1/*! For license information please see main.js.LICENSE.txt */ 2(()=>{var ze,wt,Rt,Xt,sr={5481:ze=>{"use strict";const wt=async function(){}.constructor;ze.exports=()=>wt},5220:ze=>{"use strict";const wt=async function*(){}.constructor;ze.exports=()=>wt},5677:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{l:()=>ButtonLoader});var Xt=Rt(7995);const ButtonLoader=()=>(0,Xt.h)("span",{class:"c-button-loader"})},5737:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{D:()=>ButtonRound,P:()=>ButtonRoundA});var Xt=Rt(7995),sr=Rt(5677),Dr=Rt(8118);const Lr=["children"];function ownKeys(ze,wt){var Rt=Object.keys(ze);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ButtonRound=ze=>{const wt=(ze=>_objectSpread(_objectSpread(_objectSpread({"c-button-round":!0},ze.variant&&{[`button-round--${ze.variant}`]:!0}),ze.size&&{[`button-round--${ze.size}`]:!0}),ze.classes&&{[ze.classes]:!0}))(ze),Rt=(ze=>_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({"aria-label":ze.ariaLabel},ze.attributes),ze.url&&{href:ze.url}),ze.onClick&&{onClick:ze.onClick}),ze.disabled&&{disabled:ze.disabled}),ze.hook&&{[`js-hook-${ze.hook}`]:ze.hook}),ze.loadableModal&&{"js-hook-loadable-modal":ze.loadableModal}))(ze),Lr=`${ze.element||"button"}`;return(0,Xt.h)(Lr,_objectSpread({className:wt},Rt),ze.svg&&(0,Xt.h)(Dr.Z,{name:ze.svg}),ze.children&&(0,Xt.h)("span",{class:"button-round__label"},ze.children),(ze.hasLoading||ze.loadableModal)&&(0,Xt.h)(sr.l,null))},ButtonRoundA=ze=>{let{children:wt}=ze,Rt=function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}(ze,Lr);return(0,Xt.h)(ButtonRound,_objectSpread(_objectSpread({},Rt),{},{element:"a"}),wt)}},5446:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{x:()=>ButtonSquare});var Xt=Rt(7995),sr=Rt(5677),Dr=Rt(8118);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ButtonSquare=ze=>{const wt=(ze=>_objectSpread(_objectSpread({"c-button-square":!0},ze.variant&&{[`button-square--${ze.variant}`]:!0}),ze.classes&&{[ze.classes]:!0}))(ze),Rt=(ze=>_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({"aria-label":ze.ariaLabel},ze.attributes),ze.url&&{href:ze.url}),ze.onClick&&{onClick:ze.onClick}),ze.disabled&&{disabled:ze.disabled}),ze.hook&&{[`js-hook-${ze.hook}`]:ze.hook}),ze.loadableModal&&{"js-hook-loadable-modal":ze.loadableModal}))(ze),Lr=`${ze.element||"button"}`;return(0,Xt.h)(Lr,_objectSpread({className:wt},Rt),ze.svg&&(0,Xt.h)(Dr.Z,{name:ze.svg}),ze.label&&(0,Xt.h)("span",{class:"button-square__label"},ze.label),ze.children&&(0,Xt.h)("span",{class:"button-square__label"},ze.children),(ze.hasLoading||ze.loadableModal)&&(0,Xt.h)(sr.l,null))}},1856:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{bx:()=>ButtonA,zx:()=>Button});var Xt=Rt(7995),sr=Rt(5677),Dr=Rt(8118);const Lr=["children"];function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Button=ze=>{const wt=(ze=>{const wt=ze.variant?`c-button--${ze.variant}`:"text"===ze.mode?"c-button--text":"c-button";return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({[wt]:!0},ze.icon&&{"button--icon":!0}),ze.width&&{[`button--${ze.width}`]:!0}),ze.size&&{[`button--${ze.size}`]:!0}),ze.shape&&{[`button--${ze.shape}`]:!0}),ze.classes&&{[ze.classes]:!0})})(ze),Rt=(ze=>_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({},ze.attr),{},{type:ze.type||"button"},ze.url&&{href:ze.url}),ze.onClick&&{onClick:ze.onClick}),ze.disabled&&{disabled:ze.disabled}),ze.hook&&{[`js-hook-${ze.hook}`]:ze.hook}),ze.controls&&{"aria-controls":ze.controls}),ze.loadableModal&&{"js-hook-loadable-modal":ze.loadableModal}))(ze),Lr=`${ze.element||"button"}`,Ur=null!==ze.label&&void 0!==ze.label;return(0,Xt.h)(Lr,_objectSpread({class:wt},Rt),ze.icon&&(0,Xt.h)("span",{class:"button__icon"},(0,Xt.h)(Dr.Z,{name:ze.icon})),Ur||ze.children?.length?(0,Xt.h)("span",{class:"button__label"},ze.label??"",ze.children??""):null,(ze.hasLoading||ze.loadableModal)&&(0,Xt.h)(sr.l,null))},ButtonA=ze=>{let{children:wt}=ze,Rt=_objectWithoutProperties(ze,Lr);return(0,Xt.h)(Button,_objectSpread(_objectSpread({},Rt),{},{element:"a"}),wt)}},6646:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{T:()=>setButtonLabel});const setButtonLabel=(ze,wt)=>{const Rt=ze.querySelector(".button__label");Rt&&(Rt.innerText=wt)}},8309:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{J:()=>Col});var Xt=Rt(7995);const sr=["xs","sm","md","lg","xlg"],createClasses=(ze,wt)=>wt.reduce((wt,Rt,Xt)=>(wt.push(0===Xt?`${ze}-${Rt}`:`${ze}-${Rt}--${sr[Xt]}`),wt),[]),Col=({extraClass:ze="",children:wt,cols:Rt=[],push:sr=[],pull:Dr=[],pre:Lr=[],post:Ur=[]})=>{const qr=[...createClasses("o-col",Rt),...createClasses("u-push",sr),...createClasses("u-pull",Dr),...createClasses("u-pre",Lr),...createClasses("u-post",Ur)].join(" ");return(0,Xt.h)("div",{class:`${qr} ${ze}`},wt)}},2699:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Xt});const Xt=function getComponentData(ze){const wt=ze.dataset.componentId;if(!wt)return null;const{data:Rt}=window.__BPD_APP__.find(ze=>ze.componentId===wt);return Rt}},6204:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{W:()=>Container});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Container=({extraClass:ze="",position:wt,children:Rt,attr:sr,hook:Dr})=>(0,Xt.h)("div",_objectSpread(_objectSpread({},_objectSpread({[`js-hook-${Dr||""}`]:!!Dr},sr)),{},{class:`o-container ${ze} ${wt?"container--"+wt:""}`.trim()}),Rt)},7936:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{A:()=>ContentCollapseContent});var Xt=Rt(9490);const getElementHeight=ze=>{let wt=ze.clientHeight;const Rt=window.getComputedStyle(ze),Xt=parseInt(Rt.marginTop),sr=parseInt(Rt.marginBottom);return Xt&&(wt+=Xt),sr&&(wt+=sr),wt};var sr=Rt(5940);const useMemoizedValue=ze=>(0,Xt.Bi)({onDidLoad:()=>{let wt;return()=>(wt||(wt=ze()),wt)}}),Dr="aria-expanded",Lr="aria-hidden",Ur="content-collapse--is-collapsed",ContentCollapse=({element:ze})=>{const[,wt,Rt]=(0,Xt.v9)("expanded",!1),[qr]=(0,Xt.v9)("defaultHeight","0"),[ri]=(0,Xt.v9)("name",""),[ai]=(0,Xt.v9)("gtmEvent",null),[Yi]=(0,Xt.v9)("gtmEventCategory",null),[Ji]=(0,Xt.v9)("gtmEventLabel",null),Qi=(0,Xt.zX)({eventName:`contentCollapse[${ri}]::expand`}),kn=(0,Xt.zX)({eventName:`contentCollapse[${ri}]::collapse`});let jn;const Un=useMemoizedValue(()=>{const wt=document.querySelector(`[aria-controls="${ze.id}"]`);return wt?.addEventListener("click",toggleExpanded),wt}),Wn=useMemoizedValue(()=>Un()?.querySelector("[js-hook-content-collapse-label]")),Yn=useMemoizedValue(()=>Un()?.dataset.collapsedLabel??"Meer informatie"),Jn=useMemoizedValue(()=>Un()?.dataset.expandedLabel??"Minder informatie"),toggleExpanded=()=>{wt(!ze.expanded)};function handleExpandedChanged(wt){!function setAriaAttributes(wt){Un()?.setAttribute(Dr,`${wt}`),ze.setAttribute(Lr,`${!wt}`)}(wt),function handleAnimation(){const wt=(ze=>Array.from(ze.children).reduce((ze,wt)=>ze+getElementHeight(wt),0))(ze);wt&&(jn=()=>function heightTransitionEnd(){ze.expanded&&(ze.style.height="auto",ze.classList.add(Ur));ze.removeEventListener("transitionend",jn,!1)}(),function setHeight(wt){ze.style.height=ze.expanded?qr:wt,ze.offsetHeight,ze.style.height=ze.expanded?wt:qr}(`${wt}px`),ze.addEventListener("transitionend",jn,!1))}(),wt||ze.classList.remove(Ur);const Rt=wt?Jn():Yn();wt?(Qi.emit({}),ai&&Yi&&Ji&&(0,sr.d)({event:ai,eventCategory:Yi,eventLabel:Ji})):kn.emit({});const Xt=Wn(),ri=Un();Xt?Xt.innerHTML=Rt:ri&&(ri.innerHTML=Rt)}(0,Xt.N_)(()=>{Un(),ze.expanded&&handleExpandedChanged(ze.expanded)}),Rt(ze=>{handleExpandedChanged(ze)})};ContentCollapse.props={expanded:{type:Boolean,reflectToAttr:!0},defaultHeight:{type:String},name:{type:String,reflectToAttr:!0},gtmEvent:{type:String},gtmEventCategory:{type:String},gtmEventLabel:{type:String}},(0,Xt.Nk)("bpd-content-collapse",ContentCollapse);var qr=Rt(7995);Rt(1856);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ContentCollapseContent=ze=>(0,qr.h)("bpd-content-collapse",_objectSpread({id:`${ze.name}-controls`,name:ze.name,"aria-labelledby":`${ze.name}-labelledby`,"aria-hidden":!ze.expanded},{expanded:ze.expanded}),ze.children)},7691:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>CheckboxElement});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const CheckboxElement=({validationTypes:ze,validationRegex:wt,validationErrorMessage:Rt,requiredErrorMessage:sr,value:Dr,horizontal:Lr,classes:Ur,disabled:qr,name:ri,id:ai,required:Yi,checked:Ji,hook:Qi,bpdInputHook:kn,labelHook:jn,attr:Un,label:Wn,error:Yn,srOnly:Jn,displayName:Qn,hideError:Io=!1})=>{const Mo={"c-checkbox":!0,form__item:!0,"checkbox--horizontal":Lr,"form__item--disabled":qr};return(0,Xt.h)("bpd-input",_objectSpread({"validation-types":ze,"validation-regex":wt,"validation-error-message":Rt,"required-error-message":sr,bindValue:Dr,class:Ur,displayName:Qn},{[`js-hook-${kn}`]:kn}),(0,Xt.h)("div",{class:Mo},(0,Xt.h)("div",{class:"checkbox__wrapper"},(0,Xt.h)("input",_objectSpread({class:"checkbox__input u-sr-only",type:"checkbox",name:ri,id:ai,required:Yi,disabled:qr,checked:Ji,value:Dr},_objectSpread({[`js-hook-${Qi||""}`]:!!Qi},Un))),(0,Xt.h)("label",{class:"checkbox__label",for:ai},(0,Xt.h)("span",_objectSpread({class:{"u-sr-only":Jn}},{[`js-hook-${jn}`]:jn}),Wn),(0,Xt.h)("span",{class:"checkbox__hover-helper"}),(0,Xt.h)("span",{class:"checkbox__focus-helper"}))),!Io&&(0,Xt.h)("div",{class:"form__item-error",role:"alert"},Yn)))}},5273:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{_:()=>ChipCheckbox,l:()=>ChipRadio});var Xt=Rt(7995),sr=Rt(6320);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ChipCheckbox=({validationTypes:ze,validationRegex:wt,validationErrorMessage:Rt,requiredErrorMessage:sr,value:Dr,classes:Lr,disabled:Ur,name:qr,id:ri,required:ai,checked:Yi,hook:Ji,attr:Qi,label:kn,icon:jn,error:Un,displayName:Wn,variant:Yn,hideError:Jn=!1,collapsedLabel:Qn=!1})=>{const Io={"c-chip":!0,[`chip--${Yn}`]:!!Yn,"chip--collapsed":Qn,"chip--icon":!!jn,"chip--text-only":!jn,form__item:!0,"form__item--disabled":Ur};return(0,Xt.h)("bpd-input",{"validation-types":ze,"validation-regex":wt,"validation-error-message":Rt,"required-error-message":sr,bindValue:Dr,class:Lr,displayName:Wn},(0,Xt.h)(ChipInput,{name:qr,inputClasses:Io,id:ri,required:ai,disabled:Ur,checked:Yi,value:Dr,attr:Qi,icon:jn,label:kn,hook:Ji,type:"checkbox"}),!Jn&&(0,Xt.h)("div",{class:"form__item-error",role:"alert"},Un))},ChipRadio=({validationTypes:ze,validationRegex:wt,validationErrorMessage:Rt,requiredErrorMessage:sr,value:Dr,classes:Lr,disabled:Ur,required:qr,name:ri,displayName:ai,hook:Yi,variant:Ji,options:Qi,collapsedLabel:kn})=>(0,Xt.h)("bpd-radio",_objectSpread({"validation-types":ze,"validation-regex":wt,"validation-error-message":Rt,"required-error-message":sr,bindValue:Dr,class:Lr,displayName:ai},{[`js-hook-${Yi}`]:!!Yi}),(0,Xt.h)("div",{class:"chip__radio-container"},Qi.map(ze=>{const wt={"c-chip":!0,[`chip--${Ji}`]:!!Ji,"chip--collapsed":kn,"chip--icon":!!ze.icon,"chip--text-only":!ze.icon,form__item:!0,"form__item--disabled":Ur};return(0,Xt.h)("div",{class:"chip__radio"},(0,Xt.h)(ChipInput,{name:ri,inputClasses:wt,id:ze.id,required:qr,disabled:Ur,checked:ze.checked,value:ze.value,attr:ze.attr,icon:ze.icon,label:ze.label,hook:ze.hook,type:"radio"}))}))),ChipInput=({name:ze,inputClasses:wt,id:Rt,required:Dr,disabled:Lr,checked:Ur,value:qr,attr:ri,icon:ai,label:Yi,hook:Ji,type:Qi})=>(0,Xt.h)("div",{class:wt},(0,Xt.h)("div",{class:"chip__wrapper"},(0,Xt.h)("input",_objectSpread({class:"chip__input u-sr-only",type:Qi,name:ze,id:Rt,required:Dr,disabled:Lr,checked:Ur,value:qr},_objectSpread(_objectSpread({},ri),Ji&&{[`js-hook-${Ji}`]:!0}))),(0,Xt.h)("label",{class:"chip__label",for:Rt},(0,Xt.h)("span",{class:"chip__button"},ai&&(0,Xt.h)("span",{class:"chip__icon"},(0,Xt.h)(sr.Zz,{name:ai})),!ai&&(0,Xt.h)("span",{class:"chip__title"},Yi))),ai&&(0,Xt.h)("span",{class:"chip__title"},Yi)))},6698:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{W:()=>FormElement});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const FormElement=({hook:ze,action:wt,method:Rt,attr:sr,classes:Dr,children:Lr})=>{const Ur={action:wt,method:Rt,attr:sr};return(0,Xt.h)("bpd-form",_objectSpread({},{[`js-hook-${ze}`]:!!ze}),(0,Xt.h)("form",_objectSpread({class:`c-form ${Dr||""}`},Ur),Lr))}},8182:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{X:()=>Honeypot});var Xt=Rt(7995);const Honeypot=({classes:ze,name:wt,id:Rt})=>(0,Xt.h)("div",{class:`u-sr-only ${ze}`},(0,Xt.h)("input",{id:Rt,name:wt,type:"text",autocomplete:"off",tabindex:"-1"}))},8178:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{$L:()=>
2checkbox_list_CheckboxListElement,Wg:()=>Qn.W,kO:()=>Io.k,aR:()=>RadioElement,nj:()=>jo.n,K2:()=>zo.K,Oh:()=>extendValidations,OP:()=>validateField});var Xt=Rt(9490),sr=Rt(5044);(0,Xt.Nk)("bpd-form",({element:ze})=>{(0,sr.Rd)("bpd-form { display: block }");const wt=(0,Xt.lq)("bpd-input, bpd-radio, bpd-checkbox-list"),Rt=(0,Xt.lq)("select, input, textarea"),Dr=(0,Xt.YP)("form",{as:"formInner"}),Lr=(0,Xt.zX)({eventName:"serializedForm"});function validate(ze=!0){if(!Dr)return{valid:!1};if(Dr.current?.getAttribute("novalidate"))return{valid:!0};let Rt=Dr.current?.checkValidity()||!1;return Array.from(wt.current).forEach(wt=>{wt&&wt.validate&&(Rt=!!wt.validate(ze)&&Rt)}),{valid:Rt}}function serializeForm(){const wt={},Xt={},sr=ze.querySelector("select");return[...Rt.current,sr].filter(Boolean).forEach(ze=>{const Rt="radio"===ze?.type,sr=(Rt||"checkbox"===ze?.type)&&!ze.checked,Dr=ze.name,Lr=Dr.includes("[]"),Ur=sr?"":ze.value;if(Rt)(wt[Dr]&&Ur||!wt[Dr])&&(wt[Dr]=Ur);else{if(Lr){const ze=Dr.replace("[]","");Xt[ze]||(Xt[ze]=[]),Ur&&Xt[ze].push(Ur);const Rt=Xt[ze];return void(wt[ze]=Rt.join(Rt.length>1?",":""))}wt[Dr]=Ur}}),Lr.emit(wt),wt}(0,Xt.We)("checkValidity",function checkValidity(){return!!wt.current&&[...wt.current]?.filter(ze=>!ze||!ze.valid).length>=1}),(0,Xt.We)("validate",validate),(0,Xt.We)("serializeForm",serializeForm),(0,Xt.We)("clearInputs",function clearInputs(){if(!wt.current)return;Array.from(wt.current).forEach(ze=>{ze&&ze.resetInput&&ze.resetInput()})}),(0,Xt.We)("formData",function formData(){if(Dr.current)return new FormData(Dr.current);return null}),(0,Xt.iX)(Dr,"submit",ze=>{ze&&ze.preventDefault();const{valid:wt}=validate();wt&&serializeForm()})});var Dr=Rt(3352),Lr=Rt(3748);const Ur=2147483647,qr=36,ri=/^xn--/,ai=/[\x2E\u3002\uFF0E\uFF61]/g,Yi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ji=Math.floor;String.fromCharCode;function error(ze){throw new RangeError(Yi[ze])}function mapDomain(ze,wt){const Rt=ze.split("@");let Xt="";Rt.length>1&&(Xt=Rt[0]+"@",ze=Rt[1]);const sr=function map(ze,wt){const Rt=[];let Xt=ze.length;for(;Xt--;)Rt[Xt]=wt(ze[Xt]);return Rt}((ze=ze.replace(ai,".")).split("."),wt).join(".");return Xt+sr}const basicToDigit=function(ze){return ze>=48&&ze<58?ze-48+26:ze>=65&&ze<91?ze-65:ze>=97&&ze<123?ze-97:qr},adapt=function(ze,wt,Rt){let Xt=0;for(ze=Rt?Ji(ze/700):ze>>1,ze+=Ji(ze/wt);ze>455;Xt+=qr)ze=Ji(ze/35);return Ji(Xt+36*ze/(ze+38))},decode=function(ze){const wt=[],Rt=ze.length;let Xt=0,sr=128,Dr=72,Lr=ze.lastIndexOf("-");Lr<0&&(Lr=0);for(let Rt=0;Rt<Lr;++Rt)ze.charCodeAt(Rt)>=128&&error("not-basic"),wt.push(ze.charCodeAt(Rt));for(let ri=Lr>0?Lr+1:0;ri<Rt;){const Lr=Xt;for(let wt=1,sr=qr;;sr+=qr){ri>=Rt&&error("invalid-input");const Lr=basicToDigit(ze.charCodeAt(ri++));Lr>=qr&&error("invalid-input"),Lr>Ji((Ur-Xt)/wt)&&error("overflow"),Xt+=Lr*wt;const ai=sr<=Dr?1:sr>=Dr+26?26:sr-Dr;if(Lr<ai)break;const Yi=qr-ai;wt>Ji(Ur/Yi)&&error("overflow"),wt*=Yi}const ai=wt.length+1;Dr=adapt(Xt-Lr,ai,0==Lr),Ji(Xt/ai)>Ur-sr&&error("overflow"),sr+=Ji(Xt/ai),Xt%=ai,wt.splice(Xt++,0,sr)}return String.fromCodePoint(...wt)},toUnicode=function(ze){return mapDomain(ze,function(ze){return ri.test(ze)?decode(ze.slice(4).toLowerCase()):ze})};let Qi={required:ze=>ze?void 0:(0,sr.qM)("FieldIsRequired"),email:ze=>ze&&!/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])+$/i.test(toUnicode(ze))?(0,sr.qM)("PleaseEnterValidEmailAddress"):void 0,phone:ze=>ze&&!/^[\s\-+()0-9]*(?:[\s\-+()]*[0-9]){4}[\s\-+()0-9]*$/.test(ze)?(0,sr.qM)("PleaseEnterValidPhoneNumber"):void 0,number:ze=>isNaN(Number(ze))?(0,sr.qM)("EnterValidHouseNumber"):void 0,text:ze=>ze&&!/^[^\d]+$/.test(ze)?(0,sr.qM)("PleaseEnterValidText"):void 0,fullDate:ze=>ze&&!/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test(ze)?(0,sr.qM)("PleaseEnterValidDate"):void 0,zipCode:ze=>{if(!ze)return;return((0,Lr.F)()?/\b(?!01000)(?!99999)(0[1-9]\d{3}|[1-9]\d{4})\b$/.test(ze):/^[1-9][0-9]{3} ?[a-z]{2}$/i.test(ze))?void 0:(0,sr.qM)("EnterValidPostCode")}};const validateField=(ze,wt)=>{const Rt=[];return(wt.indexOf(",")>
2-1?wt.split(","):[wt]).forEach(wt=>{const Xt=Qi[wt](ze);Xt&&Rt.push(Xt)}),Rt},extendValidations=ze=>{Qi=Object.assign({},Qi,ze)},validateCustomRegex=({value:ze,requiredErrorMessage:wt,validationErrorMessage:Rt,required:Xt,validationRegex:sr,maxLength:Dr,maxLengthErrorMessage:Lr})=>{const Ur=[];if(Xt&&!ze&&Ur.push(wt||""),Dr&&ze.length>Dr&&Ur.push(Lr||""),sr){new RegExp(sr).test(ze)||Ur.push(Rt||"")}return Ur},Input=({element:ze})=>{const[wt,Rt]=(0,Xt.v9)("bindValue",""),[,Lr]=(0,Xt.v9)("valid",!1),[,]=(0,Xt.v9)("displayName",null),[Ur]=(0,Xt.v9)("validationTypes",""),[qr]=(0,Xt.v9)("validationRegex",null),[ri]=(0,Xt.v9)("validationErrorMessage",null),[ai]=(0,Xt.v9)("requiredErrorMessage",null),[Yi]=(0,Xt.v9)("maxLength",null),[Ji]=(0,Xt.v9)("maxLengthErrorMessage",null),[Qi]=(0,Xt.v9)("hideErrors",!1),[,kn]=(0,Xt.v9)("isTouched",!1),[,jn]=(0,Xt.v9)("isFocussed",!1),Un=(0,Xt.sO)(null),Wn=(0,Xt.sO)([]),Yn=(0,Xt.sO)(""),Jn=(0,Xt.zX)({eventName:"focus"}),Qn=(0,Xt.zX)({eventName:"focusout"}),{inputs:Io,errorHolder:Mo,bindValueChanged:jo,inputValidate:zo}=(0,sr.Gl)({inputElements:"input, select, textarea",errorTarget:'[role="alert"]',inputLabelTarget:"label",onInputChange:function onInputChange(){const wt=Un.current;Rt(wt.value),ze.validate()},onInputFocus:function onInputFocus(){jn(!0),updateErrorValidState(),toggleLabelClass(!0),Jn.emit(ze)},onInputBlur:function onInputBlur(){kn(!0),jn(!1),ze.validate()},onInputInput:function onInputInput(){toggleLabelClass(!0),oa()},onInputFocusout:function onInputFocusout(){toggleLabelClass(),Qn.emit(ze)},onRebindValue,onValidate:function onValidate(wt=!0){const Rt=Un.current;if(!Rt||Rt.disabled)return!0;const Xt=function getValue(ze){const wt=Un.current;let Rt;Rt="checkbox"===wt.type?!!wt.checked:ze||"";return Rt}(Rt.value),sr=function getErrors(ze){const wt=Yi||Ur||Ur.length>0||qr||Un.current.required;let Rt=[];if(!wt)return Rt;(qr||Un.current.required||Yi)&&(Rt=validateCustomRegex({value:ze,required:Un.current.required,requiredErrorMessage:ai,validationRegex:qr,validationErrorMessage:ri,maxLength:Yi,maxLengthErrorMessage:Ji}));(Ur||Ur.length>0)&&(Rt=validateField(ze,Ur));return Rt}(Xt),Dr=0===sr.length;if(!wt)return Dr;Wn.current=sr,Lr(Dr),Yn.current=ze.valid?"":Wn.current[0],zo.emit({errorMessage:Yn.current,value:Xt,isValid:ze.valid,input:Un.current}),wt&&updateErrorValidState();return ze.valid},resetInput:function resetInput(){const wt=Un.current;if(!wt)return;"checkbox"===wt.type||"radio"===wt.type?wt.checked=!1:onRebindValue("",!1);wt.removeAttribute("invalid"),ze.removeAttribute("valid")}});(0,Xt.N_)(()=>{if(function setInput(){const ze=Io.current;if(0===ze.length)throw new Error("There is no select, input or textarea found.");Un.current=ze[0]}(),Un.current){const Rt=Un.current;wt&&(Rt.value=wt,ze.validate(),toggleLabelClass())}});const oa=(0,Dr.Ds)(()=>{ze.validate()},300);function onRebindValue(wt,Xt=!0){const sr=Un.current;sr&&(Rt(wt),sr.value=wt,Xt&&ze.validate(),jo.emit(wt),toggleLabelClass())}function updateErrorValidState(){const wt=Un.current,Rt=Mo.current;wt&&Rt&&(Wn.current.length>0&&(ze.setAttribute("invalid",""),wt.setAttribute("invalid",""),ze.removeAttribute("valid"),Qi||(Rt.innerHTML="",Rt.append(Yn.current))),ze.valid&&(ze.setAttribute("valid",""),ze.removeAttribute("invalid"),wt.removeAttribute("invalid"),Qi||(Rt.textContent="")))}function toggleLabelClass(wt=!1){const Rt=wt||Un.current.value?"add":"remove";ze.classList[Rt]("floating-label-active")}};Input.props={bindValue:{type:String},valid:{type:Boolean,reflectToAttr:!0},validationTypes:{type:String},hideErrors:{type:Boolean,reflectToAttr:!0},isTouched:{type:Boolean},isFocussed:{type:Boolean},validationRegex:{type:String},validationErrorMessage:{type:String},requiredErrorMessage:{type:String},displayName:{type:String},maxLength:{type:Number},maxLengthErrorMessage:{type:String}},(0,Xt.Nk)("bpd-input",Input);var kn=Rt(6260);const Radio=({element:ze})=>{const[,wt]=(0,Xt.v9)("bindValue",""),[,Rt]=(0,Xt.v9)("valid",!1),[,]=(0,Xt.v9)("displayName",null),[sr]=(0,Xt.v9)("validationTypes",""),[Dr]=(0,Xt.v9)("validationRegex",null),[Lr]=(0,Xt.v9)("validationErrorMessage",null),[Ur]=(0,Xt.v9)("requiredErrorMessage",null),[qr]=(0,Xt.v9)("hideErrors",!1),[,ri]=(0,Xt.v9)("isTouched",!1),[,ai]=(0,Xt.v9)("isFocussed",!1),Yi=(0,Xt.sO)(null),Ji=(0,Xt.sO)([]),Qi=(0,Xt.sO)(""),{inputs:jn,errorHolder:Un,bindValueChanged:Wn,inputValidate:Yn}=(0,kn.G)({inputElements:"input",errorTarget:'[role="alert"]',inputLabelTarget:"label",onInputChange:function onInputChange(){setInput();const Rt=Yi.current;Rt&&(wt(Rt.value),ze.validate())},onInputFocus:function onInputFocus(){ai(!0),updateErrorValidState()},onInputBlur:function onInputBlur(){ri(!0),ai(!1)},onRebindValue:function onRebindValue(Rt){const Xt=Yi.current;Xt&&(wt(Rt),Xt.checked=!0,ze.validate(),Wn.emit(Rt))},onValidate:function onValidate(wt=!0){const Xt=jn.current;if(!Xt)return!0;const qr=[...Xt].filter(ze=>ze&&ze.disabled).length>0,ri=[...Xt].filter(ze=>ze&&ze.checked).length>0;if(qr)return!0;const ai=ri;Ji.current=function getErrors(ze){const wt=sr||sr.length>0||Dr||Yi.current.required;let Rt=[];
2if(!wt)return Rt;(Dr||Yi.current.required)&&(Rt=validateCustomRegex({value:ze,required:Yi.current.required,requiredErrorMessage:Ur,validationRegex:Dr,validationErrorMessage:Lr}));(sr||sr.length>0)&&(Rt=validateField(ze,sr));return Rt}(ai);const kn=0===Ji.current.length;if(!wt)return kn;Rt(kn),Qi.current=ze.valid?"":Ji.current[0],Yn.emit({errorMessage:Qi.current,value:ai,isValid:ze.valid,input:Yi.current}),wt&&updateErrorValidState();return ze.valid}});function updateErrorValidState(){const wt=jn.current,Rt=Un.current;wt&&Rt&&(Ji.current.length>0&&(ze.setAttribute("invalid",""),[...wt].forEach(ze=>ze&&ze.setAttribute("invalid","")),ze.removeAttribute("valid"),qr||(Rt.innerHTML="",Rt.append(Qi.current))),ze.valid&&(ze.setAttribute("valid",""),ze.removeAttribute("invalid"),[...wt].forEach(ze=>ze&&ze.removeAttribute("invalid")),qr||(Rt.textContent="")))}function setInput(){const ze=jn.current;if(0===ze.length)throw new Error('There is no input[type="radio"] found.');const wt=[...ze],Rt=wt.filter(ze=>!0===ze.checked);return Rt.length>0?Yi.current=Rt[0]:wt.length>0?Yi.current=wt[0]:Yi.current=null}(0,Xt.N_)(()=>{setInput();const ze=Yi.current;wt(ze?ze.value:""),Rt(!!ze)}),(0,Xt.We)("getSelectedInput",function getSelectedInput(){const ze=Array.from(jn.current).find(ze=>!!ze?.checked);return ze}),(0,Xt.We)("setCheckedByValue",function setCheckedByValue(wt){const Rt=ze.querySelector(`input[value="${wt}"]`);Rt&&(Rt.checked=!0)})};Radio.props={bindValue:{type:String},valid:{type:Boolean,reflectToAttr:!0},validationTypes:{type:String},hideErrors:{type:Boolean,reflectToAttr:!0},isTouched:{type:Boolean},isFocussed:{type:Boolean},validationRegex:{type:String},validationErrorMessage:{type:String},requiredErrorMessage:{type:String},displayName:{type:String}},(0,Xt.Nk)("bpd-radio",Radio);const CheckboxListElement=({element:ze})=>{const[,wt]=(0,Xt.v9)("valid",!1),[Rt]=(0,Xt.v9)("requiredErrorMessage",null),[sr]=(0,Xt.v9)("required",!1),[Dr]=(0,Xt.v9)("hideErrors",!1),Lr=(0,Xt.sO)(null),Ur=(0,Xt.sO)([]),qr=(0,Xt.sO)(""),{inputs:ri,errorHolder:ai,inputValidate:Yi}=(0,kn.G)({inputElements:"input",errorTarget:'[role="alert"]',onValidate:function onValidate(){const Xt=ri.current;if(!Xt&&!sr)return!0;const Dr=[...Xt].filter(ze=>ze&&ze.disabled).length>0,ai=[...Xt].filter(ze=>ze&&ze.checked).length>0;if(Dr)return!0;const Ji=!sr||sr&&ai;Ur.current=function getErrors(ze){let wt=[];if(!sr)return wt;sr&&(wt=validateCustomRegex({value:ze,required:sr,requiredErrorMessage:Rt,validationErrorMessage:null,validationRegex:null}));return wt}(Ji);const Qi=0===Ur.current.length;return wt(Qi),qr.current=ze.valid?"":Ur.current[0],Yi.emit({errorMessage:qr.current,value:Ji,isValid:ze.valid,input:Lr.current}),updateErrorValidState(),ze.valid},onInputChange:function onInputChange(){ze.validate()}});function updateErrorValidState(){const wt=ri.current,Rt=ai.current;wt&&Rt&&(Ur.current.length>0&&(ze.setAttribute("invalid",""),[...wt].forEach(ze=>ze&&ze.setAttribute("invalid","")),ze.removeAttribute("valid"),Dr||(Rt.textContent=qr.current)),ze.valid&&(ze.setAttribute("valid",""),ze.removeAttribute("invalid"),[...wt].forEach(ze=>ze&&ze.removeAttribute("invalid")),Dr||(Rt.textContent="")))}};CheckboxListElement.props={valid:{type:Boolean,reflectToAttr:!0},required:{type:Boolean},requiredErrorMessage:{type:String},hideErrors:{type:Boolean,reflectToAttr:!0}},(0,Xt.Nk)("bpd-checkbox-list",CheckboxListElement);var jn=Rt(2117);const Un="floating-label-active",Wn="select__dropdown--is-active",Yn="select__dropdown-item--selected",Jn="select__dropdown-item--focused",Select=({element:ze})=>{const wt=(0,Xt.YP)("bpd-input"),Rt=(0,Xt.YP)("select"),sr=(0,Xt.YP)("[js-hook-select-dropdown]"),Lr=(0,Xt.lq)("[js-hook-select-item]"),[Ur]=(0,Xt.v9)("mobileEnabled",!1),[qr]=(0,Xt.v9)("disableEvents",!1),[ri]=(0,Xt.v9)("preselected",!1),ai=(0,Xt.sO)(!1),Yi=(0,Xt.sO)(null),Ji=(0,Xt.sO)(null),Qi=ze.closest("form");let kn;function openDropdown(){ai.current=!0,Yi.current?focusItem(Yi.current):Lr.current.length&&focusItem(Lr.current[0])}function closeDropdown(){ai.current=!1,focusItem(null),wt.current?.validate()}function selectItem(ze){const{value:Xt}=ze.dataset;Yi.current&&Yi.current.classList.remove(Yn),ze.classList.add(Yn),wt.current.rebindValue(`${Xt}`),Rt.current.dispatchEvent(new Event("change")),Yi.current=ze,qr||Qi?.dispatchEvent(new Event("change"))}function focusItem(ze){if([...Lr.current].forEach(ze=>ze?.classList.remove(Jn)),ze){Ji.current=ze,Ji.current.classList.add(Jn);const wt=[...Lr.current].indexOf(ze);sr.current?.scrollTo({top:42*wt,behavior:"smooth"})}}(0,Dr.O8)(ze,ze=>{ai.current&&ze&&closeDropdown()}),(0,Xt.iX)(wt,"mousedown",function onInputClick(ze){(Ur||(0,jn.P$)((0,jn.VV)("tabletLandscape")))&&(ze.preventDefault(),!ai.current&&openDropdown())}),(0,Xt.iX)(Lr,"click",function onItemClick(ze){ze.preventDefault();const wt=ze.currentTarget;wt&&selectItem(wt),closeDropdown()}),(0,Xt.iX)(ze,"keydown",function onKeyDown(ze){const hijackEvent=()=>{ze.preventDefault(),ze.stopPropagation()},updateItem=ze=>{const wt=Yi.current?.dataset.value,Xt=Rt.current?.value;if(!Xt||Xt===wt)return;const sr=[...Lr.current].find(ze=>ze?.dataset.value===Xt);sr&&("select"===ze?(selectItem(sr),sr.click()):(ai.current||openDropdown(),focusItem(sr)))};switch(ze.key){case"Enter":hijackEvent(),ai.current?(Ji.current&&Ji.current!==Yi.current&&(selectItem(Ji.current),Ji.current.click()),closeDropdown()):openDropdown();break;case"ArrowUp":case"ArrowDown":{if(hijackEvent(),!ai.current){openDropdown();break}const{previousSibling:wt,nextSibling:Rt}=Ji.current??{},Xt="ArrowUp"===ze.key?wt:Rt;if(!Xt)return;focusItem(Xt);break}case"Escape":hijackEvent(),closeDropdown();break;case"Tab":updateItem("select"),ai.current&&closeDropdown();break;
2default:kn&&clearTimeout(kn),kn=setTimeout(()=>updateItem("focus"),250)}}),(0,Xt.qo)(()=>{!function toggleDropdown(wt){const Rt=wt?"add":"remove";sr.current.classList[Rt](Wn),ze.classList[Rt](Un)}(ai.current)}),(0,Xt.N_)(()=>{setTimeout(()=>ri&&ze.classList.add(Un),100)})};Select.props={mobileEnabled:{type:Boolean,reflectToAttr:!0},disableEvents:{type:Boolean,reflectToAttr:!0},preselected:{type:Boolean,reflectToAttr:!0}},(0,Xt.Nk)("bpd-select",Select);var Qn=Rt(6698),Io=Rt(2152),Mo=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const RadioElement=({validationTypes:ze,validationRegex:wt,validationErrorMessage:Rt,requiredErrorMessage:Xt,value:sr,horizontal:Dr,disabled:Lr,classes:Ur,options:qr,label:ri,displayName:ai,required:Yi,hook:Ji,error:Qi})=>{const kn={"c-radio":!0,form__item:!0,"radio--horizontal":Dr,"form__item--disabled":Lr};return 0===qr.length?null:(0,Mo.h)("bpd-radio",_objectSpread({"validation-types":ze,"validation-regex":wt,"validation-error-message":Rt,"required-error-message":Xt,bindValue:sr,class:Ur,displayName:ai},{[`js-hook-${Ji}`]:!!Ji}),(0,Mo.h)("div",{class:kn},ri&&(0,Mo.h)("p",{class:"u-body-normal-bold u-margin-bottom-1"},ri),(0,Mo.h)("div",{class:"radio__wrapper"},qr&&qr.map(ze=>(0,Mo.h)(Mo.H,null,(0,Mo.h)("input",_objectSpread({class:"radio__input u-sr-only",type:"radio",name:ze.name,id:ze.id,required:Yi,disabled:Lr,checked:ze.checked,value:ze.value},_objectSpread({[`js-hook-${ze.hook?ze.hook:""}`]:!!ze.hook},ze.attr))),(0,Mo.h)("label",{class:"radio__label",for:ze.id},(0,Mo.h)("span",{class:"radio__hover-helper"}),ze.label,(0,Mo.h)("span",{class:"radio__focus-helper"}))))),(0,Mo.h)("div",{class:"form__item-error",role:"alert"},Qi)))},checkbox_list_CheckboxListElement=ze=>(0,Mo.h)("bpd-checkbox-list",{class:"c-checkbox-list form__item","required-error-message":ze.requiredErrorMessage,required:ze.required},(0,Mo.h)("span",{class:"form__label"},ze.title),(0,Mo.h)("div",{class:"checkbox-list__wrapper"},ze.children),(0,Mo.h)("div",{class:"form__item-error",role:"alert"}));Rt(5273);var jo=Rt(6022),zo=Rt(1865),oa=Rt(9162);const SelectCountry=({element:ze})=>{const[wt]=(0,Xt.v9)("name"),[Rt]=(0,Xt.v9)("id"),[Ur]=(0,Xt.v9)("label",(0,sr.qM)("SelectCountry")),[qr]=(0,Xt.v9)("preFilledCountry",null),ri=(0,Lr.F)()?oa.EO:oa.lT;return(0,sr.xV)({id:ri}),(0,Xt.N_)(async()=>{!async function render(Xt){const Dr=await Promise.all(Xt.filter(({englishName:ze})=>!!ze).map(async ze=>{const{id:wt,englishName:Rt}=ze;return{value:wt,label:await(0,sr.qM)(Rt)}}));ze.innerHTML="",ze.append((0,Mo.h)(jo.n,{hook:"select-country-input",name:wt,id:Rt,label:Ur,options:Dr,value:qr||ri,readonly:!!qr}))}(await(0,Dr.db)())}),(0,Mo.h)("div",null)};SelectCountry.props={name:{type:String,required:!0},id:{type:String,required:!0},label:{type:String},hook:{type:String,required:!0},preFilledCountry:{type:String,required:!1}},(0,Xt.Nk)("select-country",SelectCountry)},2152:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{k:()=>InputElement});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const InputElement=({validationTypes:ze,validationRegex:wt,validationErrorMessage:Rt,requiredErrorMessage:sr,maxLength:Dr,maxLengthErrorMessage:Lr,value:Ur,classes:qr,disabled:ri,name:ai,id:Yi,required:Ji,hook:Qi,bpdInputHook:kn,attr:jn,label:Un,error:Wn,type:Yn="text",sronly:Jn,displayName:Qn,readonly:Io})=>{const Mo={"c-input":!0,form__item:!0,"form__item--disabled":ri},jo=_objectSpread(_objectSpread({},Ur&&{bindValue:Ur}),kn&&{[`js-hook-${kn}`]:""});return(0,Xt.h)("bpd-input",_objectSpread({"validation-types":ze,"validation-regex":wt,"max-length":Dr,"validation-error-message":Rt,"required-error-message":sr,"max-length-error-message":Lr,class:qr,displayName:Qn},jo),(0,Xt.h)("div",{class:Mo},"hidden"===Yn?(0,Xt.h)("input",_objectSpread({class:"input__input",name:ai,id:Yi,required:Ji,disabled:ri,readonly:Io,value:Ur,type:Yn},_objectSpread({[`js-hook-${Qi||""}`]:!!Qi},jn))):(0,Xt.h)("div",{class:"input__wrapper"},(0,Xt.h)("label",{class:{input__label:!0,"u-sr-only":Jn},for:Yi},Un),(0,Xt.h)("input",_objectSpread({class:"input__input",name:ai,id:Yi,required:Ji,disabled:ri,readonly:Io,type:Yn,maxlength:Dr},_objectSpread({[`js-hook-${Qi||""}`]:!!Qi},jn)))),(0,Xt.h)("div",{class:"form__item-error",role:"alert"},Wn)))}},6022:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{n:()=>SelectElement});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const SelectElement=ze=>{const wt=ze.options.some(({selected:ze})=>ze),Rt=_objectSpread({"c-select":!0,form__item:!0,"floating-label-active":!0,"form__item--disabled":!!ze.disabled},ze.classes&&{[ze.classes]:!0}),sr=ze.customSelect?"bpd-select":"div";return(0,Xt.h)(sr,_objectSpread(_objectSpread({class:Rt},ze.attr),{},{preselected:wt}),(0,Xt.h)("bpd-input",_objectSpread({"validation-types":ze.validationTypes,"validation-regex":ze.validationRegex,"validation-error-message":ze.validationErrorMessage,"required-error-message":ze.requiredErrorMessage,"bind-value":ze.value},{[`js-hook-${ze.bpdInputHook||""}`]:!!ze.bpdInputHook}),(0,Xt.h)("div",{class:"select__wrapper"},(0,Xt.h)("label",{class:"select__label"+(ze.sronly?" u-sr-only":""),for:ze.id},ze.label),(0,Xt.h)("select",_objectSpread({class:"select__input",name:ze.name,id:ze.id},_objectSpread({required:ze.required,disabled:ze.disabled,readonly:ze.readonly,[`js-hook-${ze.hook||""}`]:!!ze.hook},ze.attr)),ze.options.map(ze=>(0,Xt.h)("option",_objectSpread(_objectSpread({value:ze.value},{hidden:ze.default,selected:ze.default||ze.selected}),ze.rawValue&&{"data-raw":ze.rawValue}),!ze.default&&ze.label))),(0,Xt.h)("span",{class:"focus-helper"})),ze.customSelect?(0,Xt.h)("div",{class:"select__dropdown","js-hook-select-dropdown":!0},ze.options.map(wt=>wt.default?null:(0,Xt.h)("button",_objectSpread(_objectSpread({class:"select__dropdown-item","js-hook-select-item":!0,"data-value":wt.value,"data-label":wt.label},wt.rawValue&&{"data-raw":wt.rawValue}),ze.onOptionSelect&&{onclick:()=>ze.onOptionSelect(wt)}),wt.label))):null,(0,Xt.h)("div",{class:"form__item-error",role:"alert"},ze.error)))}},1865:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{K:()=>TextareaElement});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const TextareaElement=({label:ze,id:wt,name:Rt,required:sr,value:Dr,classes:Lr,disabled:Ur,sronly:qr,attr:ri={},hook:ai,error:Yi,labelFloating:Ji=!0})=>{let Qi="c-textarea form__item";Ur&&(Qi+=" form__item--disabled"),Lr&&(Qi+=` ${Lr}`);const kn=ri||{};sr&&(kn.required=!0),Dr&&(kn["bind-value"]=Dr);const jn={"u-sr-only":qr,textarea__label:Ji,"u-body-normal-bold u-margin-bottom-1":!Ji},Un={textarea__input:!0,"u-margin-top-1":!Ji};return(0,Xt.h)("bpd-input",_objectSpread({},kn),(0,Xt.h)("div",{class:Qi},(0,Xt.h)("div",{class:"textarea__wrapper",title:ze},(0,Xt.h)("label",{class:jn,for:wt},ze),(0,Xt.h)("textarea",_objectSpread({class:Un,name:Rt,id:wt},_objectSpread({disabled:Ur,required:sr,[`js-hook-${ai||""}`]:!!ai},ri))),(0,Xt.h)("span",{class:"focus-helper"})),Yi&&(0,Xt.h)("div",{class:"form__item-error",role:"alert"},Yi)))}},7768:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{E:()=>Image});var Xt=Rt(7995),sr=Rt(5676);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Image=ze=>{const wt=!!ze.preload&&(0,sr.Z)({image:ze.image,setting:ze.preload,mode:ze.mode});return(0,Xt.h)("bpd-image",{class:`c-image ${ze.classes?ze.classes:""}`,mode:ze.mode},(0,Xt.h)("figure",_objectSpread({},{"js-hook-objectfit-container":ze.objectFit}),(0,Xt.h)("img",_objectSpread({class:ze.disableCrossFade?"":"image__default","data-image":ze.image,alt:ze.alt},{src:wt||!1,"data-settings":JSON.stringify(ze.settings),"js-hook-objectfit-img":ze.objectFit,hidden:ze.hidden}))),ze.caption&&(0,Xt.h)("figcaption",{class:"c-image__caption"},ze.caption))}},2002:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{E:()=>Xt.E});var Xt=Rt(7768)},5676:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var Xt=Rt(1408),sr=Rt(3397);const addUrlParameter=(ze,wt,Rt)=>{const Xt=ze.indexOf("?")>-1?"&":"?";return`${ze}${Xt}${wt}=${Rt}`},__WEBPACK_DEFAULT_EXPORT__=({image:ze,setting:wt,mode:Rt="crop"})=>{let Dr=ze;return Rt&&(Dr=addUrlParameter(ze,"mode",Rt)),wt.width&&(Dr=addUrlParameter(Dr,"width",wt.width)),wt.height&&(Dr=addUrlParameter(Dr,"height",wt.height)),Dr.includes("quality=")||(Dr=addUrlParameter(Dr,"quality",80)),Xt.Z.isLocal&&Dr.startsWith("/media")&&(Dr=(0,sr.S)(Dr)),Dr}},6320:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Zz:()=>Ji.Z,$L:()=>Yn.$L,Wg:()=>Yn.Wg,aR:()=>Yn.aR,u:()=>Tooltip,OP:()=>Yn.OP});var Xt=Rt(9490),sr=Rt(524),Dr=Rt(5676);const Lr=function(){const ze={srcset:!1,currentSrc:!1,sizes:!1,picture:!1},wt=new Image;return"srcset"in wt&&(ze.srcset=!0),"currentSrc"in wt&&(ze.currentSrc=!0),"sizes"in wt&&(ze.sizes=!0),"HTMLPictureElement"in window&&(ze.picture=!0),ze}();var Ur=Rt(7173);const qr="js-hook-objectfit-img";class ObjectFit{static polyfillObjectFit(ze){if("objectFit"in document.documentElement.style)return;const wt=ObjectFit.getObjectfitImages(ze);Ur.R.html.classList.add("has--object-fit-polyfill"),wt.forEach(ze=>ObjectFit.polyfillImage(ze))}static getObjectfitImages(ze){let wt=[];if(Array.isArray(ze)){wt=[...document.querySelectorAll(`[${qr}]`)]}else{if(void 0===ze.getAttribute(qr)||null===ze.getAttribute(qr))return wt;wt.push(ze)}return wt}static polyfillImage(ze){const wt=ze.closest("[js-hook-objectfit-container]");wt&&wt.setAttribute("style",`background-image: url(${ze.currentSrc});`)}}const ri="data-settings",ai="data-image",Yi=Lr.srcset||Lr.picture,BPDImage=({element:ze})=>{const[wt]=(0,Xt.v9)("mode","crop"),Rt=(0,Xt.YP)("img");function renderImage(ze){Rt.current&&(ze.classList.add("image--is-loaded"),Lr.currentSrc||(Rt.current.currentSrc=`${Rt.current.src}`),ObjectFit.polyfillObjectFit(Rt.current))}(0,Xt.N_)(()=>{sr.O.observe(ze,Xt=>Xt&&function loadImage(){if(!Rt.current)return;sr.O.unobserve(ze);const Xt=Rt.current.getAttribute(ai),Lr=Rt.current.getAttribute(ri);if(Lr){const sr=JSON.parse(Lr)||{},Ur=function generateSrc(ze,Rt){const Xt=Object.keys(Rt);let sr=Rt[Xt[0]];if(Xt.length>1){const ze=Xt.find(ze=>!!Rt[ze].src);sr=ze?Rt[ze]:{}}const Lr=(0,Dr.Z)({image:ze,setting:sr,mode:wt});return Lr}(Xt,sr),qr=function generateSrcset(ze,Rt){const Xt=Object.keys(Rt),sr=Xt.reduce((sr,Lr,Ur)=>{const qr=Rt[Lr];return`${sr} ${(0,Dr.Z)({image:ze,setting:qr,mode:wt})} ${Lr}${Ur+1===Xt.length?"":","}`},"");return sr}(Xt,sr);if(!Ur)return void renderImage(ze);Yi&&qr&&(Rt.current.srcset=qr),Rt.current.src=Ur,Rt.current.onload=()=>renderImage(ze)}else renderImage(ze)}())}),(0,Xt.gU)(()=>sr.O.unobserve(ze))};BPDImage.props={mode:{type:String}},(0,Xt.Nk)("bpd-image",BPDImage);var Ji=Rt(8118),Qi=(Rt(7936),Rt(7995)),kn=Rt(5044),jn=Rt(2503);const Un="[js-hook-content-page]",ContentFetcher=()=>{const[,ze]=(0,Xt.v9)("hasActiveModal",!1),[wt,Rt]=(0,Xt.v9)("cachedModal",{}),[sr,Dr]=(0,Xt.v9)("modalId",""),Lr=(0,Xt.YP)("a");(0,kn.Rd)("content-fetcher {display: block;}"),(0,Xt.iX)(Lr,"click",Xt=>{Xt.preventDefault();const{href:Lr}=Xt.currentTarget;Dr(Lr),function fetchContent(Xt){wt?wt.active=!0:fetch(Xt).then(ze=>ze.text()).then(ze=>async function createModal(ze){const wt=function stringToHTML(ze){const wt=document.createElement("div");return ze=ze.trim(),wt.innerHTML=ze,wt}(ze).querySelector(Un);if(!wt)return;const Xt=function renderModal(ze){return(0,Qi.h)(jn.A,{id:sr,active:!0},ze)}(wt);Rt(Xt),Ur.R.body.appendChild(Xt)}(ze)).catch(()=>ze(!1))}(Lr)})};ContentFetcher.props={hasActiveModal:{type:Boolean},cachedModal:{type:Object},modalId:{type:String}},(0,Xt.Nk)("content-fetcher",ContentFetcher);var Wn=Rt(8318);const Social=()=>{const[ze]=(0,Xt.v9)("type","email"),[wt]=(0,Xt.v9)("emailBody",""),[Rt]=(0,Xt.v9)("emailSubject",""),[sr]=(0,Xt.v9)("image","");(0,kn.Rd)(Wn.Z);const Dr=(0,Xt.YP)("[js-hook-social-button]");function openDialogue(ze){window.open(encodeURI(ze),"Share","height=500,width=700")}return(0,Xt.iX)(Dr,"click",()=>{switch(ze){case"pinterest":!function openPinterest(){openDialogue(`http://pinterest.com/pin/create/button/?url=${window.location.href}&media=${sr}`)}();break;case"twitter":!function openTwitter(){openDialogue(`https://twitter.com/intent/tweet?text=${window.location.href}`)}();break;case"facebook":!function openFacebook(){openDialogue(`https://www.facebook.com/sharer/sharer.php?u=${window.location.href}`)}();break;case"linkedIn":!function openLinkedIn(){openDialogue(`https://www.linkedin.com/shareArticle?url=${window.location.href}`)}();break;case"whatsapp":!function openWhatsapp(){openDialogue(`https://web.whatsapp.com/se
2nd?text=${encodeURI(window.location.href)}`)}();break;case"email":!function openEmail(){window.location.href=`mailto:?subject=${Rt}&body=${wt}`}()}}),(0,Qi.h)("button",{class:"c-social","js-hook-social-button":!0},(0,Qi.h)("slot",null))};Social.props={type:{type:String},emailBody:{type:String},emailSubject:{type:String},image:{type:String}},(0,Xt.Nk)("bpd-social",Social,{useShadowDom:!0});Rt(436);var Yn=Rt(8178),Jn=Rt(3352);const Qn="tooltip__item--top-fallback",Io=16,repositionTooltip=ze=>{ze.style.removeProperty("left"),ze.style.removeProperty("--caret-offset"),ze.classList.remove(Qn);const wt=ze.getBoundingClientRect(),Rt=document.documentElement.clientWidth,Xt=ze.classList.contains("tooltip__item--left"),sr=ze.classList.contains("tooltip__item--right");(Xt&&wt.left<Io||sr&&wt.right>Rt-Io)&&ze.classList.add(Qn);const Dr=ze.getBoundingClientRect();let Lr=0;Dr.left<Io?(Lr=Io-Dr.left,ze.style.left=`${ze.offsetLeft+Lr}px`):Dr.right>Rt-Io&&(Lr=-(Dr.right-(Rt-Io)),ze.style.left=`${ze.offsetLeft+Lr}px`),0!==Lr&&ze.style.setProperty("--caret-offset",-Lr+"px")};(0,Xt.Nk)("bpd-tooltip",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-tooltip-icon]"),Rt=(0,Xt.YP)(".tooltip__item");(0,Xt.iX)(wt,"click",()=>{ze.classList.toggle("tooltip--visible"),Rt.current&&repositionTooltip(Rt.current)}),(0,Xt.iX)(wt,"mouseenter",()=>{Rt.current&&repositionTooltip(Rt.current)}),(0,Xt.iX)(wt,"mouseleave",()=>{Rt.current&&repositionTooltip(Rt.current)}),(0,Xt.N_)(()=>{Rt.current&&repositionTooltip(Rt.current);const ze=(0,Jn.TE)(()=>{Rt.current&&repositionTooltip(Rt.current)});window.addEventListener("resize",ze)})});const Tooltip=({classes:ze,icon:wt="icons-information",text:Rt,variant:Xt,direction:sr="top"})=>(0,Qi.h)("bpd-tooltip",{class:`c-tooltip ${ze||""} ${Xt?`tooltip--${Xt}`:""}`},(0,Qi.h)("button",{class:"tooltip__icon","js-hook-tooltip-icon":!0},(0,Qi.h)(Ji.Z,{name:wt}),(0,Qi.h)("div",{class:`tooltip__item tooltip__item--${sr}`},(0,Qi.h)("div",{class:"tooltip__content"},Rt))));Rt(6337);(0,Xt.Nk)("bpd-loader",()=>(0,Qi.h)("div",{class:"c-loader"},(0,Qi.h)("div",{class:"loader__ball"}),(0,Qi.h)("div",{class:"loader__ball"}),(0,Qi.h)("div",{class:"loader__ball"})));var Mo=Rt(6346);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const BPDBackLink=()=>{const[ze]=(0,Xt.v9)("text",""),[wt]=(0,Xt.v9)("url",""),[Rt]=(0,Xt.v9)("backToHousingOverview",null);const sr=wt?"a":"button",Dr=wt?{href:wt}:{onClick:Rt?function goToHousingOverview(){const{referrer:ze}=document,{areaHouseOverviewUrl:wt}=window.__ENVIRONMENT_DETAILS__;!function isHousingOverviewUrl(ze){const{pathname:wt}=new URL(ze),{areaHouseOverviewUrl:Rt,districtHouseOverviewUrl:Xt}=window.__ENVIRONMENT_DETAILS__,sr=Object.values(Xt),Dr=[Rt,...sr];return!!Dr.find(ze=>wt===ze)}(ze)?window.location.href=`${window.location.origin}${wt}`:window.location.href=ze}:function goBack(){window.history.back()}};return(0,Qi.h)(Mo.W2,{extraClass:"c-back-link"},(0,Qi.h)(sr,function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({class:"back-link__button u-flex u-flex-middle"},Dr),(0,Qi.h)("div",{class:"back-link__icon"},(0,Qi.h)(Ji.Z,{name:"arrow-chevron-right"})),(0,Qi.h)("div",{class:"back-link__label u-chip"},ze)))};BPDBackLink.props={text:{type:String},url:{type:String},backToHousingOverview:{type:Boolean}},(0,Xt.Nk)("bpd-back-link",BPDBackLink);var jo=Rt(1856),zo=Rt(474),oa=Rt(7655),la=Rt(5696),ca=Rt(5940),ua=Rt(6910);const ProfileDropdown=()=>{(0,kn.Rd)(ua.Z);const[ze]=(0,Xt.v9)("useMehNavigation",!1),[wt]=(0,Xt.v9)("hasUserAreas",!1),[Rt]=(0,Xt.v9)("email",""),[sr]=(0,Xt.v9)("fullName",""),[Dr]=(0,Xt.v9)("mijnHomeUrl",""),[Lr]=(0,Xt.v9)("mijnAccountUrl",""),[Ur]=(0,Xt.v9)("accountNavigationLinks",""),qr=JSON.parse(Ur),handleGtm=ze=>{(0,ca.d)({event:"menuUsed",eventCategory:"Menu",eventAction:"Navigatie gebruikt",eventLabel:ze.eventLabel})};return ze?(0,Qi.h)("div",{class:"c-profile-dropdown"},(0,Qi.h)("div",{class:"profile-dropdown__inner"},(0,Qi.h)("div",{class:"profile-dropdown__account-info"},(0,Qi.h)("span",{class:"u-body-normal-bold u-color--grey-50"},sr),(0,Qi.h)("span",{class:"u-body-normal u-color--grey-30"},Rt),(0,Qi.h)(jo.bx,{classes:"profile-dropdown__cta u-margin-top-1",label:(0,kn.qM)("Settings"),url:Lr,size:"small",onClick:()=>handleGtm({eventLabel:"settings"})})),(0,Qi.h)("ul",{class:"profile-dropdown__list"},qr.map(({url:ze,label:wt,gtmLabel:Rt})=>(0,Qi.h)("li",{class:"profile-dropdown__list-item"},(0,Qi.h)("a",{href:ze,onClick:()=>handleGtm({eventLabel:Rt})},(0,Qi.h)("span",{class:"u-body-normal u-color--grey-50"},wt))))),(0,Qi.h)("div",{class:"profile-dropdown__actions-bar u-color--grey-50"},wt?(0,Qi.h)(jo.zx,{classes:"profile-dropdown__cta",label:(0,kn.qM)("ToOtherWebsite"),variant:"grey-5",size:"small",onClick:()=>{handleGtm({eventLabel:"to other website"}),(0,oa.h7)(zo.a7)}}):null,(0,Qi.h)(jo.zx,{classes:"profile-dropdown__cta",label:(0,kn.qM)("LogOut"),variant:"grey-5",size:"small",onClick:()=>{handleGtm({eventLabel:"logout"}),(0,la.kS)()}})))):(0,Qi.h)("ul",{class:"bpd-profile-dropdown__list"},(0,Qi.h)("li",{class:"bpd-profile-dropdown__list-item"},(0,Qi.h)("a",{href:Dr,class:"bpd-profile-dropdown__list-link"},(0,kn.qM)("My")," ",window.__ENVIRONMENT_DETAILS__.areaProjectName)),(0,Qi.h)("li",{class:"bpd-profile-dropdown__list-item"},(0,Qi.h)("a",{href:Lr,class:"bpd-profile-dropdown__list-link"}
2,(0,Qi.h)("span",{class:"bpd-profile-dropdown__name"},sr),(0,Qi.h)("span",{class:"bpd-profile-dropdown__email"},Rt))),(0,Qi.h)("li",{class:"bpd-profile-dropdown__list-item bpd-profile-dropdown__list-actions"},(0,Qi.h)("a",{href:Lr,class:"bpd-profile-dropdown__list-link"},(0,Qi.h)(Ji.Z,{name:"icons-filter"}),(0,Qi.h)("span",null,(0,kn.qM)("Account"))),(0,Qi.h)("button",{class:"bpd-profile-dropdown__list-link",onClick:la.kS},(0,kn.qM)("LogOut"))))};ProfileDropdown.props={useMehNavigation:{type:Boolean},hasUserAreas:{type:Boolean},email:{type:String},fullName:{type:String},mijnHomeUrl:{type:String},mijnAccountUrl:{type:String},accountNavigationLinks:{type:String},sitePickerOpen:{type:String}},(0,Xt.Nk)("bpd-profile-dropdown",ProfileDropdown);const ha="[js-hook-chat-bubble-hide]",pa="chat-bubble--show",_a="bpd-map-switch, bpd-map, bpd-krpano";(0,Xt.Nk)("chat-bubble",({element:ze})=>{const wt=[];function addElement(ze){const Rt={node:ze,inView:!1};wt.push(Rt),function observeElement(ze){sr.O.observe(ze.node,wt=>{ze.inView=wt,updateVisibility()},{rootMargin:"-80% 0px 0px 0px"})}(Rt)}function updateVisibility(){!!wt.find(({inView:ze})=>!!ze)?ze.classList.remove(pa):ze.classList.add(pa)}(0,Xt.N_)(()=>{!function getElements(){const ze=Array.from(document.querySelectorAll(_a)),wt=Array.from(document.querySelectorAll(ha));[...ze,...wt].map(addElement)}(),updateVisibility()}),(0,Xt.We)("addElement",addElement)});const wa="u-hidden",ModalCloseConfirmationPopup=({element:ze})=>{const[wt]=(0,Xt.v9)("modalId"),[Rt]=(0,Xt.v9)("onConfirm"),[sr]=(0,Xt.v9)("onDismiss"),[Dr]=(0,Xt.v9)("title",null),[Lr]=(0,Xt.v9)("description",null),[Ur]=(0,Xt.v9)("confirmButtonText",null),[qr]=(0,Xt.v9)("dismissButtonText",null),ri=(0,Xt.YP)("[js-hook-modal-close-confirmation-popup]");return(0,Xt.YP)("[js-hook-modal-close-confirmation-popup-title]",{as:"titleElement"}),(0,Xt.YP)("[js-hook-modal-close-confirmation-popup-description]",{as:"descriptionElement"}),(0,Xt.YP)("[js-hook-modal-close-confirmation-popup-confirm-cta]",{as:"confirmCta"}),(0,Xt.YP)("[js-hook-modal-close-confirmation-popup-dismiss-cta]",{as:"dismissCta"}),(0,Xt.We)("setData",wt=>{wt.title&&(ze.titleElement.innerHTML=wt.title),wt.description&&(ze.descriptionElement.innerHTML=wt.description),wt.confirmButtonText&&(ze.confirmCta.innerHTML=wt.confirmButtonText),wt.dismissButtonText&&(ze.dismissCta.innerHTML=wt.dismissButtonText)}),oa.C8.subscribe(({modals:{[wt]:ze}})=>{ze&&(ze.closeRequest?ri.current?.classList.remove(wa):ri.current?.classList.add(wa),ze.active||ri.current?.classList.add(wa))},["modals"]),(0,Qi.h)("div",{class:"c-modal-close-confirmation-popup u-hidden","js-hook-modal-close-confirmation-popup":!0},(0,Qi.h)("p",{class:"u-body-large-bold","js-hook-modal-close-confirmation-popup-title":!0},Dr),(0,Qi.h)("p",{"js-hook-modal-close-confirmation-popup-description":!0},Lr),(0,Qi.h)("div",{class:"modal-close-confirmation-popup__link-container"},(0,Qi.h)("button",{class:"u-content-link",onClick:sr,"js-hook-modal-close-confirmation-popup-dismiss-cta":!0},qr),(0,Qi.h)("button",{class:"u-content-link",onClick:Rt,"js-hook-modal-close-confirmation-popup-confirm-cta":!0},Ur)))};ModalCloseConfirmationPopup.props={modalId:{type:String,required:!0},onConfirm:{type:Function,required:!0},onDismiss:{type:Function,required:!0},title:{type:Text},description:{type:Text,reflectToAttr:!0},confirmButtonText:{type:Text},dismissButtonText:{type:Text}},(0,Xt.Nk)("modal-close-confirmation-popup",ModalCloseConfirmationPopup)},436:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{wt:()=>Ur});var Xt=Rt(9490),sr=Rt(524),Dr=Rt(5044),Lr=Rt(1072);const Ur="is--in-view",qr="js-hook-inview-item",InviewContainer=({element:ze})=>{let wt;const Rt=(0,Xt.zX)({eventName:"change"}),ri=(0,Xt.YP)("inview-indicator");(0,Dr.Rd)(Lr.Z),(0,Xt.N_)(async()=>{!function initObservers(){const{root:Xt,threshold:Dr,rootDisabled:Lr}=ze.dataset;wt=ze.querySelectorAll(`[${ze.dataset.inviewHook||qr}]`);const ai=Xt?document.querySelector(Xt):ze,Yi={threshold:Dr?parseInt(Dr):.95,root:Lr?null:ai};if(!wt)return;Array.from(wt).forEach(ze=>{ze&&sr.O.observe(ze,(ze,Xt)=>function setActiveElement(ze,Xt){const{target:sr}=Xt,Dr=ze?"add":"remove";sr.classList[Dr](Ur),ri.current&&ze&&(ri.current.activeItem=Array.from(wt||[]).indexOf(function getLastInviewElement(){const ze=Array.from(wt||[]).filter(ze=>ze&&ze.classList.contains(Ur));return ze.length>0?ze[ze.length-1]:ze[0]}()));Rt.emit({intersection:Xt,target:sr,inView:ze,elements:wt})}(ze,Xt),Yi)})}(),await async function initInviewIndicator(){const ze=ri.current;if(!ze)return;ze.connected||await ze.componentOnReady();ze.amount=wt?.length||0}()}),(0,Xt.gU)(()=>{wt&&Array.from(wt).forEach(ze=>{sr.O.unobserve(ze)})})};InviewContainer.props={elements:{type:Array}},(0,Xt.Nk)("inview-container",InviewContainer);var ri=Rt(7995),ai=Rt(4539);const Yi="inview-indicators__item--is-active",InviewIndicator=({update:ze})=>{const[wt,,Rt]=(0,Xt.v9)("amount",0),[sr,,Lr]=(0,Xt.v9)("activeItem",0),Ur=(0,Xt.lq)("[js-hook-inview-indicator]");return(0,Dr.Rd)(ai.Z),Rt(()=>{ze()}),Lr(ze=>{Ur.current&&Array.from(Ur.current).forEach((wt,Rt)=>{const Xt=ze===Rt?"add":"remove";wt&&wt.classList[Xt](Yi)})}),(0,ri.h)(ri.H,null,[...new Array(wt)].map((ze,wt)=>(0,ri.h)("span",{class:`inview-indicators__item ${sr===wt?Yi:""} `,"js-hook-inview-indicator":!0})))};InviewIndicator.props={amount:{type:Number,reflectToAttr:!0},activeItem:{type:Number,reflectToAttr:!0}},(0,Xt.Nk)("inview-indicator",InviewIndicator,{useShadowDom:!0})},2503:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{A:()=>ModalWrapper});var Xt=Rt(7995),sr=Rt(5737),Dr=Rt(7655),Lr=Rt(5044);const ModalWrapper=({id:ze,active:wt,title:Rt="",noPadding:Ur,children:qr,classes:ri,hasConfirmationPopup:ai,onClose:Y
2i})=>(0,Xt.h)("bpd-modal",{id:ze,active:wt,"has-confirmation-popup":ai,onModalClose:Yi},(0,Xt.h)("div",{class:`c-modal-wrapper ${ri||""}`.trim()},(0,Xt.h)(sr.D,{ariaLabel:"Modal button",svg:"icons-close",variant:"grey-5",size:"small",classes:"modal-wrapper__button",hook:"modal-trigger",attributes:{"aria-controls":ze,"data-modal-action":ai?"closeConfirmation":"close"}}),ai&&(0,Xt.h)("modal-close-confirmation-popup",{modalId:ze,title:(0,Lr.qM)("ModalCloseConfirmationPopupTitle"),description:(0,Lr.qM)("ModalCloseConfirmationPopupDescription"),confirmButtonText:(0,Lr.qM)("ModalCloseConfirmationPopupConfirmLinkText"),closeButtonText:(0,Lr.qM)("ModalCloseConfirmationPopupLinkText"),onConfirm:()=>(0,Dr.Mr)(ze),onDismiss:()=>(0,Dr.pI)(ze)}),(0,Xt.h)("div",{class:"modal-wrapper__content"+(Ur?" no--padding":""),"js-hook-modal-wrapper-content":!0},!!Rt&&(0,Xt.h)("h2",{class:"u-title-underlined"},Rt),qr)))},6337:(ze,wt,Rt)=>{"use strict";var Xt=Rt(9490);function transitionHiddenElement({element:ze,visibleClass:wt,waitMode:Rt="transitionend",timeoutDuration:Xt,hideMode:sr="hidden",displayValue:Dr="block"}){if("timeout"===Rt&&"number"!=typeof Xt)return void console.error("\n When calling transitionHiddenElement with waitMode set to timeout,\n you must pass in a number for timeoutDuration.\n ");window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(Rt="immediate");const listener=wt=>{wt.target===ze&&(applyHiddenAttributes(),ze.removeEventListener("transitionend",listener))},applyHiddenAttributes=()=>{"display"===sr?ze.style.display="none":ze.setAttribute("hidden","")};return{show(){ze.removeEventListener("transitionend",listener),this.timeout&&clearTimeout(this.timeout),"display"===sr?ze.style.display=Dr:ze.removeAttribute("hidden"),ze.offsetHeight,ze.classList.add(wt)},hide(){"transitionend"===Rt?ze.addEventListener("transitionend",listener):"timeout"===Rt?this.timeout=setTimeout(()=>{applyHiddenAttributes()},Xt):applyHiddenAttributes(),ze.classList.remove(wt)},toggle(){this.isHidden()?this.show():this.hide()},isHidden(){const Rt=null!==ze.getAttribute("hidden"),Xt="none"===ze.style.display,sr=[...ze.classList].includes(wt);return Rt||Xt||!sr},timeout:null}}const Pages=({element:ze})=>{const[wt,Rt]=(0,Xt.v9)("selected",0),[sr]=(0,Xt.v9)("attrForSelected",null),[Dr]=(0,Xt.v9)("animated",!1),[Lr]=(0,Xt.v9)("selector","div"),[Ur]=(0,Xt.v9)("selectedClass","page--is-selected"),qr=(0,Xt.sO)(),ri=(0,Xt.sO)(0),ai=(0,Xt.sO)(null),Yi=(0,Xt.sO)([]),Ji=(0,Xt.sO)([]);function setPage(ze){Ji.current&&Ji.current.length&&(ri.current=function valueToIndex(ze){if(!sr||!Ji.current)return Number(ze);for(let wt=0;wt<Ji.current.length;wt++)if(getValue(Ji.current[wt])===ze)return wt;return 0}(`${ze}`),Rt(function indexToValue(ze){let wt;return sr?(wt=Ji.current[ze],wt?Number(getValue(wt)):0):ze}(Number(ze))),Dr?function setAnimatedPage(){Yi.current.length>0&&("number"==typeof ai.current&&Yi.current[ai.current].hide(),Yi.current[ri.current].show(),ai.current=ri.current)}():function setNormalPage(){qr.current&&qr.current.classList.remove(`${Ur}`);Ji.current[ri.current].classList.add(`${Ur}`),qr.current=Ji.current[ri.current]}())}function getPages(){const wt=ze.querySelectorAll(`${Lr}`);return Array.from(wt)}function getValue(ze){return sr?ze.getAttribute(sr):""}(0,Xt.N_)(()=>{Ji.current=getPages(),Dr&&function initAnimatedPages(){(Array.from(Ji.current)||[]).forEach(ze=>{const wt=transitionHiddenElement({element:ze,visibleClass:Ur});Yi.current=[...Yi.current,wt]})}(),setPage(`${wt}`)}),(0,Xt.We)("selectNext",function selectNext(){const ze=ri.current;ze+1>=Ji.current.length?setPage("0"):setPage(`${ze+1}`)}),(0,Xt.We)("selectPrev",function selectPrev(){const ze=ri.current;setPage(ze-1<0?""+(Ji.current.length-1):""+(ze-1))}),(0,Xt.We)("setPage",setPage),(0,Xt.We)("setPages",()=>Ji.current=getPages())};Pages.props={selected:{type:Number,reflectToAttr:!0},animated:{type:Boolean,reflectToAttr:!0},selector:{type:String,reflectToAttr:!0},selectedClass:{type:String,reflectToAttr:!0},attrForSelected:{type:String,reflectToAttr:!0}},(0,Xt.Nk)("bpd-pages",Pages)},5893:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{D:()=>Pill});var Xt=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Pill=({element:ze="span",size:wt,text:Rt,color:sr,classes:Dr,children:Lr})=>{const Ur=ze,qr=function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({"c-pill":!0,[`pill--${wt??"regular"}`]:!0,[`pill--${sr??"blue"}`]:!0},Dr&&{[Dr]:!0});return(0,Xt.h)(Ur,{class:qr},Rt,Lr)}},9227:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{X:()=>Row,Y:()=>SingleColumnRow});var Xt=Rt(7995),sr=Rt(8309);const Row=({extraClass:ze="",children:wt})=>(0,Xt.h)("div",{class:`o-grid ${ze}`},wt),SingleColumnRow=({extraClass:ze="",cols:wt,children:Rt})=>(0,Xt.h)(Row,{extraClass:ze},(0,Xt.h)(sr.J,{cols:wt},Rt))},8118:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>BPDFunctionalSvg});var Xt=Rt(9490),sr=Rt(7995);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const BPDSvg=()=>{const[ze]=(0,Xt.v9)("name","");return(0,sr.h)("svg",{class:`svg svg-${ze}`},(0,sr.h)("use",{xlinkHref:`#svg-${ze}`}))};BPDSvg.props={name:{type:String}},(0,Xt.Nk)("bpd-svg",BPDSvg);const BPDFunctionalSvg=({name:ze,attr:wt={}})=>(0,sr.h)("svg",function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({class:`svg svg-${ze}`},wt),(0,sr.h)("use",{xlinkHref:`#svg-${ze}`}))},3899:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{U:()=>Callout});var Xt=Rt(7995),sr=Rt(8309),Dr=Rt(6204),Lr=Rt(9227);const Callout=({title:ze,titleElement:wt,subtitle:Rt,classes:Ur,children:qr})=>{const ri=wt||"h2";return(0,Xt.h)(Dr.W,{extraClass:Ur},(0,Xt.h)(Lr.X,null,(0,Xt.h)(sr.J,{cols:[12,,10,8],pre:[,,1,2]},(0,Xt.h)("div",{class:"c-callout"},(0,Xt.h)("div",{class:"callout__content"},(0,Xt.h)(ri,{class:"u-body-large-bold u-margin-bottom-1","js-hook-callout-title":!0},ze),(0,Xt.h)("p",{class:"u-body-normal","js-hook-callout-subtitle":!0},Rt)),(0,Xt.h)("div",{class:"callout__cta"},qr)))))}},1269:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{p:()=>Flyin});var Xt=Rt(9490),sr=Rt(2741);const BPDFlyInPanel=({element:ze})=>{const[,wt]=(0,Xt.v9)("active",!1);(0,Xt.N_)(()=>{ze.id&&(0,sr.MY)(ze.id),sr.OJ.subscribe(({flyins:Rt})=>{const{active:Xt}=Rt[ze.id];wt(Xt)})})};BPDFlyInPanel.props={active:{type:Boolean,reflectToAttr:!0}},(0,Xt.Nk)("bpd-fly-in-panel",BPDFlyInPanel);var Dr=Rt(7995),Lr=Rt(1856),Ur=Rt(5737);const Flyin=ze=>(0,Dr.h)("bpd-fly-in-panel",{id:ze.id,class:"c-fly-in"},(0,Dr.h)("div",{class:"fly-in__header"},ze.label&&(0,Dr.h)("h5",null,ze.label),(0,Dr.h)(Ur.D,{classes:"fly-in__close-button",variant:"dark",size:"small",svg:"icons-close",ariaLabel:"Sluit flyin panel",onClick:()=>{ze.onClose&&ze.onClose(),(0,sr.xi)(ze.id)}})),(0,Dr.h)("div",{class:"fly-in__scroll-container"},ze.children),ze.buttonLabel&&ze.buttonLink&&(0,Dr.h)(Lr.bx,{label:ze.buttonLabel,url:ze.buttonLink,classes:"fly-in__link"}))},8167:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Jj:()=>yu.J});var Xt=Rt(9490),sr=Rt(7173);(0,Xt.Nk)("bpd-areas-navigation",()=>{const ze=(0,Xt.YP)("[js-hook-areas-trigger]",{root:document}),wt=(0,Xt.YP)("[js-hook-areas-navigation-close]");let Rt=!1,Dr=!1;const toggleAreas=ze=>{void 0===ze&&(ze=!Rt),Rt=ze,sr.R.body.classList.toggle("header--areas-is-active",Rt)};(0,Xt.iX)(ze,"click",()=>toggleAreas()),(0,Xt.iX)(wt,"click",()=>toggleAreas(!1)),(0,Xt.iX)(window,"scroll",()=>{Rt&&window.scrollY>100&&(Dr=!0,toggleAreas(!1)),Dr&&0==window.scrollY&&(Dr=!1,toggleAreas(!0))})});var Dr=Rt(7995),Lr=Rt(1856),Ur=Rt(899),qr=Rt(6206),ri=Rt(8248),ai=Rt(5044),Yi=Rt(6389);function ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Ji="AreaSubscription.Trigger.SubscribeToArea",Qi={notSubscribedToArea:Ji,userNotSubscribedToArea:Ji,notSubscribedToAreaNoProjectsAvailable:Ji,userNotSubscribedToAreaNoProjectsAvailable:Ji,subscribedToAreaNotSubscribedToProjects:"AreaSubscription.Trigger.AreaSubscribed.SubscribeToProjects",subscribedToAreaSubscribedToSomeProjects:"AreaSubscription.Trigger.AreaSubscribed.SubscribeToMoreProjects"},kn={width:"full-width-mobile"},AreaSubscriptionCta=({element:ze})=>{const[wt]=(0,Xt.v9)("hook",null),[Rt]=(0,Xt.v9)("defaultLabel",null),[sr]=(0,Xt.v9)("projectPhaseIds",null),[Ji]=(0,Xt.v9)("source","content"),jn=(0,Yi.a)();let Un,Wn,Yn=!1,Jn=_objectSpread({},kn);if(ze.dataset.button){const wt=JSON.parse(ze.dataset.button);Jn=_objectSpread(_objectSpread({},Jn),wt)}(0,Xt.N_)(async()=>{if(sr?.length){const ze=await(0,ai.KP)();Wn=ze.projectPhases,Wn=Wn.filter(({id:ze})=>sr.includes(ze)),Yn=!Wn.some(qr.z6)}await jn.load(),await render()}),Ur.MH.subscribe(render,["status"]);const isAlreadySubscribed=()=>Yn?(0,ri.QS)():!!sr?.length&&sr.every(ri.wz);async function handleButtonClick(){await(jn.element.current?.openInitialized({source:Ji,selectedProjectPhases:sr,areaOnly:Yn}))}async function render(){let Xt;const{status:sr}=Ur.MH.getState(),qr=sr&&Qi[sr];if(wt){if(Un=ze.querySelector(`[js-hook-${wt}]`),!Un)return;Un.removeEventListener("click",handleButtonClick),Un.addEventListener("click",handleButtonClick);const renderEmptyState=()=>{ze.innerHTML="",ze.append((0,Dr.h)("span",{class:"u-inline-block u-margin-left-1 u-color--grey-50"},Xt))};return void(isAlreadySubscribed()&&(Xt=await(0,ai.WU)("cta_SubscribedToProjectPhase"),renderEmptyState()))}if(ze.innerHTML="",isAlreadySubscribed())removeCalloutParent();else{switch(sr){case void 0:if(!Rt)return;Xt=Rt;break;case"notSubscribedToArea":case"userNotSubscribedToArea":case"notSubscribedToAreaNoProjectsAvailable":case"userNotSubscribedToAreaNoProjectsAvailable":if(Rt)Xt=Rt;else{if(!qr)return;Xt=await(0,ai.WU)(qr)}break;case"subscribedToAreaNoProjectsAvailable":case"subscribedToAreaSubscribedToAllProjects":return void removeCalloutParent();default:if(!qr)return;Xt=await(0,ai.WU)(qr)}ze.append((0,Dr.h)(Lr.zx,_objectSpread(_objectSpread({},Jn),{},{label:Xt,onClick:handleButtonClick})))}}function removeCalloutParent(){const wt=ze.closest("[js-hook-subscription-callout]");wt&&setTimeout(()=>{wt.outerHTML=""},50)}return wt?(0,Dr.h)(Dr.H,null):(0,Dr.h)(Lr.zx,_objectSpread(_objectSpread({},Jn),{},{label:Rt,hasLoading:!0,classes:"area-subscription-cta--loader is-loading"}))};AreaSubscriptionCta.props={defaultLabel:{type:String,reflectToAttr:!0},hook:{type:String,reflectToAttr:!0},projectPhaseIds:{type:Object,reflectToAttr:!0},source:{type:String,reflectToAttr:!0}},(0,Xt.Nk)("area-subscription-cta",AreaSubscriptionCta);var jn=Rt(8178),Un=Rt(6022),Wn=Rt(3352),Yn=Rt(7691),Jn=Rt(5696),Qn=Rt(741),Io=Rt(1408),Mo=Rt(2847),jo=Rt(7072);const getConstructionNumberIds=()=>{switch(window.__ENVIRONMENT_DETAILS__.areaId){case"a0i2X00000D6143QAB":return["a083O0000000kDoQAI","a083O0000000kEmQAI","a083O0000000kEHQAY","a083O0000000kDwQAI","a083O0000000kEFQAY","a083O0000000kDeQAI","a083O0000001V6JQAU","a083O000001FaG0QAK","a082X00001BuqrmQAB","a083O0000000kIXQAY","a083O0000000kISQAY","a083O0000000kITQAY","a083O0000000kIOQAY"];case"a0i3O000002cuSzQAI":return["a083O000003qMauQAE","a083O000003qMYuQAM","a083O0000045ZIBQA2","a083O000003qMYfQAM","a083O000003qMY6QAM"];case"a0iw0000008QvIVAA0":return["a08QB00000QUuDuYAL","a08QB00000QUuDyYAL","a08QB00000QUuDzYAL","a08QB00000QUuE3YAL","a08QB00000QVOOrYAP","a08QB00000QVOOsYAP","a08QB00000QVIzTYAX","a08QB00000QbUY3YAN"]}return[]},fillCompare=()=>
2{getConstructionNumberIds().forEach(ze=>{(0,jo.qz)(ze)})},clearCompare=()=>{getConstructionNumberIds().forEach(ze=>{(0,jo.nS)(ze)})},zo=[1,2,3,4,5,6,7,8,9,10,11,12],oa="u-hidden",la="KeyQ",ca=["t-theme-sustainable","t-theme-classic","t-theme-modern","t-theme-raw","t-theme-urban"];function triggerDictionaryKeys(){(0,Qn.vF)(),window.location.reload()}function triggerBackendDictionaryKeys(){(0,Qn.id)(),setDebugOnQueryString(),window.location.reload()}function setDebugOnQueryString(){const{showBackendDictionaryKeys:ze}=(0,Qn.XO)(),wt="debug",Rt=window.location.pathname,Xt=new URLSearchParams(window.location.search);ze?Xt.set(wt,ze.toString()):Xt.delete(wt);const sr=Xt.toString()?`?${Xt.toString()}`:"";history.replaceState(null,"",Rt+sr)}var ua=Rt(8648);const ha=["extraData"];function login_ownKeys(ze,wt){var Rt=Object.keys(ze);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function login_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?login_ownKeys(Object(Rt),!0).forEach(function(wt){login_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):login_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function login_defineProperty(ze,wt,Rt){return(wt=function login_toPropertyKey(ze){var wt=function login_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const pa=[{Id:"a0iw0000009AOvlAAG",Name:"KVL",RedirectUrl:"https://nieuwbouw-kvl.nl",LogoUrl:"https://nieuwbouw-kvl.nl/media/leoo5cyw/logo-kvl.png"},{Id:"a0iw000000900CZAAY",Name:"Ode",RedirectUrl:"https://nieuwbouw-ode.nl",LogoUrl:"https://nieuwbouw-ode.nl/media/pa3joszb/bpd-ode-logo-design-v2_black.png"},{Id:"a0i2X00000Cf6aQQAR",Name:"De Nieuwe Defensie",RedirectUrl:"https://nieuwbouw-denieuwedefensie.nl",LogoUrl:"https://nieuwbouw-denieuwedefensie.nl/media/zwrg0hmm/de-nieuwe-defensie_logo_zwart_cmyk.png"},{Id:"a0iw0000009NHiTAAW",Name:"Oegstgeestaanderijn",RedirectUrl:"https://nieuwbouw-oegstgeestaanderijn.nl",LogoUrl:"https://nieuwbouw-oegstgeestaanderijn.nl/media/iz3n5y1b/oegstgeest-aan-de-rijn-90x90-px-zwarte-letter-nieuw.png"}],_a=[{Id:"a062X00001JO34pQAD",Name:"Kevin Accenture"},{Id:"a062X00001JO34qQAD",Name:"Lennart Accenture"},{Id:"a062X00001JO3ELQA1",Name:"Archi Accenture"},{Id:"a062X00001JO312QAD",Name:"Hans IM"},{Id:"a062X00001JO30sQAD",Name:"Fleur IM"},{Id:"a063O000003UpopQAC",Name:"NL For Sale - After allocation [free/option/sold]"},{Id:"a063O000003UpokQAC",Name:"NL For Sale - Between end of sale and allocation"},{Id:"a063O000003UpofQAC",Name:"NL For sale - date start for sale until end of sale"},{Id:"a063O000004IrihQAC",Name:"Rental - in preparation"},{Id:"a063O000000IN3XQAW",Name:"Accenture Heerlen"},{Id:"a063O000000JdXmQAK",Name:"Cloud City [ProjectName]"},{Id:"a063O000003U3HVQA0",Name:"Cloud city phase 15/10"},{Id:"a063O000003U3HVQA0",Name:"Cloud city phase 15/10"},{Id:"a063O000000JdXmQAK",Name:"Cloud City [ProjectName]"},{Id:"a062X00001JO30sQAD",Name:"Fleur IM"},{Id:"a062X0000183vVIQAY",Name:"Gerard Huur"},{Id:"a062X00001JO39zQAD",Name:"Annehilde IM"}],wa=[{Id:"a072X00001Gjdr7QAB",ProjectId:"a062X00001JO34pQAD"},{Id:"a072X00001GjdrCQAR",ProjectId:"a062X00001JO34qQAD"},{Id:"a072X00001GjdrIQAR",ProjectId:"a062X00001JO3ELQA1"},{Id:"a072X00001GjdqxQAB",ProjectId:"a062X00001JO312QAD"},{Id:"a073O000000IAeyQAG",ProjectId:"a062X00001JO312QAD"},{Id:"a072X00001GjdqiQAB",ProjectId:"a062X00001JO30sQAD"},{Id:"a073O000002er19QAA",ProjectId:"a063O000004IrihQAC"},{Id:"a073O000000IAheQAG",ProjectId:"a063O000000IN3XQAW"},{Id:"a073O000000Sb3rQAC",ProjectId:"a063O000000JdXmQAK"},{Id:"a073O0000022JB1QAM",ProjectId:"a063O000003U3HVQA0"},{Id:"a073O0000022JB1QAM",ProjectId:"a063O000003U3HVQA0"},{Id:"a073O000000Sb3mQAC",ProjectId:"a063O000000JdXmQAK"},{Id:"a073O000000Sb48QAC",ProjectId:"a063O000000JdXmQAK"},{Id:"a073O000001FJWBQA4",ProjectId:"a063O000000JdXmQAK"},{Id:"a073O000000Sb4PQAS",ProjectId:"a063O000000JdXmQAK"},{Id:"a073O000000Sb3rQAC",ProjectId:"a063O000000JdXmQAK"}
2,{Id:"a073O000000Sb8MQAS",ProjectId:"a063O000000JdXmQAK"}],login=ze=>{const wt=login_objectSpread({Id:"test-id",Email:"[email protected]",DisplayName:"T Test",Initials:"T T",FirstName:"Test",LastName:"T",Salutation:"Mr",Wishlist:ze?.wishlist?getConstructionNumberIds():[],Areas:ze?.subscription?pa:[],Projects:ze?.subscription?_a:[],PropertyTypes:ze?.subscription?wa:[],SubscribedToAreaNewsletter:!0,HasAddress:!1},ze?.extraData);(0,ua.wp)(wt)},loginWithAddress=ze=>{const wt=ze??{},{extraData:Rt}=wt,Xt=function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}(wt,ha);login(login_objectSpread({extraData:login_objectSpread({PostalCode:"1000aa",Street:"Street",HouseNumber:"1",HouseNumberAddition:"B",City:"City",PhoneNumber:"0123456789",Country:""},Rt)},Xt))};function triggerPropertiesId(){(0,Qn.v1)(),window.location.reload()}async function triggerSearchObjectByID({key:ze,target:wt}){const Rt=await(0,ai.KP)();if("Enter"==ze){const ze=(0,Wn.cc)(Rt,wt.value);if(ze)return void console.log(ze);console.log("The ID doesnt exist on Public API")}}function resetThemeClasses(){ca.forEach(ze=>{sr.R.body.classList.remove(ze)})}function updateBodyThemeClass(ze){ze&&sr.R.body.classList.add(`${ze}`)}const triggerIdInHouseSelector=()=>{(0,Qn.ot)(),window.location.reload()},triggerIdInMap=()=>{(0,Qn.R2)(),window.location.reload()},triggerObjectTypeInMap=()=>{(0,Qn.WP)(),window.location.reload()};function user_address_ownKeys(ze,wt){var Rt=Object.keys(ze);
2if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function user_address_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?user_address_ownKeys(Object(Rt),!0).forEach(function(wt){user_address_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):user_address_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function user_address_defineProperty(ze,wt,Rt){return(wt=function user_address_toPropertyKey(ze){var wt=function user_address_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const addUserAddress=()=>{const ze=Jn.HP.getState(),wt=(0,Jn.bG)();(0,Jn.Nq)(user_address_objectSpread(user_address_objectSpread({},ze),{},{info:user_address_objectSpread(user_address_objectSpread({},wt),{},{zipcode:"1234AA",street:"Voorstraat",houseNumber:"23",houseNumberSuffix:"",city:"Amsterdam",phoneNumber:"0612345678",country:"a0U2000000DuCWyEAN"})}))},fillWishlist=()=>{(0,Jn.jV)(getConstructionNumberIds())},emptyWishlist=()=>{(0,Jn.jV)([])};(0,Xt.Nk)("bpd-development-overlay",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-development-overlay]"),Rt=(0,Xt.YP)("[js-hook-development-overlay-theme-selection]"),sr=(0,Xt.YP)("[js-hook-development-overlay-properties-id]"),Lr=(0,Xt.YP)("[js-hook-development-overlay-search-object]"),Ur=(0,Xt.YP)("[js-hook-development-overlay-dictionary-keys]"),qr=(0,Xt.YP)("[js-hook-development-overlay-backend-dictionary-keys]"),Yi=(0,Xt.YP)("[js-hook-development-overlay-object-type-in-map]"),Ji=(0,Xt.YP)("[js-hook-development-overlay-id-in-map]"),Qi=(0,Xt.YP)("[js-hook-development-overlay-id-in-house-selector]"),kn=(0,Xt.YP)("[js-hook-development-overlay-project-phase-selection] form"),[jo,ua]=(0,Wn.oR)(Qn.DN),{selectedTheme:ha,showDictionaryKeys:pa,showBackendDictionaryKeys:_a,propertiesId:wa,showIdInMap:Pa,showIdInHouseSelector:Oa,showObjectTypeInMap:Da}=jo;return(0,Xt.iX)(document,"keypress",ze=>function toggleBPDGrid(ze){ze?.code?.toLowerCase()==la.toLowerCase()&&(wt.current?.classList.toggle(oa),async function renderProjectPhaseSelection(){const ze=await Wn._n.getData(window.__ENVIRONMENT_DETAILS__.areaId);ze.projectPhases&&(kn.current.innerHTML="",kn.current.append((0,Dr.h)("div",null,(0,Dr.h)(Un.n,{name:"select-project-phase-id",id:"select-project-phase-id",label:"Select project phase ID",options:ze.projectPhases.map(({name:ze,id:wt})=>({label:`${ze} - ${wt}`,value:wt}))}),(0,Dr.h)("button",{type:"submit"},"Add to subscription store"))))}())}(ze)),(0,Xt.iX)(Rt,"change",()=>function changeTheme(ze){const wt=ze.querySelector("#select-theme");(0,Qn.IS)(wt.value)}(ze)),(0,Xt.iX)(sr,"change",triggerPropertiesId),(0,Xt.iX)(Lr,"keypress",triggerSearchObjectByID),(0,Xt.iX)(Ur,"change",triggerDictionaryKeys),(0,Xt.iX)(qr,"change",triggerBackendDictionaryKeys),(0,Xt.iX)(Yi,"change",triggerObjectTypeInMap),(0,Xt.iX)(Ji,"change",triggerIdInMap),(0,Xt.iX)(Qi,"change",triggerIdInHouseSelector),(0,Xt.iX)(kn,"submit",async ze=>{ze.preventDefault();const wt=await Wn._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),Rt=document.querySelector("#select-project-phase-id")?.value,Xt=wt.projectPhases.find(({id:ze})=>ze===Rt);(0,ri.Az)({areaInfo:{areaProjectId:wt.areaProject.id,areaProjectName:wt.areaProject.name||"",projectPhaseId:Rt,districtId:Xt.districtId||""},userInfo:{email:"[email protected]",lastName:"lastName",firstName:"firstName"}})}),(0,ai.Rd)(Mo.Z),ua(({selectedTheme:ze})=>{resetThemeClasses(),updateBodyThemeClass(ze)}),(0,Xt.N_)(()=>{(0,Qn.XO)().selectedTheme&&(resetThemeClasses(),updateBodyThemeClass((0,Qn.XO)().selectedTheme)),setDebugOnQueryString()}),(0,Dr.h)("div",{class:"c-development-overlay u-hidden","js-hook-development-overlay":!0},(0,Dr.h)("div",{className:"o-container"},(0,Dr.h)("div",{class:"o-grid"},zo.map(()=>(0,Dr.h)("div",{class:"o-col o-col-1 development-overlay__column"},(0,Dr.h)("div",{className:"development-overlay__column-inner"}))))),(0,Dr.h)("div",{className:"development-overlay__actions"},Io.Z.isLocal&&(0,Dr.h)("div",null,(0,Dr.h)("button",{onClick:fillWishlist}
2,"Fill wishlist"),(0,Dr.h)("button",{onClick:emptyWishlist},"Empty wishlist"),(0,Dr.h)("button",{onClick:addUserAddress},"Add user address"),(0,Dr.h)("br",null),(0,Dr.h)("br",null),(0,Dr.h)("button",{onClick:login},"Login"),(0,Dr.h)("button",{onClick:()=>login({wishlist:!0})},"Login with wishlist"),(0,Dr.h)("button",{onClick:()=>login({subscription:!0})},"Login with Subscription"),(0,Dr.h)("button",{onClick:()=>loginWithAddress({subscription:!0})},"Login with Address and Subscription"),(0,Dr.h)("button",{onClick:Jn.kS},"Logout"),(0,Dr.h)("br",null),(0,Dr.h)("br",null),(0,Dr.h)("button",{onClick:fillCompare},"Fill compare"),(0,Dr.h)("button",{onClick:clearCompare},"Clear compare"),(0,Dr.h)("br",null),(0,Dr.h)("br",null),(0,Dr.h)(jn.Wg,{hook:"development-overlay-project-phase-selection"})),(0,Dr.h)("bpd-form",{"js-hook-development-overlay-form":!0},(0,Dr.h)(jn.kO,{label:"search-object",id:"search-object",name:"search-object",bpdInputHook:"development-overlay-search-object"}),(0,Dr.h)(Un.n,{label:"Select theme",id:"select-theme",name:"select-theme",bpdInputHook:"development-overlay-theme-selection",value:ha,options:[{label:"Default",value:""},...ca.map(ze=>({label:ze,value:ze}))]}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",value:"Show dictionary keys",name:"dictionary-keys",id:"dictionary-keys",label:"Show dictionary keys",checked:pa,bpdInputHook:"development-overlay-dictionary-keys"}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",value:"Show backend dictionary keys",name:"backend-dictionary-keys",id:"backend-dictionary-keys",label:"Show backend dictionary keys",checked:_a,bpdInputHook:"development-overlay-backend-dictionary-keys"}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",value:"Show object ID in properties overview",name:"show-object-id-in-properties-overview",id:"show-object-id-in-properties-overview",label:"Show object ID in properties overview",checked:wa,bpdInputHook:"development-overlay-properties-id"}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",name:"show-object-type-in-map",id:"show-object-type-in-map",label:"Show object type in map",checked:Da,bpdInputHook:"development-overlay-object-type-in-map"}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",name:"show-id-in-map",id:"show-id-in-map",label:"Show id in map",checked:Pa,bpdInputHook:"development-overlay-id-in-map"}),(0,Dr.h)(Yn.Z,{classes:"development-overlay__checkbox",name:"show-id-in-house-selector",id:"show-id-in-house-selector",label:"Show id in house selector",checked:Oa,bpdInputHook:"development-overlay-id-in-house-selector"}),(0,Dr.h)("button",{onClick:function resetBPDTools(){(0,Qn.oA)(),window.location.reload()}},"Reset all"))))});var Pa=Rt(5940),Oa=Rt(2117);const Da="navigation__item--dropdown-active";(0,Xt.Nk)("bpd-navigation",()=>{const ze=(0,Xt.lq)("[js-hook-navigation-sub-trigger]"),wt=(0,Xt.lq)("[js-hook-navigation-link-item]");let Rt=[];function openSub(ze){ze.element&&(ze.element.style.maxHeight=`${ze.height}px`,ze.isOpen=!0),ze.trigger.classList.add(Da)}function closeSub(ze){ze.element&&(ze.element.style.maxHeight="0px",ze.isOpen=!1),ze.trigger.classList.remove(Da)}function setSubsHeight(ze){ze.forEach(ze=>{const wt=ze.inner.getBoundingClientRect().height,Rt=window.getComputedStyle(ze.inner),Xt=parseInt(Rt.marginTop)+parseInt(Rt.marginBottom);ze.height=wt+Xt})}(0,Xt.N_)(()=>{Rt=function getSubs(){const wt=[...ze.current].map(ze=>({trigger:ze,element:ze.querySelector("[js-hook-navigation-sub]"),inner:ze.querySelector("[js-hook-navigation-sub-inner]"),isOpen:!1}));return setSubsHeight(wt),wt}(),(0,Oa.GS)(({tabletLandscape:ze,tabletPortrait:wt})=>{(ze||wt)&&(setSubsHeight(Rt),Rt.forEach(ze=>closeSub(ze)))}),function bindSubMenuTriggerEvents(){Rt.forEach(ze=>{ze.trigger.addEventListener("mouseenter",()=>function handleMouseenter(ze){(0,Oa.tq)()||openSub(ze)}(ze)),ze.trigger.addEventListener("mouseleave",()=>function handleMouseleave(ze){(0,Oa.tq)()||closeSub(ze)}(ze)),ze.trigger.addEventListener("click",wt=>function handleTriggerClick(ze,wt){(0,Oa.tq)()&&(!function closeOtherSubs(ze){Rt.forEach(wt=>
2{wt!==ze&&closeSub(wt)})}(wt),wt.isOpen?closeSub(wt):openSub(wt))}(0,ze))})}(),function bindGTMEvents(){[...wt.current].forEach(ze=>{if(!ze)return;const wt=ze.querySelector("[js-hook-navigation-top-link]");wt?.addEventListener("click",()=>(0,Pa.d)({event:"menuUsed",menuCategory:wt.innerText,menuSubCategory:""}))}),Rt.forEach(({trigger:ze})=>{const wt=ze.querySelectorAll("[js-hook-navigation-sub-link]"),Rt=ze.querySelector("span")?.innerText;wt.forEach(ze=>{ze.addEventListener("click",()=>(0,Pa.d)({event:"menuUsed",menuCategory:Rt,menuSubCategory:ze.innerText}))})})}()})});Rt(3899),Rt(7538);var La=Rt(436);const Ra="slider__control--is-active",Na=La.wt,Ba="slider__list--no-transition",Ua="slider--has-previous-slide",qa="slider--has-next-slide",Slider=({element:ze})=>{const[wt]=(0,Xt.v9)("start",null),[Rt]=(0,Xt.v9)("controlId",null),sr=(0,Xt.YP)("[js-hook-slider-list]"),Dr=(0,Xt.YP)("inview-container"),Lr=(0,Xt.lq)("[js-hook-slider-item]"),Ur=Rt?`[js-hook-slider-control-previous=${Rt}]`:"[js-hook-slider-control-previous]",qr=Rt?`[js-hook-slider-control-next=${Rt}]`:"[js-hook-slider-control-next]",ri=Rt?{root:document}:void 0,ai=(0,Xt.YP)(Ur,ri),Yi=(0,Xt.YP)(qr,ri),Ji=[];let Qi=0,kn=0;function getInviewItems(){const ze=function getItemsInDOM(){return Array.from(Lr.current).filter(ze=>!!ze&&ze.offsetParent)}();return{isFirstCardInView:!(ze.length>0)||ze[0].classList.contains(Na),isLastCardInView:!(ze.length>0)||ze[ze.length-1].classList.contains(Na)}}function slideToItem(ze,wt=!0){const Rt=Ji[ze],Xt=Ji[kn];Rt&&(wt||sr.current.classList.add(Ba),Qi+=Rt.left-Xt.left,sr.current.style.transform=`translateX(-${Qi}px)`,kn=ze,wt||(sr.current.offsetHeight,sr.current.classList.remove(Ba)))}function nextSlide(){if(!isLastSlide()){slideToItem(kn+1)}}function previousSlide(){slideToItem(kn-1)}function isLastSlide(){const{isLastCardInView:ze}=getInviewItems();return ze}(0,Xt.iX)(Yi,"click",nextSlide),(0,Xt.iX)(ai,"click",previousSlide),(0,Xt.iX)(Dr,"change",function setControlsActiveState(){if(!ai.current)return;if(!Yi.current)return;const{isFirstCardInView:wt,isLastCardInView:Rt}=getInviewItems();wt?wt&&(ai.current.classList.remove(Ra),ze.classList.remove(Ua)):(ai.current.classList.add(Ra),ze.classList.add(Ua));Rt?Rt&&(Yi.current.classList.remove(Ra),ze.classList.remove(qa)):(Yi.current.classList.add(Ra),ze.classList.add(qa))}),(0,Xt.We)("slideToItem",slideToItem),(0,Xt.We)("nextSlide",nextSlide),(0,Xt.We)("previousSlide",previousSlide),(0,Xt.We)("isLastSlide",isLastSlide),(0,Xt.N_)(()=>{!function initItemPositions(){requestAnimationFrame(()=>{Array.from(Lr.current).forEach(ze=>{ze&&Ji.push({left:ze.getBoundingClientRect().left})}),wt&&slideToItem(wt,!1)})}()})};Slider.props={start:{type:Number,required:!1},controlId:{type:String,required:!1}},(0,Xt.Nk)("bpd-slider",Slider);var rs=Rt(524);const ss="js-hook-status-bar-indicator",_s="js-hook-status-bar-item",Pl="status-bar__indicator--unchecked",Cl="status-bar__indicator--checking",Ol="status-bar__indicator--checked";(0,Xt.Nk)("status-bar",()=>{const ze=(0,Xt.lq)(`[${_s}]`),wt=(0,Xt.lq)(`[${ss}]`);let Rt=window.innerHeight;(0,Xt.iX)(window,"resize",()=>{Rt=window.innerHeight}),(0,Xt.N_)(()=>{Array.from(ze.current).forEach(ze=>{if(!ze)return;const wt=ze.getAttribute(_s)||"";rs.O.observe(ze,(ze,Rt)=>itemVisibilityChanged(wt,ze,Rt))}),Array.from(wt.current).forEach(ze=>{if(!ze)return;const wt=ze.getAttribute(ss)||"";ze.addEventListener("click",()=>onIndicatorClick(wt))})}),(0,Xt.gU)(()=>{Array.from(ze.current).forEach(ze=>rs.O.unobserve(ze))});const itemVisibilityChanged=(ze,wt,Xt)=>{wt?Xt.boundingClientRect.bottom<=Rt?setIndicatorState(ze,"checked"):setIndicatorState(ze,"checking"):Xt.boundingClientRect.top>=Rt&&setIndicatorState(ze,"unchecked")},onIndicatorClick=wt=>{Array.from(ze.current).forEach(ze=>{if(!ze)return;if(ze.getAttribute(_s)===wt){const wt=200,Rt=ze.getBoundingClientRect().top+window.pageYOffset-wt;window.scrollTo({top:Rt,behavior:"smooth"})}})},setIndicatorState=(ze,Rt)=>{Array.from(wt.current).forEach(wt=>{if(wt&&wt.getAttribute(ss)===ze)switch(Rt){case"unchecked":wt.classList.remove(Cl),wt.classList.remove(Ol),wt.classList.add(Pl);break;case"checking":wt.classList.remove(Pl),wt.classList.remove(Ol),wt.classList.add(Cl);break;case"checked":wt.classList.remove(Pl),wt.classList.remove(Cl),wt.classList.add(Ol)}})}});var Dl=Rt(8050);const Ll="chat--is-open",Fl="chat--status-offline",Vl="chat--status-away",Gl="chat--status-online",Zl="chat--status-unread",Wl=[Fl,Vl,Gl,Zl];(0,Xt.Nk)("bpd-chat",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-chat-close]",{root:document}),Rt=document.createElement("iframe");let Lr;function blackboxUrl(){return ze.dataset.blackboxUrl}function isActive(){return"true"===ze.dataset.active}function open(ze){sendMessage({active:!0,pane:ze}),sr.R.body.classList.add(Ll)}function close(){sendMessage({active:!1}),sr.R.body.classList.remove(Ll)}function sendMessage({active:wt,pane:Xt}){Rt.contentWindow.postMessage({active:wt?"true":"false",pane:Xt,agent:{name:ze.dataset.agentName,picture:ze.dataset.agentPicture},user:{firstname:ze.dataset.userFirstname,lastname:ze.dataset.userLastname,emailaddress:ze.dataset.userEmailaddress,phonenumber:ze.dataset.userPhonenumber},contact:{phonenumber:ze.dataset.contactPhonenumber,weekdays:ze.dataset.contactHoursWeekdays,saturday:ze.dataset.contactHoursSaturday,sunday:ze.dataset.contactHoursSunday},areaid:ze.dataset.areaId,districtid:ze.dataset.districtId},blackboxUrl())}(0,Xt.iX)(window,"message",ze=>{const{status:wt,unread:Rt}=ze.data;Lr&&(open(Lr),Lr=void 0),wt&&function setStatus(ze,wt){let Rt=!1;switch(ze){case"offline":Rt=Fl;break;case"away":Rt=Vl;break;case"online":Rt=wt>0?Zl:Gl}if(!Rt)return;sr.R.body.classList.contains(Rt)||(sr.R.body.classList.remove(...Wl),sr.R.body.classList.add(Rt))}(wt,Rt)}),(0,Xt.iX)(wt,"click",ze=>{ze.stopPropagation(),close()}),(0,Xt.N_)(()=>{!function appendIframe(){const wt=function constructSrc(){const encode=(ze,...wt)=>wt.reduce((wt,Rt,Xt)=>`${wt}${ze[Xt]?ze[Xt].trim():""}${encodeURI(Rt)}`,"").replace(/\s/g,"");let wt=blackboxUrl();return wt+=encode`/blackbox/index.html 3 ?origin=${window.location.origin} 4 &cookie-accepted=${ze.dataset.cookieAccepted?"true":"false"} 5 &location=${blackboxUrl()} 6 &client=${ze.dataset.client} 7 &client-key=${ze.dataset.clientKey} 8 &area-id=${ze.dataset.areaId} 9 &page-title=${ze.dataset.pageTitle} 10 &page-url=${ze.dataset.pageUrl} 11 &page-referer=${ze.dataset.pageReferer} 12 &page-domain=${ze.dataset.pageDomain} 13 &contact-phone-number=${ze.dataset.contactPhonenumber} 14 &contact-hours-weekdays=${ze.dataset.contactHoursWeekdays} 15 &contact-hours-saturday=${ze.dataset.contactHoursSaturday} 16 &contact-hours-sunday=${ze.dataset.contactHoursSunday} 17 &timeout-switch=${ze.dataset.timeoutSwitch} 18 &timeout-duration=${ze.dataset.timeoutDuration} 19 &timeout-message=${ze.dataset.timeoutMessage} 20 `,wt}(),Xt=document.createElement("div");Rt.src=wt,Rt.title="blackbox",Xt.classList.add("chat__frame"),Xt.appendChild(function renderCloseButton(){return(0,Dr.h)("button",{class:"chat__close-button",onClick:()=>close()},(0,Dr.h)("bpd-svg",{name:"icons-close"}))}()),Xt.appendChild(Rt),sr.R.body.append(Xt)}(),function setupDelegate(){(0,Dl.cl)({selector:"[js-hook-chat-open]",target:document,type:"click",callback:ze=>{const wt=ze.delegateTarget.dataset.pane;open(isActive()?wt:"message")}})}(),isActive()&&sr.R.body.classList.add("chat--is-active"),"true"===ze.dataset.open&&(Lr="message")})});var Xl=Rt(8118);const ProfileButton=({element:ze})=>{let wt,Rt;function handleLoginChange(){wt=(0,Jn.bG)(),Rt=(0,Jn.eo)(),function render(){const Xt=ze.useMehNavigation&&Rt&&Rt.length>1;ze.innerHTML="",ze.append((0,Dr.h)("div",{class:"c-profile-button u-flex u-flex-center u-flex-middle"},(0,Dr.h)("button",{class:"profile-button__inner u-flex u-flex-center u-flex-middle",onClick:handleClick},wt?.avatar&&(0,Dr.h)("figure",{class:"profile-button__circle"},(0,Dr.h)("img",{src:wt?.avatar,alt:"Profile"})),wt?.initials&&!wt.avatar&&(0,Dr.h)("span",{class:"profile-button__circle"},(0,Dr.h)("span",null,wt.initials)),!wt?.avatar&&!wt?.initials&&(0,Dr.h)(Dr.H,null,(0,Dr.h)("div",{class:"profile-button__icon"},(0,Dr.h)(Xl.Z,{name:"icons-user"})),(0,Dr.h)("span",{class:"profile-button__label"},"Inloggen"))),(0,Jn.jl)()&&(0,Dr.h)("div",{class:"profile-button__dropdown","js-
20hook-profile-button-dropdown":!0},(0,Dr.h)("bpd-profile-dropdown",{"full-name":wt?.displayName,email:wt?.email,"mijn-home-url":ze.mijnHomeUrl,"mijn-account-url":ze.mijnAccountUrl,"use-meh-navigation":ze.useMehNavigation,"account-navigation-links":ze.accountNavigationLinks,"has-user-areas":Xt}))))}(),(0,Jn.ys)()}function handleClick(){(0,Jn.jl)()?(0,Oa.tq)()&&ze.classList.toggle("profile-button--dropdown-open"):(0,Jn.x4)()}(0,Xt.v9)("useMehNavigation",!1),(0,Xt.v9)("mijnHomeUrl",""),(0,Xt.v9)("mijnAccountUrl",""),(0,Xt.v9)("accountNavigationLinks",""),(0,Xt.YP)("[js-hook-profile-button-dropdown]",{as:"dropdown"}),(0,Xt.N_)(()=>{Jn.HP.subscribe(handleLoginChange,["loggedIn"]),handleLoginChange()})};ProfileButton.props={useMehNavigation:{type:Boolean},mijnHomeUrl:{type:String},mijnAccountUrl:{type:String},accountNavigationLinks:{type:String}},(0,Xt.Nk)("bpd-profile-button",ProfileButton);var ic=Rt(7655),lc=Rt(9010);const uc="login-screen";(0,Xt.Nk)("bpd-login-screen",({element:ze})=>{let wt=null;function getiframeSrc(){if(Io.Z.isLocal)return`${Io.Z.baseApiUrl}/umbraco/surface/saml/authrequest?host=hoefenhaag.test.bpd.nl&id=a0iw0000008QvIVAA0&protocol=https`;return`/umbraco/surface/saml/authrequest?host=${window.location.hostname}&id=${window.__ENVIRONMENT_DETAILS__.areaId}&protocol=https`}return(0,ai.Rd)(lc.Z),(0,Xt.We)("closeAndRemove",function closeAndRemove(){switch(function type(){return wt?"popup":"modal"}()){case"popup":wt?.close(),ze.remove();break;case"modal":(0,ic.Mr)(uc),ze.remove()}}),function isSafari(){const ze=navigator.userAgent.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);return!!ze&&"safari"===ze[1].toLowerCase()}()?(wt=function isMobile(){return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion)}()?window.open(getiframeSrc()):function openPopup(){const ze=window.screen.width/2-460,wt=window.screen.height/2-287.5;return window.open(getiframeSrc(),"Login",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=900, height=475, top=${wt}, left=${ze}`)}(),""):(0,Dr.h)("bpd-iframe-modal",{classes:"c-login-screen",active:!0,id:uc,"iframe-id":"login-iframe",src:getiframeSrc(),"min-width":"100%","min-height":"41.2rem"})});var Ec=Rt(2699),Mc=Rt(2002),Bc=Rt(903),Vc=Rt(8230);function map_switch_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function map_switch_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?map_switch_ownKeys(Object(Rt),!0).forEach(function(wt){map_switch_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):map_switch_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function map_switch_defineProperty(ze,wt,Rt){return(wt=function map_switch_toPropertyKey(ze){var wt=function map_switch_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Hc="map-switch--view-exterior",Kc=(0,Bc.R)("/images/map-switch-thumbnail-exterior.jpg"),iu=(0,Bc.R)("/images/map-switch-thumbnail-interior.jpg");HTMLElement;const ToggleImage=({label:ze,image:wt,className:Rt})=>(0,Dr.h)("span",{class:Rt},(0,Dr.h)("span",{class:"map-switch__toggle-label"},ze),(0,Dr.h)(Mc.E,{classes:"map-switch__toggle-image",image:wt,alt:"",settings:{"640w":{width:200,height:200}},objectFit:!0}));(0,Xt.Nk)("bpd-map-switch",({element:ze})=>{(0,ai.Rd)(Vc.Z);const wt=(0,Xt.YP)("[js-hook-map-switch]"),Rt=(0,Xt.YP)("[js-hook-map-switch-toggle]"),Lr=(0,Ec.Z)(ze);return function setDefaultImages(){if(!Lr)return;Lr.interiorToggle.image||(Lr.interiorToggle.image=iu);Lr.exteriorToggle.image||(Lr.exteriorToggle.image=Kc)}(),(0,Xt.iX)(Rt,"click",function toggle(){wt.current?.classList.toggle(Hc),sr.R.body.classList.toggle(Hc)}),(0,Dr.h)("div",{class:"c-map-switch","js-hook-map-switch":!0},(0,Dr.h)("div",{class:"map-switch__container"},(0,Dr.h)("div",{class:"map-switch__interior"},(0,Dr.h)("slot",{name:"interior"})),(0,Dr.h)("div",{class:"map-switch__exterior"},(0,Dr.h)("slot",{name:"exterior"})),(0,Dr.h)("button",{class:"map-switch__toggle","js-hook-map-switch-toggle":!0},Lr?.interiorToggle&&Lr?.exteriorToggle&&(0,Dr.h)(Dr.H,null,(0,Dr.h)(ToggleImage,map_switch_objectSpread({className:"map-switch__toggle-exterior"},Lr.exteriorToggle)),(0,Dr.h)(ToggleImage,map_switch_objectSpread({className:"map-switch__toggle-interior"},Lr.interiorToggle))))))},{useShadowDom:!0});const nu="house-characteristics-cta-bar--is-active",ou="has--house-characteristics-cta-bar";(0,Xt.Nk)("bpd-house-characteristics-cta-bar",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-characteristics-section]",{root:document});function setActiveClass(){if(!wt.current)return;const Rt=window.pageYOffset>wt.current.offsetTop+wt.current.clientHeight?"add":"remove";ze.classList[Rt](nu),sr.R.body.classList[Rt](nu)}(0,Xt.iX)(window,"scroll",()=>{(0,Wn.Ds)(()=>{setActiveClass()},200)()}),(0,Xt.N_)(()=>{!function setBodyClass(){sr.R.body.classList.add(ou)}(),setActiveClass()})});Rt(4597);var au=Rt(5737),su=Rt(7768),lu=Rt(5893),cu=Rt(7663),hu=Rt(2572);const pu="construction-number-card--highlighted",ConstructionNumberCard=({element:ze})=>{const[wt]=(0,Xt.v9)("id",""),[Rt]=(0,Xt.v9)("houseName",""),[sr]=(0,Xt.v9)("wishlistItemCount",0),[Lr]=(0,Xt.v9)("href",""),[Ur]=(0,Xt.v9)("price",!1),[qr]=(0,Xt.v9)("image"),[ri]=(0,Xt.v9)("specs",[]),[Yi]=(0,Xt.v9)("shoppingCartUrl",!1),[Ji]=(0,Xt.v9)("classes",null),[Qi]=(0,Xt.v9)("status",null),[kn]=(0,Xt.v9)("compare",!1),[jn]=(0,Xt.v9)("hidePrice",!1),[Un]=(0,Xt.v9)("isNhg",!1),[Wn]=(0,Xt.v9)("debugId",null);(0,ai.Rd)(hu.Z),(0,Xt.We)("setHighlighted",function setHighlighted(){ze.classList.add(pu)}),(0,Xt.We)("unsetHighlighted",function unsetHighlighted(){ze.classList.remove(pu)});let Yn="c-construction-number-card";return Yn+=Ji?` ${Ji}`:"",(0,Dr.h)("a",{className:Yn,href:Lr,id:wt},(0,Dr.h)("div",{class:"construction-number-card__image-container"},(0,Dr.h)(su.E,{classes:"construction-number-card__image",image:qr.url,alt:qr.alt,settings:{"640w":{width:232,height:144}},objectFit:!0})),(0,Dr.h)("div",{class:"construction-number-card__details"},(0,Dr.h)("div",null,Qi&&(0,Dr.h)("span",{class:`construction-number-card__status ${cu.Sw[Qi.color]}`},Qi.label),(0,Dr.h)("h3",{class:"construction-number-card__title"},Rt),Ur&&Ur.amount&&!jn&&(0,Dr.h)("span",{class:"construction-number-card__price"},Ur.prefix&&Ur.prefix," ",Ur.amount&&Ur.amount," ",Ur.suffix&&Ur.suffix,Un&&(0,Dr.h)(lu.D,{text:"NHG",size:"small",classes:"u-margin-left-1"})),(0,Dr.h)("ul",{class:"construction-number-card__specs-list"},ri.map(ze=>(0,Dr.h)("li",{class:"construction-number-card__list-item"}
20,ze.value," ",ze.suffix)))),Wn&&(0,Dr.h)("span",null,Wn),kn&&(0,Dr.h)("compare-button",{class:"construction-number-card__compare",id:wt})),(0,Dr.h)("div",{class:"construction-number-card__actions"},window.__ENVIRONMENT_DETAILS__.hasWishlist&&(0,Dr.h)("div",{class:"construction-number-card__action"},(0,Dr.h)("bpd-wishlist-favourite-button",{"construction-number-id":wt,count:sr})),Yi&&(0,Dr.h)("div",{class:"construction-number-card__action"},(0,Dr.h)(au.P,{ariaLabel:"Voeg toe aan winkelwagen",size:"small",classes:"construction-number-card__add-to-cart",svg:"icons-cart",url:Yi}))))};ConstructionNumberCard.props={id:{type:String},houseName:{type:String},wishlistItemCount:{type:Number},href:{type:String},price:{type:Object},image:{type:Object,required:!0},specs:{type:Array},shoppingCartUrl:{type:String},classes:{type:String},status:{type:Object},compare:{type:Boolean},hidePrice:{type:Boolean},isNhg:{type:Boolean},debugId:{type:String}},(0,Xt.Nk)("bpd-construction-number-card",ConstructionNumberCard);const fu="header-wishlist-button--highlighted";(0,Xt.Nk)("bpd-header-wishlist-button",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-header-wishlist-button-total]");let Rt=0;function handleWishlist(){const Xt=(0,Jn.AH)();Rt=Xt?.length||0,function setHighlightedClass(){Rt?ze.classList.add(fu):ze.classList.remove(fu)}(),function setWishlistTotal(){if(!wt.current)return;wt.current.innerHTML=Rt?`${Rt}`:""}()}(0,Xt.N_)(()=>{handleWishlist(),Jn.HP.subscribe(handleWishlist,["wishlist"])})});var mu=Rt(6320);const gu="header-alerts-button--highlighted";(0,Xt.Nk)("bpd-header-alerts-button",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-header-alerts-button-total]");let Rt=0;return(0,Xt.N_)(()=>{!function handleAlerts(){const Xt=[];Rt=Xt?.length||0,function setHighlightedClass(){Rt?ze.classList.add(gu):ze.classList.remove(gu)}(),function setAlertsTotal(){if(!wt.current)return;wt.current.innerHTML=Rt?`${Rt}`:""}()}()}),(0,Dr.h)("button",{class:"header-alerts-button__link"},(0,Dr.h)("div",{class:"header-alerts-button__icon"},(0,Dr.h)(mu.Zz,{name:"icons-bell"})),(0,Dr.h)("span",{class:"header-alerts-button__total u-label","js-hook-header-alerts-button-total":!0}))});var yu=Rt(8620),bu=(Rt(8661),Rt(2397)),vu=Rt(7505);const useKrpanoJs=async()=>(window.krpanoJS||await Rt.e(779).then(Rt.t.bind(Rt,3779,23)),window.krpanoJS),Krpano=()=>{const[ze]=(0,Xt.v9)("krpanoId","krpanoSWFObject"),[wt]=(0,Xt.v9)("storeId"),[Rt,sr]=(0,Wn.oR)(vu.C);let Lr;(0,Xt.We)("zoomIn",function zoomIn(){if(!qr){const ze=Number(Lr.get("view.fov")),wt=bu.bV.reverse().find(wt=>wt<ze)||bu.I2;bu.bV.reverse().indexOf(wt)<=0&&(Yi.emit({disabled:!0}),qr=!0),ri&&(Ji.emit({disabled:!1}),ri=!1),Lr.call(`zoomto(${wt})`)}}),(0,Xt.We)("zoomOut",function zoomOut(){if(!ri){const ze=Number(Lr.get("view.fov")),wt=bu.bV.find(wt=>wt>ze)||bu.b_;bu.bV.indexOf(wt)>=bu.bV.length-1&&(Ji.emit({disabled:!0}),ri=!0),qr&&(Yi.emit({disabled:!1}),qr=!1),Lr.call(`zoomto(${wt})`)}}),(0,Xt.We)("goBack",function goBack(){const ze=Rt[wt].initialSceneId;Ur||(Lr.call(`\n if(startScene === null, set(startScene,'${ze}'); );\n loadScene(get(startScene), null, null, ZOOMBLEND(1.0, 1.0, easeInOutQuad));\n `),ai.emit({disabled:!0}),Ur=!0)}),(0,Xt.We)("destroy",async function destroy(){const{removepano:wt}=await useKrpanoJs();wt(ze)});let Ur=!0,qr=!1,ri=!1;const ai=(0,Xt.zX)({eventName:bu.wL.TOGGLE_GO_BACK}),Yi=(0,Xt.zX)({eventName:bu.wL.TOGGLE_ZOOM_IN}),Ji=(0,Xt.zX)({eventName:bu.wL.TOGGLE_ZOOM_OUT});function onKrpanoReady(ze){Lr=ze,qr=!1,ri=!1}async function updatePano(wt){const{removepano:Rt,embedpano:Xt}=await useKrpanoJs();Rt(ze),Xt({id:ze,xml:wt,target:`${ze}-container`,html5:"prefer",mwheel:!1,initvars:{design:"flat"},passQueryParameters:!0,onready:onKrpanoReady})}return(0,Xt.iX)(document,bu.p1.SCENE_CHANGE,ze=>{const Xt=Rt[wt]?.initialSceneId;Xt&&Xt!==ze.detail.sceneName&&(ai.emit({disabled:!1}),Ur=!1)}),(0,Xt.N_)(()=>{const{pano:ze}=vu.C.getState()[wt]||{};ze&&updatePano(ze)}),sr(({[wt]:ze})=>{ze.pano&&updatePano(ze.pano)},[wt]),(0,Dr.h)("div",{class:"c-krpano",id:`${ze}-container`})};Krpano.props={krpanoId:{type:String,reflectToAttr:!0},storeId:{type:String,required:!0,reflectToAttr:!0},viewPath:{type:String,reflectToAttr:!0}},(0,Xt.Nk)("bpd-krpano",Krpano);var xu=Rt(5446);const wu=["children","classes","centered","variant","options","showFade","controlMode","onSelect"],Su=["children"],Cu=["children","classes"],Du=["classes","direction","active","controlId","label"];function slider_embla_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function slider_embla_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?slider_embla_ownKeys(Object(Rt),!0).forEach(function(wt){slider_embla_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):slider_embla_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function slider_embla_defineProperty(ze,wt,Rt){return(wt=function slider_embla_toPropertyKey(ze){var wt=function slider_embla_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}function slider_embla_objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function slider_embla_objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}const slider_embla_Container=ze=>{let{children:wt,classes:Rt,centered:Xt,variant:sr,options:Lr,showFade:Ur,controlMode:qr,onSelect:ri}=ze,ai=slider_embla_objectWithoutProperties(ze,wu);return(0,Dr.h)("slider-embla",slider_embla_objectSpread({class:`c-slider-embla ${sr&&"slider-embla--"+sr} ${Rt||""}`.trim(),"slider-options":Lr,centered:Xt,onSelect:ri,"show-fade":Ur,"control-mode":qr},ai),(0,Dr.h)("div",{class:"slider-embla__container"},wt))},slider_embla_List=ze=>{let{children:wt}=ze,Rt=slider_embla_objectWithoutProperties(ze,Su);return(0,Dr.h)("div",slider_embla_objectSpread({class:"slider-embla__slider","js-hook-slider":!0},Rt),(0,Dr.h)("div",{class:"slider-embla__slider-inner"},wt))},slider_embla_Slide=ze=>{let{children:wt,classes:Rt}=ze,Xt=slider_embla_objectWithoutProperties(ze,Cu);return(0,Dr.h)("div",slider_embla_objectSpread(slider_embla_objectSpread({class:`slider-embla__slide ${Rt||""}`.trim()},Xt),{},{role:"button",tabIndex:0}),(0,Dr.h)("div",{class:"slider-embla__slide-inner"},wt))},slider_embla_Control=ze=>{let{classes:wt,direction:Rt,active:Xt,controlId:sr,label:Lr}=ze,Ur=slider_embla_objectWithoutProperties(ze,Du),qr=`slider-embla__control slider-embla__control--${Rt}`;qr+=` ${Xt&&"slider-embla__control--active"}`,qr+=` ${wt||""}`;let ri="js-hook-slider-control-";switch(Rt){case"left":case"up":ri+="previous";break;case"right":case"down":ri+="next"}return(0,Dr.h)(xu.x,slider_embla_objectSpread({classes:qr.trim(),attributes:{"data-direction":Rt,[ri]:sr||""},svg:"icons-arrow-areas",hook:ri},Ur))};function video_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function video_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?video_ownKeys(Object(Rt),!0).forEach(function(wt){video_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):video_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function video_defineProperty(ze,wt,Rt){return(wt=function video_toPropertyKey(ze){var wt=function video_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Video=ze=>{const wt=video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread(video_objectSpread({class:`c-video ${ze.classes?ze.classes:""}`.trim()},ze.noschema&&{itemprop:"video",itemscope:!0,itemtype:"http://schema.org/VideoObject"}),{},{id:`video-${ze.instanceId}`,"data-video-platform":ze.platform},ze.id&&{"data-video-id":ze.id}),ze.startTime&&{"data-video-time":ze.startTime}),ze.muted&&{"data-video-muted":ze.muted?"1":"0"}),ze.autoplay&&{"data-video-autoplay":ze.autoplay?"1":"0"}),ze.playsInline&&{"data-video-playsinline":ze.playsInline?"1":"0"}),ze.controls&&{"data-video-controls":ze.controls?"1":"0"}),ze.loop&&{"data-video-loop":ze.loop?"1":"0"}),ze.closedCaptions&&{"data-video-closedcaptions":JSON.stringify(ze.closedCaptions)}),ze.title&&{"aria-label":ze.title}),{},{"is-playlist":!!ze.isPlaylist,"ignore-viewport":!!ze.ignoreViewport});return(0,Dr.h)("bpd-video",video_objectSpread(video_objectSpread({},wt),{},{role:"application","js-hook-video":!0}),ze.noschema&&(0,Dr.h)(Dr.H,null,ze.title&&(0,Dr.h)("meta",{itemprop:"name",content:ze.title}),ze.description&&(0,Dr.h)("meta",{itemprop:"description",content:ze.description}),ze.totalTime&&(0,Dr.h)("meta",{itemprop:"duration",content:ze.totalTime}),ze.thumbnail&&(0,Dr.h)("meta",{itemprop:"thumbnailUrl",content:ze.thumbnail}),ze.embedUrl&&(0,Dr.h)("meta",{itemprop:"embedUrl",content:ze.embedUrl}),ze.uploadDate&&(0,Dr.h)("meta",{itemprop:"uploadDate",content:ze.uploadDate})),(0,Dr.h)("div",{class:"video__player","js-hook-video-player":!0}),(0,Dr.h)("div",video_objectSpread({},{[`uc-${ze.platform}-banner`]:!0})),ze.buttons&&!ze.previewText&&(0,Dr.h)("button",{class:"video__button video__button--play","js-hook-video-play":!0},(0,Dr.h)("span",{class:"video__button-icon"}),(0,Dr.h)("span",{class:"u-sr-only"},(0,ai.qM)("Play"))),ze.previewText&&(0,Dr.h)(Lr.zx,{classes:"video__play-text u-color--white",label:ze.previewText,hook:"video-play"}),ze.image&&(0,Dr.h)(Mc.E,video_objectSpread({},ze.image)))};var Lu=Rt(7801);const zu="u-hidden",Vu="is-active",ed="media-overlay-vr-tour",MediaOverlay=({update:ze})=>{const[wt]=(0,Xt.v9)("media"),[Rt]=(0,Xt.v9)("modalId","media-overlay"),[sr]=(0,Xt.v9)("zoomImage",!1),[Ur]=(0,Xt.v9)("sidebar",!1),[qr]=(0,Xt.v9)("allowMultipleVideos",!1),ri=(0,Xt.YP)("[js-hook-media-overlay-slider]"),Yi=(0,Xt.YP)("[js-hook-media-overlay-sidebar-slider]"),Ji=(0,Xt.YP)("[js-hook-media-overlay-slider-container]"),Qi=(0,Xt.lq)("[js-hook-media-overlay-sidebar-slider-button-image]"),kn=(0,Xt.YP)("[js-hook-media-overlay-gallery-length]"),jn=(0,Xt.YP)("[js-hook-media-overlay-sidebar-button-vr]"),Un=(0,Xt.YP)("[js-hook-media-overlay-sidebar-button-video]"),Wn=(0,Xt.YP)("[js-hook-media-overlay-vr-container]"),Yn=(0,Xt.YP)("[js-hook-media-overlay-krpano]"),Jn=(0,Xt.YP)("[js-hook-media-overlay-krpano-zoom-in]"),Qn=(0,Xt.YP)("[js-hook-media-overlay-krpano-zoom-out]"),Io=(0,Xt.lq)("[js-hook-media-overlay-vr-scene-button]"),Mo=(0,Xt.YP)("[js-hook-media-overlay-video-container]"),jo=(0,Xt.YP)("[js-hook-video]"),zo=(0,Xt.lq)("[js-hook-media-overlay-video-button]"),{images:oa=[],scenes:la=[],videos:ca=[]}=JSON.parse(wt);let ua,ha=(0,Oa.tq)();const pa=JSON.stringify({axis:ha?"x":"y",align:"center",containScroll:"trimSnaps",inViewThreshold:void 0,dragFree:!0});(0,ai.Rd)(Lu.Z),(0,Xt.N_)(()=>{Ur&&(0,Oa.GS)(()=>{const wt=(0,Oa.tq)();
20ha!==wt&&(ha=wt,ze())})});const setMediaView=ze=>{ze.vr?(Ji.current?.classList.add(zu),Wn.current?.classList.remove(zu),Mo.current?.classList.add(zu),jn.current?.classList.add(Vu),Un.current?.classList.remove(Vu),setVirtualScene(la[0],0),jo.current?.unloadVimeoVideo(),ua="vr"):ze.video?(Ji.current?.classList.add(zu),Wn.current?.classList.add(zu),Mo.current?.classList.remove(zu),jn.current?.classList.remove(Vu),Un.current?.classList.add(Vu),setVideo(ca[0],0),Yn.current?.destroy(),ua="video"):(Ji.current?.classList.remove(zu),Wn.current?.classList.add(zu),Mo.current?.classList.add(zu),jn.current?.classList.remove(Vu),Un.current?.classList.remove(Vu),ze.index?ri.current?.select(ze.index,{jump:!0}):onSelect(0),Yn.current?.destroy(),jo.current?.unloadVimeoVideo(),ua="image")},onSelect=ze=>{Ur&&(kn.current.innerText=`${ze+1} / ${oa.length}`,Yi.current?.select(ze),Array.from(Qi.current).forEach((wt,Rt)=>{wt?.classList[Rt===ze?"add":"remove"](Vu)}))};(0,Xt.We)("open",ze=>{setMediaView(ze??{index:0}),requestAnimationFrame(()=>{(0,ic.h7)(Rt)})});const handleClose=()=>{(0,ic.Mr)(Rt),Yn.current?.destroy&&Yn.current?.destroy(),jo.current?.unloadVimeoVideo&&jo.current?.unloadVimeoVideo()},setVirtualScene=(ze,wt)=>{Array.from(Io.current).forEach((ze,Rt)=>ze?.classList[Rt===wt?"add":"remove"](Vu)),Jn.current?.removeAttribute("disabled"),Qn.current?.removeAttribute("disabled"),(0,vu.p)(ed,ze.xmlUrl)},setVideo=(ze,wt)=>{Array.from(zo.current).forEach((ze,Rt)=>ze?.classList[Rt===wt?"add":"remove"](Vu)),jo.current?.loadVimeoVideo(ze.videoId)};return(0,Xt.iX)(Yn,bu.wL.TOGGLE_ZOOM_IN,ze=>{ze.detail.disabled?Jn.current?.setAttribute("disabled","disabled"):Jn.current?.removeAttribute("disabled")}),(0,Xt.iX)(Yn,bu.wL.TOGGLE_ZOOM_OUT,ze=>{ze.detail.disabled?Qn.current?.setAttribute("disabled","disabled"):Qn.current?.removeAttribute("disabled")}),(0,Dr.h)("bpd-modal",{class:"c-media-overlay",id:Rt,onModalClose:handleClose},(0,Dr.h)("div",{class:"media-overlay__container"},(0,Dr.h)(xu.x,{onClick:handleClose,variant:"light",svg:"icons-close",ariaLabel:"Close button",classes:"media-overlay__close-button"}),Ur&&(0,Dr.h)("aside",{class:"media-overlay__sidebar"},(0,Dr.h)("div",{class:"media-overlay__sidebar-inner"},(0,Dr.h)(slider_embla_Container,{classes:"media-overlay__sidebar-slider",options:pa,variant:ha?"default":"vertical",controlMode:"start-end","js-hook-media-overlay-sidebar-slider":!0,showFade:!0},!ha&&oa.length&&(0,Dr.h)(Dr.H,null,(0,Dr.h)(slider_embla_Control,{variant:"light",direction:"up",ariaLabel:"Previous slide",classes:"media-overlay__sidebar-slider-control media-overlay__sidebar-slider-control--up"}),(0,Dr.h)(slider_embla_Control,{variant:"light",direction:"down",ariaLabel:"Next slide",classes:"media-overlay__sidebar-slider-control media-overlay__sidebar-slider-control--down"})),(0,Dr.h)(slider_embla_List,null,oa.map((ze,wt)=>(0,Dr.h)(slider_embla_Slide,{classes:"media-overlay__sidebar-slider-item"},(0,Dr.h)(Lr.zx,{classes:"media-overlay__sidebar-button media-overlay__sidebar-button--image",hook:"media-overlay-sidebar-slider-button-image",onClick:()=>(ze=>{"image"!==ua?setMediaView({index:ze}):ri.current?.select(ze)})(wt)},(0,Dr.h)(su.E,{classes:"media-overlay__thumbnail",image:ze.image,alt:ze.alt,settings:{"240w":{width:88,height:88}}})))))),(0,Dr.h)("p",{class:"u-body-normal media-overlay__gallery-length","js-hook-media-overlay-gallery-length":!0},"0 / ",oa.length),la.length?(0,Dr.h)(Lr.zx,{classes:"media-overlay__sidebar-button media-overlay__sidebar-button--special",variant:"grey-90",icon:"icons-360",label:"360",hook:"media-overlay-sidebar-button-vr",onClick:()=>setMediaView({vr:!0})}):null,ca.length?(0,Dr.h)(Lr.zx,{classes:"media-overlay__sidebar-button media-overlay__sidebar-button--special",variant:"grey-90",icon:"icons-video",label:"Video",hook:"media-overlay-sidebar-button-video",onClick:()=>setMediaView({video:!0})}):null)),(0,Dr.h)("div",{class:"media-overlay__inner"},oa.length&&(0,Dr.h)("div",{class:"media-overlay__media-container","js-hook-media-overlay-slider-container":!0},sr?(0,Dr.h)("div",{class:"media-overlay__slider"},(0,Dr.h)("div",{class:"media-overlay__item"},(0,Dr.h)("zoom-image",{url:oa[0].image,alt:oa[0].alt,"js-hook-zoom-image":!0,settings:{"1920w":{width:1920}}}))):(0,Dr.h)(slider_embla_Container,{centered:"true",variant:"full-height",classes:"media-overlay__slider",onSelect,"js-hook-media-overlay-slider":!0}
20,oa.length?(0,Dr.h)("div",{class:"media-overlay__slider-controls"},(0,Dr.h)(slider_embla_Control,{variant:"light",direction:"left",ariaLabel:"Previous slide",classes:"media-overlay__slider-control"}),(0,Dr.h)(slider_embla_Control,{variant:"light",direction:"right",ariaLabel:"Next slide",classes:"media-overlay__slider-control"})):null,(0,Dr.h)(slider_embla_List,null,oa.map(ze=>(0,Dr.h)(slider_embla_Slide,{classes:"media-overlay__slider-item"},(0,Dr.h)("div",{class:"media-overlay__item"},(0,Dr.h)(su.E,{classes:"media-overlay__image",image:ze.image,alt:ze.alt,settings:{"1920w":{width:1920,height:1440}}}))))))),la.length?(0,Dr.h)("div",{class:"media-overlay__media-container","js-hook-media-overlay-vr-container":!0},(0,Dr.h)("bpd-krpano",{"js-hook-media-overlay-krpano":!0,class:"media-overlay__krpano","krpano-id":"media-overlay-krpano","store-id":ed}),(0,Dr.h)("div",{class:"media-overlay__krpano-controls"},(0,Dr.h)(Lr.zx,{variant:"white",width:"square",icon:"icons-plus",hook:"media-overlay-krpano-zoom-in",classes:"media-overlay__krpano-control",onClick:()=>Yn.current?.zoomIn()}),(0,Dr.h)(Lr.zx,{variant:"white",width:"square",icon:"icons-minus",hook:"media-overlay-krpano-zoom-out",classes:"media-overlay__krpano-control",onClick:()=>Yn.current?.zoomOut()})),la.length>1?(0,Dr.h)("div",{class:"media-overlay__media-item-buttons"},la.map((ze,wt)=>(0,Dr.h)(Lr.zx,{label:ze.name,variant:"grey-5",classes:"media-overlay__media-item-button",hook:"media-overlay-vr-scene-button",onClick:()=>setVirtualScene(ze,wt)}))):null):null,ca.length?(0,Dr.h)("div",{class:"media-overlay__media-container","js-hook-media-overlay-video-container":!0},(0,Dr.h)(Video,{classes:"media-overlay__video "+(qr&&ca.length>1?"media-overlay__video--has-multiple":""),platform:"vimeo",id:ca[0].videoId,instanceId:"media-overlay-video",ignoreViewport:!0,playsInline:!0,controls:!0,loop:!0}),(qr&&ca.length)>1?(0,Dr.h)("div",{class:"media-overlay__media-item-buttons"},ca.map((ze,wt)=>(0,Dr.h)(Lr.zx,{label:ze.name,variant:"grey-5",classes:"media-overlay__media-item-button",hook:"media-overlay-video-button",onClick:()=>setVideo(ze,wt)}))):null):null)))};MediaOverlay.props={media:{type:String,required:!0},modalId:{type:String,required:!1},zoomImage:{type:Boolean,required:!1},sidebar:{type:Boolean,required:!1},allowMultipleVideos:{type:Boolean,required:!1}},(0,Xt.Nk)("bpd-media-overlay",MediaOverlay);(0,Xt.Nk)("house-characteristics-card",()=>{const ze=(0,Xt.YP)("[js-hook-house-characteristics-card-trigger]");(0,Xt.iX)(ze,"click",function onOpenModal(){const ze=window.location.pathname;(0,Pa.d)({event:"gtm.virtualPageview",virtualurl:`${ze}/toon-alle-kenmerken`,virtualtitle:"Toon Alle Kenmerken"})})});function button_toggle_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function button_toggle_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?button_toggle_ownKeys(Object(Rt),!0).forEach(function(wt){button_toggle_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):button_toggle_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function button_toggle_defineProperty(ze,wt,Rt){return(wt=function button_toggle_toPropertyKey(ze){var wt=function button_toggle_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const td="button-toggle--on",rd="button-toggle--off",ButtonToggle=()=>{const[ze]=(0,Xt.v9)("type","toggle"),[wt]=(0,Xt.v9)("direction","row"),[Rt]=(0,Xt.v9)("toggleOn"),[sr]=(0,Xt.v9)("toggleOff"),[Ur]=(0,Xt.v9)("classes",""),[qr]=(0,Xt.v9)("onClick",null),[ri,ai,Yi]=(0,Xt.v9)("isToggleOn",!1),Ji=(0,Xt.YP)("[js-hook-button-toggle]");(0,Xt.We)("setToggleOn",ai),Yi(ze=>{ze?(Ji.current.classList.add(td),Ji.current.classList.remove(rd)):(Ji.current.classList.remove(td),Ji.current.classList.add(rd))});const createHandleClick=ze=>wt=>{ai(ze.toggleOn),qr&&qr(wt,ze.toggleOn),ze.toggleClick&&ze.toggleClick(wt,Rt)},Qi={"c-button-toggle":!0,[`button-toggle--${ze}`]:!0,[`button-toggle--${wt}`]:!0,[Ur]:!0,[ri?td:rd]:!0};return(0,Dr.h)("div",{class:Qi,"js-hook-button-toggle":!0},(0,Dr.h)("div",{class:"button-toggle__button-off","js-hook-button-toggle-off":!0},(0,Dr.h)(Lr.zx,button_toggle_objectSpread(button_toggle_objectSpread({},sr),{},{onClick:createHandleClick({toggleOn:!0,toggleClick:sr.onClick})}))),(0,Dr.h)("div",{class:"button-toggle__button-on","js-hook-button-toggle-on":!0},(0,Dr.h)(Lr.zx,button_toggle_objectSpread(button_toggle_objectSpread({},Rt),{},{onClick:createHandleClick({toggleOn:!1,toggleClick:Rt.onClick})}))))};function zoom_image_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function zoom_image_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?zoom_image_ownKeys(Object(Rt),!0).forEach(function(wt){zoom_image_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):zoom_image_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function zoom_image_defineProperty(ze,wt,Rt){return(wt=function zoom_image_toPropertyKey(ze){var wt=function zoom_image_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}ButtonToggle.props={type:{type:String,reflectToAttr:!0},direction:{type:String,reflectToAttr:!0},toggleOn:{type:Object,required:!0},toggleOff:{type:Object,required:!0},classes:{type:String,reflectToAttr:!0},onClick:{type:Function},isToggleOn:{type:Boolean,reflectToAttr:!0}},(0,Xt.Nk)("button-toggle",ButtonToggle);const id="zoom-image--zoomed",ZoomImage=({element:ze})=>{const[wt]=(0,Xt.v9)("settings",null),[Rt]=(0,Xt.v9)("url",null),[sr]=(0,Xt.v9)("alt",null),Lr=(0,Xt.YP)("img"),Ur=(0,Xt.YP)("[js-hook-zoom-image-container]"),qr=(0,Xt.lq)("[js-hook-zoom-image-button]");let ri,ai=!1,Yi={zoomLevel:0};function zoomIn(wt){Yi=function zoomInSetting(ze){return ri=zoom_image_objectSpread({},ze),ze.zoomLevel=function increaseZoomLevel(ze){return ze=(ze=(ze+=1)>4?4:ze)<2?2:ze}(ze.zoomLevel),ze.elementBounds=getElementBounds(),ze.zoomedSize=getZoomedImgSize(ze),ze.diff=getDiff(ze),ze}(Yi),Yi.zoomedSize&&Lr.current&&(ze.classList.add(id),Lr.current.style.width=`${Yi.zoomedSize.width}px`,Lr.current.style.height=`${Yi.zoomedSize.height}px`,Lr.current.src=Lr.current.src.replace(/\?.*/gi,""),Lr.current.srcset=Lr.current.srcset.replace(/\?.*/gi," 1920w"),setScroll(Yi,{useMouseEvent:wt,useCurrentScroll:!wt}),ai||(ai=!0))}function zoomOut(wt=!1){Yi=function zoomOutSetting(ze,wt){return ri=zoom_image_objectSpread({},ze),ze.zoomLevel=function decreaseZoomLevel(ze){return ze=(ze-=1)<2?0:ze}(wt?0:ze.zoomLevel),ze.zoomedSize=getZoomedImgSize(ze),ze.diff=getDiff(ze),ze}(Yi,wt);const{zoomLevel:Rt,zoomedSize:Xt}=Yi;0===Rt?(ze.classList.remove(id),Lr.current&&(Lr.current.style.width="",Lr.current.style.height=""),ai=!1):(setScroll(Yi,{useCurrentScroll:!0}),Xt&&Lr.current&&(Lr.current.style.width=`${Xt.width}px`,Lr.current.style.height=`${Xt.height}px`))}function setScroll(ze,wt){const{diff:Rt}=ze;if(!Rt)return;let Xt={x:0,y:0};wt?.useMouseEvent?Xt=function getDistanceByMouse(ze,wt){const{diff:Rt,elementBounds:Xt}=ze;if(!Rt||!Xt||!Ur.current)return{x:0,y:0};const sr=wt.clientX,Dr=wt.clientY;return{x:(sr-Xt.left)/Xt.width,y:(Dr-Xt.top)/Xt.height}}(ze,wt.useMouseEvent):wt?.useCurrentScroll&&(Xt=ri?function getDistanceByScroll(ze){const{scrollTop:wt,scrollLeft:Rt}=Ur.current,{diff:Xt}=ze;return{x:Xt?Rt/Xt.width:0,y:Xt?wt/Xt.height:0}}(ri):Xt),Ur.current.scrollLeft=Rt.width*Xt.x,Ur.current.scrollTop=Rt.height*Xt.y}function getElementBounds(){return ze.getBoundingClientRect()}function getZoomedImgSize(ze){const{elementBounds:wt,zoomLevel:Rt}=ze;if(!Lr.current||!wt)return;let Xt,sr;const Dr=wt.height/wt.width,Ur=Lr.current.naturalHeight/Lr.current.naturalWidth;return Dr<Ur?(Xt=wt.height*Rt,sr=Xt/Ur):(sr=wt.width*Rt,Xt=sr*Ur),{width:sr<wt.width?wt.width:sr,height:Xt<wt.height?wt.height:Xt}}function getDiff(ze){const{zoomedSize:wt,elementBounds:Rt}=ze;if(wt&&Rt)return{width:wt.width-Rt.width,height:wt.height-Rt.height}}return(0,Xt.We)("zoomIn",zoomIn),(0,Xt.We)("zoomOut",zoomOut),(0,Xt.iX)(ze,"mousemove",ze=>{ai&&setScroll(Yi,{useMouseEvent:ze})}),(0,Xt.iX)(qr,"mousemove",ze=>{ze.stopPropagation()}),(0,Xt.N_)(()=>{Yi.elementBounds=getElementBounds()}),(0,Dr.h)(Dr.H,null,wt&&Rt&&sr&&(0,Dr.h)(Dr.H,null,(0,Dr.h)("div",{class:"zoom-image__button-container"},(0,Dr.h)(au.D,{ariaLabel:"Zoom in",size:"small",classes:"zoom-image__zoom-button",svg:"icons-plus",hook:"zoom-image-button",onClick:ze=>{ze.preventDefault(),ze.stopPropagation(),zoomIn()}}),(0,Dr.h)(au.D,{ariaLabel:"Zoom uit",size:"small",classes:"zoom-image__zoom-button",svg:"icons-minus",hook:"zoom-image-button",onClick:ze=>{ze.preventDefault(),ze.stopPropagation(),zoomOut()}})),(0,Dr.h)("div",{role:"button",tabindex:"-1",class:"zoom-image__container","js-hook-zoom-image-container":!0,onClick:ze=>{ze.preventDefault(),ai?zoomOut(!0):zoomIn(ze)}},(0,Dr.h)(su.E,{classes:"zoom-image__image",image:Rt,alt:sr,mode:"max",settings:wt}))))};ZoomImage.props={settings:{type:Object,required:!0},url:{type:String,required:!0},alt:{type:String,required:!0}},(0,Xt.Nk)("zoom-image",ZoomImage);const nd="referral--right",od="referral--left";(0,Xt.Nk)("bpd-referral",({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-referral-left]"),Rt=(0,Xt.YP)("[js-hook-referral-right]");function getCurrentPosition(){return ze.classList.contains(nd)?"right":"left"}function isMobile(){return Oa.o1.isMobilePlusAndSmaller()}(0,Xt.iX)(wt,"click",Rt=>{isMobile()&&"right"===getCurrentPosition()&&(Rt.preventDefault(),ze.classList.add(od),ze.classList.remove(nd),wt.current.blur())}),(0,Xt.iX)(Rt,"click",wt=>{isMobile()&&"left"===getCurrentPosition()&&(wt.preventDefault(),ze.classList.add(nd),ze.classList.remove(od),Rt.current.blur())})});var ad=Rt(3609);function utilities_video_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function utilities_video_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?utilities_video_ownKeys(Object(Rt),!0).forEach(function(wt){utilities_video_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):utilities_video_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function utilities_video_defineProperty(ze,wt,Rt){return(wt=function utilities_video_toPropertyKey(ze){var wt=function utilities_video_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const sd="video--is-initialised",ld="video--is-playing",cd="video--is-paused",ud="video--is-ended",dd="video--has-played",BPDVideo=({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-video-player]"),sr=(0,Xt.YP)("[js-hook-video-play]"),[Dr]=(0,Xt.v9)("isPlaylist",null);(0,Xt.v9)("player",null);const[,,Lr]=(0,Xt.v9)("inViewPort",!1),[Ur]=(0,Xt.v9)("ignoreViewport",!1),[,qr]=(0,Wn.oR)(ad.tH);(0,Xt.We)("ready",function ready(){ze.classList.add(sd),ze.classList.add(cd)}),(0,Xt.We)("playing",playing),(0,Xt.We)("paused",function paused(){ze.classList.remove(ld),ze.classList.add(cd)}),(0,Xt.We)("ended",function ended(){ze.classList.remove(ld),ze.classList.add(ud)}),(0,Xt.We)("loadVimeoVideo",function loadVimeoVideo(wt){if(ri.videoId=wt,!ze.player)return void loadVideo();unloadVimeoVideo(),ze.player.loadVideo(wt)}),(0,Xt.We)("unloadVimeoVideo",unloadVimeoVideo);const ri=function constructVideoOptions(ze){const{videoPlatform:wt,videoId:Rt="",videoTime:Xt="0",videoControls:sr="1",videoMuted:Lr="0",videoAutoplay:Ur="0",videoLoop:qr="0",videoPlaysinline:ri="0"}=ze.dataset;return{element:ze,videoId:Rt,isPlaylist:Dr,videoPlatform:wt,videoTime:parseInt(Xt,10),videoControls:parseInt(sr,10),videoMuted:parseInt(Lr,10),videoAutoplay:parseInt(Ur,10),videoPlaysinline:parseInt(ri,10),videoLoop:parseInt(qr,10)}}(ze);async function loadVideo(){ri.videoId&&(0,ad.gs)(ri.videoPlatform)&&(ze.inViewPort||Ur)&&(ze.player||await async function loadPlayer(){if(!wt.current)return console.error("[Video] - Unable to attach player: player container not found in DOM"),!1;const Xt=utilities_video_objectSpread({player:wt.current},ri),sr=await async function getPlayer(ze){return new Promise(async wt=>{switch(ze){case"youtube":return void wt((await Rt.e(691).then(Rt.bind(Rt,2771))).default);case"vimeo":return void wt((await Promise.all([Rt.e(333),Rt.e(535)]).then(Rt.bind(Rt,6713))).default)}})}(ri.videoPlatform);return!!Xt.videoId&&(ze.player=new sr(Xt),!0)}(),(0,Pa.d)({event:"videoLoaded",eventData:utilities_video_objectSpread({},ri)}))}function unloadVimeoVideo(){const wt=ze.player;wt?.unload&&(!function reset(){ze.classList.remove(sd),ze.classList.remove(ld),ze.classList.remove(ud),ze.classList.remove(cd),ze.classList.remove(dd)}(),wt.unload())}function playing(){ze.classList.remove(ud),ze.classList.remove(cd),ze.classList.add(ld),ze.classList.add(dd)}qr(({[ri.videoPlatform]:ze})=>ze&&loadVideo()),Lr(loadVideo),(0,Xt.iX)(sr,"click",function playVideo(){ze.player?.play(),playing()})};BPDVideo.props={player:{type:Object},inViewPort:{type:Boolean},isPlaylist:{type:Boolean},ignoreViewport:{type:Boolean}},(0,Xt.Nk)("bpd-video",BPDVideo);(0,Xt.Nk)("house-hero-gallery",()=>{const ze=(0,Xt.YP)("[js-hook-house-hero-gallery-overlay]"),wt=(0,Xt.YP)("[js-hook-house-hero-gallery-cta-open-images]"),Rt=(0,Xt.YP)("[js-hook-house-hero-gallery-cta-open-vr]"),sr=(0,Xt.YP)("[js-hook-house-hero-gallery-cta-open-video]"),Dr=(0,Xt.lq)("[js-hook-house-hero-gallery-clickable-image]"),openImages=wt=>ze.current?.open({index:wt});(0,Xt.iX)(wt,"click",()=>openImages()),(0,Xt.iX)(Rt,"click",()=>ze.current?.open({vr:!0})),(0,Xt.iX)(sr,"click",()=>ze.current?.open({video:!0})),(0,Xt.N_)(()=>{Dr.current?.forEach((ze,wt)=>ze?.addEventListener("click",()=>openImages(wt)))})});var hd=Rt(3955);function utilities_slider_embla_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function utilities_slider_embla_defineProperty(ze,wt,Rt){return(wt=function utilities_slider_embla_toPropertyKey(ze){var wt=function utilities_slider_embla_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const pd="slider-embla--fade-start",fd="slider-embla--fade-end",SliderEmbla=({element:ze})=>{const[wt]=(0,Xt.v9)("centered",!1),[Rt]=(0,Xt.v9)("sliderOptions",null),[sr]=(0,Xt.v9)("controlMode",null),[Dr]=(0,Xt.v9)("showFade",!1),[Lr]=(0,Xt.v9)("onSelect",null),Ur=(0,Xt.YP)("[js-hook-slider]"),qr=(0,Xt.YP)("[js-hook-slider-control-previous]"),ri=(0,Xt.YP)("[js-hook-slider-control-next]");let ai,Yi,Ji,Qi=!1;function next(){"start-end"===sr?ai?.scrollTo(Yi.length-1):ai?.scrollNext()}function previous(){"start-end"===sr?ai?.scrollTo(0):ai?.scrollPrev()}function setSelectedState(){ai&&ri&&qr&&(ai.canScrollNext()?ri.current?.removeAttribute("disabled"):ri.current?.setAttribute("disabled","disabled"),ai.canScrollPrev()?qr.current?.removeAttribute("disabled"):qr.current?.setAttribute("disabled","disabled"))}function setFade(){if(!ai||!Yi)return;const wt=ai.slidesNotInView(),Rt=ai.selectedScrollSnap(),Xt=Yi.length-1;wt.includes(0)&&Rt>0?ze.classList.add(pd):ze.classList.remove(pd),wt.includes(Xt)&&Rt<Xt?ze.classList.add(fd):ze.classList.remove(fd)}function select(ze,wt){Ji!==ze&&(Ji=ze,ai?.scrollTo(ze,wt?.jump))}function initSlider(){const ze=Ur.current;if(!ze)return;const Xt=function utilities_slider_embla_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?utilities_slider_embla_ownKeys(Object(Rt),!0).forEach(function(wt){utilities_slider_embla_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):utilities_slider_embla_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({align:"start",containScroll:"trimSnaps",inViewThreshold:1},Rt&&JSON.parse(Rt));wt&&(Xt.align="center",Xt.containScroll="keepSnaps"),ai=(0,hd.Z)(ze,Xt),Yi=ai?.slideNodes(),ai&&(ai.on("select",()=>{setSelectedState(),Lr&&Lr(ai?.selectedScrollSnap())}),Dr&&ai.on("settle",()=>{setFade()})),Yi.forEach((ze,wt)=>{ze.addEventListener("click",()=>{select(wt)})})}function setupSlider(){ai?function destroySlider(){ai&&(ai.destroy(),ai=void 0)}():initSlider()}(0,Xt.iX)(ri,"click",next),(0,Xt.iX)(qr,"click",previous),(0,Xt.We)("select",select),(0,Xt.N_)(()=>{Ur.current&&(rs.O.observe(Ur.current,ze=>{Qi=ze}),window.addEventListener("keydown",ze=>{Qi&&function checkKey(ze){Qi&&("ArrowLeft"==ze.key||"ArrowUp"==ze.key?previous():"ArrowRight"!=ze.key&&"ArrowDown"!=ze.key||next())}(ze)}),setupSlider(),setSelectedState(),Dr&&setFade())})};SliderEmbla.props={centered:{type:Boolean},sliderOptions:{type:String},controlMode:{type:String},showFade:{type:Boolean},onSelect:{type:Function}},(0,Xt.Nk)("slider-embla",SliderEmbla);Rt(7085);var md=Rt(474),gd=Rt(2503);(0,Xt.Nk)("bpd-site-picker-modal",({element:ze})=>{let wt;(0,Xt.N_)(()=>{Jn.HP.subscribe(render,["loggedIn"]),render()});const areaPickerItemMapper=({Name:ze,RedirectUrl:wt,Id:Rt,LogoUrl:Xt})=>(0,Dr.h)("li",{class:"site-picker-modal__list-item"},(0,Dr.h)("a",{href:wt,class:"site-picker-modal__list-item-inner",onClick:()=>{return wt={eventLabel:ze},void(0,Pa.d)({event:"areaSwitch",eventCategory:"Gebieden",eventAction:"Verandert",eventLabel:wt.eventLabel});var wt}},(0,Dr.h)("div",{class:"site-picker-modal__list-item-image-wrapper"},(0,Dr.h)(Mc.E,{classes:"site-picker-modal__list-item-image",image:Xt,alt:`${ze} Logo`,preload:{width:100},objectFit:"contain"})),(0,Dr.h)("span",{class:"u-body-normal u-color--grey-50 u-flex-grow"},ze),Rt===window.__ENVIRONMENT_DETAILS__.areaId?(0,Dr.h)(Xl.Z,{name:"icons-checkmark"}):null));function render(){ze.innerHTML="",wt=(0,Jn.eo)(),wt&&wt.length>1&&ze.append((0,Dr.h)(gd.A,{id:md.a7,active:!1,title:(0,ai.qM)("MyInterests"),classes:"site-picker-modal__wrapper",noPadding:!0},(0,Dr.h)("ul",{class:"site-picker-modal__list"},wt?.map(areaPickerItemMapper))))}});const yd=!1,_d={type:"gas",supplyKnowledge:"yes",electricKnowledge:"yes",interestedHouse:""};function setupEnergyCostGTM(ze){const wt=setInterval(()=>{ze.querySelector("#wnmdl-pagination > li")&&(clearInterval(wt),function measureEnergyCostGTM(ze){const wt=ze.querySelectorAll("#wnmdl-pagination > li"),Rt=ze.querySelector("#wnmdl-btn-next"),Xt=ze.querySelector("#wnmdl-form");let sr=1;wt?.forEach(ze=>{ze.addEventListener("click",ze=>{const wt=ze.target;if(wt.classList.contains("disabled"))return;const Rt=wt?wt.getAttribute("data-index"):"1";sr=Rt?parseInt(Rt)+1:1})}),Rt?.addEventListener("click",()=>{setTimeout(()=>{(function hasError(){return!!document.querySelector(".wnmdl-error")})()||(!function handleStep(ze){switch(ze){case 1:datalayerPush(_d.type,"","",getStepTitle(1));break;case 2:{const{supplyKnowledge:ze,type:wt,supplyUsageGas:Rt,supplyUsageHeat:Xt,houseDetailsType:sr,houseDetailsBuildYear:Dr,houseDetailsSize:Lr}=_d,Ur="gas"===_d.type?Rt:Xt;datalayerPush(wt,ze,("yes"===ze?Ur:`${sr}_${Dr}_${Lr}`)||"",getStepTitle(2,{type:wt}));break}case 3:{const{electricKnowledge:ze,electricUsage:wt,houseDetailsType:Rt,houseDetailsSize:Xt,residents:sr}=_d;let Dr="";"yes"===ze?Dr=wt||"":Rt&&Xt&&sr?Dr=`${Rt}_${Xt}_${sr}`:sr&&(Dr=sr),datalayerPush("electricity",ze,Dr,getStepTitle(3));break}case 4:datalayerPush("house interest","",_d.interestedHouse,getStepTitle(4)),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"gtm.virtualPageview",virtualURL:"/energ
20iecalculator/details",virtualTitle:"Energiecalculator - Details"}),datalayerPush("house interest","",_d.interestedHouse,getStepTitle(5))}}(sr),sr++)},0)},{capture:!0}),Xt?.addEventListener("change",()=>{const ze=new FormData(Xt).entries();for(const wt of ze){const[ze,Rt]=wt;switch(ze){case"energiesoort":yd,_d.type="gas"===Rt?"gas":"city heating";break;case"energieverbruikmodus":yd,_d.houseDetailsType="",_d.houseDetailsBuildYear="",_d.houseDetailsSize="",_d.supplyUsageGas="",_d.supplyUsageHeat="",_d.supplyKnowledge="1"===Rt?"yes":"no";break;case"warmteverbruik":yd,_d.supplyUsageHeat=`${Rt}`;break;case"gasverbruik":yd,_d.supplyUsageGas=`${Rt}`;break;case"woningtype":yd,houseType(Rt);break;case"bouwjaar":yd,houseBuildYear(Rt);break;case"woonoppervlak":yd,houseSize(Rt);break;case"elektraverbruikmodus":yd,_d.electricKnowledge="1"===Rt?"yes":"no";break;case"elektraverbruik":yd,_d.electricUsage=`${Rt}`;break;case"bewoners":yd,residents(Rt);break;case"bouwnummer":yd,_d.interestedHouse=`${Rt}`}}},{capture:!0})}(ze))},200)}function getStepTitle(ze,wt){switch(ze){case 1:return"1. Welk type warmtelevering gebruik je in je huidige woning?";case 2:return"gas"===wt?.type?"2. Weet je jouw huidige gasverbruik?":"2. Weet je jouw huidige warmteverbruik?";case 3:return"3. Weet je jouw huidige elektriciteitsverbruik?";case 4:return"4. In welke nieuwe woning heb je interesse?";default:return"Energiebesparing berekend."}}function houseSize(ze){switch(ze){case"1":_d.houseDetailsSize="15-tot-50-m²";break;case"2":_d.houseDetailsSize="50-tot-75-m²";break;case"3":_d.houseDetailsSize="75-tot-100-m²";break;case"4":_d.houseDetailsSize="100-tot-150-m²";break;case"5":_d.houseDetailsSize="150-tot-250-m²";break;case"6":_d.houseDetailsSize="250-tot-500-m²"}}function residents(ze){switch(ze){case"1":_d.residents="1-persoon";break;case"5":_d.residents="5-of-meer";break;default:_d.residents=`${ze}-personen`}}function houseBuildYear(ze){switch(ze){case"1":_d.houseDetailsBuildYear="1945-of-eerder";break;case"2":_d.houseDetailsBuildYear="1946-en-1964";break;case"3":_d.houseDetailsType="1965-en-1974";break;case"4":_d.houseDetailsBuildYear="1975-en-1991";break;case"5":_d.houseDetailsBuildYear="1992-en-1999";break;case"6":_d.houseDetailsBuildYear="2000-en-2013";break;case"7":_d.houseDetailsBuildYear="2014-of-later"}}function houseType(ze){switch(ze){case"1":_d.houseDetailsType="appartement";break;case"2":_d.houseDetailsType="hoekwoning";break;case"3":_d.houseDetailsType="2-onder-1-kapwoning";break;case"4":_d.houseDetailsType="tussenwoning";break;case"5":_d.houseDetailsType="vrijstaande-woning"}}function datalayerPush(ze,wt,Rt,Xt){(0,Pa.d)({event:"energyCostCalculator",eventCategory:ze,eventAction:wt,title:Xt,eventLabel:Rt})}(0,Xt.Nk)("woonconfigurator-wrapper",()=>{const ze=(0,Xt.YP)("[js-hook-woonconfigurator-iframe]"),wt=(0,Xt.YP)("[js-hook-woonconfigurator-script-wrapper]");let Rt;(0,Xt.N_)(()=>{Rt=ze.current?.src||"",wt.current&&setupEnergyCostGTM(wt.current)}),(0,Xt.iX)(window,"message",wt=>{const{origin:Xt}=wt;ze.current&&Xt&&Rt.includes(Xt)&&(ze.current.style.height=`${wt.data}px`)})});const bd="tab";(0,Xt.Nk)("bpd-downloads",()=>{const ze=(0,Xt.lq)("[js-hook-downloads-tab]"),wt=(0,Xt.lq)("[js-hook-downloads-documents]");(0,Xt.N_)(()=>{ze.current[0]&&wt.current[0]&&(ze.current[0]?.setAttribute("selected",""),[...wt.current].forEach(ze=>{const wt=ze.getAttribute(bd);wt&&"1"!=wt&&(ze.style.display="none")}),wt.current[0].style.display="block")}),(0,Xt.iX)(ze,"click",Rt=>{Rt.preventDefault();const{currentTarget:Xt}=Rt,sr=Xt.getAttribute(bd);[...wt.current].forEach(Rt=>{Rt.getAttribute("tab")===sr&&(Rt.style.display="block",Xt.setAttribute("selected",""),function hideNonIndexDocuments(ze){[...wt.current].forEach(wt=>
20{wt.getAttribute(bd)!=ze&&(wt.style.display="none")})}(sr),function toggleSelectedTab(wt){[...ze.current].forEach(ze=>{ze.getAttribute(bd)!=wt&&ze.removeAttribute("selected")})}(sr))})})});const vd="hotspot-image--has-open-modal",xd="modal--is-open",wd="hotspot-image__modal--open",Sd="hotspot-image--disable-controls",Td=4/3,getDeviceHeaderHeight=()=>Oa.o1.isMobilePlusAndSmaller()?64:72,HotspotImage=({element:ze})=>{const[wt]=(0,Xt.v9)("componentWidth",null),[,Rt,Dr]=(0,Xt.v9)("currentHotspotId",null),Lr=(0,Xt.YP)("[js-hook-hotspot-image-viewport]"),Ur=(0,Xt.YP)("[js-hook-hotspot-image-content-container]"),qr=(0,Xt.YP)("[js-hook-hotspot-image-image]"),ri=(0,Xt.lq)("[js-hook-hotspot-image-hotspot-button]"),ai=(0,Xt.YP)("[js-hook-hotspot-image-hotspot-overlay]"),Yi=(0,Xt.lq)("[js-hook-hotspot-image-info]"),Ji=(0,Xt.YP)("[js-hook-hotspot-image-left]"),Qi=(0,Xt.YP)("[js-hook-hotspot-image-right]"),kn=(0,Xt.lq)("[js-hook-hotspot-image-modal-close]");let jn=null,Un=0,Yn=0,Jn=0;function closeActiveModal(wt=null){if(!jn)return;jn.classList.remove(wd);setTimeout(()=>{jn&&(Oa.o1.isMobilePlusAndSmaller()&&sr.R.html.classList.remove(xd),jn.close(),jn=null,function removeModalBackgroundState(){ze.classList.remove(vd),Lr.current?.removeEventListener("click",onBackgroundClick),ai.current?.removeAttribute("inert"),Ji.current?.removeAttribute("inert"),Qi.current?.removeAttribute("inert")}(),wt&&ze.querySelector(`[aria-controls="${wt}"]`)?.focus({preventScroll:!0}))},200)}function resizeAndAlignImage(){const Rt=Ur.current,Xt=Lr.current;if(!Rt||!Xt)return;const sr=Oa.o1.isTabletPortraitAndBigger();if(sr)return void((Rt.style.width||Rt.style.left)&&(Rt.style.width="",Rt.style.left=""));if(!Un||!Yn)return;const Dr=Un/Yn,{width:qr,height:ri}=function getSafeViewportDimensions(){if("fit-container"!==wt||Oa.o1.isMobilePlusAndSmaller())return{width:window.innerWidth,height:.9*window.innerHeight-getDeviceHeaderHeight()};{const ze=Lr.current?.clientWidth??window.innerWidth,wt=(ze=>ze/Td)(ze);return{width:ze,height:wt}}}(),ai=Dr>qr/ri;let Yi;Yi=ai&&sr?qr:ri*Dr,Rt.style.width=`${Yi}px`;const Ji=Math.abs(Yi-qr)/2;Jn=Ji,ai?(Xt.scrollLeft=Ji,Rt.style.left="0",ze.classList.remove(Sd)):(Xt.scrollLeft=0,Rt.style.left=`${Ji}px`,ze.classList.add(Sd))}function onBackgroundClick(ze){const wt=ze.target;wt&&!wt.closest(".hotspot-image__modal")&&jn&&Rt(null)}(0,Xt.N_)(function initializeImageDimensions(){const ze=qr.current;if(!ze)return;const storeImageDimensions=()=>{Un=ze.naturalWidth,Yn=ze.naturalHeight,Un&&Yn&&resizeAndAlignImage()};ze.complete&&storeImageDimensions();ze.addEventListener("load",storeImageDimensions)}),(0,Xt.iX)(window,"resize",(0,Wn.TE)(resizeAndAlignImage)),Dr((wt,Rt)=>{wt?function openHotspotModal(wt){closeActiveModal();const Rt=Array.from(Yi.current).find(ze=>ze.id===wt);if(!Rt)return;if(jn=Rt,function addModalBackgroundState(){ze.classList.add(vd),Lr.current?.addEventListener("click",onBackgroundClick),ai.current?.setAttribute("inert",""),Ji.current?.setAttribute("inert",""),Qi.current?.setAttribute("inert","")}(),function updateAriaLabels(){Array.from(ri.current).forEach(wt=>{if(!wt)return;const Rt=wt.getAttribute("aria-controls")===ze.currentHotspotId;wt.setAttribute("aria-expanded",Rt&&jn?"true":"false")})}(),Oa.o1.isMobilePlusAndSmaller())sr.R.html.classList.add(xd),Rt.showModal();else{Rt.show();const{top:wt}=ze.getBoundingClientRect(),Xt=window.scrollY+wt-getDeviceHeaderHeight();window.scrollTo({top:Xt,behavior:"smooth"})}requestAnimationFrame(()=>{Rt.classList.add(wd),Rt.querySelector("button")?.focus({preventScroll:!0})})}(wt):Rt&&closeActiveModal(Rt)}),(0,Xt.iX)(ri,"click",ze=>{const wt=ze.currentTarget.getAttribute("aria-controls");wt&&Rt(wt),ze.stopPropagation()}),(0,Xt.iX)(Ji,"click",()=>{Jn-=100,Lr.current?.scrollTo({left:Jn,behavior:"smooth"})}),(0,Xt.iX)(Qi,"click",()=>{Jn+=100,Lr.current?.scrollTo({left:Jn,behavior:"smooth"})}),(0,Xt.iX)(Lr,"scroll",()=>{if(!Lr.current)return;const{scrollLeft:ze,scrollWidth:wt,clientWidth:Rt}=Lr.current,Xt=ze+Rt===wt;0===ze?Ji.current?.setAttribute("disabled","true"):Ji.current?.removeAttribute("disabled"),Xt?Qi.current?.setAttribute("disabled","true"):Qi.current?.removeAttribute("disabled"),Jn=ze}),(0,Xt.iX)(kn,"click",ze=>{ze.preventDefault(),ze.stopPropagation(),Rt(null)}),(0,Xt.iX)(document,"keydown",ze=>{"Escape"===ze.key&&jn&&Rt(null)})};HotspotImage.props={componentWidth:{type:String,reflectToAttr:!0},currentHotspotId:{type:String,reflectToAttr:!0}},(0,Xt.Nk)("bpd-hotspot-image",HotspotImage);const SubscriptionHelperText=({element:ze})=>{const[wt]=(0,Xt.v9)("projectPhaseId",""),[,Rt]=(0,Wn.oR)(ri.or);
20function init(){const Rt=(0,ri.wz)(wt);ze.classList.toggle("u-hidden",Rt)}Rt(init,["projectPhases","user"]),(0,Xt.N_)(init)};SubscriptionHelperText.props={projectPhaseId:{type:String,required:!0}},(0,Xt.Nk)("subscription-helper-text",SubscriptionHelperText)},2397:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{I2:()=>sr,bV:()=>Lr,b_:()=>Dr,iC:()=>Xt,p1:()=>Ur,wL:()=>qr});const Xt="/krpano/krpano.xml",sr=18,Dr=97,Lr=[sr,25,38,52.5,70,84.5,Dr],Ur={SCENE_CHANGE:"krpano::sceneChange"},qr={TOGGLE_GO_BACK:"krpano::goBackToggleEvent",TOGGLE_ZOOM_IN:"krpano::zoomInToggleEvent",TOGGLE_ZOOM_OUT:"krpano::zoomOutToggleEvent"}},7538:(ze,wt,Rt)=>{"use strict";var Xt=Rt(9490),sr=Rt(7995),Dr=Rt(7173),Lr=Rt(7655),Ur=Rt(5044),qr=Rt(2530);const BpdModal=({element:ze})=>{(0,Ur.Rd)(qr.Z),(0,Xt.v9)("closeDisabled",!1),(0,Xt.v9)("hasShadow",!1),(0,Xt.v9)("hasConfirmationPopup",!1);const[,,wt]=(0,Xt.v9)("active",!1),[Rt]=(0,Xt.v9)("onModalClose",()=>null),ri=(0,Xt.YP)("[js-hook-modal]"),ai=new Event(`modalIsActive::${ze.id}`),Yi=new Event(`modalIsInactive::${ze.id}`);function handleCloseModal(){if(ze.hasConfirmationPopup){Lr.C8.getState().modals[ze.id].closeRequest?(0,Lr.pI)(ze.id):(0,Lr._H)(ze.id)}else(0,Lr.Mr)(ze.id)}function handleActiveChange(ze){const wt=ze?"add":"remove";ri.current?.classList[wt]("modal--is-showing"),Dr.R.html.classList[wt]("modal--is-open"),ze?document.dispatchEvent(ai):(Rt(),document.dispatchEvent(Yi))}return wt(handleActiveChange),(0,Xt.iX)(document,"keydown",ze=>{"Escape"===ze.key&&handleCloseModal()}),(0,Xt.N_)(()=>{handleActiveChange(ze.active),ze.id&&((0,Lr.Y_)(ze.id),Lr.C8.subscribe(({modals:wt})=>{const{active:Rt}=wt[ze.id];ze.active=Rt}))}),(0,sr.h)("div",{class:"c-modal","js-hook-modal":!0},(0,sr.h)("div",{class:"modal__container"+(ze.hasShadow?" modal__container--has-shadow":"")},(0,sr.h)("div",{class:"modal__content",role:"dialog"},(0,sr.h)("slot",null))),(0,sr.h)("div",{class:"modal__background",role:"button",tabindex:"0",onClick:handleCloseModal}))};BpdModal.props={closeDisabled:{type:Boolean,reflectToAttr:!0},active:{type:Boolean,reflectToAttr:!0},hasShadow:{type:Boolean,reflectToAttr:!0},hasConfirmationPopup:{type:Boolean,reflectToAttr:!0},onModalClose:{type:Object}},(0,Xt.Nk)("bpd-modal",BpdModal,{useShadowDom:!0})},8661:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{q:()=>ProjectPhaseCard});var Xt=Rt(7995),sr=Rt(2002),Dr=Rt(7663),Lr=Rt(5044);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ProjectPhaseCard=({classes:ze="",id:wt,image:Rt,imageAlt:Ur,title:qr,status:ri,housesAmount:ai,price:Yi,specs:Ji,hidePrice:Qi,debugId:kn})=>(0,Xt.h)("div",function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({class:`c-project-phase-card ${ze}`},wt&&{id:wt}),kn&&(0,Xt.h)("span",{class:"project-phase-card__debug-id"},kn),(0,Xt.h)("div",{class:"project-phase-card__image-container"},Rt&&(0,Xt.h)(sr.E,{classes:"project-phase-card__image",image:Rt,alt:Ur??qr,settings:{"640w":{width:232,height:144}},objectFit:!0})),(0,Xt.h)("div",{class:"project-phase-card__details"},ri&&(0,Xt.h)("span",{class:`project-phase-card__status ${Dr.Sw[ri.color]}`},ri.label),ai&&(0,Xt.h)("span",{class:"project-phase-card__houses-amount u-color--grey-30"},` - ${ai} `,(0,Lr.qM)(1===ai?"House":"Houses")),(0,Xt.h)("p",{class:"project-phase-card__title"},qr),Yi?.amount&&!Qi&&(0,Xt.h)("div",{class:"project-phase-card__price"},Yi.prefix&&Yi.prefix," ",Yi.amount&&Yi.amount," ",Yi.suffix&&Yi.suffix),Ji&&(0,Xt.h)("ul",{class:"project-phase-card__specs"},Ji.map(({value:ze,suffix:wt})=>(0,Xt.h)("li",{class:"project-phase-card__spec"},ze," ",wt)))))},8620:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{J:()=>PropertyCard});var Xt=Rt(7995),sr=Rt(2002),Dr=Rt(7663);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const PropertyCard=ze=>{const{classes:wt="",href:Rt,id:Lr,image:Ur,imageAlt:qr,title:ri,number:ai,status:Yi,price:Ji,specs:Qi,project:kn,wishlistItemCount:jn,hidePrice:Un,debugId:Wn,orientation:Yn}=ze,{hasWishlist:Jn}=window.__ENVIRONMENT_DETAILS__,Qn=_objectSpread({"c-property-card":!0,[wt]:!0},Yn&&{[`property-card--${Yn}`]:!0});return(0,Xt.h)("a",_objectSpread({class:Qn,href:Rt},Lr&&{id:Lr}),Wn&&(0,Xt.h)("span",{class:"property-card__debug-id"},Wn),(0,Xt.h)("div",{class:"property-card__image-container"},Ur&&(0,Xt.h)(sr.E,{classes:"property-card__image",image:Ur,alt:qr??`${ri} ${kn}`,settings:{"640w":{width:232,height:144}},objectFit:!0}),Jn&&jn&&(0,Xt.h)("bpd-wishlist-favourite-button",{"construction-number-id":Lr,count:jn})),ai&&(0,Xt.h)("div",{class:"u-flex u-flex-center"},(0,Xt.h)("span",{class:"property-card__number"},ai)),(0,Xt.h)("div",{class:"property-card__details"},Yi&&(0,Xt.h)("span",{class:`property-card__status ${Dr.Sw[Yi.color]}`},Yi.label),(0,Xt.h)("h3",{class:"property-card__title"},ri),Ji?.amount&&!Un&&(0,Xt.h)("div",{class:"property-card__price"},Ji.prefix&&Ji.prefix," ",Ji.amount&&Ji.amount," ",Ji.suffix&&Ji.suffix),Qi&&(0,Xt.h)("ul",{class:"property-card__specs"},Qi.map(ze=>(0,Xt.h)("li",{class:"property-card__spec"},ze))),kn&&(0,Xt.h)("span",{class:"property-card__project"},kn)))}},7085:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Fy:()=>Xt});Rt(7995),Rt(2002),Rt(6320);const Xt="js-hook-slider-progress-cell-container";var sr=Rt(9490),Dr=Rt(524),Lr=Rt(2117),Ur=Rt(3955);const SliderProgress=({element:ze})=>{const[wt]=(0,sr.v9)("autoSlide",!1),[Rt]=(0,sr.v9)("autoSlideTimeout",3e3),[Xt]=(0,sr.v9)("sliderIfNotGreaterThan",null),[qr]=(0,sr.v9)("slidesToScroll",1),[,ri,ai]=(0,sr.v9)("inView",!1),Yi=(0,sr.YP)("[js-hook-slider-progress]"),Ji=(0,sr.YP)("[js-hook-slider-progress-footer]"),Qi=(0,sr.YP)("[js-hook-slider-progress-progress]"),kn=(0,sr.YP)("[js-hook-slider-progress-previous]"),jn=(0,sr.YP)("[js-hook-slider-progress-next]");let Un,Wn,Yn,Jn=null,Qn=0,Io=!1;function nextSlide(){(Un?.canScrollNext()||Qn+1<Wn.length)&&select(Qn+1)}function previousSlide(){Un?.canScrollPrev()&&select(Qn-1)}function setSelectedState(){Un&&(ze.classList.toggle("slider-progress--start-position",Qn<=0),ze.classList.toggle("slider-progress--end-position",Qn>=Wn.length-1),Wn.forEach((ze,wt)=>ze.classList.toggle("slider-progress__cell--is-selected",wt===Qn)))}function select(ze,wt){(Qn!==ze||wt?.force)&&(Qn=ze<0?0:ze>=Wn.length?Wn.length-1:ze,wt?.noScroll||Un?.scrollTo(Qn,!1),setSelectedState(),function fillSliderProgress(){if(!Un||!Qi.current)return;const ze=(Qn+1)/Wn.length*100;Qi.current.style.transform=`translate(${ze}%, -50%)`}())}function addAutoPlay(){Un&&(Yn=((ze,wt)=>{const Rt={timer:0},play=()=>{stop(),requestAnimationFrame(()=>Rt.timer=window.setTimeout(next,wt))},stop=()=>{window.clearTimeout(Rt.timer),Rt.timer=0},next=()=>{ze.canScrollNext()?ze.scrollNext():ze.scrollTo(0),play()};return{play,stop}})(Un,Rt),Yn.play())}
20function checkKey(wt){ze.inView&&("ArrowLeft"==wt.key?previousSlide():"ArrowRight"==wt.key&&nextSlide())}function destroySlider(){Un&&(Un.destroy(),Un=void 0)}function setupSlider(){!function showAsSlider(){if(Xt){const ze=(0,Lr.bc)();return Object.keys(Lr.AV).indexOf(ze||"")<Object.keys(Lr.AV).indexOf(Xt||"")}return!0}()||Un?destroySlider():function initSlider(){Yi.current&&(Un=(0,Ur.Z)(Yi.current,{align:"center",slidesToScroll:(0,Lr.tq)()?1:qr,containScroll:"trimSnaps",dragFree:!1,skipSnaps:!0,watchFocus(ze,wt){const Rt=wt.currentTarget,Xt=Rt&&Wn.indexOf(Rt);return Xt>=0&&select(Xt,{noScroll:!0}),!0},watchDrag:()=>(Io=!0,!0)}),Un&&(Wn=Un.slideNodes(),Wn.length>1&&Ji.current?.classList.add("slider-progress__footer--has-items"),Jn=Wn.findIndex(ze=>ze.hasAttribute("js-hook-slider-slide-to-here")),Jn<0&&(select(0,{force:!0}),Jn=null),wt&&addAutoPlay(),Un.on("scroll",()=>{Io&&select(Un.selectedScrollSnap(),{noScroll:!0})}),Yn&&(Un.on("pointerDown",()=>{Yn?.stop()}),Un.on("pointerUp",()=>{Yn?.play()}))))}()}(0,sr.N_)(function componentDidLoad(){if(!Yi.current)return;setupSlider(),setSelectedState(),window.addEventListener("keydown",checkKey),Dr.O.observe(Yi.current,ri)}),(0,sr.iX)(jn,"click",nextSlide),(0,sr.iX)(kn,"click",previousSlide),(0,sr.We)("reload",function reloadSlider(){destroySlider(),setupSlider(),setSelectedState()}),ai(ze=>{ze&&Jn&&(select(Jn),Jn=null)})};SliderProgress.props={autoSlide:{type:Boolean},autoSlideTimeout:{type:Number},sliderIfNotGreaterThan:{type:String},slidesToScroll:{type:Number,reflectToAttr:!0},inView:{type:Boolean}},(0,sr.Nk)("bpd-slider-progress",SliderProgress)},3536:(ze,wt,Rt)=>{"use strict";Rt.r(wt),Rt.d(wt,{SUBSCRIPTION_MODAL_ID:()=>Ur,SmartSubscription:()=>SmartSubscription});var Xt=Rt(9490),sr=Rt(6308),Dr=Rt(5044),Lr=Rt(8248);const Ur="smart-subscription-modal",qr="[js-hook-smart-subscription-zipcode] bpd-input",ri="[js-hook-smart-subscription-housenumber] bpd-input",ai="[js-hook-smart-subscription-housenumber-suffix] bpd-input",Yi="[js-hook-smart-subscription-street] bpd-input",Ji="[js-hook-smart-subscription-city] bpd-input",SmartSubscription=({element:ze})=>{const wt=(0,Xt.YP)("[js-hook-smart-subscription-project-signup-form]");(0,Xt.YP)("bpd-pages",{as:"bpdPages"}),(0,Xt.iX)(wt,"serializedForm",async wt=>async function handleFormSubmit(wt){const Xt=wt.detail;Io(!0);try{const wt=(0,Lr.TR)(),Dr=(0,sr.xg)(),{projectPhaseId:Ur,districtId:qr,area:ri,name:ai}=Dr;if(!(wt&&Ur&&ai))return;await(0,Lr.Az)({areaInfo:{projectPhaseId:Ur,areaProjectId:Rt,areaProjectName:ri||"",districtId:qr||""},userInfo:{firstName:wt.firstName||"",lastName:wt.lastName||"",initials:wt.initials,email:wt.email||"",gender:wt.gender,website:Xt.website},address:{zipcode:Xt.postalCode,street:Xt.street,houseNumber:Xt.houseNumber,houseNumberAddition:Xt.houseNumberSuffix,city:Xt.city,phoneNumber:Xt.phoneNumber,country:Xt.country},GTMEventLabel:ri||""}),ze.bpdPages.selectNext()}finally{Io(!1)}}(wt));const Rt=window.__ENVIRONMENT_DETAILS__.areaId,Ur=(0,Xt.YP)(qr),Qi=(0,Xt.YP)(ri),kn=(0,Xt.YP)(ai),jn=(0,Xt.YP)(Yi),Un=(0,Xt.YP)(Ji),Wn=(0,Xt.YP)("[js-hook-smart-subscription-phonenumber] bpd-input"),Yn=(0,Xt.YP)("[js-hook-smart-subscription-country] bpd-input"),Jn=(0,Dr.bM)({element:ze,hooks:{postcodeHook:qr,houseNumberHook:ri,houseNumberAdditionHook:ai,streetNameHook:Yi,placeNameHook:Ji}}),Qn=(0,Xt.YP)("[js-hook-smart-subscription-confirmation-phases]"),Io=(0,Dr.iY)("[js-hook-smart-subscription-submit]");let Mo=(0,Lr.Nv)();(0,Xt.N_)(()=>{Jn?.initialize(),Mo&&(ze.bpdPages.setPage((0,Lr.lQ)(Mo)?"1":"0"),function preFillModal(ze){const{zipcode:wt,houseNumber:Rt,houseNumberAddition:Xt}=ze;wt&&Ur.current.rebindValue(wt),Rt&&Qi.current.rebindValue(Rt),Xt&&kn.current.rebindValue(Xt);const{street:sr,city:Dr,phoneNumber:Lr,country:qr}=ze;sr&&jn.current.rebindValue(sr),Dr&&Un.current.rebindValue(Dr),Lr&&Wn.current.rebindValue(Lr),qr&&Yn.current.rebindValue(qr)}(Mo))}),Lr.or.subscribe(({address:wt})=>{Mo=wt,Mo&&(0,Lr.lQ)(Mo)&&ze.bpdPages.setPage("1")},["address"]),sr.pm.subscribe(({project:ze})=>{Qn.current.innerHTML=`Je bent aangemeld voor de woningtypes van project ${ze.name}`},["project"])};
20(0,Xt.Nk)("smart-subscription",SmartSubscription)},1704:(ze,wt,Rt)=>{"use strict";var Xt=Rt(9490),sr=Rt(7995),Dr=Rt(1856),Lr=Rt(3352),Ur=Rt(7655),qr=Rt(6308),ri=Rt(5044),ai=Rt(8248),Yi=Rt(3536);const SubscriptionBox=({element:ze})=>{const[wt]=(0,Xt.v9)("boxTitle",null),[Rt]=(0,Xt.v9)("boxContent"),[Ji]=(0,Xt.v9)("variant",null),[Qi]=(0,Xt.v9)("buttonLabel"),[kn]=(0,Xt.v9)("projectPhaseId"),[jn]=(0,Xt.v9)("projectPhaseName"),[Un]=(0,Xt.v9)("districtId"),[Wn]=(0,Xt.v9)("constructionNumberName",""),[Yn]=(0,Xt.v9)("deleteWhenSubscribed",!1),Jn=window.__ENVIRONMENT_DETAILS__.areaId;let Qn="c-subscription-box";return Qn=Ji?`${Qn} subscription-box--${Ji}`:Qn,ai.or.subscribe(({projectPhases:wt})=>{if(Yn){!!wt?.find(ze=>ze===kn)&&ze.remove()}},["projectPhases"]),(0,sr.h)("div",{class:Qn},(0,sr.h)("div",null,(0,sr.h)("h4",{class:"subscription-box__title"},wt||(0,ri.qM)("SubscriptionBox.Title",{replace:[{id:"Phase",value:jn}]})),(0,sr.h)("p",{class:"subscription-box__description"},Rt)),(0,sr.h)(Dr.zx,{variant:"vertical"===Ji?"tertiary":"primary",width:"vertical"===Ji?"full-width":void 0,type:"button",label:Qi,classes:"subscription-box__button",onClick:()=>async function handleSubscription(){const{user:ze,address:wt}=ai.or.getState(),Rt=await(0,Lr.aY)(Jn);(0,qr.UI)({districtId:Un,projectPhaseId:kn,title:Wn,area:Rt.name||"",name:jn}),ze&&wt&&(0,ai.lQ)(wt)?(0,ai.Az)({areaInfo:{projectPhaseId:kn,areaProjectId:Rt.id,areaProjectName:Rt.name||"",districtId:Un},userInfo:{firstName:ze.firstName||"",lastName:ze.lastName,initials:ze.initials,email:ze.email,gender:ze.gender}}).then(()=>{(0,Ur.h7)(Yi.SUBSCRIPTION_MODAL_ID)}):(0,Ur.h7)(Yi.SUBSCRIPTION_MODAL_ID)}()}))};SubscriptionBox.props={boxTitle:{type:String},boxContent:{type:String,required:!0},variant:{type:String},buttonLabel:{type:String,required:!0},projectPhaseId:{type:String,required:!0},projectPhaseName:{type:String,required:!0},districtId:{type:String,required:!0},propertyTypeId:{type:String},constructionNumberName:{type:String},deleteWhenSubscribed:{type:Boolean}},(0,Xt.Nk)("subscription-box",SubscriptionBox)},6928:(ze,wt,Rt)=>{"use strict";var Xt=Rt(9490),sr=Rt(7995),Dr=Rt(2503),Lr=Rt(7655),Ur=Rt(5940),qr=Rt(5044),ri=Rt(4356);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const BpdIframeModal=({element:ze})=>{(0,qr.Rd)(ri.Z);const wt=(0,Xt.YP)("[js-hook-modal-wrapper-content]"),[Rt]=(0,Xt.v9)("id"),[ai]=(0,Xt.v9)("iframeId",null),[,Yi,Ji]=(0,Xt.v9)("active",!1),[Qi]=(0,Xt.v9)("src",""),[kn]=(0,Xt.v9)("modalTitle",""),[jn]=(0,Xt.v9)("minWidth","100%"),[Un]=(0,Xt.v9)("minHeight","50vh"),[Wn]=(0,Xt.v9)("useCssDimensions",!1),[Yn]=(0,Xt.v9)("noPadding",!1),[Jn]=(0,Xt.v9)("classes",""),[Qn]=(0,Xt.v9)("trackState",!1);let Io=!1;const Mo=_objectSpread({event:"iframe-modal-state",modalId:ze.id},ze.dataset),jo={"bpd-iframe-modal__container":!0,[Jn]:!!Jn};function open(ze){if(ze){if(Io)(0,Lr.Eb)(Rt)&&!(0,Lr.T)(Rt)&&(0,Lr.h7)(Rt);else{const ze=function createIframe(){const ze=document.createElement("iframe");ze.src=Qi,Wn||ze.setAttribute("style",`min-width: ${jn}; min-height: ${Un};`);ai&&(ze.id=ai);return ze.onload=()=>{(0,Lr.T)(Rt)||(0,Lr.h7)(Rt)},ze}();wt.current?.appendChild(ze),Io=!0}Qn&&(0,Ur.d)(_objectSpread(_objectSpread({},Mo),{},{eventAction:"open"}))}else Qn&&(0,Ur.d)(_objectSpread(_objectSpread({},Mo),{},{eventAction:"close"}))}return(0,Xt.N_)(()=>{ze.active&&open(!0),Lr.C8.subscribe(({modals:ze})=>{const{active:wt}=ze[Rt];Yi(wt)},["modals"])}),Ji(open),(0,Xt.iX)(window,"message",function iframeMessageReceived(ze){const{data:wt,modalId:Xt}=ze.data;Xt===Rt&&function runAction(ze){const wt=ze.close;wt&&(0,Lr.Mr)(Rt)}(wt)}),(0,sr.h)("div",{class:jo},(0,sr.h)(Dr.A,{id:Rt,active:!1,title:kn,noPadding:Yn}))};BpdIframeModal.props={id:{type:String,required:!0,reflectToAttr:!0},iframeId:{type:String,reflectToAttr:!0},active:{type:String,reflectToAttr:!0},src:{type:String,reflectToAttr:!0},modalTitle:{type:String},minWidth:{type:String},minHeight:{type:String},useCssDimensions:{type:Boolean},noPadding:{type:Boolean},classes:{type:String},trackState:{type:Boolean}},(0,Xt.Nk)("bpd-iframe-modal",BpdIframeModal)},9162:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{$Y:()=>Dr,EO:()=>sr,Eu:()=>Lr,lT:()=>Xt});const Xt="a0U2000000DuCWyEAN",sr="a0U2000000DuCXDEA3",Dr="nl-NL",Lr="de-DE"},474:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Cf:()=>sr,PO:()=>Dr,a7:()=>Xt});const Xt="area-picker-modal",sr="js-hook-loadable-modal";var Dr;!function(ze){ze.AREA_PICKER="area-picker-modal",ze.MORTGAGE_TOOL="mortgage-tool",ze.LEAD_FORM="lead-form",ze.BROCHURE_FORM="brochure-form",ze.NEWSLETTER_FORM="newsletter-form",ze.MESSAGE_FORM="message-form-modal",ze.HOUSING_MODULE="housing-module",ze.MORTGAGE_TOOL_RABO="mortgage-tool-rabo"}(Dr||(Dr={}))},9389:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{V:()=>AreaSubscriptionListCard,g:()=>qr});var Xt=Rt(7995),sr=Rt(7691),Dr=Rt(2002),Lr=Rt(7663),Ur=Rt(5044);const qr="area-subscription-list-card-toggle-input",AreaSubscriptionListCard=ze=>{const{id:wt,classes:Rt="",image:ri,imageAlt:ai,title:Yi,status:Ji,children:Qi,selectable:kn,checkboxLabel:jn,onItemClick:Un}=ze,Wn=(0,Xt.h)("button",{class:`c-area-subscription-list-card ${kn?"area-subscription-list-card--selectable":""} ${Rt}`.trim(),onClick:async function handleClick(){const ze=Wn.querySelector(`[js-
20hook-${qr}]`);ze.checked=!ze.checked,Un&&Un(wt,ze.checked);const Rt=document.querySelector("[js-hook-area-subscription-subscribe-area-only-toggle]"),Xt=Rt?.querySelector("[js-hook-area-subscription-subscribe-area-only-toggle-input]"),sr=Rt?.querySelector("[js-hook-area-subscription-subscribe-area-only-toggle-label]"),Dr=await(0,Ur.WU)("AreaSubscription.Modal.Step1.AreaOnlyToggleLabelDisabled");Xt&&sr&&(sr.getAttribute("regular-label")||sr.setAttribute("regular-label",sr.innerText),ze.checked?(Xt.disabled=!0,Rt?.classList.add("disabled"),sr.innerText=Dr):(Xt.disabled=!1,Rt?.classList.remove("disabled"),sr.innerText=sr.getAttribute("regular-label")||""))}},(0,Xt.h)("div",{class:"area-subscription-list-card__inner"},ri&&(0,Xt.h)(Dr.E,{classes:"area-subscription-list-card__image",image:ri,alt:ai??`${Yi} ${wt}`,preload:{width:16,height:12},settings:{"320w":{width:320,height:240},"480w":{width:480,height:320},"640w":{width:640,height:480},"800w":{width:800,height:600}},objectFit:!0}),(0,Xt.h)("div",{class:"area-subscription-list-card__details"},(0,Xt.h)("div",null,Ji?(0,Xt.h)("span",{class:`u-body-normal ${Lr.Sw[Ji.color]}`},Ji.label):null,(0,Xt.h)("div",{class:"u-margin-top-2"},(0,Xt.h)("p",{class:"u-body-normal-bold"},Yi),Qi?(0,Xt.h)("div",{class:"s-rich-text"},Qi):null)),kn&&jn?(0,Xt.h)(sr.Z,{label:jn,hook:qr,value:wt,id:`area-subscription-list-card-checkbox-${wt}`,name:"area-subscription-list-card-checkbox",classes:"area-subscription__checkbox area-subscription-list-card__checkbox",hideError:!0}):null)));const setToggleHover=ze=>{Wn.querySelector(`[js-hook-${qr}]`).classList[ze?"add":"remove"]("checkbox__input--force-hover")};return Wn.addEventListener("mouseenter",()=>setToggleHover(!0)),Wn.addEventListener("mouseleave",()=>setToggleHover(!1)),Wn}},5506:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{NC:()=>AreaSubscriptionForm,VY:()=>Xt.V,ns:()=>AreaSubscriptionNavigationBar,gD:()=>Xt.g,h6:()=>renderSummary});var Xt=Rt(9389),sr=Rt(7995),Dr=Rt(8178),Lr=Rt(8182),Ur=Rt(6346),qr=Rt(5044);const AreaSubscriptionForm=({areaOnly:ze,formReversed:wt,preFilledInputs:Rt,classes:Xt})=>(0,sr.h)(Dr.Wg,{hook:"area-subscription-modal-form",classes:`c-area-subscription-form ${Xt}`.trim()},(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,11]},(0,sr.h)("p",{class:"u-h5 u-h3--md u-margin-top-6"},(0,qr.qM)("AreaSubscription.Modal.Step2.Title")))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,10]},(0,sr.h)("p",{class:"u-margin-top-3 u-margin-bottom-3 s-rich-text"},(0,qr.qM)("AreaSubscription.Modal.Step2.Description")))),(0,sr.h)("div",{class:"area-subscription-form "+(wt?"area-subscription-form--reversed":"")},(0,sr.h)("div",{"js-hook-area-subscription-contact-details-section":!0},(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,9]},(0,sr.h)("p",{class:"u-h6 u-h4--md u-h6 u-h4--md area-subscription-form__title"},(0,qr.qM)("AreaSubscription.Modal.Step2.ContactTitle")))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,9]},(0,sr.h)("p",{class:"area-subscription-form__description"},(0,qr.qM)("AreaSubscription.Modal.Step2.ContactDescription")))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.kO,{label:(0,qr.qM)("EmailAdres"),id:"area-subscription-form-email",name:"email",validationTypes:"required,email",value:Rt?.email,readonly:!!Rt?.email}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.aR,{validationTypes:"required",horizontal:!0,options:[{name:"gender",id:"area-subscription-form-gender-dhr",label:(0,qr.qM)("Acronym-Mister"),value:"Mr",checked:"Mr"===Rt?.gender},{name:"gender",id:"area-subscription-form-gender-ms",label:(0,qr.qM)("Acronym-Misses"),value:"Mrs",checked:"Mrs"===Rt?.gender}],label:(0,qr.qM)("Salutation"),disabled:!!Rt?.gender}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.kO,{label:(0,qr.qM)("FirstName"),id:"area-subscription-form-first-name",name:"first-name",validationTypes:"required,text",value:Rt?.firstName,readonly:!!Rt?.firstName}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,3]},(0,sr.h)(Dr.kO,{label:(0,qr.qM)("LastNamePrefix"),id:"area-subscription-form-last-name-prefix",name:"last-name-prefix",validationTypes:"text",value:Rt?.lastNamePrefix,readonly:!!Rt?.lastNamePrefix})),(0,sr.h)(Ur.JX,{cols:[12,,5]},(0,sr.h)(Dr.kO,{label:(0,qr.qM)("LastName"),id:"area-subscription-form-last-name",name:"last-name",validationTypes:"required,text",value:Rt?.lastName,readonly:!!Rt?.lastName})))),!ze&&(0,sr.h)("div",{"js-hook-area-subscription-address-detail
20s-section":!0},(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,9]},(0,sr.h)("p",{class:"u-h6 u-h4--md area-subscription-form__title"},(0,qr.qM)("AreaSubscription.Modal.Step2.AddressTitle")))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,9]},(0,sr.h)("p",{class:"area-subscription-form__description"},(0,qr.qM)("AreaSubscription.Modal.Step2.AddressDescription")))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,3]},(0,sr.h)(Dr.kO,{bpdInputHook:"area-subscription-form-zipcode",label:(0,qr.qM)("Postcode"),id:"area-subscription-form-zipcode",name:"zipcode",validationTypes:"required,zipCode",value:Rt?.zipcode,readonly:!!Rt?.zipcode})),(0,sr.h)(Ur.JX,{cols:[8,,3]},(0,sr.h)(Dr.kO,{bpdInputHook:"area-subscription-form-housenumber",label:(0,qr.qM)("HouseNumber"),id:"area-subscription-form-house-number",name:"house-number",validationTypes:"required,number",value:Rt?.houseNumber,readonly:!!Rt?.houseNumber})),(0,sr.h)(Ur.JX,{cols:[4,,2]},(0,sr.h)(Dr.kO,{bpdInputHook:"area-subscription-form-houseaddition",label:(0,qr.qM)("HouseAddition"),id:"area-subscription-form-house-number-addition",name:"house-number-addition",validationTypes:"text",value:Rt?.houseNumberAddition,readonly:!!Rt?.houseNumberAddition}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.kO,{bpdInputHook:"area-subscription-form-streename",label:(0,qr.qM)("StreetName"),id:"area-subscription-form-street",name:"street",validationTypes:"required,text",value:Rt?.street,readonly:!!Rt?.street}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.kO,{bpdInputHook:"area-subscription-form-city",label:(0,qr.qM)("Place"),id:"area-subscription-form-city",name:"city",validationTypes:"required,text",value:Rt?.city,readonly:!!Rt?.city}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)(Dr.kO,{label:(0,qr.qM)("PhoneNumber"),id:"area-subscription-form-phone",name:"phone-number",validationTypes:"required,phone",value:Rt?.phoneNumber,readonly:!!Rt?.phoneNumber}))),(0,sr.h)(Ur.X2,null,(0,sr.h)(Ur.JX,{cols:[12,,8]},(0,sr.h)("select-country",{id:"country",name:"country",label:(0,qr.qM)("land"),preFilledCountry:Rt?.country}))))),(0,sr.h)(Lr.X,{id:"area-subscription-form-website",name:"website"}));var ri=Rt(1856),ai=Rt(8118);const AreaSubscriptionNavigationBar=ze=>(0,sr.h)("div",{class:`c-area-subscription-navigation-bar ${ze.classes}`.trim()},(0,sr.h)("span",{class:"u-color--positive u-margin-right-1 u-hidden--xs u-hidden--sm"+(ze.checkmark?"":" u-hidden"),"js-hook-area-subscription-navigation-checkmark":!0},(0,sr.h)(ai.Z,{name:"icons-checkmark",attr:{style:{width:"1.2rem",height:"0.8rem"}}})),(0,sr.h)("p",{class:"u-body-normal u-margin-right-3 u-hidden--xs u-hidden--sm","js-hook-area-subscription-navigation-helper-text":!0},ze.helperText),(0,sr.h)(ri.zx,{width:"full-width-mobile",label:ze.ctaLabel||"",onClick:ze.ctaAction,hook:"area-subscription-navigation-cta",hasLoading:!0,disabled:!0}));function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const AreaSubscriptionSummaryList=ze=>{if(ze)return(0,sr.h)("div",{class:"u-margin-top-3 u-margin-bottom-3"},(0,sr.h)("p",{class:"u-body-normal-bold"},ze.title),(0,sr.h)("div",{class:"u-margin-top-2 u-margin-left-1"},ze.items.map(ze=>(0,sr.h)(SummaryItem,_objectSpread({},ze)))),ze.afterText&&(0,sr.h)("p",{class:"u-margin-top-2"},ze.afterText))},SummaryItem=ze=>(0,sr.h)("div",{class:"u-flex u-margin-top-1"},(0,sr.h)("span",{class:"u-color--"+(ze.positive?"positive":"alert")},(0,sr.h)(ai.Z,{name:"icons-"+(ze.positive?"checkmark":"close")})),(0,sr.h)("p",{class:"u-margin-left-1"},ze.value)),renderSummary=ze=>(0,sr.h)(AreaSubscriptionSummaryList,_objectSpread({},ze));var Yi=Rt(9490),Ji=Rt(5737),Qi=Rt(6646),kn=Rt(6204),jn=Rt(7691),Un=Rt(9227),Wn=Rt(3352),Yn=Rt(9162),Jn=Rt(5668),Qn=Rt(899),Io=Rt(6206),Mo=Rt(8248);function form_helpers_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function form_helpers_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?form_helpers_ownKeys(Object(Rt),!0).forEach(function(wt){form_helpers_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):form_helpers_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function form_helpers_defineProperty(ze,wt,Rt){return(wt=function form_helpers_toPropertyKey(ze){var wt=function form_helpers_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const extractFormData=(ze,wt)=>{const Rt={},{formRequired:Xt}=Qn.MH.getState();if(Xt){if(!ze)return Rt;const{email:Xt,gender:sr,country:Dr,city:Lr,street:Ur,zipcode:qr,"first-name":ri,"last-name-prefix":ai,"last-name":Yi,"house-number":Ji,"house-number-addition":Qi,"phone-number":kn,website:jn}=ze.serializeForm();Rt.userInfo={firstName:ri,lastName:Yi,lastNamePrefix:ai,email:Xt,gender:sr,website:jn},wt?.areaOnly||(Rt.addressInfo={zipcode:qr,houseNumber:Ji,houseNumberAddition:Qi,street:Ur,city:Lr,phoneNumber:kn,country:Dr})}else{const{user:ze,address:wt}=(0,Mo.C_)();Rt.userInfo=ze,Rt.addressInfo=wt}return Rt},submitSelection=async ze=>{const{step:wt,formData:Rt}=ze,{areaOnly:Xt}=Qn.MH.getState();switch(wt){case 0:case 1:Xt?await(async ze=>{const{districtId:wt,areaId:Rt}=window.__ENVIRONMENT_DETAILS__,{areaProject:Xt}=await Wn._n.getData(Rt),sr={areaInfo:form_helpers_objectSpread({areaProjectId:Xt.id,areaProjectName:Xt.name},wt&&{districtId:wt}),userInfo:ze.userInfo};return await(0,Mo.US)(sr),sr})(Rt):await(async ze=>{const{selectedProjectPhases:wt,areaSelected:Rt}=Qn.MH.getState(),{projectPhases:Xt,areaProject:sr}=await Wn._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),Dr=Xt.filter(({id:ze})=>wt.includes(ze)).map(wt=>({areaInfo:{areaProjectId:sr.id,areaProjectName:sr.name||"",districtId:wt?.districtId||"",projectPhaseId:wt.id},userInfo:ze.userInfo,address:ze.addressInfo}));let Lr;return Rt&&(Lr={areaInfo:{areaProjectId:sr.id,areaProjectName:sr.name||"",districtId:window.__ENVIRONMENT_DETAILS__?.districtId||""},userInfo:ze.userInfo}),await(0,Mo.Iq)(Dr,Lr),Dr})(Rt);break;case 2:await(async ze=>{const{selectedPropertyTypes:wt}=Qn.MH.getState(),{areaProject:Rt,propertyTypes:Xt}=await Wn._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),sr=Xt.filter(({id:ze})=>wt.includes(ze)).map(wt=>({areaInfo:{areaProjectId:Rt.id,areaProjectName:Rt.name||"",districtId:wt?.districtId||"",projectPhaseId:wt.projectPhaseId||"",propertyTypeId:wt.id},userInfo:ze.userInfo,address:ze.addressInfo}));return await(0,Mo.SF)(sr),sr})(Rt)}};var jo=Rt(28),zo=Rt(7655),oa=Rt(5940);function area_subscription_modal_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function area_subscription_modal_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?area_subscription_modal_ownKeys(Object(Rt),!0).forEach(function(wt){area_subscription_modal_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):area_subscription_modal_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function area_subscription_modal_defineProperty(ze,wt,Rt){return(wt=function area_subscription_modal_toPropertyKey(ze){var wt=function area_subscription_modal_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const la="area-subscription-list--disabled",ca="u-hidden",ua="data-modal-action",AreaSubscriptionModal=({element:ze})=>{const[wt]=(0,Yi.v9)("onModalClose"),[,Rt,Xt]=(0,Yi.v9)("dirty",!1),[Dr,Lr]=(0,Wn.oR)(Qn.MH);let Ur,ri;const{areaOnlyToggleInput:ai}={modal:(0,Yi.YP)("bpd-modal",{as:"modal"}),modalCloseCta:(0,Yi.YP)("[js-hook-modal-trigger]",{as:"modalCloseCta"}),modalCloseConfirmation:(0,Yi.YP)("modal-close-confirmation-popup",{as:"modalCloseConfirmation"}),bpdPages:(0,Yi.YP)("bpd-pages",{as:"bpdPages"}),step1Title:(0,Yi.YP)("[js-hook-area-subscription-modal-step-1-title]",{as:"step1Title"}),step1Description:(0,Yi.YP)("[js-hook-area-subscription-modal-step-1-description]",{as:"step1Description"}),areaOnlyToggle:(0,Yi.YP)("[js-hook-area-subscription-subscribe-area-only-toggle]",{as:"areaOnlyToggle"}),areaOnlyToggleInput:(0,Yi.YP)("[js-hook-area-subscription-subscribe-area-only-toggle-input]",{as:"areaOnlyToggleInput"}),areaOnlyToggleLabel:(0,Yi.YP)("[js-hook-area-subscription-subscribe-area-only-toggle-label]",{as:"areaOnlyToggleLabel"}),step1SubscribedList:(0,Yi.YP)("[js-hook-area-subscription-modal-step-1-subscribed-list]",{as:"step1SubscribedList"}),step1AvailableList:(0,Yi.YP)("[js-hook-area-subscription-modal-step-1-available-list]",{as:"step1AvailableList"}),areaSubscriptionForm:(0,Yi.YP)("[js-hook-area-subscription-modal-step-2-form]",{as:"areaSubscriptionForm"}),step3Title:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-title]",{as:"step3Title"}),step3Confirmation:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-confirmation]",{as:"step3Confirmation"}),step3Advantages:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-advantages]",{as:"step3Advantages"}),step3ListIntroTitle:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-list-intro-title]",{as:"step3ListIntroTitle"}),step3ListIntroContent:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-list-intro-content]",{as:"step3ListIntroContent"}),step3AvailableList:(0,Yi.YP)("[js-hook-area-subscription-modal-step-3-available-list]",{as:"step3AvailableList"}),step4Title:(0,Yi.YP)("[js-hook-area-subscription-modal-step-4-title]",{as:"step4Title"}),step4Confirmation:(0,Yi.YP)("[js-hook-area-subscription-modal-step-4-confirmation]",{as:"step4Confirmation"}),step4Advantages:(0,Yi.YP)("[js-hook-area-subscription-modal-step-4-advantages]",{as:"step4Advantages"}),navigationCta:(0,Yi.YP)("[js-hook-area-subscription-navigation-cta]",{as:"navigationCta"}),navigationHelperText:(0,Yi.YP)("[js-hook-area-subscription-navigation-helper-text]",{as:"navigationHelperText"}),navigationCheckmark:(0,Yi.YP)("[js-hook-area-subscription-navigation-checkmark]",{as:"navigationCheckmark"})},ha=(0,qr.bM)({element:ze,hooks:{postcodeHook:"[js-hook-area-subscription-form-zipcode]",houseNumberHook:"[js-hook-area-subscription-form-housenumber]",houseNumberAdditionHook:"[js-hook-area-subscription-form-houseaddition]",streetNameHook:"[js-hook-area-subscription-form-streename]",placeNameHook:"[js-hook-area-subscription-form-city]"},onAddressUpdated:handleFormChange});let pa=null;Xt(wt=>{ze.modalCloseCta.setAttribute(ua,wt?"closeConfirmation":"close"),ze.modal.hasConfirmationPopup=wt}),(0,Yi.We)("openModal",async wt=>{(0,zo.h7)(Jn.e);const{areaProject:Rt}=await(0,qr.KP)();(0,oa.d)({event:"newsletterSubscription",eventCategory:"newsletter",eventAction:`start flow - ${wt||"content"}`,eventLabel:Rt?.name}),await(0,jo.a)({step:ze.bpdPages.selected,areaOnly:Dr.areaOnly??!1})}),(0,Yi.We)("updateModalInactive",async wt=>{if(!wt.status||ze.modal.active)return;switch(wt.status){case"notSubscribedToArea":case"userNotSubscribedToArea":case"subscribedToAreaNotSubscribedToProjects":case"subscribedToAreaSubscribedToSomeProjects":ri=await(0,Io.Jz)(ze,wt,{step:0,areaOnly:!1}),(0,Qn.Ay)(!1);break;case"notSubscribedToAreaNoProjectsAvailable":await renderForm({areaOnly:!0}),ri=await(0,Io.Jz)(ze,wt,{step:1,areaOnly:!0}),await setNavigationForFormValid(isFormValid()),(0,Qn.Ay)(!0);break;case"userNotSubscribedToAreaNoProjectsAvailable":await renderForm({areaOnly:!0});isFormValid()?((0,Qn.DL)(!0),await submitSelection({step:0,formData:{userInfo:(0,Mo.TR)()}}),ri=await(0,Io.Jz)(ze,wt,{step:2,areaOnly:!0})):(ri=await(0,Io.Jz)(ze,wt,{step:1,areaOnly:!0}),await setNavigationForFormValid(isFormValid())),(0,Qn.Ay)(!0);break;case"subscribedToAreaNoProjectsAvailable":case"subscribedToAreaSubscribedToAllProjects":ri=await(0,Io.Jz)(ze,wt,{step:2,areaOnly:!1}),(0,Qn.Ay)(!1)}const Rt=await(0,Io.jt)();ze.modalCloseCta.setAttribute(ua,"close"),ze.modalCloseConfirmation.setData(Rt)}),(0,Yi.We)("updateModalActive",async(wt,Rt)=>{if("login"===Rt?.modalActiveAction)return void handleClose({force:!0});if("submit"!==Rt?.modalActiveAction)return;(0,Qn.DL)(!1);const{areaOnly:Xt=!1}=Dr;switch(ze.bpdPages.selected){case 0:case 1:ri=await(0,Io.Jz)(ze,wt,{step:2,areaOnly:Xt});break;case 2:ri=await(0,Io.Jz)(ze,wt,{step:3,areaOnly:Xt})}});const handleNextStepClick=async()=>{const{areaOnly:wt=!1,formRequired:Rt,selectedPropertyTypes:Xt}=Dr;switch(ze.bpdPages.selected){case 0:await(0,jo.v)({step:0,areaOnly:wt}),Rt?(await renderForm({areaOnly:wt}),ri=await(0,Io.Jz)(ze,Dr,{step:1,areaOnly:wt}),await setNavigationForFormValid(isFormValid())):((0,Qn.DL)(!0),await submitSelection({step:0,formData:extractFormData(Ur,{areaOnly:wt})}));break;case 1:(0,Qn.DL)(!0),await submitSelection({step:1,formData:extractFormData(Ur,{areaOnly:wt})});break;case 2:Xt.length?(await(0,jo.v)({step:2,areaOnly:wt}),(0,Qn.DL)(!0),await submitSelection({step:2,formData:extractFormData(Ur,{areaOnly:wt})})):handleForceClose();break;case 3:handleForceClose()}};function handleFormChange(){const wt=ze.querySelector("[js-hook-select-country-input]"),Rt=wt&&(0,qr.pV)(wt);
20Rt?.id&&pa?.id!==Rt?.id&&(pa=Rt,(0,qr.xV)(pa),pa.id===Yn.lT?ha?.enable():ha?.disable()),setNavigationForFormValid(isFormValid())}async function renderForm({areaOnly:wt}){const Rt=(0,Mo.TR)(),Xt=(0,Mo.Nv)(),Dr=area_subscription_modal_objectSpread(area_subscription_modal_objectSpread({},Rt),Xt);Ur=(0,sr.h)(AreaSubscriptionForm,{areaOnly:wt,preFilledInputs:Dr,formReversed:(0,Mo.uz)(Rt)}),ze.areaSubscriptionForm.innerHTML="",ze.areaSubscriptionForm.append(Ur),await Ur.componentOnReady(),!wt&&ha?.initialize(),Ur.formInner.addEventListener("change",handleFormChange)}(0,Yi.We)("nextStepClick",handleNextStepClick),Lr(async({selectedProjectPhases:wt})=>{if(0!==ze.bpdPages.selected)return;wt.length?(ze.navigationCta.removeAttribute("disabled"),ze.navigationCheckmark.classList.remove(ca),Rt(!0)):(ze.navigationCta.setAttribute("disabled","disabled"),ze.navigationCheckmark.classList.add(ca),ze.step1AvailableList.selectAllToggleInput&&(ze.step1AvailableList.selectAllToggleInput.checked=!1));const{navigationHelperTextProjectsSelect:Xt}=await await(0,Io.QH)({step:0,selected:wt.length});ze.navigationHelperText.innerHTML=Xt,ri.navigationHelperTextProjectsSelect=Xt},["selectedProjectPhases"]),Lr(async({selectedPropertyTypes:wt})=>{wt.length?(Rt(!0),ri&&(0,Qi.T)(ze.navigationCta,ri.navigationCtaCompleteRegistration)):ri&&(0,Qi.T)(ze.navigationCta,ri.navigationCtaClose)},["selectedPropertyTypes"]),Lr(async({submitting:ze})=>{ze?_a(!0):(Rt(!1),_a(!1))},["submitting"]),Lr(async({areaOnly:wt,selectedProjectPhases:Rt})=>{wt?(ze.step1AvailableList.classList.add(la),ze.navigationCta.removeAttribute("disabled"),ze.navigationHelperText.innerHTML=ri.navigationHelperTextAreaOnly,ze.navigationCheckmark.classList.remove(ca)):(ze.step1AvailableList.classList.remove(la),ze.navigationHelperText.innerHTML=ri.navigationHelperTextProjectsSelect,0===Rt.length&&(ze.navigationCta.setAttribute("disabled","disabled"),ze.navigationCheckmark.classList.add(ca)),ai.current&&(ai.current.checked=!1));const Xt=(0,Mo.Hz)(),sr=wt?Xt.area:Xt.project;(0,Qn.n3)(sr),sr?(0,Qi.T)(ze.navigationCta,ri.navigationCtaNextStep):(0,Qi.T)(ze.navigationCta,ri.navigationCtaCompleteRegistration)},["areaOnly"]),(0,Yi.iX)(ai,"change",async()=>{Rt(!0),(0,Qn.Ay)(ai.current?.checked??!1)});const isFormValid=()=>{if(!Ur)return!1;const{valid:ze}=Ur.validate(!1);return ha?.isEnabled?ze&&ha?.checkValidity():ze},setNavigationForFormValid=async wt=>{wt?(ze.navigationHelperText.innerHTML=ri.navigationHelperTextFormValid,ze.navigationCta.removeAttribute("disabled"),ze.navigationCheckmark.classList.remove(ca)):(ze.navigationHelperText.innerHTML=ri.navigationHelperTextFormInvalid,ze.navigationCta.setAttribute("disabled","disabled"),ze.navigationCheckmark.classList.add(ca))},_a=(0,qr.iY)("[js-hook-area-subscription-navigation-cta]"),handleClose=Xt=>{(Xt?.force||"close"===ze.modalCloseCta.getAttribute(ua))&&((0,zo.Mr)(Jn.e),Rt(!1),wt())},handleForceClose=()=>handleClose({force:!0});return(0,sr.h)("bpd-modal",{id:Jn.e,onModalClose:wt},(0,sr.h)("div",{class:"area-subscription-modal__container"},(0,sr.h)(Ji.D,{ariaLabel:"Modal button",svg:"icons-close",variant:"light",size:"small",classes:"area-subscription-modal__close-button",hook:"modal-trigger",attributes:{"aria-controls":Jn.e},onClick:handleClose}),(0,sr.h)("modal-close-confirmation-popup",{class:"area-subscription-modal__close-confirmation","modal-id":Jn.e,onConfirm:handleForceClose,onDismiss:()=>(0,zo.pI)(Jn.e)}),(0,sr.h)("bpd-pages",{selector:"[area-subscription-modal-page]",class:"area-subscription-modal__pages-wrapper",animated:!0},(0,sr.h)(kn.W,{attr:{"area-subscription-modal-page":!0},extraClass:"area-subscription-modal__page"},(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-6 u-margin-bottom-2"},(0,sr.h)("p",{class:"u-h5 u-h3--md","js-hook-area-subscription-modal-step-1-title":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-2 u-margin-bottom-2"},(0,sr.h)("p",{class:"s-rich-text","js-hook-area-subscription-modal-step-1-description":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-4 u-margin-bottom-2"},(0,sr.h)(jn.Z,{name:"subscribe-area-only",id:"area-subscription-subscribe-area-only-option",hook:"area-subscription-subscribe-area-only-toggle-input",bpdInputHook:"area-subscription-subscribe-area-only-toggle",labelHook:"area-subscription-subscribe-area-only-toggle-label",classes:"u-hidden",label:"",hideError:!0})),(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-2 u-margin-bottom-2"},(0,sr.h)("area-subscription-list",{"item-type":"projectPhase",class:"c-area-subscription-list","js-hook-area-subscription-modal-step-1-subscribed-list":!0})),(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-2"},(0,sr.h)("area-subscription-list",{"item-type":"projectPhase",class:"c-area-subscription-list","js-hook-area-subscription-modal-step-1-available-list":!0,onItemClick:Qn.M1,selectable:!0,"has-select-all":!0}))),(0,sr.h)(kn.W,{attr:{"area-subscription-modal-page":!0},extraClass:"area-subscription-modal__page"},(0,sr.h)("div",{"js-hook-area-subscription-modal-step-2-form":!0})),(0,sr.h)(kn.W,{attr:{"area-subscription-modal-page":!0},extraClass:"area-subscription-modal__page"},(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-6 u-margin-bottom-2"}
20,(0,sr.h)("p",{class:"u-h5 u-h3--md","js-hook-area-subscription-modal-step-3-title":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-1"},(0,sr.h)("div",{"js-hook-area-subscription-modal-step-3-confirmation":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-1"},(0,sr.h)("div",{"js-hook-area-subscription-modal-step-3-advantages":!0})),(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-1"},(0,sr.h)("p",{class:"u-body-normal-bold u-h6--md","js-hook-area-subscription-modal-step-3-list-intro-title":!0}),(0,sr.h)("p",{class:"u-margin-top-2 u-margin-bottom-2","js-hook-area-subscription-modal-step-3-list-intro-content":!0}),(0,sr.h)("area-subscription-list",{"item-type":"propertyType",class:"c-area-subscription-list","js-hook-area-subscription-modal-step-3-available-list":!0,onItemClick:Qn.Vs,selectable:!0}))),(0,sr.h)(kn.W,{attr:{"area-subscription-modal-page":!0},extraClass:"area-subscription-modal__page"},(0,sr.h)(Un.Y,{cols:[12,,11],extraClass:"u-margin-top-6 u-margin-bottom-2"},(0,sr.h)("p",{class:"u-h5 u-h3--md","js-hook-area-subscription-modal-step-4-title":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-1"},(0,sr.h)("div",{"js-hook-area-subscription-modal-step-4-confirmation":!0})),(0,sr.h)(Un.Y,{cols:[12,,10],extraClass:"u-margin-top-1"},(0,sr.h)("div",{"js-hook-area-subscription-modal-step-4-advantages":!0})))),(0,sr.h)(AreaSubscriptionNavigationBar,{classes:"area-subscription-modal__navigation",ctaAction:handleNextStepClick})))};AreaSubscriptionModal.props={onModalClose:{type:Function,required:!0},dirty:{type:Boolean}},(0,Yi.Nk)("area-subscription-modal",AreaSubscriptionModal);var ha=Rt(7663);const pa=["children"];function area_subscription_list_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function area_subscription_list_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?area_subscription_list_ownKeys(Object(Rt),!0).forEach(function(wt){area_subscription_list_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):area_subscription_list_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function area_subscription_list_defineProperty(ze,wt,Rt){return(wt=function area_subscription_list_toPropertyKey(ze){var wt=function area_subscription_list_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const _a="u-hidden",AreaSubscriptionList=({element:ze})=>{const[wt]=(0,Yi.v9)("itemType"),[Rt]=(0,Yi.v9)("selectable",!1),[Dr]=(0,Yi.v9)("hasSelectAll",!1),[Lr]=(0,Yi.v9)("onItemClick",null);let Ur=[];(0,Yi.YP)("[js-hook-area-subscription-list-header]",{as:"listHeader"}),(0,Yi.YP)("[js-hook-area-subscription-list-title]",{as:"listTitle"}),(0,Yi.YP)("[js-hook-area-subscription-list]",{as:"list"}),(0,Yi.YP)("[js-hook-area-subscription-list-select-all-toggle]",{as:"selectAllToggle"}),(0,Yi.YP)("[js-hook-area-subscription-list-select-all-toggle-label]",{as:"selectAllToggleLabel"});const qr=(0,Yi.YP)("[js-hook-area-subscription-list-select-all-toggle-inner]",{as:"selectAllToggleInput"});(0,Yi.iX)(qr,"change",()=>{const ze=qr.current.checked;let Rt;switch(wt){case"projectPhase":Rt=Qn.MH.getState().selectedProjectPhases;break;case"propertyType":Rt=Qn.MH.getState().selectedPropertyTypes}Ur.forEach(({card:wt,item:{id:Xt}})=>{ze&&Rt.includes(Xt)||wt.click()})}),Qn.MH.subscribe(({selectedProjectPhases:ze,selectedPropertyTypes:Rt})=>{if(!qr.current)return;let sr;switch(wt){case"projectPhase":sr=ze;break;case"propertyType":sr=Rt}!sr.length||sr.length<Ur.length?qr.current.checked=!1:qr.current.checked=!0,Ur.forEach(({item:ze,card:wt})=>{wt.querySelector(`[js-hook-${Xt.g}]`).checked=sr.includes(ze.id)})},["selectedProjectPhases","selectedPropertyTypes"]);const ProjectPhasesListItemDivider=()=>(0,sr.h)("div",{class:"u-margin-top-2 u-margin-bottom-2 u-divider"}),ri="projectPhase"===wt?ProjectPhasesListItemDivider:()=>(0,sr.h)("div",{class:"u-margin-top-3"}),ai="projectPhase"===wt?ProjectPhasesListItemDivider:()=>(0,sr.h)("div",{class:"u-margin-top-1 u-margin-bottom-3 u-divider"}),cardForDataItem=ze=>{let{children:wt}=ze,Dr=function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}(ze,pa);const Ur=(0,sr.h)(Xt.V,area_subscription_list_objectSpread({},area_subscription_list_objectSpread(area_subscription_list_objectSpread({},Dr),{},{selectable:Rt},Rt&&{onItemClick:Lr})),wt),Card=()=>Ur;return{card:Ur,CardElement:()=>(0,sr.h)(sr.H,null,(0,sr.h)(Card,null),(0,sr.h)(ri,null))}},ListHeaderItem=ze=>(0,sr.h)("div",{class:"area-subscription-list__section-header"},(0,sr.h)("span",{class:"area-subscription-list__section-header-item-counter"},ze.itemsCount),(0,sr.h)("div",null,(0,sr.h)("p",{class:"u-body-normal-bold"},ze.title),ze.status?(0,sr.h)("span",{class:`u-body-normal ${ha.Sw[ze.status.color]}`},ze.status.label):null));return(0,Yi.We)("setData",Xt=>{Ur=[],ze.list.innerHTML="","projectPhase"===wt?ze.list.append(...Xt.map(ze=>{const{card:wt,CardElement:Rt}=cardForDataItem(ze);return Ur.push({card:wt,item:ze}),(0,sr.h)(Rt,null)})):"propertyType"===wt&&Xt.forEach(({header:wt,listItems:Rt})=>{wt&&Rt&&(ze.list.append((0,sr.h)(ListHeaderItem,area_subscription_list_objectSpread({},wt))),ze.list.append((0,sr.h)(ri,null)),ze.list.append(...Rt.map(ze=>{const{card:wt,CardElement:Rt}=cardForDataItem(ze);return Ur.push({card:wt,item:ze}),(0,sr.h)(Rt,null)})),ze.list.append((0,sr.h)(ai,null)))}),Rt&&Dr&&(Ur.length<=1?ze.selectAllToggle?.classList.add(_a):ze.selectAllToggle?.classList.remove(_a))}),(0,sr.h)(sr.H,null,(0,sr.h)("div",{class:"u-flex u-flex-between area-subscription-list__header"+("propertyType"===wt?" u-hidden":""),"js-hook-area-subscription-list-header":!0}
20,(0,sr.h)("span",{class:"u-h6 u-h4--md","js-hook-area-subscription-list-title":!0}),Rt&&Dr&&(0,sr.h)(jn.Z,{name:"select-all-toggle",id:`area-subscription-select-all-toggle-${wt}`,hook:"area-subscription-list-select-all-toggle-inner",bpdInputHook:"area-subscription-list-select-all-toggle",labelHook:"area-subscription-list-select-all-toggle-label",classes:"area-subscription__checkbox",label:"",hideError:!0})),(0,sr.h)(ai,null),(0,sr.h)("div",{class:"u-flex u-flex-column area-subscription-list__items","js-hook-area-subscription-list":!0}))};AreaSubscriptionList.props={itemType:{type:String,required:!0},selectable:{type:Boolean},hasSelectAll:{type:Boolean},onItemClick:{type:Function}},(0,Yi.Nk)("area-subscription-list",AreaSubscriptionList)},5668:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{e:()=>Xt,m:()=>sr});const Xt="area-subscription-modal",sr="area-subscription::loaded"},899:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{MH:()=>Lr,u4:()=>resetAreaSubscriptionState,Ay:()=>setAreaSubscriptionAreaOnly,n3:()=>setAreaSubscriptionFormRequired,DL:()=>setAreaSubscriptionFormSubmitting,M1:()=>toggleProjectPhaseSelected,Vs:()=>togglePropertyTypeSelected,_i:()=>updateAreaSubscriptionState});var Xt=Rt(3352),sr=Rt(6206);const Dr=["availableProjectIds","subscribedProjectIds"];const Lr=(0,Xt.MT)({initialState:{formRequired:!1,submitting:!1,selectedProjectPhases:[],selectedPropertyTypes:[]},actions:{setState:(ze,wt)=>(ze.status=wt.status??ze.status,ze.areaOnly=wt.areaOnly??ze.areaOnly,ze.formRequired=wt.formRequired??ze.formRequired,ze.areaSelected=wt.areaSelected??ze.areaSelected,ze.submitting=wt.submitting??ze.submitting,ze.selectedProjectPhases=wt.selectedProjectPhases??ze.selectedProjectPhases,ze.selectedPropertyTypes=wt.selectedPropertyTypes??ze.selectedPropertyTypes,ze),setStatus:(ze,wt)=>(ze.status=wt,ze),setAreaOnly:(ze,wt)=>(ze.areaOnly=wt,ze),setAreaSelected:(ze,wt)=>(ze.areaSelected=wt,ze),setFormRequired:(ze,wt)=>(ze.formRequired=wt,ze),toggleProjectPhaseSelected:(ze,{id:wt,selected:Rt})=>(ze.selectedProjectPhases=Rt?[...ze.selectedProjectPhases,wt]:ze.selectedProjectPhases.filter(ze=>ze!==wt),ze),clearSelectedProjectPhases:ze=>(ze.selectedProjectPhases=[],ze),togglePropertyTypeSelected:(ze,{id:wt,selected:Rt})=>(ze.selectedPropertyTypes=Rt?[...ze.selectedPropertyTypes,wt]:ze.selectedPropertyTypes.filter(ze=>ze!==wt),ze),clearSelectedPropertyTypes:ze=>(ze.selectedPropertyTypes=[],ze),setSubmitting:(ze,wt)=>(ze.submitting=wt,ze),resetState:ze=>(ze.submitting=!1,ze.selectedProjectPhases=[],ze.selectedPropertyTypes=[],ze)}}),updateAreaSubscriptionState=async()=>{const ze=await(0,sr.of)(),{availableProjectIds:wt,subscribedProjectIds:Rt}=ze,Xt=function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}(ze,Dr);return setAreaSubscriptionState(Xt),ze},setAreaSubscriptionState=ze=>{Lr.dispatch("setState",ze)},setAreaSubscriptionAreaOnly=ze=>{Lr.dispatch("setAreaOnly",ze)},setAreaSubscriptionFormRequired=ze=>{Lr.dispatch("setFormRequired",ze)},toggleProjectPhaseSelected=(ze,wt)=>{Lr.dispatch("toggleProjectPhaseSelected",{id:ze,selected:wt})},togglePropertyTypeSelected=(ze,wt)=>{Lr.dispatch("togglePropertyTypeSelected",{id:ze,selected:wt})},setAreaSubscriptionFormSubmitting=ze=>{Lr.dispatch("setSubmitting",ze)},resetAreaSubscriptionState=()=>{Lr.dispatch("resetState")}},28:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{a:()=>handleVirtualPageGTM,v:()=>handleSelectionGTM});var Xt=Rt(3352),sr=Rt(8248),Dr=Rt(1408),Lr=Rt(5940),Ur=Rt(6033),qr=Rt(2568),ri=Rt.n(qr),ai=Rt(899);const handleVirtualPageGTM=async ze=>{const{areaProject:wt}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),Rt=(0,sr.TR)(),logData=ze=>Dr.Z.isLocal||Dr.Z.isTest?console.log(`%c[GTM] - ${ze.virtualTitle}`,"color: lightblue; font-size: 20px"):null;switch(ze.step){case 0:{const ze={event:"gtm.virtualPageview",virtualURL:`/${wt?.name}/newsletter_subscription/projectfase`,virtualTitle:"Newsletter Subscribe Project Phase"};(0,Lr.d)(ze),logData(ze);break}case 1:{const ze={event:"gtm.virtualPageview",virtualURL:`/${wt?.name}/newsletter_subscription/contact_info`,virtualTitle:"Newsletter Subscribe Contact Info"};(0,Lr.d)(ze),logData(ze);break}case 2:if(!Rt?.email){console.error("[GTM]: ERROR - no user email provided");break}if(ze.areaOnly){const ze={event:"gtm.virtualPageview",virtualURL:`/${wt?.name}
20/newsletter_subscription/newsletter_complete`,virtualTitle:"Newsletter Subscribe Newsletter Complete",subscriptionEmail:ri()(Rt.email),email_sha_256:await(0,Ur.J)(Rt.email)};(0,Lr.d)(ze),logData(ze)}else{const ze={event:"gtm.virtualPageview",virtualURL:`/${wt.name}/newsletter_subscription/projectfase_complete`,virtualTitle:"Newsletter Subscribe Project Fase Complete",subscriptionEmail:ri()(Rt.email),email_sha_256:await(0,Ur.J)(Rt.email)};(0,Lr.d)(ze),logData(ze)}break;case 3:{if(!Rt?.email){console.error("[GTM]: ERROR - no user email provided");break}const ze={event:"gtm.virtualPageview",virtualURL:`/${wt.name}/newsletter_subscription/woningtype_complete`,virtualTitle:"Newsletter Subscribe Woningtype Complete",subscriptionEmail:ri()(Rt.email),email_sha_256:await(0,Ur.J)(Rt.email)};(0,Lr.d)(ze),logData(ze);break}}},handleSelectionGTM=async ze=>{const{selectedProjectPhases:wt,selectedPropertyTypes:Rt}=ai.MH.getState(),{areaProject:sr,projectPhases:Ur,propertyTypes:qr}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),logData=ze=>Dr.Z.isLocal||Dr.Z.isTest?console.log(`%c[GTM] - ${ze.eventAction} ${ze.eventLabel}`,"color: lightgreen; font-size: 20px"):null;switch(ze.step){case 0:if(ze.areaOnly){const ze={event:"newsletterSubscription",eventCategory:"newsletter",eventAction:"subscribe gebied",eventLabel:sr.name};(0,Lr.d)(ze),logData(ze)}else wt.forEach(ze=>{const wt=Ur.find(({id:wt})=>wt===ze),Rt={event:"newsletterSubscription",eventCategory:"newsletter",eventAction:"subscribe fase",eventLabel:`${ze}_${wt?.name}`};(0,Lr.d)(Rt),logData(Rt)});break;case 2:Rt.forEach(ze=>{const wt=qr.find(({id:wt})=>wt===ze),Rt={event:"newsletterSubscription",eventCategory:"newsletter",eventAction:"subscribe woningtype",eventLabel:`${ze}_${wt?.name}`};(0,Lr.d)(Rt),logData(Rt)})}}},6206:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{nH:()=>ai,of:()=>getCurrentSubscriptionState,E$:()=>getFooterDataForStatus,QH:()=>getHelperTextForSelection,mi:()=>getListData,jt:()=>getModalCloseConfirmationTranslations,ss:()=>getSummaryData,b$:()=>translation_helpers_getTranslationOptions,a7:()=>pa.a,z6:()=>isProjectPhaseSubscribable,_k:()=>updateAreaSubscriptionTranslationOptions,Jz:()=>updateModalElement});var Xt=Rt(3352),sr=Rt(6466);const isConstructionNumberAvailable=({status:ze})=>"Available"===ze||"InOption"===ze,isProjectPhaseSubscribable=({mainImage:ze,status:wt,propertyTypes:Rt,constructionNumbers:Dr,customerJourneyMilestones:Lr})=>{if((0,sr.H)()){if("InPreparation"!==wt&&"OnSale"!==wt)return!1;if(!ze?.url||!Rt?.length)return!1;if("InPreparation"===wt){const ze=Lr?.find(({type:ze})=>"NewPhaseAnnouncement"===ze);if(!ze?.date||!(0,Xt._M)(ze.date))return!1}else if("OnSale"===wt&&Dr?.length&&!Dr.some(isConstructionNumberAvailable))return!1;return!0}return("InPreparation"===wt||"OnSale"===wt)&&(!(!ze?.url||!Rt?.length)&&!("OnSale"===wt&&Dr?.length&&!Dr.some(isConstructionNumberAvailable)))};var Dr=Rt(8248);const getCurrentSubscriptionState=async()=>{const{areaProject:ze,isUpdatedFromUserStore:wt,projectPhases:Rt}=(0,Dr.C_)();let sr,Lr=!1;const Ur=(0,Dr.Hz)();let qr;const{projectPhases:ri}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),ai=ri.filter(isProjectPhaseSubscribable),Yi=ai.filter(({id:ze})=>!Rt.includes(ze)).map(({id:ze})=>ze);return ze?ai.length?(sr=0===Yi.length?"subscribedToAreaSubscribedToAllProjects":Yi.length===ai.length?"subscribedToAreaNotSubscribedToProjects":"subscribedToAreaSubscribedToSomeProjects",qr=Ur.project,{status:sr,formRequired:qr,areaSelected:Lr,subscribedProjectIds:Rt,availableProjectIds:Yi}):(sr="subscribedToAreaNoProjectsAvailable",qr=Ur.area,{status:sr,formRequired:qr,areaSelected:Lr}):(Lr=!0,ai.length?(sr=wt?"userNotSubscribedToArea":"notSubscribedToArea",qr=Ur.project,{status:sr,formRequired:qr,areaSelected:Lr,availableProjectIds:Yi}):(sr=wt?"userNotSubscribedToAreaNoProjectsAvailable":"notSubscribedToAreaNoProjectsAvailable",qr=Ur.area,{status:sr,formRequired:qr,areaSelected:Lr}))};var Lr=Rt(5044);const Ur=", ",translateEnumeration=async(ze,wt)=>{let Rt=0;if(!(ze=ze.map(ze=>ze.trim()).filter(ze=>(ze.length||Rt++,!!ze.length))).length)return"";if(1===ze.length)return ze[0];const Xt=(await(0,Lr.WU)("And")).trim().toLocaleLowerCase();if(Rt||wt?.cutoff&&ze.length>wt.cutoff){const sr=(await(0,Lr.WU)("More")).trim().toLocaleLowerCase();if(!Xt.length||!sr.length)return ze.join(Ur);const Dr=ze.splice(wt?.cutoff??0).length+Rt;return`${ze.join(Ur).trim()} ${Xt} ${Dr} ${sr}`}{if(!Xt.length)return ze.join(Ur);const[wt]=ze.splice(ze.length-1,1);return`${ze.join(Ur).trim()} ${Xt} ${wt.trim()}`}},qr="projectsSubscribedCount",ri="projectsAvailableCount",ai="projectsSelectedCount",Yi={replace:[],plurality:[]},translation_helpers_getTranslationOptions=()=>Yi,updateTranslationOptions=ze=>{if(ze.replace?.length)if(Yi.replace?.length){const wt=Yi.replace.filter(({id:wt})=>!ze.replace?.find(({id:ze})=>wt===ze));Yi.replace=[...wt,...ze.replace]}else Yi.replace=ze.replace;if(ze.plurality?.length)if(Yi.plurality?.length){const wt=Yi.plurality.filter(({id:wt})=>!ze.plurality?.find(({id:ze})=>wt===ze));Yi.plurality=[...wt,...ze.plurality]}else Yi.plurality=ze.plurality;return Yi},updateAreaSubscriptionTranslationOptions=async({subscribedProjectIds:ze,availableProjectIds:wt})=>{const{areaProject:{name:Rt},projectPhases:sr}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),Dr={replace:[{id:"areaName",value:Rt},{id:ai,value:"0"}],plurality:[{id:ai,value:0,total:wt?.length}]};if(ze){const wt=ze.map(ze=>sr.find(({id:wt})=>wt===ze)?.name||""),Rt=await translateEnumeration(wt,{cutoff:3});Dr.replace?.push({id:"projectNames",value:Rt},{id:qr,value:`${ze.length}`}),Dr.plurality?.push({id:qr,value:ze.length})}wt&&(Dr.replace?.push({id:ri,value:`${wt.length}`}),Dr.plurality?.push({id:ri,value:wt.length})),updateTranslationOptions(Dr)},Ji={footerTitle:"AreaSubscription.SubscribeToArea.Footer.Title",footerSubtitle:"AreaSubscription.SubscribeToArea.Footer.
20Subtitle",footerCta:"AreaSubscription.SubscribeToArea.Footer.CtaLabel"},Qi={footerTitle:"AreaSubscription.SubscribeToArea.LoggedInUser.Footer.Title",footerSubtitle:"AreaSubscription.SubscribeToArea.LoggedInUser.Footer.Subtitle",footerCta:"AreaSubscription.SubscribeToArea.LoggedInUser.Footer.CtaLabel"},kn={notSubscribedToArea:Ji,userNotSubscribedToArea:Qi,notSubscribedToAreaNoProjectsAvailable:Ji,userNotSubscribedToAreaNoProjectsAvailable:Qi,subscribedToAreaNotSubscribedToProjects:{footerTitle:"AreaSubscription.AreaSubscribed.SubscribeToProjects.Footer.Title",footerSubtitle:"AreaSubscription.AreaSubscribed.SubscribeToProjects.Footer.Subtitle",footerCta:"AreaSubscription.AreaSubscribed.SubscribeToProjects.Footer.CtaLabel"},subscribedToAreaSubscribedToSomeProjects:{footerTitle:"AreaSubscription.AreaSubscribed.SubscribeToMoreProjects.Footer.Title",footerSubtitle:"AreaSubscription.AreaSubscribed.SubscribeToMoreProjects.Footer.Subtitle",footerCta:"AreaSubscription.AreaSubscribed.SubscribeToMoreProjects.Footer.CtaLabel"}},getFooterDataForStatus=async ze=>{const wt=kn[ze];if(!wt)return null;const Rt=translation_helpers_getTranslationOptions();return(0,Lr.Hg)(wt,Rt)};var jn=Rt(6646),Un=Rt(5506);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Wn="u-hidden",Yn={areaOnlyToggleLabel:"AreaSubscription.Modal.Step1.AreaOnlyToggleLabel",step3Title:"AreaSubscription.Modal.Step3.Title",step3ListIntroTitle:"AreaSubscription.Modal.Step3.AvailableList.IntroTitle",step3ListIntroContent:"AreaSubscription.Modal.Step3.AvailableList.IntroContent",step4Title:"AreaSubscription.Modal.Step4.Title",navigationHelperTextProjectsSelect:"AreaSubscription.Modal.Step1.NavigationHelperText.ProjectsSelect",navigationHelperTextAreaOnly:"AreaSubscription.Modal.Step1.NavigationHelperText.AreaOnly",navigationHelperTextFormValid:"AreaSubscription.Modal.Step2.NavigationHelperText.FormValid",navigationHelperTextFormInvalid:"AreaSubscription.Modal.Step2.NavigationHelperText.FormInvalid",navigationCtaNextStep:"AreaSubscription.Modal.NavigationCtaLabel.NextStep",navigationCtaClose:"AreaSubscription.Modal.NavigationCtaLabel.Close",navigationCtaCompleteRegistration:"AreaSubscription.Modal.NavigationCtaLabel.CompleteRegistration"},Jn={notSubscribedToArea:{step1Title:"AreaSubscription.SubscribeToArea.Modal.Step1.Title",step1Description:"AreaSubscription.SubscribeToArea.Modal.Step1.Description"},userNotSubscribedToArea:{step1Title:"AreaSubscription.SubscribeToArea.LoggedInUser.Modal.Step1.Title",step1Description:"AreaSubscription.SubscribeToArea.LoggedInUser.Modal.Step1.Description"},subscribedToAreaNotSubscribedToProjects:{step1Title:"AreaSubscription.AreaSubscribed.SubscribeToProjects.Modal.Step1.Title",step1Description:"AreaSubscription.AreaSubscribed.SubscribeToProjects.Modal.Step1.Description"},subscribedToAreaSubscribedToSomeProjects:{step1Title:"AreaSubscription.AreaSubscribed.SubscribeToMoreProjects.Modal.Step1.Title",step1Description:"AreaSubscription.AreaSubscribed.SubscribeToMoreProjects.Modal.Step1.Description"}},getModalCloseConfirmationTranslations=async()=>({title:await(0,Lr.WU)("AreaSubscription.Modal.CloseConfirmationPopup.Title"),description:await(0,Lr.WU)("AreaSubscription.Modal.CloseConfirmationPopup.Description"),confirmButtonText:await(0,Lr.WU)("AreaSubscription.Modal.CloseConfirmationPopup.CtaConfirm"),dismissButtonText:await(0,Lr.WU)("AreaSubscription.Modal.CloseConfirmationPopup.CtaDismiss")}),updateModalElement=async(ze,wt,Rt)=>{const Xt=await getModalDataForState(wt);switch(Rt.step){case 0:{ze.step1Title.innerText=Xt.step1Title,ze.step1Description.innerHTML=Xt.step1Description,ze.areaOnlyToggleLabel.innerHTML=Xt.areaOnlyToggleLabel,ze.navigationHelperText.innerHTML=Xt.navigationHelperTextProjectsSelect,"notSubscribedToArea"===wt.status||"userNotSubscribedToArea"===wt.status?ze.areaOnlyToggle.classList.remove(Wn):ze.areaOnlyToggle.classList.add(Wn);const{available:Rt,subscribed:sr}=await getListData(wt,"projectPhase");sr?.listData.length?(ze.step1SubscribedList.classList.remove(Wn),ze.step1SubscribedList.listTitle.innerHTML=sr.listTitle,ze.step1SubscribedList.setData(sr.listData)):(ze.step1SubscribedList.classList.add(Wn),ze.step1SubscribedList.setData([])),Rt?.listData.length?(ze.step1AvailableList.classList.remove(Wn),ze.step1AvailableList.listTitle.innerHTML=Rt.listTitle,ze.step1AvailableList.selectAllToggleLabel.innerHTML=Rt.selectAllToggleLabel,ze.step1AvailableList.setData(Rt.listData)):(ze.step1AvailableList.classList.add(Wn),ze.step1AvailableList.setData([])),wt.formRequired?(0,jn.T)(ze.navigationCta,Xt.navigationCtaNextStep):(0,jn.T)(ze.navigationCta,Xt.navigationCtaCompleteRegistration),ze.navigationCta.setAttribute("disabled","disabled");break}case 1:(0,jn.T)(ze.navigationCta,Xt.navigationCtaCompleteRegistration);break;
20case 2:{ze.step3Title.innerText=Xt.step3Title;const{confirmation:Rt,advantages:sr}=await getSummaryData(wt,{step:2});if(ze.step3Confirmation.innerHTML="",ze.step3Confirmation.append((0,Un.h6)(Rt)),sr)ze.step3ListIntroTitle.classList.add(Wn),ze.step3ListIntroContent.classList.add(Wn),ze.step3Advantages.innerHTML="",ze.step3Advantages.append((0,Un.h6)(sr)),ze.step3AvailableList.classList.add(Wn),ze.step3AvailableList.setData([]);else{ze.step3Advantages.innerHTML="",ze.step3ListIntroTitle.innerHTML=Xt.step3ListIntroTitle,ze.step3ListIntroContent.innerHTML=Xt.step3ListIntroContent,ze.step3ListIntroTitle.classList.remove(Wn),ze.step3ListIntroContent.classList.remove(Wn);const{available:Rt}=await getListData(wt,"propertyType");Rt?.listData.length?(ze.step3AvailableList.classList.remove(Wn),ze.step3AvailableList.setData(Rt.listData)):(ze.step3AvailableList.classList.add(Wn),ze.step3AvailableList.setData([]),ze.step3ListIntroTitle.classList.add(Wn),ze.step3ListIntroContent.classList.add(Wn))}ze.navigationHelperText.innerHTML="",ze.navigationCheckmark.classList.add(Wn),ze.navigationCta.removeAttribute("disabled"),(0,jn.T)(ze.navigationCta,Xt.navigationCtaClose);break}case 3:{ze.step4Title.innerText=Xt.step4Title;const{confirmation:Rt,advantages:sr}=await getSummaryData(wt,{step:3});ze.step4Confirmation.innerHTML="",ze.step4Confirmation.append((0,Un.h6)(Rt)),sr?(ze.step4Advantages.innerHTML="",ze.step4Advantages.append((0,Un.h6)(sr))):ze.step4Advantages.innerHTML="",ze.navigationHelperText.innerHTML="",ze.navigationCheckmark.classList.add(Wn),ze.navigationCta.removeAttribute("disabled"),(0,jn.T)(ze.navigationCta,Xt.navigationCtaClose);break}}return ze.bpdPages.setPage(String(Rt.step)),ze.modal.active&&await(0,pa.a)({step:ze.bpdPages.selected,areaOnly:Rt.areaOnly}),Xt},getModalDataForState=async({status:ze})=>{const wt=_objectSpread(_objectSpread({},Yn),ze&&Jn[ze]);return await(0,Lr.Hg)(wt,translation_helpers_getTranslationOptions())},getHelperTextForSelection=async({step:ze,selected:wt,total:Rt})=>{if(0===ze){const{navigationHelperTextProjectsSelect:ze,navigationHelperTextAreaOnly:Xt}=Yn,sr=translation_helpers_getTranslationOptions().plurality?.find(({id:ze})=>ze===ai),Dr={replace:[{id:ai,value:`${wt||0}`}],plurality:[{id:ai,value:wt||0,total:Rt??sr?.total}]};return await(0,Lr.Hg)({navigationHelperTextProjectsSelect:ze,navigationHelperTextAreaOnly:Xt},updateTranslationOptions(Dr))}return{navigationHelperTextProjectsSelect:"",navigationHelperTextAreaOnly:""}};var Qn=Rt(7995),Io=Rt(7663);const Mo={InPreparation:"AreaSubscription.Modal.Step1.AvailableListCardDetail.ConstructionNumbersInPreparation",Available:"AreaSubscription.Modal.Step1.AvailableListCardDetail.ConstructionNumbersAvailable",AssigningOn:"AreaSubscription.Modal.Step1.AvailableListCardDetail.ConstructionNumbersAssigningOn",InOption:"AreaSubscription.Modal.Step1.AvailableListCardDetail.ConstructionNumbersInOption",Sold:"AreaSubscription.Modal.Step1.AvailableListCardDetail.ConstructionNumbersSold"},jo=["Rented","Sold","UnderConstruction"],zo=["Available","InOption","AssigningOn","InPreparation","Sold"],oa=["InPreparation","Available","InOption"],la=["Available","InOption","AssigningOn","Sold"],createCountedTranslation=async(ze,wt,Rt)=>{const Xt={replace:[{id:Rt,value:`<b>${ze}</b>`}],plurality:[{id:Rt,value:ze}]};return await(0,Lr.WU)(wt,Xt)},renderProjectPhaseDetail=async ze=>{const{constructionNumbers:wt,propertyTypes:Rt}=ze,Xt=Rt?.filter(({status:ze})=>!!ze&&!jo.includes(ze)),sr=[],Dr=(0,Qn.h)("p",null),Lr=wt?.reduce((ze,wt)=>{const{status:Rt}=wt;if(!Rt||!zo.includes(Rt))return ze;const Xt=ze[Rt];return ze[Rt]=Xt?Xt+1:1,ze},{}),Ur="InPreparation"===ze.status&&!Object.keys(Lr??{}).length;if(!Lr||Ur){const ze=Xt?.length,wt="AreaSubscription.Modal.Step1.AvailableListCardDetail.PropertiesInPreparation";if(!ze||!wt)return;return Dr.innerHTML=await createCountedTranslation(ze,wt,"countPropertiesInPreparation"),Dr}let qr=[];"InPreparation"===ze.status?qr=oa:"OnSale"===ze.status&&(qr=la);for(const ze of qr){const wt=Lr[ze],Rt=Mo[ze];wt&&Rt&&sr.push(await createCountedTranslation(wt,Rt,`countConstructionNumbers${ze}`))}return Dr.innerHTML=await translateEnumeration(sr),Dr},renderPropertyTypeDetail=ze=>{const wt=(0,Io.T4)({propertyType:ze}),Rt=(0,Io.g0)(ze);return(0,Qn.h)(Qn.H,null,wt&&(0,Qn.h)("div",null,wt.prefix&&(0,Qn.h)("span",{class:"u-status-large u-color--grey-30 u-margin-right-1"},wt.prefix),wt.amount&&wt.amount,wt.suffix&&(0,Qn.h)("span",{class:"u-status-large u-color--grey-30 u-margin-left-1"},wt.suffix)),Rt&&(0,Qn.h)("div",null,(0,Qn.h)("span",{class:"u-status-large u-color--grey-30 u-margin-right"},Rt.value),Rt.suffix&&(0,Qn.h)("span",{class:"u-status-large u-color--grey-30 u-margin-left-1"},Rt.suffix)))};Rt(9389);function list_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function list_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?list_ownKeys(Object(Rt),!0).forEach(function(wt){list_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):list_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function list_defineProperty(ze,wt,Rt){return(wt=function list_toPropertyKey(ze){var wt=function list_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ca={subscribed:{listTitle:"AreaSubscription.Modal.Step1.SubscribedListTitle"},available:{listTitle:"AreaSubscription.Modal.Step1.AvailableListTitle",selectAllToggleLabel:"AreaSubscription.Modal.Step1.SelectAllToggleLabel",selectItemToggleLabel:"AreaSubscription.Modal.Step1.SelectItemToggleLabel"}},ua={subscribed:{},available:{listTitle:"AreaSubscription.Modal.Step3.AvailableListTitle",selectItemToggleLabel:"AreaSubscription.Modal.Step3.SelectItemToggleLabel"}},mapToProjectPhaseListData=async(ze,wt)=>{const{projectPhases:Rt}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),sr=[];let Dr;"available"===wt&&(Dr=await(0,Lr.WU)(ca[wt].selectItemToggleLabel));for(const wt of ze){const ze=Rt.find(({id:ze})=>ze===wt);if(!ze)continue;const{id:Xt,name:Lr,mainImage:Ur}=ze,qr=(0,Io.pp)(ze);sr.push({id:Xt,title:Lr||"",status:qr,checkboxLabel:Dr,image:Ur?.url,imageAlt:Ur?.metadata?.altText,children:await renderProjectPhaseDetail(ze),classes:"area-subscription-list-card--project-phase"})}return sr},mapToPropertyTypeListData=async(ze,wt)=>{const{projectPhases:Rt}=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId),sr=[];let Ur;"available"===wt&&(Ur=await(0,Lr.WU)(ua[wt].selectItemToggleLabel));const{propertyTypes:qr}=(0,Dr.C_)();for(const wt of ze){const ze=Rt.find(({id:ze})=>ze===wt);if(!ze)continue;const{id:Xt,name:Dr,propertyTypes:Lr}=ze,ri=Lr?.filter(({id:ze})=>!qr.includes(ze));if(!ri?.length)continue;const ai={id:Xt,itemsCount:Lr?.length||0,title:Dr||"",status:(0,Io.pp)(ze)},Yi=[];for(const ze of ri){const{id:wt,name:Rt,mainImage:Xt}=ze,sr=(0,Io.YN)(ze);Yi.push({id:wt,title:Rt||"",status:sr,checkboxLabel:Ur,image:Xt?.url,imageAlt:Xt?.metadata?.altText,children:renderPropertyTypeDetail(ze),classes:"area-subscription-list-card--property-type"})}sr.push({header:ai,listItems:Yi})}return sr},getListData=async(ze,wt)=>{const{subscribedProjectIds:Rt,availableProjectIds:Xt}=ze,sr={},Dr=translation_helpers_getTranslationOptions();switch(wt){case"projectPhase":{const ze=ca;Rt?.length&&(sr.subscribed=list_objectSpread(list_objectSpread({},await(0,Lr.Hg)(ze.subscribed,Dr)),{},{listData:await mapToProjectPhaseListData(Rt,"subscribed")})),Xt?.length&&(sr.available=list_objectSpread(list_objectSpread({},await(0,Lr.Hg)(ze.available,Dr)),{},{listData:await mapToProjectPhaseListData(Xt,"available")}));break}case"propertyType":{const ze=ua;Rt?.length&&(sr.available=list_objectSpread(list_objectSpread({},await(0,Lr.Hg)(ze.available,Dr)),{},{listData:await mapToPropertyTypeListData(Rt,"available")}));break}}return sr},ha={confirmationTitle:"AreaSubscription.Modal.Confirmation.Title",confirmationAreaPositive:"AreaSubscription.Modal.Confirmation.AreaSubscribed.Positive",confirmationProjectsPositive:"AreaSubscription.Modal.Confirmation.ProjectsSubscribed.Positive",confirmationProjectsNegative:"AreaSubscription.Modal.Confirmation.ProjectsSubscribed.Negative",confirmationPropertiesPositive:"AreaSubscription.Modal.Confirmation.PropertiesSubscribed.Positive",confirmationAfterTextAreaSubscribedNoProjects:"",step3AdvantagesTitle:"AreaSubscription.Modal.Step3.ExtraText.Title",step3AdvantagesLine1:"AreaSubscription.Modal.Step3.ExtraText.Line1",step3AdvantagesLine2:"AreaSubscription.Modal.Step3.ExtraText.Line2",step3AdvantagesLine3:"AreaSubscription.Modal.Step3.ExtraText.Line3",step3AdvantagesLine4:"AreaSubscription.Modal.Step3.ExtraText.Line4",step4AdvantagesTitle:"AreaSubscription.Modal.Step4.ExtraText.Title",step4AdvantagesLine1:"AreaSubscription.Modal.Step4.ExtraText.Line1",step4AdvantagesLine2:"AreaSubscription.Modal.Step4.ExtraText.Line2",step4AdvantagesLine3:"AreaSubscription.Modal.Step4.ExtraText.Line3",step4AdvantagesLine4:"AreaSubscription.Modal.Step4.ExtraText.Line4"},getSummaryData=async(ze,wt)=>{const Rt=translation_helpers_getTranslationOptions(),Xt=await(0,Lr.Hg)(h
20a,Rt),{confirmationTitle:sr,confirmationAreaPositive:Dr}=Xt,Ur={confirmation:{title:sr,items:[{value:Dr,positive:!0}]}};switch(wt.step){case 2:switch(ze.status){case"subscribedToAreaNoProjectsAvailable":case"subscribedToAreaNotSubscribedToProjects":"subscribedToAreaNotSubscribedToProjects"===ze.status&&(Ur.confirmation.items.push({value:Xt.confirmationProjectsNegative,positive:!1}),Ur.confirmation.afterText=Xt.confirmationAfterTextAreaSubscribedNoProjects),Ur.advantages={title:Xt.step3AdvantagesTitle,items:[{value:Xt.step3AdvantagesLine1,positive:!0},{value:Xt.step3AdvantagesLine2,positive:!0},{value:Xt.step3AdvantagesLine3,positive:!0},{value:Xt.step3AdvantagesLine4,positive:!0}]};break;case"subscribedToAreaSubscribedToSomeProjects":case"subscribedToAreaSubscribedToAllProjects":Ur.confirmation.items.push({value:Xt.confirmationProjectsPositive,positive:!0})}break;case 3:Ur.confirmation.items.push({value:Xt.confirmationProjectsPositive,positive:!0}),Ur.confirmation.items.push({value:Xt.confirmationPropertiesPositive,positive:!0}),Ur.advantages={title:Xt.step4AdvantagesTitle,items:[{value:Xt.step4AdvantagesLine1,positive:!0},{value:Xt.step4AdvantagesLine2,positive:!0},{value:Xt.step4AdvantagesLine3,positive:!0},{value:Xt.step4AdvantagesLine4,positive:!0}]}}return Ur};var pa=Rt(28)},4597:(ze,wt,Rt)=>{"use strict";var Xt=Rt(9490),sr=Rt(7995),Dr=Rt(7691),Lr=Rt(7072),Ur=Rt(5044),qr=Rt(185);const ri="u-hidden",CompareButton=()=>{(0,Ur.Rd)(qr.Z);const[ze]=(0,Xt.v9)("id"),wt=(0,Xt.YP)("[js-hook-compare-button-checkbox]"),Rt=(0,Xt.YP)("bpd-input span"),ai=(0,Xt.YP)("[js-hook-compare-button-link]");(0,Xt.iX)(wt,"change",async function compareChanged(wt){wt.currentTarget.checked?((0,Lr.qz)(ze),Rt.current.innerHTML=await(0,Ur.WU)("Compare.Added"),ai.current.classList.remove(ri)):((0,Lr.nS)(ze),Rt.current.innerHTML=await(0,Ur.WU)("Compare.Compare"),ai.current.classList.add(ri))});const Yi=Lr.H2.getState().constructionNumberIds.includes(ze);return(0,sr.h)("div",{class:"c-compare-button"},(0,sr.h)(Dr.Z,{label:Yi?(0,Ur.qM)("Compare.Added"):(0,Ur.qM)("Compare.Compare"),name:"compare",id:`compare-${ze}`,classes:"compare-button__checkbox",checked:Yi,hook:"compare-button-checkbox"}),(0,sr.h)("a",{class:"compare-button__button u-content-link"+(Yi?"":` ${ri}`),href:window.__ENVIRONMENT_DETAILS__.compareUrl,"js-hook-compare-button-link":!0},(0,Ur.qM)("Compare.Check")))};CompareButton.props={id:{type:String,required:!0}},(0,Xt.Nk)("compare-button",CompareButton)},4510:()=>{"use strict";[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(ze){ze.hasOwnProperty("append")||Object.defineProperty(ze,"append",{configurable:!0,enumerable:!0,writable:!0,value:function append(...ze){const wt=Array.prototype.slice.call(ze),Rt=document.createDocumentFragment();wt.forEach(function(ze){const wt=ze instanceof Node;Rt.appendChild(wt?ze:document.createTextNode(String(ze)))}),this.appendChild(Rt)}})})},5142:()=>{"use strict";var ze;"function"!=typeof(ze=window.Element.prototype).matches&&(ze.matches=ze.msMatchesSelector||ze.mozMatchesSelector||ze.webkitMatchesSelector||function matches(ze){const wt=(this.document||this.ownerDocument).querySelectorAll(ze);let Rt=0;for(;wt[Rt]&&wt[Rt]!==this;)++Rt;return Boolean(wt[Rt])})},1783:()=>{"use strict";Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(ze,wt){return void 0!==wt&&(wt=!!wt),null!==this.getAttribute(ze)?!!wt||(this.removeAttribute(ze),!1):!1!==wt&&(this.setAttribute(ze,""),!0)})},7072:(ze,wt,Rt)=>{"use strict";function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}Rt.d(wt,{qz:()=>compareConstructionNumberAdd,nS:()=>compareConstructionNumberRemove,H2:()=>sr,p2:()=>getCompareData,eJ:()=>getCompareState,LU:()=>setCompareData});const Xt={init:(ze,wt)=>(ze.constructionNumberIds=wt.constructionNumberIds,ze),compareConstructionNumberAdd:(ze,wt)=>(ze.constructionNumberIds.includes(wt)||(ze.constructionNumberIds=[...ze.constructionNumberIds,wt]),ze),compareConstructionNumberRemove:(ze,wt)=>(ze.constructionNumberIds=ze.constructionNumberIds.filter(ze=>ze!==wt),ze),setExtendedArea:(ze,wt)=>(ze.data=function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({},wt),ze)},sr=(0,Rt(3352).yh)({key:"compareHouses",initialState:{constructionNumberIds:[]},actions:Xt,initAction:"init",expireInDays:180,excludeProps:["data"]}),compareConstructionNumberAdd=ze=>{sr.dispatch("compareConstructionNumberAdd",ze)},compareConstructionNumberRemove=ze=>{sr.dispatch("compareConstructionNumberRemove",ze)},setCompareData=ze=>{sr.dispatch("setExtendedArea",ze)},getCompareState=()=>sr.getState(),getCompareData=()=>sr.getState().data},741:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{DN:()=>Ur,XO:()=>getDebugState,XJ:()=>getDebuggerMapOptions,oA:()=>resetState,IS:()=>storeTheme,id:()=>toggleBackendDictionaryKeys,vF:()=>toggleDictionaryKeys,ot:()=>toggleIdInHouseSelector,R2:()=>toggleIdInMap,WP:()=>toggleObjectTypeInMap,v1:()=>togglePropertiesId});var Xt=Rt(3352);const sr={showDictionaryKeys:!1,showBackendDictionaryKeys:!1,selectedTheme:void 0,propertiesId:!1,showObjectTypeInMap:!1,showIdInMap:!1,showIdInHouseSelector:!1},Dr=Object.assign({},sr),Lr={init:(ze,wt)=>wt?Object.assign(ze,wt):ze,toggleDictionaryKeys:ze=>(ze.showDictionaryKeys=!ze.showDictionaryKeys,ze),toggleBackendDictionaryKeys:ze=>(ze.showBackendDictionaryKeys=!ze.showBackendDictionaryKeys,ze),selectTheme:(ze,wt)=>(ze.selectedTheme=wt,ze),togglePropertiesId:ze=>(ze.propertiesId=!ze.propertiesId,ze),toggleObjectTypeInMap:ze=>(ze.showObjectTypeInMap=!ze.showObjectTypeInMap,ze),toggleIdInMap:ze=>(ze.showIdInMap=!ze.showIdInMap,ze),toggleIdInHouseSelector:ze=>(ze.showIdInHouseSelector=!ze.showIdInHouseSelector,ze),resetState:ze=>Object.assign(ze,Dr)},toggleDictionaryKeys=()=>{Ur.dispatch("toggleDictionaryKeys")},toggleBackendDictionaryKeys=()=>{Ur.dispatch("toggleBackendDictionaryKeys")},togglePropertiesId=()=>{Ur.dispatch("togglePropertiesId")},storeTheme=ze=>{Ur.dispatch("selectTheme",ze)},getDebugState=()=>Ur.getState(),toggleObjectTypeInMap=()=>{Ur.dispatch("toggleObjectTypeInMap")},toggleIdInMap=()=>{Ur.dispatch("toggleIdInMap")},toggleIdInHouseSelector=()=>{Ur.dispatch("toggleIdInHouseSelector")},resetState=()=>{Ur.dispatch("resetState")},getDebuggerMapOptions=()=>{const ze=Ur.getState(),wt=ze.showObjectTypeInMap||ze.showIdInMap;let Rt;return wt?(Rt=[],ze.showIdInMap&&Rt.push("id"),ze.showObjectTypeInMap&&Rt.push("objectType"),{debugMode:Boolean(wt),debugProperties:Rt}):{}},Ur=(0,Xt.yh)({key:"debugStore",initialState:sr,actions:Lr,initAction:"init"})},2741:(ze,wt,Rt)=>{"use strict";function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}Rt.d(wt,{MY:()=>addFlyin,xi:()=>closeFlyin,OJ:()=>sr,cJ:()=>openFlyin});const Xt={addFlyIn:(ze,wt)=>(ze.flyins=_objectSpread(_objectSpread({},ze.flyins),{},{[wt.id]:{active:!1}}),ze),openFlyIn:(ze,wt)=>(ze.flyins=_objectSpread(_objectSpread({},ze.flyins),{},{[wt.id]:{active:!0}}),ze),closeFlyIn:(ze,wt)=>(ze.flyins=_objectSpread(_objectSpread({},ze.flyins),{},{[wt.id]:{active:!1}}),ze)},sr=(0,Rt(3352).MT)({initialState:{flyins:{}},actions:Xt}),addFlyin=ze=>{sr.dispatch("addFlyIn",{id:ze})},closeFlyin=ze=>{sr.dispatch("closeFlyIn",{id:ze})},openFlyin=ze=>{sr.dispatch("openFlyIn",{id:ze})}},7505:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{C:()=>Ur,p:()=>updateSelectedPano});var Xt=Rt(3352),sr=Rt(2397),Dr=Rt(1408),Lr=Rt(903);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Ur=(0,Xt.MT)({initialState:{},actions:{updateSelectedPano:(ze,wt)=>{const{tourId:Rt,pano:Xt,sceneId:sr}=wt;return ze[Rt]={pano:Xt,initialSceneId:sr},ze}}}),updateSelectedPano=(ze,wt,Rt)=>{let Xt;Xt=Dr.Z.isLocal?(0,Lr.R)(wt||sr.iC):wt;const qr=((ze,wt)=>{const Rt=ze.includes("?");return`${ze}${Rt?"&":"?"}${Object.keys(wt).map(ze=>`${encodeURIComponent(ze)}=${encodeURIComponent(wt[ze])}`).join("&")}`})(Xt,function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({vrTourId:ze},Rt&&{sceneId:Rt}));Ur.dispatch("updateSelectedPano",{tourId:ze,pano:qr,sceneId:Rt})}},7655:(ze,wt,Rt)=>{"use strict";function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}Rt.d(wt,{Y_:()=>addModal,pT:()=>closeAllModals,Mr:()=>closeModal,pI:()=>dismissCloseModal,T:()=>isModalActive,Eb:()=>modalExists,C8:()=>sr,h7:()=>openModal,_H:()=>requestCloseModal});const Xt={addModal:(ze,wt)=>(ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt.id]:{active:!1}}),ze),openModal:(ze,wt)=>(ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt.id]:{active:!0,closeRequest:!1}}),ze),closeModal:(ze,wt)=>(ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt.id]:{active:!1,closeRequest:!1}}),ze),requestCloseModal:(ze,wt)=>(ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt.id]:{active:!0,closeRequest:!0}}),ze),dismissCloseModal:(ze,wt)=>(ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt.id]:{active:!0,closeRequest:!1}}),ze),closeAllModals:ze=>(Object.keys(ze.modals).map(wt=>{ze.modals=_objectSpread(_objectSpread({},ze.modals),{},{[wt]:{active:!1,closeRequest:!1}})}),ze)},sr=(0,Rt(3352).MT)({initialState:{modals:{}},actions:Xt}),addModal=ze=>{sr.dispatch("addModal",{id:ze})},openModal=ze=>{sr.dispatch("openModal",{id:ze})},closeModal=ze=>{sr.dispatch("closeModal",{id:ze})},requestCloseModal=ze=>{sr.dispatch("requestCloseModal",{id:ze})},dismissCloseModal=ze=>{sr.dispatch("dismissCloseModal",{id:ze})},closeAllModals=()=>{sr.dispatch("closeAllModals")},modalExists=ze=>{const wt=sr.getState().modals;return Boolean(wt[ze])},isModalActive=ze=>{const wt=sr.getState().modals;return Boolean(wt[ze]?.active)}},3609:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{gs:()=>hasConsent,tH:()=>Xt,ib:()=>updateServiceConsent});const Xt=(0,Rt(3352).MT)({initialState:{mapbox:!1,vimeo:!1,youtube:!1},actions:{updateServiceConsent:(ze,{mapbox:wt,vimeo:Rt,youtube:Xt})=>(ze.mapbox=wt,ze.vimeo=Rt,ze.youtube=Xt,ze)}}),updateServiceConsent=ze=>{Xt.dispatch("updateServiceConsent",ze)},hasConsent=ze=>Xt.getState()[ze]},6308:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{xg:()=>getSmartSubscriptionProject,pm:()=>sr,UI:()=>updateSmartSubscriptionProject});const Xt={project:{projectPhaseId:void 0,districtId:void 0,title:void 0,area:void 0,name:void 0}},sr=(0,Rt(3352).MT)({initialState:Xt,actions:{updateProject:(ze,wt)=>(ze.project=wt,ze)}}),updateSmartSubscriptionProject=ze=>{sr.dispatch("updateProject",ze)},getSmartSubscriptionProject=()=>sr.getState().project},8248:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Nv:()=>getSubscriptionAddress,C_:()=>getSubscriptionState,TR:()=>getSubscriptionUser,lQ:()=>isStoreAddressDataComplete,uz:()=>isStoreUserDataComplete,QS:()=>isSubscribedToAreaProject,wz:()=>isSubscribedToProjectPhase,Hz:()=>isSubscriptionFormRequired,US:()=>subscribeToAreaProject,Iq:()=>subscribeToAreaProjectAndProjectPhases,pG:()=>subscribeToConstructionNumber,Az:()=>subscribeToProjectPhase,uc:()=>subscribeToPropertyType,SF:()=>subscribeToPropertyTypes,or:()=>Yi});var Xt=Rt(3352),sr=Rt(5696),Dr=Rt(5940),Lr=Rt(6033),Ur=Rt(2568),qr=Rt.n(Ur),ri=Rt(1408);const areaNewsletterBaseApiCall=async({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt})=>{const sr={FirstName:wt.firstName||"",LastName:wt.lastName,LastNamePrefix:wt.lastNamePrefix||"",Email:wt.email,Website:wt.website||"",ProjectId:ze.projectPhaseId||"",PropertyId:ze.propertyTypeId||"",AreaId:ze.areaProjectId||"",DistrictId:ze.districtId||"",ConstructionNumberId:ze.constructionNumberId||""};wt.gender&&(sr.IsMale="Mr"===wt.gender),Rt&&(sr.Phone=Rt.phoneNumber,sr.PostalCode=Rt.zipcode||"",sr.Street=Rt.street||"",sr.HouseNumber=Rt.houseNumber,sr.HouseNumberAddition=Rt.houseNumberAddition||"",sr.City=Rt.city,sr.Country=Rt.country),Xt&&(sr.IntendedUsage=Xt.intendedUsage,sr.PurchaseTimeframe=Xt.purchaseTimeframe,sr.FinancialCheck=Xt.financialCheck,sr.Comment=Xt.comment),ri.Z.isLocal&&console.log(sr),await fetch("/umbraco/api/ajaxform/submitfooterform",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(sr)})},areaNewsletterApiCalls_constructionNumber=async({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt,GTMEventLabel:sr})=>{try{await areaNewsletterBaseApiCall({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt}),sr&&(0,Dr.d)({event:"gtm.NewsletterSubscription",eventCategory:"Newsletter",eventAction:"Subscribe Bouwnummer",eventLabel:`${ze.constructionNumberId} ${sr}`,email:qr()(wt.email),email_sha_256:await(0,Lr.J)(wt.email)})}catch(ze){console.log("Error subscribing to property type newsletter",ze)}},areaNewsletterApiCalls_propertyType=async({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt,GTMEventLabel:sr})=>{try{await areaNewsletterBaseApiCall({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt}),sr&&(0,Dr.d)({event:"gtm.NewsletterSubscription",eventCategory:"Newsletter",eventAction:"Subscribe Woningtype",eventLabel:`${ze.propertyTypeId} ${sr}`,email:qr()(wt.email),email_sha_256:await(0,Lr.J)(wt.email)})}catch(ze){console.log("Error subscribing to property type newsletter",ze)}},areaNewsletterApiCalls_projectPhase=async({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt,GTMEventLabel:sr})=>{try{await areaNewsletterBaseApiCall({areaInfo:ze,userInfo:wt,address:Rt,buyerInfo:Xt}),sr&&(0,Dr.d)({event:"gtm.NewsletterSubscription",eventCategory:"Newsletter",eventAction:"Subscribe Gebied",eventLabel:sr,email:qr()(wt.email),email_sha_256:await(0,Lr.J)(wt.email)})}catch(ze){console.log("Error subscribing to project phase newsletter",ze)}},areaNewsletterApiCalls_areaProject=async({areaInfo:ze,userInfo:wt,buyerInfo:Rt,GTMEventLabel:Xt})=>{try{await areaNewsletterBaseApiCall({areaInfo:ze,userInfo:wt,buyerInfo:Rt}),Xt&&(0,Dr.d)({event:"gtm.NewsletterSubscription",eventCategory:"Newsletter",eventAction:"Subscribe Gebied",eventLabel:Xt,email:qr()(wt.email),email_sha_256:await(0,Lr.J)(wt.email)})}catch(ze){console.log("Error subscribing to project phase newsletter",ze)}};function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const ai={init:(ze,wt)=>(ze.user=wt.user,ze.address=wt.address,ze.areaProject=wt.areaProject,ze.projectPhases=wt.projectPhases,ze.propertyTypes=wt.propertyTypes,ze.isUpdatedFromUserStore=wt.isUpdatedFromUserStore,ze),updateBatch:(ze,{user:wt,address:Rt,projectPhases:Xt,propertyTypes:sr,areaProject:Dr})=>(Dr&&(ze.areaProject=!0),Xt?.length&&(ze.projectPhases=[...ze.projectPhases,...Xt]),sr?.length&&(ze.propertyTypes=[...ze.propertyTypes,...sr]),wt&&(ze.user=_objectSpread(_objectSpread({},ze.user),wt)),Rt&&(ze.address=_objectSpread(_objectSpread({},ze.address),Rt)),ze),update:(ze,{areaInfo:wt,userInfo:Rt,address:Xt})=>{if(wt){const{areaProjectId:Rt,projectPhaseId:Xt,propertyTypeId:sr}=wt;Rt&&(ze.areaProject=!0),sr?ze.propertyTypes=[...ze.propertyTypes,sr]:Xt&&(ze.projectPhases=[...ze.projectPhases,Xt])}return Rt&&(ze.user=_objectSpread(_objectSpread({},ze.user),Rt)),Xt&&(ze.address=_objectSpread(_objectSpread({},ze.address),Xt)),ze},onLogin:(ze,wt)=>{if(wt.info){const{email:Rt,initials:Xt,firstName:sr,lastName:Dr,gender:Lr,subscribedToAreaNewsletter:Ur,zipcode:qr,street:ri,houseNumber:ai,houseNumberSuffix:Yi,city:Ji,phoneNumber:Qi,country:kn}=wt.info;ze.address={city:Ji,zipcode:qr,street:ri,houseNumber:ai,houseNumberAddition:Yi,phoneNumber:Qi,country:kn},ze.user={email:Rt,initials:Xt,firstName:sr,lastName:Dr,gender:Lr},ze.areaProject=!!Ur,ze.projectPhases=wt.projects?.map(({Id:ze})=>ze)??[],ze.propertyTypes=wt.propertyTypes?.map(({Id:ze})=>ze)??[],ze.isUpdatedFromUserStore=!0}return ze},onLogout:ze=>(ze.projectPhases=[],ze.propertyTypes=[],ze.areaProject=!1,ze.address=void 0,ze.user=void 0,ze.isUpdatedFromUserStore=!1,ze)},Yi=(0,Xt.yh)({key:"subscription",initialState:{areaProject:!1,projectPhases:[],propertyTypes:[],isUpdatedFromUserStore:!1},actions:ai,expireInDays:30,initAction:"init"});sr.HP.subscribe(ze=>{ze.loggedIn?getSubscriptionState().isUpdatedFromUserStore||Yi.dispatch("onLogin",ze):Yi.dispatch("onLogout")},["loggedIn"]);const subscribeToAreaProject=async ze=>{try{await areaNewsletterApiCalls_areaProject(ze),Yi.dispatch("update",ze)}catch{}},subscribeToProjectPhase=async ze=>{try{await areaNewsletterApiCalls_projectPhase(ze),Yi.dispatch("update",ze)}catch{}},subscribeToAreaProjectAndProjectPhases=async(ze,wt)=>{const Rt={};try{wt&&(await areaNewsletterApiCalls_areaProject(wt),Rt.areaProject=!0,Rt.user=_objectSpread({},wt.userInfo)),Rt.address=ze[0].address,Rt.projectPhases=[];for(const wt of ze)await areaNewsletterApiCalls_projectPhase(wt),Rt.projectPhases.push(wt.areaInfo.projectPhaseId);Yi.dispatch("updateBatch",Rt)}catch{}},subscribeToPropertyType=async ze=>{try{await areaNewsletterApiCalls_propertyType(ze),Yi.dispatch("update",ze)}catch{}},subscribeToPropertyTypes=async ze=>{const wt={};try{wt.propertyTypes=[];for(const Rt of ze)await areaNewsletterApiCalls_propertyType(Rt),wt.propertyTypes.push(Rt.areaInfo.propertyTypeId);Yi.dispatch("updateBatch",wt)}catch{}},subscribeToConstructionNumber=async ze=>{try{await areaNewsletterApiCalls_constructionNumber(ze),Yi.dispatch("update",ze)}catch{}},isSubscribedToAreaProject=()=>Yi.getState().areaProject,isSubscribedToProjectPhase=ze=>Yi.getState().projectPhases.includes(ze),getSubscriptionUser=()=>Yi.getState().user,getSubscriptionAddress=()=>Yi.getState().address,getSubscriptionState=()=>Yi.getState(),isStoreUserDataComplete=ze=>{if(!ze)return!1;const{email:wt,firstName:Rt,lastName:Xt,gender:sr}=ze;return!!(wt&&Rt&&Xt&&sr)},isStoreAddressDataComplete=ze=>{if(!ze)return!1;
20const{zipcode:wt,phoneNumber:Rt,street:Xt,houseNumber:sr,city:Dr}=ze;return!!(wt&&Xt&&sr&&Dr&&Rt)},isSubscriptionFormRequired=()=>{const ze=getSubscriptionUser(),wt=getSubscriptionAddress(),Rt=isStoreUserDataComplete(ze),Xt=isStoreAddressDataComplete(wt);return{area:!Rt,project:!(Rt&&Xt)}}},5696:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{$f:()=>sr.$f,AH:()=>sr.AH,HP:()=>Xt.HP,Mp:()=>sr.Mp,Nq:()=>Xt.Nq,PO:()=>sr.PO,Sd:()=>sr.Sd,bG:()=>sr.bG,eo:()=>sr.eo,gS:()=>Xt.gS,jV:()=>Xt.jV,jl:()=>sr.jl,kS:()=>sr.kS,t9:()=>sr.t9,x4:()=>sr.x4,xS:()=>sr.xS,ys:()=>sr.ys});var Xt=Rt(7306),sr=Rt(6149)},7306:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{HP:()=>Lr,Nq:()=>updateUser,gS:()=>updateUserInfo,jV:()=>updateWishlist,pn:()=>clearUser});var Xt=Rt(3352),sr=Rt(2709);function ownKeys(ze,wt){var Rt=Object.keys(ze);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Dr={init:(ze,wt)=>(ze.info=wt.info,ze.wishlist=wt.wishlist,ze.areas=wt.areas,ze.projects=wt.projects,ze.propertyTypes=wt.propertyTypes,ze.loggedIn=wt.loggedIn,ze),clearUser:ze=>(ze.info=void 0,ze.wishlist=void 0,ze.areas=void 0,ze.projects=void 0,ze.propertyTypes=void 0,ze.loggedIn=!1,ze),updateWishlist:(ze,wt)=>(ze.wishlist=[...wt],ze),addProject:(ze,wt)=>(ze.projects?ze.projects=[...ze.projects,...wt]:ze.projects=wt,ze),updateUserInfo:(ze,wt)=>ze.info?(ze.info=_objectSpread(_objectSpread({},ze.info),wt),ze):ze},Lr=(0,Xt.mS)({key:sr.yg,initialState:{loggedIn:!1},actions:Dr,initAction:"init"}),updateUser=ze=>{Lr.dispatch("init",ze)},clearUser=()=>{Lr.dispatch("clearUser")},updateWishlist=ze=>{Lr.dispatch("updateWishlist",ze)},updateUserInfo=ze=>{Lr.dispatch("updateUserInfo",ze)}},2709:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{B$:()=>sr,Ez:()=>Lr,TQ:()=>Yi,d$:()=>ai,fQ:()=>Ji,fj:()=>Dr,kR:()=>ri,vT:()=>Ur,wS:()=>qr,yg:()=>Xt});const Xt="user::store",sr="bpdAccountToken",Dr=Math.floor(182.5),Lr="myHomeIframe::messageEvent",Ur="myhomeiframe",qr="accountLogin",ri="/umbraco/surface/account/get",ai="/umbraco/surface/account/addtowishlist",Yi="/umbraco/surface/account/removefromwishlist",Ji="/umbraco/surface/account/updaterabobankpreference"},6149:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Mp:()=>addToWishlist,PO:()=>checkLoggedInUser,eo:()=>getUserAreas,Sd:()=>getUserBuyerStatus,bG:()=>getUserInfo,AH:()=>getUserWishlist,ys:()=>handleGTM,jl:()=>isLoggedIn,x4:()=>login,kS:()=>logout,$f:()=>removeFromWishlist,t9:()=>wishlistContains,xS:()=>wishlistLength});var Xt=Rt(7995),sr=Rt(3352),Dr=Rt(3397);var Lr=Rt(7173),Ur=Rt(1408),qr=Rt(5940),ri=Rt(6033),ai=Rt(2568),Yi=Rt.n(ai),Ji=Rt(7306),Qi=Rt(2709),kn=Rt(8648);let jn=null;const checkLoggedInUser=async()=>{const ze=(0,kn.IJ)(),wt=(0,kn.WH)();window.addEventListener("message",handleLoginData);const{get:Rt,clearParam:Xt}=(0,sr.H1)();if(Rt("user-redirect"))return Xt("user-redirect"),void login();if(!ze&&wt){const ze=await(0,kn.FQ)(wt);ze&&(0,kn.wp)(ze)}},handleGTM=async()=>{const{areas:ze,projects:wt,propertyTypes:Rt,info:Xt}=Ji.HP.getState(),toIdList=ze=>ze?.length?ze.map(({Id:ze})=>ze):void 0,sr={event:"initUser",userId:Xt?.id,loggedIn:!!Xt,email:Xt?.email&&Yi()(Xt.email),email_sha_256:Xt?.email&&await(0,ri.J)(Xt.email),favorite_areas:toIdList(ze),favorite_projects:toIdList(wt),favorite_houses:toIdList(Rt)};(0,qr.d)(sr)},handleLoginData=async ze=>{const{event:wt,loginToken:Rt}=ze.data;if(wt!==Qi.wS||!Rt)return;jn?.closeAndRemove();const Xt=await(0,kn.FQ)(Rt);Xt&&(0,kn.wp)(Xt),(0,kn.d5)(Rt)},getUserInfo=()=>Ji.HP.getState().info,getUserAreas=()=>Ji.HP.getState().areas,getUserWishlist=()=>Ji.HP.getState().wishlist,isLoggedIn=()=>Ji.HP.getState().loggedIn,login=()=>{jn=(0,Xt.h)("bpd-login-screen",null),jn&&Lr.R.body.append(jn)},logout=()=>{if((0,kn.Nk)(),!window.__ENVIRONMENT_DETAILS__.logoutUrl)return void(Ur.Z.isProduction||console.error("logoutUrl is missing on window.__ENVIRONMENT_DETAILS__ object"));const ze=document.createElement("iframe");
20ze.title="Logout iframe",ze.src=window.__ENVIRONMENT_DETAILS__.logoutUrl,ze.classList.add("u-hidden"),Lr.R.body.append(ze),document.querySelector("[js-hook-account-frame]")&&setTimeout(()=>window.location.reload(),2e3)},wishlistContains=ze=>(getUserWishlist()||[]).indexOf(ze)>-1,addToWishlist=async ze=>{const wt=getUserWishlist()||[];if(Ur.Z.isLocal)(0,Ji.jV)([ze,...wt]);else{if(!isLoggedIn())return login(),void Ji.HP.subscribe(function addWhenLoggedIn({loggedIn:wt}){wt&&!wishlistContains(ze)&&(addToWishlist(ze),Ji.HP.unsubscribe(addWhenLoggedIn))},["loggedIn"]);(0,Ji.jV)([ze,...wt]);try{await(0,kn.uv)(ze)}catch(ze){return(0,Ji.jV)(wt),void console.log("error addToWishlist ",ze)}}},removeFromWishlist=async ze=>{const wt=getUserWishlist()||[],Rt=[...wt],Xt=wt.indexOf(ze);if(Xt>-1&&(wt.splice(Xt,1),(0,Ji.jV)(wt)),!Ur.Z.isLocal){if(!isLoggedIn())return void(Ur.Z.isProduction||console.error("User must be logged in to remove favourite"));try{await(0,kn.z6)(ze)}catch(ze){return(0,Ji.jV)(Rt),void console.log("error removeFromWishlist ",ze)}}},wishlistLength=()=>(getUserWishlist()||[]).length,getUserBuyerStatus=async ze=>{const{id:wt}=getUserInfo();return await(async(ze,wt)=>{const Rt=`/umbraco/surface/account/buyerstatus?accountId=${ze}&constructionNumberId=${wt}`;try{const ze=await fetch((0,Dr.S)(Rt)).then(ze=>ze.json());if(!ze)return;return ze.status}catch{return}})(wt,ze)};document.addEventListener(Qi.Ez,ze=>{var wt;(wt=ze.detail).event===Qi.vT?isLoggedIn()||login():(0,qr.d)(wt)})},8648:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{FQ:()=>fetchUserData,IJ:()=>getSessionStorageData,Nk:()=>clearData,WH:()=>getMyAccountCookie,d5:()=>setMyAccountCookie,t9:()=>updateRabobankPreferenceApiCall,uv:()=>addToWishlistApiCall,wp:()=>fillUserStore,z6:()=>removeFromWishlistApiCall});var Xt=Rt(1408),sr=Rt(5044),Dr=Rt(6808),Lr=Rt.n(Dr),Ur=Rt(7306),qr=Rt(2709),ri=Rt(6149);function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const fillUserStore=async ze=>{if(!ze)return;const wt={id:ze.Id,email:ze.Email??"",displayName:ze.DisplayName??"",initials:ze.Initials??"",firstName:ze.FirstName??"",lastName:ze.LastName??"",gender:ze.Salutation,subscribedToAreaNewsletter:ze.SubscribedToAreaNewsletter??!1,hasRabobankOpportunity:ze.HasRabobankOpportunity??!1,rabobankPreference:ze.RabobankPreference};ze.Avatar&&(wt.avatar=ze.Avatar),ze.HasAddress&&(wt.hasAddress=ze.HasAddress),ze.PostalCode&&(wt.zipcode=ze.PostalCode),ze.Street&&(wt.street=ze.Street),ze.HouseNumber&&(wt.houseNumber=ze.HouseNumber),ze.HouseNumberAddition&&(wt.houseNumberSuffix=ze.HouseNumberAddition),ze.City&&(wt.city=ze.City),ze.PhoneNumber&&(wt.phoneNumber=ze.PhoneNumber),ze.Country&&(wt.country=ze.Country);const{projectPhases:Rt,propertyTypes:Xt}=await(0,sr.KP)();ze.Projects=ze.Projects.filter(({Id:ze})=>Rt.find(({id:wt,mainImage:Rt})=>wt===ze&&!!Rt?.url)),ze.PropertyTypes=ze.PropertyTypes.filter(({Id:ze})=>Xt.find(({id:wt,mainImage:Rt})=>wt===ze&&!!Rt?.url)),(0,Ur.Nq)({loggedIn:!0,info:wt,wishlist:ze.Wishlist,areas:ze.Areas,projects:ze.Projects,propertyTypes:ze.PropertyTypes})},setMyAccountCookie=ze=>{Lr().set(qr.B$,ze,{expires:qr.fj})},getMyAccountCookie=()=>Lr().get(qr.B$),getSessionStorageData=()=>sessionStorage.getItem(qr.yg),fetchUserData=async ze=>{const{areaId:wt}=window.__ENVIRONMENT_DETAILS__,Rt=`${Xt.Z.baseApiUrl}${qr.kR}?token=${ze}&areaid=${wt}`;let sr;try{const ze=await fetch(Rt,{method:"GET",cache:"no-cache"});sr=await ze.json()}catch(ze){console.error("Couldn't fetch user data:","\n",ze)}return sr},clearData=()=>{Lr().remove(qr.B$),sessionStorage.removeItem(qr.yg),(0,Ur.pn)()},makeFormPost=async(ze,wt)=>{const Rt=getMyAccountCookie(),{id:Xt}=(0,ri.bG)()??{};let sr="",Dr={};return Xt&&(sr=new URLSearchParams(function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}({token:Rt??"",accountId:Xt??""},wt)).toString(),Dr={"x-requested-with":"XMLHttpRequest","content-type":"application/x-www-form-urlencoded; charset=UTF-8"}),await fetch(ze,{method:"POST",body:sr,headers:Dr}).then(ze=>ze.json())},addToWishlistApiCall=ze=>makeFormPost(qr.d$,{constructionNumberId:ze}),removeFromWishlistApiCall=ze=>makeFormPost(qr.TQ,{constructionNumberId:ze}),updateRabobankPreferenceApiCall=()=>{const{areaId:ze}=window.__ENVIRONMENT_DETAILS__;return makeFormPost(qr.fQ,{areaId:ze})}},4025:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>requestAddress,U:()=>requestBrochure});var Xt=Rt(3352);const requestBrochure=async({additionalPdfs:ze,email:wt,firstName:Rt,lastNamePrefix:sr,lastName:Dr,areaProjectId:Lr,projectPhaseId:Ur,propertyTypeId:qr,constructionNumberId:ri,pageUrl:ai})=>{const Yi={data:ze,email:wt,firstName:Rt,sufix:sr,lastName:Dr,pageUrl:ai,areaId:Lr,projectId:Ur,propertyId:qr,constructionNumberId:ri};try{await(0,Xt.RY)(Yi)}catch(ze){console.error(ze)}};var sr=Rt(1408),Dr=Rt(3397);const requestAddress=async({postcode:ze,houseNumber:wt,houseNumberAddition:Rt})=>{let Xt=(0,Dr.S)("/umbraco/surface/Postcode/LookupAddress");Xt+=`?postcode=${ze}`,Xt+=`&houseNumber=${wt}`,Rt&&(Xt+=`&houseNumberAddition=${Rt}`);const Lr=await fetch(Xt).then(ze=>ze.json()).catch(ze=>!sr.Z.isProduction&&console.error(ze));if(Lr)return Lr}},7663:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Sw:()=>Ur,up:()=>ai,NS:()=>ri,UN:()=>qr,Jy:()=>formatApartmentBuildingStatus,Sz:()=>formatConstructionNumberStatus,z4:()=>formatDetailPageUrl,rg:()=>formatDistrictStatus,g0:()=>formatLivingArea,aM:()=>formatPlotArea,T4:()=>formatPrice,pp:()=>formatProjectPhaseStatus,YN:()=>formatPropertyTypeStatus,z8:()=>formatRooms,pu:()=>formatShoppingCartUrl});var Xt=Rt(3352),sr=Rt(3748),Dr=Rt(5044);const formatNumber=ze=>
20Number(ze).toLocaleString("nl-NL",{minimumFractionDigits:0}),formatAmount=ze=>{const{from:wt,to:Rt}=ze;if(!wt)return;let Xt=`⬠${formatNumber(wt)}`;return Rt&&Rt!==wt&&(Xt+=` - ⬠${formatNumber(Rt)}`),Xt},isSamePriceType=(ze,wt)=>ze?.length&&ze?.every(ze=>ze&&wt.includes(ze)),getPriceTypeAbbreviation=(ze,wt,Rt)=>{if(!(wt?.from&&wt.to&&Rt))return"StartsFrom"===ze?(0,Dr.qM)("Acronym-Vanaf"):"Indication"===ze||"Circa"===ze?(0,Dr.qM)("Acronym-Circa"):void 0},hasExclusivePrice=ze=>!!ze.constructionNumbers?.length&&!!ze.constructionNumbers.filter(ze=>!["Rented","Sold","UnderConstruction"].includes(ze.status||"")).filter(ze=>(0,Xt.S2)({constructionNumber:ze})).every(ze=>"KostenKoper"===ze.salesPrice?.condition),formatPurchasePrice=({amount:ze,condition:wt,priceType:Rt},Xt)=>{if(!ze)return;const sr={prefix:getPriceTypeAbbreviation(Rt,ze,Xt),amount:formatAmount(ze)};return"PriceOnRequest"===Rt?sr.amount=(0,Dr.qM)("Acronym-PriceOnRequest"):("VrijOpNaam"===wt&&(sr.suffix=(0,Dr.qM)("Acronym-Inclusive")),"KostenKoper"===wt&&(sr.suffix=(0,Dr.qM)("Acronym-Exclusive"))),sr},formatRentalPrice=({amount:ze,priceType:wt})=>{if(ze)return{prefix:getPriceTypeAbbreviation(wt),amount:formatAmount(ze),suffix:"p.m."}},formatPrice=({constructionNumber:ze,apartmentBuilding:wt,propertyType:Rt,projectPhase:Lr})=>{const{status:Ur}=ze||wt||Rt||{};if(!!["Rented","Sold","UnderConstruction"].includes(Ur||"")){if((0,sr.F)())return;if("OnSale"!==ze?.projectPhase?.status)return}if(ze){const{salesPrice:wt,rentalPrice:Rt}=ze;if(wt)return formatPurchasePrice(wt,!0);if(Rt)return formatRentalPrice(Rt)}if(Rt){const{salesPrice:ze,rentalPrice:wt}=Rt;if(ze)return hasExclusivePrice(Rt)&&(ze.condition="KostenKoper"),formatPurchasePrice(ze);if(wt)return formatRentalPrice(wt)}if(wt){const{projectPhase:ze}=wt,Rt=(0,Xt.XI)(wt),sr=(ze=>{const{constructionNumbers:wt,propertyTypes:Rt}=ze,Xt=wt?.length?wt:Rt;if(Xt)return Xt.filter(({status:ze})=>"Sold"!==ze&&"UnderConstruction"!==ze)?.map(({salesPrice:ze})=>ze?.priceType)})(wt),Lr=(ze=>{const{constructionNumbers:wt,propertyTypes:Rt}=ze,Xt=wt?.length?wt:Rt;return Xt?Xt.map(ze=>ze.salesPrice?.amount||ze.rentalPrice?.amount).reduce((ze,wt)=>wt?(!ze.find(ze=>ze?.from===wt.from&&ze?.to===wt.to)&&ze.push(wt),ze):ze,[]):[]})(wt),Ur=!!ze?.isRental,qr=Lr.length>1,ri=[...new Set(sr)].length>1;if(isSamePriceType(sr,["PriceOnRequest"]))return{amount:(0,Dr.qM)("Acronym-PriceOnRequest")};if(!Rt)return;let ai;isSamePriceType(sr,["Circa","Indication"])&&(ai=(0,Dr.qM)("Acronym-Circa")),isSamePriceType(sr,["StartsFrom"])&&(ai=(0,Dr.qM)("Acronym-Vanaf")),(qr||ri)&&(ai=(0,Dr.qM)("Acronym-Vanaf"));const Yi=hasExclusivePrice(wt)?"Acronym-Exclusive":"Acronym-Inclusive";return{prefix:ai,amount:formatAmount(qr?{from:Rt.from}:Rt),suffix:Ur?"p.m.":(0,Dr.qM)(Yi)}}if(Lr){const{propertyPurchasePrice:ze,propertyRentalPrice:wt}=Lr;if(ze)return formatPurchasePrice(ze);if(wt)return formatRentalPrice(wt)}},rangeAsString=ze=>{let wt;return ze.from&&(wt=`${ze.from}`),ze.to&&(wt=wt?`${wt} - ${ze.to}`:`${ze.to}`),wt||""},formatGenericSpecification=({specification:ze,extendedObject:wt,suffix:Rt})=>{let sr;switch(wt.objectType){case"constructionNumber":case"propertyType":sr=wt.specifications?wt.specifications[ze]:void 0;break;case"apartmentBuilding":case"projectPhase":const Rt=(0,Xt.$c)(wt.constructionNumbers||[],ze),Dr=(0,Xt.M1)({propertyTypes:wt.propertyTypes||[]},ze);sr=(0,Xt.TO)(Rt,Dr)}return sr&&(sr.from||sr.to)?{value:rangeAsString(sr),suffix:Rt}:void 0},formatRooms=ze=>formatGenericSpecification({specification:"rooms",extendedObject:ze,suffix:(0,Dr.qM)("Rooms")}),formatLivingArea=ze=>formatGenericSpecification({specification:"livingArea",extendedObject:ze,suffix:"m²"}),formatPlotArea=ze=>formatGenericSpecification({specification:"plotArea",extendedObject:ze,suffix:"m²"});var Lr=Rt(3305);const formatDetailPageUrl=({constructionNumber:ze,propertyType:wt})=>{const{districtHouseOverviewUrl:Rt}=window.__ENVIRONMENT_DETAILS__;let Xt,Dr,Ur,qr;if(ze&&(Xt=ze.identifier,Dr=ze.propertyTypeName,Ur=ze.propertyTypeId,qr=ze.districtId),wt&&(Dr=wt.name,Ur=wt.id,qr=wt.districtId),!Dr||!qr||!Ur)return;Dr=encodeURI((0,Lr.Z)(Dr)),Xt=Xt?encodeURI(Xt):null;const ri=Rt[qr];if(!ri)return;return(0,sr.F)()?`${ri}/${Dr}-objekttypen-${Ur}${Xt?"/hausnummer-"+Xt:""}`:`${ri}/${Dr}-woningtype-${Ur}${Xt?"/bouwnummer-"+Xt:""}`},formatShoppingCartUrl=ze=>{const{propertyType:wt,identifier:Rt,propertyTypeId:Xt,projectPhaseId:sr,areaProject:Dr,availabilityStatus:Lr,status:Ur}=ze,qr=wt?.status;if(Dr?.website&&!Dr.website.enableCustomerCommunity)return;let ri=!1;switch(qr){case"SaleStarted":"Available"===Ur&&(ri=!0);break;case"AmountAvailable":Ur&&["Available","InOption"].indexOf(Ur)>-1&&(ri=!0);break;case"AssigningOn":"Available"===Lr&&(ri=!0);break;case"InOption":"InOption"===Ur&&(ri=!0)}if(ri){if(!Rt||!sr||!Xt)return;return`/umbraco/api/redirect/salestart?projectId=${sr}&propertyId=${Xt}&constructionNumber=${Rt}`}},Ur={green:"u-color--positive",orange:"u-color--attention",grey:"u-color--grey-50",purple:"u-color--progression",red:"u-color--alert"};function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const qr="status-translations::loaded";
20const ri=new class StatusTranslator{async init(){this._translatedStatuses={InPreparation:await(0,Dr.WU)("StatusLabel-InVoorbereiding"),SaleSoon:await(0,Dr.WU)("SoonOnSale"),SaleStarted:await(0,Dr.WU)("SalesStarted"),OnSale:await(0,Dr.WU)("StatusLabel-InVerkoop"),Available:await(0,Dr.WU)("Enum-ConstructionNumberStatus-Vrij"),ForRent:await(0,Dr.WU)("Enum-ProjectStatus-InVerhuur"),InOption:await(0,Dr.WU)("houses-overview-status-option"),AssigningOn:await(0,Dr.WU)("StatusLabel-AssigningOn"),Reserved:await(0,Dr.WU)("Reserved"),Sold:await(0,Dr.WU)("Enum-ConstructionNumberStatus-Verkocht"),Rented:await(0,Dr.WU)("Enum-ProjectStatus-Verhuurd"),UnderConstruction:await(0,Dr.WU)("UnderConstructionInhabited")},this._formattedStatuses={InPreparation:{label:this._translatedStatuses.InPreparation,color:"grey"},SaleSoon:{label:this._translatedStatuses.SaleSoon,color:"grey"},SaleStarted:{label:this._translatedStatuses.SaleStarted,color:"green"},OnSale:{label:this._translatedStatuses.OnSale,color:"green"},Available:{label:this._translatedStatuses.Available,color:"green"},ForRent:{label:this._translatedStatuses.ForRent,color:"green"},InOption:{label:this._translatedStatuses.InOption,color:"orange"},AssigningOn:{label:this._translatedStatuses.AssigningOn,color:"orange"},Reserved:{label:this._translatedStatuses.Reserved,color:"orange"},Sold:{label:this._translatedStatuses.Sold,color:"red"},Rented:{label:this._translatedStatuses.Rented,color:"red"},UnderConstruction:{label:this._translatedStatuses.UnderConstruction,color:"purple"}},this.isTranslated=!0,document.dispatchEvent(new CustomEvent(qr,{detail:{isTranslated:!0}}))}constructor(){_defineProperty(this,"_formattedStatuses",void 0),_defineProperty(this,"_translatedStatuses",void 0),_defineProperty(this,"isTranslated",!1),this.init()}get LABEL(){return this._translatedStatuses}get FORMATTED(){return this._formattedStatuses}},ai={InPreparation:"StatusLabel-InVoorbereiding",Available:"Enum-ConstructionNumberStatus-Vrij",InOption:"houses-overview-status-option",Sold:"Enum-ConstructionNumberStatus-Verkocht",Reserved:"Reserved",Rented:"Enum-ProjectStatus-Verhuurd",UnderConstruction:"UnderConstructionInhabited",AssigningOn:"StatusLabel-AssigningOn"},formatConstructionNumberStatus=ze=>{const{status:wt,projectPhase:Rt}=ze;if(wt)switch(wt){case"Available":return ze.projectPhase?.isRental?ri.FORMATTED.ForRent:ri.FORMATTED.Available;case"AssigningOn":const Xt=new Date(Rt?.allocationDate).toLocaleDateString(window.__ENVIRONMENT_DETAILS__.languageIsoCode,{day:"numeric",month:"short"});return{label:(0,Dr.qM)("StatusLabel-AssigningOn.Dynamic",{replace:[{id:"Date",value:Xt}]}),color:"orange"};default:return ri.FORMATTED[wt]}},formatPropertyTypeStatus=ze=>{const{projectPhase:wt,constructionNumbers:Rt,status:Xt}=ze;if(Xt)switch(Xt){case"AmountAvailable":const ze=Rt.filter(ze=>"Available"===ze.availabilityStatus);return{label:(0,Dr.qM)("StatusLabel-AmountAvailable",{replace:[{id:"Amount",value:`${ze.length}`}]}),color:"green"};case"AssigningOn":const sr=new Date(wt?.allocationDate).toLocaleDateString(window.__ENVIRONMENT_DETAILS__.languageIsoCode,{day:"numeric",month:"short"});return{label:(0,Dr.qM)("StatusLabel-AssigningOn.Dynamic",{replace:[{id:"Date",value:sr}]}),color:"orange"};default:return ri.FORMATTED[Xt]}},formatApartmentBuildingStatus=ze=>{const{status:wt,constructionNumbers:Rt,projectPhase:Xt}=ze;if(wt)switch(wt){case"AmountAvailable":const ze=Rt.filter(ze=>"Available"===ze.availabilityStatus);return{label:(0,Dr.qM)("StatusLabel-AmountAvailable",{replace:[{id:"Amount",value:`${ze.length}`}]}),color:"green"};case"AssigningOn":const sr=new Date(Xt?.allocationDate).toLocaleDateString(window.__ENVIRONMENT_DETAILS__.languageIsoCode,{day:"numeric",month:"short"});return{label:(0,Dr.qM)("StatusLabel-AssigningOn.Dynamic",{replace:[{id:"Date",value:sr}]}),color:"orange"};default:return ri.FORMATTED[wt]}},formatProjectPhaseStatus=ze=>{const{status:wt}=ze;if(wt&&"NotActive"!==wt)return ri.FORMATTED[wt]},formatDistrictStatus=ze=>{const{status:wt}=ze;if(wt&&"NotActive"!==wt)return ri.FORMATTED[wt]}},7173:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{R:()=>Xt});const Xt={html:document.documentElement,body:document.body}},1408:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>qr});var Xt=Rt(3352),sr=Rt(9162);function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Dr="local",Lr=Dr;const Ur=new class Environment{constructor(){_defineProperty(this,"_baseApiUrl",void 0)}get get(){return window.__ENVIRONMENT_DETAILS__.environment||Lr}get isLocal(){return this.get===Dr}get isTest(){return"test"===this.get}get isAcceptation(){return"acceptation"===this.get}get isProduction(){return"production"===this.get}get isDebugMode(){return!!(0,Xt.H1)().get("debug")&&!this.isProduction}get isGermany(){return window.__ENVIRONMENT_DETAILS__.languageIsoCode===sr.Eu}set baseApiUrl(ze){Ur.isLocal&&(this._baseApiUrl=ze)}get baseApiUrl(){return Ur.isLocal?this._baseApiUrl:window.location.origin}},qr=Ur},903:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{R:()=>getAssetsFolder});var Xt=Rt(1408);const getAssetsFolder=ze=>{let wt="/assets";return Xt.Z.isLocal||(wt="/frontend/hestia/assets"),wt+ze}},3397:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{S:()=>getPrefixedUrl});var Xt=Rt(1408);const getPrefixedUrl=ze=>Xt.Z.isLocal?Xt.Z.baseApiUrl+ze:ze},5940:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{d:()=>GTMPush});const GTMPush=ze=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push(ze)}},5044:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Xx:()=>normalizedTranslateItem,WU:()=>translateItem,Hg:()=>translateItems,KP:()=>sr,dW:()=>Dr,iY:()=>Qi.i,xV:()=>useCountryPostcodeValidator,bl:()=>Wn.b,Gl:()=>kn.G,bM:()=>
20usePostcodeChecker,pV:()=>useSelectedCountry,Rd:()=>useStylesheet,XK:()=>useText,qM:()=>useTranslate});var Xt=Rt(3352);const{getData:sr,getDataUnsafe:Dr}=(()=>{let ze;return{getData:async()=>(ze||(ze=await Xt._n.getData(window.__ENVIRONMENT_DETAILS__.areaId)),ze),getDataUnsafe:()=>ze}})();function useText(ze){const wt=new Text;function setText(ze){wt.textContent=ze}return Object.defineProperty(wt,"toString",{value(){return this.textContent}}),null!=ze&&setText(ze),[wt,setText]}let Lr;const Ur=(0,Rt(741).XO)().showDictionaryKeys,getTranslationByKey=(ze,wt)=>{let Rt=ze[wt]||"";return Ur&&(Rt=`${Rt} :: ${wt}`),Rt},applyTranslateOptions=(ze,wt)=>(wt?.plurality&&wt.plurality.forEach(({id:wt,value:Rt,total:Xt})=>{const sr=ze.match(new RegExp(`\\{id:\\s*${wt}\\s*\\/one:([^\\/]*)\\/many:([^\\/\\}]*)(?:\\/none:([^\\/\\}]*))?(?:\\/max:([^\\}]*))?\\}`));if(!sr)return;let Dr;Dr=Rt<=0?sr[3]||sr[2]:Xt&&Rt>=Xt&&sr[4]?sr[4]:1===Rt?sr[1]:sr[2],ze=ze.replace(sr[0],Dr.trim())}),wt?.replace&&wt.replace.forEach(({id:wt,value:Rt})=>{ze=ze.replace(new RegExp(`\\[${wt}\\]`,"g"),Rt)}),ze),fetchDictionary=async()=>{const{dictionaryUrl:ze}=window.__ENVIRONMENT_DETAILS__,wt=await fetch(ze);return await wt.json()},translateItem=async(ze,wt)=>{const Rt=sessionStorage.getItem("dictionary"),Xt=Rt&&"null"!==Rt?JSON.parse(Rt):[];if(Xt&&Xt.length>0)return applyTranslateOptions(getTranslationByKey(Xt,ze),wt);const sr=await(async()=>(Lr||(Lr=fetchDictionary()),await Lr))();if(sr){try{sessionStorage.setItem("dictionary",JSON.stringify(sr))}catch(ze){console.log("Error in sessionStorage.setItem",ze)}return applyTranslateOptions(getTranslationByKey(sr,ze),wt)}return Ur?`:: ${ze}`:""},translateItems=async(ze,wt)=>{const Rt={};for(const Xt of Object.keys(ze))ze[Xt]&&(Rt[Xt]=await translateItem(ze[Xt],wt));return Rt},normalizedTranslateItem=async(ze,wt)=>{const Rt=wt.toLowerCase().replace(/[^a-zA-Z0-9A-zÃ-ú]/g,"");const Xt=await translateItem(`${ze}${Rt}`);return Xt.length?Xt:wt},useTranslate=(ze,wt)=>{const[Rt,Xt]=useText("");return translateItem(ze).then(ze=>{ze&&(ze=applyTranslateOptions(ze,wt),Xt(ze),wt?.onUpdate&&wt.onUpdate())}),Rt};var qr=Rt(9490);const ri=window.ShadyCSS&&!window.ShadyCSS.nativeShadow,ai=Symbol("atomify.cssSaveToken"),Yi=new Map,Ji=[],supportsAdoptingStyleSheets=()=>"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;const applyShadowdomStyles=(ze,wt)=>{const Rt=ze.container,Xt=ze.$cmpMeta$.$tagName$;let sr;Yi.has(Xt)?sr=Yi.get(Xt):(sr=document.createElement("template"),sr.innerHTML=""+(ze.hasShadowDom&&!supportsAdoptingStyleSheets()&&wt?`<style style-hook>${wt}</style>`:"")),sr&&(ri&&ze.hasShadowDom&&function bindShadyRoot(ze,wt){window.ShadyCSS.prepareTemplate(wt,ze.$cmpMeta$.$tagName$),window.ShadyCSS.styleElement(ze)}(ze,sr),Rt.appendChild(document.importNode(sr.content,!0)))},createCSSResult=(ze,wt)=>{if(wt!==ai)throw new Error(`${ze} is not supported. Use 'unsafeCSS' if you want to use: ${ze}`);let Rt=null;const Xt=ze;return supportsAdoptingStyleSheets()&&(Rt=new CSSStyleSheet,Rt.replaceSync(Xt)),{cssText:Xt,styleSheet:Rt}},adoptStyles=(ze,wt)=>{const Rt=ze.hasShadowDom,Xt=ze.$cmpMeta$.$tagName$;if(supportsAdoptingStyleSheets()&&Rt){const Rt=ze.container;Rt instanceof HTMLElement||(Rt.adoptedStyleSheets=wt.map(ze=>ze instanceof StyleSheet?ze:ze.styleSheet))}else if(-1===Ji.indexOf(Xt)){const sr=wt.map(ze=>"cssText"in ze?ze.cssText:null).join("");if(Rt)ze.styles=sr,applyShadowdomStyles(ze,sr);else{const ze=document.createElement("style");ze.textContent=sr,ze.setAttribute("scope",Xt),document.head.appendChild(ze),Ji.push(Xt)}}},useStylesheet=ze=>{const wt=createCSSResult(String(ze),ai);const Rt=Array.isArray(wt)?[...wt]:[wt];return(0,qr.Bi)({onDidLoad:ze=>adoptStyles(ze,Rt),onUpdate:ze=>adoptStyles(ze,Rt)})};var Qi=Rt(4244),kn=Rt(6260),jn=Rt(4025),Un=Rt(6466);const usePostcodeChecker=({element:ze,hooks:wt,onAddressUpdated:Rt})=>{if(!(0,Un.H)())return;let Xt,sr=null,Dr=null,Lr=null,Ur=null,qr=null,ri=null,ai=!1,Yi=!1;const queryBPDInput=wt=>ze.querySelector(wt),queryHTMLInput=ze=>ze?.querySelector("input")||null,enable=()=>{ai||(Xt?.addEventListener("change",updateAddress),sr?.addEventListener("change",updateAddress),Dr?.addEventListener("change",updateAddress),qr?.setAttribute("disabled","disabled"),ri?.setAttribute("disabled","disabled"),revalidateInputs(),ai=!0)};function revalidateInputs(){Xt?.bindValue&&Xt?.validate(),sr?.bindValue&&sr?.validate(),Dr?.bindValue&&Dr?.validate(),Lr?.bindValue&&Lr.validate(),Ur?.bindValue&&Ur.validate()}const isValidPostcode=()=>Xt?.valid&&sr?.valid&&(Dr?.valid||!Dr?.bindValue),updateAddress=async()=>
20{if(isValidPostcode())try{const ze=await(0,jn.Z)({postcode:Xt.bindValue,houseNumber:sr.bindValue,houseNumberAddition:Dr?.bindValue});if(!ze)return;const{Street:wt,City:Rt}=ze;Lr?.rebindValue(wt),Ur?.rebindValue(Rt)}finally{qr?.removeAttribute("disabled"),ri?.removeAttribute("disabled"),Yi=checkValidity(),Yi&&Rt&&Rt()}};function checkValidity(){return revalidateInputs(),isValidPostcode()&&Lr?.valid&&Ur?.valid||!1}return{initialize:()=>{Xt=queryBPDInput(wt.postcodeHook),sr=queryBPDInput(wt.houseNumberHook),Dr=queryBPDInput(wt.houseNumberAdditionHook),Lr=queryBPDInput(wt.streetNameHook),Ur=queryBPDInput(wt.placeNameHook),qr=queryHTMLInput(Lr),ri=queryHTMLInput(Ur),enable()},updateAddress,enable,disable:()=>{ai&&(Xt?.removeEventListener("change",updateAddress),sr?.removeEventListener("change",updateAddress),Dr?.removeEventListener("change",updateAddress),qr?.removeAttribute("disabled"),ri?.removeAttribute("disabled"),revalidateInputs(),ai=!1)},checkValidity,isEnabled:ai}};var Wn=Rt(694);const useSelectedCountry=ze=>({name:ze?.children[ze?.selectedIndex]?.innerHTML,id:ze?.value});var Yn=Rt(8178),Jn=Rt(9162);const useCountryPostcodeValidator=ze=>{const{id:wt}=ze;(0,Yn.Oh)({zipCode:ze=>{if(!ze)return;let Rt;switch(wt){case Jn.lT:Rt=/^[1-9][0-9]{3} ?[a-z]{2}$/i.test(ze);break;case Jn.EO:Rt=/\b(?!01000)(?!99999)(0[1-9]\d{3}|[1-9]\d{4})\b$/.test(ze);break;default:Rt=!0}return Rt?void 0:useTranslate("EnterValidPostCode")}})}},6389:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{a:()=>useAreaSubscriptionLoader});var Xt=Rt(9490),sr=Rt(5668),Dr=Rt(2896),Lr=Rt(1111);const useAreaSubscriptionLoader=()=>{const ze=(0,Xt.YP)("bpd-area-subscription",{root:document});let wt=!1;(0,Xt.iX)(ze,sr.m,ze=>wt=ze.detail.loaded);const isLoaded=()=>wt||ze.current?.loaded;return{element:ze,isLoaded,load:async()=>{if(!ze.current)return!1;if(isLoaded())return!0;await(0,Dr.j)();return(await(0,Lr.e)(ze.current,sr.m)).detail.loaded}}}},4244:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{i:()=>useButtonLoadingState});var Xt=Rt(9490);const useButtonLoadingState=(ze,wt="is-loading")=>(0,Xt.Bi)({onDidLoad:Rt=>Xt=>{const sr=Rt.querySelector(ze);sr&&(Xt?sr.classList.add(wt):sr.classList.remove(wt))}})},694:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{b:()=>useFormChanges});var Xt=Rt(9490);let sr=[];function setPreviousState(ze){if(sr=[],ze.current){const wt=ze.current.formData();if(!wt)return;const Rt=wt.entries();for(const[wt,Xt]of Rt){const Rt=ze.current.querySelector(`input[name="${wt}"][value="${Xt}"]`);sr.push({key:wt,value:Xt,element:Rt})}}}function useFormChanges(ze,wt){(0,Xt.N_)(async()=>{ze.current?.connected||await(ze.current?.componentOnReady()),setPreviousState(ze)}),(0,Xt.iX)(ze,"change",()=>{if(ze.current){const Rt=ze.current.formData();if(!Rt)return;const Xt=Rt?.entries(),Dr=[];for(const[wt,Rt]of Xt){const Xt=ze.current.querySelector(`input[name="${wt}"][value="${Rt}"]`);Dr.push({key:wt,value:Rt,element:Xt})}const Lr=Dr.filter(ze=>!sr.find(wt=>wt.key===ze.key&&wt.value===ze.value)),Ur=sr.filter(ze=>!Dr.find(wt=>wt.key===ze.key&&wt.value===ze.value));setPreviousState(ze),wt({additions:Lr,deletions:Ur})}})}},6260:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{G:()=>useInput});var Xt=Rt(9490);const useInput=({inputElements:ze,errorTarget:wt,inputLabelTarget:Rt="",onInputChange:sr=()=>null,onInputFocus:Dr=()=>null,onInputBlur:Lr=()=>null,onInputInput:Ur=()=>null,onInputFocusout:qr=()=>null,resetInput:ri=()=>null,onRebindValue:ai=()=>null,onValidate:Yi})=>{const Ji=(0,Xt.lq)(ze),Qi=(0,Xt.YP)(wt),kn=Rt?(0,Xt.YP)(Rt):{current:null},jn=(0,Xt.zX)({eventName:"bindValueChanged"}),Un=(0,Xt.zX)({eventName:"input-validate"});return(0,Xt.iX)(Ji,"change",sr),(0,Xt.iX)(Ji,"focus",Dr),(0,Xt.iX)(Ji,"blur",Lr),(0,Xt.iX)(Ji,"input",Ur),(0,Xt.iX)(Ji,"focusout",qr),(0,Xt.We)("resetInput",ri),(0,Xt.We)("rebindValue",ai),(0,Xt.We)("validate",Yi),{inputs:Ji,errorHolder:Qi,inputLabel:kn,bindValueChanged:jn,inputValidate:Un}}},524:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{O:()=>Ur});const Xt=new Map,sr=new Map,Dr=new Map,Lr=document.querySelector("body");const Ur=new class Inview{observe(ze,wt,Rt={}){if(!ze)return;if(Xt.has(ze))throw new Error(`Trying to observe ${Element} this one is already observed by another instance.`);void 0===Rt.threshold&&(Rt.threshold=function buildThresholdList(){const ze=[];for(let wt=1;wt<=1e3;wt++){const Rt=wt/1e3;ze.push(Rt)}return ze.push(0),ze}());const{threshold:Ur}=Rt,qr=Rt.root||Lr,ri=`${function generateUniqueElementId(ze,wt){if(!wt)return"";if(ze.has(wt))return ze.get(wt);const Rt=`${Math.random().toString(36).substr(2,9)}_`;return ze.set(wt,Rt),ze.get(wt)}(Dr,qr)}`,ai=function generateOptionsId(ze,wt){const{rootMargin:Rt,threshold:Xt}=wt,sr=Xt?Xt.toString():"";return`${ze}${Rt?`${sr}_${Rt}`:sr}`}(ri,Rt);let Yi=sr.get(ai);Yi||(Yi=new IntersectionObserver(ze=>function onChange(ze,wt){ze.forEach(ze=>{const{isIntersecting:Rt,intersectionRatio:Xt,target:sr}=ze,Dr=wt.get(sr);if(Dr&&Xt>=0){let wt=Dr.thresholds.some(ze=>Dr.inView?Xt>ze:Xt>=ze);void 0!==Rt&&(wt=wt&&Rt),Dr.inView=wt,Dr.callback(wt,ze)}})}(ze,Xt),Rt),ai&&sr.set(ai,Yi));const Ji={callback:wt,element:ze,instanceId:ai,inView:!1,observer:Yi,thresholds:Array.isArray(Ur)?Ur:[Ur]};
20return Xt.set(ze,Ji),Ji.observer.observe(ze),Ji}unobserve(ze){if(!ze)return;const wt=Xt.get(ze);if(wt){const{observer:Rt,instanceId:sr}=wt,{rootHasItemsLeft:Lr,rootIsObserved:Ur}=function hasObserverItems(ze,wt,Rt,Xt){let sr=!1,Dr=!1;return ze.forEach((ze,Lr)=>{Lr!==Rt&&(ze.instanceId===Xt&&(Dr=!0,sr=!0),ze.observer.root===wt&&(sr=!0))}),{rootIsObserved:sr,rootHasItemsLeft:Dr}}(Xt,Rt.root,ze,sr);Rt.unobserve(ze),!Ur&&Rt.root&&Dr.delete(Rt.root),Rt&&!Lr&&Rt.disconnect(),Xt.delete(ze)}}destroy(){Xt.forEach(ze=>ze.observer.disconnect()),Xt.clear(),Dr.clear(),sr.clear()}}},3748:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{F:()=>isGermany});var Xt=Rt(9162);const isGermany=()=>window.__ENVIRONMENT_DETAILS__.languageIsoCode===Xt.Eu},6466:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{H:()=>isNetherlands});var Xt=Rt(9162);const isNetherlands=()=>window.__ENVIRONMENT_DETAILS__.languageIsoCode===Xt.$Y},3305:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__=ze=>ze.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(ze=>ze.toLowerCase()).join("-")},2896:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{j:()=>La});var Xt=Rt(3352),sr=Rt(474),Dr=(Rt(7538),Rt(8050)),Lr=Rt(7655);const Ur="aria-controls",qr=document,openModalById=ze=>{const wt=ze.getAttribute(Ur),Rt=ze.getAttribute("data-modal-action");if(!wt)return;const Xt=Lr.C8.getState().modals[wt].closeRequest;switch(Rt){case"open":default:return(0,Lr.h7)(wt);case"close":return(0,Lr.Mr)(wt);case"closeConfirmation":return Xt?(0,Lr.pI)(wt):(0,Lr._H)(wt)}};var ri=Rt(524);const ai=!!window.navigator.userAgent.match(/(MSIE|Trident)/);var Yi=Rt(7173);const Ji=document,Qi=new Map,createIframeModal=ze=>{const{iframeUrl:wt,iframeId:Rt,iframeTitle:Xt,iframeHeight:sr,iframeWidth:Dr}=ze.dataset,Lr=Rt&&Qi.has(Rt);if(wt&&Rt&&!Lr){const ze=document.createElement("bpd-iframe-modal");ze.src=wt,ze.modalTitle=Xt||"",ze.setAttribute("id",Rt),ze.minHeight=sr||"50vh",ze.minWidth=Dr||"100%",Yi.R.body.appendChild(ze),ze.active=!0,Qi.set(Rt,ze)}else if(Lr&&Rt){const ze=Qi.get(Rt);ze&&(ze.active=!0)}};var kn=Rt(5940);var jn=Rt(5696),Un=Rt(1408),Wn=Rt(9162),Yn=Rt(903);const Jn=["domain"];function ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const Qn=Wn.$Y,Io={environment:"local",dictionaryUrl:(0,Yn.R)("/lang/nl.json"),languageIsoCode:Qn,compareUrl:"/compare-houses",areaHouseOverviewUrl:"/properties-overview",logoutUrl:"https://acceptance-bpd.cs189.force.com/MijnEigenHuis/secur/logout.jsp",myEnvironmentUrl:"/account",mapbox:{style:"bpd-acc/ciowo3k3f000udum18y8x7qd0",accessToken:"pk.eyJ1IjoiYnBkLWFjYyIsImEiOiJjaWlzbzBreXcwMzk5dTZrbnNlMDY1ZTFhIn0.N4JONLqHs9Bc67kJTikkXw"}},Mo={TEST:Io,ACC:Io,PROD:_objectSpread(_objectSpread({},Io),{},{logoutUrl:"https://www.mijneigenhuis.nl/secur/logout.jsp",mapbox:{style:"bpd/cj47zzkvg1jo62roansv1k0mo",accessToken:"pk.eyJ1IjoiYnBkIiwiYSI6IjBiNTQyNmIyNTFmNTk4NDdkOTE1MDMyNDViYWRmMDI1In0.tfd0_36gpomlERjFuqPIsQ"}})},jo="mockNodeId",baseApiMock_TEST=ze=>`https://${ze}.test.bpd.nl`,baseApiMock_ACC=ze=>`https://${ze}.acc.bpd.nl`,baseApiMock_PROD=ze=>`https://${ze}.nl`,createMocks=(ze,wt)=>{let{domain:Rt}=ze,Xt=function _objectWithoutProperties(ze,wt){if(null==ze)return{};var Rt,Xt,sr=function _objectWithoutPropertiesLoose(ze,wt){if(null==ze)return{};var Rt={};for(var Xt in ze)if({}.hasOwnProperty.call(ze,Xt)){if(-1!==wt.indexOf(Xt))continue;Rt[Xt]=ze[Xt]}return Rt}(ze,wt);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(ze);for(Xt=0;Xt<Dr.length;Xt++)Rt=Dr[Xt],-1===wt.indexOf(Rt)&&{}.propertyIsEnumerable.call(ze,Rt)&&(sr[Rt]=ze[Rt])}return sr}(ze,Jn);return{TEST:ze=>{Un.Z.baseApiUrl=baseApiMock_TEST(Rt),window.__ENVIRONMENT_DETAILS__=_objectSpread(_objectSpread(_objectSpread(_objectSpread({apiBaseUrl:`${Un.Z.baseApiUrl}/api/middleware`,nodeId:jo},Mo.TEST),Xt),wt?.TEST),ze)},ACC:ze=>{Un.Z.baseApiUrl=baseApiMock_ACC(Rt),window.__ENVIRONMENT_DETAILS__=_objectSpread(_objectSpread(_objectSpread(_objectSpread({apiBaseUrl:`${Un.Z.baseApiUrl}/api/middleware`,nodeId:jo},Mo.ACC),Xt),wt?.ACC),ze)},PROD:ze=>{Un.Z.baseApiUrl=baseApiMock_PROD(Rt),window.__ENVIRONMENT_DETAILS__=_objectSpread(_objectSpread(_objectSpread(_objectSpread({apiBaseUrl:`${Un.Z.baseApiUrl}/api/middleware`,nodeId:jo},Mo.PROD),Xt),wt?.PROD),ze)}}},zo={domain:"hoefenhaag",areaId:"a0iw0000008QvIVAA0",areaProjectName:"Hoef en Haag",districtHouseOverviewUrl:{a0lw000000EBLa4AAH:"/het-dorpshart/woningen",a0lw000000EBvWTAA1:"/het-lint/woningen",a0lw000000EBvWYAA1:"/de-erven/woningen"}},oa={domain:"digital-park",areaId:"a0i7R00001qWMD9QAO",areaProjectName:"Digital Park",districtHouseOverviewUrl:{a0l7R00000dUs1zQAC:"/department-digitals/woningen",a0l7R00000gK6fuQAC:"/department-digital-rental/woningen"}},la={HoefenHaag:createMocks(zo),DeErven:createMocks(_objectSpread(_objectSpread({},zo),{},{districtId:"a0lw000000EBvWYAA1"})),DigitalPark:createMocks(oa),DepartmentDigitalProjectPage:createMocks(oa,{TEST:{districtId:"a0l7R00000dUs1zQAC",projectId:"a067R00002zmK6YQAU"}}),DeNieuweDefensie:createMocks({domain:"nieuwbouw-denieuwedefensie",areaId:"a0i2X00000Cf6aQQAR",districtId:"a0l2X00000YRioKQAT",areaProjectName:"De Nieuwe Defensie",districtHouseOverviewUrl:{a0l2X00000YRioKQAT:"/woningen"}}),Waalfront:createMocks({domain:"nieuwbouw-waalfront",areaId:"a0iw000000ADveXAAT",areaProjectName:"Waalfront",districtHouseOverviewUrl:{a0l7R00000dUspmQAC:"/properties-overview"}})},ca="is--in-view",ua="is--out-of-view",ha=new Map,pa=[],Loadable=ze=>{const wt=document.querySelectorAll(ze.hook);0!==wt.length&&Array.from(wt).forEach(wt=>{const Rt=ha.get(ze.hook);Rt?ha.set(ze.hook,[...Rt,wt]):ha.set(ze.hook,[wt]),wt.__initializedHookReference=wt.__initializedHookReference||[],-1===wt.__initializedHookReference.indexOf(ze.hook)&&function observeComponent(ze,wt){const Rt=function createLoadingState(ze,wt){if(!wt.loading)return!1;let Rt;"string"==typeof wt.loading?(Rt=document.createElement("div"),Rt.innerHTML=wt.loading):Rt=wt.loading;return ze.appendChild(Rt),{remove:async()=>{ze.componentOnReady?(ze.connected||await ze.componentOnReady(),Rt?.remove()):Rt?.remove()}}}(ze,wt);ri.O.observe(ze,ze=>{ze&&wt.loader().then(()=>{-1===pa.indexOf(wt.hook)&&(!function unObserveRelatedElements(ze,wt){const Rt=ha.get(ze);Rt&&Array.from(Rt).map(Rt=>{Rt.__initializedHookReference.push(ze),wt.unobserve(Rt)})}(wt.hook,ri.O),wt.onLoaded&&wt.onLoaded(),pa.push(wt.hook),Rt&&Rt.remove())}).catch(ze=>{wt.onError&&wt.onError(ze)})},wt.inViewOptions||{})}(wt,ze)});return{loadManually:async()=>{0!==wt.length&&(await ze.loader(),Array.from(wt).forEach(ze=>{ri.O.unobserve(ze)}))}}};var _a=Rt(5044);const wa="is-loading",Pa="data-attributes",LoadableModal=ze=>{let wt=!1;const Rt=`[js-hook-loadable-modal="${getModalId(ze)}"]`;(0,Dr.cl)({selector:Rt,target:document,type:"mouseover",callback:()=>{wt||(ze.loader&&ze.loader(),wt=!0)}}),(0,Dr.cl)({selector:Rt,target:document,type:"click",callback:wt=>{const Rt=wt.delegateTarget,Xt=getModalId(ze);(0,Lr.Eb)(Xt)?(0,Lr.h7)(Xt):loadModal(Rt,Xt,ze)}})},getModalId=ze=>ze.modalId||ze.name,loadModal=async(ze,wt,Rt)=>{ze.classList.add(wa);try{await(0,_a.WU)(""),Rt.loader&&await Rt.loader();const Xt=((ze,wt)=>{const Rt=ze.getAttribute(Pa),Xt=document.createElement((ze=>ze.htmlTag||ze.name)(wt));if(Rt)try{const ze=JSON.parse(Rt);for(const wt in ze){const Rt=ze[wt];Xt.setAttribute(wt,Rt)}}catch(ze){console.error(`Error parsing ${Pa}: `,ze)}return Yi.R.body.append(Xt),Xt})(ze,Rt);Xt.connected||await Xt.componentOnReady();const sr=Xt.querySelector("bpd-modal");sr&&(sr.connected||await sr.componentOnReady(),setTimeout(()=>(0,Lr.h7)(wt),50))}finally{ze.classList.remove(wa)}};var Oa=Rt(3609);const Da=(()=>{const mapToStore=({Vimeo:ze,"YouTube Video":wt,Mapbox:Rt})=>
20{(0,Oa.ib)({vimeo:ze,mapbox:Rt,youtube:wt})};return{init:()=>{null!==window.__INIT_CONSENT__&&mapToStore(window.__INIT_CONSENT__),window.addEventListener("usercentrics::window-event",({detail:ze})=>{"consent_status"==ze?.event&&mapToStore(ze)})}}})(),{loadAreaSubscription:La}=(()=>{var ze;Da.init(),Un.Z.isLocal&&la.HoefenHaag.TEST({hasWishlist:!0}),Xt.mT.init({environment:window.__ENVIRONMENT_DETAILS__.environment,apiBaseUrl:window.__ENVIRONMENT_DETAILS__.apiBaseUrl,languageIsoCode:window.__ENVIRONMENT_DETAILS__.languageIsoCode,mapboxAccessToken:window.__ENVIRONMENT_DETAILS__.mapbox.accessToken,mapboxStyle:window.__ENVIRONMENT_DETAILS__.mapbox.style,areaId:window.__ENVIRONMENT_DETAILS__.areaId}),(0,Dr.cl)({selector:ze?.ariaControls||"[js-hook-modal-trigger]",target:ze?.delegateTarget||qr,type:ze?.delegateEvent||"click",callback:ze=>{const wt=ze.delegateTarget,Rt=wt.hasAttribute(Ur);wt.hasAttribute("data-close-all-modals")&&(0,Lr.pT)(),Rt&&openModalById(wt)}}),(ze=>{(0,Dr.cl)({selector:"[js-hook-iframe-modal-trigger]",target:ze?.delegateTarget||Ji,type:ze?.delegateEvent||"click",callback:ze=>{const wt=ze.delegateTarget;createIframeModal(wt)}})})(),(()=>{if(ai){const ze="ie-modal",wt=document.querySelector(`#${ze}`);wt?.setAttribute("active","")}})(),(0,jn.PO)(),[...document.querySelectorAll("[js-hook-inview]")].forEach(ze=>{ri.O.observe(ze,wt=>{const{inView:Rt=ca,outView:Xt=ua}=ze.dataset;wt?(ze.classList.add(Rt),ze.classList.remove(Xt)):(ze.classList.remove(Rt),ze.classList.add(Xt))})}),Array.from(document.querySelectorAll("[js-hook-video]")).forEach(ze=>{ri.O.observe(ze,wt=>{wt&&(ze.inViewPort=!0,ri.O.unobserve(ze))})}),(0,Dr.cl)({selector:"[js-hook-gtm-trigger]",target:document,type:"click",callback:ze=>{const wt=ze.delegateTarget,{gtmEvent:Rt,gtmEventCategory:Xt,gtmEventAction:sr,gtmEventLabel:Dr}=wt.dataset,Lr={event:Rt||"",eventCategory:Xt||"",eventAction:sr||"",eventLabel:Dr||""};(0,kn.d)(Lr)}}),Loadable({hook:"apartments-view",loader:()=>Promise.all([Rt.e(521),Rt.e(792)]).then(Rt.bind(Rt,8792))}
20),Loadable({hook:"bpd-properties",loader:()=>Promise.all([Rt.e(570),Rt.e(177),Rt.e(521),Rt.e(547)]).then(Rt.bind(Rt,5547))}),Loadable({hook:"bpd-map-current-area",loader:()=>Promise.all([Rt.e(570),Rt.e(177),Rt.e(627)]).then(Rt.bind(Rt,9627))}),Loadable({hook:"bpd-wishlist",loader:()=>Promise.all([Rt.e(570),Rt.e(177),Rt.e(548)]).then(Rt.bind(Rt,8548))}),Loadable({hook:"bpd-house-plans",loader:()=>Rt.e(748).then(Rt.bind(Rt,9748))});const{loadManually:wt}=Loadable({hook:"bpd-area-subscription",loader:()=>Rt.e(929).then(Rt.bind(Rt,1535))});Loadable({hook:"area-subscription-de",loader:()=>Rt.e(833).then(Rt.bind(Rt,3833))}),Loadable({hook:"bpd-compare",loader:()=>Promise.all([Rt.e(570),Rt.e(177),Rt.e(489)]).then(Rt.bind(Rt,8489))}),Loadable({hook:"smart-subscription",loader:()=>Promise.resolve().then(Rt.bind(Rt,3536))}),Loadable({hook:"hero-apartment",loader:()=>Promise.all([Rt.e(521),Rt.e(661)]).then(Rt.bind(Rt,5661))}),Loadable({hook:"message-form-inline",loader:()=>Rt.e(279).then(Rt.bind(Rt,8279))}),Loadable({hook:"bpd-flyin-update",loader:()=>Rt.e(740).then(Rt.bind(Rt,7740))}),Loadable({hook:"error-page",loader:()=>Rt.e(404).then(Rt.bind(Rt,2404))}),Loadable({hook:"bpd-faq",loader:()=>Rt.e(460).then(Rt.bind(Rt,4460))}),Loadable({hook:"area-map",loader:()=>Promise.all([Rt.e(570),Rt.e(177),Rt.e(51)]).then(Rt.bind(Rt,3051))}
20),Loadable({hook:"virtual-tour-wrapper",loader:()=>Rt.e(521).then(Rt.bind(Rt,5521))}),Loadable({hook:"house-detailpage-cta",loader:()=>Rt.e(877).then(Rt.bind(Rt,2877))}),LoadableModal({name:sr.PO.MORTGAGE_TOOL,loader:()=>Rt.e(767).then(Rt.bind(Rt,7767))}),LoadableModal({name:sr.PO.LEAD_FORM,loader:()=>Rt.e(444).then(Rt.bind(Rt,1444))}),LoadableModal({name:sr.PO.BROCHURE_FORM,loader:()=>Rt.e(130).then(Rt.bind(Rt,7130))}),LoadableModal({name:sr.PO.NEWSLETTER_FORM,loader:()=>Rt.e(898).then(Rt.bind(Rt,898))}),LoadableModal({name:sr.PO.MESSAGE_FORM,loader:()=>Rt.e(427).then(Rt.bind(Rt,8427))}),LoadableModal({name:sr.PO.HOUSING_MODULE,loader:()=>Rt.e(151).then(Rt.bind(Rt,9151))}),LoadableModal({name:sr.PO.MORTGAGE_TOOL_RABO,loader:()=>Rt.e(278).then(Rt.bind(Rt,3278))});const Yi=Object.values(sr.PO);return document.querySelectorAll(`[${sr.Cf}]`).forEach(ze=>{const wt=ze.getAttribute(`${sr.Cf}`);wt&&!Yi.includes(wt)&&LoadableModal({name:wt,htmlTag:"bpd-iframe-modal"})}),{loadAreaSubscription:wt}})()},2117:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{AV:()=>Xt,o1:()=>sr,bc:()=>getCurrentBreakpoint,tq:()=>isMobile,P$:()=>mediaIsMatch,VV:()=>min,GS:()=>useMedia});const Xt={mobile:{size:320,next:479.5,active:!1},mobilePlus:{size:480,next:767.5,active:!1},tabletPortrait:{size:768,next:1023.5,active:!1},tabletLandscape:{size:1024,next:1259.5,active:!1},laptop:{size:1260,next:1599.5,active:!1},desktop:{size:1600,active:!1}};function getMediaQueries(){const ze=Object.keys(Xt);return ze.map((wt,Rt)=>{const sr=Xt[wt],Dr=Xt[ze[Rt+1]];return{breakpoint:wt,query:()=>0===Rt?`(max-width: ${toEm(Dr.size-1)})`:Rt===ze.length-1?`(min-width: ${toEm(sr.size)})`:`(max-width: ${toEm(Dr.size-1)}) and (min-width: ${toEm(sr.size)})`}})}const toEm=ze=>ze/16+"em",min=ze=>`(min-width: ${toEm(function getBreakpointStart(ze){return Xt[ze].size?Xt[ze].size:(console.error("No valid breakpoint or size specified for media."),0)}(ze))})`,max=ze=>`(max-width: ${toEm(function getBreakpointEnd(ze){return Xt[ze].next||(console.error("No valid breakpoint or size specified for media."),0)}(ze))})`,mediaIsMatch=ze=>window.matchMedia(ze).matches,sr={isMobilePlusAndSmaller:()=>mediaIsMatch(`${min("mobile")} and ${max("mobilePlus")}`),isTabletPortraitAndSmaller:()=>mediaIsMatch(`${min("mobile")} and ${max("tabletPortrait")}`),isTabletLandscapeAndSmaller:()=>mediaIsMatch(`${min("mobile")} and ${max("tabletLandscape")}`),isTabletPortraitAndBigger:()=>mediaIsMatch(`${min("tabletPortrait")}`),isTabletLandscapeAndBigger:()=>mediaIsMatch(`${min("tabletLandscape")}`),isLaptopAndBigger:()=>mediaIsMatch(`${min("laptop")}`)},isMobile=()=>sr.isTabletPortraitAndSmaller(),getCurrentBreakpoint=()=>getMediaQueries().reduce((ze,wt)=>window.matchMedia(wt.query()).matches?wt.breakpoint:ze,void 0),useMedia=ze=>{getMediaQueries().map(ze=>({listener:window.matchMedia(ze.query()),breakpoint:ze.breakpoint})).forEach(wt=>wt.listener.addListener(Rt=>function handleMediaListeners(wt,Rt){if(!wt.matches)return;Object.keys(Xt).forEach(ze=>Xt[ze].active=ze===Rt?wt.matches:!wt.matches),ze(Xt)}(Rt,wt.breakpoint))),ze(Xt)}},1111:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{e:()=>nextEvent});const nextEvent=(ze,wt)=>new Promise(Rt=>{const callback=Xt=>{ze.removeEventListener(wt,callback),Rt(Xt)};ze.addEventListener(wt,callback)})},1838:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{u:()=>partition});const partition=(ze,wt)=>ze?.reduce((ze,Rt)=>(wt(Rt)?ze[0].push(Rt):ze[1].push(Rt),ze),[[],[]])??[void 0,void 0]},6033:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{J:()=>sha256});const sha256=async ze=>{const wt=(new TextEncoder).encode(ze),Rt=await crypto.subtle.digest("SHA-256",wt);return Array.from(new Uint8Array(Rt)).map(ze=>ze.toString(16).padStart(2,"0")).join("")}},8050:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{wA:()=>Component,fI:()=>Prop,cl:()=>delegate});const Xt="__classProperties",sr="__watchedProperties",Dr="__reflectedPropertiesToAttribute",Lr="__isReflectingToProperty",Ur="__isReflectingToAttribute",qr="properties",ri="__isDisconnecting",ai="__onReadyResolve",Yi="__elementId",camelCaseToDash=ze=>ze.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),dashToCamelCase=ze=>ze.replace(/-([a-z])/g,ze=>ze[1].toUpperCase()),Ji={toAttribute(ze,wt,Rt){const Xt=Rt||getTypeOfValue(wt),sr=camelCaseToDash(ze);let Dr=wt;switch(Xt){case"Boolean":Dr=wt?"":null;break;case"Object":case"Array":Dr=null==wt?wt:JSON.stringify(wt)}return{value:Dr,name:sr}},toProperty(ze,wt,Rt){const Xt=Rt||getTypeOfValue(wt),sr=dashToCamelCase(ze);let Dr=wt;switch(Xt){case"Boolean":Dr=null!==wt;break;case"Number":Dr=null===wt?null:Number(wt);break;case"Object":case"Array":Dr=JSON.parse(wt)}return{value:Dr,name:sr}}};function getTypeOfValue(ze){return"object"!=typeof ze||Array.isArray(ze)?Array.isArray(ze)?"Array":"boolean"==typeof ze?"Boolean":"number"==typeof ze?"Number":"String":"Object"}function _delegate(ze){const{target:wt,selector:Rt,type:Xt,callback:sr,useCapture:Dr=!1}=ze,listenerFn=ze=>{const Xt=ze.target.closest(Rt);Xt&&(ze.delegateTarget=Xt,ze.currentTarget.contains(ze.delegateTarget)&&sr.call(wt,ze))};return wt.addEventListener(Xt,listenerFn,Dr),{destroy(){wt.removeEventListener(Xt,listenerFn,Dr)}}}const delegate=ze=>{const{target:wt,type:Rt}=ze;return"object"==typeof wt||"function"==typeof Rt?_delegate(Object.assign({},ze,{target:wt})):"string"==typeof wt?Array.from(document.querySelectorAll(wt)).map(wt=>_delegate(Object.assign({},ze,{target:wt}
20))):null};function defer(){let ze=null;return{promise:new Promise(wt=>ze=wt),resolve:ze}}const Qi=new Map,renderTemplate=(ze,wt)=>{const Rt=ze.render&&ze.render(),Xt=Rt&&"string"==typeof Rt;if(Qi.has(ze.__nodeName)){const{styles:wt,template:Xt}=Qi.get(ze.__nodeName);return{styles:wt,template:Xt,templateResult:Rt}}{const sr=((ze,wt)=>{const Rt=wt.style,Xt=wt.styles;if(Rt&&Xt)throw new Error(`Component: ${ze.__nodeName} can only have on type of style property: styles or style`);return Rt||!!Xt&&Xt.join("")})(ze,wt),Dr=sr&&wt.shadow?`<style>${sr}</style>`:"",Lr=document.createElement("template");return Qi.set(ze.__nodeName,{styles:sr,template:Lr,componentStyles:Dr}),Lr.innerHTML=`\n ${Dr}\n ${Xt?Rt:""}\n `,{styles:sr,template:Lr,templateResult:Rt}}},removeTemplate=ze=>new Promise(wt=>{ze.renderRoot.innerHTML="",wt()}),updateComponent=(ze,wt,Rt=!1)=>new Promise(async Xt=>{const{styles:sr,template:Dr,templateResult:Lr}=renderTemplate(ze,wt);sr&&!wt.shadow&&((ze,wt)=>{const Rt=`${ze.__nodeName}`;if(!document.head.querySelector(`[scope="${Rt}"]`)){const ze=document.createElement("style");ze.setAttribute("scope",`${Rt}`),ze.innerText=`${wt}`,ze.innerText=ze.innerText.replace(/:host/gi,`${Rt}`),document.head.appendChild(ze)}})(ze,sr),ze.__hasShadowdomPolyfill&&wt.shadow&&!document.head.querySelector(`[scope="${ze.__nodeName}"]`)&&function bindShadyRoot(ze,wt){window.ShadyCSS.prepareTemplate(wt,ze.__nodeName),window.ShadyCSS.styleElement(ze)}(ze,Dr);const Ur=Lr&&"object"==typeof Lr,qr=document.importNode(Dr.content,!0);return Rt&&(ze.renderRoot.innerHTML=""),ze.renderRoot.appendChild(qr),Ur&&ze.renderRoot.appendChild(Lr),Xt()}),safeCall=async(ze,wt,Rt)=>{wt&&wt[Rt]&&await wt[Rt].call(ze)};const Component=ze=>((ze=>{if(ze.indexOf("-")<=0)throw new Error("You need at least 1 dash in the custom element name!")})(ze.tag),wt=>{const Rt=class extends wt{constructor(...wt){var Rt;super(wt),this.connected=!1,this.__canAttachShadowDom=!!ze.shadow&&ze.shadow,this.__hasShadowdomPolyfill=window.ShadyCSS&&!window.ShadyCSS.nativeShadow,this.__nodeName=this.nodeName.toLowerCase(),this[Yi]=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this[ri]=!1,!(Rt=this).shadowRoot&&Rt.__canAttachShadowDom&&Rt.attachShadow({mode:"open"}),this.renderRoot=this.__canAttachShadowDom&&this.shadowRoot?this.shadowRoot:this}static get observedAttributes(){return(ze=>{const wt=ze.properties,Rt=[];return wt&&wt.forEach((ze,wt)=>Rt.push(camelCaseToDash(wt))),Rt})(this)}attributeChangedCallback(ze,wt,Rt){((ze,wt,Rt,Xt)=>{Rt!==Xt&&attributeToProperty(ze,wt,Xt)})(this,ze,wt,Rt)}connectedCallback(){(async(ze,wt,Rt)=>{ze[ai]=defer(),ze[ri]&&await ze[ri].promise,await safeCall(ze,Rt,"connectedCallback"),await safeCall(ze,Rt,"componentWillLoad"),await safeCall(ze,Rt,"componentWillRender"),await initializePropertyToAttributes(ze),await updateComponent(ze,wt),await addRemoveEventListeners(ze),ze.connected=!0,ze.setAttribute("initialized",""),await safeCall(ze,Rt,"componentDidRender"),await safeCall(ze,Rt,"componentDidLoad"),ze[ai].resolve(ze)})(this,ze,wt.prototype)}disconnectedCallback(){this[ri]=defer(),(async(ze,wt)=>{await safeCall(ze,wt,"disconnectedCallback"),await addRemoveEventListeners(ze,"removeEventListener"),await removeTemplate(ze),ze.connected=!1,ze.removeAttribute("initialized"),ze[ri]&&(ze[ri].resolve(),ze[ri]=!1),safeCall(ze,wt,"componentDidUnLoad")})(this,wt.prototype)}componentOnReady(){return this[ai].promise}reRender(){(async(ze,wt,Rt)=>{await safeCall(ze,Rt,"componentWillRender"),await updateComponent(ze,wt,!0),await addRemoveEventListeners(ze),await safeCall(ze,Rt,"componentDidRender")})(this,ze,wt.prototype)}};return customElements.get(ze.tag)||customElements.define(ze.tag,Rt),Rt}),kn={reflectToAttribute:!1,type:!1,reRender:!1},Prop=ze=>(wt,Rt)=>{const sr=`_${Rt}`;wt.constructor[Xt]||(wt.constructor[Xt]=new Map),wt.constructor[qr]||(wt.constructor[qr]=new Map),wt.constructor[qr].set(Rt),ze&&wt.constructor[Xt].set(Rt,ze);const Dr={get(){return this[sr]},set(ze){const wt=this[Rt];this[sr]=ze,requestUpdate(this,Rt,wt)},enumerable:!0,configurable:!0};return Object.defineProperty(wt,Rt,Dr)},initializePropertyToAttributes=ze=>{const wt=ze[Dr];wt&&(wt.forEach((wt,Rt)=>{propertyToAttribute(ze,Rt,wt)}),ze[Dr]=void 0)},requestUpdate=(ze,wt,Rt)=>{const Lr=ze[wt],Ur=valueHasChanged(Lr,Rt),qr=ze.constructor[Xt].has(wt)?ze.constructor[Xt].get(wt):kn;ze.connected?(Ur&&ze.constructor[sr]&&callWatcher(ze,wt,Lr,Rt),qr.reflectToAttribute&&propertyToAttribute(ze,wt,Lr),Ur&&qr.reRender&&ze.reRender()):(ze[Dr]||(ze[Dr]=new Map),qr.reflectToAttribute&&ze[Dr].set(wt,Lr))},propertyToAttribute=(ze,wt,Rt)=>{const{type:Xt}=getType(ze,wt),{name:sr,value:Dr}
20=Ji.toAttribute(wt,Rt,Xt);void 0===Dr||ze.constructor[Lr]||(ze.constructor[Ur]=!0,null==Dr?ze.removeAttribute(sr):ze.setAttribute(sr,Dr),ze.constructor[Ur]=!1)},attributeToProperty=(ze,wt,Rt)=>{if(ze.constructor[Ur])return;const{type:Xt}=getType(ze,wt),{name:sr,value:Dr}=Ji.toProperty(wt,Rt,Xt);ze.constructor[Lr]=!0,ze[sr]=Dr,ze.constructor[Lr]=!1},getType=(ze,wt)=>{const Rt=dashToCamelCase(wt);return ze.constructor[Xt].has(Rt)?ze.constructor[Xt].get(Rt):kn},callWatcher=(ze,wt,Rt,Xt)=>{const Dr=ze.constructor[sr].has(wt),Lr=!!Dr&&ze.constructor[sr].get(wt),Ur=!!Dr&&ze[Lr].bind(ze);Ur&&"function"==typeof Ur&&Ur(Rt,Xt)},valueHasChanged=(ze,wt)=>wt!==ze&&(wt==wt||ze==ze),jn=new Map,addRemoveEventListeners=(ze,wt="addEventListener")=>{const Rt=ze.constructor.__boundListeners,Xt=ze;return new Promise(sr=>{if(!Rt)return sr();Rt.forEach(Rt=>{const sr=function getEventTarget(ze,wt,Rt){if(Rt&&"string"!=typeof Rt)return Rt;if(Rt&&"string"==typeof Rt)return ze[Rt]?ze[Rt]:null;return wt}(ze,Xt,Rt.eventTarget);if(sr){const Xt=`${ze[Yi]}${Rt.type}${Rt.eventTarget}${Rt.handler.toString()}`;(NodeList.prototype.isPrototypeOf(sr)||Array.isArray(sr))&&sr.length>0?Array.from(sr).map(sr=>initializeEvent(sr,Xt,Rt,ze,wt)):initializeEvent(sr,Xt,Rt,ze,wt)}}),sr()})};function initializeEvent(ze,wt,Rt,Xt,sr){const Dr="function"==typeof ze[sr];jn.has(wt)&&Dr&&ze.removeEventListener(Rt.type,jn.get(wt).callbackWrapper,Rt.options),jn.set(wt,{callbackWrapper:ze=>{Rt.handler.call(Xt,ze)}}),"removeEventListener"===sr?jn.delete(wt):Dr&&ze[sr](Rt.type,jn.get(wt).callbackWrapper,Rt.options)}},9490:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Bi:()=>hook_createHook,Nk:()=>defineElement,N_:()=>onDidLoad,gU:()=>onDidUnload,cF:()=>queueMicrotaskPolyfill,We:()=>useBindMethod,YP:()=>useElement,lq:()=>useElements,zX:()=>useEvent,iX:()=>useListen,v9:()=>useProp,sO:()=>use_ref_useRef,qo:()=>use_watch_useWatch});const Xt=Symbol("atomify.phase"),sr=Symbol("atomify.sideEffectPhase"),Dr=Symbol("atomify.update"),Lr=Symbol("atomify.didLoad"),Ur=Symbol("atomify.didUnload"),qr=(Symbol("atomify.cssSaveToken"),Symbol("atomify.reflectingToAttribute")),ri=Symbol("atomify.reflectingToProperty");let ai=null,Yi=0;const clear=()=>{ai=null,Yi=0},setCurrentElement=ze=>ai=ze,getCurrentElement=()=>ai,getCurrentElementPhase=()=>{const ze=getCurrentElement();return ze?ze[Xt]:null},nextHook=()=>(Yi+=1,Yi);function hook_createHook(ze){const wt=nextHook(),Rt=getCurrentElement();if(!Rt)throw new Error("Hooks can only be used within a Component");const Xt=Rt.$cmpMeta$.$hooks$,sr=getCurrentElementPhase();return sr===Lr&&ze.onDidLoad&&(Xt.state[wt]=ze.onDidLoad(Rt,Xt,wt)),sr===Dr&&ze.onUpdate&&ze.onUpdate(Rt,Xt,wt),Xt.state[wt]}const onDidLoad=ze=>hook_createHook({onDidLoad(wt,Rt){Rt.callbacks.push({type:Lr,callback:ze})}}),onDidUnload=ze=>hook_createHook({onDidLoad(wt,Rt){Rt.callbacks.push({type:Ur,callback:ze})}});function getWatchersDependingOn(ze,wt){return ze.$cmpMeta$.$watchers$.filter(({dependencies:ze})=>ze.has(wt))}const reactive=(ze,wt)=>{const Rt={};for(const[Xt,sr]of Object.entries(ze)){let ze=null==sr||Array.isArray(sr)||"object"!=typeof sr?sr:reactive(sr,wt);const Dr=Symbol(Xt);Object.defineProperty(Rt,Xt,{enumerable:!0,get:()=>(wt.$cmpMeta$.$dependencies$.add(Dr),ze),set(Rt){const Xt=Rt instanceof NodeList||Array.isArray(Rt)||Rt instanceof HTMLElement;null==ze||Xt||"object"!=typeof ze||"object"!=typeof Rt?ze=Rt:Object.assign(ze,Rt),getWatchersDependingOn(wt,Dr).forEach(({callback:ze})=>ze())}})}return Rt};function use_ref_useRef(ze){return hook_createHook({onDidLoad:wt=>reactive({current:ze},wt)})}const useElement=(ze,wt)=>createListenHook(ze,!1,wt),useElements=(ze,wt)=>createListenHook(ze,!0,wt),createListenHook=(ze,wt,Rt)=>hook_createHook({onDidLoad(Xt,sr,Dr){const Ur=Rt&&Rt.root?Rt.root:Xt.container,qr=Rt&&Rt.as&&""!==Rt.as?Rt.as:ze;return function use_elements_select(ze,wt=!1,Rt,Xt,sr){const Dr={get:()=>wt?Xt.querySelectorAll(ze):Xt.querySelector(ze),enumerable:!0,configurable:!0};return Object.defineProperty(Rt,sr,Dr),Rt[sr]}(ze,wt,Xt,Ur,qr),sr.callbacks.push({type:Lr,callback:()=>{sr.state[Dr].current=Xt[qr]}}),Object.defineProperty(Object.create(null),"current",{value:[],writable:!0})},onUpdate(wt,Xt,sr){const Lr=Rt&&Rt.as&&""!==Rt.as?Rt.as:ze;Xt.callbacks.push({type:Dr,callback:()=>{Xt.state[sr].current=wt[Lr]}})}}),supportsPassive=()=>{let ze=!1;try{const wt=Object.defineProperty({},"passive",{get:()=>(ze=!0,ze)});window.addEventListener("passiveTest",()=>{},wt),window.removeEventListener("passiveTest",()=>{},wt)}catch(wt){ze=!1}return ze},useListen=(ze,wt,Rt,Xt)=>hook_createHook({onDidLoad(sr,Dr){Dr.callbacks.push({type:Lr,callback:()=>{bindEvents({eventName:wt,cb:Rt,options:Xt,element:sr,target:ze})}})},onUpdate(sr,Lr){Lr.callbacks.push({type:Dr,callback:()=>{bindEvents({eventName:wt,cb:Rt,options:Xt,element:sr,target:ze})}})},onDidUnload(sr){bindEvents({eventName:wt,cb:Rt,options:Xt,remove:!0,element:sr,target:ze})}});function bindEvents({options:ze,remove:wt=!1,eventName:Rt,cb:Xt,element:sr,target:Dr}){Dr instanceof Window||Dr instanceof Document||Dr instanceof HTMLElement?trackEventListener({options:ze,target:Dr,element:sr,remove:wt,cb:Xt,eventName:Rt}):Dr.current instanceof NodeList||Array.isArray(Dr.current)?Array.from(Dr.current).forEach(Dr=>Dr&&trackEventListener({options:ze,target:Dr,element:sr,remove:wt,cb:Xt,eventName:Rt})):Dr.current instanceof HTMLElement&&trackEventListener({options:ze,target:Dr.current,element:sr,remove:wt,cb:Xt,eventName:Rt})}function removeListener(ze,wt,Rt){const Xt=ze.get(wt);Xt&&Rt.removeEventListener(Xt.eventName,Xt.callbackWrapper,Xt.options)}function trackEventListener({cb:ze,element:wt,target:Rt,remove:Xt,options:sr,eventName:Dr}){const Lr=`${wt.$cmpMeta$.$id$}_${Dr}_${Rt}_${ze.toString()}`,Ur=wt.$cmpMeta$.$listeners$;if(Xt&&Ur.has(Lr))return removeListener(Ur,Lr,Rt),void Ur.delete(Lr);const callbackWrapper=wt=>ze(wt),qr=supportsPassive&&sr?{capture:!!sr.capture,passive:!!sr.passive}:!(!sr||!sr.capture)&&sr.capture;Ur.has(Lr)&&removeListener(Ur,Lr,Rt),Ur.set(Lr,{eventName:Dr,callbackWrapper,options:sr}
20),Rt.addEventListener(Dr,callbackWrapper,qr)}const useEvent=ze=>hook_createHook({onDidLoad:wt=>({emit:function emit(Rt){const Xt=ze.eventName,sr=Object.assign({},{detail:Rt,bubbles:!0,cancelable:!0},ze),Dr=new CustomEvent(Xt,sr);(ze.target?ze.target:wt).dispatchEvent(Dr)}})}),useBindMethod=(ze,wt)=>hook_createHook({onDidLoad(Rt){Rt[ze]=(...ze)=>wt(...ze)}});var Ji=Rt(7807);new Map;const valueHasChanged=(ze,wt)=>wt!==ze&&(wt==wt||ze==ze),reflectPropertyToAttribute=(ze,wt,Rt)=>{if(void 0===Rt||ze[sr]===ri)return;const{name:Xt,value:Dr}=(0,Ji.Tn)(wt,Rt,ze);ze[sr]=qr,null==Dr?ze.removeAttribute(Xt):ze.setAttribute(Xt,Dr),ze[sr]=null};function useProp(ze,wt){return hook_createHook({onDidLoad(Rt,Xt,sr){const Dr=void 0===wt;let Lr=!1;if(!(ze in Rt.props))throw new Error(`Please add the ${ze} as property to the ${Rt.$cmpMeta$.$tagName$} prop map`);if(Dr&&ze in Rt.props){const{required:wt=!1}=Rt.props[ze];if(!wt)throw new Error(`The value for ${ze} is undefined and doesnt have a initial value so it should be required. Add the required boolean as true for ${ze} to the ${Rt.$cmpMeta$.$tagName$} prop map or add an initial value as second param to the useProp hook.`);Lr=wt}const Ur=`_${ze}`,qr=Rt[ze]||wt,ri=Rt.props[ze].reflectToAttr||!1;if(Lr&&void 0===qr)throw new Error(`The value of ${ze} is undefined but required make sure that the ${ze} prop is filled in.`);let ai=null;return Object.defineProperty(Rt,ze,{get(){return this[Ur]},set(wt){const Dr=this[ze];this[Ur]=wt;const Lr=valueHasChanged(wt,Dr);Lr&&ai&&ai(wt,Dr),Xt.state[sr][0]=wt,Lr&&ri&&reflectPropertyToAttribute(Rt,ze,wt)},enumerable:!0,configurable:!0}),Rt[Ur]=qr,ri&&reflectPropertyToAttribute(Rt,ze,qr),[qr,function setState(wt){Rt[ze]=wt},function watchCallback(ze){ai||(ai=ze)}]}})}const debounce=(ze,wt)=>{let Rt;return(...Xt)=>{clearTimeout(Rt),Rt=setTimeout(()=>ze(...Xt),wt)}},use_watch_useWatch=ze=>hook_createHook({onDidLoad(wt,Rt){Rt.callbacks.push({type:Lr,callback:()=>{const Rt=function runAndGetDependencies(ze,wt){wt.$cmpMeta$.$dependencies$.clear(),ze();const Rt=new Set(wt.$cmpMeta$.$dependencies$);return wt.$cmpMeta$.$dependencies$.clear(),Rt}(ze,wt);wt.$cmpMeta$.$watchers$.push({callback:debounce(ze,10),dependencies:Rt})}})}});const Qi=new Map,defaultRenderer=(ze,wt,Rt,Xt)=>{if(Qi.has(Rt)){const sr=Qi.get(Rt);sr&&setTemplate(wt,sr,ze,Xt)}else{const sr=document.createElement("template"),Dr="string"==typeof ze,Lr=Dr||""!==Xt.styles,Ur="object"==typeof ze;sr.innerHTML=`\n ${Xt.hasShadowDom&&!Ji.FV&&Xt.styles?`<style>${Xt.styles}</style>`:""}\n ${Dr?ze:""}\n `;const qr={template:sr,isTemplateString:Lr,isJSXresult:Ur};Qi.set(Rt,qr),setTemplate(wt,qr,ze,Xt)}},setTemplate=(ze,wt,Rt,Xt)=>{const{template:sr,isJSXresult:Dr,isTemplateString:Lr}=wt;Ji.KS&&Xt.hasShadowDom&&(0,Ji.kT)(Xt,sr),Xt.$cmpMeta$.$clearElementOnUpdate$&&(ze.innerHTML=""),Lr&&ze.appendChild(document.importNode(sr.content,!0)),Dr&&ze.appendChild(Rt),Xt.$cmpMeta$.$clearElementOnUpdate$||(Xt.$cmpMeta$.$clearElementOnUpdate$=!0)};function defineElement(ze,wt,Rt){var ai,Yi;const{renderer:Qi=defaultRenderer,useShadowDom:kn=!1}=Rt||{};(0,Ji.Lr)(ze);class Element extends HTMLElement{constructor(){super(),this.connected=null,this[ai]=null,this[Yi]=null,this.styles="",this.props=wt.props||{},this.hasShadowDom=kn,this.$cmpMeta$={$listeners$:new Map,$onComponentReadyResolve$:(0,Ji.PQ)(),$hooks$:{state:[],callbacks:[]},$tagName$:ze,$id$:(0,Ji.Dv)(),$clearElementOnUpdate$:!1,$dependencies$:new Set,$watchers$:[]},Rt&&Rt.useShadowDom?(this.attachShadow({mode:"open"}),this.container=this.shadowRoot?this.shadowRoot:this):this.container=this}static get observedAttributes(){return wt.props?Object.keys(wt.props).map(ze=>(0,Ji.gS)(ze)):[]}connectedCallback(){this.update()}disconnectedCallback(){this.handlePhase(Ur)}attributeChangedCallback(ze,wt,Rt){if(this[sr]!==qr&&wt!==Rt){this[sr]=ri;const{name:wt,value:Xt}=(0,Ji.gg)(ze,Rt,this);this[wt]=Xt,this[sr]=null}}update(){(0,Ji.A4)(()=>{const ze=this.connected?Dr:Lr;this.handlePhase(ze)})}componentOnReady(){return this.$cmpMeta$.$onComponentReadyResolve$.promise}flushPhaseCallbacks(ze){const wt=this.$cmpMeta$.$hooks$.callbacks;wt.forEach((Rt,Xt)=>{Rt.type===ze&&(Rt.callback(),delete wt[Xt])})}handlePhase(ze){switch(this[Xt]=ze,ze){case Lr:this.connected=!0,this.render(),this.$cmpMeta$.$onComponentReadyResolve$.resolve(this),this.flushPhaseCallbacks(Lr),this.$cmpMeta$.$onComponentReadyResolve$=(0,Ji.PQ)(),this.setAttribute("initialized","");break;case Dr:this.render(),this.flushPhaseCallbacks(Dr);break;case Ur:this.connected=!1,this.flushPhaseCallbacks(Ur),this.removeAttribute("initialized")}this[Xt]=null}render(){setCurrentElement(this),Qi(wt({element:this,update:this.update.bind(this)}),this.container,ze,this),clear()}}ai=Xt,Yi=sr,customElements.get(ze)||customElements.define(ze,Element)}const queueMicrotaskPolyfill=()=>{"function"!=typeof window.queueMicrotask&&(window.queueMicrotask=function(ze){Promise.resolve().then(ze).catch(ze=>setTimeout(()=>{throw ze}))})}},7807:(ze,wt,Rt)=>{"use strict";function defer(){let ze=null;return{promise:new Promise(wt=>ze=wt),resolve:ze}}Rt.d(wt,{kT:()=>bindShadyRoot,gS:()=>camelCaseToDash,PQ:()=>defer,Dv:()=>generateQuickGuid,A4:()=>scheduleMicrotask,KS:()=>sr,FV:()=>Xt,Tn:()=>toAttribute,gg:()=>toProperty,Lr:()=>validateSelector});
20const setupScheduler=ze=>{const wt=[];return Rt=>wt.push(Rt)&&ze(()=>((ze,wt)=>{let Rt;for(;Rt=ze.shift();)wt();return Rt})(wt,Rt))},scheduleMicrotask=ze=>setupScheduler(queueMicrotask)(ze),validateSelector=ze=>{if(ze.indexOf("-")<=0)throw new Error("You need at least 1 dash in the custom element name!")},generateQuickGuid=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),Xt="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function bindShadyRoot(ze,wt){window.ShadyCSS.prepareTemplate(wt,ze.$cmpMeta$.$tagName$),window.ShadyCSS.styleElement(ze)}const sr=window.ShadyCSS&&!window.ShadyCSS.nativeShadow,camelCaseToDash=ze=>ze.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),toAttribute=(ze,wt,Rt)=>{const Xt=camelCaseToDash(ze),sr=Xt in Rt.props?Rt.props[Xt]:null;let Dr=wt;switch(sr&&sr.type?sr.type:sr){case Boolean:Dr=wt?"":null;break;case Object:case Array:Dr=null==wt?wt:JSON.stringify(wt)}return{name:Xt,value:Dr}},toProperty=(ze,wt,Rt)=>{const Xt=ze.replace(/-([a-z])/g,ze=>ze[1].toUpperCase());const sr=Xt in Rt.props?Rt.props[Xt]:null;let Dr=wt;switch(sr&&sr.type?sr.type:sr){case Boolean:Dr=null!==wt;break;case Number:Dr=null===wt?null:Number(wt);break;case Object:case Array:Dr=JSON.parse(wt)}return{name:Xt,value:Dr}}},7995:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{H:()=>Dr,h:()=>h});const processNodes=(ze,wt)=>(ze instanceof Node?wt.appendChild(ze):"string"==typeof ze||"number"==typeof ze?wt.appendChild(document.createTextNode(ze)):ze instanceof Array&&ze.forEach(ze=>processNodes(ze,wt)),wt),isFunction=ze=>"function"==typeof ze,setAttr=(ze,wt,Rt)=>ze.setAttribute(wt,Rt),Xt=["async","allowfullscreen","allowpaymentrequest","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","multiple","muted","novalidate","nowrap","open","readonly","required","reversed","selected","playsinline"],isBooleanAttr=ze=>Xt.includes(ze),sr="http://www.w3.org/1999/xlink",applyAttributes=(ze,wt)=>(Object.keys(wt||{}).forEach(Rt=>{const Xt=Rt,Dr=wt[Xt];let Lr=Rt.toLowerCase();switch(Xt){case"style":return void Object.assign(ze.style,Dr);case"dataset":return void Object.keys(Dr).map(wt=>{const Rt=Dr[wt];null!=Rt&&(ze.dataset[wt]=Rt)});case"ref":return void(isFunction(Dr)?Dr(ze):Dr.current=ze);case"class":case"className":return void(isFunction(Dr)?Dr(ze):setAttr(ze,"class",null==(Ur=Dr)?"":"string"==typeof Ur?Ur:Array.isArray(Ur)?Ur.filter(Boolean).join(" "):Object.keys(Ur).filter(ze=>!!Ur[ze]).join(" ")));case"htmlFor":return void setAttr(ze,"for",Dr);case"dangerouslySetInnerHTML":return void(ze.innerHTML=Dr)}var Ur,qr;if((ze=>ze&&ze.tagName&&ze.tagName.includes("-"))(ze)&&!Xt.includes("-")&&!isBooleanAttr(Xt)&&void 0!==ze.constructor.properties&&ze.constructor.properties.has(Xt)||ze.props&&Xt in ze.props)ze[Xt]=Dr;else if(isBooleanAttr(Xt))Dr?setAttr(ze,Xt,""):(qr=Xt,ze.removeAttribute(qr));else if(isFunction(Dr)){if("o"===Xt[0]&&"n"===Xt[1]){const wt=Xt.substr(2).toLowerCase();ze.addEventListener(wt,Dr)}}else Lr!==(Lr=Lr.replace(/^xlink\:?/,""))?null==Dr||!1===Dr?ze.removeAttributeNS(sr,Lr.toLowerCase()):ze.setAttributeNS(sr,Lr.toLowerCase(),Dr):!0===Dr?setAttr(ze,Xt,""):(ze=>null==ze||!1===ze)(Dr)||setAttr(ze,Xt,Dr)}),ze),h=(ze,wt,...Rt)=>{const Xt=((ze,wt,Rt)=>["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","animation","circle","clipPath","color-profile","cursor","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","handler","hkern","iframe","image","line","linearGradient","listener","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","style","svg","switch","symbol","tbreak","text","textArea","textPath","title","tref","tspan","unknown","use","view","vkern"].indexOf(ze)>=0?document.createElementNS("http://www.w3.org/2000/svg",ze):ze===DocumentFragment?document.createDocumentFragment():"function"==typeof ze?ze(Object.assign({},wt,{children:Rt})):document.createElement(ze))(ze,wt,Rt),sr=!("function"==typeof ze&&ze!==DocumentFragment);if(sr){const ze=(ze=>{const wt=document.createDocumentFragment();return ze.forEach(ze=>processNodes(ze,wt)),wt})(Rt);Xt.appendChild(ze)}return sr?applyAttributes(Xt,wt):Xt}
20,Dr=DocumentFragment},9824:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{z:()=>Button,b:()=>ButtonA});var Xt=Rt(7995);const createClassName=ze=>{let wt=ze.variant?`c-button--${ze.variant}`:"c-button";return wt+=ze.icon?" button--icon":"",wt+=ze.size?` button--${ze.size}`:"",wt+=ze.classes?` ${ze.classes}`:"",wt},createAttributes=ze=>Object.assign(Object.assign({},ze.attr),{[`js-hook-${ze.hook}`]:ze.hook,onClick:ze.onClick,ariaControls:ze.controls,href:ze.url}),Button=ze=>{const wt=createClassName(ze),Rt=createAttributes(ze);return Rt.type=ze.type||"button",(0,Xt.h)("button",Object.assign({class:wt},Rt),ze.icon&&(0,Xt.h)("span",{class:"button__icon"},(0,Xt.h)("bpd-svg",{name:ze.icon})),(0,Xt.h)("span",{class:"button__label"},ze.label))},ButtonA=ze=>{const wt=createClassName(ze),Rt=createAttributes(ze);return(0,Xt.h)("a",Object.assign({class:wt},Rt,{target:ze.target}),ze.icon&&(0,Xt.h)("span",{class:"button__icon"},(0,Xt.h)("bpd-svg",{name:ze.icon})),(0,Xt.h)("span",{class:"button__label"},ze.label))}},6887:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{E:()=>Image});var Xt=Rt(7995);const addUrlParameter=(ze,wt,Rt)=>{const Xt=ze.indexOf("?")>-1?"&":"?";return`${ze}${Xt}${wt}=${Rt}`},create_image_url=(ze,{width:wt,height:Rt})=>{let Xt=addUrlParameter(ze,"mode","crop");return wt&&(Xt=addUrlParameter(Xt,"width",wt)),Rt&&(Xt=addUrlParameter(Xt,"height",Rt)),Xt},Image=ze=>{const wt=!!ze.preload&&create_image_url(ze.image,ze.preload);return(0,Xt.h)("bpd-image",{class:`c-image ${ze.classes?ze.classes:""}`},(0,Xt.h)("figure",Object.assign({},{"js-hook-objectfit-container":ze.objectFit}),(0,Xt.h)("img",Object.assign({class:""+(ze.disableCrossFade?"":" image__default"),"data-image":ze.image,alt:ze.alt},{src:wt||!1,"data-settings":JSON.stringify(ze.settings),"js-hook-objectfit-img":ze.objectFit,hidden:ze.hidden}))),ze.caption&&(0,Xt.h)("figcaption",{class:"image__caption"},ze.caption))}},6346:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{zx:()=>Xt.z,bx:()=>Xt.b,JX:()=>Col,W2:()=>Container,Ee:()=>ai.E,te:()=>RangeSliderElement,X2:()=>Row,Pl:()=>Qi.Pl,D0:()=>Qi.D0,M3:()=>Qi.Ee,SJ:()=>extendMapTheme,cl:()=>Qi.cl,S4:()=>Qi.S4,aN:()=>overrideMapTheme,s5:()=>Qi.s5,kW:()=>Qi.kW,oL:()=>Qi.oL,Vq:()=>Qi.Vq,ow:()=>Qi.ow});var Xt=Rt(9824),sr=Rt(7995);const Dr=["xs","sm","md","lg","xlg"],createClasses=(ze,wt)=>wt.reduce((wt,Rt,Xt)=>(wt.push(0===Xt?`${ze}-${Rt}`:`${ze}-${Rt}--${Dr[Xt]}`),wt),[]),Col=({extraClass:ze="",children:wt,cols:Rt=[],push:Xt=[],pull:Dr=[],pre:Lr=[],post:Ur=[]})=>{const qr=[...createClasses("o-col",Rt),...createClasses("u-push",Xt),...createClasses("u-pull",Dr),...createClasses("u-pre",Lr),...createClasses("u-post",Ur)].join(" ");return(0,sr.h)("div",{class:`${qr} ${ze}`},wt)},Container=({extraClass:ze="",children:wt})=>(0,sr.h)("div",{class:`o-container ${ze}`},wt),RangeSliderElement=({classes:ze,disabled:wt,min:Rt,max:Xt,increment:Dr,start:Lr,name:Ur,onChange:qr,enableInputControls:ri,minLabel:ai,maxLabel:Yi,valuePrefix:Ji})=>{const Qi={"c-range-slider":!0,form__item:!0,"form__item--disabled":wt};return(0,sr.h)("div",{class:Qi},(0,sr.h)("bpd-range-slider",{min:Rt,max:Xt,increment:Dr,start:Lr,onRangeValuesChanged:qr,class:ze},(0,sr.h)("div",{class:"range-slider__container"},(0,sr.h)("div",{"js-hook-slider-container":!0}),(0,sr.h)("div",{class:"range-slider__values"},ri?(0,sr.h)(sr.H,null,(0,sr.h)("div",{class:"range-slider__value-input-container"},(0,sr.h)("span",{class:"range-slider__value-input-label"},ai),(0,sr.h)("div",{class:"range-slider__value-input-wrapper"},(0,sr.h)("span",{class:"range-slider__value-prefix"},Ji),(0,sr.h)("input",{type:"number",min:Rt,max:Xt,step:Dr,class:"range-slider__value-input","js-hook-slider-min":!0}))),(0,sr.h)("div",{class:"range-slider__value-input-container"},(0,sr.h)("span",{class:"range-slider__value-input-label"},Yi),(0,sr.h)("div",{class:"range-slider__value-input-wrapper"},(0,sr.h)("span",{class:"range-slider__value-prefix"},Ji),(0,sr.h)("input",{type:"number",min:Rt,max:Xt,step:Dr,class:"range-slider__value-input","js-hook-slider-max":!0}))),(0,sr.h)("input",{type:"text",id:Ur,name:Ur,class:"u-sr-only","js-hook-slider-min-max-value":!0})):(0,sr.h)(sr.H,null,(0,sr.h)("span",{class:"range-slider__values-item","js-hook-slider-min":!0}),(0,sr.h)("span",{class:"range-slider__values-item","js-hook-slider-max":!0}),(0,sr.h)("input",{type:"number",id:`${Ur}-0`,name:Ur,value:Lr[0],"js-hook-slider-min-value":!0}),(0,sr.h)("input",{type:"number",id:`${Ur}-1`,name:Ur,value:Lr[1],"js-hook-slider-max-value":!0}))))))};var Lr=Rt(9490),Ur=Rt(3352),qr=Rt(9365),ri=Rt.n(qr);const formatValue=ze=>(0,Ur.j3)(ze).replace(",","."),RangeSlider=({element:ze})=>{const[wt]=(0,Lr.v9)("min",0),[Rt]=(0,Lr.v9)("max",0),[Xt]=(0,Lr.v9)("increment",0),[sr,Dr]=(0,Lr.v9)("hasChanged",!1),[,Ur,qr]=(0,Lr.v9)("start",[0,0]),[,ai]=(0,Lr.v9)("bindValue",[0,0]),Yi=(0,Lr.YP)("[js-hook-slider-container]"),Ji=(0,Lr.YP)("[js-hook-slider-min]"),Qi=(0,Lr.YP)("[js-hook-slider-max]"),kn=(0,Lr.YP)("[js-hook-slider-min-value]"),jn=(0,Lr.YP)("[js-hook-slider-max-value]"),Un=(0,Lr.YP)("[js-hook-slider-min-max-value]"),Wn=(0,Lr.zX)({eventName:"rangevalueschanged"});function changeValuesManually(){var sr;const[Dr,Lr]=ze.start;let qr=Number(Ji.current.value),ri=Number(Qi.current.value);qr=Math.floor(qr/Xt)*Xt,ri=Math.ceil(ri/Xt)*Xt,qr>Lr&&(qr=Dr),ri<Dr&&(ri=Lr),qr<wt&&(qr=wt),ri>Rt&&(ri=Rt),Ur([qr,ri]),setMinMaxValues(),onChangeHandler("input"),null===(sr=Yi.current)||void 0===sr||sr.noUiSlider.updateOptions({start:[qr,ri]})}function setMinMaxValues(){const{minValue:ze,maxValue:wt}=getValues();Un.current?(Ji.current.value=`${ze}`,Qi.current.value=`${wt}`):(Ji.current.innerHTML=formatValue(ze),Qi.current.innerHTML=formatValue(wt))}function onChangeHandler(ze){const{minValue:wt,maxValue:Rt}=getValues();kn.current&&jn.current&&(kn.current.value=`${wt}`,jn.current.value=`${Rt}`,kn.current.checked=!0,jn.current.checked=!0,Ji.current.innerHTML=formatValue(wt),Qi.current.innerHTML=formatValue(Rt),kn.current.dispatchEvent(new Event("change")),jn.current.dispatchEvent(new Event("change"))),Un.current&&(Un.current.value=`${wt},${Rt}`,Un.current.checked=!0,"slider"===ze&&Un.current.dispatchEvent(new Event("change",{bubbles:!0}))),Wn.emit({minValue:wt,maxValue:Rt,hasChanged:sr})}function getValues(){const Xt=ze.start.every(ze=>0===ze),sr=Xt?wt:ze.start[0],Lr=Xt?Rt:ze.start[1];return ai(ze.start),Dr(JSON.stringify(ze.start)!==JSON.stringify([wt,Rt])),{minValue:sr,maxValue:Lr}}(0,Lr.We)("resetState",function resetState(){var ze;null===(ze=Yi.current)||void 0===ze||ze.noUiSlider.set([wt,Rt]),Ur([wt,Rt]),Dr(!1),Un.current&&(Un.current.value="",Un.current.checked=!1)}),(0,Lr.We)("setValues",(ze,wt)=>{var Rt;kn.current&&jn.current&&(kn.current.value=`${ze}`,jn.current.value=`${wt}`,kn.current.checked=!0,jn.current.checked=!0,Ji.current.innerHTML=formatValue(ze),Qi.current.innerHTML=formatValue(wt)),Un.current&&(Un.current.value=`${ze},${wt}`,Un.current.checked=!0),null===(Rt=Yi.current)||void 0===Rt||Rt.noUiSlider.updateOptions({start:[Number(ze),Number(wt)]})}),(0,Lr.iX)(Ji,"change",changeValuesManually),(0,Lr.iX)(Qi,"change",changeValuesManually),(0,Lr.N_)(()=>{var sr,Dr;const Lr={start:ze.start.every(ze=>0===ze)?[wt,Rt]:ze.start,step:Xt,connect:!0,documentElement:Yi.current,range:{min:wt,max:Rt}};ri().create(Yi.current,Lr),null===(sr=Yi.current)||void 0===sr||sr.noUiSlider.on("update",ze=>{const wt=ze.map(ze=>parseInt(ze));Ur([...wt])}),null===(Dr=Yi.current)||void 0===Dr||Dr.noUiSlider.on("change",()=>onChangeHandler("slider")),setMinMaxValues()}),qr(setMinMaxValues)};RangeSlider.props={min:{type:Number,reflectToAttr:!0},max:{type:Number,reflectToAttr:!0},increment:{type:Number,reflectToAttr:!0},hasChanged:{type:Boolean,reflectToAttr:!0},start:{type:Array,reflectToAttr:!0},bindValue:{type:Array}},(0,Lr.Nk)("bpd-range-slider",RangeSlider);var ai=Rt(6887);const Row=({extraClass:ze="",children:wt})=>(0,sr.h)("div",{class:`o-grid ${ze}`},wt);function __decorate(ze,wt,Rt,Xt){var sr,Dr=arguments.length,Lr=Dr<3?wt:null===Xt?Xt=Object.getOwnPropertyDescriptor(wt,Rt):Xt;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)Lr=Reflect.decorate(ze,wt,Rt,Xt);else for(var Ur=ze.length-1;Ur>=0;
20Ur--)(sr=ze[Ur])&&(Lr=(Dr<3?sr(Lr):Dr>3?sr(wt,Rt,Lr):sr(wt,Rt))||Lr);return Dr>3&&Lr&&Object.defineProperty(wt,Rt,Lr),Lr}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var Yi=Rt(8050);let Ji=class BPDSvg extends HTMLElement{constructor(){super(...arguments),this.name=""}render(){return(0,sr.h)("svg",{class:`svg svg-${this.name}`},(0,sr.h)("use",{xlinkHref:`#svg-${this.name}`}))}};__decorate([(0,Yi.fI)()],Ji.prototype,"name",void 0),Ji=__decorate([(0,Yi.wA)({tag:"bpd-svg"})],Ji);Rt(7628);const extendMapTheme=(...ze)=>{const wt={polygon:{settings:[]},pointer:{settings:[],cluster:ze=>(0,sr.h)("span",null,ze)}};return ze.forEach(({polygon:ze,pointer:Rt})=>{var Xt,sr,Dr,Lr;(null==ze?void 0:ze.settings.length)&&(null===(sr=null===(Xt=wt.polygon)||void 0===Xt?void 0:Xt.settings)||void 0===sr||sr.push(...ze.settings)),(null==Rt?void 0:Rt.settings.length)&&(null===(Lr=null===(Dr=wt.pointer)||void 0===Dr?void 0:Dr.settings)||void 0===Lr||Lr.push(...Rt.settings)),(null==Rt?void 0:Rt.cluster)&&wt.pointer&&(wt.pointer.cluster=Rt.cluster)}),wt},overrideMapTheme=(ze,wt)=>{const{polygon:Rt,pointer:Xt}=ze,{polygon:sr,pointer:Dr}=wt,Lr={};return(null==Rt?void 0:Rt.settings.length)&&((null==sr?void 0:sr.settings.length)?Lr.polygon={settings:Rt.settings.map(ze=>sr.settings.find(({variant:wt})=>wt===ze.variant)||ze)}:Lr.polygon=Rt),(null==Xt?void 0:Xt.settings.length)&&((null==Dr?void 0:Dr.settings.length)?Lr.pointer={settings:Xt.settings.map(ze=>Dr.settings.find(({variant:wt})=>wt===ze.variant)||ze),cluster:Dr.cluster||Xt.cluster}:Lr.pointer=Xt),Lr};Rt(6023);var Qi=Rt(36)},7628:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{k:()=>Infobox});var Xt=Rt(7995),sr=Rt(9824),Dr=Rt(6887);const Infobox=({title:ze,image:wt,tags:Rt,description:Lr,link:Ur,onClose:qr,openInTab:ri})=>(0,Xt.h)("div",{class:"c-infobox"},(0,Xt.h)("button",{class:"infobox__close",onClick:qr},(0,Xt.h)("bpd-svg",{name:"icons-close"})),wt&&ze&&(0,Xt.h)("div",{class:"infobox__image-container"},(0,Xt.h)(Dr.E,{classes:"infobox__image",image:wt,alt:ze,preload:{width:325,height:117}})),(0,Xt.h)("div",{class:"infobox__wrapper"},ze&&(0,Xt.h)("h3",{class:"infobox__title"},ze),Rt&&(0,Xt.h)("span",{class:"infobox__tags"},null==Rt?void 0:Rt.join(", ")),Lr&&(0,Xt.h)("p",{class:"infobox__description"},Lr),Ur&&(0,Xt.h)(sr.b,{target:ri?"_blank":"_self",url:Ur,label:"Bekijk het gebied"})))},36:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Pl:()=>clearDirections,D0:()=>clearFocus,I9:()=>clearHover,Ee:()=>clearIsochrone,$m:()=>clearSearchResult,R8:()=>getHover,cl:()=>getMapInstance,sm:()=>getMapboxData,S4:()=>sr,s5:()=>setDirections,kW:()=>setFocus,oL:()=>setIsochrone,Vq:()=>setLayerRaster,_5:()=>setMapInstance,cq:()=>setZoom,$f:()=>updateClick,_X:()=>updateHover,ow:()=>updateMapData,nD:()=>updateSearchIsMoving,jO:()=>updateSearchResult});const Xt={updateMapData:(ze,wt)=>(ze.data=wt,ze),updateHover:(ze,wt)=>(ze.hover={current:wt,previous:ze.hover.current},ze),clearHover:ze=>(ze.hover={current:void 0,previous:ze.hover.current},ze),updateClick:(ze,wt)=>(ze.click=Object.assign({},wt),ze),setFocus:(ze,{ids:wt,options:Rt})=>{var Xt;const sr=ze.data.filter(({id:ze})=>wt.indexOf(ze)>-1);return sr.length&&(ze.focus={current:sr,previous:null===(Xt=ze.focus)||void 0===Xt?void 0:Xt.current,options:Rt}),ze},clearFocus:ze=>(ze.focus={current:void 0,previous:ze.focus.current},ze),updateSearchResult:(ze,wt)=>(ze.searchResult=wt,ze),clearSearchResult:ze=>(ze.searchResult=void 0,ze),setFilter:(ze,wt)=>(ze.filter=wt,ze),clearFilter:ze=>(ze.filter=void 0,ze),setMapInstance:(ze,wt)=>(ze.mapInstance=wt,ze),manualSearch:(ze,wt)=>(ze.manualSearch=wt,ze),updateSearchIsMoving:(ze,wt)=>(ze.searchIsMoving=wt,ze),setLayerRaster:(ze,wt)=>(ze.layerRasterSettings=wt,ze),setIsochrone:(ze,wt)=>(ze.isochroneSetting=wt,ze),clearIsochrone:ze=>(ze.isochroneSetting=void 0,ze),setDirections:(ze,wt)=>(ze.directionsSetting=wt,ze),clearDirections:ze=>(ze.directionsSetting=void 0,ze),setZoom:(ze,wt)=>(ze.currentZoom=wt,ze)},sr=(0,Rt(3352).MT)({initialState:{data:[],hover:{},focus:{},searchIsMoving:!1},actions:Xt}),updateMapData=ze=>{sr.dispatch("updateMapData",ze)},clearHover=()=>{sr.dispatch("clearHover")},updateHover=ze=>{sr.dispatch("updateHover",ze)},updateClick=ze=>{sr.dispatch("updateClick",ze)},setFocus=(ze,wt={})=>{sr.dispatch("setFocus",{ids:ze,options:wt})},clearFocus=()=>{sr.dispatch("clearFocus")},updateSearchResult=ze=>{sr.dispatch("updateSearchResult",ze)},clearSearchResult=()=>{sr.dispatch("clearSearchResult")},setMapInstance=ze=>{sr.dispatch("setMapInstance",ze)},updateSearchIsMoving=ze=>{sr.dispatch("updateSearchIsMoving",ze)},setLayerRaster=ze=>
20{sr.dispatch("setLayerRaster",ze)},setIsochrone=ze=>{sr.dispatch("setIsochrone",ze)},clearIsochrone=()=>{sr.dispatch("clearIsochrone")},setDirections=ze=>{sr.dispatch("setDirections",ze)},clearDirections=()=>{sr.dispatch("clearDirections")},setZoom=ze=>{sr.dispatch("setZoom",ze)},getMapboxData=()=>sr.getState().data,getHover=()=>sr.getState().hover,getMapInstance=()=>sr.getState().mapInstance},6023:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>search_search});var Xt=Rt(7995),sr=Rt(3352),Dr=Rt(6158),Lr=Rt.n(Dr),Ur=Rt(36);const qr=[{query:"Den Bosch",title:"Den Bosch, Noord-Brabant, Nederland",bbox:[5.206494,51.663997,5.377136,51.755477]},{query:"'s-Gravenhage",title:"'s-Gravenhage, Zuid-Holland, Nederland",bbox:[4.1962,52.014848,4.42249,52.128324]}];const ri=function getCityAlternativeSuggestions(ze){const wt=[];return qr.forEach(({title:Rt,query:Xt,bbox:sr})=>{Xt.toLowerCase().indexOf(ze)>-1&&wt.push({title:Rt,bbox:sr})}),wt};let ai=10;const search_search=async(ze,{hook:wt,onSearchSuggestion:Dr,noZoomAfterSearch:qr,distanceFilter:Yi,types:Ji="region,district,place,neighborhood"},{searchCountryIsoCodes:Qi=["nl","de"],language:kn="nl"})=>{const jn=document.querySelector(wt),Un=(0,sr.Pm)(Qi);if(!jn)return void(sr.mT.isLocal&&console.error(`Search element can't be found: ${wt}`));const Wn=jn.querySelector("[js-hook-map-search-input]"),Yn=jn.querySelector("[js-hook-map-search-distance-select-input]"),Jn=Wn.closest("form"),Qn=jn.querySelector("[js-hook-map-search-suggestions]"),Io=jn.querySelector("[js-hook-map-search-button]");let Mo,jo;function handleManualSearch({manualSearch:ze}){if(ze){let wt;Array.isArray(ze)?(Mo.options.reverseGeocode=!0,wt=ze.join(", ")):(Mo.options.reverseGeocode=!1,wt=ze),Mo.setInput(wt).on("results",function handleResults(wt){var Rt;let Xt;jo=wt,"string"==typeof ze&&(Xt=null===(Rt=null==wt?void 0:wt.features)||void 0===Rt?void 0:Rt.find(({text:wt})=>(null==wt?void 0:wt.toLowerCase())===ze.toLowerCase())),Xt?submitSuggestion(Xt):submitFirstSuggestion(),Mo.off("results",handleResults)})}}function handleClickOutside(){clearSuggestionsContainer()}function handleFitBounds(){qr||((ze,wt)=>{ze.fitBounds(wt)})(ze,Un)}function onKeyDown(ze){const{value:wt}=Wn;"Enter"===ze.key&&handleButtonClick(),wt.length>=3?Mo.setInput(wt):(jo=void 0,handleFitBounds(),clearSuggestionsContainer(),(0,Ur.$m)())}function handleButtonClick(){const{value:ze}=Wn;ze?Mo.setInput(ze).on("results",function handleSubmit(ze){jo=ze,submitFirstSuggestion(),null==Wn||Wn.blur(),Mo.off("results",handleSubmit)}):function clearAll(){jo=void 0,handleFitBounds(),clearSuggestionsContainer(),(0,Ur.$m)(),null==Wn||Wn.blur()}()}function submitFirstSuggestion(){submitSuggestion(null==jo?void 0:jo.features[0])}function submitSuggestion(ze){updateStore(ze),clearSuggestionsContainer()}function clearSuggestionsContainer(){Qn.innerHTML="",jo=void 0}function localGeocoder(ze){const createSuggestion=({title:ze,bbox:wt,type:Rt,id:Xt})=>({place_name:ze,bbox:wt,center:(0,sr.sR)(wt),type:Rt,id:Xt});return[...Dr?Dr(ze.toLowerCase()).map(createSuggestion):[],...ri(ze.toLowerCase()).map(createSuggestion)].slice(0,4)}function updateStore(wt){const Rt=Number(null==Yn?void 0:Yn.value)?Number(Yn.value):ai;if(!wt)return(0,Ur.jO)({items:[],result:!1}),void handleFitBounds();const Xt=wt.bbox?wt.bbox:[wt.center[0],wt.center[1],wt.center[0],wt.center[1]],Dr=(0,sr.vP)(Xt,Rt),Lr=(0,Ur.sm)().filter(ze=>{if("turfDistance"===Yi){const Xt=(0,sr.Ux)(ze.coordinates);return(0,sr.k3)(wt.center,Xt)<=Rt}return(0,sr.Gq)(ze.coordinates,Dr)});qr||(ze.fitBounds(Dr),(0,Ur.nD)(!0),ze.once("moveend",()=>{(0,Ur.nD)(!1)}));const ri=function parseResultText(ze){var wt;const Rt=(null==ze?void 0:ze.place_name)||"";if(null===(wt=null==ze?void 0:ze.place_type)||void 0===wt?void 0:wt.includes("poi"))return{};const[Xt,sr,Dr,Lr]=Rt.split(",").reverse();return{country:Xt,province:sr,city:Dr,district:Lr}}(wt);(0,Ur.jO)({items:Lr,result:wt,originalBoundingBox:Xt,expandedBoundingBox:Dr,place:ri,kmPadding:Rt})}!async function init(){const{default:wt}=await Rt.e(651).then(Rt.t.bind(Rt,9651,23));
20Mo=new wt({accessToken:Lr().accessToken,mapboxgl:Lr(),countries:Qi.join(",").toUpperCase(),types:Ji,localGeocoder,language:kn,enableEventLogging:!1,marker:!1}),ze.addControl(Mo),function bindEvents(){const ze=(0,sr.Ds)(onKeyDown,300);Wn.addEventListener("keydown",ze),Io.addEventListener("click",handleButtonClick),null==Jn||Jn.addEventListener("submit",ze=>ze.preventDefault()),(0,sr.O8)(Wn,handleClickOutside),Mo.on("results",ze=>{jo=ze,function renderSuggestions(ze){clearSuggestionsContainer(),Qn.append((0,Xt.h)("ul",{class:"map-search__suggestions"},ze.features.map(ze=>(0,Xt.h)("li",{class:"map-search__suggestion"},(0,Xt.h)("button",{onClick:()=>function handleSuggestionClick(ze){Wn.value=ze.place_name,clearSuggestionsContainer(),updateStore(ze)}(ze)},ze.place_name)))))}(jo)})}(),function subscribe(){handleManualSearch(Ur.S4.getState()),Ur.S4.subscribe(handleManualSearch,["manualSearch"])}()}()}},3352:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{aY:()=>areaProjectGetById,gz:()=>calculateBoundingBox,sR:()=>calculateBoundingBoxCenter,Ux:()=>calculateCenter,DZ:()=>calculateDifferenceInDays,k3:()=>calculateDistanceInKm,eZ:()=>calculateMapDataBoundingBox,Dq:()=>calculateMapDataCenter,DM:()=>constructionNumberGetById,db:()=>countryQuery,yh:()=>createLocalStorageStore,mS:()=>createSessionStorageStore,MT:()=>createStore,Ds:()=>debounce,mT:()=>Ji,vP:()=>expandBoundingBox,_n:()=>Da,GB:()=>jn,wO:()=>Yn,ij:()=>Wn,kS:()=>Un,fM:()=>Mo,MZ:()=>Jn,cc:()=>findExtendedObjectById,Bq:()=>Io,CL:()=>Qn,RY:()=>formDigitalBrochure,J0:()=>kn,A1:()=>getApartmentBuildingView,is:()=>getApiObjectCenter,Y_:()=>getApiObjectCoordinates,Xg:()=>getApiObjectLayerRaster,hz:()=>getAreaProjectsLightweight,Pm:()=>getCountryBoundingBox,XI:()=>getExtendedModelPriceRange,_M:()=>hasDatePassed,jq:()=>houseSelectorGetByExternalId,b1:()=>isApartment,$c:()=>mergeConstructionNumberSpecification,TO:()=>mergeDecimalRange,M1:()=>mergePropertySpecification,TE:()=>raf_throttle_rafThrottle,S2:()=>showPrice,P2:()=>throttle,j3:()=>toCurrency,O8:()=>useClickOutside,oR:()=>useStore,H1:()=>useUrlParams,Gq:()=>withinBoundingBox});var Xt=Rt(129),sr=Rt.n(Xt);class HttpError extends Error{constructor(ze){super(ze.message),this.response=ze.response,this.statusCode=ze.statusCode,this.body=ze.body,this.name="HttpError"}}const Dr=new class HttpClient{constructor(ze={}){this.defaultConfig={returnType:"json"},this.config={},this.get=this.createRequest("GET"),this.post=this.createRequest("POST"),this.put=this.createRequest("PUT"),this.patch=this.createRequest("PATCH"),this.delete=this.createRequest("DELETE"),this.setToken=ze=>this.token=ze,this.setBaseUrl=ze=>this.config.baseUrl=ze,this.setSecurityHeaders=(ze,wt)=>{var Rt;(null===(Rt=this.config)||void 0===Rt?void 0:Rt.headers)&&(this.config.headers=Object.assign(Object.assign({},this.config.headers),{[ze]:wt}))},this.setAbortController=ze=>{const{createAbort:wt}=ze;if(wt)if(void 0!==typeof AbortController){const Rt=new AbortController,{signal:Xt}=Rt;ze.signal=Xt,wt(Rt.abort.bind(Rt))}else wt(()=>console.log("The AbortController api isnt available in your browser"))},this.config=Object.assign(Object.assign({},this.defaultConfig),ze)}createRequest(ze){return(wt,Rt,Xt)=>{if("GET"===ze){let ze=wt;return Rt&&(ze=wt+"?"+sr().stringify(Rt)),this.request(ze,Object.assign(Object.assign({},Xt),{method:"GET"}))}const Dr=Xt&&Xt.headers&&Xt.headers["Content-Type"];return this.request(wt,Object.assign(Object.assign({},Xt),{method:ze,body:this.createBody(Rt,Dr)}))}}setAuthenticationHeaders(ze){this.token&&(ze.headers=Object.assign(Object.assign({},ze.headers),{Authorization:`Bearer ${this.token}`}))}async request(ze,wt={}){const{beforeHook:Rt}=this.config,Xt=Object.assign(Object.assign({},this.config),wt),{baseUrl:sr=""}=Xt;this.setAbortController(Xt),Rt&&await Rt(this),this.setAuthenticationHeaders(Xt);return fetch(sr+ze,Xt).then(this.handleError).then(ze=>this.handleSuccess(ze,Xt)).catch(Rt=>this.onError(Rt,()=>this.request(ze,wt)))}handleSuccess(ze,wt){const{returnType:Rt="json"}=wt;return 204!==ze.status&&201!==ze.status&&ze[Rt]?ze[Rt]():ze}async onError(ze,wt){const{onError:Rt}=this.config;if(Rt)return Rt(ze,wt);throw ze}createBody(ze,wt){switch(wt){case"application/json":default:return JSON.stringify(ze);case"application/x-www-form-urlencoded":return new URLSearchParams(ze)}}async handleError(ze){if(ze.ok)return ze;const wt=await ze.text();let Rt=ze;try{Rt=JSON.parse(wt)}catch(ze){Rt=wt}const Xt={message:`HttpError: ${ze.status} - ${ze.statusText}`,statusCode:ze.status,response:ze,body:Rt};throw console.error(Xt),new HttpError(Xt)}}({headers:{"Content-Type":"application/json"}}),areaProjectGetById=(ze,wt,Rt)=>Dr.get(`/areaprojects/${ze}`,wt,Rt).then(ze=>
20ze),constructionNumberGetById=(ze,wt,Rt)=>Dr.get(`/constructionnumbers/${ze}`,wt,Rt).then(ze=>ze),countryQuery=(ze,wt)=>Dr.get("/countries",ze,wt).then(ze=>ze),formDigitalBrochure=(ze,wt)=>Dr.post("/forms/digital-brochure",ze,wt).then(ze=>ze),houseSelectorGetByExternalId=(ze,wt,Rt)=>Dr.get(`/houseselectors/${ze}`,wt,Rt).then(ze=>ze);document.documentElement,document.body;var Lr=Rt(9490);const Ur={removeListener:!1},isNodeList=ze=>NodeList.prototype.isPrototypeOf(ze),isHTMLElement=ze=>HTMLElement.prototype.isPrototypeOf(ze),isHTMLCollection=ze=>HTMLCollection.prototype.isPrototypeOf(ze);function useClickOutside(ze,wt,Rt){const Xt=Object.assign(Object.assign({},Ur),Rt),listener=Rt=>{if(isNodeList(ze)||isHTMLCollection(ze)){if(Array.from(ze).some(ze=>ze.contains(Rt.target)))return wt(!1)}else{if(!isHTMLElement(ze))return wt(null);if(ze.contains(Rt.target))return wt(!1)}return Xt.removeListener&&document.removeEventListener("click",listener),wt(!0)};return document.addEventListener("click",listener),listener}var qr=Rt(7563);const useUrlParams=()=>{const{push:ze,replace:wt}={push:function pushHistory(ze){window.history.pushState({},document.title,ze)},replace:function replaceHistory(ze){window.history.replaceState({},document.title,ze)}};return{replace:function replaceParams(ze,Rt){const Xt=window.location.href.split("?"),sr=qr.parse(location.search);sr[ze]=Rt;const Dr=qr.stringify(sr),Lr=`${Xt[0]}?${Dr}`;wt(Lr)},push:function pushParams(wt,Rt){const Xt=window.location.href.split("?"),sr=qr.parse(location.search);sr[wt]=Rt;const Dr=qr.stringify(sr),Lr=`${Xt[0]}?${Dr}`;ze(Lr)},get:function getParams(ze){return qr.parse(location.search)[ze]},clear:function clearParams(){const wt=window.location.href.split("?");ze(wt[0])},clearParam:function clearParam(ze){const Rt=new URL(document.location.href);Rt.searchParams.delete(ze),wt(Rt.toString())}}},useStore=ze=>(0,Lr.Bi)({onDidLoad:()=>[ze.getState(),ze.subscribe,ze.getPrevState()]});function debounce(ze,wt=50,Rt={isImmediate:!1}){let Xt;return function(...sr){const Dr=this,Lr=Rt.isImmediate&&void 0===Xt;void 0!==Xt&&clearTimeout(Xt),Xt=setTimeout(function(){Xt=void 0,Rt.isImmediate||ze.apply(Dr,sr)},wt),Lr&&ze.apply(Dr,sr)}}const ri="is-touch",ai=`${ri}--with-mouse`,Yi=document.documentElement;new class DetectTouch{get isTouchDevice(){return this.touch}constructor(){this.hasMouse=!1,this.touch="ontouchstart"in Yi||navigator.maxTouchPoints>0,Yi.addEventListener("touchstart",()=>{Yi.removeEventListener("mousemove",()=>this.handleMouseEvent())}),Yi.addEventListener("mousemove",()=>this.handleMouseEvent()),this.touch&&Yi.classList.add(ri)}handleMouseEvent(){!this.hasMouse&&Yi.classList.contains(ri)&&(Yi.classList.add(ai),this.hasMouse=!0)}};const Ji=new class EnvironmentDetails{init({environment:ze,mapboxAccessToken:wt,apiBaseUrl:Rt,mapboxStyle:Xt,languageIsoCode:sr,areaId:Lr,middlewareSecurityHeaderName:Ur,middlewareSecurityHeaderValue:qr}){this.environment=ze,this.mapboxAccessToken=wt,this.mapboxStyle=Xt,this.apiBaseUrl=Rt,this.languageIsoCode=sr,this.areaId=Lr,this.middlewareSecurityHeaderName=Ur,this.middlewareSecurityHeaderValue=qr,Dr.setBaseUrl(Rt),this.middlewareSecurityHeaderValue&&this.middlewareSecurityHeaderName&&Dr.setSecurityHeaders(this.middlewareSecurityHeaderName,this.middlewareSecurityHeaderValue)}get isLocal(){return"local"===this.environment}get isTest(){return"test"===this.environment}get isAcceptance(){return"acceptance"===this.environment}get isProduction(){return"production"===this.environment}},raf_throttle_rafThrottle=ze=>{let wt=null,Rt=null;const wrapperFunction=(...Xt)=>{Rt=Xt,wt||(wt=requestAnimationFrame(()=>{wt=null,ze(...Rt)}))};return wrapperFunction.cancel=()=>{null!==wt&&(cancelAnimationFrame(wt),wt=null)},wrapperFunction},Qi={mobile:{size:320,active:!1},mobilePlus:{size:480,active:!1},tabletPortrait:{size:768,active:!1},tabletLandscape:{size:1024,active:!1},laptop:{size:1260,active:!1},desktop:{size:1600,active:!1}};function getSizeFromBreakpoint(ze){return Qi[ze].size?Qi[ze].size:(console.error("No valid breakpoint or size specified for media."),"0")}const max=ze=>`(max-width: ${getSizeFromBreakpoint(ze)}px)`,min=ze=>`(min-width: ${getSizeFromBreakpoint(ze)}px)`,mediaIsMatch=ze=>window.matchMedia(ze).matches,kn=(mediaIsMatch(`${min("mobile")} and ${max("mobilePlus")}`),mediaIsMatch(`${min("mobile")} and ${max("tabletPortrait")}`),ze=>new Promise(wt=>{const Rt=setInterval(()=>
20{ze()&&(clearInterval(Rt),wt(!0))},50)})),filterApiObjects=()=>(ze,wt)=>ze.filter(ze=>{const Rt=[];return Object.keys(wt).forEach(Xt=>{const sr=wt[Xt];if(null==sr)return;const Dr=ze[Xt]===sr;Rt.push(Dr)}),-1===Rt.indexOf(!1)}),findApiObject=()=>(ze,wt)=>ze.find(ze=>{const Rt=[];return Object.keys(wt).forEach(Xt=>{const sr=wt[Xt];if(null==sr)return;const Dr=ze[Xt]===sr;Rt.push(Dr)}),-1===Rt.indexOf(!1)}),jn=filterApiObjects(),Un=filterApiObjects(),Wn=filterApiObjects(),Yn=filterApiObjects(),Jn=(filterApiObjects(),filterApiObjects(),findApiObject()),Qn=findApiObject(),Io=findApiObject(),Mo=(findApiObject(),findApiObject(),findApiObject()),showPrice=({constructionNumber:ze,apartmentBuilding:wt,propertyType:Rt})=>{const{status:Xt}=ze||Rt||wt||{},{salesPrice:sr}=ze||Rt||{};if(sr){const{priceType:ze}=sr;if("PriceOnRequest"===ze)return!1}return!["Rented","Sold","UnderConstruction"].includes(Xt||"")};var jo=Rt(1449);function getCoord(ze){if(!ze)throw new Error("coord is required");if(!Array.isArray(ze)){if("Feature"===ze.type&&null!==ze.geometry&&"Point"===ze.geometry.type)return ze.geometry.coordinates;if("Point"===ze.type)return ze.coordinates}if(Array.isArray(ze)&&ze.length>=2&&!Array.isArray(ze[0])&&!Array.isArray(ze[1]))return ze;throw new Error("coord must be GeoJSON Point or an Array of numbers")}const zo=function distance(ze,wt,Rt){void 0===Rt&&(Rt={});var Xt=getCoord(ze),sr=getCoord(wt),Dr=(0,jo.degreesToRadians)(sr[1]-Xt[1]),Lr=(0,jo.degreesToRadians)(sr[0]-Xt[0]),Ur=(0,jo.degreesToRadians)(Xt[1]),qr=(0,jo.degreesToRadians)(sr[1]),ri=Math.pow(Math.sin(Dr/2),2)+Math.pow(Math.sin(Lr/2),2)*Math.cos(Ur)*Math.cos(qr);return(0,jo.radiansToLength)(2*Math.atan2(Math.sqrt(ri),Math.sqrt(1-ri)),Rt.units)},calculateBoundingBox=ze=>{let wt,Rt,Xt,sr;return ze.flat(1).forEach(([ze,Dr])=>{wt=!wt||ze<wt?ze:wt,Rt=!Rt||Dr<Rt?Dr:Rt,Xt=!Xt||ze>Xt?ze:Xt,sr=!sr||Dr>sr?Dr:sr}),[wt||0,Rt||0,Xt||0,sr||0]},concatMapDataCoordinates=ze=>ze.reduce((ze,wt)=>ze.concat(wt.coordinates),[]),calculateMapDataBoundingBox=ze=>{const wt=concatMapDataCoordinates(ze);return calculateBoundingBox(wt)},calculateMapDataCenter=ze=>{const wt=concatMapDataCoordinates(ze);return calculateCenter(wt)},calculateBoundingBoxCenter=([ze,wt,Rt,Xt])=>[(ze+Rt)/2,(wt+Xt)/2],calculateCenter=ze=>calculateBoundingBoxCenter(calculateBoundingBox(ze)),expandBoundingBox=([ze,wt,Rt,Xt],sr)=>{const Dr=.0089*sr;return[ze-=Dr,wt-=Dr,Rt+=Dr,Xt+=Dr]},withinBoundingBox=(ze,wt,Rt=0)=>{Rt&&(wt=expandBoundingBox(wt,Rt));const Xt=ze.flat(1),[sr,Dr,Lr,Ur]=wt;for(let ze=0;ze<Xt.length;ze++){const[wt,Rt]=Xt[ze];if(wt<Lr&&wt>sr&&Rt<Ur&&Rt>Dr)return!0}return!1},calculateDistanceInKm=(ze,wt)=>zo(ze,wt),oa={nl:[3.33390071158434,50.7503661060614,7.22749998189678,53.6436329908026],de:[5.98865807458,47.3024876979,15.0169958839,54.983104153]},getCountryBoundingBox=ze=>{const wt=(ze=>ze.reduce((ze,wt)=>(ze[0]=ze[0]<wt[0]?ze[0]:wt[0],ze[1]=ze[1]<wt[1]?ze[1]:wt[1],ze[2]=ze[2]>wt[2]?ze[2]:wt[2],ze[3]=ze[3]>wt[3]?ze[3]:wt[3],ze),ze[0]))(null==ze?void 0:ze.map(ze=>oa[ze]).filter(ze=>!!ze));return wt},validateCoordinates=ze=>ze.every(ze=>ze.every(([ze,wt])=>ze<180&&ze>-180&&wt>-90&&wt<90));function getApiObjectCenter(ze,wt){const{location:Rt}=ze;let Xt;return Rt?Xt=[[Rt]]:getApiObjectCoordinates(ze)&&(Xt=getApiObjectCoordinates(ze),Xt=Xt?[[calculateCenter(Xt)]]:void 0),!(!Xt||!validateCoordinates(Xt))&&("coordinate"===(null==wt?void 0:wt.as)?Xt[0][0]:Xt)}const getApiObjectCoordinates=({geometry:ze})=>{if(!(null==ze?void 0:ze.length))return;const wt=ze.filter(({coordinates:ze})=>!!ze).map(({coordinates:ze})=>ze);return(null==wt?void 0:wt.length)?wt:void 0},getApiObjectLayerRaster=({mapboxTilesetId:ze})=>ze?`https://api.mapbox.com/v4/${ze}`:null,mergeDecimalRange=({from:ze,to:wt},{from:Rt,to:Xt})=>{const sr={},Dr=[ze,wt,Rt,Xt].filter(ze=>0===ze||!!ze);return Dr.length?(sr.from=Math.min(...Dr),sr.to=Math.max(...Dr),sr):{}},mergeSpecification=(ze,wt,Rt)=>Rt&&Rt[wt]?mergeDecimalRange(ze,Rt[wt]):ze,mergePropertySpecification=({propertyTypes:ze,projectPhases:wt},Rt)=>ze?ze.reduce((ze,wt)=>mergeSpecification(ze,Rt,wt.specifications),{}):wt?wt.reduce((ze,wt)=>mergeSpecification(ze,Rt,wt.propertySpecifications),{}):{},mergeConstructionNumberSpecification=(ze,wt)=>ze.reduce((ze,Rt)=>mergeSpecification(ze,wt,Rt.specifications),{}),la=new Intl.DateTimeFormat("en-US",{timeZone:"Europe/Amsterdam",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),createDateFromApiString=ze=>/Z|[+-]\d{1,2}:?\d{2}$|[+-]\d{1,2}$/.test(ze)?new Date(ze):(ze=>{const wt=new Date(`${ze}Z`),Rt=la.formatToParts(wt),getPart=ze=>{var wt;return parseInt((null===(wt=Rt.find(wt=>wt.type===ze))||void 0===wt?void 0:wt.value)||"0",10)},Xt=new Date(Date.UTC(getPart("year"),getPart("month")-1,getPart("day"),getPart("hour"),getPart("minute"),getPart("second"),wt.getUTCMilliseconds())).getTime()-wt.getTime();return new Date(wt.getTime()-Xt)})(ze),calculateDifferenceInDays=(ze,wt)=>Math.abs((wt.getTime()-ze.getTime())/864e5),hasDatePassed=ze=>("string"==typeof ze&&(ze=createDateFromApiString(ze)),Date.now()>ze.getTime()),betweenDates=(ze,wt,Rt)=>wt>ze&&wt<Rt,toCurrency=(ze,wt=2)=>{let Rt=null;return Rt=((ze,wt)=>Number(Math.round(ze+"e"+wt)+"e-"+wt).toFixed(wt))(Number(ze),wt),Rt=`${ze.toString().replace(".",",")}`,Rt=((ze,wt)=>{let Rt=null;
20if(null==wt&&(wt="."),ze.toString()===ze.toLocaleString()){const Xt=ze.toString().split(",");Xt[0]=Xt[0].replace(/\B(?=(\d{3})+(?!\d))/g,wt),Rt=Xt[1]?Xt.join(","):Xt[0]}else Rt=ze.toLocaleString();return Rt})(ze),`⬠${Rt}`},getExtendedModelPriceRange=ze=>{const{constructionNumbers:wt}=ze;let Rt;if(wt&&wt.length)Rt=wt.filter(ze=>"Sold"!==ze.status&&"UnderConstruction"!==ze.status).reduce((ze,wt)=>{const{rentalPrice:Rt,salesPrice:Xt}=wt;return(null==Rt?void 0:Rt.amount)&&"PriceOnRequest"!==Rt.priceType?mergeDecimalRange(ze,Rt.amount):(null==Xt?void 0:Xt.amount)&&"PriceOnRequest"!==Xt.priceType?mergeDecimalRange(ze,Xt.amount):ze},{});else{if(!("propertyTypes"in ze)||!ze.propertyTypes||!ze.propertyTypes.length)return;Rt=ze.propertyTypes.filter(ze=>"Sold"!==ze.status&&"UnderConstruction"!==ze.status).reduce((ze,wt)=>{const{rentalPrice:Rt,salesPrice:Xt}=wt;return(null==Rt?void 0:Rt.amount)&&"PriceOnRequest"!==Rt.priceType?mergeDecimalRange(ze,Rt.amount):(null==Xt?void 0:Xt.amount)&&"PriceOnRequest"!==Xt.priceType?mergeDecimalRange(ze,Xt.amount):ze},{})}return Rt},getApartmentBuildingView=ze=>{var wt,Rt;return null===(Rt=null===(wt=ze.apartmentBuilding)||void 0===wt?void 0:wt.views)||void 0===Rt?void 0:Rt.find(wt=>{var Rt;return null===(Rt=wt.pointers)||void 0===Rt?void 0:Rt.find(wt=>wt.constructionNumberId===ze.id)})},isApartment=({constructionNumber:ze,propertyType:wt})=>{var Rt;let Xt;return wt&&(Xt=wt.houseType),ze&&(Xt=null===(Rt=ze.propertyType)||void 0===Rt?void 0:Rt.houseType),["Appartement","Loft","Maisonette","Studio"].includes(Xt||"")},findExtendedObjectById=({areaProject:ze,constructionNumbers:wt,propertyTypes:Rt,apartmentBuildings:Xt,projectPhases:sr,districts:Dr},Lr)=>{if(ze.id===Lr)return ze;const Ur=Jn(wt,{id:Lr});if(Ur)return Ur;const qr=Qn(Rt,{id:Lr});if(qr)return qr;const ri=Mo(Xt,{id:Lr});if(ri)return ri;const ai=Io(sr,{id:Lr});if(ai)return ai;const Yi=Dr.find(ze=>ze.id===Lr);return Yi||void 0},composeIncludeString=ze=>ze.join(","),ca=["areaProjectId","districtId","projectPhaseId","projectPhaseName","propertyTypeId","propertyTypeName","apartmentBuildingId","identifier","wishlistItemCount","availabilityStatus","geometry","mainImage","specifications","salesPrice","rentalPrice","numberOfReserveCandidates","gardens","outsideSpace","isEnergyNeutral"],ua=["areaProjectId","districtId","projectPhaseId","projectPhaseName","name","houseType","isRental","geometry","mainImage","specifications","salesPrice","rentalPrice","canShowPrice"],ha=["areaProjectId","areaProjectName","districtId","name","url","districtUrl","shortDescription","status","saleStartDate","saleEndDate","allocationDate","isRental","location","geometry","mainImage","propertySpecifications","propertyPurchasePrice","propertyRentalPrice","customerJourneyMilestones","houseTypes"],pa=["areaProjectId","projectPhaseId","projectPhaseName","displayName","nodeId","propertyTypeIds","constructionNumberIds","image","geometry","views"],_a=["areaProjectId","name","url","location","geometry","descriptionTitle","description","image"],wa=["name","shortDescription","regionId","url","isCompleted","image","location","geometry","website","mapboxDatasetId","mapboxTilesetId"],Pa={constructionNumber:composeIncludeString([...ca]),propertyType:composeIncludeString([...ua]),projectPhase:composeIncludeString([...ha]),apartmentBuilding:composeIncludeString([...pa]),district:composeIncludeString([..._a]),areaProject:composeIncludeString([...wa])},Oa=3e5,Da=(()=>{const ze={};async function controller(wt){let Rt=function fetchSessionStorageData(ze){const wt=sessionStorage.getItem(sessionStorageId(ze));if(wt){const{data:Rt,timestamp:Xt}=JSON.parse(wt);return!Xt||Date.now()-Xt>=Oa?void sessionStorage.removeItem(sessionStorageId(ze)):Rt}return}(wt);Rt||(Rt=await async function fetchData(ze){const wt=(qr={AreaProjectId:ze,include:Pa.propertyType},Dr.get("/propertytypes",qr,ri).then(ze=>ze)),Rt=((ze,wt)=>Dr.get("/constructionnumbers",ze,wt).then(ze=>ze))({AreaProjectId:ze,include:Pa.constructionNumber}),Xt=((ze,wt)=>Dr.get("/projectphases",ze,wt).then(ze=>ze))({AreaProjectId:ze,include:Pa.projectPhase}),sr=((ze,wt)=>Dr.get("/apartmentbuildings",ze,wt).then(ze=>ze))({AreaProjectId:ze,include:Pa.apartmentBuilding}),Lr=((ze,wt)=>Dr.get("/districts",ze,wt).then(ze=>ze))({AreaProjectId:ze,include:Pa.district}),Ur=areaProjectGetById(ze,{include:Pa.areaProject});var qr,ri;return{propertyTypes:await wt,constructionNumbers:await Rt,projectPhases:await Xt,apartmentBuildings:await sr,districts:await Lr,areaProject:await Ur}}(wt),function setSessionStorageData(ze,wt){try{const Rt=JSON.stringify({data:wt,timestamp:Date.now()});sessionStorage.setItem(sessionStorageId(ze),Rt)}catch(ze){}}(wt,Rt)),Rt=function filterObjectsWithImages(ze){return Object.assign(Object.assign({},ze),{constructionNumbers:ze.constructionNumbers.filter(({mainImage:ze})=>!!(null==ze?void 0:ze.url)),propertyTypes:ze.propertyTypes.filter(({mainImage:ze})=>!!(null==ze?void 0:ze.url)),apartmentBuildings:ze.apartmentBuildings.filter(({image:ze})=>!!(null==ze?void 0:ze.url))})}(Rt),ze[wt].extendedData=function extendModels(ze){const{constructionNumbers:wt,propertyTypes:Rt,apartmentBuildings:Xt,projectPhases:sr,districts:Dr,areaProject:Lr}=ze;return Rt.forEach(ze=>{const{projectPhaseId:Rt,id:Dr}=ze;Rt&&(ze.projectPhase=Io(sr,{id:Rt})),ze.constructionNumbers=jn(wt,{propertyTypeId:Dr}),ze.projectPhase&&(ze.status=((ze,wt)=>{const Rt=new Date,Xt=ze.saleStartDate&&new Date(ze.saleStartDate),sr=ze.saleEndDate&&new Date(ze.saleEndDate),Dr=ze.allocationDate&&new Date(ze.allocationDate);if("Sold"===ze.status)return"UnderConstruction";if("Rented"===ze.status)return"Rented";if(!(null==wt?void 0:wt.length))return getInPreparationStatus();switch(ze.status){case"InPreparation":return getInPreparationStatus();case"ForRent":return"ForRent";case"OnSale":return function getOnSaleStatus(){if(!Xt||!sr||!Dr)return;const ze=betweenDates(Xt,Rt,sr),Lr=betweenDates(Xt,Rt,Dr);if(ze)return"SaleStarted";if(Lr)return"AssigningOn";if(Rt>=Dr){const ze=wt.map(({availabilityStatus:ze})=>ze),Rt=ze.filter(ze=>"Available"===ze),Xt=ze.filter(ze=>"InOption"===ze);if(Rt.length)return"AmountAvailable";if(Xt.length)return"InOption";if(ze.indexOf("Sold")>-1)return"Sold"}}();default:return}function getInPreparationStatus(){return ze.isRental?"InPreparation":Xt&&calculateDifferenceInDays(Xt,Rt)<=30?"SaleSoon":"InPreparation"}})(ze.projectPhase,ze.constructionNumbers)),ze.apartmentBuildings=Xt.filter(wt=>{var Rt;return null===(Rt=wt.propertyTypeIds)||void 0===Rt?void 0:Rt.includes(ze.id)}),ze.objectType="propertyType"}),sr.forEach(ze=>{const{id:Xt}=ze;ze.propertyTypes=Un(Rt,{projectPhaseId:Xt}),ze.constructionNumbers=jn(wt,{projectPhaseId:Xt}),ze.objectType="projectPhase"}),Xt.forEach(ze=>{const{propertyTypeIds:Xt,constructionNumberIds:Dr,projectPhaseId:Lr}=ze;Xt&&(ze.propertyTypes=Rt.filter(({id:ze})=>null==Xt?void 0:Xt.includes(ze))),Dr&&(ze.constructionNumbers=wt.filter(({id:ze})=>
20null==Dr?void 0:Dr.includes(ze))),Lr&&(ze.projectPhase=Io(sr,{id:Lr})),ze.projectPhase&&(ze.status=((ze,wt)=>{const Rt=new Date,Xt=ze.saleStartDate&&new Date(ze.saleStartDate),sr=ze.saleEndDate&&new Date(ze.saleEndDate),Dr=ze.allocationDate&&new Date(ze.allocationDate);if("Sold"===ze.status)return"UnderConstruction";if("Rented"===ze.status)return"Rented";if(!(null==wt?void 0:wt.length))return getInPreparationStatus();switch(ze.status){case"InPreparation":return getInPreparationStatus();case"ForRent":return"ForRent";case"OnSale":return function getOnSaleStatus(){if(!Xt||!sr||!Dr)return;const ze=betweenDates(Xt,Rt,sr),Lr=betweenDates(Xt,Rt,Dr);if(ze)return"SaleStarted";if(Lr)return"AssigningOn";if(Rt>=Dr){const ze=wt.map(({availabilityStatus:ze})=>ze),Rt=ze.filter(ze=>"Available"===ze),Xt=ze.filter(ze=>"InOption"===ze);if(Rt.length)return"AmountAvailable";if(Xt.length)return"InOption";if(ze.indexOf("Sold")>-1)return"Sold"}}();default:return}function getInPreparationStatus(){return ze.isRental?"InPreparation":Xt&&calculateDifferenceInDays(Xt,Rt)<=30?"SaleSoon":"InPreparation"}})(ze.projectPhase,ze.constructionNumbers)),ze.objectType="apartmentBuilding"}),wt.forEach(ze=>{const{propertyTypeId:wt,projectPhaseId:Dr}=ze;ze.areaProject=Lr,wt&&(ze.propertyType=Qn(Rt,{id:wt})),Dr&&(ze.projectPhase=Io(sr,{id:Dr})),ze.apartmentBuilding=Xt.find(wt=>{var Rt;return null===(Rt=wt.constructionNumberIds)||void 0===Rt?void 0:Rt.includes(ze.id)}),ze.status=(ze=>{const{projectPhase:wt,availabilityStatus:Rt,propertyType:Xt}=ze,{status:sr}=Xt||{},{status:Dr}=ze.apartmentBuilding||{},{status:Lr,isRental:Ur}=ze.projectPhase||{};if("InPreparation"===Lr)return"Reserved"===Rt?"Reserved":"InPreparation";if("Sold"===Lr)return"UnderConstruction";switch(Rt){case"Reserved":return"OnSale"===Lr&&(null==wt?void 0:wt.allocationDate)&&hasDatePassed(wt.allocationDate)?"InOption":"Reserved";case"InOption":case"Available":return"AssigningOn"===sr||"AssigningOn"===Dr?"AssigningOn":Rt;case"Sold":return Ur?"Rented":"Sold"}})(ze),ze.objectType="constructionNumber"}),Dr.forEach(ze=>{ze.status=((ze,wt)=>{const Rt=wt.filter(({districtId:wt})=>ze.id===wt).map(ze=>ze.status).filter((ze,wt,Rt)=>ze&&Rt.indexOf(ze)===wt);return 1===Rt.length&&Rt[0]?Rt[0]:Rt.indexOf("OnSale")>-1?"OnSale":"InPreparation"})(ze,sr),ze.objectType="district"}),Lr.objectType="areaProject",{constructionNumbers:wt,propertyTypes:Rt,apartmentBuildings:Xt,projectPhases:sr,districts:Dr,areaProject:Lr}}(Rt),function setLoaded(wt){ze[wt].resolveArray.forEach(Rt=>{Rt(ze[wt].extendedData)})}(wt)}async function getData(wt){ze[wt]||(ze[wt]={resolveArray:[]},controller(wt));const Rt=ze[wt];return Rt.extendedData?Rt.extendedData:new Promise(ze=>{Rt.resolveArray.push(ze)})}function sessionStorageId(ze){return`AreaObjects::${ze}`}return{getData,getCurrentAreaData:async function getCurrentAreaData(){return getData(Ji.areaId)}}})(),La=["name","image","url","shortDescription","isCompleted","location","geometry"],getAreaProjectsLightweight=async()=>{const ze=await(wt={include:composeIncludeString([...La])},Dr.get("/areaprojects",wt,Rt).then(ze=>ze));var wt,Rt;return ze.forEach(ze=>{ze.objectType="areaProject"}),ze},throttle=(ze,wt=300)=>{let Rt,Xt,sr;return function(){const Dr=this,Lr=arguments;Rt?(clearTimeout(Xt),Xt=setTimeout(()=>{Date.now()-sr>=wt&&(ze.apply(Dr,Lr),sr=Date.now())},Math.max(wt-(Date.now()-sr),0))):(ze.apply(Dr,Lr),sr=Date.now(),Rt=!0)}};const proxyContainer=(ze,wt)=>{if(!window.Proxy){const Rt=function proxyPolyfill(){let ze=null;function isObject(ze){return!!ze&&("object"==typeof ze||"function"==typeof ze)}const ProxyPolyfill=function(wt,Rt){if(!isObject(wt)||!isObject(Rt))throw new TypeError("Cannot create proxy with a non-object as target or handler");let throwRevoked=function(){};ze=function(){throwRevoked=function(ze){throw new TypeError(`Cannot perform '${ze}' on a proxy that has been revoked`)}};const Xt=Rt;Rt={get:null,set:null,apply:null,construct:null};for(const ze in Xt)ze in Rt&&(Rt[ze]=Xt[ze]);"function"==typeof Xt&&(Rt.apply=Xt.apply.bind(Xt));let sr=this,Dr=!1,Lr=!1;"function"==typeof wt?(sr=function ProxyPolyfill(){const ze=this&&this.constructor===sr,Xt=Array.prototype.slice.call(arguments);return throwRevoked(ze?"construct":"apply"),ze&&Rt.construct?Rt.construct.call(this,wt,Xt):!ze&&Rt.apply?Rt.apply(wt,this,Xt):ze?(Xt.unshift(wt),new(wt.bind.apply(wt,Xt))):wt.a
20pply(this,Xt)},Dr=!0):wt instanceof Array&&(sr=[],Lr=!0);const Ur=Rt.get?function(ze){return throwRevoked("get"),Rt.get(this,ze,sr)}:function(ze){return throwRevoked("get"),this[ze]},qr=Rt.set?function(ze,wt){throwRevoked("set"),Rt.set(this,ze,wt,sr)}:function(ze,wt){throwRevoked("set"),this[ze]=wt},ri=Object.getOwnPropertyNames(wt),ai={};ri.forEach(function(ze){if((Dr||Lr)&&ze in sr)return;const Rt={enumerable:!!Object.getOwnPropertyDescriptor(wt,ze).enumerable,get:Ur.bind(wt,ze),set:qr.bind(wt,ze)};Object.defineProperty(sr,ze,Rt),ai[ze]=!0});let Yi=!0;if(Object.setPrototypeOf?Object.setPrototypeOf(sr,Object.getPrototypeOf(wt)):sr.__proto__?sr.__proto__=wt.__proto__:Yi=!1,Rt.get||!Yi)for(const ze in wt)ai[ze]||Object.defineProperty(sr,ze,{get:Ur.bind(wt,ze)});return Object.seal(wt),Object.seal(sr),sr};return ProxyPolyfill.revocable=function(wt,Rt){return{proxy:new ProxyPolyfill(wt,Rt),revoke:ze}},ProxyPolyfill}();return new Rt(ze,wt)}return new Proxy(ze,wt)};function createStore(ze){const wt=[];let Rt=ze.initialState;const Xt={set:(ze,Rt,Xt)=>(function valueHasChanged(ze,wt){return wt!==ze&&(wt==wt||ze==ze)}(ze[Rt],Xt)&&(ze[Rt]=Xt,function callObservers(ze,Rt){wt.forEach(({keys:wt,callback:Xt})=>{wt?Array.isArray(wt)&&wt.indexOf(Rt)>-1&&Xt(ze):Xt(ze)})}(ze,Rt)),!0)};let sr=proxyContainer(ze.initialState||{},Xt);return{subscribe:function subscribe(ze,Rt){return"function"!=typeof ze&&new Error("You can only subscribe to Store changes with a valid function!"),wt.push({callback:ze,keys:Rt}),!0},unsubscribe:function unsubscribe(ze){"function"!=typeof ze&&new Error("You can only subscribe to Store changes with a valid function!");const Rt=wt.find(({callback:wt})=>wt===ze);Rt&&wt.splice(wt.indexOf(Rt),1)},dispatch:async function dispatch(wt,Xt){ze.actions&&"function"==typeof ze.actions[wt]||new Error(`Action "${wt}" doesn't exist.`);const Dr=ze.actions[wt];Rt=Object.assign({},sr);const Lr=await Dr(sr,Xt);return sr=Lr,sr},getState:()=>sr,getPrevState:()=>Rt}}const createLocalStorageStore=({key:ze,actions:wt,initialState:Rt,expireInDays:Xt,excludeProps:sr,initAction:Dr})=>{const Lr=createStore({initialState:Rt,actions:wt});function get(){const wt=localStorage.getItem(ze);if(!wt)return;const Rt=JSON.parse(wt);if(!(Rt.expire&&new Date>Rt.expire))return Rt.value;localStorage.removeItem(ze)}function set(wt){try{const Rt=new Date,Dr=JSON.stringify({value:sr?excludePropsFromState(wt):wt,expire:Xt?Rt.setDate(Rt.getDate()+Xt):void 0});localStorage.setItem(ze,Dr)}catch(ze){console.log("Error in localStorage.setItem",ze)}}function excludePropsFromState(ze){const wt=Object.keys(ze),Rt={};return wt.filter(ze=>!(null==sr?void 0:sr.includes(ze))).forEach(wt=>{const Xt=ze[wt];Rt[wt]=Xt}),Rt}Lr.subscribe(ze=>set(ze));const Ur=get();return Ur&&function updateStore(ze){return Lr.dispatch(Dr,ze)}(Ur),Object.assign({get,set},Lr)},createSessionStorageStore=({key:ze,initialState:wt,actions:Rt,initAction:Xt})=>{const sr=createStore({initialState:wt,actions:Rt});function get(){const wt=sessionStorage.getItem(ze);if(wt)return JSON.parse(wt)}function set(wt){try{const Rt=JSON.stringify(wt);sessionStorage.setItem(ze,Rt)}catch(ze){console.log("Error in sessionStorage.setItem",ze)}}sr.subscribe(ze=>set(ze));const Dr=get();return Dr&&function updateStore(ze){return sr.dispatch(Xt,ze)}(Dr),Object.assign({get,set},sr)}},5116:(ze,wt,Rt)=>{"use strict";var Xt=Rt(8612),sr=Rt(1768),Dr=Rt(8928),Lr=Rt(9770);ze.exports=Lr||Xt.call(Dr,sr)},1768:ze=>{"use strict";ze.exports=Function.prototype.apply},8928:ze=>{"use strict";ze.exports=Function.prototype.call},319:(ze,wt,Rt)=>{"use strict";var Xt=Rt(8612),sr=Rt(4453),Dr=Rt(8928),Lr=Rt(5116);ze.exports=function callBindBasic(ze){if(ze.length<1||"function"!=typeof ze[0])throw new sr("a function is required");return Lr(Xt,Dr,ze)}},9770:ze=>{"use strict";ze.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7379:(ze,wt,Rt)=>{"use strict";var Xt=Rt(210),sr=Rt(319),Dr=sr([Xt("%String.prototype.indexOf%")]);ze.exports=function callBoundIntrinsic(ze,wt){var Rt=Xt(ze,!!wt);return"function"==typeof Rt&&Dr(ze,".prototype.")>-1?sr([Rt]):Rt}},487:ze=>{var wt={utf8:{stringToBytes:function(ze){return wt.bin.stringToBytes(unescape(encodeURIComponent(ze)))},bytesToString:function(ze){return decodeURIComponent(escape(wt.bin.bytesToString(ze)))}},bin:{stringToBytes:function(ze){for(var wt=[],Rt=0;Rt<ze.length;Rt++)wt.push(255&ze.charCodeAt(Rt));return wt},bytesToString:function(ze){for(var wt=[],Rt=0;Rt<ze.length;Rt++)wt.push(String.fromCharCode(ze[Rt]));return wt.join("")}}};ze.exports=wt},1012:ze=>{var wt,Rt;wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
20+/",Rt={rotl:function(ze,wt){return ze<<wt|ze>>>32-wt},rotr:function(ze,wt){return ze<<32-wt|ze>>>wt},endian:function(ze){if(ze.constructor==Number)return 16711935&Rt.rotl(ze,8)|4278255360&Rt.rotl(ze,24);for(var wt=0;wt<ze.length;wt++)ze[wt]=Rt.endian(ze[wt]);return ze},randomBytes:function(ze){for(var wt=[];ze>0;ze--)wt.push(Math.floor(256*Math.random()));return wt},bytesToWords:function(ze){for(var wt=[],Rt=0,Xt=0;Rt<ze.length;Rt++,Xt+=8)wt[Xt>>>5]|=ze[Rt]<<24-Xt%32;return wt},wordsToBytes:function(ze){for(var wt=[],Rt=0;Rt<32*ze.length;Rt+=8)wt.push(ze[Rt>>>5]>>>24-Rt%32&255);return wt},bytesToHex:function(ze){for(var wt=[],Rt=0;Rt<ze.length;Rt++)wt.push((ze[Rt]>>>4).toString(16)),wt.push((15&ze[Rt]).toString(16));return wt.join("")},hexToBytes:function(ze){for(var wt=[],Rt=0;Rt<ze.length;Rt+=2)wt.push(parseInt(ze.substr(Rt,2),16));return wt},bytesToBase64:function(ze){for(var Rt=[],Xt=0;Xt<ze.length;Xt+=3)for(var sr=ze[Xt]<<16|ze[Xt+1]<<8|ze[Xt+2],Dr=0;Dr<4;Dr++)8*Xt+6*Dr<=8*ze.length?Rt.push(wt.charAt(sr>>>6*(3-Dr)&63)):Rt.push("=");return Rt.join("")},base64ToBytes:function(ze){ze=ze.replace(/[^A-Z0-9+\/]/gi,"");for(var Rt=[],Xt=0,sr=0;Xt<ze.length;sr=++Xt%4)0!=sr&&Rt.push((wt.indexOf(ze.charAt(Xt-1))&Math.pow(2,-2*sr+8)-1)<<2*sr|wt.indexOf(ze.charAt(Xt))>>>6-2*sr);return Rt}},ze.exports=Rt},1072:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,"inview-container{display:block;height:100%;width:100%}",""]);const Ur=Lr.toString()},4539:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,":host{-webkit-box-pack:center;-ms-flex-pack:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center;margin-top:1.5rem;width:100%}.inview-indicators__item{background-color:var(--color-grey-20);border-radius:50%;display:block;height:.5rem;margin:0 .5rem;-webkit-transform:scale(1);transform:scale(1);-webkit-transform-origin:center;transform-origin:center;-webkit-transition-property:background-color,-webkit-transform;transition-property:background-color,-webkit-transform;transition-property:transform,background-color;transition-property:transform,background-color,-webkit-transform;-webkit-transition:.25s;transition:.25s;width:.5rem}.inview-indicators__item--is-active{background-color:var(--color-black);-webkit-transform:scale(1.3);transform:scale(1.3)}",""]);const Ur=Lr.toString()},6910:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,"bpd-profile-dropdown{display:block;position:relative}.c-profile-dropdown{background-color:var(--color-white);min-width:30rem;position:relative;width:100%}.profile-dropdown__inner{display:block;height:100%;position:relative;width:100%}.profile-dropdown__account-info,.profile-dropdown__list-item{border-bottom:.1rem solid var(--color-grey-20);padding:2rem}.profile-dropdown__account-info span,.profile-dropdown__list-item span{display:block}.profile-dropdown__list{list-style:none}.profile-dropdown__actions-bar{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-align-items:center;align-items:center;background-color:var(--color-bg);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:space-between;justify-content:space-between;padding:1.2rem .8rem}.profile-dropdown__actions-bar .svg{margin-right:1rem}.profile-dropdown__cta{padding:0 1.2rem}.profile-dropdown__site-picker-close{display:none}.profile-dropdown--site-picker-active .profile-dropdown__site-picker-close{display:block;position:fixed;right:1.6rem;top:1.6rem;z-index:1}.bpd-profile-dropdown__list{background-color:var(--color-white);-webkit-box-shadow:0 .2rem .5rem 0 rgba(43,43,43,.2);box-shadow:0 .2rem .5rem 0 rgba(43,43,43,.2);list-style:none;min-width:30rem;right:0;width:100%}.bpd-profile-dropdown__list-item{border-bottom:.1rem solid var(--color-grey-20)}.bpd-profile-dropdown__list-link{color:var(--color-grey-50);display:block;font-size:1.6rem;padding:2rem}.bpd-profile-dropdown__name{font-weight:600}.bpd-profile-dropdown__email{color:var(--color-grey-30);display:block}.bpd-profile-dropdown__list-actions{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;background-color:var(--color-bg);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.bpd-profile-dropdown__list-actions .svg{margin-right:1rem}.bpd-profile-dropdown__list-actions>*{width:50%}@media only screen and (min-width:64em){.c-profile-dropdown{-webkit-box-shadow:0 .2rem .5rem 0 rgba(43,43,43,.2);box-shadow:0 .2rem .5rem 0 rgba(43,43,43,.2);position:absolute;right:0}.bpd-profile-dropdown__list{position:absolute}}@media only screen and (max-width:63.96875em){.c-profile-dropdown{border-bottom:1px solid var(--color-grey-10);border-top:1px solid var(--color-grey-10)}}",""]);const Ur=Lr.toString()},8318:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".c-social{-webkit-appearance:none;-moz-appearance:none;background-color:transparent;border:0;cursor:pointer;font-family:Avenir Next W02,sans-serif;margin:0;padding:0;text-align:center;text-decoration:none}",""]);const Ur=Lr.toString()},2572:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,'bpd-construction-number-card{display:block}.c-construction-number-card{background-color:var(--color-white);color:var(--color-black);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:0 3.2rem;height:100%;padding:2.4rem 3.2rem;position:relative;width:100%}.construction-number-card--highlighted .c-construction-number-card,.is--highlighted .c-construction-number-card,html.is-touch--with-mouse .c-construction-number-card:hover,html:not(.is-touch) .c-construction-number-card:hover{background-color:var(--color-bg)}.construction-number-card__image-container{-ms-flex-item-align:stretch;-webkit-box-flex:1;-webkit-align-self:stretch;align-self:stretch;-webkit-flex:1 0 0;-ms-flex:1 0 0px;flex:1 0 0;margin-bottom:auto;margin-top:auto;max-width:24rem;min-width:12rem;position:relative}.construction-number-card__image{height:100%;width:100%}.construction-number-card__details{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;padding-top:2.2rem;text-align:left}.construction-number-card__status{font-size:1.2rem;font-weight:500;line-height:1.33}.construction-number-card__status:first-letter{text-transform:uppercase}.construction-number-card__title{font-size:1.4rem;font-weight:400;font-weight:600;letter-spacing:.25px;line-height:1.71;margin-top:.8rem}.construction-number-card__price{font-size:1.4rem;font-weight:400;letter-spacing:.25px;line-height:1.71}.construction-number-card__specs-list{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;font-size:1.2rem;font-weight:400;line-height:1.33;list-style:none}.construction-number-card__list-item{color:var(--color-grey-30);margin-right:1.5rem;position:relative}.construction-number-card__list-item:after{background-color:var(--color-grey-30);border-radius:50%;content:"";display:none;height:.3rem;position:absolute;right:-.8rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:.3rem}.construction-number-card__list-item:first-of-type:after{display:initial}.construction-number-card__list-item:last-of-type:after{display:none}.construction-number-card__compare{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;justify-self:end;margin-top:1.6rem}.construction-number-card__actions{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:absolute;right:1.6rem;top:2.4rem}.construction-number-card__action{margin-bottom:.8rem}.construction-number-card__add-to-cart{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-align-items:center;align-items:center;background-color:var(--color-positive);color:var(--color-grey-30);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;
20-webkit-justify-content:center;justify-content:center;-webkit-transition:background-color .2s;transition:background-color .2s}.construction-number-card__add-to-cart:after{background-color:var(--color-white)}.construction-number-card__add-to-cart .svg-icons-cart{-webkit-animation:fadeIn .2s;animation:fadeIn .2s;display:block;height:2.2rem;-webkit-transition:color .2s;transition:color .2s;width:2.2rem}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@media only screen and (min-width:48em){.construction-number-card__title{margin-top:1.6rem}.construction-number-card__specs-list{font-size:1.4rem;font-weight:400;letter-spacing:.25px;line-height:1.71}.construction-number-card__list-item:after{display:initial}.construction-number-card__list-item:last-of-type{width:auto}.construction-number-card__actions{right:3.2rem}.construction-number-card__action{margin-bottom:0;margin-left:.8rem}}@media only screen and (max-width:63.96875em){.c-construction-number-card{gap:0 1.6rem;padding:2.4rem 0}.construction-number-card__image-container{-webkit-box-flex:0;aspect-ratio:1;-webkit-flex:0 0 0;-ms-flex:0 0 0px;flex:0 0 0;height:auto}}',""]);const Ur=Lr.toString()},2847:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".c-development-overlay{height:100%;left:0;pointer-events:none;position:fixed;top:0;width:100%;z-index:9999}.c-development-overlay *,.development-overlay__column{height:100%}.development-overlay__column-inner{background-color:rgba(255,165,0,.25);height:100%;width:100%}.development-overlay__actions{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;background-color:hsla(0,0%,100%,.7);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;gap:0 20px;height:auto;padding:2rem;pointer-events:all;position:fixed;right:2rem;top:7rem}.development-overlay__actions button{background-color:hsla(0,0%,100%,.5);border:1px solid var(--color-grey-50);display:block;margin:.5rem .5rem .5rem auto;
20min-width:200px;padding:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.development-overlay__actions bpd-form{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}",""]);const Ur=Lr.toString()},9010:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".c-user-login .modal-wrapper__content{padding:0}",""]);const Ur=Lr.toString()},8230:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".c-image{display:block;overflow:hidden;position:relative}.c-image img{height:auto;max-height:100%;max-width:100%;width:100%}.c-image [js-hook-objectfit-img]{height:100%;max-height:none;max-width:none;-o-object-fit:cover;object-fit:cover;width:100%}.has--object-fit-polyfill .c-image [js-hook-objectfit-img] :not(.image--is-loaded){opacity:0}.c-image [js-hook-objectfit-img^=contain]{-o-object-fit:contain;object-fit:contain}[js-hook-objectfit-container]{background-position:50%;background-repeat:no-repeat;background-size:cover;height:100%;width:100%}[js-hook-objectfit-container^=contain]{background-size:contain}.image__default{opacity:0;-webkit-transition:opacity .5s cubic-bezier(.645,.045,.355,1);transition:opacity .5s cubic-bezier(.645,.045,.355,1)}.image--is-loaded .image__default{opacity:1}.has--object-fit-polyfill .image__default{display:none}.image__ghost{-webkit-filter:blur(1.5rem);filter:blur(1.5rem);left:50%;pointer-events:none;position:absolute;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);-webkit-transition:opacity .5s cubic-bezier(.645,.045,.355,1) 50ms;transition:opacity .5s cubic-bezier(.645,.045,.355,1) 50ms}.image--is-loaded .image__ghost{opacity:0}.c-map-switch{background-color:var(--color-bg);overflow:hidden}.map-switch__container{position:relative;width:100%}.map-switch__toggle{-moz-appearance:none;appearance:none;-webkit-appearance:none;border:0;font-size:1.4rem;font-weight:600;letter-spacing:.5px;line-height:1.71;outline:0;position:absolute}.map-switch__toggle-interior{display:none}.map-switch--view-exterior .map-switch__toggle-interior,.map-switch__toggle-exterior{display:block}.map-switch--view-exterior .map-switch__toggle-exterior,.map-switch__toggle-label{display:none}.c-image.map-switch__toggle-image{display:block;height:10rem;width:10rem}.c-image.map-switch__toggle-image figure{margin:0}@media only screen and (min-width:48em){.map-switch__container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;max-width:100%;overflow:visible;-webkit-transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1),-webkit-transform .5s cubic-bezier(.645,.045,.355,1)}.map-switch--view-exterior .map-switch__container{-webkit-transform:translateX(-100vw) translateX(52.6rem);transform:translateX(-100vw) translateX(52.6rem)}.map-switch__interior{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 26.3rem);-ms-flex:0 0 calc(100% - 26.3rem);flex:0 0 calc(100% - 26.3rem);min-width:calc(100% - 26.3rem);-webkit-transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1),-webkit-transform .5s cubic-bezier(.645,.045,.355,1);-webkit-transition-delay:50ms;transition-delay:50ms}.map-switch--view-exterior .map-switch__interior{-webkit-transform:translateX(-26.3rem);transform:translateX(-26.3rem)}.map-switch__exterior{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 26.3rem);-ms-flex:0 0 calc(100% - 26.3rem);flex:0 0 calc(100% - 26.3rem);min-width:calc(100% - 26.3rem);position:relative}.map-switch__toggle{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-align-items:center;align-items:center;background-color:var(--color-primary);bottom:0;color:var(--color-black);cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;
20-webkit-justify-content:center;justify-content:center;left:calc(100% - 26.3rem);padding:1.6rem;text-align:center;-webkit-transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1);transition:transform .5s cubic-bezier(.645,.045,.355,1),-webkit-transform .5s cubic-bezier(.645,.045,.355,1);-webkit-transition-delay:50ms;transition-delay:50ms;width:26.3rem}.map-switch__toggle:hover{text-decoration:underline}.map-switch--view-exterior .map-switch__toggle{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.map-switch__toggle-label{display:block}.c-image.map-switch__toggle-image{display:none}}@media only screen and (max-width:29.96875em){.map-switch__container{padding-bottom:15rem}}@media only screen and (max-width:47.96875em){.map-switch__exterior{height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:90}.map-switch--view-exterior .map-switch__exterior{opacity:1;pointer-events:all}.map-switch__toggle{background-color:var(--color-white);bottom:7.2rem;padding:.2rem;right:0;z-index:91}}",""]);const Ur=Lr.toString()},7801:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".media-overlay__container{-webkit-box-orient:vertical;-webkit-box-direction:reverse;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;height:100vh;width:100vw}.media-overlay__close-button{height:6rem;position:absolute;right:2.6rem;top:2.6rem;width:6rem;z-index:3}.media-overlay__close-button .svg{pointer-events:none}.media-overlay__inner{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-flex-grow:1;flex-grow:1;position:relative;width:100%}.media-overlay__sidebar{height:14.5rem;padding:2.4rem 1.6rem;width:100%}.media-overlay__sidebar-inner{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:100%;position:relative;width:100%}.media-overlay__media-container{background-color:var(--color-grey-5);height:100%;left:0;opacity:1;pointer-events:all;position:absolute;top:0;-webkit-transition:opacity .2s cubic-bezier(.645,.045,.355,1);transition:opacity .2s cubic-bezier(.645,.045,.355,1);width:100%;z-index:2}.media-overlay__media-container.is-hidden{opacity:0;pointer-events:none}.media-overlay__slider{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:100%}.media-overlay__slider-item{height:100%}.media-overlay__item{height:100%;width:100vw}.media-overlay__image{display:block}.media-overlay__image,.media-overlay__image figure,.media-overlay__image img{height:100%;width:100%}.media-overlay__image img{-o-object-fit:contain;object-fit:contain}.media-overlay__krpano{height:100%;width:100%}.media-overlay__krpano-controls,.media-overlay__slider-controls{display:none;position:absolute;right:6rem;top:0;z-index:3}.media-overlay__krpano-control,.media-overlay__slider-control{border-right:1px solid var(--color-grey-20);height:6rem;width:6rem}.media-overlay__video{height:100%;padding-bottom:0;width:100%}.media-overlay__video .video__player{height:100%;left:50%;right:auto;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:100%}.media-overlay__video--has-multiple{height:90%}.media-overlay__sidebar-slider{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-flex-grow:1;flex-grow:1;overflow:hidden}.media-overlay__sidebar-slider .slider-embla__slider-inner{gap:.8rem}.media-overlay__sidebar-slider-item{width:auto}.media-overlay__sidebar-slider-control{border:1px solid var(--color-grey-10);height:4rem;left:50%;opacity:0;pointer-events:none;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;width:4rem;z-index:4}.media-overlay__sidebar-slider-control--up{top:0}.slider-embla--fade-start .media-overlay__sidebar-slider-control--up{opacity:1;pointer-events:all}.media-overlay__sidebar-slider-control--down{bottom:0}.slider-embla--fade-end .media-overlay__sidebar-slider-control--down{opacity:1;pointer-events:all}.media-overlay__sidebar-button{-ms-flex-negative:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;flex-shrink:0;height:6rem;
20-webkit-justify-content:center;justify-content:center;width:6rem}.media-overlay__sidebar-button .button__icon+.button__label{margin-left:0;margin-top:.5rem}.media-overlay__sidebar-button--image{padding:0}.media-overlay__sidebar-button--image.is-active{border:2px solid var(--color-selected)}.media-overlay__sidebar-button--special{margin-left:.8rem;pointer-events:all}.media-overlay__sidebar-button--special.is-active{border:1px solid var(--color-black);color:var(--color-black);pointer-events:none}.media-overlay__sidebar-button--special.is-active:before{background-color:var(--color-white)}.media-overlay__thumbnail{height:100%;width:100%}.media-overlay__gallery-length{text-align:center}.media-overlay__media-item-buttons{-webkit-box-pack:center;-ms-flex-pack:center;bottom:2.4rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:1.4rem;-webkit-justify-content:center;justify-content:center;left:0;padding:2rem;position:absolute;width:100%;z-index:3}.media-overlay__media-item-button{border-radius:.6rem;height:4rem;min-width:4rem}.media-overlay__media-item-button.button--square{padding:0}.media-overlay__media-item-button.button--large{border-radius:.8rem}.media-overlay__media-item-button.button--small{border-radius:.4rem}.media-overlay__media-item-button.is-active{pointer-events:none}.media-overlay__media-item-button.is-active:before{background-color:var(--color-grey-20)}@media only screen and (min-width:64em){.media-overlay__container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;height:calc(100vh - 4rem);width:calc(100vw - 4rem)}.media-overlay__close-button{right:0;top:0}.media-overlay__inner{height:100%;width:auto}.media-overlay__sidebar{height:100%;padding:4.5rem 1.8rem 2.1rem 5.8rem;width:16.5rem}.media-overlay__sidebar-inner{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.media-overlay__item{width:calc(100vw - 4rem)}.media-overlay__container:has(.media-overlay__sidebar) .media-overlay__item{width:calc(100vw - 20.5rem)}.media-overlay__krpano-controls,.media-overlay__slider-controls{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.media-overlay__video .video__player{height:80%;width:80%}.media-overlay__sidebar-slider .slider-embla__slider-inner{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:2.4rem}.media-overlay__sidebar-slider-item{height:auto;width:100%}.media-overlay__sidebar-button{height:8.8rem;width:8.8rem}.media-overlay__sidebar-button .button__icon .svg{height:1.5rem;width:1.9rem}.media-overlay__sidebar-button--special{margin-left:0;margin-top:1.4rem}.media-overlay__media-item-buttons{bottom:4.8rem;gap:2.5rem}.media-overlay__media-item-button{height:5.6rem;min-width:5.6rem}}@media only screen and (max-width:63.96875em){.media-overlay__gallery-length{left:0;position:absolute;text-align:left;top:6.8rem;z-index:3}}",""]);const Ur=Lr.toString()},2530:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,":host([close-disabled]) .modal__button{display:none}:host([close-disabled]) .modal__background{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.c-modal{-webkit-overflow-scrolling:touch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;-webkit-transition:.4s cubic-bezier(.455,.03,.515,.955),0s linear .4s;transition:.4s cubic-bezier(.455,.03,.515,.955),0s linear .4s;
20-webkit-transition-property:opacity,visibility;transition-property:opacity,visibility;visibility:hidden;width:100%;z-index:9999}.modal--is-showing{left:0;opacity:1;pointer-events:all;-webkit-transition:.4s cubic-bezier(.455,.03,.515,.955);transition:.4s cubic-bezier(.455,.03,.515,.955);-webkit-transition-property:opacity;transition-property:opacity;visibility:visible}.modal--is-showing .modal__content{opacity:1;-webkit-transition:.4s cubic-bezier(.455,.03,.515,.955) .1s,.4s cubic-bezier(.455,.03,.515,.955);transition:.4s cubic-bezier(.455,.03,.515,.955) .1s,.4s cubic-bezier(.455,.03,.515,.955);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform}.modal--is-showing .modal__background{left:0;-webkit-transition:.4s cubic-bezier(.455,.03,.515,.955),0s;transition:.4s cubic-bezier(.455,.03,.515,.955),0s;-webkit-transition-property:opacity,left;transition-property:opacity,left}.modal__button{position:absolute;right:0;top:0}.modal__container{left:50%;max-height:100%;max-width:100%;overflow:auto;position:absolute;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);z-index:1}.modal__container--has-shadow{-webkit-box-shadow:0 .2rem 6rem 0 rgba(0,0,0,.07);box-shadow:0 .2rem 6rem 0 rgba(0,0,0,.07)}.modal__content{background-color:#fff;height:auto;margin:0 auto;opacity:0;pointer-events:all;position:relative;-webkit-transition:.4s cubic-bezier(.455,.03,.515,.955),.4s cubic-bezier(.455,.03,.515,.955);transition:.4s cubic-bezier(.455,.03,.515,.955),.4s cubic-bezier(.455,.03,.515,.955);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;width:auto;z-index:1}.modal__background{background-color:rgba(30,30,30,.5);cursor:pointer;height:100%;left:-100%;position:fixed;top:0;-webkit-transition:0s linear .4s;transition:0s linear .4s;
20-webkit-transition-property:left;transition-property:left;width:100%;z-index:0}",""]);const Ur=Lr.toString()},4356:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".bpd-iframe-modal__container iframe{height:100%;width:100%}",""]);const Ur=Lr.toString()},185:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,"compare-button{display:inline-block}.c-compare-button{-webkit-box-align:baseline;-ms-flex-align:baseline;-webkit-align-items:baseline;align-items:baseline;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.c-compare-button .checkbox__label,.c-compare-button .form__item{margin-bottom:0}.compare-button__button{color:var(--color-primary);font-weight:600;margin-left:1.6rem}",""]);const Ur=Lr.toString()},182:(ze,wt,Rt)=>{"use strict";Rt.d(wt,{Z:()=>Ur});var Xt=Rt(8081),sr=Rt.n(Xt),Dr=Rt(3645),Lr=Rt.n(Dr)()(sr());Lr.push([ze.id,".wishlist-favourite-button__button{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-align-items:center;align-items:center;background-color:var(--color-bg);border:0;color:var(--color-grey-30);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;padding:0;-webkit-transition:background-color .2s;transition:background-color .2s}.wishlist-favourite-button__button .svg-icons-heart{-webkit-animation:fadeIn .2s;animation:fadeIn .2s;height:.9rem;-webkit-transition:color .2s ease-out;transition:color .2s ease-out}.wishlist-favourite-button__button.is-loading .svg-icons-heart{opacity:0}[is-added] .wishlist-favourite-button__button{color:var(--color-progression)}.wishlist-favourite-button__button:after{background-color:var(--color-white)}.wishlist-favourite-button__count{color:var(--color-black);display:block;font-size:1.2rem;font-weight:500;letter-spacing:.5px;line-height:1.33;margin:-.3rem 0 .2rem}.is-loading .wishlist-favourite-button__count{opacity:0}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const Ur=Lr.toString()},3645:ze=>{"use strict";ze.exports=function(ze){var wt=[];return wt.toString=function toString(){return this.map(function(wt){var Rt="",Xt=void 0!==wt[5];return wt[4]&&(Rt+="@supports (".concat(wt[4],") {")),wt[2]&&(Rt+="@media ".concat(wt[2]," {")),Xt&&(Rt+="@layer".concat(wt[5].length>0?" ".concat(wt[5]):""," {")),Rt+=ze(wt),Xt&&(Rt+="}"),wt[2]&&(Rt+="}"),wt[4]&&(Rt+="}"),Rt}).join("")},wt.i=function i(ze,Rt,Xt,sr,Dr){"string"==typeof ze&&(ze=[[null,ze,void 0]]);var Lr={};if(Xt)for(var Ur=0;Ur<this.length;Ur++){var qr=this[Ur][0];null!=qr&&(Lr[qr]=!0)}for(var ri=0;ri<ze.length;ri++){var ai=[].concat(ze[ri]);Xt&&Lr[ai[0]]||(void 0!==Dr&&(void 0===ai[5]||(ai[1]="@layer".concat(ai[5].length>0?" ".concat(ai[5]):""," {").concat(ai[1],"}")),ai[5]=Dr),Rt&&(ai[2]?(ai[1]="@media ".concat(ai[2]," {").concat(ai[1],"}"),ai[2]=Rt):ai[2]=Rt),sr&&(ai[4]?(ai[1]="@supports (".concat(ai[4],") {").concat(ai[1],"}"),ai[4]=sr):ai[4]="".concat(sr)),wt.push(ai))}},wt}},8081:ze=>{"use strict";ze.exports=function(ze){return ze[1]}},4020:ze=>{"use strict";var wt="%[a-f0-9]{2}",Rt=new RegExp("("+wt+")|([^%]+?)","gi"),Xt=new RegExp("("+wt+")+","gi");function decodeComponents(ze,wt){try{return[decodeURIComponent(ze.join(""))]}catch(ze){}if(1===ze.length)return ze;wt=wt||1;var Rt=ze.slice(0,wt),Xt=ze.slice(wt);return Array.prototype.concat.call([],decodeComponents(Rt),decodeComponents(Xt))}function decode(ze){try{return decodeURIComponent(ze)}catch(sr){for(var wt=ze.match(Rt)||[],Xt=1;Xt<wt.length;Xt++)wt=(ze=decodeComponents(wt,Xt).join("")).match(Rt)||[];return ze}}ze.exports=function(ze){if("string"!=typeof ze)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof ze+"`");try{return ze=ze.replace(/\+/g," "),decodeURIComponent(ze)}catch(wt){return function customDecodeURIComponent(ze){for(var wt={"%FE%FF":"��","%FF%FE":"��"},Rt=Xt.exec(ze);Rt;){try{wt[Rt[0]]=decodeURIComponent(Rt[0])}catch(ze){var sr=decode(Rt[0]);sr!==Rt[0]&&(wt[Rt[0]]=sr)}Rt=Xt.exec(ze)}wt["%C2"]="�";for(var Dr=Object.keys(wt),Lr=0;Lr<Dr.length;Lr++){var Ur=Dr[Lr];ze=ze.replace(new RegExp(Ur,"g"),wt[Ur])}return ze}(ze)}}},6504:(ze,wt,Rt)=>{"use strict";var Xt,sr=Rt(319),Dr=Rt(7296);try{Xt=[].__proto__===Array.prototype}
vendor: 2,018 bytes, line 20
20catch(ze){if(!ze||"object"!=typeof ze||!("code"in ze)||"ERR_PROTO_ACCESS"!==ze.code)throw ze}var Lr=!!Xt&&Dr&&Dr(Object.prototype,"__proto__"),Ur=Object,qr=Ur.getPrototypeOf;ze.exports=Lr&&"function"==typeof Lr.get?sr([Lr.get]):"function"==typeof qr&&function getDunder(ze){return qr(null==ze?ze:Ur(ze))}},4429:ze=>{"use strict";var wt=Object.defineProperty||!1;if(wt)try{wt({},"a",{value:1})}catch(ze){wt=!1}ze.exports=wt},3981:ze=>{"use strict";ze.exports=EvalError},1648:ze=>{"use strict";ze.exports=Error},4726:ze=>{"use strict";ze.exports=RangeError},6712:ze=>{"use strict";ze.exports=ReferenceError},3464:ze=>{"use strict";ze.exports=SyntaxError},4453:ze=>{"use strict";ze.exports=TypeError},3915:ze=>{"use strict";ze.exports=URIError},8892:ze=>{"use strict";ze.exports=Object},7648:ze=>{"use strict";var wt=Object.prototype.toString,Rt=Math.max,Xt=function concatty(ze,wt){for(var Rt=[],Xt=0;Xt<ze.length;Xt+=1)Rt[Xt]=ze[Xt];for(var sr=0;sr<wt.length;sr+=1)Rt[sr+ze.length]=wt[sr];return Rt};ze.exports=function bind(ze){var sr=this;if("function"!=typeof sr||"[object Function]"!==wt.apply(sr))throw new TypeError("Function.prototype.bind called on incompatible "+sr);for(var Dr,Lr=function slicy(ze,wt){for(var Rt=[],Xt=wt||0,sr=0;Xt<ze.length;Xt+=1,sr+=1)Rt[sr]=ze[Xt];return Rt}(arguments,1),Ur=Rt(0,sr.length-Lr.length),qr=[],ri=0;ri<Ur;ri++)qr[ri]="$"+ri;if(Dr=Function("binder","return function ("+function(ze,wt){for(var Rt="",Xt=0;Xt<ze.length;Xt+=1)Rt+=ze[Xt],Xt+1<ze.length&&(Rt+=wt);return Rt}(qr,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof Dr){var wt=sr.apply(this,Xt(Lr,arguments));return Object(wt)===wt?wt:this}return sr.apply(ze,Xt(Lr,arguments))}),sr.prototype){var ai=function Empty(){};ai.prototype=sr.prototype,Dr.prototype=new ai,ai.prototype=null}return Dr}},8612:(ze,wt,Rt)=>{"use strict";var Xt=Rt(7648);ze.exports=Function.prototype.bind||Xt},4113:ze=>{"use strict";const wt=function*(){}.constructor;ze.exports=()=>wt},210:(ze,wt,Rt)=>{"use strict";
vendor: 1,958 bytes, line 20
20var Xt,sr=Rt(8892),Dr=Rt(1648),Lr=Rt(3981),Ur=Rt(4726),qr=Rt(6712),ri=Rt(3464),ai=Rt(4453),Yi=Rt(3915),Ji=Rt(9738),Qi=Rt(6329),kn=Rt(2264),jn=Rt(5730),Un=Rt(707),Wn=Rt(3862),Yn=Rt(9550),Jn=Rt(7296),Qn=Rt(4429),throwTypeError=function(){throw new ai},Io=Jn?function(){try{return throwTypeError}catch(ze){try{return Jn(arguments,"callee").get}catch(ze){return throwTypeError}}}():throwTypeError,Mo=Rt(1405)(),jo=Rt(1618),zo=Rt(8899),oa=Rt(443),la=Rt(1768),ca=Rt(8928),ua={},ha="undefined"!=typeof Uint8Array&&jo?jo(Uint8Array):Xt,pa={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Xt:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Xt:ArrayBuffer,"%ArrayIteratorPrototype%":Mo&&jo?jo([][Symbol.iterator]()):Xt,"%AsyncFromSyncIteratorPrototype%":Xt,"%AsyncFunction%":ua,"%AsyncGenerator%":ua,"%AsyncGeneratorFunction%":ua,"%AsyncIteratorPrototype%":ua,"%Atomics%":"undefined"==typeof Atomics?Xt:Atomics,"%BigInt%":"undefined"==typeof BigInt?Xt:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Xt:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Xt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Xt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Dr,"%eval%":eval,"%EvalError%":Lr,"%Float16Array%":"undefined"==typeof Float16Array?Xt:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?Xt:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Xt:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Xt:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":ua,"%Int8Array%":"undefined"==typeof Int8Array?Xt:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Xt:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Xt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
20IteratorPrototype%":Mo&&jo?jo(jo([][Symbol.iterator]())):Xt,"%JSON%":"object"==typeof JSON?JSON:Xt,"%Map%":"undefined"==typeof Map?Xt:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Mo&&jo?jo((new Map)[Symbol.iterator]()):Xt,"%Math%":Math,"%Number%":Number,"%Object%":sr,"%Object.getOwnPropertyDescriptor%":Jn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Xt:Promise,"%Proxy%":"undefined"==typeof Proxy?Xt:Proxy,"%RangeError%":Ur,"%ReferenceError%":qr,"%Reflect%":"undefined"==typeof Reflect?Xt:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Xt:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Mo&&jo?jo((new Set)[Symbol.iterator]()):Xt,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Xt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Mo&&jo?jo(""[Symbol.iterator]()):Xt,"%Symbol%":Mo?Symbol:Xt,"%SyntaxError%":ri,"%ThrowTypeError%":Io,"%TypedArray%":ha,"%TypeError%":ai,"%Uint8Array%":"undefined"==typeof Uint8Array?Xt:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Xt:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Xt:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Xt:Uint32Array,"%URIError%":Yi,"%WeakMap%":"undefined"==typeof WeakMap?Xt:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Xt:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Xt:WeakSet,"%Function.prototype.call%":ca,"%Function.prototype.apply%":la,"%Object.defineProperty%":Qn,"%Object.getPrototypeOf%":zo,"%Math.abs%":Ji,"%Math.floor%":Qi,"%Math.max%":kn,"%Math.min%":jn,"%Math.pow%":Un,"%Math.round%":Wn,"%Math.sign%":Yn,"%Reflect.getPrototypeOf%":oa};if(jo)try{null.error}catch(ze){var _a=jo(jo(ze));pa["%Error.prototype%"]=_a}var wa=Rt(5481),Pa=Rt(4113),Oa=Rt(5220),Da=function doEval(ze){var wt;if("%AsyncFunction%"===ze)wt=wa()||void 0;else if("%GeneratorFunction%"===ze)wt=Pa()||void 0;else if("%AsyncGeneratorFunction%"===ze)wt=Oa()||void 0;else if("%AsyncGenerator%"===ze){var Rt=doEval("%AsyncGeneratorFunction%");Rt&&(wt=Rt.prototype)}else if("%AsyncIteratorPrototype%"===ze){var Xt=doEval("%AsyncGenerator%");Xt&&jo&&(wt=jo(Xt.prototype))}return pa[ze]=wt,wt},La={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ra=Rt(8612),Na=Rt(8824),Ba=Ra.call(ca,Array.prototype.concat),Ua=Ra.call(la,Array.prototype.splice),qa=Ra.call(ca,String.prototype.replace),rs=Ra.call(ca,String.prototype.slice),ss=Ra.call(ca,RegExp.prototype.exec),_s=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pl=/\\(\\)?/g,Cl=function getBaseIntrinsic(ze,wt){var Rt,Xt=ze;if(Na(La,Xt)&&(Xt="%"+(Rt=La[Xt])[0]+"%"),Na(pa,Xt)){var sr=pa[Xt];if(sr===ua&&(sr=Da(Xt)),void 0===sr&&!wt)throw new ai("intrinsic "+ze+" exists, but is not available. Please file an issue!");return{alias:Rt,name:Xt,value:sr}}throw new ri("intrinsic "+ze+" does not exist!")};ze.exports=function GetIntrinsic(ze,wt){if("string"!=typeof ze||0===ze.length)throw new ai("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof wt)throw new ai('"allowMissing" argument must be a boolean');if(null===ss(/^%?[^%]*%?$/,ze))throw new ri("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Rt=function stringToPath(ze){var wt=rs(ze,0,1),Rt=rs(ze,-1);if("%"===wt&&"%"!==Rt)throw new ri("invalid intrinsic syntax, expected closing `%`");if("%"===Rt&&"%"!==wt)throw new ri("invalid intrinsic syntax, expected opening `%`");var Xt=[];return qa(ze,_s,function(ze,wt,Rt,sr){Xt[Xt.length]=Rt?qa(sr,Pl,"$1"):wt||ze}),Xt}(ze),Xt=Rt.length>0?Rt[0]:"",sr=Cl("%"+Xt+"%",wt),Dr=sr.name,Lr=sr.value,Ur=!1,qr=sr.alias;qr&&(Xt=qr[0],Ua(Rt,Ba([0,1],qr)));for(var Yi=1,Ji=!0;Yi<Rt.length;Yi+=1){var Qi=Rt[Yi],kn=rs(Qi,0,1),jn=rs(Qi,-1);if(('"'===kn||"'"===kn||"`"===kn||'"'===jn||"'"===jn||"`"===jn)&&kn!==jn)throw new ri("property names with quotes must have matching quotes");if("constructor"!==Qi&&Ji||(Ur=!0),Na(pa,Dr="%"+(Xt+="."+Qi)+"%"))Lr=pa[Dr];else if(null!=Lr){if(!(Qi in Lr)){if(!wt)throw new ai("base intrinsic for "+ze+" exists, but the property is not available.");return}if(Jn&&Yi+1>=Rt.length){var Un=Jn(Lr,Qi);Lr=(Ji=!!Un)&&"get"in Un&&!("originalValue"in Un.get)?Un.get:Lr[Qi]}else Ji=Na(Lr,Qi),Lr=Lr[Qi];Ji&&!Ur&&(pa[Dr]=Lr)}}return Lr}},8899:(ze,wt,Rt)=>{"use strict";var Xt=Rt(8892);ze.exports=Xt.getPrototypeOf||null},443:ze=>{"use strict";ze.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1618:(ze,wt,Rt)=>{"use strict";var Xt=Rt(443),sr=Rt(8899),Dr=Rt(6504);ze.exports=Xt?function getProto(ze){return Xt(ze)}:sr?function getProto(ze){if(!ze||"object"!=typeof ze&&"function"!=typeof ze)throw new TypeError("getProto: not an object");return sr(ze)}:Dr?function getProto(ze){return Dr(ze)}:null},690:ze=>{"use strict";ze.exports=Object.getOwnPropertyDescriptor},7296:(ze,wt,Rt)=>{"use strict";var Xt=Rt(690);if(Xt)try{Xt([],"length")}catch(ze){Xt=null}ze.exports=Xt},1405:(ze,wt,Rt)=>{"use strict";var Xt="undefined"!=typeof Symbol&&Symbol,sr=Rt(5419);ze.exports=function hasNativeSymbols(){return"function"==typeof Xt&&("function"==typeof Symbol&&("symbol"==typeof Xt("foo")&&("symbol"==typeof Symbol("bar")&&sr())))}},5419:ze=>{"use strict";
20ze.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var ze={},wt=Symbol("test"),Rt=Object(wt);if("string"==typeof wt)return!1;if("[object Symbol]"!==Object.prototype.toString.call(wt))return!1;if("[object Symbol]"!==Object.prototype.toString.call(Rt))return!1;for(var Xt in ze[wt]=42,ze)return!1;if("function"==typeof Object.keys&&0!==Object.keys(ze).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(ze).length)return!1;var sr=Object.getOwnPropertySymbols(ze);if(1!==sr.length||sr[0]!==wt)return!1;if(!Object.prototype.propertyIsEnumerable.call(ze,wt))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var Dr=Object.getOwnPropertyDescriptor(ze,wt);if(42!==Dr.value||!0!==Dr.enumerable)return!1}return!0}},8824:(ze,wt,Rt)=>{"use strict";var Xt=Function.prototype.call,sr=Object.prototype.hasOwnProperty,Dr=Rt(8612);ze.exports=Dr.call(Xt,sr)},8738:ze=>{function isBuffer(ze){return!!ze.constructor&&"function"==typeof ze.constructor.isBuffer&&ze.constructor.isBuffer(ze)}ze.exports=function(ze){return null!=ze&&(isBuffer(ze)||function isSlowBuffer(ze){return"function"==typeof ze.readFloatLE&&"function"==typeof ze.slice&&isBuffer(ze.slice(0,0))}(ze)||!!ze._isBuffer)}},6808:(ze,wt,Rt)=>{var Xt,sr;!function(Dr){if(void 0===(sr="function"==typeof(Xt=Dr)?Xt.call(wt,Rt,wt,ze):Xt)||(ze.exports=sr),ze.exports=Dr(),!!0){var Lr=window.Cookies,Ur=window.Cookies=Dr();Ur.noConflict=function(){return window.Cookies=Lr,Ur}}}(function(){function extend(){for(var ze=0,wt={};ze<arguments.length;ze++){var Rt=arguments[ze];for(var Xt in Rt)wt[Xt]=Rt[Xt]}return wt}function decode(ze){return ze.replace(/(%[0-9A-Z]{2}
20)+/g,decodeURIComponent)}return function init(ze){function api(){}function set(wt,Rt,Xt){if("undefined"!=typeof document){"number"==typeof(Xt=extend({path:"/"},api.defaults,Xt)).expires&&(Xt.expires=new Date(1*new Date+864e5*Xt.expires)),Xt.expires=Xt.expires?Xt.expires.toUTCString():"";try{var sr=JSON.stringify(Rt);/^[\{\[]/.test(sr)&&(Rt=sr)}catch(ze){}Rt=ze.write?ze.write(Rt,wt):encodeURIComponent(String(Rt)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),wt=encodeURIComponent(String(wt)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var Dr="";for(var Lr in Xt)Xt[Lr]&&(Dr+="; "+Lr,!0!==Xt[Lr]&&(Dr+="="+Xt[Lr].split(";")[0]));return document.cookie=wt+"="+Rt+Dr}}function get(wt,Rt){if("undefined"!=typeof document){for(var Xt={},sr=document.cookie?document.cookie.split("; "):[],Dr=0;Dr<sr.length;Dr++){var Lr=sr[Dr].split("="),Ur=Lr.slice(1).join("=");Rt||'"'!==Ur.charAt(0)||(Ur=Ur.slice(1,-1));try{var qr=decode(Lr[0]);if(Ur=(ze.read||ze)(Ur,qr)||decode(Ur),Rt)try{Ur=JSON.parse(Ur)}catch(ze){}if(Xt[qr]=Ur,wt===qr)break}catch(ze){}}return wt?Xt[wt]:Xt}}return api.set=set,api.get=function(ze){return get(ze,!1)},api.getJSON=function(ze){return get(ze,!0)},api.remove=function(ze,wt){set(ze,"",extend(wt,{expires:-1}))},api.defaults={},api.withConverter=init,api}(function(){})})},6158:function(ze){ze.exports=function(){"use strict";var ze,wt,Rt;function define(Xt,sr){if(ze)if(wt){var Dr="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/api/#transpiling-v2'); }; var sharedChunk = {}; ("+ze+")(sharedChunk); ("+wt+")(sharedChunk); self.onerror = null;",Lr={};ze(Lr),Rt=sr(Lr),"undefined"!=typeof window&&(Rt.workerUrl=window.URL.createObjectURL(new Blob([Dr],{type:"text/javascript"})))}else wt=sr;else ze=sr}return define(["exports"],function(ze){var wt="2.4.1",Rt=n;function n(ze,wt,Rt,Xt){this.cx=3*ze,this.bx=3*(Rt-ze)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*wt,this.by=3*(Xt-wt)-this.cy,this.ay=1-this.cy-this.by,this.p1x=ze,this.p1y=Xt,this.p2x=Rt,this.p2y=Xt}n.prototype.sampleCurveX=function(ze){return((this.ax*ze+this.bx)*ze+this.cx)*ze},n.prototype.sampleCurveY=function(ze){return((this.ay*ze+this.by)*ze+this.cy)*ze},n.prototype.sampleCurveDerivativeX=function(ze){return(3*this.ax*ze+2*this.bx)*ze+this.cx},n.prototype.solveCurveX=function(ze,wt){var Rt,Xt,sr,Dr,Lr;for(void 0===wt&&(wt=1e-6),sr=ze,Lr=0;Lr<8;Lr++){if(Dr=this.sampleCurveX(sr)-ze,Math.abs(Dr)<wt)return sr;var Ur=this.sampleCurveDerivativeX(sr);if(Math.abs(Ur)<1e-6)break;sr-=Dr/Ur}if((sr=ze)<(Rt=0))return Rt;if(sr>(Xt=1))return Xt;for(;Rt<Xt;){if(Dr=this.sampleCurveX(sr),Math.abs(Dr-ze)<wt)return sr;ze>Dr?Rt=sr:Xt=sr,sr=.5*(Xt-Rt)+Rt}return sr},n.prototype.solve=function(ze,wt){return this.sampleCurveY(this.solveCurveX(ze,wt))};var Xt=s;function s(ze,wt){this.x=ze,this.y=wt}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(ze){return this.clone()._add(ze)},sub:function(ze){return this.clone()._sub(ze)},multByPoint:function(ze){return this.clone()._multByPoint(ze)},divByPoint:function(ze){return this.clone()._divByPoint(ze)},mult:function(ze){return this.clone()._mult(ze)},div:function(ze){return this.clone()._div(ze)},rotate:function(ze){return this.clone()._rotate(ze)},rotateAround:function(ze,wt){return this.clone()._rotateAround(ze,wt)},matMult:function(ze){return this.clone()._matMult(ze)},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(ze){return this.x===ze.x&&this.y===ze.y},dist:function(ze){return Math.sqrt(this.distSqr(ze))},distSqr:function(ze){var wt=ze.x-this.x,Rt=ze.y-this.y;return wt*wt+Rt*Rt},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(ze){return Math.atan2(this.y-ze.y,this.x-ze.x)}
vendor: 10,658 bytes, line 20
20,angleWith:function(ze){return this.angleWithSep(ze.x,ze.y)},angleWithSep:function(ze,wt){return Math.atan2(this.x*wt-this.y*ze,this.x*ze+this.y*wt)},_matMult:function(ze){var wt=ze[2]*this.x+ze[3]*this.y;return this.x=ze[0]*this.x+ze[1]*this.y,this.y=wt,this},_add:function(ze){return this.x+=ze.x,this.y+=ze.y,this},_sub:function(ze){return this.x-=ze.x,this.y-=ze.y,this},_mult:function(ze){return this.x*=ze,this.y*=ze,this},_div:function(ze){return this.x/=ze,this.y/=ze,this},_multByPoint:function(ze){return this.x*=ze.x,this.y*=ze.y,this},_divByPoint:function(ze){return this.x/=ze.x,this.y/=ze.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var ze=this.y;return this.y=this.x,this.x=-ze,this},_rotate:function(ze){var wt=Math.cos(ze),Rt=Math.sin(ze),Xt=Rt*this.x+wt*this.y;return this.x=wt*this.x-Rt*this.y,this.y=Xt,this},_rotateAround:function(ze,wt){var Rt=Math.cos(ze),Xt=Math.sin(ze),sr=wt.y+Xt*(this.x-wt.x)+Rt*(this.y-wt.y);return this.x=wt.x+Rt*(this.x-wt.x)-Xt*(this.y-wt.y),this.y=sr,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(ze){return ze instanceof s?ze:Array.isArray(ze)?new s(ze[0],ze[1]):ze};var sr="undefined"!=typeof self?self:{};const Dr=Math.pow(2,53)-1,Lr=Math.PI/180,Ur=180/Math.PI;function c(ze){return ze*Lr}const qr=[[0,0],[1,0],[1,1],[0,1]];function p(ze){if(ze<=0)return 0;if(ze>=1)return 1;const wt=ze*ze,Rt=wt*ze;return 4*(ze<.5?Rt:3*(ze-wt)+Rt-.75)}function d(ze,wt,Xt,sr){const Dr=new Rt(ze,wt,Xt,sr);return function(ze){return Dr.solve(ze)}}const ri=d(.25,.1,.25,1);function y(ze,wt,Rt){return Math.min(Rt,Math.max(wt,ze))}function m(ze,wt,Rt){const Xt=Rt-wt,sr=((ze-wt)%Xt+Xt)%Xt+wt;return sr===wt?Rt:sr}function g(ze,wt,Rt){if(!ze.length)return Rt(null,[]);let Xt=ze.length;const sr=new Array(ze.length);let Dr=null;ze.forEach((ze,Lr)=>{wt(ze,(ze,wt)=>{ze&&(Dr=ze),sr[Lr]=wt,0==--Xt&&Rt(Dr,sr)})})}function x(ze){const wt=[];for(const Rt in ze)wt.push(ze[Rt]);return wt}function v(ze,...wt){for(const Rt of wt)for(const wt in Rt)ze[wt]=Rt[wt];return ze}let ai=1;function w(){return ai++}function _(){return function t(ze){return ze?(ze^16*Math.random()>>ze/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function k(ze){return ze<=1?1:Math.pow(2,Math.ceil(Math.log(ze)/Math.LN2))}function A(ze){return!!ze&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(ze)}function S(ze,wt){ze.forEach(ze=>{wt[ze]&&(wt[ze]=wt[ze].bind(wt))})}function I(ze,wt){return-1!==ze.indexOf(wt,ze.length-wt.length)}function z(ze,wt,Rt){const Xt={};for(const sr in ze)Xt[sr]=wt.call(Rt||this,ze[sr],sr,ze);return Xt}function T(ze,wt,Rt){const Xt={};for(const sr in ze)wt.call(Rt||this,ze[sr],sr,ze)&&(Xt[sr]=ze[sr]);return Xt}function M(ze){return Array.isArray(ze)?ze.map(M):"object"==typeof ze&&ze?z(ze,M):ze}const Yi={};function B(ze){Yi[ze]||(Yi[ze]=!0)}function C(ze,wt,Rt){return(Rt.y-ze.y)*(wt.x-ze.x)>(wt.y-ze.y)*(Rt.x-ze.x)}function P(ze){let wt=0;for(let Rt,Xt,sr=0,Dr=ze.length,Lr=Dr-1;sr<Dr;Lr=sr++)Rt=ze[sr],Xt=ze[Lr],wt+=(Xt.x-Rt.x)*(Rt.y+Xt.y);return wt}function D(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function V(ze){const wt={};if(ze.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ze,Rt,Xt,sr)=>{const Dr=Xt||sr;return wt[Rt]=!Dr||Dr.toLowerCase(),""}),wt["max-age"]){const ze=parseInt(wt["max-age"],10);isNaN(ze)?delete wt["max-age"]:wt["max-age"]=ze}return wt}let Ji,Qi,kn,jn=null;function $(ze){if(null==jn){const wt=ze.navigator?ze.navigator.userAgent:null;jn=!!ze.safari||!(!wt||!(/\b(iPad|iPhone|iPod)\b/.test(wt)||wt.match("Safari")&&!wt.match("Chrome")))}return jn}function O(ze){try{const wt=sr[ze];return wt.setItem("_mapbox_test_",1),wt.removeItem("_mapbox_test_"),!0}catch(ze){return!1}}const Un={now:()=>void 0!==kn?kn:sr.performance.now(),setNow(ze){kn=ze},restoreNow(){kn=void 0},frame(ze){const wt=sr.requestAnimationFrame(ze);return{cancel:()=>sr.cancelAnimationFrame(wt)}},getImageData(ze,wt=0){const Rt=sr.document.createElement("canvas"),Xt=Rt.getContext("2d");if(!Xt)throw new Error("failed to create canvas 2d context");return Rt.width=ze.width,Rt.height=ze.height,Xt.drawImage(ze,0,0,ze.width,ze.height),Xt.getImageData(-wt,-wt,ze.width+2*wt,ze.height+2*wt)},resolveURL:ze=>(Ji||(Ji=sr.document.createElement("a")),Ji.href=ze,Ji.href),get devicePixelRatio(){return sr.devicePixelRatio},get prefersReducedMotion(){return!!sr.matchMedia&&(null==Qi&&(Qi=sr.matchMedia("(prefers-reduced-motion: reduce)")),Qi.matches)}};let Wn;const Yn={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==Wn){const ze=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Wn=null!={PORT:3e3,NODE_ENV:"production",HOST:"http://localhost",ASSET_PREFIX:"/frontend/hestia"}.API_URL_REGEX?new RegExp({PORT:3e3,NODE_ENV:"production",HOST:"http://localhost",ASSET_PREFIX:"/frontend/hestia"}.API_URL_REGEX):ze}catch(wt){Wn=ze}}return Wn},get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Jn={supported:!1,testSupport:function(ze){!Mo&&Io&&(jo?Y(ze):Qn=ze)}};let Qn,Io,Mo=!1,jo=!1;function Y(ze){const wt=ze.createTexture();ze.bindTexture(ze.TEXTURE_2D,wt);try{if(ze.texImage2D(ze.TEXTURE_2D,0,ze.RGBA,ze.RGBA,ze.UNSIGNED_BYTE,Io),ze.isContextLost())return;Jn.supported=!0}catch(ze){}ze.deleteTexture(wt),Mo=!0}sr.document&&(Io=sr.document.createElement("img"),Io.onload=function(){Qn&&Y(Qn),Qn=null,jo=!0},Io.onerror=function(){Mo=!0,Qn=null},Io.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const zo="01",oa="NO_ACCESS_TOKEN";function Q(ze){return 0===ze.indexOf("mapbox:")}function tt(ze){return Yn.API_URL_REGEX.test(ze)}const la=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(ze){const wt=ze.match(la);if(!wt)throw new Error("Unable to parse URL object");return{protocol:wt[1],authority:wt[2],path:wt[3]||"/",params:wt[4]?wt[4].split("&"):[]}}function nt(ze){const wt=ze.params.length?`?${ze.params.join("&")}`:"";return`${ze.protocol}://${ze.authority}${ze.path}${wt}`}function it(ze){if(!ze)return null;const wt=ze.split(".");if(!wt||3!==wt.length)return null;try{return JSON.parse(decodeURIComponent(sr.atob(wt[1]).split("").map(ze=>"%"+("00"+ze.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(ze){return null}}class st{constructor(ze){this.type=ze,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(ze){const wt=it(Yn.ACCESS_TOKEN);let Rt="";return Rt=wt&&wt.u?sr.btoa(encodeURIComponent(wt.u).replace(/%([0-9A-F]{2})/g,(ze,wt)=>String.fromCharCode(Number("0x"+wt)))):Yn.ACCESS_TOKEN||"",ze?`mapbox.eventData.${ze}:${Rt}`:`mapbox.eventData:${Rt}`}fetchEventData(){const ze=O("localStorage"),wt=this.getStorageKey(),Rt=this.getStorageKey("uuid");if(ze)try{const ze=sr.localStorage.getItem(wt);ze&&(this.eventData=JSON.parse(ze));const Xt=sr.localStorage.getItem(Rt);Xt&&(this.anonId=Xt)}catch(ze){B("Unable to read from LocalStorage")}}saveEventData(){const ze=O("localStorage"),wt=this.getStorageKey(),Rt=this.getStorageKey("uuid");if(ze)try{sr.localStorage.setItem(Rt,this.anonId),Object.keys(this.eventData).length>=1&&sr.localStorage.setItem(wt,JSON.stringify(this.eventData))}catch(ze){B("Unable to write to LocalStorage")}}processRequests(ze){}postEvent(ze,Rt,Xt,sr){if(!Yn.EVENTS_URL)return;const Dr=rt(Yn.EVENTS_URL);Dr.params.push(`access_token=${sr||Yn.ACCESS_TOKEN||""}`);const Lr={event:this.type,created:new Date(ze).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:wt,skuId:zo,userId:this.anonId},Ur=Rt?v(Lr,Rt):Lr,qr={url:nt(Dr),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ur])};this.pendingRequest=It(qr,ze=>{this.pendingRequest=null,Xt(ze),this.saveEventData(),this.processRequests(sr)})}queueRequest(ze,wt){this.queue.push(ze),this.processRequests(wt)}}const ca=new class extends st{constructor(ze){super("appUserTurnstile"),this._customAccessToken=ze}postTurnstileEvent(ze,wt){Yn.EVENTS_URL&&Yn.ACCESS_TOKEN&&Array.isArray(ze)&&ze.some(ze=>Q(ze)||tt(ze))&&this.queueRequest(Date.now(),wt)}processRequests(ze){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const wt=it(Yn.ACCESS_TOKEN),Rt=wt?wt.u:Yn.ACCESS_TOKEN;let Xt=Rt!==this.eventData.tokenU;A(this.anonId)||(this.anonId=_(),Xt=!0);const sr=this.queue.shift();if(this.eventData.lastSuccess){const ze=new Date(this.eventData.lastSuccess),wt=new Date(sr),Rt=(sr-this.eventData.lastSuccess)/864e5;Xt=Xt||Rt>=1||Rt<-1||ze.getDate()!==wt.getDate()}else Xt=!0;if(!Xt)return this.processRequests();this.postEvent(sr,{"enabled.telemetry":!1},ze=>{ze||(this.eventData.lastSuccess=sr,this.eventData.tokenU=Rt)},ze)}},ua=ca.postTurnstileEvent.bind(ca),ha=new class extends st{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(ze,wt,Rt,Xt){this.skuToken=wt,this.errorCb=Xt,Yn.EVENTS_URL&&(Rt||Yn.ACCESS_TOKEN?this.queueRequest({id:ze,timestamp:Date.now()},Rt):this.errorCb(new Error(oa)))}processRequests(ze){if(this.pendingRequest||0===this.queue.length)return;const{id:wt,timestamp:Rt}=this.queue.shift();wt&&this.success[wt]||(this.anonId||this.fetchEventData(),A(this.anonId)||(this.anonId=_()),this.postEvent(Rt,{skuToken:this.skuToken},ze=>{ze?this.errorCb(ze):wt&&(this.success[wt]=!0)},ze))}},pa=ha.postMapLoadEvent.bind(ha),_a=new class extends st{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(ze,wt,Rt,Xt){if(!Yn.API_URL||!Yn.SESSION_PATH)return;const sr=rt(Yn.API_URL+Yn.SESSION_PATH);sr.params.push(`sku=${wt||""}`),sr.params.push(`access_token=${Xt||Yn.ACCESS_TOKEN||""}`);const Dr={url:nt(sr),headers:{"Content-Type":"text/plain"}};this.pendingRequest=zt(Dr,ze=>{this.pendingRequest=null,Rt(ze),this.saveEventData(),this.processRequests(Xt)})}getSessionAPI(ze,wt,Rt,Xt){this.skuToken=wt,this.errorCb=Xt,Yn.SESSION_PATH&&Yn.API_URL&&(Rt||Yn.ACCESS_TOKEN?this.queueRequest({id:ze,timestamp:Date.now()},Rt):this.errorCb(new Error(oa)))}processRequests(ze){if(this.pendingRequest||0===this.queue.length)return;const{id:wt,timestamp:Rt}=this.queue.shift();
20wt&&this.success[wt]||this.getSession(Rt,this.skuToken,ze=>{ze?this.errorCb(ze):wt&&(this.success[wt]=!0)},ze)}},wa=_a.getSessionAPI.bind(_a),Pa=new Set,Oa="mapbox-tiles";let Da,La,Ra=500,Na=50;function xt(){sr.caches&&!Da&&(Da=sr.caches.open(Oa))}function vt(ze){const wt=ze.indexOf("?");return wt<0?ze:ze.slice(0,wt)}let Ba=1/0;const Ua={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Ua);class _t extends Error{constructor(ze,wt,Rt){401===wt&&tt(Rt)&&(ze+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(ze),this.status=wt,this.url=Rt}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const qa=D()?()=>self.worker&&self.worker.referrer:()=>("blob:"===sr.location.protocol?sr.parent:sr).location.href,At=function(ze,wt){if(!(/^file:/.test(Rt=ze.url)||/^file:/.test(qa())&&!/^\w+:/.test(Rt))){if(sr.fetch&&sr.Request&&sr.AbortController&&sr.Request.prototype.hasOwnProperty("signal"))return function(ze,wt){const Rt=new sr.AbortController,Xt=new sr.Request(ze.url,{method:ze.method||"GET",body:ze.body,credentials:ze.credentials,headers:ze.headers,referrer:qa(),signal:Rt.signal});let Dr=!1,Lr=!1;const Ur=(qr=Xt.url).indexOf("sku=")>0&&tt(qr);var qr;"json"===ze.type&&Xt.headers.set("Accept","application/json");const u=(Rt,Dr,qr)=>{if(Lr)return;if(Rt&&"SecurityError"!==Rt.message&&B(Rt),Dr&&qr)return c(Dr);const ri=Date.now();sr.fetch(Xt).then(Rt=>{if(Rt.ok){const ze=Ur?Rt.clone():null;return c(Rt,ze,ri)}return wt(new _t(Rt.statusText,Rt.status,ze.url))}).catch(ze=>{20!==ze.code&&wt(new Error(ze.message))})},c=(Rt,Ur,qr)=>{("arrayBuffer"===ze.type?Rt.arrayBuffer():"json"===ze.type?Rt.json():Rt.text()).then(ze=>{Lr||(Ur&&qr&&function(ze,wt,Rt){if(xt(),!Da)return;const Xt={status:wt.status,statusText:wt.statusText,headers:new sr.Headers};wt.headers.forEach((ze,wt)=>Xt.headers.set(wt,ze));const Dr=V(wt.headers.get("Cache-Control")||"");Dr["no-store"]||(Dr["max-age"]&&Xt.headers.set("Expires",new Date(Rt+1e3*Dr["max-age"]).toUTCString()),new Date(Xt.headers.get("Expires")).getTime()-Rt<42e4||function(ze,wt){if(void 0===La)try{new Response(new ReadableStream),La=!0}catch(ze){La=!1}La?wt(ze.body):ze.blob().then(wt)}(wt,wt=>{const Rt=new sr.Response(wt,Xt);xt(),Da&&Da.then(wt=>wt.put(vt(ze.url),Rt)).catch(ze=>B(ze.message))}))}(Xt,Ur,qr),Dr=!0,wt(null,ze,Rt.headers.get("Cache-Control"),Rt.headers.get("Expires")))}).catch(ze=>{Lr||wt(new Error(ze.message))})};return Ur?function(ze,wt){if(xt(),!Da)return wt(null);const Rt=vt(ze.url);Da.then(ze=>{ze.match(Rt).then(Xt=>{const sr=function(ze){if(!ze)return!1;const wt=new Date(ze.headers.get("Expires")||0),Rt=V(ze.headers.get("Cache-Control")||"");return wt>Date.now()&&!Rt["no-cache"]}(Xt);ze.delete(Rt),sr&&ze.put(Rt,Xt.clone()),wt(null,Xt,sr)}).catch(wt)}).catch(wt)}(Xt,u):u(null,null),{cancel:()=>{Lr=!0,Dr||Rt.abort()}}}(ze,wt);if(D()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",ze,wt,void 0,!0)}var Rt;return function(ze,wt){const Rt=new sr.XMLHttpRequest;Rt.open(ze.method||"GET",ze.url,!0),"arrayBuffer"===ze.type&&(Rt.responseType="arraybuffer");for(const wt in ze.headers)Rt.setRequestHeader(wt,ze.headers[wt]);return"json"===ze.type&&(Rt.responseType="text",Rt.setRequestHeader("Accept","application/json")),Rt.withCredentials="include"===ze.credentials,Rt.onerror=()=>{wt(new Error(Rt.statusText))},Rt.onload=()=>{if((Rt.status>=200&&Rt.status<300||0===Rt.status)&&null!==Rt.response){let Xt=Rt.response;if("json"===ze.type)try{Xt=JSON.parse(Rt.response)}catch(ze){return wt(ze)}wt(null,Xt,Rt.getResponseHeader("Cache-Control"),Rt.getResponseHeader("Expires"))}else wt(new _t(Rt.statusText,Rt.status,ze.url))},Rt.send(ze.body),{cancel:()=>Rt.abort()}}(ze,wt)},St=function(ze,wt){return At(v(ze,{type:"arrayBuffer"}),wt)},It=function(ze,wt){return At(v(ze,{method:"POST"}),wt)},zt=function(ze,wt){return At(v(ze,{method:"GET"}),wt)};function Tt(ze){const wt=sr.document.createElement("a");return wt.href=ze,wt.protocol===sr.document.location.protocol&&wt.host===sr.document.location.host}const rs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ss,_s;ss=[],_s=0;const Ct=function(ze,wt){if(Jn.supported&&(ze.headers||(ze.headers={}),ze.headers.accept="image/webp,*/*"),_s>=Yn.MAX_PARALLEL_IMAGE_REQUESTS){const Rt={requestParameters:ze,callback:wt,cancelled:!1,cancel(){this.cancelled=!0}};return ss.push(Rt),Rt}_s++;let Rt=!1;const n=()=>
20{if(!Rt)for(Rt=!0,_s--;ss.length&&_s<Yn.MAX_PARALLEL_IMAGE_REQUESTS;){const ze=ss.shift(),{requestParameters:wt,callback:Rt,cancelled:Xt}=ze;Xt||(ze.cancel=Ct(wt,Rt).cancel)}},Xt=St(ze,(ze,Rt,Xt,Dr)=>{n(),ze?wt(ze):Rt&&(sr.createImageBitmap?function(ze,wt){const Rt=new sr.Blob([new Uint8Array(ze)],{type:"image/png"});sr.createImageBitmap(Rt).then(ze=>{wt(null,ze)}).catch(ze=>{wt(new Error(`Could not load image because of ${ze.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(Rt,(ze,Rt)=>wt(ze,Rt,Xt,Dr)):function(ze,wt){const Rt=new sr.Image,Xt=sr.URL;Rt.onload=()=>{wt(null,Rt),Xt.revokeObjectURL(Rt.src),Rt.onload=null,sr.requestAnimationFrame(()=>{Rt.src=rs})},Rt.onerror=()=>wt(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 Dr=new sr.Blob([new Uint8Array(ze)],{type:"image/png"});Rt.src=ze.byteLength?Xt.createObjectURL(Dr):rs}(Rt,(ze,Rt)=>wt(ze,Rt,Xt,Dr)))});return{cancel:()=>{Xt.cancel(),n()}}};function Pt(ze,wt,Rt){Rt[ze]&&-1!==Rt[ze].indexOf(wt)||(Rt[ze]=Rt[ze]||[],Rt[ze].push(wt))}function Dt(ze,wt,Rt){if(Rt&&Rt[ze]){const Xt=Rt[ze].indexOf(wt);-1!==Xt&&Rt[ze].splice(Xt,1)}}class Vt{constructor(ze,wt={}){v(this,wt),this.type=ze}}class Lt extends Vt{constructor(ze,wt={}){super("error",v({error:ze},wt))}}class Ft{on(ze,wt){return this._listeners=this._listeners||{},Pt(ze,wt,this._listeners),this}off(ze,wt){return Dt(ze,wt,this._listeners),Dt(ze,wt,this._oneTimeListeners),this}once(ze,wt){return wt?(this._oneTimeListeners=this._oneTimeListeners||{},Pt(ze,wt,this._oneTimeListeners),this):new Promise(wt=>this.once(ze,wt))}fire(ze,wt){"string"==typeof ze&&(ze=new Vt(ze,wt||{}));const Rt=ze.type;if(this.listens(Rt)){ze.target=this;const wt=this._listeners&&this._listeners[Rt]?this._listeners[Rt].slice():[];for(const Rt of wt)Rt.call(this,ze);const Xt=this._oneTimeListeners&&this._oneTimeListeners[Rt]?this._oneTimeListeners[Rt].slice():[];for(const wt of Xt)Dt(Rt,wt,this._oneTimeListeners),wt.call(this,ze);const sr=this._eventedParent;sr&&(v(ze,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),sr.fire(ze))}else ze instanceof Lt&&console.error(ze.error);return this}listens(ze){return!!(this._listeners&&this._listeners[ze]&&this._listeners[ze].length>0||this._oneTimeListeners&&this._oneTimeListeners[ze]&&this._oneTimeListeners[ze].length>0||this._eventedParent&&this._eventedParent.listens(ze))}setEventedParent(ze,wt){return this._eventedParent=ze,this._eventedParentData=wt,this}}var Pl={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0}
vendor: 5,290 bytes, line 20
20,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:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{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","feature"]},"property-type":"data-driven"},"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"],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"}
vendor: 11,097 bytes, line 20
20,"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},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",{"symbol-placement":["point"]}],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","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,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},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],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
vendor: 8,689 bytes, line 20
20"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"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"},
20"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"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Ut{constructor(ze,wt,Rt,Xt){this.message=(ze?`${ze}: `:"")+Rt,Xt&&(this.identifier=Xt),null!=wt&&wt.__line__&&(this.line=wt.__line__)}}function $t(ze){const wt=ze.value;return wt?[new Ut(ze.key,wt,"constants have been deprecated as of v8")]:[]}function Ot(ze,...wt){for(const Rt of wt)for(const wt in Rt)ze[wt]=Rt[wt];return ze}function qt(ze){return ze instanceof Number||ze instanceof String||ze instanceof Boolean?ze.valueOf():ze}function Nt(ze){if(Array.isArray(ze))return ze.map(Nt);if(ze instanceof Object&&!(ze instanceof Number||ze instanceof String||ze instanceof Boolean)){const wt={};for(const Rt in ze)wt[Rt]=Nt(ze[Rt]);return wt}return qt(ze)}
vendor: 6,948 bytes, line 20
20class jt extends Error{constructor(ze,wt){super(wt),this.message=wt,this.key=ze}}class Gt{constructor(ze,wt=[]){this.parent=ze,this.bindings={};for(const[ze,Rt]of wt)this.bindings[ze]=Rt}concat(ze){return new Gt(this,ze)}get(ze){if(this.bindings[ze])return this.bindings[ze];if(this.parent)return this.parent.get(ze);throw new Error(`${ze} not found in scope.`)}has(ze){return!!this.bindings[ze]||!!this.parent&&this.parent.has(ze)}}const Cl={kind:"null"},Ol={kind:"number"},Dl={kind:"string"},Ll={kind:"boolean"},Fl={kind:"color"},Vl={kind:"object"},Gl={kind:"value"},Zl={kind:"collator"},Wl={kind:"formatted"},Xl={kind:"resolvedImage"};function re(ze,wt){return{kind:"array",itemType:ze,N:wt}}function ne(ze){if("array"===ze.kind){const wt=ne(ze.itemType);return"number"==typeof ze.N?`array<${wt}, ${ze.N}>`:"value"===ze.itemType.kind?"array":`array<${wt}>`}return ze.kind}const ic=[Cl,Ol,Dl,Ll,Fl,Wl,Vl,re(Gl),Xl];function se(ze,wt){if("error"===wt.kind)return null;if("array"===ze.kind){if("array"===wt.kind&&(0===wt.N&&"value"===wt.itemType.kind||!se(ze.itemType,wt.itemType))&&("number"!=typeof ze.N||ze.N===wt.N))return null}else{if(ze.kind===wt.kind)return null;if("value"===ze.kind)for(const ze of ic)if(!se(ze,wt))return null}return`Expected ${ne(ze)} but found ${ne(wt)} instead.`}function ae(ze,wt){return wt.some(wt=>wt.kind===ze.kind)}function oe(ze,wt){return wt.some(wt=>"null"===wt?null===ze:"array"===wt?Array.isArray(ze):"object"===wt?ze&&!Array.isArray(ze)&&"object"==typeof ze:wt===typeof ze)}function le(ze){var wt={exports:{}};return ze(wt,wt.exports),wt.exports}var lc=le(function(ze,wt){var Rt={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(ze){return(ze=Math.round(ze))<0?0:ze>255?255:ze}function i(ze){return n("%"===ze[ze.length-1]?parseFloat(ze)/100*255:parseInt(ze))}function s(ze){return(wt="%"===ze[ze.length-1]?parseFloat(ze)/100:parseFloat(ze))<0?0:wt>1?1:wt;var wt}function a(ze,wt,Rt){return Rt<0?Rt+=1:Rt>1&&(Rt-=1),6*Rt<1?ze+(wt-ze)*Rt*6:2*Rt<1?wt:3*Rt<2?ze+(wt-ze)*(2/3-Rt)*6:ze}try{wt.parseCSSColor=function(ze){var wt,Xt=ze.replace(/ /g,"").toLowerCase();if(Xt in Rt)return Rt[Xt].slice();if("#"===Xt[0])return 4===Xt.length?(wt=parseInt(Xt.substr(1),16))>=0&&wt<=4095?[(3840&wt)>>4|(3840&wt)>>8,240&wt|(240&wt)>>4,15&wt|(15&wt)<<4,1]:null:7===Xt.length&&(wt=parseInt(Xt.substr(1),16))>=0&&wt<=16777215?[(16711680&wt)>>16,(65280&wt)>>8,255&wt,1]:null;var sr=Xt.indexOf("("),Dr=Xt.indexOf(")");if(-1!==sr&&Dr+1===Xt.length){var Lr=Xt.substr(0,sr),Ur=Xt.substr(sr+1,Dr-(sr+1)).split(","),qr=1;switch(Lr){case"rgba":if(4!==Ur.length)return null;qr=s(Ur.pop());case"rgb":return 3!==Ur.length?null:[i(Ur[0]),i(Ur[1]),i(Ur[2]),qr];case"hsla":if(4!==Ur.length)return null;qr=s(Ur.pop());case"hsl":if(3!==Ur.length)return null;var ri=(parseFloat(Ur[0])%360+360)%360/360,ai=s(Ur[1]),Yi=s(Ur[2]),Ji=Yi<=.5?Yi*(ai+1):Yi+ai-Yi*ai,Qi=2*Yi-Ji;return[n(255*a(Qi,Ji,ri+1/3)),n(255*a(Qi,Ji,ri)),n(255*a(Qi,Ji,ri-1/3)),qr];default:return null}}return null}}catch(ze){}});class ce{constructor(ze,wt,Rt,Xt=1){this.r=ze,this.g=wt,this.b=Rt,this.a=Xt}static parse(ze){if(!ze)return;if(ze instanceof ce)return ze;if("string"!=typeof ze)return;const wt=lc.parseCSSColor(ze);return wt?new ce(wt[0]/255*wt[3],wt[1]/255*wt[3],wt[2]/255*wt[3],wt[3]):void 0}
vendor: 9,161 bytes, line 20
20toString(){const[ze,wt,Rt,Xt]=this.toArray();return`rgba(${Math.round(ze)},${Math.round(wt)},${Math.round(Rt)},${Xt})`}toArray(){const{r:ze,g:wt,b:Rt,a:Xt}=this;return 0===Xt?[0,0,0,0]:[255*ze/Xt,255*wt/Xt,255*Rt/Xt,Xt]}}ce.black=new ce(0,0,0,1),ce.white=new ce(1,1,1,1),ce.transparent=new ce(0,0,0,0),ce.red=new ce(1,0,0,1),ce.blue=new ce(0,0,1,1);class he{constructor(ze,wt,Rt){this.sensitivity=ze?wt?"variant":"case":wt?"accent":"base",this.locale=Rt,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(ze,wt){return this.collator.compare(ze,wt)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class pe{constructor(ze,wt,Rt,Xt,sr){this.text=ze,this.image=wt,this.scale=Rt,this.fontStack=Xt,this.textColor=sr}}class de{constructor(ze){this.sections=ze}static fromString(ze){return new de([new pe(ze,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(ze=>0!==ze.text.length||ze.image&&0!==ze.image.name.length)}static factory(ze){return ze instanceof de?ze:de.fromString(ze)}toString(){return 0===this.sections.length?"":this.sections.map(ze=>ze.text).join("")}serialize(){const ze=["format"];for(const wt of this.sections){if(wt.image){ze.push(["image",wt.image.name]);continue}ze.push(wt.text);const Rt={};wt.fontStack&&(Rt["text-font"]=["literal",wt.fontStack.split(",")]),wt.scale&&(Rt["font-scale"]=wt.scale),wt.textColor&&(Rt["text-color"]=["rgba"].concat(wt.textColor.toArray())),ze.push(Rt)}return ze}}class fe{constructor(ze){this.name=ze.name,this.available=ze.available}toString(){return this.name}static fromString(ze){return ze?new fe({name:ze,available:!1}):null}serialize(){return["image",this.name]}}function ye(ze,wt,Rt,Xt){return"number"==typeof ze&&ze>=0&&ze<=255&&"number"==typeof wt&&wt>=0&&wt<=255&&"number"==typeof Rt&&Rt>=0&&Rt<=255?void 0===Xt||"number"==typeof Xt&&Xt>=0&&Xt<=1?null:`Invalid rgba value [${[ze,wt,Rt,Xt].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof Xt?[ze,wt,Rt,Xt]:[ze,wt,Rt]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function me(ze){if(null===ze)return!0;if("string"==typeof ze)return!0;if("boolean"==typeof ze)return!0;if("number"==typeof ze)return!0;if(ze instanceof ce)return!0;if(ze instanceof he)return!0;if(ze instanceof de)return!0;if(ze instanceof fe)return!0;if(Array.isArray(ze)){for(const wt of ze)if(!me(wt))return!1;return!0}if("object"==typeof ze){for(const wt in ze)if(!me(ze[wt]))return!1;return!0}return!1}function ge(ze){if(null===ze)return Cl;if("string"==typeof ze)return Dl;if("boolean"==typeof ze)return Ll;if("number"==typeof ze)return Ol;if(ze instanceof ce)return Fl;if(ze instanceof he)return Zl;if(ze instanceof de)return Wl;if(ze instanceof fe)return Xl;if(Array.isArray(ze)){const wt=ze.length;let Rt;for(const wt of ze){const ze=ge(wt);if(Rt){if(Rt===ze)continue;Rt=Gl;break}Rt=ze}return re(Rt||Gl,wt)}return Vl}function xe(ze){const wt=typeof ze;return null===ze?"":"string"===wt||"number"===wt||"boolean"===wt?String(ze):ze instanceof ce||ze instanceof de||ze instanceof fe?ze.toString():JSON.stringify(ze)}class ve{constructor(ze,wt){this.type=ze,this.value=wt}static parse(ze,wt){if(2!==ze.length)return wt.error(`'literal' expression requires exactly one argument, but found ${ze.length-1} instead.`);if(!me(ze[1]))return wt.error("invalid value");const Rt=ze[1];let Xt=ge(Rt);const sr=wt.expectedType;return"array"!==Xt.kind||0!==Xt.N||!sr||"array"!==sr.kind||"number"==typeof sr.N&&0!==sr.N||(Xt=sr),new ve(Xt,Rt)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ce?["rgba"].concat(this.value.toArray()):this.value instanceof de?this.value.serialize():this.value}}class be{constructor(ze){this.name="ExpressionEvaluationError",this.message=ze}toJSON(){return this.message}}const uc={string:Dl,number:Ol,boolean:Ll,object:Vl};class _e{constructor(ze,wt){this.type=ze,this.args=wt}static parse(ze,wt){if(ze.length<2)return wt.error("Expected at least one argument.");let Rt,Xt=1;const sr=ze[0];if("array"===sr){let sr,Dr;if(ze.length>2){const Rt=ze[1];if("string"!=typeof Rt||!(Rt in uc)||"object"===Rt)return wt.error('The item type argument of "array" must be one of string, number, boolean',1);sr=uc[Rt],Xt++}else sr=Gl;if(ze.length>3){if(null!==ze[2]&&("number"!=typeof ze[2]||ze[2]<0||ze[2]!==Math.floor(ze[2])))return wt.error('The length argument to "array" must be a positive integer literal',2);Dr=ze[2],Xt++}Rt=re(sr,Dr)}else Rt=uc[sr];const Dr=[];for(;Xt<ze.length;Xt++){const Rt=wt.parse(ze[Xt],Xt,Gl);if(!Rt)return null;Dr.push(Rt)}return new _e(Rt,Dr)}evaluate(ze){for(let wt=0;wt<this.args.length;wt++){const Rt=this.args[wt].evaluate(ze);if(!se(this.type,ge(Rt)))return Rt;if(wt===this.args.length-1)throw new be(`Expected value to be of type ${ne(this.type)}, but found ${ne(ge(Rt))} instead.`)}return null}eachChild(ze){this.args.forEach(ze)}outputDefined(){return this.args.every(ze=>ze.outputDefined())}serialize(){const ze=this.type,wt=[ze.kind];if("array"===ze.kind){const Rt=ze.itemType;if("string"===Rt.kind||"number"===Rt.kind||"boolean"===Rt.kind){wt.push(Rt.kind);const Xt=ze.N;("number"==typeof Xt||this.args.length>1)&&wt.push(Xt)}}return wt.concat(this.args.map(ze=>ze.serialize()))}}class ke{constructor(ze){this.type=Wl,this.sections=ze}static parse(ze,wt){if(ze.length<2)return wt.error("Expected at least one argument.");const Rt=ze[1];if(!Array.isArray(Rt)&&"object"==typeof Rt)return wt.error("First argument must be an image or text section.");const Xt=[];let sr=!1;for(let Rt=1;Rt<=ze.length-1;++Rt){const Dr=ze[Rt];if(sr&&"object"==typeof Dr&&!Array.isArray(Dr)){sr=!1;let ze=null;if(Dr["font-scale"]&&(ze=wt.parse(Dr["font-scale"],1,Ol),!ze))return null;let Rt=null;if(Dr["text-font"]&&(Rt=wt.parse(Dr["text-font"],1,re(Dl)),!Rt))return null;let Lr=null;if(Dr["text-color"]&&(Lr=wt.parse(Dr["text-color"],1,Fl),!Lr))return null;const Ur=Xt[Xt.length-1];Ur.scale=ze,Ur.font=Rt,Ur.textColor=Lr}else{const Dr=wt.parse(ze[Rt],1,Gl);if(!Dr)return null;const Lr=Dr.type.kind;if("string"!==Lr&&"value"!==Lr&&"null"!==Lr&&"resolvedImage"!==Lr)return wt.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");sr=!0,Xt.push({content:Dr,scale:null,font:null,textColor:null})}}return new ke(Xt)}evaluate(ze){return new de(this.sections.map(wt=>{const Rt=wt.content.evaluate(ze);return ge(Rt)===Xl?new pe("",Rt,null,null,null):new pe(xe(Rt),null,wt.scale?wt.scale.evaluate(ze):null,wt.font?wt.font.evaluate(ze).join(","):null,wt.textColor?wt.textColor.evaluate(ze):null)}))}eachChild(ze){for(const wt of this.sections)ze(wt.content),wt.scale&&ze(wt.scale),wt.font&&ze(wt.font),wt.textColor&&ze(wt.textColor)}outputDefined(){return!1}serialize(){const ze=["format"];for(const wt of this.sections){ze.push(wt.content.serialize());const Rt={};wt.scale&&(Rt["font-scale"]=wt.scale.serialize()),wt.font&&(Rt["text-font"]=wt.font.serialize()),wt.textColor&&(Rt["text-color"]=wt.textColor.serialize()),ze.push(Rt)}return ze}}class Ae{constructor(ze){this.type=Xl,this.input=ze}static parse(ze,wt){if(2!==ze.length)return wt.error("Expected two arguments.");const Rt=wt.parse(ze[1],1,Dl);return Rt?new Ae(Rt):wt.error("No image name provided.")}evaluate(ze){const wt=this.input.evaluate(ze),Rt=fe.fromString(wt);return Rt&&ze.availableImages&&(Rt.available=ze.availableImages.indexOf(wt)>-1),Rt}eachChild(ze){ze(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ec={"to-boolean":Ll,"to-color":Fl,"to-number":Ol,"to-string":Dl};class Ie{constructor(ze,wt){this.type=ze,this.args=wt}static parse(ze,wt){if(ze.length<2)return wt.error("Expected at least one argument.");const Rt=ze[0];if(("to-boolean"===Rt||"to-string"===Rt)&&2!==ze.length)return wt.error("Expected one argument.");const Xt=Ec[Rt],sr=[];for(let Rt=1;Rt<ze.length;Rt++){const Xt=wt.parse(ze[Rt],Rt,Gl);if(!Xt)return null;sr.push(Xt)}return new Ie(Xt,sr)}evaluate(ze){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(ze));if("color"===this.type.kind){let wt,Rt;for(const Xt of this.args){if(wt=Xt.evaluate(ze),Rt=null,wt instanceof ce)return wt;if("string"==typeof wt){const Rt=ze.parseColor(wt);if(Rt)return Rt}else if(Array.isArray(wt)&&(Rt=wt.length<3||wt.length>4?`Invalid rbga value ${JSON.stringify(wt)}: expected an array containing either three or four numeric values.`:ye(wt[0],wt[1],wt[2],wt[3]),!Rt))return new ce(wt[0]/255,wt[1]/255,wt[2]/255,wt[3])}throw new be(Rt||`Could not parse color from value '${"string"==typeof wt?wt:String(JSON.stringify(wt))}'`)}if("number"===this.type.kind){let wt=null;for(const Rt of this.args){if(wt=Rt.evaluate(ze),null===wt)return 0;const Xt=Number(wt);if(!isNaN(Xt))return Xt}throw new be(`Could not convert ${JSON.stringify(wt)} to number.`)}return"formatted"===this.type.kind?de.fromString(xe(this.args[0].evaluate(ze))):"resolvedImage"===this.type.kind?fe.fromString(xe(this.args[0].evaluate(ze))):xe(this.args[0].evaluate(ze))}
vendor: 18,106 bytes, line 20
20eachChild(ze){this.args.forEach(ze)}outputDefined(){return this.args.every(ze=>ze.outputDefined())}serialize(){if("formatted"===this.type.kind)return new ke([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ae(this.args[0]).serialize();const ze=[`to-${this.type.kind}`];return this.eachChild(wt=>{ze.push(wt.serialize())}),ze}}const Mc=["Unknown","Point","LineString","Polygon"];class Te{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?Mc[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(ze){let wt=this._parseColorCache[ze];return wt||(wt=this._parseColorCache[ze]=ce.parse(ze)),wt}}class Me{constructor(ze,wt,Rt,Xt){this.name=ze,this.type=wt,this._evaluate=Rt,this.args=Xt}evaluate(ze){return this._evaluate(ze,this.args)}eachChild(ze){this.args.forEach(ze)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(ze=>ze.serialize()))}static parse(ze,wt){const Rt=ze[0],Xt=Me.definitions[Rt];if(!Xt)return wt.error(`Unknown expression "${Rt}". If you wanted a literal array, use ["literal", [...]].`,0);const sr=Array.isArray(Xt)?Xt[0]:Xt.type,Dr=Array.isArray(Xt)?[[Xt[1],Xt[2]]]:Xt.overloads,Lr=Dr.filter(([wt])=>!Array.isArray(wt)||wt.length===ze.length-1);let Ur=null;for(const[Xt,Dr]of Lr){Ur=new We(wt.registry,wt.path,null,wt.scope);const Lr=[];let qr=!1;for(let wt=1;wt<ze.length;wt++){const Rt=ze[wt],sr=Array.isArray(Xt)?Xt[wt-1]:Xt.type,Dr=Ur.parse(Rt,1+Lr.length,sr);if(!Dr){qr=!0;break}Lr.push(Dr)}if(!qr)if(Array.isArray(Xt)&&Xt.length!==Lr.length)Ur.error(`Expected ${Xt.length} arguments, but found ${Lr.length} instead.`);else{for(let ze=0;ze<Lr.length;ze++){const wt=Array.isArray(Xt)?Xt[ze]:Xt.type,Rt=Lr[ze];Ur.concat(ze+1).checkSubtype(wt,Rt.type)}if(0===Ur.errors.length)return new Me(Rt,sr,Dr,Lr)}}if(1===Lr.length)wt.errors.push(...Ur.errors);else{const Rt=(Lr.length?Lr:Dr).map(([ze])=>{return wt=ze,Array.isArray(wt)?`(${wt.map(ne).join(", ")})`:`(${ne(wt.type)}...)`;var wt}).join(" | "),Xt=[];for(let Rt=1;Rt<ze.length;Rt++){const sr=wt.parse(ze[Rt],1+Xt.length);if(!sr)return null;Xt.push(ne(sr.type))}wt.error(`Expected arguments of type ${Rt}, but found (${Xt.join(", ")}) instead.`)}return null}static register(ze,wt){Me.definitions=wt;for(const Rt in wt)ze[Rt]=Me}}class Ee{constructor(ze,wt,Rt){this.type=Zl,this.locale=Rt,this.caseSensitive=ze,this.diacriticSensitive=wt}static parse(ze,wt){if(2!==ze.length)return wt.error("Expected one argument.");const Rt=ze[1];if("object"!=typeof Rt||Array.isArray(Rt))return wt.error("Collator options argument must be an object.");const Xt=wt.parse(void 0!==Rt["case-sensitive"]&&Rt["case-sensitive"],1,Ll);if(!Xt)return null;const sr=wt.parse(void 0!==Rt["diacritic-sensitive"]&&Rt["diacritic-sensitive"],1,Ll);if(!sr)return null;let Dr=null;return Rt.locale&&(Dr=wt.parse(Rt.locale,1,Dl),!Dr)?null:new Ee(Xt,sr,Dr)}evaluate(ze){return new he(this.caseSensitive.evaluate(ze),this.diacriticSensitive.evaluate(ze),this.locale?this.locale.evaluate(ze):null)}eachChild(ze){ze(this.caseSensitive),ze(this.diacriticSensitive),this.locale&&ze(this.locale)}outputDefined(){return!1}serialize(){const ze={};return ze["case-sensitive"]=this.caseSensitive.serialize(),ze["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(ze.locale=this.locale.serialize()),["collator",ze]}}const Bc=8192;function Ce(ze,wt){ze[0]=Math.min(ze[0],wt[0]),ze[1]=Math.min(ze[1],wt[1]),ze[2]=Math.max(ze[2],wt[0]),ze[3]=Math.max(ze[3],wt[1])}function Pe(ze,wt){return!(ze[0]<=wt[0]||ze[2]>=wt[2]||ze[1]<=wt[1]||ze[3]>=wt[3])}function De(ze,wt){const Rt=(180+ze[0])/360,Xt=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+ze[1]*Math.PI/360)))/360,sr=Math.pow(2,wt.z);return[Math.round(Rt*sr*Bc),Math.round(Xt*sr*Bc)]}function Ve(ze,wt,Rt){const Xt=ze[0]-wt[0],sr=ze[1]-wt[1],Dr=ze[0]-Rt[0],Lr=ze[1]-Rt[1];return Xt*Lr-Dr*sr==0&&Xt*Dr<=0&&sr*Lr<=0}function Le(ze,wt){let Rt=!1;for(let Lr=0,Ur=wt.length;Lr<Ur;Lr++){const Ur=wt[Lr];for(let wt=0,Lr=Ur.length;wt<Lr-1;wt++){if(Ve(ze,Ur[wt],Ur[wt+1]))return!1;(sr=Ur[wt])[1]>(Xt=ze)[1]!=(Dr=Ur[wt+1])[1]>Xt[1]&&Xt[0]<(Dr[0]-sr[0])*(Xt[1]-sr[1])/(Dr[1]-sr[1])+sr[0]&&(Rt=!Rt)}}var Xt,sr,Dr;return Rt}function Fe(ze,wt){for(let Rt=0;Rt<wt.length;Rt++)if(Le(ze,wt[Rt]))return!0;return!1}function Re(ze,wt,Rt,Xt){const sr=Xt[0]-Rt[0],Dr=Xt[1]-Rt[1],Lr=(ze[0]-Rt[0])*Dr-sr*(ze[1]-Rt[1]),Ur=(wt[0]-Rt[0])*Dr-sr*(wt[1]-Rt[1]);return Lr>0&&Ur<0||Lr<0&&Ur>0}function Ue(ze,wt,Rt){for(const ri of Rt)for(let Rt=0;Rt<ri.length-1;++Rt)if(0!=(Ur=[(Lr=ri[Rt+1])[0]-(Dr=ri[Rt])[0],Lr[1]-Dr[1]])[0]*(qr=[(sr=wt)[0]-(Xt=ze)[0],sr[1]-Xt[1]])[1]-Ur[1]*qr[0]&&Re(Xt,sr,Dr,Lr)&&Re(Dr,Lr,Xt,sr))return!0;var Xt,sr,Dr,Lr,Ur,qr;return!1}function $e(ze,wt){for(let Rt=0;Rt<ze.length;++Rt)if(!Le(ze[Rt],wt))return!1;for(let Rt=0;Rt<ze.length-1;++Rt)if(Ue(ze[Rt],ze[Rt+1],wt))return!1;return!0}function Oe(ze,wt){for(let Rt=0;Rt<wt.length;Rt++)if($e(ze,wt[Rt]))return!0;return!1}function qe(ze,wt,Rt){const Xt=[];for(let sr=0;sr<ze.length;sr++){const Dr=[];for(let Xt=0;Xt<ze[sr].length;Xt++){const Lr=De(ze[sr][Xt],Rt);Ce(wt,Lr),Dr.push(Lr)}Xt.push(Dr)}return Xt}function Ne(ze,wt,Rt){const Xt=[];for(let sr=0;sr<ze.length;sr++){const Dr=qe(ze[sr],wt,Rt);Xt.push(Dr)}return Xt}function je(ze,wt,Rt,Xt){if(ze[0]<Rt[0]||ze[0]>Rt[2]){const wt=.5*Xt;let sr=ze[0]-Rt[0]>wt?-Xt:Rt[0]-ze[0]>wt?Xt:0;0===sr&&(sr=ze[0]-Rt[2]>wt?-Xt:Rt[2]-ze[0]>wt?Xt:0),ze[0]+=sr}Ce(wt,ze)}function Ge(ze,wt,Rt,Xt){const sr=Math.pow(2,Xt.z)*Bc,Dr=[Xt.x*Bc,Xt.y*Bc],Lr=[];for(const Xt of ze)for(const ze of Xt){const Xt=[ze.x+Dr[0],ze.y+Dr[1]];je(Xt,wt,Rt,sr),Lr.push(Xt)}return Lr}function Ze(ze,wt,Rt,Xt){const sr=Math.pow(2,Xt.z)*Bc,Dr=[Xt.x*Bc,Xt.y*Bc],Lr=[];for(const Rt of ze){const ze=[];for(const Xt of Rt){const Rt=[Xt.x+Dr[0],Xt.y+Dr[1]];Ce(wt,Rt),ze.push(Rt)}Lr.push(ze)}if(wt[2]-wt[0]<=sr/2){(Ur=wt)[0]=Ur[1]=1/0,Ur[2]=Ur[3]=-1/0;for(const ze of Lr)for(const Xt of ze)je(Xt,wt,Rt,sr)}var Ur;return Lr}class Xe{constructor(ze,wt){this.type=Ll,this.geojson=ze,this.geometries=wt}static parse(ze,wt){if(2!==ze.length)return wt.error(`'within' expression requires exactly one argument, but found ${ze.length-1} instead.`);if(me(ze[1])){const wt=ze[1];if("FeatureCollection"===wt.type)for(let ze=0;ze<wt.features.length;++ze){const Rt=wt.features[ze].geometry.type;if("Polygon"===Rt||"MultiPolygon"===Rt)return new Xe(wt,wt.features[ze].geometry)}else if("Feature"===wt.type){const ze=wt.geometry.type;if("Polygon"===ze||"MultiPolygon"===ze)return new Xe(wt,wt.geometry)}else if("Polygon"===wt.type||"MultiPolygon"===wt.type)return new Xe(wt,wt)}return wt.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(ze){if(null!=ze.geometry()&&null!=ze.canonicalID()){if("Point"===ze.geometryType())return function(ze,wt){const Rt=[1/0,1/0,-1/0,-1/0],Xt=[1/0,1/0,-1/0,-1/0],sr=ze.canonicalID();if("Polygon"===wt.type){const Dr=qe(wt.coordinates,Xt,sr),Lr=Ge(ze.geometry(),Rt,Xt,sr);if(!Pe(Rt,Xt))return!1;for(const ze of Lr)if(!Le(ze,Dr))return!1}if("MultiPolygon"===wt.type){const Dr=Ne(wt.coordinates,Xt,sr),Lr=Ge(ze.geometry(),Rt,Xt,sr);if(!Pe(Rt,Xt))return!1;for(const ze of Lr)if(!Fe(ze,Dr))return!1}return!0}(ze,this.geometries);if("LineString"===ze.geometryType())return function(ze,wt){const Rt=[1/0,1/0,-1/0,-1/0],Xt=[1/0,1/0,-1/0,-1/0],sr=ze.canonicalID();if("Polygon"===wt.type){const Dr=qe(wt.coordinates,Xt,sr),Lr=Ze(ze.geometry(),Rt,Xt,sr);if(!Pe(Rt,Xt))return!1;for(const ze of Lr)if(!$e(ze,Dr))return!1}if("MultiPolygon"===wt.type){const Dr=Ne(wt.coordinates,Xt,sr),Lr=Ze(ze.geometry(),Rt,Xt,sr);if(!Pe(Rt,Xt))return!1;for(const ze of Lr)if(!Oe(ze,Dr))return!1}return!0}(ze,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Ke(ze){if(ze instanceof Me){if("get"===ze.name&&1===ze.args.length)return!1;if("feature-state"===ze.name)return!1;if("has"===ze.name&&1===ze.args.length)return!1;if("properties"===ze.name||"geometry-type"===ze.name||"id"===ze.name)return!1;if(/^filter-/.test(ze.name))return!1}if(ze instanceof Xe)return!1;let wt=!0;return ze.eachChild(ze=>{wt&&!Ke(ze)&&(wt=!1)}),wt}function He(ze){if(ze instanceof Me&&"feature-state"===ze.name)return!1;let wt=!0;return ze.eachChild(ze=>{wt&&!He(ze)&&(wt=!1)}),wt}function Ye(ze,wt){if(ze instanceof Me&&wt.indexOf(ze.name)>=0)return!1;let Rt=!0;return ze.eachChild(ze=>{Rt&&!Ye(ze,wt)&&(Rt=!1)}),Rt}class Je{constructor(ze,wt){this.type=wt.type,this.name=ze,this.boundExpression=wt}static parse(ze,wt){if(2!==ze.length||"string"!=typeof ze[1])return wt.error("'var' expression requires exactly one string literal argument.");const Rt=ze[1];return wt.scope.has(Rt)?new Je(Rt,wt.scope.get(Rt)):wt.error(`Unknown variable "${Rt}". Make sure "${Rt}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(ze){return this.boundExpression.evaluate(ze)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class We{constructor(ze,wt=[],Rt,Xt=new Gt,sr=[]){this.registry=ze,this.path=wt,this.key=wt.map(ze=>`[${ze}]`).join(""),this.scope=Xt,this.errors=sr,this.expectedType=Rt}parse(ze,wt,Rt,Xt,sr={}){return wt?this.concat(wt,Rt,Xt)._parse(ze,sr):this._parse(ze,sr)}_parse(ze,wt){function r(ze,wt,Rt){return"assert"===Rt?new _e(wt,[ze]):"coerce"===Rt?new Ie(wt,[ze]):ze}if(null!==ze&&"string"!=typeof ze&&"boolean"!=typeof ze&&"number"!=typeof ze||(ze=["literal",ze]),Array.isArray(ze)){if(0===ze.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Rt=ze[0];if("string"!=typeof Rt)return this.error(`Expression name must be a string, but found ${typeof Rt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Xt=this.registry[Rt];if(Xt){let Rt=Xt.parse(ze,this);if(!Rt)return null;if(this.expectedType){const ze=this.expectedType,Xt=Rt.type;if("string"!==ze.kind&&"number"!==ze.kind&&"boolean"!==ze.kind&&"object"!==ze.kind&&"array"!==ze.kind||"value"!==Xt.kind)if("color"!==ze.kind&&"formatted"!==ze.kind&&"resolvedImage"!==ze.kind||"value"!==Xt.kind&&"string"!==Xt.kind){if(this.checkSubtype(ze,Xt))return null}else Rt=r(Rt,ze,wt.typeAnnotation||"coerce");else Rt=r(Rt,ze,wt.typeAnnotation||"assert")}if(!(Rt instanceof ve)&&"resolvedImage"!==Rt.type.kind&&Qe(Rt)){const wt=new Te;try{Rt=new ve(Rt.type,Rt.evaluate(wt))}catch(ze){return this.error(ze.message),null}}return Rt}return this.error(`Unknown expression "${Rt}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===ze?"'undefined' value invalid. Use null instead.":"object"==typeof ze?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof ze} instead.`)}concat(ze,wt,Rt){const Xt="number"==typeof ze?this.path.concat(ze):this.path,sr=Rt?this.scope.concat(Rt):this.scope;return new We(this.registry,Xt,wt||null,sr,this.errors)}error(ze,...wt){const Rt=`${this.key}${wt.map(ze=>`[${ze}]`).join("")}`;this.errors.push(new jt(Rt,ze))}checkSubtype(ze,wt){const Rt=se(ze,wt);return Rt&&this.error(Rt),Rt}}function Qe(ze){if(ze instanceof Je)return Qe(ze.boundExpression);if(ze instanceof Me&&"error"===ze.name)return!1;if(ze instanceof Ee)return!1;if(ze instanceof Xe)return!1;const wt=ze instanceof Ie||ze instanceof _e;let Rt=!0;return ze.eachChild(ze=>{Rt=wt?Rt&&Qe(ze):Rt&&ze instanceof ve}),!!Rt&&Ke(ze)&&Ye(ze,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"])}function tr(ze,wt){const Rt=ze.length-1;let Xt,sr,Dr=0,Lr=Rt,Ur=0;for(;Dr<=Lr;)if(Ur=Math.floor((Dr+Lr)/2),Xt=ze[Ur],sr=ze[Ur+1],Xt<=wt){if(Ur===Rt||wt<sr)return Ur;Dr=Ur+1}else{if(!(Xt>wt))throw new be("Input is not a number.");Lr=Ur-1}return 0}class er{constructor(ze,wt,Rt){this.type=ze,this.input=wt,this.labels=[],this.outputs=[];for(const[ze,wt]of Rt)this.labels.push(ze),this.outputs.push(wt)}static parse(ze,wt){if(ze.length-1<4)return wt.error(`Expected at least 4 arguments, but found only ${ze.length-1}.`);if((ze.length-1)%2!=0)return wt.error("Expected an even number of arguments.");const Rt=wt.parse(ze[1],1,Ol);if(!Rt)return null;const Xt=[];let sr=null;wt.expectedType&&"value"!==wt.expectedType.kind&&(sr=wt.expectedType);for(let Rt=1;Rt<ze.length;Rt+=2){const Dr=1===Rt?-1/0:ze[Rt],Lr=ze[Rt+1],Ur=Rt,qr=Rt+1;if("number"!=typeof Dr)return wt.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ur);if(Xt.length&&Xt[Xt.length-1][0]>=Dr)return wt.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ur);const ri=wt.parse(Lr,qr,sr);if(!ri)return null;sr=sr||ri.type,Xt.push([Dr,ri])}return new er(sr,Rt,Xt)}evaluate(ze){const wt=this.labels,Rt=this.outputs;if(1===wt.length)return Rt[0].evaluate(ze);const Xt=this.input.evaluate(ze);if(Xt<=wt[0])return Rt[0].evaluate(ze);const sr=wt.length;return Xt>=wt[sr-1]?Rt[sr-1].evaluate(ze):Rt[tr(wt,Xt)].evaluate(ze)}eachChild(ze){ze(this.input);for(const wt of this.outputs)ze(wt)}outputDefined(){return this.outputs.every(ze=>ze.outputDefined())}serialize(){const ze=["step",this.input.serialize()];for(let wt=0;wt<this.labels.length;wt++)wt>0&&ze.push(this.labels[wt]),ze.push(this.outputs[wt].serialize());return ze}}function rr(ze,wt,Rt){return ze*(1-Rt)+wt*Rt}var Vc=Object.freeze({__proto__:null,number:rr,color:function(ze,wt,Rt){return new ce(rr(ze.r,wt.r,Rt),rr(ze.g,wt.g,Rt),rr(ze.b,wt.b,Rt),rr(ze.a,wt.a,Rt))},array:function(ze,wt,Rt){return ze.map((ze,Xt)=>rr(ze,wt[Xt],Rt))}});const Hc=.95047,Kc=1.08883,iu=4/29,nu=6/29,ou=3*nu*nu,au=Math.PI/180,su=180/Math.PI;function hr(ze){return ze>.008856451679035631?Math.pow(ze,1/3):ze/ou+iu}function pr(ze){return ze>nu?ze*ze*ze:ou*(ze-iu)}function dr(ze){return 255*(ze<=.0031308?12.92*ze:1.055*Math.pow(ze,1/2.4)-.055)}function fr(ze){return(ze/=255)<=.04045?ze/12.92:Math.pow((ze+.055)/1.055,2.4)}function yr(ze){const wt=fr(ze.r),Rt=fr(ze.g),Xt=fr(ze.b),sr=hr((.4124564*wt+.3575761*Rt+.1804375*Xt)/Hc),Dr=hr((.2126729*wt+.7151522*Rt+.072175*Xt)/1);return{l:116*Dr-16,a:500*(sr-Dr),b:200*(Dr-hr((.0193339*wt+.119192*Rt+.9503041*Xt)/Kc)),alpha:ze.a}}function mr(ze){let wt=(ze.l+16)/116,Rt=isNaN(ze.a)?wt:wt+ze.a/500,Xt=isNaN(ze.b)?wt:wt-ze.b/200;return wt=1*pr(wt),Rt=Hc*pr(Rt),Xt=Kc*pr(Xt),new ce(dr(3.2404542*Rt-1.5371385*wt-.4985314*Xt),dr(-.969266*Rt+1.8760108*wt+.041556*Xt),dr(.0556434*Rt-.2040259*wt+1.0572252*Xt),ze.alpha)}function gr(ze,wt,Rt){const Xt=wt-ze;return ze+Rt*(Xt>180||Xt<-180?Xt-360*Math.round(Xt/360):Xt)}const lu={forward:yr,reverse:mr,interpolate:function(ze,wt,Rt){return{l:rr(ze.l,wt.l,Rt),a:rr(ze.a,wt.a,Rt),b:rr(ze.b,wt.b,Rt),alpha:rr(ze.alpha,wt.alpha,Rt)}}},cu={forward:function(ze){const{l:wt,a:Rt,b:Xt}=yr(ze),sr=Math.atan2(Xt,Rt)*su;return{h:sr<0?sr+360:sr,c:Math.sqrt(Rt*Rt+Xt*Xt),l:wt,alpha:ze.a}},reverse:function(ze){const wt=ze.h*au,Rt=ze.c;return mr({l:ze.l,a:Math.cos(wt)*Rt,b:Math.sin(wt)*Rt,alpha:ze.alpha})},interpolate:function(ze,wt,Rt){return{h:gr(ze.h,wt.h,Rt),c:rr(ze.c,wt.c,Rt),l:rr(ze.l,wt.l,Rt),alpha:rr(ze.alpha,wt.alpha,Rt)}}};var hu=Object.freeze({__proto__:null,lab:lu,hcl:cu});class wr{constructor(ze,wt,Rt,Xt,sr){this.type=ze,this.operator=wt,this.interpolation=Rt,this.input=Xt,this.labels=[],this.outputs=[];for(const[ze,wt]of sr)this.labels.push(ze),this.outputs.push(wt)}static interpolationFactor(ze,wt,Xt,sr){let Dr=0;if("exponential"===ze.name)Dr=_r(wt,ze.base,Xt,sr);else if("linear"===ze.name)Dr=_r(wt,1,Xt,sr);else if("cubic-bezier"===ze.name){const Lr=ze.controlPoints;Dr=new Rt(Lr[0],Lr[1],Lr[2],Lr[3]).solve(_r(wt,1,Xt,sr))}return Dr}static parse(ze,wt){let[Rt,Xt,sr,...Dr]=ze;if(!Array.isArray(Xt)||0===Xt.length)return wt.error("Expected an interpolation type expression.",1);if("linear"===Xt[0])Xt={name:"linear"};else if("exponential"===Xt[0]){const ze=Xt[1];if("number"!=typeof ze)return wt.error("Exponential interpolation requires a numeric base.",1,1);Xt={name:"exponential",base:ze}}else{if("cubic-bezier"!==Xt[0])return wt.error(`Unknown interpolation type ${String(Xt[0])}`,1,0);{const ze=Xt.slice(1);if(4!==ze.length||ze.some(ze=>"number"!=typeof ze||ze<0||ze>1))return wt.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Xt={name:"cubic-bezier",controlPoints:ze}}}if(ze.length-1<4)return wt.error(`Expected at least 4 arguments, but found only ${ze.length-1}.`);if((ze.length-1)%2!=0)return wt.error("Expected an even number of arguments.");if(sr=wt.parse(sr,2,Ol),!sr)return null;const Lr=[];let Ur=null;"interpolate-hcl"===Rt||"interpolate-lab"===Rt?Ur=Fl:wt.expectedType&&"value"!==wt.expectedType.kind&&(Ur=wt.expectedType);for(let ze=0;ze<Dr.length;ze+=2){const Rt=Dr[ze],Xt=Dr[ze+1],sr=ze+3,qr=ze+4;if("number"!=typeof Rt)return wt.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',sr);if(Lr.length&&Lr[Lr.length-1][0]>=Rt)return wt.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',sr);const ri=wt.parse(Xt,qr,Ur);if(!ri)return null;Ur=Ur||ri.type,Lr.push([Rt,ri])}return"number"===Ur.kind||"color"===Ur.kind||"array"===Ur.kind&&"number"===Ur.itemType.kind&&"number"==typeof Ur.N?new wr(Ur,Rt,Xt,sr,Lr):wt.error(`Type ${ne(Ur)} is not interpolatable.`)}evaluate(ze){const wt=this.labels,Rt=this.outputs;if(1===wt.length)return Rt[0].evaluate(ze);const Xt=this.input.evaluate(ze);if(Xt<=wt[0])return Rt[0].evaluate(ze);const sr=wt.length;if(Xt>
vendor: 21,456 bytes, line 20
20=wt[sr-1])return Rt[sr-1].evaluate(ze);const Dr=tr(wt,Xt),Lr=wr.interpolationFactor(this.interpolation,Xt,wt[Dr],wt[Dr+1]),Ur=Rt[Dr].evaluate(ze),qr=Rt[Dr+1].evaluate(ze);return"interpolate"===this.operator?Vc[this.type.kind.toLowerCase()](Ur,qr,Lr):"interpolate-hcl"===this.operator?cu.reverse(cu.interpolate(cu.forward(Ur),cu.forward(qr),Lr)):lu.reverse(lu.interpolate(lu.forward(Ur),lu.forward(qr),Lr))}eachChild(ze){ze(this.input);for(const wt of this.outputs)ze(wt)}outputDefined(){return this.outputs.every(ze=>ze.outputDefined())}serialize(){let ze;ze="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const wt=[this.operator,ze,this.input.serialize()];for(let ze=0;ze<this.labels.length;ze++)wt.push(this.labels[ze],this.outputs[ze].serialize());return wt}}function _r(ze,wt,Rt,Xt){const sr=Xt-Rt,Dr=ze-Rt;return 0===sr?0:1===wt?Dr/sr:(Math.pow(wt,Dr)-1)/(Math.pow(wt,sr)-1)}class kr{constructor(ze,wt){this.type=ze,this.args=wt}static parse(ze,wt){if(ze.length<2)return wt.error("Expectected at least one argument.");let Rt=null;const Xt=wt.expectedType;Xt&&"value"!==Xt.kind&&(Rt=Xt);const sr=[];for(const Xt of ze.slice(1)){const ze=wt.parse(Xt,1+sr.length,Rt,void 0,{typeAnnotation:"omit"});if(!ze)return null;Rt=Rt||ze.type,sr.push(ze)}const Dr=Xt&&sr.some(ze=>se(Xt,ze.type));return new kr(Dr?Gl:Rt,sr)}evaluate(ze){let wt,Rt=null,Xt=0;for(const sr of this.args)if(Xt++,Rt=sr.evaluate(ze),Rt&&Rt instanceof fe&&!Rt.available&&(wt||(wt=Rt.name),Rt=null,Xt===this.args.length&&(Rt=wt)),null!==Rt)break;return Rt}eachChild(ze){this.args.forEach(ze)}outputDefined(){return this.args.every(ze=>ze.outputDefined())}serialize(){const ze=["coalesce"];return this.eachChild(wt=>{ze.push(wt.serialize())}),ze}}class Ar{constructor(ze,wt){this.type=wt.type,this.bindings=[].concat(ze),this.result=wt}evaluate(ze){return this.result.evaluate(ze)}eachChild(ze){for(const wt of this.bindings)ze(wt[1]);ze(this.result)}static parse(ze,wt){if(ze.length<4)return wt.error(`Expected at least 3 arguments, but found ${ze.length-1} instead.`);const Rt=[];for(let Xt=1;Xt<ze.length-1;Xt+=2){const sr=ze[Xt];if("string"!=typeof sr)return wt.error(`Expected string, but found ${typeof sr} instead.`,Xt);if(/[^a-zA-Z0-9_]/.test(sr))return wt.error("Variable names must contain only alphanumeric characters or '_'.",Xt);const Dr=wt.parse(ze[Xt+1],Xt+1);if(!Dr)return null;Rt.push([sr,Dr])}const Xt=wt.parse(ze[ze.length-1],ze.length-1,wt.expectedType,Rt);return Xt?new Ar(Rt,Xt):null}outputDefined(){return this.result.outputDefined()}serialize(){const ze=["let"];for(const[wt,Rt]of this.bindings)ze.push(wt,Rt.serialize());return ze.push(this.result.serialize()),ze}}class Sr{constructor(ze,wt,Rt){this.type=ze,this.index=wt,this.input=Rt}static parse(ze,wt){if(3!==ze.length)return wt.error(`Expected 2 arguments, but found ${ze.length-1} instead.`);const Rt=wt.parse(ze[1],1,Ol),Xt=wt.parse(ze[2],2,re(wt.expectedType||Gl));return Rt&&Xt?new Sr(Xt.type.itemType,Rt,Xt):null}evaluate(ze){const wt=this.index.evaluate(ze),Rt=this.input.evaluate(ze);if(wt<0)throw new be(`Array index out of bounds: ${wt} < 0.`);if(wt>=Rt.length)throw new be(`Array index out of bounds: ${wt} > ${Rt.length-1}.`);if(wt!==Math.floor(wt))throw new be(`Array index must be an integer, but found ${wt} instead.`);return Rt[wt]}eachChild(ze){ze(this.index),ze(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Ir{constructor(ze,wt){this.type=Ll,this.needle=ze,this.haystack=wt}static parse(ze,wt){if(3!==ze.length)return wt.error(`Expected 2 arguments, but found ${ze.length-1} instead.`);const Rt=wt.parse(ze[1],1,Gl),Xt=wt.parse(ze[2],2,Gl);return Rt&&Xt?ae(Rt.type,[Ll,Dl,Ol,Cl,Gl])?new Ir(Rt,Xt):wt.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(Rt.type)} instead`):null}evaluate(ze){const wt=this.needle.evaluate(ze),Rt=this.haystack.evaluate(ze);if(!Rt)return!1;if(!oe(wt,["boolean","string","number","null"]))throw new be(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ge(wt))} instead.`);if(!oe(Rt,["string","array"]))throw new be(`Expected second argument to be of type array or string, but found ${ne(ge(Rt))} instead.`);return Rt.indexOf(wt)>=0}eachChild(ze){ze(this.needle),ze(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class zr{constructor(ze,wt,Rt){this.type=Ol,this.needle=ze,this.haystack=wt,this.fromIndex=Rt}static parse(ze,wt){if(ze.length<=2||ze.length>=5)return wt.error(`Expected 3 or 4 arguments, but found ${ze.length-1} instead.`);const Rt=wt.parse(ze[1],1,Gl),Xt=wt.parse(ze[2],2,Gl);if(!Rt||!Xt)return null;if(!ae(Rt.type,[Ll,Dl,Ol,Cl,Gl]))return wt.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(Rt.type)} instead`);if(4===ze.length){const sr=wt.parse(ze[3],3,Ol);return sr?new zr(Rt,Xt,sr):null}return new zr(Rt,Xt)}evaluate(ze){const wt=this.needle.evaluate(ze),Rt=this.haystack.evaluate(ze);if(!oe(wt,["boolean","string","number","null"]))throw new be(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ge(wt))} instead.`);if(!oe(Rt,["string","array"]))throw new be(`Expected second argument to be of type array or string, but found ${ne(ge(Rt))} instead.`);if(this.fromIndex){const Xt=this.fromIndex.evaluate(ze);return Rt.indexOf(wt,Xt)}return Rt.indexOf(wt)}eachChild(ze){ze(this.needle),ze(this.haystack),this.fromIndex&&ze(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const ze=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),ze]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Tr{constructor(ze,wt,Rt,Xt,sr,Dr){this.inputType=ze,this.type=wt,this.input=Rt,this.cases=Xt,this.outputs=sr,this.otherwise=Dr}static parse(ze,wt){if(ze.length<5)return wt.error(`Expected at least 4 arguments, but found only ${ze.length-1}.`);if(ze.length%2!=1)return wt.error("Expected an even number of arguments.");let Rt,Xt;wt.expectedType&&"value"!==wt.expectedType.kind&&(Xt=wt.expectedType);const sr={},Dr=[];for(let Lr=2;Lr<ze.length-1;Lr+=2){let Ur=ze[Lr];const qr=ze[Lr+1];Array.isArray(Ur)||(Ur=[Ur]);const ri=wt.concat(Lr);if(0===Ur.length)return ri.error("Expected at least one branch label.");for(const ze of Ur){if("number"!=typeof ze&&"string"!=typeof ze)return ri.error("Branch labels must be numbers or strings.");if("number"==typeof ze&&Math.abs(ze)>Number.MAX_SAFE_INTEGER)return ri.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof ze&&Math.floor(ze)!==ze)return ri.error("Numeric branch labels must be integer values.");if(Rt){if(ri.checkSubtype(Rt,ge(ze)))return null}else Rt=ge(ze);if(void 0!==sr[String(ze)])return ri.error("Branch labels must be unique.");sr[String(ze)]=Dr.length}const ai=wt.parse(qr,Lr,Xt);if(!ai)return null;Xt=Xt||ai.type,Dr.push(ai)}const Lr=wt.parse(ze[1],1,Gl);if(!Lr)return null;const Ur=wt.parse(ze[ze.length-1],ze.length-1,Xt);return Ur?"value"!==Lr.type.kind&&wt.concat(1).checkSubtype(Rt,Lr.type)?null:new Tr(Rt,Xt,Lr,sr,Dr,Ur):null}evaluate(ze){const wt=this.input.evaluate(ze);return(ge(wt)===this.inputType&&this.outputs[this.cases[wt]]||this.otherwise).evaluate(ze)}eachChild(ze){ze(this.input),this.outputs.forEach(ze),ze(this.otherwise)}outputDefined(){return this.outputs.every(ze=>ze.outputDefined())&&this.otherwise.outputDefined()}serialize(){const ze=["match",this.input.serialize()],wt=Object.keys(this.cases).sort(),Rt=[],Xt={};for(const ze of wt){const wt=Xt[this.cases[ze]];void 0===wt?(Xt[this.cases[ze]]=Rt.length,Rt.push([this.cases[ze],[ze]])):Rt[wt][1].push(ze)}const i=ze=>"number"===this.inputType.kind?Number(ze):ze;for(const[wt,Xt]of Rt)ze.push(1===Xt.length?i(Xt[0]):Xt.map(i)),ze.push(this.outputs[wt].serialize());return ze.push(this.otherwise.serialize()),ze}}class Mr{constructor(ze,wt,Rt){this.type=ze,this.branches=wt,this.otherwise=Rt}static parse(ze,wt){if(ze.length<4)return wt.error(`Expected at least 3 arguments, but found only ${ze.length-1}.`);if(ze.length%2!=0)return wt.error("Expected an odd number of arguments.");let Rt;wt.expectedType&&"value"!==wt.expectedType.kind&&(Rt=wt.expectedType);const Xt=[];for(let sr=1;sr<ze.length-1;sr+=2){const Dr=wt.parse(ze[sr],sr,Ll);if(!Dr)return null;const Lr=wt.parse(ze[sr+1],sr+1,Rt);if(!Lr)return null;Xt.push([Dr,Lr]),Rt=Rt||Lr.type}const sr=wt.parse(ze[ze.length-1],ze.length-1,Rt);return sr?new Mr(Rt,Xt,sr):null}evaluate(ze){for(const[wt,Rt]of this.branches)if(wt.evaluate(ze))return Rt.evaluate(ze);return this.otherwise.evaluate(ze)}eachChild(ze){for(const[wt,Rt]of this.branches)ze(wt),ze(Rt);ze(this.otherwise)}outputDefined(){return this.branches.every(([ze,wt])=>wt.outputDefined())&&this.otherwise.outputDefined()}serialize(){const ze=["case"];return this.eachChild(wt=>{ze.push(wt.serialize())}),ze}}class Er{constructor(ze,wt,Rt,Xt){this.type=ze,this.input=wt,this.beginIndex=Rt,this.endIndex=Xt}static parse(ze,wt){if(ze.length<=2||ze.length>=5)return wt.error(`Expected 3 or 4 arguments, but found ${ze.length-1} instead.`);const Rt=wt.parse(ze[1],1,Gl),Xt=wt.parse(ze[2],2,Ol);if(!Rt||!Xt)return null;if(!ae(Rt.type,[re(Gl),Dl,Gl]))return wt.error(`Expected first argument to be of type array or string, but found ${ne(Rt.type)} instead`);if(4===ze.length){const sr=wt.parse(ze[3],3,Ol);return sr?new Er(Rt.type,Rt,Xt,sr):null}return new Er(Rt.type,Rt,Xt)}evaluate(ze){const wt=this.input.evaluate(ze),Rt=this.beginIndex.evaluate(ze);if(!oe(wt,["string","array"]))throw new be(`Expected first argument to be of type array or string, but found ${ne(ge(wt))} instead.`);if(this.endIndex){const Xt=this.endIndex.evaluate(ze);return wt.slice(Rt,Xt)}return wt.slice(Rt)}eachChild(ze){ze(this.input),ze(this.beginIndex),this.endIndex&&ze(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const ze=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),ze]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Br(ze,wt){return"=="===ze||"!="===ze?"boolean"===wt.kind||"string"===wt.kind||"number"===wt.kind||"null"===wt.kind||"value"===wt.kind:"string"===wt.kind||"number"===wt.kind||"value"===wt.kind}function Cr(ze,wt,Rt,Xt){return 0===Xt.compare(wt,Rt)}function Pr(ze,wt,Rt){const Xt="=="!==ze&&"!="!==ze;return class i{constructor(ze,wt,Rt){this.type=Ll,this.lhs=ze,this.rhs=wt,this.collator=Rt,this.hasUntypedArgument="value"===ze.type.kind||"value"===wt.type.kind}static parse(ze,wt){if(3!==ze.length&&4!==ze.length)return wt.error("Expected two or three arguments.");const Rt=ze[0];let sr=wt.parse(ze[1],1,Gl);if(!sr)return null;if(!Br(Rt,sr.type))return wt.concat(1).error(`"${Rt}" comparisons are not supported for type '${ne(sr.type)}'.`);let Dr=wt.parse(ze[2],2,Gl);if(!Dr)return null;if(!Br(Rt,Dr.type))return wt.concat(2).error(`"${Rt}" comparisons are not supported for type '${ne(Dr.type)}'.`);if(sr.type.kind!==Dr.type.kind&&"value"!==sr.type.kind&&"value"!==Dr.type.kind)return wt.error(`Cannot compare types '${ne(sr.type)}' and '${ne(Dr.type)}'.`);Xt&&("value"===sr.type.kind&&"value"!==Dr.type.kind?sr=new _e(Dr.type,[sr]):"value"!==sr.type.kind&&"value"===Dr.type.kind&&(Dr=new _e(sr.type,[Dr])));let Lr=null;if(4===ze.length){if("string"!==sr.type.kind&&"string"!==Dr.type.kind&&"value"!==sr.type.kind&&"value"!==Dr.type.kind)return wt.error("Cannot use collator to compare non-string types.");if(Lr=wt.parse(ze[3],3,Zl),!Lr)return null}return new i(sr,Dr,Lr)}evaluate(sr){const Dr=this.lhs.evaluate(sr),Lr=this.rhs.evaluate(sr);if(Xt&&this.hasUntypedArgument){const wt=ge(Dr),Rt=ge(Lr);if(wt.kind!==Rt.kind||"string"!==wt.kind&&"number"!==wt.kind)throw new be(`Expected arguments for "${ze}" to be (string, string) or (number, number), but found (${wt.kind}, ${Rt.kind}) instead.`)}if(this.collator&&!Xt&&this.hasUntypedArgument){const ze=ge(Dr),Rt=ge(Lr);if("string"!==ze.kind||"string"!==Rt.kind)return wt(sr,Dr,Lr)}return this.collator?Rt(sr,Dr,Lr,this.collator.evaluate(sr)):wt(sr,Dr,Lr)}eachChild(ze){ze(this.lhs),ze(this.rhs),this.collator&&ze(this.collator)}outputDefined(){return!0}serialize(){const wt=[ze];return this.eachChild(ze=>{wt.push(ze.serialize())}),wt}}}const pu=Pr("==",function(ze,wt,Rt){return wt===Rt},Cr),fu=Pr("!=",function(ze,wt,Rt){return wt!==Rt},function(ze,wt,Rt,Xt){return!Cr(0,wt,Rt,Xt)}),mu=Pr("<",function(ze,wt,Rt){return wt<Rt},function(ze,wt,Rt,Xt){return Xt.compare(wt,Rt)<0}),gu=Pr(">",function(ze,wt,Rt){return wt>Rt},function(ze,wt,Rt,Xt){return Xt.compare(wt,Rt)>0}),yu=Pr("<=",function(ze,wt,Rt){return wt<=Rt},function(ze,wt,Rt,Xt){return Xt.compare(wt,Rt)<=0}),bu=Pr(">=",function(ze,wt,Rt){return wt>=Rt},function(ze,wt,Rt,Xt){return Xt.compare(wt,Rt)>=0});class $r{constructor(ze,wt,Rt,Xt,sr){this.type=Dl,this.number=ze,this.locale=wt,this.currency=Rt,this.minFractionDigits=Xt,this.maxFractionDigits=sr}static parse(ze,wt){if(3!==ze.length)return wt.error("Expected two arguments.");const Rt=wt.parse(ze[1],1,Ol);if(!Rt)return null;const Xt=ze[2];if("object"!=typeof Xt||Array.isArray(Xt))return wt.error("NumberFormat options argument must be an object.");let sr=null;if(Xt.locale&&(sr=wt.parse(Xt.locale,1,Dl),!sr))return null;let Dr=null;if(Xt.currency&&(Dr=wt.parse(Xt.currency,1,Dl),!Dr))return null;let Lr=null;if(Xt["min-fraction-digits"]&&(Lr=wt.parse(Xt["min-fraction-digits"],1,Ol),!Lr))return null;let Ur=null;return Xt["max-fraction-digits"]&&(Ur=wt.parse(Xt["max-fraction-digits"],1,Ol),!Ur)?null:new $r(Rt,sr,Dr,Lr,Ur)}evaluate(ze){return new Intl.NumberFormat(this.locale?this.locale.evaluate(ze):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(ze):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(ze):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(ze):void 0}).format(this.number.evaluate(ze))}eachChild(ze){ze(this.number),this.locale&&ze(this.locale),this.currency&&ze(this.currency),this.minFractionDigits&&ze(this.minFractionDigits),this.maxFractionDigits&&ze(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const ze={};return this.locale&&(ze.locale=this.locale.serialize()),this.currency&&(ze.currency=this.currency.serialize()),this.minFractionDigits&&(ze["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(ze["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),ze]}}class Or{constructor(ze){this.type=Ol,this.input=ze}static parse(ze,wt){if(2!==ze.length)return wt.error(`Expected 1 argument, but found ${ze.length-1} instead.`);const Rt=wt.parse(ze[1],1);return Rt?"array"!==Rt.type.kind&&"string"!==Rt.type.kind&&"value"!==Rt.type.kind?wt.error(`Expected argument of type string or array, but found ${ne(Rt.type)} instead.`):new Or(Rt):null}evaluate(ze){const wt=this.input.evaluate(ze);if("string"==typeof wt)return wt.length;if(Array.isArray(wt))return wt.length;throw new be(`Expected value to be of type string or array, but found ${ne(ge(wt))} instead.`)}eachChild(ze){ze(this.input)}outputDefined(){return!1}serialize(){const ze=["length"];return this.eachChild(wt=>{ze.push(wt.serialize())}),ze}}const vu={"==":pu,"!=":fu,">":gu,"<":mu,">=":bu,"<=":yu,array:_e,at:Sr,boolean:_e,case:Mr,coalesce:kr,collator:Ee,format:ke,image:Ae,in:Ir,"index-of":zr,interpolate:wr,"interpolate-hcl":wr,"interpolate-lab":wr,length:Or,let:Ar,literal:ve,match:Tr,number:_e,"number-format":$r,object:_e,slice:Er,step:er,string:_e,"to-boolean":Ie,"to-color":Ie,"to-number":Ie,"to-string":Ie,var:Je,within:Xe};function Nr(ze,[wt,Rt,Xt,sr]){wt=wt.evaluate(ze),Rt=Rt.evaluate(ze),Xt=Xt.evaluate(ze);const Dr=sr?sr.evaluate(ze):1,Lr=ye(wt,Rt,Xt,Dr);if(Lr)throw new be(Lr);return new ce(wt/255*Dr,Rt/255*Dr,Xt/255*Dr,Dr)}function jr(ze,wt){return ze in wt}function Gr(ze,wt){const Rt=wt[ze];return void 0===Rt?null:Rt}function Zr(ze){return{type:ze}}function Xr(ze){return{result:"success",value:ze}}function Kr(ze){return{result:"error",value:ze}}function Hr(ze){return"data-driven"===ze["property-type"]||"cross-faded-data-driven"===ze["property-type"]}function Yr(ze){return!!ze.expression&&ze.expression.parameters.indexOf("zoom")>-1}function Jr(ze){return!!ze.expression&&ze.expression.interpolated}function Wr(ze){return ze instanceof Number?"number":ze instanceof String?"string":ze instanceof Boolean?"boolean":Array.isArray(ze)?"array":null===ze?"null":typeof ze}function Qr(ze){return"object"==typeof ze&&null!==ze&&!Array.isArray(ze)}function tn(ze){return ze}function en(ze,wt){const Rt="color"===wt.type,Xt=ze.stops&&"object"==typeof ze.stops[0][0],sr=Xt||!(Xt||void 0!==ze.property),Dr=ze.type||(Jr(wt)?"exponential":"interval");if(Rt&&((ze=Ot({},ze)).stops&&(ze.stops=ze.stops.map(ze=>[ze[0],ce.parse(ze[1])])),ze.default=ce.parse(ze.default?ze.default:wt.default)),ze.colorSpace&&"rgb"!==ze.colorSpace&&!hu[ze.colorSpace])throw new Error(`Unknown color space: ${ze.colorSpace}`);let Lr,Ur,qr;if("exponential"===Dr)Lr=an;else if("interval"===Dr)Lr=sn;else if("categorical"===Dr){Lr=nn,Ur=Object.create(null);for(const wt of ze.stops)Ur[wt[0]]=wt[1];qr=typeof ze.stops[0][0]}else{if("identity"!==Dr)throw new Error(`Unknown function type "${Dr}"`);Lr=on}if(Xt){const Rt={},Xt=[];for(let wt=0;wt<ze.stops.length;wt++){const sr=ze.stops[wt],Dr=sr[0].zoom;void 0===Rt[Dr]&&(Rt[Dr]={zoom:Dr,type:ze.type,property:ze.property,default:ze.default,stops:[]},Xt.push(Dr)),Rt[Dr].stops.push([sr[0].value,sr[1]])}const sr=[];for(const ze of Xt)sr.push([Rt[ze].zoom,en(Rt[ze],wt)]);const Dr={name:"linear"};return{kind:"composite",interpolationType:Dr,interpolationFactor:wr.interpolationFactor.bind(void 0,Dr),zoomStops:sr.map(ze=>ze[0]),evaluate:({zoom:Rt},Xt)=>an({stops:sr,base:ze.base},wt,Rt).evaluate(Rt,Xt)}}if(sr){const Rt="exponential"===Dr?{name:"exponential",base:void 0!==ze.base?ze.base:1}:null;return{kind:"camera",interpolationType:Rt,interpolationFactor:wr.interpolationFactor.bind(void 0,Rt),zoomStops:ze.stops.map(ze=>ze[0]),evaluate:({zoom:Rt})=>Lr(ze,wt,Rt,Ur,qr)}}return{kind:"source",evaluate(Rt,Xt){const sr=Xt&&Xt.properties?Xt.properties[ze.property]:void 0;return void 0===sr?rn(ze.default,wt.default):Lr(ze,wt,sr,Ur,qr)}}}function rn(ze,wt,Rt){return void 0!==ze?ze:void 0!==wt?wt:void 0!==Rt?Rt:void 0}function nn(ze,wt,Rt,Xt,sr){return rn(typeof Rt===sr?Xt[Rt]:void 0,ze.default,wt.default)}function sn(ze,wt,Rt){if("number"!==Wr(Rt))return rn(ze.default,wt.default);const Xt=ze.stops.length;if(1===Xt)return ze.stops[0][1];if(Rt<=ze.stops[0][0])return ze.stops[0][1];if(Rt>=ze.stops[Xt-1][0])return ze.stops[Xt-1][1];const sr=tr(ze.stops.map(ze=>ze[0]),Rt);return ze.stops[sr][1]}function an(ze,wt,Rt){const Xt=void 0!==ze.base?ze.base:1;if("number"!==Wr(Rt))return rn(ze.default,wt.default);const sr=ze.stops.length;if(1===sr)return ze.stops[0][1];if(Rt<=ze.stops[0][0])return ze.stops[0][1];if(Rt>=ze.stops[sr-1][0])return ze.stops[sr-1][1];const Dr=tr(ze.stops.map(ze=>ze[0]),Rt),Lr=function(ze,wt,Rt,Xt){const sr=Xt-Rt,Dr=ze-Rt;return 0===sr?0:1===wt?Dr/sr:(Math.pow(wt,Dr)-1)/(Math.pow(wt,sr)-1)}(Rt,Xt,ze.stops[Dr][0],ze.stops[Dr+1][0]),Ur=ze.stops[Dr][1],qr=ze.stops[Dr+1][1];let ri=Vc[wt.type]||tn;if(ze.colorSpace&&"rgb"!==ze.colorSpace){const wt=hu[ze.colorSpace];ri=(ze,Rt)=>wt.reverse(wt.interpolate(wt.forward(ze),wt.forward(Rt),Lr))}return"function"==typeof Ur.evaluate?{evaluate(...ze){const wt=Ur.evaluate.apply(void 0,ze),Rt=qr.evaluate.apply(void 0,ze);if(void 0!==wt&&void 0!==Rt)return ri(wt,Rt,Lr)}}:ri(Ur,qr,Lr)}function on(ze,wt,Rt){return"color"===wt.type?Rt=ce.parse(Rt):"formatted"===wt.type?Rt=de.fromString(Rt.toString()):"resolvedImage"===wt.type?Rt=fe.fromString(Rt.toString()):Wr(Rt)===wt.type||"enum"===wt.type&&wt.values[Rt]||(Rt=void 0),rn(Rt,ze.default,wt.default)}Me.register(vu,{error:[{kind:"error"},[Dl],(ze,[wt])=>{throw new be(wt.evaluate(ze))}],typeof:[Dl,[Gl],(ze,[wt])=>ne(ge(wt.evaluate(ze)))],"to-rgba":[re(Ol,4),[Fl],(ze,[wt])=>wt.evaluate(ze).toArray()],rgb:[Fl,[Ol,Ol,Ol],Nr],rgba:[Fl,[Ol,Ol,Ol,Ol],Nr],has:{type:Ll,overloads:[[[Dl],(ze,[wt])=>jr(wt.evaluate(ze),ze.properties())],[[Dl,Vl],(ze,[wt,Rt])=>jr(wt.evaluate(ze),Rt.evaluate(ze))]]},get:{type:Gl,overloads:[[[Dl],(ze,[wt])=>Gr(wt.evaluate(ze),ze.properties())],[[Dl,Vl],(ze,[wt,Rt])=>Gr(wt.evaluate(ze),Rt.evaluate(ze))]]},"feature-state":[Gl,[Dl],(ze,[wt])=>Gr(wt.evaluate(ze),ze.featureState||{})],properties:[Vl,[],ze=>ze.properties()],"geometry-type":[Dl,[],ze=>ze.geometryType()],id:[Gl,[],ze=>ze.id()],zoom:[Ol,[],ze=>ze.globals.zoom],"heatmap-density":[Ol,[],ze=>ze.globals.heatmapDensity||0],"line-progress":[Ol,[],ze=>ze.globals.lineProgress||0],"sky-radial-progress":[Ol,[],ze=>ze.globals.skyRadialProgress||0],accumulated:[Gl,[],ze=>void 0===ze.globals.accumulated?null:ze.globals.accumulated],"+":[Ol,Zr(Ol),(ze,wt)=>{let Rt=0;for(const Xt of wt)Rt+=Xt.evaluate(ze);return Rt}],"*":[Ol,Zr(Ol),(ze,wt)=>{let Rt=1;for(const Xt of wt)Rt*=Xt.evaluate(ze);return Rt}],"-":{type:Ol,overloads:[[[Ol,Ol],(ze,[wt,Rt])=>
vendor: 9,132 bytes, line 20
20wt.evaluate(ze)-Rt.evaluate(ze)],[[Ol],(ze,[wt])=>-wt.evaluate(ze)]]},"/":[Ol,[Ol,Ol],(ze,[wt,Rt])=>wt.evaluate(ze)/Rt.evaluate(ze)],"%":[Ol,[Ol,Ol],(ze,[wt,Rt])=>wt.evaluate(ze)%Rt.evaluate(ze)],ln2:[Ol,[],()=>Math.LN2],pi:[Ol,[],()=>Math.PI],e:[Ol,[],()=>Math.E],"^":[Ol,[Ol,Ol],(ze,[wt,Rt])=>Math.pow(wt.evaluate(ze),Rt.evaluate(ze))],sqrt:[Ol,[Ol],(ze,[wt])=>Math.sqrt(wt.evaluate(ze))],log10:[Ol,[Ol],(ze,[wt])=>Math.log(wt.evaluate(ze))/Math.LN10],ln:[Ol,[Ol],(ze,[wt])=>Math.log(wt.evaluate(ze))],log2:[Ol,[Ol],(ze,[wt])=>Math.log(wt.evaluate(ze))/Math.LN2],sin:[Ol,[Ol],(ze,[wt])=>Math.sin(wt.evaluate(ze))],cos:[Ol,[Ol],(ze,[wt])=>Math.cos(wt.evaluate(ze))],tan:[Ol,[Ol],(ze,[wt])=>Math.tan(wt.evaluate(ze))],asin:[Ol,[Ol],(ze,[wt])=>Math.asin(wt.evaluate(ze))],acos:[Ol,[Ol],(ze,[wt])=>Math.acos(wt.evaluate(ze))],atan:[Ol,[Ol],(ze,[wt])=>Math.atan(wt.evaluate(ze))],min:[Ol,Zr(Ol),(ze,wt)=>Math.min(...wt.map(wt=>wt.evaluate(ze)))],max:[Ol,Zr(Ol),(ze,wt)=>Math.max(...wt.map(wt=>wt.evaluate(ze)))],abs:[Ol,[Ol],(ze,[wt])=>Math.abs(wt.evaluate(ze))],round:[Ol,[Ol],(ze,[wt])=>{const Rt=wt.evaluate(ze);return Rt<0?-Math.round(-Rt):Math.round(Rt)}],floor:[Ol,[Ol],(ze,[wt])=>Math.floor(wt.evaluate(ze))],ceil:[Ol,[Ol],(ze,[wt])=>Math.ceil(wt.evaluate(ze))],"filter-==":[Ll,[Dl,Gl],(ze,[wt,Rt])=>ze.properties()[wt.value]===Rt.value],"filter-id-==":[Ll,[Gl],(ze,[wt])=>ze.id()===wt.value],"filter-type-==":[Ll,[Dl],(ze,[wt])=>ze.geometryType()===wt.value],"filter-<":[Ll,[Dl,Gl],(ze,[wt,Rt])=>{const Xt=ze.properties()[wt.value],sr=Rt.value;return typeof Xt==typeof sr&&Xt<sr}],"filter-id-<":[Ll,[Gl],(ze,[wt])=>{const Rt=ze.id(),Xt=wt.value;return typeof Rt==typeof Xt&&Rt<Xt}],"filter->":[Ll,[Dl,Gl],(ze,[wt,Rt])=>{const Xt=ze.properties()[wt.value],sr=Rt.value;return typeof Xt==typeof sr&&Xt>sr}],"filter-id->":[Ll,[Gl],(ze,[wt])=>{const Rt=ze.id(),Xt=wt.value;return typeof Rt==typeof Xt&&Rt>Xt}],"filter-<=":[Ll,[Dl,Gl],(ze,[wt,Rt])=>{const Xt=ze.properties()[wt.value],sr=Rt.value;return typeof Xt==typeof sr&&Xt<=sr}],"filter-id-<=":[Ll,[Gl],(ze,[wt])=>{const Rt=ze.id(),Xt=wt.value;return typeof Rt==typeof Xt&&Rt<=Xt}],"filter->=":[Ll,[Dl,Gl],(ze,[wt,Rt])=>{const Xt=ze.properties()[wt.value],sr=Rt.value;return typeof Xt==typeof sr&&Xt>=sr}],"filter-id->=":[Ll,[Gl],(ze,[wt])=>{const Rt=ze.id(),Xt=wt.value;return typeof Rt==typeof Xt&&Rt>=Xt}],"filter-has":[Ll,[Gl],(ze,[wt])=>wt.value in ze.properties()],"filter-has-id":[Ll,[],ze=>null!==ze.id()&&void 0!==ze.id()],"filter-type-in":[Ll,[re(Dl)],(ze,[wt])=>wt.value.indexOf(ze.geometryType())>=0],"filter-id-in":[Ll,[re(Gl)],(ze,[wt])=>wt.value.indexOf(ze.id())>=0],"filter-in-small":[Ll,[Dl,re(Gl)],(ze,[wt,Rt])=>Rt.value.indexOf(ze.properties()[wt.value])>=0],"filter-in-large":[Ll,[Dl,re(Gl)],(ze,[wt,Rt])=>function(ze,wt,Rt,Xt){for(;Rt<=Xt;){const sr=Rt+Xt>>1;if(wt[sr]===ze)return!0;wt[sr]>ze?Xt=sr-1:Rt=sr+1}return!1}(ze.properties()[wt.value],Rt.value,0,Rt.value.length-1)],all:{type:Ll,overloads:[[[Ll,Ll],(ze,[wt,Rt])=>wt.evaluate(ze)&&Rt.evaluate(ze)],[Zr(Ll),(ze,wt)=>{for(const Rt of wt)if(!Rt.evaluate(ze))return!1;return!0}]]},any:{type:Ll,overloads:[[[Ll,Ll],(ze,[wt,Rt])=>wt.evaluate(ze)||Rt.evaluate(ze)],[Zr(Ll),(ze,wt)=>{for(const Rt of wt)if(Rt.evaluate(ze))return!0;return!1}]]},"!":[Ll,[Ll],(ze,[wt])=>!wt.evaluate(ze)],"is-supported-script":[Ll,[Dl],(ze,[wt])=>{const Rt=ze.globals&&ze.globals.isSupportedScript;return!Rt||Rt(wt.evaluate(ze))}],upcase:[Dl,[Dl],(ze,[wt])=>wt.evaluate(ze).toUpperCase()],downcase:[Dl,[Dl],(ze,[wt])=>wt.evaluate(ze).toLowerCase()],concat:[Dl,Zr(Gl),(ze,wt)=>wt.map(wt=>xe(wt.evaluate(ze))).join("")],"resolved-locale":[Dl,[Zl],(ze,[wt])=>wt.evaluate(ze).resolvedLocale()]});class ln{constructor(ze,wt){this.expression=ze,this._warningHistory={},this._evaluator=new Te,this._defaultValue=wt?function(ze){return"color"===ze.type&&Qr(ze.default)?new ce(0,0,0,0):"color"===ze.type?ce.parse(ze.default)||null:void 0===ze.default?null:ze.default}(wt):null,this._enumValues=wt&&"enum"===wt.type?wt.values:null}evaluateWithoutErrorHandling(ze,wt,Rt,Xt,sr,Dr){return this._evaluator.globals=ze,this._evaluator.feature=wt,this._evaluator.featureState=Rt,this._evaluator.canonical=Xt,this._evaluator.availableImages=sr||null,this._evaluator.formattedSection=Dr,this.expression.evaluate(this._evaluator)}evaluate(ze,wt,Rt,Xt,sr,Dr){this._evaluator.globals=ze,this._evaluator.feature=wt||null,this._evaluator.featureState=Rt||null,this._evaluator.canonical=Xt,this._evaluator.availableImages=sr||null,this._evaluator.formattedSection=Dr||null;try{const ze=this.expression.evaluate(this._evaluator);if(null==ze||"number"==typeof ze&&ze!=ze)return this._defaultValue;if(this._enumValues&&!(ze in this._enumValues))throw new be(`Expected value to be one of ${Object.keys(this._enumValues).map(ze=>JSON.stringify(ze)).join(", ")}, but found ${JSON.stringify(ze)} instead.`);return ze}catch(ze){return this._warningHistory[ze.message]||(this._warningHistory[ze.message]=!0,"undefined"!=typeof console&&ze.message),this._defaultValue}}}function un(ze){return Array.isArray(ze)&&ze.length>0&&"string"==typeof ze[0]&&ze[0]in vu}function cn(ze,wt){const Rt=new We(vu,[],wt?function(ze){const wt={color:Fl,string:Dl,number:Ol,enum:Dl,boolean:Ll,formatted:Wl,resolvedImage:Xl};return"array"===ze.type?re(wt[ze.value]||Gl,ze.length):wt[ze.type]}(wt):void 0),Xt=Rt.parse(ze,void 0,void 0,void 0,wt&&"string"===wt.type?{typeAnnotation:"coerce"}:void 0);return Xt?Xr(new ln(Xt,wt)):Kr(Rt.errors)}class hn{constructor(ze,wt){this.kind=ze,this._styleExpression=wt,this.isStateDependent="constant"!==ze&&!He(wt.expression)}evaluateWithoutErrorHandling(ze,wt,Rt,Xt,sr,Dr){return this._styleExpression.evaluateWithoutErrorHandling(ze,wt,Rt,Xt,sr,Dr)}evaluate(ze,wt,Rt,Xt,sr,Dr){return this._styleExpression.evaluate(ze,wt,Rt,Xt,sr,Dr)}}class pn{constructor(ze,wt,Rt,Xt){this.kind=ze,this.zoomStops=Rt,this._styleExpression=wt,this.isStateDependent="camera"!==ze&&!He(wt.expression),this.interpolationType=Xt}evaluateWithoutErrorHandling(ze,wt,Rt,Xt,sr,Dr){return this._styleExpression.evaluateWithoutErrorHandling(ze,wt,Rt,Xt,sr,Dr)}evaluate(ze,wt,Rt,Xt,sr,Dr){return this._styleExpression.evaluate(ze,wt,Rt,Xt,sr,Dr)}interpolationFactor(ze,wt,Rt){return this.interpolationType?wr.interpolationFactor(this.interpolationType,ze,wt,Rt):0}}function dn(ze,wt){if("error"===(ze=cn(ze,wt)).result)return ze;const Rt=ze.value.expression,Xt=Ke(Rt);if(!Xt&&!Hr(wt))return Kr([new jt("","data expressions not supported")]);const sr=Ye(Rt,["zoom"]);if(!sr&&!Yr(wt))return Kr([new jt("","zoom expressions not supported")]);const Dr=yn(Rt);return Dr||sr?Dr instanceof jt?Kr([Dr]):Dr instanceof wr&&!Jr(wt)?Kr([new jt("",'"interpolate" expressions cannot be used with this property')]):Xr(Dr?new pn(Xt?"camera":"composite",ze.value,Dr.labels,Dr instanceof wr?Dr.interpolation:void 0):new hn(Xt?"constant":"source",ze.value)):Kr([new jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class fn{constructor(ze,wt){this._parameters=ze,this._specification=wt,Ot(this,en(this._parameters,this._specification))}static deserialize(ze){return new fn(ze._parameters,ze._specification)}static serialize(ze){return{_parameters:ze._parameters,_specification:ze._specification}}}function yn(ze){let wt=null;if(ze instanceof Ar)wt=yn(ze.result);else if(ze instanceof kr){for(const Rt of ze.args)if(wt=yn(Rt),wt)break}else(ze instanceof er||ze instanceof wr)&&ze.input instanceof Me&&"zoom"===ze.input.name&&(wt=ze);return wt instanceof jt||ze.eachChild(ze=>{const Rt=yn(ze);Rt instanceof jt?wt=Rt:!wt&&Rt?wt=new jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):wt&&Rt&&wt!==Rt&&(wt=new jt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),wt}function mn(ze){const wt=ze.key,Rt=ze.value,Xt=ze.valueSpec||{},sr=ze.objectElementValidators||{},Dr=ze.style,Lr=ze.styleSpec;let Ur=[];const qr=Wr(Rt);if("object"!==qr)return[new Ut(wt,Rt,`object expected, ${qr} found`)];for(const ze in Rt){const qr=ze.split(".")[0],ri=Xt[qr]||Xt["*"];let ai;if(sr[qr])ai=sr[qr];else if(Xt[qr])ai=Gn;else if(sr["*"])ai=sr["*"];else{if(!Xt["*"]){Ur.push(new Ut(wt,Rt[ze],`unknown property "${ze}"`));continue}ai=Gn}Ur=Ur.concat(ai({key:(wt?`${wt}.`:wt)+ze,value:Rt[ze],valueSpec:ri,style:Dr,styleSpec:Lr,object:Rt,objectKey:ze},Rt))}for(const ze in Xt)sr[ze]||Xt[ze].required&&void 0===Xt[ze].default&&void 0===Rt[ze]&&Ur.push(new Ut(wt,Rt,`missing required property "${ze}"`));return Ur}function gn(ze){const wt=ze.value,Rt=ze.valueSpec,Xt=ze.style,sr=ze.styleSpec,Dr=ze.key,Lr=ze.arrayElementValidator||Gn;if("array"!==Wr(wt))return[new Ut(Dr,wt,`array expected, ${Wr(wt)} found`)];if(Rt.length&&wt.length!==Rt.length)return[new Ut(Dr,wt,`array length ${Rt.length} expected, length ${wt.length} found`)];if(Rt["min-length"]&&wt.length<Rt["min-length"])return[new Ut(Dr,wt,`array length at least ${Rt["min-length"]} expected, length ${wt.length} found`)];let Ur={type:Rt.value,values:Rt.values,minimum:Rt.minimum,maximum:Rt.maximum};
vendor: 5,973 bytes, line 20
20sr.$version<7&&(Ur.function=Rt.function),"object"===Wr(Rt.value)&&(Ur=Rt.value);let qr=[];for(let ze=0;ze<wt.length;ze++)qr=qr.concat(Lr({array:wt,arrayIndex:ze,value:wt[ze],valueSpec:Ur,style:Xt,styleSpec:sr,key:`${Dr}[${ze}]`}));return qr}function xn(ze){const wt=ze.key,Rt=ze.value,Xt=ze.valueSpec;let sr=Wr(Rt);if("number"===sr&&Rt!=Rt&&(sr="NaN"),"number"!==sr)return[new Ut(wt,Rt,`number expected, ${sr} found`)];if("minimum"in Xt){let sr=Xt.minimum;if("array"===Wr(Xt.minimum)&&(sr=Xt.minimum[ze.arrayIndex]),Rt<sr)return[new Ut(wt,Rt,`${Rt} is less than the minimum value ${sr}`)]}if("maximum"in Xt){let sr=Xt.maximum;if("array"===Wr(Xt.maximum)&&(sr=Xt.maximum[ze.arrayIndex]),Rt>sr)return[new Ut(wt,Rt,`${Rt} is greater than the maximum value ${sr}`)]}return[]}function vn(ze){const wt=ze.valueSpec,Rt=qt(ze.value.type);let Xt,sr,Dr,Lr={};const Ur="categorical"!==Rt&&void 0===ze.value.property,qr=!Ur,ri="array"===Wr(ze.value.stops)&&"array"===Wr(ze.value.stops[0])&&"object"===Wr(ze.value.stops[0][0]),ai=mn({key:ze.key,value:ze.value,valueSpec:ze.styleSpec.function,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{stops:function(ze){if("identity"===Rt)return[new Ut(ze.key,ze.value,'identity function may not have a "stops" property')];let wt=[];const Xt=ze.value;return wt=wt.concat(gn({key:ze.key,value:Xt,valueSpec:ze.valueSpec,style:ze.style,styleSpec:ze.styleSpec,arrayElementValidator:h})),"array"===Wr(Xt)&&0===Xt.length&&wt.push(new Ut(ze.key,Xt,"array must have at least one stop")),wt},default:function(ze){return Gn({key:ze.key,value:ze.value,valueSpec:wt,style:ze.style,styleSpec:ze.styleSpec})}}});return"identity"===Rt&&Ur&&ai.push(new Ut(ze.key,ze.value,'missing required property "property"')),"identity"===Rt||ze.value.stops||ai.push(new Ut(ze.key,ze.value,'missing required property "stops"')),"exponential"===Rt&&ze.valueSpec.expression&&!Jr(ze.valueSpec)&&ai.push(new Ut(ze.key,ze.value,"exponential functions not supported")),ze.styleSpec.$version>=8&&(qr&&!Hr(ze.valueSpec)?ai.push(new Ut(ze.key,ze.value,"property functions not supported")):Ur&&!Yr(ze.valueSpec)&&ai.push(new Ut(ze.key,ze.value,"zoom functions not supported"))),"categorical"!==Rt&&!ri||void 0!==ze.value.property||ai.push(new Ut(ze.key,ze.value,'"property" property is required')),ai;function h(ze){let Rt=[];const Xt=ze.value,Ur=ze.key;if("array"!==Wr(Xt))return[new Ut(Ur,Xt,`array expected, ${Wr(Xt)} found`)];if(2!==Xt.length)return[new Ut(Ur,Xt,`array length 2 expected, length ${Xt.length} found`)];if(ri){if("object"!==Wr(Xt[0]))return[new Ut(Ur,Xt,`object expected, ${Wr(Xt[0])} found`)];if(void 0===Xt[0].zoom)return[new Ut(Ur,Xt,"object stop key must have zoom")];if(void 0===Xt[0].value)return[new Ut(Ur,Xt,"object stop key must have value")];if(Dr&&Dr>qt(Xt[0].zoom))return[new Ut(Ur,Xt[0].zoom,"stop zoom values must appear in ascending order")];qt(Xt[0].zoom)!==Dr&&(Dr=qt(Xt[0].zoom),sr=void 0,Lr={}),Rt=Rt.concat(mn({key:`${Ur}[0]`,value:Xt[0],valueSpec:{zoom:{}},style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{zoom:xn,value:p}}))}else Rt=Rt.concat(p({key:`${Ur}[0]`,value:Xt[0],valueSpec:{},style:ze.style,styleSpec:ze.styleSpec},Xt));return un(Nt(Xt[1]))?Rt.concat([new Ut(`${Ur}[1]`,Xt[1],"expressions are not allowed in function stops.")]):Rt.concat(Gn({key:`${Ur}[1]`,value:Xt[1],valueSpec:wt,style:ze.style,styleSpec:ze.styleSpec}))}function p(ze,Dr){const Ur=Wr(ze.value),qr=qt(ze.value),ri=null!==ze.value?ze.value:Dr;if(Xt){if(Ur!==Xt)return[new Ut(ze.key,ri,`${Ur} stop domain type must match previous stop domain type ${Xt}`)]}else Xt=Ur;if("number"!==Ur&&"string"!==Ur&&"boolean"!==Ur)return[new Ut(ze.key,ri,"stop domain value must be a number, string, or boolean")];if("number"!==Ur&&"categorical"!==Rt){let Xt=`number expected, ${Ur} found`;return Hr(wt)&&void 0===Rt&&(Xt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ut(ze.key,ri,Xt)]}return"categorical"!==Rt||"number"!==Ur||isFinite(qr)&&Math.floor(qr)===qr?"categorical"!==Rt&&"number"===Ur&&void 0!==sr&&qr<sr?[new Ut(ze.key,ri,"stop domain values must appear in ascending order")]:(sr=qr,"categorical"===Rt&&qr in Lr?[new Ut(ze.key,ri,"stop domain values must be unique")]:(Lr[qr]=!0,[])):[new Ut(ze.key,ri,`integer expected, found ${qr}`)]}}function bn(ze){const wt=("property"===ze.expressionContext?dn:cn)(Nt(ze.value),ze.valueSpec);if("error"===wt.result)return wt.value.map(wt=>new Ut(`${ze.key}${wt.key}`,ze.value,wt.message));const Rt=wt.value.expression||wt.value._styleExpression.expression;if("property"===ze.expressionContext&&"text-font"===ze.propertyKey&&!Rt.outputDefined())return[new Ut(ze.key,ze.value,`Invalid data expression for "${ze.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===ze.expressionContext&&"layout"===ze.propertyType&&!He(Rt))return[new Ut(ze.key,ze.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===ze.expressionContext&&!He(Rt))return[new Ut(ze.key,ze.value,'"feature-state" data expressions are not supported with filters.')];if(ze.expressionContext&&0===ze.expressionContext.indexOf("cluster")){if(!Ye(Rt,["zoom","feature-state"]))return[new Ut(ze.key,ze.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===ze.expressionContext&&!Ke(Rt))return[new Ut(ze.key,ze.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function wn(ze){const wt=ze.key,Rt=ze.value,Xt=ze.valueSpec,sr=[];return Array.isArray(Xt.values)?-1===Xt.values.indexOf(qt(Rt))&&sr.push(new Ut(wt,Rt,`expected one of [${Xt.values.join(", ")}], ${JSON.stringify(Rt)} found`)):-1===Object.keys(Xt.values).indexOf(qt(Rt))&&sr.push(new Ut(wt,Rt,`expected one of [${Object.keys(Xt.values).join(", ")}], ${JSON.stringify(Rt)} found`)),sr}function _n(ze){if(!0===ze||!1===ze)return!0;
vendor: 5,684 bytes, line 20
20if(!Array.isArray(ze)||0===ze.length)return!1;switch(ze[0]){case"has":return ze.length>=2&&"$id"!==ze[1]&&"$type"!==ze[1];case"in":return ze.length>=3&&("string"!=typeof ze[1]||Array.isArray(ze[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==ze.length||Array.isArray(ze[1])||Array.isArray(ze[2]);case"any":case"all":for(const wt of ze.slice(1))if(!_n(wt)&&"boolean"!=typeof wt)return!1;return!0;default:return!0}}const xu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function An(ze){if(null==ze)return{filter:()=>!0,needGeometry:!1};_n(ze)||(ze=zn(ze));const wt=cn(ze,xu);if("error"===wt.result)throw new Error(wt.value.map(ze=>`${ze.key}: ${ze.message}`).join(", "));return{filter:(ze,Rt,Xt)=>wt.value.evaluate(ze,Rt,{},Xt),needGeometry:In(ze)}}function Sn(ze,wt){return ze<wt?-1:ze>wt?1:0}function In(ze){if(!Array.isArray(ze))return!1;if("within"===ze[0])return!0;for(let wt=1;wt<ze.length;wt++)if(In(ze[wt]))return!0;return!1}function zn(ze){if(!ze)return!0;const wt=ze[0];return ze.length<=1?"any"!==wt:"=="===wt?Tn(ze[1],ze[2],"=="):"!="===wt?Bn(Tn(ze[1],ze[2],"==")):"<"===wt||">"===wt||"<="===wt||">="===wt?Tn(ze[1],ze[2],wt):"any"===wt?(Rt=ze.slice(1),["any"].concat(Rt.map(zn))):"all"===wt?["all"].concat(ze.slice(1).map(zn)):"none"===wt?["all"].concat(ze.slice(1).map(zn).map(Bn)):"in"===wt?Mn(ze[1],ze.slice(2)):"!in"===wt?Bn(Mn(ze[1],ze.slice(2))):"has"===wt?En(ze[1]):"!has"===wt?Bn(En(ze[1])):"within"!==wt||ze;var Rt}function Tn(ze,wt,Rt){switch(ze){case"$type":return[`filter-type-${Rt}`,wt];case"$id":return[`filter-id-${Rt}`,wt];default:return[`filter-${Rt}`,ze,wt]}}function Mn(ze,wt){if(0===wt.length)return!1;switch(ze){case"$type":return["filter-type-in",["literal",wt]];case"$id":return["filter-id-in",["literal",wt]];default:return wt.length>200&&!wt.some(ze=>typeof ze!=typeof wt[0])?["filter-in-large",ze,["literal",wt.sort(Sn)]]:["filter-in-small",ze,["literal",wt]]}}function En(ze){switch(ze){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",ze]}}function Bn(ze){return["!",ze]}function Cn(ze){return _n(Nt(ze.value))?bn(Ot({},ze,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pn(ze)}function Pn(ze){const wt=ze.value,Rt=ze.key;if("array"!==Wr(wt))return[new Ut(Rt,wt,`array expected, ${Wr(wt)} found`)];const Xt=ze.styleSpec;let sr,Dr=[];if(wt.length<1)return[new Ut(Rt,wt,"filter array must have at least 1 element")];switch(Dr=Dr.concat(wn({key:`${Rt}[0]`,value:wt[0],valueSpec:Xt.filter_operator,style:ze.style,styleSpec:ze.styleSpec})),qt(wt[0])){case"<":case"<=":case">":case">=":wt.length>=2&&"$type"===qt(wt[1])&&Dr.push(new Ut(Rt,wt,`"$type" cannot be use with operator "${wt[0]}"`));case"==":case"!=":3!==wt.length&&Dr.push(new Ut(Rt,wt,`filter array for operator "${wt[0]}" must have 3 elements`));case"in":case"!in":wt.length>=2&&(sr=Wr(wt[1]),"string"!==sr&&Dr.push(new Ut(`${Rt}[1]`,wt[1],`string expected, ${sr} found`)));for(let Lr=2;Lr<wt.length;Lr++)sr=Wr(wt[Lr]),"$type"===qt(wt[1])?Dr=Dr.concat(wn({key:`${Rt}[${Lr}]`,value:wt[Lr],valueSpec:Xt.geometry_type,style:ze.style,styleSpec:ze.styleSpec})):"string"!==sr&&"number"!==sr&&"boolean"!==sr&&Dr.push(new Ut(`${Rt}[${Lr}]`,wt[Lr],`string, number, or boolean expected, ${sr} found`));break;case"any":case"all":case"none":for(let Xt=1;Xt<wt.length;Xt++)Dr=Dr.concat(Pn({key:`${Rt}[${Xt}]`,value:wt[Xt],style:ze.style,styleSpec:ze.styleSpec}));break;case"has":case"!has":sr=Wr(wt[1]),2!==wt.length?Dr.push(new Ut(Rt,wt,`filter array for "${wt[0]}" operator must have 2 elements`)):"string"!==sr&&Dr.push(new Ut(`${Rt}[1]`,wt[1],`string expected, ${sr} found`));break;case"within":sr=Wr(wt[1]),2!==wt.length?Dr.push(new Ut(Rt,wt,`filter array for "${wt[0]}" operator must have 2 elements`)):"object"!==sr&&Dr.push(new Ut(`${Rt}[1]`,wt[1],`object expected, ${sr} found`))}return Dr}function Dn(ze,wt){const Rt=ze.key,Xt=ze.style,sr=ze.styleSpec,Dr=ze.value,Lr=ze.objectKey,Ur=sr[`${wt}_${ze.layerType}`];if(!Ur)return[];const qr=Lr.match(/^(.*)-transition$/);if("paint"===wt&&qr&&Ur[qr[1]]&&Ur[qr[1]].transition)return Gn({key:Rt,value:Dr,valueSpec:sr.transition,style:Xt,styleSpec:sr});const ri=ze.valueSpec||Ur[Lr];if(!ri)return[new Ut(Rt,Dr,`unknown property "${Lr}"`)];let ai;if("string"===Wr(Dr)&&Hr(ri)&&!ri.tokens&&(ai=/^{([^}]+)}$/.exec(Dr)))return[new Ut(Rt,Dr,`"${Lr}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(ai[1])} }\`.`)];const Yi=[];return"symbol"===ze.layerType&&("text-field"===Lr&&Xt&&!Xt.glyphs&&Yi.push(new Ut(Rt,Dr,'use of "text-field" requires a style "glyphs" property')),"text-font"===Lr&&Qr(Nt(Dr))&&"identity"===qt(Dr.type)&&Yi.push(new Ut(Rt,Dr,'"text-font" does not support identity functions'))),Yi.concat(Gn({key:ze.key,value:Dr,valueSpec:ri,style:Xt,styleSpec:sr,expressionContext:"property",propertyType:wt,propertyKey:Lr}))}function Vn(ze){return Dn(ze,"paint")}function Ln(ze){return Dn(ze,"layout")}function Fn(ze){let wt=[];const Rt=ze.value,Xt=ze.key,sr=ze.style,Dr=ze.styleSpec;Rt.type||Rt.ref||wt.push(new Ut(Xt,Rt,'either "type" or "ref" is required'));let Lr=qt(Rt.type);const Ur=qt(Rt.ref);if(Rt.id){const Dr=qt(Rt.id);for(let Lr=0;Lr<ze.arrayIndex;Lr++){const ze=sr.layers[Lr];qt(ze.id)===Dr&&wt.push(new Ut(Xt,Rt.id,`duplicate layer id "${Rt.id}", previously used at line ${ze.id.__line__}`))}}if("ref"in Rt){let ze;["type","source","source-layer","filter","layout"].forEach(ze=>{ze in Rt&&wt.push(new Ut(Xt,Rt[ze],`"${ze}" is prohibited for ref layers`))}
vendor: 1,744 bytes, line 20
20),sr.layers.forEach(wt=>{qt(wt.id)===Ur&&(ze=wt)}),ze?ze.ref?wt.push(new Ut(Xt,Rt.ref,"ref cannot reference another ref layer")):Lr=qt(ze.type):wt.push(new Ut(Xt,Rt.ref,`ref layer "${Ur}" not found`))}else if("background"!==Lr&&"sky"!==Lr)if(Rt.source){const ze=sr.sources&&sr.sources[Rt.source],Dr=ze&&qt(ze.type);ze?"vector"===Dr&&"raster"===Lr?wt.push(new Ut(Xt,Rt.source,`layer "${Rt.id}" requires a raster source`)):"raster"===Dr&&"raster"!==Lr?wt.push(new Ut(Xt,Rt.source,`layer "${Rt.id}" requires a vector source`)):"vector"!==Dr||Rt["source-layer"]?"raster-dem"===Dr&&"hillshade"!==Lr?wt.push(new Ut(Xt,Rt.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==Lr||!Rt.paint||!Rt.paint["line-gradient"]||"geojson"===Dr&&ze.lineMetrics||wt.push(new Ut(Xt,Rt,`layer "${Rt.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):wt.push(new Ut(Xt,Rt,`layer "${Rt.id}" must specify a "source-layer"`)):wt.push(new Ut(Xt,Rt.source,`source "${Rt.source}" not found`))}else wt.push(new Ut(Xt,Rt,'missing required property "source"'));return wt=wt.concat(mn({key:Xt,value:Rt,valueSpec:Dr.layer,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Gn({key:`${Xt}.type`,value:Rt.type,valueSpec:Dr.layer.type,style:ze.style,styleSpec:ze.styleSpec,object:Rt,objectKey:"type"}),filter:Cn,layout:ze=>mn({layer:Rt,key:ze.key,value:ze.value,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{"*":ze=>Ln(Ot({layerType:Lr},ze))}}),paint:ze=>mn({layer:Rt,key:ze.key,value:ze.value,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{"*":ze=>Vn(Ot({layerType:Lr},ze))}})}})),wt}function Rn(ze){const wt=ze.value,Rt=ze.key,Xt=Wr(wt);
vendor: 7,901 bytes, line 20
20return"string"!==Xt?[new Ut(Rt,wt,`string expected, ${Xt} found`)]:[]}const wu={promoteId:function({key:ze,value:wt}){if("string"===Wr(wt))return Rn({key:ze,value:wt});{const Rt=[];for(const Xt in wt)Rt.push(...Rn({key:`${ze}.${Xt}`,value:wt[Xt]}));return Rt}}};function $n(ze){const wt=ze.value,Rt=ze.key,Xt=ze.styleSpec,sr=ze.style;if(!wt.type)return[new Ut(Rt,wt,'"type" is required')];const Dr=qt(wt.type);let Lr;switch(Dr){case"vector":case"raster":case"raster-dem":return Lr=mn({key:Rt,value:wt,valueSpec:Xt[`source_${Dr.replace("-","_")}`],style:ze.style,styleSpec:Xt,objectElementValidators:wu}),Lr;case"geojson":if(Lr=mn({key:Rt,value:wt,valueSpec:Xt.source_geojson,style:sr,styleSpec:Xt,objectElementValidators:wu}),wt.cluster)for(const ze in wt.clusterProperties){const[Xt,sr]=wt.clusterProperties[ze],Dr="string"==typeof Xt?[Xt,["accumulated"],["get",ze]]:Xt;Lr.push(...bn({key:`${Rt}.${ze}.map`,value:sr,expressionContext:"cluster-map"})),Lr.push(...bn({key:`${Rt}.${ze}.reduce`,value:Dr,expressionContext:"cluster-reduce"}))}return Lr;case"video":return mn({key:Rt,value:wt,valueSpec:Xt.source_video,style:sr,styleSpec:Xt});case"image":return mn({key:Rt,value:wt,valueSpec:Xt.source_image,style:sr,styleSpec:Xt});case"canvas":return[new Ut(Rt,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return wn({key:`${Rt}.type`,value:wt.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:sr,styleSpec:Xt})}}function On(ze){const wt=ze.value,Rt=ze.styleSpec,Xt=Rt.light,sr=ze.style;let Dr=[];const Lr=Wr(wt);if(void 0===wt)return Dr;if("object"!==Lr)return Dr=Dr.concat([new Ut("light",wt,`object expected, ${Lr} found`)]),Dr;for(const ze in wt){const Lr=ze.match(/^(.*)-transition$/);Dr=Dr.concat(Lr&&Xt[Lr[1]]&&Xt[Lr[1]].transition?Gn({key:ze,value:wt[ze],valueSpec:Rt.transition,style:sr,styleSpec:Rt}):Xt[ze]?Gn({key:ze,value:wt[ze],valueSpec:Xt[ze],style:sr,styleSpec:Rt}):[new Ut(ze,wt[ze],`unknown property "${ze}"`)])}return Dr}function qn(ze){const wt=ze.value,Rt=ze.key,Xt=ze.style,sr=ze.styleSpec,Dr=sr.terrain;let Lr=[];const Ur=Wr(wt);if(void 0===wt)return Lr;if("object"!==Ur)return Lr=Lr.concat([new Ut("terrain",wt,`object expected, ${Ur} found`)]),Lr;for(const ze in wt){const Rt=ze.match(/^(.*)-transition$/);Lr=Lr.concat(Rt&&Dr[Rt[1]]&&Dr[Rt[1]].transition?Gn({key:ze,value:wt[ze],valueSpec:sr.transition,style:Xt,styleSpec:sr}):Dr[ze]?Gn({key:ze,value:wt[ze],valueSpec:Dr[ze],style:Xt,styleSpec:sr}):[new Ut(ze,wt[ze],`unknown property "${ze}"`)])}if(wt.source){const ze=Xt.sources&&Xt.sources[wt.source],sr=ze&&qt(ze.type);ze?"raster-dem"!==sr&&Lr.push(new Ut(Rt,wt.source,`terrain cannot be used with a source of type ${sr}, it only be used with a "raster-dem" source type`)):Lr.push(new Ut(Rt,wt.source,`source "${wt.source}" not found`))}else Lr.push(new Ut(Rt,wt,'terrain is missing required property "source"'));return Lr}function Nn(ze){const wt=ze.value,Rt=ze.style,Xt=ze.styleSpec,sr=Xt.fog;let Dr=[];const Lr=Wr(wt);if(void 0===wt)return Dr;if("object"!==Lr)return Dr=Dr.concat([new Ut("fog",wt,`object expected, ${Lr} found`)]),Dr;for(const ze in wt){const Lr=ze.match(/^(.*)-transition$/);Dr=Dr.concat(Lr&&sr[Lr[1]]&&sr[Lr[1]].transition?Gn({key:ze,value:wt[ze],valueSpec:Xt.transition,style:Rt,styleSpec:Xt}):sr[ze]?Gn({key:ze,value:wt[ze],valueSpec:sr[ze],style:Rt,styleSpec:Xt}):[new Ut(ze,wt[ze],`unknown property "${ze}"`)])}return Dr}const Su={"*":()=>[],array:gn,boolean:function(ze){const wt=ze.value,Rt=ze.key,Xt=Wr(wt);return"boolean"!==Xt?[new Ut(Rt,wt,`boolean expected, ${Xt} found`)]:[]},number:xn,color:function(ze){const wt=ze.key,Rt=ze.value,Xt=Wr(Rt);return"string"!==Xt?[new Ut(wt,Rt,`color expected, ${Xt} found`)]:null===lc.parseCSSColor(Rt)?[new Ut(wt,Rt,`color expected, "${Rt}" found`)]:[]},constants:$t,enum:wn,filter:Cn,function:vn,layer:Fn,object:mn,source:$n,light:On,terrain:qn,fog:Nn,string:Rn,formatted:function(ze){return 0===Rn(ze).length?[]:bn(ze)},resolvedImage:function(ze){return 0===Rn(ze).length?[]:bn(ze)}};function Gn(ze){const wt=ze.value,Rt=ze.valueSpec,Xt=ze.styleSpec;return Rt.expression&&Qr(qt(wt))?vn(ze):Rt.expression&&un(Nt(wt))?bn(ze):Rt.type&&Su[Rt.type]?Su[Rt.type](ze):mn(Ot({},ze,{valueSpec:Rt.type?Xt[Rt.type]:Rt}))}function Zn(ze){const wt=ze.value,Rt=ze.key,Xt=Rn(ze);return Xt.length||(-1===wt.indexOf("{fontstack}")&&Xt.push(new Ut(Rt,wt,'"glyphs" url must include a "{fontstack}" token')),-1===wt.indexOf("{range}")&&Xt.push(new Ut(Rt,wt,'"glyphs" url must include a "{range}" token'))),Xt}function Xn(ze,wt=Pl){let Rt=[];return Rt=Rt.concat(Gn({key:"",value:ze,valueSpec:wt.$root,styleSpec:wt,style:ze,objectElementValidators:{glyphs:Zn,"*":()=>[]}})),ze.constants&&(Rt=Rt.concat($t({key:"constants",value:ze.constants,style:ze,styleSpec:wt}))),Kn(Rt)}function Kn(ze){return[].concat(ze).sort((ze,wt)=>ze.line-wt.line)}function Hn(ze){return function(...wt){return Kn(ze.apply(this,wt))}}Xn.source=Hn($n),Xn.light=Hn(On),Xn.terrain=Hn(qn),Xn.fog=Hn(Nn),Xn.layer=Hn(Fn),Xn.filter=Hn(Cn),Xn.paintProperty=Hn(Vn),Xn.layoutProperty=Hn(Ln);const Cu=Xn,Du=Cu.light,Lu=Cu.fog,zu=Cu.paintProperty,Vu=Cu.layoutProperty;function ei(ze,wt){let Rt=!1;if(wt&&wt.length)for(const Xt of wt)ze.fire(new Lt(new Error(Xt.message))),Rt=!0;return Rt}var ed=ni;function ni(ze,wt,Rt){var Xt=this.cells=[];if(ze instanceof ArrayBuffer){this.arrayBuffer=ze;var sr=new Int32Array(this.arrayBuffer);ze=sr[0],this.d=(wt=sr[1])+2*(Rt=sr[2]);for(var Dr=0;Dr<this.d*this.d;Dr++){var Lr=sr[3+Dr],Ur=sr[3+Dr+1];Xt.push(Lr===Ur?null:sr.subarray(Lr,Ur))}var qr=sr[3+Xt.length+1];this.keys=sr.subarray(sr[3+Xt.length],qr),this.bboxes=sr.subarray(qr),this.insert=this._insertReadonly}else{this.d=wt+2*Rt;for(var ri=0;ri<this.d*this.d;ri++)Xt.push([]);this.keys=[],this.bboxes=[]}this.n=wt,this.extent=ze,this.padding=Rt,this.scale=wt/ze,this.uid=0;var ai=Rt/wt*ze;this.min=-ai,this.max=ze+ai}ni.prototype.insert=function(ze,wt,Rt,Xt,sr){this._forEachCell(wt,Rt,Xt,sr,this._insertCell,this.uid++),this.keys.push(ze),this.bboxes.push(wt),this.bboxes.push(Rt),this.bboxes.push(Xt),this.bboxes.push(sr)},ni.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ni.prototype._insertCell=function(ze,wt,Rt,Xt,sr,Dr){this.cells[sr].push(Dr)},ni.prototype.query=function(ze,wt,Rt,Xt,sr){var Dr=this.min,Lr=this.max;if(ze<=Dr&&wt<=Dr&&Lr<=Rt&&Lr<=Xt&&!sr)return Array.prototype.slice.call(this.keys);var Ur=[];return this._forEachCell(ze,wt,Rt,Xt,this._queryCell,Ur,{},sr),Ur},ni.prototype._queryCell=function(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){var qr=this.cells[sr];if(null!==qr)for(var ri=this.keys,ai=this.bboxes,Yi=0;Yi<qr.length;Yi++){var Ji=qr[Yi];if(void 0===Lr[Ji]){var Qi=4*Ji;(Ur?Ur(ai[Qi+0],ai[Qi+1],ai[Qi+2],ai[Qi+3]):ze<=ai[Qi+2]&&wt<=ai[Qi+3]&&Rt>=ai[Qi+0]&&Xt>=ai[Qi+1])?(Lr[Ji]=!0,Dr.push(ri[Ji])):Lr[Ji]=!1}}},ni.prototype._forEachCell=function(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){for(var qr=this._convertToCellCoord(ze),ri=this._convertToCellCoord(wt),ai=this._convertToCellCoord(Rt),Yi=this._convertToCellCoord(Xt),Ji=qr;Ji<=ai;Ji++)for(var Qi=ri;Qi<=Yi;Qi++){var kn=this.d*Qi+Ji;if((!Ur||Ur(this._convertFromCellCoord(Ji),this._convertFromCellCoord(Qi),this._convertFromCellCoord(Ji+1),this._convertFromCellCoord(Qi+1)))&&sr.call(this,ze,wt,Rt,Xt,kn,Dr,Lr,Ur))return}},ni.prototype._convertFromCellCoord=function(ze){return(ze-this.padding)/this.scale},ni.prototype._convertToCellCoord=function(ze){return Math.max(0,Math.min(this.d-1,Math.floor(ze*this.scale)+this.padding))},ni.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var ze=this.cells,wt=3+this.cells.length+1+1,Rt=0,Xt=0;Xt<this.cells.length;Xt++)Rt+=this.cells[Xt].length;var sr=new Int32Array(wt+Rt+this.keys.length+this.bboxes.length);sr[0]=this.extent,sr[1]=this.n,sr[2]=this.padding;
20for(var Dr=wt,Lr=0;Lr<ze.length;Lr++){var Ur=ze[Lr];sr[3+Lr]=Dr,sr.set(Ur,Dr),Dr+=Ur.length}return sr[3+ze.length]=Dr,sr.set(this.keys,Dr),sr[3+ze.length+1]=Dr+=this.keys.length,sr.set(this.bboxes,Dr),Dr+=this.bboxes.length,sr.buffer};const{ImageData:td,ImageBitmap:rd}=sr,id={};function oi(ze,wt,Rt={}){Object.defineProperty(wt,"_classRegistryKey",{value:ze,writeable:!1}),id[ze]={klass:wt,omit:Rt.omit||[],shallow:Rt.shallow||[]}}oi("Object",Object),ed.serialize=function(ze,wt){const Rt=ze.toArrayBuffer();return wt&&wt.push(Rt),{buffer:Rt}},ed.deserialize=function(ze){return new ed(ze.buffer)},oi("Grid",ed),oi("Color",ce),oi("Error",Error),oi("ResolvedImage",fe),oi("StylePropertyFunction",fn),oi("StyleExpression",ln,{omit:["_evaluator"]}),oi("ZoomDependentExpression",pn),oi("ZoomConstantExpression",hn),oi("CompoundExpression",Me,{omit:["_evaluate"]});for(const ze in vu)vu[ze]._classRegistryKey||oi(`Expression_${ze}`,vu[ze]);function li(ze){return ze&&"undefined"!=typeof ArrayBuffer&&(ze instanceof ArrayBuffer||ze.constructor&&"ArrayBuffer"===ze.constructor.name)}function ui(ze){return rd&&ze instanceof rd}function ci(ze,wt){if(null==ze||"boolean"==typeof ze||"number"==typeof ze||"string"==typeof ze||ze instanceof Boolean||ze instanceof Number||ze instanceof String||ze instanceof Date||ze instanceof RegExp)return ze;if(li(ze)||ui(ze))return wt&&wt.push(ze),ze;if(ArrayBuffer.isView(ze)){const Rt=ze;return wt&&wt.push(Rt.buffer),Rt}if(ze instanceof td)return wt&&wt.push(ze.data.buffer),ze;if(Array.isArray(ze)){const Rt=[];for(const Xt of ze)Rt.push(ci(Xt,wt));return Rt}if("object"==typeof ze){const Rt=ze.constructor,Xt=Rt._classRegistryKey;if(!Xt)throw new Error("can't serialize object of unregistered class");const sr=Rt.serialize?Rt.serialize(ze,wt):{};if(!Rt.serialize){for(const Rt in ze){if(!ze.hasOwnProperty(Rt))continue;if(id[Xt].omit.indexOf(Rt)>=0)continue;const Dr=ze[Rt];sr[Rt]=id[Xt].shallow.indexOf(Rt)>=0?Dr:ci(Dr,wt)}ze instanceof Error&&(sr.message=ze.message)}if(sr.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==Xt&&(sr.$name=Xt),sr}throw new Error("can't serialize object of type "+typeof ze)}function hi(ze){if(null==ze||"boolean"==typeof ze||"number"==typeof ze||"string"==typeof ze||ze instanceof Boolean||ze instanceof Number||ze instanceof String||ze instanceof Date||ze instanceof RegExp||li(ze)||ui(ze)||ArrayBuffer.isView(ze)||ze instanceof td)return ze;if(Array.isArray(ze))return ze.map(hi);if("object"==typeof ze){const wt=ze.$name||"Object",{klass:Rt}=id[wt];if(!Rt)throw new Error(`can't deserialize unregistered class ${wt}`);if(Rt.deserialize)return Rt.deserialize(ze);const Xt=Object.create(Rt.prototype);for(const Rt of Object.keys(ze)){if("$name"===Rt)continue;const sr=ze[Rt];Xt[Rt]=id[wt].shallow.indexOf(Rt)>=0?sr:hi(sr)}return Xt}throw new Error("can't deserialize object of type "+typeof ze)}class pi{constructor(){this.first=!0}update(ze,wt){const Rt=Math.floor(ze);return this.first?(this.first=!1,this.lastIntegerZoom=Rt,this.lastIntegerZoomTime=0,this.lastZoom=ze,this.lastFloorZoom=Rt,!0):(this.lastFloorZoom>Rt?(this.lastIntegerZoom=Rt+1,this.lastIntegerZoomTime=wt):this.lastFloorZoom<Rt&&(this.lastIntegerZoom=Rt,this.lastIntegerZoomTime=wt),ze!==this.lastZoom&&(this.lastZoom=ze,this.lastFloorZoom=Rt,!0))}}const di=ze=>ze>=1536&&ze<=1791,fi=ze=>ze>=1872&&ze<=1919,yi=ze=>ze>=2208&&ze<=2303,mi=ze=>ze>=11904&&ze<=12031,gi=ze=>ze>=12032&&ze<=12255,xi=ze=>ze>=12272&&ze<=12287,vi=ze=>ze>=12288&&ze<=12351,bi=ze=>ze>=12352&&ze<=12447,wi=ze=>ze>=12448&&ze<=12543,_i=ze=>ze>=12544&&ze<=12591,ki=ze=>ze>=12704&&ze<=12735,Ai=ze=>ze>=12736&&ze<=12783,Si=ze=>ze>=12784&&ze<=12799,Ii=ze=>ze>=12800&&ze<=13055,zi=ze=>ze>=13056&&ze<=13311,Ti=ze=>ze>=13312&&ze<=19903,Mi=ze=>ze>=19968&&ze<=40959,Ei=ze=>ze>=40960&&ze<=42127,Bi=ze=>ze>=42128&&ze<=42191,Ci=ze=>ze>=44032&&ze<=55215,Pi=ze=>ze>=63744&&ze<=64255,Di=ze=>ze>=64336&&ze<=65023,Vi=ze=>ze>=65040&&ze<=65055,Li=ze=>ze>=65072&&ze<=65103,Fi=ze=>ze>=65104&&ze<=65135,Ri=ze=>ze>=65136&&ze<=65279,Ui=ze=>ze>=65280&&ze<=65519;function $i(ze){for(const wt of ze)if(Ni(wt.charCodeAt(0)))return!0;return!1}function Oi(ze){for(const wt of ze)if(!qi(wt.charCodeAt(0)))return!1;return!0}function qi(ze){return!(di(ze)||fi(ze)||yi(ze)||Di(ze)||Ri(ze))}function Ni(ze){return!(746!==ze&&747!==ze&&(ze<4352||!(ki(ze)||_i(ze)||Li(ze)&&!(ze>
vendor: 10,804 bytes, line 20
20=65097&&ze<=65103)||Pi(ze)||zi(ze)||mi(ze)||Ai(ze)||!(!vi(ze)||ze>=12296&&ze<=12305||ze>=12308&&ze<=12319||12336===ze)||Ti(ze)||Mi(ze)||Ii(ze)||(ze=>ze>=12592&&ze<=12687)(ze)||(ze=>ze>=43360&&ze<=43391)(ze)||(ze=>ze>=55216&&ze<=55295)(ze)||(ze=>ze>=4352&&ze<=4607)(ze)||Ci(ze)||bi(ze)||xi(ze)||(ze=>ze>=12688&&ze<=12703)(ze)||gi(ze)||Si(ze)||wi(ze)&&12540!==ze||!(!Ui(ze)||65288===ze||65289===ze||65293===ze||ze>=65306&&ze<=65310||65339===ze||65341===ze||65343===ze||ze>=65371&&ze<=65503||65507===ze||ze>=65512&&ze<=65519)||!(!Fi(ze)||ze>=65112&&ze<=65118||ze>=65123&&ze<=65126)||(ze=>ze>=5120&&ze<=5759)(ze)||(ze=>ze>=6320&&ze<=6399)(ze)||Vi(ze)||(ze=>ze>=19904&&ze<=19967)(ze)||Ei(ze)||Bi(ze))))}function ji(ze){return!(Ni(ze)||function(ze){return!!((ze=>ze>=128&&ze<=255)(ze)&&(167===ze||169===ze||174===ze||177===ze||188===ze||189===ze||190===ze||215===ze||247===ze)||(ze=>ze>=8192&&ze<=8303)(ze)&&(8214===ze||8224===ze||8225===ze||8240===ze||8241===ze||8251===ze||8252===ze||8258===ze||8263===ze||8264===ze||8265===ze||8273===ze)||(ze=>ze>=8448&&ze<=8527)(ze)||(ze=>ze>=8528&&ze<=8591)(ze)||(ze=>ze>=8960&&ze<=9215)(ze)&&(ze>=8960&&ze<=8967||ze>=8972&&ze<=8991||ze>=8996&&ze<=9e3||9003===ze||ze>=9085&&ze<=9114||ze>=9150&&ze<=9165||9167===ze||ze>=9169&&ze<=9179||ze>=9186&&ze<=9215)||(ze=>ze>=9216&&ze<=9279)(ze)&&9251!==ze||(ze=>ze>=9280&&ze<=9311)(ze)||(ze=>ze>=9312&&ze<=9471)(ze)||(ze=>ze>=9632&&ze<=9727)(ze)||(ze=>ze>=9728&&ze<=9983)(ze)&&!(ze>=9754&&ze<=9759)||(ze=>ze>=11008&&ze<=11263)(ze)&&(ze>=11026&&ze<=11055||ze>=11088&&ze<=11097||ze>=11192&&ze<=11243)||vi(ze)||wi(ze)||(ze=>ze>=57344&&ze<=63743)(ze)||Li(ze)||Fi(ze)||Ui(ze)||8734===ze||8756===ze||8757===ze||ze>=9984&&ze<=10087||ze>=10102&&ze<=10131||65532===ze||65533===ze)}(ze))}function Gi(ze){return ze>=1424&&ze<=2303||Di(ze)||Ri(ze)}function Zi(ze,wt){return!(!wt&&Gi(ze)||ze>=2304&&ze<=3583||ze>=3840&&ze<=4255||(ze=>ze>=6016&&ze<=6143)(ze))}function Xi(ze){for(const wt of ze)if(Gi(wt.charCodeAt(0)))return!0;return!1}const nd="deferred",od="loading",ad="loaded";let sd=null,ld="unavailable",cd=null;const ts=function(ze){ze&&"string"==typeof ze&&ze.indexOf("NetworkError")>-1&&(ld="error"),sd&&sd(ze)};function es(){ud.fire(new Vt("pluginStateChange",{pluginStatus:ld,pluginURL:cd}))}const ud=new Ft,ns=function(){return ld},is=function(){if(ld!==nd||!cd)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ld=od,es(),cd&&St({url:cd},ze=>{ze?ts(ze):(ld=ad,es())})},dd={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ld===ad||null!=dd.applyArabicShaping,isLoading:()=>ld===od,setState(ze){ld=ze.pluginStatus,cd=ze.pluginURL},isParsed:()=>null!=dd.applyArabicShaping&&null!=dd.processBidirectionalText&&null!=dd.processStyledBidirectionalText,getPluginURL:()=>cd};class as{constructor(ze,wt){this.zoom=ze,wt?(this.now=wt.now,this.fadeDuration=wt.fadeDuration,this.zoomHistory=wt.zoomHistory,this.transition=wt.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new pi,this.transition={})}isSupportedScript(ze){return function(ze,wt){for(const Rt of ze)if(!Zi(Rt.charCodeAt(0),wt))return!1;return!0}(ze,dd.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const ze=this.zoom,wt=ze-Math.floor(ze),Rt=this.crossFadingFactor();return ze>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:wt+(1-wt)*Rt}:{fromScale:.5,toScale:1,t:1-(1-Rt)*wt}}}class os{constructor(ze,wt){this.property=ze,this.value=wt,this.expression=function(ze,wt){if(Qr(ze))return new fn(ze,wt);if(un(ze)){const Rt=dn(ze,wt);if("error"===Rt.result)throw new Error(Rt.value.map(ze=>`${ze.key}: ${ze.message}`).join(", "));return Rt.value}{let Rt=ze;return"string"==typeof ze&&"color"===wt.type&&(Rt=ce.parse(ze)),{kind:"constant",evaluate:()=>Rt}}}(void 0===wt?ze.specification.default:wt,ze.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(ze,wt,Rt){return this.property.possiblyEvaluate(this,ze,wt,Rt)}}class ls{constructor(ze){this.property=ze,this.value=new os(ze,void 0)}transitioned(ze,wt){return new cs(this.property,this.value,wt,v({},ze.transition,this.transition),ze.now)}untransitioned(){return new cs(this.property,this.value,null,{},0)}}class us{constructor(ze){this._properties=ze,this._values=Object.create(ze.defaultTransitionablePropertyValues)}getValue(ze){return M(this._values[ze].value.value)}setValue(ze,wt){this._values.hasOwnProperty(ze)||(this._values[ze]=new ls(this._values[ze].property)),this._values[ze].value=new os(this._values[ze].property,null===wt?void 0:M(wt))}getTransition(ze){return M(this._values[ze].transition)}setTransition(ze,wt){this._values.hasOwnProperty(ze)||(this._values[ze]=new ls(this._values[ze].property)),this._values[ze].transition=M(wt)||void 0}serialize(){const ze={};for(const wt of Object.keys(this._values)){const Rt=this.getValue(wt);void 0!==Rt&&(ze[wt]=Rt);const Xt=this.getTransition(wt);void 0!==Xt&&(ze[`${wt}-transition`]=Xt)}return ze}transitioned(ze,wt){const Rt=new hs(this._properties);for(const Xt of Object.keys(this._values))Rt._values[Xt]=this._values[Xt].transitioned(ze,wt._values[Xt]);return Rt}untransitioned(){const ze=new hs(this._properties);for(const wt of Object.keys(this._values))ze._values[wt]=this._values[wt].untransitioned();return ze}}class cs{constructor(ze,wt,Rt,Xt,sr){const Dr=Xt.delay||0,Lr=Xt.duration||0;sr=sr||0,this.property=ze,this.value=wt,this.begin=sr+Dr,this.end=this.begin+Lr,ze.specification.transition&&(Xt.delay||Xt.duration)&&(this.prior=Rt)}possiblyEvaluate(ze,wt,Rt){const Xt=ze.now||0,sr=this.value.possiblyEvaluate(ze,wt,Rt),Dr=this.prior;if(Dr){if(Xt>this.end)return this.prior=null,sr;if(this.value.isDataDriven())return this.prior=null,sr;if(Xt<this.begin)return Dr.possiblyEvaluate(ze,wt,Rt);{const Lr=(Xt-this.begin)/(this.end-this.begin);return this.property.interpolate(Dr.possiblyEvaluate(ze,wt,Rt),sr,p(Lr))}}return sr}}class hs{constructor(ze){this._properties=ze,this._values=Object.create(ze.defaultTransitioningPropertyValues)}possiblyEvaluate(ze,wt,Rt){const Xt=new fs(this._properties);for(const sr of Object.keys(this._values))Xt._values[sr]=this._values[sr].possiblyEvaluate(ze,wt,Rt);return Xt}hasTransition(){for(const ze of Object.keys(this._values))if(this._values[ze].prior)return!0;return!1}}class ps{constructor(ze){this._properties=ze,this._values=Object.create(ze.defaultPropertyValues)}getValue(ze){return M(this._values[ze].value)}setValue(ze,wt){this._values[ze]=new os(this._values[ze].property,null===wt?void 0:M(wt))}serialize(){const ze={};for(const wt of Object.keys(this._values)){const Rt=this.getValue(wt);void 0!==Rt&&(ze[wt]=Rt)}return ze}possiblyEvaluate(ze,wt,Rt){const Xt=new fs(this._properties);for(const sr of Object.keys(this._values))Xt._values[sr]=this._values[sr].possiblyEvaluate(ze,wt,Rt);return Xt}}class ds{constructor(ze,wt,Rt){this.property=ze,this.value=wt,this.parameters=Rt}isConstant(){return"constant"===this.value.kind}constantOr(ze){return"constant"===this.value.kind?this.value.value:ze}evaluate(ze,wt,Rt,Xt){return this.property.evaluate(this.value,this.parameters,ze,wt,Rt,Xt)}}class fs{constructor(ze){this._properties=ze,this._values=Object.create(ze.defaultPossiblyEvaluatedValues)}get(ze){return this._values[ze]}}class ys{constructor(ze){this.specification=ze}possiblyEvaluate(ze,wt){return ze.expression.evaluate(wt)}interpolate(ze,wt,Rt){const Xt=Vc[this.specification.type];return Xt?Xt(ze,wt,Rt):ze}}class ms{constructor(ze,wt){this.specification=ze,this.overrides=wt}possiblyEvaluate(ze,wt,Rt,Xt){return new ds(this,"constant"===ze.expression.kind||"camera"===ze.expression.kind?{kind:"constant",value:ze.expression.evaluate(wt,null,{},Rt,Xt)}:ze.expression,wt)}interpolate(ze,wt,Rt){if("constant"!==ze.value.kind||"constant"!==wt.value.kind)return ze;if(void 0===ze.value.value||void 0===wt.value.value)return new ds(this,{kind:"constant",value:void 0},ze.parameters);const Xt=Vc[this.specification.type];return Xt?new ds(this,{kind:"constant",value:Xt(ze.value.value,wt.value.value,Rt)},ze.parameters):ze}evaluate(ze,wt,Rt,Xt,sr,Dr){return"constant"===ze.kind?ze.value:ze.evaluate(wt,Rt,Xt,sr,Dr)}}class gs extends ms{possiblyEvaluate(ze,wt,Rt,Xt){if(void 0===ze.value)return new ds(this,{kind:"constant",value:void 0},wt);if("constant"===ze.expression.kind){const sr=ze.expression.evaluate(wt,null,{},Rt,Xt),Dr="resolvedImage"===ze.property.specification.type&&"string"!=typeof sr?sr.name:sr,Lr=this._calculate(Dr,Dr,Dr,wt);return new ds(this,{kind:"constant",value:Lr},wt)}if("camera"===ze.expression.kind){const Rt=this._calculate(ze.expression.evaluate({zoom:wt.zoom-1}),ze.expression.evaluate({zoom:wt.zoom}),ze.expression.evaluate({zoom:wt.zoom+1}),wt);return new ds(this,{kind:"constant",value:Rt},wt)}return new ds(this,ze.expression,wt)}evaluate(ze,wt,Rt,Xt,sr,Dr){if("source"===ze.kind){const Lr=ze.evaluate(wt,Rt,Xt,sr,Dr);return this._calculate(Lr,Lr,Lr,wt)}return"composite"===ze.kind?this._calculate(ze.evaluate({zoom:Math.floor(wt.zoom)-1},Rt,Xt),ze.evaluate({zoom:Math.floor(wt.zoom)},Rt,Xt),ze.evaluate({zoom:Math.floor(wt.zoom)+1},Rt,Xt),wt):ze.value}_calculate(ze,wt,Rt,Xt){return Xt.zoom>Xt.zoomHistory.lastIntegerZoom?{from:ze,to:wt,other:Rt}:{from:Rt,to:wt,other:ze}}interpolate(ze){return ze}}class xs{constructor(ze){this.specification=ze}possiblyEvaluate(ze,wt,Rt,Xt){if(void 0!==ze.value){if("constant"===ze.expression.kind){const sr=ze.expression.evaluate(wt,null,{},Rt,Xt);return this._calculate(sr,sr,sr,wt)}return this._calculate(ze.expression.evaluate(new as(Math.floor(wt.zoom-1),wt)),ze.expression.evaluate(new as(Math.floor(wt.zoom),wt)),ze.expression.evaluate(new as(Math.floor(wt.zoom+1),wt)),wt)}}_calculate(ze,wt,Rt,Xt){return Xt.zoom>Xt.zoomHistory.lastIntegerZoom?{from:ze,to:wt}:{from:Rt,to:wt}}interpolate(ze){return ze}}class vs{constructor(ze){this.specification=ze}possiblyEvaluate(ze,wt,Rt,Xt){return!!ze.expression.evaluate(wt,null,{},Rt,Xt)}interpolate(){return!1}}class bs{constructor(ze){this.properties=ze,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const wt in ze){const Rt=ze[wt];Rt.specification.overridable&&this.overridableProperties.push(wt);const Xt=this.defaultPropertyValues[wt]=new os(Rt,void 0),sr=this.defaultTransitionablePropertyValues[wt]=new ls(Rt);this.defaultTransitioningPropertyValues[wt]=sr.untransitioned(),this.defaultPossiblyEvaluatedValues[wt]=Xt.possiblyEvaluate({})}}}function ws(ze,wt){return 256*(ze=y(Math.floor(ze),0,255))+y(Math.floor(wt),0,255)}
vendor: 16,150 bytes, line 20
20oi("DataDrivenProperty",ms),oi("DataConstantProperty",ys),oi("CrossFadedDataDrivenProperty",gs),oi("CrossFadedProperty",xs),oi("ColorRampProperty",vs);const hd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ks{constructor(ze,wt){this._structArray=ze,this._pos1=wt*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class As{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(ze,wt){return ze._trim(),wt&&(ze.isTransferred=!0,wt.push(ze.arrayBuffer)),{length:ze.length,arrayBuffer:ze.arrayBuffer}}static deserialize(ze){const wt=Object.create(this.prototype);return wt.arrayBuffer=ze.arrayBuffer,wt.length=ze.length,wt.capacity=ze.arrayBuffer.byteLength/wt.bytesPerElement,wt._refreshViews(),wt}_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(ze){this.reserve(ze),this.length=ze}reserve(ze){if(ze>this.capacity){this.capacity=Math.max(ze,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const wt=this.uint8;this._refreshViews(),wt&&this.uint8.set(wt)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ss(ze,wt=1){let Rt=0,Xt=0;return{members:ze.map(ze=>{const sr=hd[ze.type].BYTES_PER_ELEMENT,Dr=Rt=Is(Rt,Math.max(wt,sr)),Lr=ze.components||1;return Xt=Math.max(Xt,sr),Rt+=sr*Lr,{name:ze.name,type:ze.type,components:Lr,offset:Dr}}),size:Is(Rt,Math.max(Xt,wt)),alignment:wt}}function Is(ze,wt){return Math.ceil(ze/wt)*wt}class zs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt){const Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ze,wt)}emplace(ze,wt,Rt){const Xt=2*ze;return this.int16[Xt+0]=wt,this.int16[Xt+1]=Rt,ze}}zs.prototype.bytesPerElement=4,oi("StructArrayLayout2i4",zs);class Ts extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt){const sr=this.length;return this.resize(sr+1),this.emplace(sr,ze,wt,Rt,Xt)}emplace(ze,wt,Rt,Xt,sr){const Dr=4*ze;return this.int16[Dr+0]=wt,this.int16[Dr+1]=Rt,this.int16[Dr+2]=Xt,this.int16[Dr+3]=sr,ze}}Ts.prototype.bytesPerElement=8,oi("StructArrayLayout4i8",Ts);class Ms extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=this.length;return this.resize(Ur+1),this.emplace(Ur,ze,wt,Rt,Xt,sr,Dr,Lr)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=6*ze,ri=12*ze,ai=3*ze;return this.int16[qr+0]=wt,this.int16[qr+1]=Rt,this.uint8[ri+4]=Xt,this.uint8[ri+5]=sr,this.uint8[ri+6]=Dr,this.uint8[ri+7]=Lr,this.float32[ai+2]=Ur,ze}}Ms.prototype.bytesPerElement=12,oi("StructArrayLayout2i4ub1f12",Ms);class Es extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze,wt){const Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ze,wt)}emplace(ze,wt,Rt){const Xt=2*ze;return this.float32[Xt+0]=wt,this.float32[Xt+1]=Rt,ze}}Es.prototype.bytesPerElement=8,oi("StructArrayLayout2f8",Es);class Bs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri){const ai=this.length;return this.resize(ai+1),this.emplace(ai,ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai){const Yi=10*ze;return this.uint16[Yi+0]=wt,this.uint16[Yi+1]=Rt,this.uint16[Yi+2]=Xt,this.uint16[Yi+3]=sr,this.uint16[Yi+4]=Dr,this.uint16[Yi+5]=Lr,this.uint16[Yi+6]=Ur,this.uint16[Yi+7]=qr,this.uint16[Yi+8]=ri,this.uint16[Yi+9]=ai,ze}}Bs.prototype.bytesPerElement=20,oi("StructArrayLayout10ui20",Bs);class Cs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=this.length;return this.resize(qr+1),this.emplace(qr,ze,wt,Rt,Xt,sr,Dr,Lr,Ur)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=8*ze;return this.uint16[ri+0]=wt,this.uint16[ri+1]=Rt,this.uint16[ri+2]=Xt,this.uint16[ri+3]=sr,this.uint16[ri+4]=Dr,this.uint16[ri+5]=Lr,this.uint16[ri+6]=Ur,this.uint16[ri+7]=qr,ze}}Cs.prototype.bytesPerElement=16,oi("StructArrayLayout8ui16",Cs);class Ps extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi){const Ji=this.length;return this.resize(Ji+1),this.emplace(Ji,ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji){const Qi=12*ze;return this.int16[Qi+0]=wt,this.int16[Qi+1]=Rt,this.int16[Qi+2]=Xt,this.int16[Qi+3]=sr,this.uint16[Qi+4]=Dr,this.uint16[Qi+5]=Lr,this.uint16[Qi+6]=Ur,this.uint16[Qi+7]=qr,this.int16[Qi+8]=ri,this.int16[Qi+9]=ai,this.int16[Qi+10]=Yi,this.int16[Qi+11]=Ji,ze}}Ps.prototype.bytesPerElement=24,oi("StructArrayLayout4i4ui4i24",Ps);class Ds extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,ze,wt,Rt)}emplace(ze,wt,Rt,Xt){const sr=3*ze;return this.float32[sr+0]=wt,this.float32[sr+1]=Rt,this.float32[sr+2]=Xt,ze}}Ds.prototype.bytesPerElement=12,oi("StructArrayLayout3f12",Ds);class Vs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(ze){const wt=this.length;return this.resize(wt+1),this.emplace(wt,ze)}emplace(ze,wt){return this.uint32[1*ze+0]=wt,ze}}Vs.prototype.bytesPerElement=4,oi("StructArrayLayout1ul4",Vs);class Ls extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri){const ai=this.length;return this.resize(ai+1),this.emplace(ai,ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai){const Yi=16*ze,Ji=8*ze;return this.int16[Yi+0]=wt,this.int16[Yi+1]=Rt,this.float32[Ji+1]=Xt,this.float32[Ji+2]=sr,this.float32[Ji+3]=Dr,this.float32[Ji+4]=Lr,this.int16[Yi+10]=Ur,this.uint32[Ji+6]=qr,this.uint16[Yi+14]=ri,this.uint16[Yi+15]=ai,ze}}Ls.prototype.bytesPerElement=32,oi("StructArrayLayout2i4f1i1ul2ui32",Ls);class Fs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr){const Lr=this.length;return this.resize(Lr+1),this.emplace(Lr,ze,wt,Rt,Xt,sr,Dr)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=6*ze;return this.int16[Ur+0]=wt,this.int16[Ur+1]=Rt,this.int16[Ur+2]=Xt,this.int16[Ur+3]=sr,this.int16[Ur+4]=Dr,this.int16[Ur+5]=Lr,ze}}Fs.prototype.bytesPerElement=12,oi("StructArrayLayout2i2i2i12",Fs);class Rs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr){const Dr=this.length;return this.resize(Dr+1),this.emplace(Dr,ze,wt,Rt,Xt,sr)}emplace(ze,wt,Rt,Xt,sr,Dr){const Lr=4*ze,Ur=8*ze;return this.float32[Lr+0]=wt,this.float32[Lr+1]=Rt,this.float32[Lr+2]=Xt,this.int16[Ur+6]=sr,this.int16[Ur+7]=Dr,ze}}Rs.prototype.bytesPerElement=16,oi("StructArrayLayout2f1f2i16",Rs);class Us extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt){const sr=this.length;return this.resize(sr+1),this.emplace(sr,ze,wt,Rt,Xt)}emplace(ze,wt,Rt,Xt,sr){const Dr=12*ze,Lr=3*ze;return this.uint8[Dr+0]=wt,this.uint8[Dr+1]=Rt,this.float32[Lr+1]=Xt,this.float32[Lr+2]=sr,ze}}Us.prototype.bytesPerElement=12,oi("StructArrayLayout2ub2f12",Us);class $s extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,ze,wt,Rt)}emplace(ze,wt,Rt,Xt){const sr=3*ze;return this.uint16[sr+0]=wt,this.uint16[sr+1]=Rt,this.uint16[sr+2]=Xt,ze}}$s.prototype.bytesPerElement=6,oi("StructArrayLayout3ui6",$s);class Os extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn){const Yn=this.length;return this.resize(Yn+1),this.emplace(Yn,ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn){const Jn=13*ze,Qn=26*ze,Io=52*ze;return this.float32[Jn+0]=wt,this.float32[Jn+1]=Rt,this.uint16[Qn+4]=Xt,this.uint16[Qn+5]=sr,this.uint32[Jn+3]=Dr,this.uint32[Jn+4]=Lr,this.uint32[Jn+5]=Ur,this.uint16[Qn+12]=qr,this.uint16[Qn+13]=ri,this.uint16[Qn+14]=ai,this.float32[Jn+8]=Yi,this.float32[Jn+9]=Ji,this.uint8[Io+40]=Qi,this.uint8[Io+41]=kn,this.uint8[Io+42]=jn,this.uint32[Jn+11]=Un,this.int16[Qn+24]=Wn,this.uint8[Io+50]=Yn,ze}}Os.prototype.bytesPerElement=52,oi("StructArrayLayout2f2ui3ul3ui2f3ub1ul1i1ub52",Os);class qs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Mo,jo,zo,oa,la){const ca=this.length;return this.resize(ca+1),this.emplace(ca,ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Mo,jo,zo,oa,la)}emplace(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Mo,jo,zo,oa,la,ca){const ua=17*ze,ha=34*ze;return this.float32[ua+0]=wt,this.float32[ua+1]=Rt,this.int16[ha+4]=Xt,this.int16[ha+5]=sr,this.int16[ha+6]=Dr,this.int16[ha+7]=Lr,this.int16[ha+8]=Ur,this.int16[ha+9]=qr,this.uint16[ha+10]=ri,this.uint16[ha+11]=ai,this.uint16[ha+12]=Yi,this.uint16[ha+13]=Ji,this.uint16[ha+14]=Qi,this.uint16[ha+15]=kn,this.uint16[ha+16]=jn,this.uint16[ha+17]=Un,this.uint16[ha+18]=Wn,this.uint16[ha+19]=Yn,this.uint16[ha+20]=Jn,this.uint16[ha+21]=Qn,this.uint16[ha+22]=Io,this.uint16[ha+23]=Mo,this.uint16[ha+24]=jo,this.uint32[ua+13]=zo,this.float32[ua+14]=oa,this.float32[ua+15]=la,this.float32[ua+16]=ca,ze}}qs.prototype.bytesPerElement=68,oi("StructArrayLayout2f6i15ui1ul3f68",qs);class Ns extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze){const wt=this.length;return this.resize(wt+1),this.emplace(wt,ze)}emplace(ze,wt){return this.float32[1*ze+0]=wt,ze}}Ns.prototype.bytesPerElement=4,oi("StructArrayLayout1f4",Ns);class js extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,ze,wt,Rt)}emplace(ze,wt,Rt,Xt){const sr=3*ze;return this.int16[sr+0]=wt,this.int16[sr+1]=Rt,this.int16[sr+2]=Xt,ze}}js.prototype.bytesPerElement=6,oi("StructArrayLayout3i6",js);class Gs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt){const sr=this.length;return this.resize(sr+1),this.emplace(sr,ze,wt,Rt,Xt)}emplace(ze,wt,Rt,Xt,sr){const Dr=6*ze;return this.uint32[3*ze+0]=wt,this.uint16[Dr+2]=Rt,this.uint16[Dr+3]=Xt,this.uint16[Dr+4]=sr,ze}}Gs.prototype.bytesPerElement=12,oi("StructArrayLayout1ul3ui12",Gs);class Zs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze,wt){const Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ze,wt)}emplace(ze,wt,Rt){const Xt=2*ze;return this.uint16[Xt+0]=wt,this.uint16[Xt+1]=Rt,ze}}Zs.prototype.bytesPerElement=4,oi("StructArrayLayout2ui4",Zs);class Xs extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(ze){const wt=this.length;return this.resize(wt+1),this.emplace(wt,ze)}emplace(ze,wt){return this.uint16[1*ze+0]=wt,ze}}Xs.prototype.bytesPerElement=2,oi("StructArrayLayout1ui2",Xs);class Ks extends As{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(ze,wt,Rt,Xt){const sr=this.length;return this.resize(sr+1),this.emplace(sr,ze,wt,Rt,Xt)}emplace(ze,wt,Rt,Xt,sr){const Dr=4*ze;return this.float32[Dr+0]=wt,this.float32[Dr+1]=Rt,this.float32[Dr+2]=Xt,this.float32[Dr+3]=sr,ze}}Ks.prototype.bytesPerElement=16,oi("StructArrayLayout4f16",Ks);class Hs extends ks{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.float32[this._pos4+1]}get y1(){return this._structArray.float32[this._pos4+2]}get x2(){return this._structArray.float32[this._pos4+3]}get y2(){return this._structArray.float32[this._pos4+4]}get padding(){return this._structArray.int16[this._pos2+10]}get featureIndex(){return this._structArray.uint32[this._pos4+6]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+14]}get bucketIndex(){return this._structArray.uint16[this._pos2+15]}get anchorPoint(){return new Xt(this.anchorPointX,this.anchorPointY)}}Hs.prototype.size=32;class Ys extends Ls{get(ze){return new Hs(this,ze)}}oi("CollisionBoxArray",Ys);class Js extends ks{get anchorX(){return this._structArray.float32[this._pos4+0]}get anchorY(){return this._structArray.float32[this._pos4+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+4]}get numGlyphs(){return this._structArray.uint16[this._pos2+5]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineStartIndex(){return this._structArray.uint32[this._pos4+4]}get lineLength(){return this._structArray.uint32[this._pos4+5]}get segment(){return this._structArray.uint16[this._pos2+12]}get lowerSize(){return this._structArray.uint16[this._pos2+13]}get upperSize(){return this._structArray.uint16[this._pos2+14]}get lineOffsetX(){return this._structArray.float32[this._pos4+8]}get lineOffsetY(){return this._structArray.float32[this._pos4+9]}get writingMode(){return this._structArray.uint8[this._pos1+40]}get placedOrientation(){return this._structArray.uint8[this._pos1+41]}set placedOrientation(ze){this._structArray.uint8[this._pos1+41]=ze}get hidden(){return this._structArray.uint8[this._pos1+42]}set hidden(ze){this._structArray.uint8[this._pos1+42]=ze}get crossTileID(){return this._structArray.uint32[this._pos4+11]}set crossTileID(ze){this._structArray.uint32[this._pos4+11]=ze}get associatedIconIndex(){return this._structArray.int16[this._pos2+24]}get flipState(){return this._structArray.uint8[this._pos1+50]}set flipState(ze){this._structArray.uint8[this._pos1+50]=ze}}Js.prototype.size=52;class Ws extends Os{get(ze){return new Js(this,ze)}}oi("PlacedSymbolArray",Ws);class Qs extends ks{get anchorX(){return this._structArray.float32[this._pos4+0]}get anchorY(){return this._structArray.float32[this._pos4+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+8]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+9]}
vendor: 4,587 bytes, line 20
20get key(){return this._structArray.uint16[this._pos2+10]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get featureIndex(){return this._structArray.uint16[this._pos2+19]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+21]}get numIconVertices(){return this._structArray.uint16[this._pos2+22]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+23]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+24]}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(ze){this._structArray.uint32[this._pos4+13]=ze}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Qs.prototype.size=68;class ta extends qs{get(ze){return new Qs(this,ze)}}oi("SymbolInstanceArray",ta);class ea extends Ns{getoffsetX(ze){return this.float32[1*ze+0]}}oi("GlyphOffsetArray",ea);class ra extends js{getx(ze){return this.int16[3*ze+0]}gety(ze){return this.int16[3*ze+1]}gettileUnitDistanceFromAnchor(ze){return this.int16[3*ze+2]}}oi("SymbolLineVertexArray",ra);class na extends ks{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}na.prototype.size=12;class ia extends Gs{get(ze){return new na(this,ze)}}oi("FeatureIndexArray",ia);class sa extends ks{get a_centroid_pos0(){return this._structArray.uint16[this._pos2+0]}get a_centroid_pos1(){return this._structArray.uint16[this._pos2+1]}}sa.prototype.size=4;class aa extends Zs{get(ze){return new sa(this,ze)}}oi("FillExtrusionCentroidArray",aa);const pd=Ss([{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"}]),fd=Ss([{name:"a_dash_to",components:4,type:"Uint16"},{name:"a_dash_from",components:4,type:"Uint16"}]);var md=le(function(ze){ze.exports=function(ze,wt){var Rt,Xt,sr,Dr,Lr,Ur,qr,ri;for(Xt=ze.length-(Rt=3&ze.length),sr=wt,Lr=3432918353,Ur=461845907,ri=0;ri<Xt;)qr=255&ze.charCodeAt(ri)|(255&ze.charCodeAt(++ri))<<8|(255&ze.charCodeAt(++ri))<<16|(255&ze.charCodeAt(++ri))<<24,++ri,sr=27492+(65535&(Dr=5*(65535&(sr=(sr^=qr=(65535&(qr=(qr=(65535&qr)*Lr+(((qr>>>16)*Lr&65535)<<16)&4294967295)<<15|qr>>>17))*Ur+(((qr>>>16)*Ur&65535)<<16)&4294967295)<<13|sr>>>19))+((5*(sr>>>16)&65535)<<16)&4294967295))+((58964+(Dr>>>16)&65535)<<16);switch(qr=0,Rt){case 3:qr^=(255&ze.charCodeAt(ri+2))<<16;case 2:qr^=(255&ze.charCodeAt(ri+1))<<8;case 1:sr^=qr=(65535&(qr=(qr=(65535&(qr^=255&ze.charCodeAt(ri)))*Lr+(((qr>>>16)*Lr&65535)<<16)&4294967295)<<15|qr>>>17))*Ur+(((qr>>>16)*Ur&65535)<<16)&4294967295}return sr^=ze.length,sr=2246822507*(65535&(sr^=sr>>>16))+((2246822507*(sr>>>16)&65535)<<16)&4294967295,sr=3266489909*(65535&(sr^=sr>>>13))+((3266489909*(sr>>>16)&65535)<<16)&4294967295,(sr^=sr>>>16)>>>0}}),gd=le(function(ze){ze.exports=function(ze,wt){for(var Rt,Xt=ze.length,sr=wt^Xt,Dr=0;Xt>=4;)Rt=1540483477*(65535&(Rt=255&ze.charCodeAt(Dr)|(255&ze.charCodeAt(++Dr))<<8|(255&ze.charCodeAt(++Dr))<<16|(255&ze.charCodeAt(++Dr))<<24))+((1540483477*(Rt>>>16)&65535)<<16),sr=1540483477*(65535&sr)+((1540483477*(sr>>>16)&65535)<<16)^(Rt=1540483477*(65535&(Rt^=Rt>>>24))+((1540483477*(Rt>>>16)&65535)<<16)),Xt-=4,++Dr;switch(Xt){case 3:sr^=(255&ze.charCodeAt(Dr+2))<<16;case 2:sr^=(255&ze.charCodeAt(Dr+1))<<8;case 1:sr=1540483477*(65535&(sr^=255&ze.charCodeAt(Dr)))+((1540483477*(sr>>>16)&65535)<<16)}return sr=1540483477*(65535&(sr^=sr>>>13))+((1540483477*(sr>>>16)&65535)<<16),(sr^=sr>>>15)>>>0}}),yd=md,_d=gd;yd.murmur3=md,yd.murmur2=_d;class da{constructor(){this.ids=[],this.positions=[],this.indexed=!1}
vendor: 11,955 bytes, line 20
20add(ze,wt,Rt,Xt){this.ids.push(fa(ze)),this.positions.push(wt,Rt,Xt)}getPositions(ze){const wt=fa(ze);let Rt=0,Xt=this.ids.length-1;for(;Rt<Xt;){const ze=Rt+Xt>>1;this.ids[ze]>=wt?Xt=ze:Rt=ze+1}const sr=[];for(;this.ids[Rt]===wt;)sr.push({index:this.positions[3*Rt],start:this.positions[3*Rt+1],end:this.positions[3*Rt+2]}),Rt++;return sr}static serialize(ze,wt){const Rt=new Float64Array(ze.ids),Xt=new Uint32Array(ze.positions);return ya(Rt,Xt,0,Rt.length-1),wt&&wt.push(Rt.buffer,Xt.buffer),{ids:Rt,positions:Xt}}static deserialize(ze){const wt=new da;return wt.ids=ze.ids,wt.positions=ze.positions,wt.indexed=!0,wt}}function fa(ze){const wt=+ze;return!isNaN(wt)&&wt<=Dr?wt:yd(String(ze))}function ya(ze,wt,Rt,Xt){for(;Rt<Xt;){const sr=ze[Rt+Xt>>1];let Dr=Rt-1,Lr=Xt+1;for(;;){do{Dr++}while(ze[Dr]<sr);do{Lr--}while(ze[Lr]>sr);if(Dr>=Lr)break;ma(ze,Dr,Lr),ma(wt,3*Dr,3*Lr),ma(wt,3*Dr+1,3*Lr+1),ma(wt,3*Dr+2,3*Lr+2)}Lr-Rt<Xt-Lr?(ya(ze,wt,Rt,Lr),Rt=Lr+1):(ya(ze,wt,Lr+1,Xt),Xt=Lr)}}function ma(ze,wt,Rt){const Xt=ze[wt];ze[wt]=ze[Rt],ze[Rt]=Xt}oi("FeaturePositionMap",da);class ga{constructor(ze,wt){this.gl=ze.gl,this.location=wt}}class xa extends ga{constructor(ze,wt){super(ze,wt),this.current=0}set(ze){this.current!==ze&&(this.current=ze,this.gl.uniform1f(this.location,ze))}}class va extends ga{constructor(ze,wt){super(ze,wt),this.current=[0,0,0,0]}set(ze){ze[0]===this.current[0]&&ze[1]===this.current[1]&&ze[2]===this.current[2]&&ze[3]===this.current[3]||(this.current=ze,this.gl.uniform4f(this.location,ze[0],ze[1],ze[2],ze[3]))}}class ba extends ga{constructor(ze,wt){super(ze,wt),this.current=ce.transparent}set(ze){ze.r===this.current.r&&ze.g===this.current.g&&ze.b===this.current.b&&ze.a===this.current.a||(this.current=ze,this.gl.uniform4f(this.location,ze.r,ze.g,ze.b,ze.a))}}const bd=new Float32Array(16),vd=new Float32Array(9);function ka(ze){return[ws(255*ze.r,255*ze.g),ws(255*ze.b,255*ze.a)]}class Aa{constructor(ze,wt,Rt){this.value=ze,this.uniformNames=wt.map(ze=>`u_${ze}`),this.type=Rt}setUniform(ze,wt,Rt){ze.set(Rt.constantOr(this.value))}getBinding(ze,wt,Rt){return"color"===this.type?new ba(ze,wt):new xa(ze,wt)}}class Sa{constructor(ze,wt){this.uniformNames=wt.map(ze=>`u_${ze}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(ze,wt){this.pixelRatioFrom=wt.pixelRatio,this.pixelRatioTo=ze.pixelRatio,this.patternFrom=wt.tl.concat(wt.br),this.patternTo=ze.tl.concat(ze.br)}setUniform(ze,wt,Rt,Xt){const sr="u_pattern_to"===Xt||"u_dash_to"===Xt?this.patternTo:"u_pattern_from"===Xt||"u_dash_from"===Xt?this.patternFrom:"u_pixel_ratio_to"===Xt?this.pixelRatioTo:"u_pixel_ratio_from"===Xt?this.pixelRatioFrom:null;sr&&ze.set(sr)}getBinding(ze,wt,Rt){return"u_pattern_from"===Rt||"u_pattern_to"===Rt||"u_dash_from"===Rt||"u_dash_to"===Rt?new va(ze,wt):new xa(ze,wt)}}class Ia{constructor(ze,wt,Rt,Xt){this.expression=ze,this.type=Rt,this.maxValue=0,this.paintVertexAttributes=wt.map(ze=>({name:`a_${ze}`,type:"Float32",components:"color"===Rt?2:1,offset:0})),this.paintVertexArray=new Xt}populatePaintArray(ze,wt,Rt,Xt,sr){const Dr=this.paintVertexArray.length,Lr=this.expression.evaluate(new as(0),wt,{},Xt,[],sr);this.paintVertexArray.resize(ze),this._setPaintValue(Dr,ze,Lr)}updatePaintArray(ze,wt,Rt,Xt){const sr=this.expression.evaluate({zoom:0},Rt,Xt);this._setPaintValue(ze,wt,sr)}_setPaintValue(ze,wt,Rt){if("color"===this.type){const Xt=ka(Rt);for(let Rt=ze;Rt<wt;Rt++)this.paintVertexArray.emplace(Rt,Xt[0],Xt[1])}else{for(let Xt=ze;Xt<wt;Xt++)this.paintVertexArray.emplace(Xt,Rt);this.maxValue=Math.max(this.maxValue,Math.abs(Rt))}}upload(ze){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=ze.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class za{constructor(ze,wt,Rt,Xt,sr,Dr){this.expression=ze,this.uniformNames=wt.map(ze=>`u_${ze}_t`),this.type=Rt,this.useIntegerZoom=Xt,this.zoom=sr,this.maxValue=0,this.paintVertexAttributes=wt.map(ze=>({name:`a_${ze}`,type:"Float32",components:"color"===Rt?4:2,offset:0})),this.paintVertexArray=new Dr}populatePaintArray(ze,wt,Rt,Xt,sr){const Dr=this.expression.evaluate(new as(this.zoom),wt,{},Xt,[],sr),Lr=this.expression.evaluate(new as(this.zoom+1),wt,{},Xt,[],sr),Ur=this.paintVertexArray.length;this.paintVertexArray.resize(ze),this._setPaintValue(Ur,ze,Dr,Lr)}updatePaintArray(ze,wt,Rt,Xt){const sr=this.expression.evaluate({zoom:this.zoom},Rt,Xt),Dr=this.expression.evaluate({zoom:this.zoom+1},Rt,Xt);this._setPaintValue(ze,wt,sr,Dr)}_setPaintValue(ze,wt,Rt,Xt){if("color"===this.type){const sr=ka(Rt),Dr=ka(Xt);for(let Rt=ze;Rt<wt;Rt++)this.paintVertexArray.emplace(Rt,sr[0],sr[1],Dr[0],Dr[1])}else{for(let sr=ze;sr<wt;sr++)this.paintVertexArray.emplace(sr,Rt,Xt);this.maxValue=Math.max(this.maxValue,Math.abs(Rt),Math.abs(Xt))}}upload(ze){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=ze.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(ze,wt){const Rt=this.useIntegerZoom?Math.floor(wt.zoom):wt.zoom,Xt=y(this.expression.interpolationFactor(Rt,this.zoom,this.zoom+1),0,1);ze.set(Xt)}getBinding(ze,wt,Rt){return new xa(ze,wt)}}class Ta{constructor(ze,wt,Rt,Xt,sr,Dr,Lr){this.expression=ze,this.type=Rt,this.useIntegerZoom=Xt,this.zoom=sr,this.layerId=Lr,this.paintVertexAttributes=("array"===Rt?fd:pd).members;for(let ze=0;ze<wt.length;++ze);this.zoomInPaintVertexArray=new Dr,this.zoomOutPaintVertexArray=new Dr}populatePaintArray(ze,wt,Rt){const Xt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(ze),this.zoomOutPaintVertexArray.resize(ze),this._setPaintValues(Xt,ze,wt.patterns&&wt.patterns[this.layerId],Rt)}updatePaintArray(ze,wt,Rt,Xt,sr){this._setPaintValues(ze,wt,Rt.patterns&&Rt.patterns[this.layerId],sr)}_setPaintValues(ze,wt,Rt,Xt){if(!Xt||!Rt)return;const{min:sr,mid:Dr,max:Lr}=Rt,Ur=Xt[sr],qr=Xt[Dr],ri=Xt[Lr];if(Ur&&qr&&ri)for(let Rt=ze;Rt<wt;Rt++)this._setPaintValue(this.zoomInPaintVertexArray,Rt,qr,Ur),this._setPaintValue(this.zoomOutPaintVertexArray,Rt,qr,ri)}_setPaintValue(ze,wt,Rt,Xt){ze.emplace(wt,Rt.tl[0],Rt.tl[1],Rt.br[0],Rt.br[1],Xt.tl[0],Xt.tl[1],Xt.br[0],Xt.br[1],Rt.pixelRatio,Xt.pixelRatio)}upload(ze){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=ze.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=ze.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ma{constructor(ze,wt,Rt=()=>!0){this.binders={},this._buffers=[];const Xt=[];for(const sr in ze.paint._values){if(!Rt(sr))continue;const Dr=ze.paint.get(sr);if(!(Dr instanceof ds&&Hr(Dr.property.specification)))continue;const Lr=Ca(sr,ze.type),Ur=Dr.value,qr=Dr.property.specification.type,ri=Dr.property.useIntegerZoom,ai=Dr.property.specification["property-type"],Yi="cross-faded"===ai||"cross-faded-data-driven"===ai,Ji="line-dasharray"===String(sr)&&"constant"!==ze.layout.get("line-cap").value.kind;if("constant"!==Ur.kind||Ji)if("source"===Ur.kind||Ji||Yi){const Rt=Va(sr,qr,"source");this.binders[sr]=Yi?new Ta(Ur,Lr,qr,ri,wt,Rt,ze.id):new Ia(Ur,Lr,qr,Rt),Xt.push(`/a_${sr}`)}else{const ze=Va(sr,qr,"composite");this.binders[sr]=new za(Ur,Lr,qr,ri,wt,ze),Xt.push(`/z_${sr}`)}else this.binders[sr]=Yi?new Sa(Ur.value,Lr):new Aa(Ur.value,Lr,qr),Xt.push(`/u_${sr}`)}this.cacheKey=Xt.sort().join("")}getMaxValue(ze){const wt=this.binders[ze];return wt instanceof Ia||wt instanceof za?wt.maxValue:0}populatePaintArrays(ze,wt,Rt,Xt,sr){for(const Dr in this.binders){const Lr=this.binders[Dr];(Lr instanceof Ia||Lr instanceof za||Lr instanceof Ta)&&Lr.populatePaintArray(ze,wt,Rt,Xt,sr)}}setConstantPatternPositions(ze,wt){for(const Rt in this.binders){const Xt=this.binders[Rt];Xt instanceof Sa&&Xt.setConstantPatternPositions(ze,wt)}}updatePaintArrays(ze,wt,Rt,Xt,sr){let Dr=!1;for(const Lr in ze){const Ur=wt.getPositions(Lr);for(const wt of Ur){const Ur=Rt.feature(wt.index);for(const Rt in this.binders){const qr=this.binders[Rt];if((qr instanceof Ia||qr instanceof za||qr instanceof Ta)&&!0===qr.expression.isStateDependent){const ri=Xt.paint.get(Rt);qr.expression=ri.value,qr.updatePaintArray(wt.start,wt.end,Ur,ze[Lr],sr),Dr=!0}}}}return Dr}defines(){const ze=[];for(const wt in this.binders){const Rt=this.binders[wt];(Rt instanceof Aa||Rt instanceof Sa)&&ze.push(...Rt.uniformNames.map(ze=>`#define HAS_UNIFORM_${ze}`))}return ze}getBinderAttributes(){const ze=[];for(const wt in this.binders){const Rt=this.binders[wt];if(Rt instanceof Ia||Rt instanceof za||Rt instanceof Ta)for(let wt=0;wt<Rt.paintVertexAttributes.length;wt++)ze.push(Rt.paintVertexAttributes[wt].name)}return ze}getBinderUniforms(){const ze=[];for(const wt in this.binders){const Rt=this.binders[wt];if(Rt instanceof Aa||Rt instanceof Sa||Rt instanceof za)for(const wt of Rt.uniformNames)ze.push(wt)}return ze}getPaintVertexBuffers(){return this._buffers}getUniforms(ze,wt){const Rt=[];for(const Xt in this.binders){const sr=this.binders[Xt];if(sr instanceof Aa||sr instanceof Sa||sr instanceof za)for(const Dr of sr.uniformNames)if(wt[Dr]){const Lr=sr.getBinding(ze,wt[Dr],Dr);Rt.push({name:Dr,property:Xt,binding:Lr})}}return Rt}setUniforms(ze,wt,Rt,Xt){for(const{name:ze,property:sr,binding:Dr}of wt)this.binders[sr].setUniform(Dr,Xt,Rt.get(sr),ze)}updatePaintBuffers(ze){this._buffers=[];for(const wt in this.binders){const Rt=this.binders[wt];if(ze&&Rt instanceof Ta){const wt=2===ze.fromScale?Rt.zoomInPaintVertexBuffer:Rt.zoomOutPaintVertexBuffer;wt&&this._buffers.push(wt)}else(Rt instanceof Ia||Rt instanceof za)&&Rt.paintVertexBuffer&&this._buffers.push(Rt.paintVertexBuffer)}}upload(ze){for(const wt in this.binders){const Rt=this.binders[wt];(Rt instanceof Ia||Rt instanceof za||Rt instanceof Ta)&&Rt.upload(ze)}this.updatePaintBuffers()}destroy(){for(const ze in this.binders){const wt=this.binders[ze];(wt instanceof Ia||wt instanceof za||wt instanceof Ta)&&wt.destroy()}}}class Ea{constructor(ze,wt,Rt=()=>!0){this.programConfigurations={};for(const Xt of ze)this.programConfigurations[Xt.id]=new Ma(Xt,wt,Rt);this.needsUpload=!1,this._featureMap=new da,this._bufferOffset=0}populatePaintArrays(ze,wt,Rt,Xt,sr,Dr){for(const Rt in this.programConfigurations)this.programConfigurations[Rt].populatePaintArrays(ze,wt,Xt,sr,Dr);void 0!==wt.id&&this._featureMap.add(wt.id,Rt,this._bufferOffset,ze),this._bufferOffset=ze,this.needsUpload=!0}updatePaintArrays(ze,wt,Rt,Xt){for(const sr of Rt)this.needsUpload=this.programConfigurations[sr.id].updatePaintArrays(ze,this._featureMap,wt,sr,Xt)||this.needsUpload}get(ze){return this.programConfigurations[ze]}upload(ze){if(this.needsUpload){for(const wt in this.programConfigurations)this.programConfigurations[wt].upload(ze);this.needsUpload=!1}}destroy(){for(const ze in this.programConfigurations)this.programConfigurations[ze].destroy()}}const xd={"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":["ga
20pwidth"],"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"],"line-dasharray":["dash_to","dash_from"]};function Ca(ze,wt){return xd[ze]||[ze.replace(`${wt}-`,"").replace(/-/g,"_")]}const wd={"line-pattern":{source:Bs,composite:Bs},"fill-pattern":{source:Bs,composite:Bs},"fill-extrusion-pattern":{source:Bs,composite:Bs},"line-dasharray":{source:Cs,composite:Cs}},Sd={color:{source:Es,composite:Ks},number:{source:Ns,composite:Es}};function Va(ze,wt,Rt){const Xt=wd[ze];return Xt&&Xt[Rt]||Sd[wt][Rt]}oi("ConstantBinder",Aa),oi("CrossFadedConstantBinder",Sa),oi("SourceExpressionBinder",Ia),oi("CrossFadedCompositeBinder",Ta),oi("CompositeExpressionBinder",za),oi("ProgramConfiguration",Ma,{omit:["_buffers"]}),oi("ProgramConfigurationSet",Ea);const Td="-transition";class Fa extends Ft{constructor(ze,wt){if(super(),this.id=ze.id,this.type=ze.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==ze.type&&(this.metadata=ze.metadata,this.minzoom=ze.minzoom,this.maxzoom=ze.maxzoom,"background"!==ze.type&&"sky"!==ze.type&&(this.source=ze.source,this.sourceLayer=ze["source-layer"],this.filter=ze.filter),wt.layout&&(this._unevaluatedLayout=new ps(wt.layout)),wt.paint)){this._transitionablePaint=new us(wt.paint);for(const wt in ze.paint)this.setPaintProperty(wt,ze.paint[wt],{validate:!1});for(const wt in ze.layout)this.setLayoutProperty(wt,ze.layout[wt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new fs(wt.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(ze){return"visibility"===ze?this.visibility:this._unevaluatedLayout.getValue(ze)}setLayoutProperty(ze,wt,Rt={}){null!=wt&&this._validate(Vu,`layers.${this.id}.layout.${ze}`,ze,wt,Rt)||("visibility"!==ze?this._unevaluatedLayout.setValue(ze,wt):this.visibility=wt)}getPaintProperty(ze){return I(ze,Td)?this._transitionablePaint.getTransition(ze.slice(0,-Td.length)):this._transitionablePaint.getValue(ze)}setPaintProperty(ze,wt,Rt={}){if(null!=wt&&this._validate(zu,`layers.${this.id}.paint.${ze}`,ze,wt,Rt))return!1;if(I(ze,Td))return this._transitionablePaint.setTransition(ze.slice(0,-Td.length),wt||void 0),!1;{const Rt=this._transitionablePaint._values[ze],Xt="cross-faded-data-driven"===Rt.property.specification["property-type"],sr=Rt.value.isDataDriven(),Dr=Rt.value;this._transitionablePaint.setValue(ze,wt),this._handleSpecialPaintPropertyUpdate(ze);const Lr=this._transitionablePaint._values[ze].value;return Lr.isDataDriven()||sr||Xt||this._handleOverridablePaintPropertyUpdate(ze,Dr,Lr)}}_handleSpecialPaintPropertyUpdate(ze){}getProgramIds(){return null}getProgramConfiguration(ze){return null}_handleOverridablePaintPropertyUpdate(ze,wt,Rt){return!1}isHidden(ze){return!!(this.minzoom&&ze<this.minzoom)||!!(this.maxzoom&&ze>=this.maxzoom)||"none"===this.visibility}updateTransitions(ze){this._transitioningPaint=this._transitionablePaint.transitioned(ze,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(ze,wt){ze.getCrossfadeParameters&&(this._crossfadeParameters=ze.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ze,void 0,wt)),this.paint=this._transitioningPaint.possiblyEvaluate(ze,void 0,wt)}
vendor: 4,293 bytes, line 20
20serialize(){const ze={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&&(ze.layout=ze.layout||{},ze.layout.visibility=this.visibility),T(ze,(ze,wt)=>!(void 0===ze||"layout"===wt&&!Object.keys(ze).length||"paint"===wt&&!Object.keys(ze).length))}_validate(ze,wt,Rt,Xt,sr={}){return(!sr||!1!==sr.validate)&&ei(this,ze.call(Cu,{key:wt,layerType:this.type,objectKey:Rt,value:Xt,styleSpec:Pl,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const ze in this.paint._values){const wt=this.paint.get(ze);if(wt instanceof ds&&Hr(wt.property.specification)&&("source"===wt.value.kind||"composite"===wt.value.kind)&&wt.value.isStateDependent)return!0}return!1}}const Pd=Ss([{name:"a_pos",components:2,type:"Int16"}],4),{members:kd}=Pd;class $a{constructor(ze=[]){this.segments=ze}prepareSegment(ze,wt,Rt,Xt){let sr=this.segments[this.segments.length-1];return ze>$a.MAX_VERTEX_ARRAY_LENGTH&&B(`Max vertices per segment is ${$a.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${ze}`),(!sr||sr.vertexLength+ze>$a.MAX_VERTEX_ARRAY_LENGTH||sr.sortKey!==Xt)&&(sr={vertexOffset:wt.length,primitiveOffset:Rt.length,vertexLength:0,primitiveLength:0},void 0!==Xt&&(sr.sortKey=Xt),this.segments.push(sr)),sr}get(){return this.segments}destroy(){for(const ze of this.segments)for(const wt in ze.vaos)ze.vaos[wt].destroy()}static simpleSegment(ze,wt,Rt,Xt){return new $a([{vertexOffset:ze,primitiveOffset:wt,vertexLength:Rt,primitiveLength:Xt,vaos:{},sortKey:0}])}}$a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,oi("SegmentVector",$a);var Ed=8192;const Ad=Math.pow(2,14)-1,Id=-Ad-1;function ja(ze){const wt=Ed/ze.extent,Rt=ze.loadGeometry();for(let ze=0;ze<Rt.length;ze++){const Xt=Rt[ze];for(let ze=0;ze<Xt.length;ze++){const Rt=Xt[ze],sr=Math.round(Rt.x*wt),Dr=Math.round(Rt.y*wt);Rt.x=y(sr,Id,Ad),Rt.y=y(Dr,Id,Ad),(sr<Rt.x||sr>Rt.x+1||Dr<Rt.y||Dr>Rt.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return Rt}function Ga(ze,wt){return{type:ze.type,id:ze.id,properties:ze.properties,geometry:wt?ja(ze):[]}}function Za(ze,wt,Rt,Xt,sr){ze.emplaceBack(2*wt+(Xt+1)/2,2*Rt+(sr+1)/2)}class Xa{constructor(ze){this.zoom=ze.zoom,this.overscaling=ze.overscaling,this.layers=ze.layers,this.layerIds=this.layers.map(ze=>ze.id),this.index=ze.index,this.hasPattern=!1,this.layoutVertexArray=new zs,this.indexArray=new $s,this.segments=new $a,this.programConfigurations=new Ea(ze.layers,ze.zoom),this.stateDependentLayerIds=this.layers.filter(ze=>ze.isStateDependent()).map(ze=>ze.id)}populate(ze,wt,Rt){const Xt=this.layers[0],sr=[];let Dr=null;"circle"===Xt.type&&(Dr=Xt.layout.get("circle-sort-key"));for(const{feature:wt,id:Xt,index:Lr,sourceLayerIndex:Ur}of ze){const ze=this.layers[0]._featureFilter.needGeometry,qr=Ga(wt,ze);if(!this.layers[0]._featureFilter.filter(new as(this.zoom),qr,Rt))continue;const ri=Dr?Dr.evaluate(qr,{},Rt):void 0,ai={id:Xt,properties:wt.properties,type:wt.type,sourceLayerIndex:Ur,index:Lr,geometry:ze?qr.geometry:ja(wt),patterns:{},sortKey:ri};sr.push(ai)}Dr&&sr.sort((ze,wt)=>ze.sortKey-wt.sortKey);for(const Xt of sr){const{geometry:sr,index:Dr,sourceLayerIndex:Lr}=Xt,Ur=ze[Dr].feature;this.addFeature(Xt,sr,Dr,Rt),wt.featureIndex.insert(Ur,sr,Dr,Lr,this.index)}}update(ze,wt,Rt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(ze,wt,this.stateDependentLayers,Rt)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(ze){this.uploaded||(this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,kd),this.indexBuffer=ze.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(ze),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(ze,wt,Rt,Xt){for(const Rt of wt)for(const wt of Rt){const Rt=wt.x,Xt=wt.y;if(Rt<0||Rt>
vendor: 11,566 bytes, line 20
20=Ed||Xt<0||Xt>=Ed)continue;const sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,ze.sortKey),Dr=sr.vertexLength;Za(this.layoutVertexArray,Rt,Xt,-1,-1),Za(this.layoutVertexArray,Rt,Xt,1,-1),Za(this.layoutVertexArray,Rt,Xt,1,1),Za(this.layoutVertexArray,Rt,Xt,-1,1),this.indexArray.emplaceBack(Dr,Dr+1,Dr+2),this.indexArray.emplaceBack(Dr,Dr+3,Dr+2),sr.vertexLength+=4,sr.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,ze,Rt,{},Xt)}}function Ka(ze,wt){for(let Rt=0;Rt<ze.length;Rt++)if(no(wt,ze[Rt]))return!0;for(let Rt=0;Rt<wt.length;Rt++)if(no(ze,wt[Rt]))return!0;return!!Wa(ze,wt)}function Ha(ze,wt,Rt){return!!no(ze,wt)||!!to(wt,ze,Rt)}function Ya(ze,wt){if(1===ze.length)return ro(wt,ze[0]);for(let Rt=0;Rt<wt.length;Rt++){const Xt=wt[Rt];for(let wt=0;wt<Xt.length;wt++)if(no(ze,Xt[wt]))return!0}for(let Rt=0;Rt<ze.length;Rt++)if(ro(wt,ze[Rt]))return!0;for(let Rt=0;Rt<wt.length;Rt++)if(Wa(ze,wt[Rt]))return!0;return!1}function Ja(ze,wt,Rt){if(ze.length>1){if(Wa(ze,wt))return!0;for(let Xt=0;Xt<wt.length;Xt++)if(to(wt[Xt],ze,Rt))return!0}for(let Xt=0;Xt<ze.length;Xt++)if(to(ze[Xt],wt,Rt))return!0;return!1}function Wa(ze,wt){if(0===ze.length||0===wt.length)return!1;for(let Rt=0;Rt<ze.length-1;Rt++){const Xt=ze[Rt],sr=ze[Rt+1];for(let ze=0;ze<wt.length-1;ze++)if(Qa(Xt,sr,wt[ze],wt[ze+1]))return!0}return!1}function Qa(ze,wt,Rt,Xt){return C(ze,Rt,Xt)!==C(wt,Rt,Xt)&&C(ze,wt,Rt)!==C(ze,wt,Xt)}function to(ze,wt,Rt){const Xt=Rt*Rt;if(1===wt.length)return ze.distSqr(wt[0])<Xt;for(let Rt=1;Rt<wt.length;Rt++)if(eo(ze,wt[Rt-1],wt[Rt])<Xt)return!0;return!1}function eo(ze,wt,Rt){const Xt=wt.distSqr(Rt);if(0===Xt)return ze.distSqr(wt);const sr=((ze.x-wt.x)*(Rt.x-wt.x)+(ze.y-wt.y)*(Rt.y-wt.y))/Xt;return ze.distSqr(sr<0?wt:sr>1?Rt:Rt.sub(wt)._mult(sr)._add(wt))}function ro(ze,wt){let Rt,Xt,sr,Dr=!1;for(let Lr=0;Lr<ze.length;Lr++){Rt=ze[Lr];for(let ze=0,Lr=Rt.length-1;ze<Rt.length;Lr=ze++)Xt=Rt[ze],sr=Rt[Lr],Xt.y>wt.y!=sr.y>wt.y&&wt.x<(sr.x-Xt.x)*(wt.y-Xt.y)/(sr.y-Xt.y)+Xt.x&&(Dr=!Dr)}return Dr}function no(ze,wt){let Rt=!1;for(let Xt=0,sr=ze.length-1;Xt<ze.length;sr=Xt++){const Dr=ze[Xt],Lr=ze[sr];Dr.y>wt.y!=Lr.y>wt.y&&wt.x<(Lr.x-Dr.x)*(wt.y-Dr.y)/(Lr.y-Dr.y)+Dr.x&&(Rt=!Rt)}return Rt}function io(ze,wt,Rt,sr,Dr){for(const Xt of ze)if(wt<=Xt.x&&Rt<=Xt.y&&sr>=Xt.x&&Dr>=Xt.y)return!0;const Lr=[new Xt(wt,Rt),new Xt(wt,Dr),new Xt(sr,Dr),new Xt(sr,Rt)];if(ze.length>2)for(const wt of Lr)if(no(ze,wt))return!0;for(let wt=0;wt<ze.length-1;wt++)if(so(ze[wt],ze[wt+1],Lr))return!0;return!1}function so(ze,wt,Rt){const Xt=Rt[0],sr=Rt[2];if(ze.x<Xt.x&&wt.x<Xt.x||ze.x>sr.x&&wt.x>sr.x||ze.y<Xt.y&&wt.y<Xt.y||ze.y>sr.y&&wt.y>sr.y)return!1;const Dr=C(ze,wt,Rt[0]);return Dr!==C(ze,wt,Rt[1])||Dr!==C(ze,wt,Rt[2])||Dr!==C(ze,wt,Rt[3])}function ao(ze,wt,Rt){const Xt=wt.paint.get(ze).value;return"constant"===Xt.kind?Xt.value:Rt.programConfigurations.get(wt.id).getMaxValue(ze)}function oo(ze){return Math.sqrt(ze[0]*ze[0]+ze[1]*ze[1])}function lo(ze,wt,Rt,sr,Dr){if(!wt[0]&&!wt[1])return ze;const Lr=Xt.convert(wt)._mult(Dr);"viewport"===Rt&&Lr._rotate(-sr);const Ur=[];for(let wt=0;wt<ze.length;wt++)Ur.push(ze[wt].sub(Lr));return Ur}function uo(ze,wt,Rt,sr){const Dr=Xt.convert(ze)._mult(sr);return"viewport"===wt&&Dr._rotate(-Rt),Dr}oi("CircleBucket",Xa,{omit:["layers"]});const Cd=new bs({"circle-sort-key":new ms(Pl.layout_circle["circle-sort-key"])});var Od={paint:new bs({"circle-radius":new ms(Pl.paint_circle["circle-radius"]),"circle-color":new ms(Pl.paint_circle["circle-color"]),"circle-blur":new ms(Pl.paint_circle["circle-blur"]),"circle-opacity":new ms(Pl.paint_circle["circle-opacity"]),"circle-translate":new ys(Pl.paint_circle["circle-translate"]),"circle-translate-anchor":new ys(Pl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ys(Pl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ys(Pl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ms(Pl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ms(Pl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ms(Pl.paint_circle["circle-stroke-opacity"])}),layout:Cd},Md="undefined"!=typeof Float32Array?Float32Array:Array;function fo(){var ze=new Md(9);return Md!=Float32Array&&(ze[1]=0,ze[2]=0,ze[3]=0,ze[5]=0,ze[6]=0,ze[7]=0),ze[0]=1,ze[4]=1,ze[8]=1,ze}function yo(ze){return ze[0]=1,ze[1]=0,ze[2]=0,ze[3]=0,ze[4]=0,ze[5]=1,ze[6]=0,ze[7]=0,ze[8]=0,ze[9]=0,ze[10]=1,ze[11]=0,ze[12]=0,ze[13]=0,ze[14]=0,ze[15]=1,ze}function mo(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=wt[4],qr=wt[5],ri=wt[6],ai=wt[7],Yi=wt[8],Ji=wt[9],Qi=wt[10],kn=wt[11],jn=wt[12],Un=wt[13],Wn=wt[14],Yn=wt[15],Jn=Rt[0],Qn=Rt[1],Io=Rt[2],Mo=Rt[3];return ze[0]=Jn*Xt+Qn*Ur+Io*Yi+Mo*jn,ze[1]=Jn*sr+Qn*qr+Io*Ji+Mo*Un,ze[2]=Jn*Dr+Qn*ri+Io*Qi+Mo*Wn,ze[3]=Jn*Lr+Qn*ai+Io*kn+Mo*Yn,ze[4]=(Jn=Rt[4])*Xt+(Qn=Rt[5])*Ur+(Io=Rt[6])*Yi+(Mo=Rt[7])*jn,ze[5]=Jn*sr+Qn*qr+Io*Ji+Mo*Un,ze[6]=Jn*Dr+Qn*ri+Io*Qi+Mo*Wn,ze[7]=Jn*Lr+Qn*ai+Io*kn+Mo*Yn,ze[8]=(Jn=Rt[8])*Xt+(Qn=Rt[9])*Ur+(Io=Rt[10])*Yi+(Mo=Rt[11])*jn,ze[9]=Jn*sr+Qn*qr+Io*Ji+Mo*Un,ze[10]=Jn*Dr+Qn*ri+Io*Qi+Mo*Wn,ze[11]=Jn*Lr+Qn*ai+Io*kn+Mo*Yn,ze[12]=(Jn=Rt[12])*Xt+(Qn=Rt[13])*Ur+(Io=Rt[14])*Yi+(Mo=Rt[15])*jn,ze[13]=Jn*sr+Qn*qr+Io*Ji+Mo*Un,ze[14]=Jn*Dr+Qn*ri+Io*Qi+Mo*Wn,ze[15]=Jn*Lr+Qn*ai+Io*kn+Mo*Yn,ze}Math.hypot||(Math.hypot=function(){for(var ze=0,wt=arguments.length;wt--;)ze+=arguments[wt]*arguments[wt];return Math.sqrt(ze)});var Dd=mo;function xo(){var ze=new Md(3);return Md!=Float32Array&&(ze[0]=0,ze[1]=0,ze[2]=0),ze}function vo(ze){return Math.hypot(ze[0],ze[1],ze[2])}function bo(ze,wt,Rt){var Xt=new Md(3);return Xt[0]=ze,Xt[1]=wt,Xt[2]=Rt,Xt}function wo(ze,wt,Rt){return ze[0]=wt[0]-Rt[0],ze[1]=wt[1]-Rt[1],ze[2]=wt[2]-Rt[2],ze}function _o(ze,wt,Rt){return ze[0]=wt[0]*Rt[0],ze[1]=wt[1]*Rt[1],ze[2]=wt[2]*Rt[2],ze}function ko(ze,wt,Rt,Xt){return ze[0]=wt[0]+Rt[0]*Xt,ze[1]=wt[1]+Rt[1]*Xt,ze[2]=wt[2]+Rt[2]*Xt,ze}function Ao(ze,wt){var Rt=wt[0],Xt=wt[1],sr=wt[2],Dr=Rt*Rt+Xt*Xt+sr*sr;return Dr>0&&(Dr=1/Math.sqrt(Dr)),ze[0]=wt[0]*Dr,ze[1]=wt[1]*Dr,ze[2]=wt[2]*Dr,ze}function So(ze,wt,Rt){var Xt=Rt[0],sr=Rt[1],Dr=Rt[2],Lr=wt[0],Ur=wt[1],qr=wt[2],ri=sr*qr-Dr*Ur,ai=Dr*Lr-Xt*qr,Yi=Xt*Ur-sr*Lr,Ji=sr*Yi-Dr*ai,Qi=Dr*ri-Xt*Yi,kn=Xt*ai-sr*ri,jn=2*Rt[3];return ai*=jn,Yi*=jn,Qi*=2,kn*=2,ze[0]=Lr+(ri*=jn)+(Ji*=2),ze[1]=Ur+ai+Qi,ze[2]=qr+Yi+kn,ze}var Ld,jd=wo,zd=_o,Rd=vo;function Eo(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3];return ze[0]=Rt[0]*Xt+Rt[4]*sr+Rt[8]*Dr+Rt[12]*Lr,ze[1]=Rt[1]*Xt+Rt[5]*sr+Rt[9]*Dr+Rt[13]*Lr,ze[2]=Rt[2]*Xt+Rt[6]*sr+Rt[10]*Dr+Rt[14]*Lr,ze[3]=Rt[3]*Xt+Rt[7]*sr+Rt[11]*Dr+Rt[15]*Lr,ze}function Bo(){var ze=new Md(4);return Md!=Float32Array&&(ze[0]=0,ze[1]=0,ze[2]=0),ze[3]=1,ze}function Co(ze){return ze[0]=0,ze[1]=0,ze[2]=0,ze[3]=1,ze}function Po(ze,wt,Rt){Rt*=.5;var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=Math.sin(Rt),qr=Math.cos(Rt);return ze[0]=Xt*qr+Lr*Ur,ze[1]=sr*qr+Dr*Ur,ze[2]=Dr*qr-sr*Ur,ze[3]=Lr*qr-Xt*Ur,ze}function Do(ze,wt,Rt){const sr=Eo([],[ze.x,ze.y,wt,1],Rt);return new Xt(sr[0]/sr[3],sr[1]/sr[3])}xo(),Ld=new Md(4),Md!=Float32Array&&(Ld[0]=0,Ld[1]=0,Ld[2]=0,Ld[3]=0),xo(),bo(1,0,0),bo(0,1,0),Bo(),Bo(),fo();const Nd=bo(0,0,0),Bd=bo(0,0,1);function Fo(ze,wt){const Rt=xo();return Nd[2]=wt,ze.intersectsPlane(Nd,Bd,Rt),new Xt(Rt[0],Rt[1])}class Ro extends Xa{}function Uo(ze,{width:wt,height:Rt},Xt,sr){if(sr){if(sr instanceof Uint8ClampedArray)sr=new Uint8Array(sr.buffer);else if(sr.length!==wt*Rt*Xt)throw new RangeError("mismatched image size")}else sr=new Uint8Array(wt*Rt*Xt);return ze.width=wt,ze.height=Rt,ze.data=sr,ze}function $o(ze,{width:wt,height:Rt},Xt){if(wt===ze.width&&Rt===ze.height)return;const sr=Uo({},{width:wt,height:Rt},Xt);Oo(ze,sr,{x:0,y:0},{x:0,y:0},{width:Math.min(ze.width,wt),height:Math.min(ze.height,Rt)},Xt),ze.width=wt,ze.height=Rt,ze.data=sr.data}function Oo(ze,wt,Rt,Xt,sr,Dr){if(0===sr.width||0===sr.height)return wt;if(sr.width>ze.width||sr.height>ze.height||Rt.x>ze.width-sr.width||Rt.y>ze.height-sr.height)throw new RangeError("out of range source coordinates for image copy");if(sr.width>wt.width||sr.height>wt.height||Xt.x>wt.width-sr.width||Xt.y>wt.height-sr.height)throw new RangeError("out of range destination coordinates for image copy");const Lr=ze.data,Ur=wt.data;for(let qr=0;qr<sr.height;qr++){const ri=((Rt.y+qr)*ze.width+Rt.x)*Dr,ai=((Xt.y+qr)*wt.width+Xt.x)*Dr;for(let ze=0;ze<sr.width*Dr;ze++)Ur[ai+ze]=Lr[ri+ze]}return wt}oi("HeatmapBucket",Ro,{omit:["layers"]});class qo{constructor(ze,wt){Uo(this,ze,1,wt)}resize(ze){$o(this,ze,1)}clone(){return new qo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(ze,wt,Rt,Xt,sr){Oo(ze,wt,Rt,Xt,sr,1)}}class No{constructor(ze,wt){Uo(this,ze,4,wt)}resize(ze){$o(this,ze,4)}replace(ze,wt){wt?this.data.set(ze):this.data=ze instanceof Uint8ClampedArray?new Uint8Array(ze.buffer):ze}clone(){return new No({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(ze,wt,Rt,Xt,sr){Oo(ze,wt,Rt,Xt,sr,4)}}oi("AlphaImage",qo),oi("RGBAImage",No);var Fd={paint:new bs({"heatmap-radius":new ms(Pl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ms(Pl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ys(Pl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new vs(Pl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ys(Pl.paint_heatmap["heatmap-opacity"])})};function Go(ze){const wt={},Rt=ze.resolution||256,Xt=ze.clips?ze.clips.length:1,sr=ze.image||new No({width:Rt,height:Xt}),s=(Rt,Xt,Dr)=>{wt[ze.evaluationKey]=Dr;const Lr=ze.expression.evaluate(wt);sr.data[Rt+Xt+0]=Math.floor(255*Lr.r/Lr.a),sr.data[Rt+Xt+1]=Math.floor(255*Lr.g/Lr.a),sr.data[Rt+Xt+2]=Math.floor(255*Lr.b/Lr.a),sr.data[Rt+Xt+3]=Math.floor(255*Lr.a)};if(ze.clips)for(let wt=0,sr=0;wt<Xt;++wt,sr+=4*Rt)for(let Xt=0,Dr=0;Xt<Rt;Xt++,Dr+=4){const Lr=Xt/(Rt-1),{start:Ur,end:qr}=ze.clips[wt];s(sr,Dr,Ur*(1-Lr)+qr*Lr)}else for(let ze=0,wt=0;ze<Rt;ze++,wt+=4)s(0,wt,ze/(Rt-1));return sr}var Ud={paint:new bs({"hillshade-illumination-direction":new ys(Pl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ys(Pl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ys(Pl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ys(Pl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ys(Pl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ys(Pl.paint_hillshade["hillshade-accent-color"])})};const Vd=Ss([{name:"a_pos",components:2,type:"Int16"}],4),{members:$d}=Vd;var qd=Jo,Gd=Jo;function Jo(ze,wt,Rt){Rt=Rt||2;var Xt,sr,Dr,Lr,Ur,qr,ri,ai=wt&&wt.length,Yi=ai?wt[0]*Rt:ze.length,Ji=Wo(ze,0,Yi,Rt,!0),Qi=[];if(!Ji||Ji.next===Ji.prev)return Qi;if(ai&&(Ji=function(ze,wt,Rt,Xt){var sr,Dr,Lr,Ur=[];for(sr=0,Dr=wt.length;sr<Dr;sr++)(Lr=Wo(ze,wt[sr]*Xt,sr<Dr-1?wt[sr+1]*Xt:ze.length,Xt,!1))===Lr.next&&(Lr.steiner=!0),Ur.push(ul(Lr));for(Ur.sort(sl),sr=0;sr<Ur.length;sr++)al(Ur[sr],Rt),Rt=Qo(Rt,Rt.next);return Rt}(ze,wt,Ji,Rt)),ze.length>80*Rt){Xt=Dr=ze[0],sr=Lr=ze[1];for(var kn=Rt;kn<Yi;kn+=Rt)(Ur=ze[kn])<Xt&&(Xt=Ur),(qr=ze[kn+1])<sr&&(sr=qr),Ur>Dr&&(Dr=Ur),qr>Lr&&(Lr=qr);ri=0!==(ri=Math.max(Dr-Xt,Lr-sr))?1/ri:0}return tl(Ji,Qi,Rt,Xt,sr,ri),Qi}function Wo(ze,wt,Rt,Xt,sr){var Dr,Lr;if(sr===_l(ze,wt,Rt,Xt)>0)for(Dr=wt;Dr<Rt;Dr+=Xt)Lr=vl(Dr,ze[Dr],ze[Dr+1],Lr);else for(Dr=Rt-Xt;Dr>=wt;Dr-=Xt)Lr=vl(Dr,ze[Dr],ze[Dr+1],Lr);return Lr&&dl(Lr,Lr.next)&&(bl(Lr),Lr=Lr.next),Lr}function Qo(ze,wt){if(!ze)return ze;wt||(wt=ze);var Rt,Xt=ze;
vendor: 4,235 bytes, line 20
20do{if(Rt=!1,Xt.steiner||!dl(Xt,Xt.next)&&0!==pl(Xt.prev,Xt,Xt.next))Xt=Xt.next;else{if(bl(Xt),(Xt=wt=Xt.prev)===Xt.next)break;Rt=!0}}while(Rt||Xt!==wt);return wt}function tl(ze,wt,Rt,Xt,sr,Dr,Lr){if(ze){!Lr&&Dr&&function(ze,wt,Rt,Xt){var sr=ze;do{null===sr.z&&(sr.z=ll(sr.x,sr.y,wt,Rt,Xt)),sr.prevZ=sr.prev,sr.nextZ=sr.next,sr=sr.next}while(sr!==ze);sr.prevZ.nextZ=null,sr.prevZ=null,function(ze){var wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri=1;do{for(Rt=ze,ze=null,Dr=null,Lr=0;Rt;){for(Lr++,Xt=Rt,Ur=0,wt=0;wt<ri&&(Ur++,Xt=Xt.nextZ);wt++);for(qr=ri;Ur>0||qr>0&&Xt;)0!==Ur&&(0===qr||!Xt||Rt.z<=Xt.z)?(sr=Rt,Rt=Rt.nextZ,Ur--):(sr=Xt,Xt=Xt.nextZ,qr--),Dr?Dr.nextZ=sr:ze=sr,sr.prevZ=Dr,Dr=sr;Rt=Xt}Dr.nextZ=null,ri*=2}while(Lr>1)}(sr)}(ze,Xt,sr,Dr);for(var Ur,qr,ri=ze;ze.prev!==ze.next;)if(Ur=ze.prev,qr=ze.next,Dr?rl(ze,Xt,sr,Dr):el(ze))wt.push(Ur.i/Rt),wt.push(ze.i/Rt),wt.push(qr.i/Rt),bl(ze),ze=qr.next,ri=qr.next;else if((ze=qr)===ri){Lr?1===Lr?tl(ze=nl(Qo(ze),wt,Rt),wt,Rt,Xt,sr,Dr,2):2===Lr&&il(ze,wt,Rt,Xt,sr,Dr):tl(Qo(ze),wt,Rt,Xt,sr,Dr,1);break}}}function el(ze){var wt=ze.prev,Rt=ze,Xt=ze.next;if(pl(wt,Rt,Xt)>=0)return!1;for(var sr=ze.next.next;sr!==ze.prev;){if(cl(wt.x,wt.y,Rt.x,Rt.y,Xt.x,Xt.y,sr.x,sr.y)&&pl(sr.prev,sr,sr.next)>=0)return!1;sr=sr.next}return!0}function rl(ze,wt,Rt,Xt){var sr=ze.prev,Dr=ze,Lr=ze.next;if(pl(sr,Dr,Lr)>=0)return!1;for(var Ur=sr.x>Dr.x?sr.x>Lr.x?sr.x:Lr.x:Dr.x>Lr.x?Dr.x:Lr.x,qr=sr.y>Dr.y?sr.y>Lr.y?sr.y:Lr.y:Dr.y>Lr.y?Dr.y:Lr.y,ri=ll(sr.x<Dr.x?sr.x<Lr.x?sr.x:Lr.x:Dr.x<Lr.x?Dr.x:Lr.x,sr.y<Dr.y?sr.y<Lr.y?sr.y:Lr.y:Dr.y<Lr.y?Dr.y:Lr.y,wt,Rt,Xt),ai=ll(Ur,qr,wt,Rt,Xt),Yi=ze.prevZ,Ji=ze.nextZ;Yi&&Yi.z>=ri&&Ji&&Ji.z<=ai;){if(Yi!==ze.prev&&Yi!==ze.next&&cl(sr.x,sr.y,Dr.x,Dr.y,Lr.x,Lr.y,Yi.x,Yi.y)&&pl(Yi.prev,Yi,Yi.next)>=0)return!1;if(Yi=Yi.prevZ,Ji!==ze.prev&&Ji!==ze.next&&cl(sr.x,sr.y,Dr.x,Dr.y,Lr.x,Lr.y,Ji.x,Ji.y)&&pl(Ji.prev,Ji,Ji.next)>=0)return!1;Ji=Ji.nextZ}for(;Yi&&Yi.z>=ri;){if(Yi!==ze.prev&&Yi!==ze.next&&cl(sr.x,sr.y,Dr.x,Dr.y,Lr.x,Lr.y,Yi.x,Yi.y)&&pl(Yi.prev,Yi,Yi.next)>=0)return!1;Yi=Yi.prevZ}for(;Ji&&Ji.z<=ai;){if(Ji!==ze.prev&&Ji!==ze.next&&cl(sr.x,sr.y,Dr.x,Dr.y,Lr.x,Lr.y,Ji.x,Ji.y)&&pl(Ji.prev,Ji,Ji.next)>=0)return!1;Ji=Ji.nextZ}return!0}function nl(ze,wt,Rt){var Xt=ze;do{var sr=Xt.prev,Dr=Xt.next.next;!dl(sr,Dr)&&fl(sr,Xt,Xt.next,Dr)&&gl(sr,Dr)&&gl(Dr,sr)&&(wt.push(sr.i/Rt),wt.push(Xt.i/Rt),wt.push(Dr.i/Rt),bl(Xt),bl(Xt.next),Xt=ze=Dr),Xt=Xt.next}while(Xt!==ze);return Qo(Xt)}function il(ze,wt,Rt,Xt,sr,Dr){var Lr=ze;do{for(var Ur=Lr.next.next;Ur!==Lr.prev;){if(Lr.i!==Ur.i&&hl(Lr,Ur)){var qr=xl(Lr,Ur);return Lr=Qo(Lr,Lr.next),qr=Qo(qr,qr.next),tl(Lr,wt,Rt,Xt,sr,Dr),void tl(qr,wt,Rt,Xt,sr,Dr)}Ur=Ur.next}Lr=Lr.next}while(Lr!==ze)}function sl(ze,wt){return ze.x-wt.x}function al(ze,wt){if(wt=function(ze,wt){var Rt,Xt=wt,sr=ze.x,Dr=ze.y,Lr=-1/0;do{if(Dr<=Xt.y&&Dr>=Xt.next.y&&Xt.next.y!==Xt.y){var Ur=Xt.x+(Dr-Xt.y)*(Xt.next.x-Xt.x)/(Xt.next.y-Xt.y);if(Ur<=sr&&Ur>Lr){if(Lr=Ur,Ur===sr){if(Dr===Xt.y)return Xt;if(Dr===Xt.next.y)return Xt.next}Rt=Xt.x<Xt.next.x?Xt:Xt.next}}Xt=Xt.next}while(Xt!==wt);if(!Rt)return null;if(sr===Lr)return Rt;var qr,ri=Rt,ai=Rt.x,Yi=Rt.y,Ji=1/0;Xt=Rt;do{sr>=Xt.x&&Xt.x>=ai&&sr!==Xt.x&&cl(Dr<Yi?sr:Lr,Dr,ai,Yi,Dr<Yi?Lr:sr,Dr,Xt.x,Xt.y)&&(qr=Math.abs(Dr-Xt.y)/(sr-Xt.x),gl(Xt,ze)&&(qr<Ji||qr===Ji&&(Xt.x>Rt.x||Xt.x===Rt.x&&ol(Rt,Xt)))&&(Rt=Xt,Ji=qr)),Xt=Xt.next}while(Xt!==ri);return Rt}(ze,wt)){var Rt=xl(wt,ze);Qo(wt,wt.next),Qo(Rt,Rt.next)}}function ol(ze,wt){return pl(ze.prev,ze,wt.prev)<0&&pl(wt.next,ze,ze.next)<0}function ll(ze,wt,Rt,Xt,sr){return(ze=1431655765&((ze=858993459&((ze=252645135&((ze=16711935&((ze=32767*(ze-Rt)*sr)|ze<<8))|ze<<4))|ze<<2))|ze<<1))|(wt=1431655765&((wt=858993459&((wt=252645135&((wt=16711935&((wt=32767*(wt-Xt)*sr)|wt<<8))|wt<<4))|wt<<2))|wt<<1))<<1}function ul(ze){var wt=ze,Rt=ze;do{(wt.x<Rt.x||wt.x===Rt.x&&wt.y<Rt.y)&&(Rt=wt),wt=wt.next}while(wt!==ze);return Rt}function cl(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){return(sr-Lr)*(wt-Ur)-(ze-Lr)*(Dr-Ur)>=0&&(ze-Lr)*(Xt-Ur)-(Rt-Lr)*(wt-Ur)>=0&&(Rt-Lr)*(Dr-Ur)-(sr-Lr)*(Xt-Ur)>=0}function hl(ze,wt){return ze.next.i!==wt.i&&ze.prev.i!==wt.i&&!function(ze,wt){var Rt=ze;do{if(Rt.i!==ze.i&&Rt.next.i!==ze.i&&Rt.i!==wt.i&&Rt.next.i!==wt.i&&fl(Rt,Rt.next,ze,wt))return!0;Rt=Rt.next}
vendor: 61,177 bytes, line 20
20while(Rt!==ze);return!1}(ze,wt)&&(gl(ze,wt)&&gl(wt,ze)&&function(ze,wt){var Rt=ze,Xt=!1,sr=(ze.x+wt.x)/2,Dr=(ze.y+wt.y)/2;do{Rt.y>Dr!=Rt.next.y>Dr&&Rt.next.y!==Rt.y&&sr<(Rt.next.x-Rt.x)*(Dr-Rt.y)/(Rt.next.y-Rt.y)+Rt.x&&(Xt=!Xt),Rt=Rt.next}while(Rt!==ze);return Xt}(ze,wt)&&(pl(ze.prev,ze,wt.prev)||pl(ze,wt.prev,wt))||dl(ze,wt)&&pl(ze.prev,ze,ze.next)>0&&pl(wt.prev,wt,wt.next)>0)}function pl(ze,wt,Rt){return(wt.y-ze.y)*(Rt.x-wt.x)-(wt.x-ze.x)*(Rt.y-wt.y)}function dl(ze,wt){return ze.x===wt.x&&ze.y===wt.y}function fl(ze,wt,Rt,Xt){var sr=ml(pl(ze,wt,Rt)),Dr=ml(pl(ze,wt,Xt)),Lr=ml(pl(Rt,Xt,ze)),Ur=ml(pl(Rt,Xt,wt));return sr!==Dr&&Lr!==Ur||!(0!==sr||!yl(ze,Rt,wt))||!(0!==Dr||!yl(ze,Xt,wt))||!(0!==Lr||!yl(Rt,ze,Xt))||!(0!==Ur||!yl(Rt,wt,Xt))}function yl(ze,wt,Rt){return wt.x<=Math.max(ze.x,Rt.x)&&wt.x>=Math.min(ze.x,Rt.x)&&wt.y<=Math.max(ze.y,Rt.y)&&wt.y>=Math.min(ze.y,Rt.y)}function ml(ze){return ze>0?1:ze<0?-1:0}function gl(ze,wt){return pl(ze.prev,ze,ze.next)<0?pl(ze,wt,ze.next)>=0&&pl(ze,ze.prev,wt)>=0:pl(ze,wt,ze.prev)<0||pl(ze,ze.next,wt)<0}function xl(ze,wt){var Rt=new wl(ze.i,ze.x,ze.y),Xt=new wl(wt.i,wt.x,wt.y),sr=ze.next,Dr=wt.prev;return ze.next=wt,wt.prev=ze,Rt.next=sr,sr.prev=Rt,Xt.next=Rt,Rt.prev=Xt,Dr.next=Xt,Xt.prev=Dr,Xt}function vl(ze,wt,Rt,Xt){var sr=new wl(ze,wt,Rt);return Xt?(sr.next=Xt.next,sr.prev=Xt,Xt.next.prev=sr,Xt.next=sr):(sr.prev=sr,sr.next=sr),sr}function bl(ze){ze.next.prev=ze.prev,ze.prev.next=ze.next,ze.prevZ&&(ze.prevZ.nextZ=ze.nextZ),ze.nextZ&&(ze.nextZ.prevZ=ze.prevZ)}function wl(ze,wt,Rt){this.i=ze,this.x=wt,this.y=Rt,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _l(ze,wt,Rt,Xt){for(var sr=0,Dr=wt,Lr=Rt-Xt;Dr<Rt;Dr+=Xt)sr+=(ze[Lr]-ze[Dr])*(ze[Dr+1]+ze[Lr+1]),Lr=Dr;return sr}function kl(ze,wt,Rt,Xt,sr){Al(ze,wt,Rt||0,Xt||ze.length-1,sr||Il)}function Al(ze,wt,Rt,Xt,sr){for(;Xt>Rt;){if(Xt-Rt>600){var Dr=Xt-Rt+1,Lr=wt-Rt+1,Ur=Math.log(Dr),qr=.5*Math.exp(2*Ur/3),ri=.5*Math.sqrt(Ur*qr*(Dr-qr)/Dr)*(Lr-Dr/2<0?-1:1);Al(ze,wt,Math.max(Rt,Math.floor(wt-Lr*qr/Dr+ri)),Math.min(Xt,Math.floor(wt+(Dr-Lr)*qr/Dr+ri)),sr)}var ai=ze[wt],Yi=Rt,Ji=Xt;for(Sl(ze,Rt,wt),sr(ze[Xt],ai)>0&&Sl(ze,Rt,Xt);Yi<Ji;){for(Sl(ze,Yi,Ji),Yi++,Ji--;sr(ze[Yi],ai)<0;)Yi++;for(;sr(ze[Ji],ai)>0;)Ji--}0===sr(ze[Rt],ai)?Sl(ze,Rt,Ji):Sl(ze,++Ji,Xt),Ji<=wt&&(Rt=Ji+1),wt<=Ji&&(Xt=Ji-1)}}function Sl(ze,wt,Rt){var Xt=ze[wt];ze[wt]=ze[Rt],ze[Rt]=Xt}function Il(ze,wt){return ze<wt?-1:ze>wt?1:0}function zl(ze,wt){const Rt=ze.length;if(Rt<=1)return[ze];const Xt=[];let sr,Dr;for(let wt=0;wt<Rt;wt++){const Rt=P(ze[wt]);0!==Rt&&(ze[wt].area=Math.abs(Rt),void 0===Dr&&(Dr=Rt<0),Dr===Rt<0?(sr&&Xt.push(sr),sr=[ze[wt]]):sr.push(ze[wt]))}if(sr&&Xt.push(sr),wt>1)for(let ze=0;ze<Xt.length;ze++)Xt[ze].length<=wt||(kl(Xt[ze],wt,1,Xt[ze].length-1,Tl),Xt[ze]=Xt[ze].slice(0,wt));return Xt}function Tl(ze,wt){return wt.area-ze.area}function Ml(ze,wt,Rt){const Xt=Rt.patternDependencies;let sr=!1;for(const Rt of wt){const wt=Rt.paint.get(`${ze}-pattern`);wt.isConstant()||(sr=!0);const Dr=wt.constantOr(null);Dr&&(sr=!0,Xt[Dr.to]=!0,Xt[Dr.from]=!0)}return sr}function El(ze,wt,Rt,Xt,sr){const Dr=sr.patternDependencies;for(const Lr of wt){const wt=Lr.paint.get(`${ze}-pattern`).value;if("constant"!==wt.kind){let ze=wt.evaluate({zoom:Xt-1},Rt,{},sr.availableImages),Ur=wt.evaluate({zoom:Xt},Rt,{},sr.availableImages),qr=wt.evaluate({zoom:Xt+1},Rt,{},sr.availableImages);ze=ze&&ze.name?ze.name:ze,Ur=Ur&&Ur.name?Ur.name:Ur,qr=qr&&qr.name?qr.name:qr,Dr[ze]=!0,Dr[Ur]=!0,Dr[qr]=!0,Rt.patterns[Lr.id]={min:ze,mid:Ur,max:qr}}}return Rt}Jo.deviation=function(ze,wt,Rt,Xt){var sr=wt&&wt.length,Dr=Math.abs(_l(ze,0,sr?wt[0]*Rt:ze.length,Rt));if(sr)for(var Lr=0,Ur=wt.length;Lr<Ur;Lr++)Dr-=Math.abs(_l(ze,wt[Lr]*Rt,Lr<Ur-1?wt[Lr+1]*Rt:ze.length,Rt));var qr=0;for(Lr=0;Lr<Xt.length;Lr+=3){var ri=Xt[Lr]*Rt,ai=Xt[Lr+1]*Rt,Yi=Xt[Lr+2]*Rt;qr+=Math.abs((ze[ri]-ze[Yi])*(ze[ai+1]-ze[ri+1])-(ze[ri]-ze[ai])*(ze[Yi+1]-ze[ri+1]))}return 0===Dr&&0===qr?0:Math.abs((qr-Dr)/Dr)},Jo.flatten=function(ze){for(var wt=ze[0][0].length,Rt={vertices:[],holes:[],dimensions:wt},Xt=0,sr=0;sr<ze.length;sr++){for(var Dr=0;Dr<ze[sr].length;Dr++)for(var Lr=0;Lr<wt;Lr++)Rt.vertices.push(ze[sr][Dr][Lr]);sr>0&&Rt.holes.push(Xt+=ze[sr-1].length)}return Rt},qd.default=Gd;class Bl{constructor(ze){this.zoom=ze.zoom,this.overscaling=ze.overscaling,this.layers=ze.layers,this.layerIds=this.layers.map(ze=>ze.id),this.index=ze.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new zs,this.indexArray=new $s,this.indexArray2=new Zs,this.programConfigurations=new Ea(ze.layers,ze.zoom),this.segments=new $a,this.segments2=new $a,this.stateDependentLayerIds=this.layers.filter(ze=>ze.isStateDependent()).map(ze=>ze.id)}populate(ze,wt,Rt){this.hasPattern=Ml("fill",this.layers,wt);const Xt=this.layers[0].layout.get("fill-sort-key"),sr=[];for(const{feature:Dr,id:Lr,index:Ur,sourceLayerIndex:qr}of ze){const ze=this.layers[0]._featureFilter.needGeometry,ri=Ga(Dr,ze);if(!this.layers[0]._featureFilter.filter(new as(this.zoom),ri,Rt))continue;const ai=Xt?Xt.evaluate(ri,{},Rt,wt.availableImages):void 0,Yi={id:Lr,properties:Dr.properties,type:Dr.type,sourceLayerIndex:qr,index:Ur,geometry:ze?ri.geometry:ja(Dr),patterns:{},sortKey:ai};sr.push(Yi)}Xt&&sr.sort((ze,wt)=>ze.sortKey-wt.sortKey);for(const Xt of sr){const{geometry:sr,index:Dr,sourceLayerIndex:Lr}=Xt;if(this.hasPattern){const ze=El("fill",this.layers,Xt,this.zoom,wt);this.patternFeatures.push(ze)}else this.addFeature(Xt,sr,Dr,Rt,{});wt.featureIndex.insert(ze[Dr].feature,sr,Dr,Lr,this.index)}}update(ze,wt,Rt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(ze,wt,this.stateDependentLayers,Rt)}addFeatures(ze,wt,Rt){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,wt,Rt)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(ze){this.uploaded||(this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,$d),this.indexBuffer=ze.createIndexBuffer(this.indexArray),this.indexBuffer2=ze.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(ze),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(ze,wt,Rt,Xt,sr){for(const ze of zl(wt,500)){let wt=0;for(const Rt of ze)wt+=Rt.length;const Rt=this.segments.prepareSegment(wt,this.layoutVertexArray,this.indexArray),Xt=Rt.vertexLength,sr=[],Dr=[];for(const wt of ze){if(0===wt.length)continue;wt!==ze[0]&&Dr.push(sr.length/2);const Rt=this.segments2.prepareSegment(wt.length,this.layoutVertexArray,this.indexArray2),Xt=Rt.vertexLength;this.layoutVertexArray.emplaceBack(wt[0].x,wt[0].y),this.indexArray2.emplaceBack(Xt+wt.length-1,Xt),sr.push(wt[0].x),sr.push(wt[0].y);for(let ze=1;ze<wt.length;ze++)this.layoutVertexArray.emplaceBack(wt[ze].x,wt[ze].y),this.indexArray2.emplaceBack(Xt+ze-1,Xt+ze),sr.push(wt[ze].x),sr.push(wt[ze].y);Rt.vertexLength+=wt.length,Rt.primitiveLength+=wt.length}const Lr=qd(sr,Dr);for(let ze=0;ze<Lr.length;ze+=3)this.indexArray.emplaceBack(Xt+Lr[ze],Xt+Lr[ze+1],Xt+Lr[ze+2]);Rt.vertexLength+=wt,Rt.primitiveLength+=Lr.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,ze,Rt,sr,Xt)}}oi("FillBucket",Bl,{omit:["layers","patternFeatures"]});const Hd=new bs({"fill-sort-key":new ms(Pl.layout_fill["fill-sort-key"])});var Zd={paint:new bs({"fill-antialias":new ys(Pl.paint_fill["fill-antialias"]),"fill-opacity":new ms(Pl.paint_fill["fill-opacity"]),"fill-color":new ms(Pl.paint_fill["fill-color"]),"fill-outline-color":new ms(Pl.paint_fill["fill-outline-color"]),"fill-translate":new ys(Pl.paint_fill["fill-translate"]),"fill-translate-anchor":new ys(Pl.paint_fill["fill-translate-anchor"]),"fill-pattern":new gs(Pl.paint_fill["fill-pattern"])}),layout:Hd};const Wd=Ss([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Xd=Ss([{name:"a_centroid_pos",components:2,type:"Uint16"}]),{members:Kd}=Wd;var Yd=Rl;function Rl(ze,wt,Rt,Xt,sr){this.properties={},this.extent=Rt,this.type=0,this._pbf=ze,this._geometry=-1,this._keys=Xt,this._values=sr,ze.readFields(Ul,this,wt)}function Ul(ze,wt,Rt){1==ze?wt.id=Rt.readVarint():2==ze?function(ze,wt){for(var Rt=ze.readVarint()+ze.pos;ze.pos<Rt;){var Xt=wt._keys[ze.readVarint()],sr=wt._values[ze.readVarint()];wt.properties[Xt]=sr}}(Rt,wt):3==ze?wt.type=Rt.readVarint():4==ze&&(wt._geometry=Rt.pos)}function $l(ze){for(var wt,Rt,Xt=0,sr=0,Dr=ze.length,Lr=Dr-1;sr<Dr;Lr=sr++)Xt+=((Rt=ze[Lr]).x-(wt=ze[sr]).x)*(wt.y+Rt.y);return Xt}Rl.types=["Unknown","Point","LineString","Polygon"],Rl.prototype.loadGeometry=function(){var ze=this._pbf;ze.pos=this._geometry;for(var wt,Rt=ze.readVarint()+ze.pos,sr=1,Dr=0,Lr=0,Ur=0,qr=[];ze.pos<Rt;){if(Dr<=0){var ri=ze.readVarint();sr=7&ri,Dr=ri>>3}if(Dr--,1===sr||2===sr)Lr+=ze.readSVarint(),Ur+=ze.readSVarint(),1===sr&&(wt&&qr.push(wt),wt=[]),wt.push(new Xt(Lr,Ur));else{if(7!==sr)throw new Error("unknown command "+sr);wt&&wt.push(wt[0].clone())}}return wt&&qr.push(wt),qr},Rl.prototype.bbox=function(){var ze=this._pbf;ze.pos=this._geometry;for(var wt=ze.readVarint()+ze.pos,Rt=1,Xt=0,sr=0,Dr=0,Lr=1/0,Ur=-1/0,qr=1/0,ri=-1/0;ze.pos<wt;){if(Xt<=0){var ai=ze.readVarint();Rt=7&ai,Xt=ai>>3}if(Xt--,1===Rt||2===Rt)(sr+=ze.readSVarint())<Lr&&(Lr=sr),sr>Ur&&(Ur=sr),(Dr+=ze.readSVarint())<qr&&(qr=Dr),Dr>ri&&(ri=Dr);else if(7!==Rt)throw new Error("unknown command "+Rt)}return[Lr,qr,Ur,ri]},Rl.prototype.toGeoJSON=function(ze,wt,Rt){var Xt,sr,Dr=this.extent*Math.pow(2,Rt),Lr=this.extent*ze,Ur=this.extent*wt,qr=this.loadGeometry(),ri=Rl.types[this.type];function c(ze){for(var wt=0;wt<ze.length;wt++){var Rt=ze[wt];ze[wt]=[360*(Rt.x+Lr)/Dr-180,360/Math.PI*Math.atan(Math.exp((180-360*(Rt.y+Ur)/Dr)*Math.PI/180))-90]}}switch(this.type){case 1:var ai=[];for(Xt=0;Xt<qr.length;Xt++)ai[Xt]=qr[Xt][0];c(qr=ai);break;case 2:for(Xt=0;Xt<qr.length;Xt++)c(qr[Xt]);break;case 3:for(qr=function(ze){var wt=ze.length;if(wt<=1)return[ze];for(var Rt,Xt,sr=[],Dr=0;Dr<wt;Dr++){var Lr=$l(ze[Dr]);0!==Lr&&(void 0===Xt&&(Xt=Lr<0),Xt===Lr<0?(Rt&&sr.push(Rt),Rt=[ze[Dr]]):Rt.push(ze[Dr]))}return Rt&&sr.push(Rt),sr}(qr),Xt=0;Xt<qr.length;Xt++)for(sr=0;sr<qr[Xt].length;sr++)c(qr[Xt][sr])}1===qr.length?qr=qr[0]:ri="Multi"+ri;var Yi={type:"Feature",geometry:{type:ri,coordinates:qr},properties:this.properties};return"id"in this&&(Yi.id=this.id),Yi};var Jd=ql;function ql(ze,wt){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=ze,this._keys=[],this._values=[],this._features=[],ze.readFields(Nl,this,wt),this.length=this._features.length}function Nl(ze,wt,Rt){15===ze?wt.version=Rt.readVarint():1===ze?wt.name=Rt.readString():5===ze?wt.extent=Rt.readVarint():2===ze?wt._features.push(Rt.pos):3===ze?wt._keys.push(Rt.readString()):4===ze&&wt._values.push(function(ze){for(var wt=null,Rt=ze.readVarint()+ze.pos;ze.pos<Rt;){var Xt=ze.readVarint()>>3;wt=1===Xt?ze.readString():2===Xt?ze.readFloat():3===Xt?ze.readDouble():4===Xt?ze.readVarint64():5===Xt?ze.readVarint():6===Xt?ze.readSVarint():7===Xt?ze.readBoolean():null}return wt}(Rt))}function jl(ze,wt,Rt){if(3===ze){var Xt=new Jd(Rt,Rt.readVarint()+Rt.pos);Xt.length&&(wt[Xt.name]=Xt)}}ql.prototype.feature=function(ze){if(ze<0||ze>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[ze];var wt=this._pbf.readVarint()+this._pbf.pos;return new Yd(this._pbf,wt,this.extent,this._keys,this._values)};var Qd={VectorTile:function(ze,wt){this.layers=ze.readFields(jl,{},wt)},VectorTileFeature:Yd,VectorTileLayer:Jd};const th=Qd.VectorTileFeature.types,oh=Math.pow(2,13);function Kl(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){ze.emplaceBack((wt<<1)+Lr,(Rt<<1)+Dr,(Math.floor(Xt*oh)<<1)+sr,Math.round(Ur))}class Hl{constructor(){this.acc=new Xt(0,0),this.polyCount=[]}startRing(ze){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Xt(ze.x,ze.y),this.max=new Xt(ze.x,ze.y))}append(ze,wt){this.currentPolyCount.edges++,this.acc._add(ze);let Rt=!!this.borders;const Xt=this.min,sr=this.max;ze.x<Xt.x?(Xt.x=ze.x,Rt=!0):ze.x>sr.x&&(sr.x=ze.x,Rt=!0),ze.y<Xt.y?(Xt.y=ze.y,Rt=!0):ze.y>sr.y&&(sr.y=ze.y,Rt=!0),((0===ze.x||ze.x===Ed)&&ze.x===wt.x)!=((0===ze.y||ze.y===Ed)&&ze.y===wt.y)&&this.processBorderOverlap(ze,wt),Rt&&this.checkBorderIntersection(ze,wt)}checkBorderIntersection(ze,wt){wt.x<0!=ze.x<0&&this.addBorderIntersection(0,rr(wt.y,ze.y,(0-wt.x)/(ze.x-wt.x))),wt.x>Ed!=ze.x>Ed&&this.addBorderIntersection(1,rr(wt.y,ze.y,(Ed-wt.x)/(ze.x-wt.x))),wt.y<0!=ze.y<0&&this.addBorderIntersection(2,rr(wt.x,ze.x,(0-wt.y)/(ze.y-wt.y))),wt.y>Ed!=ze.y>Ed&&this.addBorderIntersection(3,rr(wt.x,ze.x,(Ed-wt.y)/(ze.y-wt.y)))}addBorderIntersection(ze,wt){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const Rt=this.borders[ze];wt<Rt[0]&&(Rt[0]=wt),wt>Rt[1]&&(Rt[1]=wt)}processBorderOverlap(ze,wt){if(ze.x===wt.x){if(ze.y===wt.y)return;const Rt=0===ze.x?0:1;this.addBorderIntersection(Rt,wt.y),this.addBorderIntersection(Rt,ze.y)}else{const Rt=0===ze.y?2:3;this.addBorderIntersection(Rt,wt.x),this.addBorderIntersection(Rt,ze.x)}}centroid(){const ze=this.polyCount.reduce((ze,wt)=>ze+wt.edges,0);return 0!==ze?this.acc.div(ze)._round():new Xt(0,0)}span(){return new Xt(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((ze,wt)=>ze+ +(wt[0]!==Number.MAX_VALUE),0)}}class Yl{constructor(ze){this.zoom=ze.zoom,this.overscaling=ze.overscaling,this.layers=ze.layers,this.layerIds=this.layers.map(ze=>ze.id),this.index=ze.index,this.hasPattern=!1,this.layoutVertexArray=new Ts,this.centroidVertexArray=new aa,this.indexArray=new $s,this.programConfigurations=new Ea(ze.layers,ze.zoom),this.segments=new $a,this.stateDependentLayerIds=this.layers.filter(ze=>ze.isStateDependent()).map(ze=>ze.id),this.enableTerrain=ze.enableTerrain}populate(ze,wt,Rt){this.features=[],this.hasPattern=Ml("fill-extrusion",this.layers,wt),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDone=[!1,!1,!1,!1],this.tileToMeter=function(ze){const wt=Math.exp(Math.PI*(1-ze.y/(1<<ze.z)*2));return 80150034*wt/(wt*wt+1)/Ed/(1<<ze.z)}(Rt);for(const{feature:Xt,id:sr,index:Dr,sourceLayerIndex:Lr}of ze){const ze=this.layers[0]._featureFilter.needGeometry,Ur=Ga(Xt,ze);if(!this.layers[0]._featureFilter.filter(new as(this.zoom),Ur,Rt))continue;const qr={id:sr,sourceLayerIndex:Lr,index:Dr,geometry:ze?Ur.geometry:ja(Xt),properties:Xt.properties,type:Xt.type,patterns:{}},ri=this.layoutVertexArray.length;this.hasPattern?this.features.push(El("fill-extrusion",this.layers,qr,this.zoom,wt)):this.addFeature(qr,qr.geometry,Dr,Rt,{}),wt.featureIndex.insert(Xt,qr.geometry,Dr,Lr,this.index,ri)}this.sortBorders()}addFeatures(ze,wt,Rt){for(const ze of this.features){const{geometry:Xt}=ze;this.addFeature(ze,Xt,ze.index,wt,Rt)}this.sortBorders()}update(ze,wt,Rt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(ze,wt,this.stateDependentLayers,Rt)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(ze){this.uploaded||(this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,Kd),this.indexBuffer=ze.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(ze),this.uploaded=!0}uploadCentroid(ze){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=ze.createVertexBuffer(this.centroidVertexArray,Xd.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(ze,wt,Rt,Xt,sr){const Dr=this.enableTerrain?new Hl:null;for(const Rt of zl(wt,500)){let wt=0,Xt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);if(0===Rt.length||(Lr=Rt[0]).every(ze=>ze.x<=0)||Lr.every(ze=>ze.x>=Ed)||Lr.every(ze=>ze.y<=0)||Lr.every(ze=>ze.y>=Ed))continue;for(let ze=0;ze<Rt.length;ze++){const sr=Rt[ze];if(0===sr.length)continue;wt+=sr.length;let Lr=0;Dr&&Dr.startRing(sr[0]);for(let ze=0;ze<sr.length;ze++){const wt=sr[ze];if(ze>=1){const Rt=sr[ze-1];if(!Jl(wt,Rt)){Dr&&Dr.append(wt,Rt),Xt.vertexLength+4>$a.MAX_VERTEX_ARRAY_LENGTH&&(Xt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ze=wt.sub(Rt)._perp(),sr=ze.x/(Math.abs(ze.x)+Math.abs(ze.y)),Ur=ze.y>0?1:0,qr=Rt.dist(wt);Lr+qr>32768&&(Lr=0),Kl(this.layoutVertexArray,wt.x,wt.y,sr,Ur,0,0,Lr),Kl(this.layoutVertexArray,wt.x,wt.y,sr,Ur,0,1,Lr),Lr+=qr,Kl(this.layoutVertexArray,Rt.x,Rt.y,sr,Ur,0,0,Lr),Kl(this.layoutVertexArray,Rt.x,Rt.y,sr,Ur,0,1,Lr);const ri=Xt.vertexLength;this.indexArray.emplaceBack(ri,ri+2,ri+1),this.indexArray.emplaceBack(ri+1,ri+2,ri+3),Xt.vertexLength+=4,Xt.primitiveLength+=2}}}}if(Xt.vertexLength+wt>$a.MAX_VERTEX_ARRAY_LENGTH&&(Xt=this.segments.prepareSegment(wt,this.layoutVertexArray,this.indexArray)),"Polygon"!==th[ze.type])continue;const sr=[],Ur=[],qr=Xt.vertexLength;for(let ze=0;ze<Rt.length;ze++){const wt=Rt[ze];if(0!==wt.length){wt!==Rt[0]&&Ur.push(sr.length/2);for(let ze=0;ze<wt.length;ze++){const Rt=wt[ze];Kl(this.layoutVertexArray,Rt.x,Rt.y,0,0,1,1,0),sr.push(Rt.x),sr.push(Rt.y),Dr&&Dr.currentPolyCount.top++}}}const ri=qd(sr,Ur);for(let ze=0;ze<ri.length;ze+=3)this.indexArray.emplaceBack(qr+ri[ze],qr+ri[ze+2],qr+ri[ze+1]);Xt.primitiveLength+=ri.length/3,Xt.vertexLength+=wt}var Lr;if(Dr&&Dr.polyCount.length>0){if(Dr.borders){Dr.vertexArrayOffset=this.centroidVertexArray.length;const ze=Dr.borders,wt=this.featuresOnBorder.push(Dr)-1;for(let Rt=0;Rt<4;Rt++)ze[Rt][0]!==Number.MAX_VALUE&&this.borders[Rt].push(wt)}this.encodeCentroid(Dr.borders?void 0:Dr.centroid(),Dr)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,ze,Rt,sr,Xt)}sortBorders(){for(let ze=0;ze<4;ze++)this.borders[ze].sort((wt,Rt)=>this.featuresOnBorder[wt].borders[ze][0]-this.featuresOnBorder[Rt].borders[ze][0])}encodeCentroid(ze,wt,Rt=!0){let Xt,sr;if(ze)if(0!==ze.y){const Rt=wt.span()._mult(this.tileToMeter);Xt=(Math.max(ze.x,1)<<3)+Math.min(7,Math.round(Rt.x/10)),sr=(Math.max(ze.y,1)<<3)+Math.min(7,Math.round(Rt.y/10))}else Xt=Math.ceil(7*(ze.x+450)),sr=0;else Xt=0,sr=+Rt;let Dr=Rt?this.centroidVertexArray.length:wt.vertexArrayOffset;for(const ze of wt.polyCount){Rt&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*ze.edges+ze.top);for(let wt=0;wt<2*ze.edges;wt++)this.centroidVertexArray.emplace(Dr++,0,sr),this.centroidVertexArray.emplace(Dr++,Xt,sr);for(let wt=0;wt<ze.top;wt++)this.centroidVertexArray.emplace(Dr++,Xt,sr)}}}function Jl(ze,wt){return ze.x===wt.x&&(ze.x<0||ze.x>Ed)||ze.y===wt.y&&(ze.y<0||ze.y>Ed)}oi("FillExtrusionBucket",Yl,{omit:["layers","features"]}),oi("PartMetadata",Hl);var ah={paint:new bs({"fill-extrusion-opacity":new ys(Pl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ms(Pl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ys(Pl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ys(Pl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new gs(Pl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ms(Pl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ms(Pl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ys(Pl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Ql(ze,wt){return ze.x*wt.x+ze.y*wt.y}function tu(ze,wt){if(1===ze.length){let Rt=0;const Xt=wt[Rt++];let sr;for(;!sr||Xt.equals(sr);)if(sr=wt[Rt++],!sr)return 1/0;for(;Rt<wt.length;Rt++){const Dr=wt[Rt],Lr=ze[0],Ur=sr.sub(Xt),qr=Dr.sub(Xt),ri=Lr.sub(Xt),ai=Ql(Ur,Ur),Yi=Ql(Ur,qr),Ji=Ql(qr,qr),Qi=Ql(ri,Ur),kn=Ql(ri,qr),jn=ai*Ji-Yi*Yi,Un=(Ji*Qi-Yi*kn)/jn,Wn=(ai*kn-Yi*Qi)/jn,Yn=Xt.z*(1-Un-Wn)+sr.z*Un+Dr.z*Wn;if(isFinite(Yn))return Yn}return 1/0}{let ze=1/0;for(const Rt of wt)ze=Math.min(ze,Rt.z);return ze}}function eu(ze){const wt=new Xt(ze[0],ze[1]);return wt.z=ze[2],wt}function ru(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=Lr*sr.getElevationAt(ze,wt,!0,!0),ri=0!==Dr[0],ai=ri?0===Dr[1]?Lr*(Dr[0]/7-450):Lr*function(ze,wt,Rt){const Xt=Math.floor(wt[0]/8),sr=Math.floor(wt[1]/8),Dr=10*(wt[0]-8*Xt),Lr=10*(wt[1]-8*sr),Ur=ze.getElevationAt(Xt,sr,!0,!0),qr=ze.getMeterToDEM(Rt),ri=Math.floor(.5*(Dr*qr-1)),ai=Math.floor(.5*(Lr*qr-1)),Yi=ze.tileCoordToPixel(Xt,sr),Ji=2*ri+1,Qi=2*ai+1,kn=function(ze,wt,Rt,Xt,sr){return[ze.getElevationAtPixel(wt,Rt,!0),ze.getElevationAtPixel(wt+sr,Rt,!0),ze.getElevationAtPixel(wt,Rt+sr,!0),ze.getElevationAtPixel(wt+Xt,Rt+sr,!0)]}(ze,Yi.x-ri,Yi.y-ai,Ji,Qi),jn=Math.abs(kn[0]-kn[1]),Un=Math.abs(kn[2]-kn[3]),Wn=Math.abs(kn[0]-kn[2])+Math.abs(kn[1]-kn[3]),Yn=Math.min(.25,.5*qr*(jn+Un)/Ji),Jn=Math.min(.25,.5*qr*Wn/Qi);return Ur+Math.max(Yn*Dr,Jn*Lr)}(sr,Dr,Ur):qr;return{base:qr+(0===Rt)?-1:Rt,top:ri?Math.max(ai+Xt,qr+Rt+2):qr+Xt}}const fh=Ss([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:yh}=fh,vh=Ss([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:xh}=vh,wh=Qd.VectorTileFeature.types,Sh=Math.cos(Math.PI/180*37.5);class uu{constructor(ze){this.zoom=ze.zoom,this.overscaling=ze.overscaling,this.layers=ze.layers,this.layerIds=this.layers.map(ze=>ze.id),this.index=ze.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ze=>{this.gradients[ze.id]={}}),this.layoutVertexArray=new Ms,this.layoutVertexArray2=new Es,this.indexArray=new $s,this.programConfigurations=new Ea(ze.layers,ze.zoom),this.segments=new $a,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ze=>ze.isStateDependent()).map(ze=>ze.id)}populate(ze,wt,Rt){this.hasPattern=Ml("line",this.layers,wt);const Xt=this.layers[0].layout.get("line-sort-key"),sr=[];for(const{feature:wt,id:Dr,index:Lr,sourceLayerIndex:Ur}of ze){const ze=this.layers[0]._featureFilter.needGeometry,qr=Ga(wt,ze);if(!this.layers[0]._featureFilter.filter(new as(this.zoom),qr,Rt))continue;const ri=Xt?Xt.evaluate(qr,{},Rt):void 0,ai={id:Dr,properties:wt.properties,type:wt.type,sourceLayerIndex:Ur,index:Lr,geometry:ze?qr.geometry:ja(wt),patterns:{},sortKey:ri};sr.push(ai)}Xt&&sr.sort((ze,wt)=>ze.sortKey-wt.sortKey);const{lineAtlas:Dr,featureIndex:Lr}=wt,Ur=this.addConstantDashes(Dr);for(const Xt of sr){const{geometry:sr,index:qr,sourceLayerIndex:ri}=Xt;if(Ur&&this.addFeatureDashes(Xt,Dr),this.hasPattern){const ze=El("line",this.layers,Xt,this.zoom,wt);this.patternFeatures.push(ze)}else this.addFeature(Xt,sr,qr,Rt,Dr.positions);Lr.insert(ze[qr].feature,sr,qr,ri,this.index)}}addConstantDashes(ze){let wt=!1;for(const Rt of this.layers){const Xt=Rt.paint.get("line-dasharray").value,sr=Rt.layout.get("line-cap").value;if("constant"!==Xt.kind||"constant"!==sr.kind)wt=!0;else{const wt=sr.value,Rt=Xt.value;if(!Rt)continue;ze.addDash(Rt.from,wt),ze.addDash(Rt.to,wt),Rt.other&&ze.addDash(Rt.other,wt)}}return wt}addFeatureDashes(ze,wt){const Rt=this.zoom;for(const Xt of this.layers){const sr=Xt.paint.get("line-dasharray").value,Dr=Xt.layout.get("line-cap").value;if("constant"===sr.kind&&"constant"===Dr.kind)continue;let Lr,Ur,qr,ri,ai,Yi;if("constant"===sr.kind){const ze=sr.value;if(!ze)continue;Lr=ze.other||ze.to,Ur=ze.to,qr=ze.from}else Lr=sr.evaluate({zoom:Rt-1},ze),Ur=sr.evaluate({zoom:Rt},ze),qr=sr.evaluate({zoom:Rt+1},ze);"constant"===Dr.kind?ri=ai=Yi=Dr.value:(ri=Dr.evaluate({zoom:Rt-1},ze),ai=Dr.evaluate({zoom:Rt},ze),Yi=Dr.evaluate({zoom:Rt+1},ze)),wt.addDash(Lr,ri),wt.addDash(Ur,ai),wt.addDash(qr,Yi);const Ji=wt.getKey(Lr,ri),Qi=wt.getKey(Ur,ai),kn=wt.getKey(qr,Yi);ze.patterns[Xt.id]={min:Ji,mid:Qi,max:kn}}}update(ze,wt,Rt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(ze,wt,this.stateDependentLayers,Rt)}addFeatures(ze,wt,Rt){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,wt,Rt)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(ze){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=ze.createVertexBuffer(this.layoutVertexArray2,xh)),this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,yh),this.indexBuffer=ze.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(ze),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(ze){if(ze.properties&&ze.properties.hasOwnProperty("mapbox_clip_start")&&ze.properties.hasOwnProperty("mapbox_clip_end"))return{start:+ze.properties.mapbox_clip_start,end:+ze.properties.mapbox_clip_end}}addFeature(ze,wt,Rt,Xt,sr){const Dr=this.layers[0].layout,Lr=Dr.get("line-join").evaluate(ze,{}),Ur=Dr.get("line-cap").evaluate(ze,{}),qr=Dr.get("line-miter-limit"),ri=Dr.get("line-round-limit");this.lineClips=this.lineFeatureClips(ze);for(const Rt of wt)this.addLine(Rt,ze,Lr,Ur,qr,ri);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,ze,Rt,sr,Xt)}addLine(ze,wt,Rt,Xt,sr,Dr){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let wt=0;wt<ze.length-1;wt++)this.totalDistance+=ze[wt].dist(ze[wt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const Lr="Polygon"===wh[wt.type];let Ur=ze.length;for(;Ur>=2&&ze[Ur-1].equals(ze[Ur-2]);)Ur--;let qr=0;for(;qr<Ur-1&&ze[qr].equals(ze[qr+1]);)qr++;if(Ur<(Lr?3:2))return;"bevel"===Rt&&(sr=1.05);const ri=this.overscaling<=16?122880/(512*this.overscaling):0,ai=this.segments.prepareSegment(10*Ur,this.layoutVertexArray,this.indexArray);let Yi,Ji,Qi,kn,jn;this.e1=this.e2=-1,Lr&&(Yi=ze[Ur-2],jn=ze[qr].sub(Yi)._unit()._perp());for(let wt=qr;wt<Ur;wt++){if(Qi=wt===Ur-1?Lr?ze[qr+1]:void 0:ze[wt+1],Qi&&ze[wt].equals(Qi))continue;jn&&(kn=jn),Yi&&(Ji=Yi),Yi=ze[wt],jn=Qi?Qi.sub(Yi)._unit()._perp():kn,kn=kn||jn;let Un=kn.add(jn);0===Un.x&&0===Un.y||Un._unit();const Wn=kn.x*jn.x+kn.y*jn.y,Yn=Un.x*jn.x+Un.y*jn.y,Jn=0!==Yn?1/Yn:1/0,Qn=2*Math.sqrt(2-2*Yn),Io=Yn<Sh&&Ji&&Qi,Mo=kn.x*jn.y-kn.y*jn.x>0;if(Io&&wt>qr){const ze=Yi.dist(Ji);if(ze>2*ri){const wt=Yi.sub(Yi.sub(Ji)._mult(ri/ze)._round());this.updateDistance(Ji,wt),this.addCurrentVertex(wt,kn,0,0,ai),Ji=wt}}const jo=Ji&&Qi;let zo=jo?Rt:Lr?"butt":Xt;if(jo&&"round"===zo&&(Jn<Dr?zo="miter":Jn<=2&&(zo="fakeround")),"miter"===zo&&Jn>sr&&(zo="bevel"),"bevel"===zo&&(Jn>2&&(zo="flipbevel"),Jn<sr&&(zo="miter")),Ji&&this.updateDistance(Ji,Yi),"miter"===zo)Un._mult(Jn),this.addCurrentVertex(Yi,Un,0,0,ai);else if("flipbevel"===zo){if(Jn>100)Un=jn.mult(-1);else{const ze=Jn*kn.add(jn).mag()/kn.sub(jn).mag();Un._perp()._mult(ze*(Mo?-1:1))}this.addCurrentVertex(Yi,Un,0,0,ai),this.addCurrentVertex(Yi,Un.mult(-1),0,0,ai)}else if("bevel"===zo||"fakeround"===zo){const ze=-Math.sqrt(Jn*Jn-1),wt=Mo?ze:0,Rt=Mo?0:ze;if(Ji&&this.addCurrentVertex(Yi,kn,wt,Rt,ai),"fakeround"===zo){const ze=Math.round(180*Qn/Math.PI/20);for(let wt=1;wt<ze;wt++){let Rt=wt/ze;if(.5!==Rt){const ze=Rt-.5;Rt+=Rt*ze*(Rt-1)*((1.0904+Wn*(Wn*(3.55645-1.43519*Wn)-3.2452))*ze*ze+(.848013+Wn*(.215638*Wn-1.06021)))}const Xt=jn.sub(kn)._mult(Rt)._add(kn)._unit()._mult(Mo?-1:1);this.addHalfVertex(Yi,Xt.x,Xt.y,!1,Mo,0,ai)}}Qi&&this.addCurrentVertex(Yi,jn,-wt,-Rt,ai)}else if("butt"===zo)this.addCurrentVertex(Yi,Un,0,0,ai);else if("square"===zo){const ze=Ji?1:-1;Ji||this.addCurrentVertex(Yi,Un,ze,ze,ai),this.addCurrentVertex(Yi,Un,0,0,ai),Ji&&this.addCurrentVertex(Yi,Un,ze,ze,ai)}else"round"===zo&&(Ji&&(this.addCurrentVertex(Yi,kn,0,0,ai),this.addCurrentVertex(Yi,kn,1,1,ai,!0)),Qi&&(this.addCurrentVertex(Yi,jn,-1,-1,ai,!0),this.addCurrentVertex(Yi,jn,0,0,ai)));if(Io&&wt<Ur-1){const ze=Yi.dist(Qi);if(ze>2*ri){const wt=Yi.add(Qi.sub(Yi)._mult(ri/ze)._round());this.updateDistance(Yi,wt),this.addCurrentVertex(wt,jn,0,0,ai),Yi=wt}}}}addCurrentVertex(ze,wt,Rt,Xt,sr,Dr=!1){const Lr=wt.y*Xt-wt.x,Ur=-wt.y-wt.x*Xt;this.addHalfVertex(ze,wt.x+wt.y*Rt,wt.y-wt.x*Rt,Dr,!1,Rt,sr),this.addHalfVertex(ze,Lr,Ur,Dr,!0,-Xt,sr)}addHalfVertex({x:ze,y:wt},Rt,Xt,sr,Dr,Lr,Ur){this.layoutVertexArray.emplaceBack((ze<<1)+(sr?1:0),(wt<<1)+(Dr?1:0),Math.round(63*Rt)+128,Math.round(63*Xt)+128,1+(0===Lr?0:Lr<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length);const qr=Ur.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,qr),Ur.primitiveLength++),Dr?this.e2=qr:this.e1=qr}updateScaledDistance(){if(this.lineClips){const ze=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=ze*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(ze,wt){this.distance+=ze.dist(wt),this.updateScaledDistance()}}oi("LineBucket",uu,{omit:["layers","patternFeatures"]});const Th=new bs({"line-cap":new ms(Pl.layout_line["line-cap"]),"line-join":new ms(Pl.layout_line["line-join"]),"line-miter-limit":new ys(Pl.layout_line["line-miter-limit"]),"line-round-limit":new ys(Pl.layout_line["line-round-limit"]),"line-sort-key":new ms(Pl.layout_line["line-sort-key"])});var Ph={paint:new bs({"line-opacity":new ms(Pl.paint_line["line-opacity"]),"line-color":new ms(Pl.paint_line["line-color"]),"line-translate":new ys(Pl.paint_line["line-translate"]),"line-translate-anchor":new ys(Pl.paint_line["line-translate-anchor"]),"line-width":new ms(Pl.paint_line["line-width"]),"line-gap-width":new ms(Pl.paint_line["line-gap-width"]),"line-offset":new ms(Pl.paint_line["line-offset"]),"line-blur":new ms(Pl.paint_line["line-blur"]),"line-dasharray":new gs(Pl.paint_line["line-dasharray"]),"line-pattern":new gs(Pl.paint_line["line-pattern"]),"line-gradient":new vs(Pl.paint_line["line-gradient"])}),layout:Th};const kh=new class extends ms{possiblyEvaluate(ze,wt){return wt=new as(Math.floor(wt.zoom),{now:wt.now,fadeDuration:wt.fadeDuration,zoomHistory:wt.zoomHistory,transition:wt.transition}),super.possiblyEvaluate(ze,wt)}evaluate(ze,wt,Rt,Xt){return wt=v({},wt,{zoom:Math.floor(wt.zoom)}),super.evaluate(ze,wt,Rt,Xt)}}(Ph.paint.properties["line-width"].specification);function du(ze,wt){return wt>0?wt+2*ze:ze}kh.useIntegerZoom=!0;const Ah=Ss([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ih=Ss([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ss([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const zh=Ss([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Nh=Ss([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);Ss([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Bh=Ss([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Qh=Ss([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ss([{name:"triangle",components:3,type:"Uint16"}]),Ss([{type:"Float32",name:"anchorX"},{type:"Float32",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"},{type:"Uint8",name:"flipState"}]),Ss([{type:"Float32",name:"anchorX"},{type:"Float32",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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ss([{type:"Float32",name:"offsetX"}]),Ss([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var cp=24;const fp=128;function _u(ze,wt){const{expression:Rt}=wt;if("constant"===Rt.kind)return{kind:"constant",layoutSize:Rt.evaluate(new as(ze+1))};if("source"===Rt.kind)return{kind:"source"};{const{zoomStops:wt,interpolationType:Xt}=Rt;let sr=0;for(;sr<wt.length&&wt[sr]<=ze;)sr++;sr=Math.max(0,sr-1);let Dr=sr;for(;Dr<wt.length&&wt[Dr]<ze+1;)Dr++;Dr=Math.min(wt.length-1,Dr);const Lr=wt[sr],Ur=wt[Dr];return"composite"===Rt.kind?{kind:"composite",minZoom:Lr,maxZoom:Ur,interpolationType:Xt}:{kind:"camera",minZoom:Lr,maxZoom:Ur,minSize:Rt.evaluate(new as(Lr)),maxSize:Rt.evaluate(new as(Ur)),interpolationType:Xt}}}function ku(ze,{uSize:wt,uSizeT:Rt},{lowerSize:Xt,upperSize:sr}){return"source"===ze.kind?Xt/fp:"composite"===ze.kind?rr(Xt/fp,sr/fp,Rt):wt}function Au(ze,wt){let Rt=0,Xt=0;if("constant"===ze.kind)Xt=ze.layoutSize;else if("source"!==ze.kind){const{interpolationType:sr,minZoom:Dr,maxZoom:Lr}=ze,Ur=sr?y(wr.interpolationFactor(sr,wt,Dr,Lr),0,1):0;"camera"===ze.kind?Xt=rr(ze.minSize,ze.maxSize,Ur):Rt=Ur}return{uSizeT:Rt,uSize:Xt}}var gp=Object.freeze({__proto__:null,getSizeData:_u,evaluateSizeForFeature:ku,evaluateSizeForZoom:Au,SIZE_PACK_FACTOR:fp});function Iu(ze,wt,Rt){return ze.sections.forEach(ze=>{ze.text=function(ze,wt,Rt){const Xt=wt.layout.get("text-transform").evaluate(Rt,{});return"uppercase"===Xt?ze=ze.toLocaleUpperCase():"lowercase"===Xt&&(ze=ze.toLocaleLowerCase()),dd.applyArabicShaping&&(ze=dd.applyArabicShaping(ze)),ze}(ze.text,wt,Rt)}),ze}const xp={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"};function Tu(ze){return"︶"===ze||"ï¹"===ze||"︸"===ze||"ï¹"===ze||"ï¹"===ze||"︾"===ze||"︼"===ze||"︺"===ze||"ï¸"===ze||"ï¹"===ze||"ï¸"===ze||"ï¸"===ze||"ï¸"===ze||"ï½"===ze||"ï¿£"===ze||"ï¸"===ze||"ï¸"===ze}function Mu(ze){return"︵"===ze||"ï¹"===ze||"︷"===ze||"ï¹"===ze||"ï¹"===ze||"︽"===ze||"︻"===ze||"︹"===ze||"ï¸"===ze||"︿"===ze}var Eu=function(ze,wt,Rt,Xt,sr){var Dr,Lr,Ur=8*sr-Xt-1,qr=(1<<Ur)-1,ri=qr>>1,ai=-7,Yi=Rt?sr-1:0,Ji=Rt?-1:1,Qi=ze[wt+Yi];for(Yi+=Ji,Dr=Qi&(1<<-ai)-1,Qi>>=-ai,ai+=Ur;ai>0;Dr=256*Dr+ze[wt+Yi],Yi+=Ji,ai-=8);for(Lr=Dr&(1<<-ai)-1,Dr>>=-ai,ai+=Xt;ai>0;Lr=256*Lr+ze[wt+Yi],Yi+=Ji,ai-=8);if(0===Dr)Dr=1-ri;else{if(Dr===qr)return Lr?NaN:1/0*(Qi?-1:1);Lr+=Math.pow(2,Xt),Dr-=ri}return(Qi?-1:1)*Lr*Math.pow(2,Dr-Xt)},Bu=function(ze,wt,Rt,Xt,sr,Dr){var Lr,Ur,qr,ri=8*Dr-sr-1,ai=(1<<ri)-1,Yi=ai>>1,Ji=23===sr?Math.pow(2,-24)-Math.pow(2,-77):0,Qi=Xt?0:Dr-1,kn=Xt?1:-1,jn=wt<0||0===wt&&1/wt<0?1:0;for(wt=Math.abs(wt),isNaN(wt)||wt===1/0?(Ur=isNaN(wt)?1:0,Lr=ai):(Lr=Math.floor(Math.log(wt)/Math.LN2),wt*(qr=Math.pow(2,-Lr))<1&&(Lr--,qr*=2),(wt+=Lr+Yi>=1?Ji/qr:Ji*Math.pow(2,1-Yi))*qr>=2&&(Lr++,qr/=2),Lr+Yi>=ai?(Ur=0,Lr=ai):Lr+Yi>=1?(Ur=(wt*qr-1)*Math.pow(2,sr),Lr+=Yi):(Ur=wt*Math.pow(2,Yi-1)*Math.pow(2,sr),Lr=0));sr>=8;ze[Rt+Qi]=255&Ur,Qi+=kn,Ur/=256,sr-=8);for(Lr=Lr<<sr|Ur,ri+=sr;ri>0;ze[Rt+Qi]=255&Lr,Qi+=kn,Lr/=256,ri-=8);ze[Rt+Qi-kn]|=128*jn},Pp=Pu;function Pu(ze){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(ze)?ze:new Uint8Array(ze||0),this.pos=0,this.type=0,this.length=this.buf.length}Pu.Varint=0,Pu.Fixed64=1,Pu.Bytes=2,Pu.Fixed32=5;var Cp=4294967296,Op=1/Cp,Dp="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Fu(ze){return ze.type===Pu.Bytes?ze.readVarint()+ze.pos:ze.pos+1}function Ru(ze,wt,Rt){return Rt?4294967296*wt+(ze>>>0):4294967296*(wt>>>0)+(ze>>>0)}function Uu(ze,wt,Rt){var Xt=wt<=16383?1:wt<=2097151?2:wt<=268435455?3:Math.floor(Math.log(wt)/(7*Math.LN2));Rt.realloc(Xt);for(var sr=Rt.pos-1;sr>=ze;sr--)Rt.buf[sr+Xt]=Rt.buf[sr]}function $u(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeVarint(ze[Rt])}function Ou(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeSVarint(ze[Rt])}function qu(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeFloat(ze[Rt])}function Nu(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeDouble(ze[Rt])}function ju(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeBoolean(ze[Rt])}function Gu(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeFixed32(ze[Rt])}function Zu(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeSFixed32(ze[Rt])}function Xu(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeFixed64(ze[Rt])}function Ku(ze,wt){for(var Rt=0;Rt<ze.length;Rt++)wt.writeSFixed64(ze[Rt])}function Hu(ze,wt){return(ze[wt]|ze[wt+1]<<8|ze[wt+2]<<16)+16777216*ze[wt+3]}function Yu(ze,wt,Rt){ze[Rt]=wt,ze[Rt+1]=wt>>>8,ze[Rt+2]=wt>>>16,ze[Rt+3]=wt>>>24}function Ju(ze,wt){return(ze[wt]|ze[wt+1]<<8|ze[wt+2]<<16)+(ze[wt+3]<<24)}function Wu(ze,wt,Rt){wt.glyphs=[],1===ze&&Rt.readMessage(Qu,wt)}function Qu(ze,wt,Rt){if(3===ze){const{id:ze,bitmap:Xt,width:sr,height:Dr,left:Lr,top:Ur,advance:qr}=Rt.readMessage(tc,{});wt.glyphs.push({id:ze,bitmap:new qo({width:sr+6,height:Dr+6},Xt),metrics:{width:sr,height:Dr,left:Lr,top:Ur,advance:qr}})}else 4===ze?wt.ascender=Rt.readSVarint():5===ze&&(wt.descender=Rt.readSVarint())}function tc(ze,wt,Rt){1===ze?wt.id=Rt.readVarint():2===ze?wt.bitmap=Rt.readBytes():3===ze?wt.width=Rt.readVarint():4===ze?wt.height=Rt.readVarint():5===ze?wt.left=Rt.readSVarint():6===ze?wt.top=Rt.readSVarint():7===ze&&(wt.advance=Rt.readVarint())}function ec(ze){let wt=0,Rt=0;for(const Xt of ze)wt+=Xt.w*Xt.h,Rt=Math.max(Rt,Xt.w);ze.sort((ze,wt)=>wt.h-ze.h);const Xt=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(wt/.95)),Rt),h:1/0}];let sr=0,Dr=0;for(const wt of ze)for(let ze=Xt.length-1;ze>=0;ze--){const Rt=Xt[ze];if(!(wt.w>Rt.w||wt.h>Rt.h)){if(wt.x=Rt.x,wt.y=Rt.y,Dr=Math.max(Dr,wt.y+wt.h),sr=Math.max(sr,wt.x+wt.w),wt.w===Rt.w&&wt.h===Rt.h){const wt=Xt.pop();ze<Xt.length&&(Xt[ze]=wt)}else wt.h===Rt.h?(Rt.x+=wt.w,Rt.w-=wt.w):wt.w===Rt.w?(Rt.y+=wt.h,Rt.h-=wt.h):(Xt.push({x:Rt.x+wt.w,y:Rt.y,w:Rt.w-wt.w,h:wt.h}),Rt.y+=wt.h,Rt.h-=wt.h);break}}return{w:sr,h:Dr,fill:wt/(sr*Dr)||0}}Pu.prototype={destroy:function(){this.buf=null},readFields:function(ze,wt,Rt){for(Rt=Rt||this.length;this.pos<Rt;){var Xt=this.readVarint(),sr=Xt>>3,Dr=this.pos;this.type=7&Xt,ze(sr,wt,this),this.pos===Dr&&this.skip(Xt)}return wt},readMessage:function(ze,wt){return this.readFields(ze,wt,this.readVarint()+this.pos)},readFixed32:function(){var ze=Hu(this.buf,this.pos);return this.pos+=4,ze},readSFixed32:function(){var ze=Ju(this.buf,this.pos);return this.pos+=4,ze},readFixed64:function(){var ze=Hu(this.buf,this.pos)+Hu(this.buf,this.pos+4)*Cp;return this.pos+=8,ze},readSFixed64:function(){var ze=Hu(this.buf,this.pos)+Ju(this.buf,this.pos+4)*Cp;return this.pos+=8,ze},readFloat:function(){var ze=Eu(this.buf,this.pos,!0,23,4);return this.pos+=4,ze},readDouble:function(){var ze=Eu(this.buf,this.pos,!0,52,8);return this.pos+=8,ze},readVarint:function(ze){var wt,Rt,Xt=this.buf;return wt=127&(Rt=Xt[this.pos++]),Rt<128?wt:(wt|=(127&(Rt=Xt[this.pos++]))<<7,Rt<128?wt:(wt|=(127&(Rt=Xt[this.pos++]))<<14,Rt<128?wt:(wt|=(127&(Rt=Xt[this.pos++]))<<21,Rt<128?wt:function(ze,wt,Rt){var Xt,sr,Dr=Rt.buf;if(Xt=(112&(sr=Dr[Rt.pos++]))>>4,sr<128)return Ru(ze,Xt,wt);if(Xt|=(127&(sr=Dr[Rt.pos++]))<<3,sr<128)return Ru(ze,Xt,wt);if(Xt|=(127&(sr=Dr[Rt.pos++]))<<10,sr<128)return Ru(ze,Xt,wt);if(Xt|=(127&(sr=Dr[Rt.pos++]))<<17,sr<128)return Ru(ze,Xt,wt);if(Xt|=(127&(sr=Dr[Rt.pos++]))<<24,sr<128)return Ru(ze,Xt,wt);if(Xt|=(1&(sr=Dr[Rt.pos++]))<<31,sr<128)return Ru(ze,Xt,wt);throw new Error("Expected varint not more than 10 bytes")}(wt|=(15&(Rt=Xt[this.pos]))<<28,ze,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var ze=this.readVarint();return ze%2==1?(ze+1)/-2:ze/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var ze=this.readVarint()+this.pos,wt=this.pos;return this.pos=ze,ze-wt>=12&&Dp?function(ze,wt,Rt){return Dp.decode(ze.subarray(wt,Rt))}(this.buf,wt,ze):function(ze,wt,Rt){for(var Xt="",sr=wt;sr<Rt;){var Dr,Lr,Ur,qr=ze[sr],ri=null,ai=qr>239?4:qr>223?3:qr>191?2:1;if(sr+ai>Rt)break;1===ai?qr<128&&(ri=qr):2===ai?128==(192&(Dr=ze[sr+1]))&&(ri=(31&qr)<<6|63&Dr)<=127&&(ri=null):3===ai?(Lr=ze[sr+2],128==(192&(Dr=ze[sr+1]))&&128==(192&Lr)&&((ri=(15&qr)<<12|(63&Dr)<<6|63&Lr)<=2047||ri>=55296&&ri<=57343)&&(ri=null)):4===ai&&(Lr=ze[sr+2],Ur=ze[sr+3],128==(192&(Dr=ze[sr+1]))&&128==(192&Lr)&&128==(192&Ur)&&((ri=(15&qr)<<18|(63&Dr)<<12|(63&Lr)<<6|63&Ur)<=65535||ri>=1114112)&&(ri=null)),null===ri?(ri=65533,ai=1):ri>65535&&(ri-=65536,Xt+=String.fromCharCode(ri>>>10&1023|55296),ri=56320|1023&ri),Xt+=String.fromCharCode(ri),sr+=ai}return Xt}(this.buf,wt,ze)},readBytes:function(){var ze=this.readVarint()+this.pos,wt=this.buf.subarray(this.pos,ze);return this.pos=ze,wt},readPackedVarint:function(ze,wt){if(this.type!==Pu.Bytes)return ze.push(this.readVarint(wt));var Rt=Fu(this);for(ze=ze||[];this.pos<Rt;)ze.push(this.readVarint(wt));return ze},readPackedSVarint:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readSVarint());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readSVarint());return ze},readPackedBoolean:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readBoolean());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readBoolean());return ze},readPackedFloat:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readFloat());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readFloat());return ze},readPackedDouble:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readDouble());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readDouble());return ze},readPackedFixed32:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readFixed32());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readFixed32());return ze},readPackedSFixed32:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readSFixed32());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readSFixed32());return ze},readPackedFixed64:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readFixed64());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readFixed64());return ze},readPackedSFixed64:function(ze){if(this.type!==Pu.Bytes)return ze.push(this.readSFixed64());var wt=Fu(this);for(ze=ze||[];this.pos<wt;)ze.push(this.readSFixed64());return ze},skip:function(ze){var wt=7&ze;if(wt===Pu.Varint)for(;this.buf[this.pos++]>127;);else if(wt===Pu.Bytes)this.pos=this.readVarint()+this.pos;else if(wt===Pu.Fixed32)this.pos+=4;else{if(wt!==Pu.Fixed64)throw new Error("Unimplemented type: "+wt);this.pos+=8}},writeTag:function(ze,wt){this.writeVarint(ze<<3|wt)},realloc:function(ze){for(var wt=this.length||16;wt<this.pos+ze;)wt*=2;if(wt!==this.length){var Rt=new Uint8Array(wt);Rt.set(this.buf),this.buf=Rt,this.length=wt}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(ze){this.realloc(4),Yu(this.buf,ze,this.pos),this.pos+=4},writeSFixed32:function(ze){this.realloc(4),Yu(this.buf,ze,this.pos),this.pos+=4},writeFixed64:function(ze){this.realloc(8),Yu(this.buf,-1&ze,this.pos),Yu(this.buf,Math.floor(ze*Op),this.pos+4),this.pos+=8},writeSFixed64:function(ze){this.realloc(8),Yu(this.buf,-1&ze,this.pos),Yu(this.buf,Math.floor(ze*Op),this.pos+4),this.pos+=8},writeVarint:function(ze){(ze=+ze||0)>268435455||ze<0?function(ze,wt){var Rt,Xt;if(ze>=0?(Rt=ze%4294967296|0,Xt=ze/4294967296|0):(Xt=~(-ze/4294967296),4294967295^(Rt=~(-ze%4294967296))?Rt=Rt+1|0:(Rt=0,Xt=Xt+1|0)),ze>=0x10000000000000000||ze<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");wt.realloc(10),function(ze,wt,Rt){Rt.buf[Rt.pos++]=127&ze|128,ze>>>=7,Rt.buf[Rt.pos++]=127&ze|128,ze>>>=7,Rt.buf[Rt.pos++]=127&ze|128,ze>>>=7,Rt.buf[Rt.pos++]=127&ze|128,Rt.buf[Rt.pos]=127&(ze>>>=7)}(Rt,0,wt),function(ze,wt){var Rt=(7&ze)<<4;wt.buf[wt.pos++]|=Rt|((ze>>>=3)?128:0),ze&&(wt.buf[wt.pos++]=127&ze|((ze>>>=7)?128:0),ze&&(wt.buf[wt.pos++]=127&ze|((ze>>>=7)?128:0),ze&&(wt.buf[wt.pos++]=127&ze|((ze>>>=7)?128:0),ze&&(wt.buf[wt.pos++]=127&ze|((ze>>>=7)?128:0),ze&&(wt.buf[wt.pos++]=127&ze)))))}(Xt,wt)}(ze,this):(this.realloc(4),this.buf[this.pos++]=127&ze|(ze>127?128:0),ze<=127||(this.buf[this.pos++]=127&(ze>>>=7)|(ze>127?128:0),ze<=127||(this.buf[this.pos++]=127&(ze>>>=7)|(ze>127?128:0),ze<=127||(this.buf[this.pos++]=ze>>>7&127))))},writeSVarint:function(ze){this.writeVarint(ze<0?2*-ze-1:2*ze)},writeBoolean:function(ze){this.writeVarint(Boolean(ze))},writeString:function(ze){ze=String(ze),this.realloc(4*ze.length),this.pos++;var wt=this.pos;this.pos=function(ze,wt,Rt){for(var Xt,sr,Dr=0;Dr<wt.length;Dr++){if((Xt=wt.charCodeAt(Dr))>55295&&Xt<57344){if(!sr){Xt>56319||Dr+1===wt.length?(ze[Rt++]=239,ze[Rt++]=191,ze[Rt++]=189):sr=Xt;continue}if(Xt<56320){ze[Rt++]=239,ze[Rt++]=191,ze[Rt++]=189,sr=Xt;continue}Xt=sr-55296<<10|Xt-56320|65536,sr=null}else sr&&(ze[Rt++]=239,ze[Rt++]=191,ze[Rt++]=189,sr=null);Xt<128?ze[Rt++]=Xt:(Xt<2048?ze[Rt++]=Xt>>6|192:(Xt<65536?ze[Rt++]=Xt>>12|224:(ze[Rt++]=Xt>>18|240,ze[Rt++]=Xt>>12&63|128),ze[Rt++]=Xt>>6&63|128),ze[Rt++]=63&Xt|128)}return Rt}(this.buf,ze,this.pos);var Rt=this.pos-wt;Rt>=128&&Uu(wt,Rt,this),this.pos=wt-1,this.writeVarint(Rt),this.pos+=Rt},writeFloat:function(ze){this.realloc(4),Bu(this.buf,ze,this.pos,!0,23,4),this.pos+=4},writeDouble:function(ze){this.realloc(8),Bu(this.buf,ze,this.pos,!0,52,8),this.pos+=8},writeBytes:function(ze){var wt=ze.length;this.writeVarint(wt),this.realloc(wt);for(var Rt=0;Rt<wt;Rt++)this.buf[this.pos++]=ze[Rt]},writeRawMessage:function(ze,wt){this.pos++;var Rt=this.pos;ze(wt,this);var Xt=this.pos-Rt;Xt>=128&&Uu(Rt,Xt,this),this.pos=Rt-1,this.writeVarint(Xt),this.pos+=Xt},writeMessage:function(ze,wt,Rt){this.writeTag(ze,Pu.Bytes),this.writeRawMessage(wt,Rt)},writePackedVarint:function(ze,wt){wt.length&&this.writeMessage(ze,$u,wt)},writePackedSVarint:function(ze,wt){wt.length&&this.writeMessage(ze,Ou,wt)},writePackedBoolean:function(ze,wt){wt.length&&this.writeMessage(ze,ju,wt)},writePackedFloat:function(ze,wt){wt.length&&this.writeMessage(ze,qu,wt)},writePackedDouble:function(ze,wt){wt.length&&this.writeMessage(ze,Nu,wt)},writePackedFixed32:function(ze,wt){wt.length&&this.writeMessage(ze,Gu,wt)},writePackedSFixed32:function(ze,wt){wt.length&&this.writeMessage(ze,Zu,wt)},writePackedFixed64:function(ze,wt){wt.length&&this.writeMessage(ze,Xu,wt)},writePackedSFixed64:function(ze,wt){wt.length&&this.writeMessage(ze,Ku,wt)},writeBytesField:function(ze,wt){this.writeTag(ze,Pu.Bytes),this.writeBytes(wt)},writeFixed32Field:function(ze,wt){this.writeTag(ze,Pu.Fixed32),this.writeFixed32(wt)},writeSFixed32Field:function(ze,wt){this.writeTag(ze,Pu.Fixed32),this.writeSFixed32(wt)},writeFixed64Field:function(ze,wt){this.writeTag(ze,Pu.Fixed64),this.writeFixed64(wt)},writeSFixed64Field:function(ze,wt){this.writeTag(ze,Pu.Fixed64),this.writeSFixed64(wt)},writeVarintField:function(ze,wt){this.writeTag(ze,Pu.Varint),this.writeVarint(wt)},writeSVarintField:function(ze,wt){this.writeTag(ze,Pu.Varint),this.writeSVarint(wt)},writeStringField:function(ze,wt){this.writeTag(ze,Pu.Bytes),this.writeString(wt)},writeFloatField:function(ze,wt){this.writeTag(ze,Pu.Fixed32),this.writeFloat(wt)},writeDoubleField:function(ze,wt){this.writeTag(ze,Pu.Fixed64),this.writeDouble(wt)},writeBooleanField:function(ze,wt){this.writeVarintField(ze,Boolean(wt))}};class rc{constructor(ze,{pixelRatio:wt,version:Rt,stretchX:Xt,stretchY:sr,content:Dr}){this.paddedRect=ze,this.pixelRatio=wt,this.stretchX=Xt,this.stretchY=sr,this.content=Dr,this.version=Rt}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class nc{constructor(ze,wt){const Rt={},Xt={};this.haveRenderCallbacks=[];const sr=[];this.addImages(ze,Rt,sr),this.addImages(wt,Xt,sr);const{w:Dr,h:Lr}=ec(sr),Ur=new No({width:Dr||1,height:Lr||1});for(const wt in ze){const Xt=ze[wt],sr=Rt[wt].paddedRect;No.copy(Xt.data,Ur,{x:0,y:0},{x:sr.x+1,y:sr.y+1},Xt.data)}for(const ze in wt){const Rt=wt[ze],sr=Xt[ze].paddedRect,Dr=sr.x+1,Lr=sr.y+1,qr=Rt.data.width,ri=Rt.data.height;No.copy(Rt.data,Ur,{x:0,y:0},{x:Dr,y:Lr},Rt.data),No.copy(Rt.data,Ur,{x:0,y:ri-1},{x:Dr,y:Lr-1},{width:qr,height:1}),No.copy(Rt.data,Ur,{x:0,y:0},{x:Dr,y:Lr+ri},{width:qr,height:1}),No.copy(Rt.data,Ur,{x:qr-1,y:0},{x:Dr-1,y:Lr},{width:1,height:ri}),No.copy(Rt.data,Ur,{x:0,y:0},{x:Dr+qr,y:Lr},{width:1,height:ri})}this.image=Ur,this.iconPositions=Rt,this.patternPositions=Xt}addImages(ze,wt,Rt){for(const Xt in ze){const sr=ze[Xt],Dr={x:0,y:0,w:sr.data.width+2,h:sr.data.height+2};Rt.push(Dr),wt[Xt]=new rc(Dr,sr),sr.hasRenderCallback&&this.haveRenderCallbacks.push(Xt)}}patchUpdatedImages(ze,wt){ze.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const Rt in ze.updatedImages)this.patchUpdatedImage(this.iconPositions[Rt],ze.getImage(Rt),wt),this.patchUpdatedImage(this.patternPositions[Rt],ze.getImage(Rt),wt)}patchUpdatedImage(ze,wt,Rt){if(!ze||!wt)return;if(ze.version===wt.version)return;ze.version=wt.version;const[Xt,sr]=ze.tl;Rt.update(wt.data,void 0,{x:Xt,y:sr})}}oi("ImagePosition",rc),oi("ImageAtlas",nc);const Lp={horizontal:1,vertical:2,horizontalOnly:3};class sc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(ze,wt){const Rt=new sc;return Rt.scale=ze||1,Rt.fontStack=wt,Rt}static forImage(ze){const wt=new sc;return wt.imageName=ze,wt}}class ac{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(ze,wt){const Rt=new ac;for(let Xt=0;Xt<ze.sections.length;Xt++){const sr=ze.sections[Xt];sr.image?Rt.addImageSection(sr):Rt.addTextSection(sr,wt)}return Rt}length(){return this.text.length}getSection(ze){return this.sections[this.sectionIndex[ze]]}getSections(){return this.sections}getSectionIndex(ze){return this.sectionIndex[ze]}getCharCode(ze){return this.text.charCodeAt(ze)}verticalizePunctuation(ze){this.text=function(ze,wt){let Rt="";for(let Xt=0;Xt<ze.length;Xt++){const sr=ze.charCodeAt(Xt+1)||null,Dr=ze.charCodeAt(Xt-1)||null;Rt+=!wt&&(sr&&ji(sr)&&!xp[ze[Xt+1]]||Dr&&ji(Dr)&&!xp[ze[Xt-1]])||!xp[ze[Xt]]?ze[Xt]:xp[ze[Xt]]}return Rt}(this.text,ze)}trim(){let ze=0;for(let wt=0;wt<this.text.length&&jp[this.text.charCodeAt(wt)];wt++)ze++;let wt=this.text.length;for(let Rt=this.text.length-1;Rt>=0&&Rt>=ze&&jp[this.text.charCodeAt(Rt)];Rt--)wt--;this.text=this.text.substring(ze,wt),this.sectionIndex=this.sectionIndex.slice(ze,wt)}substring(ze,wt){const Rt=new ac;return Rt.text=this.text.substring(ze,wt),Rt.sectionIndex=this.sectionIndex.slice(ze,wt),Rt.sections=this.sections,Rt}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((ze,wt)=>Math.max(ze,this.sections[wt].scale),0)}addTextSection(ze,wt){this.text+=ze.text,this.sections.push(sc.forText(ze.scale,ze.fontStack||wt));const Rt=this.sections.length-1;for(let wt=0;wt<ze.text.length;++wt)this.sectionIndex.push(Rt)}addImageSection(ze){const wt=ze.image?ze.image.name:"";if(0===wt.length)return void B("Can't add FormattedSection with an empty image.");const Rt=this.getNextImageSectionCharCode();Rt?(this.text+=String.fromCharCode(Rt),this.sections.push(sc.forImage(wt)),this.sectionIndex.push(this.sections.length-1)):B("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function oc(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn){const Un=ac.fromFeature(ze,sr);let Wn;Yi===Lp.vertical&&Un.verticalizePunctuation(Ji);const{processBidirectionalText:Yn,processStyledBidirectionalText:Jn}=dd;if(Yn&&1===Un.sections.length){Wn=[];const ze=Yn(Un.toString(),yc(Un,ri,Dr,wt,Xt,Qi,kn));for(const wt of ze){const ze=new ac;ze.text=wt,ze.sections=Un.sections;for(let Rt=0;Rt<wt.length;Rt++)ze.sectionIndex.push(0);Wn.push(ze)}}else if(Jn){Wn=[];const ze=Jn(Un.text,Un.sectionIndex,yc(Un,ri,Dr,wt,Xt,Qi,kn));for(const wt of ze){const ze=new ac;ze.text=wt[0],ze.sectionIndex=wt[1],ze.sections=Un.sections,Wn.push(ze)}}else Wn=function(ze,wt){const Rt=[],Xt=ze.text;let sr=0;for(const Xt of wt)Rt.push(ze.substring(sr,Xt)),sr=Xt;return sr<Xt.length&&Rt.push(ze.substring(sr,Xt.length)),Rt}(Un,yc(Un,ri,Dr,wt,Xt,Qi,kn));const Qn=[],Io={positionedLines:Qn,text:Un.toString(),top:ai[1],bottom:ai[1],left:ai[0],right:ai[0],writingMode:Yi,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi){let Ji=0,Qi=0,kn=0;const jn="right"===Ur?1:"left"===Ur?0:.5;let Un=!1;for(const ze of sr){const Rt=ze.getSections();for(const ze of Rt){if(ze.imageName)continue;const Rt=wt[ze.fontStack];if(Rt&&(Un=void 0!==Rt.ascender&&void 0!==Rt.descender,!Un))break}if(!Un)break}let Wn=0;for(const Lr of sr){Lr.trim();const sr=Lr.getMaxScale(),Ur=(sr-1)*cp,Jn={positionedGlyphs:[],lineOffset:0};ze.positionedLines[Wn]=Jn;const Qn=Jn.positionedGlyphs;let Io=0;if(!Lr.length()){Qi+=Dr,++Wn;continue}let Mo=0,jo=0;for(let Dr=0;Dr<Lr.length();Dr++){const Ur=Lr.getSection(Dr),kn=Lr.getSectionIndex(Dr),jn=Lr.getCharCode(Dr);let Wn=Ur.scale,Jn=null,zo=null,oa=null,la=cp,ca=0;const ua=!(qr===Lp.horizontal||!ai&&!Ni(jn)||ai&&(jp[jn]||(Yn=jn,di(Yn)||fi(Yn)||yi(Yn)||Di(Yn)||Ri(Yn))));if(Ur.imageName){const wt=Xt[Ur.imageName];if(!wt)continue;oa=Ur.imageName,ze.iconsInText=ze.iconsInText||!0,zo=wt.paddedRect;const Rt=wt.displaySize;Wn=Wn*cp/Yi,Jn={width:Rt[0],height:Rt[1],left:1,top:-3,advance:ua?Rt[1]:Rt[0],localGlyph:!1},ca=Un?-Jn.height*Wn:sr*cp-17-Rt[1]*Wn,la=Jn.advance;const Dr=(ua?Rt[0]:Rt[1])*Wn-cp*sr;Dr>0&&Dr>Io&&(Io=Dr)}else{const ze=Rt[Ur.fontStack];if(!ze)continue;ze[jn]&&(zo=ze[jn]);const Xt=wt[Ur.fontStack];if(!Xt)continue;const Dr=Xt.glyphs[jn];if(!Dr)continue;if(Jn=Dr.metrics,la=8203!==jn?cp:0,Un){const ze=void 0!==Xt.ascender?Math.abs(Xt.ascender):0,wt=void 0!==Xt.descender?Math.abs(Xt.descender):0,Rt=(ze+wt)*Wn;Mo<Rt&&(Mo=Rt,jo=(ze-wt)/2*Wn),ca=-ze*Wn}else ca=(sr-Wn)*cp-17}ua?(ze.verticalizable=!0,Qn.push({glyph:jn,imageName:oa,x:Ji,y:Qi+ca,vertical:ua,scale:Wn,localGlyph:Jn.localGlyph,fontStack:Ur.fontStack,sectionIndex:kn,metrics:Jn,rect:zo}),Ji+=la*Wn+ri):(Qn.push({glyph:jn,imageName:oa,x:Ji,y:Qi+ca,vertical:ua,scale:Wn,localGlyph:Jn.localGlyph,fontStack:Ur.fontStack,sectionIndex:kn,metrics:Jn,rect:zo}),Ji+=Jn.advance*Wn+ri)}0!==Qn.length&&(kn=Math.max(Ji-ri,kn),Un?gc(Qn,jn,Io,jo,Dr*sr/2):gc(Qn,jn,Io,0,Dr/2)),Ji=0;const zo=Dr*sr+Io;Jn.lineOffset=Math.max(Io,Ur),Qi+=zo,++Wn}var Yn;const Jn=Qi,{horizontalAlign:Qn,verticalAlign:Io}=mc(Lr);(function(ze,wt,Rt,Xt,sr,Dr){const Lr=(wt-Rt)*sr,Ur=-Dr*Xt;for(const wt of ze)for(const ze of wt.positionedGlyphs)ze.x+=Lr,ze.y+=Ur})(ze.positionedLines,jn,Qn,Io,kn,Jn),ze.top+=-Io*Jn,ze.bottom=ze.top+Jn,ze.left+=-Qn*kn,ze.right=ze.left+kn,ze.hasBaseline=Un}(Io,wt,Rt,Xt,Wn,Lr,Ur,qr,Yi,ri,Ji,jn),!function(ze){for(const wt of ze)if(0!==wt.positionedGlyphs.length)return!1;return!0}(Qn)&&Io}const jp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Rp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function cc(ze,wt,Rt,Xt,sr,Dr){if(wt.imageName){const ze=Xt[wt.imageName];return ze?ze.displaySize[0]*wt.scale*cp/Dr+sr:0}{const Xt=Rt[wt.fontStack],Dr=Xt&&Xt.glyphs[ze];return Dr?Dr.metrics.advance*wt.scale+sr:0}}function hc(ze,wt,Rt,Xt){const sr=Math.pow(ze-wt,2);return Xt?ze<wt?sr/2:2*sr:sr+Math.abs(Rt)*Rt}function pc(ze,wt,Rt){let Xt=0;return 10===ze&&(Xt-=1e4),Rt&&(Xt+=150),40!==ze&&65288!==ze||(Xt+=50),41!==wt&&65289!==wt||(Xt+=50),Xt}function dc(ze,wt,Rt,Xt,sr,Dr){let Lr=null,Ur=hc(wt,Rt,sr,Dr);for(const ze of Xt){const Xt=hc(wt-ze.x,Rt,sr,Dr)+ze.badness;Xt<=Ur&&(Lr=ze,Ur=Xt)}return{index:ze,x:wt,priorBreak:Lr,badness:Ur}}function fc(ze){return ze?fc(ze.priorBreak).concat(ze.index):[]}function yc(ze,wt,Rt,Xt,sr,Dr,Lr){if("point"!==Dr)return[];if(!ze)return[];const Ur=[],qr=function(ze,wt,Rt,Xt,sr,Dr){let Lr=0;for(let Rt=0;Rt<ze.length();Rt++){const Ur=ze.getSection(Rt);Lr+=cc(ze.getCharCode(Rt),Ur,Xt,sr,wt,Dr)}return Lr/Math.max(1,Math.ceil(Lr/Rt))}(ze,wt,Rt,Xt,sr,Lr),ri=ze.text.indexOf("â")>=0;let ai=0;for(let Rt=0;Rt<ze.length();Rt++){const Dr=ze.getSection(Rt),Ji=ze.getCharCode(Rt);if(jp[Ji]||(ai+=cc(Ji,Dr,Xt,sr,wt,Lr)),Rt<ze.length()-1){const wt=!((Yi=Ji)<11904||!(ki(Yi)||_i(Yi)||Li(Yi)||Pi(Yi)||zi(Yi)||mi(Yi)||Ai(Yi)||vi(Yi)||Ti(Yi)||Mi(Yi)||Ii(Yi)||Ui(Yi)||bi(Yi)||xi(Yi)||gi(Yi)||Si(Yi)||wi(Yi)||Vi(Yi)||Bi(Yi)||Ei(Yi)));(Rp[Ji]||wt||Dr.imageName)&&Ur.push(dc(Rt+1,ai,qr,Ur,pc(Ji,ze.getCharCode(Rt+1),wt&&ri),!1))}}var Yi;return fc(dc(ze.length(),ai,qr,Ur,0,!0))}function mc(ze){let wt=.5,Rt=.5;switch(ze){case"right":case"top-right":case"bottom-right":wt=1;break;case"left":case"top-left":case"bottom-left":wt=0}switch(ze){case"bottom":case"bottom-right":case"bottom-left":Rt=1;break;case"top":case"top-right":case"top-left":Rt=0}return{horizontalAlign:wt,verticalAlign:Rt}}function gc(ze,wt,Rt,Xt,sr){if(!(wt||Rt||Xt||sr))return;const Dr=ze.length-1,Lr=ze[Dr],Ur=(Lr.x+Lr.metrics.advance*Lr.scale)*wt;for(let wt=0;wt<=Dr;wt++)ze[wt].x-=Ur,ze[wt].y+=Rt+Xt+sr}function xc(ze,wt,Rt){const{horizontalAlign:Xt,verticalAlign:sr}=mc(Rt),Dr=wt[0]-ze.displaySize[0]*Xt,Lr=wt[1]-ze.displaySize[1]*sr;return{image:ze,top:Lr,bottom:Lr+ze.displaySize[1],left:Dr,right:Dr+ze.displaySize[0]}}function vc(ze,wt,Rt,Xt,sr,Dr){const Lr=ze.image;let Ur;if(Lr.content){const ze=Lr.content,wt=Lr.pixelRatio||1;Ur=[ze[0]/wt,ze[1]/wt,Lr.displaySize[0]-ze[2]/wt,Lr.displaySize[1]-ze[3]/wt]}const qr=wt.left*Dr,ri=wt.right*Dr;let ai,Yi,Ji,Qi;"width"===Rt||"both"===Rt?(Qi=sr[0]+qr-Xt[3],Yi=sr[0]+ri+Xt[1]):(Qi=sr[0]+(qr+ri-Lr.displaySize[0])/2,Yi=Qi+Lr.displaySize[0]);const kn=wt.top*Dr,jn=wt.bottom*Dr;return"height"===Rt||"both"===Rt?(ai=sr[1]+kn-Xt[0],Ji=sr[1]+jn+Xt[2]):(ai=sr[1]+(kn+jn-Lr.displaySize[1])/2,Ji=ai+Lr.displaySize[1]),{image:Lr,top:ai,right:Yi,bottom:Ji,left:Qi,collisionPadding:Ur}}class bc extends Xt{constructor(ze,wt,Rt,Xt){super(ze,wt),this.angle=Rt,void 0!==Xt&&(this.segment=Xt)}clone(){return new bc(this.x,this.y,this.angle,this.segment)}}function wc(ze,wt,Rt,Xt,sr){if(void 0===wt.segment)return!0;let Dr=wt,Lr=wt.segment+1,Ur=0;for(;Ur>-Rt/2;){if(Lr--,Lr<0)return!1;Ur-=ze[Lr].dist(Dr),Dr=ze[Lr]}Ur+=ze[Lr].dist(ze[Lr+1]),Lr++;const qr=[];let ri=0;for(;Ur<Rt/2;){const wt=ze[Lr],Rt=ze[Lr+1];if(!Rt)return!1;
20let Dr=ze[Lr-1].angleTo(wt)-wt.angleTo(Rt);for(Dr=Math.abs((Dr+3*Math.PI)%(2*Math.PI)-Math.PI),qr.push({distance:Ur,angleDelta:Dr}),ri+=Dr;Ur-qr[0].distance>Xt;)ri-=qr.shift().angleDelta;if(ri>sr)return!1;Lr++,Ur+=wt.dist(Rt)}return!0}function _c(ze){let wt=0;for(let Rt=0;Rt<ze.length-1;Rt++)wt+=ze[Rt].dist(ze[Rt+1]);return wt}function kc(ze,wt,Rt){return ze?.6*wt*Rt:0}function Ac(ze,wt){return Math.max(ze?ze.right-ze.left:0,wt?wt.right-wt.left:0)}function Sc(ze,wt,Rt,Xt,sr,Dr){const Lr=kc(Rt,sr,Dr),Ur=Ac(Rt,Xt)*Dr;let qr=0;const ri=_c(ze)/2;for(let Rt=0;Rt<ze.length-1;Rt++){const Xt=ze[Rt],sr=ze[Rt+1],Dr=Xt.dist(sr);if(qr+Dr>ri){const ai=(ri-qr)/Dr,Yi=rr(Xt.x,sr.x,ai),Ji=rr(Xt.y,sr.y,ai),Qi=new bc(Yi,Ji,sr.angleTo(Xt),Rt);return!Lr||wc(ze,Qi,Ur,Lr,wt)?Qi:void 0}qr+=Dr}}function Ic(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=kc(Xt,Dr,Lr),ai=Ac(Xt,sr),Yi=ai*Lr,Ji=0===ze[0].x||ze[0].x===qr||0===ze[0].y||ze[0].y===qr;return wt-Yi<wt/4&&(wt=Yi+wt/4),zc(ze,Ji?wt/2*Ur%wt:(ai/2+2*Dr)*Lr*Ur%wt,wt,ri,Rt,Yi,Ji,!1,qr)}function zc(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=Dr/2,ai=_c(ze);let Yi=0,Ji=wt-Rt,Qi=[];for(let wt=0;wt<ze.length-1;wt++){const Lr=ze[wt],Ur=ze[wt+1],kn=Lr.dist(Ur),jn=Ur.angleTo(Lr);for(;Ji+Rt<Yi+kn;){Ji+=Rt;const Un=(Ji-Yi)/kn,Wn=rr(Lr.x,Ur.x,Un),Yn=rr(Lr.y,Ur.y,Un);if(Wn>=0&&Wn<qr&&Yn>=0&&Yn<qr&&Ji-ri>=0&&Ji+ri<=ai){const Rt=new bc(Wn,Yn,jn,wt);Rt._round(),Xt&&!wc(ze,Rt,Dr,Xt,sr)||Qi.push(Rt)}}Yi+=kn}return Ur||Qi.length||Lr||(Qi=zc(ze,Yi/2,Rt,Xt,sr,Dr,Lr,!0,qr)),Qi}function Tc(ze,wt,Rt,sr,Dr){const Lr=[];for(let Ur=0;Ur<ze.length;Ur++){const qr=ze[Ur];let ri;for(let ze=0;ze<qr.length-1;ze++){let Ur=qr[ze],ai=qr[ze+1];Ur.x<wt&&ai.x<wt||(Ur.x<wt?Ur=new Xt(wt,Ur.y+(wt-Ur.x)/(ai.x-Ur.x)*(ai.y-Ur.y))._round():ai.x<wt&&(ai=new Xt(wt,Ur.y+(wt-Ur.x)/(ai.x-Ur.x)*(ai.y-Ur.y))._round()),Ur.y<Rt&&ai.y<Rt||(Ur.y<Rt?Ur=new Xt(Ur.x+(Rt-Ur.y)/(ai.y-Ur.y)*(ai.x-Ur.x),Rt)._round():ai.y<Rt&&(ai=new Xt(Ur.x+(Rt-Ur.y)/(ai.y-Ur.y)*(ai.x-Ur.x),Rt)._round()),Ur.x>=sr&&ai.x>=sr||(Ur.x>=sr?Ur=new Xt(sr,Ur.y+(sr-Ur.x)/(ai.x-Ur.x)*(ai.y-Ur.y))._round():ai.x>=sr&&(ai=new Xt(sr,Ur.y+(sr-Ur.x)/(ai.x-Ur.x)*(ai.y-Ur.y))._round()),Ur.y>=Dr&&ai.y>=Dr||(Ur.y>=Dr?Ur=new Xt(Ur.x+(Dr-Ur.y)/(ai.y-Ur.y)*(ai.x-Ur.x),Dr)._round():ai.y>=Dr&&(ai=new Xt(Ur.x+(Dr-Ur.y)/(ai.y-Ur.y)*(ai.x-Ur.x),Dr)._round()),ri&&Ur.equals(ri[ri.length-1])||(ri=[Ur],Lr.push(ri)),ri.push(ai)))))}}return Lr}oi("Anchor",bc);var Np=Cc,Fp=Cc,Up=1e20;function Cc(ze,wt,Rt,Xt,sr,Dr){this.fontSize=ze||24,this.buffer=void 0===wt?3:wt,this.cutoff=Xt||.25,this.fontFamily=sr||"sans-serif",this.fontWeight=Dr||"normal",this.radius=Rt||8;var Lr=this.size=this.fontSize+2*this.buffer,Ur=Lr+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Lr,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Ur*Ur),this.gridInner=new Float64Array(Ur*Ur),this.f=new Float64Array(Ur),this.z=new Float64Array(Ur+1),this.v=new Uint16Array(Ur),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(Lr/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Pc(ze,wt,Rt,Xt,sr,Dr){for(var Lr=0;Lr<wt;Lr++)Dc(ze,Lr,wt,Rt,Xt,sr,Dr);for(var Ur=0;Ur<Rt;Ur++)Dc(ze,Ur*wt,1,wt,Xt,sr,Dr)}function Dc(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur,qr,ri,ai;for(Dr[0]=0,Lr[0]=-Up,Lr[1]=Up,Ur=0;Ur<Xt;
20Ur++)sr[Ur]=ze[wt+Ur*Rt];for(Ur=1,qr=0,ri=0;Ur<Xt;Ur++){do{ri=(sr[Ur]-sr[ai=Dr[qr]]+Ur*Ur-ai*ai)/(Ur-ai)/2}while(ri<=Lr[qr]&&--qr>-1);Dr[++qr]=Ur,Lr[qr]=ri,Lr[qr+1]=Up}for(Ur=0,qr=0;Ur<Xt;Ur++){for(;Lr[qr+1]<Ur;)qr++;ze[wt+Ur*Rt]=sr[ai=Dr[qr]]+(Ur-ai)*(Ur-ai)}}Cc.prototype._draw=function(ze,wt){var Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi=this.ctx.measureText(ze),Ji=Yi.width,Qi=2*this.buffer;wt&&this.useMetrics?(Lr=Math.floor(Yi.actualBoundingBoxAscent),ri=this.buffer+Math.ceil(Yi.actualBoundingBoxAscent),Ur=this.buffer,qr=this.buffer,Rt=(Xt=Math.min(this.size,Math.ceil(Yi.actualBoundingBoxRight-Yi.actualBoundingBoxLeft)))+Qi,sr=(Dr=Math.min(this.size-Ur,Math.ceil(Yi.actualBoundingBoxAscent+Yi.actualBoundingBoxDescent)))+Qi,this.ctx.textBaseline="alphabetic"):(Rt=Xt=this.size,sr=Dr=this.size,Lr=19*this.fontSize/24,Ur=qr=0,ri=this.middle,this.ctx.textBaseline="middle"),Xt&&Dr&&(this.ctx.clearRect(qr,Ur,Xt,Dr),this.ctx.fillText(ze,this.buffer,ri),ai=this.ctx.getImageData(qr,Ur,Xt,Dr));var kn=new Uint8ClampedArray(Rt*sr);return function(ze,wt,Rt,Xt,sr,Dr,Lr){Dr.fill(Up,0,wt*Rt),Lr.fill(0,0,wt*Rt);for(var Ur=(wt-Xt)/2,qr=0;qr<sr;qr++)for(var ri=0;ri<Xt;ri++){var ai=(qr+Ur)*wt+ri+Ur,Yi=ze.data[4*(qr*Xt+ri)+3]/255;if(1===Yi)Dr[ai]=0,Lr[ai]=Up;else if(0===Yi)Dr[ai]=Up,Lr[ai]=0;else{var Ji=Math.max(0,.5-Yi),Qi=Math.max(0,Yi-.5);Dr[ai]=Ji*Ji,Lr[ai]=Qi*Qi}}}(ai,Rt,sr,Xt,Dr,this.gridOuter,this.gridInner),Pc(this.gridOuter,Rt,sr,this.f,this.v,this.z),Pc(this.gridInner,Rt,sr,this.f,this.v,this.z),function(ze,wt,Rt,Xt,sr,Dr,Lr){for(var Ur=0;Ur<wt*Rt;Ur++){var qr=Math.sqrt(Xt[Ur])-Math.sqrt(sr[Ur]);ze[Ur]=Math.round(255-255*(qr/Dr+Lr))}}(kn,Rt,sr,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:kn,metrics:{width:Xt,height:Dr,sdfWidth:Rt,sdfHeight:sr,top:Lr,left:0,advance:Ji}}},Cc.prototype.draw=function(ze){return this._draw(ze,!1).data},Cc.prototype.drawWithMetrics=function(ze){return this._draw(ze,!0)},Np.default=Fp;const Vp={none:0,ideographs:1,all:2};class Lc{constructor(ze,wt,Rt){this.requestManager=ze,this.localGlyphMode=wt,this.localFontFamily=Rt,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(ze){this.url=ze}getGlyphs(ze,wt){const Rt=[];for(const wt in ze)for(const Xt of ze[wt])Rt.push({stack:wt,id:Xt});g(Rt,({stack:ze,id:wt},Rt)=>{let Xt=this.entries[ze];Xt||(Xt=this.entries[ze]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let sr=Xt.glyphs[wt];if(void 0!==sr)return void Rt(null,{stack:ze,id:wt,glyph:sr});if(sr=this._tinySDF(Xt,ze,wt),sr)return Xt.glyphs[wt]=sr,void Rt(null,{stack:ze,id:wt,glyph:sr});const Dr=Math.floor(wt/256);if(256*Dr>65535)return void Rt(new Error("glyphs > 65535 not supported"));if(Xt.ranges[Dr])return void Rt(null,{stack:ze,id:wt,glyph:sr});let Lr=Xt.requests[Dr];Lr||(Lr=Xt.requests[Dr]=[],Lc.loadGlyphRange(ze,Dr,this.url,this.requestManager,(ze,wt)=>{if(wt){Xt.ascender=wt.ascender,Xt.descender=wt.descender;for(const ze in wt.glyphs)this._doesCharSupportLocalGlyph(+ze)||(Xt.glyphs[+ze]=wt.glyphs[+ze]);Xt.ranges[Dr]=!0}for(const Rt of Lr)Rt(ze,wt);delete Xt.requests[Dr]})),Lr.push((Xt,sr)=>{Xt?Rt(Xt):sr&&Rt(null,{stack:ze,id:wt,glyph:sr.glyphs[wt]||null})})},(ze,Rt)=>{if(ze)wt(ze);else if(Rt){const ze={};for(const{stack:wt,id:Xt,glyph:sr}of Rt)void 0===ze[wt]&&(ze[wt]={}),void 0===ze[wt].glyphs&&(ze[wt].glyphs={}),ze[wt].glyphs[Xt]=sr&&{id:sr.id,bitmap:sr.bitmap.clone(),metrics:sr.metrics},ze[wt].ascender=this.entries[wt].ascender,ze[wt].descender=this.entries[wt].descender;wt(null,ze)}})}_doesCharSupportLocalGlyph(ze){return this.localGlyphMode!==Vp.none&&(this.localGlyphMode===Vp.all?!!this.localFontFamily:!!this.localFontFamily&&(Mi(ze)||Ci(ze)||bi(ze)||wi(ze))||vi(ze))}_tinySDF(ze,wt,Rt){const Xt=this.localFontFamily;if(!Xt)return;if(!this._doesCharSupportLocalGlyph(Rt))return;let sr=ze.tinySDF;if(!sr){let Rt="400";/bold/i.test(wt)?Rt="900":/medium/i.test(wt)?Rt="500":/light/i.test(wt)&&(Rt="200"),sr=ze.tinySDF=new Lc.TinySDF(48,6,16,.25,Xt,Rt)}if(this.localGlyphs[sr.fontWeight][Rt])return this.localGlyphs[sr.fontWeight][Rt];const{data:Dr,metrics:Lr}=sr.drawWithMetrics(String.fromCharCode(Rt)),{sdfWidth:Ur,sdfHeight:qr,width:ri,height:ai,left:Y
vendor: 20,123 bytes, line 20
20i,top:Ji,advance:Qi}=Lr;return this.localGlyphs[sr.fontWeight][Rt]={id:Rt,bitmap:new qo({width:Ur,height:qr},Dr),metrics:{width:ri/2,height:ai/2,left:Yi/2,top:Ji/2-27,advance:Qi/2,localGlyph:!0}}}}function Fc(ze,wt,Rt,sr){const Dr=[],Lr=ze.image,Ur=Lr.pixelRatio,qr=Lr.paddedRect.w-2,ri=Lr.paddedRect.h-2,ai=ze.right-ze.left,Yi=ze.bottom-ze.top,Ji=Lr.stretchX||[[0,qr]],Qi=Lr.stretchY||[[0,ri]],f=(ze,wt)=>ze+wt[1]-wt[0],kn=Ji.reduce(f,0),jn=Qi.reduce(f,0),Un=qr-kn,Wn=ri-jn;let Yn=0,Jn=kn,Qn=0,Io=jn,Mo=0,jo=Un,zo=0,oa=Wn;if(Lr.content&&sr){const ze=Lr.content;Yn=Rc(Ji,0,ze[0]),Qn=Rc(Qi,0,ze[1]),Jn=Rc(Ji,ze[0],ze[2]),Io=Rc(Qi,ze[1],ze[3]),Mo=ze[0]-Yn,zo=ze[1]-Qn,jo=ze[2]-ze[0]-Jn,oa=ze[3]-ze[1]-Io}const z=(sr,Dr,qr,ri)=>{const Ji=$c(sr.stretch-Yn,Jn,ai,ze.left),Qi=Oc(sr.fixed-Mo,jo,sr.stretch,kn),Un=$c(Dr.stretch-Qn,Io,Yi,ze.top),Wn=Oc(Dr.fixed-zo,oa,Dr.stretch,jn),la=$c(qr.stretch-Yn,Jn,ai,ze.left),ca=Oc(qr.fixed-Mo,jo,qr.stretch,kn),ua=$c(ri.stretch-Qn,Io,Yi,ze.top),ha=Oc(ri.fixed-zo,oa,ri.stretch,jn),pa=new Xt(Ji,Un),_a=new Xt(la,Un),wa=new Xt(la,ua),Pa=new Xt(Ji,ua),Oa=new Xt(Qi/Ur,Wn/Ur),Da=new Xt(ca/Ur,ha/Ur),La=wt*Math.PI/180;if(La){const ze=Math.sin(La),wt=Math.cos(La),Rt=[wt,-ze,ze,wt];pa._matMult(Rt),_a._matMult(Rt),Pa._matMult(Rt),wa._matMult(Rt)}const Ra=sr.stretch+sr.fixed,Na=Dr.stretch+Dr.fixed;return{tl:pa,tr:_a,bl:Pa,br:wa,tex:{x:Lr.paddedRect.x+1+Ra,y:Lr.paddedRect.y+1+Na,w:qr.stretch+qr.fixed-Ra,h:ri.stretch+ri.fixed-Na},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Oa,pixelOffsetBR:Da,minFontScaleX:jo/Ur/ai,minFontScaleY:oa/Ur/Yi,isSDF:Rt}};if(sr&&(Lr.stretchX||Lr.stretchY)){const ze=Uc(Ji,Un,kn),wt=Uc(Qi,Wn,jn);for(let Rt=0;Rt<ze.length-1;Rt++){const Xt=ze[Rt],sr=ze[Rt+1];for(let ze=0;ze<wt.length-1;ze++)Dr.push(z(Xt,wt[ze],sr,wt[ze+1]))}}else Dr.push(z({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:qr+1},{fixed:0,stretch:ri+1}));return Dr}function Rc(ze,wt,Rt){let Xt=0;for(const sr of ze)Xt+=Math.max(wt,Math.min(Rt,sr[1]))-Math.max(wt,Math.min(Rt,sr[0]));return Xt}function Uc(ze,wt,Rt){const Xt=[{fixed:-1,stretch:0}];for(const[wt,Rt]of ze){const ze=Xt[Xt.length-1];Xt.push({fixed:wt-ze.stretch,stretch:ze.stretch}),Xt.push({fixed:wt-ze.stretch,stretch:ze.stretch+(Rt-wt)})}return Xt.push({fixed:wt+1,stretch:Rt}),Xt}function $c(ze,wt,Rt,Xt){return ze/wt*Rt+Xt}function Oc(ze,wt,Rt,Xt){return ze-wt*Rt/Xt}function qc(ze,wt,Rt,Xt){const sr=wt+ze.positionedLines[Xt].lineOffset;return 0===Xt?Rt+sr/2:Rt+(sr+(wt+ze.positionedLines[Xt-1].lineOffset))/2}Lc.loadGlyphRange=function(ze,wt,Rt,Xt,sr){const Dr=256*wt,Lr=Dr+255,Ur=Xt.transformRequest(Xt.normalizeGlyphsURL(Rt).replace("{fontstack}",ze).replace("{range}",`${Dr}-${Lr}`),Ua.Glyphs);St(Ur,(ze,wt)=>{if(ze)sr(ze);else if(wt){const ze={},Rt=function(ze){return new Pp(ze).readFields(Wu,{})}(wt);for(const wt of Rt.glyphs)ze[wt.id]=wt;sr(null,{glyphs:ze,ascender:Rt.ascender,descender:Rt.descender})}})},Lc.TinySDF=Np;class Nc{constructor(ze=[],wt=jc){if(this.data=ze,this.length=this.data.length,this.compare=wt,this.length>0)for(let ze=(this.length>>1)-1;ze>=0;ze--)this._down(ze)}push(ze){this.data.push(ze),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const ze=this.data[0],wt=this.data.pop();return this.length--,this.length>0&&(this.data[0]=wt,this._down(0)),ze}peek(){return this.data[0]}_up(ze){const{data:wt,compare:Rt}=this,Xt=wt[ze];for(;ze>0;){const sr=ze-1>>1,Dr=wt[sr];if(Rt(Xt,Dr)>=0)break;wt[ze]=Dr,ze=sr}wt[ze]=Xt}_down(ze){const{data:wt,compare:Rt}=this,Xt=this.length>>1,sr=wt[ze];for(;ze<Xt;){let Xt=1+(ze<<1),Dr=wt[Xt];const Lr=Xt+1;if(Lr<this.length&&Rt(wt[Lr],Dr)<0&&(Xt=Lr,Dr=wt[Lr]),Rt(Dr,sr)>=0)break;wt[ze]=Dr,ze=Xt}wt[ze]=sr}}function jc(ze,wt){return ze<wt?-1:ze>wt?1:0}function Gc(ze,wt=1,Rt=!1){let sr=1/0,Dr=1/0,Lr=-1/0,Ur=-1/0;const qr=ze[0];for(let ze=0;ze<qr.length;ze++){const wt=qr[ze];(!ze||wt.x<sr)&&(sr=wt.x),(!ze||wt.y<Dr)&&(Dr=wt.y),(!ze||wt.x>Lr)&&(Lr=wt.x),(!ze||wt.y>Ur)&&(Ur=wt.y)}const ri=Math.min(Lr-sr,Ur-Dr);let ai=ri/2;const Yi=new Nc([],Zc);if(0===ri)return new Xt(sr,Dr);for(let wt=sr;wt<Lr;wt+=ri)for(let Rt=Dr;Rt<Ur;Rt+=ri)Yi.push(new Xc(wt+ai,Rt+ai,ai,ze));let Ji=function(ze){let wt=0,Rt=0,Xt=0;const sr=ze[0];for(let ze=0,Dr=sr.length,Lr=Dr-1;ze<Dr;Lr=ze++){const Dr=sr[ze],Ur=sr[Lr],qr=Dr.x*Ur.y-Ur.x*Dr.y;Rt+=(Dr.x+Ur.x)*qr,Xt+=(Dr.y+Ur.y)*qr,wt+=3*qr}return new Xc(Rt/wt,Xt/wt,0,ze)}(ze),Qi=Yi.length;for(;Yi.length;){const Xt=Yi.pop();(Xt.d>Ji.d||!Ji.d)&&(Ji=Xt,Rt&&console.log("found best %d after %d probes",Math.round(1e4*Xt.d)/1e4,Qi)),Xt.max-Ji.d<=wt||(ai=Xt.h/2,Yi.push(new Xc(Xt.p.x-ai,Xt.p.y-ai,ai,ze)),Yi.push(new Xc(Xt.p.x+ai,Xt.p.y-ai,ai,ze)),Yi.push(new Xc(Xt.p.x-ai,Xt.p.y+ai,ai,ze)),Yi.push(new Xc(Xt.p.x+ai,Xt.p.y+ai,ai,ze)),Qi+=4)}return Rt&&(console.log(`num probes: ${Qi}`),console.log(`best distance: ${Ji.d}`)),Ji.p}function Zc(ze,wt){return wt.max-ze.max}function Xc(ze,wt,Rt,sr){this.p=new Xt(ze,wt),this.h=Rt,this.d=function(ze,wt){let Rt=!1,Xt=1/0;for(let sr=0;sr<wt.length;sr++){const Dr=wt[sr];for(let wt=0,sr=Dr.length,Lr=sr-1;wt<sr;Lr=wt++){const sr=Dr[wt],Ur=Dr[Lr];sr.y>ze.y!=Ur.y>ze.y&&ze.x<(Ur.x-sr.x)*(ze.y-sr.y)/(Ur.y-sr.y)+sr.x&&(Rt=!Rt),Xt=Math.min(Xt,eo(ze,sr,Ur))}}return(Rt?1:-1)*Math.sqrt(Xt)}(this.p,sr),this.max=this.d+this.h*Math.SQRT2}const $p=Number.POSITIVE_INFINITY,qp=Math.sqrt(2);function Yc(ze,wt){return wt[1]!==$p?function(ze,wt,Rt){let Xt=0,sr=0;switch(wt=Math.abs(wt),Rt=Math.abs(Rt),ze){case"top-right":case"top-left":case"top":sr=Rt-7;break;case"bottom-right":case"bottom-left":case"bottom":sr=7-Rt}switch(ze){case"top-right":case"bottom-right":case"right":Xt=-wt;break;case"top-left":case"bottom-left":case"left":Xt=wt}return[Xt,sr]}(ze,wt[0],wt[1]):function(ze,wt){let Rt=0,Xt=0;wt<0&&(wt=0);const sr=wt/qp;switch(ze){case"top-right":case"top-left":Xt=sr-7;break;case"bottom-right":case"bottom-left":Xt=7-sr;break;case"bottom":Xt=7-wt;break;case"top":Xt=wt-7}switch(ze){case"top-right":case"bottom-right":Rt=-sr;break;case"top-left":case"bottom-left":Rt=sr;break;case"left":Rt=wt;break;case"right":Rt=-wt}return[Rt,Xt]}(ze,wt[0])}function Jc(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){ze.createArrays(),ze.tilePixelRatio=Ed/(512*ze.overscaling),ze.compareText={},ze.iconsNeedLinear=!1;const qr=ze.layers[0].layout,ri=ze.layers[0]._unevaluatedLayout._values,ai={};if("composite"===ze.textSizeData.kind){const{minZoom:wt,maxZoom:Rt}=ze.textSizeData;ai.compositeTextSizes=[ri["text-size"].possiblyEvaluate(new as(wt),Lr),ri["text-size"].possiblyEvaluate(new as(Rt),Lr)]}if("composite"===ze.iconSizeData.kind){const{minZoom:wt,maxZoom:Rt}=ze.iconSizeData;ai.compositeIconSizes=[ri["icon-size"].possiblyEvaluate(new as(wt),Lr),ri["icon-size"].possiblyEvaluate(new as(Rt),Lr)]}ai.layoutTextSize=ri["text-size"].possiblyEvaluate(new as(Ur+1),Lr),ai.layoutIconSize=ri["icon-size"].possiblyEvaluate(new as(Ur+1),Lr),ai.textMaxSize=ri["text-size"].possiblyEvaluate(new as(18),Lr);const Yi="map"===qr.get("text-rotation-alignment")&&"point"!==qr.get("symbol-placement"),Ji=qr.get("text-size");for(const Dr of ze.features){const Ur=qr.get("text-font").evaluate(Dr,{},Lr).join(","),ri=Ji.evaluate(Dr,{},Lr),Qi=ai.layoutTextSize.evaluate(Dr,{},Lr),kn=(ai.layoutIconSize.evaluate(Dr,{},Lr),{horizontal:{},vertical:void 0}),jn=Dr.text;let Un,Wn=[0,0];if(jn){const Xt=jn.toString(),ai=qr.get("text-letter-spacing").evaluate(Dr,{},Lr)*cp,Ji=qr.get("text-line-height").evaluate(Dr,{},Lr)*cp,Un=Oi(Xt)?ai:0,Yn=qr.get("text-anchor").evaluate(Dr,{},Lr),Jn=qr.get("text-variable-anchor");if(!Jn){const ze=qr.get("text-radial-offset").evaluate(Dr,{},Lr);Wn=ze?Yc(Yn,[ze*cp,$p]):qr.get("text-offset").evaluate(Dr,{},Lr).map(ze=>ze*cp)}let Qn=Yi?"center":qr.get("text-justify").evaluate(Dr,{},Lr);const Io=qr.get("symbol-placement"),Mo="point"===Io,jo="point"===Io?qr.get("text-max-width").evaluate(Dr,{},Lr)*cp:0,A=Dr=>{ze.allowVerticalPlacement&&$i(Xt)&&(kn.vertical=oc(jn,wt,Rt,sr,Ur,jo,Ji,Yn,Dr,Un,Wn,Lp.vertical,!0,Io,Qi,ri))};if(!Yi&&Jn){const ze="auto"===Qn?Jn.map(ze=>Wc(ze)):[Qn];let Xt=!1;for(let Dr=0;Dr<ze.length;Dr++){const Lr=ze[Dr];if(!kn.horizontal[Lr])if(Xt)kn.horizontal[Lr]=kn.horizontal[0];else{const ze=oc(jn,wt,Rt,sr,Ur,jo,Ji,"center",Lr,Un,Wn,Lp.horizontal,!1,Io,Qi,ri);ze&&(kn.horizontal[Lr]=ze,Xt=1===ze.positionedLines.length)}}A("left")}else{if("auto"===Qn&&(Qn=Wc(Yn)),Mo||qr.get("text-writing-mode").indexOf("horizontal")>=0||!$i(Xt)){const ze=oc(jn,wt,Rt,sr,Ur,jo,Ji,Yn,Qn,Un,Wn,Lp.horizontal,!1,Io,Qi,ri);ze&&(kn.horizontal[Qn]=ze)}A("point"===Io?"left":Qn)}}let Yn=!1;if(Dr.icon&&Dr.icon.name){const wt=Xt[Dr.icon.name];wt&&(Un=xc(sr[Dr.icon.name],qr.get("icon-offset").evaluate(Dr,{},Lr),qr.get("icon-anchor").evaluate(Dr,{},Lr)),Yn=wt.sdf,void 0===ze.sdfIcons?ze.sdfIcons=wt.sdf:ze.sdfIcons!==wt.sdf&&B("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(wt.pixelRatio!==ze.pixelRatio||0!==qr.get("icon-rotate").constantOr(1))&&(ze.iconsNeedLinear=!0))}const Jn=rh(kn.horizontal)||kn.vertical;ze.iconsInText||(ze.iconsInText=!!Jn&&Jn.iconsInText),(Jn||Un)&&Qc(ze,Dr,kn,Un,Xt,ai,Qi,0,Wn,Yn,Lr)}Dr&&ze.generateCollisionDebugBuffers(Ur,ze.collisionBoxArray)}function Wc(ze){switch(ze){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Qc(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai){let Yi=Dr.textMaxSize.evaluate(wt,{},ai);void 0===Yi&&(Yi=Lr);const Ji=ze.layers[0].layout,Qi=Ji.get("icon-offset").evaluate(wt,{},ai),kn=rh(Rt.horizontal)||Rt.vertical,jn=Lr/24,Un=ze.tilePixelRatio*Yi/24,Wn=ze.tilePixelRatio*Ji.get("symbol-spacing"),Yn=Ji.get("text-padding")*ze.tilePixelRatio,Jn=Ji.get("icon-padding")*ze.tilePixelRatio,Qn=c(Ji.get("text-max-angle")),Io="map"===Ji.get("text-rotation-alignment")&&"point"!==Ji.get("symbol-placement"),Mo="map"===Ji.get("icon-rotation-alignment")&&"point"!==Ji.get("symbol-placement"),jo=Ji.get("symbol-placement"),zo=Wn/2,oa=Ji.get("icon-text-fit");let la;Xt&&"none"!==oa&&(ze.allowVerticalPlacement&&Rt.vertical&&(la=vc(Xt,Rt.vertical,oa,Ji.get("icon-text-fit-padding"),Qi,jn)),kn&&(Xt=vc(Xt,kn,oa,Ji.get("icon-text-fit-padding"),Qi,jn)));const T=(Ur,Yi)=>{Yi.x<0||Yi.x>=Ed||Yi.y<0||Yi.y>=Ed||function(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Mo,jo){const zo=ze.addToLineVertexArray(wt,Rt);let oa,la,ca,ua,ha,pa,_a,wa=0,Pa=0,Oa=0,Da=0,La=-1,Ra=-1;const Na={};let Ba=yd(""),Ua=0,qa=0;if(void 0===Ur._unevaluatedLayout.getValue("text-radial-offset")?[Ua,qa]=Ur.layout.get("text-offset").evaluate(Jn,{},Mo).map(ze=>ze*cp):(Ua=Ur.layout.get("text-radial-offset").evaluate(Jn,{},Mo)*cp,qa=$p),ze.allowVerticalPlacement&&Xt.vertical){const ze=Xt.vertical;if(Qi)pa=ih(ze),Lr&&(_a=ih(Lr));else{const Rt=Ur.layout.get("text-rotate").evaluate(Jn,{},Mo)+90;ca=nh(qr,wt,ri,ai,Yi,ze,Ji,Rt,kn),Lr&&(ua=nh(qr,wt,ri,ai,Yi,Lr,Un,Rt))}}if(sr){const Rt=Ur.layout.get("icon-rotate").evaluate(Jn,{},Mo),Xt="none"!==Ur.layout.get("icon-text-fit"),Dr=Fc(sr,Rt,Io,Xt),Ji=Lr?Fc(Lr,Rt,Io,Xt):void 0;la=nh(qr,wt,ri,ai,Yi,sr,Un,Rt),wa=4*Dr.length;const Qi=ze.iconSizeData;let kn=null;"source"===Qi.kind?(kn=[fp*Ur.layout.get("icon-size").evaluate(Jn,{},Mo)],kn[0]>Gp&&B(`${ze.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===Qi.kind&&(kn=[fp*Qn.compositeIconSizes[0].evaluate(Jn,{},Mo),fp*Qn.compositeIconSizes[1].evaluate(Jn,{},Mo)],(kn[0]>Gp||kn[1]>Gp)&&B(`${ze.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,Dr,kn,Yn,Wn,Jn,!1,wt,zo.lineStartIndex,zo.lineLength,-1,Mo),La=ze.icon.placedSymbolArray.length-1,Ji&&(Pa=4*Ji.length,ze.addSymbols(ze.icon,Ji,kn,Yn,Wn,Jn,Lp.vertical,wt,zo.lineStartIndex,zo.lineLength,-1,Mo),Ra=ze.icon.placedSymbolArray.length-1)}for(const Rt in Xt.horizontal){const sr=Xt.horizontal[Rt];oa||(Ba=yd(sr.text),Qi?ha=ih(sr):oa=nh(qr,wt,ri,ai,Yi,sr,Ji,Ur.layout.get("text-rotate").evaluate(Jn,{},Mo),kn));const Lr=1===sr.positionedLines.length;if(Oa+=eh(ze,wt,sr,Dr,Ur,Qi,Jn,kn,zo,Xt.vertical?Lp.horizontal:Lp.horizontalOnly,Lr?Object.keys(Xt.horizontal):[Rt],Na,La,Qn,Mo),Lr)break}Xt.vertical&&(Da+=eh(ze,wt,Xt.vertical,Dr,Ur,Qi,Jn,kn,zo,Lp.vertical,["vertical"],Na,Ra,Qn,Mo));let rs=-1;const j=(ze,wt)=>ze?Math.max(ze,wt):wt;rs=j(ha,rs),rs=j(pa,rs),rs=j(_a,rs);const ss=rs>-1?1:0;ss&&(rs*=jo/cp),ze.glyphOffsetArray.length>=dh.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Jn.sortKey&&ze.addToSortKeyRanges(ze.symbolInstances.length,Jn.sortKey),ze.symbolInstances.emplaceBack(wt.x,wt.y,Na.right>=0?Na.right:-1,Na.center>=0?Na.center:-1,Na.left>=0?Na.left:-1,Na.vertical>=0?Na.vertical:-1,La,Ra,Ba,void 0!==oa?oa:ze.collisionBoxArray.length,void 0!==oa?oa+1:ze.collisionBoxArray.length,void 0!==ca?ca:ze.collisionBoxArray.length,void 0!==ca?ca+1:ze.collisionBoxArray.length,void 0!==la?la:ze.collisionBoxArray.length,void 0!==la?la+1:ze.collisionBoxArray.length,ua||ze.collisionBoxArray.length,ua?ua+1:ze.collisionBoxArray.length,ri,Oa,Da,wa,Pa,ss,0,Ua,qa,rs)}(ze,Yi,Ur,Rt,Xt,sr,la,ze.layers[0],ze.collisionBoxArray,wt.index,wt.sourceLayerIndex,ze.index,Yn,Io,qr,0,Jn,Mo,Qi,wt,Dr,ri,ai,Lr)};if("line"===jo)for(const sr of Tc(wt.geometry,0,0,Ed,Ed)){const wt=Ic(sr,Wn,Qn,Rt.vertical||kn,Xt,24,Un,ze.overscaling,Ed);for(const Rt of wt)kn&&sh(ze,kn.text,zo,Rt)||T(sr,Rt)}else if("line-center"===jo){for(const ze of wt.geometry)if(ze.length>1){const wt=Sc(ze,Qn,Rt.vertical||kn,Xt,24,Un);wt&&T(ze,wt)}}else if("Polygon"===wt.type)for(const ze of zl(wt.geometry,0)){const wt=Gc(ze,16);T(ze[0],new bc(wt.x,wt.y,0))}else if("LineString"===wt.type)for(const ze of wt.geometry)T(ze,new bc(ze[0].x,ze[0].y,0));else if("Point"===wt.type)for(const ze of wt.geometry)for(const wt of ze)T([wt],new bc(wt.x,wt.y,0))}const Gp=32640;function eh(ze,wt,Rt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn){const Un=function(ze,wt,Rt,sr,Dr,Lr,Ur,qr){const ri=[];if(0===wt.positionedLines.length)return ri;const ai=sr.layout.get("text-rotate").evaluate(Lr,{})*Math.PI/180,Yi=function(ze){const wt=ze[0],Rt=ze[1],Xt=wt*Rt;return Xt>0?[wt,-Rt]:Xt<0?[-wt,Rt]:0===wt?[Rt,wt]:[Rt,-wt]}(Rt);let Ji=Math.abs(wt.top-wt.bottom);for(const ze of wt.positionedLines)Ji-=ze.lineOffset;const Qi=wt.positionedLines.length,kn=Ji/Qi;let jn=wt.top-Rt[1];for(let ze=0;ze<Qi;++ze){const sr=wt.positionedLines[ze];jn=qc(wt,kn,jn,ze);for(const ze of sr.positionedGlyphs){if(!ze.rect)continue;const sr=ze.rect||{};let Lr=4,Ji=!0,Qi=1,kn=0;const Un=(Dr||qr)&&ze.vertical,Wn=ze.metrics.advance*ze.scale/2,Yn=ze.metrics,Jn=ze.rect;if(null===Jn)continue;if(qr&&wt.verticalizable&&(kn=ze.imageName?Wn-ze.metrics.width*ze.scale/2:0),ze.imageName){const wt=Ur[ze.imageName];if(!wt)continue;Ji=wt.sdf,Qi=wt.pixelRatio,Lr=1/Qi}const Qn=Dr?[ze.x+Wn,ze.y]:[0,0];let Io=[0,0],Mo=[0,0],jo=!1;Dr||(Un?(Mo=[ze.x+Wn+Yi[0],ze.y+Yi[1]-kn],jo=!0):Io=[ze.x+Wn+Rt[0],ze.y+Rt[1]-kn]);const zo=Jn.w*ze.scale/(Qi*(ze.localGlyph?2:1)),oa=Jn.h*ze.scale/(Qi*(ze.localGlyph?2:1));let la,ca,ua,ha;if(Un){const wt=ze.y-jn,Rt=new Xt(-Wn,Wn-wt),sr=-Math.PI/2,Dr=new Xt(...Mo);la=new Xt(-Wn+Io[0],Io[1]),la._rotateAround(sr,Rt)._add(Dr),la.x+=-wt+Wn,la.y-=(Yn.left-Lr)*ze.scale;const Ur=ze.imageName?Yn.advance*ze.scale:cp*ze.scale,qr=String.fromCharCode(ze.glyph);Tu(qr)?la.x+=(1-Lr)*ze.scale:Mu(qr)?la.x+=Ur-Yn.height*ze.scale+(-Lr-1)*ze.scale:la.x+=ze.imageName||Yn.width+2*Lr===Jn.w&&Yn.height+2*Lr===Jn.h?(Ur-oa)/2:(Ur-(Yn.height+2*Lr)*ze.scale)/2,ca=new Xt(la.x,la.y-zo),ua=new Xt(la.x+oa,la.y),ha=new Xt(la.x+oa,la.y-zo)}else{const wt=(Yn.left-Lr)*ze.scale-Wn+Io[0],Rt=(-Yn.top-Lr)*ze.scale+Io[1],sr=wt+zo,Dr=Rt+oa;la=new Xt(wt,Rt),ca=new Xt(sr,Rt),ua=new Xt(wt,Dr),ha=new Xt(sr,Dr)}if(ai){let ze;ze=Dr?new Xt(0,0):jo?new Xt(Yi[0],Yi[1]):new Xt(Rt[0],Rt[1]),la._rotateAround(ai,ze),ca._rotateAround(ai,ze),ua._rotateAround(ai,ze),ha._rotateAround(ai,ze)}const pa=new Xt(0,0),_a=new Xt(0,0);ri.push({tl:la,tr:ca,bl:ua,br:ha,tex:sr,writingMode:wt.writingMode,glyphOffset:Qn,sectionIndex:ze.sectionIndex,isSDF:Ji,pixelOffsetTL:pa,pixelOffsetBR:_a,minFontScaleX:0,minFontScaleY:0})}}return ri}(0,Rt,qr,Dr,Lr,Ur,sr,ze.allowVerticalPlacement),Wn=ze.textSizeData;let Yn=null;"source"===Wn.kind?(Yn=[fp*Dr.layout.get("text-size").evaluate(Ur,{},jn)],Yn[0]>Gp&&B(`${ze.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===Wn.kind&&(Yn=[fp*kn.compositeTextSizes[0].evaluate(Ur,{},jn),fp*kn.compositeTextSizes[1].evaluate(Ur,{},jn)],(Yn[0]>Gp||Yn[1]>Gp)&&B(`${ze.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),ze.addSymbols(ze.text,Un,Yn,qr,Lr,Ur,ai,wt,ri.lineStartIndex,ri.lineLength,Qi,jn);for(const wt of Yi)Ji[wt]=ze.text.placedSymbolArray.length-1;return 4*Un.length}function rh(ze){for(const wt in ze)return ze[wt];return null}function nh(ze,wt,Rt,sr,Dr,Lr,Ur,qr,ri){let ai=Lr.top,Yi=Lr.bottom,Ji=Lr.left,Qi=Lr.right;const kn=Lr.collisionPadding;if(kn&&(Ji-=kn[0],ai-=kn[1],Qi+=kn[2],Yi+=kn[3]),qr){const ze=new Xt(Ji,ai),wt=new Xt(Qi,ai),Rt=new Xt(Ji,Yi),sr=new Xt(Qi,Yi),Dr=c(qr);let Lr=new Xt(0,0);ri&&(Lr=new Xt(ri[0],ri[1])),ze._rotateAround(Dr,Lr),wt._rotateAround(Dr,Lr),Rt._rotateAround(Dr,Lr),sr._rotateAround(Dr,Lr),Ji=Math.min(ze.x,wt.x,Rt.x,sr.x),Qi=Math.max(ze.x,wt.x,Rt.x,sr.x),ai=Math.min(ze.y,wt.y,Rt.y,sr.y),Yi=Math.max(ze.y,wt.y,Rt.y,sr.y)}return ze.emplaceBack(wt.x,wt.y,Ji,ai,Qi,Yi,Ur,Rt,sr,Dr),ze.length-1}function ih(ze){ze.collisionPadding&&(ze.top-=ze.collisionPadding[1],ze.bottom+=ze.collisionPadding[3]);const wt=ze.bottom-ze.top;return wt>0?Math.max(10,wt):null}function sh(ze,wt,Rt,Xt){const sr=ze.compareText;if(wt in sr){const ze=sr[wt];for(let wt=ze.length-1;wt>=0;wt--)if(Xt.dist(ze[wt])<Rt)return!0}else sr[wt]=[];return sr[wt].push(Xt),!1}const Hp=Qd.VectorTileFeature.types,Zp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function lh(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji){const Qi=Ur?Math.min(Gp,Math.round(Ur[0])):0,kn=Ur?Math.min(Gp,Math.round(Ur[1])):0;ze.emplaceBack(wt,Rt,Math.round(32*Xt),Math.round(32*sr),Dr,Lr,(Qi<<1)+(qr?1:0),kn,16*ri,16*ai,256*Yi,256*Ji)}function uh(ze,wt,Rt){ze.emplaceBack(wt.x,wt.y,Rt),ze.emplaceBack(wt.x,wt.y,Rt),ze.emplaceBack(wt.x,wt.y,Rt),ze.emplaceBack(wt.x,wt.y,Rt)}function ch(ze){for(const wt of ze.sections)if(Xi(wt.text))return!0;return!1}class hh{constructor(ze){this.layoutVertexArray=new Ps,this.indexArray=new $s,this.programConfigurations=ze,this.segments=new $a,this.dynamicLayoutVertexArray=new Ds,this.opacityVertexArray=new Vs,this.placedSymbolArray=new Ws}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(ze,wt,Rt,Xt){this.isEmpty()||(Rt&&(this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,Ah.members),this.indexBuffer=ze.createIndexBuffer(this.indexArray,wt),this.dynamicLayoutVertexBuffer=ze.createVertexBuffer(this.dynamicLayoutVertexArray,Ih.members,!0),this.opacityVertexBuffer=ze.createVertexBuffer(this.opacityVertexArray,Zp,!0),this.opacityVertexBuffer.itemSize=1),(Rt||Xt)&&this.programConfigurations.upload(ze))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}oi("SymbolBuffers",hh);class ph{constructor(ze,wt,Rt){this.layoutVertexArray=new ze,this.layoutAttributes=wt,this.indexArray=new Rt,this.segments=new $a,this.collisionVertexArray=new Us,this.collisionVertexArrayExt=new Ds}upload(ze){this.layoutVertexBuffer=ze.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=ze.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=ze.createVertexBuffer(this.collisionVertexArray,zh.members,!0),this.collisionVertexBufferExt=ze.createVertexBuffer(this.collisionVertexArrayExt,Nh.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
vendor: 6,094 bytes, line 20
20stroy())}}oi("CollisionBuffers",ph);class dh{constructor(ze){this.collisionBoxArray=ze.collisionBoxArray,this.zoom=ze.zoom,this.overscaling=ze.overscaling,this.layers=ze.layers,this.layerIds=this.layers.map(ze=>ze.id),this.index=ze.index,this.pixelRatio=ze.pixelRatio,this.sourceLayerIndex=ze.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yo([]),this.placementViewportMatrix=yo([]);const wt=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_u(this.zoom,wt["text-size"]),this.iconSizeData=_u(this.zoom,wt["icon-size"]);const Rt=this.layers[0].layout,Xt=Rt.get("symbol-sort-key"),sr=Rt.get("symbol-z-order");this.canOverlap=Rt.get("text-allow-overlap")||Rt.get("icon-allow-overlap")||Rt.get("text-ignore-placement")||Rt.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==sr&&void 0!==Xt.constantOr(1),this.sortFeaturesByY=("viewport-y"===sr||"auto"===sr&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=Rt.get("text-writing-mode").map(ze=>Lp[ze]),this.stateDependentLayerIds=this.layers.filter(ze=>ze.isStateDependent()).map(ze=>ze.id),this.sourceID=ze.sourceID}createArrays(){this.text=new hh(new Ea(this.layers,this.zoom,ze=>/^text/.test(ze))),this.icon=new hh(new Ea(this.layers,this.zoom,ze=>/^icon/.test(ze))),this.glyphOffsetArray=new ea,this.lineVertexArray=new ra,this.symbolInstances=new ta}calculateGlyphDependencies(ze,wt,Rt,Xt,sr){for(let Rt=0;Rt<ze.length;Rt++)if(wt[ze.charCodeAt(Rt)]=!0,Xt&&sr){const Xt=xp[ze.charAt(Rt)];Xt&&(wt[Xt.charCodeAt(0)]=!0)}}populate(ze,wt,Rt){const Xt=this.layers[0],sr=Xt.layout,Dr=sr.get("text-font"),Lr=sr.get("text-field"),Ur=sr.get("icon-image"),qr=("constant"!==Lr.value.kind||Lr.value.value instanceof de&&!Lr.value.value.isEmpty()||Lr.value.value.toString().length>0)&&("constant"!==Dr.value.kind||Dr.value.value.length>0),ri="constant"!==Ur.value.kind||!!Ur.value.value||Object.keys(Ur.parameters).length>0,ai=sr.get("symbol-sort-key");if(this.features=[],!qr&&!ri)return;const Yi=wt.iconDependencies,Ji=wt.glyphDependencies,Qi=wt.availableImages,kn=new as(this.zoom);for(const{feature:wt,id:Lr,index:Ur,sourceLayerIndex:jn}of ze){const ze=Xt._featureFilter.needGeometry,Un=Ga(wt,ze);if(!Xt._featureFilter.filter(kn,Un,Rt))continue;let Wn,Yn;if(ze||(Un.geometry=ja(wt)),qr){const ze=Xt.getValueAndResolveTokens("text-field",Un,Rt,Qi),wt=de.factory(ze);ch(wt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ns()||this.hasRTLText&&dd.isParsed())&&(Wn=Iu(wt,Xt,Un))}if(ri){const ze=Xt.getValueAndResolveTokens("icon-image",Un,Rt,Qi);Yn=ze instanceof fe?ze:fe.fromString(ze)}if(!Wn&&!Yn)continue;const Jn=this.sortFeaturesByKey?ai.evaluate(Un,{},Rt):void 0;if(this.features.push({id:Lr,text:Wn,icon:Yn,index:Ur,sourceLayerIndex:jn,geometry:Un.geometry,properties:wt.properties,type:Hp[wt.type],sortKey:Jn}),Yn&&(Yi[Yn.name]=!0),Wn){const ze=Dr.evaluate(Un,{},Rt).join(","),wt="map"===sr.get("text-rotation-alignment")&&"point"!==sr.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Lp.vertical)>=0;for(const Rt of Wn.sections)if(Rt.image)Yi[Rt.image.name]=!0;else{const Xt=$i(Wn.toString()),sr=Rt.fontStack||ze,Dr=Ji[sr]=Ji[sr]||{};this.calculateGlyphDependencies(Rt.text,Dr,wt,this.allowVerticalPlacement,Xt)}}}"line"===sr.get("symbol-placement")&&(this.features=function(ze){const wt={},Rt={},Xt=[];let sr=0;function s(wt){Xt.push(ze[wt]),sr++}function a(ze,wt,sr){const Dr=Rt[ze];return delete Rt[ze],Rt[wt]=Dr,Xt[Dr].geometry[0].pop(),Xt[Dr].geometry[0]=Xt[Dr].geometry[0].concat(sr[0]),Dr}function o(ze,Rt,sr){const Dr=wt[Rt];return delete wt[Rt],wt[ze]=Dr,Xt[Dr].geometry[0].shift(),Xt[Dr].geometry[0]=sr[0].concat(Xt[Dr].geometry[0]),Dr}function l(ze,wt,Rt){const Xt=Rt?wt[0][wt[0].length-1]:wt[0][0];return`${ze}:${Xt.x}:${Xt.y}`}for(let Dr=0;Dr<ze.length;Dr++){const Lr=ze[Dr],Ur=Lr.geometry,qr=Lr.text?Lr.text.toString():null;if(!qr){s(Dr);continue}const ri=l(qr,Ur),ai=l(qr,Ur,!0);if(ri in Rt&&ai in wt&&Rt[ri]!==wt[ai]){const ze=o(ri,ai,Ur),sr=a(ri,ai,Xt[ze].geometry);delete wt[ri],delete Rt[ai],Rt[l(qr,Xt[sr].geometry,!0)]=sr,Xt[ze].geometry=null}else ri in Rt?a(ri,ai,Ur):ai in wt?o(ri,ai,Ur):(s(Dr),wt[ri]=sr-1,Rt[ai]=sr-1)}return Xt.filter(ze=>ze.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ze,wt)=>ze.sortKey-wt.sortKey)}update(ze,wt,Rt){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(ze,wt,this.layers,Rt),this.icon.programConfigurations.updatePaintArrays(ze,wt,this.layers,Rt))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(ze){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(ze),this.iconCollisionBox.upload(ze)),this.text.upload(ze,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(ze,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(ze,wt){const Rt=this.lineVertexArray.length;if(void 0!==ze.segment){let Rt=ze.dist(wt[ze.segment+1]),Xt=ze.dist(wt[ze.segment]);const sr={};for(let Xt=ze.segment+1;Xt<wt.length;Xt++)sr[Xt]={x:wt[Xt].x,y:wt[Xt].y,tileUnitDistanceFromAnchor:Rt},Xt<wt.length-1&&(Rt+=wt[Xt+1].dist(wt[Xt]));for(let Rt=ze.segment||0;Rt>=0;Rt--)sr[Rt]={x:wt[Rt].x,y:wt[Rt].y,tileUnitDistanceFromAnchor:Xt},Rt>0&&(Xt+=wt[Rt-1].dist(wt[Rt]));for(let ze=0;ze<wt.length;ze++){const wt=sr[ze];this.lineVertexArray.emplaceBack(wt.x,wt.y,wt.tileUnitDistanceFromAnchor)}}return{lineStartIndex:Rt,lineLength:this.lineVertexArray.length-Rt}}addSymbols(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi){const Ji=ze.indexArray,Qi=ze.layoutVertexArray,kn=ze.segments.prepareSegment(4*wt.length,Qi,Ji,this.canOverlap?Dr.
vendor: 26,010 bytes, line 20
20sortKey:void 0),jn=this.glyphOffsetArray.length,Un=kn.vertexLength,Wn=this.allowVerticalPlacement&&Lr===Lp.vertical?Math.PI/2:0,Yn=Dr.text&&Dr.text.sections;for(let Xt=0;Xt<wt.length;Xt++){const{tl:sr,tr:Lr,bl:qr,br:ri,tex:ai,pixelOffsetTL:jn,pixelOffsetBR:Un,minFontScaleX:Jn,minFontScaleY:Qn,glyphOffset:Io,isSDF:Mo,sectionIndex:jo}=wt[Xt],zo=kn.vertexLength,oa=Io[1];lh(Qi,Ur.x,Ur.y,sr.x,oa+sr.y,ai.x,ai.y,Rt,Mo,jn.x,jn.y,Jn,Qn),lh(Qi,Ur.x,Ur.y,Lr.x,oa+Lr.y,ai.x+ai.w,ai.y,Rt,Mo,Un.x,jn.y,Jn,Qn),lh(Qi,Ur.x,Ur.y,qr.x,oa+qr.y,ai.x,ai.y+ai.h,Rt,Mo,jn.x,Un.y,Jn,Qn),lh(Qi,Ur.x,Ur.y,ri.x,oa+ri.y,ai.x+ai.w,ai.y+ai.h,Rt,Mo,Un.x,Un.y,Jn,Qn),uh(ze.dynamicLayoutVertexArray,Ur,Wn),Ji.emplaceBack(zo,zo+1,zo+2),Ji.emplaceBack(zo+1,zo+2,zo+3),kn.vertexLength+=4,kn.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Io[0]),Xt!==wt.length-1&&jo===wt[Xt+1].sectionIndex||ze.programConfigurations.populatePaintArrays(Qi.length,Dr,Dr.index,{},Yi,Yn&&Yn[jo])}ze.placedSymbolArray.emplaceBack(Ur.x,Ur.y,jn,this.glyphOffsetArray.length-jn,Un,qr,ri,Ur.segment,Rt?Rt[0]:0,Rt?Rt[1]:0,Xt[0],Xt[1],Lr,0,!1,0,ai,0)}_commitLayoutVertex(ze,wt,Rt,Xt,sr){ze.emplaceBack(wt.x,wt.y,Rt,Xt,Math.round(sr.x),Math.round(sr.y))}_addCollisionDebugVertices(ze,wt,Rt,sr,Dr){const Lr=Rt.segments.prepareSegment(4,Rt.layoutVertexArray,Rt.indexArray),Ur=Lr.vertexLength,qr=Dr.anchorX,ri=Dr.anchorY;for(let ze=0;ze<4;ze++)Rt.collisionVertexArray.emplaceBack(0,0,0,0);Rt.collisionVertexArrayExt.emplaceBack(wt,-ze.padding,-ze.padding),Rt.collisionVertexArrayExt.emplaceBack(wt,ze.padding,-ze.padding),Rt.collisionVertexArrayExt.emplaceBack(wt,ze.padding,ze.padding),Rt.collisionVertexArrayExt.emplaceBack(wt,-ze.padding,ze.padding),this._commitLayoutVertex(Rt.layoutVertexArray,sr,qr,ri,new Xt(ze.x1,ze.y1)),this._commitLayoutVertex(Rt.layoutVertexArray,sr,qr,ri,new Xt(ze.x2,ze.y1)),this._commitLayoutVertex(Rt.layoutVertexArray,sr,qr,ri,new Xt(ze.x2,ze.y2)),this._commitLayoutVertex(Rt.layoutVertexArray,sr,qr,ri,new Xt(ze.x1,ze.y2)),Lr.vertexLength+=4;const ai=Rt.indexArray;ai.emplaceBack(Ur,Ur+1),ai.emplaceBack(Ur+1,Ur+2),ai.emplaceBack(Ur+2,Ur+3),ai.emplaceBack(Ur+3,Ur),Lr.primitiveLength+=4}_addTextDebugCollisionBoxes(ze,wt,Rt,Xt,sr,Dr){for(let Lr=Xt;Lr<sr;Lr++){const Xt=Rt.get(Lr),sr=this.getSymbolInstanceTextSize(ze,Dr,wt,Lr);this._addCollisionDebugVertices(Xt,sr,this.textCollisionBox,Xt.anchorPoint,Dr)}}_addIconDebugCollisionBoxes(ze,wt,Rt,Xt,sr,Dr){for(let Lr=Xt;Lr<sr;Lr++){const Xt=Rt.get(Lr),sr=this.getSymbolInstanceIconSize(ze,wt,Lr);this._addCollisionDebugVertices(Xt,sr,this.iconCollisionBox,Xt.anchorPoint,Dr)}}generateCollisionDebugBuffers(ze,wt){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ph(Fs,Bh.members,Zs),this.iconCollisionBox=new ph(Fs,Bh.members,Zs);const Rt=Au(this.iconSizeData,ze),Xt=Au(this.textSizeData,ze);for(let sr=0;sr<this.symbolInstances.length;sr++){const Dr=this.symbolInstances.get(sr);this._addTextDebugCollisionBoxes(Xt,ze,wt,Dr.textBoxStartIndex,Dr.textBoxEndIndex,Dr),this._addTextDebugCollisionBoxes(Xt,ze,wt,Dr.verticalTextBoxStartIndex,Dr.verticalTextBoxEndIndex,Dr),this._addIconDebugCollisionBoxes(Rt,ze,wt,Dr.iconBoxStartIndex,Dr.iconBoxEndIndex,Dr),this._addIconDebugCollisionBoxes(Rt,ze,wt,Dr.verticalIconBoxStartIndex,Dr.verticalIconBoxEndIndex,Dr)}}getSymbolInstanceTextSize(ze,wt,Rt,Xt){const sr=this.text.placedSymbolArray.get(wt.rightJustifiedTextSymbolIndex>=0?wt.rightJustifiedTextSymbolIndex:wt.centerJustifiedTextSymbolIndex>=0?wt.centerJustifiedTextSymbolIndex:wt.leftJustifiedTextSymbolIndex>=0?wt.leftJustifiedTextSymbolIndex:wt.verticalPlacedTextSymbolIndex>=0?wt.verticalPlacedTextSymbolIndex:Xt),Dr=ku(this.textSizeData,ze,sr)/cp;return this.tilePixelRatio*Dr}getSymbolInstanceIconSize(ze,wt,Rt){const Xt=this.icon.placedSymbolArray.get(Rt),sr=ku(this.iconSizeData,ze,Xt);return this.tilePixelRatio*sr}_commitDebugCollisionVertexUpdate(ze,wt,Rt){ze.emplaceBack(wt,-Rt,-Rt),ze.emplaceBack(wt,Rt,-Rt),ze.emplaceBack(wt,Rt,Rt),ze.emplaceBack(wt,-Rt,Rt)}_updateTextDebugCollisionBoxes(ze,wt,Rt,Xt,sr,Dr){for(let Lr=Xt;Lr<sr;Lr++){const Xt=Rt.get(Lr),sr=this.getSymbolInstanceTextSize(ze,Dr,wt,Lr);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,sr,Xt.padding)}}_updateIconDebugCollisionBoxes(ze,wt,Rt,Xt,sr){for(let Dr=Xt;Dr<sr;Dr++){const Xt=Rt.get(Dr),sr=this.getSymbolInstanceIconSize(ze,wt,Dr);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,sr,Xt.padding)}}updateCollisionDebugBuffers(ze,wt){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const Rt=Au(this.iconSizeData,ze),Xt=Au(this.textSizeData,ze);for(let sr=0;sr<this.symbolInstances.length;sr++){const Dr=this.symbolInstances.get(sr);this._updateTextDebugCollisionBoxes(Xt,ze,wt,Dr.textBoxStartIndex,Dr.textBoxEndIndex,Dr),this._updateTextDebugCollisionBoxes(Xt,ze,wt,Dr.verticalTextBoxStartIndex,Dr.verticalTextBoxEndIndex,Dr),this._updateIconDebugCollisionBoxes(Rt,ze,wt,Dr.iconBoxStartIndex,Dr.iconBoxEndIndex),this._updateIconDebugCollisionBoxes(Rt,ze,wt,Dr.verticalIconBoxStartIndex,Dr.verticalIconBoxEndIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri={};for(let Xt=wt;Xt<Rt;Xt++){const wt=ze.get(Xt);ri.textBox={x1:wt.x1,y1:wt.y1,x2:wt.x2,y2:wt.y2,padding:wt.padding,anchorPointX:wt.anchorPointX,anchorPointY:wt.anchorPointY},ri.textFeatureIndex=wt.featureIndex;break}for(let wt=Xt;wt<sr;wt++){const Rt=ze.get(wt);ri.verticalTextBox={x1:Rt.x1,y1:Rt.y1,x2:Rt.x2,y2:Rt.y2,padding:Rt.padding,anchorPointX:Rt.anchorPointX,anchorPointY:Rt.anchorPointY},ri.verticalTextFeatureIndex=Rt.featureIndex;break}for(let wt=Dr;wt<Lr;wt++){const Rt=ze.get(wt);ri.iconBox={x1:Rt.x1,y1:Rt.y1,x2:Rt.x2,y2:Rt.y2,padding:Rt.padding,anchorPointX:Rt.anchorPointX,anchorPointY:Rt.anchorPointY},ri.iconFeatureIndex=Rt.featureIndex;break}for(let wt=Ur;wt<qr;wt++){const Rt=ze.get(wt);ri.verticalIconBox={x1:Rt.x1,y1:Rt.y1,x2:Rt.x2,y2:Rt.y2,padding:Rt.padding,anchorPointX:Rt.anchorPointX,anchorPointY:Rt.anchorPointY},ri.verticalIconFeatureIndex=Rt.featureIndex;break}return ri}deserializeCollisionBoxes(ze){this.collisionArrays=[];for(let wt=0;wt<this.symbolInstances.length;wt++){const Rt=this.symbolInstances.get(wt);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(ze,Rt.textBoxStartIndex,Rt.textBoxEndIndex,Rt.verticalTextBoxStartIndex,Rt.verticalTextBoxEndIndex,Rt.iconBoxStartIndex,Rt.iconBoxEndIndex,Rt.verticalIconBoxStartIndex,Rt.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(ze,wt){const Rt=ze.placedSymbolArray.get(wt),Xt=Rt.vertexStartIndex+4*Rt.numGlyphs;for(let wt=Rt.vertexStartIndex;wt<Xt;wt+=4)ze.indexArray.emplaceBack(wt,wt+1,wt+2),ze.indexArray.emplaceBack(wt+1,wt+2,wt+3)}getSortedSymbolIndexes(ze){if(this.sortedAngle===ze&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const wt=Math.sin(ze),Rt=Math.cos(ze),Xt=[],sr=[],Dr=[];for(let ze=0;ze<this.symbolInstances.length;++ze){Dr.push(ze);const Lr=this.symbolInstances.get(ze);Xt.push(0|Math.round(wt*Lr.anchorX+Rt*Lr.anchorY)),sr.push(Lr.featureIndex)}return Dr.sort((ze,wt)=>Xt[ze]-Xt[wt]||sr[wt]-sr[ze]),Dr}addToSortKeyRanges(ze,wt){const Rt=this.sortKeyRanges[this.sortKeyRanges.length-1];Rt&&Rt.sortKey===wt?Rt.symbolInstanceEnd=ze+1:this.sortKeyRanges.push({sortKey:wt,symbolInstanceStart:ze,symbolInstanceEnd:ze+1})}sortFeatures(ze){if(this.sortFeaturesByY&&this.sortedAngle!==ze&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(ze),this.sortedAngle=ze,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const ze of this.symbolInstanceIndexes){const wt=this.symbolInstances.get(ze);this.featureSortOrder.push(wt.featureIndex),[wt.rightJustifiedTextSymbolIndex,wt.centerJustifiedTextSymbolIndex,wt.leftJustifiedTextSymbolIndex].forEach((ze,wt,Rt)=>{ze>=0&&Rt.indexOf(ze)===wt&&this.addIndicesForPlacedSymbol(this.text,ze)}),wt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,wt.verticalPlacedTextSymbolIndex),wt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,wt.placedIconSymbolIndex),wt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,wt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}oi("SymbolBucket",dh,{omit:["layers","collisionBoxArray","features","compareText"]}),dh.MAX_GLYPHS=65535,dh.addDynamicAttributes=uh;const Wp=new bs({"symbol-placement":new ys(Pl.layout_symbol["symbol-placement"]),"symbol-spacing":new ys(Pl.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ys(Pl.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ms(Pl.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ys(Pl.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ys(Pl.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ys(Pl.layout_symbol["icon-ignore-placement"]),"icon-optional":new ys(Pl.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ys(Pl.layout_symbol["icon-rotation-alignment"]),"icon-size":new ms(Pl.layout_symbol["icon-size"]),"icon-text-fit":new ys(Pl.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ys(Pl.layout_symbol["icon-text-fit-padding"]),"icon-image":new ms(Pl.layout_symbol["icon-image"]),"icon-rotate":new ms(Pl.layout_symbol["icon-rotate"]),"icon-padding":new ys(Pl.layout_symbol["icon-padding"]),"icon-keep-upright":new ys(Pl.layout_symbol["icon-keep-upright"]),"icon-offset":new ms(Pl.layout_symbol["icon-offset"]),"icon-anchor":new ms(Pl.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ys(Pl.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ys(Pl.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ys(Pl.layout_symbol["text-rotation-alignment"]),"text-field":new ms(Pl.layout_symbol["text-field"]),"text-font":new ms(Pl.layout_symbol["text-font"]),"text-size":new ms(Pl.layout_symbol["text-size"]),"text-max-width":new ms(Pl.layout_symbol["text-max-width"]),"text-line-height":new ms(Pl.layout_symbol["text-line-height"]),"text-letter-spacing":new ms(Pl.layout_symbol["text-letter-spacing"]),"text-justify":new ms(Pl.layout_symbol["text-justify"]),"text-radial-offset":new ms(Pl.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ys(Pl.layout_symbol["text-variable-anchor"]),"text-anchor":new ms(Pl.layout_symbol["text-anchor"]),"text-max-angle":new ys(Pl.layout_symbol["text-max-angle"]),"text-writing-mode":new ys(Pl.layout_symbol["text-writing-mode"]),"text-rotate":new ms(Pl.layout_symbol["text-rotate"]),"text-padding":new ys(Pl.layout_symbol["text-padding"]),"text-keep-upright":new ys(Pl.layout_symbol["text-keep-upright"]),"text-transform":new ms(Pl.layout_symbol["text-transform"]),"text-offset":new ms(Pl.layout_symbol["text-offset"]),"text-allow-overlap":new ys(Pl.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ys(Pl.layout_symbol["text-ignore-placement"]),"text-optional":new ys(Pl.layout_symbol["text-optional"])});var Xp={paint:new bs({"icon-opacity":new ms(Pl.paint_symbol["icon-opacity"]),"icon-color":new ms(Pl.paint_symbol["icon-color"]),"icon-halo-color":new ms(Pl.paint_symbol["icon-halo-color"]),"icon-halo-width":new ms(Pl.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ms(Pl.paint_symbol["icon-halo-blur"]),"icon-translate":new ys(Pl.paint_symbol["icon-translate"]),"icon-translate-anchor":new ys(Pl.paint_symbol["icon-translate-anchor"]),"text-opacity":new ms(Pl.paint_symbol["text-opacity"]),"text-color":new ms(Pl.paint_symbol["text-color"],{runtimeType:Fl,getOverride:ze=>ze.textColor,hasOverride:ze=>!!ze.textColor}),"text-halo-color":new ms(Pl.paint_symbol["text-halo-color"]),"text-halo-width":new ms(Pl.paint_symbol["text-halo-width"]),"text-halo-blur":new ms(Pl.paint_symbol["text-halo-blur"]),"text-translate":new ys(Pl.paint_symbol["text-translate"]),"text-translate-anchor":new ys(Pl.paint_symbol["text-translate-anchor"])}),layout:Wp};class mh{constructor(ze){this.type=ze.property.overrides?ze.property.overrides.runtimeType:Cl,this.defaultValue=ze}evaluate(ze){if(ze.formattedSection){const wt=this.defaultValue.property.overrides;if(wt&&wt.hasOverride(ze.formattedSection))return wt.getOverride(ze.formattedSection)}return ze.feature&&ze.featureState?this.defaultValue.evaluate(ze.feature,ze.featureState):this.defaultValue.property.specification.default}eachChild(ze){this.defaultValue.isConstant()||ze(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}oi("FormatSectionOverride",mh,{omit:["defaultValue"]});class gh extends Fa{constructor(ze){super(ze,Xp)}recalculate(ze,wt){super.recalculate(ze,wt),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const Rt=this.layout.get("text-writing-mode");if(Rt){const ze=[];for(const wt of Rt)ze.indexOf(wt)<0&&ze.push(wt);this.layout._values["text-writing-mode"]=ze}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(ze,wt,Rt,Xt){const sr=this.layout.get(ze).evaluate(wt,{},Rt,Xt),Dr=this._unevaluatedLayout._values[ze];return Dr.isDataDriven()||un(Dr.value)||!sr?sr:function(ze,wt){return wt.replace(/{([^{}]+)}/g,(wt,Rt)=>Rt in ze?String(ze[Rt]):"")}(wt.properties,sr)}createBucket(ze){return new dh(ze)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const ze of Xp.paint.overridableProperties){if(!gh.hasPaintOverride(this.layout,ze))continue;const wt=this.paint.get(ze),Rt=new mh(wt),Xt=new ln(Rt,wt.property.specification);let sr=null;sr="constant"===wt.value.kind||"source"===wt.value.kind?new hn("source",Xt):new pn("composite",Xt,wt.value.zoomStops,wt.value._interpolationType),this.paint._values[ze]=new ds(wt.property,sr,wt.parameters)}}_handleOverridablePaintPropertyUpdate(ze,wt,Rt){return!(!this.layout||wt.isDataDriven()||Rt.isDataDriven())&&gh.hasPaintOverride(this.layout,ze)}static hasPaintOverride(ze,wt){const Rt=ze.get("text-field"),Xt=Xp.paint.properties[wt];let sr=!1;const s=ze=>{for(const wt of ze)if(Xt.overrides&&Xt.overrides.hasOverride(wt))return void(sr=!0)};if("constant"===Rt.value.kind&&Rt.value.value instanceof de)s(Rt.value.value.sections);else if("source"===Rt.value.kind){const t=ze=>{sr||(ze instanceof ve&&ge(ze.value)===Wl?s(ze.value.sections):ze instanceof ke?s(ze.sections):ze.eachChild(t))},ze=Rt.value;ze._styleExpression&&t(ze._styleExpression.expression)}return sr}getProgramConfiguration(ze){return new Ma(this,ze)}}var Kp={paint:new bs({"background-color":new ys(Pl.paint_background["background-color"]),"background-pattern":new xs(Pl.paint_background["background-pattern"]),"background-opacity":new ys(Pl.paint_background["background-opacity"])})},Yp={paint:new bs({"raster-opacity":new ys(Pl.paint_raster["raster-opacity"]),"raster-hue-rotate":new ys(Pl.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ys(Pl.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ys(Pl.paint_raster["raster-brightness-max"]),"raster-saturation":new ys(Pl.paint_raster["raster-saturation"]),"raster-contrast":new ys(Pl.paint_raster["raster-contrast"]),"raster-resampling":new ys(Pl.paint_raster["raster-resampling"]),"raster-fade-duration":new ys(Pl.paint_raster["raster-fade-duration"])})};class bh extends Fa{constructor(ze){super(ze,{}),this.implementation=ze}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){}serialize(){}onAdd(ze){this.implementation.onAdd&&this.implementation.onAdd(ze,ze.painter.context.gl)}onRemove(ze){this.implementation.onRemove&&this.implementation.onRemove(ze,ze.painter.context.gl)}}var Jp={paint:new bs({"sky-type":new ys(Pl.paint_sky["sky-type"]),"sky-atmosphere-sun":new ys(Pl.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ys(Pl.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ys(Pl.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ys(Pl.paint_sky["sky-gradient-radius"]),"sky-gradient":new vs(Pl.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ys(Pl.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ys(Pl.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ys(Pl.paint_sky["sky-opacity"])})};function _h(ze,wt,Rt){const Xt=bo(0,0,1),sr=Co(Bo());return function(ze,wt,Rt){Rt*=.5;var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=Math.sin(Rt),qr=Math.cos(Rt);ze[0]=Xt*qr-Dr*Ur,ze[1]=sr*qr+Lr*Ur,ze[2]=Dr*qr+Xt*Ur,ze[3]=Lr*qr-sr*Ur}(sr,sr,Rt?-c(ze)+Math.PI:c(ze)),Po(sr,sr,-c(wt)),So(Xt,Xt,sr),Ao(Xt,Xt)}const Qp={circle:class extends Fa{constructor(ze){super(ze,Od)}createBucket(ze){return new Xa(ze)}queryRadius(ze){const wt=ze;return ao("circle-radius",this,wt)+ao("circle-stroke-width",this,wt)+oo(this.paint.get("circle-translate"))}queryIntersectsFeature(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr="map"===this.paint.get("circle-pitch-alignment");if(qr&&ze.queryGeometry.isAboveHorizon)return!1;const ri=uo(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Dr.angle,ze.pixelToTileUnitsFactor),ai=this.paint.get("circle-radius").evaluate(wt,Rt)+this.paint.get("circle-stroke-width").evaluate(wt,Rt),Yi=qr?ai*ze.pixelToTileUnitsFactor:ai;for(const wt of Xt)for(const Rt of wt){const wt=Rt.add(ri),Xt=Ur&&Dr.elevation?Dr.elevation.exaggeration()*Ur.getElevationAt(wt.x,wt.y,!0):0,sr=qr?wt:Do(wt,Xt,Lr),ai=qr?ze.tilespaceRays.map(ze=>Fo(ze,Xt)):ze.queryGeometry.screenGeometry;let Ji=Yi;const Qi=Eo([],[Rt.x,Rt.y,Xt,1],Lr);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?Ji*=Qi[3]/Dr.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(Ji*=Dr.cameraToCenterDistance/Qi[3]),Ha(ai,sr,Ji))return!0}return!1}getProgramIds(){return["circle"]}getProgramConfiguration(ze){return new Ma(this,ze)}},heatmap:class extends Fa{createBucket(ze){return new Ro(ze)}constructor(ze){super(ze,Fd),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(ze){"heatmap-color"===ze&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Go({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(ze){return new Ma(this,ze)}},hillshade:class extends Fa{constructor(ze){super(ze,Ud)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getProgramConfiguration(ze){return new Ma(this,ze)}},fill:class extends Fa{constructor(ze){super(ze,Zd)}getProgramIds(){const ze=this.paint.get("fill-pattern"),wt=ze&&ze.constantOr(1),Rt=[wt?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&Rt.push(wt&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),Rt}getProgramConfiguration(ze){return new Ma(this,ze)}recalculate(ze,wt){super.recalculate(ze,wt);const Rt=this.paint._values["fill-outline-color"];"constant"===Rt.value.kind&&void 0===Rt.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(ze){return new Bl(ze)}queryRadius(){return oo(this.paint.get("fill-translate"))}queryIntersectsFeature(ze,wt,Rt,Xt,sr,Dr){return!ze.queryGeometry.isAboveHorizon&&Ya(lo(ze.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Dr.angle,ze.pixelToTileUnitsFactor),Xt)}isTileClipped(){return!0}},"fill-extrusion":class extends Fa{constructor(ze){super(ze,ah)}createBucket(ze){return new Yl(ze)}queryRadius(){return oo(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(ze){return new Ma(this,ze)}queryIntersectsFeature(ze,wt,Rt,sr,Dr,Lr,Ur,qr,ri){const ai=uo(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Lr.angle,ze.pixelToTileUnitsFactor),Yi=this.paint.get("fill-extrusion-height").evaluate(wt,Rt),Ji=this.paint.get("fill-extrusion-base").evaluate(wt,Rt),Qi=[0,0],kn=qr&&Lr.elevation,jn=Lr.elevation?Lr.elevation.exaggeration():1;if(kn){const wt=ze.tile.getBucket(this).centroidVertexArray,Rt=ri+1;if(Rt<wt.length){const ze=wt.get(Rt);Qi[0]=ze.a_centroid_pos0,Qi[1]=ze.a_centroid_pos1}}if(0===Qi[0]&&1===Qi[1])return!1;const Un=function(ze,wt,Rt,sr,Dr,Lr,Ur,qr,ri){return Lr?function(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=[],ai=[],Yi=[0,0,0,1];for(const Ji of ze){const ze=[],Qi=[];for(const ri of Ji){const ai=ri.x+Xt.x,Ji=ri.y+Xt.y,kn=ru(ai,Ji,wt,Rt,Dr,Lr,Ur,qr);Yi[0]=ai,Yi[1]=Ji,Yi[2]=kn.base,Yi[3]=1,Eo(Yi,Yi,sr),Yi[3]=Math.max(Yi[3],1e-5);const jn=eu([Yi[0]/Yi[3],Yi[1]/Yi[3],Yi[2]/Yi[3]]);Yi[0]=ai,Yi[1]=Ji,Yi[2]=kn.top,Yi[3]=1,Eo(Yi,Yi,sr),Yi[3]=Math.max(Yi[3],1e-5);const Un=eu([Yi[0]/Yi[3],Yi[1]/Yi[3],Yi[2]/Yi[3]]);ze.push(jn),Qi.push(Un)}ri.push(ze),ai.push(Qi)}return[ri,ai]}(ze,wt,Rt,sr,Dr,Lr,Ur,qr,ri):function(ze,wt,Rt,sr,Dr){const Lr=[],Ur=[],qr=Dr[8]*wt,ri=Dr[9]*wt,ai=Dr[10]*wt,Yi=Dr[11]*wt,Ji=Dr[8]*Rt,Qi=Dr[9]*Rt,kn=Dr[10]*Rt,jn=Dr[11]*Rt;for(const wt of ze){const ze=[],Rt=[];for(const Lr of wt){const wt=Lr.x+sr.x,Ur=Lr.y+sr.y,Un=Dr[0]*wt+Dr[4]*Ur+Dr[12],Wn=Dr[1]*wt+Dr[5]*Ur+Dr[13],Yn=Dr[2]*wt+Dr[6]*Ur+Dr[14],Jn=Dr[3]*wt+Dr[7]*Ur+Dr[15],Qn=Un+qr,Io=Wn+ri,Mo=Yn+ai,jo=Math.max(Jn+Yi,1e-5),zo=Un+Ji,oa=Wn+Qi,la=Yn+kn,ca=Math.max(Jn+jn,1e-5),ua=new Xt(Qn/jo,Io/jo);ua.z=Mo/jo,ze.push(ua);const ha=new Xt(zo/ca,oa/ca);ha.z=la/ca,Rt.push(ha)}Lr.push(ze),Ur.push(Rt)}return[Lr,Ur]}(ze,wt,Rt,sr,Dr)}(sr,Ji,Yi,ai,Ur,kn?qr:null,Qi,jn,Lr.center.lat),Wn=ze.queryGeometry;return function(ze,wt,Rt){let Xt=1/0;Ya(Rt,wt)&&(Xt=tu(Rt,wt[0]));for(let sr=0;sr<wt.length;sr++){const Dr=wt[sr],Lr=ze[sr];for(let ze=0;ze<Dr.length-1;ze++){const wt=Dr[ze],sr=[wt,Dr[ze+1],Lr[ze+1],Lr[ze],wt];Ka(Rt,sr)&&(Xt=Math.min(Xt,tu(Rt,sr)))}}return Xt!==1/0&&Xt}(Un[0],Un[1],Wn.isPointQuery()?Wn.screenBounds:Wn.screenGeometry)}},line:class extends Fa{constructor(ze){super(ze,Ph),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(ze){if("line-gradient"===ze){const ze=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=ze._styleExpression&&ze._styleExpression.expression instanceof er,this.gradientVersion=(this.gradientVersion+1)%Dr}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(ze,wt){super.recalculate(ze,wt),this.paint._values["line-floorwidth"]=kh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ze)}createBucket(ze){return new uu(ze)}getProgramIds(){const ze=this.paint.get("line-dasharray"),wt=this.paint.get("line-pattern").constantOr(1),Rt=this.paint.get("line-gradient");return[wt?"linePattern":ze?"lineSDF":Rt?"lineGradient":"line"]}getProgramConfiguration(ze){return new Ma(this,ze)}queryRadius(ze){const wt=ze,Rt=du(ao("line-width",this,wt),ao("line-gap-width",this,wt)),Xt=ao("line-offset",this,wt);return Rt/2+Math.abs(Xt)+oo(this.paint.get("line-translate"))}queryIntersectsFeature(ze,wt,Rt,sr,Dr,Lr){if(ze.queryGeometry.isAboveHorizon)return!1;const Ur=lo(ze.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Lr.angle,ze.pixelToTileUnitsFactor),qr=ze.pixelToTileUnitsFactor/2*du(this.paint.get("line-width").evaluate(wt,Rt),this.paint.get("line-gap-width").evaluate(wt,Rt)),ri=this.paint.get("line-offset").evaluate(wt,Rt);return ri&&(sr=function(ze,wt){const Rt=[],sr=new Xt(0,0);for(let Xt=0;Xt<ze.length;Xt++){const Dr=ze[Xt],Lr=[];for(let ze=0;ze<Dr.length;ze++){const Rt=Dr[ze-1],Xt=Dr[ze],Ur=Dr[ze+1],qr=0===ze?sr:Xt.sub(Rt)._unit()._perp(),ri=ze===Dr.length-1?sr:Ur.sub(Xt)._unit()._perp(),ai=qr._add(ri)._unit();ai._mult(1/(ai.x*ri.x+ai.y*ri.y)),Lr.push(ai._mult(wt)._add(Xt))}Rt.push(Lr)}return Rt}(sr,ri*ze.pixelToTileUnitsFactor)),function(ze,wt,Rt){for(let Xt=0;Xt<wt.length;Xt++){const sr=wt[Xt];
20if(ze.length>=3)for(let wt=0;wt<sr.length;wt++)if(no(ze,sr[wt]))return!0;if(Ja(ze,sr,Rt))return!0}return!1}(Ur,sr,qr)}isTileClipped(){return!0}},symbol:gh,background:class extends Fa{constructor(ze){super(ze,Kp)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends Fa{constructor(ze){super(ze,Yp)}getProgramIds(){return["raster"]}},sky:class extends Fa{constructor(ze){super(ze,Jp),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(ze){"sky-gradient"===ze?this._updateColorRamp():"sky-atmosphere-sun"!==ze&&"sky-atmosphere-halo-color"!==ze&&"sky-atmosphere-color"!==ze&&"sky-atmosphere-sun-intensity"!==ze||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Go({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(ze){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const wt=ze.style.light.properties.get("position");return this._lightPosition.azimuthal!==wt.azimuthal||this._lightPosition.polar!==wt.polar}}getCenter(ze,wt){const Rt=this.paint.get("sky-type");if("atmosphere"===Rt){const Rt=this.paint.get("sky-atmosphere-sun"),Xt=!Rt,sr=ze.style.light,Dr=sr.properties.get("position");return Xt&&"viewport"===sr.properties.get("anchor")&&B("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),Xt?_h(Dr.azimuthal,90-Dr.polar,wt):_h(Rt[0],90-Rt[1],wt)}if("gradient"===Rt){const ze=this.paint.get("sky-gradient-center");return _h(ze[0],90-ze[1],wt)}}is3D(){return!1}isSky(){return!0}markSkyboxValid(ze){this._skyboxInvalidated=!1,this._lightPosition=ze.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const ze=this.paint.get("sky-type");return"atmosphere"===ze?["skyboxCapture","skybox"]:"gradient"===ze?["skyboxGradient"]:null}}},{HTMLImageElement:ef,HTMLCanvasElement:tf,HTMLVideoElement:rf,ImageData:nf,ImageBitmap:of}=sr;class Mh{constructor(ze,wt,Rt,Xt){this.context=ze,this.format=Rt,this.texture=ze.gl.createTexture(),this.update(wt,Xt)}update(ze,wt,Rt){const{width:Xt,height:sr}=ze,Dr=!(this.size&&this.size[0]===Xt&&this.size[1]===sr||Rt),{context:Lr}=this,{gl:Ur}=Lr;if(this.useMipmap=Boolean(wt&&wt.useMipmap),Ur.bindTexture(Ur.TEXTURE_2D,this.texture),Lr.pixelStoreUnpackFlipY.set(!1),Lr.pixelStoreUnpack.set(1),Lr.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ur.RGBA&&(!wt||!1!==wt.premultiply)),Dr)this.size=[Xt,sr],ze instanceof ef||ze instanceof tf||ze instanceof rf||ze instanceof nf||of&&ze instanceof of?Ur.texImage2D(Ur.TEXTURE_2D,0,this.format,this.format,Ur.UNSIGNED_BYTE,ze):Ur.texImage2D(Ur.TEXTURE_2D,0,this.format,Xt,sr,0,this.format,Ur.UNSIGNED_BYTE,ze.data);else{const{x:wt,y:Dr}=Rt||{x:0,y:0};ze instanceof ef||ze instanceof tf||ze instanceof rf||ze instanceof nf||of&&ze instanceof of?Ur.texSubImage2D(Ur.TEXTURE_2D,0,wt,Dr,Ur.RGBA,Ur.UNSIGNED_BYTE,ze):Ur.texSubImage2D(Ur.TEXTURE_2D,0,wt,Dr,Xt,sr,Ur.RGBA,Ur.UNSIGNED_BYTE,ze.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ur.generateMipmap(Ur.TEXTURE_2D)}bind(ze,wt,Rt){const{context:Xt}=this,{gl:sr}=Xt;sr.bindTexture(sr.TEXTURE_2D,this.texture),Rt!==sr.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Rt=sr.LINEAR),ze!==this.filter&&(sr.texParameteri(sr.TEXTURE_2D,sr.TEXTURE_MAG_FILTER,ze),sr.texParameteri(sr.TEXTURE_2D,sr.TEXTURE_MIN_FILTER,Rt||ze),this.filter=ze),wt!==this.wrap&&(sr.texParameteri(sr.TEXTURE_2D,sr.TEXTURE_WRAP_S,wt),sr.texParameteri(sr.TEXTURE_2D,sr.TEXTURE_WRAP_T,wt),this.wrap=wt)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:ze}=this.context;ze.deleteTexture(this.texture),this.texture=null}}class Eh{constructor(ze,wt){ze&&(wt?this.setSouthWest(ze).setNorthEast(wt):4===ze.length?this.setSouthWest([ze[0],ze[1]]).setNorthEast([ze[2],ze[3]]):this.setSouthWest(ze[0]).setNorthEast(ze[1]))}setNorthEast(ze){return this._ne=ze instanceof Ch?new Ch(ze.lng,ze.lat):Ch.convert(ze),this}
vendor: 23,758 bytes, line 20
20setSouthWest(ze){return this._sw=ze instanceof Ch?new Ch(ze.lng,ze.lat):Ch.convert(ze),this}extend(ze){const wt=this._sw,Rt=this._ne;let Xt,sr;if(ze instanceof Ch)Xt=ze,sr=ze;else{if(!(ze instanceof Eh))return Array.isArray(ze)?4===ze.length||ze.every(Array.isArray)?this.extend(Eh.convert(ze)):this.extend(Ch.convert(ze)):this;if(Xt=ze._sw,sr=ze._ne,!Xt||!sr)return this}return wt||Rt?(wt.lng=Math.min(Xt.lng,wt.lng),wt.lat=Math.min(Xt.lat,wt.lat),Rt.lng=Math.max(sr.lng,Rt.lng),Rt.lat=Math.max(sr.lat,Rt.lat)):(this._sw=new Ch(Xt.lng,Xt.lat),this._ne=new Ch(sr.lng,sr.lat)),this}getCenter(){return new Ch((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 Ch(this.getWest(),this.getNorth())}getSouthEast(){return new Ch(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(ze){const{lng:wt,lat:Rt}=Ch.convert(ze);let Xt=this._sw.lng<=wt&&wt<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Xt=this._sw.lng>=wt&&wt>=this._ne.lng),this._sw.lat<=Rt&&Rt<=this._ne.lat&&Xt}static convert(ze){return!ze||ze instanceof Eh?ze:new Eh(ze)}}const af=6371008.8;class Ch{constructor(ze,wt){if(isNaN(ze)||isNaN(wt))throw new Error(`Invalid LngLat object: (${ze}, ${wt})`);if(this.lng=+ze,this.lat=+wt,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ch(m(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(ze){const wt=Math.PI/180,Rt=this.lat*wt,Xt=ze.lat*wt,sr=Math.sin(Rt)*Math.sin(Xt)+Math.cos(Rt)*Math.cos(Xt)*Math.cos((ze.lng-this.lng)*wt);return af*Math.acos(Math.min(sr,1))}toBounds(ze=0){const wt=360*ze/40075017,Rt=wt/Math.cos(Math.PI/180*this.lat);return new Eh(new Ch(this.lng-Rt,this.lat-wt),new Ch(this.lng+Rt,this.lat+wt))}static convert(ze){if(ze instanceof Ch)return ze;if(Array.isArray(ze)&&(2===ze.length||3===ze.length))return new Ch(Number(ze[0]),Number(ze[1]));if(!Array.isArray(ze)&&"object"==typeof ze&&null!==ze)return new Ch(Number("lng"in ze?ze.lng:ze.lon),Number(ze.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 sf=2*Math.PI*af;function Dh(ze){return sf*Math.cos(ze*Math.PI/180)}function Vh(ze){return(180+ze)/360}function Lh(ze){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+ze*Math.PI/360)))/360}function Fh(ze,wt){return ze/Dh(wt)}function Rh(ze){return 360/Math.PI*Math.atan(Math.exp((180-360*ze)*Math.PI/180))-90}function Uh(ze,wt){return ze*Dh(Rh(wt))}class $h{constructor(ze,wt,Rt=0){this.x=+ze,this.y=+wt,this.z=+Rt}static fromLngLat(ze,wt=0){const Rt=Ch.convert(ze);return new $h(Vh(Rt.lng),Lh(Rt.lat),Fh(wt,Rt.lat))}toLngLat(){return new Ch(360*this.x-180,Rh(this.y))}toAltitude(){return Uh(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/sf*(ze=Rh(this.y),1/Math.cos(ze*Math.PI/180));var ze}}class Oh{constructor(ze,wt){this.width=ze,this.height=wt,this.nextRow=0,this.image=new qo({width:ze,height:wt}),this.positions={},this.uploaded=!1}getDash(ze,wt){const Rt=this.getKey(ze,wt);return this.positions[Rt]}trim(){const ze=this.width,wt=this.height=k(this.nextRow);this.image.resize({width:ze,height:wt})}getKey(ze,wt){return ze.join(",")+wt}getDashRanges(ze,wt,Rt){const Xt=[];let sr=ze.length%2==1?-ze[ze.length-1]*Rt:0,Dr=ze[0]*Rt,Lr=!0;Xt.push({left:sr,right:Dr,isDash:Lr,zeroLength:0===ze[0]});let Ur=ze[0];for(let wt=1;wt<ze.length;wt++){Lr=!Lr;const qr=ze[wt];sr=Ur*Rt,Ur+=qr,Dr=Ur*Rt,Xt.push({left:sr,right:Dr,isDash:Lr,zeroLength:0===qr})}return Xt}addRoundDash(ze,wt,Rt){const Xt=wt/2;for(let wt=-Rt;wt<=Rt;wt++){const sr=this.width*(this.nextRow+Rt+wt);let Dr=0,Lr=ze[Dr];for(let Ur=0;Ur<this.width;Ur++){Ur/Lr.right>1&&(Lr=ze[++Dr]);const qr=Math.abs(Ur-Lr.left),ri=Math.abs(Ur-Lr.right),ai=Math.min(qr,ri);let Yi;const Ji=wt/Rt*(Xt+1);if(Lr.isDash){const ze=Xt-Math.abs(Ji);Yi=Math.sqrt(ai*ai+ze*ze)}else Yi=Xt-Math.sqrt(ai*ai+Ji*Ji);this.image.data[sr+Ur]=Math.max(0,Math.min(255,Yi+128))}}}addRegularDash(ze,wt){for(let wt=ze.length-1;wt>=0;--wt){const Rt=ze[wt],Xt=ze[wt+1];Rt.zeroLength?ze.splice(wt,1):Xt&&Xt.isDash===Rt.isDash&&(Xt.left=Rt.left,ze.splice(wt,1))}const Rt=ze[0],Xt=ze[ze.length-1];Rt.isDash===Xt.isDash&&(Rt.left=Xt.left-this.width,Xt.right=Rt.right+this.width);const sr=this.width*this.nextRow;let Dr=0,Lr=ze[Dr];for(let Rt=0;Rt<this.width;Rt++){Rt/Lr.right>1&&(Lr=ze[++Dr]);const Xt=Math.abs(Rt-Lr.left),Ur=Math.abs(Rt-Lr.right),qr=Math.min(Xt,Ur);this.image.data[sr+Rt]=Math.max(0,Math.min(255,(Lr.isDash?qr:-qr)+wt+128))}}addDash(ze,wt){const Rt=this.getKey(ze,wt);if(this.positions[Rt])return this.positions[Rt];const Xt="round"===wt,sr=Xt?7:0,Dr=2*sr+1;if(this.nextRow+Dr>this.height)return B("LineAtlas out of space"),null;0===ze.length&&ze.push(1);let Lr=0;for(let wt=0;wt<ze.length;wt++)ze[wt]<0&&(B("Negative value is found in line dasharray, replacing values with 0"),ze[wt]=0),Lr+=ze[wt];if(0!==Lr){const Rt=this.width/Lr,Dr=this.getDashRanges(ze,this.width,Rt);Xt?this.addRoundDash(Dr,Rt,sr):this.addRegularDash(Dr,"square"===wt?.5*Rt:0)}const Ur=this.nextRow+sr;this.nextRow+=Dr;const qr={tl:[Ur,sr],br:[Lr,0]};return this.positions[Rt]=qr,qr}}oi("LineAtlas",Oh);class qh{constructor(ze){this._callback=ze,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const lf=sr.performance;function jh(ze){const wt=ze?ze.url.toString():void 0;return lf.getEntriesByName(wt)}class Gh{constructor(){this.tasks={},this.taskQueue=[],S(["process"],this),this.invoker=new qh(this.process),this.nextId=0}add(ze,wt){const Rt=this.nextId++,Xt=function({type:ze,isSymbolTile:wt,zoom:Rt}){return Rt=Rt||0,"message"===ze?0:"maybePrepare"!==ze||wt?"parseTile"!==ze||wt?"parseTile"===ze&&wt?300-Rt:"maybePrepare"===ze&&wt?400-Rt:500:200-Rt:100-Rt}(wt);if(0===Xt){D();try{ze()}finally{}return{cancel:()=>{}}}return this.tasks[Rt]={fn:ze,metadata:wt,priority:Xt,id:Rt},this.taskQueue.push(Rt),this.invoker.trigger(),{cancel:()=>{delete this.tasks[Rt]}}}process(){D();try{if(this.taskQueue=this.taskQueue.filter(ze=>!!this.tasks[ze]),!this.taskQueue.length)return;const ze=this.pick();if(null===ze)return;const wt=this.tasks[ze];if(delete this.tasks[ze],this.taskQueue.length&&this.invoker.trigger(),!wt)return;wt.fn()}finally{}}pick(){let ze=null,wt=1/0;for(let Rt=0;Rt<this.taskQueue.length;Rt++){const Xt=this.tasks[this.taskQueue[Rt]];Xt.priority<wt&&(wt=Xt.priority,ze=Rt)}if(null===ze)return null;const Rt=this.taskQueue[ze];return this.taskQueue.splice(ze,1),Rt}remove(){this.invoker.remove()}}function Zh(ze,wt,Rt){var Xt=2*Math.PI*6378137/256/Math.pow(2,Rt);return[ze*Xt-2*Math.PI*6378137/2,wt*Xt-2*Math.PI*6378137/2]}class Xh{constructor(ze,wt,Rt){this.z=ze,this.x=wt,this.y=Rt,this.key=Yh(0,ze,ze,wt,Rt)}equals(ze){return this.z===ze.z&&this.x===ze.x&&this.y===ze.y}url(ze,wt){const Rt=(sr=this.y,Dr=this.z,Lr=Zh(256*(Xt=this.x),256*(sr=Math.pow(2,Dr)-sr-1),Dr),Ur=Zh(256*(Xt+1),256*(sr+1),Dr),Lr[0]+","+Lr[1]+","+Ur[0]+","+Ur[1]);var Xt,sr,Dr,Lr,Ur;const qr=function(ze,wt,Rt){let Xt,sr="";for(let Dr=ze;Dr>0;Dr--)Xt=1<<Dr-1,sr+=(wt&Xt?1:0)+(Rt&Xt?2:0);return sr}(this.z,this.x,this.y);return ze[(this.x+this.y)%ze.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===wt?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",qr).replace("{bbox-epsg-3857}",Rt)}getTilePoint(ze){const wt=Math.pow(2,this.z);return new Xt((ze.x*wt-this.x)*Ed,(ze.y*wt-this.y)*Ed)}getTileVec3(ze){const wt=Math.pow(2,this.z);return bo((ze.x*wt-this.x)*Ed,(ze.y*wt-this.y)*Ed,Uh(ze.z,ze.y))}toString(){return`${this.z}/${this.x}/${this.y}`}}class Kh{constructor(ze,wt){this.wrap=ze,this.canonical=wt,this.key=Yh(ze,wt.z,wt.z,wt.x,wt.y)}}class Hh{constructor(ze,wt,Rt,Xt,sr){this.overscaledZ=ze,this.wrap=wt,this.canonical=new Xh(Rt,+Xt,+sr),this.key=0===wt&&ze===Rt?this.canonical.key:Yh(wt,ze,Rt,Xt,sr)}equals(ze){return this.overscaledZ===ze.overscaledZ&&this.wrap===ze.wrap&&this.canonical.equals(ze.canonical)}scaledTo(ze){const wt=this.canonical.z-ze;return ze>this.canonical.z?new Hh(ze,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Hh(ze,this.wrap,ze,this.canonical.x>>wt,this.canonical.y>>wt)}calculateScaledKey(ze,wt=!0){if(this.overscaledZ===ze&&wt)return this.key;if(ze>this.canonical.z)return Yh(this.wrap*+wt,ze,this.canonical.z,this.canonical.x,this.canonical.y);{const Rt=this.canonical.z-ze;return Yh(this.wrap*+wt,ze,ze,this.canonical.x>>Rt,this.canonical.y>>Rt)}}isChildOf(ze){if(ze.wrap!==this.wrap)return!1;const wt=this.canonical.z-ze.canonical.z;return 0===ze.overscaledZ||ze.overscaledZ<this.overscaledZ&&ze.canonical.x===this.canonical.x>>wt&&ze.canonical.y===this.canonical.y>>wt}children(ze){if(this.overscaledZ>=ze)return[new Hh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const wt=this.canonical.z+1,Rt=2*this.canonical.x,Xt=2*this.canonical.y;return[new Hh(wt,this.wrap,wt,Rt,Xt),new Hh(wt,this.wrap,wt,Rt+1,Xt),new Hh(wt,this.wrap,wt,Rt,Xt+1),new Hh(wt,this.wrap,wt,Rt+1,Xt+1)]}isLessThan(ze){return this.wrap<ze.wrap||!(this.wrap>ze.wrap)&&(this.overscaledZ<ze.overscaledZ||!(this.overscaledZ>ze.overscaledZ)&&(this.canonical.x<ze.canonical.x||!(this.canonical.x>ze.canonical.x)&&this.canonical.y<ze.canonical.y))}wrapped(){return new Hh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(ze){return new Hh(this.overscaledZ,ze,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Kh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(ze){return this.canonical.getTilePoint(new $h(ze.x-this.wrap,ze.y))}getTileVec3(ze){return this.canonical.getTileVec3(new $h(ze.x-this.wrap,ze.y,ze.z))}}function Yh(ze,wt,Rt,Xt,sr){const Dr=1<<Math.min(Rt,22);let Lr=Dr*(sr%Dr)+Xt%Dr;return ze&&Rt<22&&(Lr+=Dr*Dr*((ze<0?-2*ze-1:2*ze)%(1<<2*(22-Rt)))),16*(32*Lr+Rt)+(wt-Rt)}oi("CanonicalTileID",Xh),oi("OverscaledTileID",Hh,{omit:["projMatrix"]});class Jh{constructor(ze){this._stringToNumber={},this._numberToString=[];for(let wt=0;wt<ze.length;wt++){const Rt=ze[wt];this._stringToNumber[Rt]=wt,this._numberToString[wt]=Rt}}encode(ze){return this._stringToNumber[ze]}decode(ze){return this._numberToString[ze]}}class Wh{constructor(ze,wt,Rt,Xt,sr){this.type="Feature",this._vectorTileFeature=ze,ze._z=wt,ze._x=Rt,ze._y=Xt,this.properties=ze.properties,this.id=sr}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(ze){this._geometry=ze}toJSON(){const ze={geometry:this.geometry};for(const wt in this)"_geometry"!==wt&&"_vectorTileFeature"!==wt&&(ze[wt]=this[wt]);return ze}}var cf=Ss([{name:"a_pos",type:"Int16",components:2}]);class tp{constructor(ze,wt,Rt){this.tileID=ze,this.uid=w(),this.uses=0,this.tileSize=wt,this.tileZoom=Rt,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(ze){const wt=ze+this.timeAdded;wt<Un.now()||this.fadeEndTime&&wt<this.fadeEndTime||(this.fadeEndTime=wt)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}loadVectorData(ze,wt,Rt){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",ze){ze.featureIndex&&(this.latestFeatureIndex=ze.featureIndex,ze.rawTileData?(this.latestRawTileData=ze.rawTileData,this.latestFeatureIndex.rawTileData=ze.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=ze.collisionBoxArray,this.buckets=function(ze,wt){const Rt={};if(!wt)return Rt;for(const Xt of ze){const ze=Xt.layerIds.map(ze=>wt.getLayer(ze)).filter(Boolean);if(0!==ze.length){Xt.layers=ze,Xt.stateDependentLayerIds&&(Xt.stateDependentLayers=Xt.stateDependentLayerIds.map(wt=>ze.filter(ze=>ze.id===wt)[0]));for(const wt of ze)Rt[wt.id]=Xt}}return Rt}(ze.buckets,wt.style),this.hasSymbolBuckets=!1;for(const ze in this.buckets){const wt=this.buckets[ze];if(wt instanceof dh){if(this.hasSymbolBuckets=!0,!Rt)break;wt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const ze in this.buckets){const wt=this.buckets[ze];if(wt instanceof dh&&wt.hasRTLText){this.hasRTLText=!0,dd.isLoading()||dd.isLoaded()||"deferred"!==ns()||is();break}}this.queryPadding=0;for(const ze in this.buckets){const Rt=this.buckets[ze];this.queryPadding=Math.max(this.queryPadding,wt.style.getLayer(ze).queryRadius(Rt))}ze.imageAtlas&&(this.imageAtlas=ze.imageAtlas),ze.glyphAtlasImage&&(this.glyphAtlasImage=ze.glyphAtlasImage),ze.lineAtlas&&(this.lineAtlas=ze.lineAtlas)}else this.collisionBoxArray=new Ys}unloadVectorData(){for(const ze in this.buckets)this.buckets[ze].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(ze){return this.buckets[ze.id]}upload(ze){for(const wt in this.buckets){const Rt=this.buckets[wt];Rt.uploadPending()&&Rt.upload(ze)}const wt=ze.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Mh(ze,this.imageAtlas.image,wt.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Mh(ze,this.glyphAtlasImage,wt.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Mh(ze,this.lineAtlas.image,wt.ALPHA),this.lineAtlas.uploaded=!0)}prepare(ze){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(ze,this.imageAtlasTexture)}queryRenderedFeatures(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:Xt,pixelPosMatrix:Lr,transform:Dr,params:sr},ze,wt,Rt):{}}querySourceFeatures(ze,wt){const Rt=this.latestFeatureIndex;if(!Rt||!Rt.rawTileData)return;const Xt=Rt.loadVTLayers(),sr=wt?wt.sourceLayer:"",Dr=Xt._geojsonTileLayer||Xt[sr];if(!Dr)return;const Lr=An(wt&&wt.filter),{z:Ur,x:qr,y:ri}=this.tileID.canonical,ai={z:Ur,x:qr,y:ri};for(let wt=0;wt<Dr.length;wt++){const Xt=Dr.feature(wt);if(Lr.needGeometry){const ze=Ga(Xt,!0);if(!Lr.filter(new as(this.tileID.overscaledZ),ze,this.tileID.canonical))continue}else if(!Lr.filter(new as(this.tileID.overscaledZ),Xt))continue;const Yi=Rt.getId(Xt,sr),Ji=new Wh(Xt,Ur,qr,ri,Yi);Ji.tile=ai,ze.push(Ji)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(ze){const wt=this.expirationTime;if(ze.cacheControl){const wt=V(ze.cacheControl);wt["max-age"]&&(this.expirationTime=Date.now()+1e3*wt["max-age"])}else ze.expires&&(this.expirationTime=new Date(ze.expires).getTime());if(this.expirationTime){const ze=Date.now();let Rt=!1;if(this.expirationTime>ze)Rt=!1;else if(wt)if(this.expirationTime<wt)Rt=!0;else{const Xt=this.expirationTime-wt;Xt?this.expirationTime=ze+Math.max(Xt,3e4):Rt=!0}else Rt=!0;Rt?(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(ze,wt){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(ze).length)return;const Rt=this.latestFeatureIndex.loadVTLayers();for(const Xt in this.buckets){if(!wt.style.hasLayer(Xt))continue;const sr=this.buckets[Xt],Dr=sr.layers[0].sourceLayer||"_geojsonTileLayer",Lr=Rt[Dr],Ur=ze[Dr];if(!Lr||!Ur||0===Object.keys(Ur).length)continue;sr.update(Ur,Lr,this.imageAtlas&&this.imageAtlas.patternPositions||{});const qr=wt&&wt.style&&wt.style.getLayer(Xt);qr&&(this.queryPadding=Math.max(this.queryPadding,qr.queryRadius(sr)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Un.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(ze){this.symbolFadeHoldUntil=Un.now()+ze}setDependencies(ze,wt){const Rt={};for(const ze of wt)Rt[ze]=!0;this.dependencies[ze]=Rt}hasDependency(ze,wt){for(const Rt of ze){const ze=this.dependencies[Rt];if(ze)for(const Rt of wt)if(ze[Rt])return!0}return!1}clearQueryDebugViz(){}}class ep{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(ze,wt,Rt){const Xt=String(wt);if(this.stateChanges[ze]=this.stateChanges[ze]||{},this.stateChanges[ze][Xt]=this.stateChanges[ze][Xt]||{},v(this.stateChanges[ze][Xt],Rt),null===this.deletedStates[ze]){this.deletedStates[ze]={};for(const wt in this.state[ze])wt!==Xt&&(this.deletedStates[ze][wt]=null)}else if(this.deletedStates[ze]&&null===this.deletedStates[ze][Xt]){this.deletedStates[ze][Xt]={};for(const wt in this.state[ze][Xt])Rt[wt]||(this.deletedStates[ze][Xt][wt]=null)}else for(const wt in Rt)this.deletedStates[ze]&&this.deletedStates[ze][Xt]&&null===this.deletedStates[ze][Xt][wt]&&delete this.deletedStates[ze][Xt][wt]}removeFeatureState(ze,wt,Rt){if(null===this.deletedStates[ze])return;const Xt=String(wt);if(this.deletedStates[ze]=this.deletedStates[ze]||{},Rt&&void 0!==wt)null!==this.deletedStates[ze][Xt]&&(this.deletedStates[ze][Xt]=this.deletedStates[ze][Xt]||{},this.deletedStates[ze][Xt][Rt]=null);else if(void 0!==wt)if(this.stateChanges[ze]&&this.stateChanges[ze][Xt])for(Rt in this.deletedStates[ze][Xt]={},this.stateChanges[ze][Xt])this.deletedStates[ze][Xt][Rt]=null;else this.deletedStates[ze][Xt]=null;else this.deletedStates[ze]=null}getState(ze,wt){const Rt=String(wt),Xt=v({},(this.state[ze]||{})[Rt],(this.stateChanges[ze]||{})[Rt]);if(null===this.deletedStates[ze])return{};if(this.deletedStates[ze]){const Rt=this.deletedStates[ze][wt];if(null===Rt)return{};for(const ze in Rt)delete Xt[ze]}return Xt}initializeTileState(ze,wt){ze.setFeatureState(this.state,wt)}coalesceChanges(ze,wt){const Rt={};for(const ze in this.stateChanges){this.state[ze]=this.state[ze]||{};const wt={};for(const Rt in this.stateChanges[ze])this.state[ze][Rt]||(this.state[ze][Rt]={}),v(this.state[ze][Rt],this.stateChanges[ze][Rt]),wt[Rt]=this.state[ze][Rt];Rt[ze]=wt}for(const ze in this.deletedStates){this.state[ze]=this.state[ze]||{};const wt={};if(null===this.deletedStates[ze])for(const Rt in this.state[ze])wt[Rt]={},this.state[ze][Rt]={};else for(const Rt in this.deletedStates[ze]){if(null===this.deletedStates[ze][Rt])this.state[ze][Rt]={};else for(const wt of Object.keys(this.deletedStates[ze][Rt]))delete this.state[ze][Rt][wt];wt[Rt]=this.state[ze][Rt]}Rt[ze]=Rt[ze]||{},v(Rt[ze],wt)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(Rt).length)for(const Xt in ze)ze[Xt].setFeatureState(Rt,wt)}}class rp{constructor(ze){this.size=ze,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(ze,wt){const Rt=this.toIdx(ze,wt);return{min:this.minimums[Rt],max:this.maximums[Rt]}}isLeaf(ze,wt){return this.leaves[this.toIdx(ze,wt)]}toIdx(ze,wt){return wt*this.size+ze}}function np(ze,wt,Rt,Xt){let sr=0,Dr=Number.MAX_VALUE;for(let Lr=0;Lr<3;Lr++)if(Math.abs(Xt[Lr])<1e-15){if(Rt[Lr]<ze[Lr]||Rt[Lr]>wt[Lr])return null}else{const Ur=1/Xt[Lr];let qr=(ze[Lr]-Rt[Lr])*Ur,ri=(wt[Lr]-Rt[Lr])*Ur;if(qr>ri){const ze=qr;qr=ri,ri=ze}if(qr>sr&&(sr=qr),ri<Dr&&(Dr=ri),sr>Dr)return null}return sr}function ip(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai){const Yi=Xt-ze,Ji=sr-wt,Qi=Dr-Rt,kn=Lr-ze,jn=Ur-wt,Un=qr-Rt,Wn=ai[1]*Un-ai[2]*jn,Yn=ai[2]*kn-ai[0]*Un,Jn=ai[0]*jn-ai[1]*kn,Qn=Yi*Wn+Ji*Yn+Qi*Jn;if(Math.abs(Qn)<1e-15)return null;const Io=1/Qn,Mo=ri[0]-ze,jo=ri[1]-wt,zo=ri[2]-Rt,oa=(Mo*Wn+jo*Yn+zo*Jn)*Io;if(oa<0||oa>1)return null;const la=jo*Qi-zo*Ji,ca=zo*Yi-Mo*Qi,ua=Mo*Ji-jo*Yi,ha=(ai[0]*la+ai[1]*ca+ai[2]*ua)*Io;return ha<0||oa+ha>1?null:(kn*la+jn*ca+Un*ua)*Io}function sp(ze,wt,Rt){return(ze-wt)/(Rt-wt)}function ap(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=1<<Rt,ai=Dr-Xt,Yi=Lr-sr,Ji=(ze+1)/ri*ai+Xt,Qi=(wt+0)/ri*Yi+sr,kn=(wt+1)/ri*Yi+sr;Ur[0]=(ze+0)/ri*ai+Xt,Ur[1]=Qi,qr[0]=Ji,qr[1]=kn}class op{constructor(ze){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=ze,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const wt=function(ze){const wt=Math.ceil(Math.log2(ze.dim/8)),Rt=[];let Xt=Math.ceil(Math.pow(2,wt));const sr=1/Xt,s=(ze,wt,Rt,Xt,sr)=>{const Dr=Xt?1:0,Lr=(ze+1)*Rt-Dr,Ur=wt*Rt,qr=(wt+1)*Rt-Dr;sr[0]=ze*Rt,sr[1]=Ur,sr[2]=Lr,sr[3]=qr};let Dr=new rp(Xt);const Lr=[];for(let wt=0;wt<Xt*Xt;wt++){s(wt%Xt,Math.floor(wt/Xt),sr,!1,Lr);const Rt=up(Lr[0],Lr[1],ze),Ur=up(Lr[2],Lr[1],ze),qr=up(Lr[2],Lr[3],ze),ri=up(Lr[0],Lr[3],ze);Dr.minimums.push(Math.min(Rt,Ur,qr,ri)),Dr.maximums.push(Math.max(Rt,Ur,qr,ri)),Dr.leaves.push(1)}for(Rt.push(Dr),Xt/=2;Xt>=1;Xt/=2){const ze=Rt[Rt.length-1];Dr=new rp(Xt);for(let wt=0;wt<Xt*Xt;wt++){s(wt%Xt,Math.floor(wt/Xt),2,!0,Lr);const Rt=ze.getElevation(Lr[0],Lr[1]),sr=ze.getElevation(Lr[2],Lr[1]),Ur=ze.getElevation(Lr[2],Lr[3]),qr=ze.getElevation(Lr[0],Lr[3]),ri=ze.isLeaf(Lr[0],Lr[1]),ai=ze.isLeaf(Lr[2],Lr[1]),Yi=ze.isLeaf(Lr[2],Lr[3]),Ji=ze.isLeaf(Lr[0],Lr[3]),Qi=Math.min(Rt.min,sr.min,Ur.min,qr.min),kn=Math.max(Rt.max,sr.max,Ur.max,qr.max),jn=ri&&ai&&Yi&&Ji;Dr.maximums.push(kn),Dr.minimums.push(Qi),Dr.leaves.push(kn-Qi<=5&&jn?1:0)}Rt.push(Dr)}return Rt}(this.dem),Rt=wt.length-1,Xt=wt[Rt];this._addNode(Xt.minimums[0],Xt.maximums[0],Xt.leaves[0]),this._construct(wt,0,0,Rt,0)}raycastRoot(ze,wt,Rt,Xt,sr,Dr,Lr=1){return np([ze,wt,-100],[Rt,Xt,this.maximums[0]*Lr],sr,Dr)}raycast(ze,wt,Rt,Xt,sr,Dr,Lr=1){if(!this.nodeCount)return null;const Ur=this.raycastRoot(ze,wt,Rt,Xt,sr,Dr,Lr);if(null==Ur)return null;const qr=[],ri=[],ai=[],Yi=[],Ji=[{idx:0,t:Ur,nodex:0,nodey:0,depth:0}];for(;Ji.length>0;){const{idx:Ur,t:Qi,nodex:kn,nodey:jn,depth:Un}=Ji.pop();if(this.leaves[Ur]){ap(kn,jn,Un,ze,wt,Rt,Xt,ai,Yi);const Ur=1<<Un,qr=(kn+0)/Ur,ri=(kn+1)/Ur,Ji=(jn+0)/Ur,Wn=(jn+1)/Ur,Yn=up(qr,Ji,this.dem)*Lr,Jn=up(ri,Ji,this.dem)*Lr,Qn=up(ri,Wn,this.dem)*Lr,Io=up(qr,Wn,this.dem)*Lr,Mo=ip(ai[0],ai[1],Yn,Yi[0],ai[1],Jn,Yi[0],Yi[1],Qn,sr,Dr),jo=ip(Yi[0],Yi[1],Qn,ai[0],Yi[1],Io,ai[0],ai[1],Yn,sr,Dr),zo=Math.min(null!==Mo?Mo:Number.MAX_VALUE,null!==jo?jo:Number.MAX_VALUE);if(zo!==Number.MAX_VALUE)return zo;{const ze=ko([],sr,Dr,Qi);if(lp(Yn,Jn,Io,Qn,sp(ze[0],ai[0],Yi[0]),sp(ze[1],ai[1],Yi[1]))>=ze[2])return Qi}continue}let Wn=0;for(let Ji=0;Ji<this._siblingOffset.length;Ji++){ap((kn<<1)+this._siblingOffset[Ji][0],(jn<<1)+this._siblingOffset[Ji][1],Un+1,ze,wt,Rt,Xt,ai,Yi),ai[2]=-100,Yi[2]=this.maximums[this.childOffsets[Ur]+Ji]*Lr;const Qi=np(ai,Yi,sr,Dr);
20if(null!=Qi){const ze=Qi;qr[Ji]=ze;let wt=!1;for(let Rt=0;Rt<Wn&&!wt;Rt++)ze>=qr[ri[Rt]]&&(ri.splice(Rt,0,Ji),wt=!0);wt||(ri[Wn]=Ji),Wn++}}for(let ze=0;ze<Wn;ze++){const wt=ri[ze];Ji.push({idx:this.childOffsets[Ur]+wt,t:qr[wt],nodex:(kn<<1)+this._siblingOffset[wt][0],nodey:(jn<<1)+this._siblingOffset[wt][1],depth:Un+1})}}return null}_addNode(ze,wt,Rt){return this.minimums.push(ze),this.maximums.push(wt),this.leaves.push(Rt),this.childOffsets.push(0),this.nodeCount++}_construct(ze,wt,Rt,Xt,sr){if(1===ze[Xt].isLeaf(wt,Rt))return;this.childOffsets[sr]||(this.childOffsets[sr]=this.nodeCount);const Dr=Xt-1,Lr=ze[Dr];let Ur,qr=0;for(let ze=0;ze<this._siblingOffset.length;ze++){const Xt=2*wt+this._siblingOffset[ze][0],sr=2*Rt+this._siblingOffset[ze][1],Dr=Lr.getElevation(Xt,sr),ri=Lr.isLeaf(Xt,sr),ai=this._addNode(Dr.min,Dr.max,ri);ri&&(qr|=1<<ze),Ur||(Ur=ai)}for(let Xt=0;Xt<this._siblingOffset.length;Xt++)qr&1<<Xt||this._construct(ze,2*wt+this._siblingOffset[Xt][0],2*Rt+this._siblingOffset[Xt][1],Dr,Ur+Xt)}}function lp(ze,wt,Rt,Xt,sr,Dr){return rr(rr(ze,Rt,Dr),rr(wt,Xt,Dr),sr)}function up(ze,wt,Rt){const Xt=Rt.dim,sr=y(ze*Xt-.5,0,Xt-1),Dr=y(wt*Xt-.5,0,Xt-1),Lr=Math.floor(sr),Ur=Math.floor(Dr),qr=Math.min(Lr+1,Xt-1),ri=Math.min(Ur+1,Xt-1);return lp(Rt.get(Lr,Ur),Rt.get(qr,Ur),Rt.get(Lr,ri),Rt.get(qr,ri),sr-Lr,Dr-Ur)}const uf={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};class hp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(ze,wt,Rt,Xt=!1,sr=!1){if(this.uid=ze,wt.height!==wt.width)throw new RangeError("DEM tiles must be square");if(Rt&&"mapbox"!==Rt&&"terrarium"!==Rt)return B(`"${Rt}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=wt.height;const Dr=this.dim=wt.height-2;if(this.data=new Uint32Array(wt.data.buffer),this.encoding=Rt||"mapbox",this.borderReady=Xt,!Xt){for(let ze=0;ze<Dr;ze++)this.data[this._idx(-1,ze)]=this.data[this._idx(0,ze)],this.data[this._idx(Dr,ze)]=this.data[this._idx(Dr-1,ze)],this.data[this._idx(ze,-1)]=this.data[this._idx(ze,0)],this.data[this._idx(ze,Dr)]=this.data[this._idx(ze,Dr-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(Dr,-1)]=this.data[this._idx(Dr-1,0)],this.data[this._idx(-1,Dr)]=this.data[this._idx(0,Dr-1)],this.data[this._idx(Dr,Dr)]=this.data[this._idx(Dr-1,Dr-1)],sr&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new op(this)}get(ze,wt,Rt=!1){const Xt=new Uint8Array(this.data.buffer);Rt&&(ze=y(ze,-1,this.dim),wt=y(wt,-1,this.dim));const sr=4*this._idx(ze,wt);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(Xt[sr],Xt[sr+1],Xt[sr+2])}static getUnpackVector(ze){return uf[ze]}get unpackVector(){return uf[this.encoding]}_idx(ze,wt){if(ze<-1||ze>=this.dim+1||wt<-1||wt>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(wt+1)*this.stride+(ze+1)}_unpackMapbox(ze,wt,Rt){return(256*ze*256+256*wt+Rt)/10-1e4}_unpackTerrarium(ze,wt,Rt){return 256*ze+wt+Rt/256-32768}static pack(ze,wt){const Rt=[0,0,0,0],Xt=hp.getUnpackVector(wt);let sr=Math.floor((ze+Xt[3])/Xt[2]);return Rt[2]=sr%256,sr=Math.floor(sr/256),Rt[1]=sr%256,sr=Math.floor(sr/256),Rt[0]=sr,Rt}getPixels(){return new No({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(ze,wt,Rt){if(this.dim!==ze.dim)throw new Error("dem dimension mismatch");let Xt=wt*this.dim,sr=wt*this.dim+this.dim,Dr=Rt*this.dim,Lr=Rt*this.dim+this.dim;switch(wt){case-1:Xt=sr-1;break;case 1:sr=Xt+1}switch(Rt){case-1:Dr=Lr-1;break;case 1:Lr=Dr+1}const Ur=-wt*this.dim,qr=-Rt*this.dim;for(let wt=Dr;wt<Lr;wt++)for(let Rt=Xt;Rt<sr;Rt++)this.data[this._idx(Rt,wt)]=ze.data[this._idx(Rt+Ur,wt+qr)]}onDeserialize(){this._tree&&(this._tree.dem=this)}}oi("DEMData",hp),oi("DemMinMaxQuadTree",op,{omit:["dem"]});class pp{constructor(ze,wt){this.max=ze,this.onRemove=wt,this.reset()}reset(){for(const ze in this.data)for(const wt of this.data[ze])wt.timeout&&clearTimeout(wt.timeout),this.onRemove(wt.value);return this.data={},this.order=[],this}add(ze,wt,Rt){const Xt=ze.wrapped().key;void 0===this.data[Xt]&&(this.data[Xt]=[]);const sr={value:wt,timeout:void 0};if(void 0!==Rt&&(sr.timeout=setTimeout(()=>
vendor: 80,296 bytes, line 20
20{this.remove(ze,sr)},Rt)),this.data[Xt].push(sr),this.order.push(Xt),this.order.length>this.max){const ze=this._getAndRemoveByKey(this.order[0]);ze&&this.onRemove(ze)}return this}has(ze){return ze.wrapped().key in this.data}getAndRemove(ze){return this.has(ze)?this._getAndRemoveByKey(ze.wrapped().key):null}_getAndRemoveByKey(ze){const wt=this.data[ze].shift();return wt.timeout&&clearTimeout(wt.timeout),0===this.data[ze].length&&delete this.data[ze],this.order.splice(this.order.indexOf(ze),1),wt.value}getByKey(ze){const wt=this.data[ze];return wt?wt[0].value:null}get(ze){return this.has(ze)?this.data[ze.wrapped().key][0].value:null}remove(ze,wt){if(!this.has(ze))return this;const Rt=ze.wrapped().key,Xt=void 0===wt?0:this.data[Rt].indexOf(wt),sr=this.data[Rt][Xt];return this.data[Rt].splice(Xt,1),sr.timeout&&clearTimeout(sr.timeout),0===this.data[Rt].length&&delete this.data[Rt],this.onRemove(sr.value),this.order.splice(this.order.indexOf(Rt),1),this}setMaxSize(ze){for(this.max=ze;this.order.length>this.max;){const ze=this._getAndRemoveByKey(this.order[0]);ze&&this.onRemove(ze)}return this}filter(ze){const wt=[];for(const Rt in this.data)for(const Xt of this.data[Rt])ze(Xt.value)||wt.push(Xt);for(const ze of wt)this.remove(ze.value.tileID,ze)}}class dp{constructor(ze,wt,Rt){this.func=ze,this.mask=wt,this.range=Rt}}dp.ReadOnly=!1,dp.ReadWrite=!0,dp.disabled=new dp(519,dp.ReadOnly,[0,1]);const df=7680;class yp{constructor(ze,wt,Rt,Xt,sr,Dr){this.test=ze,this.ref=wt,this.mask=Rt,this.fail=Xt,this.depthFail=sr,this.pass=Dr}}yp.disabled=new yp({func:519,mask:0},0,0,df,df,df);class mp{constructor(ze,wt,Rt){this.blendFunction=ze,this.blendColor=wt,this.mask=Rt}}mp.Replace=[1,0],mp.disabled=new mp(mp.Replace,ce.transparent,[!1,!1,!1,!1]),mp.unblended=new mp(mp.Replace,ce.transparent,[!0,!0,!0,!0]),mp.alphaBlended=new mp([1,771],ce.transparent,[!0,!0,!0,!0]);const hf=1029,pf=2305;class vp{constructor(ze,wt,Rt){this.enable=ze,this.mode=wt,this.frontFace=Rt}}vp.disabled=new vp(!1,hf,pf),vp.backCCW=new vp(!0,hf,pf),vp.backCW=new vp(!0,hf,2304),vp.frontCW=new vp(!0,1028,2304),vp.frontCCW=new vp(!0,1028,pf);class bp extends Ft{constructor(ze,wt,Rt){super(),this.id=ze,this._onlySymbols=Rt,wt.on("data",ze=>{"source"===ze.dataType&&"metadata"===ze.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===ze.dataType&&"content"===ze.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),wt.on("error",()=>{this._sourceErrored=!0}),this._source=wt,this._tiles={},this._cache=new pp(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ep}onAdd(ze){this.map=ze,this._maxTileCacheSize=ze?ze._maxTileCacheSize:null}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const ze in this._tiles){const wt=this._tiles[ze];if("loaded"!==wt.state&&"errored"!==wt.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const ze=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,ze&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(ze,wt){return ze.isSymbolTile=this._onlySymbols,this._source.loadTile(ze,wt)}_unloadTile(ze){if(this._source.unloadTile)return this._source.unloadTile(ze,()=>{})}_abortTile(ze){if(this._source.abortTile)return this._source.abortTile(ze,()=>{})}serialize(){return this._source.serialize()}prepare(ze){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const wt in this._tiles){const Rt=this._tiles[wt];Rt.upload(ze),Rt.prepare(this.map.style.imageManager)}}getIds(){return x(this._tiles).map(ze=>ze.tileID).sort(wp).map(ze=>ze.key)}getRenderableIds(ze){const wt=[];for(const Rt in this._tiles)this._isIdRenderable(+Rt,ze)&&wt.push(this._tiles[Rt]);return ze?wt.sort((ze,wt)=>{const Rt=ze.tileID,sr=wt.tileID,Dr=new Xt(Rt.canonical.x,Rt.canonical.y)._rotate(this.transform.angle),Lr=new Xt(sr.canonical.x,sr.canonical.y)._rotate(this.transform.angle);return Rt.overscaledZ-sr.overscaledZ||Lr.y-Dr.y||Lr.x-Dr.x}).map(ze=>ze.tileID.key):wt.map(ze=>ze.tileID).sort(wp).map(ze=>ze.key)}hasRenderableParent(ze){const wt=this.findLoadedParent(ze,0);return!!wt&&this._isIdRenderable(wt.tileID.key)}_isIdRenderable(ze,wt){return this._tiles[ze]&&this._tiles[ze].hasData()&&!this._coveredTiles[ze]&&(wt||!this._tiles[ze].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const ze in this._tiles)"errored"!==this._tiles[ze].state&&this._reloadTile(+ze,"reloading")}}_reloadTile(ze,wt){const Rt=this._tiles[ze];Rt&&("loading"!==Rt.state&&(Rt.state=wt),this._loadTile(Rt,this._tileLoaded.bind(this,Rt,ze,wt)))}_tileLoaded(ze,wt,Rt,Xt){if(Xt)return ze.state="errored",void(404!==Xt.status?this._source.fire(new Lt(Xt,{tile:ze})):this.update(this.transform));ze.timeAdded=Un.now(),"expired"===Rt&&(ze.refreshedUponExpiration=!0),this._setTileReloadTimer(wt,ze),"raster-dem"===this.getSource().type&&ze.dem&&this._backfillDEM(ze),this._state.initializeTileState(ze,this.map?this.map.painter:null),this._source.fire(new Vt("data",{dataType:"source",tile:ze,coord:ze.tileID,sourceCacheId:this.id}))}_backfillDEM(ze){const wt=this.getRenderableIds();for(let Rt=0;Rt<wt.length;Rt++){const Xt=wt[Rt];if(ze.neighboringTiles&&ze.neighboringTiles[Xt]){const wt=this.getTileByID(Xt);r(ze,wt),r(wt,ze)}}function r(ze,wt){if(!ze.dem||ze.dem.borderReady)return;ze.needsHillshadePrepare=!0,ze.needsDEMTextureUpload=!0;let Rt=wt.tileID.canonical.x-ze.tileID.canonical.x;const Xt=wt.tileID.canonical.y-ze.tileID.canonical.y,sr=Math.pow(2,ze.tileID.canonical.z),Dr=wt.tileID.key;0===Rt&&0===Xt||Math.abs(Xt)>1||(Math.abs(Rt)>1&&(1===Math.abs(Rt+sr)?Rt+=sr:1===Math.abs(Rt-sr)&&(Rt-=sr)),wt.dem&&ze.dem&&(ze.dem.backfillBorder(wt.dem,Rt,Xt),ze.neighboringTiles&&ze.neighboringTiles[Dr]&&(ze.neighboringTiles[Dr].backfilled=!0)))}}getTile(ze){return this.getTileByID(ze.key)}getTileByID(ze){return this._tiles[ze]}_retainLoadedChildren(ze,wt,Rt,Xt){for(const sr in this._tiles){let Dr=this._tiles[sr];if(Xt[sr]||!Dr.hasData()||Dr.tileID.overscaledZ<=wt||Dr.tileID.overscaledZ>Rt)continue;let Lr=Dr.tileID;for(;Dr&&Dr.tileID.overscaledZ>wt+1;){const ze=Dr.tileID.scaledTo(Dr.tileID.overscaledZ-1);Dr=this._tiles[ze.key],Dr&&Dr.hasData()&&(Lr=ze)}let Ur=Lr;for(;Ur.overscaledZ>wt;)if(Ur=Ur.scaledTo(Ur.overscaledZ-1),ze[Ur.key]){Xt[Lr.key]=Lr;break}}}findLoadedParent(ze,wt){if(ze.key in this._loadedParentTiles){const Rt=this._loadedParentTiles[ze.key];return Rt&&Rt.tileID.overscaledZ>=wt?Rt:null}for(let Rt=ze.overscaledZ-1;Rt>=wt;Rt--){const wt=ze.scaledTo(Rt),Xt=this._getLoadedTile(wt);if(Xt)return Xt}}_getLoadedTile(ze){const wt=this._tiles[ze.key];return wt&&wt.hasData()?wt:this._cache.getByKey(this._source.reparseOverscaled?ze.wrapped().key:ze.canonical.key)}updateCacheSize(ze,wt){wt=wt||this._source.tileSize;const Rt=Math.ceil(ze.width/wt)+1,Xt=Math.ceil(ze.height/wt)+1,sr=Math.floor(Rt*Xt*5),Dr="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,sr):sr;this._cache.setMaxSize(Dr)}handleWrapJump(ze){const wt=Math.round((ze-(void 0===this._prevLng?ze:this._prevLng))/360);if(this._prevLng=ze,wt){const ze={};for(const Rt in this._tiles){const Xt=this._tiles[Rt];Xt.tileID=Xt.tileID.unwrapTo(Xt.tileID.wrap+wt),ze[Xt.tileID.key]=Xt}this._tiles=ze;for(const ze in this._timers)clearTimeout(this._timers[ze]),delete this._timers[ze];for(const ze in this._tiles)this._setTileReloadTimer(+ze,this._tiles[ze])}}update(ze,wt,Rt){if(this.transform=ze,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!Rt)return;let Xt;this.updateCacheSize(ze,wt),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Xt=ze.getVisibleUnwrappedCoordinates(this._source.tileID).map(ze=>new Hh(ze.canonical.z,ze.wrap,ze.canonical.z,ze.canonical.x,ze.canonical.y)):(Xt=ze.coveringTiles({tileSize:wt||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!Rt,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(Xt=Xt.filter(ze=>this._source.hasTile(ze)))):Xt=[];const sr=this._updateRetainedTiles(Xt);if(_p(this._source.type)&&0!==Xt.length){const ze={},wt={},Rt=Object.keys(sr);for(const Xt of Rt){const Rt=sr[Xt],Dr=this._tiles[Xt];if(!Dr||Dr.fadeEndTime&&Dr.fadeEndTime<=Un.now())continue;const Lr=this.findLoadedParent(Rt,Math.max(Rt.overscaledZ-bp.maxOverzooming,this._source.minzoom));Lr&&(this._addTile(Lr.tileID),ze[Lr.tileID.key]=Lr.tileID),wt[Xt]=Rt}const Dr=Xt[Xt.length-1].overscaledZ;for(const ze in this._tiles){const Rt=this._tiles[ze];if(sr[ze]||!Rt.hasData())continue;let Xt=Rt.tileID;for(;Xt.overscaledZ>Dr;){Xt=Xt.scaledTo(Xt.overscaledZ-1);const Dr=this._tiles[Xt.key];if(Dr&&Dr.hasData()&&wt[Xt.key]){sr[ze]=Rt.tileID;break}}}for(const wt in ze)sr[wt]||(this._coveredTiles[wt]=!0,sr[wt]=ze[wt])}for(const ze in sr)this._tiles[ze].clearFadeHold();const Dr=function(ze,wt){const Rt=[];for(const Xt in ze)Xt in wt||Rt.push(Xt);return Rt}(this._tiles,sr);for(const ze of Dr){const wt=this._tiles[ze];wt.hasSymbolBuckets&&!wt.holdingForFade()?wt.setHoldDuration(this.map._fadeDuration):wt.hasSymbolBuckets&&!wt.symbolFadeFinished()||this._removeTile(+ze)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const ze in this._tiles)this._tiles[ze].holdingForFade()&&this._removeTile(+ze)}_updateRetainedTiles(ze){const wt={};if(0===ze.length)return wt;const Rt={},Xt=ze[ze.length-1].overscaledZ,sr=ze[0].overscaledZ,Dr=Math.max(sr-bp.maxOverzooming,this._source.minzoom),Lr=Math.max(sr+bp.maxUnderzooming,this._source.minzoom),Ur={};for(const Rt of ze){const ze=this._addTile(Rt);wt[Rt.key]=Rt,ze.hasData()||Xt<this._source.maxzoom&&(Ur[Rt.key]=Rt)}this._retainLoadedChildren(Ur,Xt,Lr,wt);for(const Xt of ze){let ze=this._tiles[Xt.key];if(ze.hasData())continue;if(Xt.canonical.z>=this._source.maxzoom){const ze=Xt.children(this._source.maxzoom)[0],Rt=this.getTile(ze);if(Rt&&Rt.hasData()){wt[ze.key]=ze;continue}}else{const ze=Xt.children(this._source.maxzoom);if(wt[ze[0].key]&&wt[ze[1].key]&&wt[ze[2].key]&&wt[ze[3].key])continue}let sr=ze.wasRequested();for(let Lr=Xt.overscaledZ-1;Lr>=Dr;--Lr){const Dr=Xt.scaledTo(Lr);if(Rt[Dr.key])break;if(Rt[Dr.key]=!0,ze=this.getTile(Dr),!ze&&sr&&(ze=this._addTile(Dr)),ze&&(wt[Dr.key]=Dr,sr=ze.wasRequested(),ze.hasData()))break}}return wt}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const ze in this._tiles){const wt=[];let Rt,Xt=this._tiles[ze].tileID;for(;Xt.overscaledZ>0;){if(Xt.key in this._loadedParentTiles){Rt=this._loadedParentTiles[Xt.key];break}wt.push(Xt.key);const ze=Xt.scaledTo(Xt.overscaledZ-1);if(Rt=this._getLoadedTile(ze),Rt)break;Xt=ze}for(const ze of wt)this._loadedParentTiles[ze]=Rt}}_addTile(ze){let wt=this._tiles[ze.key];if(wt)return wt;wt=this._cache.getAndRemove(ze),wt&&(this._setTileReloadTimer(ze.key,wt),wt.tileID=ze,this._state.initializeTileState(wt,this.map?this.map.painter:null),this._cacheTimers[ze.key]&&(clearTimeout(this._cacheTimers[ze.key]),delete this._cacheTimers[ze.key],this._setTileReloadTimer(ze.key,wt)));const Rt=Boolean(wt);return Rt||(wt=new tp(ze,this._source.tileSize*ze.overscaleFactor(),this.transform.tileZoom),this._loadTile(wt,this._tileLoaded.bind(this,wt,ze.key,wt.state))),wt?(wt.uses++,this._tiles[ze.key]=wt,Rt||this._source.fire(new Vt("dataloading",{tile:wt,coord:wt.tileID,dataType:"source"})),wt):null}_setTileReloadTimer(ze,wt){ze in this._timers&&(clearTimeout(this._timers[ze]),delete this._timers[ze]);const Rt=wt.getExpiryTimeout();Rt&&(this._timers[ze]=setTimeout(()=>{this._reloadTile(ze,"expired"),delete this._timers[ze]},Rt))}_removeTile(ze){const wt=this._tiles[ze];wt&&(wt.uses--,delete this._tiles[ze],this._timers[ze]&&(clearTimeout(this._timers[ze]),delete this._timers[ze]),wt.uses>0||(wt.hasData()&&"reloading"!==wt.state?this._cache.add(wt.tileID,wt,wt.getExpiryTimeout()):(wt.aborted=!0,this._abortTile(wt),this._unloadTile(wt))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const ze in this._tiles)this._removeTile(+ze);this._cache.reset()}tilesIn(ze,wt,Rt){const Xt=[],sr=this.transform;if(!sr)return Xt;for(const Dr in this._tiles){const Lr=this._tiles[Dr];if(Rt&&Lr.clearQueryDebugViz(),Lr.holdingForFade())continue;const Ur=ze.containsTile(Lr,sr,wt);Ur&&Xt.push(Ur)}return Xt}getVisibleCoordinates(ze){const wt=this.getRenderableIds(ze).map(ze=>this._tiles[ze].tileID);for(const ze of wt)ze.projMatrix=this.transform.calculateProjMatrix(ze.toUnwrapped());return wt}hasTransition(){if(this._source.hasTransition())return!0;if(_p(this._source.type))for(const ze in this._tiles){const wt=this._tiles[ze];if(void 0!==wt.fadeEndTime&&wt.fadeEndTime>=Un.now())return!0}return!1}setFeatureState(ze,wt,Rt){this._state.updateState(ze=ze||"_geojsonTileLayer",wt,Rt)}removeFeatureState(ze,wt,Rt){this._state.removeFeatureState(ze=ze||"_geojsonTileLayer",wt,Rt)}getFeatureState(ze,wt){return this._state.getState(ze=ze||"_geojsonTileLayer",wt)}setDependencies(ze,wt,Rt){const Xt=this._tiles[ze];Xt&&Xt.setDependencies(wt,Rt)}reloadTilesForDependencies(ze,wt){for(const Rt in this._tiles)this._tiles[Rt].hasDependency(ze,wt)&&this._reloadTile(+Rt,"reloading");this._cache.filter(Rt=>!Rt.hasDependency(ze,wt))}}function wp(ze,wt){const Rt=Math.abs(2*ze.wrap)-+(ze.wrap<0),Xt=Math.abs(2*wt.wrap)-+(wt.wrap<0);return ze.overscaledZ-wt.overscaledZ||Xt-Rt||wt.canonical.y-ze.canonical.y||wt.canonical.x-ze.canonical.x}function _p(ze){return"raster"===ze||"image"===ze||"video"===ze}bp.maxOverzooming=10,bp.maxUnderzooming=3;class kp{constructor(ze,wt,Rt){this._demTile=ze,this._dem=this._demTile.dem,this._scale=wt,this._offset=Rt}static create(ze,wt,Rt){const Xt=Rt||ze.findDEMTileFor(wt);if(!Xt||!Xt.dem)return;const sr=Xt.dem,Dr=Xt.tileID,Lr=1<<wt.canonical.z-Dr.canonical.z;return new kp(Xt,Xt.tileSize/Ed/Lr,[(wt.canonical.x/Lr-Dr.canonical.x)*sr.dim,(wt.canonical.y/Lr-Dr.canonical.y)*sr.dim])}tileCoordToPixel(ze,wt){const Rt=wt*this._scale+this._offset[1],sr=Math.floor(ze*this._scale+this._offset[0]),Dr=Math.floor(Rt);return new Xt(sr,Dr)}getElevationAt(ze,wt,Rt,Xt){const sr=ze*this._scale+this._offset[0],Dr=wt*this._scale+this._offset[1],Lr=Math.floor(sr),Ur=Math.floor(Dr),qr=this._dem;return Xt=!!Xt,Rt?rr(rr(qr.get(Lr,Ur,Xt),qr.get(Lr,Ur+1,Xt),Dr-Ur),rr(qr.get(Lr+1,Ur,Xt),qr.get(Lr+1,Ur+1,Xt),Dr-Ur),sr-Lr):qr.get(Lr,Ur,Xt)}getElevationAtPixel(ze,wt,Rt){return this._dem.get(ze,wt,!!Rt)}getMeterToDEM(ze){return(1<<this._demTile.tileID.canonical.z)*Fh(1,ze)*this._dem.stride}}class Ap{constructor(ze,wt){this.tileID=ze,this.x=ze.canonical.x,this.y=ze.canonical.y,this.z=ze.canonical.z,this.grid=new ed(Ed,16,0),this.featureIndexArray=new ia,this.promoteId=wt}insert(ze,wt,Rt,Xt,sr,Dr=0){const Lr=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(Rt,Xt,sr,Dr);const Ur=this.grid;for(let ze=0;ze<wt.length;ze++){const Rt=wt[ze],Xt=[1/0,1/0,-1/0,-1/0];for(let ze=0;ze<Rt.length;ze++){const wt=Rt[ze];Xt[0]=Math.min(Xt[0],wt.x),Xt[1]=Math.min(Xt[1],wt.y),Xt[2]=Math.max(Xt[2],wt.x),Xt[3]=Math.max(Xt[3],wt.y)}Xt[0]<Ed&&Xt[1]<Ed&&Xt[2]>=0&&Xt[3]>=0&&Ur.insert(Lr,Xt[0],Xt[1],Xt[2],Xt[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Qd.VectorTile(new Pp(this.rawTileData)).layers,this.sourceLayerCoder=new Jh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(ze,wt,Rt,Xt){this.loadVTLayers();const sr=ze.params||{},Dr=An(sr.filter),Lr=ze.tileResult,Ur=ze.transform,qr=Lr.bufferedTilespaceBounds,ri=this.grid.query(qr.min.x,qr.min.y,qr.max.x,qr.max.y,(ze,wt,Rt,Xt)=>io(Lr.bufferedTilespaceGeometry,ze,wt,Rt,Xt));ri.sort(Ip);let ai=null;Ur.elevation&&ri.length>0&&(ai=kp.create(Ur.elevation,this.tileID));const Yi={};let Ji;for(let Ur=0;Ur<ri.length;Ur++){const qr=ri[Ur];if(qr===Ji)continue;Ji=qr;const Qi=this.featureIndexArray.get(qr);let kn=null;this.loadMatchingFeature(Yi,Qi,Dr,sr.layers,sr.availableImages,wt,Rt,Xt,(wt,Rt,Xt,sr=0)=>(kn||(kn=ja(wt)),Rt.queryIntersectsFeature(Lr,wt,Xt,kn,this.z,ze.transform,ze.pixelPosMatrix,ai,sr)))}return Yi}loadMatchingFeature(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const{featureIndex:ri,bucketIndex:ai,sourceLayerIndex:Yi,layoutVertexArrayOffset:Ji}=wt,Qi=this.bucketLayerIDs[ai];if(Xt&&!function(ze,wt){for(let Rt=0;Rt<ze.length;Rt++)if(wt.indexOf(ze[Rt])>=0)return!0;return!1}(Xt,Qi))return;const kn=this.sourceLayerCoder.decode(Yi),jn=this.vtLayers[kn].feature(ri);if(Rt.needGeometry){const ze=Ga(jn,!0);if(!Rt.filter(new as(this.tileID.overscaledZ),ze,this.tileID.canonical))return}else if(!Rt.filter(new as(this.tileID.overscaledZ),jn))return;const Un=this.getId(jn,kn);for(let wt=0;wt<Qi.length;wt++){const Rt=Qi[wt];if(Xt&&Xt.indexOf(Rt)<0)continue;const ai=Dr[Rt];if(!ai)continue;let Yi={};void 0!==Un&&Ur&&(Yi=Ur.getState(ai.sourceLayer||"_geojsonTileLayer",Un));const kn=v({},Lr[Rt]);kn.paint=Sp(kn.paint,ai.paint,jn,Yi,sr),kn.layout=Sp(kn.layout,ai.layout,jn,Yi,sr);const Wn=!qr||qr(jn,ai,Yi,Ji);if(!Wn)continue;const Yn=new Wh(jn,this.z,this.x,this.y,Un);Yn.layer=kn;let Jn=ze[Rt];void 0===Jn&&(Jn=ze[Rt]=[]),Jn.push({featureIndex:ri,feature:Yn,intersectionZ:Wn})}}lookupSymbolFeatures(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr={};this.loadVTLayers();const ri=An(sr);for(const sr of ze)this.loadMatchingFeature(qr,{bucketIndex:Rt,sourceLayerIndex:Xt,featureIndex:sr,layoutVertexArrayOffset:0},ri,Dr,Lr,Ur,wt);return qr}hasLayer(ze){for(const wt of this.bucketLayerIDs)for(const Rt of wt)if(ze===Rt)return!0;return!1}getId(ze,wt){let Rt=ze.id;return this.promoteId&&(Rt=ze.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[wt]],"boolean"==typeof Rt&&(Rt=Number(Rt))),Rt}}function Sp(ze,wt,Rt,Xt,sr){return z(ze,(ze,Dr)=>{const Lr=wt instanceof fs?wt.get(Dr):null;return Lr&&Lr.evaluate?Lr.evaluate(Rt,Xt,sr):Lr})}function Ip(ze,wt){return wt-ze}oi("FeatureIndex",Ap,{omit:["rawTileData","sourceLayerCoder"]});class zp{constructor(ze){const wt={},Rt=[];for(const Xt in ze){const sr=ze[Xt],Dr=wt[Xt]={};for(const ze in sr.glyphs){const wt=sr.glyphs[+ze];if(!wt||0===wt.bitmap.width||0===wt.bitmap.height)continue;const Xt=wt.metrics.localGlyph?2:1,Lr={x:0,y:0,w:wt.bitmap.width+2*Xt,h:wt.bitmap.height+2*Xt};Rt.push(Lr),Dr[ze]=Lr}}const{w:Xt,h:sr}=ec(Rt),Dr=new qo({width:Xt||1,height:sr||1});for(const Rt in ze){const Xt=ze[Rt];for(const ze in Xt.glyphs){const sr=Xt.glyphs[+ze];if(!sr||0===sr.bitmap.width||0===sr.bitmap.height)continue;const Lr=wt[Rt][ze],Ur=sr.metrics.localGlyph?2:1;qo.copy(sr.bitmap,Dr,{x:0,y:0},{x:Lr.x+Ur,y:Lr.y+Ur},sr.bitmap)}}this.image=Dr,this.positions=wt}}oi("GlyphAtlas",zp);class Tp{constructor(ze){this.tileID=new Hh(ze.tileID.overscaledZ,ze.tileID.wrap,ze.tileID.canonical.z,ze.tileID.canonical.x,ze.tileID.canonical.y),this.tileZoom=ze.tileZoom,this.uid=ze.uid,this.zoom=ze.zoom,this.pixelRatio=ze.pixelRatio,this.tileSize=ze.tileSize,this.source=ze.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ze.showCollisionBoxes,this.collectResourceTiming=!!ze.collectResourceTiming,this.returnDependencies=!!ze.returnDependencies,this.promoteId=ze.promoteId,this.enableTerrain=!!ze.enableTerrain,this.isSymbolTile=ze.isSymbolTile}parse(ze,wt,Rt,Xt,sr){this.status="parsing",this.data=ze,this.collisionBoxArray=new Ys;const Dr=new Jh(Object.keys(ze.layers).sort()),Lr=new Ap(this.tileID,this.promoteId);Lr.bucketLayerIDs=[];const Ur={},qr=new Oh(256,256),ri={featureIndex:Lr,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:qr,availableImages:Rt},ai=wt.familiesBySource[this.source];for(const wt in ai){const Xt=ze.layers[wt];if(!Xt)continue;let sr=!1,qr=!1;for(const ze of ai[wt])"symbol"===ze[0].type?sr=!0:qr=!0;if(!0===this.isSymbolTile&&!sr)continue;if(!1===this.isSymbolTile&&!qr)continue;1===Xt.version&&B(`Vector tile source "${this.source}" layer "${wt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Yi=Dr.encode(wt),Ji=[];for(let ze=0;ze<Xt.length;ze++){const Rt=Xt.feature(ze),sr=Lr.getId(Rt,wt);Ji.push({feature:Rt,id:sr,index:ze,sourceLayerIndex:Yi})}for(const ze of ai[wt]){const wt=ze[0];void 0!==this.isSymbolTile&&"symbol"===wt.type!==this.isSymbolTile||wt.minzoom&&this.zoom<Math.floor(wt.minzoom)||wt.maxzoom&&this.zoom>=wt.maxzoom||"none"!==wt.visibility&&(Mp(ze,this.zoom,Rt),(Ur[wt.id]=wt.createBucket({index:Lr.bucketLayerIDs.length,layers:ze,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Yi,sourceID:this.source,enableTerrain:this.enableTerrain})).populate(Ji,ri,this.tileID.canonical),Lr.bucketLayerIDs.push(ze.map(ze=>ze.id)))}}let Yi,Ji,Qi,kn;qr.trim();const jn={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},Un=z(ri.glyphDependencies,ze=>Object.keys(ze).map(Number));Object.keys(Un).length?Xt.send("getGlyphs",{uid:this.uid,stacks:Un},(ze,wt)=>{Yi||(Yi=ze,Ji=wt,b.call(this))},void 0,!1,jn):Ji={};const Wn=Object.keys(ri.iconDependencies);Wn.length?Xt.send("getImages",{icons:Wn,source:this.source,tileID:this.tileID,type:"icons"},(ze,wt)=>{Yi||(Yi=ze,Qi=wt,b.call(this))},void 0,!1,jn):Qi={};const Yn=Object.keys(ri.patternDependencies);function b(){if(Yi)return sr(Yi);if(Ji&&Qi&&kn){const ze=new zp(Ji),wt=new nc(Qi,kn);for(const Xt in Ur){const sr=Ur[Xt];sr instanceof dh?(Mp(sr.layers,this.zoom,Rt),Jc(sr,Ji,ze.positions,Qi,wt.iconPositions,this.showCollisionBoxes,this.tileID.canonical,this.tileZoom)):sr.hasPattern&&(sr instanceof uu||sr instanceof Bl||sr instanceof Yl)&&(Mp(sr.layers,this.zoom,Rt),sr.addFeatures(ri,this.tileID.canonical,wt.patternPositions))}this.status="done",sr(null,{buckets:x(Ur).filter(ze=>!ze.isEmpty()),featureIndex:Lr,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ze.image,lineAtlas:qr,imageAtlas:wt,glyphMap:this.returnDependencies?Ji:null,iconMap:this.returnDependencies?Qi:null,glyphPositions:this.returnDependencies?ze.positions:null})}}Yn.length?Xt.send("getImages",{icons:Yn,source:this.source,tileID:this.tileID,type:"patterns"},(ze,wt)=>{Yi||(Yi=ze,kn=wt,b.call(this))},void 0,!1,jn):kn={},b.call(this)}}function Mp(ze,wt,Rt){const Xt=new as(wt);for(const wt of ze)wt.recalculate(Xt,Rt)}class Ep{constructor(ze){this.entries={},this.scheduler=ze}request(ze,wt,Rt,Xt){const sr=this.entries[ze]=this.entries[ze]||{callbacks:[]};if(sr.result){const[ze,Rt]=sr.result;return this.scheduler?this.scheduler.add(()=>{Xt(ze,Rt)},wt):Xt(ze,Rt),()=>{}}return sr.callbacks.push(Xt),sr.cancel||(sr.cancel=Rt((Rt,Xt)=>{sr.result=[Rt,Xt];for(const ze of sr.callbacks)this.scheduler?this.scheduler.add(()=>{ze(Rt,Xt)},wt):ze(Rt,Xt);setTimeout(()=>delete this.entries[ze],3e3)})),()=>{sr.result||(sr.callbacks=sr.callbacks.filter(ze=>ze!==Xt),sr.callbacks.length||(sr.cancel(),delete this.entries[ze]))}}}function Bp(ze,wt,Rt){const Xt=JSON.stringify(ze.request);return ze.data&&(this.deduped.entries[Xt]={result:[null,ze.data]}),this.deduped.request(Xt,{type:"parseTile",isSymbolTile:ze.isSymbolTile,zoom:ze.tileZoom},wt=>{const Xt=St(ze.request,(ze,Xt,sr,Dr)=>{ze?wt(ze):Xt&&wt(null,{vectorTile:Rt?void 0:new Qd.VectorTile(new Pp(Xt)),rawData:Xt,cacheControl:sr,expires:Dr})});return()=>{Xt.cancel(),wt()}},wt)}ze.ARRAY_TYPE=Md,ze.AUTH_ERR_MSG=oa,ze.Actor=class{constructor(ze,wt,Rt){this.target=ze,this.parent=wt,this.mapId=Rt,this.callbacks={},this.cancelCallbacks={},S(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=D()?ze:sr,this.scheduler=new Gh}send(ze,wt,Rt,Xt,sr=!1,Dr){const Lr=Math.round(1e18*Math.random()).toString(36).substring(0,10);Rt&&(Rt.metadata=Dr,this.callbacks[Lr]=Rt);const Ur=$(this.globalScope)?void 0:[];return this.target.postMessage({id:Lr,type:ze,hasCallback:!!Rt,targetMapId:Xt,mustQueue:sr,sourceMapId:this.mapId,data:ci(wt,Ur)},Ur),{cancel:()=>{Rt&&delete this.callbacks[Lr],this.target.postMessage({id:Lr,type:"<cancel>",targetMapId:Xt,sourceMapId:this.mapId})}}}receive(ze){const wt=ze.data,Rt=wt.id;if(Rt&&(!wt.targetMapId||this.mapId===wt.targetMapId))if("<cancel>"===wt.type){const ze=this.cancelCallbacks[Rt];delete this.cancelCallbacks[Rt],ze&&ze.cancel()}else if(wt.mustQueue||D()){const ze=this.callbacks[Rt];this.cancelCallbacks[Rt]=this.scheduler.add(()=>this.processTask(Rt,wt),ze&&ze.metadata||{type:"message"})}else this.processTask(Rt,wt)}processTask(ze,wt){if("<response>"===wt.type){const Rt=this.callbacks[ze];delete this.callbacks[ze],Rt&&(wt.error?Rt(hi(wt.error)):Rt(null,hi(wt.data)))}else{const Rt=$(this.globalScope)?void 0:[],Xt=wt.hasCallback?(wt,Xt)=>{delete this.cancelCallbacks[ze],this.target.postMessage({id:ze,type:"<response>",sourceMapId:this.mapId,error:wt?ci(wt):null,data:ci(Xt,Rt)},Rt)}:ze=>{},sr=hi(wt.data);if(this.parent[wt.type])this.parent[wt.type](wt.sourceMapId,sr,Xt);else if(this.parent.getWorkerSource){const ze=wt.type.split(".");this.parent.getWorkerSource(wt.sourceMapId,ze[0],sr.source)[ze[1]](sr,Xt)}else Xt(new Error(`Could not find function ${wt.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},ze.CanonicalTileID=Xh,ze.Color=ce,ze.ColorMode=mp,ze.CullFaceMode=vp,ze.DEMData=hp,ze.DataConstantProperty=ys,ze.DedupedRequest=Ep,ze.DepthMode=dp,ze.EXTENT=Ed,ze.Elevation=class{getAtPointOrZero(ze,wt=0){return this.getAtPoint(ze,wt)||0}getAtPoint(ze,wt,Rt=!0){null==wt&&(wt=null);const Xt=this._source();if(!Xt)return wt;if(ze.y<0||ze.y>1)return wt;const sr=Xt.getSource().maxzoom,Dr=1<<sr,Lr=Math.floor(ze.x),Ur=ze.x-Lr,qr=new Hh(sr,Lr,sr,Math.floor(Ur*Dr),Math.floor(ze.y*Dr)),ri=this.findDEMTileFor(qr);if(!ri||!ri.dem)return wt;const ai=ri.dem,Yi=1<<ri.tileID.canonical.z,Ji=(Ur*Yi-ri.tileID.canonical.x)*ai.dim,Qi=(ze.y*Yi-ri.tileID.canonical.y)*ai.dim,kn=Math.floor(Ji),jn=Math.floor(Qi);return(Rt?this.exaggeration():1)*rr(rr(ai.get(kn,jn),ai.get(kn,jn+1),Qi-jn),rr(ai.get(kn+1,jn),ai.get(kn+1,jn+1),Qi-jn),Ji-kn)}getAtTileOffset(ze,wt,Rt){const Xt=1<<ze.canonical.z;return this.getAtPointOrZero(new $h(ze.wrap+(ze.canonical.x+wt/Ed)/Xt,(ze.canonical.y+Rt/Ed)/Xt))}getForTilePoints(ze,wt,Rt,Xt){const sr=kp.create(this,ze,Xt);return!!sr&&(wt.forEach(ze=>{ze[2]=this.exaggeration()*sr.getElevationAt(ze[0],ze[1],Rt)}),!0)}getMinMaxForTile(ze){const wt=this.findDEMTileFor(ze);if(!wt||!wt.dem)return null;const Rt=wt.dem.tree,Xt=wt.tileID,sr=1<<ze.canonical.z-Xt.canonical.z;let Dr=ze.canonical.x/sr-Xt.canonical.x,Lr=ze.canonical.y/sr-Xt.canonical.y,Ur=0;for(let wt=0;wt<ze.canonical.z-Xt.canonical.z&&!Rt.leaves[Ur];wt++){Dr*=2,Lr*=2;const ze=2*Math.floor(Lr)+Math.floor(Dr);Ur=Rt.childOffsets[Ur]+ze,Dr%=1,Lr%=1}return{min:this.exaggeration()*Rt.minimums[Ur],max:this.exaggeration()*Rt.maximums[Ur]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(ze,wt,Rt){throw new Error("Pure virtual method called.")}pointCoordinate(ze){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(ze){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},ze.ErrorEvent=Lt,ze.EvaluationParameters=as,ze.Event=Vt,ze.Evented=Ft,ze.GlyphManager=Lc,ze.ImagePosition=rc,ze.LineAtlas=Oh,ze.LngLat=Ch,ze.LngLatBounds=Eh,ze.LocalGlyphMode=Vp,ze.MAX_SAFE_INTEGER=Dr,ze.MercatorCoordinate=$h,ze.ONE_EM=cp,ze.OverscaledTileID=Hh,ze.Properties=bs,ze.RGBAImage=No,ze.RequestManager=class{constructor(ze,wt,Rt){this._transformRequestFn=ze,this._customAccessToken=wt,this._silenceAuthErrors=!!Rt,this._createSkuToken()}_createSkuToken(){const ze=function(){let ze="";for(let wt=0;wt<10;wt++)ze+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",zo,ze].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=ze.token,this._skuTokenExpiresAt=ze.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(ze,wt){return this._transformRequestFn&&this._transformRequestFn(ze,wt)||{url:ze}}normalizeStyleURL(ze,wt){if(!Q(ze))return ze;const Rt=rt(ze);return Rt.path=`/styles/v1${Rt.path}`,this._makeAPIURL(Rt,this._customAccessToken||wt)}normalizeGlyphsURL(ze,wt){if(!Q(ze))return ze;const Rt=rt(ze);return Rt.path=`/fonts/v1${Rt.path}`,this._makeAPIURL(Rt,this._customAccessToken||wt)}normalizeSourceURL(ze,wt){if(!Q(ze))return ze;const Rt=rt(ze);return Rt.path=`/v4/${Rt.authority}.json`,Rt.params.push("secure"),this._makeAPIURL(Rt,this._customAccessToken||wt)}normalizeSpriteURL(ze,wt,Rt,Xt){const sr=rt(ze);return Q(ze)?(sr.path=`/styles/v1${sr.path}/sprite${wt}${Rt}`,this._makeAPIURL(sr,this._customAccessToken||Xt)):(sr.path+=`${wt}${Rt}`,nt(sr))}normalizeTileURL(ze,wt,Rt){if(this._isSkuTokenExpired()&&this._createSkuToken(),ze&&!Q(ze))return ze;const Xt=rt(ze);Xt.path=Xt.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${wt||Rt&&"raster"!==Xt.authority&&512===Rt?"@2x":""}${Jn.supported?".webp":"$1"}`),"raster"===Xt.authority?Xt.path=`/${Yn.RASTER_URL_PREFIX}${Xt.path}`:(Xt.path=Xt.path.replace(/^.+\/v4\//,"/"),Xt.path=`/${Yn.TILE_URL_VERSION}${Xt.path}`);const sr=this._customAccessToken||function(ze){for(const wt of ze){const ze=wt.match(/^access_token=(.*)$/);if(ze)return ze[1]}return null}(Xt.params)||Yn.ACCESS_TOKEN;return Yn.REQUIRE_ACCESS_TOKEN&&sr&&this._skuToken&&Xt.params.push(`sku=${this._skuToken}`),this._makeAPIURL(Xt,sr)}canonicalizeTileURL(ze,wt){const Rt=rt(ze);if(!Rt.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!Rt.path.match(/\.[\w]+$/))return ze;let Xt="mapbox://";Rt.path.match(/^\/raster\/v1\//)?Xt+=`raster/${Rt.path.replace(`/${Yn.RASTER_URL_PREFIX}/`,"")}`:Xt+=`tiles/${Rt.path.replace(`/${Yn.TILE_URL_VERSION}/`,"")}`;let sr=Rt.params;return wt&&(sr=sr.filter(ze=>!ze.match(/^access_token=/))),sr.length&&(Xt+=`?${sr.join("&")}`),Xt}canonicalizeTileset(ze,wt){const Rt=!!wt&&Q(wt),Xt=[];for(const wt of ze.tiles||[])tt(wt)?Xt.push(this.canonicalizeTileURL(wt,Rt)):Xt.push(wt);return Xt}_makeAPIURL(ze,wt){const Rt="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",Xt=rt(Yn.API_URL);if(ze.protocol=Xt.protocol,ze.authority=Xt.authority,"http"===ze.protocol){const wt=ze.params.indexOf("secure");wt>=0&&ze.params.splice(wt,1)}if("/"!==Xt.path&&(ze.path=`${Xt.path}${ze.path}`),!Yn.REQUIRE_ACCESS_TOKEN)return nt(ze);if(wt=wt||Yn.ACCESS_TOKEN,!this._silenceAuthErrors){if(!wt)throw new Error(`An API access token is required to use Mapbox GL. ${Rt}`);if("s"===wt[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${Rt}`)}return ze.params=ze.params.filter(ze=>-1===ze.indexOf("access_token")),ze.params.push(`access_token=${wt||""}`),nt(ze)}},ze.ResourceType=Ua,ze.SegmentVector=$a,ze.SourceCache=bp,ze.StencilMode=yp,ze.StructArrayLayout1ui2=Xs,ze.StructArrayLayout2f1f2i16=Rs,ze.StructArrayLayout2i4=zs,ze.StructArrayLayout2ui4=Zs,ze.StructArrayLayout3f12=Ds,ze.StructArrayLayout3ui6=$s,ze.StructArrayLayout4i8=Ts,ze.Texture=Mh,ze.Tile=tp,ze.Transitionable=us,ze.Uniform1f=xa,ze.Uniform1i=class extends ga{constructor(ze,wt){super(ze,wt),this.current=0}set(ze){this.current!==ze&&(this.current=ze,this.gl.uniform1i(this.location,ze))}},ze.Uniform2f=class extends ga{constructor(ze,wt){super(ze,wt),this.current=[0,0]}set(ze){ze[0]===this.current[0]&&ze[1]===this.current[1]||(this.current=ze,this.gl.uniform2f(this.location,ze[0],ze[1]))}},ze.Uniform3f=class extends ga{constructor(ze,wt){super(ze,wt),this.current=[0,0,0]}set(ze){ze[0]===this.current[0]&&ze[1]===this.current[1]&&ze[2]===this.current[2]||(this.current=ze,this.gl.uniform3f(this.location,ze[0],ze[1],ze[2]))}},ze.Uniform4f=va,ze.UniformColor=ba,ze.UniformMatrix3f=class extends ga{constructor(ze,wt){super(ze,wt),this.current=vd}set(ze){for(let wt=0;wt<9;wt++)if(ze[wt]!==this.current[wt]){this.current=ze,this.gl.uniformMatrix3fv(this.location,!1,ze);break}}},ze.UniformMatrix4f=class extends ga{constructor(ze,wt){super(ze,wt),this.current=bd}set(ze){if(ze[12]!==this.current[12]||ze[0]!==this.current[0])return this.current=ze,void this.gl.uniformMatrix4fv(this.location,!1,ze);for(let wt=1;wt<16;wt++)if(ze[wt]!==this.current[wt]){this.current=ze,this.gl.uniformMatrix4fv(this.location,!1,ze);break}}},ze.UnwrappedTileID=Kh,ze.ValidationError=Ut,ze.VectorTileWorkerSource=class extends Ft{constructor(ze,wt,Rt,Xt,sr){super(),this.actor=ze,this.layerIndex=wt,this.availableImages=Rt,this.loadVectorData=sr||Bp,this.loading={},this.loaded={},this.deduped=new Ep(ze.scheduler),this.isSpriteLoaded=Xt,this.scheduler=ze.scheduler}loadTile(ze,wt){const Rt=ze.uid,Xt=ze&&ze.request,sr=Xt&&Xt.collectResourceTiming,Dr=this.loading[Rt]=new Tp(ze);Dr.abort=this.loadVectorData(ze,(Lr,Ur)=>{const qr=!this.loading[Rt];if(delete this.loading[Rt],qr||Lr||!Ur)return Dr.status="done",qr||(this.loaded[Rt]=Dr),wt(Lr);const ri=Ur.rawData,ai={};Ur.expires&&(ai.expires=Ur.expires),Ur.cacheControl&&(ai.cacheControl=Ur.cacheControl),Dr.vectorTile=Ur.vectorTile||new Qd.VectorTile(new Pp(ri));const h=()=>{Dr.parse(Dr.vectorTile,this.layerIndex,this.availableImages,this.actor,(ze,Rt)=>{if(ze||!Rt)return wt(ze);const Dr={};if(sr){const ze=jh(Xt);ze.length>0&&(Dr.resourceTiming=JSON.parse(JSON.stringify(ze)))}wt(null,v({rawTileData:ri.slice(0)},Rt,ai,Dr))})};this.isSpriteLoaded?h():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(h,{type:"parseTile",isSymbolTile:ze.isSymbolTile,zoom:ze.tileZoom}):h()}),this.loaded=this.loaded||{},this.loaded[Rt]=Dr})}reloadTile(ze,wt){const Rt=this.loaded,Xt=ze.uid,sr=this;if(Rt&&Rt[Xt]){const Dr=Rt[Xt];Dr.showCollisionBoxes=ze.showCollisionBoxes,Dr.enableTerrain=!!ze.enableTerrain;const a=(ze,Rt)=>{const Xt=Dr.reloadCallback;Xt&&(delete Dr.reloadCallback,Dr.parse(Dr.vectorTile,sr.layerIndex,this.availableImages,sr.actor,Xt)),wt(ze,Rt)};"parsing"===Dr.status?Dr.reloadCallback=a:"done"===Dr.status&&(Dr.vectorTile?Dr.parse(Dr.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(ze,wt){const Rt=ze.uid,Xt=this.loading[Rt];Xt&&(Xt.abort&&Xt.abort(),delete this.loading[Rt]),wt()}removeTile(ze,wt){const Rt=this.loaded,Xt=ze.uid;Rt&&Rt[Xt]&&delete Rt[Xt],wt()}},ze.WritingMode=Lp,ze.ZoomHistory=pi,ze.add=function(ze,wt,Rt){return ze[0]=wt[0]+Rt[0],ze[1]=wt[1]+Rt[1],ze[2]=wt[2]+Rt[2],ze},ze.addDynamicAttributes=uh,ze.altitudeFromMercatorZ=Uh,ze.asyncAll=g,ze.bezier=d,ze.bindAll=S,ze.bufferConvexPolygon=function(ze,wt){const Rt=[];for(let Xt=0;Xt<ze.length;Xt++){const sr=m(Xt-1,-1,ze.length-1),Dr=m(Xt+1,-1,ze.length-1),Lr=ze[Xt],Ur=ze[Dr],qr=ze[sr].sub(Lr).unit(),ri=Ur.sub(Lr).unit(),ai=ri.angleWithSep(qr.x,qr.y),Yi=qr.add(ri).unit().mult(-1*wt/Math.sin(ai/2));Rt.push(Lr.add(Yi))}return Rt},ze.cacheEntryPossiblyAdded=function(ze){Ba++,Ba>Na&&(ze.getActor().send("enforceCacheSizeLimit",Ra),Ba=0)},ze.clamp=y,ze.clearTileCache=function(ze){const wt=sr.caches.delete(Oa);ze&&wt.catch(ze).then(()=>ze())},ze.clipLine=Tc,ze.clone=function(ze){var wt=new Md(3);return wt[0]=ze[0],wt[1]=ze[1],wt[2]=ze[2],wt},ze.clone$1=function(ze){var wt=new Md(16);return wt[0]=ze[0],wt[1]=ze[1],wt[2]=ze[2],wt[3]=ze[3],wt[4]=ze[4],wt[5]=ze[5],wt[6]=ze[6],wt[7]=ze[7],wt[8]=ze[8],wt[9]=ze[9],wt[10]=ze[10],wt[11]=ze[11],wt[12]=ze[12],wt[13]=ze[13],wt[14]=ze[14],wt[15]=ze[15],wt},ze.clone$2=M,ze.collisionCircleLayout=Qh,ze.config=Yn,ze.conjugate=function(ze,wt){return ze[0]=-wt[0],ze[1]=-wt[1],ze[2]=-wt[2],ze[3]=wt[3],ze},ze.copy=function(ze,wt){return ze[0]=wt[0],ze[1]=wt[1],ze[2]=wt[2],ze},ze.create=xo,ze.create$1=function(){var ze=new Md(16);return Md!=Float32Array&&(ze[1]=0,ze[2]=0,ze[3]=0,ze[4]=0,ze[6]=0,ze[7]=0,ze[8]=0,ze[9]=0,ze[11]=0,ze[12]=0,ze[13]=0,ze[14]=0),ze[0]=1,ze[5]=1,ze[10]=1,ze[15]=1,ze},ze.create$2=fo,ze.createExpression=cn,ze.createFilter=An,ze.createLayout=Ss,ze.createStyleLayer=function(ze){return"custom"===ze.type?new bh(ze):new Qp[ze.type](ze)},ze.cross=function(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=Rt[0],Ur=Rt[1],qr=Rt[2];return ze[0]=sr*qr-Dr*Ur,ze[1]=Dr*Lr-Xt*qr,ze[2]=Xt*Ur-sr*Lr,ze},ze.degToRad=c,ze.div=function(ze,wt,Rt){return ze[0]=wt[0]/Rt[0],ze[1]=wt[1]/Rt[1],ze[2]=wt[2]/Rt[2],ze},ze.dot=function(ze,wt){return ze[0]*wt[0]+ze[1]*wt[1]+ze[2]*wt[2]},ze.dot$1=function(ze,wt){return ze[0]*wt[0]+ze[1]*wt[1]+ze[2]*wt[2]+ze[3]*wt[3]},ze.ease=ri,ze.easeCubicInOut=p,ze.emitValidationErrors=ei,ze.endsWith=I,ze.enforceCacheSizeLimit=function(ze){xt(),Da&&Da.then(wt=>{wt.keys().then(Rt=>{for(let Xt=0;Xt<Rt.length-ze;Xt++)wt.delete(Rt[Xt])})})},ze.evaluateSizeForFeature=ku,ze.evaluateSizeForZoom=Au,ze.evaluateVariableOffset=Yc,ze.evented=ud,ze.exactEquals=function(ze,wt){return ze[0]===wt[0]&&ze[1]===wt[1]&&ze[2]===wt[2]&&ze[3]===wt[3]},ze.exactEquals$1=function(ze,wt){return ze[0]===wt[0]&&ze[1]===wt[1]&&ze[2]===wt[2]},ze.exported=Un,ze.exported$1=Jn,ze.extend=v,ze.filterObject=T,ze.fromMat4=function(ze,wt){return ze[0]=wt[0],ze[1]=wt[1],ze[2]=wt[2],ze[3]=wt[4],ze[4]=wt[5],ze[5]=wt[6],ze[6]=wt[8],ze[7]=wt[9],ze[8]=wt[10],ze},ze.fromQuat=function(ze,wt){var Rt=wt[0],Xt=wt[1],sr=wt[2],Dr=wt[3],Lr=Rt+Rt,Ur=Xt+Xt,qr=sr+sr,ri=Rt*Lr,ai=Xt*Lr,Yi=Xt*Ur,Ji=sr*Lr,Qi=sr*Ur,kn=sr*qr,jn=Dr*Lr,Un=Dr*Ur,Wn=Dr*qr;return ze[0]=1-Yi-kn,ze[1]=ai+Wn,ze[2]=Ji-Un,ze[3]=0,ze[4]=ai-Wn,ze[5]=1-ri-kn,ze[6]=Qi+jn,ze[7]=0,ze[8]=Ji+Un,ze[9]=Qi-jn,ze[10]=1-ri-Yi,ze[11]=0,ze[12]=0,ze[13]=0,ze[14]=0,ze[15]=1,ze},ze.fromRotation=function(ze,wt){var Rt=Math.sin(wt),Xt=Math.cos(wt);return ze[0]=Xt,ze[1]=Rt,ze[2]=0,ze[3]=-Rt,ze[4]=Xt,ze[5]=0,ze[6]=0,ze[7]=0,ze[8]=1,ze},ze.fromScaling=function(ze,wt){return ze[0]=wt[0],ze[1]=0,ze[2]=0,ze[3]=0,ze[4]=0,ze[5]=wt[1],ze[6]=0,ze[7]=0,ze[8]=0,ze[9]=0,ze[10]=wt[2],ze[11]=0,ze[12]=0,ze[13]=0,ze[14]=0,ze[15]=1,ze},ze.furthestTileCorner=function(ze){const wt=Math.round((ze+45+360)%360/90)%4;return qr[wt]},ze.getAABBPointSquareDist=function(ze,wt,Rt){let Xt=0;for(let sr=0;sr<2;++sr){const Dr=Rt?Rt[sr]:0;ze[sr]>Dr&&(Xt+=(ze[sr]-Dr)*(ze[sr]-Dr)),wt[sr]<Dr&&(Xt+=(Dr-wt[sr])*(Dr-wt[sr]))}return Xt},ze.getAnchorAlignment=mc,ze.getAnchorJustification=Wc,ze.getBounds=function(ze){let wt=1/0,Rt=1/0,sr=-1/0,Dr=-1/0;for(const Xt of ze)wt=Math.min(wt,Xt.x),Rt=Math.min(Rt,Xt.y),sr=Math.max(sr,Xt.x),Dr=Math.max(Dr,Xt.y);return{min:new Xt(wt,Rt),max:new Xt(sr,Dr)}},ze.getImage=Ct,ze.getJSON=function(ze,wt){return At(v(ze,{type:"json"}),wt)},ze.getMapSessionAPI=wa,ze.getPerformanceMeasurement=jh,ze.getRTLTextPluginStatus=ns,ze.getReferrer=qa,ze.getVideo=function(ze,wt){const Rt=sr.document.createElement("video");Rt.muted=!0,Rt.onloadstart=function(){wt(null,Rt)};for(let wt=0;wt<ze.length;wt++){const Xt=sr.document.createElement("source");Tt(ze[wt])||(Rt.crossOrigin="Anonymous"),Xt.src=ze[wt],Rt.appendChild(Xt)}return{cancel:()=>{}}},ze.identity=yo,ze.identity$1=Co,ze.invert=function(ze,wt){var Rt=wt[0],Xt=wt[1],sr=wt[2],Dr=wt[3],Lr=wt[4],Ur=wt[5],qr=wt[6],ri=wt[7],ai=wt[8],Yi=wt[9],Ji=wt[10],Qi=wt[11],kn=wt[12],jn=wt[13],Un=wt[14],Wn=wt[15],Yn=Rt*Ur-Xt*Lr,Jn=Rt*qr-sr*Lr,Qn=Rt*ri-Dr*Lr,Io=Xt*qr-sr*Ur,Mo=Xt*ri-Dr*Ur,jo=sr*ri-Dr*qr,zo=ai*jn-Yi*kn,oa=ai*Un-Ji*kn,la=ai*Wn-Qi*kn,ca=Yi*Un-Ji*jn,ua=Yi*Wn-Qi*jn,ha=Ji*Wn-Qi*Un,pa=Yn*ha-Jn*ua+Qn*ca+Io*la-Mo*oa+jo*zo;return pa?(ze[0]=(Ur*ha-qr*ua+ri*ca)*(pa=1/pa),ze[1]=(sr*ua-Xt*ha-Dr*ca)*pa,ze[2]=(jn*jo-Un*Mo+Wn*Io)*pa,ze[3]=(Ji*Mo-Yi*jo-Qi*Io)*pa,ze[4]=(qr*la-Lr*ha-ri*oa)*pa,ze[5]=(Rt*ha-sr*la+Dr*oa)*pa,ze[6]=(Un*Qn-kn*jo-Wn*Jn)*pa,ze[7]=(ai*jo-Ji*Qn+Qi*Jn)*pa,ze[8]=(Lr*ua-Ur*la+ri*zo)*pa,ze[9]=(Xt*la-Rt*ua-Dr*zo)*pa,ze[10]=(kn*Mo-jn*Qn+Wn*Yn)*pa,ze[11]=(Yi*Qn-ai*Mo-Qi*Yn)*pa,ze[12]=(Ur*oa-Lr*ca-qr*zo)*pa,ze[13]=(Rt*ca-Xt*oa+sr*zo)*pa,ze[14]=(jn*Jn-kn*Io-Un*Yn)*pa,ze[15]=(ai*Io-Yi*Jn+Ji*Yn)*pa,ze):null},ze.isMapAuthenticated=function(ze){return Pa.has(ze)},ze.isMapboxURL=Q,ze.latFromMercatorY=Rh,ze.len=Rd,ze.length=vo,ze.length$1=function(ze){return Math.hypot(ze[0],ze[1],ze[2],ze[3])},ze.loadVectorTile=Bp,ze.makeRequest=At,ze.mercatorXfromLng=Vh,ze.mercatorYfromLat=Lh,ze.mercatorZfromAltitude=Fh,ze.mul=function(ze,wt,Rt){return ze[0]=wt[0]*Rt[0],ze[1]=wt[1]*Rt[1],ze[2]=wt[2]*Rt[2],ze[3]=wt[3]*Rt[3],ze},ze.mul$1=Dd,ze.mul$2=zd,ze.multiply=mo,ze.multiply$1=_o,ze.nextPowerOfTwo=k,ze.normalize=Ao,ze.normalize$1=function(ze,wt){var Rt=wt[0],Xt=wt[1],sr=wt[2],Dr=wt[3],Lr=Rt*Rt+Xt*Xt+sr*sr+Dr*Dr;return Lr>0&&(Lr=1/Math.sqrt(Lr)),ze[0]=Rt*Lr,ze[1]=Xt*Lr,ze[2]=sr*Lr,ze[3]=Dr*Lr,ze},ze.number=rr,ze.ortho=function(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur=1/(wt-Rt),qr=1/(Xt-sr),ri=1/(Dr-Lr);return ze[0]=-2*Ur,ze[1]=0,ze[2]=0,ze[3]=0,ze[4]=0,ze[5]=-2*qr,ze[6]=0,ze[7]=0,ze[8]=0,ze[9]=0,ze[10]=2*ri,ze[11]=0,ze[12]=(wt+Rt)*Ur,ze[13]=(sr+Xt)*qr,ze[14]=(Lr+Dr)*ri,ze[15]=1,ze},ze.pbf=Pp,ze.perspective=function(ze,wt,Rt,Xt,sr){var Dr,Lr=1/Math.tan(wt/2);return ze[0]=Lr/Rt,ze[1]=0,ze[2]=0,ze[3]=0,ze[4]=0,ze[5]=Lr,ze[6]=0,ze[7]=0,ze[8]=0,ze[9]=0,ze[11]=-1,ze[12]=0,ze[13]=0,ze[15]=0,null!=sr&&sr!==1/0?(ze[10]=(sr+Xt)*(Dr=1/(Xt-sr)),ze[14]=2*sr*Xt*Dr):(ze[10]=-1,ze[14]=-2*Xt),ze},ze.pick=function(ze,wt){const Rt={};for(let Xt=0;Xt<wt.length;Xt++){const sr=wt[Xt];sr in ze&&(Rt[sr]=ze[sr])}return Rt},ze.plugin=dd,ze.pointGeometry=Xt,ze.polygonIntersectsBox=io,ze.polygonIntersectsPolygon=Ka,ze.polygonizeBounds=function(ze,wt,Rt=0,sr=!0){const Dr=new Xt(Rt,Rt),Lr=ze.sub(Dr),Ur=wt.add(Dr),qr=[Lr,new Xt(Ur.x,Lr.y),Ur,new Xt(Lr.x,Ur.y)];return sr&&qr.push(Lr),qr},ze.posAttributes=cf,ze.postMapLoadEvent=pa,ze.postTurnstileEvent=ua,ze.potpack=ec,ze.prevPowerOfTwo=function(ze){return ze<=1?1:Math.pow(2,Math.floor(Math.log(ze)/Math.LN2))},ze.radToDeg=function(ze){return ze*Ur},ze.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],ze.registerForPluginStateChange=function(ze){return ze({pluginStatus:ld,pluginURL:cd}),ud.on("pluginStateChange",ze),ze},ze.removeAuthState=function(ze){Pa.delete(ze)},ze.renderColorRamp=Go,ze.rotateX=function(ze,wt,Rt){var Xt=Math.sin(Rt),sr=Math.cos(Rt),Dr=wt[4],Lr=wt[5],Ur=wt[6],qr=wt[7],ri=wt[8],ai=wt[9],Yi=wt[10],Ji=wt[11];return wt!==ze&&(ze[0]=wt[0],ze[1]=wt[1],ze[2]=wt[2],ze[3]=wt[3],ze[12]=wt[12],ze[13]=wt[13],ze[14]=wt[14],ze[15]=wt[15]),ze[4]=Dr*sr+ri*Xt,ze[5]=Lr*sr+ai*Xt,ze[6]=Ur*sr+Yi*Xt,ze[7]=qr*sr+Ji*Xt,ze[8]=ri*sr-Dr*Xt,ze[9]=ai*sr-Lr*Xt,ze[10]=Yi*sr-Ur*Xt,ze[11]=Ji*sr-qr*Xt,ze},ze.rotateX$1=Po,ze.rotateY=function(ze,wt,Rt){var Xt=Math.sin(Rt),sr=Math.cos(Rt),Dr=wt[0],Lr=wt[1],Ur=wt[2],qr=wt[3],ri=wt[8],ai=wt[9],Yi=wt[10],Ji=wt[11];return wt!==ze&&(ze[4]=wt[4],ze[5]=wt[5],ze[6]=wt[6],ze[7]=wt[7],ze[12]=wt[12],ze[13]=wt[13],ze[14]=wt[14],ze[15]=wt[15]),ze[0]=Dr*sr-ri*Xt,ze[1]=Lr*sr-ai*Xt,ze[2]=Ur*sr-Yi*Xt,ze[3]=qr*sr-Ji*Xt,ze[8]=Dr*Xt+ri*sr,ze[9]=Lr*Xt+ai*sr,ze[10]=Ur*Xt+Yi*sr,ze[11]=qr*Xt+Ji*sr,ze},ze.rotateZ=function(ze,wt,Rt){var Xt=Math.sin(Rt),sr=Math.cos(Rt),Dr=wt[0],Lr=wt[1],Ur=wt[2],qr=wt[3],ri=wt[4],ai=wt[5],Yi=wt[6],Ji=wt[7];return wt!==ze&&(ze[8]=wt[8],ze[9]=wt[9],ze[10]=wt[10],ze[11]=wt[11],ze[12]=wt[12],ze[13]=wt[13],ze[14]=wt[14],ze[15]=wt[15]),ze[0]=Dr*sr+ri*Xt,ze[1]=Lr*sr+ai*Xt,ze[2]=Ur*sr+Yi*Xt,ze[3]=qr*sr+Ji*Xt,ze[4]=ri*sr-Dr*Xt,ze[5]=ai*sr-Lr*Xt,ze[6]=Yi*sr-Ur*Xt,ze[7]=Ji*sr-qr*Xt,ze},ze.rotateZ$1=function(ze,wt,Rt){Rt*=.5;var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=Math.sin(Rt),qr=Math.cos(Rt);return ze[0]=Xt*qr+sr*Ur,ze[1]=sr*qr-Xt*Ur,ze[2]=Dr*qr+Lr*Ur,ze[3]=Lr*qr-Dr*Ur,ze},ze.scale=function(ze,wt,Rt){return ze[0]=wt[0]*Rt,ze[1]=wt[1]*Rt,ze[2]=wt[2]*Rt,ze},ze.scale$1=function(ze,wt,Rt){var Xt=Rt[0],sr=Rt[1],Dr=Rt[2];return ze[0]=wt[0]*Xt,ze[1]=wt[1]*Xt,ze[2]=wt[2]*Xt,ze[3]=wt[3]*Xt,ze[4]=wt[4]*sr,ze[5]=wt[5]*sr,ze[6]=wt[6]*sr,ze[7]=wt[7]*sr,ze[8]=wt[8]*Dr,ze[9]=wt[9]*Dr,ze[10]=wt[10]*Dr,ze[11]=wt[11]*Dr,ze[12]=wt[12],ze[13]=wt[13],ze[14]=wt[14],ze[15]=wt[15],ze},ze.scale$2=function(ze,wt,Rt){return ze[0]=wt[0]*Rt,ze[1]=wt[1]*Rt,ze[2]=wt[2]*Rt,ze[3]=wt[3]*Rt,ze},ze.scaleAndAdd=ko,ze.setCacheLimits=function(ze,wt){Ra=ze,Na=wt},ze.setRTLTextPlugin=function(ze,wt,Rt=!1){if(ld===nd||ld===od||ld===ad)throw new Error("setRTLTextPlugin cannot be called multiple times.");cd=Un.resolveURL(ze),ld=nd,sd=wt,es(),Rt||is()},ze.smoothstep=function(ze,wt,Rt){return(Rt=y((Rt-ze)/(wt-ze),0,1))*Rt*(3-2*Rt)},ze.spec=Pl,ze.storeAuthState=function(ze,wt){wt?Pa.add(ze):Pa.delete(ze)},ze.sub=jd,ze.subtract=wo,ze.symbolSize=gp,ze.transformMat3=function(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2];return ze[0]=Xt*Rt[0]+sr*Rt[3]+Dr*Rt[6],ze[1]=Xt*Rt[1]+sr*Rt[4]+Dr*Rt[7],ze[2]=Xt*Rt[2]+sr*Rt[5]+Dr*Rt[8],ze},ze.transformMat4=Eo,ze.transformMat4$1=function(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=Rt[3]*Xt+Rt[7]*sr+Rt[11]*Dr+Rt[15];return ze[0]=(Rt[0]*Xt+Rt[4]*sr+Rt[8]*Dr+Rt[12])/(Lr=Lr||1),ze[1]=(Rt[1]*Xt+Rt[5]*sr+Rt[9]*Dr+Rt[13])/Lr,ze[2]=(Rt[2]*Xt+Rt[6]*sr+Rt[10]*Dr+Rt[14])/Lr,ze},ze.transformQuat=So,ze.translate=function(ze,wt,Rt){var Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn=Rt[0],Un=Rt[1],Wn=Rt[2];return wt===ze?(ze[12]=wt[0]*jn+wt[4]*Un+wt[8]*Wn+wt[12],ze[13]=wt[1]*jn+wt[5]*Un+wt[9]*Wn+wt[13],ze[14]=wt[2]*jn+wt[6]*Un+wt[10]*Wn+wt[14],ze[15]=wt[3]*jn+wt[7]*Un+wt[11]*Wn+wt[15]):(sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=wt[4],qr=wt[5],ri=wt[6],ai=wt[7],Yi=wt[8],Ji=wt[9],Qi=wt[10],kn=wt[11],ze[0]=Xt=wt[0],ze[1]=sr,ze[2]=Dr,ze[3]=Lr,ze[4]=Ur,ze[5]=qr,ze[6]=ri,ze[7]=ai,ze[8]=Yi,ze[9]=Ji,ze[10]=Qi,ze[11]=kn,ze[12]=Xt*jn+Ur*Un+Yi*Wn+wt[12],ze[13]=sr*jn+qr*Un+Ji*Wn+wt[13],ze[14]=Dr*jn+ri*Un+Qi*Wn+wt[14],ze[15]=Lr*jn+ai*Un+kn*Wn+wt[15]),ze},ze.triggerPluginCompletionEvent=ts,ze.uniqueId=w,ze.validateCustomStyleLayer=function(ze){const wt=[],Rt=ze.id;return void 0===Rt&&wt.push({message:`layers.${Rt}: missing required property "id"`}),void 0===ze.render&&wt.push({message:`layers.${Rt}: missing required method "render"`}),ze.renderingMode&&"2d"!==ze.renderingMode&&"3d"!==ze.renderingMode&&wt.push({message:`layers.${Rt}: property "renderingMode" must be either "2d" or "3d"`}),wt},ze.validateFog=Lu,ze.validateLight=Du,ze.validateStyle=Cu,ze.values=x,ze.vectorTile=Qd,ze.version=wt,ze.warnOnce=B,ze.window=sr,ze.wrap=m}),define(["./shared"],function(ze){function t(ze){const wt=typeof ze;if("number"===wt||"boolean"===wt||"string"===wt||null==ze)return JSON.stringify(ze);if(Array.isArray(ze)){let wt="[";for(const Rt of ze)wt+=`${t(Rt)},`;return`${wt}]`}const Rt=Object.keys(ze).sort();let Xt="{";for(let wt=0;wt<Rt.length;wt++)Xt+=`${JSON.stringify(Rt[wt])}:${t(ze[Rt[wt]])},`;return`${Xt}}`}function r(wt){let Rt="";for(const Xt of ze.refProperties)Rt+=`/${t(wt[Xt])}`;return Rt}class o{constructor(ze){this.keyCache={},ze&&this.replace(ze)}replace(ze){this._layerConfigs={},this._layers={},this.update(ze,[])}update(wt,Rt){for(const Rt of wt){this._layerConfigs[Rt.id]=Rt;const wt=this._layers[Rt.id]=ze.createStyleLayer(Rt);wt._featureFilter=ze.createFilter(wt.filter),this.keyCache[Rt.id]&&delete this.keyCache[Rt.id]}for(const ze of Rt)delete this.keyCache[ze],delete this._layerConfigs[ze],delete this._layers[ze];this.familiesBySource={};const Xt=function(ze,wt){const Rt={};for(let Xt=0;Xt<ze.length;Xt++){const sr=wt&&wt[ze[Xt].id]||r(ze[Xt]);wt&&(wt[ze[Xt].id]=sr);let Dr=Rt[sr];Dr||(Dr=Rt[sr]=[]),Dr.push(ze[Xt])}const Xt=[];for(const ze in Rt)Xt.push(Rt[ze]);return Xt}(ze.values(this._layerConfigs),this.keyCache);for(const ze of Xt){const wt=ze.map(ze=>this._layers[ze.id]),Rt=wt[0];if("none"===Rt.visibility)continue;const Xt=Rt.source||"";let sr=this.familiesBySource[Xt];sr||(sr=this.familiesBySource[Xt]={});const Dr=Rt.sourceLayer||"_geojsonTileLayer";let Lr=sr[Dr];Lr||(Lr=sr[Dr]=[]),Lr.push(wt)}}}const{ImageBitmap:wt}=ze.window;class i{loadTile(Rt,Xt){const{uid:sr,encoding:Dr,rawImageData:Lr,padding:Ur,buildQuadTree:qr}=Rt,ri=wt&&Lr instanceof wt?this.getImageData(Lr,Ur):Lr;Xt(null,new ze.DEMData(sr,ri,Dr,Ur<1,qr))}getImageData(wt,Rt){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(wt.width,wt.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=wt.width,this.offscreenCanvas.height=wt.height,this.offscreenCanvasContext.drawImage(wt,0,0,wt.width,wt.height);const Xt=this.offscreenCanvasContext.getImageData(-Rt,-Rt,wt.width+2*Rt,wt.height+2*Rt);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new ze.RGBAImage({width:Xt.width,height:Xt.height},Xt.data)}}var Rt=function e(ze,wt){var Rt,Xt=ze&&ze.type;if("FeatureCollection"===Xt)for(Rt=0;Rt<ze.features.length;Rt++)e(ze.features[Rt],wt);else if("GeometryCollection"===Xt)for(Rt=0;Rt<ze.geometries.length;Rt++)e(ze.geometries[Rt],wt);else if("Feature"===Xt)e(ze.geometry,wt);else if("Polygon"===Xt)a(ze.coordinates,wt);else if("MultiPolygon"===Xt)for(Rt=0;Rt<ze.coordinates.length;Rt++)a(ze.coordinates[Rt],wt);return ze};function a(ze,wt){if(0!==ze.length){l(ze[0],wt);for(var Rt=1;Rt<ze.length;Rt++)l(ze[Rt],!wt)}}function l(ze,wt){for(var Rt=0,Xt=0,sr=ze.length,Dr=sr-1;Xt<sr;Dr=Xt++)Rt+=(ze[Xt][0]-ze[Dr][0])*(ze[Dr][1]+ze[Xt][1]);Rt>=0!=!!wt&&ze.reverse()}const Xt=ze.vectorTile.VectorTileFeature.prototype.toGeoJSON;class h{constructor(wt){this._feature=wt,this.extent=ze.EXTENT,this.type=wt.type,this.properties=wt.tags,"id"in wt&&!isNaN(wt.id)&&(this.id=parseInt(wt.id,10))}loadGeometry(){if(1===this._feature.type){const wt=[];for(const Rt of this._feature.geometry)wt.push([new ze.pointGeometry(Rt[0],Rt[1])]);return wt}{const wt=[];for(const Rt of this._feature.geometry){const Xt=[];for(const wt of Rt)Xt.push(new ze.pointGeometry(wt[0],wt[1]));wt.push(Xt)}return wt}}toGeoJSON(ze,wt,Rt){return Xt.call(this,ze,wt,Rt)}}class c{constructor(wt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=ze.EXTENT,this.length=wt.length,this._features=wt}feature(ze){return new h(this._features[ze])}}var sr=ze.vectorTile.VectorTileFeature,Dr=g;function g(ze,wt){this.options=wt||{},this.features=ze,this.length=ze.length}function d(ze,wt){this.id="number"==typeof ze.id?ze.id:void 0,this.type=ze.type,this.rawGeometry=1===ze.type?[ze.geometry]:ze.geometry,this.properties=ze.tags,this.extent=wt||4096}g.prototype.feature=function(ze){return new d(this.features[ze],this.options.extent)},d.prototype.loadGeometry=function(){var wt=this.rawGeometry;this.geometry=[];for(var Rt=0;Rt<wt.length;Rt++){for(var Xt=wt[Rt],sr=[],Dr=0;Dr<Xt.length;Dr++)sr.push(new ze.pointGeometry(Xt[Dr][0],Xt[Dr][1]));this.geometry.push(sr)}return this.geometry},d.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var ze=this.geometry,wt=1/0,Rt=-1/0,Xt=1/0,sr=-1/0,Dr=0;Dr<ze.length;Dr++)for(var Lr=ze[Dr],Ur=0;Ur<Lr.length;Ur++){var qr=Lr[Ur];wt=Math.min(wt,qr.x),Rt=Math.max(Rt,qr.x),Xt=Math.min(Xt,qr.y),sr=Math.max(sr,qr.y)}return[wt,Xt,Rt,sr]},d.prototype.toGeoJSON=sr.prototype.toGeoJSON;var Lr=v,Ur=Dr;function v(wt){var Rt=new ze.pbf;return function(ze,wt){for(var Rt in ze.layers)wt.writeMessage(3,x,ze.layers[Rt])}(wt,Rt),Rt.finish()}function x(ze,wt){var Rt;wt.writeVarintField(15,ze.version||1),wt.writeStringField(1,ze.name||""),wt.writeVarintField(5,ze.extent||4096);var Xt={keys:[],values:[],keycache:{},valuecache:{}};for(Rt=0;Rt<ze.length;Rt++)Xt.feature=ze.feature(Rt),wt.writeMessage(2,w,Xt);var sr=Xt.keys;for(Rt=0;Rt<sr.length;Rt++)wt.writeStringField(3,sr[Rt]);var Dr=Xt.values;for(Rt=0;Rt<Dr.length;Rt++)wt.writeMessage(4,T,Dr[Rt])}function w(ze,wt){var Rt=ze.feature;void 0!==Rt.id&&wt.writeVarintField(1,Rt.id),wt.writeMessage(2,S,ze),wt.writeVarintField(3,Rt.type),wt.writeMessage(4,b,Rt)}function S(ze,wt){var Rt=ze.feature,Xt=ze.keys,sr=ze.values,Dr=ze.keycache,Lr=ze.valuecache;for(var Ur in Rt.properties){var qr=Dr[Ur];void 0===qr&&(Xt.push(Ur),Dr[Ur]=qr=Xt.length-1),wt.writeVarint(qr);var ri=Rt.properties[Ur],ai=typeof ri;"string"!==ai&&"boolean"!==ai&&"number"!==ai&&(ri=JSON.stringify(ri));var Yi=ai+":"+ri,Ji=Lr[Yi];void 0===Ji&&(sr.push(ri),Lr[Yi]=Ji=sr.length-1),wt.writeVarint(Ji)}}function M(ze,wt){return(wt<<3)+(7&ze)}function P(ze){return ze<<1^ze>>31}function b(ze,wt){for(var Rt=ze.loadGeometry(),Xt=ze.type,sr=0,Dr=0,Lr=Rt.length,Ur=0;Ur<Lr;Ur++){var qr=Rt[Ur],ri=1;1===Xt&&(ri=qr.length),wt.writeVarint(M(1,ri));for(var ai=3===Xt?qr.length-1:qr.length,Yi=0;Yi<ai;Yi++){1===Yi&&1!==Xt&&wt.writeVarint(M(2,ai-1));var Ji=qr[Yi].x-sr,Qi=qr[Yi].y-Dr;wt.writeVarint(P(Ji)),wt.writeVarint(P(Qi)),sr+=Ji,Dr+=Qi}3===Xt&&wt.writeVarint(M(7,1))}}function T(ze,wt){var Rt=typeof ze;"string"===Rt?wt.writeStringField(1,ze):"boolean"===Rt?wt.writeBooleanField(7,ze):"number"===Rt&&(ze%1!=0?wt.writeDoubleField(3,ze):ze<0?wt.writeSVarintField(6,ze):wt.writeVarintField(5,ze))}function k(ze,wt,Rt,Xt,sr,Dr){if(sr-Xt<=Rt)return;const Lr=Xt+sr>>1;I(ze,wt,Lr,Xt,sr,Dr%2),k(ze,wt,Rt,Xt,Lr-1,Dr+1),k(ze,wt,Rt,Lr+1,sr,Dr+1)}function I(ze,wt,Rt,Xt,sr,Dr){for(;sr>Xt;){if(sr-Xt>600){const Lr=sr-Xt+1,Ur=Rt-Xt+1,qr=Math.log(Lr),ri=.5*Math.exp(2*qr/3),ai=.5*Math.sqrt(qr*ri*(Lr-ri)/Lr)*(Ur-Lr/2<0?-1:1);I(ze,wt,Rt,Math.max(Xt,Math.floor(Rt-Ur*ri/Lr+ai)),Math.min(sr,Math.floor(Rt+(Lr-Ur)*ri/Lr+ai)),Dr)}const Lr=wt[2*Rt+Dr];let Ur=Xt,qr=sr;for(_(ze,wt,Xt,Rt),wt[2*sr+Dr]>Lr&&_(ze,wt,Xt,sr);Ur<qr;){for(_(ze,wt,Ur,qr),Ur++,qr--;wt[2*Ur+Dr]<Lr;)Ur++;for(;wt[2*qr+Dr]>Lr;)qr--}wt[2*Xt+Dr]===Lr?_(ze,wt,Xt,qr):(qr++,_(ze,wt,qr,sr)),qr<=Rt&&(Xt=qr+1),Rt<=qr&&(sr=qr-1)}}function _(ze,wt,Rt,Xt){L(ze,Rt,Xt),L(wt,2*Rt,2*Xt),L(wt,2*Rt+1,2*Xt+1)}function L(ze,wt,Rt){const Xt=ze[wt];ze[wt]=ze[Rt],ze[Rt]=Xt}function C(ze,wt,Rt,Xt){const sr=ze-Rt,Dr=wt-Xt;return sr*sr+Dr*Dr}Lr.fromVectorTileJs=v,Lr.fromGeojsonVt=function(ze,wt){wt=wt||{};var Rt={};for(var Xt in ze)Rt[Xt]=new Dr(ze[Xt].features,wt),Rt[Xt].name=Xt,Rt[Xt].version=wt.version,Rt[Xt].extent=wt.extent;return v({layers:Rt})},Lr.GeoJSONWrapper=Ur;const O=ze=>ze[0],z=ze=>ze[1];class E{constructor(ze,wt=O,Rt=z,Xt=64,sr=Float64Array){this.nodeSize=Xt,this.points=ze;const Dr=ze.length<65536?Uint16Array:Uint32Array,Lr=this.ids=new Dr(ze.length),Ur=this.coords=new sr(2*ze.length);for(let Xt=0;Xt<ze.length;Xt++)Lr[Xt]=Xt,Ur[2*Xt]=wt(ze[Xt]),Ur[2*Xt+1]=Rt(ze[Xt]);k(Lr,Ur,Xt,0,Lr.length-1,0)}range(ze,wt,Rt,Xt){return function(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=[0,ze.length-1,0],qr=[];let ri,ai;for(;Ur.length;){const Yi=Ur.pop(),Ji=Ur.pop(),Qi=Ur.pop();if(Ji-Qi<=Lr){for(let Lr=Qi;Lr<=Ji;Lr++)ri=wt[2*Lr],ai=wt[2*Lr+1],ri>=Rt&&ri<=sr&&ai>=Xt&&ai<=Dr&&qr.push(ze[Lr]);continue}const kn=Math.floor((Qi+Ji)/2);ri=wt[2*kn],ai=wt[2*kn+1],ri>=Rt&&ri<=sr&&ai>=Xt&&ai<=Dr&&qr.push(ze[kn]);const jn=(Yi+1)%2;(0===Yi?Rt<=ri:Xt<=ai)&&(Ur.push(Qi),Ur.push(kn-1),Ur.push(jn)),(0===Yi?sr>=ri:Dr>=ai)&&(Ur.push(kn+1),Ur.push(Ji),Ur.push(jn))}return qr}(this.ids,this.coords,ze,wt,Rt,Xt,this.nodeSize)}within(ze,wt,Rt){return function(ze,wt,Rt,Xt,sr,Dr){const Lr=[0,ze.length-1,0],Ur=[],qr=sr*sr;for(;Lr.length;){const ri=Lr.pop(),ai=Lr.pop(),Yi=Lr.pop();if(ai-Yi<=Dr){for(let sr=Yi;sr<=ai;sr++)C(wt[2*sr],wt[2*sr+1],Rt,Xt)<=qr&&Ur.push(ze[sr]);continue}const Ji=Math.floor((Yi+ai)/2),Qi=wt[2*Ji],kn=wt[2*Ji+1];C(Qi,kn,Rt,Xt)<=qr&&Ur.push(ze[Ji]);const jn=(ri+1)%2;(0===ri?Rt-sr<=Qi:Xt-sr<=kn)&&(Lr.push(Yi),Lr.push(Ji-1),Lr.push(jn)),(0===ri?Rt+sr>=Qi:Xt+sr>=kn)&&(Lr.push(Ji+1),Lr.push(ai),Lr.push(jn))}return Ur}(this.ids,this.coords,ze,wt,Rt,this.nodeSize)}}const qr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:ze=>ze},ri=Math.fround||(ai=new Float32Array(1),ze=>(ai[0]=+ze,ai[0]));var ai;class G{constructor(ze){this.options=D(Object.create(qr),ze),this.trees=new Array(this.options.maxZoom+1)}load(ze){const{log:wt,minZoom:Rt,maxZoom:Xt,nodeSize:sr}=this.options;wt&&console.time("total time");const Dr=`prepare ${ze.length} points`;wt&&console.time(Dr),this.points=ze;let Lr=[];for(let wt=0;wt<ze.length;wt++)ze[wt].geometry&&Lr.push(Y(ze[wt],wt));this.trees[Xt+1]=new E(Lr,$,B,sr,Float32Array),wt&&console.timeEnd(Dr);for(let ze=Xt;ze>=Rt;ze--){const Rt=+Date.now();Lr=this._cluster(Lr,ze),this.trees[ze]=new E(Lr,$,B,sr,Float32Array),wt&&console.log("z%d: %d clusters in %dms",ze,Lr.length,+Date.now()-Rt)}return wt&&console.timeEnd("total time"),this}getClusters(ze,wt){let Rt=((ze[0]+180)%360+360)%360-180;const Xt=Math.max(-90,Math.min(90,ze[1]));let sr=180===ze[2]?180:((ze[2]+180)%360+360)%360-180;const Dr=Math.max(-90,Math.min(90,ze[3]));if(ze[2]-ze[0]>=360)Rt=-180,sr=180;else if(Rt>sr){const ze=this.getClusters([Rt,Xt,180,Dr],wt),Lr=this.getClusters([-180,Xt,sr,Dr],wt);return ze.concat(Lr)}const Lr=this.trees[this._limitZoom(wt)],Ur=Lr.range(V(Rt),j(Dr),V(sr),j(Xt)),qr=[];for(const ze of Ur){const wt=Lr.points[ze];qr.push(wt.numPoints?W(wt):this.points[wt.index])}return qr}getChildren(ze){const wt=this._getOriginId(ze),Rt=this._getOriginZoom(ze),Xt="No cluster with the specified id.",sr=this.trees[Rt];if(!sr)throw new Error(Xt);const Dr=sr.points[wt];if(!Dr)throw new Error(Xt);const Lr=this.options.radius/(this.options.extent*Math.pow(2,Rt-1)),Ur=sr.within(Dr.x,Dr.y,Lr),qr=[];for(const wt of Ur){const Rt=sr.points[wt];Rt.parentId===ze&&qr.push(Rt.numPoints?W(Rt):this.points[Rt.index])}if(0===qr.length)throw new Error(Xt);return qr}getLeaves(ze,wt,Rt){const Xt=[];return this._appendLeaves(Xt,ze,wt=wt||10,Rt=Rt||0,0),Xt}getTile(ze,wt,Rt){const Xt=this.trees[this._limitZoom(ze)],sr=Math.pow(2,ze),{extent:Dr,radius:Lr}=this.options,Ur=Lr/Dr,qr=(Rt-Ur)/sr,ri=(Rt+1+Ur)/sr,ai={features:[]};return this._addTileFeatures(Xt.range((wt-Ur)/sr,qr,(wt+1+Ur)/sr,ri),Xt.points,wt,Rt,sr,ai),0===wt&&this._addTileFeatures(Xt.range(1-Ur/sr,qr,1,ri),Xt.points,sr,Rt,sr,ai),wt===sr-1&&this._addTileFeatures(Xt.range(0,qr,Ur/sr,ri),Xt.points,-1,Rt,sr,ai),ai.features.length?ai:null}getClusterExpansionZoom(ze){let wt=this._getOriginZoom(ze)-1;for(;wt<=this.options.maxZoom;){const Rt=this.getChildren(ze);if(wt++,1!==Rt.length)break;ze=Rt[0].properties.cluster_id}return wt}_appendLeaves(ze,wt,Rt,Xt,sr){const Dr=this.getChildren(wt);for(const wt of Dr){const Dr=wt.properties;if(Dr&&Dr.cluster?sr+Dr.point_count<=Xt?sr+=Dr.point_count:sr=this._appendLeaves(ze,Dr.cluster_id,Rt,Xt,sr):sr<Xt?sr++:ze.push(wt),ze.length===Rt)break}return sr}_addTileFeatures(ze,wt,Rt,Xt,sr,Dr){for(const Lr of ze){const ze=wt[Lr],Ur=ze.numPoints;let qr,ri,ai;if(Ur)qr=X(ze),ri=ze.x,ai=ze.y;else{const wt=this.points[ze.index];qr=wt.properties,ri=V(wt.geometry.coordinates[0]),ai=j(wt.geometry.coordinates[1])}const Yi={type:1,geometry:[[Math.round(this.options.extent*(ri*sr-Rt)),Math.round(this.options.extent*(ai*sr-Xt))]],tags:qr};let Ji;Ur?Ji=ze.id:this.options.generateId?Ji=ze.index:this.points[ze.index].id&&(Ji=this.points[ze.index].id),void 0!==Ji&&(Yi.id=Ji),Dr.features.push(Yi)}}_limitZoom(ze){return Math.max(this.options.minZoom,Math.min(+ze,this.options.maxZoom+1))}_cluster(ze,wt){const Rt=[],{radius:Xt,extent:sr,reduce:Dr,minPoints:Lr}=this.options,Ur=Xt/(sr*Math.pow(2,wt));for(let Xt=0;Xt<ze.length;Xt++){const sr=ze[Xt];if(sr.zoom<=wt)continue;sr.zoom=wt;const qr=this.trees[wt+1],ri=qr.within(sr.x,sr.y,Ur),ai=sr.numPoints||1;let Yi=ai;for(const ze of ri){const Rt=qr.points[ze];Rt.zoom>wt&&(Yi+=Rt.numPoints||1)}if(Yi>=Lr){let ze=sr.x*ai,Lr=sr.y*ai,Ur=Dr&&ai>1?this._map(sr,!0):null;const Ji=(Xt<<5)+(wt+1)+this.points.length;for(const Rt of ri){const Xt=qr.points[Rt];if(Xt.zoom<=wt)continue;Xt.zoom=wt;const ri=Xt.numPoints||1;ze+=Xt.x*ri,Lr+=Xt.y*ri,Xt.parentId=Ji,Dr&&(Ur||(Ur=this._map(sr,!0)),Dr(Ur,this._map(Xt)))}sr.parentId=Ji,Rt.push(J(ze/Yi,Lr/Yi,Ji,Yi,Ur))}else if(Rt.push(sr),Yi>1)for(const ze of ri){const Xt=qr.points[ze];Xt.zoom<=wt||(Xt.zoom=wt,Rt.push(Xt))}}return Rt}_getOriginId(ze){return ze-this.points.length>>5}_getOriginZoom(ze){return(ze-this.points.length)%32}_map(ze,wt){if(ze.numPoints)return wt?D({},ze.properties):ze.properties;const Rt=this.points[ze.index].properties,Xt=this.options.map(Rt);return wt&&Xt===Rt?D({},Xt):Xt}}function J(ze,wt,Rt,Xt,sr){return{x:ri(ze),y:ri(wt),zoom:1/0,id:Rt,parentId:-1,numPoints:Xt,properties:sr}}function Y(ze,wt){const[Rt,Xt]=ze.geometry.coordinates;return{x:ri(V(Rt)),y:ri(j(Xt)),zoom:1/0,index:wt,parentId:-1}}function W(ze){return{type:"Feature",id:ze.id,properties:X(ze),geometry:{type:"Point",coordinates:[(wt=ze.x,360*(wt-.5)),A(ze.y)]}};var wt}function X(ze){const wt=ze.numPoints,Rt=wt>=1e4?`${Math.round(wt/1e3)}k`:wt>=1e3?Math.round(wt/100)/10+"k":wt;return D(D({},ze.properties),{cluster:!0,cluster_id:ze.id,point_count:wt,point_count_abbreviated:Rt})}function V(ze){return ze/360+.5}function j(ze){const wt=Math.sin(ze*Math.PI/180),Rt=.5-.25*Math.log((1+wt)/(1-wt))/Math.PI;return Rt<0?0:Rt>1?1:Rt}function A(ze){const wt=(180-360*ze)*Math.PI/180;return 360*Math.atan(Math.exp(wt))/Math.PI-90}function D(ze,wt){for(const Rt in wt)ze[Rt]=wt[Rt];return ze}function $(ze){return ze.x}function B(ze){return ze.y}function R(ze,wt,Rt,Xt){for(var sr,Dr=Xt,Lr=Rt-wt>>1,Ur=Rt-wt,qr=ze[wt],ri=ze[wt+1],ai=ze[Rt],Yi=ze[Rt+1],Ji=wt+3;Ji<Rt;Ji+=3){var Qi=q(ze[Ji],ze[Ji+1],qr,ri,ai,Yi);if(Qi>Dr)sr=Ji,Dr=Qi;else if(Qi===Dr){var kn=Math.abs(Ji-Lr);kn<Ur&&(sr=Ji,Ur=kn)}}Dr>Xt&&(sr-wt>3&&R(ze,wt,sr,Xt),ze[sr+2]=Dr,Rt-sr>3&&R(ze,sr,Rt,Xt))}function q(ze,wt,Rt,Xt,sr,Dr){var Lr=sr-Rt,Ur=Dr-Xt;if(0!==Lr||0!==Ur){var qr=((ze-Rt)*Lr+(wt-Xt)*Ur)/(Lr*Lr+Ur*Ur);qr>1?(Rt=sr,Xt=Dr):qr>0&&(Rt+=Lr*qr,Xt+=Ur*qr)}return(Lr=ze-Rt)*Lr+(Ur=wt-Xt)*Ur}function U(ze,wt,Rt,Xt){var sr={id:void 0===ze?null:ze,type:wt,geometry:Rt,tags:Xt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ze){var wt=ze.geometry,Rt=ze.type;if("Point"===Rt||"MultiPoint"===Rt||"LineString"===Rt)Q(ze,wt);else if("Polygon"===Rt||"MultiLineString"===Rt)for(var Xt=0;Xt<wt.length;Xt++)Q(ze,wt[Xt]);else if("MultiPolygon"===Rt)for(Xt=0;Xt<wt.length;Xt++)for(var sr=0;sr<wt[Xt].length;sr++)Q(ze,wt[Xt][sr])}(sr),sr}function Q(ze,wt){for(var Rt=0;Rt<wt.length;Rt+=3)ze.minX=Math.min(ze.minX,wt[Rt]),ze.minY=Math.min(ze.minY,wt[Rt+1]),ze.maxX=Math.max(ze.maxX,wt[Rt]),ze.maxY=Math.max(ze.maxY,wt[Rt+1])}function H(ze,wt,Rt,Xt){if(wt.geometry){var sr=wt.geometry.coordinates,Dr=wt.geometry.type,Lr=Math.pow(Rt.tolerance/((1<<Rt.maxZoom)*Rt.extent),2),Ur=[],qr=wt.id;if(Rt.promoteId?qr=wt.properties[Rt.promoteId]:Rt.generateId&&(qr=Xt||0),"Point"===Dr)K(sr,Ur);else if("MultiPoint"===Dr)for(var ri=0;ri<sr.length;ri++)K(sr[ri],Ur);else if("LineString"===Dr)ee(sr,Ur,Lr,!1);else if("MultiLineString"===Dr){if(Rt.lineMetrics){for(ri=0;ri<sr.length;ri++)ee(sr[ri],Ur=[],Lr,!1),ze.push(U(qr,"LineString",Ur,wt.properties));return}te(sr,Ur,Lr,!1)}else if("Polygon"===Dr)te(sr,Ur,Lr,!0);else{if("MultiPolygon"!==Dr){if("GeometryCollection"===Dr){for(ri=0;ri<wt.geometry.geometries.length;ri++)H(ze,{id:qr,geometry:wt.geometry.geometries[ri],properties:wt.properties},Rt,Xt);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ri=0;ri<sr.length;ri++){var ai=[];te(sr[ri],ai,Lr,!0),Ur.push(ai)}}ze.push(U(qr,Dr,Ur,wt.properties))}}function K(ze,wt){wt.push(re(ze[0])),wt.push(oe(ze[1])),wt.push(0)}function ee(ze,wt,Rt,Xt){for(var sr,Dr,Lr=0,Ur=0;Ur<ze.length;Ur++){var qr=re(ze[Ur][0]),ri=oe(ze[Ur][1]);wt.push(qr),wt.push(ri),wt.push(0),Ur>0&&(Lr+=Xt?(sr*ri-qr*Dr)/2:Math.sqrt(Math.pow(qr-sr,2)+Math.pow(ri-Dr,2))),sr=qr,Dr=ri}var ai=wt.length-3;wt[2]=1,R(wt,0,ai,Rt),wt[ai+2]=1,wt.size=Math.abs(Lr),wt.start=0,wt.end=wt.size}function te(ze,wt,Rt,Xt){for(var sr=0;sr<ze.length;sr++){var Dr=[];ee(ze[sr],Dr,Rt,Xt),wt.push(Dr)}}function re(ze){return ze/360+.5}function oe(ze){var wt=Math.sin(ze*Math.PI/180),Rt=.5-.25*Math.log((1+wt)/(1-wt))/Math.PI;return Rt<0?0:Rt>1?1:Rt}function ne(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){if(Xt/=wt,Dr>=(Rt/=wt)&&Lr<Xt)return ze;if(Lr<Rt||Dr>=Xt)return null;for(var qr=[],ri=0;ri<ze.length;ri++){var ai=ze[ri],Yi=ai.geometry,Ji=ai.type,Qi=0===sr?ai.minX:ai.minY,kn=0===sr?ai.maxX:ai.maxY;if(Qi>=Rt&&kn<Xt)qr.push(ai);else if(!(kn<Rt||Qi>=Xt)){var jn=[];if("Point"===Ji||"MultiPoint"===Ji)ie(Yi,jn,Rt,Xt,sr);else if("LineString"===Ji)se(Yi,jn,Rt,Xt,sr,!1,Ur.lineMetrics);else if("MultiLineString"===Ji)le(Yi,jn,Rt,Xt,sr,!1);else if("Polygon"===Ji)le(Yi,jn,Rt,Xt,sr,!0);else if("MultiPolygon"===Ji)for(var Un=0;Un<Yi.length;Un++){var Wn=[];le(Yi[Un],Wn,Rt,Xt,sr,!0),Wn.length&&jn.push(Wn)}if(jn.length){if(Ur.lineMetrics&&"LineString"===Ji){for(Un=0;Un<jn.length;Un++)qr.push(U(ai.id,Ji,jn[Un],ai.tags));continue}"LineString"!==Ji&&"MultiLineString"!==Ji||(1===jn.length?(Ji="LineString",jn=jn[0]):Ji="MultiLineString"),"Point"!==Ji&&"MultiPoint"!==Ji||(Ji=3===jn.length?"Point":"MultiPoint"),qr.push(U(ai.id,Ji,jn,ai.tags))}}}return qr.length?qr:null}function ie(ze,wt,Rt,Xt,sr){for(var Dr=0;Dr<ze.length;Dr+=3){var Lr=ze[Dr+sr];Lr>=Rt&&Lr<=Xt&&(wt.push(ze[Dr]),wt.push(ze[Dr+1]),wt.push(ze[Dr+2]))}}function se(ze,wt,Rt,Xt,sr,Dr,Lr){for(var Ur,qr,ri=ae(ze),ai=0===sr?he:ce,Yi=ze.start,Ji=0;Ji<ze.length-3;Ji+=3){var Qi=ze[Ji],kn=ze[Ji+1],jn=ze[Ji+2],Un=ze[Ji+3],Wn=ze[Ji+4],Yn=0===sr?Qi:kn,Jn=0===sr?Un:Wn,Qn=!1;Lr&&(Ur=Math.sqrt(Math.pow(Qi-Un,2)+Math.pow(kn-Wn,2))),Yn<Rt?Jn>Rt&&(qr=ai(ri,Qi,kn,Un,Wn,Rt),Lr&&(ri.start=Yi+Ur*qr)):Yn>Xt?Jn<Xt&&(qr=ai(ri,Qi,kn,Un,Wn,Xt),Lr&&(ri.start=Yi+Ur*qr)):ue(ri,Qi,kn,jn),Jn<Rt&&Yn>=Rt&&(qr=ai(ri,Qi,kn,Un,Wn,Rt),Qn=!0),Jn>Xt&&Yn<=Xt&&(qr=ai(ri,Qi,kn,Un,Wn,Xt),Qn=!0),!Dr&&Qn&&(Lr&&(ri.end=Yi+Ur*qr),wt.push(ri),ri=ae(ze)),Lr&&(Yi+=Ur)}var Io=ze.length-3;Qi=ze[Io],kn=ze[Io+1],jn=ze[Io+2],(Yn=0===sr?Qi:kn)>=Rt&&Yn<=Xt&&ue(ri,Qi,kn,jn),Io=ri.length-3,Dr&&Io>=3&&(ri[Io]!==ri[0]||ri[Io+1]!==ri[1])&&ue(ri,ri[0],ri[1],ri[2]),ri.length&&wt.push(ri)}function ae(ze){var wt=[];return wt.size=ze.size,wt.start=ze.start,wt.end=ze.end,wt}function le(ze,wt,Rt,Xt,sr,Dr){for(var Lr=0;Lr<ze.length;Lr++)se(ze[Lr],wt,Rt,Xt,sr,Dr,!1)}function ue(ze,wt,Rt,Xt){ze.push(wt),ze.push(Rt),ze.push(Xt)}function he(ze,wt,Rt,Xt,sr,Dr){var Lr=(Dr-wt)/(Xt-wt);return ze.push(Dr),ze.push(Rt+(sr-Rt)*Lr),ze.push(1),Lr}function ce(ze,wt,Rt,Xt,sr,Dr){var Lr=(Dr-Rt)/(sr-Rt);return ze.push(wt+(Xt-wt)*Lr),ze.push(Dr),ze.push(1),Lr}function fe(ze,wt){for(var Rt=[],Xt=0;Xt<ze.length;Xt++){var sr,Dr=ze[Xt],Lr=Dr.type;if("Point"===Lr||"MultiPoint"===Lr||"LineString"===Lr)sr=pe(Dr.geometry,wt);else if("MultiLineString"===Lr||"Polygon"===Lr){sr=[];for(var Ur=0;Ur<Dr.geometry.length;Ur++)sr.push(pe(Dr.geometry[Ur],wt))}else if("MultiPolygon"===Lr)for(sr=[],Ur=0;Ur<Dr.geometry.length;Ur++){for(var qr=[],ri=0;ri<Dr.geometry[Ur].length;ri++)qr.push(pe(Dr.geometry[Ur][ri],wt));sr.push(qr)}Rt.push(U(Dr.id,Lr,sr,Dr.tags))}return Rt}function pe(ze,wt){var Rt=[];Rt.size=ze.size,void 0!==ze.start&&(Rt.start=ze.start,Rt.end=ze.end);for(var Xt=0;Xt<ze.length;Xt+=3)Rt.push(ze[Xt]+wt,ze[Xt+1],ze[Xt+2]);return Rt}function ge(ze,wt){if(ze.transformed)return ze;var Rt,Xt,sr,Dr=1<<ze.z,Lr=ze.x,Ur=ze.y;for(Rt=0;Rt<ze.features.length;Rt++){var qr=ze.features[Rt],ri=qr.geometry,ai=qr.type;if(qr.geometry=[],1===ai)for(Xt=0;Xt<ri.length;Xt+=2)qr.geometry.push(de(ri[Xt],ri[Xt+1],wt,Dr,Lr,Ur));else for(Xt=0;Xt<ri.length;Xt++){var Yi=[];for(sr=0;sr<ri[Xt].length;sr+=2)Yi.push(de(ri[Xt][sr],ri[Xt][sr+1],wt,Dr,Lr,Ur));qr.geometry.push(Yi)}}return ze.transformed=!0,ze}function de(ze,wt,Rt,Xt,sr,Dr){return[Math.round(Rt*(ze*Xt-sr)),Math.round(Rt*(wt*Xt-Dr))]}function me(ze,wt,Rt,Xt,sr){for(var Dr=wt===sr.maxZoom?0:sr.tolerance/((1<<wt)*sr.extent),Lr={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Rt,y:Xt,z:wt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Ur=0;Ur<ze.length;Ur++){Lr.numFeatures++,ye(Lr,ze[Ur],Dr,sr);var qr=ze[Ur].minX,ri=ze[Ur].minY,ai=ze[Ur].maxX,Yi=ze[Ur].maxY;qr<Lr.minX&&(Lr.minX=qr),ri<Lr.minY&&(Lr.minY=ri),ai>Lr.maxX&&(Lr.maxX=ai),Yi>Lr.maxY&&(Lr.maxY=Yi)}return Lr}function ye(ze,wt,Rt,Xt){var sr=wt.geometry,Dr=wt.type,Lr=[];if("Point"===Dr||"MultiPoint"===Dr)for(var Ur=0;Ur<sr.length;Ur+=3)Lr.push(sr[Ur]),Lr.push(sr[Ur+1]),ze.numPoints++,ze.numSimplified++;else if("LineString"===Dr)ve(Lr,sr,ze,Rt,!1,!1);else if("MultiLineString"===Dr||"Polygon"===Dr)for(Ur=0;Ur<sr.length;Ur++)ve(Lr,sr[Ur],ze,Rt,"Polygon"===Dr,0===Ur);else if("MultiPolygon"===Dr)for(var qr=0;qr<sr.length;qr++){var ri=sr[qr];for(Ur=0;Ur<ri.length;Ur++)ve(Lr,ri[Ur],ze,Rt,!0,0===Ur)}if(Lr.length){var ai=wt.tags||null;if("LineString"===Dr&&Xt.lineMetrics){for(var Yi in ai={},wt.tags)ai[Yi]=wt.tags[Yi];ai.mapbox_clip_start=sr.start/sr.size,ai.mapbox_clip_end=sr.end/sr.size}var Ji={geometry:Lr,type:"Polygon"===Dr||"MultiPolygon"===Dr?3:"LineString"===Dr||"MultiLineString"===Dr?2:1,tags:ai};null!==wt.id&&(Ji.id=wt.id),ze.features.push(Ji)}}function ve(ze,wt,Rt,Xt,sr,Dr){var Lr=Xt*Xt;if(Xt>0&&wt.size<(sr?Lr:Xt))Rt.numPoints+=wt.length/3;else{for(var Ur=[],qr=0;qr<wt.length;qr+=3)(0===Xt||wt[qr+2]>Lr)&&(Rt.numSimplified++,Ur.push(wt[qr]),Ur.push(wt[qr+1])),Rt.numPoints++;sr&&function(ze,wt){for(var Rt=0,Xt=0,sr=ze.length,Dr=sr-2;Xt<sr;Dr=Xt,Xt+=2)Rt+=(ze[Xt]-ze[Dr])*(ze[Xt+1]+ze[Dr+1]);if(Rt>0===wt)for(Xt=0,sr=ze.length;Xt<sr/2;Xt+=2){var Lr=ze[Xt],Ur=ze[Xt+1];ze[Xt]=ze[sr-2-Xt],ze[Xt+1]=ze[sr-1-Xt],ze[sr-2-Xt]=Lr,ze[sr-1-Xt]=Ur}}(Ur,Dr),ze.push(Ur)}}function xe(ze,wt){var Rt=(wt=this.options=function(ze,wt){for(var Rt in wt)ze[Rt]=wt[Rt];return ze}(Object.create(this.options),wt)).debug;if(Rt&&console.time("preprocess data"),wt.maxZoom<0||wt.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(wt.promoteId&&wt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Xt=function(ze,wt){var Rt=[];if("FeatureCollection"===ze.type)for(var Xt=0;Xt<ze.features.length;Xt++)H(Rt,ze.features[Xt],wt,Xt);else H(Rt,"Feature"===ze.type?ze:{geometry:ze},wt);return Rt}(ze,wt);this.tiles={},this.tileCoords=[],Rt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",wt.indexMaxZoom,wt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(Xt=function(ze,wt){var Rt=wt.buffer/wt.extent,Xt=ze,sr=ne(ze,1,-1-Rt,Rt,0,-1,2,wt),Dr=ne(ze,1,1-Rt,2+Rt,0,-1,2,wt);return(sr||Dr)&&(Xt=ne(ze,1,-Rt,1+Rt,0,-1,2,wt)||[],sr&&(Xt=fe(sr,1).concat(Xt)),Dr&&(Xt=Xt.concat(fe(Dr,-1)))),Xt}(Xt,wt)).length&&this.splitTile(Xt,0,0,0),Rt&&(Xt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function we(ze,wt,Rt){return 32*((1<<ze)*Rt+wt)+ze}function Se(ze,wt){const Rt=ze.tileID.canonical;if(!this._geoJSONIndex)return wt(null,null);const Xt=this._geoJSONIndex.getTile(Rt.z,Rt.x,Rt.y);if(!Xt)return wt(null,null);const sr=new c(Xt.features);let Dr=Lr(sr);0===Dr.byteOffset&&Dr.byteLength===Dr.buffer.byteLength||(Dr=new Uint8Array(Dr)),wt(null,{vectorTile:sr,rawData:Dr.buffer})}xe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},xe.prototype.splitTile=function(ze,wt,Rt,Xt,sr,Dr,Lr){for(var Ur=[ze,wt,Rt,Xt],qr=this.options,ri=qr.debug;Ur.length;){Xt=Ur.pop(),Rt=Ur.pop(),wt=Ur.pop(),ze=Ur.pop();var ai=1<<wt,Yi=we(wt,Rt,Xt),Ji=this.tiles[Yi];if(!Ji&&(ri>1&&console.time("creation"),Ji=this.tiles[Yi]=me(ze,wt,Rt,Xt,qr),this.tileCoords.push({z:wt,x:Rt,y:Xt}),ri)){ri>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",wt,Rt,Xt,Ji.numFeatures,Ji.numPoints,Ji.numSimplified),console.timeEnd("creation"));var Qi="z"+wt;this.stats[Qi]=(this.stats[Qi]||0)+1,this.total++}if(Ji.source=ze,sr){if(wt===qr.maxZoom||wt===sr)continue;var kn=1<<sr-wt;if(Rt!==Math.floor(Dr/kn)||Xt!==Math.floor(Lr/kn))continue}else if(wt===qr.indexMaxZoom||Ji.numPoints<=qr.indexMaxPoints)continue;if(Ji.source=null,0!==ze.length){ri>1&&console.time("clipping");var jn,Un,Wn,Yn,Jn,Qn,Io=.5*qr.buffer/qr.extent,Mo=.5-Io,jo=.5+Io,zo=1+Io;jn=Un=Wn=Yn=null,Jn=ne(ze,ai,Rt-Io,Rt+jo,0,Ji.minX,Ji.maxX,qr),Qn=ne(ze,ai,Rt+Mo,Rt+zo,0,Ji.minX,Ji.maxX,qr),ze=null,Jn&&(jn=ne(Jn,ai,Xt-Io,Xt+jo,1,Ji.minY,Ji.maxY,qr),Un=ne(Jn,ai,Xt+Mo,Xt+zo,1,Ji.minY,Ji.maxY,qr),Jn=null),Qn&&(Wn=ne(Qn,ai,Xt-Io,Xt+jo,1,Ji.minY,Ji.maxY,qr),Yn=ne(Qn,ai,Xt+Mo,Xt+zo,1,Ji.minY,Ji.maxY,qr),Qn=null),ri>1&&console.timeEnd("clipping"),Ur.push(jn||[],wt+1,2*Rt,2*Xt),Ur.push(Un||[],wt+1,2*Rt,2*Xt+1),Ur.push(Wn||[],wt+1,2*Rt+1,2*Xt),Ur.push(Yn||[],wt+1,2*Rt+1,2*Xt+1)}}},xe.prototype.getTile=function(ze,wt,Rt){var Xt=this.options,sr=Xt.extent,Dr=Xt.debug;if(ze<0||ze>24)return null;var Lr=1<<ze,Ur=we(ze,wt=(wt%Lr+Lr)%Lr,Rt);if(this.tiles[Ur])return ge(this.tiles[Ur],sr);Dr>1&&console.log("drilling down to z%d-%d-%d",ze,wt,Rt);for(var qr,ri=ze,ai=wt,Yi=Rt;!qr&&ri>0;)ri--,ai=Math.floor(ai/2),Yi=Math.floor(Yi/2),qr=this.tiles[we(ri,ai,Yi)];return qr&&qr.source?(Dr>1&&console.log("found parent tile z%d-%d-%d",ri,ai,Yi),Dr>1&&console.time("drilling down"),this.splitTile(qr.source,ri,ai,Yi,ze,wt,Rt),Dr>1&&console.timeEnd("drilling down"),this.tiles[Ur]?ge(this.tiles[Ur],sr):null):null};class Me extends ze.VectorTileWorkerSource{constructor(ze,wt,Rt,Xt,sr){super(ze,wt,Rt,Xt,Se),sr&&(this.loadGeoJSON=sr)}loadData(wt,Xt){const sr=wt&&wt.request,Dr=sr&&sr.collectResourceTiming;this.loadGeoJSON(wt,(Lr,Ur)=>{if(Lr||!Ur)return Xt(Lr);if("object"!=typeof Ur)return Xt(new Error(`Input data given to '${wt.source}' is not a valid GeoJSON object.`));{Rt(Ur,!0);try{if(wt.filter){const Rt=ze.createExpression(wt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===Rt.result)throw new Error(Rt.value.map(ze=>`${ze.key}: ${ze.message}`).join(", "));const Xt=Ur.features.filter(ze=>Rt.value.evaluate({zoom:0},ze));Ur={type:"FeatureCollection",features:Xt}}this._geoJSONIndex=wt.cluster?new G(function({superclusterOptions:wt,clusterProperties:Rt}){if(!Rt||!wt)return wt;const Xt={},sr={},Dr={accumulated:null,zoom:0},Lr={properties:null},Ur=Object.keys(Rt);for(const wt of Ur){const[Dr,Lr]=Rt[wt],Ur=ze.createExpression(Lr),qr=ze.createExpression("string"==typeof Dr?[Dr,["accumulated"],["get",wt]]:Dr);Xt[wt]=Ur.value,sr[wt]=qr.value}return wt.map=ze=>{Lr.properties=ze;const wt={};for(const ze of Ur)wt[ze]=Xt[ze].evaluate(Dr,Lr);return wt},wt.reduce=(ze,wt)=>{Lr.properties=wt;for(const wt of Ur)Dr.accumulated=ze[wt],ze[wt]=sr[wt].evaluate(Dr,Lr)},wt}(wt)).load(Ur.features):function(ze,wt){return new xe(ze,wt)}(Ur,wt.geojsonVtOptions)}catch(Lr){return Xt(Lr)}this.loaded={};const qr={};if(Dr){const Rt=ze.getPerformanceMeasurement(sr);Rt&&(qr.resourceTiming={},qr.resourceTiming[wt.source]=JSON.parse(JSON.stringify(Rt)))}Xt(null,qr)}})}reloadTile(ze,wt){const Rt=this.loaded;return Rt&&Rt[ze.uid]?super.reloadTile(ze,wt):this.loadTile(ze,wt)}loadGeoJSON(wt,Rt){if(wt.request)ze.getJSON(wt.request,Rt);else{if("string"!=typeof wt.data)return Rt(new Error(`Input data given to '${wt.source}' is not a valid GeoJSON object.`));try{return Rt(null,JSON.parse(wt.data))}catch(ze){return Rt(new Error(`Input data given to '${wt.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(ze,wt){try{wt(null,this._geoJSONIndex.getClusterExpansionZoom(ze.clusterId))}catch(ze){wt(ze)}}getClusterChildren(ze,wt){try{wt(null,this._geoJSONIndex.getChildren(ze.clusterId))}catch(ze){wt(ze)}}getClusterLeaves(ze,wt){try{wt(null,this._geoJSONIndex.getLeaves(ze.clusterId,ze.limit,ze.offset))}catch(ze){wt(ze)}}}class Pe{constructor(wt){this.self=wt,this.actor=new ze.Actor(wt,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded=!1,this.workerSourceTypes={vector:ze.VectorTileWorkerSource,geojson:Me},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(ze,wt)=>{if(this.workerSourceTypes[ze])throw new Error(`Worker source with name "${ze}" already registered.`);this.workerSourceTypes[ze]=wt},this.self.registerRTLTextPlugin=wt=>{if(ze.plugin.isParsed())throw new Error("RTL text plugin already registered.");ze.plugin.applyArabicShaping=wt.applyArabicShaping,ze.plugin.processBidirectionalText=wt.processBidirectionalText,ze.plugin.processStyledBidirectionalText=wt.processStyledBidirectionalText}}checkIfReady(ze,wt,Rt){Rt()}setReferrer(ze,wt){this.referrer=wt}spriteLoaded(wt,Rt){this.isSpriteLoaded=Rt;for(const Xt in this.workerSources[wt]){const sr=this.workerSources[wt][Xt];for(const wt in sr)sr[wt]instanceof ze.VectorTileWorkerSource&&(sr[wt].isSpriteLoaded=Rt,sr[wt].fire(new ze.Event("isSpriteLoaded")))}}setImages(ze,wt,Rt){this.availableImages[ze]=wt;for(const Rt in this.workerSources[ze]){const Xt=this.workerSources[ze][Rt];for(const ze in Xt)Xt[ze].availableImages=wt}Rt()}enableTerrain(ze,wt,Rt){this.terrain=wt,Rt()}setLayers(ze,wt,Rt){this.getLayerIndex(ze).replace(wt),Rt()}updateLayers(ze,wt,Rt){this.getLayerIndex(ze).update(wt.layers,wt.removedIds),Rt()}loadTile(wt,Rt,Xt){const sr=this.enableTerrain?ze.extend({enableTerrain:this.terrain},Rt):Rt;this.getWorkerSource(wt,Rt.type,Rt.source).loadTile(sr,Xt)}loadDEMTile(wt,Rt,Xt){const sr=this.enableTerrain?ze.extend({buildQuadTree:this.terrain},Rt):Rt;this.getDEMWorkerSource(wt,Rt.source).loadTile(sr,Xt)}reloadTile(wt,Rt,Xt){const sr=this.enableTerrain?ze.extend({enableTerrain:this.terrain},Rt):Rt;this.getWorkerSource(wt,Rt.type,Rt.source).reloadTile(sr,Xt)}abortTile(ze,wt,Rt){this.getWorkerSource(ze,wt.type,wt.source).abortTile(wt,Rt)}removeTile(ze,wt,Rt){this.getWorkerSource(ze,wt.type,wt.source).removeTile(wt,Rt)}removeSource(ze,wt,Rt){if(!this.workerSources[ze]||!this.workerSources[ze][wt.type]||!this.workerSources[ze][wt.type][wt.source])return;const Xt=this.workerSources[ze][wt.type][wt.source];delete this.workerSources[ze][wt.type][wt.source],void 0!==Xt.removeSource?Xt.removeSource(wt,Rt):Rt()}loadWorkerSource(ze,wt,Rt){try{this.self.importScripts(wt.url),Rt()}catch(ze){Rt(ze.toString())}}syncRTLPluginState(wt,Rt,Xt){try{ze.plugin.setState(Rt);const wt=ze.plugin.getPluginURL();if(ze.plugin.isLoaded()&&!ze.plugin.isParsed()&&null!=wt){this.self.importScripts(wt);const Rt=ze.plugin.isParsed();Xt(Rt?void 0:new Error(`RTL Text Plugin failed to import scripts from ${wt}`),Rt)}}catch(ze){Xt(ze.toString())}}getAvailableImages(ze){let wt=this.availableImages[ze];return wt||(wt=[]),wt}getLayerIndex(ze){let wt=this.layerIndexes[ze];return wt||(wt=this.layerIndexes[ze]=new o),wt}getWorkerSource(ze,wt,Rt){return this.workerSources[ze]||(this.workerSources[ze]={}),this.workerSources[ze][wt]||(this.workerSources[ze][wt]={}),this.workerSources[ze][wt][Rt]||(this.workerSources[ze][wt][Rt]=new this.workerSourceTypes[wt]({send:(wt,Rt,Xt,sr,Dr,Lr)=>{this.actor.send(wt,Rt,Xt,ze,Dr,Lr)},scheduler:this.actor.scheduler},this.getLayerIndex(ze),this.getAvailableImages(ze),this.isSpriteLoaded)),this.workerSources[ze][wt][Rt]}getDEMWorkerSource(ze,wt){return this.demWorkerSources[ze]||(this.demWorkerSources[ze]={}),this.demWorkerSources[ze][wt]||(this.demWorkerSources[ze][wt]=new i),this.demWorkerSources[ze][wt]}enforceCacheSizeLimit(wt,Rt){ze.enforceCacheSizeLimit(Rt)}getWorkerPerformanceMetrics(ze,wt,Rt){Rt(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Pe(self)),Pe}),define(["./shared"],function(ze){var wt=i;function i(ze){return!function(ze){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var ze,wt,Rt=new Blob([""],{type:"text/javascript"}),Xt=URL.createObjectURL(Rt);try{wt=new Worker(Xt),ze=!0}catch(wt){ze=!1}return wt&&wt.terminate(),URL.revokeObjectURL(Xt),ze}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var ze=document.createElement("canvas");ze.width=ze.height=1;var wt=ze.getContext("2d");if(!wt)return!1;var Rt=wt.getImageData(0,0,1,1);
20return Rt&&Rt.width===ze.width}()?(void 0===Rt[wt=ze&&ze.failIfMajorPerformanceCaveat]&&(Rt[wt]=function(ze){var wt,Rt=function(ze){var wt=document.createElement("canvas"),Rt=Object.create(i.webGLContextAttributes);return Rt.failIfMajorPerformanceCaveat=ze,wt.getContext("webgl",Rt)||wt.getContext("experimental-webgl",Rt)}(ze);if(!Rt)return!1;try{wt=Rt.createShader(Rt.VERTEX_SHADER)}catch(ze){return!1}return!(!wt||Rt.isContextLost())&&(Rt.shaderSource(wt,"void main() {}"),Rt.compileShader(wt),!0===Rt.getShaderParameter(wt,Rt.COMPILE_STATUS))}(wt)),Rt[wt]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var wt}(ze)}var Rt={};function r(ze,wt){if(Array.isArray(ze)){if(!Array.isArray(wt)||ze.length!==wt.length)return!1;for(let Rt=0;Rt<ze.length;Rt++)if(!r(ze[Rt],wt[Rt]))return!1;return!0}if("object"==typeof ze&&null!==ze&&null!==wt){if("object"!=typeof wt)return!1;if(Object.keys(ze).length!==Object.keys(wt).length)return!1;for(const Rt in ze)if(!r(ze[Rt],wt[Rt]))return!1;return!0}return ze===wt}i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Xt={create:function(wt,Rt,Xt){const sr=ze.window.document.createElement(wt);return void 0!==Rt&&(sr.className=Rt),Xt&&Xt.appendChild(sr),sr},createNS:function(wt,Rt){return ze.window.document.createElementNS(wt,Rt)}},sr=ze.window.document&&ze.window.document.documentElement.style,Dr=sr&&void 0!==sr.userSelect?"userSelect":"WebkitUserSelect";let Lr;Xt.disableDrag=function(){sr&&Dr&&(Lr=sr[Dr],sr[Dr]="none")},Xt.enableDrag=function(){sr&&Dr&&(sr[Dr]=Lr)},Xt.setTransform=function(ze,wt){ze.style.transform=wt};let Ur=!1;try{const wt=Object.defineProperty({},"passive",{get(){Ur=!0}});ze.window.addEventListener("test",wt,wt),ze.window.removeEventListener("test",wt,wt)}catch(ze){Ur=!1}Xt.addEventListener=function(ze,wt,Rt,Xt={}){ze.addEventListener(wt,Rt,"passive"in Xt&&Ur?Xt:Xt.capture)},Xt.removeEventListener=function(ze,wt,Rt,Xt={}){ze.removeEventListener(wt,Rt,"passive"in Xt&&Ur?Xt:Xt.capture)};const h=function(wt){wt.preventDefault(),wt.stopPropagation(),ze.window.removeEventListener("click",h,!0)};function d(wt,Rt,Xt){const sr=wt.offsetWidth===Rt.width?1:wt.offsetWidth/Rt.width;return new ze.pointGeometry((Xt.clientX-Rt.left)*sr,(Xt.clientY-Rt.top)*sr)}Xt.suppressClick=function(){ze.window.addEventListener("click",h,!0),ze.window.setTimeout(()=>{ze.window.removeEventListener("click",h,!0)},0)},Xt.mousePos=function(ze,wt){const Rt=ze.getBoundingClientRect();return d(ze,Rt,wt)},Xt.touchPos=function(ze,wt){const Rt=ze.getBoundingClientRect(),Xt=[];for(let sr=0;sr<wt.length;sr++)Xt.push(d(ze,Rt,wt[sr]));return Xt},Xt.mouseButton=function(wt){return void 0!==ze.window.InstallTrigger&&2===wt.button&&wt.ctrlKey&&ze.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:wt.button},Xt.remove=function(ze){ze.parentNode&&ze.parentNode.removeChild(ze)};class u{constructor(ze,wt){this.pos=ze,this.dir=wt}intersectsPlane(wt,Rt,Xt){const sr=ze.dot(Rt,this.dir);if(Math.abs(sr)<1e-6)return!1;const Dr=ze.dot(ze.sub(ze.create(),wt,this.pos),Rt)/sr,Lr=ze.scaleAndAdd(ze.create(),this.pos,this.dir,Dr);return ze.copy(Xt,Lr),!0}}class _{constructor(ze,wt){this.points=ze,this.planes=wt}static fromInvProjectionMatrix(wt,Rt,Xt){const sr=Math.pow(2,Xt),Dr=[[-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(Xt=>{const Dr=ze.transformMat4([],Xt,wt),Lr=1/Dr[3]/Rt*sr;return ze.mul(Dr,Dr,[Lr,Lr,1/Dr[3],Lr])}),Lr=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(wt=>{const Rt=ze.sub([],Dr[wt[0]],Dr[wt[1]]),Xt=ze.sub([],Dr[wt[2]],Dr[wt[1]]),sr=ze.normalize([],ze.cross([],Rt,Xt)),Lr=-ze.dot(sr,Dr[wt[1]]);return sr.concat(Lr)});return new _(Dr,Lr)}}class p{constructor(wt,Rt){this.min=wt,this.max=Rt,this.center=ze.scale([],ze.add([],this.min,this.max),.5)}quadrant(wt){const Rt=[wt%2==0,wt<2],Xt=ze.clone(this.min),sr=ze.clone(this.max);for(let ze=0;ze<Rt.length;ze++)Xt[ze]=Rt[ze]?this.min[ze]:this.center[ze],sr[ze]=Rt[ze]?this.center[ze]:this.max[ze];return sr[2]=this.max[2],new p(Xt,sr)}distanceX(ze){return Math.max(Math.min(this.max[0],ze[0]),this.min[0])-ze[0]}distanceY(ze){return Math.max(Math.min(this.max[1],ze[1]),this.min[1])-ze[1]}distanceZ(ze){return Math.max(Math.min(this.max[2],ze[2]),this.min[2])-ze[2]}intersects(wt){const Rt=[[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],
vendor: 8,785 bytes, line 20
201],[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 Xt=!0;for(let sr=0;sr<wt.planes.length;sr++){const Dr=wt.planes[sr];let Lr=0;for(let wt=0;wt<Rt.length;wt++)Lr+=ze.dot$1(Dr,Rt[wt])>=0;if(0===Lr)return 0;Lr!==Rt.length&&(Xt=!1)}if(Xt)return 2;for(let ze=0;ze<3;ze++){let Rt=Number.MAX_VALUE,Xt=-Number.MAX_VALUE;for(let sr=0;sr<wt.points.length;sr++){const Dr=wt.points[sr][ze]-this.min[ze];Rt=Math.min(Rt,Dr),Xt=Math.max(Xt,Dr)}if(Xt<0||Rt>this.max[ze]-this.min[ze])return 0}return 1}}function m(ze){const{userImage:wt}=ze;return!!(wt&&wt.render&&wt.render())&&(ze.data.replace(new Uint8Array(wt.data.buffer)),!0)}class f extends ze.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new ze.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(ze){if(this.loaded!==ze&&(this.loaded=ze,ze)){for(const{ids:ze,callback:wt}of this.requestors)this._notify(ze,wt);this.requestors=[]}}getImage(ze){return this.images[ze]}addImage(ze,wt){this._validate(ze,wt)&&(this.images[ze]=wt)}_validate(wt,Rt){let Xt=!0;return this._validateStretch(Rt.stretchX,Rt.data&&Rt.data.width)||(this.fire(new ze.ErrorEvent(new Error(`Image "${wt}" has invalid "stretchX" value`))),Xt=!1),this._validateStretch(Rt.stretchY,Rt.data&&Rt.data.height)||(this.fire(new ze.ErrorEvent(new Error(`Image "${wt}" has invalid "stretchY" value`))),Xt=!1),this._validateContent(Rt.content,Rt)||(this.fire(new ze.ErrorEvent(new Error(`Image "${wt}" has invalid "content" value`))),Xt=!1),Xt}_validateStretch(ze,wt){if(!ze)return!0;let Rt=0;for(const Xt of ze){if(Xt[0]<Rt||Xt[1]<Xt[0]||wt<Xt[1])return!1;Rt=Xt[1]}return!0}_validateContent(ze,wt){return!(ze&&(4!==ze.length||ze[0]<0||wt.data.width<ze[0]||ze[1]<0||wt.data.height<ze[1]||ze[2]<0||wt.data.width<ze[2]||ze[3]<0||wt.data.height<ze[3]||ze[2]<ze[0]||ze[3]<ze[1]))}updateImage(ze,wt){wt.version=this.images[ze].version+1,this.images[ze]=wt,this.updatedImages[ze]=!0}removeImage(ze){const wt=this.images[ze];delete this.images[ze],delete this.patterns[ze],wt.userImage&&wt.userImage.onRemove&&wt.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(ze,wt){let Rt=!0;if(!this.isLoaded())for(const wt of ze)this.images[wt]||(Rt=!1);this.isLoaded()||Rt?this._notify(ze,wt):this.requestors.push({ids:ze,callback:wt})}_notify(wt,Rt){const Xt={};for(const Rt of wt){this.images[Rt]||this.fire(new ze.Event("styleimagemissing",{id:Rt}));const wt=this.images[Rt];wt?Xt[Rt]={data:wt.data.clone(),pixelRatio:wt.pixelRatio,sdf:wt.sdf,version:wt.version,stretchX:wt.stretchX,stretchY:wt.stretchY,content:wt.content,hasRenderCallback:Boolean(wt.userImage&&wt.userImage.render)}:ze.warnOnce(`Image "${Rt}" 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.`)}Rt(null,Xt)}getPixelSize(){const{width:ze,height:wt}=this.atlasImage;return{width:ze,height:wt}}getPattern(wt){const Rt=this.patterns[wt],Xt=this.getImage(wt);if(!Xt)return null;if(Rt&&Rt.position.version===Xt.version)return Rt.position;if(Rt)Rt.position.version=Xt.version;else{const Rt={w:Xt.data.width+2,h:Xt.data.height+2,x:0,y:0},sr=new ze.ImagePosition(Rt,Xt);this.patterns[wt]={bin:Rt,position:sr}}return this._updatePatternAtlas(),this.patterns[wt].position}bind(wt){const Rt=wt.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ze.Texture(wt,this.atlasImage,Rt.RGBA),this.atlasTexture.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE)}_updatePatternAtlas(){const wt=[];for(const ze in this.patterns)wt.push(this.patterns[ze].bin);const{w:Rt,h:Xt}=ze.potpack(wt),sr=this.atlasImage;sr.resize({width:Rt||1,height:Xt||1});for(const wt in this.patterns){const{bin:Rt}=this.patterns[wt],Xt=Rt.x+1,Dr=Rt.y+1,Lr=this.images[wt].data,Ur=Lr.width,qr=Lr.height;ze.RGBAImage.copy(Lr,sr,{x:0,y:0},{x:Xt,y:Dr},{width:Ur,height:qr}),ze.RGBAImage.copy(Lr,sr,{x:0,y:qr-1},{x:Xt,y:Dr-1},{width:Ur,height:1}),ze.RGBAImage.copy(Lr,sr,{x:0,y:0},{x:Xt,y:Dr+qr},{width:Ur,height:1}),ze.RGBAImage.copy(Lr,sr,{x:Ur-1,y:0},{x:Xt-1,y:Dr},{width:1,height:qr}),ze.RGBAImage.copy(Lr,sr,{x:0,y:0},{x:Xt+Ur,y:Dr},{width:1,height:qr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(ze){for(const wt of ze){if(this.callbackDispatchedThisFrame[wt])continue;this.callbackDispatchedThisFrame[wt]=!0;const ze=this.images[wt];m(ze)&&this.updateImage(wt,ze)}}}const qr=new ze.Properties({anchor:new ze.DataConstantProperty(ze.spec.light.anchor),position:new class{constructor(){this.specification=ze.spec.light.position}possiblyEvaluate(wt,Rt){return function([wt,Rt,Xt]){const sr=ze.degToRad(Rt+90),Dr=ze.degToRad(Xt);return{x:wt*Math.cos(sr)*Math.sin(Dr),y:wt*Math.sin(sr)*Math.sin(Dr),z:wt*Math.cos(Dr),azimuthal:Rt,polar:Xt}}(wt.expression.evaluate(Rt))}interpolate(wt,Rt,Xt){return{x:ze.number(wt.x,Rt.x,Xt),y:ze.number(wt.y,Rt.y,Xt),z:ze.number(wt.z,Rt.z,Xt),azimuthal:ze.number(wt.azimuthal,Rt.azimuthal,Xt),polar:ze.number(wt.polar,Rt.polar,Xt)}}},color:new ze.DataConstantProperty(ze.spec.light.color),intensity:new ze.DataConstantProperty(ze.spec.light.intensity)}),ri="-transition";class x extends ze.Evented{constructor(wt){super(),this._transitionable=new ze.Transitionable(qr),this.setLight(wt),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(wt,Rt={}){if(!this._validate(ze.validateLight,wt,Rt))for(const Rt in wt){const Xt=wt[Rt];ze.endsWith(Rt,ri)?this._transitionable.setTransition(Rt.slice(0,-ri.length),Xt):this._transitionable.setValue(Rt,Xt)}}updateTransitions(ze){this._transitioning=this._transitionable.transitioned(ze,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(ze){this.properties=this._transitioning.possiblyEvaluate(ze)}_validate(wt,Rt,Xt){return(!Xt||!1!==Xt.validate)&&ze.emitValidationErrors(this,wt.call(ze.validateStyle,ze.extend({value:Rt,style:{glyphs:!0,sprite:!0},styleSpec:ze.spec})))}}const ai=new ze.Properties({source:new ze.DataConstantProperty(ze.spec.terrain.source),exaggeration:new ze.DataConstantProperty(ze.spec.terrain.exaggeration)}),Yi="-transition";class w extends ze.Evented{constructor(wt){super(),this._transitionable=new ze.Transitionable(ai),this.set(wt),this._transitioning=this._transitionable.untransitioned()}get(){return this._transitionable.serialize()}set(wt){for(const Rt in wt){const Xt=wt[Rt];ze.endsWith(Rt,Yi)?this._transitionable.setTransition(Rt.slice(0,-Yi.length),Xt):this._transitionable.setValue(Rt,Xt)}}updateTransitions(ze){this._transitioning=this._transitionable.transitioned(ze,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(ze){this.properties=this._transitioning.possiblyEvaluate(ze)}}function T(wt,Rt,Xt,sr){const Dr=ze.smoothstep(45,65,Xt),[Lr,Ur]=E(wt,sr),qr=ze.length(Rt);let ri=1-Math.min(1,Math.exp((qr-Lr)/(Ur-Lr)*-6));return ri*=ri*ri,ri=Math.min(1,1.00747*ri),ri*Dr*wt.alpha}function E(ze,wt){const Rt=.5/Math.tan(.5*wt);return[ze.range[0]+Rt,ze.range[1]+Rt]}const Ji=new ze.Properties({range:new ze.DataConstantProperty(ze.spec.fog.range),color:new ze.DataConstantProperty(ze.spec.fog.color),"horizon-blend":new ze.DataConstantProperty(ze.spec.fog["horizon-blend"])}),Qi="-transition";class I extends ze.Evented{constructor(wt){super(),this._transitionable=new ze.Transitionable(Ji),this.set(wt),this._transitioning=this._transitionable.untransitioned()}get state(){return{range:this.properties.get("range"),horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(wt,Rt={}){if(!this._validate(ze.validateFog,wt,Rt))for(const Rt in wt){const Xt=wt[Rt];ze.endsWith(Rt,Qi)?this._transitionable.setTransition(Rt.slice(0,-Qi.length),Xt):this._transitionable.setValue(Rt,Xt)}}getOpacity(wt){const Rt=this.properties&&this.properties.get("color")||1;return ze.smoothstep(45,65,wt)*Rt.a}getOpacityAtLatLng(wt,Rt){return function(wt,Rt,Xt){const sr=ze.MercatorCoordinate.fromLngLat(Rt),Dr=Xt.elevation?Xt.elevation.getAtPointOrZero(sr):0,Lr=[sr.x,sr.y,Dr];return ze.transformMat4$1(Lr,Lr,Xt.mercatorFogMatrix),T(wt,Lr,Xt.pitch,Xt._fov)}(this.state,wt,Rt)}getFovAdjustedRange(ze){return E(this.state,ze)}updateTransitions(ze){this._transitioning=this._transitionable.transitioned(ze,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(ze){this.properties=this._transitioning.possiblyEvaluate(ze)}
20_validate(wt,Rt,Xt){return(!Xt||!1!==Xt.validate)&&ze.emitValidationErrors(this,wt.call(ze.validateStyle,ze.extend({value:Rt,style:{glyphs:!0,sprite:!0},styleSpec:ze.spec})))}}class M{constructor(wt,Rt){this.workerPool=wt,this.actors=[],this.currentActor=0,this.id=ze.uniqueId();const Xt=this.workerPool.acquire(this.id);for(let ze=0;ze<Xt.length;ze++){const wt=new M.Actor(Xt[ze],Rt,this.id);wt.name=`Worker ${ze}`,this.actors.push(wt)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(wt,Rt,Xt){ze.asyncAll(this.actors,(ze,Xt)=>{ze.send(wt,Rt,Xt)},Xt=Xt||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(ze=>{ze.remove()}),this.actors=[],this.workerPool.release(this.id)}}function z(wt,Rt,Xt){return Rt*(ze.EXTENT/(wt.tileSize*Math.pow(2,Xt-wt.tileID.overscaledZ)))}M.Actor=ze.Actor;class D{constructor(ze,wt,Rt,Xt){this.screenBounds=ze,this.cameraPoint=wt,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=Rt,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this.screenGeometry.map(ze=>Xt.pointCoordinate3D(ze)),this.cameraGeometry=this.bufferedCameraGeometry(0)}static createFromScreenPoints(wt,Rt){let Xt,sr;if(wt instanceof ze.pointGeometry||"number"==typeof wt[0]){const Dr=ze.pointGeometry.convert(wt);Xt=[ze.pointGeometry.convert(wt)],sr=Rt.isPointAboveHorizon(Dr)}else{const Dr=ze.pointGeometry.convert(wt[0]),Lr=ze.pointGeometry.convert(wt[1]);Xt=[Dr,Lr],sr=ze.polygonizeBounds(Dr,Lr).every(ze=>Rt.isPointAboveHorizon(ze))}return new D(Xt,Rt.getCameraPoint(),sr,Rt)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(wt){return ze.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],wt)}bufferedCameraGeometry(wt){const Rt=this.screenBounds[0],Xt=1===this.screenBounds.length?this.screenBounds[0].add(new ze.pointGeometry(1,1)):this.screenBounds[1],sr=ze.polygonizeBounds(Rt,Xt,0,!1);return this.cameraPoint.y>Xt.y&&(this.cameraPoint.x>Rt.x&&this.cameraPoint.x<Xt.x?sr.splice(3,0,this.cameraPoint):this.cameraPoint.x>=Xt.x?sr[2]=this.cameraPoint:this.cameraPoint.x<=Rt.x&&(sr[3]=this.cameraPoint)),ze.bufferConvexPolygon(sr,wt)}containsTile(wt,Rt,Xt){const sr=wt.queryPadding+1,Dr=Xt?this._bufferedCameraMercator(sr,Rt).map(ze=>wt.tileID.getTilePoint(ze)):this._bufferedScreenMercator(sr,Rt).map(ze=>wt.tileID.getTilePoint(ze)),Lr=this.screenGeometryMercator.map(ze=>wt.tileID.getTileVec3(ze)),Ur=Lr.map(wt=>new ze.pointGeometry(wt[0],wt[1])),qr=Rt.getFreeCameraOptions().position||new ze.MercatorCoordinate(0,0,0),ri=wt.tileID.getTileVec3(qr),ai=Lr.map(wt=>{const Rt=ze.sub(wt,wt,ri);return ze.normalize(Rt,Rt),new u(ri,Rt)}),Yi=z(wt,1,Rt.zoom);if(ze.polygonIntersectsBox(Dr,0,0,ze.EXTENT,ze.EXTENT))return{queryGeometry:this,tilespaceGeometry:Ur,tilespaceRays:ai,bufferedTilespaceGeometry:Dr,bufferedTilespaceBounds:(Ji=ze.getBounds(Dr),Ji.min.x=ze.clamp(Ji.min.x,0,ze.EXTENT),Ji.min.y=ze.clamp(Ji.min.y,0,ze.EXTENT),Ji.max.x=ze.clamp(Ji.max.x,0,ze.EXTENT),Ji.max.y=ze.clamp(Ji.max.y,0,ze.EXTENT),Ji),tile:wt,tileID:wt.tileID,pixelToTileUnitsFactor:Yi};var Ji}_bufferedScreenMercator(ze,wt){const Rt=A(ze);if(this._screenRaycastCache[Rt])return this._screenRaycastCache[Rt];{const Xt=this.bufferedScreenGeometry(ze).map(ze=>wt.pointCoordinate3D(ze));return this._screenRaycastCache[Rt]=Xt,Xt}}_bufferedCameraMercator(ze,wt){const Rt=A(ze);if(this._cameraRaycastCache[Rt])return this._cameraRaycastCache[Rt];{const Xt=this.bufferedCameraGeometry(ze).map(ze=>wt.pointCoordinate3D(ze));return this._cameraRaycastCache[Rt]=Xt,Xt}}}function A(ze){return 100*ze|0}function P(wt,Rt,Xt){const r=function(sr,Dr){if(sr)return Xt(sr);if(Dr){const sr=ze.pick(ze.extend(Dr,wt),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);Dr.vector_layers&&(sr.vectorLayers=Dr.vector_layers,sr.vectorLayerIds=sr.vectorLayers.map(ze=>ze.id)),sr.tiles=Rt.canonicalizeTileset(sr,wt.url),Xt(null,sr)}};return wt.url?ze.getJSON(Rt.transformRequest(Rt.normalizeSourceURL(wt.url),ze.ResourceType.Source),r):ze.exported.frame(()=>r(null,wt))}class L{constructor(wt,Rt,Xt){this.bounds=ze.LngLatBounds.convert(this.validateBounds(wt)),this.minzoom=Rt||0,this.maxzoom=Xt||24}
vendor: 5,236 bytes, line 20
20validateBounds(ze){return Array.isArray(ze)&&4===ze.length?[Math.max(-180,ze[0]),Math.max(-90,ze[1]),Math.min(180,ze[2]),Math.min(90,ze[3])]:[-180,-90,180,90]}contains(wt){const Rt=Math.pow(2,wt.z),Xt=Math.floor(ze.mercatorXfromLng(this.bounds.getWest())*Rt),sr=Math.floor(ze.mercatorYfromLat(this.bounds.getNorth())*Rt),Dr=Math.ceil(ze.mercatorXfromLng(this.bounds.getEast())*Rt),Lr=Math.ceil(ze.mercatorYfromLat(this.bounds.getSouth())*Rt);return wt.x>=Xt&&wt.x<Dr&&wt.y>=sr&&wt.y<Lr}}class R{constructor(ze,wt,Rt){this.context=ze;const Xt=ze.gl;this.buffer=Xt.createBuffer(),this.dynamicDraw=Boolean(Rt),this.context.unbindVAO(),ze.bindElementBuffer.set(this.buffer),Xt.bufferData(Xt.ELEMENT_ARRAY_BUFFER,wt.arrayBuffer,this.dynamicDraw?Xt.DYNAMIC_DRAW:Xt.STATIC_DRAW),this.dynamicDraw||delete wt.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(ze){const wt=this.context.gl;this.context.unbindVAO(),this.bind(),wt.bufferSubData(wt.ELEMENT_ARRAY_BUFFER,0,ze.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const kn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class F{constructor(ze,wt,Rt,Xt){this.length=wt.length,this.attributes=Rt,this.itemSize=wt.bytesPerElement,this.dynamicDraw=Xt,this.context=ze;const sr=ze.gl;this.buffer=sr.createBuffer(),ze.bindVertexBuffer.set(this.buffer),sr.bufferData(sr.ARRAY_BUFFER,wt.arrayBuffer,this.dynamicDraw?sr.DYNAMIC_DRAW:sr.STATIC_DRAW),this.dynamicDraw||delete wt.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(ze){const wt=this.context.gl;this.bind(),wt.bufferSubData(wt.ARRAY_BUFFER,0,ze.arrayBuffer)}enableAttributes(ze,wt){for(let Rt=0;Rt<this.attributes.length;Rt++){const Xt=wt.attributes[this.attributes[Rt].name];void 0!==Xt&&ze.enableVertexAttribArray(Xt)}}setVertexAttribPointers(ze,wt,Rt){for(let Xt=0;Xt<this.attributes.length;Xt++){const sr=this.attributes[Xt],Dr=wt.attributes[sr.name];void 0!==Dr&&ze.vertexAttribPointer(Dr,sr.components,ze[kn[sr.type]],!1,this.itemSize,sr.offset+this.itemSize*(Rt||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class B{constructor(ze){this.gl=ze.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(ze){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class O extends B{getDefault(){return ze.Color.transparent}set(ze){const wt=this.current;(ze.r!==wt.r||ze.g!==wt.g||ze.b!==wt.b||ze.a!==wt.a||this.dirty)&&(this.gl.clearColor(ze.r,ze.g,ze.b,ze.a),this.current=ze,this.dirty=!1)}}class U extends B{getDefault(){return 1}set(ze){(ze!==this.current||this.dirty)&&(this.gl.clearDepth(ze),this.current=ze,this.dirty=!1)}}class N extends B{getDefault(){return 0}set(ze){(ze!==this.current||this.dirty)&&(this.gl.clearStencil(ze),this.current=ze,this.dirty=!1)}}class G extends B{getDefault(){return[!0,!0,!0,!0]}set(ze){const wt=this.current;(ze[0]!==wt[0]||ze[1]!==wt[1]||ze[2]!==wt[2]||ze[3]!==wt[3]||this.dirty)&&(this.gl.colorMask(ze[0],ze[1],ze[2],ze[3]),this.current=ze,this.dirty=!1)}}class Z extends B{getDefault(){return!0}set(ze){(ze!==this.current||this.dirty)&&(this.gl.depthMask(ze),this.current=ze,this.dirty=!1)}}class V extends B{getDefault(){return 255}set(ze){(ze!==this.current||this.dirty)&&(this.gl.stencilMask(ze),this.current=ze,this.dirty=!1)}}class j extends B{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(ze){const wt=this.current;(ze.func!==wt.func||ze.ref!==wt.ref||ze.mask!==wt.mask||this.dirty)&&(this.gl.stencilFunc(ze.func,ze.ref,ze.mask),this.current=ze,this.dirty=!1)}}class q extends B{getDefault(){const ze=this.gl;return[ze.KEEP,ze.KEEP,ze.KEEP]}set(ze){const wt=this.current;(ze[0]!==wt[0]||ze[1]!==wt[1]||ze[2]!==wt[2]||this.dirty)&&(this.gl.stencilOp(ze[0],ze[1],ze[2]),this.current=ze,this.dirty=!1)}}class W extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;ze?wt.enable(wt.STENCIL_TEST):wt.disable(wt.STENCIL_TEST),this.current=ze,this.dirty=!1}}class $ extends B{getDefault(){return[0,1]}set(ze){const wt=this.current;(ze[0]!==wt[0]||ze[1]!==wt[1]||this.dirty)&&(this.gl.depthRange(ze[0],ze[1]),this.current=ze,this.dirty=!1)}}class X extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;ze?wt.enable(wt.DEPTH_TEST):wt.disable(wt.DEPTH_TEST),this.current=ze,this.dirty=!1}}class H extends B{getDefault(){return this.gl.LESS}set(ze){(ze!==this.current||this.dirty)&&(this.gl.depthFunc(ze),this.current=ze,this.dirty=!1)}}class K extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;ze?wt.enable(wt.BLEND):wt.disable(wt.BLEND),this.current=ze,this.dirty=!1}}class Y extends B{getDefault(){const ze=this.gl;return[ze.ONE,ze.ZERO]}set(ze){const wt=this.current;(ze[0]!==wt[0]||ze[1]!==wt[1]||this.dirty)&&(this.gl.blendFunc(ze[0],ze[1]),this.current=ze,this.dirty=!1)}}class Q extends B{getDefault(){return ze.Color.transparent}set(ze){const wt=this.current;(ze.r!==wt.r||ze.g!==wt.g||ze.b!==wt.b||ze.a!==wt.a||this.dirty)&&(this.gl.blendColor
vendor: 10,716 bytes, line 20
20(ze.r,ze.g,ze.b,ze.a),this.current=ze,this.dirty=!1)}}class J extends B{getDefault(){return this.gl.FUNC_ADD}set(ze){(ze!==this.current||this.dirty)&&(this.gl.blendEquation(ze),this.current=ze,this.dirty=!1)}}class tt extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;ze?wt.enable(wt.CULL_FACE):wt.disable(wt.CULL_FACE),this.current=ze,this.dirty=!1}}class et extends B{getDefault(){return this.gl.BACK}set(ze){(ze!==this.current||this.dirty)&&(this.gl.cullFace(ze),this.current=ze,this.dirty=!1)}}class it extends B{getDefault(){return this.gl.CCW}set(ze){(ze!==this.current||this.dirty)&&(this.gl.frontFace(ze),this.current=ze,this.dirty=!1)}}class ot extends B{getDefault(){return null}set(ze){(ze!==this.current||this.dirty)&&(this.gl.useProgram(ze),this.current=ze,this.dirty=!1)}}class rt extends B{getDefault(){return this.gl.TEXTURE0}set(ze){(ze!==this.current||this.dirty)&&(this.gl.activeTexture(ze),this.current=ze,this.dirty=!1)}}class at extends B{getDefault(){const ze=this.gl;return[0,0,ze.drawingBufferWidth,ze.drawingBufferHeight]}set(ze){const wt=this.current;(ze[0]!==wt[0]||ze[1]!==wt[1]||ze[2]!==wt[2]||ze[3]!==wt[3]||this.dirty)&&(this.gl.viewport(ze[0],ze[1],ze[2],ze[3]),this.current=ze,this.dirty=!1)}}class nt extends B{getDefault(){return null}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.bindFramebuffer(wt.FRAMEBUFFER,ze),this.current=ze,this.dirty=!1}}class st extends B{getDefault(){return null}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.bindRenderbuffer(wt.RENDERBUFFER,ze),this.current=ze,this.dirty=!1}}class lt extends B{getDefault(){return null}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.bindTexture(wt.TEXTURE_2D,ze),this.current=ze,this.dirty=!1}}class ct extends B{getDefault(){return null}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.bindBuffer(wt.ARRAY_BUFFER,ze),this.current=ze,this.dirty=!1}}class ht extends B{getDefault(){return null}set(ze){const wt=this.gl;wt.bindBuffer(wt.ELEMENT_ARRAY_BUFFER,ze),this.current=ze,this.dirty=!1}}class dt extends B{constructor(ze){super(ze),this.vao=ze.extVertexArrayObject}getDefault(){return null}set(ze){this.vao&&(ze!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(ze),this.current=ze,this.dirty=!1)}}class ut extends B{getDefault(){return 4}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.pixelStorei(wt.UNPACK_ALIGNMENT,ze),this.current=ze,this.dirty=!1}}class _t extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.pixelStorei(wt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ze),this.current=ze,this.dirty=!1}}class pt extends B{getDefault(){return!1}set(ze){if(ze===this.current&&!this.dirty)return;const wt=this.gl;wt.pixelStorei(wt.UNPACK_FLIP_Y_WEBGL,ze),this.current=ze,this.dirty=!1}}class mt extends B{constructor(ze,wt){super(ze),this.context=ze,this.parent=wt}getDefault(){return null}}class ft extends mt{setDirty(){this.dirty=!0}set(ze){if(ze===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const wt=this.gl;wt.framebufferTexture2D(wt.FRAMEBUFFER,wt.COLOR_ATTACHMENT0,wt.TEXTURE_2D,ze,0),this.current=ze,this.dirty=!1}}class gt extends mt{attachment(){return this.gl.DEPTH_ATTACHMENT}set(ze){if(ze===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const wt=this.gl;wt.framebufferRenderbuffer(wt.FRAMEBUFFER,this.attachment(),wt.RENDERBUFFER,ze),this.current=ze,this.dirty=!1}}class vt extends gt{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class xt{constructor(ze,wt,Rt,Xt){this.context=ze,this.width=wt,this.height=Rt;const sr=this.framebuffer=ze.gl.createFramebuffer();this.colorAttachment=new ft(ze,sr),Xt&&(this.depthAttachment=new gt(ze,sr))}destroy(){const ze=this.context.gl,wt=this.colorAttachment.get();if(wt&&ze.deleteTexture(wt),this.depthAttachment){const wt=this.depthAttachment.get();wt&&ze.deleteRenderbuffer(wt)}ze.deleteFramebuffer(this.framebuffer)}}class yt{constructor(ze){this.gl=ze,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new O(this),this.clearDepth=new U(this),this.clearStencil=new N(this),this.colorMask=new G(this),this.depthMask=new Z(this),this.stencilMask=new V(this),this.stencilFunc=new j(this),this.stencilOp=new q(this),this.stencilTest=new W(this),this.depthRange=new $(this),this.depthTest=new X(this),this.depthFunc=new H(this),this.blend=new K(this),this.blendFunc=new Y(this),this.blendColor=new Q(this),this.blendEquation=new J(this),this.cullFace=new tt(this),this.cullFaceSide=new et(this),this.frontFace=new it(this),this.program=new ot(this),this.activeTexture=new rt(this),this.viewport=new at(this),this.bindFramebuffer=new nt(this),this.bindRenderbuffer=new st(this),this.bindTexture=new lt(this),this.bindVertexBuffer=new ct(this),this.bindElementBuffer=new ht(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new dt(this),this.pixelStoreUnpack=new ut(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new pt(this),this.extTextureFilterAnisotropic=ze.getExtension("EXT_texture_filter_anisotropic")||ze.getExtension("MOZ_EXT_texture_filter_anisotropic")||ze.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=ze.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extTextureHalfFloat=ze.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(ze.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=ze.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=ze.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=ze.getParameter(ze.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(ze,wt){return new R(this,ze,wt)}createVertexBuffer(ze,wt,Rt){return new F(this,ze,wt,Rt)}createRenderbuffer(ze,wt,Rt){const Xt=this.gl,sr=Xt.createRenderbuffer();return this.bindRenderbuffer.set(sr),Xt.renderbufferStorage(Xt.RENDERBUFFER,ze,wt,Rt),this.bindRenderbuffer.set(null),sr}createFramebuffer(ze,wt,Rt){return new xt(this,ze,wt,Rt)}clear({color:ze,depth:wt,stencil:Rt}){const Xt=this.gl;let sr=0;ze&&(sr|=Xt.COLOR_BUFFER_BIT,this.clearColor.set(ze),this.colorMask.set([!0,!0,!0,!0])),void 0!==wt&&(sr|=Xt.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(wt),this.depthMask.set(!0)),void 0!==Rt&&(sr|=Xt.STENCIL_BUFFER_BIT,this.clearStencil.set(Rt),this.stencilMask.set(255)),Xt.clear(sr)}setCullFace(ze){!1===ze.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(ze.mode),this.frontFace.set(ze.frontFace))}setDepthMode(ze){ze.func!==this.gl.ALWAYS||ze.mask?(this.depthTest.set(!0),this.depthFunc.set(ze.func),this.depthMask.set(ze.mask),this.depthRange.set(ze.range)):this.depthTest.set(!1)}setStencilMode(ze){ze.test.func!==this.gl.ALWAYS||ze.mask?(this.stencilTest.set(!0),this.stencilMask.set(ze.mask),this.stencilOp.set([ze.fail,ze.depthFail,ze.pass]),this.stencilFunc.set({func:ze.test.func,ref:ze.ref,mask:ze.test.mask})):this.stencilTest.set(!1)}setColorMode(wt){r(wt.blendFunction,ze.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(wt.blendFunction),this.blendColor.set(wt.blendColor)),this.colorMask.set(wt.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class bt extends ze.Evented{constructor(wt,Rt,Xt,sr){super(),this.id=wt,this.dispatcher=Xt,this.setEventedParent(sr),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=ze.extend({type:"raster"},Rt),ze.extend(this,ze.pick(Rt,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new ze.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=P(this._options,this.map._requestManager,(wt,Rt)=>{this._tileJSONRequest=null,this._loaded=!0,wt?this.fire(new ze.ErrorEvent(wt)):Rt&&(ze.extend(this,Rt),Rt.bounds&&(this.tileBounds=new L(Rt.bounds,this.minzoom,this.maxzoom)),ze.postTurnstileEvent(Rt.tiles),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(ze){this.map=ze,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return ze.extend({},this._options)}hasTile(ze){return!this.tileBounds||this.tileBounds.contains(ze.canonical)}loadTile(wt,Rt){const Xt=ze.exported.devicePixelRatio>=2,sr=this.map._requestManager.normalizeTileURL(wt.tileID.canonical.url(this.tiles,this.scheme),Xt,this.tileSize);wt.request=ze.getImage(this.map._requestManager.transformRequest(sr,ze.ResourceType.Tile),(Xt,sr,Dr,Lr)=>{if(delete wt.request,wt.aborted)wt.state="unloaded",Rt(null);else if(Xt)wt.state="errored",Rt(Xt);else if(sr){this.map._refreshExpiredTiles&&wt.setExpiryData({cac
20heControl:Dr,expires:Lr});const Xt=this.map.painter.context,Ur=Xt.gl;wt.texture=this.map.painter.getTileTexture(sr.width),wt.texture?wt.texture.update(sr,{useMipmap:!0}):(wt.texture=new ze.Texture(Xt,sr,Ur.RGBA,{useMipmap:!0}),wt.texture.bind(Ur.LINEAR,Ur.CLAMP_TO_EDGE,Ur.LINEAR_MIPMAP_NEAREST),Xt.extTextureFilterAnisotropic&&Ur.texParameterf(Ur.TEXTURE_2D,Xt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Xt.extTextureFilterAnisotropicMax)),wt.state="loaded",ze.cacheEntryPossiblyAdded(this.dispatcher),Rt(null)}})}abortTile(ze,wt){ze.request&&(ze.request.cancel(),delete ze.request),wt()}unloadTile(ze,wt){ze.texture&&this.map.painter.saveTileTexture(ze.texture),wt()}hasTransition(){return!1}}let jn;var Un=ze.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Et extends ze.Evented{constructor(ze,wt,Rt,Xt){super(),this.id=ze,this.dispatcher=Rt,this.coordinates=wt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Xt),this.options=wt}load(wt,Rt){this._loaded=!1,this.fire(new ze.Event("dataloading",{dataType:"source"})),this.url=this.options.url,ze.getImage(this.map._requestManager.transformRequest(this.url,ze.ResourceType.Image),(Xt,sr)=>{this._loaded=!0,Xt?this.fire(new ze.ErrorEvent(Xt)):sr&&(this.image=ze.exported.getImageData(sr),wt&&(this.coordinates=wt),Rt&&Rt(),this._finishLoading())})}loaded(){return this._loaded}updateImage(ze){return this.image&&ze.url?(this.options.url=ze.url,this.load(ze.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(ze){this.map=ze,this.load()}setCoordinates(wt){this.coordinates=wt;const Rt=wt.map(ze.MercatorCoordinate.fromLngLat);this.tileID=function(wt){let Rt=1/0,Xt=1/0,sr=-1/0,Dr=-1/0;for(const ze of wt)Rt=Math.min(Rt,ze.x),Xt=Math.min(Xt,ze.y),sr=Math.max(sr,ze.x),Dr=Math.max(Dr,ze.y);const Lr=Math.max(sr-Rt,Dr-Xt),Ur=Math.max(0,Math.floor(-Math.log(Lr)/Math.LN2)),qr=Math.pow(2,Ur);return new ze.CanonicalTileID(Ur,Math.floor((Rt+sr)/2*qr),Math.floor((Xt+Dr)/2*qr))}(Rt),this.minzoom=this.maxzoom=this.tileID.z;const Xt=Rt.map(ze=>this.tileID.getTilePoint(ze)._round());return this._boundsArray=new ze.StructArrayLayout4i8,this._boundsArray.emplaceBack(Xt[0].x,Xt[0].y,0,0),this._boundsArray.emplaceBack(Xt[1].x,Xt[1].y,ze.EXTENT,0),this._boundsArray.emplaceBack(Xt[3].x,Xt[3].y,0,ze.EXTENT),this._boundsArray.emplaceBack(Xt[2].x,Xt[2].y,ze.EXTENT,ze.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const wt=this.map.painter.context,Rt=wt.gl;this.boundsBuffer||(this.boundsBuffer=wt.createVertexBuffer(this._boundsArray,Un.members)),this.boundsSegments||(this.boundsSegments=ze.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ze.Texture(wt,this.image,Rt.RGBA),this.texture.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE));for(const ze in this.tiles){const wt=this.tiles[ze];"loaded"!==wt.state&&(wt.state="loaded",wt.texture=this.texture)}}loadTile(ze,wt){this.tileID&&this.tileID.equals(ze.tileID.canonical)?(this.tiles[String(ze.tileID.wrap)]=ze,ze.buckets={},wt(null)):(ze.state="errored",wt(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Wn={vector:class extends ze.Evented{constructor(wt,Rt,Xt,sr){if(super(),this.id=wt,this.dispatcher=Xt,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,ze.extend(this,ze.pick(Rt,["url","scheme","tileSize","promoteId"])),this._options=ze.extend({type:"vector"},Rt),this._collectResourceTiming=Rt.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(sr),this._tileWorkers={},this._deduped=new ze.DedupedRequest}load(){this._loaded=!1,this.fire(new ze.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=P(this._options,this.map._requestManager,(wt,Rt)=>{this._tileJSONRequest=null,this._loaded=!0,wt?this.fire(new ze.ErrorEvent(wt)):Rt&&(ze.extend(this,Rt),Rt.bounds&&(this.tileBounds=new L(Rt.bounds,this.minzoom,this.maxzoom)),ze.postTurnstileEvent(Rt.tiles,this.map._requestManager._customAccessToken),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ze.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(ze){return!this.tileBounds||this.tileBounds.contains(ze.canonical)}onAdd(ze){this.map=ze,this.load()}setSourceProperty(ze){this._tileJSONRequest&&this._tileJSONRequest.cancel(),ze();const wt=this.map.style._getSourceCaches(this.id);for(const ze of wt)ze.clearTiles();this.load()}setTiles(ze){return this.setSourceProperty(()=>{this._options.tiles=ze}),this}setUrl(ze){return this.setSourceProperty(()=>{this.url=ze,this._options.url=ze}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return ze.extend({},this._options)}loadTile(wt,Rt){const Xt=this.map._requestManager.normalizeTileURL(wt.tileID.canonical.url(this.tiles,this.scheme)),sr={request:this.map._requestManager.transformRequest(Xt,ze.ResourceType.Tile),data:void 0,uid:wt.uid,tileID:wt.tileID,tileZoom:wt.tileZoom,zoom:wt.tileID.overscaledZ,tileSize:this.tileSize*wt.tileID.overscaleFactor(),type:this.t
vendor: 21,527 bytes, line 20
20ype,source:this.id,pixelRatio:ze.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:wt.isSymbolTile};if(sr.request.collectResourceTiming=this._collectResourceTiming,wt.actor&&"expired"!==wt.state)"loading"===wt.state?wt.reloadCallback=Rt:wt.request=wt.actor.send("reloadTile",sr,a.bind(this));else if(wt.actor=this._tileWorkers[Xt]=this._tileWorkers[Xt]||this.dispatcher.getActor(),this.dispatcher.ready)wt.request=wt.actor.send("loadTile",sr,a.bind(this),void 0,!0);else{const Rt=ze.loadVectorTile.call({deduped:this._deduped},sr,(ze,Rt)=>{ze||!Rt?a.call(this,ze):(sr.data={cacheControl:Rt.cacheControl,expires:Rt.expires,rawData:Rt.rawData.slice(0)},wt.actor&&wt.actor.send("loadTile",sr,a.bind(this),void 0,!0))},!0);wt.request={cancel:Rt}}function a(Xt,sr){return delete wt.request,wt.aborted?Rt(null):Xt&&404!==Xt.status?Rt(Xt):(sr&&sr.resourceTiming&&(wt.resourceTiming=sr.resourceTiming),this.map._refreshExpiredTiles&&sr&&wt.setExpiryData(sr),wt.loadVectorData(sr,this.map.painter),ze.cacheEntryPossiblyAdded(this.dispatcher),Rt(null),void(wt.reloadCallback&&(this.loadTile(wt,wt.reloadCallback),wt.reloadCallback=null)))}}abortTile(ze){ze.request&&(ze.request.cancel(),delete ze.request),ze.actor&&ze.actor.send("abortTile",{uid:ze.uid,type:this.type,source:this.id})}unloadTile(ze){ze.unloadVectorData(),ze.actor&&ze.actor.send("removeTile",{uid:ze.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}},raster:bt,"raster-dem":class extends bt{constructor(wt,Rt,Xt,sr){super(wt,Rt,Xt,sr),this.type="raster-dem",this.maxzoom=22,this._options=ze.extend({type:"raster-dem"},Rt),this.encoding=Rt.encoding||"mapbox"}loadTile(wt,Rt){const Xt=this.map._requestManager.normalizeTileURL(wt.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(ze,Xt){ze&&(wt.state="errored",Rt(ze)),Xt&&(wt.dem=Xt,wt.dem.onDeserialize(),wt.needsHillshadePrepare=!0,wt.needsDEMTextureUpload=!0,wt.state="loaded",Rt(null))}wt.request=ze.getImage(this.map._requestManager.transformRequest(Xt,ze.ResourceType.Tile),function(Xt,sr,Dr,Lr){if(delete wt.request,wt.aborted)wt.state="unloaded",Rt(null);else if(Xt)wt.state="errored",Rt(Xt);else if(sr){this.map._refreshExpiredTiles&&wt.setExpiryData({cacheControl:Dr,expires:Lr});const Rt=ze.window.ImageBitmap&&sr instanceof ze.window.ImageBitmap&&(null==jn&&(jn=ze.window.OffscreenCanvas&&new ze.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof ze.window.createImageBitmap),jn),Xt=1-(sr.width-ze.prevPowerOfTwo(sr.width))/2;Xt<1||wt.neighboringTiles||(wt.neighboringTiles=this._getNeighboringTiles(wt.tileID));const Ur=Rt?sr:ze.exported.getImageData(sr,Xt),qr={uid:wt.uid,coord:wt.tileID,source:this.id,rawImageData:Ur,encoding:this.encoding,padding:Xt};wt.actor&&"expired"!==wt.state||(wt.actor=this.dispatcher.getActor(),wt.actor.send("loadDEMTile",qr,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(wt){const Rt=wt.canonical,Xt=Math.pow(2,Rt.z),sr=(Rt.x-1+Xt)%Xt,Dr=0===Rt.x?wt.wrap-1:wt.wrap,Lr=(Rt.x+1+Xt)%Xt,Ur=Rt.x+1===Xt?wt.wrap+1:wt.wrap,qr={};return qr[new ze.OverscaledTileID(wt.overscaledZ,Dr,Rt.z,sr,Rt.y).key]={backfilled:!1},qr[new ze.OverscaledTileID(wt.overscaledZ,Ur,Rt.z,Lr,Rt.y).key]={backfilled:!1},Rt.y>0&&(qr[new ze.OverscaledTileID(wt.overscaledZ,Dr,Rt.z,sr,Rt.y-1).key]={backfilled:!1},qr[new ze.OverscaledTileID(wt.overscaledZ,wt.wrap,Rt.z,Rt.x,Rt.y-1).key]={backfilled:!1},qr[new ze.OverscaledTileID(wt.overscaledZ,Ur,Rt.z,Lr,Rt.y-1).key]={backfilled:!1}),Rt.y+1<Xt&&(qr[new ze.OverscaledTileID(wt.overscaledZ,Dr,Rt.z,sr,Rt.y+1).key]={backfilled:!1},qr[new ze.OverscaledTileID(wt.overscaledZ,wt.wrap,Rt.z,Rt.x,Rt.y+1).key]={backfilled:!1},qr[new ze.OverscaledTileID(wt.overscaledZ,Ur,Rt.z,Lr,Rt.y+1).key]={backfilled:!1}),qr}unloadTile(ze){ze.demTexture&&this.map.painter.saveTileTexture(ze.demTexture),ze.fbo&&(ze.fbo.destroy(),delete ze.fbo),ze.dem&&delete ze.dem,delete ze.neighboringTiles,ze.state="unloaded"}},geojson:class extends ze.Evented{constructor(wt,Rt,Xt,sr){super(),this.id=wt,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=Xt.getActor(),this.setEventedParent(sr),this._data=Rt.data,this._options=ze.extend({},Rt),this._collectResourceTiming=Rt.collectResourceTiming,void 0!==Rt.maxzoom&&(this.maxzoom=Rt.maxzoom),Rt.type&&(this.type=Rt.type),Rt.attribution&&(this.attribution=Rt.attribution),this.promoteId=Rt.promoteId;const Dr=ze.EXTENT/this.tileSize;this.workerOptions=ze.extend({source:this.id,cluster:Rt.cluster||!1,geojsonVtOptions:{buffer:(void 0!==Rt.buffer?Rt.buffer:128)*Dr,tolerance:(void 0!==Rt.tolerance?Rt.tolerance:.375)*Dr,extent:ze.EXTENT,maxZoom:this.maxzoom,lineMetrics:Rt.lineMetrics||!1,generateId:Rt.generateId||!1},superclusterOptions:{maxZoom:void 0!==Rt.clusterMaxZoom?Rt.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,Rt.clusterMinPoints||2),extent:ze.EXTENT,radius:(void 0!==Rt.clusterRadius?Rt.clusterRadius:50)*Dr,log:!1,generateId:Rt.generateId||!1},clusterProperties:Rt.clusterProperties,filter:Rt.filter},Rt.workerOptions)}onAdd(ze){this.map=ze,this.setData(this._data)}setData(ze){return this._data=ze,this._updateWorkerData(),this}getClusterExpansionZoom(ze,wt){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:ze,source:this.id},wt),this}getClusterChildren(ze,wt){return this.actor.send("geojson.getClusterChildren",{clusterId:ze,source:this.id},wt),this}getClusterLeaves(ze,wt,Rt,Xt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:ze,limit:wt,offset:Rt},Xt),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new ze.Event("dataloading",{dataType:"source"})),this._loaded=!1;const wt=ze.extend({},this.workerOptions),Rt=this._data;"string"==typeof Rt?(wt.request=this.map._requestManager.transformRequest(ze.exported.resolveURL(Rt),ze.ResourceType.Source),wt.request.collectResourceTiming=this._collectResourceTiming):wt.data=JSON.stringify(Rt),this._pendingLoad=this.actor.send(`${this.type}.loadData`,wt,(wt,Rt)=>{if(this._loaded=!0,this._pendingLoad=null,wt)this.fire(new ze.ErrorEvent(wt));else{const wt={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&Rt&&Rt.resourceTiming&&Rt.resourceTiming[this.id]&&(wt.resourceTiming=Rt.resourceTiming[this.id]),this.fire(new ze.Event("data",wt)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(wt,Rt){const Xt=wt.actor?"reloadTile":"loadTile";wt.actor=this.actor,wt.request=this.actor.send(Xt,{type:this.type,uid:wt.uid,tileID:wt.tileID,tileZoom:wt.tileZoom,zoom:wt.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:ze.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(ze,sr)=>(delete wt.request,wt.unloadVectorData(),wt.aborted?Rt(null):ze?Rt(ze):(wt.loadVectorData(sr,this.map.painter,"reloadTile"===Xt),Rt(null))),void 0,"loadTile"===Xt)}abortTile(ze){ze.request&&(ze.request.cancel(),delete ze.request),ze.aborted=!0}unloadTile(ze){ze.unloadVectorData(),this.actor.send("removeTile",{uid:ze.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return ze.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Et{constructor(ze,wt,Rt,Xt){super(ze,wt,Rt,Xt),this.roundZoom=!0,this.type="video",this.options=wt}load(){this._loaded=!1;const wt=this.options;this.urls=[];for(const Rt of wt.urls)this.urls.push(this.map._requestManager.transformRequest(Rt,ze.ResourceType.Source).url);ze.getVideo(this.urls,(wt,Rt)=>{this._loaded=!0,wt?this.fire(new ze.ErrorEvent(wt)):Rt&&(this.video=Rt,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(wt){if(this.video){const Rt=this.video.seekable;wt<Rt.start(0)||wt>Rt.end(0)?this.fire(new ze.ErrorEvent(new ze.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${Rt.start(0)} and ${Rt.end(0)}-second mark.`))):this.video.currentTime=wt}}getVideo(){return this.video}onAdd(ze){this.map||(this.map=ze,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 wt=this.map.painter.context,Rt=wt.gl;this.boundsBuffer||(this.boundsBuffer=wt.createVertexBuffer(this._boundsArray,Un.members)),this.boundsSegments||(this.boundsSegments=ze.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE),Rt.texSubImage2D(Rt.TEXTURE_2D,0,0,0,Rt.RGBA,Rt.UNSIGNED_BYTE,this.video)):(this.texture=new ze.Texture(wt,this.video,Rt.RGBA),this.texture.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE));for(const ze in this.tiles){const wt=this.tiles[ze];"loaded"!==wt.state&&(wt.state="loaded",wt.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Et,canvas:class extends Et{constructor(wt,Rt,Xt,sr){super(wt,Rt,Xt,sr),Rt.coordinates?Array.isArray(Rt.coordinates)&&4===Rt.coordinates.length&&!Rt.coordinates.some(ze=>!Array.isArray(ze)||2!==ze.length||ze.some(ze=>"number"!=typeof ze))||this.fire(new ze.ErrorEvent(new ze.ValidationError(`sources.${wt}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new ze.ErrorEvent(new ze.ValidationError(`sources.${wt}`,null,'missing required property "coordinates"'))),Rt.animate&&"boolean"!=typeof Rt.animate&&this.fire(new ze.ErrorEvent(new ze.ValidationError(`sources.${wt}`,null,'optional "animate" property must be a boolean value'))),Rt.canvas?"string"==typeof Rt.canvas||Rt.canvas instanceof ze.window.HTMLCanvasElement||this.fire(new ze.ErrorEvent(new ze.ValidationError(`sources.${wt}`,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 ze.ErrorEvent(new ze.ValidationError(`sources.${wt}`,null,'missing required property "canvas"'))),this.options=Rt,this.animate=void 0===Rt.animate||Rt.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof ze.window.HTMLCanvasElement?this.options.canvas:ze.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new ze.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(ze){this.map=ze,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let wt=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,wt=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,wt=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const Rt=this.map.painter.context,Xt=Rt.gl;this.boundsBuffer||(this.boundsBuffer=Rt.createVertexBuffer(this._boundsArray,Un.members)),this.boundsSegments||(this.boundsSegments=ze.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(wt||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ze.Texture(Rt,this.canvas,Xt.RGBA,{premultiply:!0});for(const ze in this.tiles){const wt=this.tiles[ze];"loaded"!==wt.state&&(wt.state="loaded",wt.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const ze of[this.canvas.width,this.canvas.height])if(isNaN(ze)||ze<=0)return!0;return!1}}},St=function(wt,Rt,Xt,sr){const Dr=new Wn[Rt.type](wt,Rt,Xt,sr);if(Dr.id!==wt)throw new Error(`Expected Source id to be ${wt} instead of ${Dr.id}`);return ze.bindAll(["load","abort","unload","serialize","prepare"],Dr),Dr};function It(wt,Rt){const Xt=ze.identity([]);return ze.scale$1(Xt,Xt,[.5*wt.width,.5*-wt.height,1]),ze.translate(Xt,Xt,[1,-1,0]),ze.multiply(Xt,Xt,wt.calculateProjMatrix(Rt.toUnwrapped()))}function Mt(ze,wt,Rt,Xt,sr,Dr,Lr,Ur=!1){const qr=ze.tilesIn(Xt,Lr,Ur);qr.sort(Dt);const ri=[];for(const Xt of qr)ri.push({wrappedTileID:Xt.tile.tileID.wrapped().key,queryResults:Xt.tile.queryRenderedFeatures(wt,Rt,ze._state,Xt,sr,Dr,It(ze.transform,Xt.tile.tileID),Ur)});const ai=function(ze){const wt={},Rt={};for(const Xt of ze){const ze=Xt.queryResults,sr=Xt.wrappedTileID,Dr=Rt[sr]=Rt[sr]||{};for(const Rt in ze){const Xt=ze[Rt],sr=Dr[Rt]=Dr[Rt]||{},Lr=wt[Rt]=wt[Rt]||[];for(const ze of Xt)sr[ze.featureIndex]||(sr[ze.featureIndex]=!0,Lr.push(ze))}}return wt}(ri);for(const wt in ai)ai[wt].forEach(wt=>{const Rt=wt.feature,Xt=ze.getFeatureState(Rt.layer["source-layer"],Rt.id);Rt.source=Rt.layer.source,Rt.layer["source-layer"]&&(Rt.sourceLayer=Rt.layer["source-layer"]),Rt.state=Xt});return ai}function zt(ze,wt){const Rt=ze.getRenderableIds().map(wt=>ze.getTileByID(wt)),Xt=[],sr={};for(let ze=0;ze<Rt.length;ze++){const Dr=Rt[ze],Lr=Dr.tileID.canonical.key;sr[Lr]||(sr[Lr]=!0,Dr.querySourceFeatures(Xt,wt))}return Xt}function Dt(ze,wt){const Rt=ze.tileID,Xt=wt.tileID;return Rt.overscaledZ-Xt.overscaledZ||Rt.canonical.y-Xt.canonical.y||Rt.wrap-Xt.wrap||Rt.canonical.x-Xt.canonical.x}function At(){return null!=vu.workerClass?new vu.workerClass:new ze.window.Worker(vu.workerUrl)}const Yn="mapboxgl_preloaded_worker_pool";class Lt{constructor(){this.active={}}acquire(ze){if(!this.workers)for(this.workers=[];this.workers.length<Lt.workerCount;)this.workers.push(new At);return this.active[ze]=!0,this.workers.slice()}release(ze){delete this.active[ze],0===this.numActive()&&(this.workers.forEach(ze=>{ze.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Yn]}numActive(){return Object.keys(this.active).length}}let Jn;function kt(){return Jn||(Jn=new Lt),Jn}function Ft(wt,Rt){const Xt={};for(const ze in wt)"ref"!==ze&&(Xt[ze]=wt[ze]);return ze.refProperties.forEach(ze=>{ze in Rt&&(Xt[ze]=Rt[ze])}),Xt}function Bt(ze){ze=ze.slice();const wt=Object.create(null);for(let Rt=0;Rt<ze.length;Rt++)wt[ze[Rt].id]=ze[Rt];for(let Rt=0;Rt<ze.length;Rt++)"ref"in ze[Rt]&&(ze[Rt]=Ft(ze[Rt],wt[ze[Rt].ref]));return ze}Lt.workerCount=2;const Qn={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog"};function Ut(ze,wt,Rt){Rt.push({command:Qn.addSource,args:[ze,wt[ze]]})}function Nt(ze,wt,Rt){wt.push({command:Qn.removeSource,args:[ze]}),Rt[ze]=!0}function Gt(ze,wt,Rt,Xt){Nt(ze,Rt,Xt),Ut(ze,wt,Rt)}function Zt(ze,wt,Rt){let Xt;for(Xt in ze[Rt])if(ze[Rt].hasOwnProperty(Xt)&&"data"!==Xt&&!r(ze[Rt][Xt],wt[Rt][Xt]))return!1;for(Xt in wt[Rt])if(wt[Rt].hasOwnProperty(Xt)&&"data"!==Xt&&!r(ze[Rt][Xt],wt[Rt][Xt]))return!1;return!0}function Vt(ze,wt,Rt,Xt,sr,Dr){let Lr;for(Lr in wt=wt||{},ze=ze||{})ze.hasOwnProperty(Lr)&&(r(ze[Lr],wt[Lr])||Rt.push({command:Dr,args:[Xt,Lr,wt[Lr],sr]}));for(Lr in wt)wt.hasOwnProperty(Lr)&&!ze.hasOwnProperty(Lr)&&(r(ze[Lr],wt[Lr])||Rt.push({command:Dr,args:[Xt,Lr,wt[Lr],sr]}))}function jt(ze){return ze.id}function qt(ze,wt){return ze[wt.id]=wt,ze}class Wt{constructor(ze,wt){this.reset(ze,wt)}reset(ze,wt){this.points=ze||[],this._distances=[0];for(let ze=1;ze<this.points.length;ze++)this._distances[ze]=this._distances[ze-1]+this.points[ze].dist(this.points[ze-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(wt||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(wt){if(1===this.points.length)return this.points[0];wt=ze.clamp(wt,0,1);let Rt=1,Xt=this._distances[Rt];const sr=wt*this.paddedLength+this.padding;for(;Xt<sr&&Rt<this._distances.length;)Xt=this._distances[++Rt];const Dr=Rt-1,Lr=this._distances[Dr],Ur=Xt-Lr,qr=Ur>0?(sr-Lr)/Ur:0;return this.points[Dr].mult(1-qr).add(this.points[Rt].mult(qr))}}class $t{constructor(ze,wt,Rt){const Xt=this.boxCells=[],sr=this.circleCells=[];this.xCellCount=Math.ceil(ze/Rt),this.yCellCount=Math.ceil(wt/Rt);for(let ze=0;ze<this.xCellCount*this.yCellCount;ze++)Xt.push([]),sr.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=ze,this.height=wt,this.xScale=this.xCellCount/ze,this.yScale=this.yCellCount/wt,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(ze,wt,Rt,Xt,sr){this._forEachCell(wt,Rt,Xt,sr,this._insertBoxCell,this.boxUid++),this.boxKeys.push(ze),this.bboxes.push(wt),this.bboxes.push(Rt),this.bboxes.push(Xt),this.bboxes.push(sr)}insertCircle(ze,wt,Rt,Xt){this._forEachCell(wt-Xt,Rt-Xt,wt+Xt,Rt+Xt,this._insertCircleCell,this.circleUid++),this.circleKeys.push(ze),this.circles.push(wt),this.circles.push(Rt),this.circles.push(Xt)}_insertBoxCell(ze,wt,Rt,Xt,sr,Dr){this.boxCells[sr].push(Dr)}_insertCircleCell(ze,wt,Rt,Xt,sr,Dr){this.circleCells[sr].push(Dr)}_query(ze,wt,Rt,Xt,sr,Dr){if(Rt<0||ze>this.width||Xt<0||wt>this.height)return!sr&&[];const Lr=[];if(ze<=0&&wt<=0&&this.width<=Rt&&this.height<=Xt){if(sr)return!0;for(let ze=0;ze<this.boxKeys.length;ze++)Lr.push({key:this.boxKeys[ze],x1:this.bboxes[4*ze],y1:this.bboxes[4*ze+1],x2:this.bboxes[4*ze+2],y2:this.bboxes[4*ze+3]});for(let ze=0;ze<this.circleKeys.length;ze++){const wt=this.circles[3*ze],Rt=this.circles[3*ze+1],Xt=this.circles[3*ze+2];Lr.push({key:this.circleKeys[ze],x1:wt-Xt,y1:Rt-Xt,x2:wt+Xt,y2:Rt+Xt})}return Dr?Lr.filter(Dr):Lr}return this._forEachCell(ze,wt,Rt,Xt,this._queryCell,Lr,{hitTest:sr,seenUids:{box:{},circle:{}}},Dr),sr?Lr.length>0:Lr}_queryCircle(ze,wt,Rt,Xt,sr){const Dr=ze-Rt,Lr=ze+Rt,Ur=wt-Rt,qr=wt+Rt;if(Lr<0||Dr>this.width||qr<0||Ur>this.height)return!Xt&&[];const ri=[];return this._forEachCell(Dr,Ur,Lr,qr,this._queryCellCircle,ri,{hitTest:Xt,circle:{x:ze,y:wt,radius:Rt},seenUids:{box:{},circle:{}}},sr),Xt?ri.length>0:ri}query(ze,wt,Rt,Xt,sr){return this._query(ze,wt,Rt,Xt,!1,sr)}hitTest(ze,wt,Rt,Xt,sr){return this._query(ze,wt,Rt,Xt,!0,sr)}hitTestCircle(ze,wt,Rt,Xt){return this._queryCircle(ze,wt,Rt,!0,Xt)}_queryCell(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=Lr.seenUids,ri=this.boxCells[sr];if(null!==ri){const sr=this.bboxes;for(const ai of ri)if(!qr.box[ai]){qr.box[ai]=!0;const ri=4*ai;if(ze<=sr[ri+2]&&wt<=sr[ri+3]&&Rt>=sr[ri+0]&&Xt>=sr[ri+1]&&(!Ur||Ur(this.boxKeys[ai]))){if(Lr.hitTest)return Dr.push(!0),!0;Dr.push({key:this.boxKeys[ai],x1:sr[ri],y1:sr[ri+1],x2:sr[ri+2],y2:sr[ri+3]})}}}const ai=this.circleCells[sr];if(null!==ai){const sr=this.circles;for(const ri of ai)if(!qr.circle[ri]){qr.circle[ri]=!0;const ai=3*ri;if(this._circleAndRectCollide(sr[ai],sr[ai+1],sr[ai+2],ze,wt,Rt,Xt)&&(!Ur||Ur(this.circleKeys[ri]))){if(Lr.hitTest)return Dr.push(!0),!0;{const ze=sr[ai],wt=sr[ai+1],Rt=sr[ai+2];Dr.push({key:this.circleKeys[ri],x1:ze-Rt,y1:wt-Rt,x2:ze+Rt,y2:wt+Rt})}}}}}_queryCellCircle(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=Lr.circle,ri=Lr.seenUids,ai=this.boxCells[sr];if(null!==ai){const ze=this.bboxes;for(const wt of ai)if(!ri.box[wt]){ri.box[wt]=!0;const Rt=4*wt;if(this._circleAndRectCollide(qr.x,qr.y,qr.radius,ze[Rt+0],ze[Rt+1],ze[Rt+2],ze[Rt+3])&&(!Ur||Ur(this.boxKeys[wt])))return Dr.push(!0),!0}}const Yi=this.circleCells[sr];if(null!==Yi){const ze=this.circles;for(const wt of Yi)if(!ri.circle[wt]){ri.circle[wt]=!0;const Rt=3*wt;if(this._circlesCollide(ze[Rt],ze[Rt+1],ze[Rt+2],qr.x,qr.y,qr.radius)&&(!Ur||Ur(this.circleKeys[wt])))return Dr.push(!0),!0}}}_forEachCell(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=this._convertToXCellCoord(ze),ri=this._convertToYCellCoord(wt),ai=this._convertToXCellCoord(Rt),Yi=this._convertToYCellCoord(Xt);for(let Ji=qr;Ji<=ai;Ji++)for(let qr=ri;qr<=Yi;qr++)if(sr.call(this,ze,wt,Rt,Xt,this.xCellCount*qr+Ji,Dr,Lr,Ur))return}_convertToXCellCoord(ze){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(ze*this.xScale)))}_convertToYCellCoord(ze){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(ze*this.yScale)))}_circlesCollide(ze,wt,Rt,Xt,sr,Dr){const Lr=Xt-ze,Ur=sr-wt,qr=Rt+Dr;return qr*qr>Lr*Lr+Ur*Ur}_circleAndRectCollide(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=(Dr-Xt)/2,qr=Math.abs(ze-(Xt+Ur));if(qr>Ur+Rt)return!1;const ri=(Lr-sr)/2,ai=Math.abs(wt-(sr+ri));if(ai>ri+Rt)return!1;if(qr<=Ur||ai<=ri)return!0;const Yi=qr-Ur,Ji=ai-ri;return Yi*Yi+Ji*Ji<=Rt*Rt}}const Io=Math.tan(85*Math.PI/180);function Ht(wt,Rt,Xt,sr,Dr){const Lr=ze.create$1();return Rt?(ze.scale$1(Lr,Lr,[1/Dr,1/Dr,1]),Xt||ze.rotateZ(Lr,Lr,sr.angle)):ze.multiply(Lr,sr.labelPlaneMatrix,wt),Lr}function Kt(wt,Rt,Xt,sr,Dr){if(Rt){const Rt=ze.clone$1(wt);return ze.scale$1(Rt,Rt,[Dr,Dr,1]),Xt||ze.rotateZ(Rt,Rt,-sr.angle),Rt}return sr.glCoordMatrix}function Yt(wt,Rt,Xt=0){const sr=[wt.x,wt.y,Xt,1];Xt?ze.transformMat4(sr,sr,Rt):le(sr,sr,Rt);const Dr=sr[3];
20return{point:new ze.pointGeometry(sr[0]/Dr,sr[1]/Dr),signedDistanceFromCamera:Dr}}function Qt(ze,wt){return Math.min(.5+ze/wt*.5,1.5)}function Jt(ze,wt){const Rt=ze[0]/ze[3],Xt=ze[1]/ze[3];return Rt>=-wt[0]&&Rt<=wt[0]&&Xt>=-wt[1]&&Xt<=wt[1]}function te(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri){const ai=sr?wt.textSizeData:wt.iconSizeData,Yi=ze.evaluateSizeForZoom(ai,Xt.transform.zoom),Ji=[256/Xt.width*2+1,256/Xt.height*2+1],Qi=sr?wt.text.dynamicLayoutVertexArray:wt.icon.dynamicLayoutVertexArray;Qi.clear();const kn=wt.lineVertexArray,jn=sr?wt.text.placedSymbolArray:wt.icon.placedSymbolArray,Un=Xt.transform.width/Xt.transform.height;let Wn=!1;for(let sr=0;sr<jn.length;sr++){const Yn=jn.get(sr);if(Yn.writingMode!==ze.WritingMode.vertical||Wn||0!==sr&&jn.get(sr-1).writingMode===ze.WritingMode.horizontal||(Wn=!0),Yn.hidden||Yn.writingMode===ze.WritingMode.vertical&&!Wn){se(Yn.numGlyphs,Qi);continue}Wn=!1;const Jn=ri?ri({x:Yn.anchorX,y:Yn.anchorY}):0,Qn=[Yn.anchorX,Yn.anchorY,Jn,1];if(ze.transformMat4(Qn,Qn,Rt),!Jt(Qn,Ji)){se(Yn.numGlyphs,Qi);continue}const Io=Qt(Xt.transform.cameraToCenterDistance,Qn[3]),Mo=ze.evaluateSizeForFeature(ai,Yi,Yn),jo=Ur?Mo/Io:Mo*Io,zo=new ze.pointGeometry(Yn.anchorX,Yn.anchorY),oa=Yt(zo,Dr,Jn);if(oa.signedDistanceFromCamera<=0){se(Yn.numGlyphs,Qi);continue}const la=oa.point;let ca={};const ua=Ur?null:ri,ha=oe(Yn,jo,!1,qr,Rt,Dr,Lr,wt.glyphOffsetArray,kn,Qi,la,zo,ca,Un,ua);Wn=ha.useVertical,ua&&ha.needsFlipping&&(ca={}),(ha.notEnoughRoom||Wn||ha.needsFlipping&&oe(Yn,jo,!0,qr,Rt,Dr,Lr,wt.glyphOffsetArray,kn,Qi,la,zo,ca,Un,ua).notEnoughRoom)&&se(Yn.numGlyphs,Qi)}sr?wt.text.dynamicLayoutVertexBuffer.updateData(Qi):wt.icon.dynamicLayoutVertexBuffer.updateData(Qi)}function ee(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji){const Qi=Ur.glyphStartIndex+Ur.numGlyphs,kn=Ur.lineStartIndex,jn=Ur.lineStartIndex+Ur.lineLength,Un=wt.getoffsetX(Ur.glyphStartIndex),Wn=wt.getoffsetX(Qi-1),Yn=ae(ze*Un,Rt,Xt,sr,Dr,Lr,Ur.segment,kn,jn,qr,ri,ai,Yi,Ji,!0);if(!Yn)return null;const Jn=ae(ze*Wn,Rt,Xt,sr,Dr,Lr,Ur.segment,kn,jn,qr,ri,ai,Yi,Ji,!0);return Jn?{first:Yn,last:Jn}:null}function ie(wt,Rt,Xt,sr){return wt.writingMode===ze.WritingMode.horizontal&&Math.abs(Xt.y-Rt.y)>Math.abs(Xt.x-Rt.x)*sr?{useVertical:!0}:wt.writingMode===ze.WritingMode.vertical?Rt.y<Xt.y?{needsFlipping:!0}:null:0!==wt.flipState&&function(ze,wt,Rt){const Xt=(wt.x-ze.x)*Rt;return 0===Xt||Math.abs((wt.y-ze.y)/Xt)>Io}(Rt,Xt,sr)?1===wt.flipState?{needsFlipping:!0}:null:Rt.x>Xt.x?{needsFlipping:!0}:null}function oe(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn){const Un=Rt/24,Wn=wt.lineOffsetX*Un,Yn=wt.lineOffsetY*Un;let Jn;if(wt.numGlyphs>1){const ze=wt.glyphStartIndex+wt.numGlyphs,Rt=wt.lineStartIndex,Dr=wt.lineStartIndex+wt.lineLength,ai=ee(Un,qr,Wn,Yn,Xt,Yi,Ji,wt,ri,Lr,Qi,jn);if(!ai)return{notEnoughRoom:!0};const Qn=Yt(ai.first.point,Ur).point,Io=Yt(ai.last.point,Ur).point;if(sr&&!Xt){const ze=ie(wt,Qn,Io,kn);if(wt.flipState=ze&&ze.needsFlipping?1:2,ze)return ze}Jn=[ai.first];for(let sr=wt.glyphStartIndex+1;sr<ze-1;sr++)Jn.push(ae(Un*qr.getoffsetX(sr),Wn,Yn,Xt,Yi,Ji,wt.segment,Rt,Dr,ri,Lr,Qi,jn));Jn.push(ai.last)}else{if(sr&&!Xt){const Rt=Yt(Ji,Dr).point,Xt=wt.lineStartIndex+wt.segment+1,sr=new ze.pointGeometry(ri.getx(Xt),ri.gety(Xt)),Lr=Yt(sr,Dr),Ur=ie(wt,Rt,Lr.signedDistanceFromCamera>0?Lr.point:re(Ji,sr,Rt,1,Dr),kn);if(wt.flipState=Ur&&Ur.needsFlipping?1:2,Ur)return Ur}const Rt=ae(Un*qr.getoffsetX(wt.glyphStartIndex),Wn,Yn,Xt,Yi,Ji,wt.segment,wt.lineStartIndex,wt.lineStartIndex+wt.lineLength,ri,Lr,Qi,jn);if(!Rt)return{notEnoughRoom:!0};Jn=[Rt]}for(const wt of Jn)ze.addDynamicAttributes(ai,wt.point,wt.angle);return{}}function re(ze,wt,Rt,Xt,sr,Dr){const Lr=ze.add(ze.sub(wt)._unit()),Ur=Yt(Lr,sr,Dr?Dr(Lr):0).point,qr=Rt.sub(Ur);return Rt.add(qr._mult(Xt/qr.mag()))}function ae(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn){const Un=sr?wt-Rt:wt+Rt;let Wn=Un>0?1:-1,Yn=0;sr&&(Wn*=-1,Yn=Math.PI),Wn<0&&(Yn+=Math.PI);let Jn=Wn>0?qr+Ur:qr+Ur+1,Qn=Dr,Io=Dr,Mo=0,jo=0;const zo=Math.abs(Un),oa=[],la=[];let ca=Lr;const M=()=>{const wt=Jn-Wn;return 0===Mo?Lr:new ze.pointGeometry(ai.getx(wt),ai.gety(wt))},z=()=>re(M(),ca,Io,zo-Mo+1,Yi,Qi);for(;Mo+jo<=zo;){if(Jn+=Wn,Jn<qr||Jn>=ri)return null;if(Io=Qn,oa.push(Qn),kn&&la.push(ca||M()),Qn=Ji[Jn],void 0===Qn){ca=new ze.pointGeometry(ai.getx(Jn),ai.gety(Jn));const wt=Yt(ca,Yi,Qi?Qi(ca):0);Qn=wt.signedDistanceFromCamera>0?Ji[Jn]=wt.point:z()}else ca=null;Mo+=jo,jo=Io.dist(Qn)}jn&&Qi&&(ca=ca||new ze.pointGeometry(ai.getx(Jn),ai.gety(Jn)),Ji[Jn]=Qn=void 0===Ji[Jn]?Qn:z(),jo=Io.dist(Qn));const ua=(zo-Mo)/jo,ha=Qn.sub(Io),pa=ha.mult(ua)._add(Io);Xt&&pa._add(ha._unit()._perp()._mult(Xt*Wn));const _a=Yn+Math.atan2(Qn.y-Io.y,Qn.x-Io.x);return oa.push(pa),kn&&(ca=ca||new ze.pointGeometry(ai.getx(Jn),ai.gety(Jn)),la.push(function(wt,Rt,Xt){const sr=1-Xt;return new ze.pointGeometry(wt.x*sr+Rt.x*Xt,wt.y*sr+Rt.y*Xt)}(la.length>0?la[la.length-1]:ca,ca,ua))),{point:pa,angle:_a,path:oa,tilePath:la}}const Mo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function se(ze,wt){for(let Rt=0;Rt<ze;Rt++){const ze=wt.length;wt.resize(ze+4),wt.float32.set(Mo,3*ze)}}function le(ze,wt,Rt){const Xt=wt[0],sr=wt[1];return ze[0]=Rt[0]*Xt+Rt[4]*sr+Rt[12],ze[1]=Rt[1]*Xt+Rt[5]*sr+Rt[13],ze[3]=Rt[3]*Xt+Rt[7]*sr+Rt[15],ze}const jo=100;class he{constructor(ze,wt,Rt=new $t(ze.width+200,ze.height+200,25),Xt=new $t(ze.width+200,ze.height+200,25)){this.transform=ze,this.grid=Rt,this.ignoredGrid=Xt,this.pitchfactor=Math.cos(ze._pitch)*ze.cameraToCenterDistance,this.screenRightBoundary=ze.width+jo,this.screenBottomBoundary=ze.height+jo,this.gridRightBoundary=ze.width+200,this.gridBottomBoundary=ze.height+200,this.fogState=wt}placeCollisionBox(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=this.projectAndGetPerspectiveRatio(Dr,wt.anchorPointX,wt.anchorPointY,wt.elevation,wt.tileID),qr=sr*Ur.perspectiveRatio,ri=(wt.x1*ze+Rt.x-wt.padding)*qr+Ur.point.x,ai=(wt.y1*ze+Rt.y-wt.padding)*qr+Ur.point.y,Yi=(wt.x2*ze+Rt.x+wt.padding)*qr+Ur.point.x,Ji=(wt.y2*ze+Rt.y+wt.padding)*qr+Ur.point.y,Qi=Ur.perspectiveRatio<=.55||Ur.aboveHorizon;return!this.isInsideGrid(ri,ai,Yi,Ji)||!Xt&&this.grid.hitTest(ri,ai,Yi,Ji,Lr)||Qi?{box:[],offscreen:!1}:{box:[ri,ai,Yi,Ji],offscreen:this.isOffscreen(ri,ai,Yi,Ji)}}placeCollisionCircles(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn){const jn=[],Un=this.transform.elevation,Wn=Un?ze=>
20Un.getAtTileOffset(kn,ze.x,ze.y):ze=>0,Yn=new ze.pointGeometry(Rt.anchorX,Rt.anchorY),Jn=Wn(Yn),Qn=this.projectAndGetPerspectiveRatio(Lr,Yn.x,Yn.y,Jn,kn),{perspectiveRatio:Io}=Qn,Mo=(ai?Dr/Io:Dr*Io)/ze.ONE_EM,zo=Yt(Yn,Ur,Jn).point,oa=Qn.signedDistanceFromCamera>0?ee(Mo,sr,Rt.lineOffsetX*Mo,Rt.lineOffsetY*Mo,!1,zo,Yn,Rt,Xt,Ur,{},Un&&!ai?Wn:null,ai&&!!Un):null;let la=!1,ca=!1,ua=!0;if(oa&&!Qn.aboveHorizon){const Rt=.5*Ji*Io+Qi,Xt=new ze.pointGeometry(-100,-100),sr=new ze.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),Dr=new Wt,Lr=oa.first,Ur=oa.last;let ai=[];for(let ze=Lr.path.length-1;ze>=1;ze--)ai.push(Lr.path[ze]);for(let ze=1;ze<Ur.path.length;ze++)ai.push(Ur.path[ze]);const kn=2.5*Rt;if(qr){const ze=ai.map(Un?(ze,wt)=>{const Rt=Wn(wt<Lr.path.length-1?Lr.tilePath[Lr.path.length-1-wt]:Ur.tilePath[wt-Lr.path.length+2]);return Yt(ze,qr,Rt)}:ze=>Yt(ze,qr));ai=ze.some(ze=>ze.signedDistanceFromCamera<=0)?[]:ze.map(ze=>ze.point)}let Yn=[];if(ai.length>0){const wt=ai[0].clone(),Rt=ai[0].clone();for(let ze=1;ze<ai.length;ze++)wt.x=Math.min(wt.x,ai[ze].x),wt.y=Math.min(wt.y,ai[ze].y),Rt.x=Math.max(Rt.x,ai[ze].x),Rt.y=Math.max(Rt.y,ai[ze].y);Yn=wt.x>=Xt.x&&Rt.x<=sr.x&&wt.y>=Xt.y&&Rt.y<=sr.y?[ai]:Rt.x<Xt.x||wt.x>sr.x||Rt.y<Xt.y||wt.y>sr.y?[]:ze.clipLine([ai],Xt.x,Xt.y,sr.x,sr.y)}for(const ze of Yn){Dr.reset(ze,.25*Rt);let Xt=0;Xt=Dr.length<=.5*Rt?1:Math.ceil(Dr.paddedLength/kn)+1;for(let ze=0;ze<Xt;ze++){const sr=ze/Math.max(Xt-1,1),Lr=Dr.lerp(sr),Ur=Lr.x+jo,qr=Lr.y+jo;jn.push(Ur,qr,Rt,0);const ai=Ur-Rt,Ji=qr-Rt,Qi=Ur+Rt,kn=qr+Rt;if(ua=ua&&this.isOffscreen(ai,Ji,Qi,kn),ca=ca||this.isInsideGrid(ai,Ji,Qi,kn),!wt&&this.grid.hitTestCircle(Ur,qr,Rt,Yi)&&(la=!0,!ri))return{circles:[],offscreen:!1,collisionDetected:la}}}}return{circles:!ri&&la||!ca?[]:jn,offscreen:ua,collisionDetected:la}}queryRenderedSymbols(wt){if(0===wt.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const Rt=[];let Xt=1/0,sr=1/0,Dr=-1/0,Lr=-1/0;for(const Ur of wt){const wt=new ze.pointGeometry(Ur.x+jo,Ur.y+jo);Xt=Math.min(Xt,wt.x),sr=Math.min(sr,wt.y),Dr=Math.max(Dr,wt.x),Lr=Math.max(Lr,wt.y),Rt.push(wt)}const Ur=this.grid.query(Xt,sr,Dr,Lr).concat(this.ignoredGrid.query(Xt,sr,Dr,Lr)),qr={},ri={};for(const wt of Ur){const Xt=wt.key;if(void 0===qr[Xt.bucketInstanceId]&&(qr[Xt.bucketInstanceId]={}),qr[Xt.bucketInstanceId][Xt.featureIndex])continue;const sr=[new ze.pointGeometry(wt.x1,wt.y1),new ze.pointGeometry(wt.x2,wt.y1),new ze.pointGeometry(wt.x2,wt.y2),new ze.pointGeometry(wt.x1,wt.y2)];ze.polygonIntersectsPolygon(Rt,sr)&&(qr[Xt.bucketInstanceId][Xt.featureIndex]=!0,void 0===ri[Xt.bucketInstanceId]&&(ri[Xt.bucketInstanceId]=[]),ri[
vendor: 25,833 bytes, line 20
20Xt.bucketInstanceId].push(Xt.featureIndex))}return ri}insertCollisionBox(ze,wt,Rt,Xt,sr){(wt?this.ignoredGrid:this.grid).insert({bucketInstanceId:Rt,featureIndex:Xt,collisionGroupID:sr},ze[0],ze[1],ze[2],ze[3])}insertCollisionCircles(ze,wt,Rt,Xt,sr){const Dr=wt?this.ignoredGrid:this.grid,Lr={bucketInstanceId:Rt,featureIndex:Xt,collisionGroupID:sr};for(let wt=0;wt<ze.length;wt+=4)Dr.insertCircle(Lr,ze[wt],ze[wt+1],ze[wt+2])}projectAndGetPerspectiveRatio(wt,Rt,Xt,sr,Dr){const Lr=[Rt,Xt,sr||0,1];let Ur=!1;if(sr||this.transform.pitch>0){ze.transformMat4(Lr,Lr,wt);let qr=!1;this.fogState&&Dr&&(qr=function(wt,Rt,Xt,sr,Dr,Lr){const Ur=Lr.calculateFogTileMatrix(Dr),qr=[Rt,Xt,sr];return ze.transformMat4$1(qr,qr,Ur),T(wt,qr,Lr.pitch,Lr._fov)}(this.fogState,Rt,Xt,sr||0,Dr.toUnwrapped(),this.transform)>.9),Ur=Lr[2]>Lr[3]||qr}else le(Lr,Lr,wt);return{point:new ze.pointGeometry((Lr[0]/Lr[3]+1)/2*this.transform.width+jo,(-Lr[1]/Lr[3]+1)/2*this.transform.height+jo),perspectiveRatio:Math.min(.5+this.transform.cameraToCenterDistance/Lr[3]*.5,1.5),signedDistanceFromCamera:Lr[3],aboveHorizon:Ur}}isOffscreen(ze,wt,Rt,Xt){return Rt<jo||ze>=this.screenRightBoundary||Xt<jo||wt>this.screenBottomBoundary}isInsideGrid(ze,wt,Rt,Xt){return Rt>=0&&ze<this.gridRightBoundary&&Xt>=0&&wt<this.gridBottomBoundary}getViewportMatrix(){const wt=ze.identity([]);return ze.translate(wt,wt,[-100,-100,0]),wt}}class de{constructor(ze,wt,Rt,Xt){this.opacity=ze?Math.max(0,Math.min(1,ze.opacity+(ze.placed?wt:-wt))):Xt&&Rt?1:0,this.placed=Rt}isHidden(){return 0===this.opacity&&!this.placed}}class ue{constructor(ze,wt,Rt,Xt,sr){this.text=new de(ze?ze.text:null,wt,Rt,sr),this.icon=new de(ze?ze.icon:null,wt,Xt,sr)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class _e{constructor(ze,wt,Rt){this.text=ze,this.icon=wt,this.skipFade=Rt}}class pe{constructor(){this.invProjMatrix=ze.create$1(),this.viewportMatrix=ze.create$1(),this.circles=[]}}class me{constructor(ze,wt,Rt,Xt,sr){this.bucketInstanceId=ze,this.featureIndex=wt,this.sourceLayerIndex=Rt,this.bucketIndex=Xt,this.tileID=sr}}class fe{constructor(ze){this.crossSourceCollisions=ze,this.maxGroupID=0,this.collisionGroups={}}get(ze){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[ze]){const wt=++this.maxGroupID;this.collisionGroups[ze]={ID:wt,predicate:ze=>ze.collisionGroupID===wt}}return this.collisionGroups[ze]}}function ge(wt,Rt,Xt,sr,Dr){const{horizontalAlign:Lr,verticalAlign:Ur}=ze.getAnchorAlignment(wt),qr=-(Lr-.5)*Rt,ri=-(Ur-.5)*Xt,ai=ze.evaluateVariableOffset(wt,sr);return new ze.pointGeometry(qr+ai[0]*Dr,ri+ai[1]*Dr)}function ve(wt,Rt,Xt,sr,Dr){const Lr=new ze.pointGeometry(wt,Rt);return Xt&&Lr._rotate(sr?Dr:-Dr),Lr}class xe{constructor(ze,wt,Rt,Xt,sr){this.transform=ze.clone(),this.collisionIndex=new he(this.transform,sr),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=wt,this.retainedQueryData={},this.collisionGroups=new fe(Rt),this.collisionCircleArrays={},this.prevPlacement=Xt,Xt&&(Xt.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(wt,Rt,Xt,sr){const Dr=Xt.getBucket(Rt),Lr=Xt.latestFeatureIndex;if(!Dr||!Lr||Rt.id!==Dr.layerIds[0])return;const Ur=Xt.collisionBoxArray,qr=Dr.layers[0].layout,ri=Math.pow(2,this.transform.zoom-Xt.tileID.overscaledZ),ai=Xt.tileSize/ze.EXTENT,Yi=this.transform.calculateProjMatrix(Xt.tileID.toUnwrapped()),Ji="map"===qr.get("text-pitch-alignment"),Qi="map"===qr.get("text-rotation-alignment"),kn=z(Xt,1,this.transform.zoom),jn=Ht(Yi,Ji,Qi,this.transform,kn);let Un=null;if(Ji){const wt=Kt(Yi,Ji,Qi,this.transform,kn);Un=ze.multiply([],this.transform.labelPlaneMatrix,wt)}this.retainedQueryData[Dr.bucketInstanceId]=new me(Dr.bucketInstanceId,Lr,Dr.sourceLayerIndex,Dr.index,Xt.tileID);const Wn={bucket:Dr,layout:qr,posMatrix:Yi,textLabelPlaneMatrix:jn,labelToScreenMatrix:Un,scale:ri,textPixelRatio:ai,holdingForFade:Xt.holdingForFade(),collisionBoxArray:Ur,partiallyEvaluatedTextSize:ze.evaluateSizeForZoom(Dr.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:ze.evaluateSizeForZoom(Dr.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Dr.sourceID)};if(sr)for(const ze of Dr.sortKeyRanges){const{sortKey:Rt,symbolInstanceStart:Xt,symbolInstanceEnd:sr}=ze;wt.push({sortKey:Rt,symbolInstanceStart:Xt,symbolInstanceEnd:sr,parameters:Wn})}else wt.push({symbolInstanceStart:0,symbolInstanceEnd:Dr.symbolInstances.length,parameters:Wn})}attemptAnchorPlacement(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn){const Yn=[Yi.textOffset0,Yi.textOffset1],Jn=ge(ze,Rt,Xt,Yn,sr),Qn=this.collisionIndex.placeCollisionBox(sr,wt,ve(Jn.x,Jn.y,Dr,Lr,this.transform.angle),ai,Ur,qr,ri.predicate);if((!jn||0!==this.collisionIndex.placeCollisionBox(Qi.getSymbolInstanceIconSize(Wn,this.transform.zoom,Ji),jn,ve(Jn.x,Jn.y,Dr,Lr,this.transform.angle),ai,Ur,qr,ri.predicate).box.length)&&Qn.box.length>0){let wt;return this.prevPlacement&&this.prevPlacement.variableOffsets[Yi.crossTileID]&&this.prevPlacement.placements[Yi.crossTileID]&&this.prevPlacement.placements[Yi.crossTileID].text&&(wt=this.prevPlacement.variableOffsets[Yi.crossTileID].anchor),this.variableOffsets[Yi.crossTileID]={textOffset:Yn,width:Rt,height:Xt,anchor:ze,textScale:sr,prevAnchor:wt},this.markUsedJustification(Qi,ze,Yi,kn),Qi.allowVerticalPlacement&&(this.markUsedOrientation(Qi,kn,Yi),this.placedOrientations[Yi.crossTileID]=kn),{shift:Jn,placedGlyphBoxes:Qn}}}placeLayerBucketPart(wt,Rt,Xt){const{bucket:sr,layout:Dr,posMatrix:Lr,textLabelPlaneMatrix:Ur,labelToScreenMatrix:qr,textPixelRatio:ri,holdingForFade:ai,collisionBoxArray:Yi,partiallyEvaluatedTextSize:Ji,partiallyEvaluatedIconSize:Qi,collisionGroup:kn}=wt.parameters,jn=Dr.get("text-optional"),Un=Dr.get("icon-optional"),Wn=Dr.get("text-allow-overlap"),Yn=Dr.get("icon-allow-overlap"),Jn="map"===Dr.get("text-rotation-alignment"),Qn="map"===Dr.get("text-pitch-alignment"),Io="none"!==Dr.get("icon-text-fit"),Mo="viewport-y"===Dr.get("symbol-z-order"),jo=Wn&&(Yn||!sr.hasIconData()||Un),zo=Yn&&(Wn||!sr.hasTextData()||jn);!sr.collisionArrays&&Yi&&sr.deserializeCollisionBoxes(Yi),Xt&&sr.updateCollisionDebugBuffers(this.transform.zoom,Yi);const C=(wt,Yi,Mo)=>{if(Rt[wt.crossTileID])return;if(ai)return void(this.placements[wt.crossTileID]=new _e(!1,!1,!1));let oa=!1,la=!1,ca=!0,ua=null,ha={box:null,offscreen:null},pa={box:null,offscreen:null},_a=null,wa=null,Pa=null,Oa=0,Da=0,La=0;Mo.textFeatureIndex?Oa=Mo.textFeatureIndex:wt.useRuntimeCollisionCircles&&(Oa=wt.featureIndex),Mo.verticalTextFeatureIndex&&(Da=Mo.verticalTextFeatureIndex);const B=ze=>{ze.tileID=this.retainedQueryData[sr.bucketInstanceId].tileID,(this.transform.elevation||ze.elevation)&&(ze.elevation=this.transform.elevation?this.transform.elevation.getAtTileOffset(this.retainedQueryData[sr.bucketInstanceId].tileID,ze.anchorPointX,ze.anchorPointY):0)},Ra=Mo.textBox;if(Ra){B(Ra);const i=Rt=>{let Xt=ze.WritingMode.horizontal;if(sr.allowVerticalPlacement&&!Rt&&this.prevPlacement){const ze=this.prevPlacement.placedOrientations[wt.crossTileID];ze&&(this.placedOrientations[wt.crossTileID]=ze,Xt=ze,this.markUsedOrientation(sr,Xt,wt))}return Xt},o=(Rt,Xt)=>{if(sr.allowVerticalPlacement&&wt.numVerticalGlyphVertices>0&&Mo.verticalTextBox){for(const wt of sr.writingModes)if(wt===ze.WritingMode.vertical?(ha=Xt(),pa=ha):ha=Rt(),ha&&ha.box&&ha.box.length)break}else ha=Rt()};if(Dr.get("text-variable-anchor")){let Rt=Dr.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[wt.crossTileID]){const ze=this.prevPlacement.variableOffsets[wt.crossTileID];Rt.indexOf(ze.anchor)>0&&(Rt=Rt.filter(wt=>wt!==ze.anchor),Rt.unshift(ze.anchor))}const l=(ze,Xt,Dr)=>{const Ur=sr.getSymbolInstanceTextSize(Ji,wt,this.transform.zoom,Yi),qr=(ze.x2-ze.x1)*Ur+2*ze.padding,ai=(ze.y2-ze.y1)*Ur+2*ze.padding,jn=Io&&!Yn?Xt:null;jn&&B(jn);let Un={box:[],offscreen:!1};const Mo=Wn?2*Rt.length:Rt.length;for(let Xt=0;Xt<Mo;++Xt){const Wn=this.attemptAnchorPlacement(Rt[Xt%Rt.length],ze,qr,ai,Ur,Jn,Qn,ri,Lr,kn,Xt>=Rt.length,wt,Yi,sr,Dr,jn,Ji,Qi);if(Wn&&(Un=Wn.placedGlyphBoxes,Un&&Un.box&&Un.box.length)){oa=!0,ua=Wn.shift;break}}return Un};o(()=>l(Ra,Mo.iconBox,ze.WritingMode.horizontal),()=>{const Rt=Mo.verticalTextBox;return Rt&&B(Rt),sr.allowVerticalPlacement&&!(ha&&ha.box&&ha.box.length)&&wt.numVerticalGlyphVertices>0&&Rt?l(Rt,Mo.verticalIconBox,ze.WritingMode.vertical):{box:null,offscreen:null}}),ha&&(oa=ha.box,ca=ha.offscreen);const Xt=i(ha&&ha.box);if(!oa&&this.prevPlacement){const ze=this.prevPlacement.variableOffsets[wt.crossTileID];ze&&(this.variableOffsets[wt.crossTileID]=ze,this.markUsedJustification(sr,ze.anchor,wt,Xt))}}else{const a=(Rt,Xt)=>{const Dr=sr.getSymbolInstanceTextSize(Ji,wt,this.transform.zoom,Yi),Ur=this.collisionIndex.placeCollisionBox(Dr,Rt,new ze.pointGeometry(0,0),Wn,ri,Lr,kn.predicate);return Ur&&Ur.box&&Ur.box.length&&(this.markUsedOrientation(sr,Xt,wt),this.placedOrientations[wt.crossTileID]=Xt),Ur};o(()=>a(Ra,ze.WritingMode.horizontal),()=>{const Rt=Mo.verticalTextBox;return sr.allowVerticalPlacement&&wt.numVerticalGlyphVertices>0&&Rt?(B(Rt),a(Rt,ze.WritingMode.vertical)):{box:null,offscreen:null}}),i(ha&&ha.box&&ha.box.length)}}if(_a=ha,oa=_a&&_a.box&&_a.box.length>0,ca=_a&&_a.offscreen,wt.useRuntimeCollisionCircles){const Rt=sr.text.placedSymbolArray.get(wt.centerJustifiedTextSymbolIndex>=0?wt.centerJustifiedTextSymbolIndex:wt.verticalPlacedTextSymbolIndex),ri=ze.evaluateSizeForFeature(sr.textSizeData,Ji,Rt),ai=Dr.get("text-padding");wa=this.collisionIndex.placeCollisionCircles(Wn,Rt,sr.lineVertexArray,sr.glyphOffsetArray,ri,Lr,Ur,qr,Xt,Qn,kn.predicate,wt.collisionCircleDiameter,ai,this.retainedQueryData[sr.bucketInstanceId].tileID),oa=Wn||wa.circles.length>0&&!wa.collisionDetected,ca=ca&&wa.offscreen}if(Mo.iconFeatureIndex&&(La=Mo.iconFeatureIndex),Mo.iconBox){const e=wt=>{B(wt);const Rt=Io&&ua?ve(ua.x,ua.y,Jn,Qn,this.transform.angle):new ze.pointGeometry(0,0),Xt=sr.getSymbolInstanceIconSize(Qi,this.transform.zoom,Yi);return this.collisionIndex.placeCollisionBox(Xt,wt,Rt,Yn,ri,Lr,kn.predicate)};pa&&pa.box&&pa.box.length&&Mo.verticalIconBox?(Pa=e(Mo.verticalIconBox),la=Pa.box.length>0):(Pa=e(Mo.iconBox),la=Pa.box.length>0),ca=ca&&Pa.offscreen}const Na=jn||0===wt.numHorizontalGlyphVertices&&0===wt.numVerticalGlyphVertices,Ba=Un||0===wt.numIconVertices;if(Na||Ba?Ba?Na||(la=la&&oa):oa=la&&oa:la=oa=la&&oa,oa&&_a&&_a.box&&this.collisionIndex.insertCollisionBox(_a.box,Dr.get("text-ignore-placement"),sr.bucketInstanceId,pa&&pa.box&&Da?Da:Oa,kn.ID),la&&Pa&&this.collisionIndex.insertCollisionBox(Pa.box,Dr.get("icon-ignore-placement"),sr.bucketInstanceId,La,kn.ID),wa&&(oa&&this.collisionIndex.insertCollisionCircles(wa.circles,Dr.get("text-ignore-placement"),sr.bucketInstanceId,Oa,kn.ID),Xt)){const ze=sr.bucketInstanceId;let wt=this.collisionCircleArrays[ze];void 0===wt&&(wt=this.collisionCircleArrays[ze]=new pe);for(let ze=0;ze<wa.circles.length;ze+=4)wt.circles.push(wa.circles[ze+0]),wt.circles.push(wa.circles[ze+1]),wt.circles.push(wa.circles[ze+2]),wt.circles.push(wa.collisionDetected?1:0)}this.placements[wt.crossTileID]=new _e(oa||jo,la||zo,ca||sr.justReloaded),Rt[wt.crossTileID]=!0};if(Mo){const ze=sr.getSortedSymbolIndexes(this.transform.angle);for(let wt=ze.length-1;wt>=0;--wt){const Rt=ze[wt];C(sr.symbolInstances.get(Rt),Rt,sr.collisionArrays[Rt])}}else for(let ze=wt.symbolInstanceStart;ze<wt.symbolInstanceEnd;ze++)C(sr.symbolInstances.get(ze),ze,sr.collisionArrays[ze]);if(Xt&&sr.bucketInstanceId in this.collisionCircleArrays){const wt=this.collisionCircleArrays[sr.bucketInstanceId];ze.invert(wt.invProjMatrix,Lr),wt.viewportMatrix=this.collisionIndex.getViewportMatrix()}sr.justReloaded=!1}markUsedJustification(wt,Rt,Xt,sr){let Dr;Dr=sr===ze.WritingMode.vertical?Xt.verticalPlacedTextSymbolIndex:{left:Xt.leftJustifiedTextSymbolIndex,center:Xt.centerJustifiedTextSymbolIndex,right:Xt.rightJustifiedTextSymbolIndex}[ze.getAnchorJustification(Rt)];const Lr=[Xt.leftJustifiedTextSymbolIndex,Xt.centerJustifiedTextSymbolIndex,Xt.rightJustifiedTextSymbolIndex,Xt.verticalPlacedTextSymbolIndex];for(const ze of Lr)ze>=0&&(wt.text.placedSymbolArray.get(ze).crossTileID=Dr>=0&&ze!==Dr?0:Xt.crossTileID)}markUsedOrientation(wt,Rt,Xt){const sr=Rt===ze.WritingMode.horizontal||Rt===ze.WritingMode.horizontalOnly?Rt:0,Dr=Rt===ze.WritingMode.vertical?Rt:0,Lr=[Xt.leftJustifiedTextSymbolIndex,Xt.centerJustifiedTextSymbolIndex,Xt.rightJustifiedTextSymbolIndex];for(const ze of Lr)wt.text.placedSymbolArray.get(ze).placedOrientation=sr;Xt.verticalPlacedTextSymbolIndex&&(wt.text.placedSymbolArray.get(Xt.verticalPlacedTextSymbolIndex).placedOrientation=Dr)}commit(ze){this.commitTime=ze,this.zoomAtLastRecencyCheck=this.transform.zoom;const wt=this.prevPlacement;let Rt=!1;this.prevZoomAdjustment=wt?wt.zoomAdjustment(this.transform.zoom):0;const Xt=wt?wt.symbolFadeChange(ze):1,sr=wt?wt.opacities:{},Dr=wt?wt.variableOffsets:{},Lr=wt?wt.placedOrientations:{};for(const ze in this.placements){const wt=this.placements[ze],Dr=sr[ze];Dr?(this.opacities[ze]=new ue(Dr,Xt,wt.text,wt.icon),Rt=Rt||wt.text!==Dr.text.placed||wt.icon!==Dr.icon.placed):(this.opacities[ze]=new ue(null,Xt,wt.text,wt.icon,wt.skipFade),Rt=Rt||wt.text||wt.icon)}for(const ze in sr){const wt=sr[ze];if(!this.opacities[ze]){const sr=new ue(wt,Xt,!1,!1);sr.isHidden()||(this.opacities[ze]=sr,Rt=Rt||wt.text.placed||wt.icon.placed)}}for(const ze in Dr)this.variableOffsets[ze]||!this.opacities[ze]||this.opacities[ze].isHidden()||(this.variableOffsets[ze]=Dr[ze]);for(const ze in Lr)this.placedOrientations[ze]||!this.opacities[ze]||this.opacities[ze].isHidden()||(this.placedOrientations[ze]=Lr[ze]);Rt?this.lastPlacementChangeTime=ze:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=wt?wt.lastPlacementChangeTime:ze)}updateLayerOpacities(ze,wt){const Rt={};for(const Xt of wt){const wt=Xt.getBucket(ze);wt&&Xt.latestFeatureIndex&&ze.id===wt.layerIds[0]&&this.updateBucketOpacities(wt,Rt,Xt.collisionBoxArray)}}updateBucketOpacities(wt,Rt,Xt){wt.hasTextData()&&wt.text.opacityVertexArray.clear(),wt.hasIconData()&&wt.icon.opacityVertexArray.clear(),wt.hasIconCollisionBoxData()&&wt.iconCollisionBox.collisionVertexArray.clear(),wt.hasTextCollisionBoxData()&&wt.textCollisionBox.collisionVertexArray.clear();const sr=wt.layers[0].layout,Dr=new ue(null,0,!1,!1,!0),Lr=sr.get("text-allow-overlap"),Ur=sr.get("icon-allow-overlap"),qr=sr.get("text-variable-anchor"),ri="map"===sr.get("text-rotation-alignment"),ai="map"===sr.get("text-pitch-alignment"),Yi="none"!==sr.get("icon-text-fit"),Ji=new ue(null,0,Lr&&(Ur||!wt.hasIconData()||sr.get("icon-optional")),Ur&&(Lr||!wt.hasTextData()||sr.get("text-optional")),!0);!wt.collisionArrays&&Xt&&(wt.hasIconCollisionBoxData()||wt.hasTextCollisionBoxData())&&wt.deserializeCollisionBoxes(Xt);const _=(ze,wt,Rt)=>{for(let Xt=0;Xt<wt/4;Xt++)ze.opacityVertexArray.emplaceBack(Rt)};for(let Xt=0;Xt<wt.symbolInstances.length;Xt++){const sr=wt.symbolInstances.get(Xt),{numHorizontalGlyphVertices:Lr,numVerticalGlyphVertices:Ur,crossTileID:Qi}=sr;let kn=this.opacities[Qi];Rt[Qi]?kn=Dr:kn||(kn=Ji,this.opacities[Qi]=kn),Rt[Qi]=!0;const jn=sr.numIconVertices>0,Un=this.placedOrientations[sr.crossTileID],Wn=Un===ze.WritingMode.vertical,Yn=Un===ze.WritingMode.horizontal||Un===ze.WritingMode.horizontalOnly;if(Lr>0||Ur>0){const ze=Me(kn.text);_(wt.text,Lr,Wn?_a:ze),_(wt.text,Ur,Yn?_a:ze);const Rt=kn.text.isHidden();[sr.rightJustifiedTextSymbolIndex,sr.centerJustifiedTextSymbolIndex,sr.leftJustifiedTextSymbolIndex].forEach(ze=>{ze>=0&&(wt.text.placedSymbolArray.get(ze).hidden=Rt||Wn?1:0)}),sr.verticalPlacedTextSymbolIndex>=0&&(wt.text.placedSymbolArray.get(sr.verticalPlacedTextSymbolIndex).hidden=Rt||Yn?1:0);const Xt=this.variableOffsets[sr.crossTileID];Xt&&this.markUsedJustification(wt,Xt.anchor,sr,Un);const Dr=this.placedOrientations[sr.crossTileID];Dr&&(this.markUsedJustification(wt,"left",sr,Dr),this.markUsedOrientation(wt,Dr,sr))}if(jn){const ze=Me(kn.icon);sr.placedIconSymbolIndex>=0&&(_(wt.icon,sr.numIconVertices,Wn?_a:ze),wt.icon.placedSymbolArray.get(sr.placedIconSymbolIndex).hidden=kn.icon.isHidden()),sr.verticalPlacedIconSymbolIndex>=0&&(_(wt.icon,sr.numVerticalIconVertices,Yn?_a:ze),wt.icon.placedSymbolArray.get(sr.verticalPlacedIconSymbolIndex).hidden=kn.icon.isHidden())}if(wt.hasIconCollisionBoxData()||wt.hasTextCollisionBoxData()){const Rt=wt.collisionArrays[Xt];if(Rt){let Xt=new ze.pointGeometry(0,0);if(Rt.textBox||Rt.verticalTextBox){let ze=!0;if(qr){const wt=this.variableOffsets[Qi];wt?(Xt=ge(wt.anchor,wt.width,wt.height,wt.textOffset,wt.textScale),ri&&Xt._rotate(ai?this.transform.angle:-this.transform.angle)):ze=!1}Rt.textBox&&ye(wt.textCollisionBox.collisionVertexArray,kn.text.placed,!ze||Wn,Xt.x,Xt.y),Rt.verticalTextBox&&ye(wt.textCollisionBox.collisionVertexArray,kn.text.placed,!ze||Yn,Xt.x,Xt.y)}const sr=Boolean(!Yn&&Rt.verticalIconBox);Rt.iconBox&&ye(wt.iconCollisionBox.collisionVertexArray,kn.icon.placed,sr,Yi?Xt.x:0,Yi?Xt.y:0),Rt.verticalIconBox&&ye(wt.iconCollisionBox.collisionVertexArray,kn.icon.placed,!sr,Yi?Xt.x:0,Yi?Xt.y:0)}}}if(wt.sortFeatures(this.transform.angle),this.retainedQueryData[wt.bucketInstanceId]&&(this.retainedQueryData[wt.bucketInstanceId].featureSortOrder=wt.featureSortOrder),wt.hasTextData()&&wt.text.opacityVertexBuffer&&wt.text.opacityVertexBuffer.updateData(wt.text.opacityVertexArray),wt.hasIconData()&&wt.icon.opacityVertexBuffer&&wt.icon.opacityVertexBuffer.updateData(wt.icon.opacityVertexArray),wt.hasIconCollisionBoxData()&&wt.iconCollisionBox.collisionVertexBuffer&&wt.iconCollisionBox.collisionVertexBuffer.updateData(wt.iconCollisionBox.collisionVertexArray),wt.hasTextCollisionBoxData()&&wt.textCollisionBox.collisionVertexBuffer&&wt.textCollisionBox.collisionVertexBuffer.updateData(wt.textCollisionBox.collisionVertexArray),wt.bucketInstanceId in this.collisionCircleArrays){const ze=this.collisionCircleArrays[wt.bucketInstanceId];wt.placementInvProjMatrix=ze.invProjMatrix,wt.placementViewportMatrix=ze.viewportMatrix,wt.collisionCircleArray=ze.circles,delete this.collisionCircleArrays[wt.bucketInstanceId]}}symbolFadeChange(ze){return 0===this.fadeDuration?1:(ze-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(ze){return Math.max(0,(this.transform.zoom-ze)/1.5)}hasTransitions(ze){return this.stale||ze-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(ze,wt){const Rt=this.zoomAtLastRecencyCheck===wt?1-this.zoomAdjustment(wt):1;return this.zoomAtLastRecencyCheck=wt,this.commitTime+this.fadeDuration*Rt>ze}setStale(){this.stale=!0}}function ye(ze,wt,Rt,Xt,sr){ze.emplaceBack(wt?1:0,Rt?1:0,Xt||0,sr||0),ze.emplaceBack(wt?1:0,Rt?1:0,Xt||0,sr||0),ze.emplaceBack(wt?1:0,Rt?1:0,Xt||0,sr||0),ze.emplaceBack(wt?1:0,Rt?1:0,Xt||0,sr||0)}const zo=Math.pow(2,25),oa=Math.pow(2,24),la=Math.pow(2,17),ca=Math.pow(2,16),ua=Math.pow(2,9),ha=Math.pow(2,8),pa=Math.pow(2,1);function Me(ze){if(0===ze.opacity&&!ze.placed)return 0;if(1===ze.opacity&&ze.placed)return 4294967295;const wt=ze.placed?1:0,Rt=Math.floor(127*ze.opacity);return Rt*zo+wt*oa+Rt*la+wt*ca+Rt*ua+wt*ha+Rt*pa+wt}const _a=0;class De{constructor(ze){this._sortAcrossTiles="viewport-y"!==ze.layout.get("symbol-z-order")&&void 0!==ze.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(ze,wt,Rt,Xt,sr){const Dr=this._bucketParts;for(;this._currentTileIndex<ze.length;)if(wt.getBucketParts(Dr,Xt,ze[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,sr())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Dr.sort((ze,wt)=>ze.sortKey-wt.sortKey));this._currentPartIndex<Dr.length;)if(wt.placeLayerBucketPart(Dr[this._currentPartIndex],this._seenCrossTileIDs,Rt),this._currentPartIndex++,sr())return!0;return!1}}class Ae{constructor(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){this.placement=new xe(ze,sr,Dr,Lr,Ur),this._currentPlacementIndex=wt.length-1,this._forceFullPlacement=Rt,this._showCollisionBoxes=Xt,this._done=!1}isDone(){return this._done}continuePlacement(wt,Rt,Xt){const sr=ze.exported.now(),a=()=>{const wt=ze.exported.now()-sr;return!this._forceFullPlacement&&wt>2};for(;this._currentPlacementIndex>=0;){const ze=Rt[wt[this._currentPlacementIndex]],sr=this.placement.collisionIndex.transform.zoom;if("symbol"===ze.type&&(!ze.minzoom||ze.minzoom<=sr)&&(!ze.maxzoom||ze.maxzoom>sr)){if(this._inProgressLayer||(this._inProgressLayer=new De(ze)),this._inProgressLayer.continuePlacement(Xt[ze.source],this.placement,this._showCollisionBoxes,ze,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(ze){return this.placement.commit(ze),this.placement}}const wa=512/ze.EXTENT/2;class Le{constructor(ze,wt,Rt){this.tileID=ze,this.indexedSymbolInstances={},this.bucketInstanceId=Rt;for(let Rt=0;Rt<wt.length;Rt++){const Xt=wt.get(Rt),sr=Xt.key;this.indexedSymbolInstances[sr]||(this.indexedSymbolInstances[sr]=[]),this.indexedSymbolInstances[sr].push({crossTileID:Xt.crossTileID,coord:this.getScaledCoordinates(Xt,ze)})}}getScaledCoordinates(wt,Rt){const Xt=wa/Math.pow(2,Rt.canonical.z-this.tileID.canonical.z);return{x:Math.floor((Rt.canonical.x*ze.EXTENT+wt.anchorX)*Xt),y:Math.floor((Rt.canonical.y*ze.EXTENT+wt.anchorY)*Xt)}}findMatches(ze,wt,Rt){const Xt=this.tileID.canonical.z<wt.canonical.z?1:Math.pow(2,this.tileID.canonical.z-wt.canonical.z);for(let sr=0;sr<ze.length;sr++){const Dr=ze.get(sr);if(Dr.crossTileID)continue;const Lr=this.indexedSymbolInstances[Dr.key];if(!Lr)continue;const Ur=this.getScaledCoordinates(Dr,wt);for(const ze of Lr)if(Math.abs(ze.coord.x-Ur.x)<=Xt&&Math.abs(ze.coord.y-Ur.y)<=Xt&&!Rt[ze.crossTileID]){Rt[ze.crossTileID]=!0,Dr.crossTileID=ze.crossTileID;break}}}}class Re{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ke{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(ze){const wt=Math.round((ze-this.lng)/360);if(0!==wt)for(const ze in this.indexes){const Rt=this.indexes[ze],Xt={};for(const ze in Rt){const sr=Rt[ze];sr.tileID=sr.tileID.unwrapTo(sr.tileID.wrap+wt),Xt[sr.tileID.key]=sr}this.indexes[ze]=Xt}this.lng=ze}addBucket(ze,wt,Rt){if(this.indexes[ze.overscaledZ]&&this.indexes[ze.overscaledZ][ze.key]){if(this.indexes[ze.overscaledZ][ze.key].bucketInstanceId===wt.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(ze.overscaledZ,this.indexes[ze.overscaledZ][ze.key])}for(let ze=0;ze<wt.symbolInstances.length;ze++)wt.symbolInstances.get(ze).crossTileID=0;this.usedCrossTileIDs[ze.overscaledZ]||(this.usedCrossTileIDs[ze.overscaledZ]={});const Xt=this.usedCrossTileIDs[ze.overscaledZ];for(const Rt in this.indexes){const sr=this.indexes[Rt];if(Number(Rt)>ze.overscaledZ)for(const Rt in sr){const Dr=sr[Rt];Dr.tileID.isChildOf(ze)&&Dr.findMatches(wt.symbolInstances,ze,Xt)}else{const Dr=sr[ze.scaledTo(Number(Rt)).key];Dr&&Dr.findMatches(wt.symbolInstances,ze,Xt)}}for(let ze=0;ze<wt.symbolInstances.length;ze++){const sr=wt.symbolInstances.get(ze);sr.crossTileID||(sr.crossTileID=Rt.generate(),Xt[sr.crossTileID]=!0)}return void 0===this.indexes[ze.overscaledZ]&&(this.indexes[ze.overscaledZ]={}),this.indexes[ze.overscaledZ][ze.key]=new Le(ze,wt.symbolInstances,wt.bucketInstanceId),!0}removeBucketCrossTileIDs(ze,wt){for(const Rt in wt.indexedSymbolInstances)for(const Xt of wt.indexedSymbolInstances[Rt])delete this.usedCrossTileIDs[ze][Xt.crossTileID]}removeStaleBuckets(ze){let wt=!1;for(const Rt in this.indexes){const Xt=this.indexes[Rt];for(const sr in Xt)ze[Xt[sr].bucketInstanceId]||(this.removeBucketCrossTileIDs(Rt,Xt[sr]),delete Xt[sr],wt=!0)}return wt}}class Fe{constructor(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(ze,wt,Rt){let Xt=this.layerIndexes[ze.id];void 0===Xt&&(Xt=this.layerIndexes[ze.id]=new ke);let sr=!1;const Dr={};Xt.handleWrapJump(Rt);for(const Rt of wt){const wt=Rt.getBucket(ze);wt&&ze.id===wt.layerIds[0]&&(wt.bucketInstanceId||(wt.bucketInstanceId=++this.maxBucketInstanceId),Xt.addBucket(Rt.tileID,wt,this.crossTileIDs)&&(sr=!0),Dr[wt.bucketInstanceId]=!0)}return Xt.removeStaleBuckets(Dr)&&(sr=!0),sr}pruneUnusedLayers(ze){const wt={};ze.forEach(ze=>{wt[ze]=!0});for(const ze in this.layerIndexes)wt[ze]||delete this.layerIndexes[ze]}}const Be=(wt,Rt)=>ze.emitValidationErrors(wt,Rt&&Rt.filter(ze=>"source.canvas"!==ze.identifier)),Pa=ze.pick(Qn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog"]),Oa=ze.pick(Qn,["setCenter","setZoom","setBearing","setPitch"]),Da=function(){const wt={},Rt=ze.spec.$version;for(const Xt in ze.spec.$root){const sr=ze.spec.$root[Xt];if(sr.required){let ze=null;ze="version"===Xt?Rt:"array"===sr.type?[]:{},null!=ze&&(wt[Xt]=ze)}}return wt}(),La={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Ze extends ze.Evented{constructor(wt,Rt={}){super(),this.map=wt,this.dispatcher=new M(kt(),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new ze.GlyphManager(wt._requestManager,Rt.localFontFamily?ze.LocalGlyphMode.all:Rt.localIdeographFontFamily?ze.LocalGlyphMode.ideographs:ze.LocalGlyphMode.none,Rt.localFontFamily||Rt.localIdeographFontFamily),this.lineAtlas=new ze.LineAtlas(256,512),this.crossTileSymbolIndex=new Fe,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this.zoomHistory=new ze.ZoomHistory,this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedU
20pdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",ze.getReferrer());const Xt=this;this._rtlTextPluginCallback=Ze.registerForPluginStateChange(wt=>{Xt.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:wt.pluginStatus,pluginURL:wt.pluginURL},(wt,Rt)=>{if(ze.triggerPluginCompletionEvent(wt),Rt&&Rt.every(ze=>ze))for(const ze in Xt._sourceCaches){const wt=Xt._sourceCaches[ze],Rt=wt.getSource().type;"vector"!==Rt&&"geojson"!==Rt||wt.reload()}})}),this.on("data",ze=>{if("source"!==ze.dataType||"metadata"!==ze.sourceDataType)return;const wt=this.getSource(ze.sourceId);if(wt&&wt.vectorLayerIds)for(const ze in this._layers){const Rt=this._layers[ze];Rt.source===wt.id&&this._validateLayer(Rt)}})}loadURL(wt,Rt={}){this.fire(new ze.Event("dataloading",{dataType:"style"}));const Xt="boolean"==typeof Rt.validate?Rt.validate:!ze.isMapboxURL(wt);wt=this.map._requestManager.normalizeStyleURL(wt,Rt.accessToken);const sr=this.map._requestManager.transformRequest(wt,ze.ResourceType.Style);this._request=ze.getJSON(sr,(wt,Rt)=>{this._request=null,wt?this.fire(new ze.ErrorEvent(wt)):Rt&&this._load(Rt,Xt)})}loadJSON(wt,Rt={}){this.fire(new ze.Event("dataloading",{dataType:"style"})),this._request=ze.exported.frame(()=>{this._request=null,this._load(wt,!1!==Rt.validate)})}loadEmpty(){this.fire(new ze.Event("dataloading",{dataType:"style"})),this._load(Da,!1)}_updateLayerCount(ze,wt){const Rt=wt?1:-1;ze.is3D()&&(this._num3DLayers+=Rt),"circle"===ze.type&&(this._numCircleLayers+=Rt),"symbol"===ze.type&&(this._numSymbolLayers+=Rt)}_load(wt,Rt){if(Rt&&Be(this,ze.validateStyle(wt)))return;this._loaded=!0,this.stylesheet=wt;
vendor: 7,396 bytes, line 20
20for(const ze in wt.sources)this.addSource(ze,wt.sources[ze],{validate:!1});this._changed=!1,wt.sprite?this._loadSprite(wt.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(wt.glyphs);const Xt=Bt(this.stylesheet.layers);this._order=Xt.map(ze=>ze.id),this._layers={},this._serializedLayers={};for(let wt of Xt)wt=ze.createStyleLayer(wt),wt.setEventedParent(this,{layer:{id:wt.id}}),this._layers[wt.id]=wt,this._serializedLayers[wt.id]=wt.serialize(),this._updateLayerCount(wt,!0);this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new x(this.stylesheet.light),this.stylesheet.terrain&&this._createTerrain(this.stylesheet.terrain),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new ze.Event("data",{dataType:"style"})),this.fire(new ze.Event("style.load"))}_loadSprite(wt){this._spriteRequest=function(wt,Rt,Xt){let sr,Dr,Lr;const Ur=ze.exported.devicePixelRatio>1?"@2x":"";let qr=ze.getJSON(Rt.transformRequest(Rt.normalizeSpriteURL(wt,Ur,".json"),ze.ResourceType.SpriteJSON),(ze,wt)=>{qr=null,Lr||(Lr=ze,sr=wt,h())}),ri=ze.getImage(Rt.transformRequest(Rt.normalizeSpriteURL(wt,Ur,".png"),ze.ResourceType.SpriteImage),(ze,wt)=>{ri=null,Lr||(Lr=ze,Dr=wt,h())});function h(){if(Lr)Xt(Lr);else if(sr&&Dr){const wt=ze.exported.getImageData(Dr),Rt={};for(const Xt in sr){const{width:Dr,height:Lr,x:Ur,y:qr,sdf:ri,pixelRatio:ai,stretchX:Yi,stretchY:Ji,content:Qi}=sr[Xt],kn=new ze.RGBAImage({width:Dr,height:Lr});ze.RGBAImage.copy(wt,kn,{x:Ur,y:qr},{x:0,y:0},{width:Dr,height:Lr}),Rt[Xt]={data:kn,pixelRatio:ai,sdf:ri,stretchX:Yi,stretchY:Ji,content:Qi}}Xt(null,Rt)}}return{cancel(){qr&&(qr.cancel(),qr=null),ri&&(ri.cancel(),ri=null)}}}(wt,this.map._requestManager,(wt,Rt)=>{if(this._spriteRequest=null,wt)this.fire(new ze.ErrorEvent(wt));else if(Rt)for(const ze in Rt)this.imageManager.addImage(ze,Rt[ze]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new ze.Event("data",{dataType:"style"}))})}_validateLayer(wt){const Rt=this.getSource(wt.source);if(!Rt)return;const Xt=wt.sourceLayer;Xt&&("geojson"===Rt.type||Rt.vectorLayerIds&&-1===Rt.vectorLayerIds.indexOf(Xt))&&this.fire(new ze.ErrorEvent(new Error(`Source layer "${Xt}" does not exist on source "${Rt.id}" as specified by style layer "${wt.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const ze in this._sourceCaches)if(!this._sourceCaches[ze].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(ze){const wt=[];for(const Rt of ze){const ze=this._layers[Rt];"custom"!==ze.type&&wt.push(ze.serialize())}return wt}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const ze in this._sourceCaches)if(this._sourceCaches[ze].hasTransition())return!0;for(const ze in this._layers)if(this._layers[ze].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(ze){return!!this.terrain&&La[ze.type]}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(wt){if(!this._loaded)return;const Rt=this._changed;if(this._changed){const ze=Object.keys(this._updatedLayers),Rt=Object.keys(this._removedLayers);(ze.length||Rt.length)&&this._updateWorkerLayers(ze,Rt);for(const ze in this._updatedSources){const wt=this._updatedSources[ze];"reload"===wt?this._reloadSource(ze):"clear"===wt&&this._clearSource(ze)}this._updateTilesForChangedImages();for(const ze in this._updatedPaintProps)this._layers[ze].updateTransitions(wt);this.light.updateTransitions(wt),this.fog&&this.fog.updateTransitions(wt),this._resetUpdates()}const Xt={};for(const ze in this._sourceCaches){const wt=this._sourceCaches[ze];Xt[ze]=wt.used,wt.used=!1}for(const ze of this._order){const Rt=this._layers[ze];if(Rt.recalculate(wt,this._availableImages),!Rt.isHidden(wt.zoom)){const ze=this._getLayerSourceCache(Rt);ze&&(ze.used=!0)}const Xt=this.map.painter;if(Xt){const ze=Rt.getProgramIds();if(!ze)continue;const sr=Rt.getProgramConfiguration(wt.zoom);for(const wt of ze)Xt.useProgram(wt,sr)}}for(const wt in Xt){const Rt=this._sourceCaches[wt];Xt[wt]!==Rt.used&&Rt.getSource().fire(new ze.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Rt.getSource().id}))}this.light.recalculate(wt),this.terrain&&this.terrain.recalculate(wt),this.fog&&this.fog.recalculate(wt),this.z=wt.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),Rt&&this.fire(new ze.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const ze=Object.keys(this._changedImages);if(ze.length){for(const wt in this._sourceCaches)this._sourceCaches[wt].reloadTilesForDependencies(["icons","patterns"],ze);this._changedImages={}}}_updateWorkerLayers(ze,wt){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(ze),removedIds:wt})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(wt){if(this._checkLoaded(),Be(this,ze.validateStyle(wt)))return!1;(wt=ze.clone$2(wt)).layers=Bt(wt.layers);const Rt=function(ze,wt){if(!ze)return[{command:Qn.setStyle,args:[wt]}];let Rt=[];try{if(!r(ze.version,wt.version))return[{command:Qn.setStyle,args:[wt]}];r(ze.center,wt.center)||Rt.push({command:Qn.setCenter,args:[wt.center]}),r(ze.zoom,wt.zoom)||Rt.push({command:Qn.setZoom,args:[wt.zoom]}),r(ze.bearing,wt.bearing)||Rt.push({command:Qn.setBearing,args:[wt.bearing]}),r(ze.pitch,wt.pitch)||Rt.push({command:Qn.setPitch,args:[wt.pitch]}),r(ze.sprite,wt.sprite)||Rt.push({command:Qn.setSprite,args:[wt.sprite]}),r(ze.glyphs,wt.glyphs)||Rt.push({command:Qn.setGlyphs,args:[wt.glyphs]}),r(ze.transition,wt.transition)||Rt.push({command:Qn.setTransition,args:[wt.transition]}),r(ze.light,wt.light)||Rt.push({command:Qn.setLight,args:[wt.light]}),r(ze.fog,wt.fog)||Rt.push({command:Qn.setFog,args:[wt.fog]});const Xt={},sr=[];!function(ze,wt,Rt,Xt){let sr;for(sr in wt=wt||{},ze=ze||{})ze.hasOwnProperty(sr)&&(wt.hasOwnProperty(sr)||Nt(sr,Rt,Xt));for(sr in wt)wt.hasOwnProperty(sr)&&(ze.hasOwnProperty(sr)?r(ze[sr],wt[sr])||("geojson"===ze[sr].type&&"geojson"===wt[sr].type&&Zt(ze,wt,sr)?Rt.push({command:Qn.setGeoJSONSourceData,args:[sr,wt[sr].data]}):Gt(sr,wt,Rt,Xt)):Ut(sr,wt,Rt))}(ze.sources,wt.sources,sr,Xt);const Dr=[];ze.layers&&ze.layers.forEach(ze=>{Xt[ze.source]?Rt.push({command:Qn.removeLayer,args:[ze.id]}):Dr.push(ze)});let Lr=ze.terrain;Lr&&Xt[Lr.source]&&(Rt.push({command:Qn.setTerrain,args:[void 0]}),Lr=void 0),Rt=Rt.concat(sr),r(Lr,wt.terrain)||Rt.push({command:Qn.setTerrain,args:[wt.terrain]}),function(ze,wt,Rt){wt=wt||[];const Xt=(ze=ze||[]).map(jt),sr=wt.map(jt),Dr=ze.reduce(qt,{}),Lr=wt.reduce(qt,{}),Ur=Xt.slice(),qr=Object.create(null);let ri,ai,Yi,Ji,Qi,kn,jn;for(ri=0,ai=0;ri<Xt.length;ri++)Yi=Xt[ri],Lr.hasOwnProperty(Yi)?ai++:(Rt.push({command:Qn.removeLayer,args:[Yi]}),Ur.splice(Ur.indexOf(Yi,ai),1));for(ri=0,ai=0;ri<sr.length;ri++)Yi=sr[sr.length-1-ri],Ur[Ur.length-1-ri]!==Yi&&(Dr.hasOwnProperty(Yi)?(Rt.push({command:Qn.removeLayer,args:[Yi]}
20),Ur.splice(Ur.lastIndexOf(Yi,Ur.length-ai),1)):ai++,kn=Ur[Ur.length-ri],Rt.push({command:Qn.addLayer,args:[Lr[Yi],kn]}),Ur.splice(Ur.length-ri,0,Yi),qr[Yi]=!0);for(ri=0;ri<sr.length;ri++)if(Yi=sr[ri],Ji=Dr[Yi],Qi=Lr[Yi],!qr[Yi]&&!r(Ji,Qi))if(r(Ji.source,Qi.source)&&r(Ji["source-layer"],Qi["source-layer"])&&r(Ji.type,Qi.type)){for(jn in Vt(Ji.layout,Qi.layout,Rt,Yi,null,Qn.setLayoutProperty),Vt(Ji.paint,Qi.paint,Rt,Yi,null,Qn.setPaintProperty),r(Ji.filter,Qi.filter)||Rt.push({command:Qn.setFilter,args:[Yi,Qi.filter]}),r(Ji.minzoom,Qi.minzoom)&&r(Ji.maxzoom,Qi.maxzoom)||Rt.push({command:Qn.setLayerZoomRange,args:[Yi,Qi.minzoom,Qi.maxzoom]}),Ji)Ji.hasOwnProperty(jn)&&"layout"!==jn&&"paint"!==jn&&"filter"!==jn&&"metadata"!==jn&&"minzoom"!==jn&&"maxzoom"!==jn&&(0===jn.indexOf("paint.")?Vt(Ji[jn],Qi[jn],Rt,Yi,jn.slice(6),Qn.setPaintProperty):r(Ji[jn],Qi[jn])||Rt.push({command:Qn.setLayerProperty,args:[Yi,jn,Qi[jn]]}));for(jn in Qi)Qi.hasOwnProperty(jn)&&!Ji.hasOwnProperty(jn)&&"layout"!==jn&&"paint"!==jn&&"filter"!==jn&&"metadata"!==jn&&"minzoom"!==jn&&"maxzoom"!==jn&&(0===jn.indexOf("paint.")?Vt(Ji[jn],Qi[jn],Rt,Yi,jn.slice(6),Qn.setPaintProperty):r(Ji[jn],Qi[jn])||Rt.push({command:Qn.setLayerProperty,args:[Yi,jn,Qi[jn]]}))}else Rt.push({command:Qn.removeLayer,args:[Yi]}),kn=Ur[Ur.lastIndexOf(Yi)+1],Rt.push({command:Qn.addLayer,args:[Qi,kn]})}(Dr,wt.layers,Rt)}catch(ze){Rt=[{command:Qn.setStyle,args:[wt]}]}return Rt}(this.serialize(),wt).filter(ze=>!(ze.command in Oa));if(0===Rt.length)return!1;const Xt=Rt.filter(ze=>!(ze.command in Pa));if(Xt.length>0)throw new Error(`Unimplemented: ${Xt.map(ze=>ze.command).join(", ")}.`);return Rt.forEach(ze=>{"setTransition"!==ze.command&&this[ze.command].apply(this,ze.args)}),this.stylesheet=wt,!0}addImage(wt,Rt){if(this.getImage(wt))return this.fire(new ze.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(wt,Rt),this._afterImageUpdated(wt)}updateImage(ze,wt){this.imageManager.updateImage(ze,wt)}getImage(ze){return this.imageManager.getImage(ze)}removeImage(wt){if(!this.getImage(wt))return this.fire(new ze.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(wt),this._afterImageUpdated(wt)}_afterImageUpdated(wt){this._availableImages=this.imageManager.listImages(),this._changedImages[wt]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new ze.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(wt,Rt,Xt={}){if(this._checkLoaded(),void 0!==this.getSource(wt))throw new Error("There is already a source with this ID");if(!Rt.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(Rt).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(Rt.type)>=0&&this._validate(ze.validateStyle.source,`sources.${wt}`,Rt,null,Xt))return;this.map&&this.map._collectResourceTiming&&(Rt.collectResourceTiming=!0);const sr=St(wt,Rt,this.dispatcher,this);sr.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:sr.serialize(),sourceId:wt}));const a=Rt=>{const Xt=(Rt?"symbol:":"other:")+wt,Dr=this._sourceCaches[Xt]=new ze.SourceCache(Xt,sr,Rt);(Rt?this._symbolSourceCaches:this._otherSourceCaches)[wt]=Dr,Dr.style=this,Dr.onAdd(this.map)};a(!1),"vector"!==Rt.type&&"geojson"!==Rt.type||a(!0),sr.onAdd&&sr.onAdd(this.map),this._changed=!0}removeSource(wt){this._checkLoaded();const Rt=this.getSource(wt);if(void 0===Rt)throw new Error("There is no source with this ID");for(const Rt in this._layers)if(this._layers[Rt].source===wt)return this.fire(new ze.ErrorEvent(new Error(`Source "${wt}" cannot be removed while layer "${Rt}" is using it.`)));if(this.terrain&&this.terrain.get().source===wt)return this.fire(new ze.ErrorEvent(new Error(`Source "${wt}" cannot be removed while terrain is using it.`)));const Xt=this._getSourceCaches(wt);for(const wt of Xt)delete this._sourceCaches[wt.id],delete this._updatedSources[wt.id],wt.fire(new ze.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:wt.getSource().id})),wt.setEventedParent(null),wt.clearTiles();delete this._otherSourceCaches[wt],delete this._symbolSourceCaches[wt],Rt.setEventedParent(null),Rt.onRemove&&Rt.onRemove(this.map),this._changed=!0}
vendor: 11,399 bytes, line 20
20setGeoJSONSourceData(ze,wt){this._checkLoaded(),this.getSource(ze).setData(wt),this._changed=!0}getSource(ze){const wt=this._getSourceCache(ze);return wt&&wt.getSource()}addLayer(wt,Rt,Xt={}){this._checkLoaded();const sr=wt.id;if(this.getLayer(sr))return void this.fire(new ze.ErrorEvent(new Error(`Layer with id "${sr}" already exists on this map`)));let Dr;if("custom"===wt.type){if(Be(this,ze.validateCustomStyleLayer(wt)))return;Dr=ze.createStyleLayer(wt)}else{if("object"==typeof wt.source&&(this.addSource(sr,wt.source),wt=ze.clone$2(wt),wt=ze.extend(wt,{source:sr})),this._validate(ze.validateStyle.layer,`layers.${sr}`,wt,{arrayIndex:-1},Xt))return;Dr=ze.createStyleLayer(wt),this._validateLayer(Dr),Dr.setEventedParent(this,{layer:{id:sr}}),this._serializedLayers[Dr.id]=Dr.serialize(),this._updateLayerCount(Dr,!0)}const Lr=Rt?this._order.indexOf(Rt):this._order.length;if(Rt&&-1===Lr)return void this.fire(new ze.ErrorEvent(new Error(`Layer with id "${Rt}" does not exist on this map.`)));this._order.splice(Lr,0,sr),this._layerOrderChanged=!0,this._layers[sr]=Dr;const Ur=this._getLayerSourceCache(Dr);if(this._removedLayers[sr]&&Dr.source&&Ur&&"custom"!==Dr.type){const ze=this._removedLayers[sr];delete this._removedLayers[sr],ze.type!==Dr.type?this._updatedSources[Dr.source]="clear":(this._updatedSources[Dr.source]="reload",Ur.pause())}this._updateLayer(Dr),Dr.onAdd&&Dr.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(wt,Rt){if(this._checkLoaded(),this._changed=!0,!this._layers[wt])return void this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be moved.`)));if(wt===Rt)return;const Xt=this._order.indexOf(wt);this._order.splice(Xt,1);const sr=Rt?this._order.indexOf(Rt):this._order.length;Rt&&-1===sr?this.fire(new ze.ErrorEvent(new Error(`Layer with id "${Rt}" does not exist on this map.`))):(this._order.splice(sr,0,wt),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(wt){this._checkLoaded();const Rt=this._layers[wt];if(!Rt)return void this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be removed.`)));Rt.setEventedParent(null),this._updateLayerCount(Rt,!1);const Xt=this._order.indexOf(wt);this._order.splice(Xt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[wt]=Rt,delete this._layers[wt],delete this._serializedLayers[wt],delete this._updatedLayers[wt],delete this._updatedPaintProps[wt],Rt.onRemove&&Rt.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(ze){return this._layers[ze]}hasLayer(ze){return ze in this._layers}hasLayerType(ze){for(const wt in this._layers)if(this._layers[wt].type===ze)return!0;return!1}setLayerZoomRange(wt,Rt,Xt){this._checkLoaded();const sr=this.getLayer(wt);sr?sr.minzoom===Rt&&sr.maxzoom===Xt||(null!=Rt&&(sr.minzoom=Rt),null!=Xt&&(sr.maxzoom=Xt),this._updateLayer(sr)):this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(wt,Rt,Xt={}){this._checkLoaded();const sr=this.getLayer(wt);if(sr){if(!r(sr.filter,Rt))return null==Rt?(sr.filter=void 0,void this._updateLayer(sr)):void(this._validate(ze.validateStyle.filter,`layers.${sr.id}.filter`,Rt,null,Xt)||(sr.filter=ze.clone$2(Rt),this._updateLayer(sr)))}else this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be filtered.`)))}getFilter(wt){return ze.clone$2(this.getLayer(wt).filter)}setLayoutProperty(wt,Rt,Xt,sr={}){this._checkLoaded();const Dr=this.getLayer(wt);Dr?r(Dr.getLayoutProperty(Rt),Xt)||(Dr.setLayoutProperty(Rt,Xt,sr),this._updateLayer(Dr)):this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(wt,Rt){const Xt=this.getLayer(wt);if(Xt)return Xt.getLayoutProperty(Rt);this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style.`)))}setPaintProperty(wt,Rt,Xt,sr={}){this._checkLoaded();const Dr=this.getLayer(wt);Dr?r(Dr.getPaintProperty(Rt),Xt)||(Dr.setPaintProperty(Rt,Xt,sr)&&this._updateLayer(Dr),this._changed=!0,this._updatedPaintProps[wt]=!0):this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(ze,wt){return this.getLayer(ze).getPaintProperty(wt)}setFeatureState(wt,Rt){this._checkLoaded();const Xt=wt.source,sr=wt.sourceLayer,Dr=this.getSource(Xt);if(void 0===Dr)return void this.fire(new ze.ErrorEvent(new Error(`The source '${Xt}' does not exist in the map's style.`)));const Lr=Dr.type;if("geojson"===Lr&&sr)return void this.fire(new ze.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===Lr&&!sr)return void this.fire(new ze.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===wt.id&&this.fire(new ze.ErrorEvent(new Error("The feature id parameter must be provided.")));const Ur=this._getSourceCaches(Xt);for(const ze of Ur)ze.setFeatureState(sr,wt.id,Rt)}removeFeatureState(wt,Rt){this._checkLoaded();const Xt=wt.source,sr=this.getSource(Xt);if(void 0===sr)return void this.fire(new ze.ErrorEvent(new Error(`The source '${Xt}' does not exist in the map's style.`)));const Dr=sr.type,Lr="vector"===Dr?wt.sourceLayer:void 0;if("vector"===Dr&&!Lr)return void this.fire(new ze.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(Rt&&"string"!=typeof wt.id&&"number"!=typeof wt.id)return void this.fire(new ze.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const Ur=this._getSourceCaches(Xt);for(const ze of Ur)ze.removeFeatureState(Lr,wt.id,Rt)}getFeatureState(wt){this._checkLoaded();const Rt=wt.source,Xt=wt.sourceLayer,sr=this.getSource(Rt);if(void 0!==sr){if("vector"!==sr.type||Xt)return void 0===wt.id&&this.fire(new ze.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(Rt)[0].getFeatureState(Xt,wt.id);this.fire(new ze.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new ze.ErrorEvent(new Error(`The source '${Rt}' does not exist in the map's style.`)))}getTransition(){return ze.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const wt={};for(const ze in this._sourceCaches){const Rt=this._sourceCaches[ze].getSource();wt[Rt.id]||(wt[Rt.id]=Rt.serialize())}return ze.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.stylesheet.terrain,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:wt,layers:this._serializeLayers(this._order)},ze=>void 0!==ze)}_updateLayer(ze){this._updatedLayers[ze.id]=!0;const wt=this._getLayerSourceCache(ze);ze.source&&!this._updatedSources[ze.source]&&wt&&"raster"!==wt.getSource().type&&(this._updatedSources[ze.source]="reload",wt.pause()),this._changed=!0}_flattenAndSortRenderedFeatures(ze){const e=ze=>"fill-extrusion"===this._layers[ze].type,wt={},Rt=[];for(let Xt=this._order.length-1;Xt>=0;Xt--){const sr=this._order[Xt];if(e(sr)){wt[sr]=Xt;for(const wt of ze){const ze=wt[sr];if(ze)for(const wt of ze)Rt.push(wt)}}}Rt.sort((ze,wt)=>wt.intersectionZ-ze.intersectionZ);const Xt=[];for(let sr=this._order.length-1;sr>=0;sr--){const Dr=this._order[sr];if(e(Dr))for(let ze=Rt.length-1;ze>=0;ze--){const Dr=Rt[ze].feature;if(wt[Dr.layer.id]<sr)break;Xt.push(Dr),Rt.pop()}else for(const wt of ze){const ze=wt[Dr];if(ze)for(const wt of ze)Xt.push(wt.feature)}}return Xt}queryRenderedFeatures(wt,Rt,Xt){Rt&&Rt.filter&&this._validate(ze.validateStyle.filter,"queryRenderedFeatures.filter",Rt.filter,null,Rt);const sr={};if(Rt&&Rt.layers){if(!Array.isArray(Rt.layers))return this.fire(new ze.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const wt of Rt.layers){const Rt=this._layers[wt];if(!Rt)return this.fire(new ze.ErrorEvent(new Error(`The layer '${wt}' does not exist in the map's style and cannot be queried for features.`))),[];sr[Rt.source]=!0}}const Dr=[];Rt.availableImages=this._availableImages;const Lr=Rt&&Rt.layers?Rt.layers.some(ze=>{const wt=this.getLayer(ze);return wt&&wt.is3D()}):this.has3DLayers(),Ur=D.createFromScreenPoints(wt,Xt);for(const ze in this._sourceCaches){const wt=this._sourceCaches[ze].getSource().id;Rt.layers&&!sr[wt]||Dr.push(Mt(this._sourceCaches[ze],this._layers,this._serializedLayers,Ur,Rt,Xt,Lr,!!this.map._showQueryGeometry))}return this.placement&&Dr.push(function(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur={},qr=Dr.queryRenderedSymbols(Xt),ri=[];for(const ze of Object.keys(qr).map(Number))ri.push(Lr[ze]);ri.sort(Dt);for(const Rt of ri){const Xt=Rt.featureIndex.lookupSymbolFeatures(qr[Rt.bucketInstanceId],wt,Rt.bucketIndex,Rt.sourceLayerIndex,sr.filter,sr.layers,sr.availableImages,ze);for(const ze in Xt){const wt=Ur[ze]=Ur[ze]||[],sr=Xt[ze];sr.sort((ze,wt)=>{const Xt=Rt.featureSortOrder;if(Xt){const Rt=Xt.indexOf(ze.featureIndex);return Xt.indexOf(wt.featureIndex)-Rt}return wt.featureIndex-ze.featureIndex});for(const ze of sr)wt.push(ze)}}for(const wt in Ur)Ur[wt].forEach(Xt=>{const sr=Xt.feature,Dr=Rt(ze[wt]).getFeatureState(sr.layer["source-layer"],sr.id);sr.source=sr.layer.source,sr.layer["source-layer"]&&(sr.sourceLayer=sr.layer["source-layer"]),sr.state=Dr});return Ur}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),Ur.screenGeometry,Rt,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Dr)}querySourceFeatures(wt,Rt){Rt&&Rt.filter&&this._validate(ze.validateStyle.filter,"querySourceFeatures.filter",Rt.filter,null,Rt);const Xt=this._getSourceCaches(wt);let sr=[];for(const ze of Xt)sr=sr.concat(zt(ze,Rt));return sr}addSourceType(ze,wt,Rt){return Ze.getSourceType(ze)?Rt(new Error(`A source type called "${ze}" already exists.`)):(Ze.setSourceType(ze,wt),wt.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:ze,url:wt.workerSourceURL},Rt):Rt(null,null))}getLight(){return this.light.getLight()}setLight(wt,Rt={}){this._checkLoaded();const Xt=this.light.getLight();let sr=!1;for(const ze in wt)if(!r(wt[ze],Xt[ze])){sr=!0;break}if(!sr)return;const Dr={now:ze.exported.now(),transition:ze.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(wt,Rt),this.light.updateTransitions(Dr)}getTerrain(){return this.terrain?this.terrain.get():null}setTerrain(wt){if(this._checkLoaded(),!wt)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);if("object"==typeof wt.source){const Rt="terrain-dem-src";this.addSource(Rt,wt.source),wt=ze.clone$2(wt),wt=ze.extend(wt,{source:Rt})}if(!this._validate(ze.validateStyle.terrain,"terrain",wt)){if(this.terrain){const Rt=this.terrain,Xt=Rt.get();for(const sr in wt)if(!r(wt[sr],Xt[sr])){Rt.set(wt),this.stylesheet.terrain=wt;const Xt={now:ze.exported.now(),transition:ze.extend({duration:0},this.stylesheet.transition)};Rt.updateTransitions(Xt);break}}else this._createTerrain(wt);
20this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}}_createFog(wt){const Rt=this.fog=new I(wt);this.stylesheet.fog=wt;const Xt={now:ze.exported.now(),transition:ze.extend({duration:0},this.stylesheet.transition)};Rt.updateTransitions(Xt)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const ze of this.map._markers)ze._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(wt){if(this._checkLoaded(),!wt)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const Rt=this.fog,Xt=Rt.get();for(const sr in wt)if(!r(wt[sr],Xt[sr])){Rt.set(wt),this.stylesheet.fog=wt;const Xt={now:ze.exported.now(),transition:ze.extend({duration:0},this.stylesheet.transition)};Rt.updateTransitions(Xt);break}}else this._createFog(wt);this._markersNeedUpdate=!0}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const ze=this._order.filter(ze=>this.isLayerDraped(this._layers[ze])),wt=this._order.filter(ze=>!this.isLayerDraped(this._layers[ze]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...ze),this._drapedFirstOrder.push(...wt)}_createTerrain(wt){const Rt=this.terrain=new w(wt);this.stylesheet.terrain=wt,this.dispatcher.broadcast("enableTerrain",!0),this._force3DLayerUpdate();const Xt={now:ze.exported.now(),transition:ze.extend({duration:0},this.stylesheet.transition)};Rt.updateTransitions(Xt)}_force3DLayerUpdate(){for(const ze in this._layers){const wt=this._layers[ze];"fill-extrusion"===wt.type&&this._updateLayer(wt)}}_validate(wt,Rt,Xt,sr,Dr={}){return(!Dr||!1!==Dr.validate)&&Be(this,wt.call(ze.validateStyle,ze.extend({key:Rt,style:this.serialize(),value:Xt,styleSpec:ze.spec},sr)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),ze.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const ze in this._layers)this._layers[ze].setEventedParent(null);for(const ze in this._sourceCaches)this._sourceCaches[ze].clearTiles(),this._sourceCaches[ze].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(ze){const wt=this._getSourceCaches(ze);for(const ze of wt)ze.clearTiles()}_reloadSource(ze){const wt=this._getSourceCaches(ze);for(const ze of wt)ze.resume(),ze.reload()}_updateSources(ze){for(const wt in this._sourceCaches)this._sourceCaches[wt].update(ze)}_generateCollisionBoxes(){for(const ze in this._sourceCaches){const wt=this._sourceCaches[ze];wt.resume(),wt.reload()}}_updatePlacement(wt,Rt,Xt,sr,Dr=!1){let Lr=!1,Ur=!1;const qr={};for(const ze of this._order){const Rt=this._layers[ze];if("symbol"!==Rt.type)continue;if(!qr[Rt.source]){const ze=this._getLayerSourceCache(Rt);if(!ze)continue;qr[Rt.source]=ze.getRenderableIds(!0).map(wt=>ze.getTileByID(wt)).sort((ze,wt)=>wt.tileID.overscaledZ-ze.tileID.overscaledZ||(ze.tileID.isLessThan(wt.tileID)?-1:1))}const Xt=this.crossTileSymbolIndex.addLayer(Rt,qr[Rt.source],wt.center.lng);Lr=Lr||Xt}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),Dr=Dr||this._layerOrderChanged||0===Xt,this._layerOrderChanged&&this.fire(new ze.Event("neworder")),(Dr||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(ze.exported.now(),wt.zoom))&&(this.pauseablePlacement=new Ae(wt,this._order,Dr,Rt,Xt,sr,this.placement,this.fog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,qr),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(ze.exported.now()),Ur=!0),Lr&&this.pauseablePlacement.placement.setStale()),Ur||Lr)for(const ze of this._order){const wt=this._layers[ze];"symbol"===wt.type&&this.placement.updateLayerOpacities(wt,qr[wt.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(ze.exported.now())}_releaseSymbolFadeTiles(){for(const ze in this._sourceCaches)this._sourceCaches[ze].releaseSymbolFadeTiles()}getImages(ze,wt,Rt){this.imageManager.getImages(wt.icons,Rt),this._updateTilesForChangedImages();const o=ze=>{ze&&ze.setDependencies(wt.tileID.key,wt.type,wt.icons)};o(this._otherSourceCaches[wt.source]),o(this._symbolSourceCaches[wt.source])}getGlyphs(ze,wt,Rt){this.glyphManager.getGlyphs(wt.stacks,Rt)}
vendor: 4,205 bytes, line 20
20getResource(wt,Rt,Xt){return ze.makeRequest(Rt,Xt)}_getSourceCache(ze){return this._otherSourceCaches[ze]}_getLayerSourceCache(ze){return"symbol"===ze.type?this._symbolSourceCaches[ze.source]:this._otherSourceCaches[ze.source]}_getSourceCaches(ze){const wt=[];return this._otherSourceCaches[ze]&&wt.push(this._otherSourceCaches[ze]),this._symbolSourceCaches[ze]&&wt.push(this._symbolSourceCaches[ze]),wt}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}}Ze.getSourceType=function(ze){return Wn[ze]},Ze.setSourceType=function(ze,wt){Wn[ze]=wt},Ze.registerForPluginStateChange=ze.registerForPluginStateChange;var Ra="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}\n#endif",Na="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}";let Ba={},Ua={};Ba=Ke("","\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {return currentElevation(apos);}\n#endif\nfloat unpack_depth(vec4 rgba_depth)\n{const vec4 bit_shift=vec4(1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0,1.0
20);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;vec4 bounds=vec4(d,vec2(1.0)-d);h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",!0),Ua=Ke("#ifdef FOG\nuniform float u_fog_temporal_offset;float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif","#ifdef FOG\nuniform mat4 u_fog_matrix;vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",!0);const qa=Ke("#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\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}","#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(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
20return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),rs=Ra;var ss={background:Ke("uniform vec4 u_color;uniform float u_opacity;void main() {vec4 out_color=u_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:Ke("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_mix);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*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);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:Ke("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(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform 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\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
20iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float height=circle_elevation(circle_center);vec4 world_center=vec4(circle_center,height,1);vec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);vec4 occlusion_world_center=vec4(circle_center,cantilevered_height,1);vec4 occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nvec4 occlusion_world_center=world_center;vec4 occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:Ke("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:Ke("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 FOG\ngl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);\n#endif\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;vec3 pos=vec3(floor(a_pos*0.5)+extrude,elevation(floor(a_pos*0.5)));gl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:Ke("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}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Ke("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=u_matrix*vec4(a_pos,elevation(a_pos),1.0);gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ke("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_2f;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_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ke("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() {float h=elevation(a_pos);v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);}"),fill:Ke("#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\nvec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:Ke("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);vec4 out_color=outline_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:Ke("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);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:Ke("uniform 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);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*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);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:Ke("varying vec4 v_color;void main() {vec4 color=v_color;\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;varying 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 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;\n#ifdef TERRAIN\nvec2 centroid_pos=a_centroid_pos;bool flat_roof=centroid_pos.x !=0.0;floa
20t ele=elevation(pos_nx.xy);float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 pos=vec3(pos_nx.xy,h);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#else\nvec3 pos=vec3(pos_nx.xy,t > 0.0 ? height : base);gl_Position=u_matrix*vec4(pos,1);\n#endif\nfloat 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,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*=(\n(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.rgb+=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:Ke("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 out_color=mix(color1,color2,u_fade);out_color=out_color*v_lighting;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;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;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;\n#ifdef TERRAIN\nvec2 centroid_pos=a_centroid_pos;bool flat_roof=centroid_pos.x !=0.0;float ele=elevation(pos_nx.xy);float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 p=vec3(pos_nx.xy,h);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);\n#else\nvec3 p=vec3(pos_nx.xy,z);gl_Position=u_matrix*vec4(p,1);\n#endif\nvec2 pos=normal.z==1.0\n? pos_nx.xy\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,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*=(\n(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;\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:Ke("#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) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos);float f=getElevation(v_pos+vec2(epsilon.x,0));float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float h=getElevation(v_pos+vec2(0,epsilon.y));float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.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:Ke("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;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;
20float 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 FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:Ke("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);vec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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;\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;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#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),lineGradient:Ke("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);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_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#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:Ke("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\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);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_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_linesofar;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;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#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),lineSDF:Ke("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;
20uniform float u_mix;uniform vec3 u_scale;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\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\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\n#pragma mapbox: initialize mediump vec4 dash_from\n#pragma mapbox: initialize mediump vec4 dash_to\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);float sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);
20float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);vec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform vec2 u_texsize;uniform mediump vec3 u_scale;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\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\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\n#pragma mapbox: initialize mediump vec4 dash_from\n#pragma mapbox: initialize mediump vec4 dash_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;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nfloat tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;float scaleA=dash_from.z==0.0 ? 0.0 : tileZoomRatio/(dash_from.z*fromScale);float scaleB=dash_to.z==0.0 ? 0.0 : tileZoomRatio/(dash_to.z*toScale);float heightA=dash_from.y;float heightB=dash_to.y;v_tex_a=vec2(a_linesofar*scaleA/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);v_tex_b=vec2(a_linesofar*scaleB/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);v_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:Ke("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(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:Ke("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;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\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;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;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);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(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));}"),symbolSDF:Ke("#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 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 vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\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;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;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);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(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:Ke("#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;
20gl_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;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\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;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;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);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(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,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);}"),terrainRaster:Ke("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef FOG\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nconst float skirtOffset=24575.0;const float wireframeOffset=0.00015;void main() {v_pos0=a_texture_pos/8192.0;float skirt=float(a_pos.x >=skirtOffset);float elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\n#endif\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n}"),terrainDepth:Ke("#ifdef GL_ES\nprecision highp float;\n#endif\nvec4 pack_depth(float ndc_z) {float depth=ndc_z*0.5+0.5;const vec4 bit_shift=vec4(256.0*256.0*256.0,256.0*256.0,256.0,1.0
20);const vec4 bit_mask =vec4(0.0,1.0/256.0,1.0/256.0,1.0/256.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying float v_depth;void main() {float elevation=elevation(a_texture_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Ke("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
20nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Na),skyboxGradient:Ke("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Na),skyboxCapture:Ke
vendor: 3,838 bytes, line 20
20("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}")
vendor: 36,975 bytes, line 20
20};function Ke(ze,wt,Rt){const Xt=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,sr=/uniform (highp |mediump |lowp )?([\w]+) ([\w]+)([\s]*)([\w]*)/g,Dr=wt.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),Lr=ze.match(sr),Ur=wt.match(sr),qr=Ra.match(sr);let ri=Ur?Ur.concat(Lr):Lr;Rt||(Ba.staticUniforms&&(ri=Ba.staticUniforms.concat(ri)),Ua.staticUniforms&&(ri=Ua.staticUniforms.concat(ri))),ri&&(ri=ri.concat(qr));const ai={};return{fragmentSource:ze=ze.replace(Xt,(ze,wt,Rt,Xt,sr)=>(ai[sr]=!0,"define"===wt?`\n#ifndef HAS_UNIFORM_u_${sr}\nvarying ${Rt} ${Xt} ${sr};\n#else\nuniform ${Rt} ${Xt} u_${sr};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${sr}\n ${Rt} ${Xt} ${sr} = u_${sr};\n#endif\n`)),vertexSource:wt=wt.replace(Xt,(ze,wt,Rt,Xt,sr)=>{const Dr="float"===Xt?"vec2":"vec4",Lr=sr.match(/color/)?"color":Dr;return ai[sr]?"define"===wt?`\n#ifndef HAS_UNIFORM_u_${sr}\nuniform lowp float u_${sr}_t;\nattribute ${Rt} ${Dr} a_${sr};\nvarying ${Rt} ${Xt} ${sr};\n#else\nuniform ${Rt} ${Xt} u_${sr};\n#endif\n`:"vec4"===Lr?`\n#ifndef HAS_UNIFORM_u_${sr}\n ${sr} = a_${sr};\n#else\n ${Rt} ${Xt} ${sr} = u_${sr};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${sr}\n ${sr} = unpack_mix_${Lr}(a_${sr}, u_${sr}_t);\n#else\n ${Rt} ${Xt} ${sr} = u_${sr};\n#endif\n`:"define"===wt?`\n#ifndef HAS_UNIFORM_u_${sr}\nuniform lowp float u_${sr}_t;\nattribute ${Rt} ${Dr} a_${sr};\n#else\nuniform ${Rt} ${Xt} u_${sr};\n#endif\n`:"vec4"===Lr?`\n#ifndef HAS_UNIFORM_u_${sr}\n ${Rt} ${Xt} ${sr} = a_${sr};\n#else\n ${Rt} ${Xt} ${sr} = u_${sr};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${sr}\n ${Rt} ${Xt} ${sr} = unpack_mix_${Lr}(a_${sr}, u_${sr}_t);\n#else\n ${Rt} ${Xt} ${sr} = u_${sr};\n#endif\n`}),staticAttributes:Dr,staticUniforms:ri}}class Ye{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){this.context=ze;let qr=this.boundPaintVertexBuffers.length!==Xt.length;for(let ze=0;!qr&&ze<Xt.length;ze++)this.boundPaintVertexBuffers[ze]!==Xt[ze]&&(qr=!0);ze.extVertexArrayObject&&this.vao&&this.boundProgram===wt&&this.boundLayoutVertexBuffer===Rt&&!qr&&this.boundIndexBuffer===sr&&this.boundVertexOffset===Dr&&this.boundDynamicVertexBuffer===Lr&&this.boundDynamicVertexBuffer2===Ur?(ze.bindVertexArrayOES.set(this.vao),Lr&&Lr.bind(),sr&&sr.dynamicDraw&&sr.bind(),Ur&&Ur.bind()):this.freshBind(wt,Rt,Xt,sr,Dr,Lr,Ur)}freshBind(ze,wt,Rt,Xt,sr,Dr,Lr){let Ur;const qr=ze.numAttributes,ri=this.context,ai=ri.gl;if(ri.extVertexArrayObject)this.vao&&this.destroy(),this.vao=ri.extVertexArrayObject.createVertexArrayOES(),ri.bindVertexArrayOES.set(this.vao),Ur=0,this.boundProgram=ze,this.boundLayoutVertexBuffer=wt,this.boundPaintVertexBuffers=Rt,this.boundIndexBuffer=Xt,this.boundVertexOffset=sr,this.boundDynamicVertexBuffer=Dr,this.boundDynamicVertexBuffer2=Lr;else{Ur=ri.currentNumAttributes||0;for(let ze=qr;ze<Ur;ze++)ai.disableVertexAttribArray(ze)}wt.enableAttributes(ai,ze);for(const wt of Rt)wt.enableAttributes(ai,ze);Dr&&Dr.enableAttributes(ai,ze),Lr&&Lr.enableAttributes(ai,ze),wt.bind(),wt.setVertexAttribPointers(ai,ze,sr);for(const wt of Rt)wt.bind(),wt.setVertexAttribPointers(ai,ze,sr);Dr&&(Dr.bind(),Dr.setVertexAttribPointers(ai,ze,sr)),Xt&&Xt.bind(),Lr&&(Lr.bind(),Lr.setVertexAttribPointers(ai,ze,sr)),ri.currentNumAttributes=qr}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Qe(wt,Rt){const Xt=Math.pow(2,Rt.canonical.z),sr=Rt.canonical.y;return[new ze.MercatorCoordinate(0,sr/Xt).toLngLat().lat,new ze.MercatorCoordinate(0,(sr+1)/Xt).toLngLat().lat]}function Je(wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=wt.context,ri=qr.gl,ai=Xt.fbo;if(!ai)return;wt.prepareDrawTile(Rt);const Yi=wt.useProgram("hillshade");qr.activeTexture.set(ri.TEXTURE0),ri.bindTexture(ri.TEXTURE_2D,ai.colorAttachment.get());const Ji=((ze,wt,Rt,Xt)=>{const sr=Rt.paint.get("hillshade-shadow-color"),Dr=Rt.paint.get("hillshade-highlight-color"),Lr=Rt.paint.get("hillshade-accent-color");let Ur=Rt.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===Rt.paint.get("hillshade-illumination-anchor")&&(Ur-=ze.transform.angle);const qr=!ze.options.moving;return{u_matrix:Xt||ze.transform.calculateProjMatrix(wt.tileID.toUnwrapped(),qr),u_image:0,u_latrange:Qe(0,wt.tileID),u_light:[Rt.paint.get("hillshade-exaggeration"),Ur],u_shadow:sr,u_highlight:Dr,u_accent:Lr}})(wt,Xt,sr,wt.terrain?Rt.projMatrix:null);wt.prepareDrawProgram(qr,Yi,Rt.toUnwrapped()),Yi.draw(qr,ri.TRIANGLES,Dr,Lr,Ur,ze.CullFaceMode.disabled,Ji,sr.id,wt.rasterBoundsBuffer,wt.quadTriangleIndexBuffer,wt.rasterBoundsSegments)}function ti(wt,Rt,Xt){if(!Rt.needsDEMTextureUpload)return;const sr=wt.context,Dr=sr.gl;sr.pixelStoreUnpackPremultiplyAlpha.set(!1),Rt.demTexture=Rt.demTexture||wt.getTileTexture(Xt.stride);const Lr=Xt.getPixels();Rt.demTexture?Rt.demTexture.update(Lr,{premultiply:!1}):Rt.demTexture=new ze.Texture(sr,Lr,Dr.RGBA,{premultiply:!1}),Rt.needsDEMTextureUpload=!1}function ei(wt,Rt,Xt,sr,Dr,Lr){const Ur=wt.context,qr=Ur.gl;if(!Rt.dem)return;const ri=Rt.dem;if(Ur.activeTexture.set(qr.TEXTURE1),ti(wt,Rt,ri),!Rt.demTexture)return;Rt.demTexture.bind(qr.NEAREST,qr.CLAMP_TO_EDGE);const ai=ri.dim;Ur.activeTexture.set(qr.TEXTURE0);let Yi=Rt.fbo;if(!Yi){const wt=new ze.Texture(Ur,{width:ai,height:ai,data:null},qr.RGBA);wt.bind(qr.LINEAR,qr.CLAMP_TO_EDGE),Yi=Rt.fbo=Ur.createFramebuffer(ai,ai,!0),Yi.colorAttachment.set(wt.texture)}Ur.bindFramebuffer.set(Yi.framebuffer),Ur.viewport.set([0,0,ai,ai]),wt.useProgram("hillshadePrepare").draw(Ur,qr.TRIANGLES,sr,Dr,Lr,ze.CullFaceMode.disabled,((wt,Rt)=>{const Xt=Rt.stride,sr=ze.create$1();return ze.ortho(sr,0,ze.EXTENT,-ze.EXTENT,0,0,1),ze.translate(sr,sr,[0,-ze.EXTENT,0]),{u_matrix:sr,u_image:1,u_dimension:[Xt,Xt],u_zoom:wt.overscaledZ,u_unpack:Rt.unpackVector}})(Rt.tileID,ri),Xt.id,wt.rasterBoundsBuffer,wt.quadTriangleIndexBuffer,wt.rasterBoundsSegments),Rt.needsHillshadePrepare=!1}const ii=(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_image0:new ze.Uniform1i(wt,Rt.u_image0),u_skirt_height:new ze.Uniform1f(wt,Rt.u_skirt_height)}),oi=(ze,wt)=>({u_matrix:ze,u_image0:0,u_skirt_height:wt}),_s=new class{constructor(){this.operations={}}newMorphing(ze,wt,Rt,Xt,sr){if(ze in this.operations){const wt=this.operations[ze];wt.to.tileID.key!==Rt.tileID.key&&(wt.queued=Rt)}else this.operations[ze]={startTime:Xt,phase:0,duration:sr,from:wt,to:Rt,queued:null}}getMorphValuesForProxy(ze){if(!(ze in this.operations))return null;const wt=this.operations[ze];return{from:wt.from,to:wt.to,phase:wt.phase}}update(ze){for(const wt in this.operations){const Rt=this.operations[wt];for(Rt.phase=(ze-Rt.startTime)/Rt.duration;Rt.phase>=1||!this._validOp(Rt);)if(!this._nextOp(Rt,ze)){delete this.operations[wt];break}}}_nextOp(ze,wt){return!!ze.queued&&(ze.from=ze.to,ze.to=ze.queued,ze.queued=null,ze.phase=0,ze.startTime=wt,!0)}_validOp(ze){return ze.from.hasData()&&ze.to.hasData()}},Pl={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function ni(ze,wt){const Rt=1<<ze.z;return!wt&&(0===ze.x||ze.x===Rt-1)||0===ze.y||ze.y===Rt-1}const si=ze=>({u_matrix:ze});function li(wt,Rt,Xt,sr,Dr){if(Dr>0){const Lr=ze.exported.now(),Ur=(Lr-wt.timeAdded)/Dr,qr=Rt?(Lr-Rt.timeAdded)/Dr:-1,ri=Xt.getSource(),ai=sr.coveringZoomLevel({tileSize:ri.tileSize,roundZoom:ri.roundZoom}),Yi=!Rt||Math.abs(Rt.tileID.overscaledZ-ai)>Math.abs(wt.tileID.overscaledZ-ai),Ji=Yi&&wt.refreshedUponExpiration?1:ze.clamp(Yi?Ur:1-qr,0,1);return wt.refreshedUponExpiration&&Ur>=1&&(wt.refreshedUponExpiration=!1),Rt?{opacity:1,mix:1-Ji}:{opacity:Ji,mix:0}}return{opacity:1,mix:0}}class ci extends ze.SourceCache{constructor(ze){const wt=St("proxy",{type:"geojson",maxzoom:ze.transform.maxZoom},new M(kt(),null),ze.style);super("proxy",wt,!1),wt.setEventedParent(this),this.map=this.getSource().map=ze,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(wt,Rt,Xt){if(wt.freezeTileCoverage)return;this.transform=wt;const sr=wt.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((Rt,Xt)=>{if(Rt[Xt.key]="",!this._tiles[Xt.key]){const Rt=new ze.Tile(Xt,this._source.tileSize*Xt.overscaleFactor(),wt.tileZoom);Rt.state="loaded",this._tiles[Xt.key]=Rt}return Rt},{});for(const ze in this._tiles)ze in sr||(this.freeFBO(ze),this._tiles[ze].state="unloaded",delete this._tiles[ze])}freeFBO(ze){const wt=this.proxyCachedFBO[ze];if(void 0!==wt){const Rt=Object.values(wt);this.renderCachePool.push(...Rt),delete this.proxyCachedFBO[ze]}}deallocRenderCache(){this.renderCache.forEach(ze=>ze.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class hi extends ze.OverscaledTileID{constructor(ze,wt,Rt){super(ze.overscaledZ,ze.wrap,ze.canonical.z,ze.canonical.x,ze.canonical.y),this.proxyTileKey=wt,this.projMatrix=Rt}}class di extends ze.Elevation{constructor(wt,Rt){super(),this.painter=wt,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[Xt,sr,Dr]=function(){const wt=new ze.StructArrayLayout4i8,Rt=new ze.StructArrayLayout3ui6,Xt=131;wt.reserve(17161),Rt.reserve(33800);const sr=ze.EXTENT/128,Dr=ze.EXTENT+sr/2,Lr=Dr+sr;for(let Rt=-sr;Rt<Lr;Rt+=sr)for(let Xt=-sr;Xt<Lr;Xt+=sr){const sr=Xt<0||Xt>Dr||Rt<0||Rt>Dr?24575:0,Lr=ze.clamp(Math.round(Xt),0,ze.EXTENT),Ur=ze.clamp(Math.round(Rt),0,ze.EXTENT);wt.emplaceBack(Lr+sr,Ur,Lr,Ur)}const l=(ze,wt)=>{const sr=wt*Xt+ze;Rt.emplaceBack(sr+1,sr,sr+Xt),Rt.emplaceBack(sr+Xt,sr+Xt+1,sr+1)};for(let ze=1;ze<129;ze++)for(let wt=1;wt<129;wt++)l(wt,ze);return[0,129].forEach(ze=>{for(let wt=0;wt<130;wt++)l(wt,ze),l(ze,wt)}),[wt,Rt,32768]}(),Lr=wt.context;this.gridBuffer=Lr.createVertexBuffer(Xt,Un.members),this.gridIndexBuffer=Lr.createIndexBuffer(sr),this.gridSegments=ze.SegmentVector.simpleSegment(0,0,Xt.length,sr.length),this.gridNoSkirtSegments=ze.SegmentVector.simpleSegment(0,0,Xt.length,Dr),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ci(Rt.map),this.orthoMatrix=ze.create$1(),ze.ortho(this.orthoMatrix,0,ze.EXTENT,0,ze.EXTENT,0,1);const Ur=Lr.gl;this._overlapStencilMode=new ze.StencilMode({func:Ur.GEQUAL,mask:255},0,255,Ur.KEEP,Ur.KEEP,Ur.REPLACE),this._previousZoom=wt.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=Rt,this._useVertexMorphing=!0,this._exaggeration=1}set style(ze){ze.on("data",this._onStyleDataEvent.bind(this)),ze.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=ze,this._checkRenderCacheEfficiency()}update(wt,Rt,Xt){if(wt&&wt.terrain){this._style!==wt&&(this.style=wt),this.enabled=!0;const sr=wt.terrain.properties;this.sourceCache=wt._getSourceCache(sr.get("source")),this._exaggeration=sr.get("exaggeration");const a=()=>{this.sourceCache.used&&ze.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const wt=this.sourceCache.getSource().tileSize/128,Xt=this.proxySourceCache.getSource().tileSize;this.sourceCache.update(Rt,wt*Xt,!0),this._findCoveringTileCache[this.sourceCache.id]={}};this.sourceCache.usedForTerrain||(this._findCoveringTileCache[this.sourceCache.id]={},this.sourceCache.usedForTerrain=!0,a(),this._initializing=!0),a(),Rt.updateElevation(!Xt),this._findCoveringTileCache[this.proxySourceCache.id]={},this.proxySourceCache.update(Rt),this._emptyDEMTextureDirty=!0}else this._disable()}_checkRenderCacheEfficiency(){const wt=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==wt.efficiency&&ze.warnOnce(`Terrain render cache efficiency is not optimal (${wt.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${wt.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(ze){ze.coord&&"source"===ze.dataType?this._clearRenderCacheForTile(ze.sourceCacheId,ze.coord):"style"===ze.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const ze in this._style._sourceCaches)this._style._sourceCaches[ze].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(ze=>ze.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture)}_source(){return this.enabled?this.sourceCache:null}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const ze=2*this.proxySourceCache.getSource().tileSize;return[ze,ze]}set useVertexMorphing(ze){this._useVertexMorphing=ze}updateTileBinding(wt){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const Rt=this.proxySourceCache,Xt=this.painter.transform;this._initializing&&(this._initializing=0===Xt._centerAltitude&&-1===this.getAtPointOrZero(ze.MercatorCoordinate.fromLngLat(Xt.center),-1),this._emptyDEMTextureDirty=!this._initializing);const sr=this.proxyCoords=Rt.getIds().map(ze=>{const wt=Rt.getTileByID(ze).tileID;return wt.projMatrix=Xt.calculateProjMatrix(wt.toUnwrapped()),wt});!function(wt,Rt){const Xt=Rt.transform.pointCoordinate(Rt.transform.getCameraPoint()),sr=new ze.pointGeometry(Xt.x,Xt.y);wt.sort((wt,Rt)=>{if(Rt.overscaledZ-wt.overscaledZ)return Rt.overscaledZ-wt.overscaledZ;const Xt=new ze.pointGeometry(wt.canonical.x+(1<<wt.canonical.z)*wt.wrap,wt.canonical.y),Dr=new ze.pointGeometry(Rt.canonical.x+(1<<Rt.canonical.z)*Rt.wrap,Rt.canonical.y),Lr=sr.mult(1<<wt.canonical.z);return Lr.x-=.5,Lr.y-=.5,Lr.distSqr(Xt)-Lr.distSqr(Dr)})}(sr,this.painter),this._previousZoom=Xt.zoom;const Dr=this.proxyToSource||{};this.proxyToSource={},sr.forEach(ze=>{this.proxyToSource[ze.key]={}}),this.terrainTileForTile={};const Lr=this._style._sourceCaches;for(const ze in Lr){const Rt=Lr[ze];if(!Rt.used)continue;if(Rt!==this.sourceCache&&(this._findCoveringTileCache[Rt.id]={}),this._setupProxiedCoordsForOrtho(Rt,wt[ze],Dr),Rt.usedForTerrain)continue;const Xt=wt[ze];Rt.getSource().reparseOverscaled&&this._assignTerrainTiles(Xt)}this.proxiedCoords[Rt.id]=sr.map(ze=>new hi(ze,ze.key,this.orthoMatrix)),this._assignTerrainTiles(sr),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(Dr),this.renderingToTexture=!1,this._updateTimestamp=ze.exported.now();const Ur={};this._visibleDemTiles=[];for(const ze of this.proxyCoords){const wt=this.terrainTileForTile[ze.key];if(!wt)continue;const Rt=wt.tileID.key;Rt in Ur||(this._visibleDemTiles.push(wt),Ur[Rt]=Rt)}}_assignTerrainTiles(ze){this._initializing||ze.forEach(ze=>{if(this.terrainTileForTile[ze.key])return;const wt=this._findTileCoveringTileID(ze,this.sourceCache);wt&&(this.terrainTileForTile[ze.key]=wt)})}_prepareDEMTextures(){const ze=this.painter.context,wt=ze.gl;for(const Rt in this.terrainTileForTile){const Xt=this.terrainTileForTile[Rt],sr=Xt.dem;!sr||Xt.demTexture&&!Xt.needsDEMTextureUpload||(ze.activeTexture.set(wt.TEXTURE1),ti(this.painter,Xt,sr))}}_prepareDemTileUniforms(ze,wt,Rt,Xt){if(!wt||null==wt.demTexture)return!1;const sr=ze.tileID.canonical,Dr=Math.pow(2,wt.tileID.canonical.z-sr.z),Lr=Xt||"";return Rt[`u_dem_tl${Lr}`]=[sr.x*Dr%1,sr.y*Dr%1],Rt[`u_dem_scale${Lr}`]=Dr,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){let ze=0;const wt=this._visibleDemTiles.reduce((wt,Rt)=>{if(!Rt.dem)return wt;const Xt=Rt.dem.tree.minimums[0];return Xt>0&&ze++,wt+Xt},0);return ze?wt/ze:0}_updateEmptyDEMTexture(){const wt=this.painter.context,Rt=wt.gl;wt.activeTexture.set(Rt.TEXTURE2);const Xt=this._getLoadedAreaMinimum(),sr={width:1,height:1,data:new Uint8Array(ze.DEMData.pack(Xt,this.sourceCache.getSource().encoding))};this._emptyDEMTextureDirty=!1;let Dr=this._emptyDEMTexture;return Dr?Dr.update(sr,{premultiply:!1}):Dr=this._emptyDEMTexture=new ze.Texture(wt,sr,Rt.RGBA,{premultiply:!1}),Dr}setupElevationDraw(wt,Rt,Xt){const sr=this.painter.context,Dr=sr.gl,Lr=(Ur=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:ze.DEMData.getUnpackVector(Ur),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var Ur;Lr.u_dem_size=this.sourceCache.getSource().tileSize,Lr.u_exaggeration=this.exaggeration();let qr=null,ri=null,ai=1;if(Xt&&Xt.morphing&&this._useVertexMorphing){const ze=Xt.morphing.srcDemTile,Rt=Xt.morphing.dstDemTile;ai=Xt.morphing.phase,ze&&Rt&&(this._prepareDemTileUniforms(wt,ze,Lr,"_prev")&&(ri=ze),this._prepareDemTileUniforms(wt,Rt,Lr)&&(qr=Rt))}if(ri&&qr?(sr.activeTexture.set(Dr.TEXTURE2),qr.demTexture.bind(Dr.NEAREST,Dr.CLAMP_TO_EDGE,Dr.NEAREST),sr.activeTexture.set(Dr.TEXTURE4),ri.demTexture.bind(Dr.NEAREST,Dr.CLAMP_TO_EDGE,Dr.NEAREST),Lr.u_dem_lerp=ai):(qr=this.terrainTileForTile[wt.tileID.key],sr.activeTexture.set(Dr.TEXTURE2),(this._prepareDemTileUniforms(wt,qr,Lr)?qr.demTexture:this.emptyDEMTexture).bind(Dr.NEAREST,Dr.CLAMP_TO_EDGE,Dr.NEAREST)),Xt&&Xt.useDepthForOcclusion&&(sr.activeTexture.set(Dr.TEXTURE3),this._depthTexture.bind(Dr.NEAREST,Dr.CLAMP_TO_EDGE,Dr.NEAREST),Lr.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height]),Xt&&Xt.useMeterToDem&&qr){const wt=(1<<qr.tileID.canonical.z)*ze.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;Lr.u_meter_to_dem=wt}Xt&&Xt.labelPlaneMatrixInv&&(Lr.u_label_plane_matrix_inv=Xt.labelPlaneMatrixInv),Rt.setTerrainUniformValues(sr,Lr)}renderToBackBuffer(wt){const Rt=this.painter,Xt=this.painter.context;0!==wt.length&&(Xt.bindFramebuffer.set(null),Xt.viewport.set([0,0,Rt.width,Rt.height]),this.renderingToTexture=!1,function(wt,Rt,Xt,sr,Dr){const Lr=wt.context,Ur=Lr.gl;let qr,ri;const ai=wt.options.showTerrainWireframe?2:0,d=(ze,Rt)=>{if(ri===ze)return;const Xt=[Pl[ze]];Rt&&Xt.push(Pl[ai]),qr=wt.useProgram("terrainRaster",null,Xt),ri=ze},Yi=wt.colorModeForRenderPass(),Ji=new ze.DepthMode(Ur.LEQUAL,ze.DepthMode.ReadWrite,wt.depthRangeFor3D);_s.update(Dr);const Qi=wt.transform,kn=6*Math.pow(1.5,22-Qi.zoom)*Rt.exaggeration();(ai?[!1,!0]:[!1]).forEach(ai=>{ri=-1;const jn=ai?Ur.LINES:Ur.TRIANGLES,[Un,Wn]=ai?Rt.getWirefameBuffer():[Rt.gridIndexBuffer,Rt.gridSegments];for(const ri of sr){const sr=Xt.getTile(ri),Qn=ze.StencilMode.disabled,Io=Rt.prevTerrainTileForTile[ri.key],Mo=Rt.terrainTileForTile[ri.key];Jn=Mo,null!=(Yn=Io)&&null!=Jn&&Yn.hasData()&&Jn.hasData()&&null!=Yn.demTexture&&null!=Jn.demTexture&&Yn.tileID.key!==Jn.tileID.key&&_s.newMorphing(ri.key,Io,Mo,Dr,250),Lr.activeTexture.set(Ur.TEXTURE0),sr.texture.bind(Ur.LINEAR,Ur.CLAMP_TO_EDGE,Ur.LINEAR_MIPMAP_NEAREST);const jo=_s.getMorphValuesForProxy(ri.key),zo=jo?1:0;let oa;jo&&(oa={morphing:{srcDemTile:jo.from,dstDemTile:jo.to,phase:ze.easeCubicInOut(jo.phase)}});const la=oi(ri.projMatrix,ni(ri.canonical,Qi.renderWorldCopies)?kn/10:kn);d(zo,ai),Rt.setupElevationDraw(sr,qr,oa),wt.prepareDrawProgram(Lr,qr,ri.toUnwrapped()),qr.draw(Lr,jn,Ji,Qn,Yi,ze.CullFaceMode.backCCW,la,"terrain_raster",Rt.gridBuffer,Un,Wn)}var Yn,Jn})}(Rt,this,this.proxySourceCache,wt,this._updateTimestamp),this.renderingToTexture=!0,wt.splice(0,wt.length))}renderBatch(wt){if(0===this._drapedRenderBatches.length)return wt+1;this.renderingToTexture=!0;const Rt=this.painter,Xt=this.painter.context,sr=this.proxySourceCache,Dr=this.proxiedCoords[sr.id],Lr=this._drapedRenderBatches.shift(),Ur=[],qr=Rt.style.order;let ri=0;for(const ai of Dr){const Dr=sr.getTileByID(ai.proxyTileKey),Yi=sr.proxyCachedFBO[ai.key]?sr.proxyCachedFBO[ai.key][wt]:void 0,Ji=void 0!==Yi?sr.renderCache[Yi]:this.pool[ri++],Qi=void 0!==Yi;if(Dr.texture=Ji.tex,Qi&&!Ji.dirty){Ur.push(Dr.tileID);continue}let kn;Xt.bindFramebuffer.set(Ji.fb.framebuffer),this.renderedToTile=!1,Ji.dirty&&(Xt.clear({color:ze.Color.transparent}),Ji.dirty=!1);for(let ze=Lr.start;ze<=Lr.end;++ze){const wt=Rt.style._layers[qr[ze]];if(wt.isHidden(Rt.transform.zoom))continue;const sr=Rt.style._getLayerSourceCache(wt),Dr=sr?this.proxyToSource[ai.key][sr.id]:[ai];if(!Dr)continue;const Lr=Dr;Xt.viewport.set([0,0,Ji.fb.width,Ji.fb.height]),kn!==(sr?sr.id:null)&&(this._setupStencil(Ji,Dr,wt,sr),kn=sr?sr.id:null),Rt.renderLayer(Rt,sr,wt,Lr)}this.renderedToTile?(Ji.dirty=!0,Ur.push(Dr.tileID)):Qi||--ri,5===ri&&(ri=0,this.renderToBackBuffer(Ur))}return this.renderToBackBuffer(Ur),this.renderingToTexture=!1,Xt.bindFramebuffer.set(null),Xt.viewport.set([0,0,Rt.width,Rt.height]),Lr.end+1}postRender(){}renderCacheEfficiency(ze){const wt=ze.order.length;if(0===wt)return{efficiency:100};let Rt,Xt=0,sr=0,Dr=!1;for(let Lr=0;Lr<wt;++Lr){const wt=ze._layers[ze.order[Lr]];this._style.isLayerDraped(wt)?(Dr&&++Xt,++sr):Dr||(Dr=!0,Rt=wt.id)}return 0===sr?{efficiency:100}:{efficiency:100*(1-Xt/sr),firstUndrapedLayer:Rt}}getMinElevationBelowMSL(){let ze=0;return this._visibleDemTiles.filter(ze=>ze.dem).forEach(wt=>{ze=Math.min(ze,wt.dem.tree.minimums[0])}),0===ze?ze:(ze-30)*this._exaggeration}raycast(ze,wt,Rt){if(!this._visibleDemTiles)return null;const Xt=this._visibleDemTiles.filter(ze=>ze.dem).map(Xt=>{const sr=Xt.tileID,Dr=Math.pow(2,sr.overscaledZ),{x:Lr,y:Ur}=sr.canonical,qr=Lr/Dr,ri=(Lr+1)/Dr,ai=Ur/Dr,Yi=(Ur+1)/Dr;return{minx:qr,miny:ai,maxx:ri,maxy:Yi,t:Xt.dem.tree.raycastRoot(qr,ai,ri,Yi,ze,wt,Rt),tile:Xt}});Xt.sort((ze,wt)=>(null!==ze.t?ze.t:Number.MAX_VALUE)-(null!==wt.t?wt.t:Number.MAX_VALUE));for(const sr of Xt){if(null==sr.t)return null;const Xt=sr.tile.dem.tree.raycast(sr.minx,sr.miny,sr.maxx,sr.maxy,ze,wt,Rt);if(null!=Xt)return Xt}return null}_createFBO(){const wt=this.painter.context,Rt=wt.gl,Xt=this.drapeBufferSize;wt.activeTexture.set(Rt.TEXTURE0);const sr=new ze.Texture(wt,{width:Xt[0],height:Xt[1],data:null},Rt.RGBA);sr.bind(Rt.LINEAR,Rt.CLAMP_TO_EDGE);const Dr=wt.createFramebuffer(Xt[0],Xt[1],!1);return Dr.colorAttachment.set(sr.texture),Dr.depthAttachment=new vt(wt,Dr.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=wt.createRenderbuffer(wt.gl.DEPTH_STENCIL,Xt[0],Xt[1]),this._stencilRef=0,Dr.depthAttachment.set(this._sharedDepthStencil),wt.clear({stencil:0})):Dr.depthAttachment.set(this._sharedDepthStencil),wt.extTextureFilterAnisotropic&&!wt.extTextureFilterAnisotropicForceOff&&Rt.texParameterf(Rt.TEXTURE_2D,wt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,wt.extTextureFilterAnisotropicMax),{fb:Dr,tex:sr,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const ze in this._style._sourceCaches)if(this._style._sourceCaches[ze].hasTransition())return!0;return this._style.order.some(ze=>{const wt=this._style._layers[ze],Rt=wt.isHidden(this.painter.transform.zoom),Xt=wt.getCrossfadeParameters(),sr=!!Xt&&1!==Xt.t,Dr=wt.hasTransition();return"custom"!==wt.type&&!Rt&&(sr||Dr)})}_clearRasterFadeFromRenderCache(){let ze=!1;for(const wt in this._style._sourceCaches)if(this._style._sourceCaches[wt]._source instanceof bt){ze=!0;break}if(ze)for(let ze=0;ze<this._style.order.length;++ze){const wt=this._style._layers[this._style.order[ze]],Rt=wt.isHidden(this.painter.transform.zoom),Xt=this._style._getLayerSourceCache(wt);if("raster"!==wt.type||Rt||!Xt)continue;const sr=wt.paint.get("raster-fade-duration");for(const ze of this.proxyCoords){const wt=this.proxyToSource[ze.key][Xt.id];if(wt)for(const ze of wt){const wt=li(Xt.getTile(ze),Xt.findLoadedParent(ze,0),Xt,this.painter.transform,sr);(1!==wt.opacity||0!==wt.mix)&&this._clearRenderCacheForTile(Xt.id,ze)}}}}_setupDrapedRenderBatches(){const ze=this._style.order,wt=ze.length;if(0===wt)return;const Rt=[];let Xt,sr=0,Dr=this._style._layers[ze[sr]];for(;!this._style.isLayerDraped(Dr)&&Dr.isHidden(this.painter.transform.zoom)&&++sr<wt;)Dr=this._style._layers[ze[sr]];for(;sr<wt;++sr){const wt=this._style._layers[ze[sr]];wt.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(wt)?void 0===Xt&&(Xt=sr):void 0!==Xt&&(Rt.push({start:Xt,end:sr-1}),Xt=void 0))}void 0!==Xt&&Rt.push({start:Xt,end:sr-1}),this._drapedRenderBatches=Rt}_setupRenderCache(ze){const wt=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,wt.renderCache.length>wt.renderCachePool.length){const ze=Object.values(wt.proxyCachedFBO);wt.proxyCachedFBO={};for(let Rt=0;Rt<ze.length;++Rt){const Xt=Object.values(ze[Rt]);wt.renderCachePool.push(...Xt)}}return}this._clearRasterFadeFromRenderCache();const Rt=this.proxyCoords,Xt=this._tilesDirty;for(let sr=Rt.length-1;sr>=0;sr--){const Dr=Rt[sr];if(wt.getTileByID(Dr.key),void 0!==wt.proxyCachedFBO[Dr.key]){const Rt=ze[Dr.key],sr=this.proxyToSource[Dr.key];let Lr=0;for(const ze in sr){const wt=sr[ze],Dr=Rt[ze];if(!Dr||Dr.length!==wt.length||wt.some((wt,Rt)=>wt!==Dr[Rt]||Xt[ze]&&Xt[ze].hasOwnProperty(wt.key))){Lr=-1;break}++Lr}for(const ze in wt.proxyCachedFBO[Dr.key])wt.renderCache[wt.proxyCachedFBO[Dr.key][ze]].dirty=Lr<0||Lr!==Object.values(Rt).length}}const sr=[...this._drapedRenderBatches];sr.sort((ze,wt)=>wt.end-wt.start-(ze.end-ze.start));for(const ze of sr)for(const Xt of Rt){if(wt.proxyCachedFBO[Xt.key])continue;let Rt=wt.renderCachePool.pop();void 0===Rt&&wt.renderCache.length<50&&(Rt=wt.renderCache.length,wt.renderCache.push(this._createFBO())),void 0!==Rt&&(wt.proxyCachedFBO[Xt.key]={},wt.proxyCachedFBO[Xt.key][ze.start]=Rt,wt.renderCache[Rt].dirty=!0)}this._tilesDirty={}}_setupStencil(ze,wt,Rt,Xt){if(!Xt||!this._sourceTilesOverlap[Xt.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const sr=this.painter.context,Dr=sr.gl;if(wt.length<=1)return void(this._overlapStencilType=!1);let Lr;if(Rt.isTileClipped())Lr=wt.length,this._overlapStencilMode.test={func:Dr.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(wt[0].overscaledZ>wt[wt.length-1].overscaledZ))return void(this._overlapStencilType=!1);Lr=1,this._overlapStencilMode.test={func:Dr.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+Lr>255&&(sr.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=Lr,this._overlapStencilMode.ref=this._stencilRef,Rt.isTileClipped()&&this._renderTileClippingMasks(wt,this._overlapStencilMode.ref)}stencilModeForRTTOverlap(wt){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[wt.key]),this._overlapStencilMode):ze.StencilMode.disabled}_renderTileClippingMasks(wt,Rt){const Xt=this.painter,sr=this.painter.context,Dr=sr.gl;Xt._tileClippingMaskIDs={},sr.setColorMode(ze.ColorMode.disabled),sr.setDepthMode(ze.DepthMode.disabled);const Lr=Xt.useProgram("clippingMask");for(const Ur of wt){const wt=Xt._tileClippingMaskIDs[Ur.key]=--Rt;Lr.draw(sr,Dr.TRIANGLES,ze.DepthMode.disabled,new ze.StencilMode({func:Dr.ALWAYS,mask:0},wt,255,Dr.KEEP,Dr.KEEP,Dr.REPLACE),ze.ColorMode.disabled,ze.CullFaceMode.disabled,si(Ur.projMatrix),"$clipping",Xt.tileExtentBuffer,Xt.quadTriangleIndexBuffer,Xt.tileExtentSegments)}}pointCoordinate(wt){const Rt=this.painter.transform;if(wt.x<0||wt.x>Rt.width||wt.y<0||wt.y>Rt.height)return null;const Xt=[wt.x,wt.y,1,1];ze.transformMat4(Xt,Xt,Rt.pixelMatrixInverse),ze.scale$2(Xt,Xt,1/Xt[3]),Xt[0]/=Rt.worldSize,Xt[1]/=Rt.worldSize;const sr=Rt._camera.position,Dr=ze.mercatorZfromAltitude(1,Rt.center.lat),Lr=[sr[0],sr[1],sr[2]/Dr,0],Ur=ze.subtract([],Xt.slice(0,3),Lr);ze.normalize(Ur,Ur);const qr=this.raycast(Lr,Ur,this._exaggeration);return null!==qr&&qr?(ze.scaleAndAdd(Lr,Lr,Ur,qr),Lr[3]=Lr[2],Lr[2]*=Dr,Lr):null}drawDepth(){const wt=this.painter,Rt=wt.context,Xt=this.proxySourceCache,sr=Math.ceil(wt.width),Dr=Math.ceil(wt.height);if(!this._depthFBO||this._depthFBO.width===sr&&this._depthFBO.height===Dr||(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture),!this._depthFBO){const wt=Rt.gl,Xt=Rt.createFramebuffer(sr,Dr,!0);Rt.activeTexture.set(wt.TEXTURE0);const Lr=new ze.Texture(Rt,{width:sr,height:Dr,data:null},wt.RGBA);Lr.bind(wt.NEAREST,wt.CLAMP_TO_EDGE),Xt.colorAttachment.set(Lr.texture);const Ur=Rt.createRenderbuffer(Rt.gl.DEPTH_COMPONENT16,sr,Dr);Xt.depthAttachment.set(Ur),this._depthFBO=Xt,this._depthTexture=Lr}Rt.bindFramebuffer.set(this._depthFBO.framebuffer),Rt.viewport.set([0,0,sr,Dr]),function(wt,Rt,Xt,sr){const Dr=wt.context,Lr=Dr.gl;Dr.clear({depth:1});const Ur=wt.useProgram("terrainDepth"),qr=new ze.DepthMode(Lr.LESS,ze.DepthMode.ReadWrite,wt.depthRangeFor3D);for(const wt of sr){const sr=Xt.getTile(wt),ri=oi(wt.projMatrix,0);Rt.setupElevationDraw(sr,Ur),Ur.draw(Dr,Lr.TRIANGLES,qr,ze.StencilMode.disabled,ze.ColorMode.unblended,ze.CullFaceMode.backCCW,ri,"terrain_depth",Rt.gridBuffer,Rt.gridIndexBuffer,Rt.gridNoSkirtSegments)}}(wt,this,Xt,this.proxyCoords)}_setupProxiedCoordsForOrtho(ze,wt,Rt){if(ze.getSource()instanceof Et)return this._setupProxiedCoordsForImageSource(ze,wt,Rt);this._findCoveringTileCache[ze.id]=this._findCoveringTileCache[ze.id]||{};const Xt=this.proxiedCoords[ze.id]=[],sr=this.proxyCoords;for(let wt=0;wt<sr.length;wt++){const Dr=sr[wt],Lr=this._findTileCoveringTileID(Dr,ze);if(Lr){const wt=this._createProxiedId(Dr,Lr,Rt[Dr.key]&&Rt[Dr.key][ze.id]);Xt.push(wt),this.proxyToSource[Dr.key][ze.id]=[wt]}}let Dr=!1;for(let sr=0;sr<wt.length;sr++){const Lr=ze.getTile(wt[sr]);if(!Lr||!Lr.hasData())continue;const Ur=this._findTileCoveringTileID(Lr.tileID,this.proxySourceCache);if(Ur&&Ur.tileID.canonical.z!==Lr.tileID.canonical.z){const wt=this.proxyToSource[Ur.tileID.key][ze.id],sr=this._createProxiedId(Ur.tileID,Lr,Rt[Ur.tileID.key]&&Rt[Ur.tileID.key][ze.id]);wt?wt.splice(wt.length-1,0,sr):this.proxyToSource[Ur.tileID.key][ze.id]=[sr],Xt.push(sr),Dr=!0}}this._sourceTilesOverlap[ze.id]=Dr}_setupProxiedCoordsForImageSource(wt,Rt,Xt){if(!wt.getSource().loaded())return;const sr=this.proxiedCoords[wt.id]=[],Dr=this.proxyCoords,Lr=wt.getSource(),Ur=new ze.pointGeometry(Lr.tileID.x,Lr.tileID.y)._div(1<<Lr.tileID.z),qr=Lr.coordinates.map(ze.MercatorCoordinate.fromLngLat).reduce((ze,wt)=>(ze.min.x=Math.min(ze.min.x,wt.x-Ur.x),ze.min.y=Math.min(ze.min.y,wt.y-Ur.y),ze.max.x=Math.max(ze.max.x,wt.x-Ur.x),ze.max.y=Math.max(ze.max.y,wt.y-Ur.y),ze),{min:new ze.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE),max:new ze.pointGeometry(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(wt,Rt)=>{const Xt=wt.wrap+wt.canonical.x/(1<<wt.canonical.z),sr=wt.canonical.y/(1<<wt.canonical.z),Dr=ze.EXTENT/(1<<wt.canonical.z),Lr=Rt.wrap+Rt.canonical.x/(1<<Rt.canonical.z),Ur=Rt.canonical.y/(1<<Rt.canonical.z);return Xt+Dr<Lr+qr.min.x||Xt>Lr+qr.max.x||sr+Dr<Ur+qr.min.y||sr>Ur+qr.max.y};for(let ze=0;ze<Dr.length;ze++){const Lr=Dr[ze];for(let ze=0;ze<Rt.length;ze++){const Dr=wt.getTile(Rt[ze]);if(!Dr||!Dr.hasData())continue;if(c(Lr,Dr.tileID))continue;const Ur=this._createProxiedId(Lr,Dr,Xt[Lr.key]&&Xt[Lr.key][wt.id]),qr=this.proxyToSource[Lr.key][wt.id];qr?qr.push(Ur):this.proxyToSource[Lr.key][wt.id]=[Ur],sr.push(Ur)}}}_createProxiedId(wt,Rt,Xt){let sr=this.orthoMatrix;if(Xt){const ze=Xt.find(ze=>ze.key===Rt.tileID.key);if(ze)return ze}if(Rt.tileID.key!==wt.key){const Xt=wt.canonical.z-Rt.tileID.canonical.z;let Dr,Lr,Ur;sr=ze.create$1();const qr=Rt.tileID.wrap-wt.wrap<<wt.overscaledZ;Xt>0?(Dr=ze.EXTENT>>Xt,Lr=Dr*((Rt.tileID.canonical.x<<Xt)-wt.canonical.x+qr),Ur=Dr*((Rt.tileID.canonical.y<<Xt)-wt.canonical.y)):(Dr=ze.EXTENT<<-Xt,Lr=ze.EXTENT*(Rt.tileID.canonical.x-(wt.canonical.x+qr<<-Xt)),Ur=ze.EXTENT*(Rt.tileID.canonical.y-(wt.canonical.y<<-Xt))),ze.ortho(sr,0,Dr,0,Dr,0,1),ze.translate(sr,sr,[Lr,Ur,0])}return new hi(Rt.tileID,wt.key,sr)}_findTileCoveringTileID(wt,Rt){let Xt=Rt.getTile(wt);if(Xt&&Xt.hasData())return Xt;const sr=this._findCoveringTileCache[Rt.id],Dr=sr[wt.key];if(Xt=Dr?Rt.getTileByID(Dr):null,Xt&&Xt.hasData()||null===Dr)return Xt;let Lr=Xt?Xt.tileID:wt,Ur=Lr.overscaledZ;const qr=Rt.getSource().minzoom,ri=[];if(!Dr){const sr=Rt.getSource().maxzoom;if(wt.canonical.z>=sr){const Xt=wt.canonical.z-sr;Rt.getSource().reparseOverscaled?(Ur=Math.max(wt.canonical.z+2,Rt.transform.tileZoom),Lr=new ze.OverscaledTileID(Ur,wt.wrap,sr,wt.canonical.x>>Xt,wt.canonical.y>>Xt)):0!==Xt&&(Ur=sr,Lr=new ze.OverscaledTileID(Ur,wt.wrap,sr,wt.canonical.x>>Xt,wt.canonical.y>>Xt))}Lr.key!==wt.key&&(ri.push(Lr.key),Xt=Rt.getTile(Lr))}const h=ze=>{ri.forEach(wt=>{sr[wt]=ze}),ri.length=0};for(Ur-=1;Ur>=qr&&(!Xt||!Xt.hasData());Ur--){Xt&&h(Xt.tileID.key);const ze=Lr.calculateScaledKey(Ur);if(Xt=Rt.getTileByID(ze),Xt&&Xt.hasData())break;const wt=sr[ze];if(null===wt)break;void 0===wt?ri.push(ze):Xt=Rt.getTileByID(wt)}return h(Xt?Xt.tileID.key:null),Xt&&Xt.hasData()?Xt:null}findDEMTileFor(ze){return this.enabled?this._findTileCoveringTileID(ze,this.sourceCache):null}prepareDrawTile(ze){this.renderedToTile=!0}_clearRenderCacheForTile(ze,wt){let Rt=this._tilesDirty[ze];Rt||(Rt=this._tilesDirty[ze]={}),Rt[wt.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const wt=function(){let wt,Rt,Xt;const sr=new ze.StructArrayLayout2ui4,Dr=131;for(Rt=1;Rt<129;Rt++){for(wt=1;wt<129;wt++)Xt=Rt*Dr+wt,sr.emplaceBack(Xt,Xt+1),sr.emplaceBack(Xt,Xt+Dr),sr.emplaceBack(Xt+1,Xt+Dr),128===Rt&&sr.emplaceBack(Xt+Dr,Xt+Dr+1);sr.emplaceBack(Xt+1,Xt+1+Dr)}return sr}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(wt),this.wireframeSegments=ze.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,wt.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}function ui(ze){const wt=[];for(let Rt=0;Rt<ze.length;Rt++){if(null===ze[Rt])continue;const Xt=ze[Rt].split(" ");wt.push(Xt.pop())}return wt}class _i{static cacheKey(ze,wt,Rt){let Xt=`${ze}${Rt?Rt.cacheKey:""}`;for(const ze of wt)Xt+=`/${ze}`;return Xt}constructor(wt,Rt,Xt,sr,Dr,Lr){const Ur=wt.gl;this.program=Ur.createProgram();const qr=ui(Xt.staticAttributes),ri=sr?sr.getBinderAttributes():[],ai=qr.concat(ri),Yi=Xt.staticUniforms?ui(Xt.staticUniforms):[],Ji=sr?sr.getBinderUniforms():[],Qi=Yi.concat(Ji),kn=[];for(const ze of Qi)kn.indexOf(ze)<0&&kn.push(ze);let jn=sr?sr.defines():[];jn=jn.concat(Lr.map(ze=>`#define ${ze}`));const Un=jn.concat(qa.fragmentSource,rs,Ua.fragmentSource,Xt.fragmentSource).join("\n"),Wn=jn.concat(qa.vertexSource,rs,Ua.vertexSource,Ba.vertexSource,Xt.vertexSource).join("\n"),Yn=Ur.createShader(Ur.FRAGMENT_SHADER);if(Ur.isContextLost())return void(this.failedToCreate=!0);Ur.shaderSource(Yn,Un),Ur.compileShader(Yn),Ur.attachShader(this.program,Yn);const Jn=Ur.createShader(Ur.VERTEX_SHADER);if(Ur.isContextLost())return void(this.failedToCreate=!0);Ur.shaderSource(Jn,Wn),Ur.compileShader(Jn),Ur.attachShader(this.program,Jn),this.attributes={};const Qn={};this.numAttributes=ai.length;for(let ze=0;ze<this.numAttributes;ze++)ai[ze]&&(Ur.bindAttribLocation(this.program,ze,ai[ze]),this.attributes[ai[ze]]=ze);Ur.linkProgram(this.program),Ur.deleteShader(Jn),Ur.deleteShader(Yn);for(let ze=0;ze<kn.length;ze++){const wt=kn[ze];if(wt&&!Qn[wt]){const ze=Ur.getUniformLocation(this.program,wt);ze&&(Qn[wt]=ze)}}this.fixedUniforms=Dr(wt,Qn),this.binderUniforms=sr?sr.getUniforms(wt,Qn):[],-1!==Lr.indexOf("TERRAIN")&&(this.terrainUniforms=((wt,Rt)=>({u_dem:new ze.Uniform1i(wt,Rt.u_dem),u_dem_prev:new ze.Uniform1i(wt,Rt.u_dem_prev),u_dem_unpack:new ze.Uniform4f(wt,Rt.u_dem_unpack),u_dem_tl:new ze.Uniform2f(wt,Rt.u_dem_tl),u_dem_scale:new ze.Uniform1f(wt,Rt.u_dem_scale),u_dem_tl_prev:new ze.Uniform2f(wt,Rt.u_dem_tl_prev),u_dem_scale_prev:new ze.Uniform1f(wt,Rt.u_dem_scale_prev),u_dem_size:new ze.Uniform1f(wt,Rt.u_dem_size),u_dem_lerp:new ze.Uniform1f(wt,Rt.u_dem_lerp),u_exaggeration:new ze.Uniform1f(wt,Rt.u_exaggeration),u_depth:new ze.Uniform1i(wt,Rt.u_depth),u_depth_size_inv:new ze.Uniform2f(wt,Rt.u_depth_size_inv),u_meter_to_dem:new ze.Uniform1f(wt,Rt.u_meter_to_dem),u_label_plane_matrix_inv:new ze.UniformMatrix4f(wt,Rt.u_label_plane_matrix_inv)}))(wt,Qn)),-1!==Lr.indexOf("FOG")&&(this.fogUniforms=((wt,Rt)=>({u_fog_matrix:new ze.UniformMatrix4f(wt,Rt.u_fog_matrix),u_fog_range:new ze.Uniform2f(wt,Rt.u_fog_range),u_fog_color:new ze.Uniform4f(wt,Rt.u_fog_color),u_fog_horizon_blend:new ze.Uniform1f(wt,Rt.u_fog_horizon_blend),u_fog_temporal_offset:new ze.Uniform1f(wt,Rt.u_fog_temporal_offset)}))(wt,Qn))}setTerrainUniformValues(ze,wt){if(!this.terrainUniforms)return;const Rt=this.terrainUniforms;if(!this.failedToCreate){ze.program.set(this.program);
20for(const ze in wt)Rt[ze].set(wt[ze])}}setFogUniformValues(ze,wt){if(!this.fogUniforms)return;const Rt=this.fogUniforms;if(!this.failedToCreate){ze.program.set(this.program);for(const ze in wt)Rt[ze].location&&Rt[ze].set(wt[ze])}}draw(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn){const Un=ze.gl;if(this.failedToCreate)return;ze.program.set(this.program),ze.setDepthMode(Rt),ze.setStencilMode(Xt),ze.setColorMode(sr),ze.setCullFace(Dr);for(const ze in this.fixedUniforms)this.fixedUniforms[ze].set(Lr[ze]);Qi&&Qi.setUniforms(ze,this.binderUniforms,Yi,{zoom:Ji});const Wn={[Un.LINES]:2,[Un.TRIANGLES]:3,[Un.LINE_STRIP]:1}[wt];for(const Rt of ai.get()){const Xt=Rt.vaos||(Rt.vaos={});(Xt[Ur]||(Xt[Ur]=new Ye)).bind(ze,this,qr,Qi?Qi.getPaintVertexBuffers():[],ri,Rt.vertexOffset,kn,jn),Un.drawElements(wt,Rt.primitiveLength*Wn,Un.UNSIGNED_SHORT,Rt.primitiveOffset*Wn*2)}}}function pi(ze,wt,Rt){const Xt=1/z(Rt,1,wt.transform.tileZoom),sr=Math.pow(2,Rt.tileID.overscaledZ),Dr=Rt.tileSize*Math.pow(2,wt.transform.tileZoom)/sr,Lr=Dr*(Rt.tileID.canonical.x+Rt.tileID.wrap*sr),Ur=Dr*Rt.tileID.canonical.y;return{u_image:0,u_texsize:Rt.imageAtlasTexture.size,u_scale:[Xt,ze.fromScale,ze.toScale],u_fade:ze.t,u_pixel_coord_upper:[Lr>>16,Ur>>16],u_pixel_coord_lower:[65535&Lr,65535&Ur]}}const mi=(wt,Rt,Xt,sr)=>{const Dr=Rt.style.light,Lr=Dr.properties.get("position"),Ur=[Lr.x,Lr.y,Lr.z],qr=ze.create$2();"viewport"===Dr.properties.get("anchor")&&(ze.fromRotation(qr,-Rt.transform.angle),ze.transformMat3(Ur,Ur,qr));const ri=Dr.properties.get("color");return{u_matrix:wt,u_lightpos:Ur,u_lightintensity:Dr.properties.get("intensity"),u_lightcolor:[ri.r,ri.g,ri.b],u_vertical_gradient:+Xt,u_opacity:sr}},fi=(wt,Rt,Xt,sr,Dr,Lr,Ur)=>ze.extend(mi(wt,Rt,Xt,sr),pi(Lr,Rt,Ur),{u_height_factor:-Math.pow(2,Dr.overscaledZ)/Ur.tileSize/8}),gi=ze=>({u_matrix:ze}),vi=(wt,Rt,Xt,sr)=>ze.extend(gi(wt),pi(Xt,Rt,sr)),xi=(ze,wt)=>({u_matrix:ze,u_world:wt}),yi=(wt,Rt,Xt,sr,Dr)=>ze.extend(vi(wt,Rt,Xt,sr),{u_world:Dr}),bi=(wt,Rt,Xt,sr)=>{const Dr=wt.transform;let Lr;if("map"===sr.paint.get("circle-pitch-alignment")){const ze=z(Xt,1,Dr.zoom);Lr=[ze,ze]}else Lr=Dr.pixelsToGLUnits;return{u_camera_to_center_distance:Dr.cameraToCenterDistance,u_matrix:wt.translatePosMatrix(Rt.projMatrix,Xt,sr.paint.get("circle-translate"),sr.paint.get("circle-translate-anchor")),u_device_pixel_ratio:ze.exported.devicePixelRatio,u_extrude_scale:Lr}},wi=ze=>{const wt=[];return"map"===ze.paint.get("circle-pitch-alignment")&&wt.push("PITCH_WITH_MAP"),"map"===ze.paint.get("circle-pitch-scale")&&wt.push("SCALE_WITH_MAP"),wt},Ti=(wt,Rt,Xt)=>{const sr=ze.EXTENT/Xt.tileSize;return{u_matrix:wt,u_camera_to_center_distance:Rt.cameraToCenterDistance,u_extrude_scale:[Rt.pixelsToGLUnits[0]/sr,Rt.pixelsToGLUnits[1]/sr]}},Ei=(ze,wt,Rt=1)=>({u_matrix:ze,u_color:wt,u_overlay:0,u_overlay_scale:Rt}),Ci=(ze,wt,Rt,Xt)=>({u_matrix:ze,u_extrude_scale:z(wt,1,Rt),u_intensity:Xt}),Si=(wt,Rt,Xt,sr)=>{const Dr=wt.transform;return{u_matrix:Ai(wt,Rt,Xt,sr),u_ratio:1/z(Rt,1,Dr.zoom),u_device_pixel_ratio:ze.exported.devicePixelRatio,u_units_to_pixels:[1/Dr.pixelsToGLUnits[0],1/Dr.pixelsToGLUnits[1]]}},Ii=(wt,Rt,Xt,sr,Dr)=>ze.extend(Si(wt,Rt,Xt,sr),{u_image:0,u_image_height:Dr}),Mi=(wt,Rt,Xt,sr,Dr)=>{const Lr=wt.transform,Ur=Di(Rt,Lr);return{u_matrix:Ai(wt,Rt,Xt,Dr),u_texsize:Rt.imageAtlasTexture.size,u_ratio:1/z(Rt,1,Lr.zoom),u_device_pixel_ratio:ze.exported.devicePixelRatio,u_image:0,u_scale:[Ur,sr.fromScale,sr.toScale],u_fade:sr.t,u_units_to_pixels:[1/Lr.pixelsToGLUnits[0],1/Lr.pixelsToGLUnits[1]]}},zi=(wt,Rt,Xt,sr,Dr)=>{const Lr=Di(Rt,wt.transform);return ze.extend(Si(wt,Rt,Xt,Dr),{u_texsize:Rt.lineAtlasTexture.size,u_scale:[Lr,sr.fromScale,sr.toScale],u_image:0,u_mix:sr.t})};function Di(ze,wt){return 1/z(ze,1,wt.tileZoom)}function Ai(ze,wt,Rt,Xt){return ze.translatePosMatrix(Xt||wt.tileID.projMatrix,wt,Rt.paint.get("line-translate"),Rt.paint.get("line-translate-anchor"))}const Pi=(ze,wt,Rt,Xt,sr)=>{return{u_matrix:ze,u_tl_parent:wt,u_scale_parent:Rt,u_buffer_scale:1,u_fade_t:Xt.mix,u_opacity:Xt.opacity*sr.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:sr.paint.get("raster-brightness-min"),u_brightness_high:sr.paint.get("raster-brightness-max"),u_saturation_factor:(Lr=sr.paint.get("raster-saturation"),Lr>0?1-1/(1.001-Lr):-Lr),u_contrast_factor:(Dr=sr.paint.get("raster-contrast"),Dr>0?1/(1-Dr):1+Dr),u_spin_weights:Li(sr.paint.get("raster-hue-rotate"))};var Dr,Lr};function Li(ze){ze*=Math.PI/180;const wt=Math.sin(ze),Rt=Math.cos(ze);return[(2*Rt+1)/3,(-Math.sqrt(3)*wt-Rt+1)/3,(Math.sqrt(3)*wt-Rt+1)/3]}const Ri=(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri)=>{const ai=sr.transform;return{u_is_size_zoom_constant:+("constant"===ze||"source"===ze),u_is_size_feature_constant:+("constant"===ze||"camera"===ze),u_size_t:wt?wt.uSizeT:0,u_size:wt?wt.uSize:0,u_camera_to_center_distance:ai.cameraToCenterDistance,u_pitch:ai.pitch/360*2*Math.PI,u_rotate_symbol:+Rt,u_aspect_ratio:ai.width/ai.height,u_fade_change:sr.options.fadeDuration?sr.symbolFadeChange:1,u_matrix:Dr,u_label_plane_matrix:Lr,u_coord_matrix:Ur,u_is_text:+qr,u_pitch_with_map:+Xt,u_texsize:ri,u_texture:0}},ki=(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi)=>{const{cameraToCenterDistance:Ji,_pitch:Qi}=Dr.transform;return ze.extend(Ri(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai),{u_gamma_scale:sr?Ji*Math.cos(Dr.terrain?0:Qi):1,u_device_pixel_ratio:ze.exported.devicePixelRatio,u_is_halo:+Yi})},Fi=(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai)=>ze.extend(ki(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,!0,ri,!0),{u_texsize_icon:ai,u_texture_icon:1}),Bi=(ze,wt,Rt)=>({u_matrix:ze,u_opacity:wt,u_color:Rt}),Oi=(wt,Rt,Xt,sr,Dr,Lr)=>ze.extend(function(ze,wt,Rt,Xt){const sr=Rt.imageManager.getPattern(ze.from.toString()),Dr=Rt.imageManager.getPattern(ze.to.toString()),{width:Lr,height:Ur}=Rt.imageManager.getPixelSize(),qr=Math.pow(2,Xt.tileID.overscaledZ
vendor: 7,181 bytes, line 20
20),ri=Xt.tileSize*Math.pow(2,Rt.transform.tileZoom)/qr,ai=ri*(Xt.tileID.canonical.x+Xt.tileID.wrap*qr),Yi=ri*Xt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:sr.tl,u_pattern_br_a:sr.br,u_pattern_tl_b:Dr.tl,u_pattern_br_b:Dr.br,u_texsize:[Lr,Ur],u_mix:wt.t,u_pattern_size_a:sr.displaySize,u_pattern_size_b:Dr.displaySize,u_scale_a:wt.fromScale,u_scale_b:wt.toScale,u_tile_units_to_pixels:1/z(Xt,1,Rt.transform.tileZoom),u_pixel_coord_upper:[ai>>16,Yi>>16],u_pixel_coord_lower:[65535&ai,65535&Yi]}}(sr,Lr,Xt,Dr),{u_matrix:wt,u_opacity:Rt}),Cl={fillExtrusion:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_lightpos:new ze.Uniform3f(wt,Rt.u_lightpos),u_lightintensity:new ze.Uniform1f(wt,Rt.u_lightintensity),u_lightcolor:new ze.Uniform3f(wt,Rt.u_lightcolor),u_vertical_gradient:new ze.Uniform1f(wt,Rt.u_vertical_gradient),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity)}),fillExtrusionPattern:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_lightpos:new ze.Uniform3f(wt,Rt.u_lightpos),u_lightintensity:new ze.Uniform1f(wt,Rt.u_lightintensity),u_lightcolor:new ze.Uniform3f(wt,Rt.u_lightcolor),u_vertical_gradient:new ze.Uniform1f(wt,Rt.u_vertical_gradient),u_height_factor:new ze.Uniform1f(wt,Rt.u_height_factor),u_image:new ze.Uniform1i(wt,Rt.u_image),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_pixel_coord_upper:new ze.Uniform2f(wt,Rt.u_pixel_coord_upper),u_pixel_coord_lower:new ze.Uniform2f(wt,Rt.u_pixel_coord_lower),u_scale:new ze.Uniform3f(wt,Rt.u_scale),u_fade:new ze.Uniform1f(wt,Rt.u_fade),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity)}),fill:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix)}),fillPattern:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_image:new ze.Uniform1i(wt,Rt.u_image),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_pixel_coord_upper:new ze.Uniform2f(wt,Rt.u_pixel_coord_upper),u_pixel_coord_lower:new ze.Uniform2f(wt,Rt.u_pixel_coord_lower),u_scale:new ze.Uniform3f(wt,Rt.u_scale),u_fade:new ze.Uniform1f(wt,Rt.u_fade)}),fillOutline:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_world:new ze.Uniform2f(wt,Rt.u_world)}),fillOutlinePattern:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_world:new ze.Uniform2f(wt,Rt.u_world),u_image:new ze.Uniform1i(wt,Rt.u_image),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_pixel_coord_upper:new ze.Uniform2f(wt,Rt.u_pixel_coord_upper),u_pixel_coord_lower:new ze.Uniform2f(wt,Rt.u_pixel_coord_lower),u_scale:new ze.Uniform3f(wt,Rt.u_scale),u_fade:new ze.Uniform1f(wt,Rt.u_fade)}),circle:(wt,Rt)=>({u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_extrude_scale:new ze.Uniform2f(wt,Rt.u_extrude_scale),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix)}),collisionBox:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_extrude_scale:new ze.Uniform2f(wt,Rt.u_extrude_scale)}),collisionCircle:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_inv_matrix:new ze.UniformMatrix4f(wt,Rt.u_inv_matrix),u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_viewport_size:new ze.Uniform2f(wt,Rt.u_viewport_size)}),debug:(wt,Rt)=>({u_color:new ze.UniformColor(wt,Rt.u_color),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_overlay:new ze.Uniform1i(wt,Rt.u_overlay),u_overlay_scale:new ze.Uniform1f(wt,Rt.u_overlay_scale)}),clippingMask:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix)}),heatmap:(wt,Rt)=>({u_extrude_scale:new ze.Uniform1f(wt,Rt.u_extrude_scale),u_intensity:new ze.Uniform1f(wt,Rt.u_intensity),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix)}),heatmapTexture:(wt,Rt)=>({u_image:new ze.Uniform1i(wt,Rt.u_image),u_color_ramp:new ze.Uniform1i(wt,Rt.u_color_ramp),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity)}),hillshade:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_image:new ze.Uniform1i(wt,Rt.u_image),u_latrange:new ze.Uniform2f(wt,Rt.u_latrange),u_light:new ze.Uniform2f(wt,Rt.u_light),u_shadow:new ze.UniformColor(wt,Rt.u_shadow),u_highlight:new ze.UniformColor(wt,Rt.u_highlight),u_accent:new ze.UniformColor(wt,Rt.u_accent)}),hillshadePrepare:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_image:new ze.Uniform1i(wt,Rt.u_image),u_dimension:new ze.Uniform2f(wt,Rt.u_dimension),u_zoom:new ze.Uniform1f(wt,Rt.u_zoom),u_unpack:new ze.Uniform4f(wt,Rt.u_unpack)}),line:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_ratio:new ze.Uniform1f(wt,Rt.u_ratio),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_units_to_pixels:new ze.Uniform2f(wt,Rt.u_units_to_pixels)}),lineGradient:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_ratio:new ze.Uniform1f(wt,Rt.u_ratio),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_units_to_pixels:new ze.Uniform2f(wt,Rt.u_units_to_pixels),u_image:new ze.Uniform1i(wt,Rt.u_image),u_image_height:new ze.Uniform1f(wt,Rt.u_image_height)}),linePattern:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_ratio:new ze.Uniform1f(wt,Rt.u_ratio),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_image:new ze.Uniform1i(wt,Rt.u_image),u_units_to_pixels:new ze.Uniform2f(wt,Rt.u_units_to_pixels),u_scale:new ze.Uniform3f(wt,Rt.u_scale),u_fade:new ze.Uniform1f(wt,Rt.u_fade)}),lineSDF:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_ratio:new ze.Uniform1f(wt,Rt.u_ratio),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_units_to_pixels:new ze.Uniform2f(wt,Rt.u_units_to_pixels),u_image:new ze.Uniform1i(wt,Rt.u_image),u_scale:new ze.Uniform3f(wt,Rt.u_scale),u_mix:new ze.Uniform1f(wt,Rt.u_mix)}),raster:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_tl_parent:new ze.Uniform2f(wt,Rt.u_tl_parent),u_scale_parent:new ze.Uniform1f(wt,Rt.u_scale_parent),u_buffer_scale:new ze.Uniform1f(wt,Rt.u_buffer_scale),u_fade_t:new ze.Uniform1f(wt,Rt.u_fade_t),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity),u_image0:new ze.Uniform1i(wt,Rt.u_image0),u_image1:new ze.Uniform1i(wt,Rt.u_image1),u_brightness_low:new ze.Uniform1f(wt,Rt.u_brightness_low),u_brightness_high:new ze.Uniform1f(wt,Rt.u_brightness_high),u_saturation_factor:new ze.Uniform1f(wt,Rt.u_saturation_factor),u_contrast_factor:new ze.Uniform1f(wt,Rt.u_contrast_factor),u_spin_weights:new ze.Uniform3f(wt,Rt.u_spin_weights)}),symbolIcon:(wt,Rt)=>({u_is_size_zoom_constant:new ze.Uniform1i(wt,Rt.u_is_size_zoom_constant),u_is_size_feature_constant:new ze.Uniform1i(wt,Rt.u_is_size_feature_constant),u_size_t:new ze.Uniform1f(wt,Rt.u_size_t),u_size:new ze.Uniform1f(wt,Rt.u_size),u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_pitch:new ze.Uniform1f(wt,Rt.u_pitch),u_rotate_symbol:new ze.Uniform1i(wt,Rt.u_rotate_symbol),u_aspect_ratio:new ze.Uniform1f(wt,Rt.u_aspect_ratio),u_fade_change:new ze.Uniform1f(wt,Rt.u_fade_change),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_label_plane_matrix:new ze.UniformMatrix4f(wt,Rt.u_label_plane_matrix
20),u_coord_matrix:new ze.UniformMatrix4f(wt,Rt.u_coord_matrix),u_is_text:new ze.Uniform1i(wt,Rt.u_is_text),u_pitch_with_map:new ze.Uniform1i(wt,Rt.u_pitch_with_map),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_texture:new ze.Uniform1i(wt,Rt.u_texture)}),symbolSDF:(wt,Rt)=>({u_is_size_zoom_constant:new ze.Uniform1i(wt,Rt.u_is_size_zoom_constant),u_is_size_feature_constant:new ze.Uniform1i(wt,Rt.u_is_size_feature_constant),u_size_t:new ze.Uniform1f(wt,Rt.u_size_t),u_size:new ze.Uniform1f(wt,Rt.u_size),u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_pitch:new ze.Uniform1f(wt,Rt.u_pitch),u_rotate_symbol:new ze.Uniform1i(wt,Rt.u_rotate_symbol),u_aspect_ratio:new ze.Uniform1f(wt,Rt.u_aspect_ratio),u_fade_change:new ze.Uniform1f(wt,Rt.u_fade_change),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_label_plane_matrix:new ze.UniformMatrix4f(wt,Rt.u_label_plane_matrix),u_coord_matrix:new ze.UniformMatrix4f(wt,Rt.u_coord_matrix),u_is_text:new ze.Uniform1i(wt,Rt.u_is_text),u_pitch_with_map:new ze.Uniform1i(wt,Rt.u_pitch_with_map),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_texture:new ze.Uniform1i(wt,Rt.u_texture),u_gamma_scale:new ze.Uniform1f(wt,Rt.u_gamma_scale),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_is_halo:new ze.Uniform1i(wt,Rt.u_is_halo)}),symbolTextAndIcon:(wt,Rt)=>({u_is_size_zoom_constant:new ze.Uniform1i(wt,Rt.u_is_size_zoom_constant),u_is_size_feature_constant:new ze.Uniform1i(wt,Rt.u_is_size_feature_constant),u_size_t:new ze.Uniform1f(wt,Rt.u_size_t),u_size:new ze.Uniform1f(wt,Rt.u_size),u_camera_to_center_distance:new ze.Uniform1f(wt,Rt.u_camera_to_center_distance),u_pitch:new ze.Uniform1f(wt,Rt.u_pitch),u_rotate_symbol:new ze.Uniform1i(wt,Rt.u_rotate_symbol),u_aspect_ratio:new ze.Uniform1f(wt,Rt.u_aspect_ratio),u_fade_change:new ze.Uniform1f(wt,Rt.u_fade_change),u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_label_plane_matrix:new ze.UniformMatrix4f(wt,Rt.u_label_plane_matrix),u_coord_matrix:new ze.UniformMatrix4f(wt,Rt.u_coord_matrix),u_is_text:new ze.Uniform1i(wt,Rt.u_is_text),u_pitch_with_map:new ze.Uniform1i(wt,Rt.u_pitch_with_map),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_texsize_icon:new ze.Uniform2f(wt,Rt.u_texsize_icon),u_texture:new ze.Uniform1i(wt,Rt.u_texture),u_texture_icon:new ze.Uniform1i(wt,Rt.u_texture_icon),u_gamma_scale:new ze.Uniform1f(wt,Rt.u_gamma_scale),u_device_pixel_ratio:new ze.Uniform1f(wt,Rt.u_device_pixel_ratio),u_is_halo:new ze.Uniform1i(wt,Rt.u_is_halo)}),background:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity),u_color:new ze.UniformColor(wt,Rt.u_color)}),backgroundPattern:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity),u_image:new ze.Uniform1i(wt,Rt.u_image),u_pattern_tl_a:new ze.Uniform2f(wt,Rt.u_pattern_tl_a),u_pattern_br_a:new ze.Uniform2f(wt,Rt.u_pattern_br_a),u_pattern_tl_b:new ze.Uniform2f(wt,Rt.u_pattern_tl_b),u_pattern_br_b:new ze.Uniform2f(wt,Rt.u_pattern_br_b),u_texsize:new ze.Uniform2f(wt,Rt.u_texsize),u_mix:new ze.Uniform1f(wt,Rt.u_mix),u_pattern_size_a:new ze.Uniform2f(wt,Rt.u_pattern_size_a),u_pattern_size_b:new ze.Uniform2f(wt,Rt.u_pattern_size_b),u_scale_a:new ze.Uniform1f(wt,Rt.u_scale_a),u_scale_b:new ze.Uniform1f(wt,Rt.u_scale_b),u_pixel_coord_upper:new ze.Uniform2f(wt,Rt.u_pixel_coord_upper),u_pixel_coord_lower:new ze.Uniform2f(wt,Rt.u_pixel_coord_lower),u_tile_units_to_pixels:new ze.Uniform1f(wt,Rt.u_tile_units_to_pixels)}),terrainRaster:ii,terrainDepth:ii,skybox:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_sun_direction:new ze.Uniform3f(wt,Rt.u_sun_direction),u_cubemap:new ze.Uniform1i(wt,Rt.u_cubemap),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity),u_temporal_offset:new ze.Uniform1f(wt,Rt.u_temporal_offset)}),skyboxGradient:(wt,Rt)=>({u_matrix:new ze.UniformMatrix4f(wt,Rt.u_matrix),u_color_ramp:new ze.Uniform1i(wt,Rt.u_color_ramp),u_center_direction:new ze.Uniform3f(wt,Rt.u_center_direction),u_radius:new ze.Uniform1f(wt,Rt.u_radius),u_opacity:new ze.Uniform1f(wt,Rt.u_opacity),u_temporal_offset:new ze.Uniform1f(wt,Rt.u_temporal_offset)}),skyboxCapture:(wt,Rt)=>({u_matrix_3f:new ze.UniformMatrix3f(wt,Rt.u_matrix_3f),u_sun_direction:new ze.Uniform3f(wt,Rt.u_sun_direction),u_sun_intensity:new ze.Uniform1f(wt,Rt.u_sun_intensity),u_color_tint_r:new ze.Uniform4f(wt,Rt.u_color_tint_r),u_color_tint_m:new ze.Uniform4f(wt,Rt.u_color_tint_m),u_luminance:new ze.Uniform1f(wt,Rt.u_luminance)})};let Ol;function Gi(wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=wt.context,ri=qr.gl,ai=wt.useProgram("collisionBox"),Yi=[];let Ji=0,Qi=0;for(let kn=0;kn<sr.length;kn++){const jn=sr[kn],Un=Rt.getTile(jn),Wn=Un.getBucket(Xt);if(!Wn)continue;let Yn=jn.projMatrix;0===Dr[0]&&0===Dr[1]||(Yn=wt.translatePosMatrix(jn.projMatrix,Un,Dr,Lr));const Jn=Ur?Wn.textCollisionBox:Wn.iconCollisionBox,Qn=Wn.collisionCircleArray;
20if(Qn.length>0){const Rt=ze.create$1(),Xt=Yn;ze.mul$1(Rt,Wn.placementInvProjMatrix,wt.transform.glCoordMatrix),ze.mul$1(Rt,Rt,Wn.placementViewportMatrix),Yi.push({circleArray:Qn,circleOffset:Qi,transform:Xt,invTransform:Rt}),Ji+=Qn.length/4,Qi=Ji}Jn&&(wt.terrain&&wt.terrain.setupElevationDraw(Un,ai),ai.draw(qr,ri.LINES,ze.DepthMode.disabled,ze.StencilMode.disabled,wt.colorModeForRenderPass(),ze.CullFaceMode.disabled,Ti(Yn,wt.transform,Un),Xt.id,Jn.layoutVertexBuffer,Jn.indexBuffer,Jn.segments,null,wt.transform.zoom,null,Jn.collisionVertexBuffer,Jn.collisionVertexBufferExt))}if(!Ur||!Yi.length)return;const kn=wt.useProgram("collisionCircle"),jn=new ze.StructArrayLayout2f1f2i16;jn.resize(4*Ji),jn._trim();let Un=0;for(const ze of Yi)for(let wt=0;wt<ze.circleArray.length/4;wt++){const Rt=4*wt,Xt=ze.circleArray[Rt+0],sr=ze.circleArray[Rt+1],Dr=ze.circleArray[Rt+2],Lr=ze.circleArray[Rt+3];jn.emplace(Un++,Xt,sr,Dr,Lr,0),jn.emplace(Un++,Xt,sr,Dr,Lr,1),jn.emplace(Un++,Xt,sr,Dr,Lr,2),jn.emplace(Un++,Xt,sr,Dr,Lr,3)}(!Ol||Ol.length<2*Ji)&&(Ol=function(wt){const Rt=2*wt,Xt=new ze.StructArrayLayout3ui6;Xt.resize(Rt),Xt._trim();for(let ze=0;ze<Rt;ze++){const wt=6*ze;Xt.uint16[wt+0]=4*ze+0,Xt.uint16[wt+1]=4*ze+1,Xt.uint16[wt+2]=4*ze+2,Xt.uint16[wt+3]=4*ze+2,Xt.uint16[wt+4]=4*ze+3,Xt.uint16[wt+5]=4*ze+0}return Xt}(Ji));const Wn=qr.createIndexBuffer(Ol,!0),Yn=qr.createVertexBuffer(jn,ze.collisionCircleLayout.members,!0);for(const Rt of Yi){const sr={u_matrix:Rt.transform,u_inv_matrix:Rt.invTransform,u_camera_to_center_distance:(Jn=wt.transform).cameraToCenterDistance,u_viewport_size:[Jn.width,Jn.height]};kn.draw(qr,ri.TRIANGLES,ze.DepthMode.disabled,ze.StencilMode.disabled,wt.colorModeForRenderPass(),ze.CullFaceMode.disabled,sr,Xt.id,Yn,Wn,ze.SegmentVector.simpleSegment(0,2*Rt.circleOffset,Rt.circleArray.length,Rt.circleArray.length/2),null,wt.transform.zoom,null,null,null)}var Jn;Yn.destroy(),Wn.destroy()}const Dl=ze.identity(new Float32Array(16));function Vi(wt,Rt,Xt,sr,Dr,Lr){const{horizontalAlign:Ur,verticalAlign:qr}=ze.getAnchorAlignment(wt),ri=-(Ur-.5)*Rt,ai=-(qr-.5)*Xt,Yi=ze.evaluateVariableOffset(wt,sr);return new ze.pointGeometry((ri/Dr+Yi[0])*Lr,(ai/Dr+Yi[1])*Lr)}function ji(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji){const Qi=wt.text.placedSymbolArray,kn=wt.text.dynamicLayoutVertexArray,jn=wt.icon.dynamicLayoutVertexArray,Un={};kn.clear();for(let jn=0;jn<Qi.length;jn++){const Wn=Qi.get(jn),Yn=wt.allowVerticalPlacement&&!Wn.placedOrientation,Jn=Wn.hidden||!Wn.crossTileID||Yn?null:sr[Wn.crossTileID];if(Jn){const sr=new ze.pointGeometry(Wn.anchorX,Wn.anchorY),Qi=Ji(sr),jn=Yt(sr,Xt?qr:Ur,Qi),Yn=Qt(Lr.cameraToCenterDistance,jn.signedDistanceFromCamera);let Qn=Dr.evaluateSizeForFeature(wt.textSizeData,ai,Wn)*Yn/ze.ONE_EM;Xt&&(Qn*=wt.tilePixelRatio/ri);const{width:Io,height:Mo,anchor:jo,textOffset:zo,textScale:oa}=Jn,la=Vi(jo,Io,Mo,zo,oa,Qn),ca=Xt?Yt(sr.add(la),Ur,Qi).point:jn.point.add(Rt?la.rotate(-Lr.angle):la),ua=wt.allowVerticalPlacement&&Wn.placedOrientation===ze.WritingMode.vertical?Math.PI/2:0;for(let wt=0;wt<Wn.numGlyphs;wt++)ze.addDynamicAttributes(kn,ca,ua);Yi&&Wn.associatedIconIndex>=0&&(Un[Wn.associatedIconIndex]={shiftedAnchor:ca,angle:ua})}else se(Wn.numGlyphs,kn)}if(Yi){jn.clear();const Rt=wt.icon.placedSymbolArray;for(let wt=0;wt<Rt.length;wt++){const Xt=Rt.get(wt);if(Xt.hidden)se(Xt.numGlyphs,jn);else{const Rt=Un[wt];if(Rt)for(let wt=0;wt<Xt.numGlyphs;wt++)ze.addDynamicAttributes(jn,Rt.shiftedAnchor,Rt.angle);else se(Xt.numGlyphs,jn)}}wt.icon.dynamicLayoutVertexBuffer.updateData(jn)}wt.text.dynamicLayoutVertexBuffer.updateData(kn)}function qi(ze,wt,Rt){return Rt.iconsInText&&wt?"symbolTextAndIcon":ze?"symbolSDF":"symbolIcon"}function Wi(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji){const Qi=wt.context,kn=Qi.gl,jn=wt.transform,Un="map"===qr,Wn="map"===ri,Yn=Un&&"point"!==Xt.layout.get("symbol-placement"),Jn=Un&&!Wn&&!Yn,Qn=void 0!==Xt.layout.get("symbol-sort-key").constantOr(1);let Io=!1;const Mo=wt.depthModeForSublayer(0,ze.DepthMode.ReadOnly),jo=Xt.layout.get("text-variable-anchor"),zo=[],oa=wt.terrain&&Wn?["PITCH_WITH_MAP_TERRAIN"]:null;for(const qr of sr){const sr=Rt.getTile(qr),ri=sr.getBucket(Xt);if(!ri)continue;const Yi=Dr?ri.text:ri.icon;if(!Yi||!Yi.segments.get().length)continue;const Ji=Yi.programConfigurations.get(Xt.id),Qi=Dr||ri.sdfIcons,Mo=Dr?ri.textSizeData:ri.iconSizeData,la=Wn||0!==jn.pitch,ca=wt.useProgram(qi(Qi,Dr,ri),Ji,oa),ua=ze.evaluateSizeForZoom(Mo,jn.zoom);let ha,pa,_a,wa,Pa=[0,0],Oa=null;if(Dr){if(pa=sr.glyphAtlasTexture,_a=kn.LINEAR,ha=sr.glyphAtlasTexture.size,ri.iconsInText){Pa=sr.imageAtlasTexture.size,Oa=sr.imageAtlasTexture;const ze="composite"===Mo.kind||"camera"===Mo.kind;wa=la||wt.options.rotating||wt.options.zooming||ze?kn.LINEAR:kn.NEAREST}}else{const ze=1!==Xt.layout.get("icon-size").constantOr(0)||ri.iconsNeedLinear;pa=sr.imageAtlasTexture,_a=Qi||wt.options.rotating||wt.options.zooming||ze||la?kn.LINEAR:kn.NEAREST,ha=sr.imageAtlasTexture.size}const Da=z(sr,1,wt.transform.zoom),La=Ht(qr.projMatrix,Wn,Un,wt.transform,Da),Ra=wt.terrain&&Wn&&Yn?ze.invert(new Float32Array(16),La):Dl,Na=Kt(qr.projMatrix,Wn,Un,wt.transform,Da),Ba=jo&&ri.hasTextData(),Ua="none"!==Xt.layout.get("icon-text-fit")&&Ba&&ri.hasIconData();if(Yn){const ze=jn.elevation;te(ri,qr.projMatrix,wt,Dr,La,Na,Wn,ai,ze?wt=>ze.getAtTileOffset(qr,wt.x,wt.y):null)}const qa=wt.translatePosMatrix(qr.projMatrix,sr,Lr,Ur),rs=Yn||Dr&&jo||Ua?Dl:La,ss=wt.translatePosMatrix(Na,sr,Lr,Ur,!0),_s=Qi&&0!==Xt.paint.get(Dr?"text-halo-width":"icon-halo-width").constantOr(1);let Pl;Pl=Qi?ri.iconsInText?Fi(Mo.kind,ua,Jn,Wn,wt,qa,rs,ss,ha,Pa):ki(Mo.kind,ua,Jn,Wn,wt,qa,rs,ss,Dr,ha,!0):Ri(Mo.kind,ua,Jn,Wn,wt,qa,rs,ss,Dr,ha);const Cl={program:ca,buffers:Yi,uniformValues:Pl,atlasTexture:pa,atlasTextureIcon:Oa,atlasInterpolation:_a,atlasInterpolationIcon:wa,isSDF:Qi,hasHalo:_s,tile:sr,labelPlaneMatr
vendor: 10,846 bytes, line 20
20ixInv:Ra};if(Qn&&ri.canOverlap){Io=!0;const wt=Yi.segments.get();for(const Rt of wt)zo.push({segments:new ze.SegmentVector([Rt]),sortKey:Rt.sortKey,state:Cl})}else zo.push({segments:Yi.segments,sortKey:0,state:Cl})}Io&&zo.sort((ze,wt)=>ze.sortKey-wt.sortKey);for(const ze of zo){const Rt=ze.state;if(wt.terrain&&wt.terrain.setupElevationDraw(Rt.tile,Rt.program,{useDepthForOcclusion:!0,labelPlaneMatrixInv:Rt.labelPlaneMatrixInv}),Qi.activeTexture.set(kn.TEXTURE0),Rt.atlasTexture.bind(Rt.atlasInterpolation,kn.CLAMP_TO_EDGE),Rt.atlasTextureIcon&&(Qi.activeTexture.set(kn.TEXTURE1),Rt.atlasTextureIcon&&Rt.atlasTextureIcon.bind(Rt.atlasInterpolationIcon,kn.CLAMP_TO_EDGE)),Rt.isSDF){const sr=Rt.uniformValues;Rt.hasHalo&&(sr.u_is_halo=1,$i(Rt.buffers,ze.segments,Xt,wt,Rt.program,Mo,Yi,Ji,sr)),sr.u_is_halo=0}$i(Rt.buffers,ze.segments,Xt,wt,Rt.program,Mo,Yi,Ji,Rt.uniformValues)}}function $i(wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri){const ai=sr.context;Dr.draw(ai,ai.gl.TRIANGLES,Lr,Ur,qr,ze.CullFaceMode.disabled,ri,Xt.id,wt.layoutVertexBuffer,wt.indexBuffer,Rt,Xt.paint,sr.transform.zoom,wt.programConfigurations.get(Xt.id),wt.dynamicLayoutVertexBuffer,wt.opacityVertexBuffer)}function Xi(wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=wt.context.gl,ri=Xt.paint.get("fill-pattern"),ai=ri&&ri.constantOr(1),Yi=Xt.getCrossfadeParameters();let Ji,Qi,kn,jn,Un;Ur?(Qi=ai&&!Xt.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ji=qr.LINES):(Qi=ai?"fillPattern":"fill",Ji=qr.TRIANGLES);for(const Wn of sr){const sr=Rt.getTile(Wn);if(ai&&!sr.patternsLoaded())continue;const Yn=sr.getBucket(Xt);if(!Yn)continue;wt.prepareDrawTile(Wn);const Jn=Yn.programConfigurations.get(Xt.id),Qn=wt.useProgram(Qi,Jn);ai&&(wt.context.activeTexture.set(qr.TEXTURE0),sr.imageAtlasTexture.bind(qr.LINEAR,qr.CLAMP_TO_EDGE),Jn.updatePaintBuffers(Yi));const Io=ri.constantOr(null);if(Io&&sr.imageAtlas){const ze=sr.imageAtlas,wt=ze.patternPositions[Io.to.toString()],Rt=ze.patternPositions[Io.from.toString()];wt&&Rt&&Jn.setConstantPatternPositions(wt,Rt)}const Mo=wt.translatePosMatrix(Wn.projMatrix,sr,Xt.paint.get("fill-translate"),Xt.paint.get("fill-translate-anchor"));if(Ur){jn=Yn.indexBuffer2,Un=Yn.segments2;const ze=wt.terrain&&wt.terrain.renderingToTexture?wt.terrain.drapeBufferSize:[qr.drawingBufferWidth,qr.drawingBufferHeight];kn="fillOutlinePattern"===Qi&&ai?yi(Mo,wt,Yi,sr,ze):xi(Mo,ze)}else jn=Yn.indexBuffer,Un=Yn.segments,kn=ai?vi(Mo,wt,Yi,sr):gi(Mo);wt.prepareDrawProgram(wt.context,Qn,Wn.toUnwrapped()),Qn.draw(wt.context,Ji,Dr,wt.stencilModeForClipping(Wn),Lr,ze.CullFaceMode.disabled,kn,Xt.id,Yn.layoutVertexBuffer,jn,Un,Xt.paint,wt.transform.zoom,Jn)}}function Hi(wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=wt.context,ri=qr.gl,ai=Xt.paint.get("fill-extrusion-pattern"),Yi=ai.constantOr(1),Ji=Xt.getCrossfadeParameters(),Qi=Xt.paint.get("fill-extrusion-opacity");for(const kn of sr){const sr=Rt.getTile(kn),jn=sr.getBucket(Xt);if(!jn)continue;const Un=jn.programConfigurations.get(Xt.id),Wn=wt.useProgram(Yi?"fillExtrusionPattern":"fillExtrusion",Un);if(wt.terrain){const ze=wt.terrain;if(!jn.enableTerrain)continue;if(ze.setupElevationDraw(sr,Wn,{useMeterToDem:!0}),Ki(qr,Rt,kn,jn,Xt,ze),!jn.centroidVertexBuffer){const ze=Wn.attributes.a_centroid_pos;void 0!==ze&&ri.vertexAttrib2f(ze,0,0)}}Yi&&(wt.context.activeTexture.set(ri.TEXTURE0),sr.imageAtlasTexture.bind(ri.LINEAR,ri.CLAMP_TO_EDGE),Un.updatePaintBuffers(Ji));const Yn=ai.constantOr(null);if(Yn&&sr.imageAtlas){const ze=sr.imageAtlas,wt=ze.patternPositions[Yn.to.toString()],Rt=ze.patternPositions[Yn.from.toString()];wt&&Rt&&Un.setConstantPatternPositions(wt,Rt)}const Jn=wt.translatePosMatrix(kn.projMatrix,sr,Xt.paint.get("fill-extrusion-translate"),Xt.paint.get("fill-extrusion-translate-anchor")),Qn=Xt.paint.get("fill-extrusion-vertical-gradient"),Io=Yi?fi(Jn,wt,Qn,Qi,kn,Ji,sr):mi(Jn,wt,Qn,Qi);wt.prepareDrawProgram(qr,Wn,kn.toUnwrapped()),Wn.draw(qr,qr.gl.TRIANGLES,Dr,Lr,Ur,ze.CullFaceMode.backCCW,Io,Xt.id,jn.layoutVertexBuffer,jn.indexBuffer,jn.segments,Xt.paint,wt.transform.zoom,Un,wt.terrain?jn.centroidVertexBuffer:null)}}function Ki(wt,Rt,Xt,sr,Dr,Lr){const Ur=[wt=>{let Rt=wt.canonical.x-1,Xt=wt.wrap;return Rt<0&&(Rt=(1<<wt.canonical.z)-1,Xt--),new ze.OverscaledTileID(wt.overscaledZ,Xt,wt.canonical.z,Rt,wt.canonical.y)},wt=>{let Rt=wt.canonical.x+1,Xt=wt.wrap;return Rt===1<<wt.canonical.z&&(Rt=0,Xt++),new ze.OverscaledTileID(wt.overscaledZ,Xt,wt.canonical.z,Rt,wt.canonical.y)},wt=>new ze.OverscaledTileID(wt.overscaledZ,wt.wrap,wt.canonical.z,wt.canonical.x,(0===wt.canonical.y?1<<wt.canonical.z:wt.canonical.y)-1),wt=>new ze.OverscaledTileID(wt.overscaledZ,wt.wrap,wt.canonical.z,wt.canonical.x,wt.canonical.y===(1<<wt.canonical.z)-1?0:wt.canonical.y+1)],l=ze=>{const wt=Rt.getSource().maxzoom,o=ze=>{const wt=Rt.getTileByID(ze);if(wt&&wt.hasData())return wt.getBucket(Dr)};let Xt,sr,Lr;return(ze.overscaledZ===ze.canonical.z||ze.overscaledZ>=wt)&&(Xt=o(ze.key)),ze.overscaledZ>=wt&&(sr=o(ze.calculateScaledKey(ze.overscaledZ+1))),ze.overscaledZ>wt&&(Lr=o(ze.calculateScaledKey(ze.overscaledZ-1))),Xt||sr||Lr},qr=[0,0,0],h=(wt,Rt)=>(qr[0]=Math.min(wt.min.y,Rt.min.y),qr[1]=Math.max(wt.max.y,Rt.max.y),qr[2]=ze.EXTENT-Rt.min.x>wt.max.x?Rt.min.x-ze.EXTENT:wt.max.x,qr),d=(wt,Rt)=>(qr[0]=Math.min(wt.min.x,Rt.min.x),qr[1]=Math.max(wt.max.x,Rt.max.x),qr[2]=ze.EXTENT-Rt.min.y>wt.max.y?Rt.min.y-ze.EXTENT:wt.max.y,qr),ri=[(ze,wt)=>h(ze,wt),(ze,wt)=>h(wt,ze),(ze,wt)=>d(ze,wt),(ze,wt)=>d(wt,ze)],ai=new ze.pointGeometry(0,0);let Yi,Ji,Qi;const g=(wt,Rt,sr,Dr,Ur)=>{const qr=[[Dr?sr:wt,Dr?wt:sr,0],[Dr?sr:Rt,Dr?Rt:sr,0]],ri=Ur<0?ze.EXTENT+Ur:Ur,ai=[Dr?ri:(wt+Rt)/2,Dr?(wt+Rt)/2:ri,0];return 0===sr&&Ur<0||0!==sr&&Ur>0?Lr.getForTilePoints(Qi,[ai],!0,Ji):qr.push(ai),Lr.getForTilePoints(Xt,qr,!0,Yi),Math.max(qr[0][2],qr[1][2],ai[2])/Lr.exaggeration()};for(let wt=0;wt<4;wt++){const Rt=sr.borders[wt];if(0===Rt.length&&(sr.borderDone[wt]=!0),sr.borderDone[wt])continue;const Dr=Qi=Ur[wt](Xt),qr=l(Dr);if(!qr||!qr.enableTerrain)continue;if(Ji=Lr.findDEMTileFor(Dr),!Ji||!Ji.dem)continue;if(!Yi){const ze=Lr.findDEMTileFor(Xt);if(!ze||!ze.dem)return;Yi=ze}const kn=(wt<2?1:5)-wt,jn=qr.borders[kn];let Un=0;for(let Xt=0;Xt<Rt.length;Xt++){const Dr=sr.featuresOnBorder[Rt[Xt]],Lr=Dr.borders[wt];let Ur;for(;Un<jn.length&&(Ur=qr.featuresOnBorder[jn[Un]],!(Ur.borders[kn][1]>Lr[0]+3));)qr.borderDone[kn]||qr.encodeCentroid(void 0,Ur,!1),Un++;if(Ur&&Un<jn.length){const Rt=Un;let Xt=0;for(;!(Ur.borders[kn][0]>Lr[1]-3)&&(Xt++,++Un!==jn.length);)Ur=qr.featuresOnBorder[jn[Un]];if(Ur=qr.featuresOnBorder[jn[Rt]],Dr.intersectsCount()>1||Ur.intersectsCount()>1||1!==Xt){1!==Xt&&(Un=Rt),sr.encodeCentroid(void 0,Dr,!1),qr.borderDone[kn]||qr.encodeCentroid(void 0,Ur,!1);continue}const Yi=ri[wt](Dr,Ur),Ji=wt%2?ze.EXTENT-1:0;ai.x=g(Yi[0],Math.min(ze.EXTENT-1,Yi[1]),Ji,wt<2,Yi[2]),ai.y=0,sr.encodeCentroid(ai,Dr,!1),qr.borderDone[kn]||qr.encodeCentroid(ai,Ur,!1)}else sr.encodeCentroid(void 0,Dr,!1)}sr.borderDone[wt]=sr.needsCentroidUpdate=!0,qr.borderDone[kn]||(qr.borderDone[kn]=qr.needsCentroidUpdate=!0)}(sr.needsCentroidUpdate||!sr.centroidVertexBuffer&&0!==sr.centroidVertexArray.length)&&sr.uploadCentroid(wt)}const Ll=new ze.Color(1,0,0,1),Fl=new ze.Color(0,1,0,1),Vl=new ze.Color(0,0,1,1),Gl=new ze.Color(1,0,1,1),Zl=new ze.Color(0,1,1,1);function io(ze,wt,Rt,Xt){ro(ze,0,wt+Rt/2,ze.transform.width,Rt,Xt)}function oo(ze,wt,Rt,Xt){ro(ze,wt-Rt/2,0,Rt,ze.transform.height,Xt)}function ro(wt,Rt,Xt,sr,Dr,Lr){const Ur=wt.context,qr=Ur.gl;qr.enable(qr.SCISSOR_TEST),qr.scissor(Rt*ze.exported.devicePixelRatio,Xt*ze.exported.devicePixelRatio,sr*ze.exported.devicePixelRatio,Dr*ze.exported.devicePixelRatio),Ur.clear({color:Lr}),qr.disable(qr.SCISSOR_TEST)}function ao(wt,Rt,Xt){const sr=wt.context,Dr=sr.gl,Lr=Xt.projMatrix,Ur=wt.useProgram("debug"),qr=Rt.getTileByID(Xt.key);wt.terrain&&wt.terrain.setupElevationDraw(qr,Ur);const ri=ze.DepthMode.disabled,ai=ze.StencilMode.disabled,Yi=wt.colorModeForRenderPass(),Ji="$debug";sr.activeTexture.set(Dr.TEXTURE0),wt.emptyTexture.bind(Dr.LINEAR,Dr.CLAMP_TO_EDGE),Ur.draw(sr,Dr.LINE_STRIP,ri,ai,Yi,ze.CullFaceMode.disabled,Ei(Lr,ze.Color.red),Ji,wt.debugBuffer,wt.tileBorderIndexBuffer,wt.debugSegments);const Qi=qr.latestRawTileData,kn=Math.floor((Qi&&Qi.byteLength||0)/1024),jn=Rt.getTile(Xt).tileSize,Un=512/Math.min(jn,512)*(Xt.overscaledZ/wt.transform.zoom)*.5;let Wn=Xt.canonical.toString();Xt.overscaledZ!==Xt.canonical.z&&(Wn+=` => ${Xt.overscaledZ}`),function(ze,wt){ze.initDebugOverlayCanvas();const Rt=ze.debugOverlayCanvas,Xt=ze.context.gl,sr=ze.debugOverlayCanvas.getContext("2d");sr.clearRect(0,0,Rt.width,Rt.height),sr.shadowColor="white",sr.shadowBlur=2,sr.lineWidth=1.5,sr.strokeStyle="white",sr.textBaseline="top",sr.font="bold 36px Open Sans, sans-serif",sr.fillText(wt,5,5),sr.strokeText(wt,5,5),ze.debugOverlayTexture.update(Rt),ze.debugOverlayTexture.bind(Xt.LINEAR,Xt.CLAMP_TO_EDGE)}(wt,`${Wn} ${kn}kb`),Ur.draw(sr,Dr.TRIANGLES,ri,ai,ze.ColorMode.alphaBlended,ze.CullFaceMode.disabled,Ei(Lr,ze.Color.transparent,Un),Ji,wt.debugBuffer,wt.quadTriangleIndexBuffer,wt.debugSegments)}const Wl=ze.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Xl}=Wl;function lo(ze,wt,Rt,Xt){ze.emplaceBack(wt,Rt,Xt)}class co{constructor(wt){this.vertexArray=new ze.StructArrayLayout3f12,this.indices=new ze.StructArrayLayout3ui6,lo(this.vertexArray,-1,-1,1),lo(this.vertexArray,1,-1,1),lo(this.vertexArray,-1,1,1),lo(this.vertexArray,1,1,1),lo(this.vertexArray,-1,-1,-1),lo(this.vertexArray,1,-1,-1),lo(this.vertexArray,-1,1,-1),lo(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=wt.createVertexBuffer(this.vertexArray,Xl),this.indexBuffer=wt.createIndexBuffer(this.indices),this.segment=ze.SegmentVector.simpleSegment(0,0,36,12)}}function ho(wt,Rt,Xt,sr,Dr,Lr){const Ur=wt.gl,qr=Rt.paint.get("sky-atmosphere-color"),ri=Rt.paint.get("sky-atmosphere-halo-color"),ai=Rt.paint.get("sky-atmosphere-sun-intensity"),Yi=((ze,wt,Rt,Xt,sr)=>({u_matrix_3f:ze,u_sun_direction:wt,u_sun_intensity:Rt,u_color_tint_r:[Xt.r,Xt.g,Xt.b,Xt.a],u_color_tint_m:[sr.r,sr.g,sr.b,sr.a],u_luminance:5e-5}))(ze.fromMat4([],sr),Dr,ai,qr,ri);Ur.framebufferTexture2D(Ur.FRAMEBUFFER,Ur.COLOR_ATTACHMENT0,Ur.TEXTURE_CUBE_MAP_POSITIVE_X+Lr,Rt.skyboxTexture,0),Xt.draw(wt,Ur.TRIANGLES,ze.DepthMode.disabled,ze.StencilMode.disabled,ze.ColorMode.unblended,ze.CullFaceMode.frontCW,Yi,"skyboxCapture",Rt.skyboxGeometry.vertexBuffer,Rt.skyboxGeometry.indexBuffer,Rt.skyboxGeometry.segment)}
20const ic={symbol:function(wt,Rt,Xt,sr,Dr){if("translucent"!==wt.renderPass)return;const Lr=ze.StencilMode.disabled,Ur=wt.colorModeForRenderPass();Xt.layout.get("text-variable-anchor")&&function(wt,Rt,Xt,sr,Dr,Lr,Ur){const qr=Rt.transform,ri="map"===Dr,ai="map"===Lr;for(const Dr of wt){const wt=sr.getTile(Dr),Lr=wt.getBucket(Xt);if(!Lr||!Lr.text||!Lr.text.segments.get().length)continue;const Yi=ze.evaluateSizeForZoom(Lr.textSizeData,qr.zoom),Ji=z(wt,1,Rt.transform.zoom),Qi=Ht(Dr.projMatrix,ai,ri,Rt.transform,Ji),kn="none"!==Xt.layout.get("icon-text-fit")&&Lr.hasIconData();if(Yi){const Rt=Math.pow(2,qr.zoom-wt.tileID.overscaledZ),Xt=qr.elevation;ji(Lr,ri,ai,Ur,ze.symbolSize,qr,Qi,Dr.projMatrix,Rt,Yi,kn,Xt?ze=>Xt.getAtTileOffset(Dr,ze.x,ze.y):ze=>0)}}}(sr,wt,Xt,Rt,Xt.layout.get("text-rotation-alignment"),Xt.layout.get("text-pitch-alignment"),Dr),0!==Xt.paint.get("icon-opacity").constantOr(1)&&Wi(wt,Rt,Xt,sr,!1,Xt.paint.get("icon-translate"),Xt.paint.get("icon-translate-anchor"),Xt.layout.get("icon-rotation-alignment"),Xt.layout.get("icon-pitch-alignment"),Xt.layout.get("icon-keep-upright"),Lr,Ur),0!==Xt.paint.get("text-opacity").constantOr(1)&&Wi(wt,Rt,Xt,sr,!0,Xt.paint.get("text-translate"),Xt.paint.get("text-translate-anchor"),Xt.layout.get("text-rotation-alignment"),Xt.layout.get("text-pitch-alignment"),Xt.layout.get("text-keep-upright"),Lr,Ur),Rt.map.showCollisionBoxes&&(Gi(wt,Rt,Xt,sr,Xt.paint.get("text-translate"),Xt.paint.get("text-translate-anchor"),!0),Gi(wt,Rt,Xt,sr,Xt.paint.get("icon-translate"),Xt.paint.get("icon-translate-anchor"),!1))},circle:function(wt,Rt,Xt,sr){if("translucent"!==wt.renderPass)return;const Dr=Xt.paint.get("circle-opacity"),Lr=Xt.paint.get("circle-stroke-width"),Ur=Xt.paint.get("circle-stroke-opacity"),qr=void 0!==Xt.layout.get("circle-sort-key").constantOr(1);if(0===Dr.constantOr(1)&&(0===Lr.constantOr(1)||0===Ur.constantOr(1)))return;const ri=wt.context,ai=ri.gl,Yi=wt.depthModeForSublayer(0,ze.DepthMode.ReadOnly),Ji=ze.StencilMode.disabled,Qi=wt.colorModeForRenderPass(),kn=[];for(let Dr=0;Dr<sr.length;Dr++){const Lr=sr[Dr],Ur=Rt.getTile(Lr),ri=Ur.getBucket(Xt);if(!ri)continue;const ai=ri.programConfigurations.get(Xt.id),Yi=wi(Xt),Ji={programConfiguration:ai,program:wt.useProgram("circle",ai,Yi),layoutVertexBuffer:ri.layoutVertexBuffer,indexBuffer:ri.indexBuffer,uniformValues:bi(wt,Lr,Ur,Xt),tile:Ur};if(qr){const wt=ri.segments.get();for(const Rt of wt)kn.push({segments:new ze.SegmentVector([Rt]),sortKey:Rt.sortKey,state:Ji})}else kn.push({segments:ri.segments,sortKey:0,state:Ji})}qr&&kn.sort((ze,wt)=>ze.sortKey-wt.sortKey);for(const Rt of kn){const{programConfiguration:sr,program:Dr,layoutVertexBuffer:Lr,indexBuffer:Ur,uniformValues:qr,tile:kn}=Rt.state,jn=Rt.segments;wt.terrain&&wt.terrain.setupElevationDraw(kn,Dr,{useDepthForOcclusion:!0}),wt.prepareDrawProgram(ri,Dr,kn.tileID.toUnwrapped()),Dr.draw(ri,ai.TRIANGLES,Yi,Ji,Qi,ze.CullFaceMode.disabled,qr,Xt.id,Lr,Ur,jn,Xt.paint,wt.transform.zoom,sr)}},heatmap:function(wt,Rt,Xt,sr){if(0!==Xt.paint.get("heatmap-opacity"))if("offscreen"===wt.renderPass){const Dr=wt.context,Lr=Dr.gl,Ur=ze.StencilMode.disabled,qr=new ze.ColorMode([Lr.ONE,Lr.ONE],ze.Color.transparent,[!0,!0,!0,!0]);!function(ze,wt,Rt){const Xt=ze.gl;ze.activeTexture.set(Xt.TEXTURE1),ze.viewport.set([0,0,wt.width/4,wt.height/4]);let sr=Rt.heatmapFbo;if(sr)Xt.bindTexture(Xt.TEXTURE_2D,sr.colorAttachment.get()),ze.bindFramebuffer.set(sr.framebuffer);else{const Dr=Xt.createTexture();Xt.bindTexture(Xt.TEXTURE_2D,Dr),Xt.texParameteri(Xt.TEXTURE_2D,Xt.TEXTURE_WRAP_S,Xt.CLAMP_TO_EDGE),Xt.texParameteri(Xt.TEXTURE_2D,Xt.TEXTURE_WRAP_T,Xt.CLAMP_TO_EDGE),Xt.texParameteri(Xt.TEXTURE_2D,Xt.TEXTURE_MIN_FILTER,Xt.LINEAR),Xt.texParameteri(Xt.TEXTURE_2D,Xt.TEXTURE_MAG_FILTER,Xt.LINEAR),sr=Rt.heatmapFbo=ze.createFramebuffer(wt.width/4,wt.height/4,!1),function(ze,wt,Rt,Xt){const sr=ze.gl;sr.texImage2D(sr.TEXTURE_2D,0,sr.RGBA,wt.width/4,wt.height/4,0,sr.RGBA,ze.extRenderToTextureHalfFloat?ze.extTextureHalfFloat.HALF_FLOAT_OES:sr.UNSIGNED_BYTE,null),Xt.colorAttachment.set(Rt)}(ze,wt,Dr,sr)}}(Dr,wt,Xt),Dr.clear({color:ze.Color.transparent});for(let ri=0;ri<sr.length;ri++){const ai=sr[ri];if(Rt.hasRenderableParent(ai))continue;const Yi=Rt.getTile(ai),Ji=Yi.getBucket(Xt);if(!Ji)continue;const Qi=Ji.programConfigurations.get(Xt.id),kn=wt.useProgram("heatmap",Qi),{zoom:jn}=wt.transform;wt.terrain&&wt.terrain.setupElevationDraw(Yi,kn),wt.prepareDrawProgram(Dr,kn,ai.toUnwrapped()),kn.draw(Dr,Lr.TRIANGLES,ze.DepthMode.disabled,Ur,qr,ze.CullFaceMode.disabled,Ci(ai.projMatrix,Yi,jn,Xt.paint.get("heatmap-intensity")),Xt.id,Ji.layoutVertexBuffer,Ji.indexBuffer,Ji.segments,Xt.paint,wt.transform.zoom,Qi)}Dr.viewport.set([0,0,wt.width,wt.height])}else"translucent"===wt.renderPass&&(wt.context.setColorMode(wt.colorModeForRenderPass()),function(wt,Rt){const Xt=wt.context,sr=Xt.gl,Dr=Rt.heatmapFbo;if(!Dr)return;Xt.activeTexture.set(sr.TEXTURE0),sr.bindTexture(sr.TEXTURE_2D,Dr.colorAttachment.get()),Xt.activeTexture.set(sr.TEXTURE1);let Lr=Rt.colorRampTexture;Lr||(Lr=Rt.colorRampTexture=new ze.Texture(Xt,Rt.colorRamp,sr.RGBA)),Lr.bind(sr.LINEAR,sr.CLAMP_TO_EDGE),wt.useProgram("heatmapTexture").draw(Xt,sr.TRIANGLES,ze.DepthMode.disabled,ze.StencilMode.disabled,wt.colorModeForRenderPass(),ze.CullFaceMode.disabled,((ze,wt)=>({u_image:0,u_color_ramp:1,u_opacity:wt.paint.get("heatmap-opacity")}))(0,Rt),Rt.id,wt.viewportBuffer,wt.quadTriangleIndexBuffer,wt.viewportSegments,Rt.paint,wt.transform.zoom)}(wt,Xt))},line:function(wt,Rt,Xt,sr){if("translucent"!==wt.renderPass)return;const Dr=Xt.paint.get("line-opacity"),Lr=Xt.paint.get("line-width");if(0===Dr.constantOr(1)||0===Lr.constantOr(1))return;const Ur=wt.depthModeForSublayer(0,ze.DepthMode.ReadOnly),qr=wt.colorModeForRenderPass(),ri=Xt.paint.get("line-dasharray"),ai=ri.constantOr(1),Yi=Xt.layout.get("line-cap"),Ji=Xt.paint.get("line-pattern"),Qi=Ji.constantOr(1),kn=Xt.paint.get("line-gradient"),jn=Xt.getCrossfadeParameters(),Un=Qi?"linePattern":ai?"lineSDF":kn?"lineGradient":"line",Wn=wt.context,Yn=Wn.gl;for(const Dr of sr){const sr=Rt.getTile(Dr);if(Qi&&!sr.patternsLoaded())continue;const Lr=sr.getBucket(Xt);if(!Lr)continue;wt.prepareDrawTile(Dr);const Jn=Lr.programConfigurations.get(Xt.id),Qn=wt.useProgram(Un,Jn),Io=Ji.constantOr(null);if(Io&&sr.imageAtlas){const ze=sr.imageAtlas,wt=ze.patternPositions[Io.to.toString()],Rt=ze.patternPositions[Io.from.toString()];wt&&Rt&&Jn.setConstantPatternPositions(wt,Rt)}const Mo=ri.constantOr(null),jo=Yi.constantOr(null);if(!Qi&&Mo&&jo&&sr.lineAtlas){const ze=sr.lineAtlas,wt=ze.getDash(Mo.to,jo),Rt=ze.getDash(Mo.from,jo);wt&&Rt&&Jn.setConstantPatternPositions(wt,Rt)}const zo=wt.terrain?Dr.projMatrix:null,oa=Qi?Mi(wt,sr,Xt,jn,zo):ai?zi(wt,sr,Xt,jn,zo):kn?Ii(wt,sr,Xt,zo,Lr.lineClipsArray.length):Si(wt,sr,Xt,zo);if(Qi)Wn.activeTexture.set(Yn.TEXTURE0),sr.imageAtlasTexture.bind(Yn.LINEAR,Yn.CLAMP_TO_EDGE),Jn.updatePaintBuffers(jn);else if(ai)Wn.activeTexture.set(Yn.TEXTURE0),sr.lineAtlasTexture.bind(Yn.LINEAR,Yn.REPEAT),Jn.updatePaintBuffers(jn);else if(kn){const sr=Lr.gradients[Xt.id];let Ur=sr.texture;if(Xt.gradientVersion!==sr.version){let qr=256;if(Xt.stepInterpolant){const Xt=Rt.getSource().maxzoom,sr=Dr.canonical.z===Xt?Math.ceil(1<<wt.transform.maxZoom-Dr.canonical.z):1;qr=ze.clamp(ze.nextPowerOfTwo(Lr.maxLineLength/ze.EXTENT*1024*sr),256,Wn.maxTextureSize)}sr.gradient=ze.renderColorRamp({expression:Xt.gradientExpression(),evaluationKey:"lineProgress",resolution:qr,image:sr.gradient||void 0,clips:Lr.lineClipsArray}),sr.texture?sr.texture.update(sr.gradient):sr.texture=new ze.Texture(Wn,sr.gradient,Yn.RGBA),sr.ver
vendor: 26,684 bytes, line 20
20sion=Xt.gradientVersion,Ur=sr.texture}Wn.activeTexture.set(Yn.TEXTURE0),Ur.bind(Xt.stepInterpolant?Yn.NEAREST:Yn.LINEAR,Yn.CLAMP_TO_EDGE)}wt.prepareDrawProgram(Wn,Qn,Dr.toUnwrapped()),Qn.draw(Wn,Yn.TRIANGLES,Ur,wt.stencilModeForClipping(Dr),qr,ze.CullFaceMode.disabled,oa,Xt.id,Lr.layoutVertexBuffer,Lr.indexBuffer,Lr.segments,Xt.paint,wt.transform.zoom,Jn,Lr.layoutVertexBuffer2)}},fill:function(wt,Rt,Xt,sr){const Dr=Xt.paint.get("fill-color"),Lr=Xt.paint.get("fill-opacity");if(0===Lr.constantOr(1))return;const Ur=wt.colorModeForRenderPass(),qr=Xt.paint.get("fill-pattern"),ri=wt.opaquePassEnabledForLayer()&&!qr.constantOr(1)&&1===Dr.constantOr(ze.Color.transparent).a&&1===Lr.constantOr(0)?"opaque":"translucent";if(wt.renderPass===ri){const Dr=wt.depthModeForSublayer(1,"opaque"===wt.renderPass?ze.DepthMode.ReadWrite:ze.DepthMode.ReadOnly);Xi(wt,Rt,Xt,sr,Dr,Ur,!1)}if("translucent"===wt.renderPass&&Xt.paint.get("fill-antialias")){const Dr=wt.depthModeForSublayer(Xt.getPaintProperty("fill-outline-color")?2:0,ze.DepthMode.ReadOnly);Xi(wt,Rt,Xt,sr,Dr,Ur,!0)}},"fill-extrusion":function(wt,Rt,Xt,sr){const Dr=Xt.paint.get("fill-extrusion-opacity");if(0!==Dr&&"translucent"===wt.renderPass){const Lr=new ze.DepthMode(wt.context.gl.LEQUAL,ze.DepthMode.ReadWrite,wt.depthRangeFor3D);if(1!==Dr||Xt.paint.get("fill-extrusion-pattern").constantOr(1))Hi(wt,Rt,Xt,sr,Lr,ze.StencilMode.disabled,ze.ColorMode.disabled),Hi(wt,Rt,Xt,sr,Lr,wt.stencilModeFor3D(),wt.colorModeForRenderPass());else{const Dr=wt.colorModeForRenderPass();Hi(wt,Rt,Xt,sr,Lr,ze.StencilMode.disabled,Dr)}}},hillshade:function(wt,Rt,Xt,sr){if("offscreen"!==wt.renderPass&&"translucent"!==wt.renderPass)return;const Dr=wt.context,Lr=wt.depthModeForSublayer(0,ze.DepthMode.ReadOnly),Ur=wt.colorModeForRenderPass(),qr=wt.terrain&&wt.terrain.renderingToTexture,[ri,ai]="translucent"!==wt.renderPass||qr?[{},sr]:wt.stencilConfigForOverlap(sr);for(const sr of ai){const Dr=Rt.getTile(sr);if(Dr.needsHillshadePrepare&&"offscreen"===wt.renderPass)ei(wt,Dr,Xt,Lr,ze.StencilMode.disabled,Ur);else if("translucent"===wt.renderPass){const ze=qr&&wt.terrain?wt.terrain.stencilModeForRTTOverlap(sr):ri[sr.overscaledZ];Je(wt,sr,Dr,Xt,Lr,ze,Ur)}}Dr.viewport.set([0,0,wt.width,wt.height])},raster:function(wt,Rt,Xt,sr,Dr,Lr){if("translucent"!==wt.renderPass)return;if(0===Xt.paint.get("raster-opacity"))return;if(!sr.length)return;const Ur=wt.context,qr=Ur.gl,ri=Rt.getSource(),ai=wt.useProgram("raster"),Yi=wt.colorModeForRenderPass(),Ji=wt.terrain&&wt.terrain.renderingToTexture,[Qi,kn]=ri instanceof Et||Ji?[{},sr]:wt.stencilConfigForOverlap(sr),jn=kn[kn.length-1].overscaledZ,Un=!wt.options.moving;for(const sr of kn){const Dr=Ji?ze.DepthMode.disabled:wt.depthModeForSublayer(sr.overscaledZ-jn,1===Xt.paint.get("raster-opacity")?ze.DepthMode.ReadWrite:ze.DepthMode.ReadOnly,qr.LESS),kn=sr.toUnwrapped(),Wn=Rt.getTile(sr);if(Ji&&(!Wn||!Wn.hasData()))continue;const Yn=Ji?sr.projMatrix:wt.transform.calculateProjMatrix(kn,Un),Jn=wt.terrain&&Ji?wt.terrain.stencilModeForRTTOverlap(sr):Qi[sr.overscaledZ],Qn=Lr?0:Xt.paint.get("raster-fade-duration");Wn.registerFadeDuration(Qn);const Io=Rt.findLoadedParent(sr,0),Mo=li(Wn,Io,Rt,wt.transform,Qn);let jo,zo;wt.terrain&&wt.terrain.prepareDrawTile(sr);const oa="nearest"===Xt.paint.get("raster-resampling")?qr.NEAREST:qr.LINEAR;Ur.activeTexture.set(qr.TEXTURE0),Wn.texture.bind(oa,qr.CLAMP_TO_EDGE,qr.LINEAR_MIPMAP_NEAREST),Ur.activeTexture.set(qr.TEXTURE1),Io?(Io.texture.bind(oa,qr.CLAMP_TO_EDGE,qr.LINEAR_MIPMAP_NEAREST),jo=Math.pow(2,Io.tileID.overscaledZ-Wn.tileID.overscaledZ),zo=[Wn.tileID.canonical.x*jo%1,Wn.tileID.canonical.y*jo%1]):Wn.texture.bind(oa,qr.CLAMP_TO_EDGE,qr.LINEAR_MIPMAP_NEAREST);const la=Pi(Yn,zo||[0,0],jo||1,Mo,Xt);wt.prepareDrawProgram(Ur,ai,kn),ri instanceof Et?ai.draw(Ur,qr.TRIANGLES,Dr,ze.StencilMode.disabled,Yi,ze.CullFaceMode.disabled,la,Xt.id,ri.boundsBuffer,wt.quadTriangleIndexBuffer,ri.boundsSegments):ai.draw(Ur,qr.TRIANGLES,Dr,Jn,Yi,ze.CullFaceMode.disabled,la,Xt.id,wt.rasterBoundsBuffer,wt.quadTriangleIndexBuffer,wt.rasterBoundsSegments)}},background:function(wt,Rt,Xt,sr){const Dr=Xt.paint.get("background-color"),Lr=Xt.paint.get("background-opacity");if(0===Lr)return;const Ur=wt.context,qr=Ur.gl,ri=wt.transform,ai=ri.tileSize,Yi=Xt.paint.get("background-pattern");if(wt.isPatternMissing(Yi))return;const Ji=!Yi&&1===Dr.a&&1===Lr&&wt.opaquePassEnabledForLayer()?"opaque":"translucent";if(wt.renderPass!==Ji)return;const Qi=ze.StencilMode.disabled,kn=wt.depthModeForSublayer(0,"opaque"===Ji?ze.DepthMode.ReadWrite:ze.DepthMode.ReadOnly),jn=wt.colorModeForRenderPass(),Un=wt.useProgram(Yi?"backgroundPattern":"background"),Wn=sr||ri.coveringTiles({tileSize:ai});Yi&&(Ur.activeTexture.set(qr.TEXTURE0),wt.imageManager.bind(wt.context));const Yn=Xt.getCrossfadeParameters();for(const Rt of Wn){const ri=Rt.toUnwrapped(),Ji=sr?Rt.projMatrix:wt.transform.calculateProjMatrix(ri);wt.prepareDrawTile(Rt);const Wn=Yi?Oi(Ji,Lr,wt,Yi,{tileID:Rt,tileSize:ai},Yn):Bi(Ji,Lr,Dr);wt.prepareDrawProgram(Ur,Un,ri),Un.draw(Ur,qr.TRIANGLES,kn,Qi,jn,ze.CullFaceMode.disabled,Wn,Xt.id,wt.tileExtentBuffer,wt.quadTriangleIndexBuffer,wt.tileExtentSegments)}},sky:function(wt,Rt,Xt){const sr=Xt.paint.get("sky-opacity");if(0===sr)return;const Dr=wt.context,Lr=Xt.paint.get("sky-type"),Ur=new ze.DepthMode(Dr.gl.LEQUAL,ze.DepthMode.ReadOnly,[0,1]),qr=wt.frameCounter/1e3%1;"atmosphere"===Lr?"offscreen"===wt.renderPass?Xt.needsSkyboxCapture(wt)&&(function(wt,Rt){const Xt=wt.context,sr=Xt.gl;let Dr=Rt.skyboxFbo;if(!Dr){Dr=Rt.skyboxFbo=Xt.createFramebuffer(32,32,!1),Rt.skyboxGeometry=new co(Xt),Rt.skyboxTexture=Xt.gl.createTexture(),sr.bindTexture(sr.TEXTURE_CUBE_MAP,Rt.skyboxTexture),sr.texParameteri(sr.TEXTURE_CUBE_MAP,sr.TEXTURE_WRAP_S,sr.CLAMP_TO_EDGE),sr.texParameteri(sr.TEXTURE_CUBE_MAP,sr.TEXTURE_WRAP_T,sr.CLAMP_TO_EDGE),sr.texParameteri(sr.TEXTURE_CUBE_MAP,sr.TEXTURE_MIN_FILTER,sr.LINEAR),sr.texParameteri(sr.TEXTURE_CUBE_MAP,sr.TEXTURE_MAG_FILTER,sr.LINEAR);for(let ze=0;ze<6;++ze)sr.texImage2D(sr.TEXTURE_CUBE_MAP_POSITIVE_X+ze,0,sr.RGBA,32,32,0,sr.RGBA,sr.UNSIGNED_BYTE,null)}Xt.bindFramebuffer.set(Dr.framebuffer),Xt.viewport.set([0,0,32,32]);const Lr=Rt.getCenter(wt,!0),Ur=wt.useProgram("skyboxCapture"),qr=new Float64Array(16);ze.identity(qr),ze.rotateY(qr,qr,.5*-Math.PI),ho(Xt,Rt,Ur,qr,Lr,0),ze.identity(qr),ze.rotateY(qr,qr,.5*Math.PI),ho(Xt,Rt,Ur,qr,Lr,1),ze.identity(qr),ze.rotateX(qr,qr,.5*-Math.PI),ho(Xt,Rt,Ur,qr,Lr,2),ze.identity(qr),ze.rotateX(qr,qr,.5*Math.PI),ho(Xt,Rt,Ur,qr,Lr,3),ze.identity(qr),ho(Xt,Rt,Ur,qr,Lr,4),ze.identity(qr),ze.rotateY(qr,qr,Math.PI),ho(Xt,Rt,Ur,qr,Lr,5),Xt.viewport.set([0,0,wt.width,wt.height])}(wt,Xt),Xt.markSkyboxValid(wt)):"sky"===wt.renderPass&&function(wt,Rt,Xt,sr,Dr){const Lr=wt.context,Ur=Lr.gl,qr=wt.transform,ri=wt.useProgram("skybox");Lr.activeTexture.set(Ur.TEXTURE0),Ur.bindTexture(Ur.TEXTURE_CUBE_MAP,Rt.skyboxTexture);const ai=((ze,wt,Rt,Xt,sr)=>({u_matrix:ze,u_sun_direction:wt,u_cubemap:0,u_opacity:Xt,u_temporal_offset:sr}))(qr.skyboxMatrix,Rt.getCenter(wt,!1),0,sr,Dr);wt.prepareDrawProgram(Lr,ri),ri.draw(Lr,Ur.TRIANGLES,Xt,ze.StencilMode.disabled,wt.colorModeForRenderPass(),ze.CullFaceMode.backCW,ai,"skybox",Rt.skyboxGeometry.vertexBuffer,Rt.skyboxGeometry.indexBuffer,Rt.skyboxGeometry.segment)}(wt,Xt,Ur,sr,qr):"gradient"===Lr&&"sky"===wt.renderPass&&function(wt,Rt,Xt,sr,Dr){const Lr=wt.context,Ur=Lr.gl,qr=wt.transform,ri=wt.useProgram("skyboxGradient");Rt.skyboxGeometry||(Rt.skyboxGeometry=new co(Lr)),Lr.activeTexture.set(Ur.TEXTURE0);let ai=Rt.colorRampTexture;ai||(ai=Rt.colorRampTexture=new ze.Texture(Lr,Rt.colorRamp,Ur.RGBA)),ai.bind(Ur.LINEAR,Ur.CLAMP_TO_EDGE);const Yi=((wt,Rt,Xt,sr,Dr)=>({u_matrix:wt,u_color_ramp:0,u_center_direction:Rt,u_radius:ze.degToRad(Xt),u_opacity:sr,u_temporal_offset:Dr}))(qr.skyboxMatrix,Rt.getCenter(wt,!1),Rt.paint.get("sky-gradient-radius"),sr,Dr);wt.prepareDrawProgram(Lr,ri),ri.draw(Lr,Ur.TRIANGLES,Xt,ze.StencilMode.disabled,wt.colorModeForRenderPass(),ze.CullFaceMode.backCW,Yi,"skyboxGradient",Rt.skyboxGeometry.vertexBuffer,Rt.skyboxGeometry.indexBuffer,Rt.skyboxGeometry.segment)}(wt,Xt,Ur,sr,qr)},debug:function(ze,wt,Rt){for(let Xt=0;Xt<Rt.length;Xt++)ao(ze,wt,Rt[Xt])},custom:function(wt,Rt,Xt){const sr=wt.context,Dr=Xt.implementation;if("offscreen"===wt.renderPass){const ze=Dr.prerender;ze&&(wt.setCustomLayerDefaults(),sr.setColorMode(wt.colorModeForRenderPass()),ze.call(Dr,sr.gl,wt.transform.customLayerMatrix()),sr.setDirty(),wt.setBaseState())}else if("translucent"===wt.renderPass){wt.setCustomLayerDefaults(),sr.setColorMode(wt.colorModeForRenderPass()),sr.setStencilMode(ze.StencilMode.disabled);const Rt="3d"===Dr.renderingMode?new ze.DepthMode(wt.context.gl.LEQUAL,ze.DepthMode.ReadWrite,wt.depthRangeFor3D):wt.depthModeForSublayer(0,ze.DepthMode.ReadOnly);sr.setDepthMode(Rt),Dr.render(sr.gl,wt.transform.customLayerMatrix()),sr.setDirty(),wt.setBaseState(),sr.bindFramebuffer.set(null)}}};class _o{constructor(wt,Rt){this.context=new yt(wt),this.transform=Rt,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=ze.SourceCache.maxUnderzooming+ze.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fe,this.gpuTimers={},this.frameCounter=0}updateTerrain(ze,wt){const Rt=!!ze&&!!ze.terrain;if(!(Rt||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new di(this,ze));const Xt=this._terrain;this.transform.elevation=Rt?Xt:null,Xt.update(ze,this.transform,wt)}_updateFog(ze){const wt=ze.fog;if(!wt||wt.getOpacity(this.transform.pitch)<1||wt.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[Rt,Xt]=wt.getFovAdjustedRange(this.transform._fov);if(Rt>Xt)return void(this.transform.fogCullDistSq=null);const sr=Rt+.78*(Xt-Rt);this.transform.fogCullDistSq=sr*sr}get terrain(){return this._terrain&&this._terrain.enabled?this._terrain:null}resize(wt,Rt){if(this.width=wt*ze.exported.devicePixelRatio,this.height=Rt*ze.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const ze of this.style.order)this.style._layers[ze].resize()}setup(){const wt=this.context,Rt=new ze.StructArrayLayout2i4;Rt.emplaceBack(0,0),Rt.emplaceBack(ze.EXTENT,0),Rt.emplaceBack(0,ze.EXTENT),Rt.emplaceBack(ze.EXTENT,ze.EXTENT),this.tileExtentBuffer=wt.createVertexBuffer(Rt,ze.posAttributes.members),this.tileExtentSegments=ze.SegmentVector.simpleSegment(0,0,4,2);const Xt=new ze.StructArrayLayout2i4;Xt.emplaceBack(0,0),Xt.emplaceBack(ze.EXTENT,0),Xt.emplaceBack(0,ze.EXTENT),Xt.emplaceBack(ze.EXTENT,ze.EXTENT),this.debugBuffer=wt.createVertexBuffer(Xt,ze.posAttributes.members),this.debugSegments=ze.SegmentVector.simpleSegment(0,0,4,5);const sr=new ze.StructArrayLayout4i8;sr.emplaceBack(0,0,0,0),sr.emplaceBack(ze.EXTENT,0,ze.EXTENT,0),sr.emplaceBack(0,ze.EXTENT,0,ze.EXTENT),sr.emplaceBack(ze.EXTENT,ze.EXTENT,ze.EXTENT,ze.EXTENT),this.rasterBoundsBuffer=wt.createVertexBuffer(sr,Un.members),this.rasterBoundsSegments=ze.SegmentVector.simpleSegment(0,0,4,2);const Dr=new ze.StructArrayLayout2i4;Dr.emplaceBack(-1,-1),Dr.emplaceBack(1,-1),Dr.emplaceBack(-1,1),Dr.emplaceBack(1,1),this.viewportBuffer=wt.createVertexBuffer(Dr,ze.posAttributes.members),this.viewportSegments=ze.SegmentVector.simpleSegment(0,0,4,2);const Lr=new ze.StructArrayLayout1ui2;Lr.emplaceBack(0),Lr.emplaceBack(1),Lr.emplaceBack(3),Lr.emplaceBack(2),Lr.emplaceBack(0),this.tileBorderIndexBuffer=wt.createIndexBuffer(Lr);const Ur=new ze.StructArrayLayout3ui6;Ur.emplaceBack(0,1,2),Ur.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=wt.createIndexBuffer(Ur),this.emptyTexture=new ze.Texture(wt,{width:1,height:1,data:new Uint8Array([0,0,0,0])},wt.gl.RGBA),this.identityMat=ze.create$1();const qr=this.context.gl;this.stencilClearMode=new ze.StencilMode({func:qr.ALWAYS,mask:0},0,255,qr.ZERO,qr.ZERO,qr.ZERO),this.loadTimeStamps.push(ze.window.performance.now())}clearStencil(){const wt=this.context,Rt=wt.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this.useProgram("clippingMask").draw(wt,Rt.TRIANGLES,ze.DepthMode.disabled,this.stencilClearMode,ze.ColorMode.disabled,ze.CullFaceMode.disabled,si(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(wt,Rt,Xt){if(!(Rt&&this.currentStencilSource!==Rt.id&&wt.isTileClipped()&&Xt&&Xt.length))return;this.currentStencilSource=Rt.id;const sr=this.context,Dr=sr.gl;this.nextStencilID+Xt.length>256&&this.clearStencil(),sr.setColorMode(ze.ColorMode.disabled),sr.setDepthMode(ze.DepthMode.disabled);const Lr=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const wt of Xt){const Rt=this._tileClippingMaskIDs[wt.key]=this.nextStencilID++;Lr.draw(sr,Dr.TRIANGLES,ze.DepthMode.disabled,new ze.StencilMode({func:Dr.ALWAYS,mask:0},Rt,255,Dr.KEEP,Dr.KEEP,Dr.REPLACE),ze.ColorMode.disabled,ze.CullFaceMode.disabled,si(wt.projMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const wt=this.nextStencilID++,Rt=this.context.gl;return new ze.StencilMode({func:Rt.NOTEQUAL,mask:255},wt,255,Rt.KEEP,Rt.KEEP,Rt.REPLACE)}stencilModeForClipping(wt){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(wt);const Rt=this.context.gl;return new ze.StencilMode({func:Rt.EQUAL,mask:255},this._tileClippingMaskIDs[wt.key],0,Rt.KEEP,Rt.KEEP,Rt.REPLACE)}stencilConfigForOverlap(wt){const Rt=this.context.gl,Xt=wt.sort((ze,wt)=>wt.overscaledZ-ze.overscaledZ),sr=Xt[Xt.length-1].overscaledZ,Dr=Xt[0].overscaledZ-sr+1;if(Dr>1){this.currentStencilSource=void 0,this.nextStencilID+Dr>256&&this.clearStencil();const wt={};for(let Xt=0;Xt<Dr;Xt++)wt[Xt+sr]=new ze.StencilMode({func:Rt.GEQUAL,mask:255},Xt+this.nextStencilID,255,Rt.KEEP,Rt.KEEP,Rt.REPLACE);return this.nextStencilID+=Dr,[wt,Xt]}return[{[sr]:ze.StencilMode.disabled},Xt]}colorModeForRenderPass(){const wt=this.context.gl;if(this._showOverdrawInspector){const Rt=1/8;return new ze.ColorMode([wt.CONSTANT_COLOR,wt.ONE],new ze.Color(Rt,Rt,Rt,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?ze.ColorMode.unblended:ze.ColorMode.alphaBlended}depthModeForSublayer(wt,Rt,Xt){if(!this.opaquePassEnabledForLayer())return ze.DepthMode.disabled;const sr=1-((1+this.currentLayer)*this.numSublayers+wt)*this.depthEpsilon;return new ze.DepthMode(Xt||this.context.gl.LEQUAL,Rt,[sr,sr])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(wt,Rt){this.style=wt,this.options=Rt,this.lineAtlas=wt.lineAtlas,this.imageManager=wt.imageManager,this.glyphManager=wt.glyphManager,this.symbolFadeChange=wt.placement.symbolFadeChange(ze.exported.now()),this.imageManager.beginFrame();const Xt=this.style.order,sr=this.style._sourceCaches;for(const ze in sr){const wt=sr[ze];wt.used&&wt.prepare(this.context)}const Dr={},Lr={},Ur={};for(const ze in sr){const wt=sr[ze];Dr[ze]=wt.getVisibleCoordinates(),Lr[ze]=Dr[ze].slice().reverse(),Ur[ze]=wt.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let ze=0;ze<Xt.length;ze++)if(this.style._layers[Xt[ze]].is3D()){this.opaquePassCutoff=ze;break}if(this.terrain&&(this.terrain.updateTileBinding(Ur),this.opaquePassCutoff=0),!ze.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const ze of Xt){const Rt=this.style._layers[ze],Xt=wt._getLayerSourceCache(Rt);if(!Rt.hasOffscreenPass()||Rt.isHidden(this.transform.zoom))continue;const sr=Xt?Lr[Xt.id]:void 0;("custom"===Rt.type||Rt.isSky()||sr&&sr.length)&&this.renderLayer(this,Xt,Rt,sr)}this.depthRangeFor3D=[0,1-(wt.order.length+2)*this.numSublayers*this.depthEpsilon],this.terrain&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&this.terrain.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);let qr=ze.Color.transparent;if(this.style.fog&&(qr=this.style.fog.properties.get("color")),this.context.clear({color:Rt.showOverdrawInspector?ze.Color.black:qr,depth:1}),this.clearStencil(),this._showOverdrawInspector=Rt.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=Xt.length-1;this.currentLayer>=0;this.currentLayer--){const ze=this.style._layers[Xt[this.currentLayer]],Rt=wt._getLayerSourceCache(ze);if(ze.isSky())continue;const sr=Rt?Lr[Rt.id]:void 0;this._renderTileClippingMasks(ze,Rt,sr),this.renderLayer(this,Rt,ze,sr)}if(this.renderPass="sky",this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<Xt.length;this.currentLayer++){const ze=this.style._layers[Xt[this.currentLayer]],Rt=wt._getLayerSourceCache(ze);ze.isSky()&&this.renderLayer(this,Rt,ze,Rt?Lr[Rt.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<Xt.length;){const ze=this.style._layers[Xt[this.currentLayer]],Rt=wt._getLayerSourceCache(ze);if(ze.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(ze)){if(ze.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const sr=Rt?("symbol"===ze.type?Ur:Lr)[Rt.id]:void 0;this._renderTileClippingMasks(ze,Rt,Rt?Dr[Rt.id]:void 0),this.renderLayer(this,Rt,ze,sr),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry){let Rt=null;ze.values(this.style._layers).forEach(ze=>{const Xt=wt._getLayerSourceCache(ze);Xt&&!ze.isHidden(this.transform.zoom)&&(!Rt||Rt.getSource().maxzoom<Xt.getSource().maxzoom)&&(Rt=Xt)}),Rt&&this.options.showTileBoundaries&&ic.debug(this,Rt,Rt.getVisibleCoordinates())}this.options.showPadding&&function(ze){const wt=ze.transform.padding;io(ze,ze.transform.height-(wt.top||0),3,Ll),io(ze,wt.bottom||0,3,Fl),oo(ze,wt.left||0,3,Vl),oo(ze,ze.transform.width-(wt.right||0),3,Gl);const Rt=ze.transform.centerPoint;!function(ze,wt,Rt,Xt){ro(ze,wt-1,Rt-10,2,20,Xt),ro(ze,wt-10,Rt-1,20,2,Xt)}(ze,Rt.x,ze.transform.height-Rt.y,Zl)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%ze.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(ze.window.performance.now()),this.saveCanvasCopy())}renderLayer(ze,wt,Rt,Xt){Rt.isHidden(this.transform.zoom)||("background"===Rt.type||"sky"===Rt.type||"custom"===Rt.type||Xt&&Xt.length)&&(this.id=Rt.id,this.gpuTimingStart(Rt),ic[Rt.type](ze,wt,Rt,Xt,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(ze){if(!this.options.gpuTiming)return;const wt=this.context.extTimerQuery;let Rt=this.gpuTimers[ze.id];Rt||(Rt=this.gpuTimers[ze.id]={calls:0,cpuTime:0,query:wt.createQueryEXT()}),Rt.calls++,wt.beginQueryEXT(wt.TIME_ELAPSED_EXT,Rt.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const ze=this.context.extTimerQuery;ze.endQueryEXT(ze.TIME_ELAPSED_EXT)}collectGpuTimers(){const ze=this.gpuTimers;return this.gpuTimers={},ze}queryGpuTimers(ze){const wt={};for(const Rt in ze){const Xt=ze[Rt],sr=this.context.extTimerQuery,Dr=sr.getQueryObjectEXT(Xt.query,sr.QUERY_RESULT_EXT)/1e6;sr.deleteQueryEXT(Xt.query),wt[Rt]=Dr}return wt}translatePosMatrix(wt,Rt,Xt,sr,Dr){if(!Xt[0]&&!Xt[1])return wt;const Lr=Dr?"map"===sr?this.transform.angle:0:"viewport"===sr?-this.transform.angle:0;if(Lr){const ze=Math.sin(Lr),wt=Math.cos(Lr);Xt=[Xt[0]*wt-Xt[1]*ze,Xt[0]*ze+Xt[1]*wt]}const Ur=[Dr?Xt[0]:z(Rt,Xt[0],this.transform.zoom),Dr?Xt[1]:z(Rt,Xt[1],this.transform.zoom),0],qr=new Float32Array(16);return ze.translate(qr,wt,Ur),qr}saveTileTexture(ze){const wt=this._tileTextures[ze.size[0]];wt?wt.push(ze):this._tileTextures[ze.size[0]]=[ze]}getTileTexture(ze){const wt=this._tileTextures[ze];return wt&&wt.length>0?wt.pop():null}isPatternMissing(ze){if(!ze)return!1;if(!ze.from||!ze.to)return!0;const wt=this.imageManager.getPattern(ze.from.toString()),Rt=this.imageManager.getPattern(ze.to.toString());return!wt||!Rt}currentGlobalDefines(){const ze=this.terrain&&this.terrain.renderingToTexture,wt=this.style&&this.style.fog,Rt=[];return this.terrain&&!this.terrain.renderingToTexture&&Rt.push("TERRAIN"),wt&&!ze&&0!==wt.getOpacity(this.transform.pitch)&&Rt.push("FOG"),ze&&Rt.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&Rt.push("OVERDRAW_INSPECTOR"),Rt}useProgram(ze,wt,Rt){this.cache=this.cache||{};const Xt=Rt||[],sr=this.currentGlobalDefines().concat(Xt),Dr=_i.cacheKey(ze,sr,wt);return this.cache[Dr]||(this.cache[Dr]=new _i(this.context,ze,ss[ze],wt,Cl[ze],sr)),this.cache[Dr]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const ze=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(ze.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=ze.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ze.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}prepareDrawTile(ze){this.terrain&&this.terrain.prepareDrawTile(ze)}prepareDrawProgram(ze,wt,Rt){if(this.terrain&&this.terrain.renderingToTexture)return;const Xt=this.style.fog;if(Xt){const sr=Xt.getOpacity(this.transform.pitch);0!==sr&&wt.setFogUniformValues(ze,((ze,wt,Rt,Xt)=>{const sr=wt.properties.get("color"),Dr=ze.frameCounter/1e3%1,Lr=[sr.r/sr.a,sr.g/sr.a,sr.b/sr.a,Xt];return{u_fog_matrix:Rt?ze.transform.calculateFogTileMatrix(Rt):ze.identityMat,u_fog_range:wt.getFovAdjustedRange(ze.transform._fov),u_fog_color:Lr,u_fog_horizon_blend:wt.properties.get("horizon-blend"),u_fog_temporal_offset:Dr}})(this,Xt,Rt,sr))}}setTileLoadedFlag(ze){this.tileLoaded=ze}saveCanvasCopy(){this.frameCopies.push(this.canvasCopy()),this.tileLoaded=!1}canvasCopy(){const ze=this.context.gl,wt=ze.createTexture();return ze.bindTexture(ze.TEXTURE_2D,wt),ze.copyTexImage2D(ze.TEXTURE_2D,0,ze.RGBA,0,0,ze.drawingBufferWidth,ze.drawingBufferHeight,0),wt}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const ze=this.style&&this.style.fog;return!!ze&&0!==ze.getOpacity(this.transform.pitch)}}class po{constructor(ze=0,wt=0,Rt=0,Xt=0){if(isNaN(ze)||ze<0||isNaN(wt)||wt<0||isNaN(Rt)||Rt<0||isNaN(Xt)||Xt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=ze,this.bottom=wt,this.left=Rt,this.right=Xt}interpolate(wt,Rt,Xt){return null!=Rt.top&&null!=wt.top&&(this.top=ze.number(wt.top,Rt.top,Xt)),null!=Rt.bottom&&null!=wt.bottom&&(this.bottom=ze.number(wt.bottom,Rt.bottom,Xt)),null!=Rt.left&&null!=wt.left&&(this.left=ze.number(wt.left,Rt.left,Xt)),null!=Rt.right&&null!=wt.right&&(this.right=ze.number(wt.right,Rt.right,Xt)),this}getCenter(wt,Rt){const Xt=ze.clamp((this.left+wt-this.right)/2,0,wt),sr=ze.clamp((this.top+Rt-this.bottom)/2,0,Rt);return new ze.pointGeometry(Xt,sr)}equals(ze){return this.top===ze.top&&this.bottom===ze.bottom&&this.left===ze.left&&this.right===ze.right}clone(){return new po(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function mo(ze,wt){return[ze[4*wt],ze[4*wt+1],ze[4*wt+2],ze[4*wt+3]]}function fo(ze,wt,Rt){ze[4*wt+0]=Rt[0],ze[4*wt+1]=Rt[1],ze[4*wt+2]=Rt[2],ze[4*wt+3]=Rt[3]}function go(wt,Rt){const Xt=mo(wt,3);ze.fromQuat(wt,Rt),fo(wt,3,Xt)}function vo(ze,wt){fo(ze,3,[wt[0],wt[1],wt[2],1])}function xo(wt,Rt){const Xt=ze.identity$1([]);return ze.rotateZ$1(Xt,Xt,-Rt),ze.rotateX$1(Xt,Xt,-wt),Xt}function yo(wt,Rt){const Xt=[wt[0],wt[1],0],sr=[Rt[0],Rt[1],0];if(ze.length(Xt)>=1e-15){const wt=ze.normalize([],Xt);ze.scale(sr,wt,ze.dot(sr,wt)),Rt[0]=sr[0],Rt[1]=sr[1]}const Dr=ze.cross([],Rt,wt);if(ze.len(Dr)<1e-15)return null;const Lr=Math.atan2(-Dr[1],Dr[0]);return xo(Math.atan2(Math.sqrt(wt[0]*wt[0]+wt[1]*wt[1]),-wt[2]),Lr)}class bo{constructor(ze,wt){this.position=ze,this.orientation=wt}get position(){return this._position}set position(wt){this._position=this._renderWorldCopies?function(wt){if(!wt)return;const Rt=Array.isArray(wt)?new ze.MercatorCoordinate(wt[0],wt[1],wt[2]):wt;return Rt.x=ze.wrap(Rt.x,0,1),Rt}(wt):wt}lookAtPoint(wt,Rt){if(this.orientation=null,!this.position)return;const Xt=this._elevation?this._elevation.getAtPointOrZero(ze.MercatorCoordinate.fromLngLat(wt)):0,sr=this.position,Dr=ze.MercatorCoordinate.fromLngLat(wt,Xt),Lr=[Dr.x-sr.x,Dr.y-sr.y,Dr.z-sr.z];Rt||(Rt=[0,0,1]),Rt[2]=Math.abs(Rt[2]),this.orientation=yo(Lr,Rt)}setPitchBearing(wt,Rt){this.orientation=xo(ze.degToRad(wt),ze.degToRad(-Rt))}}class wo{constructor(wt,Rt){this._transform=ze.identity([]),this._orientation=ze.identity$1([]),Rt&&(this._orientation=Rt,go(this._transform,this._orientation)),wt&&vo(this._transform,wt)}get mercatorPosition(){const wt=this.position;return new ze.MercatorCoordinate(wt[0],wt[1],wt[2])}get position(){const ze=mo(this._transform,3);return[ze[0],ze[1],ze[2]]}set position(ze){vo(this._transform,ze)}get orientation(){return this._orientation}set orientation(ze){this._orientation=ze,go(this._transform,this._orientation)}getPitchBearing(){const ze=this.forward(),wt=this.right();return{bearing:Math.atan2(-wt[1],wt[0]),pitch:Math.atan2(Math.sqrt(ze[0]*ze[0]+ze[1]*ze[1]),-ze[2])}}setPitchBearing(ze,wt){this._orientation=xo(ze,wt),go(this._transform,this._orientation)}forward(){const ze=mo(this._transform,2);return[-ze[0],-ze[1],-ze[2]]}up(){const ze=mo(this._transform,1);return[-ze[0],-ze[1],-ze[2]]}right(){const ze=mo(this._transform,0);return[ze[0],ze[1],ze[2]]}getCameraToWorld(wt,Rt){const Xt=new Float64Array(16);return ze.invert(Xt,this.getWorldToCamera(wt,Rt)),Xt}getWorldToCameraPosition(wt,Rt,Xt){const sr=this.position;ze.scale(sr,sr,-wt);const Dr=new Float64Array(16);return ze.fromScaling(Dr,[Xt,Xt,Xt]),ze.translate(Dr,Dr,sr),Dr[10]*=Rt,Dr}getWorldToCamera(wt,Rt){const Xt=new Float64Array(16),sr=new Float64Array(4),Dr=this.position;return ze.conjugate(sr,this._orientation),ze.scale(Dr,Dr,-wt),ze.fromQuat(Xt,sr),ze.translate(Xt,Xt,Dr),Xt[1]*=-1,Xt[5]*=-1,Xt[9]*=-1,Xt[13]*=-1,Xt[8]*=Rt,Xt[9]*=Rt,Xt[10]*=Rt,Xt[11
20]*=Rt,Xt}getCameraToClipPerspective(wt,Rt,Xt,sr){const Dr=new Float64Array(16);return ze.perspective(Dr,wt,Rt,Xt,sr),Dr}getDistanceToElevation(wt){const Rt=0===wt?0:ze.mercatorZfromAltitude(wt,this.position[1]),Xt=this.forward();return(Rt-this.position[2])/Xt[2]}clone(){return new wo([...this.position],[...this.orientation])}}class To{constructor(wt,Rt,Xt,sr,Dr){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===Dr||Dr,this._minZoom=wt||0,this._maxZoom=Rt||22,this._minPitch=null==Xt?0:Xt,this._maxPitch=null==sr?60:sr,this.setMaxBounds(),this.width=0,this.height=0,this._center=new ze.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new po,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._camera=new wo,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._horizonShift=.1}clone(){const ze=new To(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return ze._elevation=this._elevation,ze._centerAltitude=this._centerAltitude,ze.tileSize=this.tileSize,ze.latRange=this.latRange,ze.width=this.width,ze.height=this.height,ze.cameraElevationReference=this.cameraElevationReference,ze._center=this._center,ze._setZoom(this.zoom),ze._cameraZoom=this._cameraZoom,ze.angle=this.angle,ze._fov=this._fov,ze._pitch=this._pitch,ze._averageElevation=this._averageElevation,ze._unmodified=this._unmodified,ze._edgeInsets=this._edgeInsets.clone(),ze._camera=this._camera.clone(),ze._calcMatrices(),ze.freezeTileCoverage=this.freezeTileCoverage,ze}get elevation(){return this._elevation}set elevation(ze){this._elevation!==ze&&(this._elevation=ze,ze?this._updateCenterElevation()&&this._updateCameraOnTerrain():(this._cameraZoom=null,this._centerAltitude=0),this._calcMatrices())}updateElevation(ze){this._terrainEnabled()&&null==this._cameraZoom&&this._updateCenterElevation()&&this._updateCameraOnTerrain(),ze&&this._constrainCameraAltitude(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(ze){this._minZoom!==ze&&(this._minZoom=ze,this.zoom=Math.max(this.zoom,ze))}get maxZoom(){return this._maxZoom}set maxZoom(ze){this._maxZoom!==ze&&(this._maxZoom=ze,this.zoom=Math.min(this.zoom,ze))}get minPitch(){return this._minPitch}set minPitch(ze){this._minPitch!==ze&&(this._minPitch=ze,this.pitch=Math.max(this.pitch,ze))}get maxPitch(){return this._maxPitch}set maxPitch(ze){this._maxPitch!==ze&&(this._maxPitch=ze,this.pitch=Math.min(this.pitch,ze))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(ze){void 0===ze?ze=!0:null===ze&&(ze=!1),this._renderWorldCopies=ze}get worldSize(){return this.tileSize*this.scale}get cameraWorldSize(){const ze=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(ze))}get pixelsPerMeter(){return ze.mercatorZfromAltitude(1,this.center.lat)*this.worldSize}get cameraPixelsPerMeter(){return ze.mercatorZfromAltitude(1,this.center.lat)*this.cameraWorldSize}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new ze.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(wt){const Rt=-ze.wrap(wt,-180,180)*Math.PI/180;var Xt;this.angle!==Rt&&(this._unmodified=!1,this.angle=Rt,this._calcMatrices(),this.rotationMatrix=(Xt=new ze.ARRAY_TYPE(4),ze.ARRAY_TYPE!=Float32Array&&(Xt[1]=0,Xt[2]=0),Xt[0]=1,Xt[3]=1,Xt),function(ze,wt,Rt){var Xt=wt[0],sr=wt[1],Dr=wt[2],Lr=wt[3],Ur=Math.sin(Rt),qr=Math.cos(Rt);ze[0]=Xt*qr+Dr*Ur,ze[1]=sr*qr+Lr*Ur,ze[2]=Xt*-Ur+Dr*qr,ze[3]=sr*-Ur+Lr*qr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(wt){const Rt=ze.clamp(wt,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==Rt&&(this._unmodified=!1,this._pitch=Rt,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(ze){ze=Math.max(.01,Math.min(60,ze)),this._fov!==ze&&(this._unmodified=!1,this._fov=ze/180*Math.PI,this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(ze){this._averageElevation=ze,this._calcFogMatrices()}get zoom(){return this._zoom}set zoom(ze){const wt=Math.min(Math.max(ze,this.minZoom),this.maxZoom);this._zoom!==wt&&(this._unmodified=!1,this._setZoom(wt),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._constrain(),this._calcMatrices())}_setZoom(ze){this._zoom=ze,this.scale=this.zoomScale(ze),this.tileZoom=Math.floor(ze),this.zoomFraction=ze-this.tileZoom}_updateCenterElevation(){if(!this._elevation)return!1;const wt=this._elevation.getAtPointOrZero(ze.MercatorCoordinate.fromLngLat(this.center),-1);return-1===wt?(this._cameraZoom=null,!1):(this._centerAltitude=wt,!0)}_updateCameraOnTerrain(){const wt=this.cameraToCenterDistance/this.worldSize,Rt=ze.mercatorZfromAltitude(this._centerAltitude,this.center.lat);this._cameraZoom=this._zoomFromMercatorZ(Rt+wt)}sampleAverageElevation(){if(!this._elevation)return 0;const wt=this._elevation,Rt=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],Xt=this.horizonLineFromTop();let sr=0,Dr=0;for(let Lr=0;Lr<Rt.length;Lr++){const Ur=new ze.pointGeometry(Rt[Lr][0]*this.width,Xt+Rt[Lr][1]*(this.height-Xt)),qr=wt.pointCoordinate(Ur);if(!qr)continue;const ri=1/Math.hypot(qr[0]-this._camera.position[0],qr[1]-this._camera.position[1]);sr+=qr[3]*ri,Dr+=ri}return 0===Dr?NaN:sr/Dr}get center(){return this._center}set center(ze){ze.lat===this._center.lat&&ze.lng===this._center.lng||(this._unmodified=!1,this._center=ze,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCenterElevation()?this._updateCameraOnTerrain():this._cameraZoom=null:this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._cameraZoom||!this._elevation)return;const wt=this._cameraZoom,Rt=this._elevation.getAtPointOrZero(ze.MercatorCoordinate.fromLngLat(this.center)),Xt=ze.mercatorZfromAltitude(Rt,this.center.lat),sr=this._mercatorZfromZoom(wt),Dr=this._mercatorZfromZoom(this._maxZoom),Lr=Math.max(sr-Xt,Dr);this._setZoom(this._zoomFromMercatorZ(Lr))}get padding(){return this._edgeInsets.toJSON()}set padding(ze){this._edgeInsets.equals(ze)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ze,1),this._calcMatrices())}computeZoomRelativeTo(wt){const Rt=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,wt.toAltitude()));let Xt;Xt=wt.z<this._camera.position[2]?[Rt.x,Rt.y,Rt.z]:[wt.x,wt.y,wt.z];
vendor: 4,802 bytes, line 20
20const sr=ze.length(ze.sub([],this._camera.position,Xt));return ze.clamp(this._zoomFromMercatorZ(sr),this._minZoom,this._maxZoom)}setFreeCameraOptions(wt){if(!this.height)return;if(!wt.position&&!wt.orientation)return;this._updateCameraState();let Rt=!1;if(wt.orientation&&!ze.exactEquals(wt.orientation,this._camera.orientation)&&(Rt=this._setCameraOrientation(wt.orientation)),wt.position){const Xt=[wt.position.x,wt.position.y,wt.position.z];ze.exactEquals$1(Xt,this._camera.position)||(this._setCameraPosition(Xt),Rt=!0)}Rt&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const wt=this._camera.position,Rt=new bo;return Rt.position=new ze.MercatorCoordinate(wt[0],wt[1],wt[2]),Rt.orientation=this._camera.orientation,Rt._elevation=this.elevation,Rt._renderWorldCopies=this._renderWorldCopies,Rt}_setCameraOrientation(wt){if(!ze.length$1(wt))return!1;ze.normalize$1(wt,wt);const Rt=ze.transformQuat([],[0,0,-1],wt),Xt=ze.transformQuat([],[0,-1,0],wt);if(Xt[2]<0)return!1;const sr=yo(Rt,Xt);return!!sr&&(this._camera.orientation=sr,!0)}_setCameraPosition(wt){const Rt=this.zoomScale(this.minZoom)*this.tileSize,Xt=this.zoomScale(this.maxZoom)*this.tileSize,sr=this.cameraToCenterDistance;wt[2]=ze.clamp(wt[2],sr/Xt,sr/Rt),this._camera.position=wt}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(ze){return this._edgeInsets.equals(ze)}interpolatePadding(ze,wt,Rt){this._unmodified=!1,this._edgeInsets.interpolate(ze,wt,Rt),this._constrain(),this._calcMatrices()}coveringZoomLevel(ze){const wt=(ze.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/ze.tileSize));return Math.max(0,wt)}getVisibleUnwrappedCoordinates(wt){const Rt=[new ze.UnwrappedTileID(0,wt)];if(this._renderWorldCopies){const Xt=this.pointCoordinate(new ze.pointGeometry(0,0)),sr=this.pointCoordinate(new ze.pointGeometry(this.width,0)),Dr=this.pointCoordinate(new ze.pointGeometry(this.width,this.height)),Lr=this.pointCoordinate(new ze.pointGeometry(0,this.height)),Ur=Math.floor(Math.min(Xt.x,sr.x,Dr.x,Lr.x)),qr=Math.floor(Math.max(Xt.x,sr.x,Dr.x,Lr.x)),ri=1;for(let Xt=Ur-ri;Xt<=qr+ri;Xt++)0!==Xt&&Rt.push(new ze.UnwrappedTileID(Xt,wt))}return Rt}coveringTiles(wt){let Rt=this.coveringZoomLevel(wt);const Xt=Rt,sr=this.elevation&&!wt.isTerrainDEM;if(void 0!==wt.minzoom&&Rt<wt.minzoom)return[];void 0!==wt.maxzoom&&Rt>wt.maxzoom&&(Rt=wt.maxzoom);const Dr=ze.MercatorCoordinate.fromLngLat(this.center),Lr=1<<Rt,Ur=[Lr*Dr.x,Lr*Dr.y,0],qr=_.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,Rt),ri=this.pointCoordinate(this.getCameraPoint()),ai=Lr*ze.mercatorZfromAltitude(1,this.center.lat),Yi=this._camera.position[2]/ze.mercatorZfromAltitude(1,this.center.lat),Ji=[Lr*ri.x,Lr*ri.y,Yi],Qi=this.cameraToCenterDistance/wt.tileSize*(wt.roundZoom?1:.502),kn=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation?Rt:0,jn=wt.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,Un=wt.isTerrainDEM?-jn:this._elevation?this._elevation.getMinElevationBelowMSL():0,x=ze=>({aabb:new p([ze*Lr,0,Un],[(ze+1)*Lr,Lr,jn]),zoom:0,x:0,y:0,wrap:ze,fullyVisible:!1}),Wn=[],Yn=[],Jn=Rt,Qn=wt.reparseOverscaled?Xt:Rt,E=ze=>{if(!this._elevation||!ze.tileID)return;const wt=this._elevation.getMinMaxForTile(ze.tileID),Rt=ze.aabb;wt?(Rt.min[2]=wt.min,Rt.max[2]=wt.max,Rt.center[2]=(Rt.min[2]+Rt.max[2])/2):(ze.shouldSplit=I(ze),ze.shouldSplit||(Rt.min[2]=Rt.max[2]=Rt.center[2]=this._centerAltitude))},C=ze=>ze*ze,Io=C((Yi-this._centerAltitude)*ai),I=ze=>{if(ze.zoom<kn)return!0;if(ze.zoom===Jn)return!1;if(null!=ze.shouldSplit)return ze.shouldSplit;const wt=ze.aabb.distanceX(Ji),Rt=ze.aabb.distanceY(Ji);let Xt=Io;sr&&(Xt=C(ze.aabb.distanceZ(Ji)*ai));const Dr=wt*wt+Rt*Rt+Xt;return Dr<C((1<<Jn-ze.zoom)*Qi*((ze,wt)=>{if(wt*C(.707)<ze)return 1;const Rt=Math.sqrt(wt/ze);return Rt/(1.4144271570014144+(Math.pow(1.1,Rt-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(Xt,Io),Dr))};if(this._renderWorldCopies)for(let ze=1;ze<=3;ze++)Wn.push(x(-ze)),Wn.push(x(ze));for(Wn.push(x(0));Wn.length>0;){const Xt=Wn.pop(),Dr=Xt.x,Lr=Xt.y;let ri=Xt.fullyVisible;if(!ri){const ze=Xt.aabb.intersects(qr);if(0===ze)continue;ri=2===ze}if(Xt.zoom!==Jn&&I(Xt))for(let wt=0;wt<4;wt++){const Rt=(Dr<<1)+wt%2,Ur=(Lr<<1)+(wt>>1),qr={aabb:Xt.aabb.quadrant(wt),zoom:Xt.zoom+1,x:Rt,y:Ur,wrap:Xt.wrap,fullyVisible:ri,tileID:void 0,shouldSplit:void 0};sr&&(qr.tileID=new ze.OverscaledTileID(Xt.zoom+1===Jn?Qn:Xt.zoom+1,Xt.wrap,Xt.zoom+1,Rt,Ur),E(qr)),Wn.push(qr)}else{const sr=Xt.zoom===Jn?Qn:Xt.zoom;if(wt.minzoom&&wt.minzoom>sr)continue;const qr=Ur[0]-(.5+Dr+(Xt.wrap<<Xt.zoom))*(1<<Rt-Xt.zoom),ri=Ur[1]-.5-Lr,ai=Xt.t
20ileID?Xt.tileID:new ze.OverscaledTileID(sr,Xt.wrap,Xt.zoom,Dr,Lr);Yn.push({tileID:ai,distanceSq:qr*qr+ri*ri})}}if(this.fogCullDistSq){const wt=this.fogCullDistSq;Yn.splice(0,Yn.length,...Yn.filter(Rt=>{const Xt=[0,0,0,1],Dr=[ze.EXTENT,ze.EXTENT,0,1],Lr=this.calculateFogTileMatrix(Rt.tileID.toUnwrapped());ze.transformMat4(Xt,Xt,Lr),ze.transformMat4(Dr,Dr,Lr);const Ur=ze.getAABBPointSquareDist(Xt,Dr);if(0===Ur)return!0;let qr=!1;const ri=this.horizonLineFromTop();if(Ur>wt&&0!==ri){const wt=this.calculateProjMatrix(Rt.tileID.toUnwrapped());let Xt;sr&&this._elevation&&(Xt=this._elevation.getMinMaxForTile(Rt.tileID)),Xt||(Xt={min:Un,max:jn});const Dr=ze.furthestTileCorner(this.bearing),Lr=[Dr[0]*ze.EXTENT,Dr[1]*ze.EXTENT,Xt.max];ze.transformMat4$1(Lr,Lr,wt),qr=(1-Lr[1])*this.height*.5<ri}return Ur<wt||qr}))}return Yn.sort((ze,wt)=>ze.distanceSq-wt.distanceSq).map(ze=>ze.tileID)}resize(ze,wt){this.width=ze,this.height=wt,this.pixelsToGLUnits=[2/ze,-2/wt],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(ze){return Math.pow(2,ze)}scaleZoom(ze){return Math.log(ze)/Math.LN2}project(wt){const Rt=ze.clamp(wt.lat,-this.maxValidLatitude,this.maxValidLatitude);return new ze.pointGeometry(ze.mercatorXfromLng(wt.lng)*this.worldSize,ze.mercatorYfromLat(Rt)*this.worldSize)}unproject(wt){return new ze.MercatorCoordinate(wt.x/this.worldSize,wt.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(wt,Rt){const Xt=this.pointCoordinate(Rt),sr=this.pointCoordinate(this.centerPoint),Dr=this.locationCoordinate(wt),Lr=new ze.MercatorCoordinate(Dr.x-(Xt.x-sr.x),Dr.y-(Xt.y-sr.y));this.center=this.coordinateLocation(Lr),this._renderWorldCopies&&
20(this.center=this.center.wrap())}setLocation(ze){this.center=this.coordinateLocation(ze),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(ze){return this._coordinatePoint(this.locationCoordinate(ze),!1)}locationPoint3D(ze){return this._coordinatePoint(this.locationCoordinate(ze),!0)}pointLocation(ze){return this.coordinateLocation(this.pointCoordinate(ze))}pointLocation3D(ze){return this.coordinateLocation(this.pointCoordinate3D(ze))}locationCoordinate(wt){return ze.MercatorCoordinate.fromLngLat(wt)}coordinateLocation(ze){return ze.toLngLat()}pointRayIntersection(wt,Rt){const Xt=null!=Rt?Rt:this._centerAltitude,sr=[wt.x,wt.y,0,1],Dr=[wt.x,wt.y,1,1];ze.transformMat4(sr,sr,this.pixelMatrixInverse),ze.transformMat4(Dr,Dr,this.pixelMatrixInverse);const Lr=Dr[3];ze.scale$2(sr,sr,1/sr[3]),ze.scale$2(Dr,Dr,1/Lr);const Ur=sr[2],qr=Dr[2];return{p0:sr,p1:Dr,t:Ur===qr?0:(Xt-Ur)/(qr-Ur)}}screenPointToMercatorRay(wt){const Rt=[wt.x,wt.y,0,1],Xt=[wt.x,wt.y,1,1];return ze.transformMat4(Rt,Rt,this.pixelMatrixInverse),ze.transformMat4(Xt,Xt,this.pixelMatrixInverse),ze.scale$2(Rt,Rt,1/Rt[3]),ze.scale$2(Xt,Xt,1/Xt[3]),Rt[2]=ze.mercatorZfromAltitude(Rt[2],this._center.lat)*this.worldSize,Xt[2]=ze.mercatorZfromAltitude(Xt[2],this._center.lat)*this.worldSize,ze.scale$2(Rt,Rt,1/this.worldSize),ze.scale$2(Xt,Xt,1/this.worldSize),new u([Rt[0],Rt[1],Rt[2]],ze.normalize([],ze.sub([],Xt,Rt)))}rayIntersectionCoordinate(wt){const{p0:Rt,p1:Xt,t:sr}=wt,Dr=ze.mercatorZfromAltitude(Rt[2],this._center.lat),Lr=ze.mercatorZfromAltitude(Xt[2],this._center.lat);return new ze.MercatorCoordinate(ze.number(Rt[0],Xt[0],sr)/this.worldSize,ze.number(Rt[1],Xt[1],sr)/this.worldSize,ze.number(Dr,Lr,sr))}pointCoordinate(wt){const Rt=this.horizonLineFromTop(!1),Xt=new ze.pointGeometry(wt.x,Math.max(Rt,wt.y));return this.rayIntersectionCoordinate(this.pointRayIntersection(Xt))}pointCoordinate3D(wt){if(!this.elevation)return this.pointCoordinate(wt);const Rt=this.elevation;let Xt=this.elevation.pointCoordinate(wt);if(Xt)return new ze.MercatorCoordinate(Xt[0],Xt[1],Xt[2]);let sr=0,Dr=this.horizonLineFromTop();if(wt.y>Dr)return this.pointCoordinate(wt);const Lr=.02*Dr,Ur=wt.clone();for(let wt=0;wt<10&&Dr-sr>Lr;wt++){Ur.y=ze.number(sr,Dr,.66);const wt=Rt.pointCoordinate(Ur);wt?(Dr=Ur.y,Xt=wt):sr=Ur.y}return Xt?new ze.MercatorCoordinate(Xt[0],Xt[1],Xt[2]):this.pointCoordinate(wt)}isPointAboveHorizon(ze){if(this.elevation)return!this.elevation.pointCoordinate(ze);{const wt=this.horizonLineFromTop();return ze.y<wt}}_coordinatePoint(wt,Rt){const Xt=Rt&&this.elevation?this.elevation.getAtPointOrZero(wt,this._centerAltitude):this._centerAltitude,sr=[wt.x*this.worldSize,wt.y*this.worldSize,Xt+wt.toAltitude(),1];return ze.transformMat4(sr,sr,this.pixelMatrix),sr[3]>0?new ze.pointGeometry(sr[0]/sr[3],sr[1]/sr[3]):new ze.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE)}getBounds(){return this._terrainEnabled()?this._getBounds3D():(new ze.LngLatBounds).extend(this.pointLocation(new ze.pointGeometry(this._edgeInsets.left,this._edgeInsets.top))).extend(this.pointLocation(new ze.pointGeometry(this.width-this._edgeInsets.right,this._edgeInsets.top))).extend(this.pointLocation(new ze.pointGeometry(this.width-this._edgeInsets.right,this.height-this._edgeInsets.bottom))).extend(this.pointLocation(new ze.pointGeometry(this._edgeInsets.left,this.height-this._edgeInsets.bottom)))}_getBounds3D(){const wt=this.elevation,Rt=wt.visibleDemTiles.reduce((ze,wt)=>{if(wt.dem){const Rt=wt.dem.tree;ze.min=Math.min(ze.min,Rt.minimums[0]),ze.max=Math.max(ze.max,Rt.maximums[0])}return ze},{min:Number.MAX_VALUE,max:0});Rt.min*=wt.exaggeration(),Rt.max*=wt.exaggeration();const Xt=this.horizonLineFromTop();return[new ze.pointGeometry(0,Xt),new ze.pointGeometry(this.width,Xt),new ze.pointGeometry(this.width,this.height),new ze.pointGeometry(0,this.height)].reduce((ze,wt)=>ze.extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(wt,Rt.min)))).extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(wt,Rt.max)))),new ze.LngLatBounds)}horizonLineFromTop(ze=!0){const wt=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,Rt=this.height/2-.97*wt;return ze?Math.max(0,Rt):Rt}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new ze.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(ze){ze?(this.lngRange=[ze.getWest(),ze.getEast()],this.latRange=[ze.getSouth(),ze.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(wt,Rt){const Xt=wt.canonical,sr=Rt/this.zoomScale(Xt.z),Dr=Xt.x+Math.pow(2,Xt.z)*wt.wrap,Lr=ze.identity(new Float64Array(16));return ze.translate(Lr,Lr,[Dr*sr,Xt.y*sr,0]),ze.scale$1(Lr,Lr,[sr/ze.EXTENT,sr/ze.EXTENT,1]),Lr}calculateFogTileMatrix(wt){const Rt=wt.key,Xt=this._fogTileMatrixCache;if(Xt[Rt])return Xt[Rt];const sr=this.calculatePosMatrix(wt,this.cameraWorldSize);return ze.multiply(sr,this.worldToFogMatrix,sr),Xt[Rt]=new Float32Array(sr),Xt[Rt]}calculateProjMatrix(wt,Rt=!1){const Xt=wt.key,sr=Rt?this._alignedProjMatrixCache:this._projMatrixCache;if(sr[Xt])return sr[Xt];const Dr=this.calculatePosMatrix(wt,this.worldSize);return ze.multiply(Dr,Rt?this.alignedProjMatrix:this.projMatrix,Dr),sr[Xt]=new Float32Array(Dr),sr[Xt]}customLayerMatrix(){return this.mercatorMatrix.slice()}recenterOnTerrain(){if(!this._elevation)return;const wt=this._elevation;this._updateCameraState();
20const Rt=this._camera.position,Xt=this._camera.forward();if(Rt[2]<=0||Xt[2]>=0)return;const sr=ze.mercatorZfromAltitude(1,this._center.lat);Rt[2]/=sr,Xt[2]/=sr,ze.normalize(Xt,Xt);const Dr=wt.raycast(Rt,Xt,wt.exaggeration());if(Dr){const wt=ze.scaleAndAdd([],Rt,Xt,Dr),sr=new ze.MercatorCoordinate(wt[0],wt[1],ze.mercatorZfromAltitude(wt[2],ze.latFromMercatorY(wt[1]))),Lr=this._camera.position,Ur=sr.z+ze.length([sr.x-Lr[0],sr.y-Lr[1],sr.z-Lr[2]]);this._cameraZoom=this._zoomFromMercatorZ(Ur),this._centerAltitude=sr.toAltitude(),this._center=sr.toLngLat(),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCameraAltitude(){if(!this._elevation)return;const wt=this._elevation;this._updateCameraState();const Rt=wt.getAtPointOrZero(this._camera.mercatorPosition),Xt=this._minimumHeightOverTerrain()*Math.cos(ze.degToRad(this._maxPitch)),sr=ze.mercatorZfromAltitude(Rt,this._center.lat),Dr=this._camera.position[2]-sr;if(Dr<Xt){const wt=ze.MercatorCoordinate.fromLngLat(this._center,this._centerAltitude),Rt=this._camera.mercatorPosition,sr=[wt.x-Rt.x,wt.y-Rt.y,wt.z-Rt.z],Lr=ze.length(sr);sr[2]-=Xt-Dr;const Ur=ze.length(sr);if(0===Ur)return;ze.scale(sr,sr,Lr/Ur),this._camera.position=[wt.x-sr[0],wt.y-sr[1],wt.z-sr[2]],this._camera.orientation=yo(sr,this._camera.up()),this._updateStateFromCamera()}}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let wt,Rt,Xt,sr,Dr=-90,Lr=90,Ur=-180,qr=180;const ri=this.size,ai=this._unmodified;if(this.latRange){const Rt=this.latRange;Dr=ze.mercatorYfromLat(Rt[1])*this.worldSize,Lr=ze.mercatorYfromLat(Rt[0])*this.worldSize,wt=Lr-Dr<ri.y?ri.y/(Lr-Dr):0}if(this.lngRange){const wt=this.lngRange;Ur=ze.mercatorXfromLng(wt[0])*this.worldSize,qr=ze.mercatorXfromLng(wt[1])*this.worldSize,Rt=qr-Ur<ri.x?ri.x/(qr-Ur):0}const Yi=this.point,Ji=Math.max(Rt||0,wt||0);if(Ji)return this.center=this.unproject(new ze.pointGeometry(Rt?(qr+Ur)/2:Yi.x,wt?(Lr+Dr)/2:Yi.y)),this.zoom+=this.scaleZoom(Ji),this._unmodified=ai,void(this._constraining=!1);if(this.latRange){const ze=Yi.y,wt=ri.y/2;ze-wt<Dr&&(sr=Dr+wt),ze+wt>Lr&&(sr=Lr-wt)}if(this.lngRange){const ze=Yi.x,wt=ri.x/2;ze-wt<Ur&&(Xt=Ur+wt),ze+wt>qr&&(Xt=qr-wt)}void 0===Xt&&void 0===sr||(this.center=this.unproject(new ze.pointGeometry(void 0!==Xt?Xt:Yi.x,void 0!==sr?sr:Yi.y))),this._constrainCameraAltitude(),this._unmodified=ai,this._constraining=!1}_minZoomForBounds(){const e=(ze,wt)=>Math.log2(ze/(this.tileSize*Math.abs(wt[1]-wt[0])));let wt=0;if(this.latRange){const Rt=this.latRange;wt=e(this.height,[ze.mercatorYfromLat(Rt[0]),ze.mercatorYfromLat(Rt[1])])}let Rt=0;if(this.lngRange){const wt=this.lngRange;Rt=e(this.width,[ze.mercatorXfromLng(wt[0]),ze.mercatorXfromLng(wt[1])])}return Math.max(wt,Rt)}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const wt=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;const Rt=this.pixelsPerMeter;this._updateCameraState();const Xt=Math.PI/2+this._pitch,sr=this.fovAboveCenter,Dr=this.elevation?this.elevation.getMinElevationBelowMSL()*Rt:0,Lr=(this._camera.position[2]*this.worldSize-Dr)/Math.cos(this._pitch),Ur=Math.sin(sr)*Lr/Math.sin(ze.clamp(Math.PI-Xt-sr,.01,Math.PI-.01)),qr=this.point,ri=qr.x,ai=qr.y,Yi=Math.cos(Math.PI/2-this._pitch)*Ur+Lr,Ji=Math.min(1.01*Yi,Lr*(1/this._horizonShift)),Qi=this.height/50,kn=this._camera.getWorldToCamera(this.worldSize,Rt),jn=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,Qi,Ji);jn[8]=2*-wt.x/this.width,jn[9]=2*wt.y/this.height;let Un=ze.mul$1([],jn,kn);this.mercatorMatrix=ze.scale$1([],Un,[this.worldSize,this.worldSize,this.worldSize/Rt]),this.projMatrix=Un,this.invProjMatrix=ze.invert(new Float64Array(16),this.projMatrix);const Wn=new Float32Array(16);ze.identity(Wn),ze.scale$1(Wn,Wn,[1,-1,1]),ze.rotateX(Wn,Wn,this._pitch),ze.rotateZ(Wn,Wn,this.angle);const Yn=ze.perspective(new Float32Array(16),this._fov,this.width/this.height,Qi,Ji),Jn=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;Yn[8]=2*-wt.x/this.width,Yn[9]=2*(wt.y+Jn)/this.height,this.skyboxMatrix=ze.multiply(Wn,Yn,Wn);const Qn=this.width%2/2,Io=this.height%2/2,Mo=Math.cos(this.angle),jo=Math.sin(this.angle),zo=ri-Math.round(ri)+Mo*Qn+jo*Io,oa=ai-Math.round(ai)+Mo*Io+jo*Qn,la=new Float64Array(Un);if(ze.translate(la,la,[zo>.5?zo-1:zo,oa>.5?oa-1:oa,0]),this.alignedProjMatrix=la,Un=ze.create$1(),ze.scale$1(Un,Un,[this.width/2,-this.height/2,1]),ze.translate(Un,Un,[1,-1,0]),this.labelPlaneMatr
20ix=Un,Un=ze.create$1(),ze.scale$1(Un,Un,[1,-1,1]),ze.translate(Un,Un,[-1,-1,0]),ze.scale$1(Un,Un,[2/this.width,2/this.height,1]),this.glCoordMatrix=Un,this.pixelMatrix=ze.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),Un=ze.invert(new Float64Array(16),this.pixelMatrix),!Un)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Un,this._projMatrixCache={},this._alignedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const wt=this.cameraWorldSize,Rt=this.cameraPixelsPerMeter,Xt=this._camera.position,sr=1/this.height,Dr=[wt,wt,Rt];ze.scale(Dr,Dr,sr),ze.scale(Xt,Xt,-1),ze.multiply$1(Xt,Xt,Dr);const Lr=ze.create$1();ze.translate(Lr,Lr,Xt),ze.scale$1(Lr,Lr,Dr),this.mercatorFogMatrix=Lr,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(wt,Rt,sr)}_updateCameraState(){if(!this.height)return;this._camera.setPitchBearing(this._pitch,this.angle);const wt=this._camera.forward(),Rt=this.cameraToCenterDistance,Xt=this.point,sr=this._mercatorZfromZoom(this._cameraZoom?this._cameraZoom:this._zoom)-ze.mercatorZfromAltitude(this._centerAltitude,this.center.lat),Dr=this.cameraToCenterDistance/sr;this._camera.position=[Xt.x/this.worldSize-wt[0]*Rt/Dr,Xt.y/this.worldSize-wt[1]*Rt/Dr,ze.mercatorZfromAltitude(this._centerAltitude,this._center.lat)+-wt[2]*Rt/Dr]}_translateCameraConstrained(wt){const Rt=this._maxCameraBoundsDistance()*Math.cos(this._pitch),Xt=wt[2];let sr=1;Xt>0&&(sr=Math.min((Rt-this._camera.position[2])/Xt,1)),this._camera.position=ze.scaleAndAdd([],this._camera.position,wt,sr),this._updateStateFromCamera()}_updateStateFromCamera(){const wt=this._camera.position,Rt=this._camera.forward(),{pitch:Xt,bearing:sr}=this._camera.getPitchBearing(),Dr=ze.mercatorZfromAltitude(this._centerAltitude,this.center.lat),Lr=this._mercatorZfromZoom(this._maxZoom)*Math.cos(ze.degToRad(this._maxPitch)),Ur=Math.max((wt[2]-Dr)/Math.cos(Xt),Lr),qr=this._zoomFromMercatorZ(Ur);ze.scaleAndAdd(wt,wt,Rt,Ur),this._pitch=ze.clamp(Xt,ze.degToRad(this.minPitch),ze.degToRad(this.maxPitch)),this.angle=ze.wrap(sr,-Math.PI,Math.PI),this._setZoom(ze.clamp(qr,this._minZoom,this._maxZoom)),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._center=new ze.MercatorCoordinate(wt[0],wt[1],wt[2]).toLngLat(),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(ze){return Math.pow(2,ze)*this.tileSize}_mercatorZfromZoom(ze){return this.cameraToCenterDistance/this._worldSizeFromZoom(ze)}_minimumHeightOverTerrain(){const ze=Math.min((null!=this._cameraZoom?this._cameraZoom:this._zoom)+2,this._maxZoom);return this._mercatorZfromZoom(ze)}_zoomFromMercatorZ(ze){return this.scaleZoom(this.cameraToCenterDistance/(ze*this.tileSize))}_terrainEnabled(){return!!this._elevation}isHorizonVisibleForPoints(wt,Rt){const Xt=Math.min(wt.x,Rt.x),sr=Math.max(wt.x,Rt.x),Dr=Math.min(wt.y,Rt.y),Lr=Math.max(wt.y,Rt.y),Ur=[new ze.pointGeometry(Xt,Dr),new ze.pointGeometry(sr,Lr),new ze.pointGeometry(Xt,Lr),new ze.pointGeometry(sr,Dr)],qr=this._renderWorldCopies?-3:0,ri=this._renderWorldCopies?4:1;for(const ze of Ur){const wt=this.pointRayIntersection(ze);if(wt.t<0)return!0;const Rt=this.rayIntersectionCoordinate(wt);if(Rt.x<qr||Rt.y<0||Rt.x>ri||Rt.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+ze.radToDeg(this.fovAboveCenter)>88||this.isHorizonVisibleForPoints(new ze.pointGeometry(0,0),new ze.pointGeometry(this.width,this.height))}zoomDeltaToMovement(wt,Rt){const Xt=ze.length(ze.sub([],this._camera.position,wt)),sr=this._zoomFromMercatorZ(Xt)+Rt;return Xt-this._mercatorZfromZoom(sr)}getCameraPoint(){const wt=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new ze.pointGeometry(0,wt))}}function Eo(ze,wt){let Rt=!1,Xt=null;const r=()=>{Xt=null,Rt&&(ze(),Xt=setTimeout(r,wt),Rt=!1)};return()=>(Rt=!0,Xt||r(),Xt)}class Co{constructor(wt){this._hashName=wt&&encodeURIComponent(wt),ze.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Eo(this._updateHashUnthrottled.bind(this),300)}addTo(wt){return this._map=wt,ze.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return ze.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(wt){const Rt=this._map.getCenter(),Xt=Math.round(100*this._map.getZoom())/100,sr=Math.ceil((Xt*Math.LN2+Math.log(512/360/.5))/Math.LN10),Dr=Math.pow(10,sr),Lr=Math.round(Rt.lng*Dr)/Dr,Ur=
vendor: 30,532 bytes, line 20
20Math.round(Rt.lat*Dr)/Dr,qr=this._map.getBearing(),ri=this._map.getPitch();let ai="";if(ai+=wt?`/${Lr}/${Ur}/${Xt}`:`${Xt}/${Ur}/${Lr}`,(qr||ri)&&(ai+="/"+Math.round(10*qr)/10),ri&&(ai+=`/${Math.round(ri)}`),this._hashName){const wt=this._hashName;let Rt=!1;const Xt=ze.window.location.hash.slice(1).split("&").map(ze=>{const Xt=ze.split("=")[0];return Xt===wt?(Rt=!0,`${Xt}=${ai}`):ze}).filter(ze=>ze);return Rt||Xt.push(`${wt}=${ai}`),`#${Xt.join("&")}`}return`#${ai}`}_getCurrentHash(){const wt=ze.window.location.hash.replace("#","");if(this._hashName){let ze;return wt.split("&").map(ze=>ze.split("=")).forEach(wt=>{wt[0]===this._hashName&&(ze=wt)}),(ze&&ze[1]||"").split("/")}return wt.split("/")}_onHashChange(){const ze=this._getCurrentHash();if(ze.length>=3&&!ze.some(ze=>isNaN(ze))){const wt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ze[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ze[2],+ze[1]],zoom:+ze[0],bearing:wt,pitch:+(ze[4]||0)}),!0}return!1}_updateHashUnthrottled(){const wt=ze.window.location.href.replace(/(#.+)?$/,this.getHashString());ze.window.history.replaceState(ze.window.history.state,null,wt)}}const lc={linearity:.3,easing:ze.bezier(0,0,.3,1)},uc=ze.extend({deceleration:2500,maxSpeed:1400},lc),Ec=ze.extend({deceleration:20,maxSpeed:1400},lc),Mc=ze.extend({deceleration:1e3,maxSpeed:360},lc),Bc=ze.extend({deceleration:1e3,maxSpeed:90},lc);class Ao{constructor(ze){this._map=ze,this.clear()}clear(){this._inertiaBuffer=[]}record(wt){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:ze.exported.now(),settings:wt})}_drainInertiaBuffer(){const wt=this._inertiaBuffer,Rt=ze.exported.now();for(;wt.length>0&&Rt-wt[0].time>160;)wt.shift()}_onMoveEnd(wt){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const Rt={zoom:0,bearing:0,pitch:0,pan:new ze.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:ze}of this._inertiaBuffer)Rt.zoom+=ze.zoomDelta||0,Rt.bearing+=ze.bearingDelta||0,Rt.pitch+=ze.pitchDelta||0,ze.panDelta&&Rt.pan._add(ze.panDelta),ze.around&&(Rt.around=ze.around),ze.pinchAround&&(Rt.pinchAround=ze.pinchAround);const Xt=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,sr={};if(Rt.pan.mag()){const Dr=Lo(Rt.pan.mag(),Xt,ze.extend({},uc,wt||{}));sr.offset=Rt.pan.mult(Dr.amount/Rt.pan.mag()),sr.center=this._map.transform.center,Po(sr,Dr)}if(Rt.zoom){const ze=Lo(Rt.zoom,Xt,Ec);sr.zoom=this._map.transform.zoom+ze.amount,Po(sr,ze)}if(Rt.bearing){const wt=Lo(Rt.bearing,Xt,Mc);sr.bearing=this._map.transform.bearing+ze.clamp(wt.amount,-179,179),Po(sr,wt)}if(Rt.pitch){const ze=Lo(Rt.pitch,Xt,Bc);sr.pitch=this._map.transform.pitch+ze.amount,Po(sr,ze)}if(sr.zoom||sr.bearing){const ze=void 0===Rt.pinchAround?Rt.around:Rt.pinchAround;sr.around=ze?this._map.unproject(ze):this._map.getCenter()}return this.clear(),ze.extend(sr,{noMoveStart:!0})}}function Po(ze,wt){(!ze.duration||ze.duration<wt.duration)&&(ze.duration=wt.duration,ze.easing=wt.easing)}function Lo(wt,Rt,Xt){const{maxSpeed:sr,linearity:Dr,deceleration:Lr}=Xt,Ur=ze.clamp(wt*Dr/(Rt/1e3),-sr,sr),qr=Math.abs(Ur)/(Lr*Dr);return{easing:Xt.easing,duration:1e3*qr,amount:Ur*(qr/2)}}class Ro extends ze.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(wt,Rt,sr,Dr={}){const Lr=Xt.mousePos(Rt.getCanvasContainer(),sr),Ur=Rt.unproject(Lr);super(wt,ze.extend({point:Lr,lngLat:Ur,originalEvent:sr},Dr)),this._defaultPrevented=!1,this.target=Rt}}class ko extends ze.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(wt,Rt,sr){const Dr="touchend"===wt?sr.changedTouches:sr.touches,Lr=Xt.touchPos(Rt.getCanvasContainer(),Dr),Ur=Lr.map(ze=>Rt.unproject(ze)),qr=Lr.reduce((ze,wt,Rt,Xt)=>ze.add(wt.div(Xt.length)),new ze.pointGeometry(0,0));super(wt,{points:Lr,point:qr,lngLats:Ur,lngLat:Rt.unproject(qr),originalEvent:sr}),this._defaultPrevented=!1}}class Fo extends ze.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(ze,wt,Rt){super(ze,{originalEvent:Rt}),this._defaultPrevented=!1}}class Bo{constructor(ze,wt){this._map=ze,this._clickTolerance=wt.clickTolerance}reset(){delete this._mousedownPos}wheel(ze){return this._firePreventable(new Fo(ze.type,this._map,ze))}mousedown(ze,wt){return this._mousedownPos=wt,this._firePreventable(new Ro(ze.type,this._map,ze))}mouseup(ze){this._map.fire(new Ro(ze.type,this._map,ze))}click(ze,wt){this._mousedownPos&&this._mousedownPos.dist(wt)>=this._clickTolerance||this._map.fire(new Ro(ze.type,this._map,ze))}dblclick(ze){return this._firePreventable(new Ro(ze.type,this._map,ze))}mouseover(ze){this._map.fire(new Ro(ze.type,this._map,ze))}mouseout(ze){this._map.fire(new Ro(ze.type,this._map,ze))}touchstart(ze){return this._firePreventable(new ko(ze.type,this._map,ze))}touchmove(ze){this._map.fire(new ko(ze.type,this._map,ze))}touchend(ze){this._map.fire(new ko(ze.type,this._map,ze))}touchcancel(ze){this._map.fire(new ko(ze.type,this._map,ze))}_firePreventable(ze){if(this._map.fire(ze),ze.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Oo{constructor(ze){this._map=ze}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(ze){this._map.fire(new Ro(ze.type,this._map,ze))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ro("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(ze){this._delayContextMenu?this._contextMenuEvent=ze:this._map.fire(new Ro(ze.type,this._map,ze)),this._map.listens("contextmenu")&&ze.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uo{constructor(ze,wt){this._map=ze,this._el=ze.getCanvasContainer(),this._container=ze.getContainer(),this._clickTolerance=wt.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(ze,wt){this.isEnabled()&&ze.shiftKey&&0===ze.button&&(Xt.disableDrag(),this._startPos=this._lastPos=wt,this._active=!0)}mousemoveWindow(ze,wt){if(!this._active)return;const Rt=wt;if(this._lastPos.equals(Rt)||!this._box&&Rt.dist(this._startPos)<this._clickTolerance)return;const sr=this._startPos;this._lastPos=Rt,this._box||(this._box=Xt.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",ze));const Dr=Math.min(sr.x,Rt.x),Lr=Math.max(sr.x,Rt.x),Ur=Math.min(sr.y,Rt.y),qr=Math.max(sr.y,Rt.y);this._map._requestDomTask(()=>{this._box&&(Xt.setTransform(this._box,`translate(${Dr}px,${Ur}px)`),this._box.style.width=Lr-Dr+"px",this._box.style.height=qr-Ur+"px")})}mouseupWindow(wt,Rt){if(!this._active)return;if(0!==wt.button)return;const sr=this._startPos,Dr=Rt;if(this.reset(),Xt.suppressClick(),sr.x!==Dr.x||sr.y!==Dr.y)return this._map.fire(new ze.Event("boxzoomend",{originalEvent:wt})),{cameraAnimation:ze=>ze.fitScreenCoordinates(sr,Dr,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",wt)}keydown(ze){this._active&&27===ze.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",ze))}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(Xt.remove(this._box),this._box=null),Xt.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(wt,Rt){return this._map.fire(new ze.Event(wt,{originalEvent:Rt}))}}function No(ze,wt){const Rt={};for(let Xt=0;Xt<ze.length;Xt++)Rt[ze[Xt].identifier]=wt[Xt];return Rt}class Go{constructor(ze){this.reset(),this.numTouches=ze.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(wt,Rt,Xt){(this.centroid||Xt.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=wt.timeStamp),Xt.length===this.numTouches&&(this.centroid=function(wt){const Rt=new ze.pointGeometry(0,0);for(const ze of wt)Rt._add(ze);return Rt.div(wt.length)}(Rt),this.touches=No(Xt,Rt)))}touchmove(ze,wt,Rt){if(this.aborted||!this.centroid)return;const Xt=No(Rt,wt);for(const ze in this.touches){const wt=this.touches[ze],Rt=Xt[ze];(!Rt||Rt.dist(wt)>30)&&(this.aborted=!0)}}touchend(ze,wt,Rt){if((!this.centroid||ze.timeStamp-this.startTime>500)&&(this.aborted=!0),0===Rt.length){const ze=!this.aborted&&this.centroid;if(this.reset(),ze)return ze}}}class Zo{constructor(ze){this.singleTap=new Go(ze),this.numTaps=ze.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(ze,wt,Rt){this.singleTap.touchstart(ze,wt,Rt)}touchmove(ze,wt,Rt){this.singleTap.touchmove(ze,wt,Rt)}touchend(ze,wt,Rt){const Xt=this.singleTap.touchend(ze,wt,Rt);if(Xt){const wt=ze.timeStamp-this.lastTime<500,Rt=!this.lastTap||this.lastTap.dist(Xt)<30;if(wt&&Rt||this.reset(),this.count++,this.lastTime=ze.timeStamp,this.lastTap=Xt,this.count===this.numTaps)return this.reset(),Xt}}}class Vo{constructor(){this._zoomIn=new Zo({numTouches:1,numTaps:2}),this._zoomOut=new Zo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(ze,wt,Rt){this._zoomIn.touchstart(ze,wt,Rt),this._zoomOut.touchstart(ze,wt,Rt)}touchmove(ze,wt,Rt){this._zoomIn.touchmove(ze,wt,Rt),this._zoomOut.touchmove(ze,wt,Rt)}touchend(ze,wt,Rt){const Xt=this._zoomIn.touchend(ze,wt,Rt),sr=this._zoomOut.touchend(ze,wt,Rt);return Xt?(this._active=!0,ze.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:wt=>wt.easeTo({duration:300,zoom:wt.getZoom()+1,around:wt.unproject(Xt)},{originalEvent:ze})}):sr?(this._active=!0,ze.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:wt=>wt.easeTo({duration:300,zoom:wt.getZoom()-1,around:wt.unproject(sr)},{originalEvent:ze})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Vc={0:1,2:2};class qo{constructor(ze){this.reset(),this._clickTolerance=ze.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(ze,wt){return!1}_move(ze,wt){return{}}mousedown(ze,wt){if(this._lastPoint)return;const Rt=Xt.mouseButton(ze);this._correctButton(ze,Rt)&&(this._lastPoint=wt,this._eventButton=Rt)}mousemoveWindow(ze,wt){const Rt=this._lastPoint;if(Rt)if(ze.preventDefault(),function(ze,wt){const Rt=Vc[wt];return void 0===ze.buttons||(ze.buttons&Rt)!==Rt}(ze,this._eventButton))this.reset();else if(this._moved||!(wt.dist(Rt)<this._clickTolerance))return this._moved=!0,this._lastPoint=wt,this._move(Rt,wt)}mouseupWindow(ze){this._lastPoint&&Xt.mouseButton(ze)===this._eventButton&&(this._moved&&Xt.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wo extends qo{mousedown(ze,wt){super.mousedown(ze,wt),this._lastPoint&&(this._active=!0)}_correctButton(ze,wt){return 0===wt&&!ze.ctrlKey}_move(ze,wt){return{around:wt,panDelta:wt.sub(ze)}}}class $o extends qo{_correctButton(ze,wt){return 0===wt&&ze.ctrlKey||2===wt}_move(ze,wt){const Rt=.8*(wt.x-ze.x);if(Rt)return this._active=!0,{bearingDelta:Rt}}contextmenu(ze){ze.preventDefault()}}class Xo extends qo{_correctButton(ze,wt){return 0===wt&&ze.ctrlKey||2===wt}_move(ze,wt){const Rt=-.5*(wt.y-ze.y);if(Rt)return this._active=!0,{pitchDelta:Rt}}contextmenu(ze){ze.preventDefault()}}class Ho{constructor(ze){this._minTouches=1,this._clickTolerance=ze.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new ze.pointGeometry(0,0)}touchstart(ze,wt,Rt){return this._calculateTransform(ze,wt,Rt)}touchmove(ze,wt,Rt){if(this._active&&!(Rt.length<this._minTouches))return ze.preventDefault(),this._calculateTransform(ze,wt,Rt)}touchend(ze,wt,Rt){this._calculateTransform(ze,wt,Rt),this._active&&Rt.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(wt,Rt,Xt){Xt.length>0&&(this._active=!0);const sr=No(Xt,Rt),Dr=new ze.pointGeometry(0,0),Lr=new ze.pointGeometry(0,0);let Ur=0;for(const ze in sr){const wt=sr[ze],Rt=this._touches[ze];Rt&&(Dr._add(wt),Lr._add(wt.sub(Rt)),Ur++,sr[ze]=wt)}if(this._touches=sr,Ur<this._minTouches||!Lr.mag())return;const qr=Lr.div(Ur);return this._sum._add(qr),this._sum.mag()<this._clickTolerance?void 0:{around:Dr.div(Ur),panDelta:qr}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ko{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(ze){}_move(ze,wt,Rt){return{}}touchstart(ze,wt,Rt){this._firstTwoTouches||Rt.length<2||(this._firstTwoTouches=[Rt[0].identifier,Rt[1].identifier],this._start([wt[0],wt[1]]))}touchmove(ze,wt,Rt){if(!this._firstTwoTouches)return;ze.preventDefault();const[Xt,sr]=this._firstTwoTouches,Dr=Yo(Rt,wt,Xt),Lr=Yo(Rt,wt,sr);if(!Dr||!Lr)return;const Ur=this._aroundCenter?null:Dr.add(Lr).div(2);return this._move([Dr,Lr],Ur,ze)}touchend(ze,wt,Rt){if(!this._firstTwoTouches)return;const[sr,Dr]=this._firstTwoTouches,Lr=Yo(Rt,wt,sr),Ur=Yo(Rt,wt,Dr);Lr&&Ur||(this._active&&Xt.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(ze){this._enabled=!0,this._aroundCenter=!!ze&&"center"===ze.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Yo(ze,wt,Rt){for(let Xt=0;Xt<ze.length;Xt++)if(ze[Xt].identifier===Rt)return wt[Xt]}function Qo(ze,wt){return Math.log(ze/wt)/Math.LN2}class Jo extends Ko{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(ze){this._startDistance=this._distance=ze[0].dist(ze[1])}_move(ze,wt){const Rt=this._distance;if(this._distance=ze[0].dist(ze[1]),this._active||!(Math.abs(Qo(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Qo(this._distance,Rt),pinchAround:wt}}}function tr(ze,wt){return 180*ze.angleWith(wt)/Math.PI}class er extends Ko{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(ze){this._startVector=this._vector=ze[0].sub(ze[1]),this._minDiameter=ze[0].dist(ze[1])}_move(ze,wt){const Rt=this._vector;if(this._vector=ze[0].sub(ze[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tr(this._vector,Rt),pinchAround:wt}}_isBelowThreshold(ze){this._minDiameter=Math.min(this._minDiameter,ze.mag());const wt=25/(Math.PI*this._minDiameter)*360,Rt=tr(ze,this._startVector);return Math.abs(Rt)<wt}}function ir(ze){return Math.abs(ze.y)>Math.abs(ze.x)}class or extends Ko{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(ze){this._lastPoints=ze,ir(ze[0].sub(ze[1]))&&(this._valid=!1)}_move(ze,wt,Rt){const Xt=ze[0].sub(this._lastPoints[0]),sr=ze[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Xt,sr,Rt.timeStamp),this._valid)return this._lastPoints=ze,this._active=!0,{pitchDelta:(Xt.y+sr.y)/2*-.5}}gestureBeginsVertically(ze,wt,Rt){if(void 0!==this._valid)return this._valid;const Xt=ze.mag()>=2,sr=wt.mag()>=2;if(!Xt&&!sr)return;if(!Xt||!sr)return void 0===this._firstMove&&(this._firstMove=Rt),Rt-this._firstMove<100&&void 0;const Dr=ze.y>0==wt.y>0;return ir(ze)&&ir(wt)&&Dr}}const Hc={panStep:100,bearingStep:15,pitchStep:10};class ar{constructor(){const ze=Hc;this._panStep=ze.panStep,this._bearingStep=ze.bearingStep,this._pitchStep=ze.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(ze){if(ze.altKey||ze.ctrlKey||ze.metaKey)return;let wt=0,Rt=0,Xt=0,sr=0,Dr=0;switch(ze.keyCode){case 61:case 107:case 171:case 187:wt=1;break;case 189:case 109:case 173:wt=-1;break;case 37:ze.shiftKey?Rt=-1:(ze.preventDefault(),sr=-1);break;case 39:ze.shiftKey?Rt=1:(ze.preventDefault(),sr=1);break;case 38:ze.shiftKey?Xt=1:(ze.preventDefault(),Dr=-1);break;case 40:ze.shiftKey?Xt=-1:(ze.preventDefault(),Dr=1);break;default:return}return this._rotationDisabled&&(Rt=0,Xt=0),{cameraAnimation:Lr=>{const Ur=Lr.getZoom();Lr.easeTo({duration:300,easeId:"keyboardHandler",easing:nr,zoom:wt?Math.round(Ur)+wt*(ze.shiftKey?2:1):Ur,bearing:Lr.getBearing()+Rt*this._bearingStep,pitch:Lr.getPitch()+Xt*this._pitchStep,offset:[-sr*this._panStep,-Dr*this._panStep],center:Lr.getCenter()},{originalEvent:ze})}}}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 nr(ze){return ze*(2-ze)}const Kc=4.000244140625;class lr{constructor(wt,Rt){this._map=wt,this._el=wt.getCanvasContainer(),this._handler=Rt,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,ze.bindAll(["_onTimeout"],this)}setZoomRate(ze){this._defaultZoomRate=ze}setWheelZoomRate(ze){this._wheelZoomRate=ze}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(ze){this.isEnabled()||(this._enabled=!0,this._aroundCenter=ze&&"center"===ze.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(wt){if(!this.isEnabled())return;let Rt=wt.deltaMode===ze.window.WheelEvent.DOM_DELTA_LINE?40*wt.deltaY:wt.deltaY;const Xt=ze.exported.now(),sr=Xt-(this._lastWheelEventTime||0);this._lastWheelEventTime=Xt,0!==Rt&&Rt%Kc==0?this._type="wheel":0!==Rt&&Math.abs(Rt)<4?this._type="trackpad":sr>400?(this._type=null,this._lastValue=Rt,this._timeout=setTimeout(this._onTimeout,40,wt)):this._type||(this._type=Math.abs(sr*Rt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,Rt+=this._lastValue)),wt.shiftKey&&Rt&&(Rt/=4),this._type&&(this._lastWheelEvent=wt,this._delta-=Rt,this._active||this._start(wt)),wt.preventDefault()}_onTimeout(ze){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(ze)}_start(ze){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 wt=Xt.mousePos(this._el,ze);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:wt,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const wt=this._map.transform,i=()=>wt._terrainEnabled()?wt.computeZoomRelativeTo(this._aroundCoord):wt.zoom;if(0!==this._delta){const ze="wheel"===this._type&&Math.abs(this._delta)>Kc?this._wheelZoomRate:this._defaultZoomRate;let Rt=2/(1+Math.exp(-Math.abs(this._delta*ze)));this._delta<0&&0!==Rt&&(Rt=1/Rt);const Xt=i(),sr=Math.pow(2,Xt),Dr="number"==typeof this._targetZoom?wt.zoomScale(this._targetZoom):sr;this._targetZoom=Math.min(wt.maxZoom,Math.max(wt.minZoom,wt.scaleZoom(Dr*Rt))),"wheel"===this._type&&(this._startZoom=i(),this._easing=this._smoothOutEasing(200)),this._delta=0}const Rt="number"==typeof this._targetZoom?this._targetZoom:i(),Xt=this._startZoom,sr=this._easing;let Dr,Lr=!1;if("wheel"===this._type&&Xt&&sr){const wt=Math.min((ze.exported.now()-this._lastWheelEventTime)/200,1),Ur=sr(wt);Dr=ze.number(Xt,Rt,Ur),wt<1?this._frameId||(this._frameId=!0):Lr=!0}else Dr=Rt,Lr=!0;return this._active=!0,Lr&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Lr,zoomDelta:Dr-i(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(wt){let Rt=ze.ease;if(this._prevEase){const wt=this._prevEase,Xt=(ze.exported.now()-wt.start)/wt.duration,sr=wt.easing(Xt+.01)-wt.easing(Xt),Dr=.27/Math.sqrt(sr*sr+1e-4)*.01,Lr=Math.sqrt(.0729-Dr*Dr);Rt=ze.bezier(Dr,Lr,.25,1)}return this._prevEase={start:ze.exported.now(),duration:wt,easing:Rt},Rt}reset(){this._active=!1}}class cr{constructor(ze,wt){this._clickZoom=ze,this._tapZoom=wt}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 hr{constructor(){this.reset()}reset(){this._active=!1}dblclick(ze,wt){return ze.preventDefault(),{cameraAnimation:Rt=>{Rt.easeTo({duration:300,zoom:Rt.getZoom()+(ze.shiftKey?-1:1),around:Rt.unproject(wt)},{originalEvent:ze})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class dr{constructor(){this._tap=new Zo({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(ze,wt,Rt){this._swipePoint||(this._tapTime&&ze.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?Rt.length>0&&(this._swipePoint=wt[0],this._swipeTouch=Rt[0].identifier):this._tap.touchstart(ze,wt,Rt))}touchmove(ze,wt,Rt){if(this._tapTime){if(this._swipePoint){if(Rt[0].identifier!==this._swipeTouch)return;const Xt=wt[0],sr=Xt.y-this._swipePoint.y;return this._swipePoint=Xt,ze.preventDefault(),this._active=!0,{zoomDelta:sr/128}}}else this._tap.touchmove(ze,wt,Rt)}touchend(ze,wt,Rt){this._tapTime?this._swipePoint&&0===Rt.length&&this.reset():this._tap.touchend(ze,wt,Rt)&&(this._tapTime=ze.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ur{constructor(ze,wt,Rt){this._el=ze,this._mousePan=wt,this._touchPan=Rt}enable(ze){this._inertiaOptions=ze||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class _r{constructor(ze,wt,Rt){this._pitchWithRotate=ze.pitchWithRotate,this._mouseRotate=wt,this._mousePitch=Rt}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 pr{constructor(ze,wt,Rt,Xt){this._el=ze,this._touchZoom=wt,this._touchRotate=Rt,this._tapDragZoom=Xt,this._rotationDisabled=!1,this._enabled=!0}enable(ze){this._touchZoom.enable(ze),this._rotationDisabled||this._touchRotate.enable(ze),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const mr=ze=>ze.zoom||ze.drag||ze.pitch||ze.rotate;class fr extends ze.Event{}class gr{constructor(){this.constants=[1,1,.01],this.radius=0}setup(wt,Rt){const Xt=ze.sub([],Rt,wt);this.radius=ze.length(Xt[2]<0?ze.div([],Xt,this.constants):[Xt[0],Xt[1],0])}projectRay(wt){ze.div(wt,wt,this.constants),ze.normalize(wt,wt),ze.mul$2(wt,wt,this.constants);const Rt=ze.scale([],wt,this.radius);if(Rt[2]>0){const wt=ze.scale([],[0,0,1],ze.dot(Rt,[0,0,1])),Xt=ze.scale([],ze.normalize([],[Rt[0],Rt[1],0]),this.radius),sr=ze.add([],Rt,ze.scale([],ze.sub([],ze.add([],Xt,wt),Rt),2));Rt[0]=sr[0],Rt[1]=sr[1]}return Rt}}function vr(ze){return ze.panDelta&&ze.panDelta.mag()||ze.zoomDelta||ze.bearingDelta||ze.pitchDelta}class xr{constructor(wt,Rt){this._map=wt,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ao(wt),this._bearingSnap=Rt.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new gr,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(Rt),ze.bindAll(["handleEvent","handleWindowEvent"],this);const sr=this._el;this._listeners=[[sr,"touchstart",{passive:!0}],[sr,"touchmove",{passive:!1}],[sr,"touchend",void 0],[sr,"touchcancel",void 0],[sr,"mousedown",void 0],[sr,"mousemove",void 0],[sr,"mouseup",void 0],[ze.window.document,"mousemove",{capture:!0}],[ze.window.document,"mouseup",void 0],[sr,"mouseover",void 0],[sr,"mouseout",void 0],[sr,"dblclick",void 0],[sr,"click",void 0],[sr,"keydown",{capture:!1}],[sr,"keyup",void 0],[sr,"wheel",{passive:!1}],[sr,"contextmenu",void 0],[ze.window,"blur",void 0]];for(const[wt,Rt,sr]of this._listeners)Xt.addEventListener(wt,Rt,wt===ze.window.document?this.handleWindowEvent:this.handleEvent,sr)}destroy(){for(const[wt,Rt,sr]of this._listeners)Xt.removeEventListener(wt,Rt,wt===ze.window.document?this.handleWindowEvent:this.handleEvent,sr)}_addDefaultHandlers(ze){const wt=this._map,Rt=wt.getCanvasContainer();this._add("mapEvent",new Bo(wt,ze));const Xt=wt.boxZoom=new Uo(wt,ze);this._add("boxZoom",Xt);const sr=new Vo,Dr=new hr;wt.doubleClickZoom=new cr(Dr,sr),this._add("tapZoom",sr),this._add("clickZoom",Dr);const Lr=new dr;this._add("tapDragZoom",Lr);const Ur=wt.touchPitch=new or;this._add("touchPitch",Ur);const qr=new $o(ze),ri=new Xo(ze);wt.dragRotate=new _r(ze,qr,ri),this._add("mouseRotate",qr,["mousePitch"]),this._add("mousePitch",ri,["mouseRotate"]);const ai=new Wo(ze),Yi=new Ho(ze);wt.dragPan=new ur(Rt,ai,Yi),this._add("mousePan",ai),this._add("touchPan",Yi,["touchZoom","touchRotate"]);const Ji=new er,Qi=new Jo;wt.touchZoomRotate=new pr(Rt,Qi,Ji,Lr),this._add("touchRotate",Ji,["touchPan","touchZoom"]),this._add("touchZoom",Qi,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Oo(wt));const kn=wt.scrollZoom=new lr(wt,this);this._add("scrollZoom",kn,["mousePan"]);const jn=wt.keyboard=new ar;this._add("keyboard",jn);for(const Rt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])ze.interactive&&ze[Rt]&&wt[Rt].enable(ze[Rt])}_add(ze,wt,Rt){this._handlers.push({handlerName:ze,handler:wt,allowed:Rt}),this._handlersById[ze]=wt}stop(ze){if(!this._updatingCamera){for(const{handler:ze}of this._handlers)ze.reset();this._inertia.clear(),this._fireEvents({},{},ze),this._changes=[]}}isActive(){for(const{handler:ze}of this._handlers)if(ze.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(mr(this._eventsInProgress))||this.isZooming()}_blockedByActive(ze,wt,Rt){for(const Xt in ze)if(Xt!==Rt&&(!wt||wt.indexOf(Xt)<0))return!0;return!1}handleWindowEvent(ze){this.handleEvent(ze,`${ze.type}Window`)}_getMapTouches(ze){const wt=[];for(const Rt of ze)this._el.contains(Rt.target)&&wt.push(Rt);return wt}handleEvent(ze,wt){if("blur"===ze.type)return void this.stop(!0);this._updatingCamera=!0;const Rt="renderFrame"===ze.type,sr=Rt?void 0:ze,Dr={needsRenderFrame:!1},Lr={},Ur={},qr=ze.touches?this._getMapTouches(ze.touches):void 0,ri=qr?Xt.touchPos(this._el,qr):Rt?void 0:Xt.mousePos(this._el,ze);for(const{handlerName:Rt,handler:Xt,allowed:ai}of this._handlers){if(!Xt.isEnabled())continue;let Yi;this._blockedByActive(Ur,ai,Rt)?Xt.reset():Xt[wt||ze.type]&&(Yi=Xt[wt||ze.type](ze,ri,qr),this.mergeHandlerResult(Dr,Lr,Yi,Rt,sr),Yi&&Yi.needsRenderFrame&&this._triggerRenderFrame()),(Yi||Xt.isActive())&&(Ur[Rt]=Xt)}const ai={};for(const ze in this._previousActiveHandlers)Ur[ze]||(ai[ze]=sr);this._previousActiveHandlers=Ur,(Object.keys(ai).length||vr(Dr))&&(this._changes.push([Dr,Lr,ai]),this._triggerRenderFrame()),(Object.keys(Ur).length||vr(Dr))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:Yi}=Dr;Yi&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Yi(this._map))}mergeHandlerResult(wt,Rt,Xt,sr,Dr){if(!Xt)return;ze.extend(wt,Xt);const Lr={handlerName:sr,originalEvent:Xt.originalEvent||Dr};void 0!==Xt.zoomDelta&&(Rt.zoom=Lr),void 0!==Xt.panDelta&&(Rt.drag=Lr),void 0!==Xt.pitchDelta&&(Rt.pitch=Lr),void 0!==Xt.bearingDelta&&(Rt.rotate=Lr)}_applyChanges(){const wt={},Rt={},Xt={};for(const[sr,Dr,Lr]of this._changes)sr.panDelta&&(wt.panDelta=(wt.panDelta||new ze.pointGeometry(0,0))._add(sr.panDelta)),sr.zoomDelta&&(wt.zoomDelta=(wt.zoomDelta||0)+sr.zoomDelta),sr.bearingDelta&&(wt.bearingDelta=(wt.bearingDelta||0)+sr.bearingDelta),sr.pitchDelta&&(wt.pitchDelta=(wt.pitchDelta||0)+sr.pitchDelta),void 0!==sr.around&&(wt.around=sr.around),void 0!==sr.aroundCoord&&(wt.aroundCoord=sr.aroundCoord),void 0!==sr.pinchAround&&(wt.pinchAround=sr.pinchAround),sr.noInertia&&(wt.noInertia=sr.noInertia),ze.extend(Rt,Dr),ze.extend(Xt,Lr);this._updateMapTransform(wt,Rt,Xt),this._changes=[]}_updateMapTransform(wt,Rt,Xt){const sr=this._map,Dr=sr.transform,n=ze=>[ze.x,ze.y,ze.z];if((()=>{const ze=this._eventsInProgress.drag;return ze&&!this._handlersById[ze.handlerName].isActive()})()&&!vr(wt)){const ze=Dr.zoom;Dr.cameraElevationReference="sea",Dr.recenterOnTerrain(),Dr.cameraElevationReference="ground",ze!==Dr.zoom&&this._map._update(!0)}if(!vr(wt))return this._fireEvents(Rt,Xt,!0);let{panDelta:Lr,zoomDelta:Ur,bearingDelta:qr,pitchDelta:ri,around:ai,aroundCoord:Yi,pinchAround:Ji}=wt;void 0!==Ji&&(ai=Ji),(()=>Rt.drag&&!this._eventsInProgress.drag)()&&ai&&(this._dragOrigin=n(Dr.pointCoordinate3D(ai)),this._trackingEllipsoid.setup(Dr._camera.position,this._dragOrigin)),Dr.cameraElevationReference="sea",sr._stop(!0),ai=ai||sr.transform.centerPoint,qr&&(Dr.bearing+=qr),ri&&(Dr.pitch+=ri),Dr._updateCameraState();const Qi=[0,0,0];if(Lr){const ze=Dr.screenPointToMercatorRay(ai),wt=Dr.screenPointToMercatorRay(ai.sub(Lr)),Rt=this._trackingEllipsoid.projectRay(ze.dir),
20Xt=this._trackingEllipsoid.projectRay(wt.dir);Qi[0]=Xt[0]-Rt[0],Qi[1]=Xt[1]-Rt[1]}const kn=Dr.zoom,jn=[0,0,0];if(Ur){const wt=n(Yi||Dr.pointCoordinate3D(ai)),Rt={dir:ze.normalize([],ze.sub([],wt,Dr._camera.position))},Xt=Dr.screenPointToMercatorRay(Dr.centerPoint);if(Rt.dir[2]<0){const sr=ze.altitudeFromMercatorZ(wt[2],wt[1]),Lr=Dr.rayIntersectionCoordinate(Dr.pointRayIntersection(Dr.centerPoint,sr)),qr=Dr.zoomDeltaToMovement(n(Lr),Ur)*(Xt.dir[2]/Rt.dir[2]);ze.scale(jn,Rt.dir,qr)}else if(Dr._terrainEnabled()){const Xt=Dr.zoomDeltaToMovement(wt,Ur);ze.scale(jn,Rt.dir,Xt)}}const Un=ze.add(Qi,Qi,jn);Dr._translateCameraConstrained(Un),Ur&&Math.abs(Dr.zoom-kn)>1e-4&&Dr.recenterOnTerrain(),Dr.cameraElevationReference="ground",this._map._update(),wt.noInertia||this._inertia.record(wt),this._fireEvents(Rt,Xt,!0)}_fireEvents(wt,Rt,Xt){const sr=mr(this._eventsInProgress),Dr=mr(wt),Lr={};for(const ze in wt){const{originalEvent:Rt}=wt[ze];this._eventsInProgress[ze]||(Lr[`${ze}start`]=Rt),this._eventsInProgress[ze]=wt[ze]}!sr&&Dr&&this._fireEvent("movestart",Dr.originalEvent);for(const ze in Lr)this._fireEvent(ze,Lr[ze]);Dr&&this._fireEvent("move",Dr.originalEvent);for(const ze in wt){const{originalEvent:Rt}=wt[ze];this._fireEvent(ze,Rt)}const Ur={};let qr;for(const ze in this._eventsInProgress){const{handlerName:wt,originalEvent:Xt}=this._eventsInProgress[ze];this._handlersById[wt].isActive()||(delete this._eventsInProgress[ze],qr=Rt[wt]||Xt,Ur[`${ze}end`]=qr)}for(const ze in Ur)this._fireEvent(ze,Ur[ze]);const ri=mr(this._eventsInProgress);if(Xt&&(sr||Dr)&&!ri){this._updatingCamera=!0;const wt=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=ze=>0!==ze&&-this._bearingSnap<ze&&ze<this._bearingSnap;wt?(i(wt.bearing||this._map.getBearing())&&(wt.bearing=0),this._map.easeTo(wt,{originalEvent:qr})):(this._map.fire(new ze.Event("moveend",{originalEvent:qr})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(wt,Rt){this._map.fire(new ze.Event(wt,Rt?{originalEvent:Rt}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(ze=>{delete this._frameId,this.handleEvent(new fr("renderFrame",{timeStamp:ze})),this._applyChanges()})}
vendor: 19,289 bytes, line 20
20_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class yr extends ze.Evented{constructor(wt,Rt){super(),this._moving=!1,this._zooming=!1,this.transform=wt,this._bearingSnap=Rt.bearingSnap,ze.bindAll(["_renderFrameCallback"],this)}getCenter(){return new ze.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(ze,wt){return this.jumpTo({center:ze},wt)}panBy(wt,Rt,Xt){return wt=ze.pointGeometry.convert(wt).mult(-1),this.panTo(this.transform.center,ze.extend({offset:wt},Rt),Xt)}panTo(wt,Rt,Xt){return this.easeTo(ze.extend({center:wt},Rt),Xt)}getZoom(){return this.transform.zoom}setZoom(ze,wt){return this.jumpTo({zoom:ze},wt),this}zoomTo(wt,Rt,Xt){return this.easeTo(ze.extend({zoom:wt},Rt),Xt)}zoomIn(ze,wt){return this.zoomTo(this.getZoom()+1,ze,wt),this}zoomOut(ze,wt){return this.zoomTo(this.getZoom()-1,ze,wt),this}getBearing(){return this.transform.bearing}setBearing(ze,wt){return this.jumpTo({bearing:ze},wt),this}getPadding(){return this.transform.padding}setPadding(ze,wt){return this.jumpTo({padding:ze},wt),this}rotateTo(wt,Rt,Xt){return this.easeTo(ze.extend({bearing:wt},Rt),Xt)}resetNorth(wt,Rt){return this.rotateTo(0,ze.extend({duration:1e3},wt),Rt),this}resetNorthPitch(wt,Rt){return this.easeTo(ze.extend({bearing:0,pitch:0,duration:1e3},wt),Rt),this}snapToNorth(ze,wt){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(ze,wt):this}getPitch(){return this.transform.pitch}setPitch(ze,wt){return this.jumpTo({pitch:ze},wt),this}cameraForBounds(wt,Rt){wt=ze.LngLatBounds.convert(wt);const Xt=Rt&&Rt.bearing||0;return this._cameraForBoxAndBearing(wt.getNorthWest(),wt.getSouthEast(),Xt,Rt)}_extendCameraOptions(wt){const Rt={top:0,bottom:0,right:0,left:0};if("number"==typeof(wt=ze.extend({padding:Rt,offset:[0,0],maxZoom:this.transform.maxZoom},wt)).padding){const ze=wt.padding;wt.padding={top:ze,bottom:ze,right:ze,left:ze}}return wt.padding=ze.extend(Rt,wt.padding),wt}_cameraForBoxAndBearing(wt,Rt,Xt,sr){const Dr=this._extendCameraOptions(sr),Lr=this.transform,Ur=Lr.padding,qr=Lr.project(ze.LngLat.convert(wt)),ri=Lr.project(ze.LngLat.convert(Rt)),ai=qr.rotate(-ze.degToRad(Xt)),Yi=ri.rotate(-ze.degToRad(Xt)),Ji=new ze.pointGeometry(Math.max(ai.x,Yi.x),Math.max(ai.y,Yi.y)),Qi=new ze.pointGeometry(Math.min(ai.x,Yi.x),Math.min(ai.y,Yi.y)),kn=Ji.sub(Qi),jn=(Lr.width-(Ur.left+Ur.right+Dr.padding.left+Dr.padding.right))/kn.x,Un=(Lr.height-(Ur.top+Ur.bottom+Dr.padding.top+Dr.padding.bottom))/kn.y;if(Un<0||jn<0)return void ze.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const Wn=Math.min(Lr.scaleZoom(Lr.scale*Math.min(jn,Un)),Dr.maxZoom),Yn="number"==typeof Dr.offset.x?new ze.pointGeometry(Dr.offset.x,Dr.offset.y):ze.pointGeometry.convert(Dr.offset),Jn=new ze.pointGeometry((Dr.padding.left-Dr.padding.right)/2,(Dr.padding.top-Dr.padding.bottom)/2).rotate(Xt*Math.PI/180),Qn=Yn.add(Jn).mult(Lr.scale/Lr.zoomScale(Wn));return{center:Lr.unproject(qr.add(ri).div(2).sub(Qn)),zoom:Wn,bearing:Xt}}_cameraForBox(wt,Rt,Xt,sr,Dr){const Lr=this._extendCameraOptions(Dr);Xt=Xt||0,sr=sr||0,wt=ze.LngLat.convert(wt),Rt=ze.LngLat.convert(Rt);const Ur=this.transform.clone();Ur.padding=Lr.padding;const qr=this.getFreeCameraOptions(),ri=new ze.LngLat(.5*(wt.lng+Rt.lng),.5*(wt.lat+Rt.lat)),ai=.5*(Xt+sr);if(Ur._camera.position[2]<ze.mercatorZfromAltitude(ai,ri.lat))return void ze.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");qr.lookAtPoint(ri),Ur.setFreeCameraOptions(qr);const Yi=ze.MercatorCoordinate.fromLngLat(wt),Ji=ze.MercatorCoordinate.fromLngLat(Rt),Qi=Ur.pointRayIntersection(Ur.centerPoint,ai),kn=[(jn=Ur.rayIntersectionCoordinate(Qi)).x,jn.y,jn.z];var jn;const Un=Ur.screenPointToMercatorRay(Ur.centerPoint);let Wn,Yn=0;do{const Rt=Math.floor(Ur.zoom),Dr=1<<Rt,Lr=Math.min(Dr*Yi.x,Dr*Ji.x),qr=Math.min(Dr*Yi.y,Dr*Ji.y),ri=Math.max(Dr*Yi.x,Dr*Ji.x),ai=Math.max(Dr*Yi.y,Dr*Ji.y),Qi=new p([Lr,qr,Xt],[ri,ai,sr]),jn=_.fromInvProjectionMatrix(Ur.invProjMatrix,Ur.worldSize,Rt);if(2!==Qi.intersects(jn)){Wn&&(Ur._camera.position=ze.scaleAndAdd([],Ur._camera.position,Un.dir,-Wn),Ur._updateStateFromCamera());break}const Yn=ze.sub([],Ur._camera.position,kn);Wn=.5*ze.length(Yn),Ur._camera.position=ze.scaleAndAdd([],Ur._camera.position,Un.dir,Wn);try{Ur._updateStateFromCamera()}catch(wt){return void ze.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}}while(++Yn<10);return{center:Ur.center,zoom:Ur.zoom,bearing:Ur.bearing,pitch:Ur.pitch}}fitBounds(ze,wt,Rt){return this._fitInternal(this.cameraForBounds(ze,wt),wt,Rt)}_raycastElevationBox(wt,Rt){const Xt=this.transform.elevation;if(!Xt)return;const sr=new ze.pointGeometry(wt.x,Rt.y),Dr=new ze.pointGeometry(Rt.x,wt.y),Lr=Xt.pointCoordinate(wt);if(!Lr)return;const Ur=Xt.pointCoordinate(Rt);if(!Ur)return;const qr=Xt.pointCoordinate(sr);if(!qr)return;const ri=Xt.pointCoordinate(Dr);if(!ri)return;const ai=new ze.MercatorCoordinate(Lr[0],Lr[1]).toLngLat(),Yi=new ze.MercatorCoordinate(Ur[0],Ur[1]).toLngLat(),Ji=new ze.MercatorCoordinate(qr[0],qr[1]).toLngLat(),Qi=new ze.MercatorCoordinate(ri[0],ri[1]).toLngLat(),kn=Math.min(ai.lng,Math.min(Yi.lng,Math.min(Ji.lng,Qi.lng))),jn=Math.min(ai.lat,Math.min(Yi.lat,Math.min(Ji.lat,Qi.lat))),Un=Math.max(ai.lng,Math.max(Yi.lng,Math.max(Ji.lng,Qi.lng))),Wn=Math.max(ai.lat,Math.max(Yi.lat,Math.max(Ji.lat,Qi.lat))),Yn=Math.min(Lr[3],Math.min(Ur[3],Math.min(qr[3],ri[3]))),Jn=Math.max(Lr[3],Math.max(Ur[3],Math.max(qr[3],ri[3])));return{minLngLat:new ze.LngLat(kn,jn),maxLngLat:new ze.LngLat(Un,Wn),minAltitude:Yn,maxAltitude:Jn}}fitScreenCoordinates(wt,Rt,Xt,sr,Dr){let Lr,Ur,qr,ri;const ai=ze.pointGeometry.convert(wt),Yi=ze.pointGeometry.convert(Rt),Ji=this._raycastElevationBox(ai,Yi);if(Ji)Lr=Ji.minLngLat,Ur=Ji.maxLngLat,qr=Ji.minAltitude,ri=Ji.maxAltitude;else{if(this.transform.isHorizonVisibleForPoints(ai,Yi))return this;Lr=this.transform.pointLocation(ai),Ur=this.transform.pointLocation(Yi)}return this._fitInternal(0===this.transform.pitch?this._cameraForBoxAndBearing(this.transform.pointLocation(ze.pointGeometry.convert(wt)),this.transform.pointLocation(ze.pointGeometry.convert(Rt)),Xt,sr):this._cameraForBox(Lr,Ur,qr,ri,sr),sr,Dr)}_fitInternal(wt,Rt,Xt){return wt?(delete(Rt=ze.extend(wt,Rt)).padding,Rt.linear?this.easeTo(Rt,Xt):this.flyTo(Rt,Xt)):this}jumpTo(wt,Rt){this.stop();const Xt=this.transform;let sr=!1,Dr=!1,Lr=!1;return"zoom"in wt&&Xt.zoom!==+wt.zoom&&(sr=!0,Xt.zoom=+wt.zoom),void 0!==wt.center&&(Xt.center=ze.LngLat.convert(wt.center)),"bearing"in wt&&Xt.bearing!==+wt.bearing&&(Dr=!0,Xt.bearing=+wt.bearing),"pitch"in wt&&Xt.pitch!==+wt.pitch&&(Lr=!0,Xt.pitch=+wt.pitch),null==wt.padding||Xt.isPaddingEqual(wt.padding)||(Xt.padding=wt.padding),this.fire(new ze.Event("movestart",Rt)).fire(new ze.Event("move",Rt)),sr&&this.fire(new ze.Event("zoomstart",Rt)).fire(new ze.Event("zoom",Rt)).fire(new ze.Event("zoomend",Rt)),Dr&&this.fire(new ze.Event("rotatestart",Rt)).fire(new ze.Event("rotate",Rt)).fire(new ze.Event("rotateend",Rt)),Lr&&this.fire(new ze.Event("pitchstart",Rt)).fire(new ze.Event("pitch",Rt)).fire(new ze.Event("pitchend",Rt)),this.fire(new ze.Event("moveend",Rt))}getFreeCameraOptions(){return this.transform.getFreeCameraOptions()}setFreeCameraOptions(wt,Rt){this.stop();const Xt=this.transform,sr=Xt.zoom,Dr=Xt.pitch,Lr=Xt.bearing;Xt.setFreeCameraOptions(wt);const Ur=sr!==Xt.zoom,qr=Dr!==Xt.pitch,ri=Lr!==Xt.bearing;return this.fire(new ze.Event("movestart",Rt)).fire(new ze.Event("move",Rt)),Ur&&this.fire(new ze.Event("zoomstart",Rt)).fire(new ze.Event("zoom",Rt)).fire(new ze.Event("zoomend",Rt)),ri&&this.fire(new ze.Event("rotatestart",Rt)).fire(new ze.Event("rotate",Rt)).fire(new ze.Event("rotateend",Rt)),qr&&this.fire(new ze.Event("pitchstart",Rt)).fire(new ze.Event("pitch",Rt)).fire(new ze.Event("pitchend",Rt)),this.fire(new ze.Event("moveend",Rt)),this}easeTo(wt,Rt){this._stop(!1,wt.easeId),(!1===(wt=ze.extend({offset:[0,0],duration:500,easing:ze.ease},wt)).animate||!wt.essential&&ze.exported.prefersReducedMotion)&&(wt.duration=0);const Xt=this.transform,sr=this.getZoom(),Dr=this.getBearing(),Lr=this.getPitch(),Ur=this.getPadding(),qr="zoom"in wt?+wt.zoom:sr,ri="bearing"in wt?this._normalizeBearing(wt.bearing,Dr):Dr,ai="pitch"in wt?+wt.pitch:Lr,Yi="padding"in wt?wt.padding:Xt.padding,Ji=ze.pointGeometry.convert(wt.offset);let Qi=Xt.centerPoint.add(Ji);const kn=Xt.pointLocation(Qi),jn=ze.LngLat.convert(wt.center||kn);this._normalizeCenter(jn);const Un=Xt.project(kn),Wn=Xt.project(jn).sub(Un),Yn=Xt.zoomScale(qr-sr);let Jn,Qn;wt.around&&(Jn=ze.LngLat.convert(wt.around),Qn=Xt.locationPoint(Jn));const Io={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||qr!==sr,this._rotating=this._rotating||Dr!==ri,this._pitching=this._pitching||ai!==Lr,this._padding=!Xt.isPaddingEqual(Yi),this._easeId=wt.easeId,this._prepareEase(Rt,wt.noMoveStart,Io),this._ease(wt=>{if(this._zooming&&(Xt.zoom=ze.number(sr,qr,wt)),this._rotating&&(Xt.bearing=ze.number(Dr,ri,wt)),this._pitching&&(Xt.pitch=ze.number(Lr,ai,wt)),this._padding&&(Xt.interpolatePadding(Ur,Yi,wt),Qi=Xt.centerPoint.add(Ji)),Jn)Xt.setLocationAtPoint(Jn,Qn);else{const ze=Xt.zoomScale(Xt.zoom-sr),Rt=qr>sr?Math.min(2,Yn):Math.max(.5,Yn),Dr=Math.pow(Rt,1-wt),Lr=Xt.unproject(Un.add(Wn.mult(wt*Dr)).mult(ze));Xt.setLocationAtPoint(Xt.renderWorldCopies?Lr.wrap():Lr,Qi)}this._fireMoveEvents(Rt)},ze=>{Xt.recenterOnTerrain(),this._afterEase(Rt,ze)},wt),this}_prepareEase(wt,Rt,Xt={}){this._moving=!0,this.transform.cameraElevationReference="sea",Rt||Xt.moving||this.fire(new ze.Event("movestart",wt)),this._zooming&&!Xt.zooming&&this.fire(new ze.Event("zoomstart",wt)),this._rotating&&!Xt.rotating&&this.fire(new ze.Event("rotatestart",wt)),this._pitching&&!Xt.pitching&&this.fire(new ze.Event("pitchstart",wt))}_fireMoveEvents(wt){this.fire(new ze.Event("move",wt)),this._zooming&&this.fire(new ze.Event("zoom",wt)),this._rotating&&this.fire(new ze.Event("rotate",wt)),this._pitching&&this.fire(new ze.Event("pitch",wt))}_afterEase(wt,Rt){if(this._easeId&&Rt&&this._easeId===Rt)return;delete this._easeId,this.transform.cameraElevationReference="ground";const Xt=this._zooming,sr=this._rotating,Dr=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Xt&&this.fire(new ze.Event("zoomend",wt)),sr&&this.fire(new ze.Event("rotateend",wt)),Dr&&this.fire(new ze.Event("pitchend",wt)),this.fire(new ze.Event("moveend",wt))}flyTo(wt,Rt){if(!wt.essential&&ze.exported.prefersReducedMotion){const Xt=ze.pick(wt,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Xt,Rt)}this.stop(),wt=ze.extend({offset:[0,0],speed:1.2,curve:1.42,easing:ze.ease},wt);const Xt=this.transform,sr=this.getZoom(),Dr=this.getBearing(),Lr=this.getPitch(),Ur=this.getPadding(),qr="zoom"in wt?ze.clamp(+wt.zoom,Xt.minZoom,Xt.maxZoom):sr,ri="bearing"in wt?this._normalizeBearing(wt.bearing,Dr):Dr,ai="pitch"in wt?+wt.pitch:Lr,Yi="padding"in wt?wt.padding:Xt.padding,Ji=Xt.zoomScale(qr-sr),Qi=ze.pointGeometry.convert(wt.offset);let kn=Xt.centerPoint.add(Qi);const jn=Xt.pointLocation(kn),Un=ze.LngLat.convert(wt.center||jn);this._normalizeCenter(Un);const Wn=Xt.project(jn),Yn=Xt.project(Un).sub(Wn);let Jn=wt.curve;const Qn=Math.max(Xt.width,Xt.height),Io=Qn/Ji,Mo=Yn.mag();if("minZoom"in wt){const Rt=ze.clamp(Math.min(wt.minZoom,sr,qr),Xt.minZoom,Xt.maxZoom),Dr=Qn/Xt.zoomScale(Rt-sr);Jn=Math.sqrt(Dr/Mo*2)}const jo=Jn*Jn;function E(ze){const wt=(Io*Io-Qn*Qn+(ze?-1:1)*jo*jo*Mo*Mo)/(2*(ze?Io:Qn)*jo*Mo);return Math.log(Math.sqrt(wt*wt+1)-wt)}function C(ze){return(Math.exp(ze)-Math.exp(-ze))/2}function S(ze){return(Math.exp(ze)+Math.exp(-ze))/2}const zo=E(0);let M=function(ze){return S(zo)/S(zo+Jn*ze)},z=function(ze){return Qn*((S(zo)*(C(wt=zo+Jn*ze)/S(wt))-C(zo))/jo)/Mo;var wt},oa=(E(1)-zo)/Jn;if(Math.abs(Mo)<1e-6||!isFinite(oa)){if(Math.abs(Qn-Io)<1e-6)return this.easeTo(wt,Rt);const ze=Io<Qn?-1:1;oa=Math.abs(Math.log(Io/Qn))/Jn,z=function(){return 0},M=function(wt){return Math.exp(ze*Jn*wt)}}return wt.duration="duration"in wt?+wt.duration:1e3*oa/("screenSpeed"in wt?+wt.screenSpeed/Jn:+wt.speed),wt.maxDuration&&wt.duration>wt.maxDuration&&(wt.duration=0),this._zooming=!0,this._rotating=Dr!==ri,this._pitching=ai!==Lr,this._padding=!Xt.isPaddingEqual(Yi),this._prepareEase(Rt,!1),this._ease(wt=>{const Ji=wt*oa,jn=1/M(Ji);Xt.zoom=1===wt?qr:sr+Xt.scaleZoom(jn),this._rotating&&(Xt.bearing=ze.number(Dr,ri,wt)),this._pitching&&(Xt.pitch=ze.number(Lr,ai,wt)),this._padding&&(Xt.interpolatePadding(Ur,Yi,wt),kn=Xt.centerPoint.add(Qi));const Jn=1===wt?Un:Xt.unproject(Wn.add(Yn.mult(z(Ji))).mult(jn));Xt.setLocationAtPoint(Xt.renderWorldCopies?Jn.wrap():Jn,kn),Xt._updateCenterElevation(),this._fireMoveEvents(Rt)},()=>this._afterEase(Rt),wt),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(ze,wt){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const ze=this._onEaseEnd;delete this._onEaseEnd,ze.call(this,wt)}if(!ze){const ze=this.handlers;ze&&ze.stop(!1)}return this}_ease(wt,Rt,Xt){!1===Xt.animate||0===Xt.duration?(wt(1),Rt()):(this._easeStart=ze.exported.now(),this._easeOptions=Xt,this._onEaseFrame=wt,this._onEaseEnd=Rt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const wt=Math.min((ze.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(wt)),wt<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(wt,Rt){wt=ze.wrap(wt,-180,180);const Xt=Math.abs(wt-Rt);return Math.abs(wt-360-Rt)<Xt&&(wt-=360),Math.abs(wt+360-Rt)<Xt&&(wt+=360),wt}_normalizeCenter(ze){const wt=this.transform;if(!wt.renderWorldCopies||wt.lngRange)return;const Rt=ze.lng-wt.center.lng;ze.lng+=Rt>180?-360:Rt<-180?360:0}}class br{constructor(wt={}){this.options=wt,ze.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(ze){const wt=this.options&&this.options.compact;return this._map=ze,this._container=Xt.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Xt.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Xt.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),wt&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===wt&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){Xt.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(ze,wt){const Rt=this._map._getUIString(`AttributionControl.${wt}`);ze.title=Rt,ze.setAttribute("aria-label",Rt)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))}_updateEditLink(){let wt=this._editLink;wt||(wt=this._editLink=this._container.querySelector(".mapbox-improve-map"));const Rt=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||ze.config.ACCESS_TOKEN}];if(wt){const Xt=Rt.reduce((ze,wt,Xt)=>(wt.value&&(ze+=`${wt.key}=${wt.value}${Xt<Rt.length-1?"&":""}`),ze),"?");wt.href=`${ze.config.FEEDBACK_URL}/${Xt}${this._map._hash?this._map._hash.getHashString(!0):""}`,wt.rel="noopener nofollow",this._setElementTitle(wt,"MapFeedback")}}_updateData(ze){!ze||"metadata"!==ze.sourceDataType&&"visibility"!==ze.sourceDataType&&"style"!==ze.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let ze=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?ze=ze.concat(this.options.customAttribution.map(ze=>"string"!=typeof ze?"":ze)):"string"==typeof this.options.customAttribution&&ze.push(this.options.customAttribution)),this._map.style.stylesheet){const ze=this._map.style.stylesheet;this.styleOwner=ze.owner,this.styleId=ze.id}const wt=this._map.style._sourceCaches;for(const Rt in wt){const Xt=wt[Rt];if(Xt.used){const wt=Xt.getSource();wt.attribution&&ze.indexOf(wt.attribution)<0&&ze.push(wt.attribution)}}ze.sort((ze,wt)=>ze.length-wt.length),ze=ze.filter((wt,Rt)=>{for(let Xt=Rt+1;Xt<ze.length;Xt++)if(ze[Xt].indexOf(wt)>=0)return!1;return!0});const Rt=ze.join(" | ");Rt!==this._attribHTML&&(this._attribHTML=Rt,ze.length?(this._innerContainer.innerHTML=Rt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class wr{constructor(){ze.bindAll(["_updateLogo"],this),ze.bindAll(["_updateCompact"],this)}onAdd(ze){this._map=ze,this._container=Xt.create("div","mapboxgl-ctrl");const wt=Xt.create("a","mapboxgl-ctrl-logo");return wt.target="_blank",wt.rel="noopener nofollow",wt.href="https://www.mapbox.com/",wt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),wt.setAttribute("rel","noopener nofollow"),this._container.appendChild(wt),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Xt.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(ze){ze&&"metadata"!==ze.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const ze=this._map.style._sourceCaches;if(0===Object.entries(ze).length)return!0;for(const wt in ze){const Rt=ze[wt].getSource();if(Rt.hasOwnProperty("mapbox_logo")&&!Rt.mapbox_logo)return!1}return!0}_updateCompact(){const ze=this._container.children;if(ze.length){const wt=ze[0];this._map.getCanvasContainer().offsetWidth<250?wt.classList.add("mapboxgl-compact"):wt.classList.remove("mapboxgl-compact")}}}class Tr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(ze){const wt=++this._id;return this._queue.push({callback:ze,id:wt,cancelled:!1}),wt}remove(ze){const wt=this._currentlyRunning,Rt=wt?this._queue.concat(wt):this._queue;
20for(const wt of Rt)if(wt.id===ze)return void(wt.cancelled=!0)}run(ze=0){const wt=this._currentlyRunning=this._queue;this._queue=[];for(const Rt of wt)if(!Rt.cancelled&&(Rt.callback(ze),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Er(wt,Rt,Xt){if(wt=new ze.LngLat(wt.lng,wt.lat),Rt){const sr=new ze.LngLat(wt.lng-360,wt.lat),Dr=new ze.LngLat(wt.lng+360,wt.lat),Lr=360*Math.ceil(Math.abs(wt.lng-Xt.center.lng)/360),Ur=Xt.locationPoint(wt).distSqr(Rt),qr=Rt.x<0||Rt.y<0||Rt.x>Xt.width||Rt.y>Xt.height;Xt.locationPoint(sr).distSqr(Rt)<Ur&&(qr||Math.abs(sr.lng-Xt.center.lng)<Lr)?wt=sr:Xt.locationPoint(Dr).distSqr(Rt)<Ur&&(qr||Math.abs(Dr.lng-Xt.center.lng)<Lr)&&(wt=Dr)}for(;Math.abs(wt.lng-Xt.center.lng)>180;){const ze=Xt.locationPoint(wt);if(ze.x>=0&&ze.y>=0&&ze.x<=Xt.width&&ze.y<=Xt.height)break;wt.lng>Xt.center.lng?wt.lng-=360:wt.lng+=360}return wt}const iu={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 Sr(ze,wt,Rt){const Xt=ze.classList;for(const ze in iu)Xt.remove(`mapboxgl-${Rt}-anchor-${ze}`);Xt.add(`mapboxgl-${Rt}-anchor-${wt}`)}class Ir extends ze.Evented{constructor(wt,Rt){if(super(),(wt instanceof ze.window.HTMLElement||Rt)&&(wt=ze.extend({element:wt},Rt)),ze.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=wt&&wt.anchor||"center",this._color=wt&&wt.color||"#3FB1CE",this._scale=wt&&wt.scale||1,this._draggable=wt&&wt.draggable||!1,this._clickTolerance=wt&&wt.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=wt&&wt.rotation||0,this._rotationAlignment=wt&&wt.rotationAlignment||"auto",this._pitchAlignment=wt&&wt.pitchAlignment&&"auto"!==wt.pitchAlignment?wt.pitchAlignment:this._rotationAlignment,wt&&wt.element)this._element=wt.element,this._offset=ze.pointGeometry.convert(wt&&wt.offset||[0,0]);else{this._defaultMarker=!0,this._element=Xt.create("div"),this._element.setAttribute("aria-label","Map marker");const Rt=Xt.createNS("http://www.w3.org/2000/svg","svg"),sr=41,Dr=27;Rt.setAttributeNS(null,"display","block"),Rt.setAttributeNS(null,"height",`${sr}px`),Rt.setAttributeNS(null,"width",`${Dr}px`),Rt.setAttributeNS(null,"viewBox",`0 0 ${Dr} ${sr}`);const Lr=Xt.createNS("http://www.w3.org/2000/svg","g");Lr.setAttributeNS(null,"stroke","none"),Lr.setAttributeNS(null,"stroke-width","1"),Lr.setAttributeNS(null,"fill","none"),Lr.setAttributeNS(null,"fill-rule","evenodd");const Ur=Xt.createNS("http://www.w3.org/2000/svg","g");Ur.setAttributeNS(null,"fill-rule","nonzero");const qr=Xt.createNS("http://www.w3.org/2000/svg","g");qr.setAttributeNS(null,"transform","translate(3.0, 29.0)"),qr.setAttributeNS(null,"fill","#000000");const ri=[{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 ze of ri){const wt=Xt.createNS("http://www.w3.org/2000/svg","ellipse");wt.setAttributeNS(null,"opacity","0.04"),wt.setAttributeNS(null,"cx","10.5"),wt.setAttributeNS(null,"cy","5.80029008"),wt.setAttributeNS(null,"rx",ze.rx),wt.setAttributeNS(null,"ry",ze.ry),qr.appendChild(wt)}const ai=Xt.createNS("http://www.w3.org/2000/svg","g");ai.setAttributeNS(null,"fill",this._color);const Yi=Xt.createNS("http://www.w3.org/2000/svg","path");Yi.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"),ai.appendChild(Yi);const Ji=Xt.createNS("http://www.w3.org/2000/svg","g");Ji.setAttributeNS(null,"opacity","0.25"),Ji.setAttributeNS(null,"fill","#000000");const Qi=Xt.createNS("http://www.w3.org/2000/svg","path");Qi.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"),Ji.appendChild(Qi);const kn=Xt.createNS("http://www.w3.org/2000/svg","g");kn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),kn.setAttributeNS(null,"fill","#FFFFFF");const jn=Xt.createNS("http://www.w3.org/2000/svg","g");jn.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Un=Xt.createNS("http://www.w3.org/2000/svg","circle");Un.setAttributeNS(null,"fill","#000000"),Un.setAttributeNS(null,"opacity","0.25"),Un.setAttributeNS(null,"cx","5.5"),Un.setAttributeNS(null,"cy","5.5"),Un.setAttributeNS(null,"r","5.4999962");const Wn=Xt.createNS("http://www.w3.org/2000/svg","circle");Wn.setAttributeNS(null,"fill","#FFFFFF"),Wn.setAttributeNS(null,"cx","5.5"),Wn.setAttributeNS(null,"cy","5.5"),Wn.setAttributeNS(null,"r","5.4999962"),jn.appendChild(Un),jn.appendChild(Wn),Ur.appendChild(qr),Ur.appendChild(ai),Ur.appendChild(Ji),Ur.appendChild(kn),Ur.appendChild(jn),Rt.appendChild(Ur),Rt.setAttributeNS(null,"height",sr*this._scale+"px"),Rt.setAttributeNS(null,"width",Dr*this._scale+"px"),this._element.appendChild(Rt),this._offset=ze.pointGeometry.convert(wt&&wt.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",ze=>{ze.preventDefault()}),this._element.addEventListener("mousedown",ze=>{ze.preventDefault()}),Sr(this._element,this._anchor,"marker"),this._popup=null}addTo(ze){return this.remove(),this._map=ze,ze.getCanvasContainer().appendChild(this._element),ze.on("move",this._update),ze.on("moveend",this._update),ze.on("remove",this._clearFadeTimer),ze._addMarker(this),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._map.off("remove",this._clearFadeTimer),this._map._removeMarker(this),delete this._map),this._clearFadeTimer(),Xt.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(wt){return this._lngLat=ze.LngLat.convert(wt),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(ze){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),ze){if(!("offset"in ze.options)){const wt=38.1,Rt=13.5,Xt=Math.sqrt(Math.pow(Rt,2)/2);ze.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
200,-wt],"bottom-left":[Xt,-1*(wt-Rt+Xt)],"bottom-right":[-Xt,-1*(wt-Rt+Xt)],left:[Rt,-1*(wt-Rt)],right:[-Rt,-1*(wt-Rt)]}:this._offset}this._popup=ze,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(ze){const wt=ze.code,Rt=ze.charCode||ze.keyCode;"Space"!==wt&&"Enter"!==wt&&32!==Rt&&13!==Rt||this.togglePopup()}_onMapClick(ze){const wt=ze.originalEvent.target,Rt=this._element;this._popup&&(wt===Rt||Rt.contains(wt))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const ze=this._popup;return ze?(ze.isOpen()?ze.remove():ze.addTo(this._map),this):this}_evaluateOpacity(){const ze=this._pos?this._pos.sub(this._transformedOffset()):null;if(!this._withinScreenBounds(ze))return void this._clearFadeTimer();const wt=this._map.unproject(ze);let Rt=!1;if(this._map.getTerrain()){const ze=this._map.getFreeCameraOptions();if(ze.position){const Xt=ze.position.toLngLat();Rt=Xt.distanceTo(wt)<.9*Xt.distanceTo(this._lngLat)}}const Xt=(1-this._map._queryFogOpacity(wt))*(Rt?.2:1);this._element.style.opacity=`${Xt}`,this._popup&&this._popup._setOpacity(`${Xt}`),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_withinScreenBounds(ze){const wt=this._map.transform;return!!ze&&ze.x>=0&&ze.x<wt.width&&ze.y>=0&&ze.y<wt.height}_update(ze){if(!this._map)return;
20this._map.transform.renderWorldCopies&&(this._lngLat=Er(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._transformedOffset());let wt="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?wt=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(wt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Rt="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?Rt="rotateX(0deg)":"map"===this._pitchAlignment&&(Rt=`rotateX(${this._map.getPitch()}deg)`),ze&&"moveend"!==ze.type||(this._pos=this._pos.round()),this._map._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&Xt.setTransform(this._element,`${iu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Rt} ${wt}`),!this._map.getTerrain()&&!this._map.getFog()||this._fadeTimer||(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})}_transformedOffset(){if(!this._defaultMarker)return this._offset;const ze=this._map.transform,wt=this._offset.mult(this._scale);return"map"===this._rotationAlignment&&wt._rotate(ze.angle),"map"===this._pitchAlignment&&(wt.y*=Math.cos(ze._pitch)),wt}getOffset(){return this._offset}setOffset(wt){return this._offset=ze.pointGeometry.convert(wt),this._update(),this}_onMove(wt){if(!this._isDragging){const ze=this._clickTolerance||this._map._clickTolerance;this._isDragging=wt.point.dist(this._pointerdownPos)>=ze}this._isDragging&&(this._pos=wt.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 ze.Event("dragstart"))),this.fire(new ze.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new ze.Event("dragend")),this._state="inactive"}_addDragHandler(ze){this._element.contains(ze.originalEvent.target)&&(ze.preventDefault(),this._positionDelta=ze.point.sub(this._pos).add(this._transformedOffset()),this._pointerdownPos=ze.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(ze){return this._draggable=!!ze,this._map&&(ze?(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(ze){return this._rotation=ze||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(ze){return this._rotationAlignment=ze||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(ze){return this._pitchAlignment=ze&&"auto"!==ze?ze:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}class Mr{constructor(ze){this.jumpTo(ze)}getValue(wt){if(wt<=this._startTime)return this._start;if(wt>=this._endTime)return this._end;const Rt=ze.easeCubicInOut((wt-this._startTime)/(this._endTime-this._startTime));return this._start*(1-Rt)+this._end*Rt}isEasing(ze){return ze>=this._startTime&&ze<=this._endTime}jumpTo(ze){this._startTime=-1/0,this._endTime=-1/0,this._start=ze,this._end=ze}easeTo(ze,wt,Rt){this._start=this.getValue(wt),this._end=ze,this._startTime=wt,this._endTime=wt+Rt}}const nu={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},{HTMLImageElement:ou,HTMLElement:au,ImageBitmap:su}=ze.window,lu={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileC
20acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0};function Rr(ze){ze.parentNode&&ze.parentNode.removeChild(ze)}const cu={showCompass:!0,showZoom:!0,visualizePitch:!1};class Fr{constructor(wt,Rt,sr=!1){this._clickTolerance=10,this.element=Rt,this.mouseRotate=new $o({clickTolerance:wt.dragRotate._mouseRotate._clickTolerance}),this.map=wt,sr&&(this.mousePitch=new Xo({clickTolerance:wt.dragRotate._mousePitch._clickTolerance})),ze.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Xt.addEventListener(Rt,"mousedown",this.mousedown),Xt.addEventListener(Rt,"touchstart",this.touchstart,{passive:!1}),Xt.addEventListener(Rt,"touchmove",this.touchmove),Xt.addEventListener(Rt,"touchend",this.touchend),Xt.addEventListener(Rt,"touchcancel",this.reset)}down(ze,wt){this.mouseRotate.mousedown(ze,wt),this.mousePitch&&this.mousePitch.mousedown(ze,wt),Xt.disableDrag()}move(ze,wt){const Rt=this.map,Xt=this.mouseRotate.mousemoveWindow(ze,wt);if(Xt&&Xt.bearingDelta&&Rt.setBearing(Rt.getBearing()+Xt.bearingDelta),this.mousePitch){const Xt=this.mousePitch.mousemoveWindow(ze,wt);Xt&&Xt.pitchDelta&&Rt.setPitch(Rt.getPitch()+Xt.pitchDelta)}}off(){const ze=this.element;Xt.removeEventListener(ze,"mousedown",this.mousedown),Xt.removeEventListener(ze,"touchstart",this.touchstart,{passive:!1}),Xt.removeEventListener(ze,"touchmove",this.touchmove),Xt.removeEventListener(ze,"touchend",this.touchend),Xt.removeEventListener(ze,"touchcancel",this.reset),this.offTemp()}offTemp(){Xt.enableDrag(),Xt.removeEventListener(ze.window,"mousemove",this.mousemove),Xt.removeEventListener(ze.window,"mouseup",this.mouseup)}mousedown(wt){this.down(ze.extend({},wt,{ctrlKey:!0,preventDefault:()=>wt.preventDefault()}),Xt.mousePos(this.element,wt)),Xt.addEventListener(ze.window,"mousemove",this.mousemove),Xt.addEventListener(ze.window,"mouseup",this.mouseup)}mousemove(ze){this.move(ze,Xt.mousePos(this.element,ze))}mouseup(ze){this.mouseRotate.mouseupWindow(ze),this.mousePitch&&this.mousePitch.mouseupWindow(ze),this.offTemp()}touchstart(ze){1!==ze.targetTouches.length?this.reset():(this._startPos=this._lastPos=Xt.touchPos(this.element,ze.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>ze.preventDefault()},this._startPos))}touchmove(ze){1!==ze.targetTouches.length?this.reset():(this._lastPos=Xt.touchPos(this.element,ze.targetTouches)[0],this.move({preventDefault:()=>ze.preventDefault()},this._lastPos))}touchend(ze){0===ze.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const hu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1};let pu,fu=0,mu=!1;const gu={maxWidth:100,unit:"metric"};function Zr(ze,wt,Rt){const Xt=Rt&&Rt.maxWidth||100,sr=ze._container.clientHeight/2,Dr=ze.unproject([0,sr]),Lr=ze.unproject([Xt,sr]),Ur=Dr.distanceTo(Lr);if(Rt&&"imperial"===Rt.unit){const Rt=3.2808*Ur;Rt>5280?Vr(wt,Xt,Rt/5280,ze._getUIString("ScaleControl.Miles"),ze):Vr(wt,Xt,Rt,ze._getUIString("ScaleControl.Feet"),ze)}else Rt&&"nautical"===Rt.unit?Vr(wt,Xt,Ur/1852,ze._getUIString("ScaleControl.NauticalMiles"),ze):Ur>=1e3?Vr(wt,Xt,Ur/1e3,ze._getUIString("ScaleControl.Kilometers"),ze):Vr(wt,Xt,Ur,ze._getUIString("ScaleControl.Meters"),ze)}function Vr(ze,wt,Rt,Xt,sr){const Dr=function(ze){const wt=Math.pow(10,`${Math.floor(ze)}`.length-1);let Rt=ze/wt;return Rt=Rt>=10?10:Rt>=5?5:Rt>=3?3:Rt>=2?2:Rt>=1?1:function(ze){const wt=Math.pow(10,Math.ceil(-Math.log(ze)/Math.LN10));return Math.round(ze*wt)/wt}(Rt),wt*Rt}(Rt),Lr=Dr/Rt;sr._requestDomTask(()=>{ze.style.width=wt*Lr+"px",ze.innerHTML=`${Dr} ${Xt}`})}const yu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"}
20,bu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Wr(wt){if(wt){if("number"==typeof wt){const Rt=Math.round(Math.sqrt(.5*Math.pow(wt,2)));return{center:new ze.pointGeometry(0,0),top:new ze.pointGeometry(0,wt),"top-left":new ze.pointGeometry(Rt,Rt),"top-right":new ze.pointGeometry(-Rt,Rt),bottom:new ze.pointGeometry(0,-wt),"bottom-left":new ze.pointGeometry(Rt,-Rt),"bottom-right":new ze.pointGeometry(-Rt,-Rt),left:new ze.pointGeometry(wt,0),right:new ze.pointGeometry(-wt,0)}}if(wt instanceof ze.pointGeometry||Array.isArray(wt)){const Rt=ze.pointGeometry.convert(wt);return{center:Rt,top:Rt,"top-left":Rt,"top-right":Rt,bottom:Rt,"bottom-left":Rt,"bottom-right":Rt,left:Rt,right:Rt}}return{center:ze.pointGeometry.convert(wt.center||[0,0]),top:ze.pointGeometry.convert(wt.top||[0,0]),"top-left":ze.pointGeometry.convert(wt["top-left"]||[0,0]),"top-right":ze.pointGeometry.convert(wt["top-right"]||[0,0]),bottom:ze.pointGeometry.convert(wt.bottom||[0,0]),"bottom-left":ze.pointGeometry.convert(wt["bottom-left"]||[0,0]),"bottom-right":ze.pointGeometry.convert(wt["bottom-right"]||[0,0]),left:ze.pointGeometry.convert(wt.left||[0,0]),right:ze.pointGeometry.convert(wt.right||[0,0])}}return Wr(new ze.pointGeometry(0,0))}const vu={version:ze.version,supported:wt,setRTLTextPlugin:ze.setRTLTextPlugin,getRTLTextPluginStatus:ze.getRTLTextPluginStatus,Map:class extends yr{constructor(wt){if(null!=(wt=ze.extend({},lu,wt)).minZoom&&null!=wt.maxZoom&&wt.minZoom>wt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=wt.minPitch&&null!=wt.maxPitch&&wt.minPitch>wt.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=wt.minPitch&&wt.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=wt.maxPitch&&wt.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new To(wt.minZoom,wt.maxZoom,wt.minPitch,wt.maxPitch,wt.renderWorldCopies),wt),this._interactive=wt.interactive,this._maxTileCacheSize=wt.maxTileCacheSize,this._failIfMajorPerformanceCaveat=wt.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=wt.preserveDrawingBuffer,this._antialias=wt.antialias,this._trackResize=wt.trackResize,this._bearingSnap=wt.bearingSnap,this._refreshExpiredTiles=wt.refreshExpiredTiles,this._fadeDuration=wt.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=wt.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=wt.collectResourceTiming,this._optimizeForTerrain=wt.optimizeForTerrain,this._renderTaskQueue=new Tr,this._domRenderTaskQueue=new Tr,this._controls=[],this._markers=[],this._mapId=ze.uniqueId(),this._locale=ze.extend({},nu,wt.locale),this._clickTolerance=wt.clickTolerance,this._averageElevationLastSampledAt=-1/0,this._averageElevation=new Mr(0),this._requestManager=new ze.RequestManager(wt.transformRequest,wt.accessToken,wt.testMode),this._silenceAuthErrors=!!wt.testMode,"string"==typeof wt.container){if(this._container=ze.window.document.getElementById(wt.container),!this._container)throw new Error(`Container '${wt.container}' not found.`)}else{if(!(wt.container instanceof au))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=wt.container}if(wt.maxBounds&&this.setMaxBounds(wt.maxBounds),ze.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),void 0!==ze.window&&(ze.window.addEventListener("online",this._onWindowOnline,!1),ze.window.addEventListener("resize",this._onWindowResize,!1),ze.window.addEventListener("orientationchange",this._onWindowResize,!1),ze.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1)),this.handlers=new xr(this,wt),this._hash=wt.hash&&new Co("str
20ing"==typeof wt.hash&&wt.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:wt.center,zoom:wt.zoom,bearing:wt.bearing,pitch:wt.pitch}),wt.bounds&&(this.resize(),this.fitBounds(wt.bounds,ze.extend({},wt.fitBoundsOptions,{duration:0})))),this.resize(),this._localFontFamily=wt.localFontFamily,this._localIdeographFontFamily=wt.localIdeographFontFamily,wt.style&&this.setStyle(wt.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),wt.attributionControl&&this.addControl(new br({customAttribution:wt.customAttribution})),this._logoControl=new wr,this.addControl(this._logoControl,wt.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",wt=>{this._update("style"===wt.dataType),this.fire(new ze.Event(`${wt.dataType}data`,wt))}),this.on("dataloading",wt=>{this.fire(new ze.Event(`${wt.dataType}dataloading`,wt))})}_getMapId(){return this._mapId}addControl(wt,Rt){if(void 0===Rt&&(Rt=wt.getDefaultPosition?wt.getDefaultPosition():"top-right"),!wt||!wt.onAdd)return this.fire(new ze.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const Xt=wt.onAdd(this);this._controls.push(wt);const sr=this._controlPositions[Rt];return-1!==Rt.indexOf("bottom")?sr.insertBefore(Xt,sr.firstChild):sr.appendChild(Xt),this}removeControl(wt){if(!wt||!wt.onRemove)return this.fire(new ze.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const Rt=this._controls.indexOf(wt);return Rt>-1&&this._controls.splice(Rt,1),wt.onRemove(this),this}hasControl(ze){return this._controls.indexOf(ze)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(wt){const Rt=this._containerDimensions(),Xt=Rt[0],sr=Rt[1];this._resizeCanvas(Xt,sr),this.transform.resize(Xt,sr),this.painter.resize(Xt,sr);const Dr=!this._moving;return Dr&&(this.stop(),this.fire(new ze.Event("movestart",wt)).fire(new ze.Event("move",wt))),this.fire(new ze.Event("resize",wt)),Dr&&this.fire(new ze.Event("moveend",wt)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(wt){return this.transform.setMaxBounds(ze.LngLatBounds.convert(wt)),this._update()}setMinZoom(ze){if((ze=null==ze?-2:ze)>=-2&&ze<=this.transform.maxZoom)return this.transform.minZoom=ze,this._update(),this.getZoom()<ze&&this.setZoom(ze),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(ze){if((ze=null==ze?22:ze)>=this.transform.minZoom)return this.transform.maxZoom=ze,this._update(),this.getZoom()>ze&&this.setZoom(ze),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(ze){if((ze=null==ze?0:ze)<0)throw new Error("minPitch must be greater than or equal to 0");if(ze>=0&&ze<=this.transform.maxPitch)return this.transform.minPitch=ze,this._update(),this.getPitch()<ze&&this.setPitch(ze),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(ze){if((ze=null==ze?85:ze)>85)throw new Error("maxPitch must be less than or equal to 85");if(ze>=this.transform.minPitch)return this.transform.maxPitch=ze,this._update(),this.getPitch()>ze&&this.setPitch(ze),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(ze){return this.transform.renderWorldCopies=ze,this._update()}project(wt){return this.transform.locationPoint3D(ze.LngLat.convert(wt))}unproject(wt){return this.transform.pointLocation3D(ze.pointGeometry.convert(wt))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()}
20_createDelegatedListener(ze,wt,Rt){if("mouseenter"===ze||"mouseover"===ze){let Xt=!1;const r=sr=>{const Dr=this.getLayer(wt)?this.queryRenderedFeatures(sr.point,{layers:[wt]}):[];Dr.length?Xt||(Xt=!0,Rt.call(this,new Ro(ze,this,sr.originalEvent,{features:Dr}))):Xt=!1};return{layer:wt,listener:Rt,delegates:{mousemove:r,mouseout:()=>{Xt=!1}}}}if("mouseleave"===ze||"mouseout"===ze){let Xt=!1;const r=sr=>{(this.getLayer(wt)?this.queryRenderedFeatures(sr.point,{layers:[wt]}):[]).length?Xt=!0:Xt&&(Xt=!1,Rt.call(this,new Ro(ze,this,sr.originalEvent)))},a=wt=>{Xt&&(Xt=!1,Rt.call(this,new Ro(ze,this,wt.originalEvent)))};return{layer:wt,listener:Rt,delegates:{mousemove:r,mouseout:a}}}{const o=ze=>{const Xt=this.getLayer(wt)?this.queryRenderedFeatures(ze.point,{layers:[wt]}):[];Xt.length&&(ze.features=Xt,Rt.call(this,ze),delete ze.features)};return{layer:wt,listener:Rt,delegates:{[ze]:o}}}}on(ze,wt,Rt){if(void 0===Rt)return super.on(ze,wt);const Xt=this._createDelegatedListener(ze,wt,Rt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[ze]=this._delegatedListeners[ze]||[],this._delegatedListeners[ze].push(Xt);for(const ze in Xt.delegates)this.on(ze,Xt.delegates[ze]);return this}once(ze,wt,Rt){if(void 0===Rt)return super.once(ze,wt);const Xt=this._createDelegatedListener(ze,wt,Rt);for(const ze in Xt.delegates)this.once(ze,Xt.delegates[ze]);return this}off(ze,wt,Rt){return void 0===Rt?super.off(ze,wt):(this._delegatedListeners&&this._delegatedListeners[ze]&&(()=>{const Xt=this._delegatedListeners[ze];for(let ze=0;ze<Xt.length;ze++){const sr=Xt[ze];if(sr.layer===wt&&sr.listener===Rt){for(const ze in sr.delegates)this.off(ze,sr.delegates[ze]);return Xt.splice(ze,1),this}}})(),this)}queryRenderedFeatures(wt,Rt){return this.style?(void 0!==Rt||void 0===wt||wt instanceof ze.pointGeometry||Array.isArray(wt)||(Rt=wt,wt=void 0),this.style.queryRenderedFeatures(wt=wt||[[0,0],[this.transform.width,this.transform.height]],Rt=Rt||{},this.transform)):[]}querySourceFeatures(ze,wt){return this.style.querySourceFeatures(ze,wt)}queryTerrainElevation(wt,Rt){const Xt=this.transform.elevation;return Xt?(Rt=ze.extend({},{exaggerated:!0},Rt),Xt.getAtPoint(ze.MercatorCoordinate.fromLngLat(wt),null,Rt.exaggerated)):null}setStyle(wt,Rt){return!1!==(Rt=ze.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},Rt)).diff&&Rt.localIdeographFontFamily===this._localIdeographFontFamily&&Rt.localFontFamily===this._localFontFamily&&this.style&&wt?(this._diffStyle(wt,Rt),this):(this._localIdeographFontFamily=Rt.localIdeographFontFamily,this._localFontFamily=Rt.localFontFamily,this._updateStyle(wt,Rt))}_getUIString(ze){const wt=this._locale[ze];if(null==wt)throw new Error(`Missing UI string '${ze}'`);return wt}_updateStyle(ze,wt){return this.style&&(this.style.setEventedParent(null),this.style._remove(),delete this.style),ze&&(this.style=new Ze(this,wt||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof ze?this.style.loadURL(ze):this.style.loadJSON(ze)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Ze(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(wt,Rt){if("string"==typeof wt){const Xt=this._requestManager.normalizeStyleURL(wt),sr=this._requestManager.transformRequest(Xt,ze.ResourceType.Style);ze.getJSON(sr,(wt,Xt)=>{wt?this.fire(new ze.ErrorEvent(wt)):Xt&&this._updateDiff(Xt,Rt)})}else"object"==typeof wt&&this._updateDiff(wt,Rt)}_updateDiff(wt,Rt){try{this.style.setState(wt)&&this._update(!0)}catch(Xt){ze.warnOnce(`Unable to perform style diff: ${Xt.message||Xt.error||Xt}. Rebuilding the style from scratch.`),this._updateStyle(wt,Rt)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():ze.warnOnce("There is no style added to the map.")}addSource(ze,wt){return this._lazyInitEmptyStyle(),this.style.addSource(ze,wt),this._update(!0)}isSourceLoaded(wt){const Rt=this.style&&this.style._getSourceCaches(wt);if(0!==Rt.length)return Rt.every(ze=>ze.loaded());this.fire(new ze.ErrorEvent(new Error(`There is no source with ID '${wt}'`)))}areTilesLoaded(){const ze=this.style&&this.style._sourceCaches;for(const wt in ze){const Rt=ze[wt]._tiles;for(const ze in Rt){const wt=Rt[ze];
20if("loaded"!==wt.state&&"errored"!==wt.state)return!1}}return!0}addSourceType(ze,wt,Rt){return this._lazyInitEmptyStyle(),this.style.addSourceType(ze,wt,Rt)}removeSource(ze){return this.style.removeSource(ze),this._updateTerrain(),this._update(!0)}getSource(ze){return this.style.getSource(ze)}addImage(wt,Rt,{pixelRatio:Xt=1,sdf:sr=!1,stretchX:Dr,stretchY:Lr,content:Ur}={}){if(this._lazyInitEmptyStyle(),Rt instanceof ou||su&&Rt instanceof su){const{width:qr,height:ri,data:ai}=ze.exported.getImageData(Rt);this.style.addImage(wt,{data:new ze.RGBAImage({width:qr,height:ri},ai),pixelRatio:Xt,stretchX:Dr,stretchY:Lr,content:Ur,sdf:sr,version:0})}else{if(void 0===Rt.width||void 0===Rt.height)return this.fire(new ze.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:qr,height:ri,data:ai}=Rt,Yi=Rt;this.style.addImage(wt,{data:new ze.RGBAImage({width:qr,height:ri},new Uint8Array(ai)),pixelRatio:Xt,stretchX:Dr,stretchY:Lr,content:Ur,sdf:sr,version:0,userImage:Yi}),Yi.onAdd&&Yi.onAdd(this,wt)}}}updateImage(wt,Rt){const Xt=this.style.getImage(wt);if(!Xt)return this.fire(new ze.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const sr=Rt instanceof ou||su&&Rt instanceof su?ze.exported.getImageData(Rt):Rt,{width:Dr,height:Lr,data:Ur}=sr;return void 0===Dr||void 0===Lr?this.fire(new ze.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):Dr!==Xt.data.width||Lr!==Xt.data.height?this.fire(new ze.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(Xt.data.replace(Ur,!(Rt instanceof ou||su&&Rt instanceof su)),void this.style.updateImage(wt,Xt))}hasImage(wt){return wt?!!this.style.getImage(wt):(this.fire(new ze.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(ze){this.style.removeImage(ze)}loadImage(wt,Rt){ze.getImage(this._requestManager.transformRequest(wt,ze.ResourceType.Image),(wt,Xt)=>{Rt(wt,Xt instanceof ou?ze.exported.getImageData(Xt):Xt)})}listImages(){return this.style.listImages()}addLayer(ze,wt){return this._lazyInitEmptyStyle(),this.style.addLayer(ze,wt),this._update(!0)}moveLayer(ze,wt){return this.style.moveLayer(ze,wt),this._update(!0)}removeLayer(ze){return this.style.removeLayer(ze),this._update(!0)}getLayer(ze){return this.style.getLayer(ze)}setLayerZoomRange(ze,wt,Rt){return this.style.setLayerZoomRange(ze,wt,Rt),this._update(!0)}setFilter(ze,wt,Rt={}){return this.style.setFilter(ze,wt,Rt),this._update(!0)}getFilter(ze){return this.style.getFilter(ze)}setPaintProperty(ze,wt,Rt,Xt={}){return this.style.setPaintProperty(ze,wt,Rt,Xt),this._update(!0)}getPaintProperty(ze,wt){return this.style.getPaintProperty(ze,wt)}setLayoutProperty(ze,wt,Rt,Xt={}){return this.style.setLayoutProperty(ze,wt,Rt,Xt),this._update(!0)}getLayoutProperty(ze,wt){return this.style.getLayoutProperty(ze,wt)}setLight(ze,wt={}){return this._lazyInitEmptyStyle(),this.style.setLight(ze,wt),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(ze){return this._lazyInitEmptyStyle(),this.style.setTerrain(ze),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(ze){return this._lazyInitEmptyStyle(),this.style.setFog(ze),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(wt){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(ze.LngLat.convert(wt),this.transform):0}setFeatureState(ze,wt){return this.style.setFeatureState(ze,wt),this._update()}removeFeatureState(ze,wt){return this.style.removeFeatureState(ze,wt),this._update()}getFeatureState(ze){return this.style.getFeatureState(ze)}_containerDimensions(){let ze=0,wt=0;return this._container&&(ze=this._container.clientWidth||400,wt=this._container.clientHeight||300),[ze,wt]}_detectMissingCSS(){"rgb(250, 128, 114)"!==ze.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&ze.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described
20in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const ze=this._container;ze.classList.add("mapboxgl-map"),(this._missingCSSCanary=Xt.create("div","mapboxgl-canary",ze)).style.visibility="hidden",this._detectMissingCSS();const wt=this._canvasContainer=Xt.create("div","mapboxgl-canvas-container",ze);this._interactive&&wt.classList.add("mapboxgl-interactive"),this._canvas=Xt.create("canvas","mapboxgl-canvas",wt),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const Rt=this._containerDimensions();this._resizeCanvas(Rt[0],Rt[1]);const sr=this._controlContainer=Xt.create("div","mapboxgl-control-container",ze),Dr=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ze=>{Dr[ze]=Xt.create("div",`mapboxgl-ctrl-${ze}`,sr)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(wt,Rt){const Xt=ze.exported.devicePixelRatio||1;this._canvas.width=Xt*wt,this._canvas.height=Xt*Rt,this._canvas.style.width=`${wt}px`,this._canvas.style.height=`${Rt}px`}_addMarker(ze){this._markers.push(ze)}_removeMarker(ze){const wt=this._markers.indexOf(ze);-1!==wt&&this._markers.splice(wt,1)}_setupPainter(){const Rt=ze.extend({},wt.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),Xt=this._canvas.getContext("webgl",Rt)||this._canvas.getContext("experimental-webgl",Rt);Xt?(ze.storeAuthState(Xt,!0),this.painter=new _o(Xt,this.transform),this.on("data",ze=>{"source"===ze.dataType&&this.painter.setTileLoadedFlag(!0)}),ze.exported$1.testSupport(Xt)):this.fire(new ze.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(wt){wt.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new ze.Event("webglcontextlost",{originalEvent:wt}))}_contextRestored(wt){this._setupPainter(),this.resize(),this._update(),this.fire(new ze.Event("webglcontextrestored",{originalEvent:wt}))}_onMapScroll(ze){if(ze.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(ze){return this.style?(this._styleDirty=this._styleDirty||ze,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(ze){return this._update(),this._renderTaskQueue.add(ze)}_cancelRenderFrame(ze){this._renderTaskQueue.remove(ze)}_requestDomTask(ze){!this.isMoving()&&this.loaded()?ze():this._domRenderTaskQueue.add(ze)}_render(wt){let Rt;const Xt=this.painter.context.extTimerQuery,sr=ze.exported.now();this.listens("gpu-timing-frame")&&(Rt=Xt.createQueryEXT(),Xt.beginQueryEXT(Xt.TIME_ELAPSED_EXT,Rt));let Dr=this._updateAverageElevation(sr);if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(wt),this._domRenderTaskQueue.run(wt),this._removed)return;let Lr=!1;const Ur=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const wt=this.transform.zoom,Rt=ze.exported.now();this.style.zoomHistory.update(wt,Rt);const Xt=new ze.EvaluationParameters(wt,{now:Rt,fadeDuration:Ur,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),sr=Xt.crossFadingFactor();1===sr&&sr===this._crossFadingFactor||(Lr=!0,this._crossFadingFactor=sr),this.style.update(Xt)}if(this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,Ur,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:Ur,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),speedIndexTiming:this.speedIndexTiming}),this.fire(new ze.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new ze.Event("load"))),this.style&&(this.style.hasTransitions()||Lr)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const wt=ze.exported.now()-sr;Xt.endQueryEXT(Xt.TIME_ELAPSED_EXT,Rt),setTimeout(()=>{const sr=Xt.getQueryObjectEXT(Rt,Xt.QUERY_RESULT_EXT)/1e6;Xt.deleteQueryEXT(Rt),this.fire(new ze.Event("gpu-timing-frame",{cpuTime:wt,gpuTime:sr}))},50)}if(this.listens("gpu-timing-layer")){const wt=this.painter.collectGpuTimers();setTimeout(()=>{const Rt=this.painter.queryGpuTimers(wt);this.fire(new ze.Event("gpu-timing-layer",{layerTimes:Rt}))},50)}const qr=this._sourcesDirty||this._styleDirty||this._placementDirty||Dr;if(qr||this._repaint)this.triggerRepaint();else{const wt=!this.isMoving()&&this.loaded();if(wt&&(Dr=this._updateAverageElevation(sr,!0)),Dr)this.triggerRepaint();else if(this._triggerFrame(!1),wt&&(this.fire(new ze.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const wt=this._calculateSpeedIndex();this.fire(new ze.Event("speedindexcompleted",{speedIndex:wt})),this.speedIndexTiming=!1}}return!this._loaded||this._fullyLoaded||qr||(this._fullyLoaded=!0,this._authenticate()),this}_updateAverageElevation(ze,wt=!1){const i=ze=>(this.transform.averageElevation=ze,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);if((wt||ze-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(ze)){const wt=this.transform.averageElevation;let Rt=this.transform.sampleAverageElevation();isNaN(Rt)?Rt=0:this._averageElevationLastSampledAt=ze;const Xt=Math.abs(wt-Rt);if(Xt>1){if(this._isInitialLoad)return this._averageElevation.jumpTo(Rt),i(Rt);this._averageElevation.easeTo(Rt,ze,300)}else if(Xt>1e-4)return this._averageElevation.jumpTo(Rt),i(Rt)}return!!this._averageElevation.isEasing(ze)&&i(this._averageElevation.getValue(ze))}_authenticate(){ze.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,wt=>{if(wt&&(wt.message===ze.AUTH_ERR_MSG||401===wt.status)){const wt=this.painter.context.gl;ze.storeAuthState(wt,!1),this._logoControl instanceof wr&&this._logoControl._updateLogo(),wt&&wt.clear(wt.DEPTH_BUFFER_BIT|wt.COLOR_BUFFER_BIT|wt.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new ze.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),ze.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){this.painter.updateTerrain(this.style,this.isMoving()||this.isRotating()||this.isZooming())}_calculateSpeedIndex(){const ze=this.painter.canvasCopy(),wt=this.painter.getCanvasCopiesAndTimestamps();wt.timeStamps.push(performance.now());const Rt=this.painter.context.gl,Xt=Rt.createFramebuffer();function r(ze){Rt.framebufferTexture2D(Rt.FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,Rt.TEXTURE_2D,ze,0);const wt=new Uint8Array(Rt.drawingBufferWidth*Rt.drawingBufferHeight*4);return Rt.readPixels(0,0,Rt.drawingBufferWidth,Rt.drawingBufferHeight,Rt.RGBA,Rt.UNSIGNED_BYTE,wt),wt}return Rt.bindFramebuffer(Rt.FRAMEBUFFER,Xt),this._canvasPixelComparison(r(ze),wt.canvasCopies.map(r),wt.timeStamps)}_canvasPixelComparison(ze,wt,Rt){let Xt=Rt[1]-Rt[0];const sr=ze.length/4;for(let Dr=0;Dr<wt.length;Dr++){const Lr=wt[Dr];let Ur=0;for(let wt=0;wt<Lr.length;wt+=4)Lr[wt]===ze[wt]&&Lr[wt+1]===ze[wt+1]&&Lr[wt+2]===ze[wt+2]&&Lr[wt+3]===ze[wt+3]&&(Ur+=1);Xt+=(Rt[Dr+2]-Rt[Dr+1])*(1-Ur/sr)}return Xt}remove(){this._hash&&this._hash.remove();for(const ze of this._controls)ze.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==ze.window&&(ze.window.removeEventListener("resize",this._onWindowResize,!1),ze.window.removeEventListener("orientationchange",this._onWindowResize,!1),ze.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),ze.window.removeEventListener("online",this._onWindowOnline,!1));const wt=this.painter.context.gl.getExtension("WEBGL_lose_context");wt&&wt.loseContext(),Rr(this._canvasContainer),Rr(this._controlContainer),Rr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),ze.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new ze.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(wt){this._renderNextFrame=this._renderNextFrame||wt,this.style&&!this._frame&&(this._frame=ze.exported.frame(ze=>{const wt=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,wt&&this._render(ze)}))}_onWindowOnline(){this._update()}_onWindowResize(ze){this._trackResize&&this.resize({originalEvent:ze})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(ze){this._showTileBoundaries!==ze&&(this._showTileBoundaries=ze,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(ze){this._showTerrainWireframe!==ze&&(this._showTerrainWireframe=ze,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(ze){this._speedIndexTiming!==ze&&(this._speedIndexTiming=ze,this._update())}get showPadding(){return!!this._showPadding}set showPadding(ze){this._showPadding!==ze&&(this._showPadding=ze,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(ze){this._showCollisionBoxes!==ze&&(this._showCollisionBoxes=ze,ze?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(ze){this._showOverdrawInspector!==ze&&(this._showOverdrawInspector=ze,this._update())}get repaint(){return!!this._repaint}set repaint(ze){this._repaint!==ze&&(this._repaint=ze,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(ze){this._vertices=ze,this._update()}
20_setCacheLimits(wt,Rt){ze.setCacheLimits(wt,Rt)}get version(){return ze.version}},NavigationControl:class{constructor(wt){this.options=ze.extend({},cu,wt),this._container=Xt.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",ze=>ze.preventDefault()),this.options.showZoom&&(ze.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",ze=>this._map.zoomIn({},{originalEvent:ze})),Xt.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",ze=>this._map.zoomOut({},{originalEvent:ze})),Xt.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(ze.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",ze=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:ze}):this._map.resetNorth({},{originalEvent:ze})}),this._compassIcon=Xt.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}_updateZoomButtons(){const ze=this._map.getZoom(),wt=ze===this._map.getMaxZoom(),Rt=ze===this._map.getMinZoom();this._zoomInButton.disabled=wt,this._zoomOutButton.disabled=Rt,this._zoomInButton.setAttribute("aria-disabled",wt.toString()),this._zoomOutButton.setAttribute("aria-disabled",Rt.toString())}_rotateCompassArrow(){const ze=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._map._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=ze)})}onAdd(ze){return this._map=ze,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 Fr(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Xt.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(ze,wt){const Rt=Xt.create("button",ze,this._container);return Rt.type="button",Rt.addEventListener("click",wt),Rt}_setButtonTitle(ze,wt){const Rt=this._map._getUIString(`NavigationControl.${wt}`);ze.title=Rt,ze.setAttribute("aria-label",Rt)}},GeolocateControl:class extends ze.Evented{constructor(wt){super(),this.options=ze.extend({},hu,wt),ze.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation"],this),this._onDeviceOrientationListener=this._onDeviceOrientation.bind(this),this._updateMarkerRotationThrottled=Eo(this._updateMarkerRotation,20)}onAdd(wt){var Rt;return this._map=wt,this._container=Xt.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Rt=this._setupUI,void 0!==pu?Rt(pu):void 0!==ze.window.navigator.permissions?ze.window.navigator.permissions.query({name:"geolocation"}).then(ze=>{pu="denied"!==ze.state,Rt(pu)}):(pu=!!ze.window.navigator.geolocation,Rt(pu)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(ze.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(),Xt.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,fu=0,mu=!1}_isOutOfMapMaxBounds(ze){const wt=this._map.getMaxBounds(),Rt=ze.coords;return wt&&(Rt.longitude<wt.getWest()||Rt.longitude>wt.getEast()||Rt.latitude<wt.getSouth()||Rt.latitude>wt.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
20RROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(wt){if(this._map){if(this._isOutOfMapMaxBounds(wt))return this._setErrorState(),this.fire(new ze.Event("outofmaxbounds",wt)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=wt,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(wt),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(wt),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new ze.Event("geolocate",wt)),this._finish()}}_updateCamera(wt){const Rt=new ze.LngLat(wt.coords.longitude,wt.coords.latitude),Xt=wt.coords.accuracy,sr=this._map.getBearing(),Dr=ze.extend({bearing:sr},this.options.fitBoundsOptions);this._map.fitBounds(Rt.toBounds(Xt),Dr,{geolocateSource:!0})}_updateMarker(wt){if(wt){const Rt=new ze.LngLat(wt.coords.longitude,wt.coords.latitude);this._accuracyCircleMarker.setLngLat(Rt).addTo(this._map),this._userLocationDotMarker.setLngLat(Rt).addTo(this._map),this._accuracy=wt.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const ze=this._map._container.clientHeight/2,wt=this._map.unproject([0,ze]),Rt=this._map.unproject([100,ze]),Xt=wt.distanceTo(Rt)/100,sr=Math.ceil(2*this._accuracy/Xt);this._circleElement.style.width=`${sr}px`,this._circleElement.style.height=`${sr}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(wt){if(this._map){if(this.options.trackUserLocation)if(1===wt.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const ze=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ze,this._geolocateButton.setAttribute("aria-label",ze),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===wt.code&&mu)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new ze.Event("error",wt)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(wt){if(this._container.addEventListener("contextmenu",ze=>ze.preventDefault()),this._geolocateButton=Xt.create("button","mapboxgl-ctrl-geolocate",this._container),Xt.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===wt){ze.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const wt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=wt,this._geolocateButton.setAttribute("aria-label",wt)}else{const ze=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=ze,this._geolocateButton.setAttribute("aria-label",ze)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
20se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Xt.create("div","mapboxgl-user-location"),this._dotElement.appendChild(Xt.create("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Xt.create("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Ir({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Xt.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ir({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",wt=>{wt.geolocateSource||"ACTIVE_LOCK"!==this._watchState||wt.originalEvent&&"resize"===wt.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new ze.Event("trackuserlocationend")))})}_onDeviceOrientation(ze){this._userLocationDotMarker&&(ze.webkitCompassHeading?this._heading=ze.webkitCompassHeading:!0===ze.absolute&&(this._heading=-1*ze.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return ze.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ze.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":fu--,mu=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new ze.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ze.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let wt;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),fu++,fu>1?(wt={maximumAge:6e5,timeout:0},mu=!0):(wt=this.options.positionOptions,mu=!1),this._geolocationWatchID=ze.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,wt),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else ze.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{ze.window.addEventListener("ondeviceorientationabsolute"in ze.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientationListener)};void 0!==ze.window.DeviceMotionEvent&&"function"==typeof ze.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(ze=>{"granted"===ze&&e()}).catch(console.error):e()}_clearWatch(){ze.window.navigator.geolocation.clearWatch(this._geolocationWatchID),ze.window.removeEventListener("deviceorientation",this._onDeviceOrientationListener),ze.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientationListener),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
20se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:br,ScaleControl:class{constructor(wt){this.options=ze.extend({},gu,wt),ze.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Zr(this._map,this._container,this.options)}onAdd(ze){return this._map=ze,this._container=Xt.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",ze.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Xt.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(ze){this.options.unit=ze,Zr(this._map,this._container,this.options)}},FullscreenControl:class{constructor(wt){this._fullscreen=!1,wt&&wt.container&&(wt.container instanceof ze.window.HTMLElement?this._container=wt.container:ze.warnOnce("Full screen control 'container' must be a DOM element.")),ze.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in ze.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in ze.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(wt){return this._map=wt,this._container||(this._container=this._map.getContainer()),this._controlContainer=Xt.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",ze.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){Xt.remove(this._controlContainer),this._map=null,ze.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!ze.window.document.fullscreenEnabled&&!ze.window.document.webkitFullscreenEnabled)}_setupUI(){const wt=this._fullscreenButton=Xt.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Xt.create("span","mapboxgl-ctrl-icon",wt).setAttribute("aria-hidden",!0),wt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),ze.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const ze=this._getTitle();this._fullscreenButton.setAttribute("aria-label",ze),this._fullscreenButton.title=ze}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(ze.window.document.fullscreenElement||ze.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?ze.window.document.exitFullscreen?ze.window.document.exitFullscreen():ze.window.document.webkitCancelFullScreen&&ze.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends ze.Evented{constructor(wt){super(),this.options=ze.extend(Object.create(yu),wt),ze.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(wt){return this._map&&this.remove(),this._map=wt,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new ze.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Xt.remove(this._content),this._container&&(Xt.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new ze.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(wt){return this._lngLat=ze.LngLat.convert(wt),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(wt){return this.setDOMContent(ze.window.document.createTextNode(wt))}setHTML(wt){const Rt=ze.window.document.createDocumentFragment(),Xt=ze.window.document.createElement("body");let sr;for(Xt.innerHTML=wt;sr=Xt.firstChild,sr;)Rt.appendChild(sr);return this.setDOMContent(Rt)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(ze){return this.options.maxWidth=ze,this._update(),this}setDOMContent(ze){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Xt.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(ze),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(ze){this._container&&this._container.classList.add(ze)}removeClassName(ze){this._container&&this._container.classList.remove(ze)}setOffset(ze){return this.options.offset=ze,this._update(),this}toggleClassName(ze){if(this._container)return this._container.classList.toggle(ze)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Xt.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(ze){this._update(ze.point)}_onMouseMove(ze){this._update(ze.point)}_onDrag(ze){this._update(ze.point)}_update(ze){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(this._container||(this._container=Xt.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=Xt.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(ze=>this._container.classList.add(ze)),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Er(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!ze)return;const wt=this._pos=this._trackPointer&&ze?ze:this._map.project(this._lngLat);let Rt=this.options.anchor;const sr=Wr(this.options.offset);if(!Rt){const ze=this._container.offsetWidth,Xt=this._container.offsetHeight;let Dr;Dr=wt.y+sr.bottom.y<Xt?["top"]:wt.y>this._map.transform.height-Xt?["bottom"]:[],wt.x<ze/2?Dr.push("left"):wt.x>this._map.transform.width-ze/2&&Dr.push("right"),Rt=0===Dr.length?"bottom":Dr.join("-")}const Dr=wt.add(sr[Rt]).round();this._map._requestDomTask(()=>{this._container&&Rt&&(Xt.setTransform(this._container,`${iu[Rt]} translate(${Dr.x}px,${Dr.y}px)`),Sr(this._container,Rt,"popup"))})}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const ze=this._container.querySelector(bu);ze&&ze.focus()}_onClose(){this.remove()}_setOpacity(ze){this._content&&(this._content.style.opacity=ze),this._tip&&(this._tip.style.opacity=ze)}},Marker:Ir,Style:Ze,LngLat:ze.LngLat,LngLatBounds:ze.LngLatBounds,Point:ze.pointGeometry,MercatorCoordinate:ze.MercatorCoordinate,FreeCameraOptions:bo,Evented:ze.Evented,config:ze.config,prewarm:function(){kt().acquire(Yn)},clearPrewarmedResources:function(){const ze=Jn;ze&&ze.isPreloaded()&&1===ze.numActive()&&(ze.release(Yn),Jn=null)},get accessToken(){return ze.config.ACCESS_TOKEN},set accessToken(wt){ze.config.ACCESS_TOKEN=wt},get baseApiUrl(){return ze.config.API_URL},set baseApiUrl(wt){ze.config.API_URL=wt},get workerCount(){return Lt.workerCount},set workerCount(ze){Lt.workerCount=ze},get maxParallelImageRequests(){return ze.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(wt){ze.config.MAX_PARALLEL_IMAGE_REQUESTS=wt},clearStorage(wt){ze.clearTileCache(wt)},workerUrl:"",workerClass:null,setNow:ze.exported.setNow,restoreNow:ze.exported.restoreNow};return vu}),Rt}()},9738:ze=>{"use strict";ze.exports=Math.abs},6329:ze=>{"use strict";ze.exports=Math.floor},3678:ze=>{"use strict";ze.exports=Number.isNaN||function isNaN(ze){return ze!=ze}},2264:ze=>{"use strict";ze.exports=Math.max},5730:ze=>{"use strict";ze.exports=Math.min},707:ze=>{"use strict";ze.exports=Math.pow},3862:ze=>{"use strict";ze.exports=Math.round},9550:(ze,wt,Rt)=>{"use strict";var Xt=Rt(3678);ze.exports=function sign(ze){return Xt(ze)||0===ze?ze:ze<0?-1:1}},2568:(ze,wt,Rt)=>{var Xt,sr,Dr,Lr,Ur;Xt=Rt(1012),sr=Rt(487).utf8,Dr=Rt(8738),Lr=Rt(487).bin,(Ur=function(ze,wt){ze.constructor==String?ze=wt&&"binary"===wt.encoding?Lr.stringToBytes(ze):sr.stringToBytes(ze):Dr(ze)?ze=Array.prototype.slice.call(ze,0):Array.isArray(ze)||ze.constructor===Uint8Array||(ze=ze.toString());for(var Rt=Xt.bytesToWords(ze),qr=8*ze.length,ri=1732584193,ai=-271733879,Yi=-1732584194,Ji=271733878,Qi=0;Qi<Rt.length;Qi++)Rt[Qi]=16711935&(Rt[Qi]<<8|Rt[Qi]>>>24)|4278255360&(Rt[Qi]<<24|Rt[Qi]>>>8);Rt[qr>>>5]|=128<<qr%32,Rt[14+(qr+64>>>9<<4)]=qr;var kn=Ur._ff,jn=Ur._gg,Un=Ur._hh,Wn=Ur._ii;for(Qi=0;Qi<Rt.length;Qi+=16){var Yn=ri,Jn=ai,Qn=Yi,Io=Ji;ri=kn(ri,ai,Yi,Ji,Rt[Qi+0],7,-680876936),Ji=kn(Ji,ri,ai,Yi,Rt[Qi+1],12,-389564586),Yi=kn(Yi,Ji,ri,ai,Rt[Qi+2],17,606105819),ai=kn(ai,Yi,Ji,ri,Rt[Qi+3],22,-1044525330),ri=kn(ri,ai,Yi,Ji,Rt[Qi+4],7,-176418897),Ji=kn(Ji,ri,ai,Yi,Rt[Qi+5],12,1200080426),Yi=kn(Yi,Ji,ri,ai,Rt[Qi+6],17,-1473231341),ai=kn(ai,Yi,Ji,ri,Rt[Qi+7],22,-45705983),ri=kn(ri,ai,Yi,Ji,Rt[Qi+8],7,1770035416),Ji=kn(Ji,ri,ai,Yi,Rt[Qi+9],12,-1958414417),Yi=kn(Yi,Ji,ri,ai,Rt[Qi+10],17,-42063),ai=kn(ai,Yi,Ji,ri,Rt[Qi+11],22,-1990404162),ri=kn(ri,ai,Yi,Ji,Rt[Qi+12],7,1804603682),Ji=kn(Ji,ri,ai,Yi,Rt[Qi+13],12,-40341101),Yi=kn(Yi,Ji,ri,ai,Rt[Qi+14],17,-1502002290),ri=jn(ri,ai=kn(ai,Yi,Ji,ri,Rt[Qi+15],22,1236535329),Yi,Ji,Rt[Qi+1],5,-165796510),Ji=jn(Ji,ri,ai,Yi,Rt[Qi+6],9,-1069501632),Yi=jn(Yi,Ji,ri,ai,Rt[Qi+11],14,643717713),ai=jn(ai,Yi,Ji,ri,Rt[Qi+0],20,-373897302),ri=jn(ri,ai,Yi,Ji,Rt[Qi+5],5,-701558691),Ji=jn(Ji,ri,ai,Yi,Rt[Qi+10],9,38016083),Yi=jn(Yi,Ji,ri,ai,Rt[Qi+15],14,-660478335),ai=jn(ai,Yi,Ji,ri,Rt[Qi+4],20,-405537848),ri=jn(ri,ai,Yi,Ji,Rt[Qi+9],5,568446438),Ji=jn(Ji,ri,ai,Yi,Rt[Qi+14],9,-1019803690),Yi=jn(Yi,Ji,ri,ai,Rt[Qi+3],14,-187363961),ai=jn(ai,Yi,Ji,ri,Rt[Qi+8],20,1163531501),ri=jn(ri,ai,Yi,Ji,Rt[Qi+13],5,-1444681467),Ji=jn(Ji,ri,ai,Yi,Rt[Qi+2],9,-51403784),Yi=jn(Yi,Ji,ri,ai,Rt[Qi+7],14,1735328473),ri=Un(ri,ai=jn(ai,Yi,Ji,ri,Rt[Qi+12],20,-1926607734),Yi,Ji,Rt[Qi+5],4,-378558),Ji=Un(Ji,ri,ai,Yi,Rt[Qi+8],11,-2022574463),Yi=Un(Yi,Ji,ri,ai,Rt[Qi+11],16,1839030562),ai=Un(ai,Yi,Ji,ri,Rt[Qi+14],23,-35309556),ri=Un(ri,ai,Yi,Ji,Rt[Qi+1],4,-1530992060),Ji=Un(Ji,ri,ai,Yi,Rt[Qi+4],11,1272893353),Yi=Un(Yi,Ji,ri,ai,Rt[Qi+7],16,-155497632),ai=Un(ai,Yi,Ji,ri,Rt[Qi+10],23,-1094730640),ri=Un(ri,ai,Yi,Ji,Rt[Qi+13],4,681279174),Ji=Un(Ji,ri,ai,Yi,Rt[Qi+0],11,-358537222),Yi=Un(Yi,Ji,ri,ai,Rt[Qi+3],16,-722521979),ai=Un(ai,Yi,Ji,ri,Rt[Qi+6],23,76029189),ri=Un(ri,ai,Yi,Ji,Rt[Qi+9],4,-640364487),Ji=Un(Ji,ri,ai,Yi,Rt[Qi+12],11,-421815835),Yi=Un(Yi,Ji,ri,ai,Rt[Qi+15],16,530742520),ri=Wn(ri,ai=Un(ai,Yi,Ji,ri,Rt[Qi+2],23,-995338651),Yi,Ji,Rt[Qi+0],6,-198630844),Ji=Wn(Ji,ri,ai,Yi,Rt[Qi+7],10,1126891415),Yi=Wn(Yi,Ji,ri,ai,Rt[Qi+14],15,-1416354905),ai=Wn(ai,Yi,Ji,ri,Rt[Qi+5],21,-57434055),ri=Wn(ri,ai,Yi,Ji,Rt[Qi+12],6,1700485571),Ji=Wn(Ji,ri,ai,Yi,Rt[Qi+3],10,-1894986606),Yi=Wn(Yi,Ji,ri,ai,Rt[Qi+10],15,-1051523),ai=Wn(ai,Yi,Ji,ri,Rt[Qi+1],21,-2054922799),ri=Wn(ri,ai,Yi,Ji,Rt[Qi+8],6,1873313359),Ji=Wn(Ji,ri,ai,Yi,Rt[Qi+15],10,-30611744),Yi=Wn(Yi,Ji,ri,ai,Rt[Qi+6],15,-1560198380),ai=Wn(ai,Yi,Ji,ri,Rt[Qi+13],21,1309151649),ri=Wn(ri,ai,Yi,Ji,Rt[Qi+4],6,-145523070),Ji=Wn(Ji,ri,ai,Yi,Rt[Qi+11],10,-1120210379),Yi=Wn(Yi,Ji,ri,ai,Rt[Qi+2],15,718787259),ai=Wn(ai,Yi,Ji,ri,Rt[Qi+9],21,-343485551),ri=ri+Yn>>>0,ai=ai+Jn>>>0,Yi=Yi+Qn>>>0,Ji=Ji+Io>>>0}return Xt.endian([ri,ai,Yi,Ji])})._ff=function(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur=ze+(wt&Rt|~wt&Xt)+(sr>>>0)+Lr;return(Ur<<Dr|Ur>>>32-Dr)+wt},Ur._gg=function(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur=ze+(wt&Xt|Rt&~Xt)+(sr>>>0)+Lr;return(Ur<<Dr|Ur>>>32-Dr)+wt},Ur._hh=function(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur=ze+(wt^Rt^Xt)+(sr>>>0)+Lr;return(Ur<<Dr|Ur>>>32-Dr)+wt},Ur._ii=function(ze,wt,Rt,Xt,sr,Dr,Lr){var Ur=ze+(Rt^(wt|~Xt))+(sr>>>0)+Lr;return(Ur<<Dr|Ur>>>32-Dr)+wt},Ur._blocksize=16,Ur._digestsize=16,ze.exports=function(ze,wt){if(null==ze)throw new Error("Illegal argument "+ze);var Rt=Xt.wordsToBytes(Ur(ze,wt));return wt&&wt.asBytes?Rt:wt&&wt.asString?Lr.bytesToString(Rt):Xt.bytesToHex(Rt)}},9365:(ze,wt)=>{var Rt,Xt,sr;Xt=[],void 0===(sr="function"==typeof(Rt=function(){"use strict";var ze="14.7.0";function isValidFormatter(ze){return"object"==typeof ze&&"function"==typeof ze.to&&"function"==typeof ze.from}function removeElement(ze){ze.parentElement.removeChild(ze)}function isSet(ze){return null!=ze}function preventDefault(ze){ze.preventDefault()}function unique(ze){return ze.filter(function(ze){return!this[ze]&&(this[ze]=!0)},{})}function closest(ze,wt){return Math.round(ze/wt)*wt}function offset(ze,wt){var Rt=ze.getBoundingClientRect(),Xt=ze.ownerDocument,sr=Xt.documentElement,Dr=getPageOffset(Xt);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(Dr.x=0),wt?Rt.top+Dr.y-sr.clientTop:Rt.left+Dr.x-sr.clientLeft}function isNumeric(ze){return"number"==typeof ze&&!isNaN(ze)&&isFinite(ze)}
20function addClassFor(ze,wt,Rt){Rt>0&&(addClass(ze,wt),setTimeout(function(){removeClass(ze,wt)},Rt))}function limit(ze){return Math.max(Math.min(ze,100),0)}function asArray(ze){return Array.isArray(ze)?ze:[ze]}function countDecimals(ze){var wt=(ze=String(ze)).split(".");return wt.length>1?wt[1].length:0}function addClass(ze,wt){ze.classList&&!/\s/.test(wt)?ze.classList.add(wt):ze.className+=" "+wt}function removeClass(ze,wt){ze.classList&&!/\s/.test(wt)?ze.classList.remove(wt):ze.className=ze.className.replace(new RegExp("(^|\\b)"+wt.split(" ").join("|")+"(\\b|$)","gi")," ")}function hasClass(ze,wt){return ze.classList?ze.classList.contains(wt):new RegExp("\\b"+wt+"\\b").test(ze.className)}function getPageOffset(ze){var wt=void 0!==window.pageXOffset,Rt="CSS1Compat"===(ze.compatMode||"");return{x:wt?window.pageXOffset:Rt?ze.documentElement.scrollLeft:ze.body.scrollLeft,y:wt?window.pageYOffset:Rt?ze.documentElement.scrollTop:ze.body.scrollTop}}function getActions(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function getSupportsPassive(){var ze=!1;try{var wt=Object.defineProperty({},"passive",{get:function(){ze=!0}});window.addEventListener("test",null,wt)}catch(ze){}return ze}function getSupportsTouchActionNone(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function subRangeRatio(ze,wt){return 100/(wt-ze)}function fromPercentage(ze,wt,Rt){return 100*wt/(ze[Rt+1]-ze[Rt])}function toPercentage(ze,wt){return fromPercentage(ze,ze[0]<0?wt+Math.abs(ze[0]):wt-ze[0],0)}function isPercentage(ze,wt){return wt*(ze[1]-ze[0])/100+ze[0]}function getJ(ze,wt){for(var Rt=1;ze>=wt[Rt];)Rt+=1;return Rt}function toStepping(ze,wt,Rt){if(Rt>=ze.slice(-1)[0])return 100;var Xt=getJ(Rt,ze),sr=ze[Xt-1],Dr=ze[Xt],Lr=wt[Xt-1],Ur=wt[Xt];return Lr+toPercentage([sr,Dr],Rt)/subRangeRatio(Lr,Ur)}function fromStepping(ze,wt,Rt){if(Rt>=100)return ze.slice(-1)[0];var Xt=getJ(Rt,wt),sr=ze[Xt-1],Dr=ze[Xt],Lr=wt[Xt-1];return isPercentage([sr,Dr],(Rt-Lr)*subRangeRatio(Lr,wt[Xt]))}function getStep(ze,wt,Rt,Xt){if(100===Xt)return Xt;var sr=getJ(Xt,ze),Dr=ze[sr-1],Lr=ze[sr];return Rt?Xt-Dr>(Lr-Dr)/2?Lr:Dr:wt[sr-1]?ze[sr-1]+closest(Xt-ze[sr-1],wt[sr-1]):Xt}function handleEntryPoint(wt,Rt,Xt){var sr;if("number"==typeof Rt&&(Rt=[Rt]),!Array.isArray(Rt))throw new Error("noUiSlider ("+ze+"): 'range' contains invalid value.");if(!isNumeric(sr="min"===wt?0:"max"===wt?100:parseFloat(wt))||!isNumeric(Rt[0]))throw new Error("noUiSlider ("+ze+"): 'range' value isn't numeric.");Xt.xPct.push(sr),Xt.xVal.push(Rt[0]),sr?Xt.xSteps.push(!isNaN(Rt[1])&&Rt[1]):isNaN(Rt[1])||(Xt.xSteps[0]=Rt[1]),Xt.xHighestCompleteStep.push(0)}function handleStepPoint(ze,wt,Rt){if(wt)if(Rt.xVal[ze]!==Rt.xVal[ze+1]){Rt.xSteps[ze]=fromPercentage([Rt.xVal[ze],Rt.xVal[ze+1]],wt,0)/subRangeRatio(Rt.xPct[ze],Rt.xPct[ze+1]);var Xt=(Rt.xVal[ze+1]-Rt.xVal[ze])/Rt.xNumSteps[ze],sr=Math.ceil(Number(Xt.toFixed(3))-1),Dr=Rt.xVal[ze]+Rt.xNumSteps[ze]*sr;Rt.xHighestCompleteStep[ze]=Dr}else Rt.xSteps[ze]=Rt.xHighestCompleteStep[ze]=Rt.xVal[ze]}function Spectrum(ze,wt,Rt){var Xt;this.xPct=[],this.xVal=[],this.xSteps=[Rt||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=wt;var sr=[];for(Xt in ze)ze.hasOwnProperty(Xt)&&sr.push([ze[Xt],Xt]);for(sr.length&&"object"==typeof sr[0][0]?sr.sort(function(ze,wt){return ze[0][0]-wt[0][0]}):sr.sort(function(ze,wt){return ze[0]-wt[0]}),Xt=0;Xt<sr.length;Xt++)handleEntryPoint(sr[Xt][1],sr[Xt][0],this);for(this.xNumSteps=this.xSteps.slice(0),Xt=0;Xt<this.xNumSteps.length;Xt++)handleStepPoint(Xt,this.xNumSteps[Xt],this)}Spectrum.prototype.getDistance=function(wt){var Rt,Xt=[];for(Rt=0;Rt<this.xNumSteps.length-1;Rt++){var sr=this.xNumSteps[Rt];if(sr&&wt/sr%1!=0)throw new Error("noUiSlider ("+ze+"): 'limit', 'margin' and 'padding' of "+this.xPct[Rt]+"% range must be divisible by step.");Xt[Rt]=fromPercentage(this.xVal,wt,Rt)}return Xt},Spectrum.prototype.getAbsoluteDistance=function(ze,wt,Rt){var Xt,sr=0;if(ze<this.xPct[this.xPct.length-1])for(;ze>this.xPct[sr+1];)sr++;else ze===this.xPct[this.xPct.length-1]&&(sr=this.xPct.length-2);Rt||ze!==this.xPct[sr+1]||sr++;var Dr=1,Lr=wt[sr],Ur=0,qr=0,ri=0,ai=0;for(Xt=Rt?(ze-this.xPct[sr])/(this.xPct[sr+1]-this.xPct[sr]):(this.xPct[sr+1]-ze)/(this.xPct[sr+1]-this.xPct[sr]);Lr>0;)Ur=this.xPct[sr+1+ai]-this.xPct[sr+ai],wt[sr+ai]*Dr+100-100*Xt>100?(qr=Ur*Xt,Dr=(Lr-100*Xt)/wt[sr+ai],Xt=1):(qr=wt[sr+ai]*Ur/100*Dr,Dr=0),Rt?(ri-=qr,this.xPct.length+ai>=1&&ai--):(ri+=qr,this.xPct.length-ai>=1&&ai++),Lr=wt[sr+ai]*Dr;return ze+ri},Spectrum.prototype.toStepping=function(ze){return ze=toStepping(this.xVal,this.xPct,ze)},Spectrum.prototype.fromStepping=function(ze){return fromStepping(this.xVal,this.xPct,ze)},Spectrum.prototype.getStep=function(ze){return ze=getStep(this.xPct,this.xSteps,this.snap,ze)},Spectrum.prototype.getDefaultStep=function(ze,wt,Rt){var Xt=getJ(ze,this.xPct);
20return(100===ze||wt&&ze===this.xPct[Xt-1])&&(Xt=Math.max(Xt-1,1)),(this.xVal[Xt]-this.xVal[Xt-1])/Rt},Spectrum.prototype.getNearbySteps=function(ze){var wt=getJ(ze,this.xPct);return{stepBefore:{startValue:this.xVal[wt-2],step:this.xNumSteps[wt-2],highestStep:this.xHighestCompleteStep[wt-2]},thisStep:{startValue:this.xVal[wt-1],step:this.xNumSteps[wt-1],highestStep:this.xHighestCompleteStep[wt-1]},stepAfter:{startValue:this.xVal[wt],step:this.xNumSteps[wt],highestStep:this.xHighestCompleteStep[wt]}}},Spectrum.prototype.countStepDecimals=function(){var ze=this.xNumSteps.map(countDecimals);return Math.max.apply(null,ze)},Spectrum.prototype.convert=function(ze){return this.getStep(this.toStepping(ze))};var wt={to:function(ze){return void 0!==ze&&ze.toFixed(2)},from:Number},Rt={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},Xt={tooltips:".__tooltips",aria:".__aria"};function validateFormat(wt){if(isValidFormatter(wt))return!0;throw new Error("noUiSlider ("+ze+"): 'format' requires 'to' and 'from' methods.")}function testStep(wt,Rt){if(!isNumeric(Rt))throw new Error("noUiSlider ("+ze+"): 'step' is not numeric.");wt.singleStep=Rt}function testKeyboardPageMultiplier(wt,Rt){if(!isNumeric(Rt))throw new Error("noUiSlider ("+ze+"): 'keyboardPageMultiplier' is not numeric.");wt.keyboardPageMultiplier=Rt}function testKeyboardDefaultStep(wt,Rt){if(!isNumeric(Rt))throw new Error("noUiSlider ("+ze+"): 'keyboardDefaultStep' is not numeric.");wt.keyboardDefaultStep=Rt}function testRange(wt,Rt){if("object"!=typeof Rt||Array.isArray(Rt))throw new Error("noUiSlider ("+ze+"): 'range' is not an object.");if(void 0===Rt.min||void 0===Rt.max)throw new Error("noUiSlider ("+ze+"): Missing 'min' or 'max' in 'range'.");if(Rt.min===Rt.max)throw new Error("noUiSlider ("+ze+"): 'range' 'min' and 'max' cannot be equal.");wt.spectrum=new Spectrum(Rt,wt.snap,wt.singleStep)}function testStart(wt,Rt){if(Rt=asArray(Rt),!Array.isArray(Rt)||!Rt.length)throw new Error("noUiSlider ("+ze+"): 'start' option is incorrect.");wt.handles=Rt.length,wt.start=Rt}function testSnap(wt,Rt){if(wt.snap=Rt,"boolean"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'snap' option must be a boolean.")}function testAnimate(wt,Rt){if(wt.animate=Rt,"boolean"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'animate' option must be a boolean.")}function testAnimationDuration(wt,Rt){if(wt.animationDuration=Rt,"number"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'animationDuration' option must be a number.")}function testConnect(wt,Rt){var Xt,sr=[!1];if("lower"===Rt?Rt=[!0,!1]:"upper"===Rt&&(Rt=[!1,!0]),!0===Rt||!1===Rt){for(Xt=1;Xt<wt.handles;Xt++)sr.push(Rt);sr.push(!1)}else{if(!Array.isArray(Rt)||!Rt.length||Rt.length!==wt.handles+1)throw new Error("noUiSlider ("+ze+"): 'connect' option doesn't match handle count.");sr=Rt}wt.connect=sr}function testOrientation(wt,Rt){switch(Rt){case"horizontal":wt.ort=0;break;case"vertical":wt.ort=1;break;default:throw new Error("noUiSlider ("+ze+"): 'orientation' option is invalid.")}}function testMargin(wt,Rt){if(!isNumeric(Rt))throw new Error("noUiSlider ("+ze+"): 'margin' option must be numeric.");0!==Rt&&(wt.margin=wt.spectrum.getDistance(Rt))}function testLimit(wt,Rt){if(!isNumeric(Rt))throw new Error("noUiSlider ("+ze+"): 'limit' option must be numeric.");if(wt.limit=wt.spectrum.getDistance(Rt),!wt.limit||wt.handles<2)throw new Error("noUiSlider ("+ze+"): 'limit' option is only supported on linear sliders with 2 or more handles.")}function testPadding(wt,Rt){var Xt;if(!isNumeric(Rt)&&!Array.isArray(Rt))throw new Error("noUiSlider ("+ze+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(Rt)&&2!==Rt.length&&!isNumeric(Rt[0])&&!isNumeric(Rt[1])
20)throw new Error("noUiSlider ("+ze+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==Rt){for(Array.isArray(Rt)||(Rt=[Rt,Rt]),wt.padding=[wt.spectrum.getDistance(Rt[0]),wt.spectrum.getDistance(Rt[1])],Xt=0;Xt<wt.spectrum.xNumSteps.length-1;Xt++)if(wt.padding[0][Xt]<0||wt.padding[1][Xt]<0)throw new Error("noUiSlider ("+ze+"): 'padding' option must be a positive number(s).");var sr=Rt[0]+Rt[1],Dr=wt.spectrum.xVal[0];if(sr/(wt.spectrum.xVal[wt.spectrum.xVal.length-1]-Dr)>1)throw new Error("noUiSlider ("+ze+"): 'padding' option must not exceed 100% of the range.")}}function testDirection(wt,Rt){switch(Rt){case"ltr":wt.dir=0;break;case"rtl":wt.dir=1;break;default:throw new Error("noUiSlider ("+ze+"): 'direction' option was not recognized.")}}function testBehaviour(wt,Rt){if("string"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'behaviour' must be a string containing options.");var Xt=Rt.indexOf("tap")>=0,sr=Rt.indexOf("drag")>=0,Dr=Rt.indexOf("fixed")>=0,Lr=Rt.indexOf("snap")>=0,Ur=Rt.indexOf("hover")>=0,qr=Rt.indexOf("unconstrained")>=0;if(Dr){if(2!==wt.handles)throw new Error("noUiSlider ("+ze+"): 'fixed' behaviour must be used with 2 handles");testMargin(wt,wt.start[1]-wt.start[0])}if(qr&&(wt.margin||wt.limit))throw new Error("noUiSlider ("+ze+"): 'unconstrained' behaviour cannot be used with margin or limit");wt.events={tap:Xt||Lr,drag:sr,fixed:Dr,snap:Lr,hover:Ur,unconstrained:qr}}function testTooltips(wt,Rt){if(!1!==Rt)if(!0===Rt){wt.tooltips=[];for(var Xt=0;Xt<wt.handles;Xt++)wt.tooltips.push(!0)}else{if(wt.tooltips=asArray(Rt),wt.tooltips.length!==wt.handles)throw new Error("noUiSlider ("+ze+"): must pass a formatter for all handles.");wt.tooltips.forEach(function(wt){if("boolean"!=typeof wt&&("object"!=typeof wt||"function"!=typeof wt.to))throw new Error("noUiSlider ("+ze+"): 'tooltips' must be passed a formatter or 'false'.")})}}function testAriaFormat(ze,wt){ze.ariaFormat=wt,validateFormat(wt)}function testFormat(ze,wt){ze.format=wt,validateFormat(wt)}function testKeyboardSupport(wt,Rt){if(wt.keyboardSupport=Rt,"boolean"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'keyboardSupport' option must be a boolean.")}function testDocumentElement(ze,wt){ze.documentElement=wt}function testCssPrefix(wt,Rt){if("string"!=typeof Rt&&!1!==Rt)throw new Error("noUiSlider ("+ze+"): 'cssPrefix' must be a string or `false`.");wt.cssPrefix=Rt}
vendor: 1,114 bytes, line 20
20function testCssClasses(wt,Rt){if("object"!=typeof Rt)throw new Error("noUiSlider ("+ze+"): 'cssClasses' must be an object.");if("string"==typeof wt.cssPrefix)for(var Xt in wt.cssClasses={},Rt)Rt.hasOwnProperty(Xt)&&(wt.cssClasses[Xt]=wt.cssPrefix+Rt[Xt]);else wt.cssClasses=Rt}function testOptions(Xt){var sr={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:wt,format:wt},Dr={step:{r:!1,t:testStep},keyboardPageMultiplier:{r:!1,t:testKeyboardPageMultiplier},keyboardDefaultStep:{r:!1,t:testKeyboardDefaultStep},start:{r:!0,t:testStart},connect:{r:!0,t:testConnect},direction:{r:!0,t:testDirection},snap:{r:!1,t:testSnap},animate:{r:!1,t:testAnimate},animationDuration:{r:!1,t:testAnimationDuration},range:{r:!0,t:testRange},orientation:{r:!1,t:testOrientation},margin:{r:!1,t:testMargin},limit:{r:!1,t:testLimit},padding:{r:!1,t:testPadding},behaviour:{r:!0,t:testBehaviour},ariaFormat:{r:!1,t:testAriaFormat},format:{r:!1,t:testFormat},tooltips:{r:!1,t:testTooltips},keyboardSupport:{r:!0,t:testKeyboardSupport},documentElement:{r:!1,t:testDocumentElement},cssPrefix:{r:!0,t:testCssPrefix}
20,cssClasses:{r:!0,t:testCssClasses}},Lr={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:Rt,keyboardPageMultiplier:5,keyboardDefaultStep:10};Xt.format&&!Xt.ariaFormat&&(Xt.ariaFormat=Xt.format),Object.keys(Dr).forEach(function(wt){if(!isSet(Xt[wt])&&void 0===Lr[wt]){if(Dr[wt].r)throw new Error("noUiSlider ("+ze+"): '"+wt+"' is required.");return!0}Dr[wt].t(sr,isSet(Xt[wt])?Xt[wt]:Lr[wt])}),sr.pips=Xt.pips;var Ur=document.createElement("div"),qr=void 0!==Ur.style.msTransform,ri=void 0!==Ur.style.transform;sr.transformRule=ri?"transform":qr?"msTransform":"webkitTransform";var ai=[["left","top"],["right","bottom"]];return sr.style=ai[sr.dir][sr.ort],sr}function scope(wt,Rt,sr){var Dr,Lr,Ur,qr,ri,ai,Yi=getActions(),Ji=getSupportsTouchActionNone()&&getSupportsPassive(),Qi=wt,kn=Rt.spectrum,jn=[],Un=[],Wn=[],Yn=0,Jn={},Qn=wt.ownerDocument,Io=Rt.documentElement||Qn.documentElement,Mo=Qn.body,jo=-1,zo=0,oa=1,la=2,ca="rtl"===Qn.dir||1===Rt.ort?0:100;function addNodeTo(ze,wt){var Rt=Qn.createElement("div");return wt&&addClass(Rt,wt),ze.appendChild(Rt),Rt}function addOrigin(ze,wt){var Xt=addNodeTo(ze,Rt.cssClasses.origin),sr=addNodeTo(Xt,Rt.cssClasses.handle);return addNodeTo(sr,Rt.cssClasses.touchArea),sr.setAttribute("data-handle",wt),Rt.keyboardSupport&&(sr.setAttribute("tabindex","0"),sr.addEventListener("keydown",function(ze){return eventKe
20ydown(ze,wt)})),sr.setAttribute("role","slider"),sr.setAttribute("aria-orientation",Rt.ort?"vertical":"horizontal"),0===wt?addClass(sr,Rt.cssClasses.handleLower):wt===Rt.handles-1&&addClass(sr,Rt.cssClasses.handleUpper),Xt}function addConnect(ze,wt){return!!wt&&addNodeTo(ze,Rt.cssClasses.connect)}function addElements(ze,wt){var Xt=addNodeTo(wt,Rt.cssClasses.connects);Lr=[],(Ur=[]).push(addConnect(Xt,ze[0]));for(var sr=0;sr<Rt.handles;sr++)Lr.push(addOrigin(wt,sr)),Wn[sr]=sr,Ur.push(addConnect(Xt,ze[sr+1]))}function addSlider(ze){return addClass(ze,Rt.cssClasses.target),0===Rt.dir?addClass(ze,Rt.cssClasses.ltr):addClass(ze,Rt.cssClasses.rtl),0===Rt.ort?addClass(ze,Rt.cssClasses.horizontal):addClass(ze,Rt.cssClasses.vertical),addClass(ze,"rtl"===getComputedStyle(ze).direction?Rt.cssClasses.textDirectionRtl:Rt.cssClasses.textDirectionLtr),addNodeTo(ze,Rt.cssClasses.base)}function addTooltip(ze,wt){return!!Rt.tooltips[wt]&&addNodeTo(ze.firstChild,Rt.cssClasses.tooltip)}function isSliderDisabled(){return Qi.hasAttribute("disabled")}function isHandleDisabled(ze){return Lr[ze].hasAttribute("disabled")}function removeTooltips(){ri&&(removeEvent("update"+Xt.tooltips),ri.forEach(function(ze){ze&&removeElement(ze)}),ri=null)}function tooltips(){removeTooltips(),ri=Lr.map(addTooltip),bindEvent("update"+Xt.tooltips,function(ze,wt,Xt){if(ri[wt]){var sr=ze[wt];!0!==Rt.tooltips[wt]&&(sr=Rt.tooltips[wt].to(Xt[wt])),ri[wt].innerHTML=sr}})}function aria(){removeEvent("update"+Xt.aria),bindEvent("update"+Xt.aria,function(ze,wt,Xt,sr,Dr){Wn.forEach(function(ze){var wt=Lr[ze],sr=checkHandlePosition(Un,ze,0,!0,!0,!0),Ur=checkHandlePosition(Un,ze,100,!0,!0,!0),qr=Dr[ze],ri=Rt.ariaFormat.to(Xt[ze]);sr=kn.fromStepping(sr).toFixed(1),Ur=kn.fromStepping(Ur).toFixed(1),qr=kn.fromStepping(qr).toFixed(1),wt.children[0].setAttribute("aria-valuemin",sr),wt.children[0].setAttribute("aria-valuemax",Ur),wt.children[0].setAttribute("aria-valuenow",qr),wt.children[0].setAttribute("aria-valuetext",ri)})})}function getGroup(wt,Rt,Xt){if("range"===wt||"steps"===wt)return kn.xVal;if("count"===wt){if(Rt<2)throw new Error("noUiSlider ("+ze+"): 'values' (>= 2) required for mode 'count'.");var sr=Rt-1,Dr=100/sr;for(Rt=[];sr--;)Rt[sr]=sr*Dr;Rt.push(100),wt="positions"}return"positions"===wt?Rt.map(function(ze){return kn.fromStepping(Xt?kn.getStep(ze):ze)}):"values"===wt?Xt?Rt.map(function(ze){return kn.fromStepping(kn.getStep(kn.toStepping(ze)))}):Rt:void 0}function generateSpread(ze,wt,Rt){function safeIncrement(ze,wt){return(ze+wt).toFixed(7)/1}var Xt={},sr=kn.xVal[0],Dr=kn.xVal[kn.xVal.length-1],Lr=!1,Ur=!1,qr=0;return(Rt=unique(Rt.slice().sort(function(ze,wt){return ze-wt})))[0]!==sr&&(Rt.unshift(sr),Lr=!0),Rt[Rt.length-1]!==Dr&&(Rt.push(Dr),Ur=!0),Rt.forEach(function(sr,Dr){var ri,ai,Yi,Ji,Qi,jn,Un,Wn,Yn,Jn,Qn=sr,Io=Rt[Dr+1],Mo="steps"===wt;if(Mo&&(ri=kn.xNumSteps[Dr]),ri||(ri=Io-Qn),!1!==Qn)for(void 0===Io&&(Io=Qn),ri=Math.max(ri,1e-7),ai=Qn;ai<=Io;ai=safeIncrement(ai,ri)){for(Wn=(Qi=(Ji=kn.toStepping(ai))-qr)/ze,Jn=Qi/(Yn=Math.round(Wn)),Yi=1;Yi<=Yn;Yi+=1)Xt[(jn=qr+Yi*Jn).toFixed(5)]=[kn.fromStepping(jn),0];Un=Rt.indexOf(ai)>-1?oa:Mo?la:zo,!Dr&&Lr&&ai!==Io&&(Un=0),ai===Io&&Ur||(Xt[Ji.toFixed(5)]=[ai,Un]),qr=Ji}}),Xt}function addMarking(ze,wt,Xt){var sr=Qn.createElement("div"),Dr=[];Dr[zo]=Rt.cssClasses.valueNormal,Dr[oa]=Rt.cssClasses.valueLarge,Dr[la]=Rt.cssClasses.valueSub;var Lr=[];Lr[zo]=Rt.cssClasses.markerNormal,Lr[oa]=Rt.cssClasses.markerLarge,Lr[la]=Rt.cssClasses.markerSub;var Ur=[Rt.cssClasses.valueHorizontal,Rt.cssClasses.valueVertical],qr=[Rt.cssClasses.markerHorizontal,Rt.cssClasses.markerVertical];function getClasses(ze,wt){var Xt=wt===Rt.cssClasses.value,sr=Xt?Dr:Lr;return wt+" "+(Xt?Ur:qr)[Rt.ort]+" "+sr[ze]}function addSpread(ze,Dr,Lr){if((Lr=wt?wt(Dr,Lr):Lr)!==jo){var Ur=addNodeTo(sr,!1);Ur.className=getClasses(Lr,Rt.cssClasses.marker),Ur.style[Rt.style]=ze+"%",Lr>zo&&((Ur=addNodeTo(sr,!1)).className=getClasses(Lr,Rt.cssClasses.value),Ur.setAttribute("data-value",Dr),Ur.style[Rt.style]=ze+"%",Ur.innerHTML=Xt.to(Dr))}}
20return addClass(sr,Rt.cssClasses.pips),addClass(sr,0===Rt.ort?Rt.cssClasses.pipsHorizontal:Rt.cssClasses.pipsVertical),Object.keys(ze).forEach(function(wt){addSpread(wt,ze[wt][0],ze[wt][1])}),sr}function removePips(){qr&&(removeElement(qr),qr=null)}function pips(ze){removePips();var wt=ze.mode,Rt=ze.density||1,Xt=ze.filter||!1,sr=generateSpread(Rt,wt,getGroup(wt,ze.values||!1,ze.stepped||!1)),Dr=ze.format||{to:Math.round};return qr=Qi.appendChild(addMarking(sr,Xt,Dr))}function baseSize(){var ze=Dr.getBoundingClientRect(),wt="offset"+["Width","Height"][Rt.ort];return 0===Rt.ort?ze.width||Dr[wt]:ze.height||Dr[wt]}function attachEvent(ze,wt,Xt,sr){var method=function(Dr){return!!(Dr=fixEvent(Dr,sr.pageOffset,sr.target||wt))&&!(isSliderDisabled()&&!sr.doNotReject)&&!(hasClass(Qi,Rt.cssClasses.tap)&&!sr.doNotReject)&&!(ze===Yi.start&&void 0!==Dr.buttons&&Dr.buttons>1)&&(!sr.hover||!Dr.buttons)&&(Ji||Dr.preventDefault(),Dr.calcPoint=Dr.points[Rt.ort],void Xt(Dr,sr))},Dr=[];return ze.split(" ").forEach(function(ze){wt.addEventListener(ze,method,!!Ji&&{passive:!0}),Dr.push([ze,method])}),Dr}function fixEvent(ze,wt,Rt){var Xt,sr,Dr=0===ze.type.indexOf("touch"),Lr=0===ze.type.indexOf("mouse"),Ur=0===ze.type.indexOf("pointer");if(0===ze.type.indexOf("MSPointer")&&(Ur=!0),"mousedown"===ze.type&&!ze.buttons&&!ze.touches)return!1;if(Dr){var isTouchOnTarget=function(ze){return ze.target===Rt||Rt.contains(ze.target)||ze.target.shadowRoot&&ze.target.shadowRoot.contains(Rt)};if("touchstart"===ze.type){var qr=Array.prototype.filter.call(ze.touches,isTouchOnTarget);if(qr.length>1)return!1;Xt=qr[0].pageX,sr=qr[0].pageY}else{var ri=Array.prototype.find.call(ze.changedTouches,isTouchOnTarget);if(!ri)return!1;Xt=ri.pageX,sr=ri.pageY}}return wt=wt||getPageOffset(Qn),(Lr||Ur)&&(Xt=ze.clientX+wt.x,sr=ze.clientY+wt.y),ze.pageOffset=wt,ze.points=[Xt,sr],ze.cursor=Lr||Ur,ze}function calcPointToPercentage(ze){var wt=100*(ze-offset(Dr,Rt.ort))/baseSize();return wt=limit(wt),Rt.dir?100-wt:wt}function getClosestHandle(ze){var wt=100,Rt=!1;return Lr.forEach(function(Xt,sr){if(!isHandleDisabled(sr)){var Dr=Un[sr],Lr=Math.abs(Dr-ze);(Lr<wt||Lr<=wt&&ze>Dr||100===Lr&&100===wt)&&(Rt=sr,wt=Lr)}}),Rt}function documentLeave(ze,wt){"mouseout"===ze.type&&"HTML"===ze.target.nodeName&&null===ze.relatedTarget&&eventEnd(ze,wt)}function eventMove(ze,wt){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===ze.buttons&&0!==wt.buttonsProperty)return eventEnd(ze,wt);var Xt=(Rt.dir?-1:1)*(ze.calcPoint-wt.startCalcPoint);moveHandles(Xt>0,100*Xt/wt.baseSize,wt.locations,wt.handleNumbers)}function eventEnd(ze,wt){wt.handle&&(removeClass(wt.handle,Rt.cssClasses.active),Yn-=1),wt.listeners.forEach(function(ze){Io.removeEventListener(ze[0],ze[1])}),0===Yn&&(removeClass(Qi,Rt.cssClasses.drag),setZindex(),ze.cursor&&(Mo.style.cursor="",Mo.removeEventListener("selectstart",preventDefault))),wt.handleNumbers.forEach(function(ze){fireEvent("change",ze),fireEvent("set",ze),fireEvent("end",ze)})}function eventStart(ze,wt){if(wt.handleNumbers.some(isHandleDisabled))return!1;var Xt;1===wt.handleNumbers.length&&(Xt=Lr[wt.handleNumbers[0]].children[0],Yn+=1,addClass(Xt,Rt.cssClasses.active)),ze.stopPropagation();var sr=[],Dr=attachEvent(Yi.move,Io,eventMove,{target:ze.target,handle:Xt,listeners:sr,startCalcPoint:ze.calcPoint,baseSize:baseSize(),pageOffset:ze.pageOffset,handleNumbers:wt.handleNumbers,buttonsProperty:ze.buttons,locations:Un.slice()}),Ur=attachEvent(Yi.end,Io,eventEnd,{target:ze.target,handle:Xt,listeners:sr,doNotReject:!0,handleNumbers:wt.handleNumbers}),qr=attachEvent("mouseout",Io,documentLeave,{target:ze.target,handle:Xt,listeners:sr,doNotReject:!0,handleNumbers:wt.handleNumbers});sr.push.apply(sr,Dr.concat(Ur,qr)),ze.cursor&&(Mo.style.cursor=getComputedStyle(ze.target).cursor,Lr.length>1&&addClass(Qi,Rt.cssClasses.drag),Mo.addEventListener("selectstart",preventDefault,!1)),wt.handleNumbers.forEach(function(ze){fireEvent("start",ze)})}function eventTap(ze){ze.stopPropagation();var wt=calcPointToPercentage(ze.calcPoint),Xt=getClosestHandle(wt);if(!1===Xt)return!1;
20Rt.events.snap||addClassFor(Qi,Rt.cssClasses.tap,Rt.animationDuration),setHandle(Xt,wt,!0,!0),setZindex(),fireEvent("slide",Xt,!0),fireEvent("update",Xt,!0),fireEvent("change",Xt,!0),fireEvent("set",Xt,!0),Rt.events.snap&&eventStart(ze,{handleNumbers:[Xt]})}function eventHover(ze){var wt=calcPointToPercentage(ze.calcPoint),Rt=kn.getStep(wt),Xt=kn.fromStepping(Rt);Object.keys(Jn).forEach(function(ze){"hover"===ze.split(".")[0]&&Jn[ze].forEach(function(ze){ze.call(ai,Xt)})})}function eventKeydown(ze,wt){if(isSliderDisabled()||isHandleDisabled(wt))return!1;var Xt=["Left","Right"],sr=["Down","Up"],Dr=["PageDown","PageUp"],Lr=["Home","End"];Rt.dir&&!Rt.ort?Xt.reverse():Rt.ort&&!Rt.dir&&(sr.reverse(),Dr.reverse());var Ur,qr=ze.key.replace("Arrow",""),ri=qr===Dr[0],ai=qr===Dr[1],Yi=qr===sr[0]||qr===Xt[0]||ri,Ji=qr===sr[1]||qr===Xt[1]||ai,Qi=qr===Lr[0],Wn=qr===Lr[1];if(!(Yi||Ji||Qi||Wn))return!0;if(ze.preventDefault(),Ji||Yi){var Yn=Rt.keyboardPageMultiplier,Jn=Yi?0:1,Qn=getNextStepsForHandle(wt)[Jn];if(null===Qn)return!1;!1===Qn&&(Qn=kn.getDefaultStep(Un[wt],Yi,Rt.keyboardDefaultStep)),(ai||ri)&&(Qn*=Yn),Qn=Math.max(Qn,1e-7),Qn*=Yi?-1:1,Ur=jn[wt]+Qn}else Ur=Wn?Rt.spectrum.xVal[Rt.spectrum.xVal.length-1]:Rt.spectrum.xVal[0];return setHandle(wt,kn.toStepping(Ur),!0,!0),fireEvent("slide",wt),fireEvent("update",wt),fireEvent("change",wt),fireEvent("set",wt),!1}function bindSliderEvents(ze){ze.fixed||Lr.forEach(function(ze,wt){attachEvent(Yi.start,ze.children[0],eventStart,{handleNumbers:[wt]})}),ze.tap&&attachEvent(Yi.start,Dr,eventTap,{}),ze.hover&&attachEvent(Yi.move,Dr,eventHover,{hover:!0}),ze.drag&&Ur.forEach(function(wt,Xt){if(!1!==wt&&0!==Xt&&Xt!==Ur.length-1){var sr=Lr[Xt-1],Dr=Lr[Xt],qr=[wt];addClass(wt,Rt.cssClasses.draggable),ze.fixed&&(qr.push(sr.children[0]),qr.push(Dr.children[0])),qr.forEach(function(ze){attachEvent(Yi.start,ze,eventStart,{handles:[sr,Dr],handleNumbers:[Xt-1,Xt]})})}})}function bindEvent(ze,wt){Jn[ze]=Jn[ze]||[],Jn[ze].push(wt),"update"===ze.split(".")[0]&&Lr.forEach(function(ze,wt){fireEvent("update",wt)})}function isInternalNamespace(ze){return ze===Xt.aria||ze===Xt.tooltips}function removeEvent(ze){var wt=ze&&ze.split(".")[0],Rt=wt?ze.substring(wt.length):ze;Object.keys(Jn).forEach(function(ze){var Xt=ze.split(".")[0],sr=ze.substring(Xt.length);wt&&wt!==Xt||Rt&&Rt!==sr||isInternalNamespace(sr)&&Rt!==sr||delete Jn[ze]})}function fireEvent(ze,wt,Xt){Object.keys(Jn).forEach(function(sr){var Dr=sr.split(".")[0];ze===Dr&&Jn[sr].forEach(function(ze){ze.call(ai,jn.map(Rt.format.to),wt,jn.slice(),Xt||!1,Un.slice(),ai)})})}function checkHandlePosition(ze,wt,Xt,sr,Dr,Ur){var qr;return Lr.length>1&&!Rt.events.unconstrained&&(sr&&wt>0&&(qr=kn.getAbsoluteDistance(ze[wt-1],Rt.margin,0),Xt=Math.max(Xt,qr)),Dr&&wt<Lr.length-1&&(qr=kn.getAbsoluteDistance(ze[wt+1],Rt.margin,1),Xt=Math.min(Xt,qr))),Lr.length>1&&Rt.limit&&(sr&&wt>0&&(qr=kn.getAbsoluteDistance(ze[wt-1],Rt.limit,0),Xt=Math.min(Xt,qr)),Dr&&wt<Lr.length-1&&(qr=kn.getAbsoluteDistance(ze[wt+1],Rt.limit,1),Xt=Math.max(Xt,qr))),Rt.padding&&(0===wt&&(qr=kn.getAbsoluteDistance(0,Rt.padding[0],0),Xt=Math.max(Xt,qr)),wt===Lr.length-1&&(qr=kn.getAbsoluteDistance(100,Rt.padding[1],1),Xt=Math.min(Xt,qr))),!((Xt=limit(Xt=kn.getStep(Xt)))===ze[wt]&&!Ur)&&Xt}function inRuleOrder(ze,wt){var Xt=Rt.ort;return(Xt?wt:ze)+", "+(Xt?ze:wt)}function moveHandles(ze,wt,Rt,Xt){var sr=Rt.slice(),Dr=[!ze,ze],Lr=[ze,!ze];Xt=Xt.slice(),ze&&Xt.reverse(),Xt.length>1?Xt.forEach(function(ze,Rt){var Xt=checkHandlePosition(sr,ze,sr[ze]+wt,Dr[Rt],Lr[Rt],!1);!1===Xt?wt=0:(wt=Xt-sr[ze],sr[ze]=Xt)}):Dr=Lr=[!0];var Ur=!1;Xt.forEach(function(ze,Xt){Ur=setHandle(ze,Rt[ze]+wt,Dr[Xt],Lr[Xt])||Ur}),Ur&&Xt.forEach(function(ze){fireEvent("update",ze),fireEvent("slide",ze)})}function transformDirection(ze,wt){return Rt.dir?100-ze-wt:ze}function updateHandlePosition(ze,wt){Un[ze]=wt,jn[ze]=kn.fromStepping(wt);var Xt="translate("+inRuleOrder(10*(transformDirection(wt,0)-ca)+"%","0")+")";Lr[ze].style[Rt.transformRule]=Xt,updateConnect(ze),updateConnect(ze+1)}function setZindex(){Wn.forEach(function(ze){var wt=Un[ze]>50?-1:1,Rt=3+(Lr.length+wt*ze);Lr[ze].style.zIndex=Rt})}function setHandle(ze,wt,Rt,Xt,sr){return sr||(wt=checkHandlePosition(Un,ze,wt,Rt,Xt,!1)),!1!==wt&&(updateHandlePosition(ze,wt),!0)}function updateConnect(ze){if(Ur[ze]){var wt=0,Xt=100;0!==ze&&(wt=Un[ze-1]),ze!==Ur.length-1&&(Xt=Un[ze]);var sr=Xt-wt,Dr="translate("+inRuleOrder(transformDirection(wt,sr)+"%","0")+")",Lr="scale("+inRuleOrder(sr/100,"1")+")";Ur[ze].style[Rt.transformRule]=Dr+" "+Lr}}function resolveToValue(ze,wt){return null===ze||!1===ze||void 0===ze?Un[wt]:("number"==typeof ze&&(ze=String(ze)),ze=Rt.format.from(ze),!1===(ze=kn.toStepping(ze))||isNaN(ze)?Un[wt]:ze)}function valueSet(ze,wt,Xt){var sr=asArray(ze),Dr=void 0===Un[0];
20wt=void 0===wt||!!wt,Rt.animate&&!Dr&&addClassFor(Qi,Rt.cssClasses.tap,Rt.animationDuration),Wn.forEach(function(ze){setHandle(ze,resolveToValue(sr[ze],ze),!0,!1,Xt)});for(var Lr=1===Wn.length?0:1;Lr<Wn.length;++Lr)Wn.forEach(function(ze){setHandle(ze,Un[ze],!0,!0,Xt)});setZindex(),Wn.forEach(function(ze){fireEvent("update",ze),null!==sr[ze]&&wt&&fireEvent("set",ze)})}function valueReset(ze){valueSet(Rt.start,ze)}function valueSetHandle(wt,Rt,Xt,sr){if(!((wt=Number(wt))>=0&&wt<Wn.length))throw new Error("noUiSlider ("+ze+"): invalid handle number, got: "+wt);setHandle(wt,resolveToValue(Rt,wt),!0,!0,sr),fireEvent("update",wt),Xt&&fireEvent("set",wt)}function valueGet(){var ze=jn.map(Rt.format.to);return 1===ze.length?ze[0]:ze}function destroy(){for(var ze in removeEvent(Xt.aria),removeEvent(Xt.tooltips),Rt.cssClasses)Rt.cssClasses.hasOwnProperty(ze)&&removeClass(Qi,Rt.cssClasses[ze]);for(;Qi.firstChild;)Qi.removeChild(Qi.firstChild);delete Qi.noUiSlider}function getNextStepsForHandle(ze){var wt=Un[ze],Xt=kn.getNearbySteps(wt),sr=jn[ze],Dr=Xt.thisStep.step,Lr=null;if(Rt.snap)return[sr-Xt.stepBefore.startValue||null,Xt.stepAfter.startValue-sr||null];!1!==Dr&&sr+Dr>Xt.stepAfter.startValue&&(Dr=Xt.stepAfter.startValue-sr),Lr=sr>Xt.thisStep.startValue?Xt.thisStep.step:!1!==Xt.stepBefore.step&&sr-Xt.stepBefore.highestStep,100===wt?Dr=null:0===wt&&(Lr=null);var Ur=kn.countStepDecimals();return null!==Dr&&!1!==Dr&&(Dr=Number(Dr.toFixed(Ur))),null!==Lr&&!1!==Lr&&(Lr=Number(Lr.toFixed(Ur))),[Lr,Dr]}function getNextSteps(){return Wn.map(getNextStepsForHandle)}function updateOptions(ze,wt){var Xt=valueGet(),Dr=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];Dr.forEach(function(wt){void 0!==ze[wt]&&(sr[wt]=ze[wt])});var Lr=testOptions(sr);Dr.forEach(function(wt){void 0!==ze[wt]&&(Rt[wt]=Lr[wt])}),kn=Lr.spectrum,Rt.margin=Lr.margin,Rt.limit=Lr.limit,Rt.padding=Lr.padding,Rt.pips?pips(Rt.pips):removePips(),Rt.tooltips?tooltips():removeTooltips(),Un=[],valueSet(isSet(ze.start)?ze.start:Xt,wt)}function setupSlider(){Dr=addSlider(Qi),addElements(Rt.connect,Dr),bindSliderEvents(Rt.events),valueSet(Rt.start),Rt.pips&&pips(Rt.pips),Rt.tooltips&&tooltips(),aria()}return setupSlider(),ai={destroy,steps:getNextSteps,on:bindEvent,off:removeEvent,get:valueGet,set:valueSet,setHandle:valueSetHandle,reset:valueReset,__moveHandles:function(ze,wt,Rt){moveHandles(ze,wt,Un,Rt)},options:sr,updateOptions,target:Qi,removePips,removeTooltips,getTooltips:function(){return ri},getOrigins:function(){return Lr},pips}}function initialize(wt,Rt){if(!wt||!wt.nodeName)throw new Error("noUiSlider ("+ze+"): create requires a single element, got: "+wt);if(wt.noUiSlider)throw new Error("noUiSlider ("+ze+"): Slider was already initialized.");var Xt=scope(wt,testOptions(Rt),Rt);return wt.noUiSlider=Xt,Xt}return{__spectrum:Spectrum,version:ze,cssClasses:Rt,create:initialize}})?Rt.apply(wt,Xt):Rt)||(ze.exports=sr)},7418:ze=>{"use strict";var wt=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;ze.exports=function shouldUseNative(){try{if(!Object.assign)return!1;var ze=new String("abc");if(ze[5]="de","5"===Object.getOwnPropertyNames(ze)[0])return!1;for(var wt={},Rt=0;Rt<10;Rt++)wt["_"+String.fromCharCode(Rt)]=Rt;if("0123456789"!==Object.getOwnPropertyNames(wt).map(function(ze){return wt[ze]}).join(""))return!1;var Xt={};return"abcdefghijklmnopqrst".split("").forEach(function(ze){Xt[ze]=ze}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},Xt)).join("")}catch(ze){return!1}}()?Object.assign:function(ze,sr){for(var Dr,Lr,Ur=function toObject(ze){if(null==ze)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(ze)}(ze),qr=1;qr<arguments.length;qr++){for(var ri in Dr=Object(arguments[qr]))Rt.call(Dr,ri)&&(Ur[ri]=Dr[ri]);if(wt){Lr=wt(Dr);for(var ai=0;ai<Lr.length;ai++)Xt.call(Dr,Lr[ai])&&(Ur[Lr[ai]]=Dr[Lr[ai]])}}return Ur}},631:(ze,wt,Rt)=>{var Xt="function"==typeof Map&&Map.prototype,sr=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Dr=Xt&&sr&&"function"==typeof sr.get?sr.get:null,Lr=Xt&&Map.prototype.forEach,Ur="function"==typeof Set&&Set.prototype,qr=Object.getOwnPropertyDescriptor&&Ur?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ri=Ur&&qr&&"function"==typeof qr.get?qr.get:null,ai=Ur&&Set.prototype.forEach,Yi="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Ji="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Qi="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,kn=Boolean.prototype.valueOf,jn=Object.prototype.toString,Un=Function.prototype.toString,Wn=String.prototype.match,Yn=String.prototype.slice,Jn=String.prototype.replace,Qn=String.prototype.toUpperCase,Io=String.prototype.toLowerCase,Mo=RegExp.prototype.test,jo=Array.prototype.concat,zo=Array.prototype.join,oa=Array.prototype.slice,la=Math.floor,ca="function"==typeof BigInt?BigInt.prototype.valueOf:null,ua=Object.getOwnPropertySymbols,ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,pa="function"==typeof Symbol&&"object"==typeof Symbol.iterator,_a="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pa||"symbol")?Symbol.toStringTag:null,wa=Object.prototype.propertyIsEnumerable,Pa=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ze){return ze.__proto__}:null);function addNumericSeparator(ze,wt){if(ze===1/0||ze===-1/0||ze!=ze||ze&&ze>-1e3&&ze<1e3||Mo.call(/e/,wt))return wt;var Rt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof ze){var Xt=ze<0?-la(-ze):la(ze);
vendor: 10,640 bytes, line 20
20if(Xt!==ze){var sr=String(Xt),Dr=Yn.call(wt,sr.length+1);return Jn.call(sr,Rt,"$&_")+"."+Jn.call(Jn.call(Dr,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Jn.call(wt,Rt,"$&_")}var Oa=Rt(4654),Da=Oa.custom,La=isSymbol(Da)?Da:null,Ra={__proto__:null,double:'"',single:"'"},Na={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(ze,wt,Rt){var Xt=Rt.quoteStyle||wt,sr=Ra[Xt];return sr+ze+sr}function quote(ze){return Jn.call(String(ze),/"/g,""")}function canTrustToString(ze){return!_a||!("object"==typeof ze&&(_a in ze||void 0!==ze[_a]))}function isArray(ze){return"[object Array]"===toStr(ze)&&canTrustToString(ze)}function isRegExp(ze){return"[object RegExp]"===toStr(ze)&&canTrustToString(ze)}function isSymbol(ze){if(pa)return ze&&"object"==typeof ze&&ze instanceof Symbol;if("symbol"==typeof ze)return!0;if(!ze||"object"!=typeof ze||!ha)return!1;try{return ha.call(ze),!0}catch(ze){}return!1}ze.exports=function inspect_(ze,wt,Xt,sr){var Ur=wt||{};if(has(Ur,"quoteStyle")&&!has(Ra,Ur.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(Ur,"maxStringLength")&&("number"==typeof Ur.maxStringLength?Ur.maxStringLength<0&&Ur.maxStringLength!==1/0:null!==Ur.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var qr=!has(Ur,"customInspect")||Ur.customInspect;if("boolean"!=typeof qr&&"symbol"!==qr)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(Ur,"indent")&&null!==Ur.indent&&"\t"!==Ur.indent&&!(parseInt(Ur.indent,10)===Ur.indent&&Ur.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(Ur,"numericSeparator")&&"boolean"!=typeof Ur.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var jn=Ur.numericSeparator;if(void 0===ze)return"undefined";if(null===ze)return"null";if("boolean"==typeof ze)return ze?"true":"false";if("string"==typeof ze)return inspectString(ze,Ur);if("number"==typeof ze){if(0===ze)return 1/0/ze>0?"0":"-0";var Qn=String(ze);return jn?addNumericSeparator(ze,Qn):Qn}if("bigint"==typeof ze){var Mo=String(ze)+"n";return jn?addNumericSeparator(ze,Mo):Mo}var la=void 0===Ur.depth?5:Ur.depth;if(void 0===Xt&&(Xt=0),Xt>=la&&la>0&&"object"==typeof ze)return isArray(ze)?"[Array]":"[Object]";var ua=function getIndent(ze,wt){var Rt;if("\t"===ze.indent)Rt="\t";else{if(!("number"==typeof ze.indent&&ze.indent>0))return null;Rt=zo.call(Array(ze.indent+1)," ")}return{base:Rt,prev:zo.call(Array(wt+1),Rt)}}(Ur,Xt);if(void 0===sr)sr=[];else if(indexOf(sr,ze)>=0)return"[Circular]";function inspect(ze,wt,Rt){if(wt&&(sr=oa.call(sr)).push(wt),Rt){var Dr={depth:Ur.depth};return has(Ur,"quoteStyle")&&(Dr.quoteStyle=Ur.quoteStyle),inspect_(ze,Dr,Xt+1,sr)}return inspect_(ze,Ur,Xt+1,sr)}if("function"==typeof ze&&!isRegExp(ze)){var Da=function nameOf(ze){if(ze.name)return ze.name;var wt=Wn.call(Un.call(ze),/^function\s*([\w$]+)/);if(wt)return wt[1];return null}(ze),Na=arrObjKeys(ze,inspect);return"[Function"+(Da?": "+Da:" (anonymous)")+"]"+(Na.length>0?" { "+zo.call(Na,", ")+" }":"")}if(isSymbol(ze)){var Ba=pa?Jn.call(String(ze),/^(Symbol\(.*\))_[^)]*$/,"$1"):ha.call(ze);return"object"!=typeof ze||pa?Ba:markBoxed(Ba)}if(function isElement(ze){if(!ze||"object"!=typeof ze)return!1;if("undefined"!=typeof HTMLElement&&ze instanceof HTMLElement)return!0;return"string"==typeof ze.nodeName&&"function"==typeof ze.getAttribute}(ze)){for(var Ua="<"+Io.call(String(ze.nodeName)),qa=ze.attributes||[],rs=0;rs<qa.length;rs++)Ua+=" "+qa[rs].name+"="+wrapQuotes(quote(qa[rs].value),"double",Ur);return Ua+=">",ze.childNodes&&ze.childNodes.length&&(Ua+="..."),Ua+="</"+Io.call(String(ze.nodeName))+">"}if(isArray(ze)){if(0===ze.length)return"[]";var ss=arrObjKeys(ze,inspect);return ua&&!function singleLineValues(ze){for(var wt=0;wt<ze.length;wt++)if(indexOf(ze[wt],"\n")>=0)return!1;return!0}(ss)?"["+indentedJoin(ss,ua)+"]":"[ "+zo.call(ss,", ")+" ]"}if(function isError(ze){return"[object Error]"===toStr(ze)&&canTrustToString(ze)}(ze)){var _s=arrObjKeys(ze,inspect);return"cause"in Error.prototype||!("cause"in ze)||wa.call(ze,"cause")?0===_s.length?"["+String(ze)+"]":"{ ["+String(ze)+"] "+zo.call(_s,", ")+" }":"{ ["+String(ze)+"] "+zo.call(jo.call("[cause]: "+inspect(ze.cause),_s),", ")+" }"}if("object"==typeof ze&&qr){if(La&&"function"==typeof ze[La]&&Oa)return Oa(ze,{depth:la-Xt});if("symbol"!==qr&&"function"==typeof ze.inspect)return ze.inspect()}if(function isMap(ze){if(!Dr||!ze||"object"!=typeof ze)return!1;try{Dr.call(ze);try{ri.call(ze)}catch(ze){return!0}return ze instanceof Map}catch(ze){}return!1}(ze)){var Pl=[];return Lr&&Lr.call(ze,function(wt,Rt){Pl.push(inspect(Rt,ze,!0)+" => "+inspect(wt,ze))}),collectionOf("Map",Dr.call(ze),Pl,ua)}if(function isSet(ze){if(!ri||!ze||"object"!=typeof ze)return!1;try{ri.call(ze);try{Dr.call(ze)}catch(ze){return!0}return ze instanceof Set}catch(ze){}return!1}(ze)){var Cl=[];return ai&&ai.call(ze,function(wt){Cl.push(inspect(wt,ze))}),collectionOf("Set",ri.call(ze),Cl,ua)}if(function isWeakMap(ze){if(!Yi||!ze||"object"!=typeof ze)return!1;try{Yi.call(ze,Yi);try{Ji.call(ze,Ji)}catch(ze){return!0}return ze instanceof WeakMap}catch(ze){}return!1}(ze))return weakCollectionOf("WeakMap");if(function isWeakSet(ze){if(!Ji||!ze||"object"!=typeof ze)return!1;try{Ji.call(ze,Ji);try{Yi.call(ze,Yi)}catch(ze){return!0}return ze instanceof WeakSet}catch(ze){}return!1}(ze))return weakCollectionOf("WeakSet");if(function isWeakRef(ze){if(!Qi||!ze||"object"!=typeof ze)return!1;try{return Qi.call(ze),!0}catch(ze){}return!1}(ze))return weakCollectionOf("WeakRef");if(function isNumber(ze){return"[object Number]"===toStr(ze)&&canTrustToString(ze)}(ze))return markBoxed(inspect(Number(ze)));if(function isBigInt(ze){if(!ze||"object"!=typeof ze||!ca)return!1;try{return ca.call(ze),!0}catch(ze){}return!1}(ze))return markBoxed(inspect(ca.call(ze)));if(function isBoolean(ze){return"[object Boolean]"===toStr(ze)&&canTrustToString(ze)}(ze))return markBoxed(kn.call(ze));if(function isString(ze){return"[object String]"===toStr(ze)&&canTrustToString(ze)}(ze))return markBoxed(inspect(String(ze)));if("undefined"!=typeof window&&ze===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&ze===globalThis||void 0!==Rt.g&&ze===Rt.g)return"{ [object globalThis] }";if(!function isDate(ze){return"[object Date]"===toStr(ze)&&canTrustToString(ze)}(ze)&&!isRegExp(ze)){var Ol=arrObjKeys(ze,inspect),Dl=Pa?Pa(ze)===Object.prototype:ze instanceof Object||ze.constructor===Object,Ll=ze instanceof Object?"":"null prototype",Fl=!Dl&&_a&&Object(ze)===ze&&_a in ze?Yn.call(toStr(ze),8,-1):Ll?"Object":"",Vl=(Dl||"function"!=typeof ze.constructor?"":ze.constructor.name?ze.constructor.name+" ":"")+(Fl||Ll?"["+zo.call(jo.call([],Fl||[],Ll||[]),": ")+"] ":"");return 0===Ol.length?Vl+"{}":ua?Vl+"{"+indentedJoin(Ol,ua)+"}":Vl+"{ "+zo.call(Ol,", ")+" }"}return String(ze)};var Ba=Object.prototype.hasOwnProperty||function(ze){return ze in this};function has(ze,wt){return Ba.call(ze,wt)}function toStr(ze){return jn.call(ze)}function indexOf(ze,wt){if(ze.indexOf)return ze.indexOf(wt);for(var Rt=0,Xt=ze.length;Rt<Xt;Rt++)if(ze[Rt]===wt)return Rt;return-1}function inspectString(ze,wt){if(ze.length>wt.maxStringLength){var Rt=ze.length-wt.maxStringLength,Xt="... "+Rt+" more character"+(Rt>1?"s":"");return inspectString(Yn.call(ze,0,wt.maxStringLength),wt)+Xt}var sr=Na[wt.quoteStyle||"single"];return sr.lastIndex=0,wrapQuotes(Jn.call(Jn.call(ze,sr,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",wt)}function lowbyte(ze){var wt=ze.charCodeAt(0),Rt={8:"b",9:"t",10:"n",12:"f",13:"r"}[wt];return Rt?"\\"+Rt:"\\x"+(wt<16?"0":"")+Qn.call(wt.toString(16))}function markBoxed(ze){return"Object("+ze+")"}function weakCollectionOf(ze){return ze+" { ? }"}function collectionOf(ze,wt,Rt,Xt){return ze+" ("+wt+") {"+(Xt?indentedJoin(Rt,Xt):zo.call(Rt,", "))+"}"}function indentedJoin(ze,wt){if(0===ze.length)return"";var Rt="\n"+wt.prev+wt.base;return Rt+zo.call(ze,","+Rt)+"\n"+wt.prev}function arrObjKeys(ze,wt){var Rt=isArray(ze),Xt=[];if(Rt){Xt.length=ze.length;for(var sr=0;sr<ze.length;sr++)Xt[sr]=has(ze,sr)?wt(ze[sr],ze):""}var Dr,Lr="function"==typeof ua?ua(ze):[];if(pa){Dr={};for(var Ur=0;Ur<Lr.length;Ur++)Dr["$"+Lr[Ur]]=Lr[Ur]}for(var qr in ze)has(ze,qr)&&(Rt&&String(Number(qr))===qr&&qr<ze.length||pa&&Dr["$"+qr]instanceof Symbol||(Mo.call(/[^\w$]/,qr)?Xt.push(wt(qr,ze)+": "+wt(ze[qr],ze)):Xt.push(qr+": "+wt(ze[qr],ze))));if("function"==typeof ua)for(var ri=0;ri<Lr.length;ri++)wa.call(ze,Lr[ri])&&Xt.push("["+wt(Lr[ri])+"]: "+wt(ze[Lr[ri]],ze));return Xt}},5798:ze=>{"use strict";var wt=String.prototype.replace,Rt=/%20/g,Xt="RFC1738",sr="RFC3986";ze.exports={default:sr,formatters:{RFC1738:function(ze){return wt.call(ze,Rt,"+")},RFC3986:function(ze){return String(ze)}},RFC1738:Xt,RFC3986:sr}},129:(ze,wt,Rt)=>{"use strict";var Xt=Rt(8261),sr=Rt(5235),Dr=Rt(5798);ze.exports={formats:Dr,parse:sr,stringify:Xt}},5235:(ze,wt,Rt)=>{"use strict";var Xt=Rt(2769),sr=Object.prototype.hasOwnProperty,Dr=Array.isArray,Lr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Xt.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(ze){return ze.replace(/&#(\d+);/g,function(ze,wt){return String.fromCharCode(parseInt(wt,10))})},parseArrayValue=function(ze,wt,Rt){if(ze&&"string"==typeof ze&&wt.comma&&ze.indexOf(",")>-1)return ze.split(",");if(wt.throwOnLimitExceeded&&Rt>=wt.arrayLimit)throw new RangeError("Array limit exceeded. Only "+wt.arrayLimit+" element"+(1===wt.arrayLimit?"":"s")+" allowed in an array.");return ze},Ur=function parseQueryStringKeys(ze,wt,Rt,Dr){if(ze){var Lr=Rt.allowDots?ze.replace(/\.([^.[]+)/g,"[$1]"):ze,Ur=/(\[[^[\]]*])/g,qr=Rt.depth>0&&/(\[[^[\]]*])/.exec(Lr),ri=qr?Lr.slice(0,qr.index):Lr,ai=[];if(ri){if(!Rt.plainObjects&&sr.call(Object.prototype,ri)&&!Rt.allowPrototypes)return;ai.push(ri)}for(var Yi=0;Rt.depth>0&&null!==(qr=Ur.exec(Lr))&&Yi<Rt.depth;){if(Yi+=1,!Rt.plainObjects&&sr.call(Object.prototype,qr[1].slice(1,-1))&&!Rt.allowPrototypes)return;ai.push(qr[1])}if(qr){if(!0===Rt.strictDepth)throw new RangeError("Input depth exceeded depth option of "+Rt.depth+" and strictDepth is true");ai.push("["+Lr.slice(qr.index)+"]")}return function(ze,wt,Rt,sr){var Dr=0;
vendor: 10,000 bytes, line 20
20if(ze.length>0&&"[]"===ze[ze.length-1]){var Lr=ze.slice(0,-1).join("");Dr=Array.isArray(wt)&&wt[Lr]?wt[Lr].length:0}for(var Ur=sr?wt:parseArrayValue(wt,Rt,Dr),qr=ze.length-1;qr>=0;--qr){var ri,ai=ze[qr];if("[]"===ai&&Rt.parseArrays)ri=Rt.allowEmptyArrays&&(""===Ur||Rt.strictNullHandling&&null===Ur)?[]:Xt.combine([],Ur);else{ri=Rt.plainObjects?{__proto__:null}:{};var Yi="["===ai.charAt(0)&&"]"===ai.charAt(ai.length-1)?ai.slice(1,-1):ai,Ji=Rt.decodeDotInKeys?Yi.replace(/%2E/g,"."):Yi,Qi=parseInt(Ji,10);Rt.parseArrays||""!==Ji?!isNaN(Qi)&&ai!==Ji&&String(Qi)===Ji&&Qi>=0&&Rt.parseArrays&&Qi<=Rt.arrayLimit?(ri=[])[Qi]=Ur:"__proto__"!==Ji&&(ri[Ji]=Ur):ri={0:Ur}}Ur=ri}return Ur}(ai,wt,Rt,Dr)}};ze.exports=function(ze,wt){var Rt=function normalizeParseOptions(ze){if(!ze)return Lr;if(void 0!==ze.allowEmptyArrays&&"boolean"!=typeof ze.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==ze.decodeDotInKeys&&"boolean"!=typeof ze.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==ze.decoder&&void 0!==ze.decoder&&"function"!=typeof ze.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==ze.charset&&"utf-8"!==ze.charset&&"iso-8859-1"!==ze.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==ze.throwOnLimitExceeded&&"boolean"!=typeof ze.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var wt=void 0===ze.charset?Lr.charset:ze.charset,Rt=void 0===ze.duplicates?Lr.duplicates:ze.duplicates;if("combine"!==Rt&&"first"!==Rt&&"last"!==Rt)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===ze.allowDots?!0===ze.decodeDotInKeys||Lr.allowDots:!!ze.allowDots,allowEmptyArrays:"boolean"==typeof ze.allowEmptyArrays?!!ze.allowEmptyArrays:Lr.allowEmptyArrays,allowPrototypes:"boolean"==typeof ze.allowPrototypes?ze.allowPrototypes:Lr.allowPrototypes,allowSparse:"boolean"==typeof ze.allowSparse?ze.allowSparse:Lr.allowSparse,arrayLimit:"number"==typeof ze.arrayLimit?ze.arrayLimit:Lr.arrayLimit,charset:wt,charsetSentinel:"boolean"==typeof ze.charsetSentinel?ze.charsetSentinel:Lr.charsetSentinel,comma:"boolean"==typeof ze.comma?ze.comma:Lr.comma,decodeDotInKeys:"boolean"==typeof ze.decodeDotInKeys?ze.decodeDotInKeys:Lr.decodeDotInKeys,decoder:"function"==typeof ze.decoder?ze.decoder:Lr.decoder,delimiter:"string"==typeof ze.delimiter||Xt.isRegExp(ze.delimiter)?ze.delimiter:Lr.delimiter,depth:"number"==typeof ze.depth||!1===ze.depth?+ze.depth:Lr.depth,duplicates:Rt,ignoreQueryPrefix:!0===ze.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof ze.interpretNumericEntities?ze.interpretNumericEntities:Lr.interpretNumericEntities,parameterLimit:"number"==typeof ze.parameterLimit?ze.parameterLimit:Lr.parameterLimit,parseArrays:!1!==ze.parseArrays,plainObjects:"boolean"==typeof ze.plainObjects?ze.plainObjects:Lr.plainObjects,strictDepth:"boolean"==typeof ze.strictDepth?!!ze.strictDepth:Lr.strictDepth,strictNullHandling:"boolean"==typeof ze.strictNullHandling?ze.strictNullHandling:Lr.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof ze.throwOnLimitExceeded&&ze.throwOnLimitExceeded}}(wt);if(""===ze||null==ze)return Rt.plainObjects?{__proto__:null}:{};for(var qr="string"==typeof ze?function parseQueryStringValues(ze,wt){var Rt={__proto__:null},Ur=wt.ignoreQueryPrefix?ze.replace(/^\?/,""):ze;Ur=Ur.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var qr=wt.parameterLimit===1/0?void 0:wt.parameterLimit,ri=Ur.split(wt.delimiter,wt.throwOnLimitExceeded?qr+1:qr);if(wt.throwOnLimitExceeded&&ri.length>qr)throw new RangeError("Parameter limit exceeded. Only "+qr+" parameter"+(1===qr?"":"s")+" allowed.");var ai,Yi=-1,Ji=wt.charset;if(wt.charsetSentinel)for(ai=0;ai<ri.length;++ai)0===ri[ai].indexOf("utf8=")&&("utf8=%E2%9C%93"===ri[ai]?Ji="utf-8":"utf8=%26%2310003%3B"===ri[ai]&&(Ji="iso-8859-1"),Yi=ai,ai=ri.length);for(ai=0;ai<ri.length;++ai)if(ai!==Yi){var Qi,kn,jn=ri[ai],Un=jn.indexOf("]="),Wn=-1===Un?jn.indexOf("="):Un+1;-1===Wn?(Qi=wt.decoder(jn,Lr.decoder,Ji,"key"),kn=wt.strictNullHandling?null:""):(Qi=wt.decoder(jn.slice(0,Wn),Lr.decoder,Ji,"key"),kn=Xt.maybeMap(parseArrayValue(jn.slice(Wn+1),wt,Dr(Rt[Qi])?Rt[Qi].length:0),function(ze){return wt.decoder(ze,Lr.decoder,Ji,"value")})),kn&&wt.interpretNumericEntities&&"iso-8859-1"===Ji&&(kn=interpretNumericEntities(String(kn))),jn.indexOf("[]=")>-1&&(kn=Dr(kn)?[kn]:kn);var Yn=sr.call(Rt,Qi);Yn&&"combine"===wt.duplicates?Rt[Qi]=Xt.combine(Rt[Qi],kn):Yn&&"last"!==wt.duplicates||(Rt[Qi]=kn)}return Rt}(ze,Rt):ze,ri=Rt.plainObjects?{__proto__:null}:{},ai=Object.keys(qr),Yi=0;Yi<ai.length;++Yi){var Ji=ai[Yi],Qi=Ur(Ji,qr[Ji],Rt,"string"==typeof ze);ri=Xt.merge(ri,Qi,Rt)}return!0===Rt.allowSparse?ri:Xt.compact(ri)}},8261:(ze,wt,Rt)=>{"use strict";var Xt=Rt(7478),sr=Rt(2769),Dr=Rt(5798),Lr=Object.prototype.hasOwnProperty,Ur={brackets:function brackets(ze){return ze+"[]"},comma:"comma",indices:function indices(ze,wt){return ze+"["+wt+"]"},repeat:function repeat(ze){return ze}},qr=Array.isArray,ri=Array.prototype.push,pushToArray=function(ze,wt){ri.apply(ze,qr(wt)?wt:[wt])},ai=Date.prototype.toISOString,Yi=Dr.default,Ji={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:sr.encode,encodeValuesOnly:!1,filter:void 0,format:Yi,formatter:Dr.formatters[Yi],indices:!1,serializeDate:function serializeDate(ze){return ai.call(ze)},skipNulls:!1,strictNullHandling:!1},Qi={},kn=function stringify(ze,wt,Rt,Dr,Lr,Ur,ri,ai,Yi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Mo){for(var jo=ze,zo=Mo,oa=0,la=!1;void 0!==(zo=zo.get(Qi))&&!la;){var ca=zo.get(ze);if(oa+=1,void 0!==ca){if(ca===oa)throw new RangeError("Cyclic object value");la=!0}void 0===zo.get(Qi)&&(oa=0)}if("function"==typeof kn?jo=kn(wt,jo):jo instanceof Date?jo=Wn(jo):"comma"===Rt&&qr(jo)&&(jo=sr.maybeMap(jo,function(ze){return ze instanceof Date?Wn(ze):ze})),null===jo){if(Ur)return Yi&&!Qn?Yi(wt,Ji.encoder,Io,"key",Yn):wt;jo=""}if(function isNonNullishPrimitive(ze){return"string"==typeof ze||"number"==typeof ze||"boolean"==typeof ze||"symbol"==typeof ze||"bigint"==typeof ze}(jo)||sr.isBuffer(jo))return Yi?[Jn(Qn?wt:Yi(wt,Ji.encoder,Io,"key",Yn))+"="+Jn(Yi(jo,Ji.encoder,Io,"value",Yn))]:[Jn(wt)+"="+Jn(String(jo))];var ua,ha=[];if(void 0===jo)return ha;if("comma"===Rt&&qr(jo))Qn&&Yi&&(jo=sr.maybeMap(jo,Yi)),ua=[{value:jo.length>0?jo.join(",")||null:void 0}];else if(qr(kn))ua=kn;else{var pa=Object.keys(jo);ua=jn?pa.sort(jn):pa}var _a=ai?String(wt).replace(/\./g,"%2E"):String(wt),wa=Dr&&qr(jo)&&1===jo.length?_a+"[]":_a;if(Lr&&qr(jo)&&0===jo.length)return wa+"[]";for(var Pa=0;Pa<ua.length;++Pa){var Oa=ua[Pa],Da="object"==typeof Oa&&Oa&&void 0!==Oa.value?Oa.value:jo[Oa];if(!ri||null!==Da){var La=Un&&ai?String(Oa).replace(/\./g,"%2E"):String(Oa),Ra=qr(jo)?"function"==typeof Rt?Rt(wa,La):wa:wa+(Un?"."+La:"["+La+"]");Mo.set(ze,oa);var Na=Xt();Na.set(Qi,Mo),pushToArray(ha,stringify(Da,Ra,Rt,Dr,Lr,Ur,ri,ai,"comma"===Rt&&Qn&&qr(jo)?null:Yi,kn,jn,Un,Wn,Yn,Jn,Qn,Io,Na))}}return ha};ze.exports=function(ze,wt){var Rt,sr=ze,ri=function normalizeStringifyOptions(ze){if(!ze)return Ji;if(void 0!==ze.allowEmptyArrays&&"boolean"!=typeof ze.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==ze.encodeDotInKeys&&"boolean"!=typeof ze.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==ze.encoder&&void 0!==ze.encoder&&"function"!=typeof ze.encoder)throw new TypeError("Encoder has to be a function.");var wt=ze.charset||Ji.charset;if(void 0!==ze.charset&&"utf-8"!==ze.charset&&"iso-8859-1"!==ze.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var Rt=Dr.default;if(void 0!==ze.format){if(!Lr.call(Dr.formatters,ze.format))throw new TypeError("Unknown format option provided.");Rt=ze.format}var Xt,sr=Dr.formatters[Rt],ri=Ji.filter;if(("function"==typeof ze.filter||qr(ze.filter))&&(ri=ze.filter),Xt=ze.arrayFormat in Ur?ze.arrayFormat:"indices"in ze?ze.indices?"indices":"repeat":Ji.arrayFormat,"commaRoundTrip"in ze&&"boolean"!=typeof ze.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var ai=void 0===ze.allowDots?!0===ze.encodeDotInKeys||Ji.allowDots:!!ze.allowDots;return{addQueryPrefix:"boolean"==typeof ze.addQueryPrefix?ze.addQueryPrefix:Ji.addQueryPrefix,allowDots:ai,allowEmptyArrays:"boolean"==typeof ze.allowEmptyArrays?!!ze.allowEmptyArrays:Ji.allowEmptyArrays,arrayFormat:Xt,charset:wt,charsetSentinel:"boolean"==typeof ze.charsetSentinel?ze.charsetSentinel:Ji.charsetSentinel,commaRoundTrip:!!ze.commaRoundTrip,delimiter:void 0===ze.delimiter?Ji.delimiter:ze.delimiter,encode:"boolean"==typeof ze.encode?ze.encode:Ji.encode,encodeDotInKeys:"boolean"==typeof ze.encodeDotInKeys?ze.encodeDotInKeys:Ji.encodeDotInKeys,encoder:"function"==typeof ze.encoder?ze.encoder:Ji.encoder,encodeValuesOnly:"boolean"==typeof ze.encodeValuesOnly?ze.encodeValuesOnly:Ji.encodeValuesOnly,filter:ri,format:Rt,formatter:sr,serializeDate:"function"==typeof ze.serializeDate?ze.serializeDate:Ji.serializeDate,skipNulls:"boolean"==typeof ze.skipNulls?ze.skipNulls:Ji.skipNulls,sort:"function"==typeof ze.sort?ze.sort:null,strictNullHandling:"boolean"==typeof ze.strictNullHandling?ze.strictNullHandling:Ji.strictNullHandling}}(wt);"function"==typeof ri.filter?sr=(0,ri.filter)("",sr):qr(ri.filter)&&(Rt=ri.filter);var ai=[];if("object"!=typeof sr||null===sr)return"";var Yi=Ur[ri.arrayFormat],Qi="comma"===Yi&&ri.commaRoundTrip;Rt||(Rt=Object.keys(sr)),ri.sort&&Rt.sort(ri.sort);for(var jn=Xt(),Un=0;Un<Rt.length;++Un){var Wn=Rt[Un],Yn=sr[Wn];ri.skipNulls&&null===Yn||pushToArray(ai,kn(Yn,Wn,Yi,Qi,ri.allowEmptyArrays,ri.str
20ictNullHandling,ri.skipNulls,ri.encodeDotInKeys,ri.encode?ri.encoder:null,ri.filter,ri.sort,ri.allowDots,ri.serializeDate,ri.format,ri.formatter,ri.encodeValuesOnly,ri.charset,jn))}var Jn=ai.join(ri.delimiter),Qn=!0===ri.addQueryPrefix?"?":"";return ri.charsetSentinel&&("iso-8859-1"===ri.charset?Qn+="utf8=%26%2310003%3B&":Qn+="utf8=%E2%9C%93&"),Jn.length>0?Qn+Jn:""}},2769:(ze,wt,Rt)=>{"use strict";var Xt=Rt(5798),sr=Object.prototype.hasOwnProperty,Dr=Array.isArray,Lr=function(){for(var ze=[],wt=0;wt<256;++wt)ze.push("%"+((wt<16?"0":"")+wt.toString(16)).toUpperCase());return ze}(),Ur=function arrayToObject(ze,wt){for(var Rt=wt&&wt.plainObjects?{__proto__:null}:{},Xt=0;Xt<ze.length;++Xt)void 0!==ze[Xt]&&(Rt[Xt]=ze[Xt]);return Rt},qr=1024;ze.exports={arrayToObject:Ur,assign:function assignSingleSource(ze,wt){return Object.keys(wt).reduce(function(ze,Rt){return ze[Rt]=wt[Rt],ze},ze)},combine:function combine(ze,wt){return[].concat(ze,wt)},compact:function compact(ze){for(var wt=[{obj:{o:ze},prop:"o"}],Rt=[],Xt=0;Xt<wt.length;++Xt)for(var sr=wt[Xt],Lr=sr.obj[sr.prop],Ur=Object.keys(Lr),qr=0;qr<Ur.length;++qr){var ri=Ur[qr],ai=Lr[ri];"object"==typeof ai&&null!==ai&&-1===Rt.indexOf(ai)&&(wt.push({obj:Lr,prop:ri}),Rt.push(ai))}return function compactQueue(ze){for(;ze.length>1;){var wt=ze.pop(),Rt=wt.obj[wt.prop];if(Dr(Rt)){for(var Xt=[],sr=0;sr<Rt.length;++sr)void 0!==Rt[sr]&&Xt.push(Rt[sr]);wt.obj[wt.prop]=Xt}}}(wt),ze},decode:function(ze,wt,Rt){var Xt=ze.replace(/\+/g," ");if("iso-8859-1"===Rt)return Xt.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(Xt)}catch(ze){return Xt}},encode:function encode(ze,wt,Rt,sr,Dr){if(0===ze.length)return ze;var Ur=ze;if("symbol"==typeof ze?Ur=Symbol.prototype.toString.call(ze):"string"!=typeof ze&&(Ur=String(ze)),"iso-8859-1"===Rt)return escape(Ur).replace(/%u[0-9a-f]{4}/gi,function(ze){return"%26%23"+parseInt(ze.slice(2),16)+"%3B"});for(var ri="",ai=0;ai<Ur.length;ai+=qr){for(var Yi=Ur.length>=qr?Ur.slice(ai,ai+qr):Ur,Ji=[],Qi=0;Qi<Yi.length;++Qi){var kn=Yi.charCodeAt(Qi);45===kn||46===kn||95===kn||126===kn||kn>=48&&kn<=57||kn>=65&&kn<=90||kn>=97&&kn<=122||Dr===Xt.RFC1738&&(40===kn||41===kn)?Ji[Ji.length]=Yi.charAt(Qi):kn<128?Ji[Ji.length]=Lr[kn]:kn<2048?Ji[Ji.length]=Lr[192|kn>>6]+Lr[128|63&kn]:kn<55296||kn>=57344?Ji[Ji.length]=Lr[224|kn>>12]+Lr[128|kn>>6&63]+Lr[128|63&kn]:(Qi+=1,kn=65536+((1023&kn)<<10|1023&Yi.charCodeAt(Qi)),Ji[Ji.length]=Lr[240|kn>>18]+Lr[128|kn>>12&63]+Lr[128|kn>>6&63]+Lr[128|63&kn])}ri+=Ji.join("")}return ri},isBuffer:function isBuffer(ze){return!(!ze||"object"!=typeof ze)&&!!(ze.constructor&&ze.constructor.isBuffer&&ze.constructor.isBuffer(ze))},isRegExp:function isRegExp(ze){return"[object RegExp]"===Object.prototype.toString.call(ze)},maybeMap:function maybeMap(ze,wt){if(Dr(ze)){for(var Rt=[],Xt=0;Xt<ze.length;Xt+=1)Rt.push(wt(ze[Xt]));return Rt}return wt(ze)},merge:function merge(ze,wt,Rt){if(!wt)return ze;if("object"!=typeof wt&&"function"!=typeof wt){if(Dr(ze))ze.push(wt);else{if(!ze||"object"!=typeof ze)return[ze,wt];(Rt&&(Rt.plainObjects||Rt.allowPrototypes)||!sr.call(Object.prototype,wt))&&(ze[wt]=!0)}return ze}if(!ze||"object"!=typeof ze)return[ze].concat(wt);var Xt=ze;return Dr(ze)&&!Dr(wt)&&(Xt=Ur(ze,Rt)),Dr(ze)&&Dr(wt)?(wt.forEach(function(wt,Xt){if(sr.call(ze,Xt)){var Dr=ze[Xt];Dr&&"object"==typeof Dr&&wt&&"object"==typeof wt?ze[Xt]=merge(Dr,wt,Rt):ze.push(wt)}else ze[Xt]=wt}),ze):Object.keys(wt).reduce(function(ze,Xt){var Dr=wt[Xt];return sr.call(ze,Xt)?ze[Xt]=merge(ze[Xt],Dr,Rt):ze[Xt]=Dr,ze},Xt)}}},7563:(ze,wt,Rt)=>{"use strict";var Xt=Rt(610),sr=Rt(7418),Dr=Rt(4020);function encode(ze,wt){return wt.encode?wt.strict?Xt(ze):encodeURIComponent(ze):ze}function keysSorter(ze){return Array.isArray(ze)?ze.sort():"object"==typeof ze?keysSorter(Object.keys(ze)).sort(function(ze,wt){return Number(ze)-Number(wt)}).map(function(wt){return ze[wt]}):ze}function extract(ze){var wt=ze.indexOf("?");return-1===wt?"":ze.slice(wt+1)}function parse(ze,wt){var Rt=function parserForArrayFormat(ze){var wt;switch(ze.arrayFormat){case"index":return function(ze,Rt,Xt){wt=/\[(\d*)\]$/.exec(ze),ze=ze.replace(/\[\d*\]$/,""),wt?(void 0===Xt[ze]&&(Xt[ze]={}),Xt[ze][wt[1]]=Rt):Xt[ze]=Rt};case"bracket":return function(ze,Rt,Xt){wt=/(\[\])$/.exec(ze),ze=ze.replace(/\[\]$/,""),wt?void 0!==Xt[ze]?Xt[ze]=[].concat(Xt[ze],Rt):Xt[ze]=[Rt]:Xt[ze]=Rt};default:return function(ze,wt,Rt){void 0!==Rt[ze]?Rt[ze]=[].concat(Rt[ze],wt):Rt[ze]=wt}}}(wt=sr({arrayFormat:"none"},wt)),Xt=Object.create(null);return"string"!=typeof ze?Xt:(ze=ze.trim().replace(/^[?#&]/,""))?(ze.split("&").forEach(function(ze){var wt=ze.replace(/\+/g," ").split("="),sr=wt.shift(),Lr=wt.length>0?wt.join("="):void 0;Lr=void 0===Lr?null:Dr(Lr),Rt(Dr(sr),Lr,Xt)}),Object.keys(Xt).sort().reduce(function(ze,wt){var Rt=Xt[wt];return Boolean(Rt)&&"object"==typeof Rt&&!Array.isArray(Rt)?ze[wt]=keysSorter(Rt):ze[wt]=Rt,ze},Object.create(null))):Xt}wt.extract=extract,wt.parse=parse,wt.stringify=function(ze,wt){!1===(wt=sr({encode:!0,strict:!0,arrayFormat:"none"},wt)).sort&&(wt.sort=function(){});var Rt=function encoderForArrayFormat(ze){switch(ze.arrayFormat){case"index":return function(wt,Rt,Xt){return null===Rt?[encode(wt,ze),"[",Xt,"]"].join(""):[encode(wt,ze),"[",encode(Xt,ze),"]=",encode(Rt,ze)].join("")};case"bracket":return function(wt,Rt){return null===Rt?encode(wt,ze):[encode(wt,ze),"[]=",encode(Rt,ze)].join("")};default:return function(wt,Rt){return null===Rt?encode(wt,ze):[encode(wt,ze),"=",encode(Rt,ze)].join("")}}}(wt);return ze?Object.keys(ze).sort(wt.sort).map(function(Xt){var sr=ze[Xt];
20if(void 0===sr)return"";if(null===sr)return encode(Xt,wt);if(Array.isArray(sr)){var Dr=[];return sr.slice().forEach(function(ze){void 0!==ze&&Dr.push(Rt(Xt,ze,Dr.length))}),Dr.join("&")}return encode(Xt,wt)+"="+encode(sr,wt)}).filter(function(ze){return ze.length>0}).join("&"):""},wt.parseUrl=function(ze,wt){return{url:ze.split("?")[0]||"",query:parse(extract(ze),wt)}}},5747:(ze,wt,Rt)=>{"use strict";var Xt=Rt(631),sr=Rt(4453),listGetNode=function(ze,wt,Rt){for(var Xt,sr=ze;null!=(Xt=sr.next);sr=Xt)if(Xt.key===wt)return sr.next=Xt.next,Rt||(Xt.next=ze.next,ze.next=Xt),Xt};ze.exports=function getSideChannelList(){var ze,wt={assert:function(ze){if(!wt.has(ze))throw new sr("Side channel does not contain "+Xt(ze))},delete:function(wt){var Rt=ze&&ze.next,Xt=function(ze,wt){if(ze)return listGetNode(ze,wt,!0)}(ze,wt);return Xt&&Rt&&Rt===Xt&&(ze=void 0),!!Xt},get:function(wt){return function(ze,wt){if(ze){var Rt=listGetNode(ze,wt);return Rt&&Rt.value}}(ze,wt)},has:function(wt){return function(ze,wt){return!!ze&&!!listGetNode(ze,wt)}(ze,wt)},set:function(wt,Rt){ze||(ze={next:void 0}),function(ze,wt,Rt){var Xt=listGetNode(ze,wt);Xt?Xt.value=Rt:ze.next={key:wt,next:ze.next,value:Rt}}(ze,wt,Rt)}};return wt}},3595:(ze,wt,Rt)=>{"use strict";var Xt=Rt(210),sr=Rt(7379),Dr=Rt(631),Lr=Rt(4453),Ur=Xt("%Map%",!0),qr=sr("Map.prototype.get",!0),ri=sr("Map.prototype.set",!0),ai=sr("Map.prototype.has",!0),Yi=sr("Map.prototype.delete",!0),Ji=sr("Map.prototype.size",!0);ze.exports=!!Ur&&function getSideChannelMap(){var ze,wt={assert:function(ze){if(!wt.has(ze))throw new Lr("Side channel does not contain "+Dr(ze))},delete:function(wt){if(ze){var Rt=Yi(ze,wt);return 0===Ji(ze)&&(ze=void 0),Rt}return!1},get:function(wt){if(ze)return qr(ze,wt)},has:function(wt){return!!ze&&ai(ze,wt)},set:function(wt,Rt){ze||(ze=new Ur),ri(ze,wt,Rt)}};return wt}},9034:(ze,wt,Rt)=>{"use strict";var Xt=Rt(210),sr=Rt(7379),Dr=Rt(631),Lr=Rt(3595),Ur=Rt(4453),qr=Xt("%WeakMap%",!0),ri=sr("WeakMap.prototype.get",!0),ai=sr("WeakMap.prototype.set",!0),Yi=sr("WeakMap.prototype.has",!0),Ji=sr("WeakMap.prototype.delete",!0);ze.exports=qr?function getSideChannelWeakMap(){var ze,wt,Rt={assert:function(ze){if(!Rt.has(ze))throw new Ur("Side channel does not contain "+Dr(ze))},delete:function(Rt){if(qr&&Rt&&("object"==typeof Rt||"function"==typeof Rt)){if(ze)return Ji(ze,Rt)}else if(Lr&&wt)return wt.delete(Rt);return!1},get:function(Rt){return qr&&Rt&&("object"==typeof Rt||"function"==typeof Rt)&&ze?ri(ze,Rt):wt&&wt.get(Rt)},has:function(Rt){return qr&&Rt&&("object"==typeof Rt||"function"==typeof Rt)&&ze?Yi(ze,Rt):!!wt&&wt.has(Rt)},set:function(Rt,Xt){qr&&Rt&&("object"==typeof Rt||"function"==typeof Rt)?(ze||(ze=new qr),ai(ze,Rt,Xt)):Lr&&(wt||(wt=Lr()),wt.set(Rt,Xt))}};return Rt}:Lr},7478:(ze,wt,Rt)=>{"use strict";var Xt=Rt(4453),sr=Rt(631),Dr=Rt(5747),Lr=Rt(3595),Ur=Rt(9034)||Lr||Dr;ze.exports=function getSideChannel(){var ze,wt={assert:function(ze){if(!wt.has(ze))throw new Xt("Side channel does not contain "+sr(ze))},delete:function(wt){return!!ze&&ze.delete(wt)},get:function(wt){return ze&&ze.get(wt)},has:function(wt){return!!ze&&ze.has(wt)},set:function(wt,Rt){ze||(ze=Ur()),ze.set(wt,Rt)}};return wt}},610:ze=>{"use strict";ze.exports=function(ze){return encodeURIComponent(ze).replace(/[!'()*]/g,function(ze){return"%"+ze.charCodeAt(0).toString(16).toUpperCase()})}},3379:ze=>{"use strict";var wt=[];function getIndexByIdentifier(ze){for(var Rt=-1,Xt=0;Xt<wt.length;Xt++)if(wt[Xt].identifier===ze){Rt=Xt;break}return Rt}function modulesToDom(ze,Rt){for(var Xt={},sr=[],Dr=0;Dr<ze.length;Dr++){var Lr=ze[Dr],Ur=Rt.base?Lr[0]+Rt.base:Lr[0],qr=Xt[Ur]||0,ri="".concat(Ur," ").concat(qr);Xt[Ur]=qr+1;var ai=getIndexByIdentifier(ri),Yi={css:Lr[1],media:Lr[2],sourceMap:Lr[3],supports:Lr[4],layer:Lr[5]};if(-1!==ai)wt[ai].references++,wt[ai].updater(Yi);else{var Ji=addElementStyle(Yi,Rt);Rt.byIndex=Dr,wt.splice(Dr,0,{identifier:ri,updater:Ji,references:1})}sr.push(ri)}return sr}function addElementStyle(ze,wt){var Rt=wt.domAPI(wt);Rt.update(ze);return function updater(wt){if(wt){if(wt.css===ze.css&&wt.media===ze.media&&wt.sourceMap===ze.sourceMap&&wt.supports===ze.supports&&wt.layer===ze.layer)return;Rt.update(ze=wt)}else Rt.remove()}}ze.exports=function(ze,Rt){var Xt=modulesToDom(ze=ze||[],Rt=Rt||{});return function update(ze){ze=ze||[];for(var sr=0;sr<Xt.length;sr++){var Dr=getIndexByIdentifier(Xt[sr]);wt[Dr].references--}for(var Lr=modulesToDom(ze,Rt),Ur=0;Ur<Xt.length;Ur++){var qr=getIndexByIdentifier(Xt[Ur]);0===wt[qr].references&&(wt[qr].updater(),wt.splice(qr,1))}Xt=Lr}}},569:ze=>{"use strict";var wt={};ze.exports=function insertBySelector(ze,Rt){var Xt=function getTarget(ze){if(void 0===wt[ze]){var Rt=document.querySelector(ze);if(window.HTMLIFrameElement&&Rt instanceof window.HTMLIFrameElement)try{Rt=Rt.contentDocument.head}catch(ze){Rt=null}wt[ze]=Rt}return wt[ze]}(ze);if(!Xt)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invali
20d.");Xt.appendChild(Rt)}},9216:ze=>{"use strict";ze.exports=function insertStyleElement(ze){var wt=document.createElement("style");return ze.setAttributes(wt,ze.attributes),ze.insert(wt,ze.options),wt}},3565:(ze,wt,Rt)=>{"use strict";ze.exports=function setAttributesWithoutAttributes(ze){var wt=Rt.nc;wt&&ze.setAttribute("nonce",wt)}},7795:ze=>{"use strict";ze.exports=function domAPI(ze){if("undefined"==typeof document)return{update:function update(){},remove:function remove(){}};var wt=ze.insertStyleElement(ze);return{update:function update(Rt){!function apply(ze,wt,Rt){var Xt="";Rt.supports&&(Xt+="@supports (".concat(Rt.supports,") {")),Rt.media&&(Xt+="@media ".concat(Rt.media," {"));var sr=void 0!==Rt.layer;sr&&(Xt+="@layer".concat(Rt.layer.length>0?" ".concat(Rt.layer):""," {")),Xt+=Rt.css,sr&&(Xt+="}"),Rt.media&&(Xt+="}"),Rt.supports&&(Xt+="}");var Dr=Rt.sourceMap;Dr&&"undefined"!=typeof btoa&&(Xt+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(Dr))))," */")),wt.styleTagTransform(Xt,ze,wt.options)}(wt,ze,Rt)},remove:function remove(){!function removeStyleElement(ze){if(null===ze.parentNode)return!1;ze.parentNode.removeChild(ze)}(wt)}}}},4589:ze=>{"use strict";ze.exports=function styleTagTransform(ze,wt){if(wt.styleSheet)wt.styleSheet.cssText=ze;else{for(;wt.firstChild;)wt.removeChild(wt.firstChild);wt.appendChild(document.createTextNode(ze))}}},4654:()=>{},1449:(ze,wt,Rt)=>{"use strict";Rt.r(wt),Rt.d(wt,{areaFactors:()=>Lr,bearingToAzimuth:()=>bearingToAzimuth,convertArea:()=>convertArea,convertLength:()=>convertLength,degreesToRadians:()=>degreesToRadians,earthRadius:()=>Xt,factors:()=>sr,feature:()=>feature,featureCollection:()=>featureCollection,geometry:()=>geometry,geometryCollection:()=>geometryCollection,isNumber:()=>isNumber,isObject:()=>isObject,lengthToDegrees:()=>lengthToDegrees,lengthToRadians:()=>lengthToRadians,lineString:()=>lineString,lineStrings:()=>lineStrings,multiLineString:()=>multiLineString,multiPoint:()=>multiPoint,multiPolygon:()=>multiPolygon,point:()=>point,points:()=>points,polygon:()=>polygon,polygons:()=>polygons,radiansToDegrees:()=>radiansToDegrees,radiansToLength:()=>radiansToLength,round:()=>round,unitsFactors:()=>Dr,validateBBox:()=>validateBBox,validateId:()=>validateId});var Xt=6371008.8,sr={centimeters:100*Xt,centimetres:100*Xt,degrees:Xt/111325,feet:3.28084*Xt,inches:39.37*Xt,kilometers:Xt/1e3,kilometres:Xt/1e3,meters:Xt,metres:Xt,miles:Xt/1609.344,millimeters:1e3*Xt,millimetres:1e3*Xt,nauticalmiles:Xt/1852,radians:1,yards:1.0936*Xt},Dr={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Xt,yards:1.0936133},Lr={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function feature(ze,wt,Rt){void 0===Rt&&(Rt={});var Xt={type:"Feature"};return(0===Rt.id||Rt.id)&&(Xt.id=Rt.id),Rt.bbox&&(Xt.bbox=Rt.bbox),Xt.properties=wt||{},Xt.geometry=ze,Xt}function geometry(ze,wt,Rt){switch(void 0===Rt&&(Rt={}),ze){case"Point":return point(wt).geometry;case"LineString":return lineString(wt).geometry;case"Polygon":return polygon(wt).geometry;case"MultiPoint":return multiPoint(wt).geometry;case"MultiLineString":return multiLineString(wt).geometry;case"MultiPolygon":return multiPolygon(wt).geometry;default:throw new Error(ze+" is invalid")}}function point(ze,wt,Rt){if(void 0===Rt&&(Rt={}),!ze)throw new Error("coordinates is required");if(!Array.isArray(ze))throw new Error("coordinates must be an Array");if(ze.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!isNumber(ze[0])||!isNumber(ze[1]))throw new Error("coordinates must contain numbers");return feature({type:"Point",coordinates:ze},wt,Rt)}function points(ze,wt,Rt){return void 0===Rt&&(Rt={}),featureCollection(ze.map(function(ze){return point(ze,wt)}),Rt)}function polygon(ze,wt,Rt){void 0===Rt&&(Rt={});for(var Xt=0,sr=ze;Xt<sr.length;Xt++){var Dr=sr[Xt];
vendor: 1,603 bytes, line 20
20if(Dr.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var Lr=0;Lr<Dr[Dr.length-1].length;Lr++)if(Dr[Dr.length-1][Lr]!==Dr[0][Lr])throw new Error("First and last Position are not equivalent.")}return feature({type:"Polygon",coordinates:ze},wt,Rt)}function polygons(ze,wt,Rt){return void 0===Rt&&(Rt={}),featureCollection(ze.map(function(ze){return polygon(ze,wt)}),Rt)}function lineString(ze,wt,Rt){if(void 0===Rt&&(Rt={}),ze.length<2)throw new Error("coordinates must be an array of two or more positions");return feature({type:"LineString",coordinates:ze},wt,Rt)}function lineStrings(ze,wt,Rt){return void 0===Rt&&(Rt={}),featureCollection(ze.map(function(ze){return lineString(ze,wt)}),Rt)}function featureCollection(ze,wt){void 0===wt&&(wt={});var Rt={type:"FeatureCollection"};return wt.id&&(Rt.id=wt.id),wt.bbox&&(Rt.bbox=wt.bbox),Rt.features=ze,Rt}function multiLineString(ze,wt,Rt){return void 0===Rt&&(Rt={}),feature({type:"MultiLineString",coordinates:ze},wt,Rt)}function multiPoint(ze,wt,Rt){return void 0===Rt&&(Rt={}),feature({type:"MultiPoint",coordinates:ze},wt,Rt)}function multiPolygon(ze,wt,Rt){return void 0===Rt&&(Rt={}),feature({type:"MultiPolygon",coordinates:ze},wt,Rt)}function geometryCollection(ze,wt,Rt){return void 0===Rt&&(Rt={}),feature({type:"GeometryCollection",geometries:ze},wt,Rt)}function round(ze,wt){if(void 0===wt&&(wt=0),wt&&!(wt>=0))throw new Error("precision must be a positive number");var Rt=Math.pow(10,wt||0);return Math.round(ze*Rt)/Rt}function radiansToLength(ze,wt){void 0===wt&&(wt="kilometers");var Rt=sr[wt];
20if(!Rt)throw new Error(wt+" units is invalid");return ze*Rt}function lengthToRadians(ze,wt){void 0===wt&&(wt="kilometers");var Rt=sr[wt];if(!Rt)throw new Error(wt+" units is invalid");return ze/Rt}function lengthToDegrees(ze,wt){return radiansToDegrees(lengthToRadians(ze,wt))}function bearingToAzimuth(ze){var wt=ze%360;return wt<0&&(wt+=360),wt}function radiansToDegrees(ze){return 180*(ze%(2*Math.PI))/Math.PI}function degreesToRadians(ze){return ze%360*Math.PI/180}function convertLength(ze,wt,Rt){if(void 0===wt&&(wt="kilometers"),void 0===Rt&&(Rt="kilometers"),!(ze>=0))throw new Error("length must be a positive number");return radiansToLength(lengthToRadians(ze,wt),Rt)}function convertArea(ze,wt,Rt){if(void 0===wt&&(wt="meters"),void 0===Rt&&(Rt="kilometers"),!(ze>=0))throw new Error("area must be a positive number");var Xt=Lr[wt];if(!Xt)throw new Error("invalid original units");var sr=Lr[Rt];if(!sr)throw new Error("invalid final units");return ze/Xt*sr}function isNumber(ze){return!isNaN(ze)&&null!==ze&&!Array.isArray(ze)}function isObject(ze){return!!ze&&ze.constructor===Object}function validateBBox(ze){if(!ze)throw new Error("bbox is required");if(!Array.isArray(ze))throw new Error("bbox must be an Array");if(4!==ze.length&&6!==ze.length)throw new Error("bbox must be an Array of 4 or 6 numbers");ze.forEach(function(ze){if(!isNumber(ze))throw new Error("bbox must only contain numbers")})}function validateId(ze){if(!ze)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof ze))throw new Error("id must be a number or a string")}},3955:(ze,wt,Rt)=>{"use strict";function isNumber(ze){return"number"==typeof ze}function isString(ze){return"string"==typeof ze}function isBoolean(ze){return"boolean"==typeof ze}function isObject(ze){return"[object Object]"===Object.prototype.toString.call(ze)}function mathAbs(ze){return Math.abs(ze)}function mathSign(ze){return Math.sign(ze)}function deltaAbs(ze,wt){return mathAbs(ze-wt)}function arrayKeys(ze){return objectKeys(ze).map(Number)}function arrayLast(ze){return ze[arrayLastIndex(ze)]}function arrayLastIndex(ze){return Math.max(0,ze.length-1)}function arrayIsLastIndex(ze,wt){return wt===arrayLastIndex(ze)}function arrayFromNumber(ze,wt=0){return Array.from(Array(ze),(ze,Rt)=>wt+Rt)}function objectKeys(ze){return Object.keys(ze)}function objectsMergeDeep(ze,wt){return[ze,wt].reduce((ze,wt)=>(objectKeys(wt).forEach(Rt=>{const Xt=ze[Rt],sr=wt[Rt],Dr=isObject(Xt)&&isObject(sr);ze[Rt]=Dr?objectsMergeDeep(Xt,sr):sr}),ze),{})}function isMouseEvent(ze,wt){return void 0!==wt.MouseEvent&&ze instanceof wt.MouseEvent}function EventStore(){let ze=[];const wt={add:function add(Rt,Xt,sr,Dr={passive:!0}){let Lr;if("addEventListener"in Rt)Rt.addEventListener(Xt,sr,Dr),Lr=()=>Rt.removeEventListener(Xt,sr,Dr);else{const ze=Rt;ze.addListener(sr),Lr=()=>ze.removeListener(sr)}return ze.push(Lr),wt},clear:function clear(){ze=ze.filter(ze=>ze())}};return wt}function Animations(ze,wt,Rt,Xt){const sr=EventStore(),Dr=1e3/60;let Lr=null,Ur=0,qr=0;function animate(ze){if(!qr)return;Lr||(Lr=ze,Rt(),Rt());const sr=ze-Lr;for(Lr=ze,Ur+=sr;Ur>=Dr;)Rt(),Ur-=Dr;Xt(Ur/Dr),qr&&(qr=wt.requestAnimationFrame(animate))}function stop(){wt.cancelAnimationFrame(qr),Lr=null,Ur=0,qr=0}return{init:function init(){sr.add(ze,"visibilitychange",()=>{ze.hidden&&function reset(){Lr=null,Ur=0}()})},destroy:function destroy(){stop(),sr.clear()},start:function start(){qr||(qr=wt.requestAnimationFrame(animate))},stop,update:Rt,render:Xt}}function Limit(ze=0,wt=0){const Rt=mathAbs(ze-wt);function reachedMin(wt){return wt<ze}function reachedMax(ze){return ze>wt}function reachedAny(ze){return reachedMin(ze)||reachedMax(ze)}return{length:Rt,max:wt,min:ze,constrain:function constrain(Rt){return reachedAny(Rt)?reachedMin(Rt)?ze:wt:Rt},reachedAny,reachedMax,reachedMin,removeOffset:function removeOffset(ze){return Rt?ze-Rt*Math.ceil((ze-wt)/Rt):ze}}}function Counter(ze,wt,Rt){const{constrain:Xt}=Limit(0,ze),sr=ze+1;let Dr=withinLimit(wt);function withinLimit(ze){return Rt?mathAbs((sr+ze)%sr):Xt(ze)}function get(){return Dr}function clone(){return Counter(ze,get(),Rt)}const Lr={get,set:function set(ze){return Dr=withinLimit(ze),Lr},add:function add(ze){return clone().set(get()+ze)},clone};return Lr}function DragHandler(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr,ri,ai,Yi,Ji,Qi,kn,jn,Un,Wn,Yn){const{cross:Jn,direction:Qn}=ze,Io=["INPUT","SELECT","TEXTAREA"],Mo={passive:!1},jo=EventStore(),zo=EventStore(),oa=Limit(50,225).constrain(Qi.measure(20)),la={mouse:300,touch:400},ca={mouse:500,touch:600},ua=kn?43:25;let ha=!1,pa=0,_a=0,wa=!1,Pa=!1,Oa=!1,Da=!1;function move(ze){if(!isMouseEvent(ze,Xt)&&ze.touches.length>=2)return up(ze);const wt=Dr.readPoint(ze),Rt=Dr.readPoint(ze,Jn),Lr=deltaAbs(wt,pa),qr=deltaAbs(Rt,_a);if(!Pa&&!Da){if(!ze.cancelable)return up(ze);if(Pa=Lr>qr,!Pa)return up(ze)}const ai=Dr.pointerMove(ze);Lr>jn&&(Oa=!0),ri.useFriction(.3).useDuration(.75),Ur.start(),sr.add(Qn(ai)),ze.preventDefault()}function up(ze){const wt=ai.byDistance(0,!1).index!==Yi.get(),Rt=Dr.pointerUp(ze)*function forceBoost(){return(kn?ca:la)[Da?"mouse":"touch"]}
20(),Xt=function allowedForce(ze,wt){const Rt=Yi.add(-1*mathSign(ze)),Xt=ai.byDistance(ze,!kn).distance;return kn||mathAbs(ze)<oa?Xt:Un&&wt?.5*Xt:ai.byIndex(Rt.get(),0).distance}(Qn(Rt),wt),sr=function factorAbs(ze,wt){if(0===ze||0===wt)return 0;if(mathAbs(ze)<=mathAbs(wt))return 0;const Rt=deltaAbs(mathAbs(ze),mathAbs(wt));return mathAbs(Rt/ze)}(Rt,Xt),Lr=ua-10*sr,Ur=Wn+sr/50;Pa=!1,wa=!1,zo.clear(),ri.useDuration(Lr).useFriction(Ur),qr.distance(Xt,!kn),Da=!1,Ji.emit("pointerUp")}function click(ze){Oa&&(ze.stopPropagation(),ze.preventDefault(),Oa=!1)}return{init:function init(ze){if(!Yn)return;function downIfAllowed(Ur){(isBoolean(Yn)||Yn(ze,Ur))&&function down(ze){const Ur=isMouseEvent(ze,Xt);if(Da=Ur,Oa=kn&&Ur&&!ze.buttons&&ha,ha=deltaAbs(sr.get(),Lr.get())>=2,Ur&&0!==ze.button)return;if(function isFocusNode(ze){const wt=ze.nodeName||"";return Io.includes(wt)}(ze.target))return;wa=!0,Dr.pointerDown(ze),ri.useFriction(0).useDuration(0),sr.set(Lr),function addDragEvents(){const ze=Da?Rt:wt;zo.add(ze,"touchmove",move,Mo).add(ze,"touchend",up).add(ze,"mousemove",move,Mo).add(ze,"mouseup",up)}(),pa=Dr.readPoint(ze),_a=Dr.readPoint(ze,Jn),Ji.emit("pointerDown")}(Ur)}const Ur=wt;jo.add(Ur,"dragstart",ze=>ze.preventDefault(),Mo).add(Ur,"touchmove",()=>{},Mo).add(Ur,"touchend",()=>{}).add(Ur,"touchstart",downIfAllowed).add(Ur,"mousedown",downIfAllowed).add(Ur,"touchcancel",up).add(Ur,"contextmenu",up).add(Ur,"click",click,!0)},destroy:function destroy(){jo.clear(),zo.clear()},pointerDown:function pointerDown(){return wa}}}function DragTracker(ze,wt){let Rt,Xt;function readTime(ze){return ze.timeStamp}function readPoint(Rt,Xt){const sr="client"+("x"===(Xt||ze.scroll)?"X":"Y");return(isMouseEvent(Rt,wt)?Rt:Rt.touches[0])[sr]}return{pointerDown:function pointerDown(ze){return Rt=ze,Xt=ze,readPoint(ze)},pointerMove:function pointerMove(ze){const wt=readPoint(ze)-readPoint(Xt),sr=readTime(ze)-readTime(Rt)>170;return Xt=ze,sr&&(Rt=ze),wt},pointerUp:function pointerUp(ze){if(!Rt||!Xt)return 0;const wt=readPoint(Xt)-readPoint(Rt),sr=readTime(ze)-readTime(Rt),Dr=readTime(ze)-readTime(Xt)>170,Lr=wt/sr;return sr&&!Dr&&mathAbs(Lr)>.1?Lr:0},readPoint}}function ResizeHandler(ze,wt,Rt,Xt,sr,Dr,Lr){const Ur=[ze].concat(Xt);let qr,ri,ai=[],Yi=!1;function readSize(ze){return sr.measureSize(Lr.measure(ze))}return{init:function init(sr){Dr&&(ri=readSize(ze),ai=Xt.map(readSize),qr=new ResizeObserver(Rt=>{(isBoolean(Dr)||Dr(sr,Rt))&&function defaultCallback(Rt){for(const Dr of Rt){if(Yi)return;const Rt=Dr.target===ze,Lr=Xt.indexOf(Dr.target),Ur=Rt?ri:ai[Lr];if(mathAbs(readSize(Rt?ze:Xt[Lr])-Ur)>=.5){sr.reInit(),wt.emit("resize");break}}}(Rt)}),Rt.requestAnimationFrame(()=>{Ur.forEach(ze=>qr.observe(ze))}))},destroy:function destroy(){Yi=!0,qr&&qr.disconnect()}}}function ScrollBounds(ze,wt,Rt,Xt,sr){const Dr=sr.measure(10),Lr=sr.measure(50),Ur=Limit(.1,.99);let qr=!1;function shouldConstrain(){return!qr&&(!!ze.reachedAny(Rt.get())&&!!ze.reachedAny(wt.get()))}return{shouldConstrain,constrain:function constrain(sr){if(!shouldConstrain())return;const qr=ze.reachedMin(wt.get())?"min":"max",ri=mathAbs(ze[qr]-wt.get()),ai=Rt.get()-wt.get(),Yi=Ur.constrain(ri/Lr);Rt.subtract(ai*Yi),!sr&&mathAbs(ai)<Dr&&(Rt.set(ze.constrain(Rt.get())),Xt.useDuration(25).useBaseFriction())},toggleActive:function toggleActive(ze){qr=!ze}}}function ScrollLooper(ze,wt,Rt,Xt){const sr=wt.min+.1,Dr=wt.max+.1,{reachedMin:Lr,reachedMax:Ur}=Limit(sr,Dr);return{loop:function loop(wt){if(!function shouldLoop(ze){return 1===ze?Ur(Rt.get()):-1===ze&&Lr(Rt.get())}(wt))return;const sr=ze*(-1*wt);Xt.forEach(ze=>ze.add(sr))}}}function ScrollTarget(ze,wt,Rt,Xt,sr){const{reachedAny:Dr,removeOffset:Lr,constrain:Ur}=Xt;function minDistance(ze){return ze.concat().sort((ze,wt)=>mathAbs(ze)-mathAbs(wt))[0]}function shortcut(wt,Xt){const sr=[wt,wt+Rt,wt-Rt];if(!ze)return wt;if(!Xt)return minDistance(sr);const Dr=sr.filter(ze=>mathSign(ze)===Xt);return Dr.length?minDistance(Dr):arrayLast(sr)-Rt}return{byDistance:function byDistance(Rt,Xt){const qr=sr.get()+Rt,{index:ri,distance:ai}
20=function findTargetSnap(Rt){const Xt=ze?Lr(Rt):Ur(Rt),sr=wt.map((ze,wt)=>({diff:shortcut(ze-Xt,0),index:wt})).sort((ze,wt)=>mathAbs(ze.diff)-mathAbs(wt.diff)),{index:Dr}=sr[0];return{index:Dr,distance:Xt}}(qr),Yi=!ze&&Dr(qr);return!Xt||Yi?{index:ri,distance:Rt}:{index:ri,distance:Rt+shortcut(wt[ri]-ai,0)}},byIndex:function byIndex(ze,Rt){return{index:ze,distance:shortcut(wt[ze]-sr.get(),Rt)}},shortcut}}function SlideFocus(ze,wt,Rt,Xt,sr,Dr,Lr,Ur){const qr={passive:!0,capture:!0};let ri=0;function registerTabPress(ze){"Tab"===ze.code&&(ri=(new Date).getTime())}return{init:function init(ai){Ur&&(Dr.add(document,"keydown",registerTabPress,!1),wt.forEach((wt,Yi)=>{Dr.add(wt,"focus",wt=>{(isBoolean(Ur)||Ur(ai,wt))&&function defaultCallback(wt){if((new Date).getTime()-ri>10)return;Lr.emit("slideFocusStart"),ze.scrollLeft=0;const Dr=Rt.findIndex(ze=>ze.includes(wt));isNumber(Dr)&&(sr.useDuration(0),Xt.index(Dr,0),Lr.emit("slideFocus"))}(Yi)},qr)}))}}}function Vector1D(ze){let wt=ze;function normalizeInput(ze){return isNumber(ze)?ze:ze.get()}return{get:function get(){return wt},set:function set(ze){wt=normalizeInput(ze)},add:function add(ze){wt+=normalizeInput(ze)},subtract:function subtract(ze){wt-=normalizeInput(ze)}}}function Translate(ze,wt){const Rt="x"===ze.scroll?function x(ze){return`translate3d(${ze}px,0px,0px)`}:function y(ze){return`translate3d(0px,${ze}px,0px)`},Xt=wt.style;let sr=null,Dr=!1;return{clear:function clear(){Dr||(Xt.transform="",wt.getAttribute("style")||wt.removeAttribute("style"))},to:function to(wt){if(Dr)return;const Lr=function roundToTwoDecimals(ze){return Math.round(100*ze)/100}(ze.direction(wt));Lr!==sr&&(Xt.transform=Rt(Lr),sr=Lr)},toggleActive:function toggleActive(ze){Dr=!ze}}}function SlideLooper(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const ri=arrayKeys(sr),ai=arrayKeys(sr).reverse(),Yi=function startPoints(){const ze=Lr[0];return findLoopPoints(slidesInGap(ai,ze),Rt,!1)}().concat(function endPoints(){const ze=wt-Lr[0]-1;return findLoopPoints(slidesInGap(ri,ze),-Rt,!0)}());function removeSlideSizes(ze,wt){return ze.reduce((ze,wt)=>ze-sr[wt],wt)}function slidesInGap(ze,wt){return ze.reduce((ze,Rt)=>removeSlideSizes(ze,wt)>0?ze.concat([Rt]):ze,[])}function findLoopPoints(sr,Lr,ri){const ai=function findSlideBounds(ze){return Dr.map((Rt,sr)=>({start:Rt-Xt[sr]+.5+ze,end:Rt+wt-.5+ze}))}(Lr);return sr.map(wt=>{const Xt=ri?0:-Rt,sr=ri?Rt:0,Dr=ri?"end":"start",Lr=ai[wt][Dr];return{index:wt,loopPoint:Lr,slideLocation:Vector1D(-1),translate:Translate(ze,qr[wt]),target:()=>Ur.get()>Lr?Xt:sr}})}return{canLoop:function canLoop(){return Yi.every(({index:ze})=>removeSlideSizes(ri.filter(wt=>wt!==ze),wt)<=.1)},clear:function clear(){Yi.forEach(ze=>ze.translate.clear())}
20,loop:function loop(){Yi.forEach(ze=>{const{target:wt,translate:Rt,slideLocation:Xt}=ze,sr=wt();sr!==Xt.get()&&(Rt.to(sr),Xt.set(sr))})},loopPoints:Yi}}function SlidesHandler(ze,wt,Rt){let Xt,sr=!1;return{init:function init(Dr){Rt&&(Xt=new MutationObserver(ze=>{sr||(isBoolean(Rt)||Rt(Dr,ze))&&function defaultCallback(ze){for(const Rt of ze)if("childList"===Rt.type){Dr.reInit(),wt.emit("slidesChanged");break}}(ze)}),Xt.observe(ze,{childList:!0}))},destroy:function destroy(){Xt&&Xt.disconnect(),sr=!0}}}function SlidesInView(ze,wt,Rt,Xt){const sr={};let Dr,Lr=null,Ur=null,qr=!1;return{init:function init(){Dr=new IntersectionObserver(ze=>{qr||(ze.forEach(ze=>{const Rt=wt.indexOf(ze.target);sr[Rt]=ze}),Lr=null,Ur=null,Rt.emit("slidesInView"))},{root:ze.parentElement,threshold:Xt}),wt.forEach(ze=>Dr.observe(ze))},destroy:function destroy(){Dr&&Dr.disconnect(),qr=!0},get:function get(ze=!0){if(ze&&Lr)return Lr;if(!ze&&Ur)return Ur;const wt=function createInViewList(ze){return objectKeys(sr).reduce((wt,Rt)=>{const Xt=parseInt(Rt),{isIntersecting:Dr}=sr[Xt];return(ze&&Dr||!ze&&!Dr)&&wt.push(Xt),wt},[])}(ze);return ze&&(Lr=wt),ze||(Ur=wt),wt}}}function SlidesToScroll(ze,wt,Rt,Xt,sr,Dr,Lr,Ur,qr){const{startEdge:ri,endEdge:ai,direction:Yi}=ze,Ji=isNumber(Rt);return{groupSlides:function groupSlides(ze){return Ji?function byNumber(ze,wt){return arrayKeys(ze).filter(ze=>ze%wt===0).map(Rt=>ze.slice(Rt,Rt+wt))}(ze,Rt):function bySize(ze){return ze.length?arrayKeys(ze).reduce((Rt,Ji,Qi)=>{const kn=arrayLast(Rt)||0,jn=0===kn,Un=Ji===arrayLastIndex(ze),Wn=sr[ri]-Dr[kn][ri],Yn=sr[ri]-Dr[Ji][ai],Jn=!Xt&&jn?Yi(Lr):0,Qn=mathAbs(Yn-(!Xt&&Un?Yi(Ur):0)-(Wn+Jn));return Qi&&Qn>wt+qr&&Rt.push(Ji),Un&&Rt.push(ze.length),Rt},[]).map((wt,Rt,Xt)=>{const sr=Math.max(Xt[Rt-1]||0);return ze.slice(sr,wt)}):[]}(ze)}}}function Engine(ze,wt,Rt,Xt,sr,Dr,Lr){const{align:Ur,axis:qr,direction:ri,startIndex:ai,loop:Yi,duration:Ji,dragFree:Qi,dragThreshold:kn,inViewThreshold:jn,slidesToScroll:Un,skipSnaps:Wn,containScroll:Yn,watchResize:Jn,watchSlides:Qn,watchDrag:Io,watchFocus:Mo}=Dr,jo={measure:function measure(ze){const{offsetTop:wt,offsetLeft:Rt,offsetWidth:Xt,offsetHeight:sr}=ze;return{top:wt,right:Rt+Xt,bottom:wt+sr,left:Rt,width:Xt,height:sr}}},zo=jo.measure(wt),oa=Rt.map(jo.measure),la=function Axis(ze,wt){const Rt="rtl"===wt,Xt="y"===ze,sr=!Xt&&Rt?-1:1;return{scroll:Xt?"y":"x",cross:Xt?"x":"y",startEdge:function getStartEdge(){return Xt?"top":Rt?"right":"left"}(),endEdge:function getEndEdge(){return Xt?"bottom":Rt?"left":"right"}(),measureSize:function measureSize(ze){const{height:wt,width:Rt}=ze;return Xt?wt:Rt},direction:function direction(ze){return ze*sr}}}(qr,ri),ca=la.measureSize(zo),ua=function PercentOfView(ze){return{measure:function measure(wt){return ze*(wt/100)}}}(ca),ha=function Alignment(ze,wt){const Rt={start:function start(){return 0},center:function center(ze){return end(ze)/2},end};function end(ze){return wt-ze}return{measure:function measure(Xt,sr){return isString(ze)?Rt[ze](Xt):ze(wt,Xt,sr)}}}(Ur,ca),pa=!Yi&&!!Yn,_a=Yi||!!Yn,{slideSizes:wa,slideSizesWithGaps:Pa,startGap:Oa,endGap:Da}=function SlideSizes(ze,wt,Rt,Xt,sr,Dr){const{measureSize:Lr,startEdge:Ur,endEdge:qr}=ze,ri=Rt[0]&&sr,ai=function measureStartGap(){if(!ri)return 0;const ze=Rt[0];return mathAbs(wt[Ur]-ze[Ur])}(),Yi=function measureEndGap(){if(!ri)return 0;const ze=Dr.getComputedStyle(arrayLast(Xt));return parseFloat(ze.getPropertyValue(`margin-${qr}`))}(),Ji=Rt.map(Lr),Qi=function measureWithGaps(){return Rt.map((ze,wt,Rt)=>{const Xt=!wt,sr=arrayIsLastIndex(Rt,wt);return Xt?Ji[wt]+ai:sr?Ji[wt]+Yi:Rt[wt+1][Ur]-ze[Ur]}).map(mathAbs)}();return{slideSizes:Ji,slideSizesWithGaps:Qi,startGap:ai,endGap:Yi}}(la,zo,oa,Rt,_a,sr),La=SlidesToScroll(la,ca,Un,Yi,zo,oa,Oa,Da,2),{snaps:Ra,snapsAligned:Na}=function ScrollSnaps(ze,wt,Rt,Xt,sr){const{startEdge:Dr,endEdge:Lr}=ze,{groupSlides:Ur}=sr,qr=function measureSizes(){return Ur(Xt).map(ze=>arrayLast(ze)[Lr]-ze[0][Dr]).map(mathAbs)}().map(wt.measure),ri=function measureUnaligned(){return Xt.map(ze=>Rt[Dr]-ze[Dr]).map(ze=>-mathAbs(ze))}(),ai=function measureAligned(){return Ur(ri).map(ze=>ze[0]).map((ze,wt)=>ze+qr[wt])}();return{snaps:ri,snapsAligned:ai}}(la,ha,zo,oa,La),Ba=-arrayLast(Ra)+arrayLast(Pa),{snapsContained:Ua,scrollContainLimit:qa}
20=function ScrollContain(ze,wt,Rt,Xt,sr){const Dr=Limit(-wt+ze,0),Lr=function measureBounded(){return Rt.map((ze,wt)=>{const{min:Xt,max:sr}=Dr,Lr=Dr.constrain(ze),Ur=!wt,qr=arrayIsLastIndex(Rt,wt);return Ur?sr:qr||usePixelTolerance(Xt,Lr)?Xt:usePixelTolerance(sr,Lr)?sr:Lr}).map(ze=>parseFloat(ze.toFixed(3)))}(),Ur=function findScrollContainLimit(){const ze=Lr[0],wt=arrayLast(Lr);return Limit(Lr.lastIndexOf(ze),Lr.indexOf(wt)+1)}();function usePixelTolerance(ze,wt){return deltaAbs(ze,wt)<=1}return{snapsContained:function measureContained(){if(wt<=ze+sr)return[Dr.max];if("keepSnaps"===Xt)return Lr;const{min:Rt,max:qr}=Ur;return Lr.slice(Rt,qr)}(),scrollContainLimit:Ur}}(ca,Ba,Na,Yn,2),rs=pa?Ua:Na,{limit:ss}=function ScrollLimit(ze,wt,Rt){const Xt=wt[0];return{limit:Limit(Rt?Xt-ze:arrayLast(wt),Xt)}}(Ba,rs,Yi),_s=Counter(arrayLastIndex(rs),ai,Yi),Pl=_s.clone(),Cl=arrayKeys(Rt),Ol=Animations(Xt,sr,()=>(({dragHandler:ze,scrollBody:wt,scrollBounds:Rt,options:{loop:Xt}})=>{Xt||Rt.constrain(ze.pointerDown()),wt.seek()})(Bc),ze=>(({scrollBody:ze,translate:wt,location:Rt,offsetLocation:Xt,previousLocation:sr,scrollLooper:Dr,slideLooper:Lr,dragHandler:Ur,animation:qr,eventHandler:ri,scrollBounds:ai,options:{loop:Yi}},Ji)=>{const Qi=ze.settled(),kn=!ai.shouldConstrain(),jn=Yi?Qi:Qi&&kn,Un=jn&&!Ur.pointerDown();Un&&qr.stop();const Wn=Rt.get()*Ji+sr.get()*(1-Ji);Xt.set(Wn),Yi&&(Dr.loop(ze.direction()),Lr.loop()),wt.to(Xt.get()),Un&&ri.emit("settle"),jn||ri.emit("scroll")})(Bc,ze)),Dl=rs[_s.get()],Ll=Vector1D(Dl),Fl=Vector1D(Dl),Vl=Vector1D(Dl),Gl=Vector1D(Dl),Zl=function ScrollBody(ze,wt,Rt,Xt,sr,Dr){let Lr=0,Ur=0,qr=sr,ri=Dr,ai=ze.get(),Yi=0;function useDuration(ze){return qr=ze,Ji}function useFriction(ze){return ri=ze,Ji}const Ji={direction:function direction(){return Ur},duration:function duration(){return qr},velocity:function velocity(){return Lr},seek:function seek(){const wt=Xt.get()-ze.get();let sr=0;return qr?(Rt.set(ze),Lr+=wt/qr,Lr*=ri,ai+=Lr,ze.add(Lr),sr=ai-Yi):(Lr=0,Rt.set(Xt),ze.set(Xt),sr=wt),Ur=mathSign(sr),Yi=ai,Ji},settled:function settled(){return mathAbs(Xt.get()-wt.get())<.001},useBaseFriction:function useBaseFriction(){return useFriction(Dr)},useBaseDuration:function useBaseDuration(){return useDuration(sr)},useFriction,useDuration};return Ji}(Ll,Vl,Fl,Gl,Ji,.68),Wl=ScrollTarget(Yi,rs,Ba,ss,Gl),Xl=function ScrollTo(ze,wt,Rt,Xt,sr,Dr,Lr){function scrollTo(sr){const Ur=sr.distance,qr=sr.index!==wt.get();Dr.add(Ur),Ur&&(Xt.duration()?ze.start():(ze.update(),ze.render(1),ze.update())),qr&&(Rt.set(wt.get()),wt.set(sr.index),Lr.emit("select"))}return{distance:function distance(ze,wt){scrollTo(sr.byDistance(ze,wt))},index:function index(ze,Rt){const Xt=wt.clone().set(ze);scrollTo(sr.byIndex(Xt.get(),Rt))}}}(Ol,_s,Pl,Zl,Wl,Gl,Lr),ic=function ScrollProgress(ze){const{max:wt,length:Rt}=ze;return{get:function get(ze){return Rt?(ze-wt)/-Rt:0}}}
20(ss),lc=EventStore(),uc=SlidesInView(wt,Rt,Lr,jn),{slideRegistry:Ec}=function SlideRegistry(ze,wt,Rt,Xt,sr,Dr){const{groupSlides:Lr}=sr,{min:Ur,max:qr}=Xt;return{slideRegistry:function createSlideRegistry(){const Xt=Lr(Dr),sr=!ze||"keepSnaps"===wt;return 1===Rt.length?[Dr]:sr?Xt:Xt.slice(Ur,qr).map((ze,wt,Rt)=>{const Xt=!wt,sr=arrayIsLastIndex(Rt,wt);return Xt?arrayFromNumber(arrayLast(Rt[0])+1):sr?arrayFromNumber(arrayLastIndex(Dr)-arrayLast(Rt)[0]+1,arrayLast(Rt)[0]):ze})}()}}(pa,Yn,rs,qa,La,Cl),Mc=SlideFocus(ze,Rt,Ec,Xl,Zl,lc,Lr,Mo),Bc={ownerDocument:Xt,ownerWindow:sr,eventHandler:Lr,containerRect:zo,slideRects:oa,animation:Ol,axis:la,dragHandler:DragHandler(la,ze,Xt,sr,Gl,DragTracker(la,sr),Ll,Ol,Xl,Zl,Wl,_s,Lr,ua,Qi,kn,Wn,.68,Io),eventStore:lc,percentOfView:ua,index:_s,indexPrevious:Pl,limit:ss,location:Ll,offsetLocation:Vl,previousLocation:Fl,options:Dr,resizeHandler:ResizeHandler(wt,Lr,sr,Rt,la,Jn,jo),scrollBody:Zl,scrollBounds:ScrollBounds(ss,Vl,Gl,Zl,ua),scrollLooper:ScrollLooper(Ba,ss,Vl,[Ll,Vl,Fl,Gl]),scrollProgress:ic,scrollSnapList:rs.map(ic.get),scrollSnaps:rs,scrollTarget:Wl,scrollTo:Xl,slideLooper:SlideLooper(la,ca,Ba,wa,Pa,Ra,rs,Vl,Rt),slideFocus:Mc,slidesHandler:SlidesHandler(wt,Lr,Qn),slidesInView:uc,slideIndexes:Cl,slideRegistry:Ec,slidesToScroll:La,target:Gl,translate:Translate(la,wt)};return Bc}Rt.d(wt,{Z:()=>EmblaCarousel});const Xt={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function OptionsHandler(ze){function mergeOptions(ze,wt){return objectsMergeDeep(ze,wt||{})}const wt={mergeOptions,optionsAtMedia:function optionsAtMedia(wt){const Rt=wt.breakpoints||{},Xt=objectKeys(Rt).filter(wt=>ze.matchMedia(wt).matches).map(ze=>Rt[ze]).reduce((ze,wt)=>mergeOptions(ze,wt),{});return mergeOptions(wt,Xt)},optionsMediaQueries:function optionsMediaQueries(wt){return wt.map(ze=>objectKeys(ze.breakpoints||{})).reduce((ze,wt)=>ze.concat(wt),[]).map(ze.matchMedia)}};return wt}function EmblaCarousel(ze,wt,Rt){const sr=ze.ownerDocument,Dr=sr.defaultView,Lr=OptionsHandler(Dr),Ur=function PluginsHandler(ze){let wt=[];return{init:function init(Rt,Xt){return wt=Xt.filter(({options:wt})=>!1!==ze.optionsAtMedia(wt).active),wt.forEach(wt=>wt.init(Rt,ze)),Xt.reduce((ze,wt)=>Object.assign(ze,{[wt.name]:wt}),{})},destroy:function destroy(){wt=wt.filter(ze=>ze.destroy())}}}(Lr),qr=EventStore(),ri=function EventHandler(){let ze,wt={};function getListeners(ze){return wt[ze]||[]}const Rt={init:function init(wt){ze=wt},emit:function emit(wt){return getListeners(wt).forEach(Rt=>Rt(ze,wt)),Rt},off:function off(ze,Xt){return wt[ze]=getListeners(ze).filter(ze=>ze!==Xt),Rt},on:function on(ze,Xt){return wt[ze]=getListeners(ze).concat([Xt]),Rt},clear:function clear(){wt={}}};return Rt}(),{mergeOptions:ai,optionsAtMedia:Yi,optionsMediaQueries:Ji}=Lr,{on:Qi,off:kn,emit:jn}=ri,Un=reActivate;let Wn,Yn,Jn,Qn,Io=!1,Mo=ai(Xt,EmblaCarousel.globalOptions),jo=ai(Mo),zo=[];function createEngine(wt){const Rt=Engine(ze,Jn,Qn,sr,Dr,wt,ri);if(wt.loop&&!Rt.slideLooper.canLoop()){return createEngine(Object.assign({},wt,{loop:!1}))}return Rt}function activate(wt,Rt){Io||(Mo=ai(Mo,wt),jo=Yi(Mo),zo=Rt||zo,function storeElements(){const{container:wt,slides:Rt}=jo,Xt=isString(wt)?ze.querySelector(wt):wt;Jn=Xt||ze.children[0];const sr=isString(Rt)?Jn.querySelectorAll(Rt):Rt;Qn=[].slice.call(sr||Jn.children)}(),Wn=createEngine(jo),Ji([Mo,...zo.map(({options:ze})=>ze)]).forEach(ze=>qr.add(ze,"change",reActivate)),jo.active&&(Wn.translate.to(Wn.location.get()),Wn.animation.init(),Wn.slidesInView.init(),Wn.slideFocus.init(oa),Wn.eventHandler.init(oa),Wn.resizeHandler.init(oa),Wn.slidesHandler.init(oa),Wn.options.loop&&Wn.slideLooper.loop(),Jn.offsetParent&&Qn.length&&Wn.dragHandler.init(oa),Yn=Ur.init(oa,zo)))}function reActivate(ze,wt){const Rt=selectedScrollSnap();deActivate(),activate(ai({startIndex:Rt},ze),wt),ri.emit("reInit")}
20function deActivate(){Wn.dragHandler.destroy(),Wn.eventStore.clear(),Wn.translate.clear(),Wn.slideLooper.clear(),Wn.resizeHandler.destroy(),Wn.slidesHandler.destroy(),Wn.slidesInView.destroy(),Wn.animation.destroy(),Ur.destroy(),qr.clear()}function scrollTo(ze,wt,Rt){jo.active&&!Io&&(Wn.scrollBody.useBaseFriction().useDuration(!0===wt?0:jo.duration),Wn.scrollTo.index(ze,Rt||0))}function selectedScrollSnap(){return Wn.index.get()}const oa={canScrollNext:function canScrollNext(){return Wn.index.add(1).get()!==selectedScrollSnap()},canScrollPrev:function canScrollPrev(){return Wn.index.add(-1).get()!==selectedScrollSnap()},containerNode:function containerNode(){return Jn},internalEngine:function internalEngine(){return Wn},destroy:function destroy(){Io||(Io=!0,qr.clear(),deActivate(),ri.emit("destroy"),ri.clear())},off:kn,on:Qi,emit:jn,plugins:function plugins(){return Yn},previousScrollSnap:function previousScrollSnap(){return Wn.indexPrevious.get()},reInit:Un,rootNode:function rootNode(){return ze},scrollNext:function scrollNext(ze){scrollTo(Wn.index.add(1).get(),ze,-1)},scrollPrev:function scrollPrev(ze){scrollTo(Wn.index.add(-1).get(),ze,1)},scrollProgress:function scrollProgress(){return Wn.scrollProgress.get(Wn.offsetLocation.get())},scrollSnapList:function scrollSnapList(){return Wn.scrollSnapList},scrollTo,selectedScrollSnap,slideNodes:function slideNodes(){return Qn},slidesInView:function slidesInView(){return Wn.slidesInView.get()},slidesNotInView:function slidesNotInView(){return Wn.slidesInView.get(!1)}};return activate(wt,Rt),setTimeout(()=>ri.emit("init"),0),oa}EmblaCarousel.globalOptions=void 0}},Dr={};function __webpack_require__(ze){var wt=Dr[ze];if(void 0!==wt)return wt.exports;var Rt=Dr[ze]={id:ze,loaded:!1,exports:{}};return sr[ze].call(Rt.exports,Rt,Rt.exports,__webpack_require__),Rt.loaded=!0,Rt.exports}__webpack_require__.m=sr,__webpack_require__.n=ze=>{var wt=ze&&ze.__esModule?()=>ze.default:()=>ze;return __webpack_require__.d(wt,{a:wt}),wt},wt=Object.getPrototypeOf?ze=>Object.getPrototypeOf(ze):ze=>ze.__proto__,__webpack_require__.t=function(Rt,Xt){if(1&Xt&&(Rt=this(Rt)),8&Xt)return Rt;if("object"==typeof Rt&&Rt){if(4&Xt&&Rt.__esModule)return Rt;if(16&Xt&&"function"==typeof Rt.then)return Rt}var sr=Object.create(null);__webpack_require__.r(sr);var Dr={};ze=ze||[null,wt({}),wt([]),wt(wt)];for(var Lr=2&Xt&&Rt;"object"==typeof Lr&&!~ze.indexOf(Lr);Lr=wt(Lr))Object.getOwnPropertyNames(Lr).forEach(ze=>Dr[ze]=()=>Rt[ze]);return Dr.default=()=>Rt,__webpack_require__.d(sr,Dr),sr},__webpack_require__.d=(ze,wt)=>{for(var Rt in wt)__webpack_require__.o(wt,Rt)&&!__webpack_require__.o(ze,Rt)&&Object.defineProperty(ze,Rt,{enumerable:!0,get:wt[Rt]})},__webpack_require__.f={},__webpack_require__.e=ze=>Promise.all(Object.keys(__webpack_require__.f).reduce((wt,Rt)=>(__webpack_require__.f[Rt](ze,wt),wt),[])),__webpack_require__.u=ze=>"assets/js/chunks/"+({535:"Vimeo-Player",691:"Youtube-Player"}[ze]||ze)+"."+{51:"e444b821c1e20c1c4cd3",82:"8b66267ffc6c3266f824",130:"c96ac9af933e38e1075b",151:"c989492757ba783529ea",177:"c5129186716032b6df97",278:"c40548ae7a9d9633aa20",279:"2856d6ca4919b1346d7f",333:"252919a137b516f84f9a",404:"b031d62b4ea7d4e9e4fc",427:"695b1a4c98c57e9df0e3",444:"94258221540dee5e77e5",460:"2787e5fc378184bbe25f",489:"d4fcc0a4fbaca96c1c8b",521:"c0080f09f42f1133a1ad",535:"b38e343061447578dcf1",547:"c2218399482dba914165",548:"7a3589857f225ea5d53d",570:"45e9cb048c8781f604ea",627:"d7276bec4b1d344a3e11",651:"20dce373e57558efe27e",661:"70c8178f9831caf9b338",691:"ad569616ada9a4e607f7",740:"923815b7946d7bf9191e",748:"84a687ad7150643935f8",767:"2746dd995da8efd242c4",779:"4ae1fe4c04ec37271f38",792:"61d1974a917851dc4520",833:"8d828dcbabcb497df13c",877:"29049635fb4af2667807",898:"1b1a1901781650a7153f",929:"c6ee1a111a9462eb4453",945:"f14e5217163c2e2cabd2"}[ze]+".js",__webpack_require__.miniCssF=ze=>{},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(ze){if("object"==typeof window)return window}}(),__webpack_require__.o=(ze,wt)=>Object.prototype.hasOwnProperty.call(ze,wt),Rt={},Xt="frontend-setup:",__webpack_require__.l=(ze,wt,sr,Dr)=>{if(Rt[ze])Rt[ze].push(wt);else{var Lr,Ur;if(void 0!==sr)for(var qr=document.getElementsByTagName("script"),ri=0;ri<qr.length;ri++){var ai=qr[ri];if(ai.getAttribute("src")==ze||ai.getAttribute("data-webpack")==Xt+sr){Lr=ai;break}}Lr||(Ur=!0,(Lr=document.createElement("script")).charset="utf-8",Lr.timeout=120,__webpack_require__.nc&&Lr.setAttribute("nonce",__webpack_require__.nc),Lr.setAttribute("data-webpack",Xt+sr),Lr.src=ze),Rt[ze]=[wt];var onScriptComplete=(wt,Xt)=>
20{Lr.onerror=Lr.onload=null,clearTimeout(Yi);var sr=Rt[ze];if(delete Rt[ze],Lr.parentNode&&Lr.parentNode.removeChild(Lr),sr&&sr.forEach(ze=>ze(Xt)),wt)return wt(Xt)},Yi=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:Lr}),12e4);Lr.onerror=onScriptComplete.bind(null,Lr.onerror),Lr.onload=onScriptComplete.bind(null,Lr.onload),Ur&&document.head.appendChild(Lr)}},__webpack_require__.r=ze=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ze,"__esModule",{value:!0})},__webpack_require__.nmd=ze=>(ze.paths=[],ze.children||(ze.children=[]),ze),__webpack_require__.p="/frontend/hestia/",(()=>{__webpack_require__.b=document.baseURI||self.location.href;var ze={179:0};__webpack_require__.f.j=(wt,Rt)=>{var Xt=__webpack_require__.o(ze,wt)?ze[wt]:void 0;if(0!==Xt)if(Xt)Rt.push(Xt[2]);else{var sr=new Promise((Rt,sr)=>Xt=ze[wt]=[Rt,sr]);Rt.push(Xt[2]=sr);var Dr=__webpack_require__.p+__webpack_require__.u(wt),Lr=new Error;__webpack_require__.l(Dr,Rt=>{if(__webpack_require__.o(ze,wt)&&(0!==(Xt=ze[wt])&&(ze[wt]=void 0),Xt)){var sr=Rt&&("load"===Rt.type?"missing":Rt.type),Dr=Rt&&Rt.target&&Rt.target.src;Lr.message="Loading chunk "+wt+" failed.\n("+sr+": "+Dr+")",Lr.name="ChunkLoadError",Lr.type=sr,Lr.request=Dr,Xt[1](Lr)}},"chunk-"+wt,wt)}};var webpackJsonpCallback=(wt,Rt)=>{var Xt,sr,[Dr,Lr,Ur]=Rt,qr=0;if(Dr.some(wt=>0!==ze[wt])){for(Xt in Lr)__webpack_require__.o(Lr,Xt)&&(__webpack_require__.m[Xt]=Lr[Xt]);if(Ur)Ur(__webpack_require__)}for(wt&&wt(Rt);qr<Dr.length;qr++)sr=Dr[qr],__webpack_require__.o(ze,sr)&&ze[sr]&&ze[sr][0](),ze[sr]=0},wt=self.webpackChunkfrontend_setup=self.webpackChunkfrontend_setup||[];wt.forEach(webpackJsonpCallback.bind(null,0)),wt.push=webpackJsonpCallback.bind(null,wt.push.bind(wt))})(),__webpack_require__.nc=void 0,(()=>{"use strict";var ze={};__webpack_require__.r(ze);var wt=__webpack_require__(3379),Rt=__webpack_require__.n(wt),Xt=__webpack_require__(7795),sr=__webpack_require__.n(Xt),Dr=__webpack_require__(569),Lr=__webpack_require__.n(Dr),Ur=__webpack_require__(3565),qr=__webpack_require__.n(Ur),ri=__webpack_require__(9216),ai=__webpack_require__.n(ri),Yi=__webpack_require__(4589),Ji=__webpack_require__.n(Yi),Qi={};Qi.styleTagTransform=Ji(),Qi.setAttributes=qr(),Qi.insert=Lr().bind(null,"head"),Qi.domAPI=sr(),Qi.insertStyleElement=ai();Rt()(ze.default,Qi);ze.default&&ze.default.locals&&ze.default.locals;var kn;__webpack_require__(5142);"function"!=typeof(kn=window.Element.prototype).closest&&(kn.closest=function closest(ze){for(var wt=this;wt&&1===wt.nodeType;){if(wt.matches(ze))return wt;wt=wt.parentNode}return null});__webpack_require__(1783),__webpack_require__(4510);var jn=__webpack_require__(9490);Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function r(){var ze=isNaN(arguments[0])?1:Number(arguments[0]);return ze?Array.prototype.reduce.call(this,function(wt,Rt){return Array.isArray(Rt)?wt.push.apply(wt,r.call(Rt,ze-1)):wt.push(Rt),wt},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(ze){return Array.prototype.map.apply(this,arguments).flat()},writable:!0}),(0,jn.cF)();__webpack_require__(2896),__webpack_require__(6320),__webpack_require__(8167);var Un=__webpack_require__(2117),Wn=__webpack_require__(7173);const Yn="header--navigation-is-active";(0,jn.Nk)("bpd-header",()=>{const ze=(0,jn.YP)("[js-hook-header-menu-trigger]"),wt=(0,jn.YP)("[js-hook-header-mobile-actions]");let Rt=!1;function setMobileActionsTop(){wt.current&&(wt.current.style.top=`${window.innerHeight}px`)}(0,jn.N_)(()=>{(0,Un.GS)(({mobile:ze,mobilePlus:wt,tabletPortrait:Xt})=>{!Rt||ze.active||wt.active||Xt.active||(Wn.R.body.classList.remove(Yn),Rt=!1)}),setMobileActionsTop()}),(0,jn.iX)(ze,"click",function handleMenuTrigger(){Wn.R.body.classList.toggle(Yn),Rt=!Rt,setMobileActionsTop()}),(0,jn.iX)(window,"resize",function handleResize(){Rt&&setMobileActionsTop()})});__webpack_require__(6928);var Jn=__webpack_require__(5696);function _defineProperty(ze,wt,Rt){return(wt=function _toPropertyKey(ze){var wt=function _toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}(0,jn.Nk)("bpd-vkk-overlay",()=>{let ze="";const wt=(0,jn.YP)("[js-hook-button-submit]");function redirect(){window.location.href=ze}(0,jn.N_)(()=>{Jn.HP.subscribe(redirect,["loggedIn"])}),(0,jn.iX)(wt,"click",function onClick(wt){wt.preventDefault(),ze=wt.currentTarget,(0,Jn.jl)()?redirect():(0,Jn.x4)()})});const Qn="is-touch",Io=`${Qn}--with-mouse`,Mo=document.documentElement;const jo=new class DetectTouch{get isTouchDevice(){return this.touch}constructor(){_defineProperty(this,"touch",void 0),_defineProperty(this,"hasMouse",void 0),this.hasMouse=!1,this.touch="ontouchstart"in Mo||navigator.maxTouchPoints>0,Mo.addEventListener("touchstart",()=>{Mo.removeEventListener("mousemove",()=>this.handleMouseEvent())}),Mo.addEventListener("mousemove",()=>this.handleMouseEvent()),this.touch&&Mo.classList.add(Qn)}handleMouseEvent(){!this.hasMouse&&Mo.classList.contains(Qn)&&(Mo.classList.add(Io),this.hasMouse=!0)}},zo="hero-hotspot--crop-vertically";(0,jn.Nk)("hero-hotspot",({element:ze})=>{const wt=(0,jn.YP)("[js-hook-hero-hotspot-image]"),Rt=(0,jn.YP)("[js-hook-hero-hotspot-container]");let Xt,sr;
20function update(){Xt=Rt.current.getBoundingClientRect(),sr=wt.current.getBoundingClientRect(),!function isImageHigher(){const ze=Xt.width/Xt.height;return sr.width/sr.height<ze}()?ze.classList.remove(zo):ze.classList.add(zo)}(0,jn.N_)(update),(0,jn.iX)(wt,"load",update),(0,jn.iX)(window,"resize",update),(0,jn.iX)(Rt,"mousemove",ze=>{const wt=ze.clientX;jo.isTouchDevice||function setScroll(ze){const wt=sr.width-Xt.width,Dr=ze/Xt.width;Rt.current.scrollLeft=wt*Dr}(wt)})});var oa=__webpack_require__(7995),la=__webpack_require__(3352),ca=__webpack_require__(1269),ua=__webpack_require__(1856),ha=__webpack_require__(2002);function ownKeys(ze,wt){var Rt=Object.keys(ze);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function _objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?ownKeys(Object(Rt),!0).forEach(function(wt){notification_card_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function notification_card_defineProperty(ze,wt,Rt){return(wt=function notification_card_toPropertyKey(ze){var wt=function notification_card_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const NotificationCard=ze=>{const wt=_objectSpread(_objectSpread({"c-notification-card":!0},ze.variant&&{[`notification-card--${ze.variant}`]:!0}),ze.extraClass&&{[ze.extraClass]:!0});return ze.contentLink=_objectSpread(_objectSpread({},ze.contentLink),{},{classes:`notification-card__button ${ze.contentLink?.classes||""}`.trim()}),(0,oa.h)("div",{class:wt},ze.image?(0,oa.h)(ha.E,_objectSpread(_objectSpread({},ze.image),{},{classes:"notification-card__image",preload:{width:16,height:9},settings:{"320w":{width:320,height:140},"640w":{width:640,height:360},"1024w":{width:512,height:288},"1440w":{width:720,height:405},"1920w":{width:960,height:540}},objectFit:!0})):null,(0,oa.h)("div",{class:"notification-card__content"},ze.title?(0,oa.h)("p",{class:"u-h5 notification-card__title"},ze.title):null,ze.children?(0,oa.h)("div",{class:"s-rich-text"},ze.children):null,ze.contentLink?(0,oa.h)(ua.zx,_objectSpread({variant:"primary",width:"full-width"},ze.contentLink)):null))};var pa=__webpack_require__(2741),_a=__webpack_require__(8248);var wa=__webpack_require__(5044),Pa=__webpack_require__(6389),Oa=__webpack_require__(6808),Da=__webpack_require__.n(Oa);function flyin_user_journey_ownKeys(ze,wt){var Rt=Object.keys(ze);
20if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(ze);wt&&(Xt=Xt.filter(function(wt){return Object.getOwnPropertyDescriptor(ze,wt).enumerable})),Rt.push.apply(Rt,Xt)}return Rt}function flyin_user_journey_objectSpread(ze){for(var wt=1;wt<arguments.length;wt++){var Rt=null!=arguments[wt]?arguments[wt]:{};wt%2?flyin_user_journey_ownKeys(Object(Rt),!0).forEach(function(wt){flyin_user_journey_defineProperty(ze,wt,Rt[wt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(Rt)):flyin_user_journey_ownKeys(Object(Rt)).forEach(function(wt){Object.defineProperty(ze,wt,Object.getOwnPropertyDescriptor(Rt,wt))})}return ze}function flyin_user_journey_defineProperty(ze,wt,Rt){return(wt=function flyin_user_journey_toPropertyKey(ze){var wt=function flyin_user_journey_toPrimitive(ze,wt){if("object"!=typeof ze||!ze)return ze;var Rt=ze[Symbol.toPrimitive];if(void 0!==Rt){var Xt=Rt.call(ze,wt||"default");if("object"!=typeof Xt)return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===wt?String:Number)(ze)}(ze,"string");return"symbol"==typeof wt?wt:wt+""}(wt))in ze?Object.defineProperty(ze,wt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):ze[wt]=Rt,ze}const La="flyin-user-journey",Ra=`${La}-closed`,Na={day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"},FlyinUserJourney=()=>{const[ze,,wt]=(0,jn.v9)("enabled",!1),Rt=(0,jn.YP)("[js-hook-fly-in-user-journey-card"),[,Xt]=(0,la.oR)(Jn.HP);(0,jn.N_)(()=>{setTimeout(render,300)}),wt(()=>render());const sr=(0,Pa.a)();Xt(()=>{Da().remove(Ra),render()},["loggedIn"]);const render=async()=>{const wt=Da().get(Ra);if(!ze||!Rt.current||wt)return;const{projectPhases:Xt}=await(0,wa.KP)(),{projectPhases:Dr}=(0,_a.C_)(),Lr={},Ur=(0,oa.h)("p",null),qr=[],ri=Xt.filter(({id:ze,status:wt,saleStartDate:Rt})=>{if("InPreparation"!==wt||!Rt||Dr.includes(ze))return!1;return!(new Date(Rt).valueOf()-Date.now()>=(Xt=30,24*Xt*60*60*1e3));var Xt}).map(ze=>flyin_user_journey_objectSpread(flyin_user_journey_objectSpread({},ze),{},{saleStartDate:new Date(ze.saleStartDate)}));if(!ri.length)return;const ai=ri[0],{id:Yi,name:Ji,mainImage:Qi,saleStartDate:kn}=ai;if(!Ji||!Qi?.url)return;qr.push(Yi);const jn=kn.toLocaleString("nl-NL",Na);Ur.innerHTML=await(0,wa.WU)("FlyIn.UserJourney.Content",{replace:[{id:"projectName",value:Ji},{id:"saleStartDate",value:jn}]}),Lr.image={image:Qi.url,alt:Qi.metadata?.altText??Qi.title??""},Lr.title=await(0,wa.WU)("FlyIn.UserJourney.Title"),Lr.contentLink={label:await(0,wa.WU)("FlyIn.UserJourney.CtaLabel"),onClick:async()=>{(0,pa.xi)(La);await sr.load()&&sr.element.current?.openInitialized({selectedProjectPhases:qr})}},Rt.current.innerHTML="",Rt.current.append((0,oa.h)(NotificationCard,flyin_user_journey_objectSpread({},Lr),Ur)),(0,pa.cJ)(La)};return(0,oa.h)(ca.p,{id:La,label:(0,wa.qM)("Updates"),onClose:()=>Da().set(Ra,"closed")},(0,oa.h)("div",{"js-hook-fly-in-user-journey-card":!0}))};FlyinUserJourney.props={enabled:{type:Boolean,reflectToAttr:!0}},(0,jn.Nk)("bpd-flyin-user-journey",FlyinUserJourney);var Ba=__webpack_require__(7085),Ua=__webpack_require__(1838);const qa="wishlist-controller--loading",WishlistController=({element:ze})=>{const[wt]=(0,jn.v9)("filterDisabled",!1),[Rt]=(0,jn.v9)("cardSelector",".c-property-card"),[Xt]=(0,jn.v9)("limit",10),sr=(0,jn.YP)("bpd-slider-progress"),Dr=(0,jn.YP)(`[${Ba.Fy}]`);let Lr;function updateState(ze){const wt=new Set(Jn.HP.getState().wishlist),Xt=new Set,sr=new Set,Dr=new Set,Ur=ze.reduce((ze,Lr)=>{const Ur=Lr.querySelector(Rt),qr=Ur?.dataset.constructionNumberId,ri=Ur?.dataset.propertyTypeId,ai=Ur?.dataset.displayStatus;return qr?(wt.has(qr)&&(Xt.add(qr),ri&&sr.add(ri)),ai&&!Dr.has(ai)&&Dr.add(ai),ze.push({constructionNumberId:qr,propertyTypeId:ri,status:ai,sliderCell:Lr}),ze):ze},[]);Lr={slides:Ur,wishlist:Xt,wishlistPropertyTypes:sr,statuses:Dr,renderedSlides:[]}}function extractWishlistSimilarSlides(ze){const{wishlist:wt,wishlistPropertyTypes:Rt}=Lr;if(!Rt.size)return[[],ze];const[Xt=[],sr=[]]=(0,Ua.u)(ze,({constructionNumberId:ze,propertyTypeId:Xt})=>!wt.has(ze)&&(!!Xt&&Rt.has(Xt)));
20return[Xt,sr]}function evenlyDistribute(ze,wt){let Rt=0;const Xt=[],sr=new Set;let Dr;do{Dr=new Set,ze.forEach(ze=>{const{propertyTypeId:Lr,constructionNumberId:Ur}=ze;Rt>=wt||!Lr||Dr.has(Lr)||sr.has(Ur)||(sr.add(Ur),Dr.add(Lr),Xt.push(ze),Rt++)})}while(Rt<wt&&Dr.size>0);return Xt}async function renderSlides(){const{current:wt}=sr,{current:Rt}=Dr;if(!wt||!Rt||!Lr)return;const{renderedSlides:Ur,statuses:qr}=Lr;ze.classList.add(qa);const[ri,ai]=function extractWishlistSlides(){const{slides:ze,wishlist:wt}=Lr;if(!wt.size)return[[],ze];const[Rt=[],Xt=[]]=(0,Ua.u)(ze,({constructionNumberId:ze})=>!!wt.has(ze));return[Rt,Xt]}();ri.length&&Ur.push(...ri);for(const ze of qr){const wt=Ur.length,Rt=Xt-wt,sr=ai.filter(({status:wt})=>ze===wt),Dr=sr.length>Rt;if(Rt<=0)break;if(!sr.length)continue;const[Lr,qr]=extractWishlistSimilarSlides(sr),ri=Lr.length;if(ri<Rt)if(Ur.push(...evenlyDistribute(Lr,ri)),Dr){const ze=Rt-ri;Ur.push(...evenlyDistribute(qr,ze))}else Ur.push(...evenlyDistribute(qr,qr.length));else Ur.push(...evenlyDistribute(Lr,Rt))}Rt.innerHTML="",Ur.map(({sliderCell:ze})=>ze.cloneNode(!0)).forEach(ze=>Rt.appendChild(ze)),wt.connected||await wt.componentOnReady(),wt.reload(),ze.classList.remove(qa)}(0,jn.N_)(async()=>{if(!Dr.current||wt)return;const ze=Array.from(Dr.current.children);updateState(ze);const Rt=setTimeout(renderSlides,100);Jn.HP.subscribe(async()=>{Rt&&clearTimeout(Rt),updateState(ze),renderSlides()},["loggedIn"])})};WishlistController.props={filterDisabled:{type:Boolean,reflectToAttr:!0},cardSelector:{type:String,reflectToAttr:!0},maxItems:{type:Number,reflectToAttr:!0},limit:{type:Number,reflectToAttr:!0}},(0,jn.Nk)("bpd-property-slider-wishlist-controller",WishlistController);const rs="is-added",ss="is-not-added",BPDWishlistToggle=({element:ze})=>{const wt=window.__ENVIRONMENT_DETAILS__.wishlistConstructionNumberId||"",[Rt]=(0,jn.v9)("constructionNumberId",wt),Xt=(0,jn.YP)("button");function setProps(){(0,Jn.t9)(Rt)?(ze.setAttribute(rs,""),ze.removeAttribute(ss)):(ze.setAttribute(ss,""),ze.removeAttribute(rs))}(0,jn.iX)(Xt,"click",async function handleClick(ze){ze.stopPropagation(),ze.preventDefault(),Xt.current?.classList.add("is-loading"),(0,Jn.t9)(Rt)?(0,Jn.$f)(Rt):await(0,Jn.Mp)(Rt);Xt.current?.classList.remove("is-loading")}),(0,jn.N_)(()=>{setProps(),Jn.HP.subscribe(()=>setProps(),["wishlist"])})};BPDWishlistToggle.props={constructionNumberId:{type:String}},(0,jn.Nk)("bpd-wishlist-toggle-wrapper",BPDWishlistToggle);var _s=__webpack_require__(5737),Pl=__webpack_require__(182);const WishlistFavouriteButton=({element:ze})=>{const[wt]=(0,jn.v9)("constructionNumberId",""),[Rt]=(0,jn.v9)("count",0),[Xt,sr]=(0,jn.v9)("rendered",!1),[,Dr,Lr]=(0,jn.v9)("isFavourited",!1),[,Ur]=(0,la.oR)(Jn.HP),qr=(0,jn.YP)("[js-hook-wishlist-favourite-button-count]");function checkWishlist(){const ze=(0,Jn.AH)(),Rt=!!ze?.includes(wt);Dr(Rt)}return(0,wa.Rd)(Pl.Z),(0,jn.N_)(()=>{checkWishlist(),sr(!0)}),Ur(checkWishlist,["wishlist"]),Lr((ze,wt)=>{ze!==wt&&(qr.current.innerText=`${ze?Rt+1:Rt}`)}),Xt&&(ze.innerHTML=""),(0,oa.h)("bpd-wishlist-toggle-wrapper",{class:"c-wishlist-favourite-button","construction-number-id":wt},(0,oa.h)(_s.D,{ariaLabel:"Voeg toe aan wishlist",hook:"wishlist-favourite-button",classes:"wishlist-favourite-button__button",size:"small",hasLoading:!0},(0,oa.h)("bpd-svg",{name:"icons-heart"}),(0,oa.h)("span",{class:"wishlist-favourite-button__count","js-hook-wishlist-favourite-button-count":!0},Rt)))};WishlistFavouriteButton.props={constructionNumberId:{type:String},count:{type:Number},isFavourited:{type:Boolean},rendered:{type:Boolean,reflectToAttr:!0}},(0,jn.Nk)("bpd-wishlist-favourite-button",WishlistFavouriteButton);__webpack_require__(1704);var Cl=__webpack_require__(8620),Ol=__webpack_require__(7663);const FlyinWishlist=()=>{const[ze]=(0,jn.v9)("flyinButtonUrl"),wt=(0,jn.YP)("[js-hook-flyin-wishlist]"),[,Rt]=(0,la.oR)(Jn.HP);let Xt,sr=[],Dr=!1;(0,jn.N_)(async()=>{(0,Jn.jl)()&&(Dr=!0,setSavedConstructionNumbers())}),Rt(({loggedIn:ze})=>{ze?setSavedConstructionNumbers():(sr=[],Dr=!1)},["loggedIn"]),Rt(({wishlist:ze})=>{if(Dr){const wt=ze?.filter(ze=>-1===sr?.indexOf(ze))||[];wt.length?(renderWishlistPropertyCards(wt),(0,pa.cJ)("flyin-wishlist")):((0,pa.xi)("flyin-wishlist"),setSavedConstructionNumbers())}Dr=!0},["wishlist"]);const setSavedConstructionNumbers=()=>{const ze=(0,Jn.AH)();sr=ze?[...ze]:[]},getUnSubscribedConstructionNumbers=ze=>{const wt=(0,_a.C_)().projectPhases||[];return ze.reduce((ze,Rt)=>{const Xt=Rt.projectPhase?.id,sr=!!Xt&&(ze=>!!wt.find(wt=>wt===ze))(Xt);return sr||ze.push(Rt),ze},[])},renderWishlistPropertyCards=async ze=>{const Rt=await(async()=>(Xt||(Xt=await la._n.getData(window.__ENVIRONMENT_DETAILS__.areaId)),Xt))();if(!Rt)return;const sr=Rt.constructionNumbers.filter(({id:wt})=>ze.includes(wt)),Dr=getUnSubscribedConstructionNumbers(sr);wt.current.innerHTML="",Dr.length&&renderSubscriptionBox(Dr[0]),wt.current.append((0,oa.h)(oa.H,null,sr.map(ze=>{const{specifications:wt,propertyTypeName:Rt,mainImage:Xt,identifier:sr,projectPhaseName:Dr}=ze;if(!Rt)return;const Lr=[];
20if(wt){const wt=(0,Ol.z8)(ze),Rt=(0,Ol.g0)(ze);wt&&Lr.push(wt.value),Rt&&Lr.push(Rt.value)}return(0,oa.h)(Cl.J,{classes:"flyin-wishlist__card",number:sr,title:Rt,project:Dr,image:Xt?.url,imageAlt:Xt?.metadata?.altText??Xt?.title??"",price:(0,Ol.T4)({constructionNumber:ze}),specs:Lr,status:(0,Ol.Sz)(ze),orientation:"vertical"})})))},renderSubscriptionBox=ze=>{const{districtId:Rt,projectPhase:Xt}=ze;Rt&&Xt&&"Rented"!==Xt.status&&"Sold"!==Xt.status&&wt.current.append((0,oa.h)("subscription-box",{class:"flyin-wishlist__subscription-box",boxContent:(0,wa.qM)("SubscriptionBox.Intro",{replace:[{id:"ProjectName",value:Xt.name||""}]}),projectPhaseId:Xt.id,projectPhaseName:Xt.name,districtId:Rt,buttonLabel:(0,wa.qM)("SubscriptionBox.ButtonLabel"),buttonVariant:"tertiary",variant:"vertical",deleteWhenSubscribed:!0}))};return(0,oa.h)(ca.p,{id:"flyin-wishlist",label:(0,wa.qM)("FlyInHeader.Text"),buttonLabel:(0,wa.qM)("ToWishlist.Text"),buttonLink:ze},(0,oa.h)("div",{"js-hook-flyin-wishlist":!0}))};FlyinWishlist.props={flyinButtonUrl:{type:String,required:!0}},(0,jn.Nk)("bpd-flyin-wishlist",FlyinWishlist);__webpack_require__(4597)})()})(); 21//# sourceMappingURL=main.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.