@oiz/stzh-components 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-bad16218.js → app-globals-c8895928.js} +2 -2
- package/dist/cjs/{app-globals-bad16218.js.map → app-globals-c8895928.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-card.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js +7 -6
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-ghettobox_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ghettobox_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +4 -4
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/collection/components/stzh-card/stzh-card.css +0 -3
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.css +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +6 -5
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js.map +1 -1
- package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +6 -0
- package/dist/collection/components/stzh-upload/stzh-upload.css +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +3 -3
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-e48a4be2.js → p-12df4eec.js} +8 -7
- package/dist/components/p-12df4eec.js.map +1 -0
- package/dist/components/{p-a8454c30.js → p-57db4298.js} +2 -2
- package/dist/components/p-57db4298.js.map +1 -0
- package/dist/components/{p-1e02d63c.js → p-c64f4bd8.js} +2 -2
- package/dist/components/p-c64f4bd8.js.map +1 -0
- package/dist/components/stzh-card.js +1 -1
- package/dist/components/stzh-checkbox.js +1 -1
- package/dist/components/stzh-geo-ref-data.js +1 -1
- package/dist/components/stzh-ghettobox.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +1 -1
- package/dist/components/stzh-upload.js +4 -4
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/components/stzh-vbz-majorticker.js +1 -1
- package/dist/esm/{app-globals-d5c59941.js → app-globals-d1453470.js} +2 -2
- package/dist/esm/{app-globals-d5c59941.js.map → app-globals-d1453470.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-card.entry.js +1 -1
- package/dist/esm/stzh-card.entry.js.map +1 -1
- package/dist/esm/stzh-checkbox_3.entry.js +7 -6
- package/dist/esm/stzh-checkbox_3.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-ghettobox_3.entry.js +1 -1
- package/dist/esm/stzh-ghettobox_3.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +4 -4
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/stzh-components/{p-79a63bd9.entry.js → p-120cc8be.entry.js} +2 -2
- package/dist/stzh-components/p-120cc8be.entry.js.map +1 -0
- package/dist/stzh-components/{p-ffed4972.entry.js → p-2b24520c.entry.js} +2 -2
- package/dist/stzh-components/p-2b24520c.entry.js.map +1 -0
- package/dist/stzh-components/p-3d7508f7.entry.js +2 -0
- package/dist/stzh-components/p-3d7508f7.entry.js.map +1 -0
- package/dist/stzh-components/p-4a00611c.entry.js +2 -0
- package/dist/stzh-components/p-4a00611c.entry.js.map +1 -0
- package/dist/stzh-components/{p-6f138c27.js → p-eb16c8df.js} +2 -2
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-1e02d63c.js.map +0 -1
- package/dist/components/p-a8454c30.js.map +0 -1
- package/dist/components/p-e48a4be2.js.map +0 -1
- package/dist/stzh-components/p-79a63bd9.entry.js.map +0 -1
- package/dist/stzh-components/p-836ee7e5.entry.js +0 -2
- package/dist/stzh-components/p-836ee7e5.entry.js.map +0 -1
- package/dist/stzh-components/p-e452b478.entry.js +0 -2
- package/dist/stzh-components/p-e452b478.entry.js.map +0 -1
- package/dist/stzh-components/p-ffed4972.entry.js.map +0 -1
- /package/dist/stzh-components/{p-6f138c27.js.map → p-eb16c8df.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e,g as r,e as n,w as h,F as a}from"./p-ef5985a3.js";import{h as o}from"./p-24caf6c1.js";import{S as f}from"./p-1e60797c.js";import{m as u}from"./p-f4adb3cd.js";import{t as l,c as v}from"./p-f48422c4.js";import{c}from"./p-a62948ad.js";import{c as d}from"./p-1ab64d01.js";import"./p-dae15605.js";const m=`<svg xmlns="http://www.w3.org/2000/svg" width="22px" height="22px" fill="none" viewBox="0 0 24 24"><g clip-path="url(#a)"><path fill="currentColor" d="m10 15.172 9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h24v24H0z"/></clipPath></defs></svg>`;const p=".sc-stzh-checkbox-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-checkbox-h,[stzh-hidden].sc-stzh-checkbox-h{display:none}.sc-stzh-checkbox-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h *.sc-stzh-checkbox,.sc-stzh-checkbox-h *.sc-stzh-checkbox::before,.sc-stzh-checkbox-h *.sc-stzh-checkbox::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-checkbox-h .has-focus.sc-stzh-checkbox{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox{outline-style:none !important}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox::-moz-focus-inner{border:0 !important}.sc-stzh-checkbox-h{--label-color:var(--stzh-checkbox-label-color, var(--stzh-base-color));--label-hover-color:var(--stzh-checkbox-label-hover-color, var(--stzh-color-primary70));--label-hover-checked-color:var(--stzh-checkbox-label-hover-checked-color, var(--stzh-color-primary90));--check-color:var(--stzh-checkbox-check-color, var(--stzh-color-primary));display:inline-block}[disabled].sc-stzh-checkbox-h:not([disabled=false]){--description-color:var(--stzh-color-grey70)}.stzh-checkbox.sc-stzh-checkbox{display:grid}.stzh-checkbox__marker-symbol.sc-stzh-checkbox{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-checkbox__marker-text.sc-stzh-checkbox{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-checkbox__description-wrapper.sc-stzh-checkbox{display:flex;flex-direction:column-reverse;min-height:var(--description-min-height, var(--stzh-description-min-height, none))}.stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox__description.sc-stzh-checkbox{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-checkbox__error.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox__error-list.sc-stzh-checkbox{list-style:none;margin:0;padding:0}.stzh-checkbox__description.sc-stzh-checkbox{display:flex;align-items:flex-start;color:var(--stzh-input-description-color, var(--description-color, var(--stzh-color-coolgrey70)));transition:color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__description-long.sc-stzh-checkbox{margin-right:var(--stzh-space-xxsmall);margin-top:0.125rem}@supports (font: -apple-system-body) and (-webkit-appearance: none){.stzh-checkbox__description-long.sc-stzh-checkbox{margin-top:0}}.stzh-checkbox__description-long-popover.sc-stzh-checkbox{--width:auto;--max-width:27.3125rem}.stzh-checkbox__description-long-button.sc-stzh-checkbox{display:flex;justify-content:center;align-items:center;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer}.stzh-checkbox.sc-stzh-checkbox stzh-icon.stzh-checkbox__description-long-icon.sc-stzh-checkbox{--size:var(--stzh-icon-size-xsmall)}.stzh-checkbox--has-error.sc-stzh-checkbox .stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox--has-description.sc-stzh-checkbox .stzh-checkbox__description.sc-stzh-checkbox{margin-top:var(--stzh-space-xxxsmall)}.stzh-checkbox__field-wrapper.sc-stzh-checkbox{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:flex;-webkit-user-select:none;user-select:none;cursor:pointer}.stzh-checkbox__input.sc-stzh-checkbox{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none;appearance:none;border-radius:var(--stzh-form-input-border-radius)}.stzh-checkbox__mark.sc-stzh-checkbox{border:0.125rem solid var(--stzh-color-black);background-color:var(--stzh-color-white);width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:var(--stzh-form-input-border-radius);display:inline-flex;justify-content:center;align-items:center;transition:border-color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__check.sc-stzh-checkbox{display:flex;flex-direction:column;justify-content:center;opacity:0;color:var(--check-color);transition-property:color;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-checkbox__label.sc-stzh-checkbox{--stzh-base-color:initial;display:inline-block;color:var(--label-color);transition:color var(--stzh-base-transition-animation-speed);margin-left:var(--stzh-space-small);line-height:1.5rem}.stzh-checkbox__label.sc-stzh-checkbox:empty{display:none}.stzh-checkbox__marker.sc-stzh-checkbox{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-left:calc(-0.25em + var(--stzh-space-xsmall))}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--label-hover-color)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--label-hover-checked-color)}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__mark.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--label-hover-color)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--label-hover-checked-color)}.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{opacity:1}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-error60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__field-wrapper.sc-stzh-checkbox{cursor:not-allowed}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-grey60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__mark.sc-stzh-checkbox{background-color:var(--stzh-color-grey20)}";const z=p;let M=0;const _=class{constructor(s){t(this,s);this.stzhChange=i(this,"stzhChange",7);this.stzhFocus=i(this,"stzhFocus",7);this.stzhBlur=i(this,"stzhBlur",7);this.focusedByInput=false;this.handleReset=async()=>{this.checked=this.defaultChecked};this.onInput=t=>{this.checked=this.input.checked;this.stzhChange.emit({component:"stzh-checkbox",originalEvent:t,value:this.value,checked:this.checked})};this.onRootFocus=()=>{if(!this.focusedByInput){this.input.focus()}this.focusedByInput=false};this.onFocus=t=>{this.focusedByInput=true;const i=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhFocus.emit({component:"stzh-checkbox",originalEvent:t})};this.onBlur=t=>{const i=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhBlur.emit({component:"stzh-checkbox",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.checked=false;this.defaultChecked=undefined;this.label="";this.description=undefined;this.descriptionLong=undefined;this.descriptionLongTitle=undefined;this.hideOptional=false;this.error=undefined;this.a11yDescribedby=""}resetListener(t){if(t.target.contains(this.element)){requestAnimationFrame((()=>{this.handleReset()}))}}errorWatcher(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(i){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}}async componentWillLoad(){this.inputId=`stzh-checkbox-${M++}`;this.errorWatcher(this.error);this.defaultChecked=typeof this.defaultChecked==="boolean"?this.defaultChecked:this.checked;if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"checkbox")}}render(){var t,i;const r=o(this.element,"description")||!!this.description;const n=o(this.element,"description-long")||!!this.descriptionLong;const h=o(this.element,"error")||((t=this._error)===null||t===void 0?void 0:t.length)>0;const a={"stzh-checkbox":true,"stzh-checkbox--has-description":r,"stzh-checkbox--has-description-long":n,"stzh-checkbox--has-error":h,"stzh-checkbox--is-required":this.required,"stzh-checkbox--is-invalid":this.invalid||h,"stzh-checkbox--is-disabled":this.disabled};return s(e,{key:"74cb5de9a35d2fb29344cdc00f89275ac46387a7","is-invalid":this.invalid||h,tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},s("div",{key:"d25e1634cf78c180a30fc3763fe584986ec5cee4",class:a},s("label",{key:"05ec24e55d00df4a928def2e340023efb605a6eb",class:"stzh-checkbox__field-wrapper"},s("input",{key:"7747960b80065b631ac378baeed2165ce7212ae5",class:"stzh-checkbox__input",ref:t=>this.input=t,type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":`${this.inputId}-description ${this.a11yDescribedby}`,"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,defaultChecked:this.defaultChecked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),s("div",{key:"50185389b282e4ad2ff4a64fc39e07a3c689e5cf",class:"stzh-checkbox__mark"},s("div",{key:"43fcdb36cc8a3e49f2ab65cfea2512dd6c15bcd7",class:"stzh-checkbox__check",innerHTML:m})),s("div",{key:"f2a1af9a1cc5fda36071f2a79557d2fc150a8506",class:"stzh-checkbox__label"},this.label?this.label:s("slot",null),!this.hideOptional&&s("span",{key:"6f63cc1781b3ba6c60954485efa630e01f97919a",class:"stzh-checkbox__marker"},s("span",{key:"a61a1e2ea60ad5316d9036e7b5ea0a7de07ecb4c",class:"stzh-checkbox__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),s("span",{key:"931884cc95c9b3f0cd0b4f94f76c601d517b4e76",class:"stzh-checkbox__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),(((i=this._error)===null||i===void 0?void 0:i.length)>0||this.description||this.descriptionLong)&&s(f,{key:"0aaf400842f0ed1a06ea2c2deb12aba202cc669a",classPrefix:"stzh-checkbox",id:`${this.inputId}-description`,error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongTitle:this.descriptionLongTitle,descriptionLongUsed:n,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel})))}get element(){return r(this)}static get watchers(){return{error:["errorWatcher"]}}};_.style=z;const g=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h,[stzh-hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--logo-width:auto;--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color)}@media print{.sc-stzh-header-h{display:none}}[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz].sc-stzh-header-s>[slot=logo],.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h.sc-stzh-header-s>[slot=logo],.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--stzh-color-coolgrey10)}.stzh-header__metabar-inner.sc-stzh-header{margin-left:1.25rem;margin-right:1.25rem;display:flex;align-items:center;height:4rem}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--stzh-color-grey90);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium);gap:var(--stzh-space-medium);color:var(--stzh-color-primary70)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}@media screen and (max-width: 599px){.stzh-header__burger-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:calc(var(--stzh-space-medium) + var(--stzh-icon-size) + var(--stzh-space-medium));padding-right:var(--stzh-space-xlarge)}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium), -50%)}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge)}}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem;--background-color:var(--stzh-color-coolgrey10)}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small);align-items:center;justify-content:center;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc(100% - 34.5625rem + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2);margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium);padding-right:var(--stzh-space-medium);padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:1.25rem;display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:2rem}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--stzh-color-secondary30);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc((27.4375rem - 4rem) + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:hidden}@media (min-height: 580px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto}}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto;position:static}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-large);background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small)}}@media screen and (min-width: 600px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge));padding-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--stzh-color-secondary20);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header{transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--stzh-color-secondary40)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary10)}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall);appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--stzh-color-primary70);padding-left:var(--stzh-space-xxxlarge);padding-top:var(--stzh-space-small);padding-bottom:var(--stzh-space-small);padding-right:var(--stzh-space-large);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium);padding-top:var(--stzh-space-medium);padding-bottom:var(--stzh-space-xsmall);min-height:none;padding-left:1.25rem;padding-right:1.25rem;gap:var(--stzh-space-xxsmall)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium);padding-right:var(--stzh-space-xxlarge)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium);margin-bottom:var(--stzh-space-xlarge);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge);margin-top:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}";const b=g;const x="stzh-header-open";const w=class{constructor(s){t(this,s);this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick",7);this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick",7);this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick",7);this.stzhMenuItemClick=i(this,"stzhMenuItemClick",7);this.stzhLanguageChange=i(this,"stzhLanguageChange",7);this.stzhSearchChange=i(this,"stzhSearchChange",7);this.stzhSearchChanged=i(this,"stzhSearchChanged",7);this.lastOpener=null;this.flyoutOpenedByMetanavItem=null;this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);if(this.isMedium&&i){this.closeMenuItem(false)}};this.handleBurgerClick=async()=>{if(this.flyoutOpenedByMetanavItem){this.flyoutOpenedByMetanavItem=false;this.closeMetanavItem()}else{this.flyoutSearchOpen=false;this.flyoutOpen=!this.flyoutOpen}const t=this.element.querySelector(".stzh-header__menu-item");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleSearchButtonClick=async()=>{this.flyoutOpen=false;this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleBackdropClick=async()=>{this.flyoutOpen=false;this.updatePosition()};this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=false;this.updatePosition()};this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})};this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})};this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=false;this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleSearchInput=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleSearchChange=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleLanguageClick=(t,i)=>{if(this.languagePreventUrlchange){t.preventDefault()}this.languageActive=i.value;this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})};this.handleFlyoutResize=()=>{this.resizeMenunavElement()};this.handleResize=()=>{if(this.sticky==="disabled"){return}if(this.debounceResize){window.cancelAnimationFrame(this.debounceResize)}this.debounceResize=requestAnimationFrame((()=>{n((()=>{var t,i,s;this.isMedium=u("medium").matches;this.isSmallOrMicro=!this.isMedium;this.mainHeight=((t=this.mainElement)===null||t===void 0?void 0:t.offsetHeight)||0;this.metabarHeight=((i=this.metabarElement)===null||i===void 0?void 0:i.offsetHeight)||0;this.logobarHeight=((s=this.logobarElement)===null||s===void 0?void 0:s.offsetHeight)||0;this.headerTop=this.element.offsetTop;this.headerHeight=this.metabarHeight+this.logobarHeight}));h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`);document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`);document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`);document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`)}));this.scrollListener()}))};this.localization=undefined;this.href="https://www.stadt-zuerich.ch";this.menuId="anchorNavMain";this.appNavId="anchorNavAppNav";this.searchId="anchorSearch";this.metanavId="anchorNavMeta";this.languageId="anchorNavLang";this.logoType="default";this.menuItems=[];this._menuItems=undefined;this.menuBackLabel=undefined;this.metanavItems=[];this._metanavItems=undefined;this.userSpecificMetanavItemsNotLoggedIn=[];this._userSpecificMetanavItemsNotLoggedIn=[];this.appNavItems=[];this._appNavItems=undefined;this.userSpecificMetanavItemsEndpoint=undefined;this.languageActive=undefined;this.languages=[];this._languages=undefined;this.languagePreventUrlchange=false;this.languageStay=false;this.hideMetabar=false;this.searchAction=undefined;this.searchFieldName="q";this.searchValue="";this.sticky="default";this.loginErrorMessage="";this.logoAnalyticsId=undefined;this.hideLogo=false;this.headerHeight=undefined;this.paddingTop=undefined;this.stickyActive=false;this.flyoutOpen=false;this.flyoutSearchOpen=false;this.searchFilled=undefined;this.fixed=false;this.fixedTransition=false;this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=false;this.userSpecificMetanavItemsLoggedIn=[];this.combinedMetanavItems=[];this.isSmallOrMicro=undefined}handleKeydown(t){if(t.key==="Escape"){this.flyoutOpen=false;this.flyoutSearchOpen=false}}flyoutCloseClicked(){this.flyoutSearchOpen=false;this.updatePosition()}async flyoutOpenWatcher(t){if(!t){this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=null;this.flyoutOpenedByMetanavItem=false;document.body.classList.remove(x);this.enableSiblings();if(this.trap){this.trap.deactivate()}}else{document.body.classList.add(x);this.disableSiblings();if(this.trap){this.trap.activate()}}}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0;await this.waitForNextRender();this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen){return}const t=()=>{this.stickyActive=true;document.documentElement.style.setProperty("--stzh-header-is-stuck","1");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")};const i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1");this.stickyActive=false};if(this.sticky==="disabled"){i()}else if(this.sticky==="always-full"){t()}else if(this.sticky==="always"){if(this.belowStayStickyPoint){t()}else{i()}}else{if(this.scrollingUp&&this.belowStayStickyPoint){if(!this.stickyActive&&this.belowStartStickyPoint){t()}}else{if(this.stickyActive&&this.belowStayStickyPoint){i()}else{i()}}}}scrollListener(){if(this.sticky==="disabled"){return}n((()=>{this.currentScrollY=window.scrollY;this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY;this.lastScrollY=this.currentScrollY;this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight;this.belowStartStickyPoint=this.currentScrollY>this.headerHeight;this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||this.sticky==="always"&&this.belowStayStickyPoint||this.sticky==="always-full";this.headerOverlap=(this.headerTop-this.currentScrollY)/-1;this.hideLogo=this.sticky!=="always-full"&&this.isMedium&&this.headerOverlap>1}));h((()=>{this.updatePosition()}))}searchValueWatcher(t){this.searchFilled=t!==""}menuItemsWatcher(t){if(typeof t==="string"){this._menuItems=JSON.parse(t)}else{this._menuItems=t}this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){if(typeof t==="string"){this._metanavItems=JSON.parse(t)}else{this._metanavItems=t}this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t)));this.combineMetanavItems()}appNavItemsWatcher(t){if(typeof t==="string"){this._appNavItems=JSON.parse(t)}else{this._appNavItems=t}}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t;this.combineMetanavItems()}languagesWatcher(t){if(typeof t==="string"){this._languages=JSON.parse(t)}else{this._languages=t}}getSiblings(){if(!this._parentElement){return[]}return Array.from(this._parentElement.children).filter((t=>t!==this.element))}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement){Object.assign(this.menunavElement.style,{height:null})}else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=true;this.lastOpener=t.currentTarget;this.openSubmenuElement=this.element.querySelector(`#${i.id}`);this.currentOpenMenuItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&l(this.openSubmenuElement)[0];t===null||t===void 0?void 0:t.focus();this.resizeMenunavElement()}))}async closeMenuItem(t=true){this.openSubmenuElement=null;this.currentOpenMenuItem=null;await this.waitForNextRender();if(t){requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null;this.resizeMenunavElement()}))}}async openMetanavItem(t,i){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenMetanavItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`);const s=t&&l(t)[0];s===null||s===void 0?void 0:s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async openLanguage(t){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenLanguage=true;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages");const i=t&&l(t)[0];i===null||i===void 0?void 0:i.focus()}))}async closeLanguage(){this.currentOpenLanguage=false;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(!this.userSpecificMetanavItemsEndpoint){return}try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json();this.combineMetanavItems()}catch(t){this.combineMetanavItems(true);console.error("Error fetching data:",t);if(this.loginErrorMessage){document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}}combineMetanavItems(t=false){if(!this.userSpecificMetanavItemsEndpoint||t){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn]}else{this.combinedMetanavItems=[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}}async componentWillLoad(){this.menuItemsWatcher(this.menuItems);this.metanavItemsWatcher(this.metanavItems);this.appNavItemsWatcher(this.appNavItems);this.languagesWatcher(this.languages);this.searchValueWatcher(this.searchValue);this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn);this.requestUserSpecificMetanavItems();if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header")}}componentDidRender(){if(this.renderPromiseResolve){this.renderPromiseResolve()}if(this.flyoutElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutElement)}if(this.flyoutSearchElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutSearchElement)}}componentDidLoad(){this.trap=v(this.element,Object.assign(Object.assign({},c()),{initialFocus:false}));this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize);if(this.flyoutElement){this.flyoutResizeObserver.observe(this.flyoutElement)}}connectedCallback(){this._parentElement=this.element.parentElement;this.resizeObserver=new ResizeObserver(this.handleResize);this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(false);(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.flyoutResizeObserver)===null||i===void 0?void 0:i.disconnect()}render(){var t,i,r,n,h,f,u;const l=o(this.element,"metanav-before");const v=o(this.element,"metanav-after");const c={"stzh-header":true,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo,"stzh-header--has-empty-metabar-mobile":!l&&!v&&this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length===0&&this._menuItems.length===0&&(this._languages.length===0||this._languages.length>0&&!this.languageStay)&&!this.searchAction,"stzh-header--has-empty-metabar":!l&&!v&&this._metanavItems.length===0&&this._menuItems.length===0&&this._languages.length===0&&!this.searchAction,[`stzh-header--sticky-${this.sticky}`]:!!this.sticky};const d=this.languageActive||window.stzhComponents.utils.getLocale(this.element);const m=((t=this._languages)===null||t===void 0?void 0:t.find((({value:t})=>t===d)))||((i=this._languages)===null||i===void 0?void 0:i[0])||null;const p=(t,i,e)=>{var r;const n=((r=t.items)===null||r===void 0?void 0:r.length)>0||t.itemButton||!t.href?"button":"a";return s(n,Object.assign({},e,{id:t.id+"-button",href:n==="a"&&t.href,target:n==="a"&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":true,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),s("span",{class:{"stzh-header__metanav-item-text":true,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},s("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),s("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&s("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&s("stzh-icon",{class:`stzh-header__metanav-icon ${t.iconOpen?"is-close":""}`,name:t.icon}),t.iconOpen&&s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&s("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:typeof t.badgeType==="undefined"?"error":t.badgeType})))};return s(e,null,s("header",{class:c},s("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this.isSmallOrMicro&&this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav-bottom"},s("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})),s("div",{class:"stzh-header__inner"},s("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},s("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},s("div",{class:"stzh-header__logobar-logo"},s("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},s("slot",{name:"logo"}))),s("div",{class:"stzh-header__logobar-decoration"})),!this.hideMetabar&&s("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},s("div",{class:"stzh-header__metabar-inner"},s("slot",{name:"menu-before"}),this._menuItems.length>0&&s("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},s("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),s("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),s("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&s("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},s("label",{class:"stzh-header__search"},s("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),s("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),s("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&s("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},s("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),s("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),s("slot",{name:"menu-after"}),!this.isSmallOrMicro&&this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav"},s("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})),s("div",{class:"stzh-header__metabar-nav",id:this.metanavId},s("slot",{name:"metanav-before"}),this.combinedMetanavItems.map((t=>{var i,e;return((i=t.items)===null||i===void 0?void 0:i.length)>0||t.itemButton?s(a,null,p(t,{"is-popover-mobile":true},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}}),s("stzh-popover",{class:{"stzh-header__metanav-popover":true},placement:"bottom-end",distance:20,variant:t.variant,size:typeof t.size==="undefined"?"large":t.size},p(t,{"is-popover-desktop":true},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),s("div",{slot:"content"},((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("stzh-menu",null,t.items.map((i=>s("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":true,"is-heavy":typeof t.importantSubmenu==="undefined"||t.importantSubmenu},size:typeof t.size==="undefined"?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&s("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label))):p(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}})})),((r=this._languages)===null||r===void 0?void 0:r.length)>0&&s(a,null,s("h2",{id:this.languageId,class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&s("button",{class:{"stzh-header__metanav-item":true,"is-popover-mobile":true,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{if(this.currentOpenLanguage){this.closeLanguage()}else{this.openLanguage(t)}}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},s("button",{class:{"stzh-header__metanav-item":true,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("div",{slot:"content"},s("stzh-menu",null,this._languages.map((t=>s("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(m===null||m===void 0?void 0:m.value)===t.value,href:t.value,onClick:i=>this.handleLanguageClick(i,t)},t.text))))))),s("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||((n=this.combinedMetanavItems)===null||n===void 0?void 0:n.length)>0)&&s("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__menu"},s("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},s("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,e;return s("li",{class:{"stzh-header__menu-list-item":true,"is-open":t===this.currentOpenMenuItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},s("li",{class:"stzh-header__menu-list-item is-backlink"},s("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},s("stzh-icon",{name:"angle-left"}),s("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),(((h=this.combinedMetanavItems)===null||h===void 0?void 0:h.length)>0||((f=this._languages)===null||f===void 0?void 0:f.length)>0)&&s("div",{class:"stzh-header__menu-metanav"},s("nav",{class:"stzh-header__menu-metanav-nav"},s("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,e,r;return s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":t===this.currentOpenMetanavItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):s("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,t.label),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:(r=this.localization.closeMetanavMenuLabel)===null||r===void 0?void 0:r.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),s("span",{class:"stzh-header__menu-metanav-item-text"},s("span",null,t.label),t.counter!==undefined&&t.counter>0&&s("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},s("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label)))))})),((u=this._languages)===null||u===void 0?void 0:u.length)>0&&s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":this.currentOpenLanguage}},s("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},s("span",null,m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),s("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,this.localization.dialogLanguageTitle),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:t.value,onClick:i=>this.handleLanguageClick(i,t)},s("span",null,t.text),(m===null||m===void 0?void 0:m.value)===t.value&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&s("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__flyout-search-main"},s("slot",{name:"search"})))))}get element(){return r(this)}static get watchers(){return{flyoutOpen:["flyoutOpenWatcher","fixedWatcher"],flyoutSearchOpen:["flyoutOpenWatcher","fixedWatcher"],fixed:["fixedWatcher"],headerHeight:["fixedWatcher"],sticky:["stickyWatcher"],searchValue:["searchValueWatcher"],menuItems:["menuItemsWatcher"],metanavItems:["metanavItemsWatcher"],appNavItems:["appNavItemsWatcher"],userSpecificMetanavItemsNotLoggedIn:["userSpecificMetanavItemsNotLoggedInWatcher"],languages:["languagesWatcher"]}}};w.style=b;function y(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var i=0;i<=60;++i){t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m");t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m")}t.WGS84=t["EPSG:4326"];t["EPSG:3785"]=t["EPSG:3857"];t.GOOGLE=t["EPSG:3857"];t["EPSG:900913"]=t["EPSG:3857"];t["EPSG:102113"]=t["EPSG:3857"]}var k=1;var E=2;var N=3;var C=4;var I=5;var S=6378137;var O=6356752.314;var T=.0066943799901413165;var A=484813681109536e-20;var R=Math.PI/2;var P=.16666666666666666;var L=.04722222222222222;var D=.022156084656084655;var F=1e-10;var W=.017453292519943295;var G=57.29577951308232;var j=Math.PI/4;var V=Math.PI*2;var U=3.14159265359;var q={};q.greenwich=0;q.lisbon=-9.131906111111;q.paris=2.337229166667;q.bogota=-74.080916666667;q.madrid=-3.687938888889;q.rome=12.452333333333;q.bern=7.439583333333;q.jakarta=106.807719444444;q.ferro=-17.666666666667;q.brussels=4.367975;q.stockholm=18.058277777778;q.athens=23.7163375;q.oslo=10.722916666667;const X={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.01},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var Y=/[\s_\-\/\(\)]/g;function B(t,i){if(t[i]){return t[i]}var s=Object.keys(t);var e=i.toLowerCase().replace(Y,"");var r=-1;var n,h;while(++r<s.length){n=s[r];h=n.toLowerCase().replace(Y,"");if(h===e){return t[n]}}}function H(t){var i={};var s=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");s.push(true);t[s[0].toLowerCase()]=s[1];return t}),{});var e,r,n;var h={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*W},lat_1:function(t){i.lat1=t*W},lat_2:function(t){i.lat2=t*W},lat_ts:function(t){i.lat_ts=t*W},lon_0:function(t){i.long0=t*W},lon_1:function(t){i.long1=t*W},lon_2:function(t){i.long2=t*W},alpha:function(t){i.alpha=parseFloat(t)*W},gamma:function(t){i.rectified_grid_angle=parseFloat(t)},lonc:function(t){i.longc=t*W},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r:function(t){i.a=i.b=parseFloat(t)},r_a:function(){i.R_A=true},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=true},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var s=B(X,t);if(s){i.to_meter=s.to_meter}},from_greenwich:function(t){i.from_greenwich=t*W},pm:function(t){var s=B(q,t);i.from_greenwich=(s?s:parseFloat(t))*W},nadgrids:function(t){if(t==="@null"){i.datumCode="none"}else{i.nadgrids=t}},axis:function(t){var s="ewnsud";if(t.length===3&&s.indexOf(t.substr(0,1))!==-1&&s.indexOf(t.substr(1,1))!==-1&&s.indexOf(t.substr(2,1))!==-1){i.axis=t}},approx:function(){i.approx=true}};for(e in s){r=s[e];if(e in h){n=h[e];if(typeof n==="function"){n(r)}else{i[n]=r}}else{i[e]=r}}if(typeof i.datumCode==="string"&&i.datumCode!=="WGS84"){i.datumCode=i.datumCode.toLowerCase()}return i}var J=1;var Z=2;var $=3;var K=4;var Q=5;var tt=-1;var it=/\s/;var st=/[A-Za-z]/;var et=/[A-Za-z84_]/;var rt=/[,\]]/;var nt=/[\d\.E\-\+]/;function ht(t){if(typeof t!=="string"){throw new Error("not a string")}this.text=t.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=J}ht.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==K){while(it.test(t)){if(this.place>=this.text.length){return}t=this.text[this.place++]}}switch(this.state){case J:return this.neutral(t);case Z:return this.keyword(t);case K:return this.quoted(t);case Q:return this.afterquote(t);case $:return this.number(t);case tt:return}};ht.prototype.afterquote=function(t){if(t==='"'){this.word+='"';this.state=K;return}if(rt.test(t)){this.word=this.word.trim();this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)};ht.prototype.afterItem=function(t){if(t===","){if(this.word!==null){this.currentObject.push(this.word)}this.word=null;this.state=J;return}if(t==="]"){this.level--;if(this.word!==null){this.currentObject.push(this.word);this.word=null}this.state=J;this.currentObject=this.stack.pop();if(!this.currentObject){this.state=tt}return}};ht.prototype.number=function(t){if(nt.test(t)){this.word+=t;return}if(rt.test(t)){this.word=parseFloat(this.word);this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)};ht.prototype.quoted=function(t){if(t==='"'){this.state=Q;return}this.word+=t;return};ht.prototype.keyword=function(t){if(et.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word);this.level++;if(this.root===null){this.root=i}else{this.currentObject.push(i)}this.stack.push(this.currentObject);this.currentObject=i;this.state=J;return}if(rt.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)};ht.prototype.neutral=function(t){if(st.test(t)){this.word=t;this.state=Z;return}if(t==='"'){this.word="";this.state=K;return}if(nt.test(t)){this.word=t;this.state=$;return}if(rt.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)};ht.prototype.output=function(){while(this.place<this.text.length){this.readCharicter()}if(this.state===tt){return this.root}throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function at(t){var i=new ht(t);return i.output()}function ot(t,i,s){if(Array.isArray(i)){s.unshift(i);i=null}var e=i?{}:t;var r=s.reduce((function(t,i){ft(i,t);return t}),e);if(i){t[i]=r}}function ft(t,i){if(!Array.isArray(t)){i[t]=true;return}var s=t.shift();if(s==="PARAMETER"){s=t.shift()}if(t.length===1){if(Array.isArray(t[0])){i[s]={};ft(t[0],i[s]);return}i[s]=t[0];return}if(!t.length){i[s]=true;return}if(s==="TOWGS84"){i[s]=t;return}if(s==="AXIS"){if(!(s in i)){i[s]=[]}i[s].push(t);return}if(!Array.isArray(s)){i[s]={}}var e;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[s]={name:t[0].toLowerCase(),convert:t[1]};if(t.length===3){ft(t[2],i[s])}return;case"SPHEROID":case"ELLIPSOID":i[s]={name:t[0],a:t[1],rf:t[2]};if(t.length===4){ft(t[3],i[s])}return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]];ot(i,s,t);return;default:e=-1;while(++e<t.length){if(!Array.isArray(t[e])){return ft(t,i[s])}}return ot(i,s,t)}}var ut=.017453292519943295;function lt(t,i){var s=i[0];var e=i[1];if(!(s in t)&&e in t){t[s]=t[e];if(i.length===3){t[s]=i[2](t[s])}}}function vt(t){return t*ut}function ct(t){if(t.type==="GEOGCS"){t.projName="longlat"}else if(t.type==="LOCAL_CS"){t.projName="identity";t.local=true}else{if(typeof t.PROJECTION==="object"){t.projName=Object.keys(t.PROJECTION)[0]}else{t.projName=t.PROJECTION}}if(t.AXIS){var i="";for(var s=0,e=t.AXIS.length;s<e;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];if(r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"){i+="n"}else if(r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"){i+="s"}else if(r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"){i+="e"}else if(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west"){i+="w"}}if(i.length===2){i+="u"}if(i.length===3){t.axis=i}}if(t.UNIT){t.units=t.UNIT.name.toLowerCase();if(t.units==="metre"){t.units="meter"}if(t.UNIT.convert){if(t.type==="GEOGCS"){if(t.DATUM&&t.DATUM.SPHEROID){t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a}}else{t.to_meter=t.UNIT.convert}}}var n=t.GEOGCS;if(t.type==="GEOGCS"){n=t}if(n){if(n.DATUM){t.datumCode=n.DATUM.name.toLowerCase()}else{t.datumCode=n.name.toLowerCase()}if(t.datumCode.slice(0,2)==="d_"){t.datumCode=t.datumCode.slice(2)}if(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949"){t.datumCode="nzgd49"}if(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984"){if(t.PROJECTION==="Mercator_Auxiliary_Sphere"){t.sphere=true}t.datumCode="wgs84"}if(t.datumCode.slice(-6)==="_ferro"){t.datumCode=t.datumCode.slice(0,-6)}if(t.datumCode.slice(-8)==="_jakarta"){t.datumCode=t.datumCode.slice(0,-8)}if(~t.datumCode.indexOf("belge")){t.datumCode="rnb72"}if(n.DATUM&&n.DATUM.SPHEROID){t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk");if(t.ellps.toLowerCase().slice(0,13)==="international"){t.ellps="intl"}t.a=n.DATUM.SPHEROID.a;t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)}if(n.DATUM&&n.DATUM.TOWGS84){t.datum_params=n.DATUM.TOWGS84}if(~t.datumCode.indexOf("osgb_1936")){t.datumCode="osgb36"}if(~t.datumCode.indexOf("osni_1952")){t.datumCode="osni52"}if(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965")){t.datumCode="ire65"}if(t.datumCode==="ch1903+"){t.datumCode="ch1903"}if(~t.datumCode.indexOf("israel")){t.datumCode="isr93"}}if(t.b&&!isFinite(t.b)){t.b=t.a}function h(i){var s=t.to_meter||1;return i*s}var a=function(i){return lt(t,i)};var o=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",vt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",vt],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",vt],["lat0","latitude_of_origin",vt],["lat0","standard_parallel_1",vt],["lat1","standard_parallel_1",vt],["lat2","standard_parallel_2",vt],["azimuth","Azimuth"],["alpha","azimuth",vt],["srsCode","name"]];o.forEach(a);if(!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")){t.long0=t.longc}if(!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")){t.lat0=vt(t.lat1>0?90:-90);t.lat_ts=t.lat1}else if(!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"){t.lat_ts=t.lat0;t.lat0=vt(t.lat0>0?90:-90)}}function dt(t){var i=at(t);var s=i.shift();var e=i.shift();i.unshift(["name",e]);i.unshift(["type",s]);var r={};ft(i,r);ct(r);return r}function mt(t){var i=this;if(arguments.length===2){var s=arguments[1];if(typeof s==="string"){if(s.charAt(0)==="+"){mt[t]=H(arguments[1])}else{mt[t]=dt(arguments[1])}}else{mt[t]=s}}else if(arguments.length===1){if(Array.isArray(t)){return t.map((function(t){if(Array.isArray(t)){mt.apply(i,t)}else{mt(t)}}))}else if(typeof t==="string"){if(t in mt){return mt[t]}}else if("EPSG"in t){mt["EPSG:"+t.EPSG]=t}else if("ESRI"in t){mt["ESRI:"+t.ESRI]=t}else if("IAU2000"in t){mt["IAU2000:"+t.IAU2000]=t}else{console.log(t)}return}}y(mt);function pt(t){return typeof t==="string"}function zt(t){return t in mt}var Mt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _t(t){return Mt.some((function(i){return t.indexOf(i)>-1}))}var gt=["3857","900913","3785","102113"];function bt(t){var i=B(t,"authority");if(!i){return}var s=B(i,"epsg");return s&>.indexOf(s)>-1}function xt(t){var i=B(t,"extension");if(!i){return}return B(i,"proj4")}function wt(t){return t[0]==="+"}function yt(t){if(pt(t)){if(zt(t)){return mt[t]}if(_t(t)){var i=dt(t);if(bt(i)){return mt["EPSG:3857"]}var s=xt(i);if(s){return H(s)}return i}if(wt(t)){return H(t)}}else{return t}}function kt(t,i){t=t||{};var s,e;if(!i){return t}for(e in i){s=i[e];if(s!==undefined){t[e]=s}}return t}function Et(t,i,s){var e=t*i;return s/Math.sqrt(1-e*e)}function Nt(t){return t<0?-1:1}function Ct(t){return Math.abs(t)<=U?t:t-Nt(t)*V}function It(t,i,s){var e=t*s;var r=.5*t;e=Math.pow((1-e)/(1+e),r);return Math.tan(.5*(R-i))/e}function St(t,i){var s=.5*t;var e,r;var n=R-2*Math.atan(i);for(var h=0;h<=15;h++){e=t*Math.sin(n);r=R-2*Math.atan(i*Math.pow((1-e)/(1+e),s))-n;n+=r;if(Math.abs(r)<=1e-10){return n}}return-9999}function Ot(){var t=this.b/this.a;this.es=1-t*t;if(!("x0"in this)){this.x0=0}if(!("y0"in this)){this.y0=0}this.e=Math.sqrt(this.es);if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}else{if(!this.k0){if(this.k){this.k0=this.k}else{this.k0=1}}}}function Tt(t){var i=t.x;var s=t.y;if(s*G>90&&s*G<-90&&i*G>180&&i*G<-180){return null}var e,r;if(Math.abs(Math.abs(s)-R)<=F){return null}else{if(this.sphere){e=this.x0+this.a*this.k0*Ct(i-this.long0);r=this.y0+this.a*this.k0*Math.log(Math.tan(j+.5*s))}else{var n=Math.sin(s);var h=It(this.e,s,n);e=this.x0+this.a*this.k0*Ct(i-this.long0);r=this.y0-this.a*this.k0*Math.log(h)}t.x=e;t.y=r;return t}}function At(t){var i=t.x-this.x0;var s=t.y-this.y0;var e,r;if(this.sphere){r=R-2*Math.atan(Math.exp(-s/(this.a*this.k0)))}else{var n=Math.exp(-s/(this.a*this.k0));r=St(this.e,n);if(r===-9999){return null}}e=Ct(this.long0+i/(this.a*this.k0));t.x=e;t.y=r;return t}var Rt=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Pt={init:Ot,forward:Tt,inverse:At,names:Rt};function Lt(){}function Dt(t){return t}var Ft=["longlat","identity"];const Wt={init:Lt,forward:Dt,inverse:Dt,names:Ft};var Gt=[Pt,Wt];var jt={};var Vt=[];function Ut(t,i){var s=Vt.length;if(!t.names){console.log(i);return true}Vt[s]=t;t.names.forEach((function(t){jt[t.toLowerCase()]=s}));return this}function qt(t){if(!t){return false}var i=t.toLowerCase();if(typeof jt[i]!=="undefined"&&Vt[jt[i]]){return Vt[jt[i]]}}function Xt(){Gt.forEach(Ut)}const Yt={start:Xt,add:Ut,get:qt};var Bt={};Bt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Bt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Bt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Bt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Bt.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"};Bt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Bt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Bt.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"};Bt.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Bt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Bt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Bt.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"};Bt.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Bt.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"};Bt.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."};Bt.clrk80ign={a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Bt.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"};Bt.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Bt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Bt.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"};Bt.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"};Bt.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"};Bt.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"};Bt.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"};Bt.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Bt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Bt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Bt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Bt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Bt.hough={a:6378270,rf:297,ellipseName:"Hough"};Bt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Bt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Bt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Bt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Bt.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"};Bt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Bt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Bt.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"};Bt.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"};Bt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Bt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Bt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Ht=Bt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Bt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Jt(t,i,s,e){var r=t*t;var n=i*i;var h=(r-n)/r;var a=0;if(e){t*=1-h*(P+h*(L+h*D));r=t*t;h=0}else{a=Math.sqrt(h)}var o=(r-n)/n;return{es:h,e:a,ep2:o}}function Zt(t,i,s,e,r){if(!t){var n=B(Bt,e);if(!n){n=Ht}t=n.a;i=n.b;s=n.rf}if(s&&!i){i=(1-1/s)*t}if(s===0||Math.abs(t-i)<F){r=true;i=t}return{a:t,b:i,rf:s,sphere:r}}var $t={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};for(var Kt in $t){var Qt=$t[Kt];$t[Qt.datumName]=Qt}function ti(t,i,s,e,r,n,h){var a={};if(t===undefined||t==="none"){a.datum_type=I}else{a.datum_type=C}if(i){a.datum_params=i.map(parseFloat);if(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0){a.datum_type=k}if(a.datum_params.length>3){if(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0){a.datum_type=E;a.datum_params[3]*=A;a.datum_params[4]*=A;a.datum_params[5]*=A;a.datum_params[6]=a.datum_params[6]/1e6+1}}}if(h){a.datum_type=N;a.grids=h}a.a=s;a.b=e;a.es=r;a.ep2=n;return a}var ii={};function si(t,i){var s=new DataView(i);var e=hi(s);var r=ai(s,e);var n=fi(s,r,e);var h={header:r,subgrids:n};ii[t]=h;return h}function ei(t){if(t===undefined){return null}var i=t.split(",");return i.map(ri)}function ri(t){if(t.length===0){return null}var i=t[0]==="@";if(i){t=t.slice(1)}if(t==="null"){return{name:"null",mandatory:!i,grid:null,isNull:true}}return{name:t,mandatory:!i,grid:ii[t]||null,isNull:false}}function ni(t){return t/3600*Math.PI/180}function hi(t){var i=t.getInt32(8,false);if(i===11){return false}i=t.getInt32(8,true);if(i!==11){console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian")}return true}function ai(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:oi(t,56,56+8).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}function oi(t,i,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,s)))}function fi(t,i,s){var e=176;var r=[];for(var n=0;n<i.nSubgrids;n++){var h=li(t,e,s);var a=vi(t,e,h,s);var o=Math.round(1+(h.upperLongitude-h.lowerLongitude)/h.longitudeInterval);var f=Math.round(1+(h.upperLatitude-h.lowerLatitude)/h.latitudeInterval);r.push({ll:[ni(h.lowerLongitude),ni(h.lowerLatitude)],del:[ni(h.longitudeInterval),ni(h.latitudeInterval)],lim:[o,f],count:h.gridNodeCount,cvs:ui(a)});e+=176+h.gridNodeCount*16}return r}function ui(t){return t.map((function(t){return[ni(t.longitudeShift),ni(t.latitudeShift)]}))}function li(t,i,s){return{name:oi(t,i+8,i+16).trim(),parent:oi(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,s),upperLatitude:t.getFloat64(i+88,s),lowerLongitude:t.getFloat64(i+104,s),upperLongitude:t.getFloat64(i+120,s),latitudeInterval:t.getFloat64(i+136,s),longitudeInterval:t.getFloat64(i+152,s),gridNodeCount:t.getInt32(i+168,s)}}function vi(t,i,s,e){var r=i+176;var n=16;var h=[];for(var a=0;a<s.gridNodeCount;a++){var o={latitudeShift:t.getFloat32(r+a*n,e),longitudeShift:t.getFloat32(r+a*n+4,e),latitudeAccuracy:t.getFloat32(r+a*n+8,e),longitudeAccuracy:t.getFloat32(r+a*n+12,e)};h.push(o)}return h}function ci(t,i){if(!(this instanceof ci)){return new ci(t)}i=i||function(t){if(t){throw t}};var s=yt(t);if(typeof s!=="object"){i("Could not parse to valid json: "+t);return}var e=ci.projections.get(s.projName);if(!e){i("Could not get projection name from: "+t);return}if(s.datumCode&&s.datumCode!=="none"){var r=B($t,s.datumCode);if(r){s.datum_params=s.datum_params||(r.towgs84?r.towgs84.split(","):null);s.ellps=r.ellipse;s.datumName=r.datumName?r.datumName:s.datumCode}}s.k0=s.k0||1;s.axis=s.axis||"enu";s.ellps=s.ellps||"wgs84";s.lat1=s.lat1||s.lat0;var n=Zt(s.a,s.b,s.rf,s.ellps,s.sphere);var h=Jt(n.a,n.b,n.rf,s.R_A);var a=ei(s.nadgrids);var o=s.datum||ti(s.datumCode,s.datum_params,n.a,n.b,h.es,h.ep2,a);kt(this,s);kt(this,e);this.a=n.a;this.b=n.b;this.rf=n.rf;this.sphere=n.sphere;this.es=h.es;this.e=h.e;this.ep2=h.ep2;this.datum=o;this.init();i(null,this)}ci.projections=Yt;ci.projections.start();function di(t,i){if(t.datum_type!==i.datum_type){return false}else if(t.a!==i.a||Math.abs(t.es-i.es)>5e-11){return false}else if(t.datum_type===k){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]}else if(t.datum_type===E){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]}else{return true}}function mi(t,i,s){var e=t.x;var r=t.y;var n=t.z?t.z:0;var h;var a;var o;var f;if(r<-R&&r>-1.001*R){r=-R}else if(r>R&&r<1.001*R){r=R}else if(r<-R){return{x:-Infinity,y:-Infinity,z:t.z}}else if(r>R){return{x:Infinity,y:Infinity,z:t.z}}if(e>Math.PI){e-=2*Math.PI}a=Math.sin(r);f=Math.cos(r);o=a*a;h=s/Math.sqrt(1-i*o);return{x:(h+n)*f*Math.cos(e),y:(h+n)*f*Math.sin(e),z:(h*(1-i)+n)*a}}function pi(t,i,s,e){var r=1e-12;var n=r*r;var h=30;var a;var o;var f;var u;var l;var v;var c;var d;var m;var p;var z;var M;var _;var g=t.x;var b=t.y;var x=t.z?t.z:0;var w;var y;var k;a=Math.sqrt(g*g+b*b);o=Math.sqrt(g*g+b*b+x*x);if(a/s<r){w=0;if(o/s<r){y=R;k=-e;return{x:t.x,y:t.y,z:t.z}}}else{w=Math.atan2(b,g)}f=x/o;u=a/o;l=1/Math.sqrt(1-i*(2-i)*u*u);d=u*(1-i)*l;m=f*l;_=0;do{_++;c=s/Math.sqrt(1-i*m*m);k=a*d+x*m-c*(1-i*m*m);v=i*c/(c+k);l=1/Math.sqrt(1-v*(2-v)*u*u);p=u*(1-v)*l;z=f*l;M=z*d-p*m;d=p;m=z}while(M*M>n&&_<h);y=Math.atan(z/Math.abs(p));return{x:w,y,z:k}}function zi(t,i,s){if(i===k){return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]}}else if(i===E){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];return{x:f*(t.x-o*t.y+a*t.z)+e,y:f*(o*t.x+t.y-h*t.z)+r,z:f*(-a*t.x+h*t.y+t.z)+n}}}function Mi(t,i,s){if(i===k){return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]}}else if(i===E){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];var u=(t.x-e)/f;var l=(t.y-r)/f;var v=(t.z-n)/f;return{x:u+o*l-a*v,y:-o*u+l+h*v,z:a*u-h*l+v}}}function _i(t){return t===k||t===E}function gi(t,i,s){if(di(t,i)){return s}if(t.datum_type===I||i.datum_type===I){return s}var e=t.a;var r=t.es;if(t.datum_type===N){var n=bi(t,false,s);if(n!==0){return undefined}e=S;r=T}var h=i.a;var a=i.b;var o=i.es;if(i.datum_type===N){h=S;a=O;o=T}if(r===o&&e===h&&!_i(t.datum_type)&&!_i(i.datum_type)){return s}s=mi(s,r,e);if(_i(t.datum_type)){s=zi(s,t.datum_type,t.datum_params)}if(_i(i.datum_type)){s=Mi(s,i.datum_type,i.datum_params)}s=pi(s,o,h,a);if(i.datum_type===N){var f=bi(i,true,s);if(f!==0){return undefined}}return s}function bi(t,i,s){if(t.grids===null||t.grids.length===0){console.log("Grid shift grids not found");return-1}var e={x:-s.x,y:s.y};var r={x:Number.NaN,y:Number.NaN};var n=[];t:for(var h=0;h<t.grids.length;h++){var a=t.grids[h];n.push(a.name);if(a.isNull){r=e;break}if(a.grid===null){if(a.mandatory){console.log("Unable to find mandatory grid '"+a.name+"'");return-1}continue}var o=a.grid.subgrids;for(var f=0,u=o.length;f<u;f++){var l=o[f];var v=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4;var c=l.ll[0]-v;var d=l.ll[1]-v;var m=l.ll[0]+(l.lim[0]-1)*l.del[0]+v;var p=l.ll[1]+(l.lim[1]-1)*l.del[1]+v;if(d>e.y||c>e.x||p<e.y||m<e.x){continue}r=xi(e,i,l);if(!isNaN(r.x)){break t}}}if(isNaN(r.x)){console.log("Failed to find a grid shift table for location '"+-e.x*G+" "+e.y*G+" tried: '"+n+"'");return-1}s.x=-r.x;s.y=r.y;return 0}function xi(t,i,s){var e={x:Number.NaN,y:Number.NaN};if(isNaN(t.x)){return e}var r={x:t.x,y:t.y};r.x-=s.ll[0];r.y-=s.ll[1];r.x=Ct(r.x-Math.PI)+Math.PI;var n=wi(r,s);if(i){if(isNaN(n.x)){return e}n.x=r.x-n.x;n.y=r.y-n.y;var h=9,a=1e-12;var o,f;do{f=wi(n,s);if(isNaN(f.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:r.x-(f.x+n.x),y:r.y-(f.y+n.y)};n.x+=o.x;n.y+=o.y}while(h--&&Math.abs(o.x)>a&&Math.abs(o.y)>a);if(h<0){console.log("Inverse grid shift iterator failed to converge.");return e}e.x=Ct(n.x+s.ll[0]);e.y=n.y+s.ll[1]}else{if(!isNaN(n.x)){e.x=t.x+n.x;e.y=t.y+n.y}}return e}function wi(t,i){var s={x:t.x/i.del[0],y:t.y/i.del[1]};var e={x:Math.floor(s.x),y:Math.floor(s.y)};var r={x:s.x-1*e.x,y:s.y-1*e.y};var n={x:Number.NaN,y:Number.NaN};var h;if(e.x<0||e.x>=i.lim[0]){return n}if(e.y<0||e.y>=i.lim[1]){return n}h=e.y*i.lim[0]+e.x;var a={x:i.cvs[h][0],y:i.cvs[h][1]};h++;var o={x:i.cvs[h][0],y:i.cvs[h][1]};h+=i.lim[0];var f={x:i.cvs[h][0],y:i.cvs[h][1]};h--;var u={x:i.cvs[h][0],y:i.cvs[h][1]};var l=r.x*r.y,v=r.x*(1-r.y),c=(1-r.x)*(1-r.y),d=(1-r.x)*r.y;n.x=c*a.x+v*o.x+d*u.x+l*f.x;n.y=c*a.y+v*o.y+d*u.y+l*f.y;return n}function yi(t,i,s){var e=s.x,r=s.y,n=s.z||0;var h,a,o;var f={};for(o=0;o<3;o++){if(i&&o===2&&s.z===undefined){continue}if(o===0){h=e;if("ew".indexOf(t.axis[o])!==-1){a="x"}else{a="y"}}else if(o===1){h=r;if("ns".indexOf(t.axis[o])!==-1){a="y"}else{a="x"}}else{h=n;a="z"}switch(t.axis[o]){case"e":f[a]=h;break;case"w":f[a]=-h;break;case"n":f[a]=h;break;case"s":f[a]=-h;break;case"u":if(s[a]!==undefined){f.z=h}break;case"d":if(s[a]!==undefined){f.z=-h}break;default:return null}}return f}function ki(t){var i={x:t[0],y:t[1]};if(t.length>2){i.z=t[2]}if(t.length>3){i.m=t[3]}return i}function Ei(t){Ni(t.x);Ni(t.y)}function Ni(t){if(typeof Number.isFinite==="function"){if(Number.isFinite(t)){return}throw new TypeError("coordinates must be finite numbers")}if(typeof t!=="number"||t!==t||!isFinite(t)){throw new TypeError("coordinates must be finite numbers")}}function Ci(t,i){return(t.datum.datum_type===k||t.datum.datum_type===E||t.datum.datum_type===N)&&i.datumCode!=="WGS84"||(i.datum.datum_type===k||i.datum.datum_type===E||i.datum.datum_type===N)&&t.datumCode!=="WGS84"}function Ii(t,i,s,e){var r;if(Array.isArray(s)){s=ki(s)}else{s={x:s.x,y:s.y,z:s.z,m:s.m}}var n=s.z!==undefined;Ei(s);if(t.datum&&i.datum&&Ci(t,i)){r=new ci("WGS84");s=Ii(t,r,s,e);t=r}if(e&&t.axis!=="enu"){s=yi(t,false,s)}if(t.projName==="longlat"){s={x:s.x*W,y:s.y*W,z:s.z||0}}else{if(t.to_meter){s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}}s=t.inverse(s);if(!s){return}}if(t.from_greenwich){s.x+=t.from_greenwich}s=gi(t.datum,i.datum,s);if(!s){return}if(i.from_greenwich){s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}}if(i.projName==="longlat"){s={x:s.x*G,y:s.y*G,z:s.z||0}}else{s=i.forward(s);if(i.to_meter){s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0}}}if(e&&i.axis!=="enu"){return yi(i,true,s)}if(s&&!n){delete s.z}return s}var Si=ci("WGS84");function Oi(t,i,s,e){var r,n,h;if(Array.isArray(s)){r=Ii(t,i,s,e)||{x:NaN,y:NaN};if(s.length>2){if(typeof t.name!=="undefined"&&t.name==="geocent"||typeof i.name!=="undefined"&&i.name==="geocent"){if(typeof r.z==="number"){return[r.x,r.y,r.z].concat(s.slice(3))}else{return[r.x,r.y,s[2]].concat(s.slice(3))}}else{return[r.x,r.y].concat(s.slice(2))}}else{return[r.x,r.y]}}else{n=Ii(t,i,s,e);h=Object.keys(s);if(h.length===2){return n}h.forEach((function(e){if(typeof t.name!=="undefined"&&t.name==="geocent"||typeof i.name!=="undefined"&&i.name==="geocent"){if(e==="x"||e==="y"||e==="z"){return}}else{if(e==="x"||e==="y"){return}}n[e]=s[e]}));return n}}function Ti(t){if(t instanceof ci){return t}if(t.oProj){return t.oProj}return ci(t)}function Ai(t,i,s){t=Ti(t);var e=false;var r;if(typeof i==="undefined"){i=t;t=Si;e=true}else if(typeof i.x!=="undefined"||Array.isArray(i)){s=i;i=t;t=Si;e=true}i=Ti(i);if(s){return Oi(t,i,s)}else{r={forward:function(s,e){return Oi(t,i,s,e)},inverse:function(s,e){return Oi(i,t,s,e)}};if(e){r.oProj=i}return r}}var Ri=6;var Pi="AJSAJS";var Li="AFAFAF";var Di=65;var Fi=73;var Wi=79;var Gi=86;var ji=90;const Vi={forward:Ui,inverse:qi,toPoint:Xi};function Ui(t,i){i=i||5;return $i(Hi({lat:t[1],lon:t[0]}),i)}function qi(t){var i=Ji(is(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat,i.lon,i.lat]}return[i.left,i.bottom,i.right,i.top]}function Xi(t){var i=Ji(is(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat]}return[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Yi(t){return t*(Math.PI/180)}function Bi(t){return 180*(t/Math.PI)}function Hi(t){var i=t.lat;var s=t.lon;var e=6378137;var r=.00669438;var n=.9996;var h;var a;var o,f,u,l,v;var c=Yi(i);var d=Yi(s);var m;var p;p=Math.floor((s+180)/6)+1;if(s===180){p=60}if(i>=56&&i<64&&s>=3&&s<12){p=32}if(i>=72&&i<84){if(s>=0&&s<9){p=31}else if(s>=9&&s<21){p=33}else if(s>=21&&s<33){p=35}else if(s>=33&&s<42){p=37}}h=(p-1)*6-180+3;m=Yi(h);a=r/(1-r);o=e/Math.sqrt(1-r*Math.sin(c)*Math.sin(c));f=Math.tan(c)*Math.tan(c);u=a*Math.cos(c)*Math.cos(c);l=Math.cos(c)*(d-m);v=e*((1-r/4-3*r*r/64-5*r*r*r/256)*c-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*c)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*c)-35*r*r*r/3072*Math.sin(6*c));var z=n*o*(l+(1-f+u)*l*l*l/6+(5-18*f+f*f+72*u-58*a)*l*l*l*l*l/120)+5e5;var M=n*(v+o*Math.tan(c)*(l*l/2+(5-f+9*u+4*u*u)*l*l*l*l/24+(61-58*f+f*f+600*u-330*a)*l*l*l*l*l*l/720));if(i<0){M+=1e7}return{northing:Math.round(M),easting:Math.round(z),zoneNumber:p,zoneLetter:Zi(i)}}function Ji(t){var i=t.northing;var s=t.easting;var e=t.zoneLetter;var r=t.zoneNumber;if(r<0||r>60){return null}var n=.9996;var h=6378137;var a=.00669438;var o;var f=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a));var u,l,v,c,d,m;var p;var z,M;var _=s-5e5;var g=i;if(e<"N"){g-=1e7}p=(r-1)*6-180+3;o=a/(1-a);m=g/n;z=m/(h*(1-a/4-3*a*a/64-5*a*a*a/256));M=z+(3*f/2-27*f*f*f/32)*Math.sin(2*z)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*z)+151*f*f*f/96*Math.sin(6*z);u=h/Math.sqrt(1-a*Math.sin(M)*Math.sin(M));l=Math.tan(M)*Math.tan(M);v=o*Math.cos(M)*Math.cos(M);c=h*(1-a)/Math.pow(1-a*Math.sin(M)*Math.sin(M),1.5);d=_/(u*n);var b=M-u*Math.tan(M)/c*(d*d/2-(5+3*l+10*v-4*v*v-9*o)*d*d*d*d/24+(61+90*l+298*v+45*l*l-252*o-3*v*v)*d*d*d*d*d*d/720);b=Bi(b);var x=(d-(1+2*l+v)*d*d*d/6+(5-2*v+28*l-3*v*v+8*o+24*l*l)*d*d*d*d*d/120)/Math.cos(M);x=p+Bi(x);var w;if(t.accuracy){var y=Ji({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:y.lat,right:y.lon,bottom:b,left:x}}else{w={lat:b,lon:x}}return w}function Zi(t){var i="Z";if(84>=t&&t>=72){i="X"}else if(72>t&&t>=64){i="W"}else if(64>t&&t>=56){i="V"}else if(56>t&&t>=48){i="U"}else if(48>t&&t>=40){i="T"}else if(40>t&&t>=32){i="S"}else if(32>t&&t>=24){i="R"}else if(24>t&&t>=16){i="Q"}else if(16>t&&t>=8){i="P"}else if(8>t&&t>=0){i="N"}else if(0>t&&t>=-8){i="M"}else if(-8>t&&t>=-16){i="L"}else if(-16>t&&t>=-24){i="K"}else if(-24>t&&t>=-32){i="J"}else if(-32>t&&t>=-40){i="H"}else if(-40>t&&t>=-48){i="G"}else if(-48>t&&t>=-56){i="F"}else if(-56>t&&t>=-64){i="E"}else if(-64>t&&t>=-72){i="D"}else if(-72>t&&t>=-80){i="C"}return i}function $i(t,i){var s="00000"+t.easting,e="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Ki(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,i)+e.substr(e.length-5,i)}function Ki(t,i,s){var e=Qi(s);var r=Math.floor(t/1e5);var n=Math.floor(i/1e5)%20;return ts(r,n,e)}function Qi(t){var i=t%Ri;if(i===0){i=Ri}return i}function ts(t,i,s){var e=s-1;var r=Pi.charCodeAt(e);var n=Li.charCodeAt(e);var h=r+t-1;var a=n+i;var o=false;if(h>ji){h=h-ji+Di-1;o=true}if(h===Fi||r<Fi&&h>Fi||(h>Fi||r<Fi)&&o){h++}if(h===Wi||r<Wi&&h>Wi||(h>Wi||r<Wi)&&o){h++;if(h===Fi){h++}}if(h>ji){h=h-ji+Di-1}if(a>Gi){a=a-Gi+Di-1;o=true}else{o=false}if(a===Fi||n<Fi&&a>Fi||(a>Fi||n<Fi)&&o){a++}if(a===Wi||n<Wi&&a>Wi||(a>Wi||n<Wi)&&o){a++;if(a===Fi){a++}}if(a>Gi){a=a-Gi+Di-1}var f=String.fromCharCode(h)+String.fromCharCode(a);return f}function is(t){if(t&&t.length===0){throw"MGRSPoint coverting from nothing"}var i=t.length;var s=null;var e="";var r;var n=0;while(!/[A-Z]/.test(r=t.charAt(n))){if(n>=2){throw"MGRSPoint bad conversion from: "+t}e+=r;n++}var h=parseInt(e,10);if(n===0||n+3>i){throw"MGRSPoint bad conversion from: "+t}var a=t.charAt(n++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O"){throw"MGRSPoint zone letter "+a+" not handled: "+t}s=t.substring(n,n+=2);var o=Qi(h);var f=ss(s.charAt(0),o);var u=es(s.charAt(1),o);while(u<rs(a)){u+=2e6}var l=i-n;if(l%2!==0){throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t}var v=l/2;var c=0;var d=0;var m,p,z,M,_;if(v>0){m=1e5/Math.pow(10,v);p=t.substring(n,n+v);c=parseFloat(p)*m;z=t.substring(n+v);d=parseFloat(z)*m}M=c+f;_=d+u;return{easting:M,northing:_,zoneLetter:a,zoneNumber:h,accuracy:m}}function ss(t,i){var s=Pi.charCodeAt(i-1);var e=1e5;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===Fi){s++}if(s===Wi){s++}if(s>ji){if(r){throw"Bad character: "+t}s=Di;r=true}e+=1e5}return e}function es(t,i){if(t>"V"){throw"MGRSPoint given invalid Northing "+t}var s=Li.charCodeAt(i-1);var e=0;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===Fi){s++}if(s===Wi){s++}if(s>Gi){if(r){throw"Bad character: "+t}s=Di;r=true}e+=1e5}return e}function rs(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0){return i}else{throw"Invalid zone letter: "+t}}function ns(t,i,s){if(!(this instanceof ns)){return new ns(t,i,s)}if(Array.isArray(t)){this.x=t[0];this.y=t[1];this.z=t[2]||0}else if(typeof t==="object"){this.x=t.x;this.y=t.y;this.z=t.z||0}else if(typeof t==="string"&&typeof i==="undefined"){var e=t.split(",");this.x=parseFloat(e[0],10);this.y=parseFloat(e[1],10);this.z=parseFloat(e[2],10)||0}else{this.x=t;this.y=i;this.z=s||0}console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}ns.fromMGRS=function(t){return new ns(Xi(t))};ns.prototype.toMGRS=function(t){return Ui([this.x,this.y],t)};var hs=1;var as=.25;var os=.046875;var fs=.01953125;var us=.01068115234375;var ls=.75;var vs=.46875;var cs=.013020833333333334;var ds=.007120768229166667;var ms=.3645833333333333;var ps=.005696614583333333;var zs=.3076171875;function Ms(t){var i=[];i[0]=hs-t*(as+t*(os+t*(fs+t*us)));i[1]=t*(ls-t*(os+t*(fs+t*us)));var s=t*t;i[2]=s*(vs-t*(cs+t*ds));s*=t;i[3]=s*(ms-t*ps);i[4]=s*t*zs;return i}function _s(t,i,s,e){s*=i;i*=i;return e[0]*t-s*(e[1]+i*(e[2]+i*(e[3]+i*e[4])))}var gs=20;function bs(t,i,s){var e=1/(1-i);var r=t;for(var n=gs;n;--n){var h=Math.sin(r);var a=1-i*h*h;a=(_s(r,h,Math.cos(r),s)-t)*(a*Math.sqrt(a))*e;r-=a;if(Math.abs(a)<F){return r}}return r}function xs(){this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;if(this.es){this.en=Ms(this.es);this.ml0=_s(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en)}}function ws(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r;var n,h;var a=Math.sin(s);var o=Math.cos(s);if(!this.es){var f=o*Math.sin(e);if(Math.abs(Math.abs(f)-1)<F){return 93}else{n=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0;h=o*Math.cos(e)/Math.sqrt(1-Math.pow(f,2));f=Math.abs(h);if(f>=1){if(f-1>F){return 93}else{h=0}}else{h=Math.acos(h)}if(s<0){h=-h}h=this.a*this.k0*(h-this.lat0)+this.y0}}else{var u=o*e;var l=Math.pow(u,2);var v=this.ep2*Math.pow(o,2);var c=Math.pow(v,2);var d=Math.abs(o)>F?Math.tan(s):0;var m=Math.pow(d,2);var p=Math.pow(m,2);r=1-this.es*Math.pow(a,2);u=u/Math.sqrt(r);var z=_s(s,a,o,this.en);n=this.a*(this.k0*u*(1+l/6*(1-m+v+l/20*(5-18*m+p+14*v-58*m*v+l/42*(61+179*p-p*m-479*m)))))+this.x0;h=this.a*(this.k0*(z-this.ml0+a*e*u/2*(1+l/12*(5-m+9*v+4*c+l/30*(61+p-58*m+270*v-330*m*v+l/56*(1385+543*p-p*m-3111*m))))))+this.y0}t.x=n;t.y=h;return t}function ys(t){var i,s;var e,r;var n=(t.x-this.x0)*(1/this.a);var h=(t.y-this.y0)*(1/this.a);if(!this.es){var a=Math.exp(n/this.k0);var o=.5*(a-1/a);var f=this.lat0+h/this.k0;var u=Math.cos(f);i=Math.sqrt((1-Math.pow(u,2))/(1+Math.pow(o,2)));e=Math.asin(i);if(h<0){e=-e}if(o===0&&u===0){r=0}else{r=Ct(Math.atan2(o,u)+this.long0)}}else{i=this.ml0+h/this.k0;s=bs(i,this.es,this.en);if(Math.abs(s)<R){var l=Math.sin(s);var v=Math.cos(s);var c=Math.abs(v)>F?Math.tan(s):0;var d=this.ep2*Math.pow(v,2);var m=Math.pow(d,2);var p=Math.pow(c,2);var z=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var M=n*Math.sqrt(i)/this.k0;var _=Math.pow(M,2);i=i*c;e=s-i*_/(1-this.es)*.5*(1-_/12*(5+3*p-9*d*p+d-4*m-_/30*(61+90*p-252*d*p+45*z+46*d-_/56*(1385+3633*p+4095*z+1574*z*p))));r=Ct(this.long0+M*(1-_/6*(1+2*p+d-_/20*(5+28*p+24*z+8*d*p+6*d-_/42*(61+662*p+1320*z+720*z*p))))/v)}else{e=R*Nt(h);r=0}}t.x=r;t.y=e;return t}var ks=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Es={init:xs,forward:ws,inverse:ys,names:ks};function Ns(t){var i=Math.exp(t);i=(i-1/i)/2;return i}function Cs(t,i){t=Math.abs(t);i=Math.abs(i);var s=Math.max(t,i);var e=Math.min(t,i)/(s?s:1);return s*Math.sqrt(1+Math.pow(e,2))}function Is(t){var i=1+t;var s=i-1;return s===0?t:t*Math.log(i)/s}function Ss(t){var i=Math.abs(t);i=Is(i*(1+i/(Cs(1,i)+1)));return t<0?-i:i}function Os(t,i){var s=2*Math.cos(2*i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return i+h*Math.sin(2*i)}function Ts(t,i){var s=2*Math.cos(i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return Math.sin(i)*h}function As(t){var i=Math.exp(t);i=(i+1/i)/2;return i}function Rs(t,i,s){var e=Math.sin(i);var r=Math.cos(i);var n=Ns(s);var h=As(s);var a=2*r*h;var o=-2*e*n;var f=t.length-1;var u=t[f];var l=0;var v=0;var c=0;var d;var m;while(--f>=0){d=v;m=l;v=u;l=c;u=-d+a*v-o*l+t[f];c=-m+o*v+a*l}a=e*h;o=r*n;return[a*u-o*c,a*c+o*u]}function Ps(){if(!this.approx&&(isNaN(this.es)||this.es<=0)){throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.')}if(this.approx){Es.init.apply(this);this.forward=Es.forward;this.inverse=Es.inverse}this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;this.cgb=[];this.cbg=[];this.utg=[];this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es));var i=t/(2-t);var s=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675))))));this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725))))));s=s*i;this.cgb[1]=s*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945)))));this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945)))));s=s*i;this.cgb[2]=s*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835))));this.cbg[2]=s*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835))));s=s*i;this.cgb[3]=s*(4279/630+i*(-332/35+i*(-399572/14175)));this.cbg[3]=s*(1237/630+i*(-12/5+i*(-24832/14175)));s=s*i;this.cgb[4]=s*(4174/315+i*(-144838/6237));this.cbg[4]=s*(-734/315+i*(109598/31185));s=s*i;this.cgb[5]=s*(601676/22275);this.cbg[5]=s*(444337/155925);s=Math.pow(i,2);this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256)));this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800))))));this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800))))));this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720)))));this.gtu[1]=s*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360)))));s=s*i;this.utg[2]=s*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720))));this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440))));s=s*i;this.utg[3]=s*(-4397/161280+i*(11/504+i*(830251/7257600)));this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600)));s=s*i;this.utg[4]=s*(-4583/161280+i*(108847/3991680));this.gtu[4]=s*(34729/80640+i*(-3418889/1995840));s=s*i;this.utg[5]=s*(-20648693/638668800);this.gtu[5]=s*(212378941/319334400);var e=Os(this.cbg,this.lat0);this.Zb=-this.Qn*(e+Ts(this.gtu,2*e))}function Ls(t){var i=Ct(t.x-this.long0);var s=t.y;s=Os(this.cbg,s);var e=Math.sin(s);var r=Math.cos(s);var n=Math.sin(i);var h=Math.cos(i);s=Math.atan2(e,h*r);i=Math.atan2(n*r,Cs(e,r*h));i=Ss(Math.tan(i));var a=Rs(this.gtu,2*s,2*i);s=s+a[0];i=i+a[1];var o;var f;if(Math.abs(i)<=2.623395162778){o=this.a*(this.Qn*i)+this.x0;f=this.a*(this.Qn*s+this.Zb)+this.y0}else{o=Infinity;f=Infinity}t.x=o;t.y=f;return t}function Ds(t){var i=(t.x-this.x0)*(1/this.a);var s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn;i=i/this.Qn;var e;var r;if(Math.abs(i)<=2.623395162778){var n=Rs(this.utg,2*s,2*i);s=s+n[0];i=i+n[1];i=Math.atan(Ns(i));var h=Math.sin(s);var a=Math.cos(s);var o=Math.sin(i);var f=Math.cos(i);s=Math.atan2(h*f,Cs(o,f*a));i=Math.atan2(o,f*a);e=Ct(i+this.long0);r=Os(this.cgb,s)}else{e=Infinity;r=Infinity}t.x=e;t.y=r;return t}var Fs=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ws={init:Ps,forward:Ls,inverse:Ds,names:Fs};function Gs(t,i){if(t===undefined){t=Math.floor((Ct(i)+Math.PI)*30/Math.PI)+1;if(t<0){return 0}else if(t>60){return 60}}return t}var js="etmerc";function Vs(){var t=Gs(this.zone,this.long0);if(t===undefined){throw new Error("unknown utm zone")}this.lat0=0;this.long0=(6*Math.abs(t)-183)*W;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;Ws.init.apply(this);this.forward=Ws.forward;this.inverse=Ws.inverse}var Us=["Universal Transverse Mercator System","utm"];const qs={init:Vs,names:Us,dependsOn:js};function Xs(t,i){return Math.pow((1-t)/(1+t),i)}var Ys=20;function Bs(){var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);i*=i;this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t);this.C=Math.sqrt(1+this.es*i*i/(1-this.es));this.phic0=Math.asin(t/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+j)/(Math.pow(Math.tan(.5*this.lat0+j),this.C)*Xs(this.e*t,this.ratexp))}function Hs(t){var i=t.x;var s=t.y;t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+j),this.C)*Xs(this.e*Math.sin(s),this.ratexp))-R;t.x=this.C*i;return t}function Js(t){var i=1e-14;var s=t.x/this.C;var e=t.y;var r=Math.pow(Math.tan(.5*e+j)/this.K,1/this.C);for(var n=Ys;n>0;--n){e=2*Math.atan(r*Xs(this.e*Math.sin(t.y),-.5*this.e))-R;if(Math.abs(e-t.y)<i){break}t.y=e}if(!n){return null}t.x=s;t.y=e;return t}var Zs=["gauss"];const $s={init:Bs,forward:Hs,inverse:Js,names:Zs};function Ks(){$s.init.apply(this);if(!this.rc){return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}}function Qs(t){var i,s,e,r;t.x=Ct(t.x-this.long0);$s.forward.apply(this,[t]);i=Math.sin(t.y);s=Math.cos(t.y);e=Math.cos(t.x);r=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*e);t.x=r*s*Math.sin(t.x);t.y=r*(this.cosc0*i-this.sinc0*s*e);t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function te(t){var i,s,e,r,n;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(n=Cs(t.x,t.y)){var h=2*Math.atan2(n,this.R2);i=Math.sin(h);s=Math.cos(h);r=Math.asin(s*this.sinc0+t.y*i*this.cosc0/n);e=Math.atan2(t.x*i,n*this.cosc0*s-t.y*this.sinc0*i)}else{r=this.phic0;e=0}t.x=e;t.y=r;$s.inverse.apply(this,[t]);t.x=Ct(t.x+this.long0);return t}var ie=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const se={init:Ks,forward:Qs,inverse:te,names:ie};function ee(t,i,s){i*=s;return Math.tan(.5*(R+t))*Math.pow((1-i)/(1+i),.5*s)}function re(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);if(this.sphere){if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=F){this.k0=.5*(1+Nt(this.lat0)*Math.sin(this.lat_ts))}}else{if(Math.abs(this.coslat0)<=F){if(this.lat0>0){this.con=1}else{this.con=-1}}this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e));if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=F&&Math.abs(Math.cos(this.lat_ts))>F){this.k0=.5*this.cons*Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/It(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))}this.ms1=Et(this.e,this.sinlat0,this.coslat0);this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-R;this.cosX0=Math.cos(this.X0);this.sinX0=Math.sin(this.X0)}}function ne(t){var i=t.x;var s=t.y;var e=Math.sin(s);var r=Math.cos(s);var n,h,a,o,f,u;var l=Ct(i-this.long0);if(Math.abs(Math.abs(i-this.long0)-Math.PI)<=F&&Math.abs(s+this.lat0)<=F){t.x=NaN;t.y=NaN;return t}if(this.sphere){n=2*this.k0/(1+this.sinlat0*e+this.coslat0*r*Math.cos(l));t.x=this.a*n*r*Math.sin(l)+this.x0;t.y=this.a*n*(this.coslat0*e-this.sinlat0*r*Math.cos(l))+this.y0;return t}else{h=2*Math.atan(this.ssfn_(s,e,this.e))-R;o=Math.cos(h);a=Math.sin(h);if(Math.abs(this.coslat0)<=F){f=It(this.e,s*this.con,this.con*e);u=2*this.a*this.k0*f/this.cons;t.x=this.x0+u*Math.sin(i-this.long0);t.y=this.y0-this.con*u*Math.cos(i-this.long0);return t}else if(Math.abs(this.sinlat0)<F){n=2*this.a*this.k0/(1+o*Math.cos(l));t.y=n*a}else{n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*o*Math.cos(l)));t.y=n*(this.cosX0*a-this.sinX0*o*Math.cos(l))+this.y0}t.x=n*o*Math.sin(l)+this.x0}return t}function he(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n;var h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(h/(2*this.a*this.k0));i=this.long0;s=this.lat0;if(h<=F){t.x=i;t.y=s;return t}s=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/h);if(Math.abs(this.coslat0)<F){if(this.lat0>0){i=Ct(this.long0+Math.atan2(t.x,-1*t.y))}else{i=Ct(this.long0+Math.atan2(t.x,t.y))}}else{i=Ct(this.long0+Math.atan2(t.x*Math.sin(a),h*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a)))}t.x=i;t.y=s;return t}else{if(Math.abs(this.coslat0)<=F){if(h<=F){s=this.lat0;i=this.long0;t.x=i;t.y=s;return t}t.x*=this.con;t.y*=this.con;e=h*this.cons/(2*this.a*this.k0);s=this.con*St(this.e,e);i=this.con*Ct(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else{r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1));i=this.long0;if(h<=F){n=this.X0}else{n=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h);i=Ct(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))}s=-1*St(this.e,Math.tan(.5*(R+n)))}}t.x=i;t.y=s;return t}var ae=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const oe={init:re,forward:ne,inverse:he,names:ae,ssfn_:ee};function fe(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t);var s=this.a;var e=this.rf;var r=1/e;var n=2*r-Math.pow(r,2);var h=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2));this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4));this.b0=Math.asin(i/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2));var o=Math.log(Math.tan(Math.PI/4+t/2));var f=Math.log((1+h*i)/(1-h*i));this.K=a-this.alpha*o+this.alpha*h/2*f}function ue(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2));var s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y)));var e=-this.alpha*(i+s)+this.K;var r=2*(Math.atan(Math.exp(e))-Math.PI/4);var n=this.alpha*(t.x-this.lambda0);var h=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n)));var a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0;t.x=this.R*h+this.x0;return t}function le(t){var i=t.x-this.x0;var s=t.y-this.y0;var e=i/this.R;var r=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4);var n=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e));var h=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r)));var a=this.lambda0+h/this.alpha;var o=0;var f=n;var u=-1e3;var l=0;while(Math.abs(f-u)>1e-7){if(++l>20){return}o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2));u=f;f=2*Math.atan(Math.exp(o))-Math.PI/2}t.x=a;t.y=f;return t}var ve=["somerc"];const ce={init:fe,forward:ue,inverse:le,names:ve};var de=1e-7;function me(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"];var s=typeof t.PROJECTION==="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||i.indexOf(s)!==-1}function pe(){var t,i,s,e,r,n,h,a,o,f,u=0,l,v=0,c=0,d=0,m=0,p=0,z=0;this.no_off=me(this);this.no_rot="no_rot"in this;var M=false;if("alpha"in this){M=true}var _=false;if("rectified_grid_angle"in this){_=true}if(M){z=this.alpha}if(_){u=this.rectified_grid_angle*W}if(M||_){v=this.longc}else{c=this.long1;m=this.lat1;d=this.long2;p=this.lat2;if(Math.abs(m-p)<=de||(t=Math.abs(m))<=de||Math.abs(t-R)<=de||Math.abs(Math.abs(this.lat0)-R)<=de||Math.abs(Math.abs(p)-R)<=de){throw new Error}}var g=1-this.es;i=Math.sqrt(g);if(Math.abs(this.lat0)>F){a=Math.sin(this.lat0);s=Math.cos(this.lat0);t=1-this.es*a*a;this.B=s*s;this.B=Math.sqrt(1+this.es*this.B*this.B/g);this.A=this.B*this.k0*i/t;e=this.B*i/(s*Math.sqrt(t));r=e*e-1;if(r<=0){r=0}else{r=Math.sqrt(r);if(this.lat0<0){r=-r}}this.E=r+=e;this.E*=Math.pow(It(this.e,this.lat0,a),this.B)}else{this.B=1/i;this.A=this.k0;this.E=e=r=1}if(M||_){if(M){l=Math.asin(Math.sin(z)/e);if(!_){u=z}}else{l=u;z=Math.asin(e*Math.sin(l))}this.lam0=v-Math.asin(.5*(r-1/r)*Math.tan(l))/this.B}else{n=Math.pow(It(this.e,m,Math.sin(m)),this.B);h=Math.pow(It(this.e,p,Math.sin(p)),this.B);r=this.E/n;o=(h-n)/(h+n);f=this.E*this.E;f=(f-h*n)/(f+h*n);t=c-d;if(t<-Math.pi){d-=V}else if(t>Math.pi){d+=V}this.lam0=Ct(.5*(c+d)-Math.atan(f*Math.tan(.5*this.B*(c-d))/o)/this.B);l=Math.atan(2*Math.sin(this.B*Ct(c-this.lam0))/(r-1/r));u=z=Math.asin(e*Math.sin(l))}this.singam=Math.sin(l);this.cosgam=Math.cos(l);this.sinrot=Math.sin(u);this.cosrot=Math.cos(u);this.rB=1/this.B;this.ArB=this.A*this.rB;this.BrA=1/this.ArB;if(this.no_off){this.u_0=0}else{this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(e*e-1)/Math.cos(z)));if(this.lat0<0){this.u_0=-this.u_0}}r=.5*l;this.v_pole_n=this.ArB*Math.log(Math.tan(j-r));this.v_pole_s=this.ArB*Math.log(Math.tan(j+r))}function ze(t){var i={};var s,e,r,n,h,a,o,f;t.x=t.x-this.lam0;if(Math.abs(Math.abs(t.y)-R)>F){h=this.E/Math.pow(It(this.e,t.y,Math.sin(t.y)),this.B);a=1/h;s=.5*(h-a);e=.5*(h+a);n=Math.sin(this.B*t.x);r=(s*this.singam-n*this.cosgam)/e;if(Math.abs(Math.abs(r)-1)<F){throw new Error}f=.5*this.ArB*Math.log((1-r)/(1+r));a=Math.cos(this.B*t.x);if(Math.abs(a)<de){o=this.A*t.x}else{o=this.ArB*Math.atan2(s*this.cosgam+n*this.singam,a)}}else{f=t.y>0?this.v_pole_n:this.v_pole_s;o=this.ArB*t.y}if(this.no_rot){i.x=o;i.y=f}else{o-=this.u_0;i.x=f*this.cosrot+o*this.sinrot;i.y=o*this.cosrot-f*this.sinrot}i.x=this.a*i.x+this.x0;i.y=this.a*i.y+this.y0;return i}function Me(t){var i,s,e,r,n,h,a;var o={};t.x=(t.x-this.x0)*(1/this.a);t.y=(t.y-this.y0)*(1/this.a);if(this.no_rot){s=t.y;i=t.x}else{s=t.x*this.cosrot-t.y*this.sinrot;i=t.y*this.cosrot+t.x*this.sinrot+this.u_0}e=Math.exp(-this.BrA*s);r=.5*(e-1/e);n=.5*(e+1/e);h=Math.sin(this.BrA*i);a=(h*this.cosgam+r*this.singam)/n;if(Math.abs(Math.abs(a)-1)<F){o.x=0;o.y=a<0?-R:R}else{o.y=this.E/Math.sqrt((1+a)/(1-a));o.y=St(this.e,Math.pow(o.y,1/this.B));if(o.y===Infinity){throw new Error}o.x=-this.rB*Math.atan2(r*this.cosgam-h*this.singam,Math.cos(this.BrA*i))}o.x+=this.lam0;return o}var _e=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const ge={init:pe,forward:ze,inverse:Me,names:_e};function be(){if(!this.lat2){this.lat2=this.lat1}if(!this.k0){this.k0=1}this.x0=this.x0||0;this.y0=this.y0||0;if(Math.abs(this.lat1+this.lat2)<F){return}var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1);var s=Math.cos(this.lat1);var e=Et(this.e,i,s);var r=It(this.e,this.lat1,i);var n=Math.sin(this.lat2);var h=Math.cos(this.lat2);var a=Et(this.e,n,h);var o=It(this.e,this.lat2,n);var f=It(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>F){this.ns=Math.log(e/a)/Math.log(r/o)}else{this.ns=i}if(isNaN(this.ns)){this.ns=i}this.f0=e/(this.ns*Math.pow(r,this.ns));this.rh=this.a*this.f0*Math.pow(f,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}}function xe(t){var i=t.x;var s=t.y;if(Math.abs(2*Math.abs(s)-Math.PI)<=F){s=Nt(s)*(R-2*F)}var e=Math.abs(Math.abs(s)-R);var r,n;if(e>F){r=It(this.e,s,Math.sin(s));n=this.a*this.f0*Math.pow(r,this.ns)}else{e=s*this.ns;if(e<=0){return null}n=0}var h=this.ns*Ct(i-this.long0);t.x=this.k0*(n*Math.sin(h))+this.x0;t.y=this.k0*(this.rh-n*Math.cos(h))+this.y0;return t}function we(t){var i,s,e;var r,n;var h=(t.x-this.x0)/this.k0;var a=this.rh-(t.y-this.y0)/this.k0;if(this.ns>0){i=Math.sqrt(h*h+a*a);s=1}else{i=-Math.sqrt(h*h+a*a);s=-1}var o=0;if(i!==0){o=Math.atan2(s*h,s*a)}if(i!==0||this.ns>0){s=1/this.ns;e=Math.pow(i/(this.a*this.f0),s);r=St(this.e,e);if(r===-9999){return null}}else{r=-R}n=Ct(o/this.ns+this.long0);t.x=n;t.y=r;return t}var ye=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const ke={init:be,forward:xe,inverse:we,names:ye};function Ee(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);if(!this.lat0){this.lat0=.863937979737193}if(!this.long0){this.long0=.7417649320975901-.308341501185665}if(!this.k0){this.k0=.9999}this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq}function Ne(t){var i,s,e,r,n,h,a;var o=t.x;var f=t.y;var u=Ct(o-this.long0);i=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2);s=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/i)-this.s45);e=-u*this.alfa;r=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(e));n=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(r));h=this.n*n;a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n);t.y=a*Math.cos(h)/1;t.x=a*Math.sin(h)/1;if(!this.czech){t.y*=-1;t.x*=-1}return t}function Ce(t){var i,s,e,r,n,h,a;var o;var f=t.x;t.x=t.y;t.y=f;if(!this.czech){t.y*=-1;t.x*=-1}h=Math.sqrt(t.x*t.x+t.y*t.y);n=Math.atan2(t.y,t.x);r=n/Math.sin(this.s0);e=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);i=Math.asin(Math.cos(this.ad)*Math.sin(e)-Math.sin(this.ad)*Math.cos(e)*Math.cos(r));s=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(i));t.x=this.long0-s/this.alfa;a=i;o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45);if(Math.abs(a-t.y)<1e-10){o=1}a=t.y;u+=1}while(o===0&&u<15);if(u>=15){return null}return t}var Ie=["Krovak","krovak"];const Se={init:Ee,forward:Ne,inverse:Ce,names:Ie};function Oe(t,i,s,e,r){return t*r-i*Math.sin(2*r)+s*Math.sin(4*r)-e*Math.sin(6*r)}function Te(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ae(t){return.375*t*(1+.25*t*(1+.46875*t))}function Re(t){return.05859375*t*t*(1+.75*t)}function Pe(t){return t*t*t*(35/3072)}function Le(t,i,s){var e=i*s;return t/Math.sqrt(1-e*e)}function De(t){return Math.abs(t)<R?t:t-Nt(t)*Math.PI}function Fe(t,i,s,e,r){var n;var h;n=t/i;for(var a=0;a<15;a++){h=(t-(i*n-s*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)))/(i-2*s*Math.cos(2*n)+4*e*Math.cos(4*n)-6*r*Math.cos(6*n));n+=h;if(Math.abs(h)<=1e-10){return n}}return NaN}function We(){if(!this.sphere){this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.ml0=this.a*Oe(this.e0,this.e1,this.e2,this.e3,this.lat0)}}function Ge(t){var i,s;var e=t.x;var r=t.y;e=Ct(e-this.long0);if(this.sphere){i=this.a*Math.asin(Math.cos(r)*Math.sin(e));s=this.a*(Math.atan2(Math.tan(r),Math.cos(e))-this.lat0)}else{var n=Math.sin(r);var h=Math.cos(r);var a=Le(this.a,this.e,n);var o=Math.tan(r)*Math.tan(r);var f=e*Math.cos(r);var u=f*f;var l=this.es*h*h/(1-this.es);var v=this.a*Oe(this.e0,this.e1,this.e2,this.e3,r);i=a*f*(1-u*o*(1/6-(8-o+8*l)*u/120));s=v-this.ml0+a*n/h*u*(.5+(5-o+6*l)*u/24)}t.x=i+this.x0;t.y=s+this.y0;return t}function je(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r;if(this.sphere){var n=s+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(i));r=Math.atan2(Math.tan(i),Math.cos(n))}else{var h=this.ml0/this.a+s;var a=Fe(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-R)<=F){t.x=this.long0;t.y=R;if(s<0){t.y*=-1}return t}var o=Le(this.a,this.e,Math.sin(a));var f=o*o*o/this.a/this.a*(1-this.es);var u=Math.pow(Math.tan(a),2);var l=i*this.a/o;var v=l*l;e=a-o*Math.tan(a)/f*l*l*(.5-(1+3*u)*l*l/24);r=l*(1-v*(u/3+(1+3*u)*u*v/15))/Math.cos(a)}t.x=Ct(r+this.long0);t.y=De(e);return t}var Ve=["Cassini","Cassini_Soldner","cass"];const Ue={init:We,forward:Ge,inverse:je,names:Ve};function qe(t,i){var s;if(t>1e-7){s=t*i;return(1-t*t)*(i/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))}else{return 2*i}}var Xe=1;var Ye=2;var Be=3;var He=4;function Je(){var t=Math.abs(this.lat0);if(Math.abs(t-R)<F){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else if(Math.abs(t)<F){this.mode=this.EQUIT}else{this.mode=this.OBLIQ}if(this.es>0){var i;this.qp=qe(this.e,1);this.mmf=.5/(1-this.es);this.apa=rr(this.es);switch(this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);i=Math.sin(this.lat0);this.sinb1=qe(this.e,i)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode===this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}}function Ze(t){var i,s,e,r,n,h,a,o,f,u;var l=t.x;var v=t.y;l=Ct(l-this.long0);if(this.sphere){n=Math.sin(v);u=Math.cos(v);e=Math.cos(l);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){s=this.mode===this.EQUIT?1+u*e:1+this.sinph0*n+this.cosph0*u*e;if(s<=F){return null}s=Math.sqrt(2/s);i=s*u*Math.sin(l);s*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*u*e}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){e=-e}if(Math.abs(v+this.lat0)<F){return null}s=j-v*.5;s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s));i=s*Math.sin(l);s*=e}}else{a=0;o=0;f=0;e=Math.cos(l);r=Math.sin(l);n=Math.sin(v);h=qe(this.e,n);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){a=h/this.qp;o=Math.sqrt(1-a*a)}switch(this.mode){case this.OBLIQ:f=1+this.sinb1*a+this.cosb1*o*e;break;case this.EQUIT:f=1+o*e;break;case this.N_POLE:f=R+v;h=this.qp-h;break;case this.S_POLE:f=v-R;h=this.qp+h;break}if(Math.abs(f)<F){return null}switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f);if(this.mode===this.OBLIQ){s=this.ymf*f*(this.cosb1*a-this.sinb1*o*e)}else{s=(f=Math.sqrt(2/(1+o*e)))*a*this.ymf}i=this.xmf*f*o*r;break;case this.N_POLE:case this.S_POLE:if(h>=0){i=(f=Math.sqrt(h))*r;s=e*(this.mode===this.S_POLE?f:-f)}else{i=s=0}break}}t.x=this.a*i+this.x0;t.y=this.a*s+this.y0;return t}function $e(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r,n,h,a,o,f;if(this.sphere){var u=0,l,v=0;l=Math.sqrt(i*i+s*s);r=l*.5;if(r>1){return null}r=2*Math.asin(r);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){v=Math.sin(r);u=Math.cos(r)}switch(this.mode){case this.EQUIT:r=Math.abs(l)<=F?0:Math.asin(s*v/l);i*=v;s=u*l;break;case this.OBLIQ:r=Math.abs(l)<=F?this.lat0:Math.asin(u*this.sinph0+s*v*this.cosph0/l);i*=v*this.cosph0;s=(u-Math.sin(r)*this.sinph0)*l;break;case this.N_POLE:s=-s;r=R-r;break;case this.S_POLE:r-=R;break}e=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,s)}else{f=0;if(this.mode===this.OBLIQ||this.mode===this.EQUIT){i/=this.dd;s*=this.dd;o=Math.sqrt(i*i+s*s);if(o<F){t.x=this.long0;t.y=this.lat0;return t}h=2*Math.asin(.5*o/this.rq);n=Math.cos(h);i*=h=Math.sin(h);if(this.mode===this.OBLIQ){f=n*this.sinb1+s*h*this.cosb1/o;a=this.qp*f;s=o*this.cosb1*n-s*this.sinb1*h}else{f=s*h/o;a=this.qp*f;s=o*n}}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){s=-s}a=i*i+s*s;if(!a){t.x=this.long0;t.y=this.lat0;return t}f=1-a/this.qp;if(this.mode===this.S_POLE){f=-f}}e=Math.atan2(i,s);r=nr(Math.asin(f),this.apa)}t.x=Ct(this.long0+e);t.y=r;return t}var Ke=.3333333333333333;var Qe=.17222222222222222;var tr=.10257936507936508;var ir=.06388888888888888;var sr=.0664021164021164;var er=.016415012942191543;function rr(t){var i;var s=[];s[0]=t*Ke;i=t*t;s[0]+=i*Qe;s[1]=i*ir;i*=t;s[0]+=i*tr;s[1]+=i*sr;s[2]=i*er;return s}function nr(t,i){var s=t+t;return t+i[0]*Math.sin(s)+i[1]*Math.sin(s+s)+i[2]*Math.sin(s+s+s)}var hr=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const ar={init:Je,forward:Ze,inverse:$e,names:hr,S_POLE:Xe,N_POLE:Ye,EQUIT:Be,OBLIQ:He};function or(t){if(Math.abs(t)>1){t=t>1?1:-1}return Math.asin(t)}function fr(){if(Math.abs(this.lat1+this.lat2)<F){return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Et(this.e3,this.sin_po,this.cos_po);this.qs1=qe(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Et(this.e3,this.sin_po,this.cos_po);this.qs2=qe(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=qe(this.e3,this.sin_po);if(Math.abs(this.lat1-this.lat2)>F){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0}function ur(t){var i=t.x;var s=t.y;this.sin_phi=Math.sin(s);this.cos_phi=Math.cos(s);var e=qe(this.e3,this.sin_phi);var r=this.a*Math.sqrt(this.c-this.ns0*e)/this.ns0;var n=this.ns0*Ct(i-this.long0);var h=r*Math.sin(n)+this.x0;var a=this.rh-r*Math.cos(n)+this.y0;t.x=h;t.y=a;return t}function lr(t){var i,s,e,r,n,h;t.x-=this.x0;t.y=this.rh-t.y+this.y0;if(this.ns0>=0){i=Math.sqrt(t.x*t.x+t.y*t.y);e=1}else{i=-Math.sqrt(t.x*t.x+t.y*t.y);e=-1}r=0;if(i!==0){r=Math.atan2(e*t.x,e*t.y)}e=i*this.ns0/this.a;if(this.sphere){h=Math.asin((this.c-e*e)/(2*this.ns0))}else{s=(this.c-e*e)/this.ns0;h=this.phi1z(this.e3,s)}n=Ct(r/this.ns0+this.long0);t.x=n;t.y=h;return t}function vr(t,i){var s,e,r,n,h;var a=or(.5*i);if(t<F){return a}var o=t*t;for(var f=1;f<=25;f++){s=Math.sin(a);e=Math.cos(a);r=t*s;n=1-r*r;h=.5*n*n/e*(i/(1-o)-s/n+.5/t*Math.log((1-r)/(1+r)));a=a+h;if(Math.abs(h)<=1e-7){return a}}return null}var cr=["Albers_Conic_Equal_Area","Albers","aea"];const dr={init:fr,forward:ur,inverse:lr,names:cr,phi1z:vr};function mr(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1}function pr(t){var i,s;var e;var r;var n;var h;var a,o;var f=t.x;var u=t.y;e=Ct(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=F){a=this.x0+this.a*n*s*Math.sin(e)/h;o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)/h}else{a=this.x0+this.infinity_dist*s*Math.sin(e);o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function zr(t){var i;var s,e;var r;var n,h;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(i=Math.sqrt(t.x*t.x+t.y*t.y)){r=Math.atan2(i,this.rc);s=Math.sin(r);e=Math.cos(r);h=or(e*this.sin_p14+t.y*s*this.cos_p14/i);n=Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s);n=Ct(this.long0+n)}else{h=this.phic0;n=0}t.x=n;t.y=h;return t}var Mr=["gnom"];const _r={init:mr,forward:pr,inverse:zr,names:Mr};function gr(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6){if(i<0){return-1*R}else{return R}}var e=Math.asin(.5*i);var r;var n;var h;var a;for(var o=0;o<30;o++){n=Math.sin(e);h=Math.cos(e);a=t*n;r=Math.pow(1-a*a,2)/(2*h)*(i/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a)));e+=r;if(Math.abs(r)<=1e-10){return e}}return NaN}function br(){if(!this.sphere){this.k0=Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}function xr(t){var i=t.x;var s=t.y;var e,r;var n=Ct(i-this.long0);if(this.sphere){e=this.x0+this.a*n*Math.cos(this.lat_ts);r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts)}else{var h=qe(this.e,Math.sin(s));e=this.x0+this.a*this.k0*n;r=this.y0+this.a*h*.5/this.k0}t.x=e;t.y=r;return t}function wr(t){t.x-=this.x0;t.y-=this.y0;var i,s;if(this.sphere){i=Ct(this.long0+t.x/this.a/Math.cos(this.lat_ts));s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))}else{s=gr(this.e,2*t.y*this.k0/this.a);i=Ct(this.long0+t.x/(this.a*this.k0))}t.x=i;t.y=s;return t}var yr=["cea"];const kr={init:br,forward:xr,inverse:wr,names:yr};function Er(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)}function Nr(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=De(s-this.lat0);t.x=this.x0+this.a*e*this.rc;t.y=this.y0+this.a*r;return t}function Cr(t){var i=t.x;var s=t.y;t.x=Ct(this.long0+(i-this.x0)/(this.a*this.rc));t.y=De(this.lat0+(s-this.y0)/this.a);return t}var Ir=["Equirectangular","Equidistant_Cylindrical","eqc"];const Sr={init:Er,forward:Nr,inverse:Cr,names:Ir};var Or=20;function Tr(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.ml0=this.a*Oe(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Ar(t){var i=t.x;var s=t.y;var e,r,n;var h=Ct(i-this.long0);n=h*Math.sin(s);if(this.sphere){if(Math.abs(s)<=F){e=this.a*h;r=-1*this.a*this.lat0}else{e=this.a*Math.sin(n)/Math.tan(s);r=this.a*(De(s-this.lat0)+(1-Math.cos(n))/Math.tan(s))}}else{if(Math.abs(s)<=F){e=this.a*h;r=-1*this.ml0}else{var a=Le(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n);r=this.a*Oe(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}}t.x=e+this.x0;t.y=r+this.y0;return t}function Rr(t){var i,s,e,r,n;var h,a;var o,f;e=t.x-this.x0;r=t.y-this.y0;if(this.sphere){if(Math.abs(r+this.a*this.lat0)<=F){i=Ct(e/this.a+this.long0);s=0}else{h=this.lat0+r/this.a;a=e*e/this.a/this.a+h*h;o=h;var u;for(n=Or;n;--n){u=Math.tan(o);f=-1*(h*(o*u+1)-o-.5*(o*o+a)*u)/((o-h)/u-1);o+=f;if(Math.abs(f)<=F){s=o;break}}i=Ct(this.long0+Math.asin(e*Math.tan(o)/this.a)/Math.sin(s))}}else{if(Math.abs(r+this.ml0)<=F){s=0;i=Ct(this.long0+e/this.a)}else{h=(this.ml0+r)/this.a;a=e*e/this.a/this.a+h*h;o=h;var l,v,c,d;var m;for(n=Or;n;--n){m=this.e*Math.sin(o);l=Math.sqrt(1-m*m)*Math.tan(o);v=this.a*Oe(this.e0,this.e1,this.e2,this.e3,o);c=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o);d=v/this.a;f=(h*(l*d+1)-d-.5*l*(d*d+a))/(this.es*Math.sin(2*o)*(d*d+a-2*h*d)/(4*l)+(h-d)*(l*c-2/Math.sin(2*o))-c);o-=f;if(Math.abs(f)<=F){s=o;break}}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s);i=Ct(this.long0+Math.asin(e*l/this.a)/Math.sin(s))}}t.x=i;t.y=s;return t}var Pr=["Polyconic","poly"];const Lr={init:Tr,forward:Ar,inverse:Rr,names:Pr};function Dr(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=67e-5;this.A[10]=-34e-5;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013}function Fr(t){var i;var s=t.x;var e=t.y;var r=e-this.lat0;var n=s-this.long0;var h=r/A*1e-5;var a=n;var o=1;var f=0;for(i=1;i<=10;i++){o=o*h;f=f+this.A[i]*o}var u=f;var l=a;var v=1;var c=0;var d;var m;var p=0;var z=0;for(i=1;i<=6;i++){d=v*u-c*l;m=c*u+v*l;v=d;c=m;p=p+this.B_re[i]*v-this.B_im[i]*c;z=z+this.B_im[i]*v+this.B_re[i]*c}t.x=z*this.a+this.x0;t.y=p*this.a+this.y0;return t}function Wr(t){var i;var s=t.x;var e=t.y;var r=s-this.x0;var n=e-this.y0;var h=n/this.a;var a=r/this.a;var o=1;var f=0;var u;var l;var v=0;var c=0;for(i=1;i<=6;i++){u=o*h-f*a;l=f*h+o*a;o=u;f=l;v=v+this.C_re[i]*o-this.C_im[i]*f;c=c+this.C_im[i]*o+this.C_re[i]*f}for(var d=0;d<this.iterations;d++){var m=v;var p=c;var z;var M;var _=h;var g=a;for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;_=_+(i-1)*(this.B_re[i]*m-this.B_im[i]*p);g=g+(i-1)*(this.B_im[i]*m+this.B_re[i]*p)}m=1;p=0;var b=this.B_re[1];var x=this.B_im[1];for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;b=b+i*(this.B_re[i]*m-this.B_im[i]*p);x=x+i*(this.B_im[i]*m+this.B_re[i]*p)}var w=b*b+x*x;v=(_*b+g*x)/w;c=(g*b-_*x)/w}var y=v;var k=c;var E=1;var N=0;for(i=1;i<=9;i++){E=E*y;N=N+this.D[i]*E}var C=this.lat0+N*A*1e5;var I=this.long0+k;t.x=I;t.y=C;return t}var Gr=["New_Zealand_Map_Grid","nzmg"];const jr={init:Dr,forward:Fr,inverse:Wr,names:Gr};function Vr(){}function Ur(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=this.x0+this.a*e;var n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;t.x=r;t.y=n;return t}function qr(t){t.x-=this.x0;t.y-=this.y0;var i=Ct(this.long0+t.x/this.a);var s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);t.x=i;t.y=s;return t}var Xr=["Miller_Cylindrical","mill"];const Yr={init:Vr,forward:Ur,inverse:qr,names:Xr};var Br=20;function Hr(){if(!this.sphere){this.en=Ms(this.es)}else{this.n=1;this.m=0;this.es=0;this.C_y=Math.sqrt((this.m+1)/this.n);this.C_x=this.C_y/(this.m+1)}}function Jr(t){var i,s;var e=t.x;var r=t.y;e=Ct(e-this.long0);if(this.sphere){if(!this.m){r=this.n!==1?Math.asin(this.n*Math.sin(r)):r}else{var n=this.n*Math.sin(r);for(var h=Br;h;--h){var a=(this.m*r+Math.sin(r)-n)/(this.m+Math.cos(r));r-=a;if(Math.abs(a)<F){break}}}i=this.a*this.C_x*e*(this.m+Math.cos(r));s=this.a*this.C_y*r}else{var o=Math.sin(r);var f=Math.cos(r);s=this.a*_s(r,o,f,this.en);i=this.a*e*f/Math.sqrt(1-this.es*o*o)}t.x=i;t.y=s;return t}function Zr(t){var i,s,e,r;t.x-=this.x0;e=t.x/this.a;t.y-=this.y0;i=t.y/this.a;if(this.sphere){i/=this.C_y;e=e/(this.C_x*(this.m+Math.cos(i)));if(this.m){i=or((this.m*i+Math.sin(i))/this.n)}else if(this.n!==1){i=or(Math.sin(i)/this.n)}e=Ct(e+this.long0);i=De(i)}else{i=bs(t.y/this.a,this.es,this.en);r=Math.abs(i);if(r<R){r=Math.sin(i);s=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(i));e=Ct(s)}else if(r-F<R){e=this.long0}}t.x=e;t.y=i;return t}var $r=["Sinusoidal","sinu"];const Kr={init:Hr,forward:Jr,inverse:Zr,names:$r};function Qr(){}function tn(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=s;var n=Math.PI*Math.sin(s);while(true){var h=-(r+Math.sin(r)-n)/(1+Math.cos(r));r+=h;if(Math.abs(h)<F){break}}r/=2;if(Math.PI/2-Math.abs(s)<F){e=0}var a=.900316316158*this.a*e*Math.cos(r)+this.x0;var o=1.4142135623731*this.a*Math.sin(r)+this.y0;t.x=a;t.y=o;return t}function sn(t){var i;var s;t.x-=this.x0;t.y-=this.y0;s=t.y/(1.4142135623731*this.a);if(Math.abs(s)>.999999999999){s=.999999999999}i=Math.asin(s);var e=Ct(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));if(e<-Math.PI){e=-Math.PI}if(e>Math.PI){e=Math.PI}s=(2*i+Math.sin(2*i))/Math.PI;if(Math.abs(s)>1){s=1}var r=Math.asin(s);t.x=e;t.y=r;return t}var en=["Mollweide","moll"];const rn={init:Qr,forward:tn,inverse:sn,names:en};function nn(){if(Math.abs(this.lat1+this.lat2)<F){return}this.lat2=this.lat2||this.lat1;this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Et(this.e,this.sinphi,this.cosphi);this.ml1=Oe(this.e0,this.e1,this.e2,this.e3,this.lat1);if(Math.abs(this.lat1-this.lat2)<F){this.ns=this.sinphi}else{this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Et(this.e,this.sinphi,this.cosphi);this.ml2=Oe(this.e0,this.e1,this.e2,this.e3,this.lat2);this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}this.g=this.ml1+this.ms1/this.ns;this.ml0=Oe(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)}function hn(t){var i=t.x;var s=t.y;var e;if(this.sphere){e=this.a*(this.g-s)}else{var r=Oe(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-r)}var n=this.ns*Ct(i-this.long0);var h=this.x0+e*Math.sin(n);var a=this.y0+this.rh-e*Math.cos(n);t.x=h;t.y=a;return t}function an(t){t.x-=this.x0;t.y=this.rh-t.y+this.y0;var i,s,e,r;if(this.ns>=0){s=Math.sqrt(t.x*t.x+t.y*t.y);i=1}else{s=-Math.sqrt(t.x*t.x+t.y*t.y);i=-1}var n=0;if(s!==0){n=Math.atan2(i*t.x,i*t.y)}if(this.sphere){r=Ct(this.long0+n/this.ns);e=De(this.g-s/this.a);t.x=r;t.y=e;return t}else{var h=this.g-s/this.a;e=Fe(h,this.e0,this.e1,this.e2,this.e3);r=Ct(this.long0+n/this.ns);t.x=r;t.y=e;return t}}var on=["Equidistant_Conic","eqdc"];const fn={init:nn,forward:hn,inverse:an,names:on};function un(){this.R=this.a}function ln(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r,n;if(Math.abs(s)<=F){r=this.x0+this.R*e;n=this.y0}var h=or(2*Math.abs(s/Math.PI));if(Math.abs(e)<=F||Math.abs(Math.abs(s)-R)<=F){r=this.x0;if(s>=0){n=this.y0+Math.PI*this.R*Math.tan(.5*h)}else{n=this.y0+Math.PI*this.R*-Math.tan(.5*h)}}var a=.5*Math.abs(Math.PI/e-e/Math.PI);var o=a*a;var f=Math.sin(h);var u=Math.cos(h);var l=u/(f+u-1);var v=l*l;var c=l*(2/f-1);var d=c*c;var m=Math.PI*this.R*(a*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(v-d)))/(d+o);if(e<0){m=-m}r=this.x0+m;var p=o+l;m=Math.PI*this.R*(c*p-a*Math.sqrt((d+o)*(o+1)-p*p))/(d+o);if(s>=0){n=this.y0+m}else{n=this.y0-m}t.x=r;t.y=n;return t}function vn(t){var i,s;var e,r,n,h,a,o;var f;var u;var l;var v;var c;t.x-=this.x0;t.y-=this.y0;l=Math.PI*this.R;e=t.x/l;r=t.y/l;n=e*e+r*r;h=-Math.abs(r)*(1+n);a=h-2*r*r+e*e;o=-2*h+1+2*r*r+n*n;c=r*r/o+(2*a*a*a/o/o/o-9*h*a/o/o)/27;f=(h-a*a/3/o)/o;u=2*Math.sqrt(-f/3);l=3*c/f/u;if(Math.abs(l)>1){if(l>=0){l=1}else{l=-1}}v=Math.acos(l)/3;if(t.y>=0){s=(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}else{s=-(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}if(Math.abs(e)<F){i=this.long0}else{i=Ct(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(e*e-r*r)+n*n))/2/e)}t.x=i;t.y=s;return t}var cn=["Van_der_Grinten_I","VanDerGrinten","vandg"];const dn={init:un,forward:ln,inverse:vn,names:cn};function mn(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)}function pn(t){var i=t.x;var s=t.y;var e=Math.sin(t.y);var r=Math.cos(t.y);var n=Ct(i-this.long0);var h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w,y,k,E,N,C;if(this.sphere){if(Math.abs(this.sin_p12-1)<=F){t.x=this.x0+this.a*(R-s)*Math.sin(n);t.y=this.y0-this.a*(R-s)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=F){t.x=this.x0+this.a*(R+s)*Math.sin(n);t.y=this.y0+this.a*(R+s)*Math.cos(n);return t}else{w=this.sin_p12*e+this.cos_p12*r*Math.cos(n);b=Math.acos(w);x=b?b/Math.sin(b):1;t.x=this.x0+this.a*x*r*Math.sin(n);t.y=this.y0+this.a*x*(this.cos_p12*e-this.sin_p12*r*Math.cos(n));return t}}else{h=Te(this.es);a=Ae(this.es);o=Re(this.es);f=Pe(this.es);if(Math.abs(this.sin_p12-1)<=F){u=this.a*Oe(h,a,o,f,R);l=this.a*Oe(h,a,o,f,s);t.x=this.x0+(u-l)*Math.sin(n);t.y=this.y0-(u-l)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=F){u=this.a*Oe(h,a,o,f,R);l=this.a*Oe(h,a,o,f,s);t.x=this.x0+(u+l)*Math.sin(n);t.y=this.y0+(u+l)*Math.cos(n);return t}else{v=e/r;c=Le(this.a,this.e,this.sin_p12);d=Le(this.a,this.e,e);m=Math.atan((1-this.es)*v+this.es*c*this.sin_p12/(d*r));p=Math.atan2(Math.sin(n),this.cos_p12*Math.tan(m)-this.sin_p12*Math.cos(n));if(p===0){y=Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else if(Math.abs(Math.abs(p)-Math.PI)<=F){y=-Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else{y=Math.asin(Math.sin(n)*Math.cos(m)/Math.sin(p))}z=this.e*this.sin_p12/Math.sqrt(1-this.es);M=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es);_=z*M;g=M*M;k=y*y;E=k*y;N=E*y;C=N*y;b=c*y*(1-k*g*(1-g)/6+E/8*_*(1-2*g)+N/120*(g*(4-7*g)-3*z*z*(1-7*g))-C/48*_);t.x=this.x0+b*Math.sin(p);t.y=this.y0+b*Math.cos(p);return t}}}function zn(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w,y;if(this.sphere){i=Math.sqrt(t.x*t.x+t.y*t.y);if(i>2*R*this.a){return}s=i/this.a;e=Math.sin(s);r=Math.cos(s);n=this.long0;if(Math.abs(i)<=F){h=this.lat0}else{h=or(r*this.sin_p12+t.y*e*this.cos_p12/i);a=Math.abs(this.lat0)-R;if(Math.abs(a)<=F){if(this.lat0>=0){n=Ct(this.long0+Math.atan2(t.x,-t.y))}else{n=Ct(this.long0-Math.atan2(-t.x,t.y))}}else{n=Ct(this.long0+Math.atan2(t.x*e,i*this.cos_p12*r-t.y*this.sin_p12*e))}}t.x=n;t.y=h;return t}else{o=Te(this.es);f=Ae(this.es);u=Re(this.es);l=Pe(this.es);if(Math.abs(this.sin_p12-1)<=F){v=this.a*Oe(o,f,u,l,R);i=Math.sqrt(t.x*t.x+t.y*t.y);c=v-i;h=Fe(c/this.a,o,f,u,l);n=Ct(this.long0+Math.atan2(t.x,-1*t.y));t.x=n;t.y=h;return t}else if(Math.abs(this.sin_p12+1)<=F){v=this.a*Oe(o,f,u,l,R);i=Math.sqrt(t.x*t.x+t.y*t.y);c=i-v;h=Fe(c/this.a,o,f,u,l);n=Ct(this.long0+Math.atan2(t.x,t.y));t.x=n;t.y=h;return t}else{i=Math.sqrt(t.x*t.x+t.y*t.y);p=Math.atan2(t.x,t.y);d=Le(this.a,this.e,this.sin_p12);z=Math.cos(p);M=this.e*this.cos_p12*z;_=-M*M/(1-this.es);g=3*this.es*(1-_)*this.sin_p12*this.cos_p12*z/(1-this.es);b=i/d;x=b-_*(1+_)*Math.pow(b,3)/6-g*(1+3*_)*Math.pow(b,4)/24;w=1-_*x*x/2-b*x*x*x/6;m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*z);n=Ct(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m)));y=Math.sin(m);h=Math.atan2((y-this.es*w*this.sin_p12)*Math.tan(m),y*(1-this.es));t.x=n;t.y=h;return t}}}var Mn=["Azimuthal_Equidistant","aeqd"];const _n={init:mn,forward:pn,inverse:zn,names:Mn};function gn(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)}function bn(t){var i,s;var e;var r;var n;var h,a,o;var f=t.x;var u=t.y;e=Ct(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=F){a=this.a*n*s*Math.sin(e);o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function xn(t){var i;var s;var e,r;var n;var h,a;t.x-=this.x0;t.y-=this.y0;i=Math.sqrt(t.x*t.x+t.y*t.y);s=or(i/this.a);e=Math.sin(s);r=Math.cos(s);h=this.long0;if(Math.abs(i)<=F){a=this.lat0;t.x=h;t.y=a;return t}a=or(r*this.sin_p14+t.y*e*this.cos_p14/i);n=Math.abs(this.lat0)-R;if(Math.abs(n)<=F){if(this.lat0>=0){h=Ct(this.long0+Math.atan2(t.x,-t.y))}else{h=Ct(this.long0-Math.atan2(-t.x,t.y))}t.x=h;t.y=a;return t}h=Ct(this.long0+Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e));t.x=h;t.y=a;return t}var wn=["ortho"];const yn={init:gn,forward:bn,inverse:xn,names:wn};var kn={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6};var En={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Nn(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Quadrilateralized Spherical Cube";if(this.lat0>=R-j/2){this.face=kn.TOP}else if(this.lat0<=-(R-j/2)){this.face=kn.BOTTOM}else if(Math.abs(this.long0)<=j){this.face=kn.FRONT}else if(Math.abs(this.long0)<=R+j){this.face=this.long0>0?kn.RIGHT:kn.LEFT}else{this.face=kn.BACK}if(this.es!==0){this.one_minus_f=1-(this.a-this.b)/this.a;this.one_minus_f_squared=this.one_minus_f*this.one_minus_f}}function Cn(t){var i={x:0,y:0};var s,e;var r,n;var h,a;var o={value:0};t.x-=this.long0;if(this.es!==0){s=Math.atan(this.one_minus_f_squared*Math.tan(t.y))}else{s=t.y}e=t.x;if(this.face===kn.TOP){n=R-s;if(e>=j&&e<=R+j){o.value=En.AREA_0;r=e-R}else if(e>R+j||e<=-(R+j)){o.value=En.AREA_1;r=e>0?e-U:e+U}else if(e>-(R+j)&&e<=-j){o.value=En.AREA_2;r=e+R}else{o.value=En.AREA_3;r=e}}else if(this.face===kn.BOTTOM){n=R+s;if(e>=j&&e<=R+j){o.value=En.AREA_0;r=-e+R}else if(e<j&&e>=-j){o.value=En.AREA_1;r=-e}else if(e<-j&&e>=-(R+j)){o.value=En.AREA_2;r=-e-R}else{o.value=En.AREA_3;r=e>0?-e+U:-e-U}}else{var f,u,l;var v,c;var d,m;if(this.face===kn.RIGHT){e=On(e,+R)}else if(this.face===kn.BACK){e=On(e,+U)}else if(this.face===kn.LEFT){e=On(e,-R)}v=Math.sin(s);c=Math.cos(s);d=Math.sin(e);m=Math.cos(e);f=c*m;u=c*d;l=v;if(this.face===kn.FRONT){n=Math.acos(f);r=Sn(n,l,u,o)}else if(this.face===kn.RIGHT){n=Math.acos(u);r=Sn(n,l,-f,o)}else if(this.face===kn.BACK){n=Math.acos(-f);r=Sn(n,l,-u,o)}else if(this.face===kn.LEFT){n=Math.acos(-u);r=Sn(n,l,f,o)}else{n=r=0;o.value=En.AREA_0}}a=Math.atan(12/U*(r+Math.acos(Math.sin(r)*Math.cos(j))-R));h=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r)))));if(o.value===En.AREA_1){a+=R}else if(o.value===En.AREA_2){a+=U}else if(o.value===En.AREA_3){a+=1.5*U}i.x=h*Math.cos(a);i.y=h*Math.sin(a);i.x=i.x*this.a+this.x0;i.y=i.y*this.a+this.y0;t.x=i.x;t.y=i.y;return t}function In(t){var i={lam:0,phi:0};var s,e,r,n;var h,a,o,f;var u;var l={value:0};t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y));s=Math.atan2(t.y,t.x);if(t.x>=0&&t.x>=Math.abs(t.y)){l.value=En.AREA_0}else if(t.y>=0&&t.y>=Math.abs(t.x)){l.value=En.AREA_1;s-=R}else if(t.x<0&&-t.x>=Math.abs(t.y)){l.value=En.AREA_2;s=s<0?s+U:s-U}else{l.value=En.AREA_3;s+=R}u=U/12*Math.tan(s);h=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2));a=Math.atan(h);r=Math.cos(s);n=Math.tan(e);o=1-r*r*n*n*(1-Math.cos(Math.atan(1/Math.cos(a))));if(o<-1){o=-1}else if(o>+1){o=+1}if(this.face===kn.TOP){f=Math.acos(o);i.phi=R-f;if(l.value===En.AREA_0){i.lam=a+R}else if(l.value===En.AREA_1){i.lam=a<0?a+U:a-U}else if(l.value===En.AREA_2){i.lam=a-R}else{i.lam=a}}else if(this.face===kn.BOTTOM){f=Math.acos(o);i.phi=f-R;if(l.value===En.AREA_0){i.lam=-a+R}else if(l.value===En.AREA_1){i.lam=-a}else if(l.value===En.AREA_2){i.lam=-a-R}else{i.lam=a<0?-a-U:-a+U}}else{var v,c,d;v=o;u=v*v;if(u>=1){d=0}else{d=Math.sqrt(1-u)*Math.sin(a)}u+=d*d;if(u>=1){c=0}else{c=Math.sqrt(1-u)}if(l.value===En.AREA_1){u=c;c=-d;d=u}else if(l.value===En.AREA_2){c=-c;d=-d}else if(l.value===En.AREA_3){u=c;c=d;d=-u}if(this.face===kn.RIGHT){u=v;v=-c;c=u}else if(this.face===kn.BACK){v=-v;c=-c}else if(this.face===kn.LEFT){u=v;v=c;c=-u}i.phi=Math.acos(-d)-R;i.lam=Math.atan2(c,v);if(this.face===kn.RIGHT){i.lam=On(i.lam,-R)}else if(this.face===kn.BACK){i.lam=On(i.lam,-U)}else if(this.face===kn.LEFT){i.lam=On(i.lam,+R)}}if(this.es!==0){var m;var p,z;m=i.phi<0?1:0;p=Math.tan(i.phi);z=this.b/Math.sqrt(p*p+this.one_minus_f_squared);i.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z));if(m){i.phi=-i.phi}}i.lam+=this.long0;t.x=i.lam;t.y=i.phi;return t}function Sn(t,i,s,e){var r;if(t<F){e.value=En.AREA_0;r=0}else{r=Math.atan2(i,s);if(Math.abs(r)<=j){e.value=En.AREA_0}else if(r>j&&r<=R+j){e.value=En.AREA_1;r-=R}else if(r>R+j||r<=-(R+j)){e.value=En.AREA_2;r=r>=0?r-U:r+U}else{e.value=En.AREA_3;r+=R}}return r}function On(t,i){var s=t+i;if(s<-U){s+=V}else if(s>+U){s-=V}return s}var Tn=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const An={init:Nn,forward:Cn,inverse:In,names:Tn};var Rn=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]];var Pn=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]];var Ln=.8487;var Dn=1.3523;var Fn=G/5;var Wn=1/Fn;var Gn=18;var jn=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))};var Vn=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function Un(t,i,s,e){var r=i;for(;e;--e){var n=t(r);r-=n;if(Math.abs(n)<s){break}}return r}function qn(){this.x0=this.x0||0;this.y0=this.y0||0;this.long0=this.long0||0;this.es=0;this.title=this.title||"Robinson"}function Xn(t){var i=Ct(t.x-this.long0);var s=Math.abs(t.y);var e=Math.floor(s*Fn);if(e<0){e=0}else if(e>=Gn){e=Gn-1}s=G*(s-Wn*e);var r={x:jn(Rn[e],s)*i,y:jn(Pn[e],s)};if(t.y<0){r.y=-r.y}r.x=r.x*this.a*Ln+this.x0;r.y=r.y*this.a*Dn+this.y0;return r}function Yn(t){var i={x:(t.x-this.x0)/(this.a*Ln),y:Math.abs(t.y-this.y0)/(this.a*Dn)};if(i.y>=1){i.x/=Rn[Gn][0];i.y=t.y<0?-R:R}else{var s=Math.floor(i.y*Gn);if(s<0){s=0}else if(s>=Gn){s=Gn-1}for(;;){if(Pn[s][0]>i.y){--s}else if(Pn[s+1][0]<=i.y){++s}else{break}}var e=Pn[s];var r=5*(i.y-e[0])/(Pn[s+1][0]-e[0]);r=Un((function(t){return(jn(e,t)-i.y)/Vn(e,t)}),r,F,100);i.x/=jn(Rn[s],r);i.y=(5*s+r)*W;if(t.y<0){i.y=-i.y}}i.x=Ct(i.x+this.long0);return i}var Bn=["Robinson","robin"];const Hn={init:qn,forward:Xn,inverse:Yn,names:Bn};function Jn(){this.name="geocent"}function Zn(t){var i=mi(t,this.es,this.a);return i}function $n(t){var i=pi(t,this.es,this.a,this.b);return i}var Kn=["Geocentric","geocentric","geocent","Geocent"];const Qn={init:Jn,forward:Zn,inverse:$n,names:Kn};var th={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3};var ih={h:{def:1e5,num:true},azi:{def:0,num:true,degrees:true},tilt:{def:0,num:true,degrees:true},long0:{def:0,num:true},lat0:{def:0,num:true}};function sh(){Object.keys(ih).forEach(function(t){if(typeof this[t]==="undefined"){this[t]=ih[t].def}else if(ih[t].num&&isNaN(this[t])){throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t])}else if(ih[t].num){this[t]=parseFloat(this[t])}if(ih[t].degrees){this[t]=this[t]*W}}.bind(this));if(Math.abs(Math.abs(this.lat0)-R)<F){this.mode=this.lat0<0?th.S_POLE:th.N_POLE}else if(Math.abs(this.lat0)<F){this.mode=th.EQUIT}else{this.mode=th.OBLIQ;this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}this.pn1=this.h/this.a;if(this.pn1<=0||this.pn1>1e10){throw new Error("Invalid height")}this.p=1+this.pn1;this.rp=1/this.p;this.h1=1/this.pn1;this.pfact=(this.p+1)*this.h1;this.es=0;var t=this.tilt;var i=this.azi;this.cg=Math.cos(i);this.sg=Math.sin(i);this.cw=Math.cos(t);this.sw=Math.sin(t)}function eh(t){t.x-=this.long0;var i=Math.sin(t.y);var s=Math.cos(t.y);var e=Math.cos(t.x);var r,n;switch(this.mode){case th.OBLIQ:n=this.sinph0*i+this.cosph0*s*e;break;case th.EQUIT:n=s*e;break;case th.S_POLE:n=-i;break;case th.N_POLE:n=i;break}n=this.pn1/(this.p-n);r=n*s*Math.sin(t.x);switch(this.mode){case th.OBLIQ:n*=this.cosph0*i-this.sinph0*s*e;break;case th.EQUIT:n*=i;break;case th.N_POLE:n*=-(s*e);break;case th.S_POLE:n*=s*e;break}var h,a;h=n*this.cg+r*this.sg;a=1/(h*this.sw*this.h1+this.cw);r=(r*this.cg-n*this.sg)*this.cw*a;n=h*a;t.x=r*this.a;t.y=n*this.a;return t}function rh(t){t.x/=this.a;t.y/=this.a;var i={x:t.x,y:t.y};var s,e,r;r=1/(this.pn1-t.y*this.sw);s=this.pn1*t.x*r;e=this.pn1*t.y*this.cw*r;t.x=s*this.cg+e*this.sg;t.y=e*this.cg-s*this.sg;var n=Cs(t.x,t.y);if(Math.abs(n)<F){i.x=0;i.y=t.y}else{var h,a;a=1-n*n*this.pfact;a=(this.p-Math.sqrt(a))/(this.pn1/n+n/this.pn1);h=Math.sqrt(1-a*a);switch(this.mode){case th.OBLIQ:i.y=Math.asin(h*this.sinph0+t.y*a*this.cosph0/n);t.y=(h-this.sinph0*Math.sin(i.y))*n;t.x*=a*this.cosph0;break;case th.EQUIT:i.y=Math.asin(t.y*a/n);t.y=h*n;t.x*=a;break;case th.N_POLE:i.y=Math.asin(h);t.y=-t.y;break;case th.S_POLE:i.y=-Math.asin(h);break}i.x=Math.atan2(t.x,t.y)}t.x=i.x+this.long0;t.y=i.y;return t}var nh=["Tilted_Perspective","tpers"];const hh={init:sh,forward:eh,inverse:rh,names:nh};function ah(){this.flip_axis=this.sweep==="x"?1:0;this.h=Number(this.h);this.radius_g_1=this.h/this.a;if(this.radius_g_1<=0||this.radius_g_1>1e10){throw new Error}this.radius_g=1+this.radius_g_1;this.C=this.radius_g*this.radius_g-1;if(this.es!==0){var t=1-this.es;var i=1/t;this.radius_p=Math.sqrt(t);this.radius_p2=t;this.radius_p_inv2=i;this.shape="ellipse"}else{this.radius_p=1;this.radius_p2=1;this.radius_p_inv2=1;this.shape="sphere"}if(!this.title){this.title="Geostationary Satellite View"}}function oh(t){var i=t.x;var s=t.y;var e,r,n,h;i=i-this.long0;if(this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var a=this.radius_p/Cs(this.radius_p*Math.cos(s),Math.sin(s));r=a*Math.cos(i)*Math.cos(s);n=a*Math.sin(i)*Math.cos(s);h=a*Math.sin(s);if((this.radius_g-r)*r-n*n-h*h*this.radius_p_inv2<0){t.x=Number.NaN;t.y=Number.NaN;return t}e=this.radius_g-r;if(this.flip_axis){t.x=this.radius_g_1*Math.atan(n/Cs(h,e));t.y=this.radius_g_1*Math.atan(h/e)}else{t.x=this.radius_g_1*Math.atan(n/e);t.y=this.radius_g_1*Math.atan(h/Cs(n,e))}}else if(this.shape==="sphere"){e=Math.cos(s);r=Math.cos(i)*e;n=Math.sin(i)*e;h=Math.sin(s);e=this.radius_g-r;if(this.flip_axis){t.x=this.radius_g_1*Math.atan(n/Cs(h,e));t.y=this.radius_g_1*Math.atan(h/e)}else{t.x=this.radius_g_1*Math.atan(n/e);t.y=this.radius_g_1*Math.atan(h/Cs(n,e))}}t.x=t.x*this.a;t.y=t.y*this.a;return t}function fh(t){var i=-1;var s=0;var e=0;var r,n,h,a;t.x=t.x/this.a;t.y=t.y/this.a;if(this.shape==="ellipse"){if(this.flip_axis){e=Math.tan(t.y/this.radius_g_1);s=Math.tan(t.x/this.radius_g_1)*Cs(1,e)}else{s=Math.tan(t.x/this.radius_g_1);e=Math.tan(t.y/this.radius_g_1)*Cs(1,s)}var o=e/this.radius_p;r=s*s+o*o+i*i;n=2*this.radius_g*i;h=n*n-4*r*this.C;if(h<0){t.x=Number.NaN;t.y=Number.NaN;return t}a=(-n-Math.sqrt(h))/(2*r);i=this.radius_g+a*i;s*=a;e*=a;t.x=Math.atan2(s,i);t.y=Math.atan(e*Math.cos(t.x)/i);t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis){e=Math.tan(t.y/this.radius_g_1);s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+e*e)}else{s=Math.tan(t.x/this.radius_g_1);e=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)}r=s*s+e*e+i*i;n=2*this.radius_g*i;h=n*n-4*r*this.C;if(h<0){t.x=Number.NaN;t.y=Number.NaN;return t}a=(-n-Math.sqrt(h))/(2*r);i=this.radius_g+a*i;s*=a;e*=a;t.x=Math.atan2(s,i);t.y=Math.atan(e*Math.cos(t.x)/i)}t.x=t.x+this.long0;return t}var uh=["Geostationary Satellite View","Geostationary_Satellite","geos"];const lh={init:ah,forward:oh,inverse:fh,names:uh};var vh=1.340264,ch=-.081106,dh=893e-6,mh=.003796,ph=Math.sqrt(3)/2;function zh(){this.es=0;this.long0=this.long0!==undefined?this.long0:0}function Mh(t){var i=Ct(t.x-this.long0);var s=t.y;var e=Math.asin(ph*Math.sin(s)),r=e*e,n=r*r*r;t.x=i*Math.cos(e)/(ph*(vh+3*ch*r+n*(7*dh+9*mh*r)));t.y=e*(vh+ch*r+n*(dh+mh*r));t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function _h(t){t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;var i=1e-9,s=12,e=t.y,r,n,h,a,o,f;for(f=0;f<s;++f){r=e*e;n=r*r*r;h=e*(vh+ch*r+n*(dh+mh*r))-t.y;a=vh+3*ch*r+n*(7*dh+9*mh*r);e-=o=h/a;if(Math.abs(o)<i){break}}r=e*e;n=r*r*r;t.x=ph*t.x*(vh+3*ch*r+n*(7*dh+9*mh*r))/Math.cos(e);t.y=Math.asin(Math.sin(e)/ph);t.x=Ct(t.x+this.long0);return t}var gh=["eqearth","Equal Earth","Equal_Earth"];const bh={init:zh,forward:Mh,inverse:_h,names:gh};var xh=1e-10;function wh(){var t;this.phi1=this.lat1;if(Math.abs(this.phi1)<xh){throw new Error}if(this.es){this.en=Ms(this.es);this.m1=_s(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en);this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1);this.inverse=kh;this.forward=yh}else{if(Math.abs(this.phi1)+xh>=R){this.cphi1=0}else{this.cphi1=1/Math.tan(this.phi1)}this.inverse=Nh;this.forward=Eh}}function yh(t){var i=Ct(t.x-(this.long0||0));var s=t.y;var e,r,n;e=this.am1+this.m1-_s(s,r=Math.sin(s),n=Math.cos(s),this.en);r=n*i/(e*Math.sqrt(1-this.es*r*r));t.x=e*Math.sin(r);t.y=this.am1-e*Math.cos(r);t.x=this.a*t.x+(this.x0||0);t.y=this.a*t.y+(this.y0||0);return t}function kh(t){t.x=(t.x-(this.x0||0))/this.a;t.y=(t.y-(this.y0||0))/this.a;var i,s,e,r;s=Cs(t.x,t.y=this.am1-t.y);r=bs(this.am1+this.m1-s,this.es,this.en);if((i=Math.abs(r))<R){i=Math.sin(r);e=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(r)}else if(Math.abs(i-R)<=xh){e=0}else{throw new Error}t.x=Ct(e+(this.long0||0));t.y=De(r);return t}function Eh(t){var i=Ct(t.x-(this.long0||0));var s=t.y;var e,r;r=this.cphi1+this.phi1-s;if(Math.abs(r)>xh){t.x=r*Math.sin(e=i*Math.cos(s)/r);t.y=this.cphi1-r*Math.cos(e)}else{t.x=t.y=0}t.x=this.a*t.x+(this.x0||0);t.y=this.a*t.y+(this.y0||0);return t}function Nh(t){t.x=(t.x-(this.x0||0))/this.a;t.y=(t.y-(this.y0||0))/this.a;var i,s;var e=Cs(t.x,t.y=this.cphi1-t.y);s=this.cphi1+this.phi1-e;if(Math.abs(s)>R){throw new Error}if(Math.abs(Math.abs(s)-R)<=xh){i=0}else{i=e*Math.atan2(t.x,t.y)/Math.cos(s)}t.x=Ct(i+(this.long0||0));t.y=De(s);return t}var Ch=["bonne","Bonne (Werner lat_1=90)"];const Ih={init:wh,names:Ch};function Sh(t){t.Proj.projections.add(Es);t.Proj.projections.add(Ws);t.Proj.projections.add(qs);t.Proj.projections.add(se);t.Proj.projections.add(oe);t.Proj.projections.add(ce);t.Proj.projections.add(ge);t.Proj.projections.add(ke);t.Proj.projections.add(Se);t.Proj.projections.add(Ue);t.Proj.projections.add(ar);t.Proj.projections.add(dr);t.Proj.projections.add(_r);t.Proj.projections.add(kr);t.Proj.projections.add(Sr);t.Proj.projections.add(Lr);t.Proj.projections.add(jr);t.Proj.projections.add(Yr);t.Proj.projections.add(Kr);t.Proj.projections.add(rn);t.Proj.projections.add(fn);t.Proj.projections.add(dn);t.Proj.projections.add(_n);t.Proj.projections.add(yn);t.Proj.projections.add(An);t.Proj.projections.add(Hn);t.Proj.projections.add(Qn);t.Proj.projections.add(hh);t.Proj.projections.add(lh);t.Proj.projections.add(bh);t.Proj.projections.add(Ih)}Ai.defaultDatum="WGS84";Ai.Proj=ci;Ai.WGS84=new Ai.Proj("WGS84");Ai.Point=ns;Ai.toPoint=ki;Ai.defs=mt;Ai.nadgrid=si;Ai.transform=Ii;Ai.mgrs=Vi;Ai.version="__VERSION__";Sh(Ai);var Oh={};Oh.ASSUME_TOUCH=false;Oh.DEFAULT_MAX_ZOOM=42;Oh.DEFAULT_MIN_ZOOM=0;Oh.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5;Oh.DEFAULT_TILE_SIZE=256;Oh.DEFAULT_WMS_VERSION="1.3.0";Oh.ENABLE_CANVAS=true;Oh.ENABLE_PROJ4JS=true;Oh.ENABLE_RASTER_REPROJECTION=true;Oh.ENABLE_WEBGL=true;Oh.DEBUG_WEBGL=true;Oh.INITIAL_ATLAS_SIZE=256;Oh.MAX_ATLAS_SIZE=-1;Oh.MOUSEWHEELZOOM_MAXDELTA=1;Oh.OVERVIEWMAP_MAX_RATIO=.75;Oh.OVERVIEWMAP_MIN_RATIO=.1;Oh.RASTER_REPROJECTION_MAX_SOURCE_TILES=100;Oh.RASTER_REPROJECTION_MAX_SUBDIVISION=10;Oh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25;Oh.SIMPLIFY_TOLERANCE=.5;Oh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024;Oh.VERSION="v4.6.5";Oh.inherits=function(t,i){t.prototype=Object.create(i.prototype);t.prototype.constructor=t};Oh.nullFunction=function(){};Oh.getUid=function(t){return t.ol_uid||(t.ol_uid=++Oh.uidCounter_)};Oh.uidCounter_=0;var Th={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};var Ah={PROPERTYCHANGE:"propertychange"};var Rh={};Rh.assign=typeof Object.assign==="function"?Object.assign:function(t,i){if(t===undefined||t===null){throw new TypeError("Cannot convert undefined or null to object")}var s=Object(t);for(var e=1,r=arguments.length;e<r;++e){var n=arguments[e];if(n!==undefined&&n!==null){for(var h in n){if(n.hasOwnProperty(h)){s[h]=n[h]}}}}return s};Rh.clear=function(t){for(var i in t){delete t[i]}};Rh.getValues=function(t){var i=[];for(var s in t){i.push(t[s])}return i};Rh.isEmpty=function(t){var i;for(i in t){return false}return!i};var Ph={};Ph.bindListener_=function(t){var i=function(i){var s=t.listener;var e=t.bindTo||t.target;if(t.callOnce){Ph.unlistenByKey(t)}return s.call(e,i)};t.boundListener=i;return i};Ph.findListener_=function(t,i,s,e){var r;for(var n=0,h=t.length;n<h;++n){r=t[n];if(r.listener===i&&r.bindTo===s){if(e){r.deleteIndex=n}return r}}return undefined};Ph.getListeners=function(t,i){var s=t.ol_lm;return s?s[i]:undefined};Ph.getListenerMap_=function(t){var i=t.ol_lm;if(!i){i=t.ol_lm={}}return i};Ph.removeListeners_=function(t,i){var s=Ph.getListeners(t,i);if(s){for(var e=0,r=s.length;e<r;++e){t.removeEventListener(i,s[e].boundListener);Rh.clear(s[e])}s.length=0;var n=t.ol_lm;if(n){delete n[i];if(Object.keys(n).length===0){delete t.ol_lm}}}};Ph.listen=function(t,i,s,e,r){var n=Ph.getListenerMap_(t);var h=n[i];if(!h){h=n[i]=[]}var a=Ph.findListener_(h,s,e,false);if(a){if(!r){a.callOnce=false}}else{a={bindTo:e,callOnce:!!r,listener:s,target:t,type:i};t.addEventListener(i,Ph.bindListener_(a));h.push(a)}return a};Ph.listenOnce=function(t,i,s,e){return Ph.listen(t,i,s,e,true)};Ph.unlisten=function(t,i,s,e){var r=Ph.getListeners(t,i);if(r){var n=Ph.findListener_(r,s,e,true);if(n){Ph.unlistenByKey(n)}}};Ph.unlistenByKey=function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=Ph.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);if(s!==-1){i.splice(s,1)}if(i.length===0){Ph.removeListeners_(t.target,t.type)}}Rh.clear(t)}};Ph.unlistenAll=function(t){var i=Ph.getListenerMap_(t);for(var s in i){Ph.removeListeners_(t,s)}};var Lh=function(){};Lh.prototype.disposed_=false;Lh.prototype.dispose=function(){if(!this.disposed_){this.disposed_=true;this.disposeInternal()}};Lh.prototype.disposeInternal=Oh.nullFunction;var Dh=function(t){this.type=t;this.target=null};Dh.prototype.preventDefault=Dh.prototype.stopPropagation=function(){this.propagationStopped=true};Dh.stopPropagation=function(t){t.stopPropagation()};Dh.preventDefault=function(t){t.preventDefault()};var Fh=function(){Lh.call(this);this.pendingRemovals_={};this.dispatching_={};this.listeners_={}};Oh.inherits(Fh,Lh);Fh.prototype.addEventListener=function(t,i){var s=this.listeners_[t];if(!s){s=this.listeners_[t]=[]}if(s.indexOf(i)===-1){s.push(i)}};Fh.prototype.dispatchEvent=function(t){var i=typeof t==="string"?new Dh(t):t;var s=i.type;i.target=this;var e=this.listeners_[s];var r;if(e){if(!(s in this.dispatching_)){this.dispatching_[s]=0;this.pendingRemovals_[s]=0}++this.dispatching_[s];for(var n=0,h=e.length;n<h;++n){if(e[n].call(this,i)===false||i.propagationStopped){r=false;break}}--this.dispatching_[s];if(this.dispatching_[s]===0){var a=this.pendingRemovals_[s];delete this.pendingRemovals_[s];while(a--){this.removeEventListener(s,Oh.nullFunction)}delete this.dispatching_[s]}return r}};Fh.prototype.disposeInternal=function(){Ph.unlistenAll(this)};Fh.prototype.getListeners=function(t){return this.listeners_[t]};Fh.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0};Fh.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var e=s.indexOf(i);if(t in this.pendingRemovals_){s[e]=Oh.nullFunction;++this.pendingRemovals_[t]}else{s.splice(e,1);if(s.length===0){delete this.listeners_[t]}}}};var Wh={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var Gh=function(){Fh.call(this);this.revision_=0};Oh.inherits(Gh,Fh);Gh.unByKey=function(t){if(Array.isArray(t)){for(var i=0,s=t.length;i<s;++i){Ph.unlistenByKey(t[i])}}else{Ph.unlistenByKey(t)}};Gh.prototype.changed=function(){++this.revision_;this.dispatchEvent(Wh.CHANGE)};Gh.prototype.getRevision=function(){return this.revision_};Gh.prototype.on=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=Ph.listen(this,t[n],i,s)}return r}else{return Ph.listen(this,t,i,s)}};Gh.prototype.once=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=Ph.listenOnce(this,t[n],i,s)}return r}else{return Ph.listenOnce(this,t,i,s)}};Gh.prototype.un=function(t,i,s){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;++e){Ph.unlisten(this,t[e],i,s)}return}else{Ph.unlisten(this,t,i,s)}};var jh=function(t){Gh.call(this);Oh.getUid(this);this.values_={};if(t!==undefined){this.setProperties(t)}};Oh.inherits(jh,Gh);jh.changeEventTypeCache_={};jh.getChangeEventType=function(t){return jh.changeEventTypeCache_.hasOwnProperty(t)?jh.changeEventTypeCache_[t]:jh.changeEventTypeCache_[t]="change:"+t};jh.prototype.get=function(t){var i;if(this.values_.hasOwnProperty(t)){i=this.values_[t]}return i};jh.prototype.getKeys=function(){return Object.keys(this.values_)};jh.prototype.getProperties=function(){return Rh.assign({},this.values_)};jh.prototype.notify=function(t,i){var s;s=jh.getChangeEventType(t);this.dispatchEvent(new jh.Event(s,t,i));s=Ah.PROPERTYCHANGE;this.dispatchEvent(new jh.Event(s,t,i))};jh.prototype.set=function(t,i,s){if(s){this.values_[t]=i}else{var e=this.values_[t];this.values_[t]=i;if(e!==i){this.notify(t,e)}}};jh.prototype.setProperties=function(t,i){var s;for(s in t){this.set(s,t[s],i)}};jh.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t];if(!i){this.notify(t,s)}}};jh.Event=function(t,i,s){Dh.call(this,t);this.key=i;this.oldValue=s};Oh.inherits(jh.Event,Dh);var Vh=function(t){var i=Oh.VERSION?Oh.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.";this.code=t;this.name="AssertionError"};Oh.inherits(Vh,Error);var Uh={};Uh.assert=function(t,i){if(!t){throw new Vh(i)}};var qh={};qh.clamp=function(t,i,s){return Math.min(Math.max(t,i),s)};qh.cosh=function(){var t;if("cosh"in Math){t=Math.cosh}else{t=function(t){var i=Math.exp(t);return(i+1/i)/2}}return t}();qh.roundUpToPowerOfTwo=function(t){Uh.assert(0<t,29);return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))};qh.squaredSegmentDistance=function(t,i,s,e,r,n){var h=r-s;var a=n-e;if(h!==0||a!==0){var o=((t-s)*h+(i-e)*a)/(h*h+a*a);if(o>1){s=r;e=n}else if(o>0){s+=h*o;e+=a*o}}return qh.squaredDistance(t,i,s,e)};qh.squaredDistance=function(t,i,s,e){var r=s-t;var n=e-i;return r*r+n*n};qh.solveLinearSystem=function(t){var i=t.length;for(var s=0;s<i;s++){var e=s;var r=Math.abs(t[s][s]);for(var n=s+1;n<i;n++){var h=Math.abs(t[n][s]);if(h>r){r=h;e=n}}if(r===0){return null}var a=t[e];t[e]=t[s];t[s]=a;for(var o=s+1;o<i;o++){var f=-t[o][s]/t[s][s];for(var u=s;u<i+1;u++){if(s==u){t[o][u]=0}else{t[o][u]+=f*t[s][u]}}}}var l=new Array(i);for(var v=i-1;v>=0;v--){l[v]=t[v][i]/t[v][v];for(var c=v-1;c>=0;c--){t[c][i]-=t[c][v]*l[v]}}return l};qh.toDegrees=function(t){return t*180/Math.PI};qh.toRadians=function(t){return t*Math.PI/180};qh.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s};qh.lerp=function(t,i,s){return t+s*(i-t)};var Xh={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
|
|
1
|
+
import{r as t,c as i,h as s,a as e,g as r,e as n,w as h,F as a}from"./p-ef5985a3.js";import{h as o}from"./p-24caf6c1.js";import{S as f}from"./p-1e60797c.js";import{m as u}from"./p-f4adb3cd.js";import{t as l,c as v}from"./p-f48422c4.js";import{c}from"./p-a62948ad.js";import{c as d}from"./p-1ab64d01.js";import"./p-dae15605.js";const m=`<svg xmlns="http://www.w3.org/2000/svg" width="22px" height="22px" fill="none" viewBox="0 0 24 24"><g clip-path="url(#a)"><path fill="currentColor" d="m10 15.172 9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h24v24H0z"/></clipPath></defs></svg>`;const p=".sc-stzh-checkbox-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-checkbox-h,[stzh-hidden].sc-stzh-checkbox-h{display:none}.sc-stzh-checkbox-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h *.sc-stzh-checkbox,.sc-stzh-checkbox-h *.sc-stzh-checkbox::before,.sc-stzh-checkbox-h *.sc-stzh-checkbox::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-checkbox-h .has-focus.sc-stzh-checkbox{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox{outline-style:none !important}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox::-moz-focus-inner{border:0 !important}.sc-stzh-checkbox-h{--label-color:var(--stzh-checkbox-label-color, var(--stzh-base-color));--label-hover-color:var(--stzh-checkbox-label-hover-color, var(--stzh-color-primary70));--label-hover-checked-color:var(--stzh-checkbox-label-hover-checked-color, var(--stzh-color-primary90));--check-color:var(--stzh-checkbox-check-color, var(--stzh-color-primary));display:inline-block}[disabled].sc-stzh-checkbox-h:not([disabled=false]){--description-color:var(--stzh-color-grey70)}.stzh-checkbox.sc-stzh-checkbox{display:grid}.stzh-checkbox__marker-symbol.sc-stzh-checkbox{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-checkbox__marker-text.sc-stzh-checkbox{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-checkbox__description-wrapper.sc-stzh-checkbox{display:flex;flex-direction:column-reverse;min-height:var(--description-min-height, var(--stzh-description-min-height, none))}.stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox__description.sc-stzh-checkbox{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-checkbox__error.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox__error-list.sc-stzh-checkbox{list-style:none;margin:0;padding:0}.stzh-checkbox__description.sc-stzh-checkbox{display:flex;align-items:flex-start;color:var(--stzh-input-description-color, var(--description-color, var(--stzh-color-coolgrey70)));transition:color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__description-long.sc-stzh-checkbox{margin-right:var(--stzh-space-xxsmall);margin-top:0.125rem}@supports (font: -apple-system-body) and (-webkit-appearance: none){.stzh-checkbox__description-long.sc-stzh-checkbox{margin-top:0}}.stzh-checkbox__description-long-popover.sc-stzh-checkbox{--width:auto;--max-width:27.3125rem}.stzh-checkbox__description-long-button.sc-stzh-checkbox{display:flex;justify-content:center;align-items:center;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer}.stzh-checkbox.sc-stzh-checkbox stzh-icon.stzh-checkbox__description-long-icon.sc-stzh-checkbox{--size:var(--stzh-icon-size-xsmall)}.stzh-checkbox--has-error.sc-stzh-checkbox .stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox--has-description.sc-stzh-checkbox .stzh-checkbox__description.sc-stzh-checkbox{margin-top:var(--stzh-space-xxxsmall)}.stzh-checkbox__field-wrapper.sc-stzh-checkbox{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:flex;-webkit-user-select:none;user-select:none;cursor:pointer}.stzh-checkbox__input.sc-stzh-checkbox{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none;appearance:none;border-radius:var(--stzh-form-input-border-radius)}.stzh-checkbox__mark.sc-stzh-checkbox{border:0.125rem solid var(--stzh-color-black);background-color:var(--stzh-color-white);width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:var(--stzh-form-input-border-radius);display:inline-flex;justify-content:center;align-items:center;transition:border-color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__check.sc-stzh-checkbox{display:flex;flex-direction:column;justify-content:center;opacity:0;color:var(--check-color);transition-property:color;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-checkbox__label.sc-stzh-checkbox{--stzh-base-color:initial;display:inline-block;color:var(--label-color);transition:color var(--stzh-base-transition-animation-speed);margin-left:var(--stzh-space-small);line-height:1.5rem}.stzh-checkbox__label.sc-stzh-checkbox:empty{display:none}.stzh-checkbox__marker.sc-stzh-checkbox{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-left:calc(-0.25em + var(--stzh-space-xsmall))}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--label-hover-color)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--label-hover-checked-color)}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__mark.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--label-hover-color)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--label-hover-checked-color)}.stzh-checkbox--is-checked.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{opacity:1}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-error60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__field-wrapper.sc-stzh-checkbox{cursor:not-allowed}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-grey60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__mark.sc-stzh-checkbox{background-color:var(--stzh-color-grey20)}";const z=p;let M=0;const _=class{constructor(s){t(this,s);this.stzhChange=i(this,"stzhChange",7);this.stzhFocus=i(this,"stzhFocus",7);this.stzhBlur=i(this,"stzhBlur",7);this.focusedByInput=false;this.handleReset=async()=>{this.checked=this.defaultChecked};this.onInput=t=>{this.checked=this.input.checked;this.stzhChange.emit({component:"stzh-checkbox",originalEvent:t,value:this.value,checked:this.checked})};this.onRootFocus=()=>{if(!this.focusedByInput){this.input.focus()}this.focusedByInput=false};this.onFocus=t=>{this.focusedByInput=true;const i=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhFocus.emit({component:"stzh-checkbox",originalEvent:t})};this.onBlur=t=>{const i=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhBlur.emit({component:"stzh-checkbox",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.checked=false;this.defaultChecked=undefined;this.label="";this.description=undefined;this.descriptionLong=undefined;this.descriptionLongTitle=undefined;this.hideOptional=false;this.error=undefined;this.a11yDescribedby=""}resetListener(t){if(t.target.contains(this.element)){requestAnimationFrame((()=>{this.handleReset()}))}}errorWatcher(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(i){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}}async componentWillLoad(){this.inputId=`stzh-checkbox-${M++}`;this.errorWatcher(this.error);this.defaultChecked=typeof this.defaultChecked==="boolean"?this.defaultChecked:this.checked;if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"checkbox")}}render(){var t,i;const r=o(this.element,"description")||!!this.description;const n=o(this.element,"description-long")||!!this.descriptionLong;const h=o(this.element,"error")||((t=this._error)===null||t===void 0?void 0:t.length)>0;const a={"stzh-checkbox":true,"stzh-checkbox--has-description":r,"stzh-checkbox--has-description-long":n,"stzh-checkbox--has-error":h,"stzh-checkbox--is-required":this.required,"stzh-checkbox--is-invalid":this.invalid||h,"stzh-checkbox--is-disabled":this.disabled,"stzh-checkbox--is-checked":this.checked};return s(e,{key:"b456ff76d193f5eeca01a13b74c89b93f6ff09e6","is-invalid":this.invalid||h,tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},s("div",{key:"b00ed1c5f9c65b2794338903491fb8126524a93c",class:a},s("label",{key:"f67e70fa169a1ee8632050eda8cf40322609a28b",class:"stzh-checkbox__field-wrapper"},s("input",{key:"20e9bccc86dc93d627eb7cae7e832fd8eda43f41",class:"stzh-checkbox__input",ref:t=>this.input=t,type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":`${this.inputId}-description ${this.a11yDescribedby}`,"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,defaultChecked:this.defaultChecked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),s("div",{key:"f76d293080b732665760637c8fe8072c6ed126c2",class:"stzh-checkbox__mark"},s("div",{key:"799d4aaf71559c1436e460b79f2c7cb6f933a76e",class:"stzh-checkbox__check",innerHTML:m})),s("div",{key:"1b196d9c3b2b2e0e8159df2dc425af087b3ff6b4",class:"stzh-checkbox__label"},this.label?this.label:s("slot",null),!this.hideOptional&&s("span",{key:"17393a4c46c20c49c84a187600ac20ccd3c01318",class:"stzh-checkbox__marker"},s("span",{key:"79f77fcee85c0b679c328073112231925398937f",class:"stzh-checkbox__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),s("span",{key:"1cbfc08350a2470bebc4e1f962e073d9b1a3ab47",class:"stzh-checkbox__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),(((i=this._error)===null||i===void 0?void 0:i.length)>0||this.description||this.descriptionLong)&&s(f,{key:"9047ffee464857b30de80fa26a8dfd2028c0bff4",classPrefix:"stzh-checkbox",id:`${this.inputId}-description`,error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongTitle:this.descriptionLongTitle,descriptionLongUsed:n,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel})))}get element(){return r(this)}static get watchers(){return{error:["errorWatcher"]}}};_.style=z;const g=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h,[stzh-hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--logo-width:auto;--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color)}@media print{.sc-stzh-header-h{display:none}}[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz].sc-stzh-header-s>[slot=logo],.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h.sc-stzh-header-s>[slot=logo],.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--stzh-color-coolgrey10)}.stzh-header__metabar-inner.sc-stzh-header{margin-left:1.25rem;margin-right:1.25rem;display:flex;align-items:center;height:4rem}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--stzh-color-grey90);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium);gap:var(--stzh-space-medium);color:var(--stzh-color-primary70)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}@media screen and (max-width: 599px){.stzh-header__burger-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:calc(var(--stzh-space-medium) + var(--stzh-icon-size) + var(--stzh-space-medium));padding-right:var(--stzh-space-xlarge)}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium), -50%)}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge)}}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem;--background-color:var(--stzh-color-coolgrey10)}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small);align-items:center;justify-content:center;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc(100% - 34.5625rem + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2);margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium);padding-right:var(--stzh-space-medium);padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:1.25rem;display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:2rem}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--stzh-color-secondary30);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc((27.4375rem - 4rem) + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:hidden}@media (min-height: 580px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto}}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto;position:static}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-large);background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small)}}@media screen and (min-width: 600px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge));padding-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--stzh-color-secondary20);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header{transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--stzh-color-secondary40)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary10)}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall);appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--stzh-color-primary70);padding-left:var(--stzh-space-xxxlarge);padding-top:var(--stzh-space-small);padding-bottom:var(--stzh-space-small);padding-right:var(--stzh-space-large);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium);padding-top:var(--stzh-space-medium);padding-bottom:var(--stzh-space-xsmall);min-height:none;padding-left:1.25rem;padding-right:1.25rem;gap:var(--stzh-space-xxsmall)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium);padding-right:var(--stzh-space-xxlarge)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium);margin-bottom:var(--stzh-space-xlarge);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge);margin-top:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}";const b=g;const x="stzh-header-open";const w=class{constructor(s){t(this,s);this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick",7);this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick",7);this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick",7);this.stzhMenuItemClick=i(this,"stzhMenuItemClick",7);this.stzhLanguageChange=i(this,"stzhLanguageChange",7);this.stzhSearchChange=i(this,"stzhSearchChange",7);this.stzhSearchChanged=i(this,"stzhSearchChanged",7);this.lastOpener=null;this.flyoutOpenedByMetanavItem=null;this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);if(this.isMedium&&i){this.closeMenuItem(false)}};this.handleBurgerClick=async()=>{if(this.flyoutOpenedByMetanavItem){this.flyoutOpenedByMetanavItem=false;this.closeMetanavItem()}else{this.flyoutSearchOpen=false;this.flyoutOpen=!this.flyoutOpen}const t=this.element.querySelector(".stzh-header__menu-item");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleSearchButtonClick=async()=>{this.flyoutOpen=false;this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleBackdropClick=async()=>{this.flyoutOpen=false;this.updatePosition()};this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=false;this.updatePosition()};this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})};this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})};this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=false;this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleSearchInput=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleSearchChange=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleLanguageClick=(t,i)=>{if(this.languagePreventUrlchange){t.preventDefault()}this.languageActive=i.value;this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})};this.handleFlyoutResize=()=>{this.resizeMenunavElement()};this.handleResize=()=>{if(this.sticky==="disabled"){return}if(this.debounceResize){window.cancelAnimationFrame(this.debounceResize)}this.debounceResize=requestAnimationFrame((()=>{n((()=>{var t,i,s;this.isMedium=u("medium").matches;this.isSmallOrMicro=!this.isMedium;this.mainHeight=((t=this.mainElement)===null||t===void 0?void 0:t.offsetHeight)||0;this.metabarHeight=((i=this.metabarElement)===null||i===void 0?void 0:i.offsetHeight)||0;this.logobarHeight=((s=this.logobarElement)===null||s===void 0?void 0:s.offsetHeight)||0;this.headerTop=this.element.offsetTop;this.headerHeight=this.metabarHeight+this.logobarHeight}));h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`);document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`);document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`);document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`)}));this.scrollListener()}))};this.localization=undefined;this.href="https://www.stadt-zuerich.ch";this.menuId="anchorNavMain";this.appNavId="anchorNavAppNav";this.searchId="anchorSearch";this.metanavId="anchorNavMeta";this.languageId="anchorNavLang";this.logoType="default";this.menuItems=[];this._menuItems=undefined;this.menuBackLabel=undefined;this.metanavItems=[];this._metanavItems=undefined;this.userSpecificMetanavItemsNotLoggedIn=[];this._userSpecificMetanavItemsNotLoggedIn=[];this.appNavItems=[];this._appNavItems=undefined;this.userSpecificMetanavItemsEndpoint=undefined;this.languageActive=undefined;this.languages=[];this._languages=undefined;this.languagePreventUrlchange=false;this.languageStay=false;this.hideMetabar=false;this.searchAction=undefined;this.searchFieldName="q";this.searchValue="";this.sticky="default";this.loginErrorMessage="";this.logoAnalyticsId=undefined;this.hideLogo=false;this.headerHeight=undefined;this.paddingTop=undefined;this.stickyActive=false;this.flyoutOpen=false;this.flyoutSearchOpen=false;this.searchFilled=undefined;this.fixed=false;this.fixedTransition=false;this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=false;this.userSpecificMetanavItemsLoggedIn=[];this.combinedMetanavItems=[];this.isSmallOrMicro=undefined}handleKeydown(t){if(t.key==="Escape"){this.flyoutOpen=false;this.flyoutSearchOpen=false}}flyoutCloseClicked(){this.flyoutSearchOpen=false;this.updatePosition()}async flyoutOpenWatcher(t){if(!t){this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=null;this.flyoutOpenedByMetanavItem=false;document.body.classList.remove(x);this.enableSiblings();if(this.trap){this.trap.deactivate()}}else{document.body.classList.add(x);this.disableSiblings();if(this.trap){this.trap.activate()}}}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0;await this.waitForNextRender();this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen){return}const t=()=>{this.stickyActive=true;document.documentElement.style.setProperty("--stzh-header-is-stuck","1");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")};const i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1");this.stickyActive=false};if(this.sticky==="disabled"){i()}else if(this.sticky==="always-full"){t()}else if(this.sticky==="always"){if(this.belowStayStickyPoint){t()}else{i()}}else{if(this.scrollingUp&&this.belowStayStickyPoint){if(!this.stickyActive&&this.belowStartStickyPoint){t()}}else{if(this.stickyActive&&this.belowStayStickyPoint){i()}else{i()}}}}scrollListener(){if(this.sticky==="disabled"){return}n((()=>{this.currentScrollY=window.scrollY;this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY;this.lastScrollY=this.currentScrollY;this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight;this.belowStartStickyPoint=this.currentScrollY>this.headerHeight;this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||this.sticky==="always"&&this.belowStayStickyPoint||this.sticky==="always-full";this.headerOverlap=(this.headerTop-this.currentScrollY)/-1;this.hideLogo=this.sticky!=="always-full"&&this.isMedium&&this.headerOverlap>1}));h((()=>{this.updatePosition()}))}searchValueWatcher(t){this.searchFilled=t!==""}menuItemsWatcher(t){if(typeof t==="string"){this._menuItems=JSON.parse(t)}else{this._menuItems=t}this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){if(typeof t==="string"){this._metanavItems=JSON.parse(t)}else{this._metanavItems=t}this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t)));this.combineMetanavItems()}appNavItemsWatcher(t){if(typeof t==="string"){this._appNavItems=JSON.parse(t)}else{this._appNavItems=t}}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t;this.combineMetanavItems()}languagesWatcher(t){if(typeof t==="string"){this._languages=JSON.parse(t)}else{this._languages=t}}getSiblings(){if(!this._parentElement){return[]}return Array.from(this._parentElement.children).filter((t=>t!==this.element))}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement){Object.assign(this.menunavElement.style,{height:null})}else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=true;this.lastOpener=t.currentTarget;this.openSubmenuElement=this.element.querySelector(`#${i.id}`);this.currentOpenMenuItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&l(this.openSubmenuElement)[0];t===null||t===void 0?void 0:t.focus();this.resizeMenunavElement()}))}async closeMenuItem(t=true){this.openSubmenuElement=null;this.currentOpenMenuItem=null;await this.waitForNextRender();if(t){requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null;this.resizeMenunavElement()}))}}async openMetanavItem(t,i){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenMetanavItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`);const s=t&&l(t)[0];s===null||s===void 0?void 0:s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async openLanguage(t){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenLanguage=true;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages");const i=t&&l(t)[0];i===null||i===void 0?void 0:i.focus()}))}async closeLanguage(){this.currentOpenLanguage=false;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(!this.userSpecificMetanavItemsEndpoint){return}try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json();this.combineMetanavItems()}catch(t){this.combineMetanavItems(true);console.error("Error fetching data:",t);if(this.loginErrorMessage){document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}}combineMetanavItems(t=false){if(!this.userSpecificMetanavItemsEndpoint||t){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn]}else{this.combinedMetanavItems=[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}}async componentWillLoad(){this.menuItemsWatcher(this.menuItems);this.metanavItemsWatcher(this.metanavItems);this.appNavItemsWatcher(this.appNavItems);this.languagesWatcher(this.languages);this.searchValueWatcher(this.searchValue);this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn);this.requestUserSpecificMetanavItems();if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header")}}componentDidRender(){if(this.renderPromiseResolve){this.renderPromiseResolve()}if(this.flyoutElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutElement)}if(this.flyoutSearchElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutSearchElement)}}componentDidLoad(){this.trap=v(this.element,Object.assign(Object.assign({},c()),{initialFocus:false}));this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize);if(this.flyoutElement){this.flyoutResizeObserver.observe(this.flyoutElement)}}connectedCallback(){this._parentElement=this.element.parentElement;this.resizeObserver=new ResizeObserver(this.handleResize);this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(false);(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.flyoutResizeObserver)===null||i===void 0?void 0:i.disconnect()}render(){var t,i,r,n,h,f,u;const l=o(this.element,"metanav-before");const v=o(this.element,"metanav-after");const c={"stzh-header":true,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo,"stzh-header--has-empty-metabar-mobile":!l&&!v&&this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length===0&&this._menuItems.length===0&&(this._languages.length===0||this._languages.length>0&&!this.languageStay)&&!this.searchAction,"stzh-header--has-empty-metabar":!l&&!v&&this._metanavItems.length===0&&this._menuItems.length===0&&this._languages.length===0&&!this.searchAction,[`stzh-header--sticky-${this.sticky}`]:!!this.sticky};const d=this.languageActive||window.stzhComponents.utils.getLocale(this.element);const m=((t=this._languages)===null||t===void 0?void 0:t.find((({value:t})=>t===d)))||((i=this._languages)===null||i===void 0?void 0:i[0])||null;const p=(t,i,e)=>{var r;const n=((r=t.items)===null||r===void 0?void 0:r.length)>0||t.itemButton||!t.href?"button":"a";return s(n,Object.assign({},e,{id:t.id+"-button",href:n==="a"&&t.href,target:n==="a"&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":true,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),s("span",{class:{"stzh-header__metanav-item-text":true,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},s("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),s("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&s("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&s("stzh-icon",{class:`stzh-header__metanav-icon ${t.iconOpen?"is-close":""}`,name:t.icon}),t.iconOpen&&s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&s("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:typeof t.badgeType==="undefined"?"error":t.badgeType})))};return s(e,null,s("header",{class:c},s("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this.isSmallOrMicro&&this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav-bottom"},s("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})),s("div",{class:"stzh-header__inner"},s("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},s("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},s("div",{class:"stzh-header__logobar-logo"},s("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},s("slot",{name:"logo"}))),s("div",{class:"stzh-header__logobar-decoration"})),!this.hideMetabar&&s("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},s("div",{class:"stzh-header__metabar-inner"},s("slot",{name:"menu-before"}),this._menuItems.length>0&&s("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},s("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),s("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),s("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&s("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},s("label",{class:"stzh-header__search"},s("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),s("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),s("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&s("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},s("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),s("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),s("slot",{name:"menu-after"}),!this.isSmallOrMicro&&this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav"},s("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})),s("div",{class:"stzh-header__metabar-nav",id:this.metanavId},s("slot",{name:"metanav-before"}),this.combinedMetanavItems.map((t=>{var i,e;return((i=t.items)===null||i===void 0?void 0:i.length)>0||t.itemButton?s(a,null,p(t,{"is-popover-mobile":true},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}}),s("stzh-popover",{class:{"stzh-header__metanav-popover":true},placement:"bottom-end",distance:20,variant:t.variant,size:typeof t.size==="undefined"?"large":t.size},p(t,{"is-popover-desktop":true},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),s("div",{slot:"content"},((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("stzh-menu",null,t.items.map((i=>s("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":true,"is-heavy":typeof t.importantSubmenu==="undefined"||t.importantSubmenu},size:typeof t.size==="undefined"?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&s("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label))):p(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}})})),((r=this._languages)===null||r===void 0?void 0:r.length)>0&&s(a,null,s("h2",{id:this.languageId,class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&s("button",{class:{"stzh-header__metanav-item":true,"is-popover-mobile":true,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{if(this.currentOpenLanguage){this.closeLanguage()}else{this.openLanguage(t)}}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},s("button",{class:{"stzh-header__metanav-item":true,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("div",{slot:"content"},s("stzh-menu",null,this._languages.map((t=>s("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(m===null||m===void 0?void 0:m.value)===t.value,href:t.value,onClick:i=>this.handleLanguageClick(i,t)},t.text))))))),s("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||((n=this.combinedMetanavItems)===null||n===void 0?void 0:n.length)>0)&&s("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__menu"},s("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},s("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,e;return s("li",{class:{"stzh-header__menu-list-item":true,"is-open":t===this.currentOpenMenuItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},s("li",{class:"stzh-header__menu-list-item is-backlink"},s("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},s("stzh-icon",{name:"angle-left"}),s("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),(((h=this.combinedMetanavItems)===null||h===void 0?void 0:h.length)>0||((f=this._languages)===null||f===void 0?void 0:f.length)>0)&&s("div",{class:"stzh-header__menu-metanav"},s("nav",{class:"stzh-header__menu-metanav-nav"},s("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,e,r;return s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":t===this.currentOpenMetanavItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):s("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,t.label),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:(r=this.localization.closeMetanavMenuLabel)===null||r===void 0?void 0:r.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),s("span",{class:"stzh-header__menu-metanav-item-text"},s("span",null,t.label),t.counter!==undefined&&t.counter>0&&s("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},s("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label)))))})),((u=this._languages)===null||u===void 0?void 0:u.length)>0&&s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":this.currentOpenLanguage}},s("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},s("span",null,m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),s("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,this.localization.dialogLanguageTitle),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:t.value,onClick:i=>this.handleLanguageClick(i,t)},s("span",null,t.text),(m===null||m===void 0?void 0:m.value)===t.value&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&s("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__flyout-search-main"},s("slot",{name:"search"})))))}get element(){return r(this)}static get watchers(){return{flyoutOpen:["flyoutOpenWatcher","fixedWatcher"],flyoutSearchOpen:["flyoutOpenWatcher","fixedWatcher"],fixed:["fixedWatcher"],headerHeight:["fixedWatcher"],sticky:["stickyWatcher"],searchValue:["searchValueWatcher"],menuItems:["menuItemsWatcher"],metanavItems:["metanavItemsWatcher"],appNavItems:["appNavItemsWatcher"],userSpecificMetanavItemsNotLoggedIn:["userSpecificMetanavItemsNotLoggedInWatcher"],languages:["languagesWatcher"]}}};w.style=b;function y(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var i=0;i<=60;++i){t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m");t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m")}t.WGS84=t["EPSG:4326"];t["EPSG:3785"]=t["EPSG:3857"];t.GOOGLE=t["EPSG:3857"];t["EPSG:900913"]=t["EPSG:3857"];t["EPSG:102113"]=t["EPSG:3857"]}var k=1;var E=2;var N=3;var C=4;var I=5;var S=6378137;var O=6356752.314;var T=.0066943799901413165;var A=484813681109536e-20;var R=Math.PI/2;var P=.16666666666666666;var L=.04722222222222222;var D=.022156084656084655;var F=1e-10;var W=.017453292519943295;var G=57.29577951308232;var j=Math.PI/4;var V=Math.PI*2;var U=3.14159265359;var q={};q.greenwich=0;q.lisbon=-9.131906111111;q.paris=2.337229166667;q.bogota=-74.080916666667;q.madrid=-3.687938888889;q.rome=12.452333333333;q.bern=7.439583333333;q.jakarta=106.807719444444;q.ferro=-17.666666666667;q.brussels=4.367975;q.stockholm=18.058277777778;q.athens=23.7163375;q.oslo=10.722916666667;const X={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.01},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var Y=/[\s_\-\/\(\)]/g;function B(t,i){if(t[i]){return t[i]}var s=Object.keys(t);var e=i.toLowerCase().replace(Y,"");var r=-1;var n,h;while(++r<s.length){n=s[r];h=n.toLowerCase().replace(Y,"");if(h===e){return t[n]}}}function H(t){var i={};var s=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");s.push(true);t[s[0].toLowerCase()]=s[1];return t}),{});var e,r,n;var h={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*W},lat_1:function(t){i.lat1=t*W},lat_2:function(t){i.lat2=t*W},lat_ts:function(t){i.lat_ts=t*W},lon_0:function(t){i.long0=t*W},lon_1:function(t){i.long1=t*W},lon_2:function(t){i.long2=t*W},alpha:function(t){i.alpha=parseFloat(t)*W},gamma:function(t){i.rectified_grid_angle=parseFloat(t)},lonc:function(t){i.longc=t*W},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r:function(t){i.a=i.b=parseFloat(t)},r_a:function(){i.R_A=true},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=true},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var s=B(X,t);if(s){i.to_meter=s.to_meter}},from_greenwich:function(t){i.from_greenwich=t*W},pm:function(t){var s=B(q,t);i.from_greenwich=(s?s:parseFloat(t))*W},nadgrids:function(t){if(t==="@null"){i.datumCode="none"}else{i.nadgrids=t}},axis:function(t){var s="ewnsud";if(t.length===3&&s.indexOf(t.substr(0,1))!==-1&&s.indexOf(t.substr(1,1))!==-1&&s.indexOf(t.substr(2,1))!==-1){i.axis=t}},approx:function(){i.approx=true}};for(e in s){r=s[e];if(e in h){n=h[e];if(typeof n==="function"){n(r)}else{i[n]=r}}else{i[e]=r}}if(typeof i.datumCode==="string"&&i.datumCode!=="WGS84"){i.datumCode=i.datumCode.toLowerCase()}return i}var J=1;var Z=2;var $=3;var K=4;var Q=5;var tt=-1;var it=/\s/;var st=/[A-Za-z]/;var et=/[A-Za-z84_]/;var rt=/[,\]]/;var nt=/[\d\.E\-\+]/;function ht(t){if(typeof t!=="string"){throw new Error("not a string")}this.text=t.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=J}ht.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==K){while(it.test(t)){if(this.place>=this.text.length){return}t=this.text[this.place++]}}switch(this.state){case J:return this.neutral(t);case Z:return this.keyword(t);case K:return this.quoted(t);case Q:return this.afterquote(t);case $:return this.number(t);case tt:return}};ht.prototype.afterquote=function(t){if(t==='"'){this.word+='"';this.state=K;return}if(rt.test(t)){this.word=this.word.trim();this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)};ht.prototype.afterItem=function(t){if(t===","){if(this.word!==null){this.currentObject.push(this.word)}this.word=null;this.state=J;return}if(t==="]"){this.level--;if(this.word!==null){this.currentObject.push(this.word);this.word=null}this.state=J;this.currentObject=this.stack.pop();if(!this.currentObject){this.state=tt}return}};ht.prototype.number=function(t){if(nt.test(t)){this.word+=t;return}if(rt.test(t)){this.word=parseFloat(this.word);this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)};ht.prototype.quoted=function(t){if(t==='"'){this.state=Q;return}this.word+=t;return};ht.prototype.keyword=function(t){if(et.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word);this.level++;if(this.root===null){this.root=i}else{this.currentObject.push(i)}this.stack.push(this.currentObject);this.currentObject=i;this.state=J;return}if(rt.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)};ht.prototype.neutral=function(t){if(st.test(t)){this.word=t;this.state=Z;return}if(t==='"'){this.word="";this.state=K;return}if(nt.test(t)){this.word=t;this.state=$;return}if(rt.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)};ht.prototype.output=function(){while(this.place<this.text.length){this.readCharicter()}if(this.state===tt){return this.root}throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function at(t){var i=new ht(t);return i.output()}function ot(t,i,s){if(Array.isArray(i)){s.unshift(i);i=null}var e=i?{}:t;var r=s.reduce((function(t,i){ft(i,t);return t}),e);if(i){t[i]=r}}function ft(t,i){if(!Array.isArray(t)){i[t]=true;return}var s=t.shift();if(s==="PARAMETER"){s=t.shift()}if(t.length===1){if(Array.isArray(t[0])){i[s]={};ft(t[0],i[s]);return}i[s]=t[0];return}if(!t.length){i[s]=true;return}if(s==="TOWGS84"){i[s]=t;return}if(s==="AXIS"){if(!(s in i)){i[s]=[]}i[s].push(t);return}if(!Array.isArray(s)){i[s]={}}var e;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[s]={name:t[0].toLowerCase(),convert:t[1]};if(t.length===3){ft(t[2],i[s])}return;case"SPHEROID":case"ELLIPSOID":i[s]={name:t[0],a:t[1],rf:t[2]};if(t.length===4){ft(t[3],i[s])}return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]];ot(i,s,t);return;default:e=-1;while(++e<t.length){if(!Array.isArray(t[e])){return ft(t,i[s])}}return ot(i,s,t)}}var ut=.017453292519943295;function lt(t,i){var s=i[0];var e=i[1];if(!(s in t)&&e in t){t[s]=t[e];if(i.length===3){t[s]=i[2](t[s])}}}function vt(t){return t*ut}function ct(t){if(t.type==="GEOGCS"){t.projName="longlat"}else if(t.type==="LOCAL_CS"){t.projName="identity";t.local=true}else{if(typeof t.PROJECTION==="object"){t.projName=Object.keys(t.PROJECTION)[0]}else{t.projName=t.PROJECTION}}if(t.AXIS){var i="";for(var s=0,e=t.AXIS.length;s<e;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];if(r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"){i+="n"}else if(r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"){i+="s"}else if(r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"){i+="e"}else if(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west"){i+="w"}}if(i.length===2){i+="u"}if(i.length===3){t.axis=i}}if(t.UNIT){t.units=t.UNIT.name.toLowerCase();if(t.units==="metre"){t.units="meter"}if(t.UNIT.convert){if(t.type==="GEOGCS"){if(t.DATUM&&t.DATUM.SPHEROID){t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a}}else{t.to_meter=t.UNIT.convert}}}var n=t.GEOGCS;if(t.type==="GEOGCS"){n=t}if(n){if(n.DATUM){t.datumCode=n.DATUM.name.toLowerCase()}else{t.datumCode=n.name.toLowerCase()}if(t.datumCode.slice(0,2)==="d_"){t.datumCode=t.datumCode.slice(2)}if(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949"){t.datumCode="nzgd49"}if(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984"){if(t.PROJECTION==="Mercator_Auxiliary_Sphere"){t.sphere=true}t.datumCode="wgs84"}if(t.datumCode.slice(-6)==="_ferro"){t.datumCode=t.datumCode.slice(0,-6)}if(t.datumCode.slice(-8)==="_jakarta"){t.datumCode=t.datumCode.slice(0,-8)}if(~t.datumCode.indexOf("belge")){t.datumCode="rnb72"}if(n.DATUM&&n.DATUM.SPHEROID){t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk");if(t.ellps.toLowerCase().slice(0,13)==="international"){t.ellps="intl"}t.a=n.DATUM.SPHEROID.a;t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)}if(n.DATUM&&n.DATUM.TOWGS84){t.datum_params=n.DATUM.TOWGS84}if(~t.datumCode.indexOf("osgb_1936")){t.datumCode="osgb36"}if(~t.datumCode.indexOf("osni_1952")){t.datumCode="osni52"}if(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965")){t.datumCode="ire65"}if(t.datumCode==="ch1903+"){t.datumCode="ch1903"}if(~t.datumCode.indexOf("israel")){t.datumCode="isr93"}}if(t.b&&!isFinite(t.b)){t.b=t.a}function h(i){var s=t.to_meter||1;return i*s}var a=function(i){return lt(t,i)};var o=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",vt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",vt],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",vt],["lat0","latitude_of_origin",vt],["lat0","standard_parallel_1",vt],["lat1","standard_parallel_1",vt],["lat2","standard_parallel_2",vt],["azimuth","Azimuth"],["alpha","azimuth",vt],["srsCode","name"]];o.forEach(a);if(!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")){t.long0=t.longc}if(!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")){t.lat0=vt(t.lat1>0?90:-90);t.lat_ts=t.lat1}else if(!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"){t.lat_ts=t.lat0;t.lat0=vt(t.lat0>0?90:-90)}}function dt(t){var i=at(t);var s=i.shift();var e=i.shift();i.unshift(["name",e]);i.unshift(["type",s]);var r={};ft(i,r);ct(r);return r}function mt(t){var i=this;if(arguments.length===2){var s=arguments[1];if(typeof s==="string"){if(s.charAt(0)==="+"){mt[t]=H(arguments[1])}else{mt[t]=dt(arguments[1])}}else{mt[t]=s}}else if(arguments.length===1){if(Array.isArray(t)){return t.map((function(t){if(Array.isArray(t)){mt.apply(i,t)}else{mt(t)}}))}else if(typeof t==="string"){if(t in mt){return mt[t]}}else if("EPSG"in t){mt["EPSG:"+t.EPSG]=t}else if("ESRI"in t){mt["ESRI:"+t.ESRI]=t}else if("IAU2000"in t){mt["IAU2000:"+t.IAU2000]=t}else{console.log(t)}return}}y(mt);function pt(t){return typeof t==="string"}function zt(t){return t in mt}var Mt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _t(t){return Mt.some((function(i){return t.indexOf(i)>-1}))}var gt=["3857","900913","3785","102113"];function bt(t){var i=B(t,"authority");if(!i){return}var s=B(i,"epsg");return s&>.indexOf(s)>-1}function xt(t){var i=B(t,"extension");if(!i){return}return B(i,"proj4")}function wt(t){return t[0]==="+"}function yt(t){if(pt(t)){if(zt(t)){return mt[t]}if(_t(t)){var i=dt(t);if(bt(i)){return mt["EPSG:3857"]}var s=xt(i);if(s){return H(s)}return i}if(wt(t)){return H(t)}}else{return t}}function kt(t,i){t=t||{};var s,e;if(!i){return t}for(e in i){s=i[e];if(s!==undefined){t[e]=s}}return t}function Et(t,i,s){var e=t*i;return s/Math.sqrt(1-e*e)}function Nt(t){return t<0?-1:1}function Ct(t){return Math.abs(t)<=U?t:t-Nt(t)*V}function It(t,i,s){var e=t*s;var r=.5*t;e=Math.pow((1-e)/(1+e),r);return Math.tan(.5*(R-i))/e}function St(t,i){var s=.5*t;var e,r;var n=R-2*Math.atan(i);for(var h=0;h<=15;h++){e=t*Math.sin(n);r=R-2*Math.atan(i*Math.pow((1-e)/(1+e),s))-n;n+=r;if(Math.abs(r)<=1e-10){return n}}return-9999}function Ot(){var t=this.b/this.a;this.es=1-t*t;if(!("x0"in this)){this.x0=0}if(!("y0"in this)){this.y0=0}this.e=Math.sqrt(this.es);if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}else{if(!this.k0){if(this.k){this.k0=this.k}else{this.k0=1}}}}function Tt(t){var i=t.x;var s=t.y;if(s*G>90&&s*G<-90&&i*G>180&&i*G<-180){return null}var e,r;if(Math.abs(Math.abs(s)-R)<=F){return null}else{if(this.sphere){e=this.x0+this.a*this.k0*Ct(i-this.long0);r=this.y0+this.a*this.k0*Math.log(Math.tan(j+.5*s))}else{var n=Math.sin(s);var h=It(this.e,s,n);e=this.x0+this.a*this.k0*Ct(i-this.long0);r=this.y0-this.a*this.k0*Math.log(h)}t.x=e;t.y=r;return t}}function At(t){var i=t.x-this.x0;var s=t.y-this.y0;var e,r;if(this.sphere){r=R-2*Math.atan(Math.exp(-s/(this.a*this.k0)))}else{var n=Math.exp(-s/(this.a*this.k0));r=St(this.e,n);if(r===-9999){return null}}e=Ct(this.long0+i/(this.a*this.k0));t.x=e;t.y=r;return t}var Rt=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Pt={init:Ot,forward:Tt,inverse:At,names:Rt};function Lt(){}function Dt(t){return t}var Ft=["longlat","identity"];const Wt={init:Lt,forward:Dt,inverse:Dt,names:Ft};var Gt=[Pt,Wt];var jt={};var Vt=[];function Ut(t,i){var s=Vt.length;if(!t.names){console.log(i);return true}Vt[s]=t;t.names.forEach((function(t){jt[t.toLowerCase()]=s}));return this}function qt(t){if(!t){return false}var i=t.toLowerCase();if(typeof jt[i]!=="undefined"&&Vt[jt[i]]){return Vt[jt[i]]}}function Xt(){Gt.forEach(Ut)}const Yt={start:Xt,add:Ut,get:qt};var Bt={};Bt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Bt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Bt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Bt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Bt.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"};Bt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Bt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Bt.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"};Bt.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Bt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Bt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Bt.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"};Bt.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Bt.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"};Bt.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."};Bt.clrk80ign={a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Bt.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"};Bt.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Bt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Bt.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"};Bt.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"};Bt.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"};Bt.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"};Bt.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"};Bt.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Bt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Bt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Bt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Bt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Bt.hough={a:6378270,rf:297,ellipseName:"Hough"};Bt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Bt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Bt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Bt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Bt.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"};Bt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Bt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Bt.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"};Bt.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"};Bt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Bt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Bt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Ht=Bt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Bt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Jt(t,i,s,e){var r=t*t;var n=i*i;var h=(r-n)/r;var a=0;if(e){t*=1-h*(P+h*(L+h*D));r=t*t;h=0}else{a=Math.sqrt(h)}var o=(r-n)/n;return{es:h,e:a,ep2:o}}function Zt(t,i,s,e,r){if(!t){var n=B(Bt,e);if(!n){n=Ht}t=n.a;i=n.b;s=n.rf}if(s&&!i){i=(1-1/s)*t}if(s===0||Math.abs(t-i)<F){r=true;i=t}return{a:t,b:i,rf:s,sphere:r}}var $t={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};for(var Kt in $t){var Qt=$t[Kt];$t[Qt.datumName]=Qt}function ti(t,i,s,e,r,n,h){var a={};if(t===undefined||t==="none"){a.datum_type=I}else{a.datum_type=C}if(i){a.datum_params=i.map(parseFloat);if(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0){a.datum_type=k}if(a.datum_params.length>3){if(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0){a.datum_type=E;a.datum_params[3]*=A;a.datum_params[4]*=A;a.datum_params[5]*=A;a.datum_params[6]=a.datum_params[6]/1e6+1}}}if(h){a.datum_type=N;a.grids=h}a.a=s;a.b=e;a.es=r;a.ep2=n;return a}var ii={};function si(t,i){var s=new DataView(i);var e=hi(s);var r=ai(s,e);var n=fi(s,r,e);var h={header:r,subgrids:n};ii[t]=h;return h}function ei(t){if(t===undefined){return null}var i=t.split(",");return i.map(ri)}function ri(t){if(t.length===0){return null}var i=t[0]==="@";if(i){t=t.slice(1)}if(t==="null"){return{name:"null",mandatory:!i,grid:null,isNull:true}}return{name:t,mandatory:!i,grid:ii[t]||null,isNull:false}}function ni(t){return t/3600*Math.PI/180}function hi(t){var i=t.getInt32(8,false);if(i===11){return false}i=t.getInt32(8,true);if(i!==11){console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian")}return true}function ai(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:oi(t,56,56+8).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}function oi(t,i,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,s)))}function fi(t,i,s){var e=176;var r=[];for(var n=0;n<i.nSubgrids;n++){var h=li(t,e,s);var a=vi(t,e,h,s);var o=Math.round(1+(h.upperLongitude-h.lowerLongitude)/h.longitudeInterval);var f=Math.round(1+(h.upperLatitude-h.lowerLatitude)/h.latitudeInterval);r.push({ll:[ni(h.lowerLongitude),ni(h.lowerLatitude)],del:[ni(h.longitudeInterval),ni(h.latitudeInterval)],lim:[o,f],count:h.gridNodeCount,cvs:ui(a)});e+=176+h.gridNodeCount*16}return r}function ui(t){return t.map((function(t){return[ni(t.longitudeShift),ni(t.latitudeShift)]}))}function li(t,i,s){return{name:oi(t,i+8,i+16).trim(),parent:oi(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,s),upperLatitude:t.getFloat64(i+88,s),lowerLongitude:t.getFloat64(i+104,s),upperLongitude:t.getFloat64(i+120,s),latitudeInterval:t.getFloat64(i+136,s),longitudeInterval:t.getFloat64(i+152,s),gridNodeCount:t.getInt32(i+168,s)}}function vi(t,i,s,e){var r=i+176;var n=16;var h=[];for(var a=0;a<s.gridNodeCount;a++){var o={latitudeShift:t.getFloat32(r+a*n,e),longitudeShift:t.getFloat32(r+a*n+4,e),latitudeAccuracy:t.getFloat32(r+a*n+8,e),longitudeAccuracy:t.getFloat32(r+a*n+12,e)};h.push(o)}return h}function ci(t,i){if(!(this instanceof ci)){return new ci(t)}i=i||function(t){if(t){throw t}};var s=yt(t);if(typeof s!=="object"){i("Could not parse to valid json: "+t);return}var e=ci.projections.get(s.projName);if(!e){i("Could not get projection name from: "+t);return}if(s.datumCode&&s.datumCode!=="none"){var r=B($t,s.datumCode);if(r){s.datum_params=s.datum_params||(r.towgs84?r.towgs84.split(","):null);s.ellps=r.ellipse;s.datumName=r.datumName?r.datumName:s.datumCode}}s.k0=s.k0||1;s.axis=s.axis||"enu";s.ellps=s.ellps||"wgs84";s.lat1=s.lat1||s.lat0;var n=Zt(s.a,s.b,s.rf,s.ellps,s.sphere);var h=Jt(n.a,n.b,n.rf,s.R_A);var a=ei(s.nadgrids);var o=s.datum||ti(s.datumCode,s.datum_params,n.a,n.b,h.es,h.ep2,a);kt(this,s);kt(this,e);this.a=n.a;this.b=n.b;this.rf=n.rf;this.sphere=n.sphere;this.es=h.es;this.e=h.e;this.ep2=h.ep2;this.datum=o;this.init();i(null,this)}ci.projections=Yt;ci.projections.start();function di(t,i){if(t.datum_type!==i.datum_type){return false}else if(t.a!==i.a||Math.abs(t.es-i.es)>5e-11){return false}else if(t.datum_type===k){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]}else if(t.datum_type===E){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]}else{return true}}function mi(t,i,s){var e=t.x;var r=t.y;var n=t.z?t.z:0;var h;var a;var o;var f;if(r<-R&&r>-1.001*R){r=-R}else if(r>R&&r<1.001*R){r=R}else if(r<-R){return{x:-Infinity,y:-Infinity,z:t.z}}else if(r>R){return{x:Infinity,y:Infinity,z:t.z}}if(e>Math.PI){e-=2*Math.PI}a=Math.sin(r);f=Math.cos(r);o=a*a;h=s/Math.sqrt(1-i*o);return{x:(h+n)*f*Math.cos(e),y:(h+n)*f*Math.sin(e),z:(h*(1-i)+n)*a}}function pi(t,i,s,e){var r=1e-12;var n=r*r;var h=30;var a;var o;var f;var u;var l;var v;var c;var d;var m;var p;var z;var M;var _;var g=t.x;var b=t.y;var x=t.z?t.z:0;var w;var y;var k;a=Math.sqrt(g*g+b*b);o=Math.sqrt(g*g+b*b+x*x);if(a/s<r){w=0;if(o/s<r){y=R;k=-e;return{x:t.x,y:t.y,z:t.z}}}else{w=Math.atan2(b,g)}f=x/o;u=a/o;l=1/Math.sqrt(1-i*(2-i)*u*u);d=u*(1-i)*l;m=f*l;_=0;do{_++;c=s/Math.sqrt(1-i*m*m);k=a*d+x*m-c*(1-i*m*m);v=i*c/(c+k);l=1/Math.sqrt(1-v*(2-v)*u*u);p=u*(1-v)*l;z=f*l;M=z*d-p*m;d=p;m=z}while(M*M>n&&_<h);y=Math.atan(z/Math.abs(p));return{x:w,y,z:k}}function zi(t,i,s){if(i===k){return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]}}else if(i===E){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];return{x:f*(t.x-o*t.y+a*t.z)+e,y:f*(o*t.x+t.y-h*t.z)+r,z:f*(-a*t.x+h*t.y+t.z)+n}}}function Mi(t,i,s){if(i===k){return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]}}else if(i===E){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];var u=(t.x-e)/f;var l=(t.y-r)/f;var v=(t.z-n)/f;return{x:u+o*l-a*v,y:-o*u+l+h*v,z:a*u-h*l+v}}}function _i(t){return t===k||t===E}function gi(t,i,s){if(di(t,i)){return s}if(t.datum_type===I||i.datum_type===I){return s}var e=t.a;var r=t.es;if(t.datum_type===N){var n=bi(t,false,s);if(n!==0){return undefined}e=S;r=T}var h=i.a;var a=i.b;var o=i.es;if(i.datum_type===N){h=S;a=O;o=T}if(r===o&&e===h&&!_i(t.datum_type)&&!_i(i.datum_type)){return s}s=mi(s,r,e);if(_i(t.datum_type)){s=zi(s,t.datum_type,t.datum_params)}if(_i(i.datum_type)){s=Mi(s,i.datum_type,i.datum_params)}s=pi(s,o,h,a);if(i.datum_type===N){var f=bi(i,true,s);if(f!==0){return undefined}}return s}function bi(t,i,s){if(t.grids===null||t.grids.length===0){console.log("Grid shift grids not found");return-1}var e={x:-s.x,y:s.y};var r={x:Number.NaN,y:Number.NaN};var n=[];t:for(var h=0;h<t.grids.length;h++){var a=t.grids[h];n.push(a.name);if(a.isNull){r=e;break}if(a.grid===null){if(a.mandatory){console.log("Unable to find mandatory grid '"+a.name+"'");return-1}continue}var o=a.grid.subgrids;for(var f=0,u=o.length;f<u;f++){var l=o[f];var v=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4;var c=l.ll[0]-v;var d=l.ll[1]-v;var m=l.ll[0]+(l.lim[0]-1)*l.del[0]+v;var p=l.ll[1]+(l.lim[1]-1)*l.del[1]+v;if(d>e.y||c>e.x||p<e.y||m<e.x){continue}r=xi(e,i,l);if(!isNaN(r.x)){break t}}}if(isNaN(r.x)){console.log("Failed to find a grid shift table for location '"+-e.x*G+" "+e.y*G+" tried: '"+n+"'");return-1}s.x=-r.x;s.y=r.y;return 0}function xi(t,i,s){var e={x:Number.NaN,y:Number.NaN};if(isNaN(t.x)){return e}var r={x:t.x,y:t.y};r.x-=s.ll[0];r.y-=s.ll[1];r.x=Ct(r.x-Math.PI)+Math.PI;var n=wi(r,s);if(i){if(isNaN(n.x)){return e}n.x=r.x-n.x;n.y=r.y-n.y;var h=9,a=1e-12;var o,f;do{f=wi(n,s);if(isNaN(f.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:r.x-(f.x+n.x),y:r.y-(f.y+n.y)};n.x+=o.x;n.y+=o.y}while(h--&&Math.abs(o.x)>a&&Math.abs(o.y)>a);if(h<0){console.log("Inverse grid shift iterator failed to converge.");return e}e.x=Ct(n.x+s.ll[0]);e.y=n.y+s.ll[1]}else{if(!isNaN(n.x)){e.x=t.x+n.x;e.y=t.y+n.y}}return e}function wi(t,i){var s={x:t.x/i.del[0],y:t.y/i.del[1]};var e={x:Math.floor(s.x),y:Math.floor(s.y)};var r={x:s.x-1*e.x,y:s.y-1*e.y};var n={x:Number.NaN,y:Number.NaN};var h;if(e.x<0||e.x>=i.lim[0]){return n}if(e.y<0||e.y>=i.lim[1]){return n}h=e.y*i.lim[0]+e.x;var a={x:i.cvs[h][0],y:i.cvs[h][1]};h++;var o={x:i.cvs[h][0],y:i.cvs[h][1]};h+=i.lim[0];var f={x:i.cvs[h][0],y:i.cvs[h][1]};h--;var u={x:i.cvs[h][0],y:i.cvs[h][1]};var l=r.x*r.y,v=r.x*(1-r.y),c=(1-r.x)*(1-r.y),d=(1-r.x)*r.y;n.x=c*a.x+v*o.x+d*u.x+l*f.x;n.y=c*a.y+v*o.y+d*u.y+l*f.y;return n}function yi(t,i,s){var e=s.x,r=s.y,n=s.z||0;var h,a,o;var f={};for(o=0;o<3;o++){if(i&&o===2&&s.z===undefined){continue}if(o===0){h=e;if("ew".indexOf(t.axis[o])!==-1){a="x"}else{a="y"}}else if(o===1){h=r;if("ns".indexOf(t.axis[o])!==-1){a="y"}else{a="x"}}else{h=n;a="z"}switch(t.axis[o]){case"e":f[a]=h;break;case"w":f[a]=-h;break;case"n":f[a]=h;break;case"s":f[a]=-h;break;case"u":if(s[a]!==undefined){f.z=h}break;case"d":if(s[a]!==undefined){f.z=-h}break;default:return null}}return f}function ki(t){var i={x:t[0],y:t[1]};if(t.length>2){i.z=t[2]}if(t.length>3){i.m=t[3]}return i}function Ei(t){Ni(t.x);Ni(t.y)}function Ni(t){if(typeof Number.isFinite==="function"){if(Number.isFinite(t)){return}throw new TypeError("coordinates must be finite numbers")}if(typeof t!=="number"||t!==t||!isFinite(t)){throw new TypeError("coordinates must be finite numbers")}}function Ci(t,i){return(t.datum.datum_type===k||t.datum.datum_type===E||t.datum.datum_type===N)&&i.datumCode!=="WGS84"||(i.datum.datum_type===k||i.datum.datum_type===E||i.datum.datum_type===N)&&t.datumCode!=="WGS84"}function Ii(t,i,s,e){var r;if(Array.isArray(s)){s=ki(s)}else{s={x:s.x,y:s.y,z:s.z,m:s.m}}var n=s.z!==undefined;Ei(s);if(t.datum&&i.datum&&Ci(t,i)){r=new ci("WGS84");s=Ii(t,r,s,e);t=r}if(e&&t.axis!=="enu"){s=yi(t,false,s)}if(t.projName==="longlat"){s={x:s.x*W,y:s.y*W,z:s.z||0}}else{if(t.to_meter){s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}}s=t.inverse(s);if(!s){return}}if(t.from_greenwich){s.x+=t.from_greenwich}s=gi(t.datum,i.datum,s);if(!s){return}if(i.from_greenwich){s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}}if(i.projName==="longlat"){s={x:s.x*G,y:s.y*G,z:s.z||0}}else{s=i.forward(s);if(i.to_meter){s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0}}}if(e&&i.axis!=="enu"){return yi(i,true,s)}if(s&&!n){delete s.z}return s}var Si=ci("WGS84");function Oi(t,i,s,e){var r,n,h;if(Array.isArray(s)){r=Ii(t,i,s,e)||{x:NaN,y:NaN};if(s.length>2){if(typeof t.name!=="undefined"&&t.name==="geocent"||typeof i.name!=="undefined"&&i.name==="geocent"){if(typeof r.z==="number"){return[r.x,r.y,r.z].concat(s.slice(3))}else{return[r.x,r.y,s[2]].concat(s.slice(3))}}else{return[r.x,r.y].concat(s.slice(2))}}else{return[r.x,r.y]}}else{n=Ii(t,i,s,e);h=Object.keys(s);if(h.length===2){return n}h.forEach((function(e){if(typeof t.name!=="undefined"&&t.name==="geocent"||typeof i.name!=="undefined"&&i.name==="geocent"){if(e==="x"||e==="y"||e==="z"){return}}else{if(e==="x"||e==="y"){return}}n[e]=s[e]}));return n}}function Ti(t){if(t instanceof ci){return t}if(t.oProj){return t.oProj}return ci(t)}function Ai(t,i,s){t=Ti(t);var e=false;var r;if(typeof i==="undefined"){i=t;t=Si;e=true}else if(typeof i.x!=="undefined"||Array.isArray(i)){s=i;i=t;t=Si;e=true}i=Ti(i);if(s){return Oi(t,i,s)}else{r={forward:function(s,e){return Oi(t,i,s,e)},inverse:function(s,e){return Oi(i,t,s,e)}};if(e){r.oProj=i}return r}}var Ri=6;var Pi="AJSAJS";var Li="AFAFAF";var Di=65;var Fi=73;var Wi=79;var Gi=86;var ji=90;const Vi={forward:Ui,inverse:qi,toPoint:Xi};function Ui(t,i){i=i||5;return $i(Hi({lat:t[1],lon:t[0]}),i)}function qi(t){var i=Ji(is(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat,i.lon,i.lat]}return[i.left,i.bottom,i.right,i.top]}function Xi(t){var i=Ji(is(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat]}return[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Yi(t){return t*(Math.PI/180)}function Bi(t){return 180*(t/Math.PI)}function Hi(t){var i=t.lat;var s=t.lon;var e=6378137;var r=.00669438;var n=.9996;var h;var a;var o,f,u,l,v;var c=Yi(i);var d=Yi(s);var m;var p;p=Math.floor((s+180)/6)+1;if(s===180){p=60}if(i>=56&&i<64&&s>=3&&s<12){p=32}if(i>=72&&i<84){if(s>=0&&s<9){p=31}else if(s>=9&&s<21){p=33}else if(s>=21&&s<33){p=35}else if(s>=33&&s<42){p=37}}h=(p-1)*6-180+3;m=Yi(h);a=r/(1-r);o=e/Math.sqrt(1-r*Math.sin(c)*Math.sin(c));f=Math.tan(c)*Math.tan(c);u=a*Math.cos(c)*Math.cos(c);l=Math.cos(c)*(d-m);v=e*((1-r/4-3*r*r/64-5*r*r*r/256)*c-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*c)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*c)-35*r*r*r/3072*Math.sin(6*c));var z=n*o*(l+(1-f+u)*l*l*l/6+(5-18*f+f*f+72*u-58*a)*l*l*l*l*l/120)+5e5;var M=n*(v+o*Math.tan(c)*(l*l/2+(5-f+9*u+4*u*u)*l*l*l*l/24+(61-58*f+f*f+600*u-330*a)*l*l*l*l*l*l/720));if(i<0){M+=1e7}return{northing:Math.round(M),easting:Math.round(z),zoneNumber:p,zoneLetter:Zi(i)}}function Ji(t){var i=t.northing;var s=t.easting;var e=t.zoneLetter;var r=t.zoneNumber;if(r<0||r>60){return null}var n=.9996;var h=6378137;var a=.00669438;var o;var f=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a));var u,l,v,c,d,m;var p;var z,M;var _=s-5e5;var g=i;if(e<"N"){g-=1e7}p=(r-1)*6-180+3;o=a/(1-a);m=g/n;z=m/(h*(1-a/4-3*a*a/64-5*a*a*a/256));M=z+(3*f/2-27*f*f*f/32)*Math.sin(2*z)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*z)+151*f*f*f/96*Math.sin(6*z);u=h/Math.sqrt(1-a*Math.sin(M)*Math.sin(M));l=Math.tan(M)*Math.tan(M);v=o*Math.cos(M)*Math.cos(M);c=h*(1-a)/Math.pow(1-a*Math.sin(M)*Math.sin(M),1.5);d=_/(u*n);var b=M-u*Math.tan(M)/c*(d*d/2-(5+3*l+10*v-4*v*v-9*o)*d*d*d*d/24+(61+90*l+298*v+45*l*l-252*o-3*v*v)*d*d*d*d*d*d/720);b=Bi(b);var x=(d-(1+2*l+v)*d*d*d/6+(5-2*v+28*l-3*v*v+8*o+24*l*l)*d*d*d*d*d/120)/Math.cos(M);x=p+Bi(x);var w;if(t.accuracy){var y=Ji({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:y.lat,right:y.lon,bottom:b,left:x}}else{w={lat:b,lon:x}}return w}function Zi(t){var i="Z";if(84>=t&&t>=72){i="X"}else if(72>t&&t>=64){i="W"}else if(64>t&&t>=56){i="V"}else if(56>t&&t>=48){i="U"}else if(48>t&&t>=40){i="T"}else if(40>t&&t>=32){i="S"}else if(32>t&&t>=24){i="R"}else if(24>t&&t>=16){i="Q"}else if(16>t&&t>=8){i="P"}else if(8>t&&t>=0){i="N"}else if(0>t&&t>=-8){i="M"}else if(-8>t&&t>=-16){i="L"}else if(-16>t&&t>=-24){i="K"}else if(-24>t&&t>=-32){i="J"}else if(-32>t&&t>=-40){i="H"}else if(-40>t&&t>=-48){i="G"}else if(-48>t&&t>=-56){i="F"}else if(-56>t&&t>=-64){i="E"}else if(-64>t&&t>=-72){i="D"}else if(-72>t&&t>=-80){i="C"}return i}function $i(t,i){var s="00000"+t.easting,e="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Ki(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,i)+e.substr(e.length-5,i)}function Ki(t,i,s){var e=Qi(s);var r=Math.floor(t/1e5);var n=Math.floor(i/1e5)%20;return ts(r,n,e)}function Qi(t){var i=t%Ri;if(i===0){i=Ri}return i}function ts(t,i,s){var e=s-1;var r=Pi.charCodeAt(e);var n=Li.charCodeAt(e);var h=r+t-1;var a=n+i;var o=false;if(h>ji){h=h-ji+Di-1;o=true}if(h===Fi||r<Fi&&h>Fi||(h>Fi||r<Fi)&&o){h++}if(h===Wi||r<Wi&&h>Wi||(h>Wi||r<Wi)&&o){h++;if(h===Fi){h++}}if(h>ji){h=h-ji+Di-1}if(a>Gi){a=a-Gi+Di-1;o=true}else{o=false}if(a===Fi||n<Fi&&a>Fi||(a>Fi||n<Fi)&&o){a++}if(a===Wi||n<Wi&&a>Wi||(a>Wi||n<Wi)&&o){a++;if(a===Fi){a++}}if(a>Gi){a=a-Gi+Di-1}var f=String.fromCharCode(h)+String.fromCharCode(a);return f}function is(t){if(t&&t.length===0){throw"MGRSPoint coverting from nothing"}var i=t.length;var s=null;var e="";var r;var n=0;while(!/[A-Z]/.test(r=t.charAt(n))){if(n>=2){throw"MGRSPoint bad conversion from: "+t}e+=r;n++}var h=parseInt(e,10);if(n===0||n+3>i){throw"MGRSPoint bad conversion from: "+t}var a=t.charAt(n++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O"){throw"MGRSPoint zone letter "+a+" not handled: "+t}s=t.substring(n,n+=2);var o=Qi(h);var f=ss(s.charAt(0),o);var u=es(s.charAt(1),o);while(u<rs(a)){u+=2e6}var l=i-n;if(l%2!==0){throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t}var v=l/2;var c=0;var d=0;var m,p,z,M,_;if(v>0){m=1e5/Math.pow(10,v);p=t.substring(n,n+v);c=parseFloat(p)*m;z=t.substring(n+v);d=parseFloat(z)*m}M=c+f;_=d+u;return{easting:M,northing:_,zoneLetter:a,zoneNumber:h,accuracy:m}}function ss(t,i){var s=Pi.charCodeAt(i-1);var e=1e5;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===Fi){s++}if(s===Wi){s++}if(s>ji){if(r){throw"Bad character: "+t}s=Di;r=true}e+=1e5}return e}function es(t,i){if(t>"V"){throw"MGRSPoint given invalid Northing "+t}var s=Li.charCodeAt(i-1);var e=0;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===Fi){s++}if(s===Wi){s++}if(s>Gi){if(r){throw"Bad character: "+t}s=Di;r=true}e+=1e5}return e}function rs(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0){return i}else{throw"Invalid zone letter: "+t}}function ns(t,i,s){if(!(this instanceof ns)){return new ns(t,i,s)}if(Array.isArray(t)){this.x=t[0];this.y=t[1];this.z=t[2]||0}else if(typeof t==="object"){this.x=t.x;this.y=t.y;this.z=t.z||0}else if(typeof t==="string"&&typeof i==="undefined"){var e=t.split(",");this.x=parseFloat(e[0],10);this.y=parseFloat(e[1],10);this.z=parseFloat(e[2],10)||0}else{this.x=t;this.y=i;this.z=s||0}console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}ns.fromMGRS=function(t){return new ns(Xi(t))};ns.prototype.toMGRS=function(t){return Ui([this.x,this.y],t)};var hs=1;var as=.25;var os=.046875;var fs=.01953125;var us=.01068115234375;var ls=.75;var vs=.46875;var cs=.013020833333333334;var ds=.007120768229166667;var ms=.3645833333333333;var ps=.005696614583333333;var zs=.3076171875;function Ms(t){var i=[];i[0]=hs-t*(as+t*(os+t*(fs+t*us)));i[1]=t*(ls-t*(os+t*(fs+t*us)));var s=t*t;i[2]=s*(vs-t*(cs+t*ds));s*=t;i[3]=s*(ms-t*ps);i[4]=s*t*zs;return i}function _s(t,i,s,e){s*=i;i*=i;return e[0]*t-s*(e[1]+i*(e[2]+i*(e[3]+i*e[4])))}var gs=20;function bs(t,i,s){var e=1/(1-i);var r=t;for(var n=gs;n;--n){var h=Math.sin(r);var a=1-i*h*h;a=(_s(r,h,Math.cos(r),s)-t)*(a*Math.sqrt(a))*e;r-=a;if(Math.abs(a)<F){return r}}return r}function xs(){this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;if(this.es){this.en=Ms(this.es);this.ml0=_s(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en)}}function ws(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r;var n,h;var a=Math.sin(s);var o=Math.cos(s);if(!this.es){var f=o*Math.sin(e);if(Math.abs(Math.abs(f)-1)<F){return 93}else{n=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0;h=o*Math.cos(e)/Math.sqrt(1-Math.pow(f,2));f=Math.abs(h);if(f>=1){if(f-1>F){return 93}else{h=0}}else{h=Math.acos(h)}if(s<0){h=-h}h=this.a*this.k0*(h-this.lat0)+this.y0}}else{var u=o*e;var l=Math.pow(u,2);var v=this.ep2*Math.pow(o,2);var c=Math.pow(v,2);var d=Math.abs(o)>F?Math.tan(s):0;var m=Math.pow(d,2);var p=Math.pow(m,2);r=1-this.es*Math.pow(a,2);u=u/Math.sqrt(r);var z=_s(s,a,o,this.en);n=this.a*(this.k0*u*(1+l/6*(1-m+v+l/20*(5-18*m+p+14*v-58*m*v+l/42*(61+179*p-p*m-479*m)))))+this.x0;h=this.a*(this.k0*(z-this.ml0+a*e*u/2*(1+l/12*(5-m+9*v+4*c+l/30*(61+p-58*m+270*v-330*m*v+l/56*(1385+543*p-p*m-3111*m))))))+this.y0}t.x=n;t.y=h;return t}function ys(t){var i,s;var e,r;var n=(t.x-this.x0)*(1/this.a);var h=(t.y-this.y0)*(1/this.a);if(!this.es){var a=Math.exp(n/this.k0);var o=.5*(a-1/a);var f=this.lat0+h/this.k0;var u=Math.cos(f);i=Math.sqrt((1-Math.pow(u,2))/(1+Math.pow(o,2)));e=Math.asin(i);if(h<0){e=-e}if(o===0&&u===0){r=0}else{r=Ct(Math.atan2(o,u)+this.long0)}}else{i=this.ml0+h/this.k0;s=bs(i,this.es,this.en);if(Math.abs(s)<R){var l=Math.sin(s);var v=Math.cos(s);var c=Math.abs(v)>F?Math.tan(s):0;var d=this.ep2*Math.pow(v,2);var m=Math.pow(d,2);var p=Math.pow(c,2);var z=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var M=n*Math.sqrt(i)/this.k0;var _=Math.pow(M,2);i=i*c;e=s-i*_/(1-this.es)*.5*(1-_/12*(5+3*p-9*d*p+d-4*m-_/30*(61+90*p-252*d*p+45*z+46*d-_/56*(1385+3633*p+4095*z+1574*z*p))));r=Ct(this.long0+M*(1-_/6*(1+2*p+d-_/20*(5+28*p+24*z+8*d*p+6*d-_/42*(61+662*p+1320*z+720*z*p))))/v)}else{e=R*Nt(h);r=0}}t.x=r;t.y=e;return t}var ks=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Es={init:xs,forward:ws,inverse:ys,names:ks};function Ns(t){var i=Math.exp(t);i=(i-1/i)/2;return i}function Cs(t,i){t=Math.abs(t);i=Math.abs(i);var s=Math.max(t,i);var e=Math.min(t,i)/(s?s:1);return s*Math.sqrt(1+Math.pow(e,2))}function Is(t){var i=1+t;var s=i-1;return s===0?t:t*Math.log(i)/s}function Ss(t){var i=Math.abs(t);i=Is(i*(1+i/(Cs(1,i)+1)));return t<0?-i:i}function Os(t,i){var s=2*Math.cos(2*i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return i+h*Math.sin(2*i)}function Ts(t,i){var s=2*Math.cos(i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return Math.sin(i)*h}function As(t){var i=Math.exp(t);i=(i+1/i)/2;return i}function Rs(t,i,s){var e=Math.sin(i);var r=Math.cos(i);var n=Ns(s);var h=As(s);var a=2*r*h;var o=-2*e*n;var f=t.length-1;var u=t[f];var l=0;var v=0;var c=0;var d;var m;while(--f>=0){d=v;m=l;v=u;l=c;u=-d+a*v-o*l+t[f];c=-m+o*v+a*l}a=e*h;o=r*n;return[a*u-o*c,a*c+o*u]}function Ps(){if(!this.approx&&(isNaN(this.es)||this.es<=0)){throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.')}if(this.approx){Es.init.apply(this);this.forward=Es.forward;this.inverse=Es.inverse}this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;this.cgb=[];this.cbg=[];this.utg=[];this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es));var i=t/(2-t);var s=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675))))));this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725))))));s=s*i;this.cgb[1]=s*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945)))));this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945)))));s=s*i;this.cgb[2]=s*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835))));this.cbg[2]=s*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835))));s=s*i;this.cgb[3]=s*(4279/630+i*(-332/35+i*(-399572/14175)));this.cbg[3]=s*(1237/630+i*(-12/5+i*(-24832/14175)));s=s*i;this.cgb[4]=s*(4174/315+i*(-144838/6237));this.cbg[4]=s*(-734/315+i*(109598/31185));s=s*i;this.cgb[5]=s*(601676/22275);this.cbg[5]=s*(444337/155925);s=Math.pow(i,2);this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256)));this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800))))));this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800))))));this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720)))));this.gtu[1]=s*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360)))));s=s*i;this.utg[2]=s*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720))));this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440))));s=s*i;this.utg[3]=s*(-4397/161280+i*(11/504+i*(830251/7257600)));this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600)));s=s*i;this.utg[4]=s*(-4583/161280+i*(108847/3991680));this.gtu[4]=s*(34729/80640+i*(-3418889/1995840));s=s*i;this.utg[5]=s*(-20648693/638668800);this.gtu[5]=s*(212378941/319334400);var e=Os(this.cbg,this.lat0);this.Zb=-this.Qn*(e+Ts(this.gtu,2*e))}function Ls(t){var i=Ct(t.x-this.long0);var s=t.y;s=Os(this.cbg,s);var e=Math.sin(s);var r=Math.cos(s);var n=Math.sin(i);var h=Math.cos(i);s=Math.atan2(e,h*r);i=Math.atan2(n*r,Cs(e,r*h));i=Ss(Math.tan(i));var a=Rs(this.gtu,2*s,2*i);s=s+a[0];i=i+a[1];var o;var f;if(Math.abs(i)<=2.623395162778){o=this.a*(this.Qn*i)+this.x0;f=this.a*(this.Qn*s+this.Zb)+this.y0}else{o=Infinity;f=Infinity}t.x=o;t.y=f;return t}function Ds(t){var i=(t.x-this.x0)*(1/this.a);var s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn;i=i/this.Qn;var e;var r;if(Math.abs(i)<=2.623395162778){var n=Rs(this.utg,2*s,2*i);s=s+n[0];i=i+n[1];i=Math.atan(Ns(i));var h=Math.sin(s);var a=Math.cos(s);var o=Math.sin(i);var f=Math.cos(i);s=Math.atan2(h*f,Cs(o,f*a));i=Math.atan2(o,f*a);e=Ct(i+this.long0);r=Os(this.cgb,s)}else{e=Infinity;r=Infinity}t.x=e;t.y=r;return t}var Fs=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ws={init:Ps,forward:Ls,inverse:Ds,names:Fs};function Gs(t,i){if(t===undefined){t=Math.floor((Ct(i)+Math.PI)*30/Math.PI)+1;if(t<0){return 0}else if(t>60){return 60}}return t}var js="etmerc";function Vs(){var t=Gs(this.zone,this.long0);if(t===undefined){throw new Error("unknown utm zone")}this.lat0=0;this.long0=(6*Math.abs(t)-183)*W;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;Ws.init.apply(this);this.forward=Ws.forward;this.inverse=Ws.inverse}var Us=["Universal Transverse Mercator System","utm"];const qs={init:Vs,names:Us,dependsOn:js};function Xs(t,i){return Math.pow((1-t)/(1+t),i)}var Ys=20;function Bs(){var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);i*=i;this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t);this.C=Math.sqrt(1+this.es*i*i/(1-this.es));this.phic0=Math.asin(t/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+j)/(Math.pow(Math.tan(.5*this.lat0+j),this.C)*Xs(this.e*t,this.ratexp))}function Hs(t){var i=t.x;var s=t.y;t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+j),this.C)*Xs(this.e*Math.sin(s),this.ratexp))-R;t.x=this.C*i;return t}function Js(t){var i=1e-14;var s=t.x/this.C;var e=t.y;var r=Math.pow(Math.tan(.5*e+j)/this.K,1/this.C);for(var n=Ys;n>0;--n){e=2*Math.atan(r*Xs(this.e*Math.sin(t.y),-.5*this.e))-R;if(Math.abs(e-t.y)<i){break}t.y=e}if(!n){return null}t.x=s;t.y=e;return t}var Zs=["gauss"];const $s={init:Bs,forward:Hs,inverse:Js,names:Zs};function Ks(){$s.init.apply(this);if(!this.rc){return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}}function Qs(t){var i,s,e,r;t.x=Ct(t.x-this.long0);$s.forward.apply(this,[t]);i=Math.sin(t.y);s=Math.cos(t.y);e=Math.cos(t.x);r=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*e);t.x=r*s*Math.sin(t.x);t.y=r*(this.cosc0*i-this.sinc0*s*e);t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function te(t){var i,s,e,r,n;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(n=Cs(t.x,t.y)){var h=2*Math.atan2(n,this.R2);i=Math.sin(h);s=Math.cos(h);r=Math.asin(s*this.sinc0+t.y*i*this.cosc0/n);e=Math.atan2(t.x*i,n*this.cosc0*s-t.y*this.sinc0*i)}else{r=this.phic0;e=0}t.x=e;t.y=r;$s.inverse.apply(this,[t]);t.x=Ct(t.x+this.long0);return t}var ie=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const se={init:Ks,forward:Qs,inverse:te,names:ie};function ee(t,i,s){i*=s;return Math.tan(.5*(R+t))*Math.pow((1-i)/(1+i),.5*s)}function re(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);if(this.sphere){if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=F){this.k0=.5*(1+Nt(this.lat0)*Math.sin(this.lat_ts))}}else{if(Math.abs(this.coslat0)<=F){if(this.lat0>0){this.con=1}else{this.con=-1}}this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e));if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=F&&Math.abs(Math.cos(this.lat_ts))>F){this.k0=.5*this.cons*Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/It(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))}this.ms1=Et(this.e,this.sinlat0,this.coslat0);this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-R;this.cosX0=Math.cos(this.X0);this.sinX0=Math.sin(this.X0)}}function ne(t){var i=t.x;var s=t.y;var e=Math.sin(s);var r=Math.cos(s);var n,h,a,o,f,u;var l=Ct(i-this.long0);if(Math.abs(Math.abs(i-this.long0)-Math.PI)<=F&&Math.abs(s+this.lat0)<=F){t.x=NaN;t.y=NaN;return t}if(this.sphere){n=2*this.k0/(1+this.sinlat0*e+this.coslat0*r*Math.cos(l));t.x=this.a*n*r*Math.sin(l)+this.x0;t.y=this.a*n*(this.coslat0*e-this.sinlat0*r*Math.cos(l))+this.y0;return t}else{h=2*Math.atan(this.ssfn_(s,e,this.e))-R;o=Math.cos(h);a=Math.sin(h);if(Math.abs(this.coslat0)<=F){f=It(this.e,s*this.con,this.con*e);u=2*this.a*this.k0*f/this.cons;t.x=this.x0+u*Math.sin(i-this.long0);t.y=this.y0-this.con*u*Math.cos(i-this.long0);return t}else if(Math.abs(this.sinlat0)<F){n=2*this.a*this.k0/(1+o*Math.cos(l));t.y=n*a}else{n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*o*Math.cos(l)));t.y=n*(this.cosX0*a-this.sinX0*o*Math.cos(l))+this.y0}t.x=n*o*Math.sin(l)+this.x0}return t}function he(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n;var h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(h/(2*this.a*this.k0));i=this.long0;s=this.lat0;if(h<=F){t.x=i;t.y=s;return t}s=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/h);if(Math.abs(this.coslat0)<F){if(this.lat0>0){i=Ct(this.long0+Math.atan2(t.x,-1*t.y))}else{i=Ct(this.long0+Math.atan2(t.x,t.y))}}else{i=Ct(this.long0+Math.atan2(t.x*Math.sin(a),h*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a)))}t.x=i;t.y=s;return t}else{if(Math.abs(this.coslat0)<=F){if(h<=F){s=this.lat0;i=this.long0;t.x=i;t.y=s;return t}t.x*=this.con;t.y*=this.con;e=h*this.cons/(2*this.a*this.k0);s=this.con*St(this.e,e);i=this.con*Ct(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else{r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1));i=this.long0;if(h<=F){n=this.X0}else{n=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h);i=Ct(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))}s=-1*St(this.e,Math.tan(.5*(R+n)))}}t.x=i;t.y=s;return t}var ae=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const oe={init:re,forward:ne,inverse:he,names:ae,ssfn_:ee};function fe(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t);var s=this.a;var e=this.rf;var r=1/e;var n=2*r-Math.pow(r,2);var h=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2));this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4));this.b0=Math.asin(i/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2));var o=Math.log(Math.tan(Math.PI/4+t/2));var f=Math.log((1+h*i)/(1-h*i));this.K=a-this.alpha*o+this.alpha*h/2*f}function ue(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2));var s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y)));var e=-this.alpha*(i+s)+this.K;var r=2*(Math.atan(Math.exp(e))-Math.PI/4);var n=this.alpha*(t.x-this.lambda0);var h=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n)));var a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0;t.x=this.R*h+this.x0;return t}function le(t){var i=t.x-this.x0;var s=t.y-this.y0;var e=i/this.R;var r=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4);var n=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e));var h=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r)));var a=this.lambda0+h/this.alpha;var o=0;var f=n;var u=-1e3;var l=0;while(Math.abs(f-u)>1e-7){if(++l>20){return}o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2));u=f;f=2*Math.atan(Math.exp(o))-Math.PI/2}t.x=a;t.y=f;return t}var ve=["somerc"];const ce={init:fe,forward:ue,inverse:le,names:ve};var de=1e-7;function me(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"];var s=typeof t.PROJECTION==="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||i.indexOf(s)!==-1}function pe(){var t,i,s,e,r,n,h,a,o,f,u=0,l,v=0,c=0,d=0,m=0,p=0,z=0;this.no_off=me(this);this.no_rot="no_rot"in this;var M=false;if("alpha"in this){M=true}var _=false;if("rectified_grid_angle"in this){_=true}if(M){z=this.alpha}if(_){u=this.rectified_grid_angle*W}if(M||_){v=this.longc}else{c=this.long1;m=this.lat1;d=this.long2;p=this.lat2;if(Math.abs(m-p)<=de||(t=Math.abs(m))<=de||Math.abs(t-R)<=de||Math.abs(Math.abs(this.lat0)-R)<=de||Math.abs(Math.abs(p)-R)<=de){throw new Error}}var g=1-this.es;i=Math.sqrt(g);if(Math.abs(this.lat0)>F){a=Math.sin(this.lat0);s=Math.cos(this.lat0);t=1-this.es*a*a;this.B=s*s;this.B=Math.sqrt(1+this.es*this.B*this.B/g);this.A=this.B*this.k0*i/t;e=this.B*i/(s*Math.sqrt(t));r=e*e-1;if(r<=0){r=0}else{r=Math.sqrt(r);if(this.lat0<0){r=-r}}this.E=r+=e;this.E*=Math.pow(It(this.e,this.lat0,a),this.B)}else{this.B=1/i;this.A=this.k0;this.E=e=r=1}if(M||_){if(M){l=Math.asin(Math.sin(z)/e);if(!_){u=z}}else{l=u;z=Math.asin(e*Math.sin(l))}this.lam0=v-Math.asin(.5*(r-1/r)*Math.tan(l))/this.B}else{n=Math.pow(It(this.e,m,Math.sin(m)),this.B);h=Math.pow(It(this.e,p,Math.sin(p)),this.B);r=this.E/n;o=(h-n)/(h+n);f=this.E*this.E;f=(f-h*n)/(f+h*n);t=c-d;if(t<-Math.pi){d-=V}else if(t>Math.pi){d+=V}this.lam0=Ct(.5*(c+d)-Math.atan(f*Math.tan(.5*this.B*(c-d))/o)/this.B);l=Math.atan(2*Math.sin(this.B*Ct(c-this.lam0))/(r-1/r));u=z=Math.asin(e*Math.sin(l))}this.singam=Math.sin(l);this.cosgam=Math.cos(l);this.sinrot=Math.sin(u);this.cosrot=Math.cos(u);this.rB=1/this.B;this.ArB=this.A*this.rB;this.BrA=1/this.ArB;if(this.no_off){this.u_0=0}else{this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(e*e-1)/Math.cos(z)));if(this.lat0<0){this.u_0=-this.u_0}}r=.5*l;this.v_pole_n=this.ArB*Math.log(Math.tan(j-r));this.v_pole_s=this.ArB*Math.log(Math.tan(j+r))}function ze(t){var i={};var s,e,r,n,h,a,o,f;t.x=t.x-this.lam0;if(Math.abs(Math.abs(t.y)-R)>F){h=this.E/Math.pow(It(this.e,t.y,Math.sin(t.y)),this.B);a=1/h;s=.5*(h-a);e=.5*(h+a);n=Math.sin(this.B*t.x);r=(s*this.singam-n*this.cosgam)/e;if(Math.abs(Math.abs(r)-1)<F){throw new Error}f=.5*this.ArB*Math.log((1-r)/(1+r));a=Math.cos(this.B*t.x);if(Math.abs(a)<de){o=this.A*t.x}else{o=this.ArB*Math.atan2(s*this.cosgam+n*this.singam,a)}}else{f=t.y>0?this.v_pole_n:this.v_pole_s;o=this.ArB*t.y}if(this.no_rot){i.x=o;i.y=f}else{o-=this.u_0;i.x=f*this.cosrot+o*this.sinrot;i.y=o*this.cosrot-f*this.sinrot}i.x=this.a*i.x+this.x0;i.y=this.a*i.y+this.y0;return i}function Me(t){var i,s,e,r,n,h,a;var o={};t.x=(t.x-this.x0)*(1/this.a);t.y=(t.y-this.y0)*(1/this.a);if(this.no_rot){s=t.y;i=t.x}else{s=t.x*this.cosrot-t.y*this.sinrot;i=t.y*this.cosrot+t.x*this.sinrot+this.u_0}e=Math.exp(-this.BrA*s);r=.5*(e-1/e);n=.5*(e+1/e);h=Math.sin(this.BrA*i);a=(h*this.cosgam+r*this.singam)/n;if(Math.abs(Math.abs(a)-1)<F){o.x=0;o.y=a<0?-R:R}else{o.y=this.E/Math.sqrt((1+a)/(1-a));o.y=St(this.e,Math.pow(o.y,1/this.B));if(o.y===Infinity){throw new Error}o.x=-this.rB*Math.atan2(r*this.cosgam-h*this.singam,Math.cos(this.BrA*i))}o.x+=this.lam0;return o}var _e=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const ge={init:pe,forward:ze,inverse:Me,names:_e};function be(){if(!this.lat2){this.lat2=this.lat1}if(!this.k0){this.k0=1}this.x0=this.x0||0;this.y0=this.y0||0;if(Math.abs(this.lat1+this.lat2)<F){return}var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1);var s=Math.cos(this.lat1);var e=Et(this.e,i,s);var r=It(this.e,this.lat1,i);var n=Math.sin(this.lat2);var h=Math.cos(this.lat2);var a=Et(this.e,n,h);var o=It(this.e,this.lat2,n);var f=It(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>F){this.ns=Math.log(e/a)/Math.log(r/o)}else{this.ns=i}if(isNaN(this.ns)){this.ns=i}this.f0=e/(this.ns*Math.pow(r,this.ns));this.rh=this.a*this.f0*Math.pow(f,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}}function xe(t){var i=t.x;var s=t.y;if(Math.abs(2*Math.abs(s)-Math.PI)<=F){s=Nt(s)*(R-2*F)}var e=Math.abs(Math.abs(s)-R);var r,n;if(e>F){r=It(this.e,s,Math.sin(s));n=this.a*this.f0*Math.pow(r,this.ns)}else{e=s*this.ns;if(e<=0){return null}n=0}var h=this.ns*Ct(i-this.long0);t.x=this.k0*(n*Math.sin(h))+this.x0;t.y=this.k0*(this.rh-n*Math.cos(h))+this.y0;return t}function we(t){var i,s,e;var r,n;var h=(t.x-this.x0)/this.k0;var a=this.rh-(t.y-this.y0)/this.k0;if(this.ns>0){i=Math.sqrt(h*h+a*a);s=1}else{i=-Math.sqrt(h*h+a*a);s=-1}var o=0;if(i!==0){o=Math.atan2(s*h,s*a)}if(i!==0||this.ns>0){s=1/this.ns;e=Math.pow(i/(this.a*this.f0),s);r=St(this.e,e);if(r===-9999){return null}}else{r=-R}n=Ct(o/this.ns+this.long0);t.x=n;t.y=r;return t}var ye=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const ke={init:be,forward:xe,inverse:we,names:ye};function Ee(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);if(!this.lat0){this.lat0=.863937979737193}if(!this.long0){this.long0=.7417649320975901-.308341501185665}if(!this.k0){this.k0=.9999}this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq}function Ne(t){var i,s,e,r,n,h,a;var o=t.x;var f=t.y;var u=Ct(o-this.long0);i=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2);s=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/i)-this.s45);e=-u*this.alfa;r=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(e));n=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(r));h=this.n*n;a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n);t.y=a*Math.cos(h)/1;t.x=a*Math.sin(h)/1;if(!this.czech){t.y*=-1;t.x*=-1}return t}function Ce(t){var i,s,e,r,n,h,a;var o;var f=t.x;t.x=t.y;t.y=f;if(!this.czech){t.y*=-1;t.x*=-1}h=Math.sqrt(t.x*t.x+t.y*t.y);n=Math.atan2(t.y,t.x);r=n/Math.sin(this.s0);e=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);i=Math.asin(Math.cos(this.ad)*Math.sin(e)-Math.sin(this.ad)*Math.cos(e)*Math.cos(r));s=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(i));t.x=this.long0-s/this.alfa;a=i;o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45);if(Math.abs(a-t.y)<1e-10){o=1}a=t.y;u+=1}while(o===0&&u<15);if(u>=15){return null}return t}var Ie=["Krovak","krovak"];const Se={init:Ee,forward:Ne,inverse:Ce,names:Ie};function Oe(t,i,s,e,r){return t*r-i*Math.sin(2*r)+s*Math.sin(4*r)-e*Math.sin(6*r)}function Te(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ae(t){return.375*t*(1+.25*t*(1+.46875*t))}function Re(t){return.05859375*t*t*(1+.75*t)}function Pe(t){return t*t*t*(35/3072)}function Le(t,i,s){var e=i*s;return t/Math.sqrt(1-e*e)}function De(t){return Math.abs(t)<R?t:t-Nt(t)*Math.PI}function Fe(t,i,s,e,r){var n;var h;n=t/i;for(var a=0;a<15;a++){h=(t-(i*n-s*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)))/(i-2*s*Math.cos(2*n)+4*e*Math.cos(4*n)-6*r*Math.cos(6*n));n+=h;if(Math.abs(h)<=1e-10){return n}}return NaN}function We(){if(!this.sphere){this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.ml0=this.a*Oe(this.e0,this.e1,this.e2,this.e3,this.lat0)}}function Ge(t){var i,s;var e=t.x;var r=t.y;e=Ct(e-this.long0);if(this.sphere){i=this.a*Math.asin(Math.cos(r)*Math.sin(e));s=this.a*(Math.atan2(Math.tan(r),Math.cos(e))-this.lat0)}else{var n=Math.sin(r);var h=Math.cos(r);var a=Le(this.a,this.e,n);var o=Math.tan(r)*Math.tan(r);var f=e*Math.cos(r);var u=f*f;var l=this.es*h*h/(1-this.es);var v=this.a*Oe(this.e0,this.e1,this.e2,this.e3,r);i=a*f*(1-u*o*(1/6-(8-o+8*l)*u/120));s=v-this.ml0+a*n/h*u*(.5+(5-o+6*l)*u/24)}t.x=i+this.x0;t.y=s+this.y0;return t}function je(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r;if(this.sphere){var n=s+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(i));r=Math.atan2(Math.tan(i),Math.cos(n))}else{var h=this.ml0/this.a+s;var a=Fe(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-R)<=F){t.x=this.long0;t.y=R;if(s<0){t.y*=-1}return t}var o=Le(this.a,this.e,Math.sin(a));var f=o*o*o/this.a/this.a*(1-this.es);var u=Math.pow(Math.tan(a),2);var l=i*this.a/o;var v=l*l;e=a-o*Math.tan(a)/f*l*l*(.5-(1+3*u)*l*l/24);r=l*(1-v*(u/3+(1+3*u)*u*v/15))/Math.cos(a)}t.x=Ct(r+this.long0);t.y=De(e);return t}var Ve=["Cassini","Cassini_Soldner","cass"];const Ue={init:We,forward:Ge,inverse:je,names:Ve};function qe(t,i){var s;if(t>1e-7){s=t*i;return(1-t*t)*(i/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))}else{return 2*i}}var Xe=1;var Ye=2;var Be=3;var He=4;function Je(){var t=Math.abs(this.lat0);if(Math.abs(t-R)<F){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else if(Math.abs(t)<F){this.mode=this.EQUIT}else{this.mode=this.OBLIQ}if(this.es>0){var i;this.qp=qe(this.e,1);this.mmf=.5/(1-this.es);this.apa=rr(this.es);switch(this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);i=Math.sin(this.lat0);this.sinb1=qe(this.e,i)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode===this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}}function Ze(t){var i,s,e,r,n,h,a,o,f,u;var l=t.x;var v=t.y;l=Ct(l-this.long0);if(this.sphere){n=Math.sin(v);u=Math.cos(v);e=Math.cos(l);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){s=this.mode===this.EQUIT?1+u*e:1+this.sinph0*n+this.cosph0*u*e;if(s<=F){return null}s=Math.sqrt(2/s);i=s*u*Math.sin(l);s*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*u*e}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){e=-e}if(Math.abs(v+this.lat0)<F){return null}s=j-v*.5;s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s));i=s*Math.sin(l);s*=e}}else{a=0;o=0;f=0;e=Math.cos(l);r=Math.sin(l);n=Math.sin(v);h=qe(this.e,n);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){a=h/this.qp;o=Math.sqrt(1-a*a)}switch(this.mode){case this.OBLIQ:f=1+this.sinb1*a+this.cosb1*o*e;break;case this.EQUIT:f=1+o*e;break;case this.N_POLE:f=R+v;h=this.qp-h;break;case this.S_POLE:f=v-R;h=this.qp+h;break}if(Math.abs(f)<F){return null}switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f);if(this.mode===this.OBLIQ){s=this.ymf*f*(this.cosb1*a-this.sinb1*o*e)}else{s=(f=Math.sqrt(2/(1+o*e)))*a*this.ymf}i=this.xmf*f*o*r;break;case this.N_POLE:case this.S_POLE:if(h>=0){i=(f=Math.sqrt(h))*r;s=e*(this.mode===this.S_POLE?f:-f)}else{i=s=0}break}}t.x=this.a*i+this.x0;t.y=this.a*s+this.y0;return t}function $e(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r,n,h,a,o,f;if(this.sphere){var u=0,l,v=0;l=Math.sqrt(i*i+s*s);r=l*.5;if(r>1){return null}r=2*Math.asin(r);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){v=Math.sin(r);u=Math.cos(r)}switch(this.mode){case this.EQUIT:r=Math.abs(l)<=F?0:Math.asin(s*v/l);i*=v;s=u*l;break;case this.OBLIQ:r=Math.abs(l)<=F?this.lat0:Math.asin(u*this.sinph0+s*v*this.cosph0/l);i*=v*this.cosph0;s=(u-Math.sin(r)*this.sinph0)*l;break;case this.N_POLE:s=-s;r=R-r;break;case this.S_POLE:r-=R;break}e=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,s)}else{f=0;if(this.mode===this.OBLIQ||this.mode===this.EQUIT){i/=this.dd;s*=this.dd;o=Math.sqrt(i*i+s*s);if(o<F){t.x=this.long0;t.y=this.lat0;return t}h=2*Math.asin(.5*o/this.rq);n=Math.cos(h);i*=h=Math.sin(h);if(this.mode===this.OBLIQ){f=n*this.sinb1+s*h*this.cosb1/o;a=this.qp*f;s=o*this.cosb1*n-s*this.sinb1*h}else{f=s*h/o;a=this.qp*f;s=o*n}}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){s=-s}a=i*i+s*s;if(!a){t.x=this.long0;t.y=this.lat0;return t}f=1-a/this.qp;if(this.mode===this.S_POLE){f=-f}}e=Math.atan2(i,s);r=nr(Math.asin(f),this.apa)}t.x=Ct(this.long0+e);t.y=r;return t}var Ke=.3333333333333333;var Qe=.17222222222222222;var tr=.10257936507936508;var ir=.06388888888888888;var sr=.0664021164021164;var er=.016415012942191543;function rr(t){var i;var s=[];s[0]=t*Ke;i=t*t;s[0]+=i*Qe;s[1]=i*ir;i*=t;s[0]+=i*tr;s[1]+=i*sr;s[2]=i*er;return s}function nr(t,i){var s=t+t;return t+i[0]*Math.sin(s)+i[1]*Math.sin(s+s)+i[2]*Math.sin(s+s+s)}var hr=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const ar={init:Je,forward:Ze,inverse:$e,names:hr,S_POLE:Xe,N_POLE:Ye,EQUIT:Be,OBLIQ:He};function or(t){if(Math.abs(t)>1){t=t>1?1:-1}return Math.asin(t)}function fr(){if(Math.abs(this.lat1+this.lat2)<F){return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Et(this.e3,this.sin_po,this.cos_po);this.qs1=qe(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Et(this.e3,this.sin_po,this.cos_po);this.qs2=qe(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=qe(this.e3,this.sin_po);if(Math.abs(this.lat1-this.lat2)>F){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0}function ur(t){var i=t.x;var s=t.y;this.sin_phi=Math.sin(s);this.cos_phi=Math.cos(s);var e=qe(this.e3,this.sin_phi);var r=this.a*Math.sqrt(this.c-this.ns0*e)/this.ns0;var n=this.ns0*Ct(i-this.long0);var h=r*Math.sin(n)+this.x0;var a=this.rh-r*Math.cos(n)+this.y0;t.x=h;t.y=a;return t}function lr(t){var i,s,e,r,n,h;t.x-=this.x0;t.y=this.rh-t.y+this.y0;if(this.ns0>=0){i=Math.sqrt(t.x*t.x+t.y*t.y);e=1}else{i=-Math.sqrt(t.x*t.x+t.y*t.y);e=-1}r=0;if(i!==0){r=Math.atan2(e*t.x,e*t.y)}e=i*this.ns0/this.a;if(this.sphere){h=Math.asin((this.c-e*e)/(2*this.ns0))}else{s=(this.c-e*e)/this.ns0;h=this.phi1z(this.e3,s)}n=Ct(r/this.ns0+this.long0);t.x=n;t.y=h;return t}function vr(t,i){var s,e,r,n,h;var a=or(.5*i);if(t<F){return a}var o=t*t;for(var f=1;f<=25;f++){s=Math.sin(a);e=Math.cos(a);r=t*s;n=1-r*r;h=.5*n*n/e*(i/(1-o)-s/n+.5/t*Math.log((1-r)/(1+r)));a=a+h;if(Math.abs(h)<=1e-7){return a}}return null}var cr=["Albers_Conic_Equal_Area","Albers","aea"];const dr={init:fr,forward:ur,inverse:lr,names:cr,phi1z:vr};function mr(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1}function pr(t){var i,s;var e;var r;var n;var h;var a,o;var f=t.x;var u=t.y;e=Ct(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=F){a=this.x0+this.a*n*s*Math.sin(e)/h;o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)/h}else{a=this.x0+this.infinity_dist*s*Math.sin(e);o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function zr(t){var i;var s,e;var r;var n,h;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(i=Math.sqrt(t.x*t.x+t.y*t.y)){r=Math.atan2(i,this.rc);s=Math.sin(r);e=Math.cos(r);h=or(e*this.sin_p14+t.y*s*this.cos_p14/i);n=Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s);n=Ct(this.long0+n)}else{h=this.phic0;n=0}t.x=n;t.y=h;return t}var Mr=["gnom"];const _r={init:mr,forward:pr,inverse:zr,names:Mr};function gr(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6){if(i<0){return-1*R}else{return R}}var e=Math.asin(.5*i);var r;var n;var h;var a;for(var o=0;o<30;o++){n=Math.sin(e);h=Math.cos(e);a=t*n;r=Math.pow(1-a*a,2)/(2*h)*(i/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a)));e+=r;if(Math.abs(r)<=1e-10){return e}}return NaN}function br(){if(!this.sphere){this.k0=Et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}function xr(t){var i=t.x;var s=t.y;var e,r;var n=Ct(i-this.long0);if(this.sphere){e=this.x0+this.a*n*Math.cos(this.lat_ts);r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts)}else{var h=qe(this.e,Math.sin(s));e=this.x0+this.a*this.k0*n;r=this.y0+this.a*h*.5/this.k0}t.x=e;t.y=r;return t}function wr(t){t.x-=this.x0;t.y-=this.y0;var i,s;if(this.sphere){i=Ct(this.long0+t.x/this.a/Math.cos(this.lat_ts));s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))}else{s=gr(this.e,2*t.y*this.k0/this.a);i=Ct(this.long0+t.x/(this.a*this.k0))}t.x=i;t.y=s;return t}var yr=["cea"];const kr={init:br,forward:xr,inverse:wr,names:yr};function Er(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)}function Nr(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=De(s-this.lat0);t.x=this.x0+this.a*e*this.rc;t.y=this.y0+this.a*r;return t}function Cr(t){var i=t.x;var s=t.y;t.x=Ct(this.long0+(i-this.x0)/(this.a*this.rc));t.y=De(this.lat0+(s-this.y0)/this.a);return t}var Ir=["Equirectangular","Equidistant_Cylindrical","eqc"];const Sr={init:Er,forward:Nr,inverse:Cr,names:Ir};var Or=20;function Tr(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.ml0=this.a*Oe(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Ar(t){var i=t.x;var s=t.y;var e,r,n;var h=Ct(i-this.long0);n=h*Math.sin(s);if(this.sphere){if(Math.abs(s)<=F){e=this.a*h;r=-1*this.a*this.lat0}else{e=this.a*Math.sin(n)/Math.tan(s);r=this.a*(De(s-this.lat0)+(1-Math.cos(n))/Math.tan(s))}}else{if(Math.abs(s)<=F){e=this.a*h;r=-1*this.ml0}else{var a=Le(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n);r=this.a*Oe(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}}t.x=e+this.x0;t.y=r+this.y0;return t}function Rr(t){var i,s,e,r,n;var h,a;var o,f;e=t.x-this.x0;r=t.y-this.y0;if(this.sphere){if(Math.abs(r+this.a*this.lat0)<=F){i=Ct(e/this.a+this.long0);s=0}else{h=this.lat0+r/this.a;a=e*e/this.a/this.a+h*h;o=h;var u;for(n=Or;n;--n){u=Math.tan(o);f=-1*(h*(o*u+1)-o-.5*(o*o+a)*u)/((o-h)/u-1);o+=f;if(Math.abs(f)<=F){s=o;break}}i=Ct(this.long0+Math.asin(e*Math.tan(o)/this.a)/Math.sin(s))}}else{if(Math.abs(r+this.ml0)<=F){s=0;i=Ct(this.long0+e/this.a)}else{h=(this.ml0+r)/this.a;a=e*e/this.a/this.a+h*h;o=h;var l,v,c,d;var m;for(n=Or;n;--n){m=this.e*Math.sin(o);l=Math.sqrt(1-m*m)*Math.tan(o);v=this.a*Oe(this.e0,this.e1,this.e2,this.e3,o);c=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o);d=v/this.a;f=(h*(l*d+1)-d-.5*l*(d*d+a))/(this.es*Math.sin(2*o)*(d*d+a-2*h*d)/(4*l)+(h-d)*(l*c-2/Math.sin(2*o))-c);o-=f;if(Math.abs(f)<=F){s=o;break}}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s);i=Ct(this.long0+Math.asin(e*l/this.a)/Math.sin(s))}}t.x=i;t.y=s;return t}var Pr=["Polyconic","poly"];const Lr={init:Tr,forward:Ar,inverse:Rr,names:Pr};function Dr(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=67e-5;this.A[10]=-34e-5;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013}function Fr(t){var i;var s=t.x;var e=t.y;var r=e-this.lat0;var n=s-this.long0;var h=r/A*1e-5;var a=n;var o=1;var f=0;for(i=1;i<=10;i++){o=o*h;f=f+this.A[i]*o}var u=f;var l=a;var v=1;var c=0;var d;var m;var p=0;var z=0;for(i=1;i<=6;i++){d=v*u-c*l;m=c*u+v*l;v=d;c=m;p=p+this.B_re[i]*v-this.B_im[i]*c;z=z+this.B_im[i]*v+this.B_re[i]*c}t.x=z*this.a+this.x0;t.y=p*this.a+this.y0;return t}function Wr(t){var i;var s=t.x;var e=t.y;var r=s-this.x0;var n=e-this.y0;var h=n/this.a;var a=r/this.a;var o=1;var f=0;var u;var l;var v=0;var c=0;for(i=1;i<=6;i++){u=o*h-f*a;l=f*h+o*a;o=u;f=l;v=v+this.C_re[i]*o-this.C_im[i]*f;c=c+this.C_im[i]*o+this.C_re[i]*f}for(var d=0;d<this.iterations;d++){var m=v;var p=c;var z;var M;var _=h;var g=a;for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;_=_+(i-1)*(this.B_re[i]*m-this.B_im[i]*p);g=g+(i-1)*(this.B_im[i]*m+this.B_re[i]*p)}m=1;p=0;var b=this.B_re[1];var x=this.B_im[1];for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;b=b+i*(this.B_re[i]*m-this.B_im[i]*p);x=x+i*(this.B_im[i]*m+this.B_re[i]*p)}var w=b*b+x*x;v=(_*b+g*x)/w;c=(g*b-_*x)/w}var y=v;var k=c;var E=1;var N=0;for(i=1;i<=9;i++){E=E*y;N=N+this.D[i]*E}var C=this.lat0+N*A*1e5;var I=this.long0+k;t.x=I;t.y=C;return t}var Gr=["New_Zealand_Map_Grid","nzmg"];const jr={init:Dr,forward:Fr,inverse:Wr,names:Gr};function Vr(){}function Ur(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=this.x0+this.a*e;var n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;t.x=r;t.y=n;return t}function qr(t){t.x-=this.x0;t.y-=this.y0;var i=Ct(this.long0+t.x/this.a);var s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);t.x=i;t.y=s;return t}var Xr=["Miller_Cylindrical","mill"];const Yr={init:Vr,forward:Ur,inverse:qr,names:Xr};var Br=20;function Hr(){if(!this.sphere){this.en=Ms(this.es)}else{this.n=1;this.m=0;this.es=0;this.C_y=Math.sqrt((this.m+1)/this.n);this.C_x=this.C_y/(this.m+1)}}function Jr(t){var i,s;var e=t.x;var r=t.y;e=Ct(e-this.long0);if(this.sphere){if(!this.m){r=this.n!==1?Math.asin(this.n*Math.sin(r)):r}else{var n=this.n*Math.sin(r);for(var h=Br;h;--h){var a=(this.m*r+Math.sin(r)-n)/(this.m+Math.cos(r));r-=a;if(Math.abs(a)<F){break}}}i=this.a*this.C_x*e*(this.m+Math.cos(r));s=this.a*this.C_y*r}else{var o=Math.sin(r);var f=Math.cos(r);s=this.a*_s(r,o,f,this.en);i=this.a*e*f/Math.sqrt(1-this.es*o*o)}t.x=i;t.y=s;return t}function Zr(t){var i,s,e,r;t.x-=this.x0;e=t.x/this.a;t.y-=this.y0;i=t.y/this.a;if(this.sphere){i/=this.C_y;e=e/(this.C_x*(this.m+Math.cos(i)));if(this.m){i=or((this.m*i+Math.sin(i))/this.n)}else if(this.n!==1){i=or(Math.sin(i)/this.n)}e=Ct(e+this.long0);i=De(i)}else{i=bs(t.y/this.a,this.es,this.en);r=Math.abs(i);if(r<R){r=Math.sin(i);s=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(i));e=Ct(s)}else if(r-F<R){e=this.long0}}t.x=e;t.y=i;return t}var $r=["Sinusoidal","sinu"];const Kr={init:Hr,forward:Jr,inverse:Zr,names:$r};function Qr(){}function tn(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r=s;var n=Math.PI*Math.sin(s);while(true){var h=-(r+Math.sin(r)-n)/(1+Math.cos(r));r+=h;if(Math.abs(h)<F){break}}r/=2;if(Math.PI/2-Math.abs(s)<F){e=0}var a=.900316316158*this.a*e*Math.cos(r)+this.x0;var o=1.4142135623731*this.a*Math.sin(r)+this.y0;t.x=a;t.y=o;return t}function sn(t){var i;var s;t.x-=this.x0;t.y-=this.y0;s=t.y/(1.4142135623731*this.a);if(Math.abs(s)>.999999999999){s=.999999999999}i=Math.asin(s);var e=Ct(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));if(e<-Math.PI){e=-Math.PI}if(e>Math.PI){e=Math.PI}s=(2*i+Math.sin(2*i))/Math.PI;if(Math.abs(s)>1){s=1}var r=Math.asin(s);t.x=e;t.y=r;return t}var en=["Mollweide","moll"];const rn={init:Qr,forward:tn,inverse:sn,names:en};function nn(){if(Math.abs(this.lat1+this.lat2)<F){return}this.lat2=this.lat2||this.lat1;this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Te(this.es);this.e1=Ae(this.es);this.e2=Re(this.es);this.e3=Pe(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Et(this.e,this.sinphi,this.cosphi);this.ml1=Oe(this.e0,this.e1,this.e2,this.e3,this.lat1);if(Math.abs(this.lat1-this.lat2)<F){this.ns=this.sinphi}else{this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Et(this.e,this.sinphi,this.cosphi);this.ml2=Oe(this.e0,this.e1,this.e2,this.e3,this.lat2);this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}this.g=this.ml1+this.ms1/this.ns;this.ml0=Oe(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)}function hn(t){var i=t.x;var s=t.y;var e;if(this.sphere){e=this.a*(this.g-s)}else{var r=Oe(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-r)}var n=this.ns*Ct(i-this.long0);var h=this.x0+e*Math.sin(n);var a=this.y0+this.rh-e*Math.cos(n);t.x=h;t.y=a;return t}function an(t){t.x-=this.x0;t.y=this.rh-t.y+this.y0;var i,s,e,r;if(this.ns>=0){s=Math.sqrt(t.x*t.x+t.y*t.y);i=1}else{s=-Math.sqrt(t.x*t.x+t.y*t.y);i=-1}var n=0;if(s!==0){n=Math.atan2(i*t.x,i*t.y)}if(this.sphere){r=Ct(this.long0+n/this.ns);e=De(this.g-s/this.a);t.x=r;t.y=e;return t}else{var h=this.g-s/this.a;e=Fe(h,this.e0,this.e1,this.e2,this.e3);r=Ct(this.long0+n/this.ns);t.x=r;t.y=e;return t}}var on=["Equidistant_Conic","eqdc"];const fn={init:nn,forward:hn,inverse:an,names:on};function un(){this.R=this.a}function ln(t){var i=t.x;var s=t.y;var e=Ct(i-this.long0);var r,n;if(Math.abs(s)<=F){r=this.x0+this.R*e;n=this.y0}var h=or(2*Math.abs(s/Math.PI));if(Math.abs(e)<=F||Math.abs(Math.abs(s)-R)<=F){r=this.x0;if(s>=0){n=this.y0+Math.PI*this.R*Math.tan(.5*h)}else{n=this.y0+Math.PI*this.R*-Math.tan(.5*h)}}var a=.5*Math.abs(Math.PI/e-e/Math.PI);var o=a*a;var f=Math.sin(h);var u=Math.cos(h);var l=u/(f+u-1);var v=l*l;var c=l*(2/f-1);var d=c*c;var m=Math.PI*this.R*(a*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(v-d)))/(d+o);if(e<0){m=-m}r=this.x0+m;var p=o+l;m=Math.PI*this.R*(c*p-a*Math.sqrt((d+o)*(o+1)-p*p))/(d+o);if(s>=0){n=this.y0+m}else{n=this.y0-m}t.x=r;t.y=n;return t}function vn(t){var i,s;var e,r,n,h,a,o;var f;var u;var l;var v;var c;t.x-=this.x0;t.y-=this.y0;l=Math.PI*this.R;e=t.x/l;r=t.y/l;n=e*e+r*r;h=-Math.abs(r)*(1+n);a=h-2*r*r+e*e;o=-2*h+1+2*r*r+n*n;c=r*r/o+(2*a*a*a/o/o/o-9*h*a/o/o)/27;f=(h-a*a/3/o)/o;u=2*Math.sqrt(-f/3);l=3*c/f/u;if(Math.abs(l)>1){if(l>=0){l=1}else{l=-1}}v=Math.acos(l)/3;if(t.y>=0){s=(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}else{s=-(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}if(Math.abs(e)<F){i=this.long0}else{i=Ct(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(e*e-r*r)+n*n))/2/e)}t.x=i;t.y=s;return t}var cn=["Van_der_Grinten_I","VanDerGrinten","vandg"];const dn={init:un,forward:ln,inverse:vn,names:cn};function mn(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)}function pn(t){var i=t.x;var s=t.y;var e=Math.sin(t.y);var r=Math.cos(t.y);var n=Ct(i-this.long0);var h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w,y,k,E,N,C;if(this.sphere){if(Math.abs(this.sin_p12-1)<=F){t.x=this.x0+this.a*(R-s)*Math.sin(n);t.y=this.y0-this.a*(R-s)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=F){t.x=this.x0+this.a*(R+s)*Math.sin(n);t.y=this.y0+this.a*(R+s)*Math.cos(n);return t}else{w=this.sin_p12*e+this.cos_p12*r*Math.cos(n);b=Math.acos(w);x=b?b/Math.sin(b):1;t.x=this.x0+this.a*x*r*Math.sin(n);t.y=this.y0+this.a*x*(this.cos_p12*e-this.sin_p12*r*Math.cos(n));return t}}else{h=Te(this.es);a=Ae(this.es);o=Re(this.es);f=Pe(this.es);if(Math.abs(this.sin_p12-1)<=F){u=this.a*Oe(h,a,o,f,R);l=this.a*Oe(h,a,o,f,s);t.x=this.x0+(u-l)*Math.sin(n);t.y=this.y0-(u-l)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=F){u=this.a*Oe(h,a,o,f,R);l=this.a*Oe(h,a,o,f,s);t.x=this.x0+(u+l)*Math.sin(n);t.y=this.y0+(u+l)*Math.cos(n);return t}else{v=e/r;c=Le(this.a,this.e,this.sin_p12);d=Le(this.a,this.e,e);m=Math.atan((1-this.es)*v+this.es*c*this.sin_p12/(d*r));p=Math.atan2(Math.sin(n),this.cos_p12*Math.tan(m)-this.sin_p12*Math.cos(n));if(p===0){y=Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else if(Math.abs(Math.abs(p)-Math.PI)<=F){y=-Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else{y=Math.asin(Math.sin(n)*Math.cos(m)/Math.sin(p))}z=this.e*this.sin_p12/Math.sqrt(1-this.es);M=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es);_=z*M;g=M*M;k=y*y;E=k*y;N=E*y;C=N*y;b=c*y*(1-k*g*(1-g)/6+E/8*_*(1-2*g)+N/120*(g*(4-7*g)-3*z*z*(1-7*g))-C/48*_);t.x=this.x0+b*Math.sin(p);t.y=this.y0+b*Math.cos(p);return t}}}function zn(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w,y;if(this.sphere){i=Math.sqrt(t.x*t.x+t.y*t.y);if(i>2*R*this.a){return}s=i/this.a;e=Math.sin(s);r=Math.cos(s);n=this.long0;if(Math.abs(i)<=F){h=this.lat0}else{h=or(r*this.sin_p12+t.y*e*this.cos_p12/i);a=Math.abs(this.lat0)-R;if(Math.abs(a)<=F){if(this.lat0>=0){n=Ct(this.long0+Math.atan2(t.x,-t.y))}else{n=Ct(this.long0-Math.atan2(-t.x,t.y))}}else{n=Ct(this.long0+Math.atan2(t.x*e,i*this.cos_p12*r-t.y*this.sin_p12*e))}}t.x=n;t.y=h;return t}else{o=Te(this.es);f=Ae(this.es);u=Re(this.es);l=Pe(this.es);if(Math.abs(this.sin_p12-1)<=F){v=this.a*Oe(o,f,u,l,R);i=Math.sqrt(t.x*t.x+t.y*t.y);c=v-i;h=Fe(c/this.a,o,f,u,l);n=Ct(this.long0+Math.atan2(t.x,-1*t.y));t.x=n;t.y=h;return t}else if(Math.abs(this.sin_p12+1)<=F){v=this.a*Oe(o,f,u,l,R);i=Math.sqrt(t.x*t.x+t.y*t.y);c=i-v;h=Fe(c/this.a,o,f,u,l);n=Ct(this.long0+Math.atan2(t.x,t.y));t.x=n;t.y=h;return t}else{i=Math.sqrt(t.x*t.x+t.y*t.y);p=Math.atan2(t.x,t.y);d=Le(this.a,this.e,this.sin_p12);z=Math.cos(p);M=this.e*this.cos_p12*z;_=-M*M/(1-this.es);g=3*this.es*(1-_)*this.sin_p12*this.cos_p12*z/(1-this.es);b=i/d;x=b-_*(1+_)*Math.pow(b,3)/6-g*(1+3*_)*Math.pow(b,4)/24;w=1-_*x*x/2-b*x*x*x/6;m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*z);n=Ct(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m)));y=Math.sin(m);h=Math.atan2((y-this.es*w*this.sin_p12)*Math.tan(m),y*(1-this.es));t.x=n;t.y=h;return t}}}var Mn=["Azimuthal_Equidistant","aeqd"];const _n={init:mn,forward:pn,inverse:zn,names:Mn};function gn(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)}function bn(t){var i,s;var e;var r;var n;var h,a,o;var f=t.x;var u=t.y;e=Ct(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=F){a=this.a*n*s*Math.sin(e);o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function xn(t){var i;var s;var e,r;var n;var h,a;t.x-=this.x0;t.y-=this.y0;i=Math.sqrt(t.x*t.x+t.y*t.y);s=or(i/this.a);e=Math.sin(s);r=Math.cos(s);h=this.long0;if(Math.abs(i)<=F){a=this.lat0;t.x=h;t.y=a;return t}a=or(r*this.sin_p14+t.y*e*this.cos_p14/i);n=Math.abs(this.lat0)-R;if(Math.abs(n)<=F){if(this.lat0>=0){h=Ct(this.long0+Math.atan2(t.x,-t.y))}else{h=Ct(this.long0-Math.atan2(-t.x,t.y))}t.x=h;t.y=a;return t}h=Ct(this.long0+Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e));t.x=h;t.y=a;return t}var wn=["ortho"];const yn={init:gn,forward:bn,inverse:xn,names:wn};var kn={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6};var En={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Nn(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Quadrilateralized Spherical Cube";if(this.lat0>=R-j/2){this.face=kn.TOP}else if(this.lat0<=-(R-j/2)){this.face=kn.BOTTOM}else if(Math.abs(this.long0)<=j){this.face=kn.FRONT}else if(Math.abs(this.long0)<=R+j){this.face=this.long0>0?kn.RIGHT:kn.LEFT}else{this.face=kn.BACK}if(this.es!==0){this.one_minus_f=1-(this.a-this.b)/this.a;this.one_minus_f_squared=this.one_minus_f*this.one_minus_f}}function Cn(t){var i={x:0,y:0};var s,e;var r,n;var h,a;var o={value:0};t.x-=this.long0;if(this.es!==0){s=Math.atan(this.one_minus_f_squared*Math.tan(t.y))}else{s=t.y}e=t.x;if(this.face===kn.TOP){n=R-s;if(e>=j&&e<=R+j){o.value=En.AREA_0;r=e-R}else if(e>R+j||e<=-(R+j)){o.value=En.AREA_1;r=e>0?e-U:e+U}else if(e>-(R+j)&&e<=-j){o.value=En.AREA_2;r=e+R}else{o.value=En.AREA_3;r=e}}else if(this.face===kn.BOTTOM){n=R+s;if(e>=j&&e<=R+j){o.value=En.AREA_0;r=-e+R}else if(e<j&&e>=-j){o.value=En.AREA_1;r=-e}else if(e<-j&&e>=-(R+j)){o.value=En.AREA_2;r=-e-R}else{o.value=En.AREA_3;r=e>0?-e+U:-e-U}}else{var f,u,l;var v,c;var d,m;if(this.face===kn.RIGHT){e=On(e,+R)}else if(this.face===kn.BACK){e=On(e,+U)}else if(this.face===kn.LEFT){e=On(e,-R)}v=Math.sin(s);c=Math.cos(s);d=Math.sin(e);m=Math.cos(e);f=c*m;u=c*d;l=v;if(this.face===kn.FRONT){n=Math.acos(f);r=Sn(n,l,u,o)}else if(this.face===kn.RIGHT){n=Math.acos(u);r=Sn(n,l,-f,o)}else if(this.face===kn.BACK){n=Math.acos(-f);r=Sn(n,l,-u,o)}else if(this.face===kn.LEFT){n=Math.acos(-u);r=Sn(n,l,f,o)}else{n=r=0;o.value=En.AREA_0}}a=Math.atan(12/U*(r+Math.acos(Math.sin(r)*Math.cos(j))-R));h=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r)))));if(o.value===En.AREA_1){a+=R}else if(o.value===En.AREA_2){a+=U}else if(o.value===En.AREA_3){a+=1.5*U}i.x=h*Math.cos(a);i.y=h*Math.sin(a);i.x=i.x*this.a+this.x0;i.y=i.y*this.a+this.y0;t.x=i.x;t.y=i.y;return t}function In(t){var i={lam:0,phi:0};var s,e,r,n;var h,a,o,f;var u;var l={value:0};t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y));s=Math.atan2(t.y,t.x);if(t.x>=0&&t.x>=Math.abs(t.y)){l.value=En.AREA_0}else if(t.y>=0&&t.y>=Math.abs(t.x)){l.value=En.AREA_1;s-=R}else if(t.x<0&&-t.x>=Math.abs(t.y)){l.value=En.AREA_2;s=s<0?s+U:s-U}else{l.value=En.AREA_3;s+=R}u=U/12*Math.tan(s);h=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2));a=Math.atan(h);r=Math.cos(s);n=Math.tan(e);o=1-r*r*n*n*(1-Math.cos(Math.atan(1/Math.cos(a))));if(o<-1){o=-1}else if(o>+1){o=+1}if(this.face===kn.TOP){f=Math.acos(o);i.phi=R-f;if(l.value===En.AREA_0){i.lam=a+R}else if(l.value===En.AREA_1){i.lam=a<0?a+U:a-U}else if(l.value===En.AREA_2){i.lam=a-R}else{i.lam=a}}else if(this.face===kn.BOTTOM){f=Math.acos(o);i.phi=f-R;if(l.value===En.AREA_0){i.lam=-a+R}else if(l.value===En.AREA_1){i.lam=-a}else if(l.value===En.AREA_2){i.lam=-a-R}else{i.lam=a<0?-a-U:-a+U}}else{var v,c,d;v=o;u=v*v;if(u>=1){d=0}else{d=Math.sqrt(1-u)*Math.sin(a)}u+=d*d;if(u>=1){c=0}else{c=Math.sqrt(1-u)}if(l.value===En.AREA_1){u=c;c=-d;d=u}else if(l.value===En.AREA_2){c=-c;d=-d}else if(l.value===En.AREA_3){u=c;c=d;d=-u}if(this.face===kn.RIGHT){u=v;v=-c;c=u}else if(this.face===kn.BACK){v=-v;c=-c}else if(this.face===kn.LEFT){u=v;v=c;c=-u}i.phi=Math.acos(-d)-R;i.lam=Math.atan2(c,v);if(this.face===kn.RIGHT){i.lam=On(i.lam,-R)}else if(this.face===kn.BACK){i.lam=On(i.lam,-U)}else if(this.face===kn.LEFT){i.lam=On(i.lam,+R)}}if(this.es!==0){var m;var p,z;m=i.phi<0?1:0;p=Math.tan(i.phi);z=this.b/Math.sqrt(p*p+this.one_minus_f_squared);i.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z));if(m){i.phi=-i.phi}}i.lam+=this.long0;t.x=i.lam;t.y=i.phi;return t}function Sn(t,i,s,e){var r;if(t<F){e.value=En.AREA_0;r=0}else{r=Math.atan2(i,s);if(Math.abs(r)<=j){e.value=En.AREA_0}else if(r>j&&r<=R+j){e.value=En.AREA_1;r-=R}else if(r>R+j||r<=-(R+j)){e.value=En.AREA_2;r=r>=0?r-U:r+U}else{e.value=En.AREA_3;r+=R}}return r}function On(t,i){var s=t+i;if(s<-U){s+=V}else if(s>+U){s-=V}return s}var Tn=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const An={init:Nn,forward:Cn,inverse:In,names:Tn};var Rn=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]];var Pn=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]];var Ln=.8487;var Dn=1.3523;var Fn=G/5;var Wn=1/Fn;var Gn=18;var jn=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))};var Vn=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function Un(t,i,s,e){var r=i;for(;e;--e){var n=t(r);r-=n;if(Math.abs(n)<s){break}}return r}function qn(){this.x0=this.x0||0;this.y0=this.y0||0;this.long0=this.long0||0;this.es=0;this.title=this.title||"Robinson"}function Xn(t){var i=Ct(t.x-this.long0);var s=Math.abs(t.y);var e=Math.floor(s*Fn);if(e<0){e=0}else if(e>=Gn){e=Gn-1}s=G*(s-Wn*e);var r={x:jn(Rn[e],s)*i,y:jn(Pn[e],s)};if(t.y<0){r.y=-r.y}r.x=r.x*this.a*Ln+this.x0;r.y=r.y*this.a*Dn+this.y0;return r}function Yn(t){var i={x:(t.x-this.x0)/(this.a*Ln),y:Math.abs(t.y-this.y0)/(this.a*Dn)};if(i.y>=1){i.x/=Rn[Gn][0];i.y=t.y<0?-R:R}else{var s=Math.floor(i.y*Gn);if(s<0){s=0}else if(s>=Gn){s=Gn-1}for(;;){if(Pn[s][0]>i.y){--s}else if(Pn[s+1][0]<=i.y){++s}else{break}}var e=Pn[s];var r=5*(i.y-e[0])/(Pn[s+1][0]-e[0]);r=Un((function(t){return(jn(e,t)-i.y)/Vn(e,t)}),r,F,100);i.x/=jn(Rn[s],r);i.y=(5*s+r)*W;if(t.y<0){i.y=-i.y}}i.x=Ct(i.x+this.long0);return i}var Bn=["Robinson","robin"];const Hn={init:qn,forward:Xn,inverse:Yn,names:Bn};function Jn(){this.name="geocent"}function Zn(t){var i=mi(t,this.es,this.a);return i}function $n(t){var i=pi(t,this.es,this.a,this.b);return i}var Kn=["Geocentric","geocentric","geocent","Geocent"];const Qn={init:Jn,forward:Zn,inverse:$n,names:Kn};var th={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3};var ih={h:{def:1e5,num:true},azi:{def:0,num:true,degrees:true},tilt:{def:0,num:true,degrees:true},long0:{def:0,num:true},lat0:{def:0,num:true}};function sh(){Object.keys(ih).forEach(function(t){if(typeof this[t]==="undefined"){this[t]=ih[t].def}else if(ih[t].num&&isNaN(this[t])){throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t])}else if(ih[t].num){this[t]=parseFloat(this[t])}if(ih[t].degrees){this[t]=this[t]*W}}.bind(this));if(Math.abs(Math.abs(this.lat0)-R)<F){this.mode=this.lat0<0?th.S_POLE:th.N_POLE}else if(Math.abs(this.lat0)<F){this.mode=th.EQUIT}else{this.mode=th.OBLIQ;this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}this.pn1=this.h/this.a;if(this.pn1<=0||this.pn1>1e10){throw new Error("Invalid height")}this.p=1+this.pn1;this.rp=1/this.p;this.h1=1/this.pn1;this.pfact=(this.p+1)*this.h1;this.es=0;var t=this.tilt;var i=this.azi;this.cg=Math.cos(i);this.sg=Math.sin(i);this.cw=Math.cos(t);this.sw=Math.sin(t)}function eh(t){t.x-=this.long0;var i=Math.sin(t.y);var s=Math.cos(t.y);var e=Math.cos(t.x);var r,n;switch(this.mode){case th.OBLIQ:n=this.sinph0*i+this.cosph0*s*e;break;case th.EQUIT:n=s*e;break;case th.S_POLE:n=-i;break;case th.N_POLE:n=i;break}n=this.pn1/(this.p-n);r=n*s*Math.sin(t.x);switch(this.mode){case th.OBLIQ:n*=this.cosph0*i-this.sinph0*s*e;break;case th.EQUIT:n*=i;break;case th.N_POLE:n*=-(s*e);break;case th.S_POLE:n*=s*e;break}var h,a;h=n*this.cg+r*this.sg;a=1/(h*this.sw*this.h1+this.cw);r=(r*this.cg-n*this.sg)*this.cw*a;n=h*a;t.x=r*this.a;t.y=n*this.a;return t}function rh(t){t.x/=this.a;t.y/=this.a;var i={x:t.x,y:t.y};var s,e,r;r=1/(this.pn1-t.y*this.sw);s=this.pn1*t.x*r;e=this.pn1*t.y*this.cw*r;t.x=s*this.cg+e*this.sg;t.y=e*this.cg-s*this.sg;var n=Cs(t.x,t.y);if(Math.abs(n)<F){i.x=0;i.y=t.y}else{var h,a;a=1-n*n*this.pfact;a=(this.p-Math.sqrt(a))/(this.pn1/n+n/this.pn1);h=Math.sqrt(1-a*a);switch(this.mode){case th.OBLIQ:i.y=Math.asin(h*this.sinph0+t.y*a*this.cosph0/n);t.y=(h-this.sinph0*Math.sin(i.y))*n;t.x*=a*this.cosph0;break;case th.EQUIT:i.y=Math.asin(t.y*a/n);t.y=h*n;t.x*=a;break;case th.N_POLE:i.y=Math.asin(h);t.y=-t.y;break;case th.S_POLE:i.y=-Math.asin(h);break}i.x=Math.atan2(t.x,t.y)}t.x=i.x+this.long0;t.y=i.y;return t}var nh=["Tilted_Perspective","tpers"];const hh={init:sh,forward:eh,inverse:rh,names:nh};function ah(){this.flip_axis=this.sweep==="x"?1:0;this.h=Number(this.h);this.radius_g_1=this.h/this.a;if(this.radius_g_1<=0||this.radius_g_1>1e10){throw new Error}this.radius_g=1+this.radius_g_1;this.C=this.radius_g*this.radius_g-1;if(this.es!==0){var t=1-this.es;var i=1/t;this.radius_p=Math.sqrt(t);this.radius_p2=t;this.radius_p_inv2=i;this.shape="ellipse"}else{this.radius_p=1;this.radius_p2=1;this.radius_p_inv2=1;this.shape="sphere"}if(!this.title){this.title="Geostationary Satellite View"}}function oh(t){var i=t.x;var s=t.y;var e,r,n,h;i=i-this.long0;if(this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var a=this.radius_p/Cs(this.radius_p*Math.cos(s),Math.sin(s));r=a*Math.cos(i)*Math.cos(s);n=a*Math.sin(i)*Math.cos(s);h=a*Math.sin(s);if((this.radius_g-r)*r-n*n-h*h*this.radius_p_inv2<0){t.x=Number.NaN;t.y=Number.NaN;return t}e=this.radius_g-r;if(this.flip_axis){t.x=this.radius_g_1*Math.atan(n/Cs(h,e));t.y=this.radius_g_1*Math.atan(h/e)}else{t.x=this.radius_g_1*Math.atan(n/e);t.y=this.radius_g_1*Math.atan(h/Cs(n,e))}}else if(this.shape==="sphere"){e=Math.cos(s);r=Math.cos(i)*e;n=Math.sin(i)*e;h=Math.sin(s);e=this.radius_g-r;if(this.flip_axis){t.x=this.radius_g_1*Math.atan(n/Cs(h,e));t.y=this.radius_g_1*Math.atan(h/e)}else{t.x=this.radius_g_1*Math.atan(n/e);t.y=this.radius_g_1*Math.atan(h/Cs(n,e))}}t.x=t.x*this.a;t.y=t.y*this.a;return t}function fh(t){var i=-1;var s=0;var e=0;var r,n,h,a;t.x=t.x/this.a;t.y=t.y/this.a;if(this.shape==="ellipse"){if(this.flip_axis){e=Math.tan(t.y/this.radius_g_1);s=Math.tan(t.x/this.radius_g_1)*Cs(1,e)}else{s=Math.tan(t.x/this.radius_g_1);e=Math.tan(t.y/this.radius_g_1)*Cs(1,s)}var o=e/this.radius_p;r=s*s+o*o+i*i;n=2*this.radius_g*i;h=n*n-4*r*this.C;if(h<0){t.x=Number.NaN;t.y=Number.NaN;return t}a=(-n-Math.sqrt(h))/(2*r);i=this.radius_g+a*i;s*=a;e*=a;t.x=Math.atan2(s,i);t.y=Math.atan(e*Math.cos(t.x)/i);t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis){e=Math.tan(t.y/this.radius_g_1);s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+e*e)}else{s=Math.tan(t.x/this.radius_g_1);e=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)}r=s*s+e*e+i*i;n=2*this.radius_g*i;h=n*n-4*r*this.C;if(h<0){t.x=Number.NaN;t.y=Number.NaN;return t}a=(-n-Math.sqrt(h))/(2*r);i=this.radius_g+a*i;s*=a;e*=a;t.x=Math.atan2(s,i);t.y=Math.atan(e*Math.cos(t.x)/i)}t.x=t.x+this.long0;return t}var uh=["Geostationary Satellite View","Geostationary_Satellite","geos"];const lh={init:ah,forward:oh,inverse:fh,names:uh};var vh=1.340264,ch=-.081106,dh=893e-6,mh=.003796,ph=Math.sqrt(3)/2;function zh(){this.es=0;this.long0=this.long0!==undefined?this.long0:0}function Mh(t){var i=Ct(t.x-this.long0);var s=t.y;var e=Math.asin(ph*Math.sin(s)),r=e*e,n=r*r*r;t.x=i*Math.cos(e)/(ph*(vh+3*ch*r+n*(7*dh+9*mh*r)));t.y=e*(vh+ch*r+n*(dh+mh*r));t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function _h(t){t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;var i=1e-9,s=12,e=t.y,r,n,h,a,o,f;for(f=0;f<s;++f){r=e*e;n=r*r*r;h=e*(vh+ch*r+n*(dh+mh*r))-t.y;a=vh+3*ch*r+n*(7*dh+9*mh*r);e-=o=h/a;if(Math.abs(o)<i){break}}r=e*e;n=r*r*r;t.x=ph*t.x*(vh+3*ch*r+n*(7*dh+9*mh*r))/Math.cos(e);t.y=Math.asin(Math.sin(e)/ph);t.x=Ct(t.x+this.long0);return t}var gh=["eqearth","Equal Earth","Equal_Earth"];const bh={init:zh,forward:Mh,inverse:_h,names:gh};var xh=1e-10;function wh(){var t;this.phi1=this.lat1;if(Math.abs(this.phi1)<xh){throw new Error}if(this.es){this.en=Ms(this.es);this.m1=_s(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en);this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1);this.inverse=kh;this.forward=yh}else{if(Math.abs(this.phi1)+xh>=R){this.cphi1=0}else{this.cphi1=1/Math.tan(this.phi1)}this.inverse=Nh;this.forward=Eh}}function yh(t){var i=Ct(t.x-(this.long0||0));var s=t.y;var e,r,n;e=this.am1+this.m1-_s(s,r=Math.sin(s),n=Math.cos(s),this.en);r=n*i/(e*Math.sqrt(1-this.es*r*r));t.x=e*Math.sin(r);t.y=this.am1-e*Math.cos(r);t.x=this.a*t.x+(this.x0||0);t.y=this.a*t.y+(this.y0||0);return t}function kh(t){t.x=(t.x-(this.x0||0))/this.a;t.y=(t.y-(this.y0||0))/this.a;var i,s,e,r;s=Cs(t.x,t.y=this.am1-t.y);r=bs(this.am1+this.m1-s,this.es,this.en);if((i=Math.abs(r))<R){i=Math.sin(r);e=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(r)}else if(Math.abs(i-R)<=xh){e=0}else{throw new Error}t.x=Ct(e+(this.long0||0));t.y=De(r);return t}function Eh(t){var i=Ct(t.x-(this.long0||0));var s=t.y;var e,r;r=this.cphi1+this.phi1-s;if(Math.abs(r)>xh){t.x=r*Math.sin(e=i*Math.cos(s)/r);t.y=this.cphi1-r*Math.cos(e)}else{t.x=t.y=0}t.x=this.a*t.x+(this.x0||0);t.y=this.a*t.y+(this.y0||0);return t}function Nh(t){t.x=(t.x-(this.x0||0))/this.a;t.y=(t.y-(this.y0||0))/this.a;var i,s;var e=Cs(t.x,t.y=this.cphi1-t.y);s=this.cphi1+this.phi1-e;if(Math.abs(s)>R){throw new Error}if(Math.abs(Math.abs(s)-R)<=xh){i=0}else{i=e*Math.atan2(t.x,t.y)/Math.cos(s)}t.x=Ct(i+(this.long0||0));t.y=De(s);return t}var Ch=["bonne","Bonne (Werner lat_1=90)"];const Ih={init:wh,names:Ch};function Sh(t){t.Proj.projections.add(Es);t.Proj.projections.add(Ws);t.Proj.projections.add(qs);t.Proj.projections.add(se);t.Proj.projections.add(oe);t.Proj.projections.add(ce);t.Proj.projections.add(ge);t.Proj.projections.add(ke);t.Proj.projections.add(Se);t.Proj.projections.add(Ue);t.Proj.projections.add(ar);t.Proj.projections.add(dr);t.Proj.projections.add(_r);t.Proj.projections.add(kr);t.Proj.projections.add(Sr);t.Proj.projections.add(Lr);t.Proj.projections.add(jr);t.Proj.projections.add(Yr);t.Proj.projections.add(Kr);t.Proj.projections.add(rn);t.Proj.projections.add(fn);t.Proj.projections.add(dn);t.Proj.projections.add(_n);t.Proj.projections.add(yn);t.Proj.projections.add(An);t.Proj.projections.add(Hn);t.Proj.projections.add(Qn);t.Proj.projections.add(hh);t.Proj.projections.add(lh);t.Proj.projections.add(bh);t.Proj.projections.add(Ih)}Ai.defaultDatum="WGS84";Ai.Proj=ci;Ai.WGS84=new Ai.Proj("WGS84");Ai.Point=ns;Ai.toPoint=ki;Ai.defs=mt;Ai.nadgrid=si;Ai.transform=Ii;Ai.mgrs=Vi;Ai.version="__VERSION__";Sh(Ai);var Oh={};Oh.ASSUME_TOUCH=false;Oh.DEFAULT_MAX_ZOOM=42;Oh.DEFAULT_MIN_ZOOM=0;Oh.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5;Oh.DEFAULT_TILE_SIZE=256;Oh.DEFAULT_WMS_VERSION="1.3.0";Oh.ENABLE_CANVAS=true;Oh.ENABLE_PROJ4JS=true;Oh.ENABLE_RASTER_REPROJECTION=true;Oh.ENABLE_WEBGL=true;Oh.DEBUG_WEBGL=true;Oh.INITIAL_ATLAS_SIZE=256;Oh.MAX_ATLAS_SIZE=-1;Oh.MOUSEWHEELZOOM_MAXDELTA=1;Oh.OVERVIEWMAP_MAX_RATIO=.75;Oh.OVERVIEWMAP_MIN_RATIO=.1;Oh.RASTER_REPROJECTION_MAX_SOURCE_TILES=100;Oh.RASTER_REPROJECTION_MAX_SUBDIVISION=10;Oh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25;Oh.SIMPLIFY_TOLERANCE=.5;Oh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024;Oh.VERSION="v4.6.5";Oh.inherits=function(t,i){t.prototype=Object.create(i.prototype);t.prototype.constructor=t};Oh.nullFunction=function(){};Oh.getUid=function(t){return t.ol_uid||(t.ol_uid=++Oh.uidCounter_)};Oh.uidCounter_=0;var Th={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};var Ah={PROPERTYCHANGE:"propertychange"};var Rh={};Rh.assign=typeof Object.assign==="function"?Object.assign:function(t,i){if(t===undefined||t===null){throw new TypeError("Cannot convert undefined or null to object")}var s=Object(t);for(var e=1,r=arguments.length;e<r;++e){var n=arguments[e];if(n!==undefined&&n!==null){for(var h in n){if(n.hasOwnProperty(h)){s[h]=n[h]}}}}return s};Rh.clear=function(t){for(var i in t){delete t[i]}};Rh.getValues=function(t){var i=[];for(var s in t){i.push(t[s])}return i};Rh.isEmpty=function(t){var i;for(i in t){return false}return!i};var Ph={};Ph.bindListener_=function(t){var i=function(i){var s=t.listener;var e=t.bindTo||t.target;if(t.callOnce){Ph.unlistenByKey(t)}return s.call(e,i)};t.boundListener=i;return i};Ph.findListener_=function(t,i,s,e){var r;for(var n=0,h=t.length;n<h;++n){r=t[n];if(r.listener===i&&r.bindTo===s){if(e){r.deleteIndex=n}return r}}return undefined};Ph.getListeners=function(t,i){var s=t.ol_lm;return s?s[i]:undefined};Ph.getListenerMap_=function(t){var i=t.ol_lm;if(!i){i=t.ol_lm={}}return i};Ph.removeListeners_=function(t,i){var s=Ph.getListeners(t,i);if(s){for(var e=0,r=s.length;e<r;++e){t.removeEventListener(i,s[e].boundListener);Rh.clear(s[e])}s.length=0;var n=t.ol_lm;if(n){delete n[i];if(Object.keys(n).length===0){delete t.ol_lm}}}};Ph.listen=function(t,i,s,e,r){var n=Ph.getListenerMap_(t);var h=n[i];if(!h){h=n[i]=[]}var a=Ph.findListener_(h,s,e,false);if(a){if(!r){a.callOnce=false}}else{a={bindTo:e,callOnce:!!r,listener:s,target:t,type:i};t.addEventListener(i,Ph.bindListener_(a));h.push(a)}return a};Ph.listenOnce=function(t,i,s,e){return Ph.listen(t,i,s,e,true)};Ph.unlisten=function(t,i,s,e){var r=Ph.getListeners(t,i);if(r){var n=Ph.findListener_(r,s,e,true);if(n){Ph.unlistenByKey(n)}}};Ph.unlistenByKey=function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=Ph.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);if(s!==-1){i.splice(s,1)}if(i.length===0){Ph.removeListeners_(t.target,t.type)}}Rh.clear(t)}};Ph.unlistenAll=function(t){var i=Ph.getListenerMap_(t);for(var s in i){Ph.removeListeners_(t,s)}};var Lh=function(){};Lh.prototype.disposed_=false;Lh.prototype.dispose=function(){if(!this.disposed_){this.disposed_=true;this.disposeInternal()}};Lh.prototype.disposeInternal=Oh.nullFunction;var Dh=function(t){this.type=t;this.target=null};Dh.prototype.preventDefault=Dh.prototype.stopPropagation=function(){this.propagationStopped=true};Dh.stopPropagation=function(t){t.stopPropagation()};Dh.preventDefault=function(t){t.preventDefault()};var Fh=function(){Lh.call(this);this.pendingRemovals_={};this.dispatching_={};this.listeners_={}};Oh.inherits(Fh,Lh);Fh.prototype.addEventListener=function(t,i){var s=this.listeners_[t];if(!s){s=this.listeners_[t]=[]}if(s.indexOf(i)===-1){s.push(i)}};Fh.prototype.dispatchEvent=function(t){var i=typeof t==="string"?new Dh(t):t;var s=i.type;i.target=this;var e=this.listeners_[s];var r;if(e){if(!(s in this.dispatching_)){this.dispatching_[s]=0;this.pendingRemovals_[s]=0}++this.dispatching_[s];for(var n=0,h=e.length;n<h;++n){if(e[n].call(this,i)===false||i.propagationStopped){r=false;break}}--this.dispatching_[s];if(this.dispatching_[s]===0){var a=this.pendingRemovals_[s];delete this.pendingRemovals_[s];while(a--){this.removeEventListener(s,Oh.nullFunction)}delete this.dispatching_[s]}return r}};Fh.prototype.disposeInternal=function(){Ph.unlistenAll(this)};Fh.prototype.getListeners=function(t){return this.listeners_[t]};Fh.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0};Fh.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var e=s.indexOf(i);if(t in this.pendingRemovals_){s[e]=Oh.nullFunction;++this.pendingRemovals_[t]}else{s.splice(e,1);if(s.length===0){delete this.listeners_[t]}}}};var Wh={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var Gh=function(){Fh.call(this);this.revision_=0};Oh.inherits(Gh,Fh);Gh.unByKey=function(t){if(Array.isArray(t)){for(var i=0,s=t.length;i<s;++i){Ph.unlistenByKey(t[i])}}else{Ph.unlistenByKey(t)}};Gh.prototype.changed=function(){++this.revision_;this.dispatchEvent(Wh.CHANGE)};Gh.prototype.getRevision=function(){return this.revision_};Gh.prototype.on=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=Ph.listen(this,t[n],i,s)}return r}else{return Ph.listen(this,t,i,s)}};Gh.prototype.once=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=Ph.listenOnce(this,t[n],i,s)}return r}else{return Ph.listenOnce(this,t,i,s)}};Gh.prototype.un=function(t,i,s){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;++e){Ph.unlisten(this,t[e],i,s)}return}else{Ph.unlisten(this,t,i,s)}};var jh=function(t){Gh.call(this);Oh.getUid(this);this.values_={};if(t!==undefined){this.setProperties(t)}};Oh.inherits(jh,Gh);jh.changeEventTypeCache_={};jh.getChangeEventType=function(t){return jh.changeEventTypeCache_.hasOwnProperty(t)?jh.changeEventTypeCache_[t]:jh.changeEventTypeCache_[t]="change:"+t};jh.prototype.get=function(t){var i;if(this.values_.hasOwnProperty(t)){i=this.values_[t]}return i};jh.prototype.getKeys=function(){return Object.keys(this.values_)};jh.prototype.getProperties=function(){return Rh.assign({},this.values_)};jh.prototype.notify=function(t,i){var s;s=jh.getChangeEventType(t);this.dispatchEvent(new jh.Event(s,t,i));s=Ah.PROPERTYCHANGE;this.dispatchEvent(new jh.Event(s,t,i))};jh.prototype.set=function(t,i,s){if(s){this.values_[t]=i}else{var e=this.values_[t];this.values_[t]=i;if(e!==i){this.notify(t,e)}}};jh.prototype.setProperties=function(t,i){var s;for(s in t){this.set(s,t[s],i)}};jh.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t];if(!i){this.notify(t,s)}}};jh.Event=function(t,i,s){Dh.call(this,t);this.key=i;this.oldValue=s};Oh.inherits(jh.Event,Dh);var Vh=function(t){var i=Oh.VERSION?Oh.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.";this.code=t;this.name="AssertionError"};Oh.inherits(Vh,Error);var Uh={};Uh.assert=function(t,i){if(!t){throw new Vh(i)}};var qh={};qh.clamp=function(t,i,s){return Math.min(Math.max(t,i),s)};qh.cosh=function(){var t;if("cosh"in Math){t=Math.cosh}else{t=function(t){var i=Math.exp(t);return(i+1/i)/2}}return t}();qh.roundUpToPowerOfTwo=function(t){Uh.assert(0<t,29);return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))};qh.squaredSegmentDistance=function(t,i,s,e,r,n){var h=r-s;var a=n-e;if(h!==0||a!==0){var o=((t-s)*h+(i-e)*a)/(h*h+a*a);if(o>1){s=r;e=n}else if(o>0){s+=h*o;e+=a*o}}return qh.squaredDistance(t,i,s,e)};qh.squaredDistance=function(t,i,s,e){var r=s-t;var n=e-i;return r*r+n*n};qh.solveLinearSystem=function(t){var i=t.length;for(var s=0;s<i;s++){var e=s;var r=Math.abs(t[s][s]);for(var n=s+1;n<i;n++){var h=Math.abs(t[n][s]);if(h>r){r=h;e=n}}if(r===0){return null}var a=t[e];t[e]=t[s];t[s]=a;for(var o=s+1;o<i;o++){var f=-t[o][s]/t[s][s];for(var u=s;u<i+1;u++){if(s==u){t[o][u]=0}else{t[o][u]+=f*t[s][u]}}}}var l=new Array(i);for(var v=i-1;v>=0;v--){l[v]=t[v][i]/t[v][v];for(var c=v-1;c>=0;c--){t[c][i]-=t[c][v]*l[v]}}return l};qh.toDegrees=function(t){return t*180/Math.PI};qh.toRadians=function(t){return t*Math.PI/180};qh.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s};qh.lerp=function(t,i,s){return t+s*(i-t)};var Xh={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Latitude/longitude spherical geodesy formulae taken from
|
|
5
5
|
* http://www.movable-type.co.uk/scripts/latlong.html
|
|
6
6
|
* Licensed under CC-BY-3.0.
|
|
7
7
|
*/var Yh=function(t){this.radius=t};Yh.prototype.geodesicArea=function(t){return Yh.getArea_(t,this.radius)};Yh.prototype.haversineDistance=function(t,i){return Yh.getDistance_(t,i,this.radius)};Yh.prototype.offset=function(t,i,s){var e=qh.toRadians(t[1]);var r=qh.toRadians(t[0]);var n=i/this.radius;var h=Math.asin(Math.sin(e)*Math.cos(n)+Math.cos(e)*Math.sin(n)*Math.cos(s));var a=r+Math.atan2(Math.sin(s)*Math.sin(n)*Math.cos(e),Math.cos(n)-Math.sin(e)*Math.sin(h));return[qh.toDegrees(a),qh.toDegrees(h)]};Yh.DEFAULT_RADIUS=6371008.8;Yh.getLength=function(t,i){var s=i||{};var e=s.radius||Yh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case Xh.POINT:case Xh.MULTI_POINT:{break}case Xh.LINE_STRING:case Xh.LINEAR_RING:{a=t.getCoordinates();h=Yh.getLength_(a,e);break}case Xh.MULTI_LINE_STRING:case Xh.POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){h+=Yh.getLength_(a[f],e)}break}case Xh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];for(l=0,v=o.length;l<v;++l){h+=Yh.getLength_(o[l],e)}}break}case Xh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Yh.getLength(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Yh.getLength_=function(t,i){var s=0;for(var e=0,r=t.length;e<r-1;++e){s+=Yh.getDistance_(t[e],t[e+1],i)}return s};Yh.getDistance_=function(t,i,s){var e=qh.toRadians(t[1]);var r=qh.toRadians(i[1]);var n=(r-e)/2;var h=qh.toRadians(i[0]-t[0])/2;var a=Math.sin(n)*Math.sin(n)+Math.sin(h)*Math.sin(h)*Math.cos(e)*Math.cos(r);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};Yh.getArea=function(t,i){var s=i||{};var e=s.radius||Yh.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case Xh.POINT:case Xh.MULTI_POINT:case Xh.LINE_STRING:case Xh.MULTI_LINE_STRING:case Xh.LINEAR_RING:{break}case Xh.POLYGON:{a=t.getCoordinates();h=Math.abs(Yh.getArea_(a[0],e));for(f=1,u=a.length;f<u;++f){h-=Math.abs(Yh.getArea_(a[f],e))}break}case Xh.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];h+=Math.abs(Yh.getArea_(o[0],e));for(l=1,v=o.length;l<v;++l){h-=Math.abs(Yh.getArea_(o[l],e))}}break}case Xh.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=Yh.getArea(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};Yh.getArea_=function(t,i){var s=0,e=t.length;var r=t[e-1][0];var n=t[e-1][1];for(var h=0;h<e;h++){var a=t[h][0],o=t[h][1];s+=qh.toRadians(a-r)*(2+Math.sin(qh.toRadians(n))+Math.sin(qh.toRadians(o)));r=a;n=o}return s*i*i/2};var Bh={};Bh.binarySearch=function(t,i,s){var e,r;var n=s||Bh.numberSafeCompareFunction;var h=0;var a=t.length;var o=false;while(h<a){e=h+(a-h>>1);r=+n(t[e],i);if(r<0){h=e+1}else{a=e;o=!r}}return o?h:~h};Bh.numberSafeCompareFunction=function(t,i){return t>i?1:t<i?-1:0};Bh.includes=function(t,i){return t.indexOf(i)>=0};Bh.linearFindNearest=function(t,i,s){var e=t.length;if(t[0]<=i){return 0}else if(i<=t[e-1]){return e-1}else{var r;if(s>0){for(r=1;r<e;++r){if(t[r]<i){return r-1}}}else if(s<0){for(r=1;r<e;++r){if(t[r]<=i){return r}}}else{for(r=1;r<e;++r){if(t[r]==i){return r}else if(t[r]<i){if(t[r-1]-i<i-t[r]){return r-1}else{return r}}}}return e-1}};Bh.reverseSubArray=function(t,i,s){while(i<s){var e=t[i];t[i]=t[s];t[s]=e;++i;--s}};Bh.extend=function(t,i){var s;var e=Array.isArray(i)?i:[i];var r=e.length;for(s=0;s<r;s++){t[t.length]=e[s]}};Bh.remove=function(t,i){var s=t.indexOf(i);var e=s>-1;if(e){t.splice(s,1)}return e};Bh.find=function(t,i){var s=t.length>>>0;var e;for(var r=0;r<s;r++){e=t[r];if(i(e,r,t)){return e}}return null};Bh.equals=function(t,i){var s=t.length;if(s!==i.length){return false}for(var e=0;e<s;e++){if(t[e]!==i[e]){return false}}return true};Bh.stableSort=function(t,i){var s=t.length;var e=Array(t.length);var r;for(r=0;r<s;r++){e[r]={index:r,value:t[r]}}e.sort((function(t,s){return i(t.value,s.value)||t.index-s.index}));for(r=0;r<t.length;r++){t[r]=e[r].value}};Bh.findIndex=function(t,i){var s;var e=!t.every((function(e,r){s=r;return!i(e,r,t)}));return e?s:-1};Bh.isSorted=function(t,i,s){var e=i||Bh.numberSafeCompareFunction;return t.every((function(i,r){if(r===0){return true}var n=e(t[r-1],i);return!(n>0||s&&n===0)}))};var Hh={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Jh={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var Zh={};Zh.boundingExtent=function(t){var i=Zh.createEmpty();for(var s=0,e=t.length;s<e;++s){Zh.extendCoordinate(i,t[s])}return i};Zh.boundingExtentXYs_=function(t,i,s){var e=Math.min.apply(null,t);var r=Math.min.apply(null,i);var n=Math.max.apply(null,t);var h=Math.max.apply(null,i);return Zh.createOrUpdate(e,r,n,h,s)};Zh.buffer=function(t,i,s){if(s){s[0]=t[0]-i;s[1]=t[1]-i;s[2]=t[2]+i;s[3]=t[3]+i;return s}else{return[t[0]-i,t[1]-i,t[2]+i,t[3]+i]}};Zh.clone=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t.slice()}};Zh.closestSquaredDistanceXY=function(t,i,s){var e,r;if(i<t[0]){e=t[0]-i}else if(t[2]<i){e=i-t[2]}else{e=0}if(s<t[1]){r=t[1]-s}else if(t[3]<s){r=s-t[3]}else{r=0}return e*e+r*r};Zh.containsCoordinate=function(t,i){return Zh.containsXY(t,i[0],i[1])};Zh.containsExtent=function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]};Zh.containsXY=function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]};Zh.coordinateRelationship=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=i[0];var a=i[1];var o=Jh.UNKNOWN;if(h<s){o=o|Jh.LEFT}else if(h>r){o=o|Jh.RIGHT}if(a<e){o=o|Jh.BELOW}else if(a>n){o=o|Jh.ABOVE}if(o===Jh.UNKNOWN){o=Jh.INTERSECTING}return o};Zh.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};Zh.createOrUpdate=function(t,i,s,e,r){if(r){r[0]=t;r[1]=i;r[2]=s;r[3]=e;return r}else{return[t,i,s,e]}};Zh.createOrUpdateEmpty=function(t){return Zh.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,t)};Zh.createOrUpdateFromCoordinate=function(t,i){var s=t[0];var e=t[1];return Zh.createOrUpdate(s,e,s,e,i)};Zh.createOrUpdateFromCoordinates=function(t,i){var s=Zh.createOrUpdateEmpty(i);return Zh.extendCoordinates(s,t)};Zh.createOrUpdateFromFlatCoordinates=function(t,i,s,e,r){var n=Zh.createOrUpdateEmpty(r);return Zh.extendFlatCoordinates(n,t,i,s,e)};Zh.createOrUpdateFromRings=function(t,i){var s=Zh.createOrUpdateEmpty(i);return Zh.extendRings(s,t)};Zh.equals=function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]};Zh.extend=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[2]>t[2]){t[2]=i[2]}if(i[1]<t[1]){t[1]=i[1]}if(i[3]>t[3]){t[3]=i[3]}return t};Zh.extendCoordinate=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[0]>t[2]){t[2]=i[0]}if(i[1]<t[1]){t[1]=i[1]}if(i[1]>t[3]){t[3]=i[1]}};Zh.extendCoordinates=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Zh.extendCoordinate(t,i[s])}return t};Zh.extendFlatCoordinates=function(t,i,s,e,r){for(;s<e;s+=r){Zh.extendXY(t,i[s],i[s+1])}return t};Zh.extendRings=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Zh.extendCoordinates(t,i[s])}return t};Zh.extendXY=function(t,i,s){t[0]=Math.min(t[0],i);t[1]=Math.min(t[1],s);t[2]=Math.max(t[2],i);t[3]=Math.max(t[3],s)};Zh.forEachCorner=function(t,i,s){var e;e=i.call(s,Zh.getBottomLeft(t));if(e){return e}e=i.call(s,Zh.getBottomRight(t));if(e){return e}e=i.call(s,Zh.getTopRight(t));if(e){return e}e=i.call(s,Zh.getTopLeft(t));if(e){return e}return false};Zh.getArea=function(t){var i=0;if(!Zh.isEmpty(t)){i=Zh.getWidth(t)*Zh.getHeight(t)}return i};Zh.getBottomLeft=function(t){return[t[0],t[1]]};Zh.getBottomRight=function(t){return[t[2],t[1]]};Zh.getCenter=function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]};Zh.getCorner=function(t,i){var s;if(i===Hh.BOTTOM_LEFT){s=Zh.getBottomLeft(t)}else if(i===Hh.BOTTOM_RIGHT){s=Zh.getBottomRight(t)}else if(i===Hh.TOP_LEFT){s=Zh.getTopLeft(t)}else if(i===Hh.TOP_RIGHT){s=Zh.getTopRight(t)}else{Uh.assert(false,13)}return s};Zh.getEnlargedArea=function(t,i){var s=Math.min(t[0],i[0]);var e=Math.min(t[1],i[1]);var r=Math.max(t[2],i[2]);var n=Math.max(t[3],i[3]);return(r-s)*(n-e)};Zh.getForViewAndSize=function(t,i,s,e,r){var n=i*e[0]/2;var h=i*e[1]/2;var a=Math.cos(s);var o=Math.sin(s);var f=n*a;var u=n*o;var l=h*a;var v=h*o;var c=t[0];var d=t[1];var m=c-f+v;var p=c-f-v;var z=c+f-v;var M=c+f+v;var _=d-u-l;var g=d-u+l;var b=d+u+l;var x=d+u-l;return Zh.createOrUpdate(Math.min(m,p,z,M),Math.min(_,g,b,x),Math.max(m,p,z,M),Math.max(_,g,b,x),r)};Zh.getHeight=function(t){return t[3]-t[1]};Zh.getIntersectionArea=function(t,i){var s=Zh.getIntersection(t,i);return Zh.getArea(s)};Zh.getIntersection=function(t,i,s){var e=s?s:Zh.createEmpty();if(Zh.intersects(t,i)){if(t[0]>i[0]){e[0]=t[0]}else{e[0]=i[0]}if(t[1]>i[1]){e[1]=t[1]}else{e[1]=i[1]}if(t[2]<i[2]){e[2]=t[2]}else{e[2]=i[2]}if(t[3]<i[3]){e[3]=t[3]}else{e[3]=i[3]}}return e};Zh.getMargin=function(t){return Zh.getWidth(t)+Zh.getHeight(t)};Zh.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};Zh.getTopLeft=function(t){return[t[0],t[3]]};Zh.getTopRight=function(t){return[t[2],t[3]]};Zh.getWidth=function(t){return t[2]-t[0]};Zh.intersects=function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]};Zh.isEmpty=function(t){return t[2]<t[0]||t[3]<t[1]};Zh.returnOrUpdate=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t}};Zh.scaleFromCenter=function(t,i){var s=(t[2]-t[0])/2*(i-1);var e=(t[3]-t[1])/2*(i-1);t[0]-=s;t[2]+=s;t[1]-=e;t[3]+=e};Zh.intersectsSegment=function(t,i,s){var e=false;var r=Zh.coordinateRelationship(t,i);var n=Zh.coordinateRelationship(t,s);if(r===Jh.INTERSECTING||n===Jh.INTERSECTING){e=true}else{var h=t[0];var a=t[1];var o=t[2];var f=t[3];var u=i[0];var l=i[1];var v=s[0];var c=s[1];var d=(c-l)/(v-u);var m,p;if(!!(n&Jh.ABOVE)&&!(r&Jh.ABOVE)){m=v-(c-f)/d;e=m>=h&&m<=o}if(!e&&!!(n&Jh.RIGHT)&&!(r&Jh.RIGHT)){p=c-(v-o)*d;e=p>=a&&p<=f}if(!e&&!!(n&Jh.BELOW)&&!(r&Jh.BELOW)){m=v-(c-a)/d;e=m>=h&&m<=o}if(!e&&!!(n&Jh.LEFT)&&!(r&Jh.LEFT)){p=c-(v-h)*d;e=p>=a&&p<=f}}return e};Zh.applyTransform=function(t,i,s){var e=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];i(e,e,2);var r=[e[0],e[2],e[4],e[6]];var n=[e[1],e[3],e[5],e[7]];return Zh.boundingExtentXYs_(r,n,s)};var $h={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Kh={};Kh.TRUE=function(){return true};Kh.FALSE=function(){return false};var Qh={};Qh.transform2D=function(t,i,s,e,r,n){var h=n?n:[];var a=0;var o;for(o=i;o<s;o+=e){var f=t[o];var u=t[o+1];h[a++]=r[0]*f+r[2]*u+r[4];h[a++]=r[1]*f+r[3]*u+r[5]}if(n&&h.length!=a){h.length=a}return h};Qh.rotate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=Math.cos(r);var f=Math.sin(r);var u=n[0];var l=n[1];var v=0;for(var c=i;c<s;c+=e){var d=t[c]-u;var m=t[c+1]-l;a[v++]=u+d*o-m*f;a[v++]=l+d*f+m*o;for(var p=c+2;p<c+e;++p){a[v++]=t[p]}}if(h&&a.length!=v){a.length=v}return a};Qh.scale=function(t,i,s,e,r,n,h,a){var o=a?a:[];var f=h[0];var u=h[1];var l=0;for(var v=i;v<s;v+=e){var c=t[v]-f;var d=t[v+1]-u;o[l++]=f+r*c;o[l++]=u+n*d;for(var m=v+2;m<v+e;++m){o[l++]=t[m]}}if(a&&o.length!=l){o.length=l}return o};Qh.translate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=0;var f,u;for(f=i;f<s;f+=e){a[o++]=t[f]+r;a[o++]=t[f+1]+n;for(u=f+2;u<f+e;++u){a[o++]=t[u]}}if(h&&a.length!=o){a.length=o}return a};var ta={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};ta.METERS_PER_UNIT={};ta.METERS_PER_UNIT[ta.DEGREES]=2*Math.PI*6370997/360;ta.METERS_PER_UNIT[ta.FEET]=.3048;ta.METERS_PER_UNIT[ta.METERS]=1;ta.METERS_PER_UNIT[ta.USFEET]=1200/3937;var ia={};ia.cache_=null;ia.set=function(t){ia.cache_=t};ia.get=function(){return ia.cache_||window["proj4"]};var sa=function(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(Oh.ENABLE_PROJ4JS){var s=ia.get();if(typeof s=="function"){var e=s.defs(i);if(e!==undefined){if(e.axis!==undefined&&t.axisOrientation===undefined){this.axisOrientation_=e.axis}if(t.metersPerUnit===undefined){this.metersPerUnit_=e.to_meter}if(t.units===undefined){this.units_=e.units}}}}};sa.prototype.canWrapX=function(){return this.canWrapX_};sa.prototype.getCode=function(){return this.code_};sa.prototype.getExtent=function(){return this.extent_};sa.prototype.getUnits=function(){return this.units_};sa.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ta.METERS_PER_UNIT[this.units_]};sa.prototype.getWorldExtent=function(){return this.worldExtent_};sa.prototype.getAxisOrientation=function(){return this.axisOrientation_};sa.prototype.isGlobal=function(){return this.global_};sa.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)};sa.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};sa.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t};sa.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)};sa.prototype.setWorldExtent=function(t){this.worldExtent_=t};sa.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t};sa.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ea={};ea.Projection_=function(t){sa.call(this,{code:t,units:ta.METERS,extent:ea.EXTENT,global:true,worldExtent:ea.WORLD_EXTENT,getPointResolution:function(t,i){return t/qh.cosh(i[1]/ea.RADIUS)}})};Oh.inherits(ea.Projection_,sa);ea.RADIUS=6378137;ea.HALF_SIZE=Math.PI*ea.RADIUS;ea.EXTENT=[-ea.HALF_SIZE,-ea.HALF_SIZE,ea.HALF_SIZE,ea.HALF_SIZE];ea.WORLD_EXTENT=[-180,-85,180,85];ea.PROJECTIONS=[new ea.Projection_("EPSG:3857"),new ea.Projection_("EPSG:102100"),new ea.Projection_("EPSG:102113"),new ea.Projection_("EPSG:900913"),new ea.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new ea.Projection_("urn:ogc:def:crs:EPSG::3857"),new ea.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")];ea.fromEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}var h=ea.HALF_SIZE;for(var a=0;a<e;a+=r){n[a]=h*t[a]/180;var o=ea.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));if(o>h){o=h}else if(o<-h){o=-h}n[a+1]=o}return n};ea.toEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}for(var h=0;h<e;h+=r){n[h]=180*t[h]/ea.HALF_SIZE;n[h+1]=360*Math.atan(Math.exp(t[h+1]/ea.RADIUS))/Math.PI-90}return n};var ra={};ra.Projection_=function(t,i){sa.call(this,{code:t,units:ta.DEGREES,extent:ra.EXTENT,axisOrientation:i,global:true,metersPerUnit:ra.METERS_PER_UNIT,worldExtent:ra.EXTENT})};Oh.inherits(ra.Projection_,sa);ra.RADIUS=6378137;ra.EXTENT=[-180,-90,180,90];ra.METERS_PER_UNIT=Math.PI*ra.RADIUS/180;ra.PROJECTIONS=[new ra.Projection_("CRS:84"),new ra.Projection_("EPSG:4326","neu"),new ra.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new ra.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new ra.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new ra.Projection_("urn:ogc:def:crs:OGC:2:84"),new ra.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ra.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var na={};na.cache_={};na.clear=function(){na.cache_={}};na.get=function(t){var i=na.cache_;return i[t]||null};na.add=function(t,i){var s=na.cache_;s[t]=i};var ha={};ha.cache_={};ha.clear=function(){ha.cache_={}};ha.add=function(t,i,s){var e=t.getCode();var r=i.getCode();var n=ha.cache_;if(!(e in n)){n[e]={}}n[e][r]=s};ha.remove=function(t,i){var s=t.getCode();var e=i.getCode();var r=ha.cache_;var n=r[s][e];delete r[s][e];if(Rh.isEmpty(r[s])){delete r[s]}return n};ha.get=function(t,i){var s;var e=ha.cache_;if(t in e&&i in e[t]){s=e[t][i]}return s};var aa={};aa.METERS_PER_UNIT=ta.METERS_PER_UNIT;aa.SPHERE_=new Yh(Yh.DEFAULT_RADIUS);if(Oh.ENABLE_PROJ4JS){aa.setProj4=function(t){ia.set(t)}}aa.getPointResolution=function(t,i,s,e){t=aa.get(t);var r;var n=t.getPointResolutionFunc();if(n){r=n(i,s)}else{var h=t.getUnits();if(h==ta.DEGREES&&!e||e==ta.DEGREES){r=i}else{var a=aa.getTransformFromProjections(t,aa.get("EPSG:4326"));var o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=a(o,o,2);var f=aa.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4));var u=aa.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8));r=(f+u)/2;var l=e?ta.METERS_PER_UNIT[e]:t.getMetersPerUnit();if(l!==undefined){r/=l}}}return r};aa.addEquivalentProjections=function(t){aa.addProjections(t);t.forEach((function(i){t.forEach((function(t){if(i!==t){ha.add(i,t,aa.cloneTransform)}}))}))};aa.addEquivalentTransforms=function(t,i,s,e){t.forEach((function(t){i.forEach((function(i){ha.add(t,i,s);ha.add(i,t,e)}))}))};aa.addProjection=function(t){na.add(t.getCode(),t);ha.add(t,t,aa.cloneTransform)};aa.addProjections=function(t){t.forEach(aa.addProjection)};aa.clearAllProjections=function(){na.clear();ha.clear()};aa.createProjection=function(t,i){if(!t){return aa.get(i)}else if(typeof t==="string"){return aa.get(t)}else{return t}};aa.addCoordinateTransforms=function(t,i,s,e){var r=aa.get(t);var n=aa.get(i);ha.add(r,n,aa.createTransformFromCoordinateTransform(s));ha.add(n,r,aa.createTransformFromCoordinateTransform(e))};aa.createTransformFromCoordinateTransform=function(t){return function(i,s,e){var r=i.length;var n=e!==undefined?e:2;var h=s!==undefined?s:new Array(r);var a,o,f;for(o=0;o<r;o+=n){a=t([i[o],i[o+1]]);h[o]=a[0];h[o+1]=a[1];for(f=n-1;f>=2;--f){h[o+f]=i[o+f]}}return h}};aa.fromLonLat=function(t,i){return aa.transform(t,"EPSG:4326",i!==undefined?i:"EPSG:3857")};aa.toLonLat=function(t,i){var s=aa.transform(t,i!==undefined?i:"EPSG:3857","EPSG:4326");var e=s[0];if(e<-180||e>180){s[0]=qh.modulo(e+180,360)-180}return s};aa.get=function(t){var i=null;if(t instanceof sa){i=t}else if(typeof t==="string"){var s=t;i=na.get(s);if(Oh.ENABLE_PROJ4JS&&!i){var e=ia.get();if(typeof e=="function"&&e.defs(s)!==undefined){i=new sa({code:s});aa.addProjection(i)}}}return i};aa.equivalent=function(t,i){if(t===i){return true}var s=t.getUnits()===i.getUnits();if(t.getCode()===i.getCode()){return s}else{var e=aa.getTransformFromProjections(t,i);return e===aa.cloneTransform&&s}};aa.getTransform=function(t,i){var s=aa.get(t);var e=aa.get(i);return aa.getTransformFromProjections(s,e)};aa.getTransformFromProjections=function(t,i){var s=t.getCode();var e=i.getCode();var r=ha.get(s,e);if(Oh.ENABLE_PROJ4JS&&!r){var n=ia.get();if(typeof n=="function"){var h=n.defs(s);var a=n.defs(e);if(h!==undefined&&a!==undefined){if(h===a){aa.addEquivalentProjections([i,t])}else{var o=n(e,s);aa.addCoordinateTransforms(i,t,o.forward,o.inverse)}r=ha.get(s,e)}}}if(!r){r=aa.identityTransform}return r};aa.identityTransform=function(t,i,s){if(i!==undefined&&t!==i){for(var e=0,r=t.length;e<r;++e){i[e]=t[e]}t=i}return t};aa.cloneTransform=function(t,i,s){var e;if(i!==undefined){for(var r=0,n=t.length;r<n;++r){i[r]=t[r]}e=i}else{e=t.slice()}return e};aa.transform=function(t,i,s){var e=aa.getTransform(i,s);return e(t,undefined,t.length)};aa.transformExtent=function(t,i,s){var e=aa.getTransform(i,s);return Zh.applyTransform(t,e)};aa.transformWithProjections=function(t,i,s){var e=aa.getTransformFromProjections(i,s);return e(t)};aa.addCommon=function(){aa.addEquivalentProjections(ea.PROJECTIONS);aa.addEquivalentProjections(ra.PROJECTIONS);aa.addEquivalentTransforms(ra.PROJECTIONS,ea.PROJECTIONS,ea.fromEPSG4326,ea.toEPSG4326)};aa.addCommon();var oa={};oa.tmp_=new Array(6);oa.create=function(){return[1,0,0,1,0,0]};oa.reset=function(t){return oa.set(t,1,0,0,1,0,0)};oa.multiply=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];var o=i[0];var f=i[1];var u=i[2];var l=i[3];var v=i[4];var c=i[5];t[0]=s*o+r*f;t[1]=e*o+n*f;t[2]=s*u+r*l;t[3]=e*u+n*l;t[4]=s*v+r*c+h;t[5]=e*v+n*c+a;return t};oa.set=function(t,i,s,e,r,n,h){t[0]=i;t[1]=s;t[2]=e;t[3]=r;t[4]=n;t[5]=h;return t};oa.setFromArray=function(t,i){t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];return t};oa.apply=function(t,i){var s=i[0],e=i[1];i[0]=t[0]*s+t[2]*e+t[4];i[1]=t[1]*s+t[3]*e+t[5];return i};oa.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);return oa.multiply(t,oa.set(oa.tmp_,s,e,-e,s,0,0))};oa.scale=function(t,i,s){return oa.multiply(t,oa.set(oa.tmp_,i,0,0,s,0,0))};oa.translate=function(t,i,s){return oa.multiply(t,oa.set(oa.tmp_,1,0,0,1,i,s))};oa.compose=function(t,i,s,e,r,n,h,a){var o=Math.sin(n);var f=Math.cos(n);t[0]=e*f;t[1]=r*o;t[2]=-e*o;t[3]=r*f;t[4]=h*e*f-a*e*o+i;t[5]=h*r*o+a*r*f+s;return t};oa.invert=function(t){var i=oa.determinant(t);Uh.assert(i!==0,32);var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];t[0]=n/i;t[1]=-e/i;t[2]=-r/i;t[3]=s/i;t[4]=(r*a-n*h)/i;t[5]=-(s*a-e*h)/i;return t};oa.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var fa=function(){jh.call(this);this.extent_=Zh.createEmpty();this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.tmpTransform_=oa.create()};Oh.inherits(fa,jh);fa.prototype.clone=function(){};fa.prototype.closestPointXY=function(t,i,s,e){};fa.prototype.getClosestPoint=function(t,i){var s=i?i:[NaN,NaN];this.closestPointXY(t[0],t[1],s,Infinity);return s};fa.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])};fa.prototype.computeExtent=function(t){};fa.prototype.containsXY=Kh.FALSE;fa.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){this.extent_=this.computeExtent(this.extent_);this.extentRevision_=this.getRevision()}return Zh.returnOrUpdate(this.extent_,t)};fa.prototype.rotate=function(t,i){};fa.prototype.scale=function(t,i,s){};fa.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)};fa.prototype.getSimplifiedGeometry=function(t){};fa.prototype.getType=function(){};fa.prototype.applyTransform=function(t){};fa.prototype.intersectsExtent=function(t){};fa.prototype.translate=function(t,i){};fa.prototype.transform=function(t,i){var s=this.tmpTransform_;t=aa.get(t);var e=t.getUnits()==ta.TILE_PIXELS?function(e,r,n){var h=t.getExtent();var a=t.getWorldExtent();var o=Zh.getHeight(a)/Zh.getHeight(h);oa.compose(s,a[0],a[3],o,-o,0,0,0);Qh.transform2D(e,0,e.length,n,s,r);return aa.getTransform(t,i)(e,r,n)}:aa.getTransform(t,i);this.applyTransform(e);return this};var ua=function(){fa.call(this);this.layout=$h.XY;this.stride=2;this.flatCoordinates=null};Oh.inherits(ua,fa);ua.getLayoutForStride_=function(t){var i;if(t==2){i=$h.XY}else if(t==3){i=$h.XYZ}else if(t==4){i=$h.XYZM}return i};ua.getStrideForLayout=function(t){var i;if(t==$h.XY){i=2}else if(t==$h.XYZ||t==$h.XYM){i=3}else if(t==$h.XYZM){i=4}return i};ua.prototype.containsXY=Kh.FALSE;ua.prototype.computeExtent=function(t){return Zh.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};ua.prototype.getCoordinates=function(){};ua.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};ua.prototype.getFlatCoordinates=function(){return this.flatCoordinates};ua.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};ua.prototype.getLayout=function(){return this.layout};ua.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()){Rh.clear(this.simplifiedGeometryCache);this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i)){return this.simplifiedGeometryCache[i]}else{var s=this.getSimplifiedGeometryInternal(t);var e=s.getFlatCoordinates();if(e.length<this.flatCoordinates.length){this.simplifiedGeometryCache[i]=s;return s}else{this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}}};ua.prototype.getSimplifiedGeometryInternal=function(t){return this};ua.prototype.getStride=function(){return this.stride};ua.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=ua.getStrideForLayout(t);this.layout=t;this.flatCoordinates=i};ua.prototype.setCoordinates=function(t,i){};ua.prototype.setLayout=function(t,i,s){var e;if(t){e=ua.getStrideForLayout(t)}else{var r;for(r=0;r<s;++r){if(i.length===0){this.layout=$h.XY;this.stride=2;return}else{i=i[0]}}e=i.length;t=ua.getLayoutForStride_(e)}this.layout=t;this.stride=e};ua.prototype.applyTransform=function(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}};ua.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Qh.rotate(s,0,s.length,e,t,i,s);this.changed()}};ua.prototype.scale=function(t,i,s){var e=i;if(e===undefined){e=t}var r=s;if(!r){r=Zh.getCenter(this.getExtent())}var n=this.getFlatCoordinates();if(n){var h=this.getStride();Qh.scale(n,0,n.length,h,t,e,r,n);this.changed()}};ua.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();Qh.translate(s,0,s.length,e,t,i,s);this.changed()}};ua.transform2D=function(t,i,s){var e=t.getFlatCoordinates();if(!e){return null}else{var r=t.getStride();return Qh.transform2D(e,0,e.length,r,i,s)}};var la={};la.linearRing=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=h*a-n*o;n=a;h=o}return r/2};la.linearRings=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=la.linearRing(t,i,a,e);i=a}return r};la.linearRingss=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=la.linearRings(t,i,a,e);i=a[a.length-1]}return r};var va={};va.point=function(t,i,s,e,r,n,h){var a=t[i];var o=t[i+1];var f=t[s]-a;var u=t[s+1]-o;var l,v;if(f===0&&u===0){v=i}else{var c=((r-a)*f+(n-o)*u)/(f*f+u*u);if(c>1){v=s}else if(c>0){for(l=0;l<e;++l){h[l]=qh.lerp(t[i+l],t[s+l],c)}h.length=e;return}else{v=i}}for(l=0;l<e;++l){h[l]=t[v+l]}h.length=e};va.getMaxSquaredDelta=function(t,i,s,e,r){var n=t[i];var h=t[i+1];for(i+=e;i<s;i+=e){var a=t[i];var o=t[i+1];var f=qh.squaredDistance(n,h,a,o);if(f>r){r=f}n=a;h=o}return r};va.getsMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=va.getMaxSquaredDelta(t,i,a,e,r);i=a}return r};va.getssMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=va.getsMaxSquaredDelta(t,i,a,e,r);i=a[a.length-1]}return r};va.getClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){if(i==s){return f}var l,v;if(r===0){v=qh.squaredDistance(h,a,t[i],t[i+1]);if(v<f){for(l=0;l<e;++l){o[l]=t[i+l]}o.length=e;return v}else{return f}}var c=u?u:[NaN,NaN];var d=i+e;while(d<s){va.point(t,d-e,d,e,h,a,c);v=qh.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e;d+=e}else{d+=e*Math.max((Math.sqrt(v)-Math.sqrt(f))/r|0,1)}}if(n){va.point(t,s-e,i,e,h,a,c);v=qh.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e}}return f};va.getsClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=va.getClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d}return f};va.getssClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=va.getsClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d[d.length-1]}return f};var ca={};ca.coordinate=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){t[i++]=s[r]}return i};ca.coordinates=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){var h=s[r];var a;for(a=0;a<e;++a){t[i++]=h[a]}}return i};ca.coordinatess=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=ca.coordinates(t,i,s[a],e);n[h++]=f;i=f}n.length=h;return n};ca.coordinatesss=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=ca.coordinatess(t,i,s[a],e,n[h]);n[h++]=f;i=f[f.length-1]}n.length=h;return n};var da={};da.coordinates=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a;for(a=i;a<s;a+=e){n[h++]=t.slice(a,a+e)}n.length=h;return n};da.coordinatess=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=da.coordinates(t,i,f,e,n[h]);i=f}n.length=h;return n};da.coordinatesss=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=da.coordinatess(t,i,f,e,n[h]);i=f[f.length-1]}n.length=h;return n};var ma={};ma.lineString=function(t,i,s,e,r,n,h){var a=h!==undefined?h:[];if(!n){s=ma.radialDistance(t,i,s,e,r,a,0);t=a;i=0;e=2}a.length=ma.douglasPeucker(t,i,s,e,r,a,0);return a};ma.douglasPeucker=function(t,i,s,e,r,n,h){var a=(s-i)/e;if(a<3){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var o=new Array(a);o[0]=1;o[a-1]=1;var f=[i,s-e];var u=0;var l;while(f.length>0){var v=f.pop();var c=f.pop();var d=0;var m=t[c];var p=t[c+1];var z=t[v];var M=t[v+1];for(l=c+e;l<v;l+=e){var _=t[l];var g=t[l+1];var b=qh.squaredSegmentDistance(_,g,m,p,z,M);if(b>d){u=l;d=b}}if(d>r){o[(u-i)/e]=1;if(c+e<u){f.push(c,u)}if(u+e<v){f.push(u,v)}}}for(l=0;l<a;++l){if(o[l]){n[h++]=t[i+l*e];n[h++]=t[i+l*e+1]}}return h};ma.douglasPeuckers=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=ma.douglasPeucker(t,i,u,e,r,n,h);a.push(h);i=u}return h};ma.douglasPeuckerss=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=ma.douglasPeuckers(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};ma.radialDistance=function(t,i,s,e,r,n,h){if(s<=i+e){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var a=t[i];var o=t[i+1];n[h++]=a;n[h++]=o;var f=a;var u=o;for(i+=e;i<s;i+=e){f=t[i];u=t[i+1];if(qh.squaredDistance(a,o,f,u)>r){n[h++]=f;n[h++]=u;a=f;o=u}}if(f!=a||u!=o){n[h++]=f;n[h++]=u}return h};ma.snap=function(t,i){return i*Math.round(t/i)};ma.quantize=function(t,i,s,e,r,n,h){if(i==s){return h}var a=ma.snap(t[i],r);var o=ma.snap(t[i+1],r);i+=e;n[h++]=a;n[h++]=o;var f,u;do{f=ma.snap(t[i],r);u=ma.snap(t[i+1],r);i+=e;if(i==s){n[h++]=f;n[h++]=u;return h}}while(f==a&&u==o);while(i<s){var l,v;l=ma.snap(t[i],r);v=ma.snap(t[i+1],r);i+=e;if(l==f&&v==u){continue}var c=f-a;var d=u-o;var m=l-a;var p=v-o;if(c*p==d*m&&(c<0&&m<c||c==m||c>0&&m>c)&&(d<0&&p<d||d==p||d>0&&p>d)){f=l;u=v;continue}n[h++]=f;n[h++]=u;a=f;o=u;f=l;u=v}n[h++]=f;n[h++]=u;return h};ma.quantizes=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=ma.quantize(t,i,u,e,r,n,h);a.push(h);i=u}return h};ma.quantizess=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=ma.quantizes(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};var pa=function(t,i){ua.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};Oh.inherits(pa,ua);pa.prototype.clone=function(){var t=new pa(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};pa.prototype.closestPointXY=function(t,i,s,e){if(e<Zh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(va.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return va.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,i,s,e)};pa.prototype.getArea=function(){return la.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};pa.prototype.getCoordinates=function(){return da.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};pa.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=ma.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new pa(null);s.setFlatCoordinates($h.XY,i);return s};pa.prototype.getType=function(){return Xh.LINEAR_RING};pa.prototype.intersectsExtent=function(t){};pa.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates($h.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=ca.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};pa.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var za=function(t,i){ua.call(this);this.setCoordinates(t,i)};Oh.inherits(za,ua);za.prototype.clone=function(){var t=new za(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};za.prototype.closestPointXY=function(t,i,s,e){var r=this.flatCoordinates;var n=qh.squaredDistance(t,i,r[0],r[1]);if(n<e){var h=this.stride;var a;for(a=0;a<h;++a){s[a]=r[a]}s.length=h;return n}else{return e}};za.prototype.getCoordinates=function(){return!this.flatCoordinates?[]:this.flatCoordinates.slice()};za.prototype.computeExtent=function(t){return Zh.createOrUpdateFromCoordinate(this.flatCoordinates,t)};za.prototype.getType=function(){return Xh.POINT};za.prototype.intersectsExtent=function(t){return Zh.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])};za.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates($h.XY,null)}else{this.setLayout(i,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=ca.coordinate(this.flatCoordinates,0,t,this.stride);this.changed()}};za.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Ma={};Ma.linearRingContainsExtent=function(t,i,s,e,r){var n=Zh.forEachCorner(r,(function(r){return!Ma.linearRingContainsXY(t,i,s,e,r[0],r[1])}));return!n};Ma.linearRingContainsXY=function(t,i,s,e,r,n){var h=0;var a=t[s-e];var o=t[s-e+1];for(;i<s;i+=e){var f=t[i];var u=t[i+1];if(o<=n){if(u>n&&(f-a)*(n-o)-(r-a)*(u-o)>0){h++}}else if(u<=n&&(f-a)*(n-o)-(r-a)*(u-o)<0){h--}a=f;o=u}return h!==0};Ma.linearRingsContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}if(!Ma.linearRingContainsXY(t,i,s[0],e,r,n)){return false}var h,a;for(h=1,a=s.length;h<a;++h){if(Ma.linearRingContainsXY(t,s[h-1],s[h],e,r,n)){return false}}return true};Ma.linearRingssContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];if(Ma.linearRingsContainsXY(t,i,o,e,r,n)){return true}i=o[o.length-1]}return false};var _a={};_a.linearRings=function(t,i,s,e,r,n,h){var a,o,f,u,l,v,c;var d=r[n+1];var m=[];for(var p=0,z=s.length;p<z;++p){var M=s[p];u=t[M-e];v=t[M-e+1];for(a=i;a<M;a+=e){l=t[a];c=t[a+1];if(d<=v&&c<=d||v<=d&&d<=c){f=(d-v)/(c-v)*(l-u)+u;m.push(f)}u=l;v=c}}var _=NaN;var g=-Infinity;m.sort(Bh.numberSafeCompareFunction);u=m[0];for(a=1,o=m.length;a<o;++a){l=m[a];var b=Math.abs(l-u);if(b>g){f=(u+l)/2;if(Ma.linearRingsContainsXY(t,i,s,e,f,d)){_=f;g=b}}u=l}if(isNaN(_)){_=r[n]}if(h){h.push(_,d,g);return h}else{return[_,d,g]}};_a.linearRingss=function(t,i,s,e,r){var n=[];var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];n=_a.linearRings(t,i,o,e,r,2*h,n);i=o[o.length-1]}return n};var ga={};ga.forEach=function(t,i,s,e,r,n){var h=[t[i],t[i+1]];var a=[];var o;for(;i+e<s;i+=e){a[0]=t[i+e];a[1]=t[i+e+1];o=r.call(n,h,a);if(o){return o}h[0]=a[0];h[1]=a[1]}return false};var ba={};ba.lineString=function(t,i,s,e,r){var n=Zh.extendFlatCoordinates(Zh.createEmpty(),t,i,s,e);if(!Zh.intersects(r,n)){return false}if(Zh.containsExtent(r,n)){return true}if(n[0]>=r[0]&&n[2]<=r[2]){return true}if(n[1]>=r[1]&&n[3]<=r[3]){return true}return ga.forEach(t,i,s,e,(function(t,i){return Zh.intersectsSegment(r,t,i)}))};ba.lineStrings=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(ba.lineString(t,i,s[n],e,r)){return true}i=s[n]}return false};ba.linearRing=function(t,i,s,e,r){if(ba.lineString(t,i,s,e,r)){return true}if(Ma.linearRingContainsXY(t,i,s,e,r[0],r[1])){return true}if(Ma.linearRingContainsXY(t,i,s,e,r[0],r[3])){return true}if(Ma.linearRingContainsXY(t,i,s,e,r[2],r[1])){return true}if(Ma.linearRingContainsXY(t,i,s,e,r[2],r[3])){return true}return false};ba.linearRings=function(t,i,s,e,r){if(!ba.linearRing(t,i,s[0],e,r)){return false}if(s.length===1){return true}var n,h;for(n=1,h=s.length;n<h;++n){if(Ma.linearRingContainsExtent(t,s[n-1],s[n],e,r)){return false}}return true};ba.linearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];if(ba.linearRings(t,i,a,e,r)){return true}i=a[a.length-1]}return false};var xa={};xa.coordinates=function(t,i,s,e){while(i<s-e){var r;for(r=0;r<e;++r){var n=t[i+r];t[i+r]=t[s-e+r];t[s-e+r]=n}i+=e;s-=e}};var wa={};wa.linearRingIsClockwise=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=(a-n)*(o+h);n=a;h=o}return r>0};wa.linearRingsAreOriented=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=wa.linearRingIsClockwise(t,i,o,e);if(h===0){if(n&&f||!n&&!f){return false}}else{if(n&&!f||!n&&f){return false}}i=o}return true};wa.linearRingssAreOriented=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(!wa.linearRingsAreOriented(t,i,s[n],e,r)){return false}}return true};wa.orientLinearRings=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=wa.linearRingIsClockwise(t,i,o,e);var u=h===0?n&&f||!n&&!f:n&&!f||!n&&f;if(u){xa.coordinates(t,i,o,e)}i=o}return i};wa.orientLinearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){i=wa.orientLinearRings(t,i,s[n],e,r)}return i};var ya=function(t,i){ua.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(t,i)};Oh.inherits(ya,ua);ya.prototype.appendLinearRing=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{Bh.extend(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()};ya.prototype.clone=function(){var t=new ya(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return t};ya.prototype.closestPointXY=function(t,i,s,e){if(e<Zh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(va.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return va.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,i,s,e)};ya.prototype.containsXY=function(t,i){return Ma.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)};ya.prototype.getArea=function(){return la.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};ya.prototype.getCoordinates=function(t){var i;if(t!==undefined){i=this.getOrientedFlatCoordinates().slice();wa.orientLinearRings(i,0,this.ends_,this.stride,t)}else{i=this.flatCoordinates}return da.coordinatess(i,0,this.ends_,this.stride)};ya.prototype.getEnds=function(){return this.ends_};ya.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Zh.getCenter(this.getExtent());this.flatInteriorPoint_=_a.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};ya.prototype.getInteriorPoint=function(){return new za(this.getFlatInteriorPoint(),$h.XYM)};ya.prototype.getLinearRingCount=function(){return this.ends_.length};ya.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t){return null}var i=new pa(null);i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]));return i};ya.prototype.getLinearRings=function(){var t=this.layout;var i=this.flatCoordinates;var s=this.ends_;var e=[];var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];var o=new pa(null);o.setFlatCoordinates(t,i.slice(r,a));e.push(o);r=a}return e};ya.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;if(wa.linearRingsAreOriented(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=wa.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};ya.prototype.getSimplifiedGeometryInternal=function(t){var i=[];var s=[];i.length=ma.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var e=new ya(null);e.setFlatCoordinates($h.XY,i,s);return e};ya.prototype.getType=function(){return Xh.POLYGON};ya.prototype.intersectsExtent=function(t){return ba.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)};ya.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates($h.XY,null,this.ends_)}else{this.setLayout(i,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}var s=ca.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=s.length===0?0:s[s.length-1];this.changed()}};ya.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i);this.ends_=s;this.changed()};ya.circular=function(t,i,s,e){var r=e?e:32;var n=[];var h;for(h=0;h<r;++h){Bh.extend(n,t.offset(i,s,2*Math.PI*h/r))}n.push(n[0],n[1]);var a=new ya(null);a.setFlatCoordinates($h.XY,n,[n.length]);return a};ya.fromExtent=function(t){var i=t[0];var s=t[1];var e=t[2];var r=t[3];var n=[i,s,i,r,e,r,e,s,i,s];var h=new ya(null);h.setFlatCoordinates($h.XY,n,[n.length]);return h};ya.fromCircle=function(t,i,s){var e=i?i:32;var r=t.getStride();var n=t.getLayout();var h=new ya(null,n);var a=r*(e+1);var o=new Array(a);for(var f=0;f<a;f++){o[f]=0}var u=[o.length];h.setFlatCoordinates(n,o,u);ya.makeRegular(h,t.getCenter(),t.getRadius(),s);return h};ya.makeRegular=function(t,i,s,e){var r=t.getFlatCoordinates();var n=t.getLayout();var h=t.getStride();var a=t.getEnds();var o=r.length/h-1;var f=e?e:0;var u,l;for(var v=0;v<=o;++v){l=v*h;u=f+qh.modulo(v,o)*2*Math.PI/o;r[l]=i[0]+s*Math.cos(u);r[l+1]=i[1]+s*Math.sin(u)}t.setFlatCoordinates(n,r,a)};var ka={};ka.ONE=1;ka.SRC_ALPHA=770;ka.COLOR_ATTACHMENT0=36064;ka.COLOR_BUFFER_BIT=16384;ka.TRIANGLES=4;ka.TRIANGLE_STRIP=5;ka.ONE_MINUS_SRC_ALPHA=771;ka.ARRAY_BUFFER=34962;ka.ELEMENT_ARRAY_BUFFER=34963;ka.STREAM_DRAW=35040;ka.STATIC_DRAW=35044;ka.DYNAMIC_DRAW=35048;ka.CULL_FACE=2884;ka.BLEND=3042;ka.STENCIL_TEST=2960;ka.DEPTH_TEST=2929;ka.SCISSOR_TEST=3089;ka.UNSIGNED_BYTE=5121;ka.UNSIGNED_SHORT=5123;ka.UNSIGNED_INT=5125;ka.FLOAT=5126;ka.RGBA=6408;ka.FRAGMENT_SHADER=35632;ka.VERTEX_SHADER=35633;ka.LINK_STATUS=35714;ka.LINEAR=9729;ka.TEXTURE_MAG_FILTER=10240;ka.TEXTURE_MIN_FILTER=10241;ka.TEXTURE_WRAP_S=10242;ka.TEXTURE_WRAP_T=10243;ka.TEXTURE_2D=3553;ka.TEXTURE0=33984;ka.CLAMP_TO_EDGE=33071;ka.COMPILE_STATUS=35713;ka.FRAMEBUFFER=36160;ka.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];ka.getContext=function(t,i){var s,e,r=ka.CONTEXT_IDS_.length;for(e=0;e<r;++e){try{s=t.getContext(ka.CONTEXT_IDS_[e],i);if(s){return s}}catch(t){}}return null};var Ea={};var Na=typeof navigator!=="undefined"?navigator.userAgent.toLowerCase():"";Ea.FIREFOX=Na.indexOf("firefox")!==-1;Ea.SAFARI=Na.indexOf("safari")!==-1&&Na.indexOf("chrom")==-1;Ea.WEBKIT=Na.indexOf("webkit")!==-1&&Na.indexOf("edge")==-1;Ea.MAC=Na.indexOf("macintosh")!==-1;Ea.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1;Ea.CANVAS_LINE_DASH=false;Ea.CANVAS=Oh.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window)){return false}try{var t=document.createElement("CANVAS").getContext("2d");if(!t){return false}else{if(t.setLineDash!==undefined){Ea.CANVAS_LINE_DASH=true}return true}}catch(t){return false}}();Ea.DEVICE_ORIENTATION="DeviceOrientationEvent"in window;Ea.GEOLOCATION="geolocation"in navigator;Ea.TOUCH=Oh.ASSUME_TOUCH||"ontouchstart"in window;Ea.POINTER="PointerEvent"in window;Ea.MSPOINTER=!!navigator.msPointerEnabled;(function(){if(Oh.ENABLE_WEBGL){var t=false;var i;var s=[];if("WebGLRenderingContext"in window){try{var e=document.createElement("CANVAS");var r=ka.getContext(e,{failIfMajorPerformanceCaveat:true});if(r){t=true;i=r.getParameter(r.MAX_TEXTURE_SIZE);s=r.getSupportedExtensions()}}catch(t){}}Ea.WEBGL=t;Oh.WEBGL_EXTENSIONS=s;Oh.WEBGL_MAX_TEXTURE_SIZE=i}})();var Ca=function(t){jh.call(this);var i=t||{};this.position_=null;this.transform_=aa.identityTransform;this.sphere_=new Yh(ra.RADIUS);this.watchId_=undefined;Ph.listen(this,jh.getChangeEventType(Th.PROJECTION),this.handleProjectionChanged_,this);Ph.listen(this,jh.getChangeEventType(Th.TRACKING),this.handleTrackingChanged_,this);if(i.projection!==undefined){this.setProjection(i.projection)}if(i.trackingOptions!==undefined){this.setTrackingOptions(i.trackingOptions)}this.setTracking(i.tracking!==undefined?i.tracking:false)};Oh.inherits(Ca,jh);Ca.prototype.disposeInternal=function(){this.setTracking(false);jh.prototype.disposeInternal.call(this)};Ca.prototype.handleProjectionChanged_=function(){var t=this.getProjection();if(t){this.transform_=aa.getTransformFromProjections(aa.get("EPSG:4326"),t);if(this.position_){this.set(Th.POSITION,this.transform_(this.position_))}}};Ca.prototype.handleTrackingChanged_=function(){if(Ea.GEOLOCATION){var t=this.getTracking();if(t&&this.watchId_===undefined){this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions())}else if(!t&&this.watchId_!==undefined){navigator.geolocation.clearWatch(this.watchId_);this.watchId_=undefined}}};Ca.prototype.positionChange_=function(t){var i=t.coords;this.set(Th.ACCURACY,i.accuracy);this.set(Th.ALTITUDE,i.altitude===null?undefined:i.altitude);this.set(Th.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?undefined:i.altitudeAccuracy);this.set(Th.HEADING,i.heading===null?undefined:qh.toRadians(i.heading));if(!this.position_){this.position_=[i.longitude,i.latitude]}else{this.position_[0]=i.longitude;this.position_[1]=i.latitude}var s=this.transform_(this.position_);this.set(Th.POSITION,s);this.set(Th.SPEED,i.speed===null?undefined:i.speed);var e=ya.circular(this.sphere_,this.position_,i.accuracy);e.applyTransform(this.transform_);this.set(Th.ACCURACY_GEOMETRY,e);this.changed()};Ca.prototype.positionError_=function(t){t.type=Wh.ERROR;this.setTracking(false);this.dispatchEvent(t)};Ca.prototype.getAccuracy=function(){return this.get(Th.ACCURACY)};Ca.prototype.getAccuracyGeometry=function(){return this.get(Th.ACCURACY_GEOMETRY)||null};Ca.prototype.getAltitude=function(){return this.get(Th.ALTITUDE)};Ca.prototype.getAltitudeAccuracy=function(){return this.get(Th.ALTITUDE_ACCURACY)};Ca.prototype.getHeading=function(){return this.get(Th.HEADING)};Ca.prototype.getPosition=function(){return this.get(Th.POSITION)};Ca.prototype.getProjection=function(){return this.get(Th.PROJECTION)};Ca.prototype.getSpeed=function(){return this.get(Th.SPEED)};Ca.prototype.getTracking=function(){return this.get(Th.TRACKING)};Ca.prototype.getTrackingOptions=function(){return this.get(Th.TRACKING_OPTIONS)};Ca.prototype.setProjection=function(t){this.set(Th.PROJECTION,aa.get(t))};Ca.prototype.setTracking=function(t){this.set(Th.TRACKING,t)};Ca.prototype.setTrackingOptions=function(t){this.set(Th.TRACKING_OPTIONS,t)};var Ia={ADD:"add",REMOVE:"remove"};var Sa=function(t,i){jh.call(this);var s=i||{};this.unique_=!!s.unique;this.array_=t?t:[];if(this.unique_){for(var e=0,r=this.array_.length;e<r;++e){this.assertUnique_(this.array_[e],e)}}this.updateLength_()};Oh.inherits(Sa,jh);Sa.prototype.clear=function(){while(this.getLength()>0){this.pop()}};Sa.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i){this.push(t[i])}return this};Sa.prototype.forEach=function(t,i){var s=i?t.bind(i):t;var e=this.array_;for(var r=0,n=e.length;r<n;++r){s(e[r],r,e)}};Sa.prototype.getArray=function(){return this.array_};Sa.prototype.item=function(t){return this.array_[t]};Sa.prototype.getLength=function(){return this.get(Sa.Property_.LENGTH)};Sa.prototype.insertAt=function(t,i){if(this.unique_){this.assertUnique_(i)}this.array_.splice(t,0,i);this.updateLength_();this.dispatchEvent(new Sa.Event(Ia.ADD,i))};Sa.prototype.pop=function(){return this.removeAt(this.getLength()-1)};Sa.prototype.push=function(t){if(this.unique_){this.assertUnique_(t)}var i=this.getLength();this.insertAt(i,t);return this.getLength()};Sa.prototype.remove=function(t){var i=this.array_;var s,e;for(s=0,e=i.length;s<e;++s){if(i[s]===t){return this.removeAt(s)}}return undefined};Sa.prototype.removeAt=function(t){var i=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new Sa.Event(Ia.REMOVE,i));return i};Sa.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){if(this.unique_){this.assertUnique_(i,t)}var e=this.array_[t];this.array_[t]=i;this.dispatchEvent(new Sa.Event(Ia.REMOVE,e));this.dispatchEvent(new Sa.Event(Ia.ADD,i))}else{var r;for(r=s;r<t;++r){this.insertAt(r,undefined)}this.insertAt(t,i)}};Sa.prototype.updateLength_=function(){this.set(Sa.Property_.LENGTH,this.array_.length)};Sa.prototype.assertUnique_=function(t,i){for(var s=0,e=this.array_.length;s<e;++s){if(this.array_[s]===t&&s!==i){throw new Vh(58)}}};Sa.Property_={LENGTH:"length"};Sa.Event=function(t,i){Dh.call(this,t);this.element=i};Oh.inherits(Sa.Event,Dh);var Oa=function(t,i,s){Dh.call(this,t);this.map=i;this.frameState=s!==undefined?s:null};Oh.inherits(Oa,Dh);var Ta=function(t,i,s,e,r){Oa.call(this,t,i,r);this.originalEvent=s;this.pixel=i.getEventPixel(s);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=e!==undefined?e:false};Oh.inherits(Ta,Oa);Ta.prototype.preventDefault=function(){Oa.prototype.preventDefault.call(this);this.originalEvent.preventDefault()};Ta.prototype.stopPropagation=function(){Oa.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()};var Aa={SINGLECLICK:"singleclick",CLICK:Wh.CLICK,DBLCLICK:Wh.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Ra=function(t,i,s,e,r){Ta.call(this,t,i,s.originalEvent,e,r);this.pointerEvent=s};Oh.inherits(Ra,Ta);var Pa={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var La=function(t,i){this.dispatcher=t;this.mapping_=i};La.prototype.getEvents=function(){return Object.keys(this.mapping_)};La.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Da=function(t){var i={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};La.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]};Oh.inherits(Da,La);Da.POINTER_ID=1;Da.POINTER_TYPE="mouse";Da.DEDUP_DIST=25;Da.prototype.isEventSimulatedFromTouch_=function(t){var i=this.lastTouches;var s=t.clientX,e=t.clientY;for(var r=0,n=i.length,h;r<n&&(h=i[r]);r++){var a=Math.abs(s-h[0]),o=Math.abs(e-h[1]);if(a<=Da.DEDUP_DIST&&o<=Da.DEDUP_DIST){return true}}return false};Da.prepareEvent=function(t,i){var s=i.cloneEvent(t,t);var e=s.preventDefault;s.preventDefault=function(){t.preventDefault();e()};s.pointerId=Da.POINTER_ID;s.isPrimary=true;s.pointerType=Da.POINTER_TYPE;return s};Da.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){if(Da.POINTER_ID.toString()in this.pointerMap){this.cancel(t)}var i=Da.prepareEvent(t,this.dispatcher);this.pointerMap[Da.POINTER_ID.toString()]=t;this.dispatcher.down(i,t)}};Da.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Da.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}};Da.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[Da.POINTER_ID.toString()];if(i&&i.button===t.button){var s=Da.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t);this.cleanupMouse()}}};Da.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Da.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}};Da.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Da.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}};Da.prototype.cancel=function(t){var i=Da.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t);this.cleanupMouse()};Da.prototype.cleanupMouse=function(){delete this.pointerMap[Da.POINTER_ID.toString()]};var Fa=function(t){var i={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};La.call(this,t,i);this.pointerMap=t.pointerMap;this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};Oh.inherits(Fa,La);Fa.prototype.prepareEvent_=function(t){var i=t;if(typeof t.pointerType==="number"){i=this.dispatcher.cloneEvent(t,t);i.pointerType=this.POINTER_TYPES[t.pointerType]}return i};Fa.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]};Fa.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)};Fa.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)};Fa.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t);this.cleanup(t.pointerId)};Fa.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)};Fa.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)};Fa.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t);this.cleanup(t.pointerId)};Fa.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)};Fa.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var Wa=function(t){var i={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};La.call(this,t,i)};Oh.inherits(Wa,La);Wa.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};Wa.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var Ga=function(t,i,s){Dh.call(this,t);this.originalEvent=i;var e=s?s:{};this.buttons=this.getButtons_(e);this.pressure=this.getPressure_(e,this.buttons);this.bubbles="bubbles"in e?e["bubbles"]:false;this.cancelable="cancelable"in e?e["cancelable"]:false;this.view="view"in e?e["view"]:null;this.detail="detail"in e?e["detail"]:null;this.screenX="screenX"in e?e["screenX"]:0;this.screenY="screenY"in e?e["screenY"]:0;this.clientX="clientX"in e?e["clientX"]:0;this.clientY="clientY"in e?e["clientY"]:0;this.ctrlKey="ctrlKey"in e?e["ctrlKey"]:false;this.altKey="altKey"in e?e["altKey"]:false;this.shiftKey="shiftKey"in e?e["shiftKey"]:false;this.metaKey="metaKey"in e?e["metaKey"]:false;this.button="button"in e?e["button"]:0;this.relatedTarget="relatedTarget"in e?e["relatedTarget"]:null;this.pointerId="pointerId"in e?e["pointerId"]:0;this.width="width"in e?e["width"]:0;this.height="height"in e?e["height"]:0;this.tiltX="tiltX"in e?e["tiltX"]:0;this.tiltY="tiltY"in e?e["tiltY"]:0;this.pointerType="pointerType"in e?e["pointerType"]:"";this.hwTimestamp="hwTimestamp"in e?e["hwTimestamp"]:0;this.isPrimary="isPrimary"in e?e["isPrimary"]:false;if(i.preventDefault){this.preventDefault=function(){i.preventDefault()}}};Oh.inherits(Ga,Dh);Ga.prototype.getButtons_=function(t){var i;if(t.buttons||Ga.HAS_BUTTONS){i=t.buttons}else{switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}}return i};Ga.prototype.getPressure_=function(t,i){var s=0;if(t.pressure){s=t.pressure}else{s=i?.5:0}return s};Ga.HAS_BUTTONS=false;(function(){try{var t=new MouseEvent("click",{buttons:1});Ga.HAS_BUTTONS=t.buttons===1}catch(t){}})();var ja=function(t,i){var s={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};La.call(this,t,s);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=undefined;this.clickCount_=0;this.resetId_=undefined};Oh.inherits(ja,La);ja.DEDUP_TIMEOUT=2500;ja.CLICK_COUNT_TIMEOUT=200;ja.POINTER_TYPE="touch";ja.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier};ja.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;if(i===0||i===1&&Da.POINTER_ID.toString()in this.pointerMap){this.firstTouchId_=t.identifier;this.cancelResetClickCount_()}};ja.prototype.removePrimaryPointer_=function(t){if(t.isPrimary){this.firstTouchId_=undefined;this.resetClickCount_()}};ja.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),ja.CLICK_COUNT_TIMEOUT)};ja.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=undefined};ja.prototype.cancelResetClickCount_=function(){if(this.resetId_!==undefined){clearTimeout(this.resetId_)}};ja.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);s.pointerId=i.identifier+2;s.bubbles=true;s.cancelable=true;s.detail=this.clickCount_;s.button=0;s.buttons=1;s.width=i.webkitRadiusX||i.radiusX||0;s.height=i.webkitRadiusY||i.radiusY||0;s.pressure=i.webkitForce||i.force||.5;s.isPrimary=this.isPrimaryTouch_(i);s.pointerType=ja.POINTER_TYPE;s.clientX=i.clientX;s.clientY=i.clientY;s.screenX=i.screenX;s.screenY=i.screenY;return s};ja.prototype.processTouches_=function(t,i){var s=Array.prototype.slice.call(t.changedTouches);var e=s.length;function r(){t.preventDefault()}var n,h;for(n=0;n<e;++n){h=this.touchToPointer_(t,s[n]);h.preventDefault=r;i.call(this,t,h)}};ja.prototype.findTouch_=function(t,i){var s=t.length;var e;for(var r=0;r<s;r++){e=t[r];if(e.identifier===i){return true}}return false};ja.prototype.vacuumTouches_=function(t){var i=t.touches;var s=Object.keys(this.pointerMap);var e=s.length;if(e>=i.length){var r=[];var n,h,a;for(n=0;n<e;++n){h=s[n];a=this.pointerMap[h];if(h!=Da.POINTER_ID&&!this.findTouch_(i,h-2)){r.push(a.out)}}for(n=0;n<r.length;++n){this.cancelOut_(t,r[n])}}};ja.prototype.touchstart=function(t){this.vacuumTouches_(t);this.setPrimaryTouch_(t.changedTouches[0]);this.dedupSynthMouse_(t);this.clickCount_++;this.processTouches_(t,this.overDown_)};ja.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target};this.dispatcher.over(i,t);this.dispatcher.enter(i,t);this.dispatcher.down(i,t)};ja.prototype.touchmove=function(t){t.preventDefault();this.processTouches_(t,this.moveOverOut_)};ja.prototype.moveOverOut_=function(t,i){var s=i;var e=this.pointerMap[s.pointerId];if(!e){return}var r=e.out;var n=e.outTarget;this.dispatcher.move(s,t);if(r&&n!==s.target){r.relatedTarget=s.target;s.relatedTarget=n;r.target=n;if(s.target){this.dispatcher.leaveOut(r,t);this.dispatcher.enterOver(s,t)}else{s.target=n;s.relatedTarget=null;this.cancelOut_(t,s)}}e.out=s;e.outTarget=s.target};ja.prototype.touchend=function(t){this.dedupSynthMouse_(t);this.processTouches_(t,this.upOut_)};ja.prototype.upOut_=function(t,i){this.dispatcher.up(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};ja.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)};ja.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};ja.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId];this.removePrimaryPointer_(t)};ja.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches;var s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var e=[s.clientX,s.clientY];i.push(e);setTimeout((function(){Bh.remove(i,e)}),ja.DEDUP_TIMEOUT)}};var Va=function(t){Fh.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()};Oh.inherits(Va,Fh);Va.prototype.registerSources=function(){if(Ea.POINTER){this.registerSource("native",new Wa(this))}else if(Ea.MSPOINTER){this.registerSource("ms",new Fa(this))}else{var t=new Da(this);this.registerSource("mouse",t);if(Ea.TOUCH){this.registerSource("touch",new ja(this,t))}}this.register_()};Va.prototype.registerSource=function(t,i){var s=i;var e=s.getEvents();if(e){e.forEach((function(t){var i=s.getHandlerForEvent(t);if(i){this.eventMap_[t]=i.bind(s)}}),this);this.eventSourceList_.push(s)}};Va.prototype.register_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.addEvents_(i.getEvents())}};Va.prototype.unregister_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.removeEvents_(i.getEvents())}};Va.prototype.eventHandler_=function(t){var i=t.type;var s=this.eventMap_[i];if(s){s(t)}};Va.prototype.addEvents_=function(t){t.forEach((function(t){Ph.listen(this.element_,t,this.eventHandler_,this)}),this)};Va.prototype.removeEvents_=function(t){t.forEach((function(t){Ph.unlisten(this.element_,t,this.eventHandler_,this)}),this)};Va.prototype.cloneEvent=function(t,i){var s={},e;for(var r=0,n=Va.CLONE_PROPS.length;r<n;r++){e=Va.CLONE_PROPS[r][0];s[e]=t[e]||i[e]||Va.CLONE_PROPS[r][1]}return s};Va.prototype.down=function(t,i){this.fireEvent(Pa.POINTERDOWN,t,i)};Va.prototype.move=function(t,i){this.fireEvent(Pa.POINTERMOVE,t,i)};Va.prototype.up=function(t,i){this.fireEvent(Pa.POINTERUP,t,i)};Va.prototype.enter=function(t,i){t.bubbles=false;this.fireEvent(Pa.POINTERENTER,t,i)};Va.prototype.leave=function(t,i){t.bubbles=false;this.fireEvent(Pa.POINTERLEAVE,t,i)};Va.prototype.over=function(t,i){t.bubbles=true;this.fireEvent(Pa.POINTEROVER,t,i)};Va.prototype.out=function(t,i){t.bubbles=true;this.fireEvent(Pa.POINTEROUT,t,i)};Va.prototype.cancel=function(t,i){this.fireEvent(Pa.POINTERCANCEL,t,i)};Va.prototype.leaveOut=function(t,i){this.out(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.leave(t,i)}};Va.prototype.enterOver=function(t,i){this.over(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.enter(t,i)}};Va.prototype.contains_=function(t,i){if(!t||!i){return false}return t.contains(i)};Va.prototype.makeEvent=function(t,i,s){return new Ga(t,s,i)};Va.prototype.fireEvent=function(t,i,s){var e=this.makeEvent(t,i,s);this.dispatchEvent(e)};Va.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)};Va.prototype.wrapMouseEvent=function(t,i){var s=this.makeEvent(t,Da.prepareEvent(i,this),i);return s};Va.prototype.disposeInternal=function(){this.unregister_();Fh.prototype.disposeInternal.call(this)};Va.CLONE_PROPS=[["bubbles",false],["cancelable",false],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",false],["altKey",false],["shiftKey",false],["metaKey",false],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",false],["type",""],["target",null],["currentTarget",null],["which",0]];var Ua=function(t,i){Fh.call(this);this.map_=t;this.clickTimeoutId_=0;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=i?i*Ea.DEVICE_PIXEL_RATIO:Ea.DEVICE_PIXEL_RATIO;this.down_=null;var s=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new Va(s);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=Ph.listen(this.pointerEventHandler_,Pa.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=Ph.listen(this.pointerEventHandler_,Pa.POINTERMOVE,this.relayEvent_,this)};Oh.inherits(Ua,Fh);Ua.prototype.emulateClick_=function(t){var i=new Ra(Aa.CLICK,this.map_,t);this.dispatchEvent(i);if(this.clickTimeoutId_!==0){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;i=new Ra(Aa.DBLCLICK,this.map_,t);this.dispatchEvent(i)}else{this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new Ra(Aa.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)}};Ua.prototype.updateActivePointers_=function(t){var i=t;if(i.type==Aa.POINTERUP||i.type==Aa.POINTERCANCEL){delete this.trackedTouches_[i.pointerId]}else if(i.type==Aa.POINTERDOWN){this.trackedTouches_[i.pointerId]=true}this.activePointers_=Object.keys(this.trackedTouches_).length};Ua.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new Ra(Aa.POINTERUP,this.map_,t);this.dispatchEvent(i);if(!i.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_===0){this.dragListenerKeys_.forEach(Ph.unlistenByKey);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null;this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}};Ua.prototype.isMouseActionButton_=function(t){return t.button===0};Ua.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new Ra(Aa.POINTERDOWN,this.map_,t);this.dispatchEvent(i);this.down_=t;if(this.dragListenerKeys_.length===0){this.documentPointerEventHandler_=new Va(document);this.dragListenerKeys_.push(Ph.listen(this.documentPointerEventHandler_,Aa.POINTERMOVE,this.handlePointerMove_,this),Ph.listen(this.documentPointerEventHandler_,Aa.POINTERUP,this.handlePointerUp_,this),Ph.listen(this.pointerEventHandler_,Aa.POINTERCANCEL,this.handlePointerUp_,this))}};Ua.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=true;var i=new Ra(Aa.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()};Ua.prototype.relayEvent_=function(t){var i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ra(t.type,this.map_,t,i))};Ua.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_};Ua.prototype.disposeInternal=function(){if(this.relayedListenerKey_){Ph.unlistenByKey(this.relayedListenerKey_);this.relayedListenerKey_=null}if(this.pointerdownListenerKey_){Ph.unlistenByKey(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(Ph.unlistenByKey);this.dragListenerKeys_.length=0;if(this.documentPointerEventHandler_){this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}if(this.pointerEventHandler_){this.pointerEventHandler_.dispose();this.pointerEventHandler_=null}Fh.prototype.disposeInternal.call(this)};var qa={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var Xa={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var Ya={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};var Ba=function(t,i){this.priorityFunction_=t;this.keyFunction_=i;this.elements_=[];this.priorities_=[];this.queuedElements_={}};Ba.DROP=Infinity;Ba.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;Rh.clear(this.queuedElements_)};Ba.prototype.dequeue=function(){var t=this.elements_;var i=this.priorities_;var s=t[0];if(t.length==1){t.length=0;i.length=0}else{t[0]=t.pop();i[0]=i.pop();this.siftUp_(0)}var e=this.keyFunction_(s);delete this.queuedElements_[e];return s};Ba.prototype.enqueue=function(t){Uh.assert(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);if(i!=Ba.DROP){this.elements_.push(t);this.priorities_.push(i);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false};Ba.prototype.getCount=function(){return this.elements_.length};Ba.prototype.getLeftChildIndex_=function(t){return t*2+1};Ba.prototype.getRightChildIndex_=function(t){return t*2+2};Ba.prototype.getParentIndex_=function(t){return t-1>>1};Ba.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}};Ba.prototype.isEmpty=function(){return this.elements_.length===0};Ba.prototype.isKeyQueued=function(t){return t in this.queuedElements_};Ba.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))};Ba.prototype.siftUp_=function(t){var i=this.elements_;var s=this.priorities_;var e=i.length;var r=i[t];var n=s[t];var h=t;while(t<e>>1){var a=this.getLeftChildIndex_(t);var o=this.getRightChildIndex_(t);var f=o<e&&s[o]<s[a]?o:a;i[t]=i[f];s[t]=s[f];t=f}i[t]=r;s[t]=n;this.siftDown_(h,t)};Ba.prototype.siftDown_=function(t,i){var s=this.elements_;var e=this.priorities_;var r=s[i];var n=e[i];while(i>t){var h=this.getParentIndex_(i);if(e[h]>n){s[i]=s[h];e[i]=e[h];i=h}else{break}}s[i]=r;e[i]=n};Ba.prototype.reprioritize=function(){var t=this.priorityFunction_;var i=this.elements_;var s=this.priorities_;var e=0;var r=i.length;var n,h,a;for(h=0;h<r;++h){n=i[h];a=t(n);if(a==Ba.DROP){delete this.queuedElements_[this.keyFunction_(n)]}else{s[e]=a;i[e++]=n}}i.length=e;s.length=e;this.heapify_()};var Ha=function(t,i){Ba.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()}));this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}};Oh.inherits(Ha,Ba);Ha.prototype.enqueue=function(t){var i=Ba.prototype.enqueue.call(this,t);if(i){var s=t[0];Ph.listen(s,Wh.CHANGE,this.handleTileChange,this)}return i};Ha.prototype.getTilesLoading=function(){return this.tilesLoading_};Ha.prototype.handleTileChange=function(t){var i=t.target;var s=i.getState();if(s===Ya.LOADED||s===Ya.ERROR||s===Ya.EMPTY||s===Ya.ABORT){Ph.unlisten(i,Wh.CHANGE,this.handleTileChange,this);var e=i.getKey();if(e in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[e];--this.tilesLoading_}this.tileChangeCallback_()}};Ha.prototype.loadMoreTiles=function(t,i){var s=0;var e=false;var r,n,h;while(this.tilesLoading_<t&&s<i&&this.getCount()>0){n=this.dequeue()[0];h=n.getKey();r=n.getState();if(r===Ya.ABORT){e=true}else if(r===Ya.IDLE&&!(h in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[h]=true;++this.tilesLoading_;++s;n.load()}}if(s===0&&e){this.tileChangeCallback_()}};var Ja={};Ja.createExtent=function(t){return function(i){if(i){return[qh.clamp(i[0],t[0],t[2]),qh.clamp(i[1],t[1],t[3])]}else{return undefined}}};Ja.none=function(t){return t};var Za={};Za.createSnapToResolutions=function(t){return function(i,s,e){if(i!==undefined){var r=Bh.linearFindNearest(t,i,e);r=qh.clamp(r+s,0,t.length-1);var n=Math.floor(r);if(r!=n&&n<t.length-1){var h=t[n]/t[n+1];return t[n]/Math.pow(h,r-n)}else{return t[n]}}else{return undefined}}};Za.createSnapToPower=function(t,i,s){return function(e,r,n){if(e!==undefined){var h=-n/2+.5;var a=Math.floor(Math.log(i/e)/Math.log(t)+h);var o=Math.max(a+r,0);if(s!==undefined){o=Math.min(o,s)}return i/Math.pow(t,o)}else{return undefined}}};var $a={};$a.disable=function(t,i){if(t!==undefined){return 0}else{return undefined}};$a.none=function(t,i){if(t!==undefined){return t+i}else{return undefined}};$a.createSnapToN=function(t){var i=2*Math.PI/t;return function(t,s){if(t!==undefined){t=Math.floor((t+s)/i+.5)*i;return t}else{return undefined}}};$a.createSnapToZero=function(t){var i=t||qh.toRadians(5);return function(t,s){if(t!==undefined){if(Math.abs(t+s)<=i){return 0}else{return t+s}}else{return undefined}}};var Ka={ANIMATING:0,INTERACTING:1};var Qa={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var to={};to.padNumber=function(t,i,s){var e=s!==undefined?t.toFixed(s):""+t;var r=e.indexOf(".");r=r===-1?e.length:r;return r>i?e:new Array(1+i-r).join("0")+e};to.compareVersions=function(t,i){var s=(""+t).split(".");var e=(""+i).split(".");for(var r=0;r<Math.max(s.length,e.length);r++){var n=parseInt(s[r]||"0",10);var h=parseInt(e[r]||"0",10);if(n>h){return 1}if(h>n){return-1}}return 0};var io={};io.add=function(t,i){t[0]+=i[0];t[1]+=i[1];return t};io.closestOnCircle=function(t,i){var s=i.getRadius();var e=i.getCenter();var r=e[0];var n=e[1];var h=t[0];var a=t[1];var o=h-r;var f=a-n;if(o===0&&f===0){o=1}var u=Math.sqrt(o*o+f*f);var l,v;l=r+s*o/u;v=n+s*f/u;return[l,v]};io.closestOnSegment=function(t,i){var s=t[0];var e=t[1];var r=i[0];var n=i[1];var h=r[0];var a=r[1];var o=n[0];var f=n[1];var u=o-h;var l=f-a;var v=u===0&&l===0?0:(u*(s-h)+l*(e-a))/(u*u+l*l||0);var c,d;if(v<=0){c=h;d=a}else if(v>=1){c=o;d=f}else{c=h+v*u;d=a+v*l}return[c,d]};io.createStringXY=function(t){return function(i){return io.toStringXY(i,t)}};io.degreesToStringHDMS=function(t,i,s){var e=qh.modulo(i+180,360)-180;var r=Math.abs(3600*e);var n=s||0;var h=Math.pow(10,n);var a=Math.floor(r/3600);var o=Math.floor((r-a*3600)/60);var f=r-a*3600-o*60;f=Math.ceil(f*h)/h;if(f>=60){f=0;o+=1}if(o>=60){o=0;a+=1}return a+"° "+to.padNumber(o,2)+"′ "+to.padNumber(f,2,n)+"″"+(e==0?"":" "+t.charAt(e<0?1:0))};io.format=function(t,i,s){if(t){return i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s))}else{return""}};io.equals=function(t,i){var s=true;for(var e=t.length-1;e>=0;--e){if(t[e]!=i[e]){s=false;break}}return s};io.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);var r=t[0]*s-t[1]*e;var n=t[1]*s+t[0]*e;t[0]=r;t[1]=n;return t};io.scale=function(t,i){t[0]*=i;t[1]*=i;return t};io.sub=function(t,i){t[0]-=i[0];t[1]-=i[1];return t};io.squaredDistance=function(t,i){var s=t[0]-i[0];var e=t[1]-i[1];return s*s+e*e};io.distance=function(t,i){return Math.sqrt(io.squaredDistance(t,i))};io.squaredDistanceToSegment=function(t,i){return io.squaredDistance(t,io.closestOnSegment(t,i))};io.toStringHDMS=function(t,i){if(t){return io.degreesToStringHDMS("NS",t[1],i)+" "+io.degreesToStringHDMS("EW",t[0],i)}else{return""}};io.toStringXY=function(t,i){return io.format(t,"{x}, {y}",i)};var so={};so.easeIn=function(t){return Math.pow(t,3)};so.easeOut=function(t){return 1-so.easeIn(1-t)};so.inAndOut=function(t){return 3*t*t-2*t*t*t};so.linear=function(t){return t};so.upAndDown=function(t){if(t<.5){return so.inAndOut(2*t)}else{return 1-so.inAndOut(2*(t-.5))}};var eo=function(t){jh.call(this);var i=Rh.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=aa.createProjection(i.projection,"EPSG:3857");this.applyOptions_(i)};Oh.inherits(eo,jh);eo.prototype.applyOptions_=function(t){var i={};i[Qa.CENTER]=t.center!==undefined?t.center:null;var s=eo.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution;this.minResolution_=s.minResolution;this.zoomFactor_=s.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=s.minZoom;var e=eo.createCenterConstraint_(t);var r=s.constraint;var n=eo.createRotationConstraint_(t);this.constraints_={center:e,resolution:r,rotation:n};if(t.resolution!==undefined){i[Qa.RESOLUTION]=t.resolution}else if(t.zoom!==undefined){i[Qa.RESOLUTION]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_);if(this.resolutions_){i[Qa.RESOLUTION]=qh.clamp(Number(this.getResolution()||i[Qa.RESOLUTION]),this.minResolution_,this.maxResolution_)}}i[Qa.ROTATION]=t.rotation!==undefined?t.rotation:0;this.setProperties(i);this.options_=t};eo.prototype.getUpdatedOptions_=function(t){var i=Rh.assign({},this.options_);if(i.resolution!==undefined){i.resolution=this.getResolution()}else{i.zoom=this.getZoom()}i.center=this.getCenter();i.rotation=this.getRotation();return Rh.assign({},i,t)};eo.prototype.animate=function(t){var i=arguments.length;var s;if(i>1&&typeof arguments[i-1]==="function"){s=arguments[i-1];--i}if(!this.isDef()){var e=arguments[i-1];if(e.center){this.setCenter(e.center)}if(e.zoom!==undefined){this.setZoom(e.zoom)}if(e.rotation!==undefined){this.setRotation(e.rotation)}if(s){s(true)}return}var r=Date.now();var n=this.getCenter().slice();var h=this.getResolution();var a=this.getRotation();var o=[];for(var f=0;f<i;++f){var u=arguments[f];var l={start:r,complete:false,anchor:u.anchor,duration:u.duration!==undefined?u.duration:1e3,easing:u.easing||so.inAndOut};if(u.center){l.sourceCenter=n;l.targetCenter=u.center;n=l.targetCenter}if(u.zoom!==undefined){l.sourceResolution=h;l.targetResolution=this.constrainResolution(this.maxResolution_,u.zoom-this.minZoom_,0);h=l.targetResolution}else if(u.resolution){l.sourceResolution=h;l.targetResolution=u.resolution;h=l.targetResolution}if(u.rotation!==undefined){l.sourceRotation=a;var v=qh.modulo(u.rotation-a+Math.PI,2*Math.PI)-Math.PI;l.targetRotation=a+v;a=l.targetRotation}l.callback=s;if(eo.isNoopAnimation(l)){l.complete=true}else{r+=l.duration}o.push(l)}this.animations_.push(o);this.setHint(Ka.ANIMATING,1);this.updateAnimations_()};eo.prototype.getAnimating=function(){return this.hints_[Ka.ANIMATING]>0};eo.prototype.getInteracting=function(){return this.hints_[Ka.INTERACTING]>0};eo.prototype.cancelAnimations=function(){this.setHint(Ka.ANIMATING,-this.hints_[Ka.ANIMATING]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];if(s[0].callback){s[0].callback(false)}}this.animations_.length=0};eo.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}var t=Date.now();var i=false;for(var s=this.animations_.length-1;s>=0;--s){var e=this.animations_[s];var r=true;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(a.complete){continue}var o=t-a.start;var f=a.duration>0?o/a.duration:1;if(f>=1){a.complete=true;f=1}else{r=false}var u=a.easing(f);if(a.sourceCenter){var l=a.sourceCenter[0];var v=a.sourceCenter[1];var c=a.targetCenter[0];var d=a.targetCenter[1];var m=l+u*(c-l);var p=v+u*(d-v);this.set(Qa.CENTER,[m,p])}if(a.sourceResolution&&a.targetResolution){var z=u===1?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){this.set(Qa.CENTER,this.calculateCenterZoom(z,a.anchor))}this.set(Qa.RESOLUTION,z)}if(a.sourceRotation!==undefined&&a.targetRotation!==undefined){var M=u===1?qh.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){this.set(Qa.CENTER,this.calculateCenterRotate(M,a.anchor))}this.set(Qa.ROTATION,M)}i=true;if(!a.complete){break}}if(r){this.animations_[s]=null;this.setHint(Ka.ANIMATING,-1);var _=e[0].callback;if(_){_(true)}}}this.animations_=this.animations_.filter(Boolean);if(i&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_)}};eo.prototype.calculateCenterRotate=function(t,i){var s;var e=this.getCenter();if(e!==undefined){s=[e[0]-i[0],e[1]-i[1]];io.rotate(s,t-this.getRotation());io.add(s,i)}return s};eo.prototype.calculateCenterZoom=function(t,i){var s;var e=this.getCenter();var r=this.getResolution();if(e!==undefined&&r!==undefined){var n=i[0]-t*(i[0]-e[0])/r;var h=i[1]-t*(i[1]-e[1])/r;s=[n,h]}return s};eo.prototype.getSizeFromViewport_=function(){var t=[100,100];var i='.ol-viewport[data-view="'+Oh.getUid(this)+'"]';var s=document.querySelector(i);if(s){var e=getComputedStyle(s);t[0]=parseInt(e.width,10);t[1]=parseInt(e.height,10)}return t};eo.prototype.constrainCenter=function(t){return this.constraints_.center(t)};eo.prototype.constrainResolution=function(t,i,s){var e=i||0;var r=s||0;return this.constraints_.resolution(t,e,r)};eo.prototype.constrainRotation=function(t,i){var s=i||0;return this.constraints_.rotation(t,s)};eo.prototype.getCenter=function(){return this.get(Qa.CENTER)};eo.prototype.getConstraints=function(){return this.constraints_};eo.prototype.getHints=function(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}else{return this.hints_.slice()}};eo.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_();var s=this.getCenter();Uh.assert(s,1);var e=this.getResolution();Uh.assert(e!==undefined,2);var r=this.getRotation();Uh.assert(r!==undefined,3);return Zh.getForViewAndSize(s,e,r,i)};eo.prototype.getMaxResolution=function(){return this.maxResolution_};eo.prototype.getMinResolution=function(){return this.minResolution_};eo.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)};eo.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))};eo.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)};eo.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))};eo.prototype.getProjection=function(){return this.projection_};eo.prototype.getResolution=function(){return this.get(Qa.RESOLUTION)};eo.prototype.getResolutions=function(){return this.resolutions_};eo.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_();var e=Zh.getWidth(t)/s[0];var r=Zh.getHeight(t)/s[1];return Math.max(e,r)};eo.prototype.getResolutionForValueFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=s/Math.pow(i,t*r);return e}};eo.prototype.getRotation=function(){return this.get(Qa.ROTATION)};eo.prototype.getValueForResolutionFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=Math.log(s/t)/Math.log(i)/r;return e}};eo.prototype.getState=function(){var t=this.getCenter();var i=this.getProjection();var s=this.getResolution();var e=this.getRotation();return{center:t.slice(),projection:i!==undefined?i:null,resolution:s,rotation:e,zoom:this.getZoom()}};eo.prototype.getZoom=function(){var t;var i=this.getResolution();if(i!==undefined){t=this.getZoomForResolution(i)}return t};eo.prototype.getZoomForResolution=function(t){var i=this.minZoom_||0;var s,e;if(this.resolutions_){var r=Bh.linearFindNearest(this.resolutions_,t,1);i=r;s=this.resolutions_[r];if(r==this.resolutions_.length-1){e=2}else{e=s/this.resolutions_[r+1]}}else{s=this.maxResolution_;e=this.zoomFactor_}return i+Math.log(s/t)/Math.log(e)};eo.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)};eo.prototype.fit=function(t,i){var s=i||{};var e=s.size;if(!e){e=this.getSizeFromViewport_()}var r;if(!(t instanceof ua)){Uh.assert(Array.isArray(t),24);Uh.assert(!Zh.isEmpty(t),25);r=ya.fromExtent(t)}else if(t.getType()===Xh.CIRCLE){t=t.getExtent();r=ya.fromExtent(t);r.rotate(this.getRotation(),Zh.getCenter(t))}else{r=t}var n=s.padding!==undefined?s.padding:[0,0,0,0];var h=s.constrainResolution!==undefined?s.constrainResolution:true;var a=s.nearest!==undefined?s.nearest:false;var o;if(s.minResolution!==undefined){o=s.minResolution}else if(s.maxZoom!==undefined){o=this.constrainResolution(this.maxResolution_,s.maxZoom-this.minZoom_,0)}else{o=0}var f=r.getFlatCoordinates();var u=this.getRotation();var l=Math.cos(-u);var v=Math.sin(-u);var c=+Infinity;var d=+Infinity;var m=-Infinity;var p=-Infinity;var z=r.getStride();for(var M=0,_=f.length;M<_;M+=z){var g=f[M]*l-f[M+1]*v;var b=f[M]*v+f[M+1]*l;c=Math.min(c,g);d=Math.min(d,b);m=Math.max(m,g);p=Math.max(p,b)}var x=this.getResolutionForExtent([c,d,m,p],[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]);x=isNaN(x)?o:Math.max(x,o);if(h){var w=this.constrainResolution(x,0,0);if(!a&&w<x){w=this.constrainResolution(w,-1,0)}x=w}v=-v;var y=(c+m)/2;var k=(d+p)/2;y+=(n[1]-n[3])/2*x;k+=(n[0]-n[2])/2*x;var E=y*l-k*v;var N=k*l+y*v;var C=[E,N];var I=s.callback?s.callback:Oh.nullFunction;if(s.duration!==undefined){this.animate({resolution:x,center:C,duration:s.duration,easing:s.easing},I)}else{this.setResolution(x);this.setCenter(C);setTimeout(I.bind(undefined,true),0)}};eo.prototype.centerOn=function(t,i,s){var e=this.getRotation();var r=Math.cos(-e);var n=Math.sin(-e);var h=t[0]*r-t[1]*n;var a=t[1]*r+t[0]*n;var o=this.getResolution();h+=(i[0]/2-s[0])*o;a+=(s[1]-i[1]/2)*o;n=-n;var f=h*r-a*n;var u=a*r+h*n;this.setCenter([f,u])};eo.prototype.isDef=function(){return!!this.getCenter()&&this.getResolution()!==undefined};eo.prototype.rotate=function(t,i){if(i!==undefined){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)};eo.prototype.setCenter=function(t){this.set(Qa.CENTER,t);if(this.getAnimating()){this.cancelAnimations()}};eo.prototype.setHint=function(t,i){this.hints_[t]+=i;this.changed();return this.hints_[t]};eo.prototype.setResolution=function(t){this.set(Qa.RESOLUTION,t);if(this.getAnimating()){this.cancelAnimations()}};eo.prototype.setRotation=function(t){this.set(Qa.ROTATION,t);if(this.getAnimating()){this.cancelAnimations()}};eo.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};eo.createCenterConstraint_=function(t){if(t.extent!==undefined){return Ja.createExtent(t.extent)}else{return Ja.none}};eo.createResolutionConstraint_=function(t){var i;var s;var e;var r=28;var n=2;var h=t.minZoom!==undefined?t.minZoom:Oh.DEFAULT_MIN_ZOOM;var a=t.maxZoom!==undefined?t.maxZoom:r;var o=t.zoomFactor!==undefined?t.zoomFactor:n;if(t.resolutions!==undefined){var f=t.resolutions;s=f[h];e=f[a]!==undefined?f[a]:f[f.length-1];i=Za.createSnapToResolutions(f)}else{var u=aa.createProjection(t.projection,"EPSG:3857");var l=u.getExtent();var v=!l?360*aa.METERS_PER_UNIT[ta.DEGREES]/u.getMetersPerUnit():Math.max(Zh.getWidth(l),Zh.getHeight(l));var c=v/Oh.DEFAULT_TILE_SIZE/Math.pow(n,Oh.DEFAULT_MIN_ZOOM);var d=c/Math.pow(n,r-Oh.DEFAULT_MIN_ZOOM);s=t.maxResolution;if(s!==undefined){h=0}else{s=c/Math.pow(o,h)}e=t.minResolution;if(e===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){e=s/Math.pow(o,a)}else{e=c/Math.pow(o,a)}}else{e=d}}a=h+Math.floor(Math.log(s/e)/Math.log(o));e=s/Math.pow(o,a-h);i=Za.createSnapToPower(o,s,a-h)}return{constraint:i,maxResolution:s,minResolution:e,minZoom:h,zoomFactor:o}};eo.createRotationConstraint_=function(t){var i=t.enableRotation!==undefined?t.enableRotation:true;if(i){var s=t.constrainRotation;if(s===undefined||s===true){return $a.createSnapToZero()}else if(s===false){return $a.none}else if(typeof s==="number"){return $a.createSnapToN(s)}else{return $a.none}}else{return $a.disable}};eo.isNoopAnimation=function(t){if(t.sourceCenter&&t.targetCenter){if(!io.equals(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true};var ro={};ro.createCanvasContext2D=function(t,i){var s=document.createElement("CANVAS");if(t){s.width=t}if(i){s.height=i}return s.getContext("2d")};ro.outerWidth=function(t){var i=t.offsetWidth;var s=getComputedStyle(t);i+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10);return i};ro.outerHeight=function(t){var i=t.offsetHeight;var s=getComputedStyle(t);i+=parseInt(s.marginTop,10)+parseInt(s.marginBottom,10);return i};ro.replaceNode=function(t,i){var s=i.parentNode;if(s){s.replaceChild(t,i)}};ro.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null};ro.removeChildren=function(t){while(t.lastChild){t.removeChild(t.lastChild)}};var no={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"};var ho=function(t){jh.call(this);var i=Rh.assign({},t);i[no.OPACITY]=t.opacity!==undefined?t.opacity:1;i[no.VISIBLE]=t.visible!==undefined?t.visible:true;i[no.Z_INDEX]=t.zIndex!==undefined?t.zIndex:0;i[no.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;i[no.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;this.setProperties(i);this.state_={layer:this,managed:true}};Oh.inherits(ho,jh);ho.prototype.getType=function(){return this.type};ho.prototype.getLayerState=function(){this.state_.opacity=qh.clamp(this.getOpacity(),0,1);this.state_.sourceState=this.getSourceState();this.state_.visible=this.getVisible();this.state_.extent=this.getExtent();this.state_.zIndex=this.getZIndex();this.state_.maxResolution=this.getMaxResolution();this.state_.minResolution=Math.max(this.getMinResolution(),0);return this.state_};ho.prototype.getLayersArray=function(t){};ho.prototype.getLayerStatesArray=function(t){};ho.prototype.getExtent=function(){return this.get(no.EXTENT)};ho.prototype.getMaxResolution=function(){return this.get(no.MAX_RESOLUTION)};ho.prototype.getMinResolution=function(){return this.get(no.MIN_RESOLUTION)};ho.prototype.getOpacity=function(){return this.get(no.OPACITY)};ho.prototype.getSourceState=function(){};ho.prototype.getVisible=function(){return this.get(no.VISIBLE)};ho.prototype.getZIndex=function(){return this.get(no.Z_INDEX)};ho.prototype.setExtent=function(t){this.set(no.EXTENT,t)};ho.prototype.setMaxResolution=function(t){this.set(no.MAX_RESOLUTION,t)};ho.prototype.setMinResolution=function(t){this.set(no.MIN_RESOLUTION,t)};ho.prototype.setOpacity=function(t){this.set(no.OPACITY,t)};ho.prototype.setVisible=function(t){this.set(no.VISIBLE,t)};ho.prototype.setZIndex=function(t){this.set(no.Z_INDEX,t)};var ao={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var oo=function(t){var i=t||{};var s=Rh.assign({},i);delete s.layers;var e=i.layers;ho.call(this,s);this.layersListenerKeys_=[];this.listenerKeys_={};Ph.listen(this,jh.getChangeEventType(oo.Property_.LAYERS),this.handleLayersChanged_,this);if(e){if(Array.isArray(e)){e=new Sa(e.slice(),{unique:true})}else{Uh.assert(e instanceof Sa,43);e=e}}else{e=new Sa(undefined,{unique:true})}this.setLayers(e)};Oh.inherits(oo,ho);oo.prototype.handleLayerChange_=function(){this.changed()};oo.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(Ph.unlistenByKey);this.layersListenerKeys_.length=0;var i=this.getLayers();this.layersListenerKeys_.push(Ph.listen(i,Ia.ADD,this.handleLayersAdd_,this),Ph.listen(i,Ia.REMOVE,this.handleLayersRemove_,this));for(var s in this.listenerKeys_){this.listenerKeys_[s].forEach(Ph.unlistenByKey)}Rh.clear(this.listenerKeys_);var e=i.getArray();var r,n,h;for(r=0,n=e.length;r<n;r++){h=e[r];this.listenerKeys_[Oh.getUid(h).toString()]=[Ph.listen(h,Ah.PROPERTYCHANGE,this.handleLayerChange_,this),Ph.listen(h,Wh.CHANGE,this.handleLayerChange_,this)]}this.changed()};oo.prototype.handleLayersAdd_=function(t){var i=t.element;var s=Oh.getUid(i).toString();this.listenerKeys_[s]=[Ph.listen(i,Ah.PROPERTYCHANGE,this.handleLayerChange_,this),Ph.listen(i,Wh.CHANGE,this.handleLayerChange_,this)];this.changed()};oo.prototype.handleLayersRemove_=function(t){var i=t.element;var s=Oh.getUid(i).toString();this.listenerKeys_[s].forEach(Ph.unlistenByKey);delete this.listenerKeys_[s];this.changed()};oo.prototype.getLayers=function(){return this.get(oo.Property_.LAYERS)};oo.prototype.setLayers=function(t){this.set(oo.Property_.LAYERS,t)};oo.prototype.getLayersArray=function(t){var i=t!==undefined?t:[];this.getLayers().forEach((function(t){t.getLayersArray(i)}));return i};oo.prototype.getLayerStatesArray=function(t){var i=t!==undefined?t:[];var s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var e=this.getLayerState();var r,n,h;for(r=s,n=i.length;r<n;r++){h=i[r];h.opacity*=e.opacity;h.visible=h.visible&&e.visible;h.maxResolution=Math.min(h.maxResolution,e.maxResolution);h.minResolution=Math.max(h.minResolution,e.minResolution);if(e.extent!==undefined){if(h.extent!==undefined){h.extent=Zh.getIntersection(h.extent,e.extent)}else{h.extent=e.extent}}}return i};oo.prototype.getSourceState=function(){return ao.READY};oo.Property_={LAYERS:"layers"};var fo={MAP_RENDERER:"MAP_RENDERER",LAYER_RENDERER:"LAYER_RENDERER"};var uo={};uo.mapRendererPlugins_=[];uo.getMapRendererPlugins=function(){return uo.mapRendererPlugins_};uo.layerRendererPlugins_=[];uo.getLayerRendererPlugins=function(){return uo.layerRendererPlugins_};uo.register=function(t,i){var s;switch(t){case fo.MAP_RENDERER:{s=uo.mapRendererPlugins_;s.push(i);break}case fo.LAYER_RENDERER:{s=uo.layerRendererPlugins_;s.push(i);break}default:{throw new Error("Unsupported plugin type: "+t)}}};uo.registerMultiple=function(t,i){for(var s=0,e=i.length;s<e;++s){uo.register(t,i[s])}};var lo={CANVAS:"canvas",WEBGL:"webgl"};var vo={};vo.buffer=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]+2*i;s[1]=t[1]+2*i;return s};vo.hasArea=function(t){return t[0]>0&&t[1]>0};vo.scale=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]*i+.5|0;s[1]=t[1]*i+.5|0;return s};vo.toSize=function(t,i){if(Array.isArray(t)){return t}else{if(i===undefined){i=[t,t]}else{i[0]=i[1]=t}return i}};var co=function(t){jh.call(this);var i=co.createOptionsInternal(t);this.loadTilesWhileAnimating_=t.loadTilesWhileAnimating!==undefined?t.loadTilesWhileAnimating:false;this.loadTilesWhileInteracting_=t.loadTilesWhileInteracting!==undefined?t.loadTilesWhileInteracting:false;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:Ea.DEVICE_PIXEL_RATIO;this.logos_=i.logos;this.animationDelay_=function(){this.animationDelayKey_=undefined;this.renderFrame_.call(this,Date.now())}.bind(this);this.coordinateToPixelTransform_=oa.create();this.pixelToCoordinateTransform_=oa.create();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("DIV");this.viewport_.className="ol-viewport"+(Ea.TOUCH?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";this.viewport_.style.touchAction="none";this.overlayContainer_=document.createElement("DIV");this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("DIV");this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";var s=[Wh.CLICK,Wh.DBLCLICK,Wh.MOUSEDOWN,Wh.TOUCHSTART,Wh.MSPOINTERDOWN,Aa.POINTERDOWN,Wh.MOUSEWHEEL,Wh.WHEEL];for(var e=0,r=s.length;e<r;++e){Ph.listen(this.overlayContainerStopEvent_,s[e],Dh.stopPropagation)}this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=new Ua(this,t.moveTolerance);for(var n in Aa){Ph.listen(this.mapBrowserEventHandler_,Aa[n],this.handleMapBrowserEvent,this)}this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;Ph.listen(this.viewport_,Wh.WHEEL,this.handleBrowserEvent,this);Ph.listen(this.viewport_,Wh.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new Sa;this.interactions=i.interactions||new Sa;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=i.mapRendererPlugin["create"](this.viewport_,this);this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new Ha(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};Ph.listen(this,jh.getChangeEventType(Xa.LAYERGROUP),this.handleLayerGroupChanged_,this);Ph.listen(this,jh.getChangeEventType(Xa.VIEW),this.handleViewChanged_,this);Ph.listen(this,jh.getChangeEventType(Xa.SIZE),this.handleSizeChanged_,this);Ph.listen(this,jh.getChangeEventType(Xa.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach((function(t){t.setMap(this)}),this);Ph.listen(this.controls,Ia.ADD,(function(t){t.element.setMap(this)}),this);Ph.listen(this.controls,Ia.REMOVE,(function(t){t.element.setMap(null)}),this);this.interactions.forEach((function(t){t.setMap(this)}),this);Ph.listen(this.interactions,Ia.ADD,(function(t){t.element.setMap(this)}),this);Ph.listen(this.interactions,Ia.REMOVE,(function(t){t.element.setMap(null)}),this);this.overlays_.forEach(this.addOverlayInternal_,this);Ph.listen(this.overlays_,Ia.ADD,(function(t){this.addOverlayInternal_(t.element)}),this);Ph.listen(this.overlays_,Ia.REMOVE,(function(t){var i=t.element;var s=i.getId();if(s!==undefined){delete this.overlayIdIndex_[s.toString()]}t.element.setMap(null)}),this)};Oh.inherits(co,jh);co.prototype.addControl=function(t){this.getControls().push(t)};co.prototype.addInteraction=function(t){this.getInteractions().push(t)};co.prototype.addLayer=function(t){var i=this.getLayerGroup().getLayers();i.push(t)};co.prototype.addOverlay=function(t){this.getOverlays().push(t)};co.prototype.addOverlayInternal_=function(t){var i=t.getId();if(i!==undefined){this.overlayIdIndex_[i.toString()]=t}t.setMap(this)};co.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();Ph.unlisten(this.viewport_,Wh.WHEEL,this.handleBrowserEvent,this);Ph.unlisten(this.viewport_,Wh.MOUSEWHEEL,this.handleBrowserEvent,this);if(this.handleResize_!==undefined){window.removeEventListener(Wh.RESIZE,this.handleResize_,false);this.handleResize_=undefined}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}this.setTarget(null);jh.prototype.disposeInternal.call(this)};co.prototype.forEachFeatureAtPixel=function(t,i,s){if(!this.frameState_){return}var e=this.getCoordinateFromPixel(t);s=s!==undefined?s:{};var r=s.hitTolerance!==undefined?s.hitTolerance*this.frameState_.pixelRatio:0;var n=s.layerFilter!==undefined?s.layerFilter:Kh.TRUE;return this.renderer_.forEachFeatureAtCoordinate(e,this.frameState_,r,i,null,n,null)};co.prototype.getFeaturesAtPixel=function(t,i){var s=null;this.forEachFeatureAtPixel(t,(function(t){if(!s){s=[]}s.push(t)}),i);return s};co.prototype.forEachLayerAtPixel=function(t,i,s,e,r){if(!this.frameState_){return}var n=s!==undefined?s:null;var h=e!==undefined?e:Kh.TRUE;var a=r!==undefined?r:null;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,n,h,a)};co.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_){return false}var s=this.getCoordinateFromPixel(t);i=i!==undefined?i:{};var e=i.layerFilter!==undefined?i.layerFilter:Kh.TRUE;var r=i.hitTolerance!==undefined?i.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,r,e,null)};co.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))};co.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect();var s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]};co.prototype.getTarget=function(){return this.get(Xa.TARGET)};co.prototype.getTargetElement=function(){var t=this.getTarget();if(t!==undefined){return typeof t==="string"?document.getElementById(t):t}else{return null}};co.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;if(!i){return null}else{return oa.apply(i.pixelToCoordinateTransform,t.slice())}};co.prototype.getControls=function(){return this.controls};co.prototype.getOverlays=function(){return this.overlays_};co.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return i!==undefined?i:null};co.prototype.getInteractions=function(){return this.interactions};co.prototype.getLayerGroup=function(){return this.get(Xa.LAYERGROUP)};co.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t};co.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;if(!i){return null}else{return oa.apply(i.coordinateToPixelTransform,t.slice(0,2))}};co.prototype.getRenderer=function(){return this.renderer_};co.prototype.getSize=function(){return this.get(Xa.SIZE)};co.prototype.getView=function(){return this.get(Xa.VIEW)};co.prototype.getViewport=function(){return this.viewport_};co.prototype.getOverlayContainer=function(){return this.overlayContainer_};co.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};co.prototype.getTilePriority=function(t,i,s,e){var r=this.frameState_;if(!r||!(i in r.wantedTiles)){return Ba.DROP}if(!r.wantedTiles[i][t.getKey()]){return Ba.DROP}var n=s[0]-r.focus[0];var h=s[1]-r.focus[1];return 65536*Math.log(e)+Math.sqrt(n*n+h*h)/e};co.prototype.handleBrowserEvent=function(t,i){var s=i||t.type;var e=new Ta(s,this,t);this.handleMapBrowserEvent(e)};co.prototype.handleMapBrowserEvent=function(t){if(!this.frameState_){return}this.focus_=t.coordinate;t.frameState=this.frameState_;var i=this.getInteractions().getArray();var s;if(this.dispatchEvent(t)!==false){for(s=i.length-1;s>=0;s--){var e=i[s];if(!e.getActive()){continue}var r=e.handleEvent(t);if(!r){break}}}};co.prototype.handlePostRender=function(){var t=this.frameState_;var i=this.tileQueue_;if(!i.isEmpty()){var s=16;var e=s;if(t){var r=t.viewHints;if(r[Ka.ANIMATING]){s=this.loadTilesWhileAnimating_?8:0;e=2}if(r[Ka.INTERACTING]){s=this.loadTilesWhileInteracting_?8:0;e=2}}if(i.getTilesLoading()<s){i.reprioritize();i.loadMoreTiles(s,e)}}var n=this.postRenderFunctions_;var h,a;for(h=0,a=n.length;h<a;++h){n[h](this,t)}n.length=0};co.prototype.handleSizeChanged_=function(){this.render()};co.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()){t=this.getTargetElement()}if(this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i){Ph.unlistenByKey(this.keyHandlerKeys_[i])}this.keyHandlerKeys_=null}if(!t){this.renderer_.removeLayerRenderers();ro.removeNode(this.viewport_);if(this.handleResize_!==undefined){window.removeEventListener(Wh.RESIZE,this.handleResize_,false);this.handleResize_=undefined}}else{t.appendChild(this.viewport_);var e=!this.keyboardEventTarget_?t:this.keyboardEventTarget_;this.keyHandlerKeys_=[Ph.listen(e,Wh.KEYDOWN,this.handleBrowserEvent,this),Ph.listen(e,Wh.KEYPRESS,this.handleBrowserEvent,this)];if(!this.handleResize_){this.handleResize_=this.updateSize.bind(this);window.addEventListener(Wh.RESIZE,this.handleResize_,false)}}this.updateSize()};co.prototype.handleTileChange_=function(){this.render()};co.prototype.handleViewPropertyChanged_=function(){this.render()};co.prototype.handleViewChanged_=function(){if(this.viewPropertyListenerKey_){Ph.unlistenByKey(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){Ph.unlistenByKey(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}var t=this.getView();if(t){this.viewport_.setAttribute("data-view",Oh.getUid(t));this.viewPropertyListenerKey_=Ph.listen(t,Ah.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=Ph.listen(t,Wh.CHANGE,this.handleViewPropertyChanged_,this)}this.render()};co.prototype.handleLayerGroupChanged_=function(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(Ph.unlistenByKey);this.layerGroupPropertyListenerKeys_=null}var t=this.getLayerGroup();if(t){this.layerGroupPropertyListenerKeys_=[Ph.listen(t,Ah.PROPERTYCHANGE,this.render,this),Ph.listen(t,Wh.CHANGE,this.render,this)]}this.render()};co.prototype.isRendered=function(){return!!this.frameState_};co.prototype.renderSync=function(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()};co.prototype.render=function(){if(this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}};co.prototype.removeControl=function(t){return this.getControls().remove(t)};co.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)};co.prototype.removeLayer=function(t){var i=this.getLayerGroup().getLayers();return i.remove(t)};co.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)};co.prototype.renderFrame_=function(t){var i,s,e;var r=this.getSize();var n=this.getView();var h=Zh.createEmpty();var a=this.frameState_;var o=null;if(r!==undefined&&vo.hasArea(r)&&n&&n.isDef()){var f=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);var u=this.getLayerGroup().getLayerStatesArray();var l={};for(i=0,s=u.length;i<s;++i){l[Oh.getUid(u[i].layer)]=u[i]}e=n.getState();var v=e.center;var c=e.resolution/this.pixelRatio_;v[0]=Math.round(v[0]/c)*c;v[1]=Math.round(v[1]/c)*c;o={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:h,focus:!this.focus_?v:this.focus_,index:this.frameIndex_++,layerStates:l,layerStatesArray:u,logos:Rh.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:f,wantedTiles:{}}}if(o){o.extent=Zh.getForViewAndSize(e.center,e.resolution,e.rotation,o.size,h)}this.frameState_=o;this.renderer_.renderFrame(o);if(o){if(o.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions);if(a){var d=!this.previousExtent_||!Zh.isEmpty(this.previousExtent_)&&!Zh.equals(o.extent,this.previousExtent_);if(d){this.dispatchEvent(new Oa(qa.MOVESTART,this,a));this.previousExtent_=Zh.createOrUpdateEmpty(this.previousExtent_)}}var m=this.previousExtent_&&!o.viewHints[Ka.ANIMATING]&&!o.viewHints[Ka.INTERACTING]&&!Zh.equals(o.extent,this.previousExtent_);if(m){this.dispatchEvent(new Oa(qa.MOVEEND,this,o));Zh.clone(o.extent,this.previousExtent_)}}this.dispatchEvent(new Oa(qa.POSTRENDER,this,o));setTimeout(this.handlePostRender.bind(this),0)};co.prototype.setLayerGroup=function(t){this.set(Xa.LAYERGROUP,t)};co.prototype.setSize=function(t){this.set(Xa.SIZE,t)};co.prototype.setTarget=function(t){this.set(Xa.TARGET,t)};co.prototype.setView=function(t){this.set(Xa.VIEW,t)};co.prototype.skipFeature=function(t){var i=Oh.getUid(t).toString();this.skippedFeatureUids_[i]=true;this.render()};co.prototype.updateSize=function(){var t=this.getTargetElement();if(!t){this.setSize(undefined)}else{var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i["borderLeftWidth"])-parseFloat(i["paddingLeft"])-parseFloat(i["paddingRight"])-parseFloat(i["borderRightWidth"]),t.offsetHeight-parseFloat(i["borderTopWidth"])-parseFloat(i["paddingTop"])-parseFloat(i["paddingBottom"])-parseFloat(i["borderBottomWidth"])])}};co.prototype.unskipFeature=function(t){var i=Oh.getUid(t).toString();delete this.skippedFeatureUids_[i];this.render()};co.DEFAULT_RENDERER_TYPES=[lo.CANVAS,lo.WEBGL];co.LOGO_URL="data:image/png;base64,"+"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBI"+"WXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAA"+"AhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszW"+"WMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvY"+"asvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvX"+"H1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1Vk"+"bMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW"+"2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLP"+"VcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqT"+"acrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaar"+"ldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+Hi"+"zeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDn"+"BAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSF"+"hYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJ"+"REFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxC"+"Brb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe"+"0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8"+"a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7a"+"hgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCn"+"B3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDg"+"q82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";co.createOptionsInternal=function(t){var i=null;if(t.keyboardEventTarget!==undefined){i=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}var s={};var e={};if(t.logo===undefined||typeof t.logo==="boolean"&&t.logo){e[co.LOGO_URL]="https://openlayers.org/"}else{var r=t.logo;if(typeof r==="string"){e[r]=""}else if(r instanceof HTMLElement){e[Oh.getUid(r).toString()]=r}else if(r){Uh.assert(typeof r.href=="string",44);Uh.assert(typeof r.src=="string",45);e[r.src]=r.href}}var n=t.layers instanceof oo?t.layers:new oo({layers:t.layers});s[Xa.LAYERGROUP]=n;s[Xa.TARGET]=t.target;s[Xa.VIEW]=t.view!==undefined?t.view:new eo;var h;if(t.renderer!==undefined){if(Array.isArray(t.renderer)){h=t.renderer}else if(typeof t.renderer==="string"){h=[t.renderer]}else{Uh.assert(false,46)}if(h.indexOf("dom")>=0){h=h.concat(co.DEFAULT_RENDERER_TYPES)}}else{h=co.DEFAULT_RENDERER_TYPES}var a;var o=uo.getMapRendererPlugins();t:for(var f=0,u=h.length;f<u;++f){var l=h[f];for(var v=0,c=o.length;v<c;++v){var d=o[v];if(d["handles"](l)){a=d;break t}}}if(!a){throw new Error("Unable to create a map renderer for types: "+h.join(", "))}var m;if(t.controls!==undefined){if(Array.isArray(t.controls)){m=new Sa(t.controls.slice())}else{Uh.assert(t.controls instanceof Sa,47);m=t.controls}}var p;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){p=new Sa(t.interactions.slice())}else{Uh.assert(t.interactions instanceof Sa,48);p=t.interactions}}var z;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){z=new Sa(t.overlays.slice())}else{Uh.assert(t.overlays instanceof Sa,49);z=t.overlays}}else{z=new Sa}return{controls:m,interactions:p,keyboardEventTarget:i,logos:e,overlays:z,mapRendererPlugin:a,values:s}};var mo=function(t){jh.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:Oh.nullFunction;if(t.target){this.setTarget(t.target)}};Oh.inherits(mo,jh);mo.prototype.disposeInternal=function(){ro.removeNode(this.element);jh.prototype.disposeInternal.call(this)};mo.prototype.getMap=function(){return this.map_};mo.prototype.setMap=function(t){if(this.map_){ro.removeNode(this.element)}for(var i=0,s=this.listenerKeys.length;i<s;++i){Ph.unlistenByKey(this.listenerKeys[i])}this.listenerKeys.length=0;this.map_=t;if(this.map_){var e=this.target_?this.target_:t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==Oh.nullFunction){this.listenerKeys.push(Ph.listen(t,qa.POSTRENDER,this.render,this))}t.render()}};mo.prototype.setTarget=function(t){this.target_=typeof t==="string"?document.getElementById(t):t};var po={};po.CLASS_HIDDEN="ol-hidden";po.CLASS_SELECTABLE="ol-selectable";po.CLASS_UNSELECTABLE="ol-unselectable";po.CLASS_UNSUPPORTED="ol-unsupported";po.CLASS_CONTROL="ol-control";po.getFontFamilies=function(){var t;var i={};return function(s){if(!t){t=document.createElement("div").style}if(!(s in i)){t.font=s;var e=t.fontFamily;t.font="";if(!e){return null}i[s]=e.split(/,\s?/)}return i[s]}}();var zo={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};var Mo=function(t){var i=Rh.assign({},t);delete i.source;ho.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;if(t.map){this.setMap(t.map)}Ph.listen(this,jh.getChangeEventType(no.SOURCE),this.handleSourcePropertyChange_,this);var s=t.source?t.source:null;this.setSource(s)};Oh.inherits(Mo,ho);Mo.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution};Mo.prototype.getLayersArray=function(t){var i=t?t:[];i.push(this);return i};Mo.prototype.getLayerStatesArray=function(t){var i=t?t:[];i.push(this.getLayerState());return i};Mo.prototype.getSource=function(){var t=this.get(no.SOURCE);return t||null};Mo.prototype.getSourceState=function(){var t=this.getSource();return!t?ao.UNDEFINED:t.getState()};Mo.prototype.handleSourceChange_=function(){this.changed()};Mo.prototype.handleSourcePropertyChange_=function(){if(this.sourceChangeKey_){Ph.unlistenByKey(this.sourceChangeKey_);this.sourceChangeKey_=null}var t=this.getSource();if(t){this.sourceChangeKey_=Ph.listen(t,Wh.CHANGE,this.handleSourceChange_,this)}this.changed()};Mo.prototype.setMap=function(t){if(this.mapPrecomposeKey_){Ph.unlistenByKey(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){Ph.unlistenByKey(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=Ph.listen(t,zo.PRECOMPOSE,(function(t){var i=this.getLayerState();i.managed=false;i.zIndex=Infinity;t.frameState.layerStatesArray.push(i);t.frameState.layerStates[Oh.getUid(this)]=i}),this);this.mapRenderKey_=Ph.listen(this,Wh.CHANGE,t.render,t);this.changed()}};Mo.prototype.setSource=function(t){this.set(no.SOURCE,t)};var _o=function(t){var i=t?t:{};this.ulElement_=document.createElement("UL");this.logoLi_=document.createElement("LI");this.ulElement_.appendChild(this.logoLi_);this.logoLi_.style.display="none";this.collapsed_=i.collapsed!==undefined?i.collapsed:true;this.collapsible_=i.collapsible!==undefined?i.collapsible:true;if(!this.collapsible_){this.collapsed_=false}var s=i.className!==undefined?i.className:"ol-attribution";var e=i.tipLabel!==undefined?i.tipLabel:"Attributions";var r=i.collapseLabel!==undefined?i.collapseLabel:"»";if(typeof r==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=r}else{this.collapseLabel_=r}var n=i.label!==undefined?i.label:"i";if(typeof n==="string"){this.label_=document.createElement("span");this.label_.textContent=n}else{this.label_=n}var h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;var a=document.createElement("button");a.setAttribute("type","button");a.title=e;a.appendChild(h);Ph.listen(a,Wh.CLICK,this.handleClick_,this);var o=s+" "+po.CLASS_UNSELECTABLE+" "+po.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible");var f=document.createElement("div");f.className=o;f.appendChild(this.ulElement_);f.appendChild(a);var u=i.render?i.render:_o.render;mo.call(this,{element:f,render:u,target:i.target});this.renderedAttributions_=[];this.renderedVisible_=true;this.logoElements_={}};Oh.inherits(_o,mo);_o.prototype.getSourceAttributions_=function(t){var i={};var s=[];var e=t.layerStatesArray;var r=t.viewState.resolution;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(!Mo.visibleAtResolution(a,r)){continue}var o=a.layer.getSource();if(!o){continue}var f=o.getAttributions2();if(!f){continue}var u=f(t);if(!u){continue}if(Array.isArray(u)){for(var l=0,v=u.length;l<v;++l){if(!(u[l]in i)){s.push(u[l]);i[u[l]]=true}}}else{if(!(u in i)){s.push(u);i[u]=true}}}return s};_o.render=function(t){this.updateElement_(t.frameState)};_o.prototype.updateElement_=function(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}var i=this.getSourceAttributions_(t);if(Bh.equals(i,this.renderedAttributions_)){return}while(this.ulElement_.lastChild!==this.logoLi_){this.ulElement_.removeChild(this.ulElement_.lastChild)}for(var s=0,e=i.length;s<e;++s){var r=document.createElement("LI");r.innerHTML=i[s];this.ulElement_.appendChild(r)}if(i.length===0&&this.renderedAttributions_.length>0){this.element.classList.add("ol-logo-only")}else if(this.renderedAttributions_.length===0&&i.length>0){this.element.classList.remove("ol-logo-only")}var n=i.length>0||!Rh.isEmpty(t.logos);if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}this.renderedAttributions_=i;this.insertLogos_(t)};_o.prototype.insertLogos_=function(t){var i;var s=t.logos;var e=this.logoElements_;for(i in e){if(!(i in s)){ro.removeNode(e[i]);delete e[i]}}var r,n,h;for(h in s){var a=s[h];if(a instanceof HTMLElement){this.logoLi_.appendChild(a);e[h]=a}if(!(h in e)){r=new Image;r.src=h;if(a===""){n=r}else{n=document.createElement("a");n.href=a;n.appendChild(r)}this.logoLi_.appendChild(n);e[h]=n}}this.logoLi_.style.display=!Rh.isEmpty(s)?"":"none"};_o.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()};_o.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed");if(this.collapsed_){ro.replaceNode(this.collapseLabel_,this.label_)}else{ro.replaceNode(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_};_o.prototype.getCollapsible=function(){return this.collapsible_};_o.prototype.setCollapsible=function(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}};_o.prototype.setCollapsed=function(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()};_o.prototype.getCollapsed=function(){return this.collapsed_};var go=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-rotate";var e=i.label!==undefined?i.label:"⇧";this.label_=null;if(typeof e==="string"){this.label_=document.createElement("span");this.label_.className="ol-compass";this.label_.textContent=e}else{this.label_=e;this.label_.classList.add("ol-compass")}var r=i.tipLabel?i.tipLabel:"Reset rotation";var n=document.createElement("button");n.className=s+"-reset";n.setAttribute("type","button");n.title=r;n.appendChild(this.label_);Ph.listen(n,Wh.CLICK,go.prototype.handleClick_,this);var h=s+" "+po.CLASS_UNSELECTABLE+" "+po.CLASS_CONTROL;var a=document.createElement("div");a.className=h;a.appendChild(n);var o=i.render?i.render:go.render;this.callResetNorth_=i.resetNorth?i.resetNorth:undefined;mo.call(this,{element:a,render:o,target:i.target});this.duration_=i.duration!==undefined?i.duration:250;this.autoHide_=i.autoHide!==undefined?i.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(po.CLASS_HIDDEN)}};Oh.inherits(go,mo);go.prototype.handleClick_=function(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}};go.prototype.resetNorth_=function(){var t=this.getMap();var i=t.getView();if(!i){return}if(i.getRotation()!==undefined){if(this.duration_>0){i.animate({rotation:0,duration:this.duration_,easing:so.easeOut})}else{i.setRotation(0)}}};go.render=function(t){var i=t.frameState;if(!i){return}var s=i.viewState.rotation;if(s!=this.rotation_){var e="rotate("+s+"rad)";if(this.autoHide_){var r=this.element.classList.contains(po.CLASS_HIDDEN);if(!r&&s===0){this.element.classList.add(po.CLASS_HIDDEN)}else if(r&&s!==0){this.element.classList.remove(po.CLASS_HIDDEN)}}this.label_.style.msTransform=e;this.label_.style.webkitTransform=e;this.label_.style.transform=e}this.rotation_=s};var bo=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-zoom";var e=i.delta!==undefined?i.delta:1;var r=i.zoomInLabel!==undefined?i.zoomInLabel:"+";var n=i.zoomOutLabel!==undefined?i.zoomOutLabel:"−";var h=i.zoomInTipLabel!==undefined?i.zoomInTipLabel:"Zoom in";var a=i.zoomOutTipLabel!==undefined?i.zoomOutTipLabel:"Zoom out";var o=document.createElement("button");o.className=s+"-in";o.setAttribute("type","button");o.title=h;o.appendChild(typeof r==="string"?document.createTextNode(r):r);Ph.listen(o,Wh.CLICK,bo.prototype.handleClick_.bind(this,e));var f=document.createElement("button");f.className=s+"-out";f.setAttribute("type","button");f.title=a;f.appendChild(typeof n==="string"?document.createTextNode(n):n);Ph.listen(f,Wh.CLICK,bo.prototype.handleClick_.bind(this,-e));var u=s+" "+po.CLASS_UNSELECTABLE+" "+po.CLASS_CONTROL;var l=document.createElement("div");l.className=u;l.appendChild(o);l.appendChild(f);mo.call(this,{element:l,target:i.target});this.duration_=i.duration!==undefined?i.duration:250};Oh.inherits(bo,mo);bo.prototype.handleClick_=function(t,i){i.preventDefault();this.zoomByDelta_(t)};bo.prototype.zoomByDelta_=function(t){var i=this.getMap();var s=i.getView();if(!s){return}var e=s.getResolution();if(e){var r=s.constrainResolution(e,t);if(this.duration_>0){if(s.getAnimating()){s.cancelAnimations()}s.animate({resolution:r,duration:this.duration_,easing:so.easeOut})}else{s.setResolution(r)}}};var xo={};xo.defaults=function(t){var i=t?t:{};var s=new Sa;var e=i.zoom!==undefined?i.zoom:true;if(e){s.push(new bo(i.zoomOptions))}var r=i.rotate!==undefined?i.rotate:true;if(r){s.push(new go(i.rotateOptions))}var n=i.attribution!==undefined?i.attribution:true;if(n){s.push(new _o(i.attributionOptions))}return s};var wo=function(t,i,s){this.decay_=t;this.minVelocity_=i;this.delay_=s;this.points_=[];this.angle_=0;this.initialVelocity_=0};wo.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};wo.prototype.update=function(t,i){this.points_.push(t,i,Date.now())};wo.prototype.end=function(){if(this.points_.length<6){return false}var t=Date.now()-this.delay_;var i=this.points_.length-3;if(this.points_[i+2]<t){return false}var s=i-3;while(s>0&&this.points_[s+2]>t){s-=3}var e=this.points_[i+2]-this.points_[s+2];if(e<1e3/60){return false}var r=this.points_[i]-this.points_[s];var n=this.points_[i+1]-this.points_[s+1];this.angle_=Math.atan2(n,r);this.initialVelocity_=Math.sqrt(r*r+n*n)/e;return this.initialVelocity_>this.minVelocity_};wo.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};wo.prototype.getAngle=function(){return this.angle_};var yo={ACTIVE:"active"};var ko=function(t){jh.call(this);this.map_=null;this.setActive(true);this.handleEvent=t.handleEvent};Oh.inherits(ko,jh);ko.prototype.getActive=function(){return this.get(yo.ACTIVE)};ko.prototype.getMap=function(){return this.map_};ko.prototype.setActive=function(t){this.set(yo.ACTIVE,t)};ko.prototype.setMap=function(t){this.map_=t};ko.pan=function(t,i,s){var e=t.getCenter();if(e){var r=t.constrainCenter([e[0]+i[0],e[1]+i[1]]);if(s){t.animate({duration:s,easing:so.linear,center:r})}else{t.setCenter(r)}}};ko.rotate=function(t,i,s,e){i=t.constrainRotation(i,0);ko.rotateWithoutConstraints(t,i,s,e)};ko.rotateWithoutConstraints=function(t,i,s,e){if(i!==undefined){var r=t.getRotation();var n=t.getCenter();if(r!==undefined&&n&&e>0){t.animate({rotation:i,anchor:s,duration:e,easing:so.easeOut})}else{t.rotate(i,s)}}};ko.zoom=function(t,i,s,e,r){i=t.constrainResolution(i,0,r);ko.zoomWithoutConstraints(t,i,s,e)};ko.zoomByDelta=function(t,i,s,e){var r=t.getResolution();var n=t.constrainResolution(r,i,0);if(n!==undefined){var h=t.getResolutions();n=qh.clamp(n,t.getMinResolution()||h[h.length-1],t.getMaxResolution()||h[0])}if(s&&n!==undefined&&n!==r){var a=t.getCenter();var o=t.calculateCenterZoom(n,s);o=t.constrainCenter(o);s=[(n*a[0]-r*o[0])/(n-r),(n*a[1]-r*o[1])/(n-r)]}ko.zoomWithoutConstraints(t,n,s,e)};ko.zoomWithoutConstraints=function(t,i,s,e){if(i){var r=t.getResolution();var n=t.getCenter();if(r!==undefined&&n&&i!==r&&e){t.animate({resolution:i,anchor:s,duration:e,easing:so.easeOut})}else{if(s){var h=t.calculateCenterZoom(i,s);t.setCenter(h)}t.setResolution(i)}}};var Eo=function(t){var i=t?t:{};this.delta_=i.delta?i.delta:1;ko.call(this,{handleEvent:Eo.handleEvent});this.duration_=i.duration!==undefined?i.duration:250};Oh.inherits(Eo,ko);Eo.handleEvent=function(t){var i=false;var s=t.originalEvent;if(t.type==Aa.DBLCLICK){var e=t.map;var r=t.coordinate;var n=s.shiftKey?-this.delta_:this.delta_;var h=e.getView();ko.zoomByDelta(h,n,r,this.duration_);t.preventDefault();i=true}return!i};var No={};No.altKeyOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};No.altShiftKeysOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};No.always=Kh.TRUE;No.click=function(t){return t.type==Aa.CLICK};No.mouseActionButton=function(t){var i=t.originalEvent;return i.button==0&&!(Ea.WEBKIT&&Ea.MAC&&i.ctrlKey)};No.never=Kh.FALSE;No.pointerMove=function(t){return t.type=="pointermove"};No.singleClick=function(t){return t.type==Aa.SINGLECLICK};No.doubleClick=function(t){return t.type==Aa.DBLCLICK};No.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};No.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(Ea.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey};No.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};No.targetNotEditable=function(t){var i=t.originalEvent.target;var s=i.tagName;return s!=="INPUT"&&s!=="SELECT"&&s!=="TEXTAREA"};No.mouseOnly=function(t){Uh.assert(t.pointerEvent,56);return t.pointerEvent.pointerType=="mouse"};No.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&i.button===0};var Co=function(t){var i=t?t:{};var s=i.handleEvent?i.handleEvent:Co.handleEvent;ko.call(this,{handleEvent:s});this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:Co.handleDownEvent;this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:Co.handleDragEvent;this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:Co.handleMoveEvent;this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:Co.handleUpEvent;this.handlingDownUpSequence=false;this.trackedPointers_={};this.targetPointers=[]};Oh.inherits(Co,ko);Co.centroid=function(t){var i=t.length;var s=0;var e=0;for(var r=0;r<i;r++){s+=t[r].clientX;e+=t[r].clientY}return[s/i,e/i]};Co.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===Aa.POINTERDOWN||i===Aa.POINTERDRAG||i===Aa.POINTERUP};Co.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent;var s=i.pointerId.toString();if(t.type==Aa.POINTERUP){delete this.trackedPointers_[s]}else if(t.type==Aa.POINTERDOWN){this.trackedPointers_[s]=i}else if(s in this.trackedPointers_){this.trackedPointers_[s]=i}this.targetPointers=Rh.getValues(this.trackedPointers_)}};Co.handleDragEvent=Oh.nullFunction;Co.handleUpEvent=Kh.FALSE;Co.handleDownEvent=Kh.FALSE;Co.handleMoveEvent=Oh.nullFunction;Co.handleEvent=function(t){if(!(t instanceof Ra)){return true}var i=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==Aa.POINTERDRAG){this.handleDragEvent_(t)}else if(t.type==Aa.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else{if(t.type==Aa.POINTERDOWN){var e=this.handleDownEvent_(t);this.handlingDownUpSequence=e;i=this.shouldStopEvent(e)}else if(t.type==Aa.POINTERMOVE){this.handleMoveEvent_(t)}}return!i};Co.prototype.shouldStopEvent=function(t){return t};var Io=function(t){Co.call(this,{handleDownEvent:Io.handleDownEvent_,handleDragEvent:Io.handleDragEvent_,handleUpEvent:Io.handleUpEvent_});var i=t?t:{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.condition_=i.condition?i.condition:No.noModifierKeys;this.noKinetic_=false};Oh.inherits(Io,Co);Io.handleDragEvent_=function(t){var i=this.targetPointers;var s=Co.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(s[0],s[1])}if(this.lastCentroid){var e=this.lastCentroid[0]-s[0];var r=s[1]-this.lastCentroid[1];var n=t.map;var h=n.getView();var a=h.getState();var o=[e,r];io.scale(o,a.resolution);io.rotate(o,a.rotation);io.add(o,a.center);o=h.constrainCenter(o);h.setCenter(o)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=s;this.lastPointersCount_=i.length};Io.handleUpEvent_=function(t){var i=t.map;var s=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var e=this.kinetic_.getDistance();var r=this.kinetic_.getAngle();var n=s.getCenter();var h=i.getPixelFromCoordinate(n);var a=i.getCoordinateFromPixel([h[0]-e*Math.cos(r),h[1]-e*Math.sin(r)]);s.animate({center:s.constrainCenter(a),duration:500,easing:so.easeOut})}s.setHint(Ka.INTERACTING,-1);return false}else{if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}};Io.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map;var s=i.getView();this.lastCentroid=null;if(!this.handlingDownUpSequence){s.setHint(Ka.INTERACTING,1)}if(s.getAnimating()){s.setCenter(t.frameState.viewState.center)}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}else{return false}};Io.prototype.shouldStopEvent=Kh.FALSE;var So=function(t){var i=t?t:{};Co.call(this,{handleDownEvent:So.handleDownEvent_,handleDragEvent:So.handleDragEvent_,handleUpEvent:So.handleUpEvent_});this.condition_=i.condition?i.condition:No.altShiftKeysOnly;this.lastAngle_=undefined;this.duration_=i.duration!==undefined?i.duration:250};Oh.inherits(So,Co);So.handleDragEvent_=function(t){if(!No.mouseOnly(t)){return}var i=t.map;var s=i.getView();if(s.getConstraints().rotation===$a.disable){return}var e=i.getSize();var r=t.pixel;var n=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(this.lastAngle_!==undefined){var h=n-this.lastAngle_;var a=s.getRotation();ko.rotateWithoutConstraints(s,a-h)}this.lastAngle_=n};So.handleUpEvent_=function(t){if(!No.mouseOnly(t)){return true}var i=t.map;var s=i.getView();s.setHint(Ka.INTERACTING,-1);var e=s.getRotation();ko.rotate(s,e,undefined,this.duration_);return false};So.handleDownEvent_=function(t){if(!No.mouseOnly(t)){return false}if(No.mouseActionButton(t)&&this.condition_(t)){var i=t.map;i.getView().setHint(Ka.INTERACTING,1);this.lastAngle_=undefined;return true}else{return false}};So.prototype.shouldStopEvent=Kh.FALSE;var Oo=function(t){this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null};Oh.inherits(Oo,Lh);Oo.prototype.disposeInternal=function(){this.setMap(null)};Oo.prototype.render_=function(){var t=this.startPixel_;var i=this.endPixel_;var s="px";var e=this.element_.style;e.left=Math.min(t[0],i[0])+s;e.top=Math.min(t[1],i[1])+s;e.width=Math.abs(i[0]-t[0])+s;e.height=Math.abs(i[1]-t[1])+s};Oo.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}};Oo.prototype.setPixels=function(t,i){this.startPixel_=t;this.endPixel_=i;this.createOrUpdateGeometry();this.render_()};Oo.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_;var i=this.endPixel_;var s=[t,[t[0],i[1]],i,[i[0],t[1]]];var e=s.map(this.map_.getCoordinateFromPixel,this.map_);e[4]=e[0].slice();if(!this.geometry_){this.geometry_=new ya([e])}else{this.geometry_.setCoordinates([e])}};Oo.prototype.getGeometry=function(){return this.geometry_};var To=function(t){Co.call(this,{handleDownEvent:To.handleDownEvent_,handleDragEvent:To.handleDragEvent_,handleUpEvent:To.handleUpEvent_});var i=t?t:{};this.box_=new Oo(i.className||"ol-dragbox");this.minArea_=i.minArea!==undefined?i.minArea:64;this.startPixel_=null;this.condition_=i.condition?i.condition:No.always;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:To.defaultBoxEndCondition};Oh.inherits(To,Co);To.defaultBoxEndCondition=function(t,i,s){var e=s[0]-i[0];var r=s[1]-i[1];return e*e+r*r>=this.minArea_};To.handleDragEvent_=function(t){if(!No.mouseOnly(t)){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new To.Event(To.EventType_.BOXDRAG,t.coordinate,t))};To.prototype.getGeometry=function(){return this.box_.getGeometry()};To.prototype.onBoxEnd=Oh.nullFunction;To.handleUpEvent_=function(t){if(!No.mouseOnly(t)){return true}this.box_.setMap(null);if(this.boxEndCondition_(t,this.startPixel_,t.pixel)){this.onBoxEnd(t);this.dispatchEvent(new To.Event(To.EventType_.BOXEND,t.coordinate,t))}return false};To.handleDownEvent_=function(t){if(!No.mouseOnly(t)){return false}if(No.mouseActionButton(t)&&this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new To.Event(To.EventType_.BOXSTART,t.coordinate,t));return true}else{return false}};To.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"};To.Event=function(t,i,s){Dh.call(this,t);this.coordinate=i;this.mapBrowserEvent=s};Oh.inherits(To.Event,Dh);var Ao=function(t){var i=t?t:{};var s=i.condition?i.condition:No.shiftKeyOnly;this.duration_=i.duration!==undefined?i.duration:200;this.out_=i.out!==undefined?i.out:false;To.call(this,{condition:s,className:i.className||"ol-dragzoom"})};Oh.inherits(Ao,To);Ao.prototype.onBoxEnd=function(){var t=this.getMap();var i=t.getView();var s=t.getSize();var e=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtent(s);var n=Zh.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(Zh.getBottomLeft(e)),t.getPixelFromCoordinate(Zh.getTopRight(e))]);var h=i.getResolutionForExtent(n,s);Zh.scaleFromCenter(r,1/h);e=r}var a=i.constrainResolution(i.getResolutionForExtent(e,s));var o=Zh.getCenter(e);o=i.constrainCenter(o);i.animate({resolution:a,center:o,duration:this.duration_,easing:so.easeOut})};var Ro={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Po=function(t){ko.call(this,{handleEvent:Po.handleEvent});var i=t||{};this.defaultCondition_=function(t){return No.noModifierKeys(t)&&No.targetNotEditable(t)};this.condition_=i.condition!==undefined?i.condition:this.defaultCondition_;this.duration_=i.duration!==undefined?i.duration:100;this.pixelDelta_=i.pixelDelta!==undefined?i.pixelDelta:128};Oh.inherits(Po,ko);Po.handleEvent=function(t){var i=false;if(t.type==Wh.KEYDOWN){var s=t.originalEvent;var e=s.keyCode;if(this.condition_(t)&&(e==Ro.DOWN||e==Ro.LEFT||e==Ro.RIGHT||e==Ro.UP)){var r=t.map;var n=r.getView();var h=n.getResolution()*this.pixelDelta_;var a=0,o=0;if(e==Ro.DOWN){o=-h}else if(e==Ro.LEFT){a=-h}else if(e==Ro.RIGHT){a=h}else{o=h}var f=[a,o];io.rotate(f,n.getRotation());ko.pan(n,f,this.duration_);t.preventDefault();i=true}}return!i};var Lo=function(t){ko.call(this,{handleEvent:Lo.handleEvent});var i=t?t:{};this.condition_=i.condition?i.condition:No.targetNotEditable;this.delta_=i.delta?i.delta:1;this.duration_=i.duration!==undefined?i.duration:100};Oh.inherits(Lo,ko);Lo.handleEvent=function(t){var i=false;if(t.type==Wh.KEYDOWN||t.type==Wh.KEYPRESS){var s=t.originalEvent;var e=s.charCode;if(this.condition_(t)&&(e=="+".charCodeAt(0)||e=="-".charCodeAt(0))){var r=t.map;var n=e=="+".charCodeAt(0)?this.delta_:-this.delta_;var h=r.getView();ko.zoomByDelta(h,n,undefined,this.duration_);t.preventDefault();i=true}}return!i};var Do=function(t){ko.call(this,{handleEvent:Do.handleEvent});var i=t||{};this.delta_=0;this.duration_=i.duration!==undefined?i.duration:250;this.timeout_=i.timeout!==undefined?i.timeout:80;this.useAnchor_=i.useAnchor!==undefined?i.useAnchor:true;this.constrainResolution_=i.constrainResolution||false;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_=undefined;this.trackpadDeltaPerZoom_=300;this.trackpadZoomBuffer_=1.5};Oh.inherits(Do,ko);Do.handleEvent=function(t){var i=t.type;if(i!==Wh.WHEEL&&i!==Wh.MOUSEWHEEL){return true}t.preventDefault();var s=t.map;var e=t.originalEvent;if(this.useAnchor_){this.lastAnchor_=t.coordinate}var r;if(t.type==Wh.WHEEL){r=e.deltaY;if(Ea.FIREFOX&&e.deltaMode===WheelEvent.DOM_DELTA_PIXEL){r/=Ea.DEVICE_PIXEL_RATIO}if(e.deltaMode===WheelEvent.DOM_DELTA_LINE){r*=40}}else if(t.type==Wh.MOUSEWHEEL){r=-e.wheelDeltaY;if(Ea.SAFARI){r/=3}}if(r===0){return false}var n=Date.now();if(this.startTime_===undefined){this.startTime_=n}if(!this.mode_||n-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(r)<4?Do.Mode_.TRACKPAD:Do.Mode_.WHEEL}if(this.mode_===Do.Mode_.TRACKPAD){var h=s.getView();if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{h.setHint(Ka.INTERACTING,1)}this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=h.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_);var o=h.getMinResolution();var f=h.getMaxResolution();var u=0;if(a<o){a=Math.max(a,o/this.trackpadZoomBuffer_);u=1}else if(a>f){a=Math.min(a,f*this.trackpadZoomBuffer_);u=-1}if(this.lastAnchor_){var l=h.calculateCenterZoom(a,this.lastAnchor_);h.setCenter(h.constrainCenter(l))}h.setResolution(a);if(u===0&&this.constrainResolution_){h.animate({resolution:h.constrainResolution(a,r>0?-1:1),easing:so.easeOut,anchor:this.lastAnchor_,duration:this.duration_})}if(u>0){h.animate({resolution:o,easing:so.easeOut,anchor:this.lastAnchor_,duration:500})}else if(u<0){h.animate({resolution:f,easing:so.easeOut,anchor:this.lastAnchor_,duration:500})}this.startTime_=n;return false}this.delta_+=r;var v=Math.max(this.timeout_-(n-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),v);return false};Do.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=undefined;var t=this.getMap().getView();t.setHint(Ka.INTERACTING,-1)};Do.prototype.handleWheelZoom_=function(t){var i=t.getView();if(i.getAnimating()){i.cancelAnimations()}var s=Oh.MOUSEWHEELZOOM_MAXDELTA;var e=qh.clamp(this.delta_,-s,s);ko.zoomByDelta(i,-e,this.lastAnchor_,this.duration_);this.mode_=undefined;this.delta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined};Do.prototype.setMouseAnchor=function(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}};Do.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var Fo=function(t){Co.call(this,{handleDownEvent:Fo.handleDownEvent_,handleDragEvent:Fo.handleDragEvent_,handleUpEvent:Fo.handleUpEvent_});var i=t||{};this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=i.threshold!==undefined?i.threshold:.3;this.duration_=i.duration!==undefined?i.duration:250};Oh.inherits(Fo,Co);Fo.handleDragEvent_=function(t){var i=0;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=Math.atan2(e.clientY-s.clientY,e.clientX-s.clientX);if(this.lastAngle_!==undefined){var n=r-this.lastAngle_;this.rotationDelta_+=n;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}i=n}this.lastAngle_=r;var h=t.map;var a=h.getView();if(a.getConstraints().rotation===$a.disable){return}var o=h.getViewport().getBoundingClientRect();var f=Co.centroid(this.targetPointers);f[0]-=o.left;f[1]-=o.top;this.anchor_=h.getCoordinateFromPixel(f);if(this.rotating_){var u=a.getRotation();h.render();ko.rotateWithoutConstraints(a,u+i,this.anchor_)}};Fo.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ka.INTERACTING,-1);if(this.rotating_){var e=s.getRotation();ko.rotate(s,e,this.anchor_,this.duration_)}return false}else{return true}};Fo.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){i.getView().setHint(Ka.INTERACTING,1)}return true}else{return false}};Fo.prototype.shouldStopEvent=Kh.FALSE;var Wo=function(t){Co.call(this,{handleDownEvent:Wo.handleDownEvent_,handleDragEvent:Wo.handleDragEvent_,handleUpEvent:Wo.handleUpEvent_});var i=t?t:{};this.constrainResolution_=i.constrainResolution||false;this.anchor_=null;this.duration_=i.duration!==undefined?i.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1};Oh.inherits(Wo,Co);Wo.handleDragEvent_=function(t){var i=1;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=s.clientX-e.clientX;var n=s.clientY-e.clientY;var h=Math.sqrt(r*r+n*n);if(this.lastDistance_!==undefined){i=this.lastDistance_/h}this.lastDistance_=h;var a=t.map;var o=a.getView();var f=o.getResolution();var u=o.getMaxResolution();var l=o.getMinResolution();var v=f*i;if(v>u){i=u/f;v=u}else if(v<l){i=l/f;v=l}if(i!=1){this.lastScaleDelta_=i}var c=a.getViewport().getBoundingClientRect();var d=Co.centroid(this.targetPointers);d[0]-=c.left;d[1]-=c.top;this.anchor_=a.getCoordinateFromPixel(d);a.render();ko.zoomWithoutConstraints(o,v,this.anchor_)};Wo.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Ka.INTERACTING,-1);var e=s.getResolution();if(this.constrainResolution_||e<s.getMinResolution()||e>s.getMaxResolution()){var r=this.lastScaleDelta_-1;ko.zoom(s,e,this.anchor_,this.duration_,r)}return false}else{return true}};Wo.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){i.getView().setHint(Ka.INTERACTING,1)}return true}else{return false}};Wo.prototype.shouldStopEvent=Kh.FALSE;var Go={};Go.defaults=function(t){var i=t?t:{};var s=new Sa;var e=new wo(-.005,.05,100);var r=i.altShiftDragRotate!==undefined?i.altShiftDragRotate:true;if(r){s.push(new So)}var n=i.doubleClickZoom!==undefined?i.doubleClickZoom:true;if(n){s.push(new Eo({delta:i.zoomDelta,duration:i.zoomDuration}))}var h=i.dragPan!==undefined?i.dragPan:true;if(h){s.push(new Io({kinetic:e}))}var a=i.pinchRotate!==undefined?i.pinchRotate:true;if(a){s.push(new Fo)}var o=i.pinchZoom!==undefined?i.pinchZoom:true;if(o){s.push(new Wo({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var f=i.keyboard!==undefined?i.keyboard:true;if(f){s.push(new Po);s.push(new Lo({delta:i.zoomDelta,duration:i.zoomDuration}))}var u=i.mouseWheelZoom!==undefined?i.mouseWheelZoom:true;if(u){s.push(new Do({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var l=i.shiftDragZoom!==undefined?i.shiftDragZoom:true;if(l){s.push(new Ao({duration:i.zoomDuration}))}return s};var jo=function(t,i,s,e){Fh.call(this);this.extent=t;this.pixelRatio_=s;this.resolution=i;this.state=e};Oh.inherits(jo,Fh);jo.prototype.changed=function(){this.dispatchEvent(Wh.CHANGE)};jo.prototype.getExtent=function(){return this.extent};jo.prototype.getImage=function(){};jo.prototype.getPixelRatio=function(){return this.pixelRatio_};jo.prototype.getResolution=function(){return this.resolution};jo.prototype.getState=function(){return this.state};jo.prototype.load=function(){};var Vo={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var Uo=function(t,i,s,e,r){this.loader_=r!==undefined?r:null;var n=r!==undefined?Vo.IDLE:Vo.LOADED;jo.call(this,t,i,s,n);this.canvas_=e;this.error_=null};Oh.inherits(Uo,jo);Uo.prototype.getError=function(){return this.error_};Uo.prototype.handleLoad_=function(t){if(t){this.error_=t;this.state=Vo.ERROR}else{this.state=Vo.LOADED}this.changed()};Uo.prototype.load=function(){if(this.state==Vo.IDLE){this.state=Vo.LOADING;this.changed();this.loader_(this.handleLoad_.bind(this))}};Uo.prototype.getImage=function(){return this.canvas_};var qo={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"};var Xo={IMAGE:"image",VECTOR:"vector"};var Yo=function(t,i,s,e,r){Dh.call(this,t);this.vectorContext=i;this.frameState=s;this.context=e;this.glContext=r};Oh.inherits(Yo,Dh);var Bo=function(t){Fh.call(this);this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null};Oh.inherits(Bo,Fh);Bo.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark};Bo.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(Wh.CLEAR)};Bo.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)};Bo.prototype.forEach=function(t,i){var s=this.oldest_;while(s){t.call(i,s.value_,s.key_,this);s=s.newer}};Bo.prototype.get=function(t){var i=this.entries_[t];Uh.assert(i!==undefined,15);if(i===this.newest_){return i.value_}else if(i===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{i.newer.older=i.older;i.older.newer=i.newer}i.newer=null;i.older=this.newest_;this.newest_.newer=i;this.newest_=i;return i.value_};Bo.prototype.remove=function(t){var i=this.entries_[t];Uh.assert(i!==undefined,15);if(i===this.newest_){this.newest_=i.older;if(this.newest_){this.newest_.newer=null}}else if(i===this.oldest_){this.oldest_=i.newer;if(this.oldest_){this.oldest_.older=null}}else{i.newer.older=i.older;i.older.newer=i.newer}delete this.entries_[t];--this.count_;return i.value_};Bo.prototype.getCount=function(){return this.count_};Bo.prototype.getKeys=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.key_}return t};Bo.prototype.getValues=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.value_}return t};Bo.prototype.peekLast=function(){return this.oldest_.value_};Bo.prototype.peekLastKey=function(){return this.oldest_.key_};Bo.prototype.peekFirstKey=function(){return this.newest_.key_};Bo.prototype.pop=function(){var t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_};Bo.prototype.replace=function(t,i){this.get(t);this.entries_[t].value_=i};Bo.prototype.set=function(t,i){Uh.assert(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};if(!this.newest_){this.oldest_=s}else{this.newest_.newer=s}this.newest_=s;this.entries_[t]=s;++this.count_};Bo.prototype.prune=function(){while(this.canExpireCache()){this.pop()}};var Ho={};Ho.defaultFont="10px sans-serif";Ho.defaultFillStyle=[0,0,0,1];Ho.defaultLineCap="round";Ho.defaultLineDash=[];Ho.defaultLineDashOffset=0;Ho.defaultLineJoin="round";Ho.defaultMiterLimit=10;Ho.defaultStrokeStyle=[0,0,0,1];Ho.defaultTextAlign="center";Ho.defaultTextBaseline="middle";Ho.defaultPadding=[0,0,0,0];Ho.defaultLineWidth=1;Ho.labelCache=new Bo;Ho.checkedFonts_={};Ho.measureContext_=null;Ho.textHeights_={};Ho.checkFont=function(){var t=60;var i=Ho.checkedFonts_;var s=Ho.labelCache;var e="32px monospace";var r="wmytzilWMYTZIL@#/&?$%10";var n,h;function a(t){var i=Ho.getMeasureContext();i.font=e;h=i.measureText(r).width;var s=true;if(t!="monospace"){i.font="32px "+t+",monospace";var n=i.measureText(r).width;s=n!=h}return s}function o(){var e=true;for(var r in i){if(i[r]<t){if(a(r)){i[r]=t;Rh.clear(Ho.textHeights_);Ho.measureContext_=null;s.clear()}else{++i[r];e=false}}}if(e){window.clearInterval(n);n=undefined}}return function(s){var e=po.getFontFamilies(s);if(!e){return}for(var r=0,h=e.length;r<h;++r){var f=e[r];if(!(f in i)){i[f]=t;if(!a(f)){i[f]=0;if(n===undefined){n=window.setInterval(o,32)}}}}}}();Ho.getMeasureContext=function(){var t=Ho.measureContext_;if(!t){t=Ho.measureContext_=ro.createCanvasContext2D(1,1)}return t};Ho.measureTextHeight=function(){var t;var i=Ho.textHeights_;return function(s){var e=i[s];if(e==undefined){if(!t){t=document.createElement("span");t.textContent="M";t.style.margin=t.style.padding="0 !important";t.style.position="absolute !important";t.style.left="-99999px !important"}t.style.font=s;document.body.appendChild(t);e=i[s]=t.offsetHeight;document.body.removeChild(t)}return e}}();Ho.measureTextWidth=function(t,i){var s=Ho.getMeasureContext();if(t!=s.font){s.font=t}return s.measureText(i).width};Ho.rotateAtOffset=function(t,i,s,e){if(i!==0){t.translate(s,e);t.rotate(i);t.translate(-s,-e)}};Ho.resetTransform_=oa.create();Ho.drawImage=function(t,i,s,e,r,n,h,a,o,f,u){var l;if(s!=1){l=t.globalAlpha;t.globalAlpha=l*s}if(i){t.setTransform.apply(t,i)}t.drawImage(e,r,n,h,a,o,f,h*u,a*u);if(l){t.globalAlpha=l}if(i){t.setTransform.apply(t,Ho.resetTransform_)}};var Jo={};Jo.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i;Jo.NAMED_COLOR_RE_=/^([a-z]*)$/i;Jo.asArray=function(t){if(Array.isArray(t)){return t}else{return Jo.fromString(t)}};Jo.asString=function(t){if(typeof t==="string"){return t}else{return Jo.toString(t)}};Jo.fromNamed=function(t){var i=document.createElement("div");i.style.color=t;document.body.appendChild(i);var s=getComputedStyle(i).color;document.body.removeChild(i);return s};Jo.fromString=function(){var t=1024;var i={};var s=0;return function(e){var r;if(i.hasOwnProperty(e)){r=i[e]}else{if(s>=t){var n=0;var h;for(h in i){if((n++&3)===0){delete i[h];--s}}}r=Jo.fromStringInternal_(e);i[e]=r;++s}return r}}();Jo.fromStringInternal_=function(t){var i,s,e,r,n,h;if(Jo.NAMED_COLOR_RE_.exec(t)){t=Jo.fromNamed(t)}if(Jo.HEX_COLOR_RE_.exec(t)){var a=t.length-1;var o;if(a<=4){o=1}else{o=2}var f=a===4||a===8;i=parseInt(t.substr(1+0*o,o),16);s=parseInt(t.substr(1+1*o,o),16);e=parseInt(t.substr(1+2*o,o),16);if(f){r=parseInt(t.substr(1+3*o,o),16)}else{r=255}if(o==1){i=(i<<4)+i;s=(s<<4)+s;e=(e<<4)+e;if(f){r=(r<<4)+r}}n=[i,s,e,r/255]}else if(t.indexOf("rgba(")==0){h=t.slice(5,-1).split(",").map(Number);n=Jo.normalize(h)}else if(t.indexOf("rgb(")==0){h=t.slice(4,-1).split(",").map(Number);h.push(1);n=Jo.normalize(h)}else{Uh.assert(false,14)}return n};Jo.normalize=function(t,i){var s=i||[];s[0]=qh.clamp(t[0]+.5|0,0,255);s[1]=qh.clamp(t[1]+.5|0,0,255);s[2]=qh.clamp(t[2]+.5|0,0,255);s[3]=qh.clamp(t[3],0,1);return s};Jo.toString=function(t){var i=t[0];if(i!=(i|0)){i=i+.5|0}var s=t[1];if(s!=(s|0)){s=s+.5|0}var e=t[2];if(e!=(e|0)){e=e+.5|0}var r=t[3]===undefined?1:t[3];return"rgba("+i+","+s+","+e+","+r+")"};var Zo={};Zo.asColorLike=function(t){if(Zo.isColorLike(t)){return t}else{return Jo.asString(t)}};Zo.isColorLike=function(t){return typeof t==="string"||t instanceof CanvasPattern||t instanceof CanvasGradient};var $o=function(){};$o.prototype.drawCustom=function(t,i,s){};$o.prototype.drawGeometry=function(t){};$o.prototype.setStyle=function(t){};$o.prototype.drawCircle=function(t,i){};$o.prototype.drawFeature=function(t,i){};$o.prototype.drawGeometryCollection=function(t,i){};$o.prototype.drawLineString=function(t,i){};$o.prototype.drawMultiLineString=function(t,i){};$o.prototype.drawMultiPoint=function(t,i){};$o.prototype.drawMultiPolygon=function(t,i){};$o.prototype.drawPoint=function(t,i){};$o.prototype.drawPolygon=function(t,i){};$o.prototype.drawText=function(t,i){};$o.prototype.setFillStrokeStyle=function(t,i){};$o.prototype.setImageStyle=function(t,i){};$o.prototype.setTextStyle=function(t,i){};var Ko=function(t,i,s,e,r){$o.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=s;this.transform_=e;this.viewRotation_=r;this.contextFillState_=null;this.contextStrokeState_=null;this.contextTextState_=null;this.fillState_=null;this.strokeState_=null;this.image_=null;this.imageAnchorX_=0;this.imageAnchorY_=0;this.imageHeight_=0;this.imageOpacity_=0;this.imageOriginX_=0;this.imageOriginY_=0;this.imageRotateWithView_=false;this.imageRotation_=0;this.imageScale_=0;this.imageSnapToPixel_=false;this.imageWidth_=0;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=false;this.textRotation_=0;this.textScale_=0;this.textFillState_=null;this.textStrokeState_=null;this.textState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=oa.create()};Oh.inherits(Ko,$o);Ko.prototype.drawImages_=function(t,i,s,e){if(!this.image_){return}var r=Qh.transform2D(t,i,s,2,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.tmpLocalTransform_;var a=n.globalAlpha;if(this.imageOpacity_!=1){n.globalAlpha=a*this.imageOpacity_}var o=this.imageRotation_;if(this.imageRotateWithView_){o+=this.viewRotation_}var f,u;for(f=0,u=r.length;f<u;f+=2){var l=r[f]-this.imageAnchorX_;var v=r[f+1]-this.imageAnchorY_;if(this.imageSnapToPixel_){l=Math.round(l);v=Math.round(v)}if(o!==0||this.imageScale_!=1){var c=l+this.imageAnchorX_;var d=v+this.imageAnchorY_;oa.compose(h,c,d,this.imageScale_,this.imageScale_,o,-c,-d);n.setTransform.apply(n,h)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,l,v,this.imageWidth_,this.imageHeight_)}if(o!==0||this.imageScale_!=1){n.setTransform(1,0,0,1,0,0)}if(this.imageOpacity_!=1){n.globalAlpha=a}};Ko.prototype.drawText_=function(t,i,s,e){if(!this.textState_||this.text_===""){return}if(this.textFillState_){this.setContextFillState_(this.textFillState_)}if(this.textStrokeState_){this.setContextStrokeState_(this.textStrokeState_)}this.setContextTextState_(this.textState_);var r=Qh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.textRotation_;if(this.textRotateWithView_){h+=this.viewRotation_}for(;i<s;i+=e){var a=r[i]+this.textOffsetX_;var o=r[i+1]+this.textOffsetY_;if(h!==0||this.textScale_!=1){var f=oa.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,h,-a,-o);n.setTransform.apply(n,f)}if(this.textStrokeState_){n.strokeText(this.text_,a,o)}if(this.textFillState_){n.fillText(this.text_,a,o)}}if(h!==0||this.textScale_!=1){n.setTransform(1,0,0,1,0,0)}};Ko.prototype.moveToLineTo_=function(t,i,s,e,r){var n=this.context_;var h=Qh.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);n.moveTo(h[0],h[1]);var a=h.length;if(r){a-=2}for(var o=2;o<a;o+=2){n.lineTo(h[o],h[o+1])}if(r){n.closePath()}return s};Ko.prototype.drawRings_=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){i=this.moveToLineTo_(t,i,s[r],e,true)}return i};Ko.prototype.drawCircle=function(t){if(!Zh.intersects(this.extent_,t.getExtent())){return}if(this.fillState_||this.strokeState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=ua.transform2D(t,this.transform_,this.pixelCoordinates_);var s=i[2]-i[0];var e=i[3]-i[1];var r=Math.sqrt(s*s+e*e);var n=this.context_;n.beginPath();n.arc(i[0],i[1],r,0,2*Math.PI);if(this.fillState_){n.fill()}if(this.strokeState_){n.stroke()}}if(this.text_!==""){this.drawText_(t.getCenter(),0,2,2)}};Ko.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Ko.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Xh.POINT:this.drawPoint(t);break;case Xh.LINE_STRING:this.drawLineString(t);break;case Xh.POLYGON:this.drawPolygon(t);break;case Xh.MULTI_POINT:this.drawMultiPoint(t);break;case Xh.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Xh.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Xh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Xh.CIRCLE:this.drawCircle(t);break}};Ko.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Zh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Ko.prototype.drawGeometryCollection=function(t){var i=t.getGeometriesArray();var s,e;for(s=0,e=i.length;s<e;++s){this.drawGeometry(i[s])}};Ko.prototype.drawPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ko.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ko.prototype.drawLineString=function(t){if(!Zh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_;var s=t.getFlatCoordinates();i.beginPath();this.moveToLineTo_(s,0,s.length,t.getStride(),false);i.stroke()}if(this.text_!==""){var e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}};Ko.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(!Zh.intersects(this.extent_,i)){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s=this.context_;var e=t.getFlatCoordinates();var r=0;var n=t.getEnds();var h=t.getStride();s.beginPath();var a,o;for(a=0,o=n.length;a<o;++a){r=this.moveToLineTo_(e,r,n[a],h,false)}s.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}};Ko.prototype.drawPolygon=function(t){if(!Zh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;i.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}};Ko.prototype.drawMultiPolygon=function(t){if(!Zh.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;var s=t.getOrientedFlatCoordinates();var e=0;var r=t.getEndss();var n=t.getStride();var h,a;i.beginPath();for(h=0,a=r.length;h<a;++h){var o=r[h];e=this.drawRings_(s,e,o,n)}if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}};Ko.prototype.setContextFillState_=function(t){var i=this.context_;var s=this.contextFillState_;if(!s){i.fillStyle=t.fillStyle;this.contextFillState_={fillStyle:t.fillStyle}}else{if(s.fillStyle!=t.fillStyle){s.fillStyle=i.fillStyle=t.fillStyle}}};Ko.prototype.setContextStrokeState_=function(t){var i=this.context_;var s=this.contextStrokeState_;if(!s){i.lineCap=t.lineCap;if(Ea.CANVAS_LINE_DASH){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineJoin=t.lineJoin;i.lineWidth=t.lineWidth;i.miterLimit=t.miterLimit;i.strokeStyle=t.strokeStyle;this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle}}else{if(s.lineCap!=t.lineCap){s.lineCap=i.lineCap=t.lineCap}if(Ea.CANVAS_LINE_DASH){if(!Bh.equals(s.lineDash,t.lineDash)){i.setLineDash(s.lineDash=t.lineDash)}if(s.lineDashOffset!=t.lineDashOffset){s.lineDashOffset=i.lineDashOffset=t.lineDashOffset}}if(s.lineJoin!=t.lineJoin){s.lineJoin=i.lineJoin=t.lineJoin}if(s.lineWidth!=t.lineWidth){s.lineWidth=i.lineWidth=t.lineWidth}if(s.miterLimit!=t.miterLimit){s.miterLimit=i.miterLimit=t.miterLimit}if(s.strokeStyle!=t.strokeStyle){s.strokeStyle=i.strokeStyle=t.strokeStyle}}};Ko.prototype.setContextTextState_=function(t){var i=this.context_;var s=this.contextTextState_;var e=t.textAlign?t.textAlign:Ho.defaultTextAlign;if(!s){i.font=t.font;i.textAlign=e;i.textBaseline=t.textBaseline;this.contextTextState_={font:t.font,textAlign:e,textBaseline:t.textBaseline}}else{if(s.font!=t.font){s.font=i.font=t.font}if(s.textAlign!=e){s.textAlign=e}if(s.textBaseline!=t.textBaseline){s.textBaseline=i.textBaseline=t.textBaseline}}};Ko.prototype.setFillStrokeStyle=function(t,i){if(!t){this.fillState_=null}else{var s=t.getColor();this.fillState_={fillStyle:Zo.asColorLike(s?s:Ho.defaultFillStyle)}}if(!i){this.strokeState_=null}else{var e=i.getColor();var r=i.getLineCap();var n=i.getLineDash();var h=i.getLineDashOffset();var a=i.getLineJoin();var o=i.getWidth();var f=i.getMiterLimit();this.strokeState_={lineCap:r!==undefined?r:Ho.defaultLineCap,lineDash:n?n:Ho.defaultLineDash,lineDashOffset:h?h:Ho.defaultLineDashOffset,lineJoin:a!==undefined?a:Ho.defaultLineJoin,lineWidth:this.pixelRatio_*(o!==undefined?o:Ho.defaultLineWidth),miterLimit:f!==undefined?f:Ho.defaultMiterLimit,strokeStyle:Zo.asColorLike(e?e:Ho.defaultStrokeStyle)}}};Ko.prototype.setImageStyle=function(t){if(!t){this.image_=null}else{var i=t.getAnchor();var s=t.getImage(1);var e=t.getOrigin();var r=t.getSize();this.imageAnchorX_=i[0];this.imageAnchorY_=i[1];this.imageHeight_=r[1];this.image_=s;this.imageOpacity_=t.getOpacity();this.imageOriginX_=e[0];this.imageOriginY_=e[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageSnapToPixel_=t.getSnapToPixel();this.imageWidth_=r[0]}};Ko.prototype.setTextStyle=function(t){if(!t){this.text_=""}else{var i=t.getFill();if(!i){this.textFillState_=null}else{var s=i.getColor();this.textFillState_={fillStyle:Zo.asColorLike(s?s:Ho.defaultFillStyle)}}var e=t.getStroke();if(!e){this.textStrokeState_=null}else{var r=e.getColor();var n=e.getLineCap();var h=e.getLineDash();var a=e.getLineDashOffset();var o=e.getLineJoin();var f=e.getWidth();var u=e.getMiterLimit();this.textStrokeState_={lineCap:n!==undefined?n:Ho.defaultLineCap,lineDash:h?h:Ho.defaultLineDash,lineDashOffset:a?a:Ho.defaultLineDashOffset,lineJoin:o!==undefined?o:Ho.defaultLineJoin,lineWidth:f!==undefined?f:Ho.defaultLineWidth,miterLimit:u!==undefined?u:Ho.defaultMiterLimit,strokeStyle:Zo.asColorLike(r?r:Ho.defaultStrokeStyle)}}var l=t.getFont();var v=t.getOffsetX();var c=t.getOffsetY();var d=t.getRotateWithView();var m=t.getRotation();var p=t.getScale();var z=t.getText();var M=t.getTextAlign();var _=t.getTextBaseline();this.textState_={font:l!==undefined?l:Ho.defaultFont,textAlign:M!==undefined?M:Ho.defaultTextAlign,textBaseline:_!==undefined?_:Ho.defaultTextBaseline};this.text_=z!==undefined?z:"";this.textOffsetX_=v!==undefined?this.pixelRatio_*v:0;this.textOffsetY_=c!==undefined?this.pixelRatio_*c:0;this.textRotateWithView_=d!==undefined?d:false;this.textRotation_=m!==undefined?m:0;this.textScale_=this.pixelRatio_*(p!==undefined?p:1)}};var Qo=function(t){Gh.call(this);this.layer_=t};Oh.inherits(Qo,Gh);Qo.prototype.forEachFeatureAtCoordinate=Oh.nullFunction;Qo.prototype.hasFeatureAtCoordinate=Kh.FALSE;Qo.prototype.createLoadedTileFinder=function(t,i,s){return function(e,r){function n(t){if(!s[e]){s[e]={}}s[e][t.tileCoord.toString()]=t}return t.forEachLoadedTile(i,e,r,n)}};Qo.prototype.getLayer=function(){return this.layer_};Qo.prototype.handleImageChange_=function(t){var i=t.target;if(i.getState()===Vo.LOADED){this.renderIfReadyAndVisible()}};Qo.prototype.loadImage=function(t){var i=t.getState();if(i!=Vo.LOADED&&i!=Vo.ERROR){Ph.listen(t,Wh.CHANGE,this.handleImageChange_,this)}if(i==Vo.IDLE){t.load();i=t.getState()}return i==Vo.LOADED};Qo.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();if(t.getVisible()&&t.getSourceState()==ao.READY){this.changed()}};Qo.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var e=Oh.getUid(t).toString();if(e in s.usedTiles){t.expireCache(s.viewState.projection,s.usedTiles[e])}}.bind(null,i);t.postRenderFunctions.push(s)}};Qo.prototype.updateLogos=function(t,i){var s=i.getLogo();if(s!==undefined){if(typeof s==="string"){t.logos[s]=""}else if(s){Uh.assert(typeof s.href=="string",44);Uh.assert(typeof s.src=="string",45);t.logos[s.src]=s.href}}};Qo.prototype.updateUsedTiles=function(t,i,s,e){var r=Oh.getUid(i).toString();var n=s.toString();if(r in t){if(n in t[r]){t[r][n].extend(e)}else{t[r][n]=e}}else{t[r]={};t[r][n]=e}};Qo.prototype.manageTilePyramid=function(t,i,s,e,r,n,h,a,o,f){var u=Oh.getUid(i).toString();if(!(u in t.wantedTiles)){t.wantedTiles[u]={}}var l=t.wantedTiles[u];var v=t.tileQueue;var c=s.getMinZoom();var d,m,p,z,M,_;for(_=c;_<=h;++_){m=s.getTileRangeForExtentAndZ(n,_,m);p=s.getResolution(_);for(z=m.minX;z<=m.maxX;++z){for(M=m.minY;M<=m.maxY;++M){if(h-_<=a){d=i.getTile(_,z,M,e,r);if(d.getState()==Ya.IDLE){l[d.getKey()]=true;if(!v.isKeyQueued(d.getKey())){v.enqueue([d,u,s.getTileCoordCenter(d.tileCoord),p])}}if(o!==undefined){o.call(f,d)}}else{i.useTile(_,z,M,r)}}}}};var tf=function(t){Qo.call(this,t);this.transform_=oa.create()};Oh.inherits(tf,Qo);tf.prototype.clip=function(t,i,s){var e=i.pixelRatio;var r=i.size[0]*e;var n=i.size[1]*e;var h=i.viewState.rotation;var a=Zh.getTopLeft(s);var o=Zh.getTopRight(s);var f=Zh.getBottomRight(s);var u=Zh.getBottomLeft(s);oa.apply(i.coordinateToPixelTransform,a);oa.apply(i.coordinateToPixelTransform,o);oa.apply(i.coordinateToPixelTransform,f);oa.apply(i.coordinateToPixelTransform,u);t.save();Ho.rotateAtOffset(t,-h,r/2,n/2);t.beginPath();t.moveTo(a[0]*e,a[1]*e);t.lineTo(o[0]*e,o[1]*e);t.lineTo(f[0]*e,f[1]*e);t.lineTo(u[0]*e,u[1]*e);t.clip();Ho.rotateAtOffset(t,h,r/2,n/2)};tf.prototype.dispatchComposeEvent_=function(t,i,s,e){var r=this.getLayer();if(r.hasListener(t)){var n=s.size[0]*s.pixelRatio;var h=s.size[1]*s.pixelRatio;var a=s.viewState.rotation;Ho.rotateAtOffset(i,-a,n/2,h/2);var o=e!==undefined?e:this.getTransform(s,0);var f=new Ko(i,s.pixelRatio,s.extent,o,s.viewState.rotation);var u=new Yo(t,f,s,i,null);r.dispatchEvent(u);Ho.rotateAtOffset(i,a,n/2,h/2)}};tf.prototype.forEachLayerAtCoordinate=function(t,i,s,e){var r=this.forEachFeatureAtCoordinate(t,i,0,Kh.TRUE,this);if(r){return s.call(e,this.getLayer(),null)}else{return undefined}};tf.prototype.postCompose=function(t,i,s,e){this.dispatchComposeEvent_(zo.POSTCOMPOSE,t,i,e)};tf.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(zo.PRECOMPOSE,t,i,s)};tf.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(zo.RENDER,t,i,s)};tf.prototype.getTransform=function(t,i){var s=t.viewState;var e=t.pixelRatio;var r=e*t.size[0]/2;var n=e*t.size[1]/2;var h=e/s.resolution;var a=-h;var o=-s.rotation;var f=-s.center[0]+i;var u=-s.center[1];return oa.compose(this.transform_,r,n,h,a,o,f,u)};tf.prototype.composeFrame=function(t,i,s){};tf.prototype.prepareFrame=function(t,i){};var sf=function(t){tf.call(this,t);this.coordinateToCanvasPixelTransform=oa.create();this.hitCanvasContext_=null};Oh.inherits(sf,tf);sf.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var e=this.getImage();if(e){var r=i.extent;var n=r!==undefined&&!Zh.containsExtent(r,t.extent)&&Zh.intersects(r,t.extent);if(n){this.clip(s,t,r)}var h=this.getImageTransform();var a=s.globalAlpha;s.globalAlpha=i.opacity;var o=h[4];var f=h[5];var u=e.width*h[0];var l=e.height*h[3];s.drawImage(e,0,0,+e.width,+e.height,Math.round(o),Math.round(f),Math.round(u),Math.round(l));s.globalAlpha=a;if(n){s.restore()}}this.postCompose(s,t,i)};sf.prototype.getImage=function(){};sf.prototype.getImageTransform=function(){};sf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};sf.prototype.forEachLayerAtCoordinate=function(t,i,s,e){if(!this.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Oh.nullFunction){return tf.prototype.forEachLayerAtCoordinate.apply(this,arguments)}else{var r=oa.apply(this.coordinateToCanvasPixelTransform,t.slice());io.scale(r,i.viewState.resolution/this.renderedResolution);if(!this.hitCanvasContext_){this.hitCanvasContext_=ro.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var n=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(n[3]>0){return s.call(e,this.getLayer(),n)}else{return undefined}}};var ef=function(t){sf.call(this,t);this.image_=null;this.imageTransform_=oa.create();this.skippedFeatures_=[];this.vectorRenderer_=null};Oh.inherits(ef,sf);ef["handles"]=function(t,i){return t===lo.CANVAS&&(i.getType()===qo.IMAGE||i.getType()===qo.VECTOR&&i.getRenderMode()===Xo.IMAGE)};ef["create"]=function(t,i){var s=new ef(i);if(i.getType()===qo.VECTOR){var e=uo.getLayerRendererPlugins();for(var r=0,n=e.length;r<n;++r){var h=e[r];if(h!==ef&&h["handles"](lo.CANVAS,i)){s.setVectorRenderer(h["create"](t,i))}}}return s};ef.prototype.getImage=function(){return!this.image_?null:this.image_.getImage()};ef.prototype.getImageTransform=function(){return this.imageTransform_};ef.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.center;var h=r.resolution;var a;var o=this.getLayer();var f=o.getSource();var u=t.viewHints;var l=t.extent;if(i.extent!==undefined){l=Zh.getIntersection(l,i.extent)}if(!u[Ka.ANIMATING]&&!u[Ka.INTERACTING]&&!Zh.isEmpty(l)){var v=r.projection;if(!Oh.ENABLE_RASTER_REPROJECTION){var c=f.getProjection();if(c){v=c}}var d=this.vectorRenderer_;if(d){var m=d.context;var p=Rh.assign({},t,{size:[Zh.getWidth(l)/h,Zh.getHeight(l)/h],viewState:Rh.assign({},t.viewState,{rotation:0})});var z=Object.keys(p.skippedFeatureUids).sort();if(d.prepareFrame(p,i)&&(d.replayGroupChanged||!Bh.equals(z,this.skippedFeatures_))){m.canvas.width=p.size[0]*s;m.canvas.height=p.size[1]*s;d.composeFrame(p,i,m);this.image_=new Uo(l,h,s,m.canvas);this.skippedFeatures_=z}}else{a=f.getImage(l,h,s,v);if(a){var M=this.loadImage(a);if(M){this.image_=a}}}}if(this.image_){a=this.image_;var _=a.getExtent();var g=a.getResolution();var b=a.getPixelRatio();var x=s*g/(h*b);var w=oa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,x,x,0,b*(_[0]-n[0])/g,b*(n[1]-_[3])/g);oa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-w[4],s*e[1]/2-w[5],s/h,-s/h,0,-n[0],-n[1]);this.updateLogos(t,f);this.renderedResolution=g*s/b}return!!this.image_};ef.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(this.vectorRenderer_){return this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,e,r)}else{return sf.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,e,r)}};ef.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var rf=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};rf.getKey=function(t,i,s){var e=s?Jo.asString(s):"null";return i+":"+t+":"+e};rf.prototype.clear=function(){this.cache_={};this.cacheSize_=0};rf.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;var i,s;for(i in this.cache_){s=this.cache_[i];if((t++&3)===0&&!s.hasListener()){delete this.cache_[i];--this.cacheSize_}}}};rf.prototype.get=function(t,i,s){var e=rf.getKey(t,i,s);return e in this.cache_?this.cache_[e]:null};rf.prototype.set=function(t,i,s,e){var r=rf.getKey(t,i,s);this.cache_[r]=e;++this.cacheSize_};rf.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()};var nf={};nf.iconImageCache=new rf;var hf=function(t,i){Lh.call(this);this.map_=i;this.layerRenderers_={};this.layerRendererListeners_={}};Oh.inherits(hf,Lh);hf.prototype.calculateMatrices2D=function(t){var i=t.viewState;var s=t.coordinateToPixelTransform;var e=t.pixelToCoordinateTransform;oa.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]);oa.invert(oa.setFromArray(e,s))};hf.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_){this.removeLayerRendererByKey_(t).dispose()}};hf.expireIconCache_=function(t,i){var s=nf.iconImageCache;s.expire()};hf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;var o=i.viewState;var f=o.resolution;function u(t,s){var n=Oh.getUid(t).toString();var h=i.layerStates[Oh.getUid(s)].managed;if(!(n in i.skippedFeatureUids&&!h)){return e.call(r,t,h?s:null)}}var l=o.projection;var v=t;if(l.canWrapX()){var c=l.getExtent();var d=Zh.getWidth(c);var m=t[0];if(m<c[0]||m>c[2]){var p=Math.ceil((c[0]-m)/d);v=[m+d*p,t[1]]}}var z=i.layerStatesArray;var M=z.length;var _;for(_=M-1;_>=0;--_){var g=z[_];var b=g.layer;if(Mo.visibleAtResolution(g,f)&&n.call(h,b)){var x=this.getLayerRenderer(b);if(b.getSource()){a=x.forEachFeatureAtCoordinate(b.getSource().getWrapX()?v:t,i,s,u,r)}if(a){return a}}}return undefined};hf.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){};hf.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=this.forEachFeatureAtCoordinate(t,i,s,Kh.TRUE,this,e,r);return n!==undefined};hf.prototype.getLayerRenderer=function(t){var i=Oh.getUid(t).toString();if(i in this.layerRenderers_){return this.layerRenderers_[i]}else{var s=uo.getLayerRendererPlugins();var e;var r=this.getType();for(var n=0,h=s.length;n<h;++n){var a=s[n];if(a["handles"](r,t)){e=a["create"](this,t);break}}if(e){this.layerRenderers_[i]=e;this.layerRendererListeners_[i]=Ph.listen(e,Wh.CHANGE,this.handleLayerRendererChange_,this)}else{throw new Error("Unable to create renderer for layer: "+t.getType())}return e}};hf.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]};hf.prototype.getLayerRenderers=function(){return this.layerRenderers_};hf.prototype.getMap=function(){return this.map_};hf.prototype.getType=function(){};hf.prototype.handleLayerRendererChange_=function(){this.map_.render()};hf.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];delete this.layerRenderers_[t];Ph.unlistenByKey(this.layerRendererListeners_[t]);delete this.layerRendererListeners_[t];return i};hf.prototype.renderFrame=Oh.nullFunction;hf.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_){if(!i||!(s in i.layerStates)){this.removeLayerRendererByKey_(s).dispose()}}};hf.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(hf.expireIconCache_)};hf.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_){if(!(i in t.layerStates)){t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this));return}}};hf.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var af=function(t,i){hf.call(this,t,i);this.context_=ro.createCanvasContext2D();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=po.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.renderedVisible_=true;this.transform_=oa.create()};Oh.inherits(af,hf);af["handles"]=function(t){return t===lo.CANVAS};af["create"]=function(t,i){return new af(t,i)};af.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();var e=this.context_;if(s.hasListener(t)){var r=i.extent;var n=i.pixelRatio;var h=i.viewState;var a=h.rotation;var o=this.getTransform(i);var f=new Ko(e,n,r,o,a);var u=new Yo(t,f,i,e,null);s.dispatchEvent(u)}};af.prototype.getTransform=function(t){var i=t.viewState;var s=this.canvas_.width/2;var e=this.canvas_.height/2;var r=t.pixelRatio/i.resolution;var n=-r;var h=-i.rotation;var a=-i.center[0];var o=-i.center[1];return oa.compose(this.transform_,s,e,r,n,h,a,o)};af.prototype.getType=function(){return lo.CANVAS};af.prototype.renderFrame=function(t){if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return}var i=this.context_;var s=t.pixelRatio;var e=Math.round(t.size[0]*s);var r=Math.round(t.size[1]*s);if(this.canvas_.width!=e||this.canvas_.height!=r){this.canvas_.width=e;this.canvas_.height=r}else{i.clearRect(0,0,e,r)}var n=t.viewState.rotation;this.calculateMatrices2D(t);this.dispatchComposeEvent_(zo.PRECOMPOSE,t);var h=t.layerStatesArray;Bh.stableSort(h,hf.sortByZIndex);if(n){i.save();Ho.rotateAtOffset(i,n,e/2,r/2)}var a=t.viewState.resolution;var o,f,u,l,v;for(o=0,f=h.length;o<f;++o){v=h[o];u=v.layer;l=this.getLayerRenderer(u);if(!Mo.visibleAtResolution(v,a)||v.sourceState!=ao.READY){continue}if(l.prepareFrame(t,v)){l.composeFrame(t,v,i)}}if(n){i.restore()}this.dispatchComposeEvent_(zo.POSTCOMPOSE,t);if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};af.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){var h;var a=i.viewState;var o=a.resolution;var f=i.layerStatesArray;var u=f.length;var l=oa.apply(i.pixelToCoordinateTransform,t.slice());var v;for(v=u-1;v>=0;--v){var c=f[v];var d=c.layer;if(Mo.visibleAtResolution(c,o)&&r.call(n,d)){var m=this.getLayerRenderer(d);h=m.forEachLayerAtCoordinate(l,i,s,e);if(h){return h}}}return undefined};var of=function(t,i,s,e){this.minX=t;this.maxX=i;this.minY=s;this.maxY=e};of.createOrUpdate=function(t,i,s,e,r){if(r!==undefined){r.minX=t;r.maxX=i;r.minY=s;r.maxY=e;return r}else{return new of(t,i,s,e)}};of.prototype.contains=function(t){return this.containsXY(t[1],t[2])};of.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY};of.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY};of.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY};of.prototype.extend=function(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}};of.prototype.getHeight=function(){return this.maxY-this.minY+1};of.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};of.prototype.getWidth=function(){return this.maxX-this.minX+1};of.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var ff=function(t){sf.call(this,t);this.context=this.context===null?null:ro.createCanvasContext2D();this.renderedExtent_=null;this.renderedTiles=[];this.tmpExtent=Zh.createEmpty();this.tmpTileRange_=new of(0,0,0,0);this.imageTransform_=oa.create();this.zDirection=0};Oh.inherits(ff,sf);ff["handles"]=function(t,i){return t===lo.CANVAS&&i.getType()===qo.TILE};ff["create"]=function(t,i){return new ff(i)};ff.prototype.isDrawableTile_=function(t){var i=t.getState();var s=this.getLayer().getUseInterimTilesOnError();return i==Ya.LOADED||i==Ya.EMPTY||i==Ya.ERROR&&!s};ff.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.projection;var h=r.resolution;var a=r.center;var o=this.getLayer();var f=o.getSource();var u=f.getRevision();var l=f.getTileGridForProjection(n);var v=l.getZForResolution(h,this.zDirection);var c=l.getResolution(v);var d=Math.round(h/c)||1;var m=t.extent;if(i.extent!==undefined){m=Zh.getIntersection(m,i.extent)}if(Zh.isEmpty(m)){return false}var p=l.getTileRangeForExtentAndZ(m,v);var z=l.getTileRangeExtent(v,p);var M=f.getTilePixelRatio(s);var _={};_[v]={};var g=this.createLoadedTileFinder(f,n,_);var b=this.tmpExtent;var x=this.tmpTileRange_;var w=false;var y,k,E;for(k=p.minX;k<=p.maxX;++k){for(E=p.minY;E<=p.maxY;++E){y=f.getTile(v,k,E,s,n);if(y.getState()==Ya.ERROR){if(!o.getUseInterimTilesOnError()){y.setState(Ya.LOADED)}else if(o.getPreload()>0){w=true}}if(!this.isDrawableTile_(y)){y=y.getInterimTile()}if(this.isDrawableTile_(y)){var N=Oh.getUid(this);if(y.getState()==Ya.LOADED){_[v][y.tileCoord.toString()]=y;var C=y.inTransition(N);if(!w&&(C||this.renderedTiles.indexOf(y)===-1)){w=true}}if(y.getAlpha(N,t.time)===1){continue}}var I=l.getTileCoordChildTileRange(y.tileCoord,x,b);var S=false;if(I){S=g(v+1,I)}if(!S){l.forEachTileCoordParentTileRange(y.tileCoord,g,null,x,b)}}}var O=c*s/M*d;var T=t.viewHints;var A=T[Ka.ANIMATING]||T[Ka.INTERACTING];if(!(this.renderedResolution&&Date.now()-t.time>16&&A)&&(w||!(this.renderedExtent_&&Zh.containsExtent(this.renderedExtent_,m))||this.renderedRevision!=u||d!=this.oversampling_||!A&&O!=this.renderedResolution)){var R=this.context;if(R){var P=f.getTilePixelSize(v,s,n);var L=Math.round(p.getWidth()*P[0]/d);var D=Math.round(p.getHeight()*P[1]/d);var F=R.canvas;if(F.width!=L||F.height!=D){this.oversampling_=d;F.width=L;F.height=D}else{if(this.renderedExtent_&&!Zh.equals(z,this.renderedExtent_)){R.clearRect(0,0,L,D)}d=this.oversampling_}}this.renderedTiles.length=0;var W=Object.keys(_).map(Number);W.sort((function(t,i){if(t===v){return 1}else if(i===v){return-1}else{return t>i?1:t<i?-1:0}}));var G,j,V,U,q,X;var Y,B,H,J,Z;for(q=0,X=W.length;q<X;++q){U=W[q];V=f.getTilePixelSize(U,s,n);G=l.getResolution(U);j=G/c;B=M*f.getGutter(n);H=_[U];for(var $ in H){y=H[$];Y=l.getTileCoordExtent(y.getTileCoord(),b);k=(Y[0]-z[0])/c*M/d;E=(z[3]-Y[3])/c*M/d;J=V[0]*j/d;Z=V[1]*j/d;this.drawTileImage(y,t,i,k,E,J,Z,B,v===U);this.renderedTiles.push(y)}}this.renderedRevision=u;this.renderedResolution=c*s/M*d;this.renderedExtent_=z}var K=this.renderedResolution/h;var Q=oa.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,K,K,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);oa.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-Q[4],s*e[1]/2-Q[5],s/h,-s/h,0,-a[0],-a[1]);this.updateUsedTiles(t.usedTiles,f,v,p);this.manageTilePyramid(t,f,l,s,n,m,v,o.getPreload());this.scheduleExpireCache(t,f);this.updateLogos(t,f);return this.renderedTiles.length>0};ff.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t.getImage(this.getLayer());if(!f){return}var u=Oh.getUid(this);var l=o?t.getAlpha(u,i.time):1;if(l===1&&!this.getLayer().getSource().getOpaque(i.viewState.projection)){this.context.clearRect(e,r,n,h)}var v=l!==this.context.globalAlpha;if(v){this.context.save();this.context.globalAlpha=l}this.context.drawImage(f,a,a,f.width-2*a,f.height-2*a,e,r,n,h);if(v){this.context.restore()}if(l!==1){i.animate=true}else if(o){t.endTransition(u)}};ff.prototype.getImage=function(){var t=this.context;return t?t.canvas:null};ff.prototype.getImageTransform=function(){return this.imageTransform_};var uf={exports:{}};(function(t,i){(function(i,s){t.exports=s()})(d,(function(){function t(t,s,r,n,h){i(t,s,r||0,n||t.length-1,h||e)}function i(t,e,r,n,h){while(n>r){if(n-r>600){var a=n-r+1;var o=e-r+1;var f=Math.log(a);var u=.5*Math.exp(2*f/3);var l=.5*Math.sqrt(f*u*(a-u)/a)*(o-a/2<0?-1:1);var v=Math.max(r,Math.floor(e-o*u/a+l));var c=Math.min(n,Math.floor(e+(a-o)*u/a+l));i(t,e,v,c,h)}var d=t[e];var m=r;var p=n;s(t,r,e);if(h(t[n],d)>0)s(t,r,n);while(m<p){s(t,m,p);m++;p--;while(h(t[m],d)<0)m++;while(h(t[p],d)>0)p--}if(h(t[r],d)===0)s(t,r,p);else{p++;s(t,p,n)}if(p<=e)r=p+1;if(e<=p)n=p-1}}function s(t,i,s){var e=t[i];t[i]=t[s];t[s]=e}function e(t,i){return t<i?-1:t>i?1:0}return t}))})(uf);var lf=cf;var vf=uf.exports;function cf(t,i){if(!(this instanceof cf))return new cf(t,i);this._maxEntries=Math.max(4,t||9);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));if(i){this._initFormat(i)}this.clear()}cf.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],e=this.toBBox;if(!kf(t,i))return s;var r=[],n,h,a,o;while(i){for(n=0,h=i.children.length;n<h;n++){a=i.children[n];o=i.leaf?e(a):a;if(kf(t,o)){if(i.leaf)s.push(a);else if(yf(t,o))this._all(a,s);else r.push(a)}}i=r.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!kf(t,i))return false;var e=[],r,n,h,a;while(i){for(r=0,n=i.children.length;r<n;r++){h=i.children[r];a=i.leaf?s(h):h;if(kf(t,a)){if(i.leaf||yf(t,a))return true;e.push(h)}}i=e.pop()}return false},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++){this.insert(t[i])}return this}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){var r=this.data;this.data=e;e=r}this._insert(e,this.data.height-e.height-1,true)}return this},insert:function(t){if(t)this._insert(t,this.data.height-1);return this},clear:function(){this.data=Ef([]);return this},remove:function(t,i){if(!t)return this;var s=this.data,e=this.toBBox(t),r=[],n=[],h,a,o,f;while(s||r.length){if(!s){s=r.pop();a=r[r.length-1];h=n.pop();f=true}if(s.leaf){o=df(t,s.children,i);if(o!==-1){s.children.splice(o,1);r.push(s);this._condense(r);return this}}if(!f&&!s.leaf&&yf(s,e)){r.push(s);n.push(h);h=0;a=s;s=s.children[0]}else if(a){h++;s=a.children[h];f=false}else s=null}return this},toBBox:function(t){return t},compareMinX:Mf,compareMinY:_f,toJSON:function(){return this.data},fromJSON:function(t){this.data=t;return this},_all:function(t,i){var s=[];while(t){if(t.leaf)i.push.apply(i,t.children);else s.push.apply(s,t.children);t=s.pop()}return i},_build:function(t,i,s,e){var r=s-i+1,n=this._maxEntries,h;if(r<=n){h=Ef(t.slice(i,s+1));mf(h,this.toBBox);return h}if(!e){e=Math.ceil(Math.log(r)/Math.log(n));n=Math.ceil(r/Math.pow(n,e-1))}h=Ef([]);h.leaf=false;h.height=e;var a=Math.ceil(r/n),o=a*Math.ceil(Math.sqrt(n)),f,u,l,v;Nf(t,i,s,o,this.compareMinX);for(f=i;f<=s;f+=o){l=Math.min(f+o-1,s);Nf(t,f,l,a,this.compareMinY);for(u=f;u<=l;u+=a){v=Math.min(u+a-1,l);h.children.push(this._build(t,u,v,e-1))}}mf(h,this.toBBox);return h},_chooseSubtree:function(t,i,s,e){var r,n,h,a,o,f,u,l;while(true){e.push(i);if(i.leaf||e.length-1===s)break;u=l=Infinity;for(r=0,n=i.children.length;r<n;r++){h=i.children[r];o=gf(h);f=xf(t,h)-o;if(f<l){l=f;u=o<u?o:u;a=h}else if(f===l){if(o<u){u=o;a=h}}}i=a||i.children[0]}return i},_insert:function(t,i,s){var e=this.toBBox,r=s?t:e(t),n=[];var h=this._chooseSubtree(r,this.data,i,n);h.children.push(t);zf(h,r);while(i>=0){if(n[i].children.length>this._maxEntries){this._split(n,i);i--}else break}this._adjustParentBBoxes(r,n,i)},_split:function(t,i){var s=t[i],e=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,e);var n=this._chooseSplitIndex(s,r,e);var h=Ef(s.children.splice(n,s.children.length-n));h.height=s.height;h.leaf=s.leaf;mf(s,this.toBBox);mf(h,this.toBBox);if(i)t[i-1].children.push(h);else this._splitRoot(s,h)},_splitRoot:function(t,i){this.data=Ef([t,i]);this.data.height=t.height+1;this.data.leaf=false;mf(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var e,r,n,h,a,o,f,u;o=f=Infinity;for(e=i;e<=s-i;e++){r=pf(t,0,e,this.toBBox);n=pf(t,e,s,this.toBBox);h=wf(r,n);a=gf(r)+gf(n);if(h<o){o=h;u=e;f=a<f?a:f}else if(h===o){if(a<f){f=a;u=e}}}return u},_chooseSplitAxis:function(t,i,s){var e=t.leaf?this.compareMinX:Mf,r=t.leaf?this.compareMinY:_f,n=this._allDistMargin(t,i,s,e),h=this._allDistMargin(t,i,s,r);if(n<h)t.children.sort(e)},_allDistMargin:function(t,i,s,e){t.children.sort(e);var r=this.toBBox,n=pf(t,0,i,r),h=pf(t,s-i,s,r),a=bf(n)+bf(h),o,f;for(o=i;o<s-i;o++){f=t.children[o];zf(n,t.leaf?r(f):f);a+=bf(n)}for(o=s-i-1;o>=i;o--){f=t.children[o];zf(h,t.leaf?r(f):f);a+=bf(h)}return a},_adjustParentBBoxes:function(t,i,s){for(var e=s;e>=0;e--){zf(i[e],t)}},_condense:function(t){for(var i=t.length-1,s;i>=0;i--){if(t[i].children.length===0){if(i>0){s=t[i-1].children;s.splice(s.indexOf(t[i]),1)}else this.clear()}else mf(t[i],this.toBBox)}},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0]));this.compareMinY=new Function("a","b",i.join(t[1]));this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function df(t,i,s){if(!s)return i.indexOf(t);for(var e=0;e<i.length;e++){if(s(t,i[e]))return e}return-1}function mf(t,i){pf(t,0,t.children.length,i,t)}function pf(t,i,s,e,r){if(!r)r=Ef(null);r.minX=Infinity;r.minY=Infinity;r.maxX=-Infinity;r.maxY=-Infinity;for(var n=i,h;n<s;n++){h=t.children[n];zf(r,t.leaf?e(h):h)}return r}function zf(t,i){t.minX=Math.min(t.minX,i.minX);t.minY=Math.min(t.minY,i.minY);t.maxX=Math.max(t.maxX,i.maxX);t.maxY=Math.max(t.maxY,i.maxY);return t}function Mf(t,i){return t.minX-i.minX}function _f(t,i){return t.minY-i.minY}function gf(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bf(t){return t.maxX-t.minX+(t.maxY-t.minY)}function xf(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function wf(t,i){var s=Math.max(t.minX,i.minX),e=Math.max(t.minY,i.minY),r=Math.min(t.maxX,i.maxX),n=Math.min(t.maxY,i.maxY);return Math.max(0,r-s)*Math.max(0,n-e)}function yf(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function kf(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function Ef(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function Nf(t,i,s,e,r){var n=[i,s],h;while(n.length){s=n.pop();i=n.pop();if(s-i<=e)continue;h=i+Math.ceil((s-i)/e/2)*e;vf(t,h,i,s,r);n.push(i,h,h,s)}}var Cf=function(){};Cf.prototype.getReplay=function(t,i){};Cf.prototype.isEmpty=function(){};var If={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var Sf={};Sf.lineString=function(t,i,s,e){var r=t[i];var n=t[i+1];var h=0;var a;for(a=i+e;a<s;a+=e){var o=t[a];var f=t[a+1];h+=Math.sqrt((o-r)*(o-r)+(f-n)*(f-n));r=o;n=f}return h};Sf.linearRing=function(t,i,s,e){var r=Sf.lineString(t,i,s,e);var n=t[s-e]-t[i];var h=t[s-e+1]-t[i+1];r+=Math.sqrt(n*n+h*h);return r};var Of={};Of.lineString=function(t,i,s,e,r,n,h,a){var o=[];var f=t[i]>t[s-e];var u=r.length;var l=t[i];var v=t[i+1];i+=e;var c=t[i];var d=t[i+1];var m=0;var p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2));var z="";var M=0;var _,g,b;for(var x=0;x<u;++x){g=f?u-x-1:x;var w=r.charAt(g);z=f?w+z:z+w;var y=n(z)-M;M+=y;var k=h+y/2;while(i<s-e&&m+p<k){l=c;v=d;i+=e;c=t[i];d=t[i+1];m+=p;p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2))}var E=k-m;var N=Math.atan2(d-v,c-l);if(f){N+=N>0?-Math.PI:Math.PI}if(b!==undefined){var C=N-b;C+=C>Math.PI?-2*Math.PI:C<-Math.PI?2*Math.PI:0;if(Math.abs(C)>a){return null}}var I=E/p;var S=qh.lerp(l,c,I);var O=qh.lerp(v,d,I);if(b==N){if(f){_[0]=S;_[1]=O;_[2]=y/2}_[4]=z}else{z=w;M=y;_=[S,O,y/2,N,z];if(f){o.unshift(_)}else{o.push(_)}b=N}h+=y}return o};var Tf={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12};var Af={};Af.ORDER=[If.POLYGON,If.CIRCLE,If.LINE_STRING,If.IMAGE,If.TEXT,If.DEFAULT];Af.TEXT_ALIGN={};Af.TEXT_ALIGN["left"]=0;Af.TEXT_ALIGN["end"]=0;Af.TEXT_ALIGN["center"]=.5;Af.TEXT_ALIGN["right"]=1;Af.TEXT_ALIGN["start"]=1;Af.TEXT_ALIGN["top"]=0;Af.TEXT_ALIGN["middle"]=.5;Af.TEXT_ALIGN["hanging"]=.2;Af.TEXT_ALIGN["alphabetic"]=.8;Af.TEXT_ALIGN["ideographic"]=.8;Af.TEXT_ALIGN["bottom"]=1;var Rf=function(t,i,s,e,r,n){$o.call(this);this.declutterTree=n;this.tmpExtent_=Zh.createEmpty();this.tolerance=t;this.maxExtent=i;this.overlaps=r;this.pixelRatio=e;this.maxLineWidth=0;this.resolution=s;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_=null;this.bufferedMaxExtent_=null;this.instructions=[];this.coordinates=[];this.coordinateCache_={};this.renderedTransform_=oa.create();this.hitDetectionInstructions=[];this.pixelCoordinates_=null;this.state={};this.viewRotation_=0;this.tmpLocalTransform_=oa.create();this.resetTransform_=oa.create()};Oh.inherits(Rf,$o);Rf.prototype.replayTextBackground_=function(t,i,s,e,r,n,h){t.beginPath();t.moveTo.apply(t,i);t.lineTo.apply(t,s);t.lineTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,i);if(n){this.fillOrigin_=n[2];this.fill_(t)}if(h){this.setStrokeStyle_(t,h);t.stroke()}};Rf.prototype.replayImage_=function(t,i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z){var M=p||z;var _=this.tmpLocalTransform_;r*=v;n*=v;i-=r;s-=n;if(c){i=Math.round(i);s=Math.round(s)}var g=d+f>e.width?e.width-f:d;var b=a+u>e.height?e.height-u:a;var x=this.tmpExtent_;var w=m[3]+g*v+m[1];var y=m[0]+b*v+m[2];var k=i-m[3];var E=s-m[0];var N;var C;var I;var S;if(M||l!==0){N=[k,E];C=[k+w,E];I=[k+w,E+y];S=[k,E+y]}var O=null;if(l!==0){var T=i+r;var A=s+n;O=oa.compose(_,T,A,1,1,l,-T,-A);Zh.createOrUpdateEmpty(x);Zh.extendCoordinate(x,oa.apply(_,N));Zh.extendCoordinate(x,oa.apply(_,C));Zh.extendCoordinate(x,oa.apply(_,I));Zh.extendCoordinate(x,oa.apply(_,S))}else{Zh.createOrUpdate(k,E,k+w,E+y,x)}var R=t.canvas;var P=x[0]<=R.width&&x[2]>=0&&x[1]<=R.height&&x[3]>=0;if(h){if(!P&&h[4]==1){return}Zh.extend(h,x);var L=P?[t,O?O.slice(0):null,o,e,f,u,g,b,i,s,v]:null;if(L&&M){L.push(p,z,N,C,I,S)}h.push(L)}else if(P){if(M){this.replayTextBackground_(t,N,C,I,S,p,z)}Ho.drawImage(t,O,o,e,f,u,g,b,i,s,v)}};Rf.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map((function(t){return t*i}))};Rf.prototype.appendFlatCoordinates=function(t,i,s,e,r,n){var h=this.coordinates.length;var a=this.getBufferedMaxExtent();if(n){i+=e}var o=[t[i],t[i+1]];var f=[NaN,NaN];var u=true;var l,v,c;for(l=i+e;l<s;l+=e){f[0]=t[l];f[1]=t[l+1];c=Zh.coordinateRelationship(a,f);if(c!==v){if(u){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else if(c===Jh.INTERSECTING){this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else{u=true}o[0]=f[0];o[1]=f[1];v=c}if(r&&u||l===i+e){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}return h};Rf.prototype.drawCustomCoordinates_=function(t,i,s,e,r){for(var n=0,h=s.length;n<h;++n){var a=s[n];var o=this.appendFlatCoordinates(t,i,a,e,false,false);r.push(o);i=a}return i};Rf.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var e=t.getType();var r=t.getStride();var n=this.coordinates.length;var h,a,o,f;var u;if(e==Xh.MULTI_POLYGON){t=t;h=t.getOrientedFlatCoordinates();f=[];var l=t.getEndss();u=0;for(var v=0,c=l.length;v<c;++v){var d=[];u=this.drawCustomCoordinates_(h,u,l[v],r,d);f.push(d)}this.instructions.push([Tf.CUSTOM,n,f,t,s,da.coordinatesss])}else if(e==Xh.POLYGON||e==Xh.MULTI_LINE_STRING){o=[];h=e==Xh.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates();u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,o);this.instructions.push([Tf.CUSTOM,n,o,t,s,da.coordinatess])}else if(e==Xh.LINE_STRING||e==Xh.MULTI_POINT){h=t.getFlatCoordinates();a=this.appendFlatCoordinates(h,0,h.length,r,false,false);this.instructions.push([Tf.CUSTOM,n,a,t,s,da.coordinates])}else if(e==Xh.POINT){h=t.getFlatCoordinates();this.coordinates.push(h[0],h[1]);a=this.coordinates.length;this.instructions.push([Tf.CUSTOM,n,a,t,s])}this.endGeometry(t,i)};Rf.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[Tf.BEGIN_GEOMETRY,i,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[Tf.BEGIN_GEOMETRY,i,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};Rf.prototype.fill_=function(t){if(this.fillOrigin_){var i=oa.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]);t.rotate(this.viewRotation_)}t.fill();if(this.fillOrigin_){t.setTransform.apply(t,Ho.resetTransform_)}};Rf.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1];t.lineWidth=i[2];t.lineCap=i[3];t.lineJoin=i[4];t.miterLimit=i[5];if(Ea.CANVAS_LINE_DASH){t.lineDashOffset=i[7];t.setLineDash(i[6])}};Rf.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(s==1||s==t.length-5){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(e)){this.declutterTree.insert(e);var r=Ho.drawImage;for(var n=5,h=t.length;n<h;++n){var a=t[n];if(a){if(a.length>11){this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12])}r.apply(undefined,a)}}}t.length=5;Zh.createOrUpdateEmpty(t)}}};Rf.prototype.replay_=function(t,i,s,e,r,n){var h;if(this.pixelCoordinates_&&Bh.equals(i,this.renderedTransform_)){h=this.pixelCoordinates_}else{if(!this.pixelCoordinates_){this.pixelCoordinates_=[]}h=Qh.transform2D(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_);oa.setFromArray(this.renderedTransform_,i)}var a=!Rh.isEmpty(s);var o=0;var f=e.length;var u=0;var l;var v,c,d,m,p,z,M,_;var g=0;var b=0;var x=null;var w=null;var y=this.coordinateCache_;var k=this.viewRotation_;var E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k};var N=this.instructions!=e||this.overlaps?0:200;while(o<f){var C=e[o];var I=C[0];var S,O,T;switch(I){case Tf.BEGIN_GEOMETRY:S=C[1];if(a&&s[Oh.getUid(S).toString()]||!S.getGeometry()){o=C[2]}else if(n!==undefined&&!Zh.intersects(n,S.getGeometry().getExtent())){o=C[2]+1}else{++o}break;case Tf.BEGIN_PATH:if(g>N){this.fill_(t);g=0}if(b>N){t.stroke();b=0}if(!g&&!b){t.beginPath();d=m=NaN}++o;break;case Tf.CIRCLE:u=C[1];var A=h[u];var R=h[u+1];var P=h[u+2];var L=h[u+3];var D=P-A;var F=L-R;var W=Math.sqrt(D*D+F*F);t.moveTo(A+W,R);t.arc(A,R,W,0,2*Math.PI,true);++o;break;case Tf.CLOSE_PATH:t.closePath();++o;break;case Tf.CUSTOM:u=C[1];l=C[2];var G=C[3];var j=C[4];var V=C.length==6?C[5]:undefined;E.geometry=G;E.feature=S;if(!(o in y)){y[o]=[]}var U=y[o];if(V){V(h,u,l,2,U)}else{U[0]=h[u];U[1]=h[u+1];U.length=2}j(U,E);++o;break;case Tf.DRAW_IMAGE:u=C[1];l=C[2];_=C[3];v=C[4];c=C[5];M=r?null:C[6];var q=C[7];var X=C[8];var Y=C[9];var B=C[10];var H=C[11];var J=C[12];var Z=C[13];var $=C[14];var K=C[15];var Q,tt,it;if(C.length>16){Q=C[16];tt=C[17];it=C[18]}else{Q=Ho.defaultPadding;tt=it=false}if(H){J+=k}for(;u<l;u+=2){this.replayImage_(t,h[u],h[u+1],_,v,c,M,q,X,Y,B,J,Z,$,K,Q,tt?x:null,it?w:null)}this.renderDeclutter_(M,S);++o;break;case Tf.DRAW_CHARS:var st=C[1];var et=C[2];var rt=C[3];M=r?null:C[4];var nt=C[5];var ht=C[6];var at=C[7];var ot=C[8];var ft=C[9];var ut=C[10];var lt=C[11];var vt=C[12];var ct=C[13];var dt=C[14];var mt=Sf.lineString(h,st,et,2);var pt=ot(vt);if(nt||pt<=mt){var zt=this.textStates[ct].textAlign;var Mt=(mt-pt)*Af.TEXT_ALIGN[zt];var _t=Of.lineString(h,st,et,2,vt,ot,Mt,at);if(_t){var gt,bt,xt,wt,yt;if(ut){for(gt=0,bt=_t.length;gt<bt;++gt){yt=_t[gt];xt=yt[4];wt=this.getImage(xt,ct,"",ut);v=yt[2]+lt;c=rt*wt.height+(.5-rt)*2*lt-ft;this.replayImage_(t,yt[0],yt[1],wt,v,c,M,wt.height,1,0,0,yt[3],dt,false,wt.width,Ho.defaultPadding,null,null)}}if(ht){for(gt=0,bt=_t.length;gt<bt;++gt){yt=_t[gt];xt=yt[4];wt=this.getImage(xt,ct,ht,"");v=yt[2];c=rt*wt.height-ft;this.replayImage_(t,yt[0],yt[1],wt,v,c,M,wt.height,1,0,0,yt[3],dt,false,wt.width,Ho.defaultPadding,null,null)}}}}this.renderDeclutter_(M,S);++o;break;case Tf.END_GEOMETRY:if(r!==undefined){S=C[1];var kt=r(S);if(kt){return kt}}++o;break;case Tf.FILL:if(N){g++}else{this.fill_(t)}++o;break;case Tf.MOVE_TO_LINE_TO:u=C[1];l=C[2];O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(p!==d||z!==m){t.moveTo(O,T);d=p;m=z}for(u+=2;u<l;u+=2){O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(u==l-2||p!==d||z!==m){t.lineTo(O,T);d=p;m=z}}++o;break;case Tf.SET_FILL_STYLE:x=C;this.fillOrigin_=C[2];if(g){this.fill_(t);g=0;if(b){t.stroke();b=0}}t.fillStyle=C[1];++o;break;case Tf.SET_STROKE_STYLE:w=C;if(b){t.stroke();b=0}this.setStrokeStyle_(t,C);++o;break;case Tf.STROKE:if(N){b++}else{t.stroke()}++o;break;default:++o;break}}if(g){this.fill_(t)}if(b){t.stroke()}return undefined};Rf.prototype.replay=function(t,i,s,e){this.viewRotation_=s;this.replay_(t,i,e,this.instructions,undefined,undefined)};Rf.prototype.replayHitDetection=function(t,i,s,e,r,n){this.viewRotation_=s;return this.replay_(t,i,e,this.hitDetectionInstructions,r,n)};Rf.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i;var s=t.length;var e;var r;var n=-1;for(i=0;i<s;++i){e=t[i];r=e[0];if(r==Tf.END_GEOMETRY){n=i}else if(r==Tf.BEGIN_GEOMETRY){e[2]=i;Bh.reverseSubArray(this.hitDetectionInstructions,n,i);n=-1}}};Rf.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var e=t.getColor();s.fillStyle=Zo.asColorLike(e?e:Ho.defaultFillStyle)}else{s.fillStyle=undefined}if(i){var r=i.getColor();s.strokeStyle=Zo.asColorLike(r?r:Ho.defaultStrokeStyle);var n=i.getLineCap();s.lineCap=n!==undefined?n:Ho.defaultLineCap;var h=i.getLineDash();s.lineDash=h?h.slice():Ho.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a?a:Ho.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=o!==undefined?o:Ho.defaultLineJoin;var f=i.getWidth();s.lineWidth=f!==undefined?f:Ho.defaultLineWidth;var u=i.getMiterLimit();s.miterLimit=u!==undefined?u:Ho.defaultMiterLimit;if(s.lineWidth>this.maxLineWidth){this.maxLineWidth=s.lineWidth;this.bufferedMaxExtent_=null}}else{s.strokeStyle=undefined;s.lineCap=undefined;s.lineDash=null;s.lineDashOffset=undefined;s.lineJoin=undefined;s.lineWidth=undefined;s.miterLimit=undefined}};Rf.prototype.applyFill=function(t,i){var s=t.fillStyle;var e=[Tf.SET_FILL_STYLE,s];if(typeof s!=="string"){var r=i.getExtent();e.push([r[0],r[3]])}this.instructions.push(e)};Rf.prototype.applyStroke=function(t){this.instructions.push([Tf.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])};Rf.prototype.updateFillStyle=function(t,i,s){var e=t.fillStyle;if(typeof e!=="string"||t.currentFillStyle!=e){i.call(this,t,s);t.currentFillStyle=e}};Rf.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle;var e=t.lineCap;var r=t.lineDash;var n=t.lineDashOffset;var h=t.lineJoin;var a=t.lineWidth;var o=t.miterLimit;if(t.currentStrokeStyle!=s||t.currentLineCap!=e||r!=t.currentLineDash&&!Bh.equals(t.currentLineDash,r)||t.currentLineDashOffset!=n||t.currentLineJoin!=h||t.currentLineWidth!=a||t.currentMiterLimit!=o){i.call(this,t);t.currentStrokeStyle=s;t.currentLineCap=e;t.currentLineDash=r;t.currentLineDashOffset=n;t.currentLineJoin=h;t.currentLineWidth=a;t.currentMiterLimit=o}};Rf.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var s=[Tf.END_GEOMETRY,i];this.instructions.push(s);this.hitDetectionInstructions.push(s)};Rf.prototype.finish=Oh.nullFunction;Rf.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_){this.bufferedMaxExtent_=Zh.clone(this.maxExtent);if(this.maxLineWidth>0){var t=this.resolution*(this.maxLineWidth+1)/2;Zh.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}}return this.bufferedMaxExtent_};var Pf=function(t,i,s,e,r,n){Rf.call(this,t,i,s,e,r,n);this.declutterGroup_=null;this.hitDetectionImage_=null;this.image_=null;this.anchorX_=undefined;this.anchorY_=undefined;this.height_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.scale_=undefined;this.snapToPixel_=undefined;this.width_=undefined};Oh.inherits(Pf,Rf);Pf.prototype.drawCoordinates_=function(t,i,s,e){return this.appendFlatCoordinates(t,i,s,e,false,false)};Pf.prototype.drawPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Tf.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Tf.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};Pf.prototype.drawMultiPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([Tf.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([Tf.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};Pf.prototype.finish=function(){this.reverseHitDetectionInstructions();this.anchorX_=undefined;this.anchorY_=undefined;this.hitDetectionImage_=null;this.image_=null;this.height_=undefined;this.scale_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.snapToPixel_=undefined;this.width_=undefined};Pf.prototype.setImageStyle=function(t,i){var s=t.getAnchor();var e=t.getSize();var r=t.getHitDetectionImage(1);var n=t.getImage(1);var h=t.getOrigin();this.anchorX_=s[0];this.anchorY_=s[1];this.declutterGroup_=i;this.hitDetectionImage_=r;this.image_=n;this.height_=e[1];this.opacity_=t.getOpacity();this.originX_=h[0];this.originY_=h[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.snapToPixel_=t.getSnapToPixel();this.width_=e[0]};var Lf=function(t,i,s,e,r,n){Rf.call(this,t,i,s,e,r,n)};Oh.inherits(Lf,Rf);Lf.prototype.drawFlatCoordinates_=function(t,i,s,e){var r=this.coordinates.length;var n=this.appendFlatCoordinates(t,i,s,e,false,false);var h=[Tf.MOVE_TO_LINE_TO,r,n];this.instructions.push(h);this.hitDetectionInstructions.push(h);return s};Lf.prototype.drawLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Tf.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Tf.BEGIN_PATH]);var n=t.getFlatCoordinates();var h=t.getStride();this.drawFlatCoordinates_(n,0,n.length,h);this.hitDetectionInstructions.push([Tf.STROKE]);this.endGeometry(t,i)};Lf.prototype.drawMultiLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Tf.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[Tf.BEGIN_PATH]);var n=t.getEnds();var h=t.getFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinates_(h,o,n[f],a)}this.hitDetectionInstructions.push([Tf.STROKE]);this.endGeometry(t,i)};Lf.prototype.finish=function(){var t=this.state;if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Tf.STROKE])}this.reverseHitDetectionInstructions();this.state=null};Lf.prototype.applyStroke=function(t){if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([Tf.STROKE]);t.lastStroke=this.coordinates.length}t.lastStroke=0;Rf.prototype.applyStroke.call(this,t);this.instructions.push([Tf.BEGIN_PATH])};var Df=function(t,i,s,e,r,n){Rf.call(this,t,i,s,e,r,n)};Oh.inherits(Df,Rf);Df.prototype.drawFlatCoordinatess_=function(t,i,s,e){var r=this.state;var n=r.fillStyle!==undefined;var h=r.strokeStyle!=undefined;var a=s.length;var o=[Tf.BEGIN_PATH];this.instructions.push(o);this.hitDetectionInstructions.push(o);for(var f=0;f<a;++f){var u=s[f];var l=this.coordinates.length;var v=this.appendFlatCoordinates(t,i,u,e,true,!h);var c=[Tf.MOVE_TO_LINE_TO,l,v];this.instructions.push(c);this.hitDetectionInstructions.push(c);if(h){var d=[Tf.CLOSE_PATH];this.instructions.push(d);this.hitDetectionInstructions.push(d)}i=u}var m=[Tf.FILL];this.hitDetectionInstructions.push(m);if(n){this.instructions.push(m)}if(h){var p=[Tf.STROKE];this.instructions.push(p);this.hitDetectionInstructions.push(p)}return i};Df.prototype.drawCircle=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Tf.SET_FILL_STYLE,Jo.asString(Ho.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Tf.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getFlatCoordinates();var h=t.getStride();var a=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,h,false,false);var o=[Tf.BEGIN_PATH];var f=[Tf.CIRCLE,a];this.instructions.push(o,f);this.hitDetectionInstructions.push(o,f);var u=[Tf.FILL];this.hitDetectionInstructions.push(u);if(s.fillStyle!==undefined){this.instructions.push(u)}if(s.strokeStyle!==undefined){var l=[Tf.STROKE];this.instructions.push(l);this.hitDetectionInstructions.push(l)}this.endGeometry(t,i)};Df.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Tf.SET_FILL_STYLE,Jo.asString(Ho.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Tf.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var e=t.getEnds();var r=t.getOrientedFlatCoordinates();var n=t.getStride();this.drawFlatCoordinatess_(r,0,e,n);this.endGeometry(t,i)};Df.prototype.drawMultiPolygon=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([Tf.SET_FILL_STYLE,Jo.asString(Ho.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([Tf.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getEndss();var h=t.getOrientedFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinatess_(h,o,n[f],a)}this.endGeometry(t,i)};Df.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var t=this.tolerance;if(t!==0){var i=this.coordinates;var s,e;for(s=0,e=i.length;s<e;++s){i[s]=ma.snap(i[s],t)}}};Df.prototype.setFillStrokeStyles_=function(t){var i=this.state;var s=i.fillStyle;if(s!==undefined){this.updateFillStyle(i,this.applyFill,t)}if(i.strokeStyle!==undefined){this.updateStrokeStyle(i,this.applyStroke)}};var Ff={};Ff.lineString=function(t,i,s,e,r){var n=s;var h=s;var a=0;var o=0;var f=s;var u,l,v,c,d,m,p,z,M,_;for(l=s;l<e;l+=r){var g=i[l];var b=i[l+1];if(d!==undefined){M=g-d;_=b-m;c=Math.sqrt(M*M+_*_);if(p!==undefined){o+=v;u=Math.acos((p*M+z*_)/(v*c));if(u>t){if(o>a){a=o;n=f;h=l}o=0;f=l-r}}v=c;p=M;z=_}d=g;m=b}o+=c;return o>a?[f,l]:[n,h]};var Wf={POINT:"point",LINE:"line"};var Gf=function(t,i,s,e,r,n){Rf.call(this,t,i,s,e,r,n);this.labels_=null;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=undefined;this.textRotation_=0;this.textFillState_=null;this.fillStates={};this.textStrokeState_=null;this.strokeStates={};this.textState_={};this.textStates={};this.textKey_="";this.fillKey_="";this.strokeKey_="";this.widths_={};var h=Ho.labelCache;h.prune()};Oh.inherits(Gf,Rf);Gf.measureTextWidths=function(t,i,s){var e=i.length;var r=0;var n,h;for(h=0;h<e;++h){n=Ho.measureTextWidth(t,i[h]);r=Math.max(r,n);s.push(n)}return r};Gf.prototype.drawText=function(t,i){var s=this.textFillState_;var e=this.textStrokeState_;var r=this.textState_;if(this.text_===""||!r||!s&&!e){return}var n=this.coordinates.length;var h=t.getType();var a=null;var o=2;var f=2;var u,l;if(r.placement===Wf.LINE){if(!Zh.intersects(this.getBufferedMaxExtent(),t.getExtent())){return}var v;a=t.getFlatCoordinates();f=t.getStride();if(h==Xh.LINE_STRING){v=[a.length]}else if(h==Xh.MULTI_LINE_STRING){v=t.getEnds()}else if(h==Xh.POLYGON){v=t.getEnds().slice(0,1)}else if(h==Xh.MULTI_POLYGON){var c=t.getEndss();v=[];for(u=0,l=c.length;u<l;++u){v.push(c[u][0])}}this.beginGeometry(t,i);var d=r.textAlign;var m=0;var p;for(var z=0,M=v.length;z<M;++z){if(d==undefined){var _=Ff.lineString(r.maxAngle,a,m,v[z],f);m=_[0];p=_[1]}else{p=v[z]}for(u=m;u<p;u+=f){this.coordinates.push(a[u],a[u+1])}o=this.coordinates.length;m=v[z];this.drawChars_(n,o,this.declutterGroup_);n=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);var b=g.width/this.pixelRatio;switch(h){case Xh.POINT:case Xh.MULTI_POINT:a=t.getFlatCoordinates();o=a.length;break;case Xh.LINE_STRING:a=t.getFlatMidpoint();break;case Xh.CIRCLE:a=t.getCenter();break;case Xh.MULTI_LINE_STRING:a=t.getFlatMidpoints();o=a.length;break;case Xh.POLYGON:a=t.getFlatInteriorPoint();if(!r.overflow&&a[2]/this.resolution<b){return}f=3;break;case Xh.MULTI_POLYGON:var x=t.getFlatInteriorPoints();a=[];for(u=0,l=x.length;u<l;u+=3){if(r.overflow||x[u+2]/this.resolution>=b){a.push(x[u],x[u+1])}}o=a.length;if(o==0){return}break}o=this.appendFlatCoordinates(a,0,o,f,false,false);this.beginGeometry(t,i);if(r.backgroundFill||r.backgroundStroke){this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke);this.updateFillStyle(this.state,this.applyFill,t);this.updateStrokeStyle(this.state,this.applyStroke)}this.drawTextImage_(g,n,o);this.endGeometry(t,i)}};Gf.prototype.getImage=function(t,i,s,e){var r;var n=e+i+t+s+this.pixelRatio;var h=Ho.labelCache;if(!h.containsKey(n)){var a=e?this.strokeStates[e]||this.textStrokeState_:null;var o=s?this.fillStates[s]||this.textFillState_:null;var f=this.textStates[i]||this.textState_;var u=this.pixelRatio;var l=f.scale*u;var v=Af.TEXT_ALIGN[f.textAlign||Ho.defaultTextAlign];var c=e&&a.lineWidth?a.lineWidth:0;var d=t.split("\n");var m=d.length;var p=[];var z=Gf.measureTextWidths(f.font,d,p);var M=Ho.measureTextHeight(f.font);var _=M*m;var g=z+c;var b=ro.createCanvasContext2D(Math.ceil(g*l),Math.ceil((_+c)*l));r=b.canvas;h.set(n,r);if(l!=1){b.scale(l,l)}b.font=f.font;if(e){b.strokeStyle=a.strokeStyle;b.lineWidth=c*(Ea.SAFARI?l:1);b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.miterLimit=a.miterLimit;if(Ea.CANVAS_LINE_DASH&&a.lineDash.length){b.setLineDash(a.lineDash);b.lineDashOffset=a.lineDashOffset}}if(s){b.fillStyle=o.fillStyle}b.textBaseline="middle";b.textAlign="center";var x=.5-v;var w=v*r.width/l+x*c;var y;if(e){for(y=0;y<m;++y){b.strokeText(d[y],w+x*p[y],.5*(c+M)+y*M)}}if(s){for(y=0;y<m;++y){b.fillText(d[y],w+x*p[y],.5*(c+M)+y*M)}}}return h.get(n)};Gf.prototype.drawTextImage_=function(t,i,s){var e=this.textState_;var r=this.textStrokeState_;var n=this.pixelRatio;var h=Af.TEXT_ALIGN[e.textAlign||Ho.defaultTextAlign];var a=Af.TEXT_ALIGN[e.textBaseline];var o=r&&r.lineWidth?r.lineWidth:0;var f=h*t.width/n+2*(.5-h)*o;var u=a*t.height/n+2*(.5-a)*o;this.instructions.push([Tf.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,true,t.width,e.padding==Ho.defaultPadding?Ho.defaultPadding:e.padding.map((function(t){return t*n})),!!e.backgroundFill,!!e.backgroundStroke]);this.hitDetectionInstructions.push([Tf.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,true,t.width,e.padding,!!e.backgroundFill,!!e.backgroundStroke])};Gf.prototype.drawChars_=function(t,i,s){var e=this.textStrokeState_;var r=this.textState_;var n=this.textFillState_;var h=this.strokeKey_;if(e){if(!(h in this.strokeStates)){this.strokeStates[h]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}}}var a=this.textKey_;if(!(this.textKey_ in this.textStates)){this.textStates[this.textKey_]={font:r.font,textAlign:r.textAlign||Ho.defaultTextAlign,scale:r.scale}}var o=this.fillKey_;if(n){if(!(o in this.fillStates)){this.fillStates[o]={fillStyle:n.fillStyle}}}var f=this.pixelRatio;var u=Af.TEXT_ALIGN[r.textBaseline];var l=this.textOffsetY_*f;var v=this.text_;var c=r.font;var d=r.scale;var m=e?e.lineWidth*d/2:0;var p=this.widths_[c];if(!p){this.widths_[c]=p={}}this.instructions.push([Tf.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Ho.measureTextWidth(c,t)}return i*d*f},l,h,m*f,v,a,1]);this.hitDetectionInstructions.push([Tf.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=Ho.measureTextWidth(c,t)}return i*d},l,h,m,v,a,1/f])};Gf.prototype.setTextStyle=function(t,i){var s,e,r;if(!t){this.text_=""}else{this.declutterGroup_=i;var n=t.getFill();if(!n){e=this.textFillState_=null}else{e=this.textFillState_;if(!e){e=this.textFillState_={}}e.fillStyle=Zo.asColorLike(n.getColor()||Ho.defaultFillStyle)}var h=t.getStroke();if(!h){r=this.textStrokeState_=null}else{r=this.textStrokeState_;if(!r){r=this.textStrokeState_={}}var a=h.getLineDash();var o=h.getLineDashOffset();var f=h.getWidth();var u=h.getMiterLimit();r.lineCap=h.getLineCap()||Ho.defaultLineCap;r.lineDash=a?a.slice():Ho.defaultLineDash;r.lineDashOffset=o===undefined?Ho.defaultLineDashOffset:o;r.lineJoin=h.getLineJoin()||Ho.defaultLineJoin;r.lineWidth=f===undefined?Ho.defaultLineWidth:f;r.miterLimit=u===undefined?Ho.defaultMiterLimit:u;r.strokeStyle=Zo.asColorLike(h.getColor()||Ho.defaultStrokeStyle)}s=this.textState_;var l=t.getFont()||Ho.defaultFont;Ho.checkFont(l);var v=t.getScale();s.overflow=t.getOverflow();s.font=l;s.maxAngle=t.getMaxAngle();s.placement=t.getPlacement();s.textAlign=t.getTextAlign();s.textBaseline=t.getTextBaseline()||Ho.defaultTextBaseline;s.backgroundFill=t.getBackgroundFill();s.backgroundStroke=t.getBackgroundStroke();s.padding=t.getPadding()||Ho.defaultPadding;s.scale=v===undefined?1:v;var c=t.getOffsetX();var d=t.getOffsetY();var m=t.getRotateWithView();var p=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=c===undefined?0:c;this.textOffsetY_=d===undefined?0:d;this.textRotateWithView_=m===undefined?false:m;this.textRotation_=p===undefined?0:p;this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:Oh.getUid(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"";this.textKey_=s.font+s.scale+(s.textAlign||"?");this.fillKey_=e?typeof e.fillStyle=="string"?e.fillStyle:"|"+Oh.getUid(e.fillStyle):""}};var jf=function(t,i,s,e,r,n,h){Cf.call(this);this.declutterTree_=n;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=r;this.pixelRatio_=e;this.resolution_=s;this.renderBuffer_=h;this.replaysByZIndex_={};this.hitDetectionContext_=ro.createCanvasContext2D(1,1);this.hitDetectionTransform_=oa.create()};Oh.inherits(jf,Cf);jf.circleArrayCache_={0:[[true]]};jf.fillCircleArrayRowToMiddle_=function(t,i,s){var e;var r=Math.floor(t.length/2);if(i>=r){for(e=r;e<i;e++){t[e][s]=true}}else if(i<r){for(e=i+1;e<r;e++){t[e][s]=true}}};jf.getCircleArray_=function(t){if(jf.circleArrayCache_[t]!==undefined){return jf.circleArrayCache_[t]}var i=t*2+1;var s=new Array(i);for(var e=0;e<i;e++){s[e]=new Array(i)}var r=t;var n=0;var h=0;while(r>=n){jf.fillCircleArrayRowToMiddle_(s,t+r,t+n);jf.fillCircleArrayRowToMiddle_(s,t+n,t+r);jf.fillCircleArrayRowToMiddle_(s,t-n,t+r);jf.fillCircleArrayRowToMiddle_(s,t-r,t+n);jf.fillCircleArrayRowToMiddle_(s,t-r,t-n);jf.fillCircleArrayRowToMiddle_(s,t-n,t-r);jf.fillCircleArrayRowToMiddle_(s,t+n,t-r);jf.fillCircleArrayRowToMiddle_(s,t+r,t-n);n++;h+=1+2*n;if(2*(h-r)+1>0){r-=1;h+=1-2*r}}jf.circleArrayCache_[t]=s;return s};jf.replayDeclutter=function(t,i,s){var e=Object.keys(t).map(Number).sort(Bh.numberSafeCompareFunction);var r={};for(var n=0,h=e.length;n<h;++n){var a=t[e[n].toString()];for(var o=0,f=a.length;o<f;){var u=a[o++];var l=a[o++];u.replay(i,l,s,r)}}};jf.prototype.addDeclutter=function(t){var i=null;if(this.declutterTree_){if(t){i=this.declutterGroup_;i[4]++}else{i=this.declutterGroup_=Zh.createEmpty();i.push(1)}}return i};jf.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath();t.moveTo(s[0],s[1]);t.lineTo(s[2],s[3]);t.lineTo(s[4],s[5]);t.lineTo(s[6],s[7]);t.clip()};jf.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];for(var e=0,r=t.length;e<r;++e){if(t[e]in s){return true}}}return false};jf.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i=this.replaysByZIndex_[t];var s;for(s in i){i[s].finish()}}};jf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){e=Math.round(e);var a=e*2+1;var o=oa.compose(this.hitDetectionTransform_,e+.5,e+.5,1/i,-1/i,-s,-t[0],-t[1]);var f=this.hitDetectionContext_;if(f.canvas.width!==a||f.canvas.height!==a){f.canvas.width=a;f.canvas.height=a}else{f.clearRect(0,0,a,a)}var u;if(this.renderBuffer_!==undefined){u=Zh.createEmpty();Zh.extendCoordinate(u,t);Zh.buffer(u,i*(this.renderBuffer_+e),u)}var l=jf.getCircleArray_(e);var v;if(this.declutterTree_){v=this.declutterTree_.all().map((function(t){return t.value}))}var c;function d(t){var i=f.getImageData(0,0,a,a).data;for(var s=0;s<a;s++){for(var e=0;e<a;e++){if(l[s][e]){if(i[(e*a+s)*4+3]>0){var r;if(!(v&&(c==If.IMAGE||c==If.TEXT))||v.indexOf(t)!==-1){r=n(t)}if(r){return r}else{f.clearRect(0,0,a,a);return undefined}}}}}}var m=Object.keys(this.replaysByZIndex_).map(Number);m.sort(Bh.numberSafeCompareFunction);var p,z,M,_,g;for(p=m.length-1;p>=0;--p){var b=m[p].toString();M=this.replaysByZIndex_[b];for(z=Af.ORDER.length-1;z>=0;--z){c=Af.ORDER[z];_=M[c];if(_!==undefined){if(h&&(c==If.IMAGE||c==If.TEXT)){var x=h[b];if(!x){h[b]=[_,o.slice(0)]}else{x.push(_,o.slice(0))}}else{g=_.replayHitDetection(f,o,s,r,d,u);if(g){return g}}}}}return undefined};jf.prototype.getClipCoords=function(t){var i=this.maxExtent_;var s=i[0];var e=i[1];var r=i[2];var n=i[3];var h=[s,e,s,n,r,n,r,e];Qh.transform2D(h,0,8,2,t,h);return h};jf.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=jf.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_);e[i]=r}return r};jf.prototype.getReplays=function(){return this.replaysByZIndex_};jf.prototype.isEmpty=function(){return Rh.isEmpty(this.replaysByZIndex_)};jf.prototype.replay=function(t,i,s,e,r,n){var h=Object.keys(this.replaysByZIndex_).map(Number);h.sort(Bh.numberSafeCompareFunction);t.save();this.clip(t,i);var a=r?r:Af.ORDER;var o,f,u,l,v,c;for(o=0,f=h.length;o<f;++o){var d=h[o].toString();v=this.replaysByZIndex_[d];for(u=0,l=a.length;u<l;++u){var m=a[u];c=v[m];if(c!==undefined){if(n&&(m==If.IMAGE||m==If.TEXT)){var p=n[d];if(!p){n[d]=[c,i.slice(0)]}else{p.push(c,i.slice(0))}}else{c.replay(t,i,s,e)}}}}t.restore()};jf.BATCH_CONSTRUCTORS_={Circle:Df,Default:Rf,Image:Pf,LineString:Lf,Polygon:Df,Text:Gf};var Vf={};Vf.defaultOrder=function(t,i){return Oh.getUid(t)-Oh.getUid(i)};Vf.getSquaredTolerance=function(t,i){var s=Vf.getTolerance(t,i);return s*s};Vf.getTolerance=function(t,i){return Oh.SIMPLIFY_TOLERANCE*t/i};Vf.renderCircleGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),If.CIRCLE);h.setFillStrokeStyle(r,n);h.drawCircle(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),If.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Vf.renderFeature=function(t,i,s,e,r,n){var h=false;var a,o;a=s.getImage();if(a){o=a.getImageState();if(o==Vo.LOADED||o==Vo.ERROR){a.unlistenImageChange(r,n)}else{if(o==Vo.IDLE){a.load()}o=a.getImageState();a.listenImageChange(r,n);h=true}}Vf.renderFeature_(t,i,s,e);return h};Vf.renderFeature_=function(t,i,s,e){var r=s.getGeometryFunction()(i);if(!r){return}var n=r.getSimplifiedGeometry(e);var h=s.getRenderer();if(h){Vf.renderGeometry_(t,n,s,i)}else{var a=Vf.GEOMETRY_RENDERERS_[n.getType()];a(t,n,s,i)}};Vf.renderGeometry_=function(t,i,s,e){if(i.getType()==Xh.GEOMETRY_COLLECTION){var r=i.getGeometries();for(var n=0,h=r.length;n<h;++n){Vf.renderGeometry_(t,r[n],s,e)}return}var a=t.getReplay(s.getZIndex(),If.DEFAULT);a.drawCustom(i,e,s.getRenderer())};Vf.renderGeometryCollectionGeometry_=function(t,i,s,e){var r=i.getGeometriesArray();var n,h;for(n=0,h=r.length;n<h;++n){var a=Vf.GEOMETRY_RENDERERS_[r[n].getType()];a(t,r[n],s,e)}};Vf.renderLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),If.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),If.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Vf.renderMultiLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),If.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawMultiLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),If.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Vf.renderMultiPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(n||r){var h=t.getReplay(s.getZIndex(),If.POLYGON);h.setFillStrokeStyle(r,n);h.drawMultiPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),If.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Vf.renderPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Vo.LOADED){return}var n=t.getReplay(s.getZIndex(),If.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),If.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Vf.renderMultiPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=Vo.LOADED){return}var n=t.getReplay(s.getZIndex(),If.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawMultiPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),If.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Vf.renderPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),If.POLYGON);h.setFillStrokeStyle(r,n);h.drawPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),If.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Vf.GEOMETRY_RENDERERS_={Point:Vf.renderPointGeometry_,LineString:Vf.renderLineStringGeometry_,Polygon:Vf.renderPolygonGeometry_,MultiPoint:Vf.renderMultiPointGeometry_,MultiLineString:Vf.renderMultiLineStringGeometry_,MultiPolygon:Vf.renderMultiPolygonGeometry_,GeometryCollection:Vf.renderGeometryCollectionGeometry_,Circle:Vf.renderCircleGeometry_};var Uf=function(t){tf.call(this,t);this.declutterTree_=t.getDeclutter()?lf(9):null;this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Zh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.replayGroupChanged=true;this.context=ro.createCanvasContext2D();Ph.listen(Ho.labelCache,Wh.CLEAR,this.handleFontsChanged_,this)};Oh.inherits(Uf,tf);Uf["handles"]=function(t,i){return t===lo.CANVAS&&i.getType()===qo.VECTOR};Uf["create"]=function(t,i){return new Uf(i)};Uf.prototype.disposeInternal=function(){Ph.unlisten(Ho.labelCache,Wh.CLEAR,this.handleFontsChanged_,this);tf.prototype.disposeInternal.call(this)};Uf.prototype.composeFrame=function(t,i,s){var e=t.extent;var r=t.pixelRatio;var n=i.managed?t.skippedFeatureUids:{};var h=t.viewState;var a=h.projection;var o=h.rotation;var f=a.getExtent();var u=this.getLayer().getSource();var l=this.getTransform(t,0);this.preCompose(s,t,l);var v=i.extent;var c=v!==undefined;if(c){this.clip(s,t,v)}var d=this.replayGroup_;if(d&&!d.isEmpty()){if(this.declutterTree_){this.declutterTree_.clear()}var m=this.getLayer();var p=0;var z=0;var M;var _=i.opacity!==1;var g=m.hasListener(zo.RENDER);if(_||g){var b=s.canvas.width;var x=s.canvas.height;if(o){var w=Math.round(Math.sqrt(b*b+x*x));p=(w-b)/2;z=(w-x)/2;b=x=w}this.context.canvas.width=b;this.context.canvas.height=x;M=this.context}else{M=s}var y=M.globalAlpha;if(!_){M.globalAlpha=i.opacity}if(M!=s){M.translate(p,z)}var k=t.size[0]*r;var E=t.size[1]*r;Ho.rotateAtOffset(M,-o,k/2,E/2);d.replay(M,l,o,n);if(u.getWrapX()&&a.canWrapX()&&!Zh.containsExtent(f,e)){var N=e[0];var C=Zh.getWidth(f);var I=0;var S;while(N<f[0]){--I;S=C*I;l=this.getTransform(t,S);d.replay(M,l,o,n);N+=C}I=0;N=e[2];while(N>f[2]){++I;S=C*I;l=this.getTransform(t,S);d.replay(M,l,o,n);N-=C}l=this.getTransform(t,0)}Ho.rotateAtOffset(M,o,k/2,E/2);if(M!=s){if(g){this.dispatchRenderEvent(M,t,l)}if(_){var O=s.globalAlpha;s.globalAlpha=i.opacity;s.drawImage(M.canvas,-p,-z);s.globalAlpha=O}else{s.drawImage(M.canvas,-p,-z)}M.translate(-p,-z)}if(!_){M.globalAlpha=y}}if(c){s.restore()}this.postCompose(s,t,i,l)};Uf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_){return undefined}else{var n=i.viewState.resolution;var h=i.viewState.rotation;var a=this.getLayer();var o={};var f=this.replayGroup_.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=Oh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null);return f}};Uf.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.replayGroup_){i.changed()}};Uf.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Uf.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getSource();this.updateLogos(t,e);var r=t.viewHints[Ka.ANIMATING];var n=t.viewHints[Ka.INTERACTING];var h=s.getUpdateWhileAnimating();var a=s.getUpdateWhileInteracting();if(!this.dirty_&&(!h&&r)||!a&&n){return true}var o=t.extent;var f=t.viewState;var u=f.projection;var l=f.resolution;var v=t.pixelRatio;var c=s.getRevision();var d=s.getRenderBuffer();var m=s.getRenderOrder();if(m===undefined){m=Vf.defaultOrder}var p=Zh.buffer(o,d*l);var z=f.projection.getExtent();if(e.getWrapX()&&f.projection.canWrapX()&&!Zh.containsExtent(z,t.extent)){var M=Zh.getWidth(z);var _=Math.max(Zh.getWidth(p)/2,M);p[0]=z[0]-_;p[2]=z[2]+_}if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==c&&this.renderedRenderOrder_==m&&Zh.containsExtent(this.renderedExtent_,p)){this.replayGroupChanged=false;return true}this.replayGroup_=null;this.dirty_=false;var g=new jf(Vf.getTolerance(l,v),p,l,v,e.getOverlaps(),this.declutterTree_,s.getRenderBuffer());e.loadFeatures(p,l,u);var b=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,l,v,i,g);this.dirty_=this.dirty_||r}}.bind(this);if(m){var x=[];e.forEachFeatureInExtent(p,(function(t){x.push(t)}),this);x.sort(m);for(var w=0,y=x.length;w<y;++w){b(x[w])}}else{e.forEachFeatureInExtent(p,b,this)}g.finish();this.renderedResolution_=l;this.renderedRevision_=c;this.renderedRenderOrder_=m;this.renderedExtent_=p;this.replayGroup_=g;this.replayGroupChanged=true;return true};Uf.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=0,a=e.length;h<a;++h){n=Vf.renderFeature(r,t,e[h],Vf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Vf.renderFeature(r,t,e,Vf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)}return n};var qf={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var Xf=function(t){this.context=null;ff.call(this,t);this.declutterTree_=t.getDeclutter()?lf(9):null;this.dirty_=false;this.tmpTransform_=oa.create();this.zDirection=t.getRenderMode()==qf.VECTOR?1:0;Ph.listen(Ho.labelCache,Wh.CLEAR,this.handleFontsChanged_,this)};Oh.inherits(Xf,ff);Xf["handles"]=function(t,i){return t===lo.CANVAS&&i.getType()===qo.VECTOR_TILE};Xf["create"]=function(t,i){return new Xf(i)};Xf.IMAGE_REPLAYS={image:[If.POLYGON,If.CIRCLE,If.LINE_STRING,If.IMAGE,If.TEXT],hybrid:[If.POLYGON,If.LINE_STRING]};Xf.VECTOR_REPLAYS={image:[If.DEFAULT],hybrid:[If.IMAGE,If.TEXT,If.DEFAULT],vector:Af.ORDER};Xf.prototype.disposeInternal=function(){Ph.unlisten(Ho.labelCache,Wh.CLEAR,this.handleFontsChanged_,this);ff.prototype.disposeInternal.call(this)};Xf.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getRevision();if(this.renderedLayerRevision_!=e){this.renderedTiles.length=0;var r=s.getRenderMode();if(!this.context&&r!=qf.VECTOR){this.context=ro.createCanvasContext2D()}if(this.context&&r==qf.VECTOR){this.context=null}}this.renderedLayerRevision_=e;return ff.prototype.prepareFrame.apply(this,arguments)};Xf.prototype.createReplayGroup_=function(t,i){var s=this.getLayer();var e=i.pixelRatio;var r=i.viewState.projection;var n=s.getRevision();var h=s.getRenderOrder()||null;var a=t.getReplayState(s);if(!a.dirty&&a.renderedRevision==n&&a.renderedRenderOrder==h){return}var o=s.getSource();var f=o.getTileGrid();var u=o.getTileGridForProjection(r);var l=u.getResolution(t.tileCoord[0]);var v=u.getTileCoordExtent(t.wrappedTileCoord);var c={};for(var d=0,m=t.tileKeys.length;d<m;++d){var p=t.getTile(t.tileKeys[d]);if(p.getState()==Ya.ERROR){continue}var z=p.tileCoord;var M=f.getTileCoordExtent(z);var _=Zh.getIntersection(v,M);var g=Zh.equals(M,_)?null:Zh.buffer(_,s.getRenderBuffer()*l);var b=p.getProjection();var x=false;if(!aa.equivalent(r,b)){x=true;p.setProjection(r)}a.dirty=false;var w=new jf(0,_,l,e,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer());var y=Vf.getSquaredTolerance(l,e);var k=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,y,i,w);this.dirty_=this.dirty_||r;a.dirty=a.dirty||r}};var E=p.getFeatures();if(h&&h!==a.renderedRenderOrder){E.sort(h)}var N;for(var C=0,I=E.length;C<I;++C){N=E[C];if(x){if(b.getUnits()==ta.TILE_PIXELS){b.setWorldExtent(M);b.setExtent(p.getExtent())}N.getGeometry().transform(b,r)}if(!g||Zh.intersects(g,N.getGeometry().getExtent())){k.call(this,N)}}w.finish();for(var S in w.getReplays()){c[S]=true}p.setReplayGroup(s,t.tileCoord.toString(),w)}a.renderedRevision=n;a.renderedRenderOrder=h};Xf.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t;this.createReplayGroup_(f,i);if(this.context){this.renderTileImage_(f,i,s);ff.prototype.drawTileImage.apply(this,arguments)}};Xf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=i.viewState.resolution;var h=i.viewState.rotation;s=s==undefined?0:s;var a=this.getLayer();var o={};var f=this.renderedTiles;var u=a.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v,c;var d,m,p;var z,M,_;for(d=0,m=f.length;d<m;++d){z=f[d];M=z.wrappedTileCoord;_=l.getTileCoordExtent(M,this.tmpExtent);v=Zh.buffer(_,s*n,v);if(!Zh.containsCoordinate(v,t)){continue}for(var g=0,b=z.tileKeys.length;g<b;++g){var x=z.getTile(z.tileKeys[g]);if(x.getState()==Ya.ERROR){continue}p=x.getReplayGroup(a,z.tileCoord.toString());c=c||p.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=Oh.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null)}}return c};Xf.prototype.getReplayTransform_=function(t,i){var s=this.getLayer();var e=s.getSource();var r=e.getTileGrid();var n=t.tileCoord;var h=r.getResolution(n[0]);var a=i.viewState;var o=i.pixelRatio;var f=a.resolution/o;var u=r.getTileCoordExtent(n,this.tmpExtent);var l=a.center;var v=Zh.getTopLeft(u);var c=i.size;var d=Math.round(o*c[0]/2);var m=Math.round(o*c[1]/2);return oa.compose(this.tmpTransform_,d,m,h/f,h/f,a.rotation,(v[0]-l[0])/h,(l[1]-v[1])/h)};Xf.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.renderedLayerRevision_!==undefined){i.changed()}};Xf.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Xf.prototype.postCompose=function(t,i,s){var e=this.getLayer();var r=e.getDeclutter()?{}:null;var n=e.getSource();var h=e.getRenderMode();var a=Xf.VECTOR_REPLAYS[h];var o=i.pixelRatio;var f=i.viewState.rotation;var u=i.size;var l,v;if(f){l=Math.round(o*u[0]/2);v=Math.round(o*u[1]/2);Ho.rotateAtOffset(t,-f,l,v)}if(r){this.declutterTree_.clear()}var c=this.renderedTiles;var d=n.getTileGridForProjection(i.viewState.projection);var m=[];var p=[];for(var z=c.length-1;z>=0;--z){var M=c[z];if(M.getState()==Ya.ABORT){continue}var _=M.tileCoord;var g=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(M.wrappedTileCoord)[0];var b=undefined;for(var x=0,w=M.tileKeys.length;x<w;++x){var y=M.getTile(M.tileKeys[x]);if(y.getState()==Ya.ERROR){continue}var k=y.getReplayGroup(e,_.toString());if(h!=qf.VECTOR&&!k.hasReplays(a)){continue}if(!b){b=this.getTransform(i,g)}var E=y.tileCoord[0];var N=k.getClipCoords(b);t.save();t.globalAlpha=s.opacity;for(var C=0,I=m.length;C<I;++C){var S=m[C];if(E<p[C]){t.beginPath();t.moveTo(N[0],N[1]);t.lineTo(N[2],N[3]);t.lineTo(N[4],N[5]);t.lineTo(N[6],N[7]);t.moveTo(S[6],S[7]);t.lineTo(S[4],S[5]);t.lineTo(S[2],S[3]);t.lineTo(S[0],S[1]);t.clip()}}k.replay(t,b,f,{},a,r);t.restore();m.push(N);p.push(E)}}if(r){jf.replayDeclutter(r,t,f)}if(f){Ho.rotateAtOffset(t,f,l,v)}ff.prototype.postCompose.apply(this,arguments)};Xf.prototype.renderFeature=function(t,i,s,e){if(!s){return false}var r=false;if(Array.isArray(s)){for(var n=0,h=s.length;n<h;++n){r=Vf.renderFeature(e,t,s[n],i,this.handleStyleImageChange_,this)||r}}else{r=Vf.renderFeature(e,t,s,i,this.handleStyleImageChange_,this)}return r};Xf.prototype.renderTileImage_=function(t,i,s){var e=this.getLayer();var r=t.getReplayState(e);var n=e.getRevision();var h=Xf.IMAGE_REPLAYS[e.getRenderMode()];if(h&&r.renderedTileRevision!==n){r.renderedTileRevision=n;var a=t.wrappedTileCoord;var o=a[0];var f=i.pixelRatio;var u=e.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v=l.getResolution(o);var c=t.getContext(e);var d=u.getTilePixelSize(o,f,i.viewState.projection);c.canvas.width=d[0];c.canvas.height=d[1];var m=l.getTileCoordExtent(a);for(var p=0,z=t.tileKeys.length;p<z;++p){var M=t.getTile(t.tileKeys[p]);if(M.getState()==Ya.ERROR){continue}var _=f/v;var g=oa.reset(this.tmpTransform_);oa.scale(g,_,-_);oa.translate(g,-m[0],-m[3]);var b=M.getReplayGroup(e,t.tileCoord.toString());b.replay(c,g,0,{},h)}}};var Yf=function(t){this.source_=t};Yf.prototype.getType=function(){};Yf.prototype.getSource=function(){return this.source_};Yf.prototype.isAnimated=Kh.FALSE;var Bf=function(t){Yf.call(this,t)};Oh.inherits(Bf,Yf);Bf.prototype.getType=function(){return ka.FRAGMENT_SHADER};var Hf=function(t){Yf.call(this,t)};Oh.inherits(Hf,Yf);Hf.prototype.getType=function(){return ka.VERTEX_SHADER};var Jf={};Jf.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}");Jf.vertex=new Hf(Oh.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Zf=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_pixelRatio=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_pixelRatio":"l");this.u_opacity=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_opacity":"m");this.u_fillColor=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_fillColor":"n");this.u_strokeColor=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_strokeColor":"o");this.u_size=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_size":"p");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"e");this.a_instruction=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_instruction":"f");this.a_radius=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_radius":"g")};var $f={};$f.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};$f.fromTransform=function(t,i){t[0]=i[0];t[1]=i[1];t[4]=i[2];t[5]=i[3];t[12]=i[4];t[13]=i[5];return t};var Kf=function(t,i){$o.call(this);this.tolerance=t;this.maxExtent=i;this.origin=Zh.getCenter(i);this.projectionMatrix_=oa.create();this.offsetRotateMatrix_=oa.create();this.offsetScaleMatrix_=oa.create();this.tmpMat4_=$f.create();this.indices=[];this.indicesBuffer=null;this.startIndices=[];this.startIndicesFeature=[];this.vertices=[];this.verticesBuffer=null;this.lineStringReplay=undefined};Oh.inherits(Kf,$o);Kf.prototype.getDeleteResourcesFunction=function(t){};Kf.prototype.finish=function(t){};Kf.prototype.setUpProgram=function(t,i,s,e){};Kf.prototype.shutDownProgram=function(t,i){};Kf.prototype.drawReplay=function(t,i,s,e){};Kf.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){};Kf.prototype.drawHitDetectionReplay=function(t,i,s,e,r,n){if(!r){return this.drawHitDetectionReplayAll(t,i,s,e)}else{return this.drawHitDetectionReplayOneByOne(t,i,s,e,n)}};Kf.prototype.drawHitDetectionReplayAll=function(t,i,s,e){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawReplay(t,i,s,true);var r=e(null);if(r){return r}else{return undefined}};Kf.prototype.replay=function(t,i,s,e,r,n,h,a,o,f,u){var l=t.getGL();var v,c,d,m,p,z,M,_;if(this.lineStringReplay){v=l.isEnabled(l.STENCIL_TEST);c=l.getParameter(l.STENCIL_FUNC);d=l.getParameter(l.STENCIL_VALUE_MASK);m=l.getParameter(l.STENCIL_REF);p=l.getParameter(l.STENCIL_WRITEMASK);z=l.getParameter(l.STENCIL_FAIL);M=l.getParameter(l.STENCIL_PASS_DEPTH_PASS);_=l.getParameter(l.STENCIL_PASS_DEPTH_FAIL);l.enable(l.STENCIL_TEST);l.clear(l.STENCIL_BUFFER_BIT);l.stencilMask(255);l.stencilFunc(l.ALWAYS,1,255);l.stencilOp(l.KEEP,l.KEEP,l.REPLACE);this.lineStringReplay.replay(t,i,s,e,r,n,h,a,o,f,u);l.stencilMask(0);l.stencilFunc(l.NOTEQUAL,1,255)}t.bindBuffer(ka.ARRAY_BUFFER,this.verticesBuffer);t.bindBuffer(ka.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var g=this.setUpProgram(l,t,r,n);var b=oa.reset(this.projectionMatrix_);oa.scale(b,2/(s*r[0]),2/(s*r[1]));oa.rotate(b,-e);oa.translate(b,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var x=oa.reset(this.offsetScaleMatrix_);oa.scale(x,2/r[0],2/r[1]);var w=oa.reset(this.offsetRotateMatrix_);if(e!==0){oa.rotate(w,-e)}l.uniformMatrix4fv(g.u_projectionMatrix,false,$f.fromTransform(this.tmpMat4_,b));l.uniformMatrix4fv(g.u_offsetScaleMatrix,false,$f.fromTransform(this.tmpMat4_,x));l.uniformMatrix4fv(g.u_offsetRotateMatrix,false,$f.fromTransform(this.tmpMat4_,w));l.uniform1f(g.u_opacity,h);var y;if(o===undefined){this.drawReplay(l,t,a,false)}else{y=this.drawHitDetectionReplay(l,t,a,o,f,u)}this.shutDownProgram(l,g);if(this.lineStringReplay){if(!v){l.disable(l.STENCIL_TEST)}l.clear(l.STENCIL_BUFFER_BIT);l.stencilFunc(c,m,d);l.stencilMask(p);l.stencilOp(z,_,M)}return y};Kf.prototype.drawElements=function(t,i,s,e){var r=i.hasOESElementIndexUint?ka.UNSIGNED_INT:ka.UNSIGNED_SHORT;var n=i.hasOESElementIndexUint?4:2;var h=e-s;var a=s*n;t.drawElements(ka.TRIANGLES,h,r,a)};var Qf={};Qf.defaultFont="10px sans-serif";Qf.defaultFillStyle=[0,0,0,1];Qf.defaultLineCap="round";Qf.defaultLineDash=[];Qf.defaultLineDashOffset=0;Qf.defaultLineJoin="round";Qf.defaultMiterLimit=10;Qf.defaultStrokeStyle=[0,0,0,1];Qf.defaultTextAlign=.5;Qf.defaultTextBaseline=.5;Qf.defaultLineWidth=1;Qf.triangleIsCounterClockwise=function(t,i,s,e,r,n){var h=(s-t)*(n-i)-(r-t)*(e-i);return h<=Qf.EPSILON&&h>=-Qf.EPSILON?undefined:h>0};Qf.EPSILON=Number.EPSILON||2220446049250313e-31;var tu=function(t,i){this.arr_=t!==undefined?t:[];this.usage_=i!==undefined?i:tu.Usage_.STATIC_DRAW};tu.prototype.getArray=function(){return this.arr_};tu.prototype.getUsage=function(){return this.usage_};tu.Usage_={STATIC_DRAW:ka.STATIC_DRAW,STREAM_DRAW:ka.STREAM_DRAW,DYNAMIC_DRAW:ka.DYNAMIC_DRAW};var iu=function(t,i){Kf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.radius_=0;this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:undefined,lineWidth:undefined,changed:false}};Oh.inherits(iu,Kf);iu.prototype.drawCoordinates_=function(t,i,s,e){var r=this.vertices.length;var n=this.indices.length;var h=r/4;var a,o;for(a=i,o=s;a<o;a+=e){this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=0;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=1;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=2;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=3;this.vertices[r++]=this.radius_;this.indices[n++]=h;this.indices[n++]=h+1;this.indices[n++]=h+2;this.indices[n++]=h+2;this.indices[n++]=h+3;this.indices[n++]=h;h+=4}};iu.prototype.drawCircle=function(t,i){var s=t.getRadius();var e=t.getStride();if(s){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.radius_=s;var r=t.getFlatCoordinates();r=Qh.translate(r,0,2,e,-this.origin[0],-this.origin[1]);this.drawCoordinates_(r,0,2,e)}else{if(this.state_.changed){this.styles_.pop();if(this.styles_.length){var n=this.styles_[this.styles_.length-1];this.state_.fillColor=n[0];this.state_.strokeColor=n[1];this.state_.lineWidth=n[2];this.state_.changed=false}}}};iu.prototype.finish=function(t){this.verticesBuffer=new tu(this.vertices);this.indicesBuffer=new tu(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};iu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};iu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Jf.fragment;n=Jf.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Zf(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,ka.FLOAT,false,16,0);t.enableVertexAttribArray(a.a_instruction);t.vertexAttribPointer(a.a_instruction,1,ka.FLOAT,false,16,8);t.enableVertexAttribArray(a.a_radius);t.vertexAttribPointer(a.a_radius,1,ka.FLOAT,false,16,12);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};iu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_instruction);t.disableVertexAttribArray(i.a_radius)};iu.prototype.drawReplay=function(t,i,s,e){if(!Rh.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var r,n,h,a;h=this.startIndices[this.startIndices.length-1];for(r=this.styleIndices_.length-1;r>=0;--r){n=this.styleIndices_[r];a=this.styles_[r];this.setFillStyle_(t,a[0]);this.setStrokeStyle_(t,a[1],a[2]);this.drawElements(t,i,n,h);h=n}}};iu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o[0]);this.setStrokeStyle_(t,o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=Oh.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Zh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};iu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h[0]);this.setStrokeStyle_(t,h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=Oh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n)}r=n=a}};iu.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)};iu.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s)};iu.prototype.setFillStrokeStyle=function(t,i){var s,e;if(i){var r=i.getLineDash();this.state_.lineDash=r?r:Qf.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n?n:Qf.defaultLineDashOffset;s=i.getColor();if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Jo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Qf.defaultStrokeStyle}else{s=Qf.defaultStrokeStyle}e=i.getWidth();e=e!==undefined?e:Qf.defaultLineWidth}else{s=[0,0,0,0];e=0}var h=t?t.getColor():[0,0,0,0];if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Jo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Qf.defaultFillStyle}else{h=Qf.defaultFillStyle}if(!this.state_.strokeColor||!Bh.equals(this.state_.strokeColor,s)||!this.state_.fillColor||!Bh.equals(this.state_.fillColor,h)||this.state_.lineWidth!==e){this.state_.changed=true;this.state_.fillColor=h;this.state_.strokeColor=s;this.state_.lineWidth=e;this.styles_.push([h,s,e])}};var su={};su.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");su.vertex=new Hf(Oh.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var eu=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_opacity=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_opacity":"k");this.u_image=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_image":"l");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"c");this.a_texCoord=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_texCoord":"d");this.a_offsets=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_offsets":"e");this.a_opacity=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_opacity":"f");this.a_rotateWithView=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_rotateWithView":"g")};var ru={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var nu=function(t,i){this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=Bh.includes(Oh.WEBGL_EXTENSIONS,"OES_element_index_uint");if(this.hasOESElementIndexUint){i.getExtension("OES_element_index_uint")}Ph.listen(this.canvas_,ru.LOST,this.handleWebGLContextLost,this);Ph.listen(this.canvas_,ru.RESTORED,this.handleWebGLContextRestored,this)};Oh.inherits(nu,Lh);nu.prototype.bindBuffer=function(t,i){var s=this.getGL();var e=i.getArray();var r=String(Oh.getUid(i));if(r in this.bufferCache_){var n=this.bufferCache_[r];s.bindBuffer(t,n.buffer)}else{var h=s.createBuffer();s.bindBuffer(t,h);var a;if(t==ka.ARRAY_BUFFER){a=new Float32Array(e)}else if(t==ka.ELEMENT_ARRAY_BUFFER){a=this.hasOESElementIndexUint?new Uint32Array(e):new Uint16Array(e)}s.bufferData(t,a,i.getUsage());this.bufferCache_[r]={buf:i,buffer:h}}};nu.prototype.deleteBuffer=function(t){var i=this.getGL();var s=String(Oh.getUid(t));var e=this.bufferCache_[s];if(!i.isContextLost()){i.deleteBuffer(e.buffer)}delete this.bufferCache_[s]};nu.prototype.disposeInternal=function(){Ph.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_){t.deleteBuffer(this.bufferCache_[i].buffer)}for(i in this.programCache_){t.deleteProgram(this.programCache_[i])}for(i in this.shaderCache_){t.deleteShader(this.shaderCache_[i])}t.deleteFramebuffer(this.hitDetectionFramebuffer_);t.deleteRenderbuffer(this.hitDetectionRenderbuffer_);t.deleteTexture(this.hitDetectionTexture_)}};nu.prototype.getCanvas=function(){return this.canvas_};nu.prototype.getGL=function(){return this.gl_};nu.prototype.getHitDetectionFramebuffer=function(){if(!this.hitDetectionFramebuffer_){this.initHitDetectionFramebuffer_()}return this.hitDetectionFramebuffer_};nu.prototype.getShader=function(t){var i=String(Oh.getUid(t));if(i in this.shaderCache_){return this.shaderCache_[i]}else{var s=this.getGL();var e=s.createShader(t.getType());s.shaderSource(e,t.getSource());s.compileShader(e);this.shaderCache_[i]=e;return e}};nu.prototype.getProgram=function(t,i){var s=Oh.getUid(t)+"/"+Oh.getUid(i);if(s in this.programCache_){return this.programCache_[s]}else{var e=this.getGL();var r=e.createProgram();e.attachShader(r,this.getShader(t));e.attachShader(r,this.getShader(i));e.linkProgram(r);this.programCache_[s]=r;return r}};nu.prototype.handleWebGLContextLost=function(){Rh.clear(this.bufferCache_);Rh.clear(this.shaderCache_);Rh.clear(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null};nu.prototype.handleWebGLContextRestored=function(){};nu.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_;var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=nu.createEmptyTexture(t,1,1);var e=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e);t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);t.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=i;this.hitDetectionTexture_=s;this.hitDetectionRenderbuffer_=e};nu.prototype.useProgram=function(t){if(t==this.currentProgram_){return false}else{var i=this.getGL();i.useProgram(t);this.currentProgram_=t;return true}};nu.createTexture_=function(t,i,s){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);if(i!==undefined){t.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_WRAP_S,i)}if(s!==undefined){t.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_WRAP_T,s)}return e};nu.createEmptyTexture=function(t,i,s,e,r){var n=nu.createTexture_(t,e,r);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null);return n};nu.createTexture=function(t,i,s,e){var r=nu.createTexture_(t,s,e);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i);return r};var hu=function(t,i){Kf.call(this,t,i);this.anchorX=undefined;this.anchorY=undefined;this.groupIndices=[];this.hitDetectionGroupIndices=[];this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.defaultLocations=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.width=undefined};Oh.inherits(hu,Kf);hu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.getTextures(true);var r=t.getGL();return function(){if(!r.isContextLost()){var n,h;for(n=0,h=e.length;n<h;++n){r.deleteTexture(e[n])}}t.deleteBuffer(i);t.deleteBuffer(s)}};hu.prototype.drawCoordinates=function(t,i,s,e){var r=this.anchorX;var n=this.anchorY;var h=this.height;var a=this.imageHeight;var o=this.imageWidth;var f=this.opacity;var u=this.originX;var l=this.originY;var v=this.rotateWithView?1:0;var c=-this.rotation;var d=this.scale;var m=this.width;var p=Math.cos(c);var z=Math.sin(c);var M=this.indices.length;var _=this.vertices.length;var g,b,x,w,y,k;for(g=i;g<s;g+=e){y=t[g]-this.origin[0];k=t[g+1]-this.origin[1];b=_/8;x=-d*r;w=-d*(h-n);this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=u/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);w=-d*(h-n);this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);w=d*n;this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;x=-d*r;w=d*n;this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=u/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;this.indices[M++]=b;this.indices[M++]=b+1;this.indices[M++]=b+2;this.indices[M++]=b;this.indices[M++]=b+2;this.indices[M++]=b+3}return _};hu.prototype.createTextures=function(t,i,s,e){var r,n,h,a;var o=i.length;for(a=0;a<o;++a){n=i[a];h=Oh.getUid(n).toString();if(h in s){r=s[h]}else{r=nu.createTexture(e,n,ka.CLAMP_TO_EDGE,ka.CLAMP_TO_EDGE);s[h]=r}t[a]=r}};hu.prototype.setUpProgram=function(t,i,s,e){var r=su.fragment;var n=su.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations){a=new eu(t,h);this.defaultLocations=a}else{a=this.defaultLocations}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,ka.FLOAT,false,32,0);t.enableVertexAttribArray(a.a_offsets);t.vertexAttribPointer(a.a_offsets,2,ka.FLOAT,false,32,8);t.enableVertexAttribArray(a.a_texCoord);t.vertexAttribPointer(a.a_texCoord,2,ka.FLOAT,false,32,16);t.enableVertexAttribArray(a.a_opacity);t.vertexAttribPointer(a.a_opacity,1,ka.FLOAT,false,32,24);t.enableVertexAttribArray(a.a_rotateWithView);t.vertexAttribPointer(a.a_rotateWithView,1,ka.FLOAT,false,32,28);return a};hu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_offsets);t.disableVertexAttribArray(i.a_texCoord);t.disableVertexAttribArray(i.a_opacity);t.disableVertexAttribArray(i.a_rotateWithView)};hu.prototype.drawReplay=function(t,i,s,e){var r=e?this.getHitDetectionTextures():this.getTextures();var n=e?this.hitDetectionGroupIndices:this.groupIndices;if(!Rh.isEmpty(s)){this.drawReplaySkipping(t,i,s,r,n)}else{var h,a,o;for(h=0,a=r.length,o=0;h<a;++h){t.bindTexture(ka.TEXTURE_2D,r[h]);var f=n[h];this.drawElements(t,i,o,f);o=f}}};hu.prototype.drawReplaySkipping=function(t,i,s,e,r){var n=0;var h,a;for(h=0,a=e.length;h<a;++h){t.bindTexture(ka.TEXTURE_2D,e[h]);var o=h>0?r[h-1]:0;var f=r[h];var u=o;var l=o;while(n<this.startIndices.length&&this.startIndices[n]<=f){var v=this.startIndicesFeature[n];var c=Oh.getUid(v).toString();if(s[c]!==undefined){if(u!==l){this.drawElements(t,i,u,l)}u=n===this.startIndices.length-1?f:this.startIndices[n+1];l=u}else{l=n===this.startIndices.length-1?f:this.startIndices[n+1]}n++}if(u!==l){this.drawElements(t,i,u,l)}}};hu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u;var l=this.startIndices.length-1;var v=this.getHitDetectionTextures();for(n=v.length-1;n>=0;--n){t.bindTexture(ka.TEXTURE_2D,v[n]);h=n>0?this.hitDetectionGroupIndices[n-1]:0;o=this.hitDetectionGroupIndices[n];while(l>=0&&this.startIndices[l]>=h){a=this.startIndices[l];f=this.startIndicesFeature[l];u=Oh.getUid(f).toString();if(s[u]===undefined&&f.getGeometry()&&(r===undefined||Zh.intersects(r,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,a,o);var c=e(f);if(c){return c}}o=a;l--}}return undefined};hu.prototype.finish=function(t){this.anchorX=undefined;this.anchorY=undefined;this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.indices=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.vertices=null;this.width=undefined};hu.prototype.getTextures=function(t){};hu.prototype.getHitDetectionTextures=function(){};var au=function(t,i){hu.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]};Oh.inherits(au,hu);au.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};au.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};au.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new tu(this.vertices);var s=this.indices;this.indicesBuffer=new tu(s);var e={};this.createTextures(this.textures_,this.images_,e,i);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,e,i);this.images_=null;this.hitDetectionImages_=null;hu.prototype.finish.call(this,t)};au.prototype.setImageStyle=function(t){var i=t.getAnchor();var s=t.getImage(1);var e=t.getImageSize();var r=t.getHitDetectionImage(1);var n=t.getOpacity();var h=t.getOrigin();var a=t.getRotateWithView();var o=t.getRotation();var f=t.getSize();var u=t.getScale();var l;if(this.images_.length===0){this.images_.push(s)}else{l=this.images_[this.images_.length-1];if(Oh.getUid(l)!=Oh.getUid(s)){this.groupIndices.push(this.indices.length);this.images_.push(s)}}if(this.hitDetectionImages_.length===0){this.hitDetectionImages_.push(r)}else{l=this.hitDetectionImages_[this.hitDetectionImages_.length-1];if(Oh.getUid(l)!=Oh.getUid(r)){this.hitDetectionGroupIndices.push(this.indices.length);this.hitDetectionImages_.push(r)}}this.anchorX=i[0];this.anchorY=i[1];this.height=f[1];this.imageHeight=e[1];this.imageWidth=e[0];this.opacity=n;this.originX=h[0];this.originY=h[1];this.rotation=o;this.rotateWithView=a;this.scale=u;this.width=f[0]};au.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_};au.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var ou={};ou.lineStringIsClosed=function(t,i,s,e){var r=s-e;if(t[i]===t[r]&&t[i+1]===t[r+1]&&(s-i)/e>3){return!!la.linearRing(t,i,s,e)}return false};var fu={};fu.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");fu.vertex=new Hf(Oh.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var uu=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_lineWidth":"k");this.u_miterLimit=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_miterLimit":"l");this.u_opacity=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_opacity":"m");this.u_color=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_color":"n");this.u_size=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_size":"o");this.u_pixelRatio=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_pixelRatio":"p");this.a_lastPos=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_lastPos":"d");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"e");this.a_nextPos=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_nextPos":"f");this.a_direction=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_direction":"g")};var lu=function(t,i){Kf.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:undefined,miterLimit:undefined,changed:false}};Oh.inherits(lu,Kf);lu.prototype.drawCoordinates_=function(t,i,s,e){var r,n;var h=this.vertices.length;var a=this.indices.length;var o=this.state_.lineJoin==="bevel"?0:this.state_.lineJoin==="miter"?1:2;var f=this.state_.lineCap==="butt"?0:this.state_.lineCap==="square"?1:2;var u=ou.lineStringIsClosed(t,i,s,e);var l,v,c;var d=a;var m=1;var p,z,M;for(r=i,n=s;r<n;r+=e){c=h/7;p=z;z=M||[t[r],t[r+1]];if(r===i){M=[t[r+e],t[r+e+1]];if(s-i===e*2&&Bh.equals(z,M)){break}if(u){p=[t[s-e*2],t[s-e*2+1]];l=M}else{if(f){h=this.addVertices_([0,0],z,M,m*lu.Instruction_.BEGIN_LINE_CAP*f,h);h=this.addVertices_([0,0],z,M,-m*lu.Instruction_.BEGIN_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}h=this.addVertices_([0,0],z,M,m*lu.Instruction_.BEGIN_LINE*(f||1),h);h=this.addVertices_([0,0],z,M,-m*lu.Instruction_.BEGIN_LINE*(f||1),h);d=h/7-1;continue}}else if(r===s-e){if(u){M=l;break}else{p=p||[0,0];h=this.addVertices_(p,z,[0,0],m*lu.Instruction_.END_LINE*(f||1),h);h=this.addVertices_(p,z,[0,0],-m*lu.Instruction_.END_LINE*(f||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;if(f){h=this.addVertices_(p,z,[0,0],m*lu.Instruction_.END_LINE_CAP*f,h);h=this.addVertices_(p,z,[0,0],-m*lu.Instruction_.END_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}break}}else{M=[t[r+e],t[r+e+1]]}v=Qf.triangleIsCounterClockwise(p[0],p[1],z[0],z[1],M[0],M[1])?-1:1;h=this.addVertices_(p,z,M,v*lu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,v*lu.Instruction_.BEVEL_SECOND*(o||1),h);h=this.addVertices_(p,z,M,-v*lu.Instruction_.MITER_BOTTOM*(o||1),h);if(r>i){this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}this.indices[a++]=c;this.indices[a++]=c+2;this.indices[a++]=c+1;d=c+2;m=v;if(o){h=this.addVertices_(p,z,M,v*lu.Instruction_.MITER_TOP*o,h);this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c}}if(u){c=c||h/7;v=wa.linearRingIsClockwise([p[0],p[1],z[0],z[1],M[0],M[1]],0,6,2)?1:-1;h=this.addVertices_(p,z,M,v*lu.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,-v*lu.Instruction_.MITER_BOTTOM*(o||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}};lu.prototype.addVertices_=function(t,i,s,e,r){this.vertices[r++]=t[0];this.vertices[r++]=t[1];this.vertices[r++]=i[0];this.vertices[r++]=i[1];this.vertices[r++]=s[0];this.vertices[r++]=s[1];this.vertices[r++]=e;return r};lu.prototype.isValid_=function(t,i,s,e){var r=s-i;if(r<e*2){return false}else if(r===e*2){var n=[t[i],t[i+1]];var h=[t[i+e],t[i+e+1]];return!Bh.equals(n,h)}return true};lu.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates();var e=t.getStride();if(this.isValid_(s,0,s.length,e)){s=Qh.translate(s,0,s.length,e,-this.origin[0],-this.origin[1]);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);this.drawCoordinates_(s,0,s.length,e)}};lu.prototype.drawMultiLineString=function(t,i){var s=this.indices.length;var e=t.getEnds();e.unshift(0);var r=t.getFlatCoordinates();var n=t.getStride();var h,a;if(e.length>1){for(h=1,a=e.length;h<a;++h){if(this.isValid_(r,e[h-1],e[h],n)){var o=Qh.translate(r,e[h-1],e[h],n,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,n)}}}if(this.indices.length>s){this.startIndices.push(s);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}}};lu.prototype.drawPolygonCoordinates=function(t,i,s){if(!ou.lineStringIsClosed(t,0,t.length,s)){t.push(t[0]);t.push(t[1])}this.drawCoordinates_(t,0,t.length,s);if(i.length){var e,r;for(e=0,r=i.length;e<r;++e){if(!ou.lineStringIsClosed(i[e],0,i[e].length,s)){i[e].push(i[e][0]);i[e].push(i[e][1])}this.drawCoordinates_(i[e],0,i[e].length,s)}}};lu.prototype.setPolygonStyle=function(t,i){var s=i===undefined?this.indices.length:i;this.startIndices.push(s);this.startIndicesFeature.push(t);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}};lu.prototype.getCurrentIndex=function(){return this.indices.length};lu.prototype.finish=function(t){this.verticesBuffer=new tu(this.vertices);this.indicesBuffer=new tu(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};lu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};lu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=fu.fragment;n=fu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new uu(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_lastPos);t.vertexAttribPointer(a.a_lastPos,2,ka.FLOAT,false,28,0);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,ka.FLOAT,false,28,8);t.enableVertexAttribArray(a.a_nextPos);t.vertexAttribPointer(a.a_nextPos,2,ka.FLOAT,false,28,16);t.enableVertexAttribArray(a.a_direction);t.vertexAttribPointer(a.a_direction,1,ka.FLOAT,false,28,24);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};lu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos);t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_nextPos);t.disableVertexAttribArray(i.a_direction)};lu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Rh.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setStrokeStyle_(t,f[0],f[1],f[2]);this.drawElements(t,i,a,o);t.clear(t.DEPTH_BUFFER_BIT);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};lu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setStrokeStyle_(t,h[0],h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=Oh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};lu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setStrokeStyle_(t,o[0],o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=Oh.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Zh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};lu.prototype.setStrokeStyle_=function(t,i,s,e){t.uniform4fv(this.defaultLocations_.u_color,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s);t.uniform1f(this.defaultLocations_.u_miterLimit,e)};lu.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=s!==undefined?s:Qf.defaultLineCap;var e=i.getLineDash();this.state_.lineDash=e?e:Qf.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r?r:Qf.defaultLineDashOffset;var n=i.getLineJoin();this.state_.lineJoin=n!==undefined?n:Qf.defaultLineJoin;var h=i.getColor();if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Jo.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Qf.defaultStrokeStyle}else{h=Qf.defaultStrokeStyle}var a=i.getWidth();a=a!==undefined?a:Qf.defaultLineWidth;var o=i.getMiterLimit();o=o!==undefined?o:Qf.defaultMiterLimit;if(!this.state_.strokeColor||!Bh.equals(this.state_.strokeColor,h)||this.state_.lineWidth!==a||this.state_.miterLimit!==o){this.state_.changed=true;this.state_.strokeColor=h;this.state_.lineWidth=a;this.state_.miterLimit=o;this.styles_.push([h,a,o])}};lu.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var vu={};vu.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");vu.vertex=new Hf(Oh.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var cu=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_projectionMatrix":"b");this.u_offsetScaleMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetScaleMatrix":"c");this.u_offsetRotateMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_offsetRotateMatrix":"d");this.u_color=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_color":"e");this.u_opacity=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_opacity":"f");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"a")};var du=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.lineCap_=i.lineCap;this.lineDash_=i.lineDash!==undefined?i.lineDash:null;this.lineDashOffset_=i.lineDashOffset;this.lineJoin_=i.lineJoin;this.miterLimit_=i.miterLimit;this.width_=i.width;this.checksum_=undefined};du.prototype.clone=function(){var t=this.getColor();return new du({color:t&&t.slice?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})};du.prototype.getColor=function(){return this.color_};du.prototype.getLineCap=function(){return this.lineCap_};du.prototype.getLineDash=function(){return this.lineDash_};du.prototype.getLineDashOffset=function(){return this.lineDashOffset_};du.prototype.getLineJoin=function(){return this.lineJoin_};du.prototype.getMiterLimit=function(){return this.miterLimit_};du.prototype.getWidth=function(){return this.width_};du.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};du.prototype.setLineCap=function(t){this.lineCap_=t;this.checksum_=undefined};du.prototype.setLineDash=function(t){this.lineDash_=t;this.checksum_=undefined};du.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t;this.checksum_=undefined};du.prototype.setLineJoin=function(t){this.lineJoin_=t;this.checksum_=undefined};du.prototype.setMiterLimit=function(t){this.miterLimit_=t;this.checksum_=undefined};du.prototype.setWidth=function(t){this.width_=t;this.checksum_=undefined};du.prototype.getChecksum=function(){if(this.checksum_===undefined){this.checksum_="s";if(this.color_){if(typeof this.color_==="string"){this.checksum_+=this.color_}else{this.checksum_+=Oh.getUid(this.color_).toString()}}else{this.checksum_+="-"}this.checksum_+=","+(this.lineCap_!==undefined?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(this.lineDashOffset_!==undefined?this.lineDashOffset_:"-")+","+(this.lineJoin_!==undefined?this.lineJoin_:"-")+","+(this.miterLimit_!==undefined?this.miterLimit_.toString():"-")+","+(this.width_!==undefined?this.width_.toString():"-")}return this.checksum_};var mu=function(t){this.first_=undefined;this.last_=undefined;this.head_=undefined;this.circular_=t===undefined?true:t;this.length_=0};mu.prototype.insertItem=function(t){var i={prev:undefined,next:undefined,data:t};var s=this.head_;if(!s){this.first_=i;this.last_=i;if(this.circular_){i.next=i;i.prev=i}}else{var e=s.next;i.prev=s;i.next=e;s.next=i;if(e){e.prev=i}if(s===this.last_){this.last_=i}}this.head_=i;this.length_++};mu.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next;var s=t.prev;if(i){i.prev=s}if(s){s.next=i}this.head_=i||s;if(this.first_===this.last_){this.head_=undefined;this.first_=undefined;this.last_=undefined}else if(this.first_===t){this.first_=this.head_}else if(this.last_===t){this.last_=s?this.head_.prev:this.head_}this.length_--}};mu.prototype.firstItem=function(){this.head_=this.first_;if(this.head_){return this.head_.data}return undefined};mu.prototype.lastItem=function(){this.head_=this.last_;if(this.head_){return this.head_.data}return undefined};mu.prototype.nextItem=function(){if(this.head_&&this.head_.next){this.head_=this.head_.next;return this.head_.data}return undefined};mu.prototype.getNextItem=function(){if(this.head_&&this.head_.next){return this.head_.next.data}return undefined};mu.prototype.prevItem=function(){if(this.head_&&this.head_.prev){this.head_=this.head_.prev;return this.head_.data}return undefined};mu.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev){return this.head_.prev.data}return undefined};mu.prototype.getCurrItem=function(){if(this.head_){return this.head_.data}return undefined};mu.prototype.setFirstItem=function(){if(this.circular_&&this.head_){this.first_=this.head_;this.last_=this.head_.prev}};mu.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_;t.first_.prev=this.head_;i.prev=t.last_;t.last_.next=i;this.length_+=t.length_}else{this.head_=t.head_;this.first_=t.first_;this.last_=t.last_;this.length_=t.length_}t.head_=undefined;t.first_=undefined;t.last_=undefined;t.length_=0}};mu.prototype.getLength=function(){return this.length_};var pu=function(t){this.rbush_=lf(t);this.items_={}};pu.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s);this.items_[Oh.getUid(i)]=s};pu.prototype.load=function(t,i){var s=new Array(i.length);for(var e=0,r=i.length;e<r;e++){var n=t[e];var h=i[e];var a={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:h};s[e]=a;this.items_[Oh.getUid(h)]=a}this.rbush_.load(s)};pu.prototype.remove=function(t){var i=Oh.getUid(t);var s=this.items_[i];delete this.items_[i];return this.rbush_.remove(s)!==null};pu.prototype.update=function(t,i){var s=this.items_[Oh.getUid(i)];var e=[s.minX,s.minY,s.maxX,s.maxY];if(!Zh.equals(e,t)){this.remove(i);this.insert(t,i)}};pu.prototype.getAll=function(){var t=this.rbush_.all();return t.map((function(t){return t.value}))};pu.prototype.getInExtent=function(t){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};var s=this.rbush_.search(i);return s.map((function(t){return t.value}))};pu.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)};pu.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)};pu.prototype.forEach_=function(t,i,s){var e;for(var r=0,n=t.length;r<n;r++){e=i.call(s,t[r]);if(e){return e}}return e};pu.prototype.isEmpty=function(){return Rh.isEmpty(this.items_)};pu.prototype.clear=function(){this.rbush_.clear();this.items_={}};pu.prototype.getExtent=function(t){var i=this.rbush_.data;return Zh.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)};pu.prototype.concat=function(t){this.rbush_.load(t.rbush_.all());for(var i in t.items_){this.items_[i|0]=t.items_[i|0]}};var zu=function(t,i){Kf.call(this,t,i);this.lineStringReplay=new lu(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:false}};Oh.inherits(zu,Kf);zu.prototype.drawCoordinates_=function(t,i,s){var e=new mu;var r=new pu;this.processFlatCoordinates_(t,s,e,r,true);var n=this.getMaxCoords_(e);if(i.length){var h,a;var o=[];for(h=0,a=i.length;h<a;++h){var f={list:new mu,maxCoords:undefined,rtree:new pu};o.push(f);this.processFlatCoordinates_(i[h],s,f.list,f.rtree,false);this.classifyPoints_(f.list,f.rtree,true);f.maxCoords=this.getMaxCoords_(f.list)}o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]}));for(h=0;h<o.length;++h){var u=o[h].list;var l=u.firstItem();var v=l;var c;do{if(this.getIntersections_(v,r).length){c=true;break}v=u.nextItem()}while(l!==v);if(!c){if(this.bridgeHole_(u,o[h].maxCoords[0],e,n[0],r)){r.concat(o[h].rtree);this.classifyPoints_(e,r,false)}}}}else{this.classifyPoints_(e,r,false)}this.triangulate_(e,r)};zu.prototype.processFlatCoordinates_=function(t,i,s,e,r){var n=wa.linearRingIsClockwise(t,0,t.length,i);var h,a;var o=this.vertices.length/2;var f;var u;var l;var v=[];var c=[];if(r===n){f=this.createPoint_(t[0],t[1],o++);u=f;for(h=i,a=t.length;h<a;h+=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}else{var d=t.length-i;f=this.createPoint_(t[d],t[d+1],o++);u=f;for(h=d-i,a=0;h>=a;h-=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}e.load(v,c)};zu.prototype.getMaxCoords_=function(t){var i=t.firstItem();var s=i;var e=[s.p0.x,s.p0.y];do{s=t.nextItem();if(s.p0.x>e[0]){e=[s.p0.x,s.p0.y]}}while(s!==i);return e};zu.prototype.classifyPoints_=function(t,i,s){var e=t.firstItem();var r=e;var n=t.nextItem();var h=false;do{var a=s?Qf.triangleIsCounterClockwise(n.p1.x,n.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):Qf.triangleIsCounterClockwise(r.p0.x,r.p0.y,r.p1.x,r.p1.y,n.p1.x,n.p1.y);if(a===undefined){this.removeItem_(r,n,t,i);h=true;if(n===e){e=t.getNextItem()}n=r;t.prevItem()}else if(r.p1.reflex!==a){r.p1.reflex=a;h=true}r=n;n=t.nextItem()}while(r!==e);return h};zu.prototype.bridgeHole_=function(t,i,s,e,r){var n=t.firstItem();while(n.p1.x!==i){n=t.nextItem()}var h=n.p1;var a={x:e,y:h.y,i:-1};var o=Infinity;var f,u,l;var v;var c=this.getIntersections_({p0:h,p1:a},r,true);for(f=0,u=c.length;f<u;++f){var d=c[f];var m=this.calculateIntersection_(h,a,d.p0,d.p1,true);var p=Math.abs(h.x-m[0]);if(p<o&&Qf.triangleIsCounterClockwise(h.x,h.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)!==undefined){o=p;v={x:m[0],y:m[1],i:-1};n=d}}if(o===Infinity){return false}l=n.p1;if(o>0){var z=this.getPointsInTriangle_(h,v,n.p1,r);if(z.length){var M=Infinity;for(f=0,u=z.length;f<u;++f){var _=z[f];var g=Math.atan2(h.y-_.y,a.x-_.x);if(g<M||g===M&&_.x<l.x){M=g;l=_}}}}n=s.firstItem();while(n.p1.x!==l.x||n.p1.y!==l.y){n=s.nextItem()}var b={x:h.x,y:h.y,i:h.i,reflex:undefined};var x={x:n.p1.x,y:n.p1.y,i:n.p1.i,reflex:undefined};t.getNextItem().p0=b;this.insertItem_(h,n.p1,t,r);this.insertItem_(x,b,t,r);n.p1=x;t.setFirstItem();s.concat(t);return true};zu.prototype.triangulate_=function(t,i){var s=false;var e=this.isSimple_(t,i);while(t.getLength()>3){if(e){if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i,true)){break}}}}else{if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i)){e=this.isSimple_(t,i);if(!e){this.splitPolygon_(t,i);break}else{s=!this.isClockwise_(t);this.classifyPoints_(t,i,s)}}}}}}if(t.getLength()===3){var r=this.indices.length;this.indices[r++]=t.getPrevItem().p0.i;this.indices[r++]=t.getCurrItem().p0.i;this.indices[r++]=t.getNextItem().p0.i}};zu.prototype.clipEars_=function(t,i,s,e){var r=this.indices.length;var n=t.firstItem();var h=t.getPrevItem();var a=n;var o=t.nextItem();var f=t.getNextItem();var u,l,v;var c=false;do{u=a.p0;l=a.p1;v=o.p1;if(l.reflex===false){var d;if(s){d=this.getPointsInTriangle_(u,l,v,i,true).length===0}else{d=e?this.diagonalIsInside_(f.p1,v,l,u,h.p0):this.diagonalIsInside_(h.p0,u,l,v,f.p1)}if((s||this.getIntersections_({p0:u,p1:v},i).length===0)&&d){if(s||u.reflex===false||v.reflex===false||wa.linearRingIsClockwise([h.p0.x,h.p0.y,u.x,u.y,l.x,l.y,v.x,v.y,f.p1.x,f.p1.y],0,10,2)===!e){this.indices[r++]=u.i;this.indices[r++]=l.i;this.indices[r++]=v.i;this.removeItem_(a,o,t,i);if(o===n){n=f}c=true}}}h=t.getPrevItem();a=t.getCurrItem();o=t.nextItem();f=t.getNextItem()}while(a!==n&&t.getLength()>3);return c};zu.prototype.resolveSelfIntersections_=function(t,i,s){var e=t.firstItem();t.nextItem();var r=e;var n=t.nextItem();var h=false;do{var a=this.calculateIntersection_(r.p0,r.p1,n.p0,n.p1,s);if(a){var o=false;var f=this.vertices.length;var u=this.indices.length;var l=f/2;var v=t.prevItem();t.removeItem();i.remove(v);o=v===e;var c;if(s){if(a[0]===r.p0.x&&a[1]===r.p0.y){t.prevItem();c=r.p0;n.p0=c;i.remove(r);o=o||r===e}else{c=n.p1;r.p1=c;i.remove(n);o=o||n===e}t.removeItem()}else{c=this.createPoint_(a[0],a[1],l);r.p1=c;n.p0=c;i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r);i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n)}this.indices[u++]=v.p0.i;this.indices[u++]=v.p1.i;this.indices[u++]=c.i;h=true;if(o){break}}r=t.getPrevItem();n=t.nextItem()}while(r!==e);return h};zu.prototype.isSimple_=function(t,i){var s=t.firstItem();var e=s;do{if(this.getIntersections_(e,i).length){return false}e=t.nextItem()}while(e!==s);return true};zu.prototype.isClockwise_=function(t){var i=t.getLength()*2;var s=new Array(i);var e=t.firstItem();var r=e;var n=0;do{s[n++]=r.p0.x;s[n++]=r.p0.y;r=t.nextItem()}while(r!==e);return wa.linearRingIsClockwise(s,0,i,2)};zu.prototype.splitPolygon_=function(t,i){var s=t.firstItem();var e=s;do{var r=this.getIntersections_(e,i);if(r.length){var n=r[0];var h=this.vertices.length/2;var a=this.calculateIntersection_(e.p0,e.p1,n.p0,n.p1);var o=this.createPoint_(a[0],a[1],h);var f=new mu;var u=new pu;this.insertItem_(o,e.p1,f,u);e.p1=o;i.update([Math.min(e.p0.x,o.x),Math.min(e.p0.y,o.y),Math.max(e.p0.x,o.x),Math.max(e.p0.y,o.y)],e);var l=t.nextItem();while(l!==n){this.insertItem_(l.p0,l.p1,f,u);i.remove(l);t.removeItem();l=t.getCurrItem()}this.insertItem_(n.p0,o,f,u);n.p0=o;i.update([Math.min(n.p1.x,o.x),Math.min(n.p1.y,o.y),Math.max(n.p1.x,o.x),Math.max(n.p1.y,o.y)],n);this.classifyPoints_(t,i,false);this.triangulate_(t,i);this.classifyPoints_(f,u,false);this.triangulate_(f,u);break}e=t.nextItem()}while(e!==s)};zu.prototype.createPoint_=function(t,i,s){var e=this.vertices.length;this.vertices[e++]=t;this.vertices[e++]=i;var r={x:t,y:i,i:s,reflex:undefined};return r};zu.prototype.insertItem_=function(t,i,s,e){var r={p0:t,p1:i};s.insertItem(r);if(e){e.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],r)}return r};zu.prototype.removeItem_=function(t,i,s,e){if(s.getCurrItem()===i){s.removeItem();t.p1=i.p1;e.remove(i);e.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t)}};zu.prototype.getPointsInTriangle_=function(t,i,s,e,r){var n,h,a,o;var f=[];var u=e.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(n=0,h=u.length;n<h;++n){for(a in u[n]){o=u[n][a];if(typeof o==="object"&&(!r||o.reflex)){if((o.x!==t.x||o.y!==t.y)&&(o.x!==i.x||o.y!==i.y)&&(o.x!==s.x||o.y!==s.y)&&f.indexOf(o)===-1&&Ma.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)){f.push(o)}}}}return f};zu.prototype.getIntersections_=function(t,i,s){var e=t.p0;var r=t.p1;var n=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]);var h=[];var a,o;for(a=0,o=n.length;a<o;++a){var f=n[a];if(t!==f&&(s||f.p0!==r||f.p1!==e)&&this.calculateIntersection_(e,r,f.p0,f.p1,s)){h.push(f)}}return h};zu.prototype.calculateIntersection_=function(t,i,s,e,r){var n=(e.y-s.y)*(i.x-t.x)-(e.x-s.x)*(i.y-t.y);if(n!==0){var h=((e.x-s.x)*(t.y-s.y)-(e.y-s.y)*(t.x-s.x))/n;var a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/n;if(!r&&h>Qf.EPSILON&&h<1-Qf.EPSILON&&a>Qf.EPSILON&&a<1-Qf.EPSILON||r&&h>=0&&h<=1&&a>=0&&a<=1){return[t.x+h*(i.x-t.x),t.y+h*(i.y-t.y)]}}return undefined};zu.prototype.diagonalIsInside_=function(t,i,s,e,r){if(i.reflex===undefined||e.reflex===undefined){return false}var n=(s.x-e.x)*(i.y-e.y)>(s.y-e.y)*(i.x-e.x);var h=(r.x-e.x)*(i.y-e.y)<(r.y-e.y)*(i.x-e.x);var a=(t.x-i.x)*(e.y-i.y)>(t.y-i.y)*(e.x-i.x);var o=(s.x-i.x)*(e.y-i.y)<(s.y-i.y)*(e.x-i.x);var f=e.reflex?h||n:h&&n;var u=i.reflex?o||a:o&&a;return f&&u};zu.prototype.drawMultiPolygon=function(t,i){var s=t.getEndss();var e=t.getStride();var r=this.indices.length;var n=this.lineStringReplay.getCurrentIndex();var h=t.getFlatCoordinates();var a,o,f,u;var l=0;for(a=0,o=s.length;a<o;++a){var v=s[a];if(v.length>0){var c=Qh.translate(h,l,v[0],e,-this.origin[0],-this.origin[1]);if(c.length){var d=[];var m;for(f=1,u=v.length;f<u;++f){if(v[f]!==v[f-1]){m=Qh.translate(h,v[f-1],v[f],e,-this.origin[0],-this.origin[1]);d.push(m)}}this.lineStringReplay.drawPolygonCoordinates(c,d,e);this.drawCoordinates_(c,d,e)}}l=v[v.length-1]}if(this.indices.length>r){this.startIndices.push(r);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(r);this.state_.changed=false}}if(this.lineStringReplay.getCurrentIndex()>n){this.lineStringReplay.setPolygonStyle(i,n)}};zu.prototype.drawPolygon=function(t,i){var s=t.getEnds();var e=t.getStride();if(s.length>0){var r=t.getFlatCoordinates().map(Number);var n=Qh.translate(r,0,s[0],e,-this.origin[0],-this.origin[1]);if(n.length){var h=[];var a,o,f;for(a=1,o=s.length;a<o;++a){if(s[a]!==s[a-1]){f=Qh.translate(r,s[a-1],s[a],e,-this.origin[0],-this.origin[1]);h.push(f)}}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.lineStringReplay.setPolygonStyle(i);this.lineStringReplay.drawPolygonCoordinates(n,h,e);this.drawCoordinates_(n,h,e)}}};zu.prototype.finish=function(t){this.verticesBuffer=new tu(this.vertices);this.indicesBuffer=new tu(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(t);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};zu.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i);t.deleteBuffer(s);e()}};zu.prototype.setUpProgram=function(t,i,s,e){var r,n;r=vu.fragment;n=vu.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new cu(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,ka.FLOAT,false,8,0);return a};zu.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)};zu.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!Rh.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setFillStyle_(t,f);this.drawElements(t,i,a,o);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};zu.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=Oh.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Zh.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};zu.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=Oh.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};zu.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)};zu.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Jo.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Qf.defaultFillStyle}else{s=Qf.defaultFillStyle}if(!this.state_.fillColor||!Bh.equals(s,this.state_.fillColor)){this.state_.fillColor=s;this.state_.changed=true;this.styles_.push(s)}if(i){this.lineStringReplay.setFillStrokeStyle(null,i)}else{var e=new du({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,e)}};var Mu=function(t,i){this.space_=i;this.emptyBlocks_=[{x:0,y:0,width:t,height:t}];this.entries_={};this.context_=ro.createCanvasContext2D(t,t);this.canvas_=this.context_.canvas};Mu.prototype.get=function(t){return this.entries_[t]||null};Mu.prototype.add=function(t,i,s,e,r){var n,h,a;for(h=0,a=this.emptyBlocks_.length;h<a;++h){n=this.emptyBlocks_[h];if(n.width>=i+this.space_&&n.height>=s+this.space_){var o={offsetX:n.x+this.space_,offsetY:n.y+this.space_,image:this.canvas_};this.entries_[t]=o;e.call(r,this.context_,n.x+this.space_,n.y+this.space_);this.split_(h,n,i+this.space_,s+this.space_);return o}}return null};Mu.prototype.split_=function(t,i,s,e){var r=i.width-s;var n=i.height-e;var h;var a;if(r>n){h={x:i.x+s,y:i.y,width:i.width-s,height:i.height};a={x:i.x,y:i.y+e,width:s,height:i.height-e};this.updateBlocks_(t,h,a)}else{h={x:i.x+s,y:i.y,width:i.width-s,height:e};a={x:i.x,y:i.y+e,width:i.width,height:i.height-e};this.updateBlocks_(t,h,a)}};Mu.prototype.updateBlocks_=function(t,i,s){var e=[t,1];if(i.width>0&&i.height>0){e.push(i)}if(s.width>0&&s.height>0){e.push(s)}this.emptyBlocks_.splice.apply(this.emptyBlocks_,e)};var _u=function(t){var i=t||{};this.currentSize_=i.initialSize!==undefined?i.initialSize:Oh.INITIAL_ATLAS_SIZE;this.maxSize_=i.maxSize!==undefined?i.maxSize:Oh.MAX_ATLAS_SIZE!=-1?Oh.MAX_ATLAS_SIZE:Oh.WEBGL_MAX_TEXTURE_SIZE!==undefined?Oh.WEBGL_MAX_TEXTURE_SIZE:2048;this.space_=i.space!==undefined?i.space:1;this.atlases_=[new Mu(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new Mu(this.currentHitSize_,this.space_)]};_u.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i){return null}var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)};_u.prototype.getInfo_=function(t,i){var s,e,r,n;for(r=0,n=t.length;r<n;++r){s=t[r];e=s.get(i);if(e){return e}}return null};_u.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}};_u.prototype.add=function(t,i,s,e,r,n){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_){return null}var h=this.add_(false,t,i,s,e,n);if(!h){return null}var a=r!==undefined?r:Oh.nullFunction;var o=this.add_(true,t,i,s,a,n);return this.mergeInfos_(h,o)};_u.prototype.add_=function(t,i,s,e,r,n){var h=t?this.hitAtlases_:this.atlases_;var a,o,f,u;for(f=0,u=h.length;f<u;++f){a=h[f];o=a.add(i,s,e,r,n);if(o){return o}else if(!o&&f===u-1){var l;if(t){l=Math.min(this.currentHitSize_*2,this.maxSize_);this.currentHitSize_=l}else{l=Math.min(this.currentSize_*2,this.maxSize_);this.currentSize_=l}a=new Mu(l,this.space_);h.push(a);++u}}return null};var gu=function(t,i){hu.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=ro.createCanvasContext2D(0,0).canvas;this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.atlases_={};this.currAtlas_=undefined;this.scale=1;this.opacity=1};Oh.inherits(gu,hu);gu.prototype.drawText=function(t,i){if(this.text_){var s=null;var e=0;var r=2;var n=2;switch(t.getType()){case Xh.POINT:case Xh.MULTI_POINT:s=t.getFlatCoordinates();r=s.length;n=t.getStride();break;case Xh.CIRCLE:s=t.getCenter();break;case Xh.LINE_STRING:s=t.getFlatMidpoint();break;case Xh.MULTI_LINE_STRING:s=t.getFlatMidpoints();r=s.length;break;case Xh.POLYGON:s=t.getFlatInteriorPoint();break;case Xh.MULTI_POLYGON:s=t.getFlatInteriorPoints();r=s.length;break}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var h=this.currAtlas_;var a=this.text_.split("\n");var o=this.getTextSize_(a);var f,u,l,v,c,d,m,p;var z=Math.round(o[0]*this.textAlign_-this.offsetX_);var M=Math.round(o[1]*this.textBaseline_-this.offsetY_);var _=this.state_.lineWidth/2*this.state_.scale;for(f=0,u=a.length;f<u;++f){c=0;d=h.height*f;m=a[f].split("");for(l=0,v=m.length;l<v;++l){p=h.atlas.getInfo(m[l]);if(p){var g=p.image;this.anchorX=z-c;this.anchorY=M-d;this.originX=l===0?p.offsetX-_:p.offsetX;this.originY=p.offsetY;this.height=h.height;this.width=l===0||l===m.length-1?h.width[m[l]]+_:h.width[m[l]];this.imageHeight=g.height;this.imageWidth=g.width;var b;if(this.images_.length===0){this.images_.push(g)}else{b=this.images_[this.images_.length-1];if(Oh.getUid(b)!=Oh.getUid(g)){this.groupIndices.push(this.indices.length);this.images_.push(g)}}this.drawText_(s,e,r,n)}c+=this.width}}}};gu.prototype.getTextSize_=function(t){var i=this;var s=this.currAtlas_;var e=t.length*s.height;var r=t.map((function(t){var e=0;var r,n;for(r=0,n=t.length;r<n;++r){var h=t[r];if(!s.width[h]){i.addCharToAtlas_(h)}e+=s.width[h]?s.width[h]:0}return e})).reduce((function(t,i){return Math.max(t,i)}));return[r,e]};gu.prototype.drawText_=function(t,i,s,e){var r,n;for(r=i,n=s;r<n;r+=e){this.drawCoordinates(t,i,s,e)}};gu.prototype.addCharToAtlas_=function(t){if(t.length===1){var i=this.currAtlas_;var s=this.state_;var e=this.measureCanvas_.getContext("2d");e.font=s.font;var r=Math.ceil(e.measureText(t).width*s.scale);var n=i.atlas.add(t,r,i.height,(function(i,e,r){i.font=s.font;i.fillStyle=s.fillColor;i.strokeStyle=s.strokeColor;i.lineWidth=s.lineWidth;i.lineCap=s.lineCap;i.lineJoin=s.lineJoin;i.miterLimit=s.miterLimit;i.textAlign="left";i.textBaseline="top";if(Ea.CANVAS_LINE_DASH&&s.lineDash){i.setLineDash(s.lineDash);i.lineDashOffset=s.lineDashOffset}if(s.scale!==1){i.setTransform(s.scale,0,0,s.scale,0,0)}if(s.strokeColor){i.strokeText(t,e,r)}if(s.fillColor){i.fillText(t,e,r)}}));if(n){i.width[t]=r}}};gu.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new tu(this.vertices);this.indicesBuffer=new tu(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i);this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.images_=null;this.atlases_={};this.currAtlas_=undefined;hu.prototype.finish.call(this,t)};gu.prototype.setTextStyle=function(t){var i=this.state_;var s=t.getFill();var e=t.getStroke();if(!t||!t.getText()||!s&&!e){this.text_=""}else{if(!s){i.fillColor=null}else{var r=s.getColor();i.fillColor=Zo.asColorLike(r?r:Qf.defaultFillStyle)}if(!e){i.strokeColor=null;i.lineWidth=0}else{var n=e.getColor();i.strokeColor=Zo.asColorLike(n?n:Qf.defaultStrokeStyle);i.lineWidth=e.getWidth()||Qf.defaultLineWidth;i.lineCap=e.getLineCap()||Qf.defaultLineCap;i.lineDashOffset=e.getLineDashOffset()||Qf.defaultLineDashOffset;i.lineJoin=e.getLineJoin()||Qf.defaultLineJoin;i.miterLimit=e.getMiterLimit()||Qf.defaultMiterLimit;var h=e.getLineDash();i.lineDash=h?h.slice():Qf.defaultLineDash}i.font=t.getFont()||Qf.defaultFont;i.scale=t.getScale()||1;this.text_=t.getText();var a=Af.TEXT_ALIGN[t.getTextAlign()];var o=Af.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=a===undefined?Qf.defaultTextAlign:a;this.textBaseline_=o===undefined?Qf.defaultTextBaseline:o;this.offsetX_=t.getOffsetX()||0;this.offsetY_=t.getOffsetY()||0;this.rotateWithView=!!t.getRotateWithView();this.rotation=t.getRotation()||0;this.currAtlas_=this.getAtlas_(i)}};gu.prototype.getAtlas_=function(t){var i=[];var s;for(s in t){if(t[s]||t[s]===0){if(Array.isArray(t[s])){i=i.concat(t[s])}else{i.push(t[s])}}}var e=this.calculateHash_(i);if(!this.atlases_[e]){var r=this.measureCanvas_.getContext("2d");r.font=t.font;var n=Math.ceil((r.measureText("M").width*1.5+t.lineWidth/2)*t.scale);this.atlases_[e]={atlas:new _u({space:t.lineWidth+1}),width:{},height:n}}return this.atlases_[e]};gu.prototype.calculateHash_=function(t){var i,s;var e="";for(i=0,s=t.length;i<s;++i){e+=t[i]}return e};gu.prototype.getTextures=function(t){return this.textures_};gu.prototype.getHitDetectionTextures=function(){return this.textures_};var bu=function(t,i,s){Cf.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=s;this.replaysByZIndex_={}};Oh.inherits(bu,Cf);bu.prototype.addDeclutter=function(t,i){};bu.prototype.getDeleteResourcesFunction=function(t){var i=[];var s;for(s in this.replaysByZIndex_){var e=this.replaysByZIndex_[s];var r;for(r in e){i.push(e[r].getDeleteResourcesFunction(t))}}return function(){var t=i.length;var s;for(var e=0;e<t;e++){s=i[e].apply(this,arguments)}return s}};bu.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];var e;for(e in s){s[e].finish(t)}}};bu.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=bu.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_);e[i]=r}return r};bu.prototype.isEmpty=function(){return Rh.isEmpty(this.replaysByZIndex_)};bu.prototype.replay=function(t,i,s,e,r,n,h,a){var o=Object.keys(this.replaysByZIndex_).map(Number);o.sort(Bh.numberSafeCompareFunction);var f,u,l,v,c,d;for(f=0,u=o.length;f<u;++f){c=this.replaysByZIndex_[o[f].toString()];for(l=0,v=Af.ORDER.length;l<v;++l){d=c[Af.ORDER[l]];if(d!==undefined){d.replay(t,i,s,e,r,n,h,a,undefined,false)}}}};bu.prototype.replayHitDetection_=function(t,i,s,e,r,n,h,a,o,f,u){var l=Object.keys(this.replaysByZIndex_).map(Number);l.sort((function(t,i){return i-t}));var v,c,d,m,p,z;for(v=0,c=l.length;v<c;++v){m=this.replaysByZIndex_[l[v].toString()];for(d=Af.ORDER.length-1;d>=0;--d){p=m[Af.ORDER[d]];if(p!==undefined){z=p.replay(t,i,s,e,r,n,h,a,o,f,u);if(z){return z}}}}return undefined};bu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o,f){var u=i.getGL();u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer());var l;if(this.renderBuffer_!==undefined){l=Zh.buffer(Zh.createOrUpdateFromCoordinate(t),e*this.renderBuffer_)}return this.replayHitDetection_(i,t,e,r,bu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,i);if(i[3]>0){var s=f(t);if(s){return s}}}),true,l)};bu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o){var f=i.getGL();f.bindFramebuffer(f.FRAMEBUFFER,i.getHitDetectionFramebuffer());var u=this.replayHitDetection_(i,t,e,r,bu.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);f.readPixels(0,0,1,1,f.RGBA,f.UNSIGNED_BYTE,i);return i[3]>0}),false);return u!==undefined};bu.HIT_DETECTION_SIZE_=[1,1];bu.BATCH_CONSTRUCTORS_={Circle:iu,Image:au,LineString:lu,Polygon:zu,Text:gu};var xu=function(t,i,s,e,r,n,h){$o.call(this);this.context_=t;this.center_=i;this.extent_=n;this.pixelRatio_=h;this.size_=r;this.rotation_=e;this.resolution_=s;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null};Oh.inherits(xu,$o);xu.prototype.drawText_=function(t,i){var s=this.context_;var e=t.getReplay(0,If.TEXT);e.setTextStyle(this.textStyle_);e.drawText(i,null);e.finish(s);var r=1;var n={};var h;var a=false;e.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,r,n,h,a);e.getDeleteResourcesFunction(s)()};xu.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};xu.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case Xh.POINT:this.drawPoint(t,null);break;case Xh.LINE_STRING:this.drawLineString(t,null);break;case Xh.POLYGON:this.drawPolygon(t,null);break;case Xh.MULTI_POINT:this.drawMultiPoint(t,null);break;case Xh.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Xh.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Xh.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Xh.CIRCLE:this.drawCircle(t,null);break}};xu.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Zh.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};xu.prototype.drawGeometryCollection=function(t,i){var s=t.getGeometriesArray();var e,r;for(e=0,r=s.length;e<r;++e){this.drawGeometry(s[e])}};xu.prototype.drawPoint=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.IMAGE);r.setImageStyle(this.imageStyle_);r.drawPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawMultiPoint=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.IMAGE);r.setImageStyle(this.imageStyle_);r.drawMultiPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawLineString=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawMultiLineString=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawMultiLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawPolygon=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawMultiPolygon=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawMultiPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.drawCircle=function(t,i){var s=this.context_;var e=new bu(1,this.extent_);var r=e.getReplay(0,If.CIRCLE);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawCircle(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};xu.prototype.setImageStyle=function(t){this.imageStyle_=t};xu.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t;this.strokeStyle_=i};xu.prototype.setTextStyle=function(t){this.textStyle_=t};var wu={};wu.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}");wu.vertex=new Hf(Oh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var yu=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_texCoordMatrix":"d");this.u_projectionMatrix=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_projectionMatrix":"e");this.u_opacity=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_opacity":"f");this.u_texture=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_texture":"g");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_texCoord":"c")};var ku=function(t,i){Qo.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new tu([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined;this.texCoordMatrix=oa.create();this.projectionMatrix=oa.create();this.tmpMat4_=$f.create();this.defaultLocations_=null};Oh.inherits(ku,Qo);ku.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(this.framebufferDimension===undefined||this.framebufferDimension!=i){var e=function(t,i,s){if(!t.isContextLost()){t.deleteFramebuffer(i);t.deleteTexture(s)}}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(e);var r=nu.createEmptyTexture(s,i,i);var n=s.createFramebuffer();s.bindFramebuffer(ka.FRAMEBUFFER,n);s.framebufferTexture2D(ka.FRAMEBUFFER,ka.COLOR_ATTACHMENT0,ka.TEXTURE_2D,r,0);this.texture=r;this.framebuffer=n;this.framebufferDimension=i}else{s.bindFramebuffer(ka.FRAMEBUFFER,this.framebuffer)}};ku.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(zo.PRECOMPOSE,s,t);s.bindBuffer(ka.ARRAY_BUFFER,this.arrayBuffer_);var e=s.getGL();var r=wu.fragment;var n=wu.vertex;var h=s.getProgram(r,n);var a;if(!this.defaultLocations_){a=new yu(e,h);this.defaultLocations_=a}else{a=this.defaultLocations_}if(s.useProgram(h)){e.enableVertexAttribArray(a.a_position);e.vertexAttribPointer(a.a_position,2,ka.FLOAT,false,16,0);e.enableVertexAttribArray(a.a_texCoord);e.vertexAttribPointer(a.a_texCoord,2,ka.FLOAT,false,16,8);e.uniform1i(a.u_texture,0)}e.uniformMatrix4fv(a.u_texCoordMatrix,false,$f.fromTransform(this.tmpMat4_,this.getTexCoordMatrix()));e.uniformMatrix4fv(a.u_projectionMatrix,false,$f.fromTransform(this.tmpMat4_,this.getProjectionMatrix()));e.uniform1f(a.u_opacity,i.opacity);e.bindTexture(ka.TEXTURE_2D,this.getTexture());e.drawArrays(ka.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(zo.POSTCOMPOSE,s,t)};ku.prototype.dispatchComposeEvent_=function(t,i,s){var e=this.getLayer();if(e.hasListener(t)){var r=s.viewState;var n=r.resolution;var h=s.pixelRatio;var a=s.extent;var o=r.center;var f=r.rotation;var u=s.size;var l=new xu(i,o,n,f,u,a,h);var v=new Yo(t,l,s,null,i);e.dispatchEvent(v)}};ku.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};ku.prototype.getTexture=function(){return this.texture};ku.prototype.getProjectionMatrix=function(){return this.projectionMatrix};ku.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined};ku.prototype.prepareFrame=function(t,i,s){};ku.prototype.forEachLayerAtPixel=function(t,i,s,e){};var Eu=function(t,i){ku.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null};Oh.inherits(Eu,ku);Eu["handles"]=function(t,i){return t===lo.WEBGL&&i.getType()===qo.IMAGE};Eu["create"]=function(t,i){return new Eu(t,i)};Eu.prototype.createTexture_=function(t){var i=t.getImage();var s=this.mapRenderer.getGL();return nu.createTexture(s,i,ka.CLAMP_TO_EDGE,ka.CLAMP_TO_EDGE)};Eu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};Eu.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer.getGL();var r=t.pixelRatio;var n=t.viewState;var h=n.center;var a=n.resolution;var o=n.rotation;var f=this.image_;var u=this.texture;var l=this.getLayer();var v=l.getSource();var c=t.viewHints;var d=t.extent;if(i.extent!==undefined){d=Zh.getIntersection(d,i.extent)}if(!c[Ka.ANIMATING]&&!c[Ka.INTERACTING]&&!Zh.isEmpty(d)){var m=n.projection;if(!Oh.ENABLE_RASTER_REPROJECTION){var p=v.getProjection();if(p){m=p}}var z=v.getImage(d,a,r,m);if(z){var M=this.loadImage(z);if(M){f=z;u=this.createTexture_(z);if(this.texture){var _=function(t,i){if(!t.isContextLost()){t.deleteTexture(i)}}.bind(null,e,this.texture);t.postRenderFunctions.push(_)}}}}if(f){var g=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(g.width,g.height,r,h,a,o,f.getExtent());this.hitTransformationMatrix_=null;var b=this.texCoordMatrix;oa.reset(b);oa.scale(b,1,-1);oa.translate(b,0,-1);this.image_=f;this.texture=u;this.updateLogos(t,v)}return!!f};Eu.prototype.updateProjectionMatrix_=function(t,i,s,e,r,n,h){var a=t*r;var o=i*r;var f=this.projectionMatrix;oa.reset(f);oa.scale(f,s*2/a,s*2/o);oa.rotate(f,-n);oa.translate(f,h[0]-e[0],h[1]-e[1]);oa.scale(f,(h[2]-h[0])/2,(h[3]-h[1])/2);oa.translate(f,1,1)};Eu.prototype.hasFeatureAtCoordinate=function(t,i){var s=this.forEachFeatureAtCoordinate(t,i,0,Kh.TRUE,this);return s!==undefined};Eu.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.image_||!this.image_.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Oh.nullFunction){var r=oa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.forEachFeatureAtCoordinate(r,i,0,Kh.TRUE,this);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}}else{var h=[this.image_.getImage().width,this.image_.getImage().height];if(!this.hitTransformationMatrix_){this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,h)}var a=oa.apply(this.hitTransformationMatrix_,t.slice());if(a[0]<0||a[0]>h[0]||a[1]<0||a[1]>h[1]){return undefined}if(!this.hitCanvasContext_){this.hitCanvasContext_=ro.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.image_.getImage(),a[0],a[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}}};Eu.prototype.getHitTransformationMatrix_=function(t,i){var s=oa.create();oa.translate(s,-1,-1);oa.scale(s,2/t[0],2/t[1]);oa.translate(s,0,t[1]);oa.scale(s,1,-1);var e=oa.invert(this.projectionMatrix.slice());var r=oa.create();oa.translate(r,0,i[1]);oa.scale(r,1,-1);oa.scale(r,i[0]/2,i[1]/2);oa.translate(r,1,1);oa.multiply(r,e);oa.multiply(r,s);return r};var Nu=function(t,i){hf.call(this,t,i);this.canvas_=document.createElement("CANVAS");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=po.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=ro.createCanvasContext2D();this.renderedVisible_=true;this.gl_=ka.getContext(this.canvas_,{antialias:true,depth:true,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:true});this.context_=new nu(this.canvas_,this.gl_);Ph.listen(this.canvas_,ru.LOST,this.handleWebGLContextLost,this);Ph.listen(this.canvas_,ru.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new Bo;this.focus_=null;this.tileTextureQueue_=new Ba(function(t){var i=t[1];var s=t[2];var e=i[0]-this.focus_[0];var r=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(e*e+r*r)/s}.bind(this),(function(t){return t[0].getKey()}));this.loadNextTileTexture_=function(t,i){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var s=this.tileTextureQueue_.dequeue();var e=s[0];var r=s[3];var n=s[4];this.bindTileTexture(e,r,n,ka.LINEAR,ka.LINEAR)}return false}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};Oh.inherits(Nu,hf);Nu["handles"]=function(t){return Ea.WEBGL&&t===lo.WEBGL};Nu["create"]=function(t,i){return new Nu(t,i)};Nu.prototype.bindTileTexture=function(t,i,s,e,r){var n=this.getGL();var h=t.getKey();if(this.textureCache_.containsKey(h)){var a=this.textureCache_.get(h);n.bindTexture(ka.TEXTURE_2D,a.texture);if(a.magFilter!=e){n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_MAG_FILTER,e);a.magFilter=e}if(a.minFilter!=r){n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_MIN_FILTER,r);a.minFilter=r}}else{var o=n.createTexture();n.bindTexture(ka.TEXTURE_2D,o);if(s>0){var f=this.clipTileContext_.canvas;var u=this.clipTileContext_;if(this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]){f.width=i[0];f.height=i[1];this.clipTileCanvasWidth_=i[0];this.clipTileCanvasHeight_=i[1]}else{u.clearRect(0,0,i[0],i[1])}u.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]);n.texImage2D(ka.TEXTURE_2D,0,ka.RGBA,ka.RGBA,ka.UNSIGNED_BYTE,f)}else{n.texImage2D(ka.TEXTURE_2D,0,ka.RGBA,ka.RGBA,ka.UNSIGNED_BYTE,t.getImage())}n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_MAG_FILTER,e);n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_MIN_FILTER,r);n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_WRAP_S,ka.CLAMP_TO_EDGE);n.texParameteri(ka.TEXTURE_2D,ka.TEXTURE_WRAP_T,ka.CLAMP_TO_EDGE);this.textureCache_.set(h,{texture:o,magFilter:e,minFilter:r})}};Nu.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var e=this.context_;var r=i.extent;var n=i.size;var h=i.viewState;var a=i.pixelRatio;var o=h.resolution;var f=h.center;var u=h.rotation;var l=new xu(e,f,o,u,n,r,a);var v=new Yo(t,l,i,null,e);s.dispatchEvent(v)}};Nu.prototype.disposeInternal=function(){var t=this.getGL();if(!t.isContextLost()){this.textureCache_.forEach((function(i){if(i){t.deleteTexture(i.texture)}}))}this.context_.dispose();hf.prototype.disposeInternal.call(this)};Nu.prototype.expireCache_=function(t,i){var s=this.getGL();var e;while(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Oh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){e=this.textureCache_.peekLast();if(!e){if(+this.textureCache_.peekLastKey()==i.index){break}else{--this.textureCacheFrameMarkerCount_}}else{s.deleteTexture(e.texture)}this.textureCache_.pop()}};Nu.prototype.getContext=function(){return this.context_};Nu.prototype.getGL=function(){return this.gl_};Nu.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};Nu.prototype.getType=function(){return lo.WEBGL};Nu.prototype.handleWebGLContextLost=function(t){t.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i){var e=i[s];e.handleWebGLContextLost()}};Nu.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};Nu.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(ka.TEXTURE0);t.blendFuncSeparate(ka.SRC_ALPHA,ka.ONE_MINUS_SRC_ALPHA,ka.ONE,ka.ONE_MINUS_SRC_ALPHA);t.disable(ka.CULL_FACE);t.disable(ka.DEPTH_TEST);t.disable(ka.SCISSOR_TEST);t.disable(ka.STENCIL_TEST)};Nu.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())};Nu.prototype.renderFrame=function(t){var i=this.getContext();var s=this.getGL();if(s.isContextLost()){return false}if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return false}this.focus_=t.focus;this.textureCache_.set((-t.index).toString(),null);++this.textureCacheFrameMarkerCount_;this.dispatchComposeEvent_(zo.PRECOMPOSE,t);var e=[];var r=t.layerStatesArray;Bh.stableSort(r,hf.sortByZIndex);var n=t.viewState.resolution;var h,a,o,f;for(h=0,a=r.length;h<a;++h){f=r[h];if(Mo.visibleAtResolution(f,n)&&f.sourceState==ao.READY){o=this.getLayerRenderer(f.layer);if(o.prepareFrame(t,f,i)){e.push(f)}}}var u=t.size[0]*t.pixelRatio;var l=t.size[1]*t.pixelRatio;if(this.canvas_.width!=u||this.canvas_.height!=l){this.canvas_.width=u;this.canvas_.height=l}s.bindFramebuffer(ka.FRAMEBUFFER,null);s.clearColor(0,0,0,0);s.clear(ka.COLOR_BUFFER_BIT);s.enable(ka.BLEND);s.viewport(0,0,this.canvas_.width,this.canvas_.height);for(h=0,a=e.length;h<a;++h){f=e[h];o=this.getLayerRenderer(f.layer);o.composeFrame(t,f,i)}if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.calculateMatrices2D(t);if(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Oh.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){t.postRenderFunctions.push(this.expireCache_.bind(this))}if(!this.tileTextureQueue_.isEmpty()){t.postRenderFunctions.push(this.loadNextTileTexture_);t.animate=true}this.dispatchComposeEvent_(zo.POSTCOMPOSE,t);this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};Nu.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;if(this.getGL().isContextLost()){return false}var o=i.viewState;var f=i.layerStatesArray;var u=f.length;var l;for(l=u-1;l>=0;--l){var v=f[l];var c=v.layer;if(Mo.visibleAtResolution(v,o.resolution)&&n.call(h,c)){var d=this.getLayerRenderer(c);a=d.forEachFeatureAtCoordinate(t,i,s,e,r);if(a){return a}}}return undefined};Nu.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=false;if(this.getGL().isContextLost()){return false}var h=i.viewState;var a=i.layerStatesArray;var o=a.length;var f;for(f=o-1;f>=0;--f){var u=a[f];var l=u.layer;if(Mo.visibleAtResolution(u,h.resolution)&&e.call(r,l)){var v=this.getLayerRenderer(l);n=v.hasFeatureAtCoordinate(t,i);if(n){return true}}}return n};Nu.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){if(this.getGL().isContextLost()){return false}var h=i.viewState;var a;var o=i.layerStatesArray;var f=o.length;var u;for(u=f-1;u>=0;--u){var l=o[u];var v=l.layer;if(Mo.visibleAtResolution(l,h.resolution)&&r.call(e,v)){var c=this.getLayerRenderer(v);a=c.forEachLayerAtPixel(t,i,s,e);if(a){return a}}}return undefined};var Cu={};Cu.fragment=new Bf(Oh.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}");Cu.vertex=new Hf(Oh.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var Iu=function(t,i){this.u_tileOffset=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_tileOffset":"d");this.u_texture=t.getUniformLocation(i,Oh.DEBUG_WEBGL?"u_texture":"e");this.a_position=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,Oh.DEBUG_WEBGL?"a_texCoord":"c")};var Su=function(t,i){ku.call(this,t,i);this.fragmentShader_=Cu.fragment;this.vertexShader_=Cu.vertex;this.locations_=null;this.renderArrayBuffer_=new tu([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;this.tmpSize_=[0,0]};Oh.inherits(Su,ku);Su["handles"]=function(t,i){return t===lo.WEBGL&&i.getType()===qo.TILE};Su["create"]=function(t,i){return new Su(t,i)};Su.prototype.disposeInternal=function(){var t=this.mapRenderer.getContext();t.deleteBuffer(this.renderArrayBuffer_);ku.prototype.disposeInternal.call(this)};Su.prototype.createLoadedTileFinder=function(t,i,s){var e=this.mapRenderer;return function(r,n){function h(t){var i=e.isTileTextureLoaded(t);if(i){if(!s[r]){s[r]={}}s[r][t.tileCoord.toString()]=t}return i}return t.forEachLoadedTile(i,r,n,h)}};Su.prototype.handleWebGLContextLost=function(){ku.prototype.handleWebGLContextLost.call(this);this.locations_=null};Su.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer;var r=s.getGL();var n=t.viewState;var h=n.projection;var a=this.getLayer();var o=a.getSource();var f=o.getTileGridForProjection(h);var u=f.getZForResolution(n.resolution);var l=f.getResolution(u);var v=o.getTilePixelSize(u,t.pixelRatio,h);var c=v[0]/vo.toSize(f.getTileSize(u),this.tmpSize_)[0];var d=l/c;var m=o.getTilePixelRatio(c)*o.getGutter(h);var p=n.center;var z=t.extent;var M=f.getTileRangeForExtentAndZ(z,u);var _;if(this.renderedTileRange_&&this.renderedTileRange_.equals(M)&&this.renderedRevision_==o.getRevision()){_=this.renderedFramebufferExtent_}else{var g=M.getSize();var b=Math.max(g[0]*v[0],g[1]*v[1]);var x=qh.roundUpToPowerOfTwo(b);var w=d*x;var y=f.getOrigin(u);var k=y[0]+M.minX*v[0]*d;var E=y[1]+M.minY*v[1]*d;_=[k,E,k+w,E+w];this.bindFramebuffer(t,x);r.viewport(0,0,x,x);r.clearColor(0,0,0,0);r.clear(ka.COLOR_BUFFER_BIT);r.disable(ka.BLEND);var N=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(N);if(!this.locations_){this.locations_=new Iu(r,N)}s.bindBuffer(ka.ARRAY_BUFFER,this.renderArrayBuffer_);r.enableVertexAttribArray(this.locations_.a_position);r.vertexAttribPointer(this.locations_.a_position,2,ka.FLOAT,false,16,0);r.enableVertexAttribArray(this.locations_.a_texCoord);r.vertexAttribPointer(this.locations_.a_texCoord,2,ka.FLOAT,false,16,8);r.uniform1i(this.locations_.u_texture,0);var C={};C[u]={};var I=this.createLoadedTileFinder(o,h,C);var S=a.getUseInterimTilesOnError();var O=true;var T=Zh.createEmpty();var A=new of(0,0,0,0);var R,P,L,D,F;var W,G,j;for(W=M.minX;W<=M.maxX;++W){for(G=M.minY;G<=M.maxY;++G){D=o.getTile(u,W,G,c,h);if(i.extent!==undefined){j=f.getTileCoordExtent(D.tileCoord,T);if(!Zh.intersects(j,i.extent)){continue}}F=D.getState();P=F==Ya.LOADED||F==Ya.EMPTY||F==Ya.ERROR&&!S;if(!P){D=D.getInterimTile()}F=D.getState();if(F==Ya.LOADED){if(e.isTileTextureLoaded(D)){C[u][D.tileCoord.toString()]=D;continue}}else if(F==Ya.EMPTY||F==Ya.ERROR&&!S){continue}O=false;L=f.forEachTileCoordParentTileRange(D.tileCoord,I,null,A,T);if(!L){R=f.getTileCoordChildTileRange(D.tileCoord,A,T);if(R){I(u+1,R)}}}}var V=Object.keys(C).map(Number);V.sort(Bh.numberSafeCompareFunction);var U=new Float32Array(4);var q,X,Y,B;for(q=0,X=V.length;q<X;++q){B=C[V[q]];for(Y in B){D=B[Y];j=f.getTileCoordExtent(D.tileCoord,T);U[0]=2*(j[2]-j[0])/w;U[1]=2*(j[3]-j[1])/w;U[2]=2*(j[0]-_[0])/w-1;U[3]=2*(j[1]-_[1])/w-1;r.uniform4fv(this.locations_.u_tileOffset,U);e.bindTileTexture(D,v,m*c,ka.LINEAR,ka.LINEAR);r.drawArrays(ka.TRIANGLE_STRIP,0,4)}}if(O){this.renderedTileRange_=M;this.renderedFramebufferExtent_=_;this.renderedRevision_=o.getRevision()}else{this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;t.animate=true}}this.updateUsedTiles(t.usedTiles,o,u,M);var H=e.getTileTextureQueue();this.manageTilePyramid(t,o,f,c,h,z,u,a.getPreload(),(function(t){if(t.getState()==Ya.LOADED&&!e.isTileTextureLoaded(t)&&!H.isKeyQueued(t.getKey())){H.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),v,m*c])}}),this);this.scheduleExpireCache(t,o);this.updateLogos(t,o);var J=this.texCoordMatrix;oa.reset(J);oa.translate(J,(Math.round(p[0]/l)*l-_[0])/(_[2]-_[0]),(Math.round(p[1]/l)*l-_[1])/(_[3]-_[1]));if(n.rotation!==0){oa.rotate(J,n.rotation)}oa.scale(J,t.size[0]*n.resolution/(_[2]-_[0]),t.size[1]*n.resolution/(_[3]-_[1]));oa.translate(J,-.5,-.5);return true};Su.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.framebuffer){return undefined}var r=[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]];var n=oa.apply(this.texCoordMatrix,r.slice());var h=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension];var a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);a.readPixels(h[0],h[1],1,1,a.RGBA,a.UNSIGNED_BYTE,o);if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}};var Ou=function(t,i){ku.call(this,t,i);this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Zh.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.layerState_=null};Oh.inherits(Ou,ku);Ou["handles"]=function(t,i){return t===lo.WEBGL&&i.getType()===qo.VECTOR};Ou["create"]=function(t,i){return new Ou(t,i)};Ou.prototype.composeFrame=function(t,i,s){this.layerState_=i;var e=t.viewState;var r=this.replayGroup_;var n=t.size;var h=t.pixelRatio;var a=this.mapRenderer.getGL();if(r&&!r.isEmpty()){a.enable(a.SCISSOR_TEST);a.scissor(0,0,n[0]*h,n[1]*h);r.replay(s,e.center,e.resolution,e.rotation,n,h,i.opacity,i.managed?t.skippedFeatureUids:{});a.disable(a.SCISSOR_TEST)}};Ou.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)();this.replayGroup_=null}ku.prototype.disposeInternal.call(this)};Ou.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_||!this.layerState_){return undefined}else{var n=this.mapRenderer.getContext();var h=i.viewState;var a=this.getLayer();var o=this.layerState_;var f={};return this.replayGroup_.forEachFeatureAtCoordinate(t,n,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,o.opacity,{},(function(t){var i=Oh.getUid(t).toString();if(!(i in f)){f[i]=true;return e.call(r,t,a)}}))}};Ou.prototype.hasFeatureAtCoordinate=function(t,i){if(!this.replayGroup_||!this.layerState_){return false}else{var s=this.mapRenderer.getContext();var e=i.viewState;var r=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,s,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,r.opacity,i.skippedFeatureUids)}};Ou.prototype.forEachLayerAtPixel=function(t,i,s,e){var r=oa.apply(i.pixelToCoordinateTransform,t.slice());var n=this.hasFeatureAtCoordinate(r,i);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}};Ou.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};Ou.prototype.prepareFrame=function(t,i,s){var e=this.getLayer();var r=e.getSource();this.updateLogos(t,r);var n=t.viewHints[Ka.ANIMATING];var h=t.viewHints[Ka.INTERACTING];var a=e.getUpdateWhileAnimating();var o=e.getUpdateWhileInteracting();if(!this.dirty_&&(!a&&n)||!o&&h){return true}var f=t.extent;var u=t.viewState;var l=u.projection;var v=u.resolution;var c=t.pixelRatio;var d=e.getRevision();var m=e.getRenderBuffer();var p=e.getRenderOrder();if(p===undefined){p=Vf.defaultOrder}var z=Zh.buffer(f,m*v);if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&Zh.containsExtent(this.renderedExtent_,z)){return true}if(this.replayGroup_){t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s))}this.dirty_=false;var M=new bu(Vf.getTolerance(v,c),z,e.getRenderBuffer());r.loadFeatures(z,v,l);var _=function(t){var i;var s=t.getStyleFunction();if(s){i=s.call(t,v)}else{s=e.getStyleFunction();if(s){i=s(t,v)}}if(i){var r=this.renderFeature(t,v,c,i,M);this.dirty_=this.dirty_||r}};if(p){var g=[];r.forEachFeatureInExtent(z,(function(t){g.push(t)}),this);g.sort(p);g.forEach(_,this)}else{r.forEachFeatureInExtent(z,_,this)}M.finish(s);this.renderedResolution_=v;this.renderedRevision_=d;this.renderedRenderOrder_=p;this.renderedExtent_=z;this.replayGroup_=M;return true};Ou.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=e.length-1,a=0;h>=a;--h){n=Vf.renderFeature(r,t,e[h],Vf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Vf.renderFeature(r,t,e,Vf.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}return n};if(Oh.ENABLE_CANVAS){uo.register(fo.MAP_RENDERER,af);uo.registerMultiple(fo.LAYER_RENDERER,[ef,ff,Uf,Xf])}if(Oh.ENABLE_WEBGL){uo.register(fo.MAP_RENDERER,Nu);uo.registerMultiple(fo.LAYER_RENDERER,[Eu,Su,Ou])}var Tu=function(t){t=Rh.assign({},t);if(!t.controls){t.controls=xo.defaults()}if(!t.interactions){t.interactions=Go.defaults()}co.call(this,t)};Oh.inherits(Tu,co);var Au={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var Ru=function(t){jh.call(this);this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("DIV");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+po.CLASS_SELECTABLE;this.element.style.position="absolute";this.autoPan=t.autoPan!==undefined?t.autoPan:false;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=t.autoPanMargin!==undefined?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:true};this.mapPostrenderListenerKey=null;Ph.listen(this,jh.getChangeEventType(Ru.Property.ELEMENT),this.handleElementChanged,this);Ph.listen(this,jh.getChangeEventType(Ru.Property.MAP),this.handleMapChanged,this);Ph.listen(this,jh.getChangeEventType(Ru.Property.OFFSET),this.handleOffsetChanged,this);Ph.listen(this,jh.getChangeEventType(Ru.Property.POSITION),this.handlePositionChanged,this);Ph.listen(this,jh.getChangeEventType(Ru.Property.POSITIONING),this.handlePositioningChanged,this);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning!==undefined?t.positioning:Au.TOP_LEFT);if(t.position!==undefined){this.setPosition(t.position)}};Oh.inherits(Ru,jh);Ru.prototype.getElement=function(){return this.get(Ru.Property.ELEMENT)};Ru.prototype.getId=function(){return this.id};Ru.prototype.getMap=function(){return this.get(Ru.Property.MAP)};Ru.prototype.getOffset=function(){return this.get(Ru.Property.OFFSET)};Ru.prototype.getPosition=function(){return this.get(Ru.Property.POSITION)};Ru.prototype.getPositioning=function(){return this.get(Ru.Property.POSITIONING)};Ru.prototype.handleElementChanged=function(){ro.removeChildren(this.element);var t=this.getElement();if(t){this.element.appendChild(t)}};Ru.prototype.handleMapChanged=function(){if(this.mapPostrenderListenerKey){ro.removeNode(this.element);Ph.unlistenByKey(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}var t=this.getMap();if(t){this.mapPostrenderListenerKey=Ph.listen(t,qa.POSTRENDER,this.render,this);this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){i.insertBefore(this.element,i.childNodes[0]||null)}else{i.appendChild(this.element)}}};Ru.prototype.render=function(){this.updatePixelPosition()};Ru.prototype.handleOffsetChanged=function(){this.updatePixelPosition()};Ru.prototype.handlePositionChanged=function(){this.updatePixelPosition();if(this.get(Ru.Property.POSITION)&&this.autoPan){this.panIntoView()}};Ru.prototype.handlePositioningChanged=function(){this.updatePixelPosition()};Ru.prototype.setElement=function(t){this.set(Ru.Property.ELEMENT,t)};Ru.prototype.setMap=function(t){this.set(Ru.Property.MAP,t)};Ru.prototype.setOffset=function(t){this.set(Ru.Property.OFFSET,t)};Ru.prototype.setPosition=function(t){this.set(Ru.Property.POSITION,t)};Ru.prototype.panIntoView=function(){var t=this.getMap();if(!t||!t.getTargetElement()){return}var i=this.getRect(t.getTargetElement(),t.getSize());var s=this.getElement();var e=this.getRect(s,[ro.outerWidth(s),ro.outerHeight(s)]);var r=this.autoPanMargin;if(!Zh.containsExtent(i,e)){var n=e[0]-i[0];var h=i[2]-e[2];var a=e[1]-i[1];var o=i[3]-e[3];var f=[0,0];if(n<0){f[0]=n-r}else if(h<0){f[0]=Math.abs(h)+r}if(a<0){f[1]=a-r}else if(o<0){f[1]=Math.abs(o)+r}if(f[0]!==0||f[1]!==0){var u=t.getView().getCenter();var l=t.getPixelFromCoordinate(u);var v=[l[0]+f[0],l[1]+f[1]];t.getView().animate({center:t.getCoordinateFromPixel(v),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}};Ru.prototype.getRect=function(t,i){var s=t.getBoundingClientRect();var e=s.left+window.pageXOffset;var r=s.top+window.pageYOffset;return[e,r,e+i[0],r+i[1]]};Ru.prototype.setPositioning=function(t){this.set(Ru.Property.POSITIONING,t)};Ru.prototype.setVisible=function(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}};Ru.prototype.updatePixelPosition=function(){var t=this.getMap();var i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(false);return}var s=t.getPixelFromCoordinate(i);var e=t.getSize();this.updateRenderedPosition(s,e)};Ru.prototype.updateRenderedPosition=function(t,i){var s=this.element.style;var e=this.getOffset();var r=this.getPositioning();this.setVisible(true);var n=e[0];var h=e[1];if(r==Au.BOTTOM_RIGHT||r==Au.CENTER_RIGHT||r==Au.TOP_RIGHT){if(this.rendered.left_!==""){this.rendered.left_=s.left=""}var a=Math.round(i[0]-t[0]-n)+"px";if(this.rendered.right_!=a){this.rendered.right_=s.right=a}}else{if(this.rendered.right_!==""){this.rendered.right_=s.right=""}if(r==Au.BOTTOM_CENTER||r==Au.CENTER_CENTER||r==Au.TOP_CENTER){n-=this.element.offsetWidth/2}var o=Math.round(t[0]+n)+"px";if(this.rendered.left_!=o){this.rendered.left_=s.left=o}}if(r==Au.BOTTOM_LEFT||r==Au.BOTTOM_CENTER||r==Au.BOTTOM_RIGHT){if(this.rendered.top_!==""){this.rendered.top_=s.top=""}var f=Math.round(i[1]-t[1]-h)+"px";if(this.rendered.bottom_!=f){this.rendered.bottom_=s.bottom=f}}else{if(this.rendered.bottom_!==""){this.rendered.bottom_=s.bottom=""}if(r==Au.CENTER_LEFT||r==Au.CENTER_CENTER||r==Au.CENTER_RIGHT){h-=this.element.offsetHeight/2}var u=Math.round(t[1]+h)+"px";if(this.rendered.top_!=u){this.rendered.top_=s.top=u}}};Ru.prototype.getOptions=function(){return this.options};Ru.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var Pu=function(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.snapToPixel_=t.snapToPixel};Pu.prototype.getOpacity=function(){return this.opacity_};Pu.prototype.getRotateWithView=function(){return this.rotateWithView_};Pu.prototype.getRotation=function(){return this.rotation_};Pu.prototype.getScale=function(){return this.scale_};Pu.prototype.getSnapToPixel=function(){return this.snapToPixel_};Pu.prototype.getAnchor=function(){};Pu.prototype.getImage=function(t){};Pu.prototype.getHitDetectionImage=function(t){};Pu.prototype.getImageState=function(){};Pu.prototype.getImageSize=function(){};Pu.prototype.getHitDetectionImageSize=function(){};Pu.prototype.getOrigin=function(){};Pu.prototype.getSize=function(){};Pu.prototype.setOpacity=function(t){this.opacity_=t};Pu.prototype.setRotateWithView=function(t){this.rotateWithView_=t};Pu.prototype.setRotation=function(t){this.rotation_=t};Pu.prototype.setScale=function(t){this.scale_=t};Pu.prototype.setSnapToPixel=function(t){this.snapToPixel_=t};Pu.prototype.listenImageChange=function(t,i){};Pu.prototype.load=function(){};Pu.prototype.unlistenImageChange=function(t,i){};var Lu=function(t){this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=t.radius!==undefined?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_);var i=t.snapToPixel!==undefined?t.snapToPixel:true;var s=t.rotateWithView!==undefined?t.rotateWithView:false;Pu.call(this,{opacity:1,rotateWithView:s,rotation:t.rotation!==undefined?t.rotation:0,scale:1,snapToPixel:i})};Oh.inherits(Lu,Pu);Lu.prototype.clone=function(){var t=new Lu({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Lu.prototype.getAnchor=function(){return this.anchor_};Lu.prototype.getAngle=function(){return this.angle_};Lu.prototype.getFill=function(){return this.fill_};Lu.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_};Lu.prototype.getImage=function(t){return this.canvas_};Lu.prototype.getImageSize=function(){return this.imageSize_};Lu.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_};Lu.prototype.getImageState=function(){return Vo.LOADED};Lu.prototype.getOrigin=function(){return this.origin_};Lu.prototype.getPoints=function(){return this.points_};Lu.prototype.getRadius=function(){return this.radius_};Lu.prototype.getRadius2=function(){return this.radius2_};Lu.prototype.getSize=function(){return this.size_};Lu.prototype.getStroke=function(){return this.stroke_};Lu.prototype.listenImageChange=function(t,i){};Lu.prototype.load=function(){};Lu.prototype.unlistenImageChange=function(t,i){};Lu.prototype.render_=function(t){var i;var s="";var e="";var r=0;var n=null;var h=0;var a;var o=0;if(this.stroke_){a=this.stroke_.getColor();if(a===null){a=Ho.defaultStrokeStyle}a=Zo.asColorLike(a);o=this.stroke_.getWidth();if(o===undefined){o=Ho.defaultLineWidth}n=this.stroke_.getLineDash();h=this.stroke_.getLineDashOffset();if(!Ea.CANVAS_LINE_DASH){n=null;h=0}e=this.stroke_.getLineJoin();if(e===undefined){e=Ho.defaultLineJoin}s=this.stroke_.getLineCap();if(s===undefined){s=Ho.defaultLineCap}r=this.stroke_.getMiterLimit();if(r===undefined){r=Ho.defaultMiterLimit}}var f=2*(this.radius_+o)+1;var u={strokeStyle:a,strokeWidth:o,size:f,lineCap:s,lineDash:n,lineDashOffset:h,lineJoin:e,miterLimit:r};if(t===undefined){var l=ro.createCanvasContext2D(f,f);this.canvas_=l.canvas;f=this.canvas_.width;i=f;this.draw_(u,l,0,0);this.createHitDetectionCanvas_(u)}else{f=Math.round(f);var v=!this.fill_;var c;if(v){c=this.drawHitDetectionCanvas_.bind(this,u)}var d=this.getChecksum();var m=t.add(d,f,f,this.draw_.bind(this,u),c);this.canvas_=m.image;this.origin_=[m.offsetX,m.offsetY];i=m.image.width;if(v){this.hitDetectionCanvas_=m.hitImage;this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]}else{this.hitDetectionCanvas_=this.canvas_;this.hitDetectionImageSize_=[i,i]}}this.anchor_=[f/2,f/2];this.size_=[f,f];this.imageSize_=[i,i]};Lu.prototype.draw_=function(t,i,s,e){var r,n,h;i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var a=this.points_;if(a===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var o=this.radius2_!==undefined?this.radius2_:this.radius_;if(o!==this.radius_){a=2*a}for(r=0;r<=a;r++){n=r*2*Math.PI/a-Math.PI/2+this.angle_;h=r%2===0?this.radius_:o;i.lineTo(t.size/2+h*Math.cos(n),t.size/2+h*Math.sin(n))}}if(this.fill_){var f=this.fill_.getColor();if(f===null){f=Ho.defaultFillStyle}i.fillStyle=Zo.asColorLike(f);i.fill()}if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.stroke()}i.closePath()};Lu.prototype.createHitDetectionCanvas_=function(t){this.hitDetectionImageSize_=[t.size,t.size];if(this.fill_){this.hitDetectionCanvas_=this.canvas_;return}var i=ro.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=i.canvas;this.drawHitDetectionCanvas_(t,i,0,0)};Lu.prototype.drawHitDetectionCanvas_=function(t,i,s,e){i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var r=this.points_;if(r===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var n=this.radius2_!==undefined?this.radius2_:this.radius_;if(n!==this.radius_){r=2*r}var h,a,o;for(h=0;h<=r;h++){o=h*2*Math.PI/r-Math.PI/2+this.angle_;a=h%2===0?this.radius_:n;i.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}}i.fillStyle=Ho.defaultFillStyle;i.fill();if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.stroke()}i.closePath()};Lu.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-";var i=this.fill_?this.fill_.getChecksum():"-";var s=!this.checksums_||(t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]);if(s){var e="r"+t+i+(this.radius_!==undefined?this.radius_.toString():"-")+(this.radius2_!==undefined?this.radius2_.toString():"-")+(this.angle_!==undefined?this.angle_.toString():"-")+(this.points_!==undefined?this.points_.toString():"-");this.checksums_=[e,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var Du=function(t){var i=t||{};Lu.call(this,{points:Infinity,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};Oh.inherits(Du,Lu);Du.prototype.clone=function(){var t=new Du({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};Du.prototype.setRadius=function(t){this.radius_=t;this.render_(this.atlasManager_)};var Fu=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.checksum_=undefined};Fu.prototype.clone=function(){var t=this.getColor();return new Fu({color:t&&t.slice?t.slice():t||undefined})};Fu.prototype.getColor=function(){return this.color_};Fu.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};Fu.prototype.getChecksum=function(){if(this.checksum_===undefined){if(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient){this.checksum_=Oh.getUid(this.color_).toString()}else{this.checksum_="f"+(this.color_?Jo.asString(this.color_):"-")}}return this.checksum_};var Wu=function(t){var i=t||{};this.geometry_=null;this.geometryFunction_=Wu.defaultGeometryFunction;if(i.geometry!==undefined){this.setGeometry(i.geometry)}this.fill_=i.fill!==undefined?i.fill:null;this.image_=i.image!==undefined?i.image:null;this.renderer_=i.renderer!==undefined?i.renderer:null;this.stroke_=i.stroke!==undefined?i.stroke:null;this.text_=i.text!==undefined?i.text:null;this.zIndex_=i.zIndex};Wu.prototype.clone=function(){var t=this.getGeometry();if(t&&t.clone){t=t.clone()}return new Wu({geometry:t,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})};Wu.prototype.getRenderer=function(){return this.renderer_};Wu.prototype.setRenderer=function(t){this.renderer_=t};Wu.prototype.getGeometry=function(){return this.geometry_};Wu.prototype.getGeometryFunction=function(){return this.geometryFunction_};Wu.prototype.getFill=function(){return this.fill_};Wu.prototype.setFill=function(t){this.fill_=t};Wu.prototype.getImage=function(){return this.image_};Wu.prototype.setImage=function(t){this.image_=t};Wu.prototype.getStroke=function(){return this.stroke_};Wu.prototype.setStroke=function(t){this.stroke_=t};Wu.prototype.getText=function(){return this.text_};Wu.prototype.setText=function(t){this.text_=t};Wu.prototype.getZIndex=function(){return this.zIndex_};Wu.prototype.setGeometry=function(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(i){return i.get(t)}}else if(!t){this.geometryFunction_=Wu.defaultGeometryFunction}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t};Wu.prototype.setZIndex=function(t){this.zIndex_=t};Wu.createFunction=function(t){var i;if(typeof t==="function"){i=t}else{var s;if(Array.isArray(t)){s=t}else{Uh.assert(t instanceof Wu,41);s=[t]}i=function(){return s}}return i};Wu.default_=null;Wu.defaultFunction=function(t,i){if(!Wu.default_){var s=new Fu({color:"rgba(255,255,255,0.4)"});var e=new du({color:"#3399CC",width:1.25});Wu.default_=[new Wu({image:new Du({fill:s,stroke:e,radius:5}),fill:s,stroke:e})]}return Wu.default_};Wu.createDefaultEditing=function(){var t={};var i=[255,255,255,1];var s=[0,153,255,1];var e=3;t[Xh.POLYGON]=[new Wu({fill:new Fu({color:[255,255,255,.5]})})];t[Xh.MULTI_POLYGON]=t[Xh.POLYGON];t[Xh.LINE_STRING]=[new Wu({stroke:new du({color:i,width:e+2})}),new Wu({stroke:new du({color:s,width:e})})];t[Xh.MULTI_LINE_STRING]=t[Xh.LINE_STRING];t[Xh.CIRCLE]=t[Xh.POLYGON].concat(t[Xh.LINE_STRING]);t[Xh.POINT]=[new Wu({image:new Du({radius:e*2,fill:new Fu({color:s}),stroke:new du({color:i,width:e/2})}),zIndex:Infinity})];t[Xh.MULTI_POINT]=t[Xh.POINT];t[Xh.GEOMETRY_COLLECTION]=t[Xh.POLYGON].concat(t[Xh.LINE_STRING],t[Xh.POINT]);return t};Wu.defaultGeometryFunction=function(t){return t.getGeometry()};var Gu=function(t){jh.call(this);this.id_=undefined;this.geometryName_="geometry";this.style_=null;this.styleFunction_=undefined;this.geometryChangeKey_=null;Ph.listen(this,jh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);if(t!==undefined){if(t instanceof fa||!t){var i=t;this.setGeometry(i)}else{var s=t;this.setProperties(s)}}};Oh.inherits(Gu,jh);Gu.prototype.clone=function(){var t=new Gu(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();if(i){t.setGeometry(i.clone())}var s=this.getStyle();if(s){t.setStyle(s)}return t};Gu.prototype.getGeometry=function(){return this.get(this.geometryName_)};Gu.prototype.getId=function(){return this.id_};Gu.prototype.getGeometryName=function(){return this.geometryName_};Gu.prototype.getStyle=function(){return this.style_};Gu.prototype.getStyleFunction=function(){return this.styleFunction_};Gu.prototype.handleGeometryChange_=function(){this.changed()};Gu.prototype.handleGeometryChanged_=function(){if(this.geometryChangeKey_){Ph.unlistenByKey(this.geometryChangeKey_);this.geometryChangeKey_=null}var t=this.getGeometry();if(t){this.geometryChangeKey_=Ph.listen(t,Wh.CHANGE,this.handleGeometryChange_,this)}this.changed()};Gu.prototype.setGeometry=function(t){this.set(this.geometryName_,t)};Gu.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=!t?undefined:Gu.createStyleFunction(t);this.changed()};Gu.prototype.setId=function(t){this.id_=t;this.changed()};Gu.prototype.setGeometryName=function(t){Ph.unlisten(this,jh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=t;Ph.listen(this,jh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()};Gu.createStyleFunction=function(t){var i;if(typeof t==="function"){if(t.length==2){i=function(i){return t(this,i)}}else{i=t}}else{var s;if(Array.isArray(t)){s=t}else{Uh.assert(t instanceof Wu,41);s=[t]}i=function(){return s}}return i};var ju={};ju.createOrUpdate=function(t,i,s,e){if(e!==undefined){e[0]=t;e[1]=i;e[2]=s;return e}else{return[t,i,s]}};ju.getKeyZXY=function(t,i,s){return t+"/"+i+"/"+s};ju.getKey=function(t){return ju.getKeyZXY(t[0],t[1],t[2])};ju.fromKey=function(t){return t.split("/").map(Number)};ju.hash=function(t){return(t[1]<<t[0])+t[2]};ju.quadKey=function(t){var i=t[0];var s=new Array(i);var e=1<<i-1;var r,n;for(r=0;r<i;++r){n=48;if(t[1]&e){n+=1}if(t[2]&e){n+=2}s[r]=String.fromCharCode(n);e>>=1}return s.join("")};ju.withinExtentAndZ=function(t,i){var s=t[0];var e=t[1];var r=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom()){return false}var n=i.getExtent();var h;if(!n){h=i.getFullTileRange(s)}else{h=i.getTileRangeForExtentAndZ(n,s)}if(!h){return true}else{return h.containsXY(e,r)}};var Vu={};Vu.createFromTemplate=function(t,i){var s=/\{z\}/g;var e=/\{x\}/g;var r=/\{y\}/g;var n=/\{-y\}/g;return function(h,a,o){if(!h){return undefined}else{return t.replace(s,h[0].toString()).replace(e,h[1].toString()).replace(r,(function(){var t=-h[2]-1;return t.toString()})).replace(n,(function(){var t=h[0];var s=i.getFullTileRange(t);Uh.assert(s,55);var e=s.getHeight()+h[2];return e.toString()}))}}};Vu.createFromTemplates=function(t,i){var s=t.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=Vu.createFromTemplate(t[r],i)}return Vu.createFromTileUrlFunctions(e)};Vu.createFromTileUrlFunctions=function(t){if(t.length===1){return t[0]}return function(i,s,e){if(!i){return undefined}else{var r=ju.hash(i);var n=qh.modulo(r,t.length);return t[n](i,s,e)}}};Vu.nullTileUrlFunction=function(t,i,s){return undefined};Vu.expandUrl=function(t){var i=[];var s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var e=s[1].charCodeAt(0);var r=s[2].charCodeAt(0);var n;for(n=e;n<=r;++n){i.push(t.replace(s[0],String.fromCharCode(n)))}return i}s=s=/\{(\d+)-(\d+)\}/.exec(t);if(s){var h=parseInt(s[2],10);for(var a=parseInt(s[1],10);a<=h;a++){i.push(t.replace(s[0],a.toString()))}return i}i.push(t);return i};var Uu=function(t,i,s){Fh.call(this);var e=s?s:{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=e.transition===undefined?250:e.transition;this.transitionStarts_={}};Oh.inherits(Uu,Fh);Uu.prototype.changed=function(){this.dispatchEvent(Wh.CHANGE)};Uu.prototype.getKey=function(){return this.key+"/"+this.tileCoord};Uu.prototype.getInterimTile=function(){if(!this.interimTile){return this}var t=this.interimTile;do{if(t.getState()==Ya.LOADED){return t}t=t.interimTile}while(t);return this};Uu.prototype.refreshInterimChain=function(){if(!this.interimTile){return}var t=this.interimTile;var i=this;do{if(t.getState()==Ya.LOADED){t.interimTile=null;break}else if(t.getState()==Ya.LOADING){i=t}else if(t.getState()==Ya.IDLE){i.interimTile=t.interimTile}else{i=t}t=i.interimTile}while(t)};Uu.prototype.getTileCoord=function(){return this.tileCoord};Uu.prototype.getState=function(){return this.state};Uu.prototype.setState=function(t){this.state=t;this.changed()};Uu.prototype.load=function(){};Uu.prototype.getAlpha=function(t,i){if(!this.transition_){return 1}var s=this.transitionStarts_[t];if(!s){s=i;this.transitionStarts_[t]=s}else if(s===-1){return 1}var e=i-s+1e3/60;if(e>=this.transition_){return 1}return so.easeIn(e/this.transition_)};Uu.prototype.inTransition=function(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1};Uu.prototype.endTransition=function(t){if(this.transition_){this.transitionStarts_[t]=-1}};var qu=function(t,i,s,e,r,n){Uu.call(this,t,i,n);this.crossOrigin_=e;this.src_=s;this.image_=new Image;if(e!==null){this.image_.crossOrigin=e}this.imageListenerKeys_=null;this.tileLoadFunction_=r};Oh.inherits(qu,Uu);qu.prototype.disposeInternal=function(){if(this.state==Ya.LOADING){this.unlistenImage_();this.image_=qu.getBlankImage()}if(this.interimTile){this.interimTile.dispose()}this.state=Ya.ABORT;this.changed();Uu.prototype.disposeInternal.call(this)};qu.prototype.getImage=function(){return this.image_};qu.prototype.getKey=function(){return this.src_};qu.prototype.handleImageError_=function(){this.state=Ya.ERROR;this.unlistenImage_();this.image_=qu.getBlankImage();this.changed()};qu.prototype.handleImageLoad_=function(){if(this.image_.naturalWidth&&this.image_.naturalHeight){this.state=Ya.LOADED}else{this.state=Ya.EMPTY}this.unlistenImage_();this.changed()};qu.prototype.load=function(){if(this.state==Ya.ERROR){this.state=Ya.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==Ya.IDLE){this.state=Ya.LOADING;this.changed();this.imageListenerKeys_=[Ph.listenOnce(this.image_,Wh.ERROR,this.handleImageError_,this),Ph.listenOnce(this.image_,Wh.LOAD,this.handleImageLoad_,this)];this.tileLoadFunction_(this,this.src_)}};qu.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ph.unlistenByKey);this.imageListenerKeys_=null};qu.getBlankImage=function(){var t=ro.createCanvasContext2D(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas};var Xu=function(t){Bo.call(this,t)};Oh.inherits(Xu,Bo);Xu.prototype.expireCache=function(t){var i,s;while(this.canExpireCache()){i=this.peekLast();s=i.tileCoord[0].toString();if(s in t&&t[s].contains(i.tileCoord)){break}else{this.pop().dispose()}}};Xu.prototype.pruneExceptNewestZ=function(){if(this.getCount()===0){return}var t=this.peekFirstKey();var i=ju.fromKey(t);var s=i[0];this.forEach((function(t){if(t.tileCoord[0]!==s){this.remove(ju.getKey(t.tileCoord));t.dispose()}}),this)};var Yu={};Yu.calculateSourceResolution=function(t,i,s,e){var r=aa.transform(s,i,t);var n=aa.getPointResolution(i,e,s);var h=i.getMetersPerUnit();if(h!==undefined){n*=h}var a=t.getMetersPerUnit();if(a!==undefined){n/=a}var o=t.getExtent();if(!o||Zh.containsCoordinate(o,r)){var f=aa.getPointResolution(t,n,r)/n;if(isFinite(f)&&f>0){n/=f}}return n};Yu.enlargeClipPoint_=function(t,i,s,e){var r=s-t,n=e-i;var h=Math.sqrt(r*r+n*n);return[Math.round(s+r/h),Math.round(e+n/h)]};Yu.render=function(t,i,s,e,r,n,h,a,o,f,u){var l=ro.createCanvasContext2D(Math.round(s*t),Math.round(s*i));if(o.length===0){return l.canvas}l.scale(s,s);var v=Zh.createEmpty();o.forEach((function(t,i,s){Zh.extend(v,t.extent)}));var c=Zh.getWidth(v);var d=Zh.getHeight(v);var m=ro.createCanvasContext2D(Math.round(s*c/e),Math.round(s*d/e));var p=s/e;o.forEach((function(t,i,s){var e=t.extent[0]-v[0];var r=-(t.extent[3]-v[3]);var n=Zh.getWidth(t.extent);var h=Zh.getHeight(t.extent);m.drawImage(t.image,f,f,t.image.width-2*f,t.image.height-2*f,e*p,r*p,n*p,h*p)}));var z=Zh.getTopLeft(h);a.getTriangles().forEach((function(t,i,r){var h=t.source,a=t.target;var o=h[0][0],f=h[0][1],u=h[1][0],c=h[1][1],d=h[2][0],p=h[2][1];var M=(a[0][0]-z[0])/n,_=-(a[0][1]-z[1])/n;var g=(a[1][0]-z[0])/n,b=-(a[1][1]-z[1])/n;var x=(a[2][0]-z[0])/n,w=-(a[2][1]-z[1])/n;var y=o,k=f;o=0;f=0;u-=y;c-=k;d-=y;p-=k;var E=[[u,c,0,0,g-M],[d,p,0,0,x-M],[0,0,u,c,b-_],[0,0,d,p,w-_]];var N=qh.solveLinearSystem(E);if(!N){return}l.save();l.beginPath();var C=(M+g+x)/3,I=(_+b+w)/3;var S=Yu.enlargeClipPoint_(C,I,M,_);var O=Yu.enlargeClipPoint_(C,I,g,b);var T=Yu.enlargeClipPoint_(C,I,x,w);l.moveTo(O[0],O[1]);l.lineTo(S[0],S[1]);l.lineTo(T[0],T[1]);l.clip();l.transform(N[0],N[2],N[1],N[3],M,_);l.translate(v[0]-y,v[3]-k);l.scale(e/s,-e/s);l.drawImage(m.canvas,0,0);l.restore()}));if(u){l.save();l.strokeStyle="black";l.lineWidth=1;a.getTriangles().forEach((function(t,i,s){var e=t.target;var r=(e[0][0]-z[0])/n,h=-(e[0][1]-z[1])/n;var a=(e[1][0]-z[0])/n,o=-(e[1][1]-z[1])/n;var f=(e[2][0]-z[0])/n,u=-(e[2][1]-z[1])/n;l.beginPath();l.moveTo(a,o);l.lineTo(r,h);l.lineTo(f,u);l.closePath();l.stroke()}));l.restore()}return l.canvas};var Bu=function(t,i,s,e,r){this.sourceProj_=t;this.targetProj_=i;var n={};var h=aa.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];if(!n[i]){n[i]=h(t)}return n[i]};this.maxSourceExtent_=e;this.errorThresholdSquared_=r*r;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!e&&!!this.sourceProj_.getExtent()&&Zh.getWidth(e)==Zh.getWidth(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?Zh.getWidth(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?Zh.getWidth(this.targetProj_.getExtent()):null;var a=Zh.getTopLeft(s);var o=Zh.getTopRight(s);var f=Zh.getBottomRight(s);var u=Zh.getBottomLeft(s);var l=this.transformInv_(a);var v=this.transformInv_(o);var c=this.transformInv_(f);var d=this.transformInv_(u);this.addQuad_(a,o,f,u,l,v,c,d,Oh.RASTER_REPROJECTION_MAX_SUBDIVISION);if(this.wrapsXInSource_){var m=Infinity;this.triangles_.forEach((function(t,i,s){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])}));this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];if(i[0][0]-m>this.sourceWorldWidth_/2){i[0][0]-=this.sourceWorldWidth_}if(i[1][0]-m>this.sourceWorldWidth_/2){i[1][0]-=this.sourceWorldWidth_}if(i[2][0]-m>this.sourceWorldWidth_/2){i[2][0]-=this.sourceWorldWidth_}var s=Math.min(i[0][0],i[1][0],i[2][0]);var e=Math.max(i[0][0],i[1][0],i[2][0]);if(e-s<this.sourceWorldWidth_/2){t.source=i}}}),this)}n={}};Bu.prototype.addTriangle_=function(t,i,s,e,r,n){this.triangles_.push({source:[e,r,n],target:[t,i,s]})};Bu.prototype.addQuad_=function(t,i,s,e,r,n,h,a,o){var f=Zh.boundingExtent([r,n,h,a]);var u=this.sourceWorldWidth_?Zh.getWidth(f)/this.sourceWorldWidth_:null;var l=this.sourceWorldWidth_;var v=this.sourceProj_.canWrapX()&&u>.5&&u<1;var c=false;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=Zh.boundingExtent([t,i,s,e]);var m=Zh.getWidth(d)/this.targetWorldWidth_;c|=m>Oh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}if(!v&&this.sourceProj_.isGlobal()&&u){c|=u>Oh.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}}if(!c&&this.maxSourceExtent_){if(!Zh.intersects(f,this.maxSourceExtent_)){return}}if(!c){if(!isFinite(r[0])||!isFinite(r[1])||!isFinite(n[0])||!isFinite(n[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(a[0])||!isFinite(a[1])){if(o>0){c=true}else{return}}}if(o>0){if(!c){var p=[(t[0]+s[0])/2,(t[1]+s[1])/2];var z=this.transformInv_(p);var M;if(v){var _=(qh.modulo(r[0],l)+qh.modulo(h[0],l))/2;M=_-qh.modulo(z[0],l)}else{M=(r[0]+h[0])/2-z[0]}var g=(r[1]+h[1])/2-z[1];var b=M*M+g*g;c=b>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var x=[(i[0]+s[0])/2,(i[1]+s[1])/2];var w=this.transformInv_(x);var y=[(e[0]+t[0])/2,(e[1]+t[1])/2];var k=this.transformInv_(y);this.addQuad_(t,i,x,y,r,n,w,k,o-1);this.addQuad_(y,x,s,e,k,w,h,a,o-1)}else{var E=[(t[0]+i[0])/2,(t[1]+i[1])/2];var N=this.transformInv_(E);var C=[(s[0]+e[0])/2,(s[1]+e[1])/2];var I=this.transformInv_(C);this.addQuad_(t,E,C,e,r,N,I,a,o-1);this.addQuad_(E,i,s,C,N,n,h,I,o-1)}return}}if(v){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}this.addTriangle_(t,s,e,r,h,a);this.addTriangle_(t,i,s,r,n,h)};Bu.prototype.calculateSourceExtent=function(){var t=Zh.createEmpty();this.triangles_.forEach((function(i,s,e){var r=i.source;Zh.extendCoordinate(t,r[0]);Zh.extendCoordinate(t,r[1]);Zh.extendCoordinate(t,r[2])}));return t};Bu.prototype.getTriangles=function(){return this.triangles_};var Hu=function(t,i,s,e,r,n,h,a,o,f,u){Uu.call(this,r,Ya.IDLE);this.renderEdges_=u!==undefined?u:false;this.pixelRatio_=h;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=e;this.wrappedTileCoord_=n?n:r;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var l=e.getTileCoordExtent(this.wrappedTileCoord_);var v=this.targetTileGrid_.getExtent();var c=this.sourceTileGrid_.getExtent();var d=v?Zh.getIntersection(l,v):l;if(Zh.getArea(d)===0){this.state=Ya.EMPTY;return}var m=t.getExtent();if(m){if(!c){c=m}else{c=Zh.getIntersection(c,m)}}var p=e.getResolution(this.wrappedTileCoord_[0]);var z=Zh.getCenter(d);var M=Yu.calculateSourceResolution(t,s,z,p);if(!isFinite(M)||M<=0){this.state=Ya.EMPTY;return}var _=f!==undefined?f:Oh.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;this.triangulation_=new Bu(t,s,d,c,M*_);if(this.triangulation_.getTriangles().length===0){this.state=Ya.EMPTY;return}this.sourceZ_=i.getZForResolution(M);var g=this.triangulation_.calculateSourceExtent();if(c){if(t.canWrapX()){g[1]=qh.clamp(g[1],c[1],c[3]);g[3]=qh.clamp(g[3],c[1],c[3])}else{g=Zh.getIntersection(g,c)}}if(!Zh.getArea(g)){this.state=Ya.EMPTY}else{var b=i.getTileRangeForExtentAndZ(g,this.sourceZ_);for(var x=b.minX;x<=b.maxX;x++){for(var w=b.minY;w<=b.maxY;w++){var y=o(this.sourceZ_,x,w,h);if(y){this.sourceTiles_.push(y)}}}if(this.sourceTiles_.length===0){this.state=Ya.EMPTY}}};Oh.inherits(Hu,Uu);Hu.prototype.disposeInternal=function(){if(this.state==Ya.LOADING){this.unlistenSources_()}Uu.prototype.disposeInternal.call(this)};Hu.prototype.getImage=function(){return this.canvas_};Hu.prototype.reproject_=function(){var t=[];this.sourceTiles_.forEach((function(i,s,e){if(i&&i.getState()==Ya.LOADED){t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}}),this);this.sourceTiles_.length=0;if(t.length===0){this.state=Ya.ERROR}else{var i=this.wrappedTileCoord_[0];var s=this.targetTileGrid_.getTileSize(i);var e=typeof s==="number"?s:s[0];var r=typeof s==="number"?s:s[1];var n=this.targetTileGrid_.getResolution(i);var h=this.sourceTileGrid_.getResolution(this.sourceZ_);var a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Yu.render(e,r,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),n,a,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=Ya.LOADED}this.changed()};Hu.prototype.load=function(){if(this.state==Ya.IDLE){this.state=Ya.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((function(i,s,e){var r=i.getState();if(r==Ya.IDLE||r==Ya.LOADING){t++;var n;n=Ph.listen(i,Wh.CHANGE,(function(s){var e=i.getState();if(e==Ya.LOADED||e==Ya.ERROR||e==Ya.EMPTY){Ph.unlistenByKey(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}),this);this.sourcesListenerKeys_.push(n)}}),this);this.sourceTiles_.forEach((function(t,i,s){var e=t.getState();if(e==Ya.IDLE){t.load()}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}}};Hu.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ph.unlistenByKey);this.sourcesListenerKeys_=null};var Ju=function(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;Uh.assert(Bh.isSorted(this.resolutions_,(function(t,i){return i-t}),true),17);var i;if(!t.origins){for(var s=0,e=this.resolutions_.length-1;s<e;++s){if(!i){i=this.resolutions_[s]/this.resolutions_[s+1]}else{if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=undefined;break}}}}this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;Uh.assert(this.origins_.length==this.resolutions_.length,20)}var r=t.extent;if(r!==undefined&&!this.origin_&&!this.origins_){this.origin_=Zh.getTopLeft(r)}Uh.assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;Uh.assert(this.tileSizes_.length==this.resolutions_.length,19)}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?Oh.DEFAULT_TILE_SIZE:null;Uh.assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=r!==undefined?r:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map((function(t,i){var s=new of(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));return s}),this)}else if(r){this.calculateTileRanges_(r)}};Ju.tmpTileCoord_=[0,0,0];Ju.prototype.forEachTileCoord=function(t,i,s){var e=this.getTileRangeForExtentAndZ(t,i);for(var r=e.minX,n=e.maxX;r<=n;++r){for(var h=e.minY,a=e.maxY;h<=a;++h){s([i,r,h])}}};Ju.prototype.forEachTileCoordParentTileRange=function(t,i,s,e,r){var n,h,a;var o=null;var f=t[0]-1;if(this.zoomFactor_===2){h=t[1];a=t[2]}else{o=this.getTileCoordExtent(t,r)}while(f>=this.minZoom){if(this.zoomFactor_===2){h=Math.floor(h/2);a=Math.floor(a/2);n=of.createOrUpdate(h,h,a,a,e)}else{n=this.getTileRangeForExtentAndZ(o,f,e)}if(i.call(s,f,n)){return true}--f}return false};Ju.prototype.getExtent=function(){return this.extent_};Ju.prototype.getMaxZoom=function(){return this.maxZoom};Ju.prototype.getMinZoom=function(){return this.minZoom};Ju.prototype.getOrigin=function(t){if(this.origin_){return this.origin_}else{return this.origins_[t]}};Ju.prototype.getResolution=function(t){return this.resolutions_[t]};Ju.prototype.getResolutions=function(){return this.resolutions_};Ju.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){var e=t[1]*2;var r=t[2]*2;return of.createOrUpdate(e,e+1,r,r+1,i)}var n=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null};Ju.prototype.getTileRangeExtent=function(t,i,s){var e=this.getOrigin(t);var r=this.getResolution(t);var n=vo.toSize(this.getTileSize(t),this.tmpSize_);var h=e[0]+i.minX*n[0]*r;var a=e[0]+(i.maxX+1)*n[0]*r;var o=e[1]+i.minY*n[1]*r;var f=e[1]+(i.maxY+1)*n[1]*r;return Zh.createOrUpdate(h,o,a,f,s)};Ju.prototype.getTileRangeForExtentAndZ=function(t,i,s){var e=Ju.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,false,e);var r=e[1];var n=e[2];this.getTileCoordForXYAndZ_(t[2],t[3],i,true,e);return of.createOrUpdate(r,e[1],n,e[2],s)};Ju.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]);var s=this.getResolution(t[0]);var e=vo.toSize(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*e[0]*s,i[1]+(t[2]+.5)*e[1]*s]};Ju.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]);var e=this.getResolution(t[0]);var r=vo.toSize(this.getTileSize(t[0]),this.tmpSize_);var n=s[0]+t[1]*r[0]*e;var h=s[1]+t[2]*r[1]*e;var a=n+r[0]*e;var o=h+r[1]*e;return Zh.createOrUpdate(n,h,a,o,i)};Ju.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,false,s)};Ju.prototype.getTileCoordForXYAndResolution_=function(t,i,s,e,r){var n=this.getZForResolution(s);var h=s/this.getResolution(n);var a=this.getOrigin(n);var o=vo.toSize(this.getTileSize(n),this.tmpSize_);var f=e?.5:0;var u=e?0:.5;var l=Math.floor((t-a[0])/s+f);var v=Math.floor((i-a[1])/s+u);var c=h*l/o[0];var d=h*v/o[1];if(e){c=Math.ceil(c)-1;d=Math.ceil(d)-1}else{c=Math.floor(c);d=Math.floor(d)}return ju.createOrUpdate(n,c,d,r)};Ju.prototype.getTileCoordForXYAndZ_=function(t,i,s,e,r){var n=this.getOrigin(s);var h=this.getResolution(s);var a=vo.toSize(this.getTileSize(s),this.tmpSize_);var o=e?.5:0;var f=e?0:.5;var u=Math.floor((t-n[0])/h+o);var l=Math.floor((i-n[1])/h+f);var v=u/a[0];var c=l/a[1];if(e){v=Math.ceil(v)-1;c=Math.ceil(c)-1}else{v=Math.floor(v);c=Math.floor(c)}return ju.createOrUpdate(s,v,c,r)};Ju.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,false,s)};Ju.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]};Ju.prototype.getTileSize=function(t){if(this.tileSize_){return this.tileSize_}else{return this.tileSizes_[t]}};Ju.prototype.getFullTileRange=function(t){if(!this.fullTileRanges_){return null}else{return this.fullTileRanges_[t]}};Ju.prototype.getZForResolution=function(t,i){var s=Bh.linearFindNearest(this.resolutions_,t,i||0);return qh.clamp(s,this.minZoom,this.maxZoom)};Ju.prototype.calculateTileRanges_=function(t){var i=this.resolutions_.length;var s=new Array(i);for(var e=this.minZoom;e<i;++e){s[e]=this.getTileRangeForExtentAndZ(t,e)}this.fullTileRanges_=s};var Zu={};Zu.getForProjection=function(t){var i=t.getDefaultTileGrid();if(!i){i=Zu.createForProjection(t);t.setDefaultTileGrid(i)}return i};Zu.wrapX=function(t,i,s){var e=i[0];var r=t.getTileCoordCenter(i);var n=Zu.extentFromProjection(s);if(!Zh.containsCoordinate(n,r)){var h=Zh.getWidth(n);var a=Math.ceil((n[0]-r[0])/h);r[0]+=h*a;return t.getTileCoordForCoordAndZ(r,e)}else{return i}};Zu.createForExtent=function(t,i,s,e){var r=e!==undefined?e:Hh.TOP_LEFT;var n=Zu.resolutionsFromExtent(t,i,s);return new Ju({extent:t,origin:Zh.getCorner(t,r),resolutions:n,tileSize:s})};Zu.createXYZ=function(t){var i={};Rh.assign(i,t!==undefined?t:{});if(i.extent===undefined){i.extent=aa.get("EPSG:3857").getExtent()}i.resolutions=Zu.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize);delete i.maxZoom;return new Ju(i)};Zu.resolutionsFromExtent=function(t,i,s){var e=i!==undefined?i:Oh.DEFAULT_MAX_ZOOM;var r=Zh.getHeight(t);var n=Zh.getWidth(t);var h=vo.toSize(s!==undefined?s:Oh.DEFAULT_TILE_SIZE);var a=Math.max(n/h[0],r/h[1]);var o=e+1;var f=new Array(o);for(var u=0;u<o;++u){f[u]=a/Math.pow(2,u)}return f};Zu.createForProjection=function(t,i,s,e){var r=Zu.extentFromProjection(t);return Zu.createForExtent(r,i,s,e)};Zu.extentFromProjection=function(t){t=aa.get(t);var i=t.getExtent();if(!i){var s=180*aa.METERS_PER_UNIT[ta.DEGREES]/t.getMetersPerUnit();i=Zh.createOrUpdate(-s,-s,s,s)}return i};var $u=function(t){this.html_=t.html;this.tileRanges_=t.tileRanges?t.tileRanges:null};$u.prototype.getHTML=function(){return this.html_};$u.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_){return true}var e,r,n,h;for(h in t){if(!(h in this.tileRanges_)){continue}n=t[h];var a;for(e=0,r=this.tileRanges_[h].length;e<r;++e){a=this.tileRanges_[h][e];if(a.intersects(n)){return true}var o=i.getTileRangeForExtentAndZ(Zu.extentFromProjection(s),parseInt(h,10));var f=o.getWidth();if(n.minX<o.minX||n.maxX>o.maxX){if(a.intersects(new of(qh.modulo(n.minX,f),qh.modulo(n.maxX,f),n.minY,n.maxY))){return true}if(n.getWidth()>f&&a.intersects(o)){return true}}}}return false};var Ku=function(t){jh.call(this);this.projection_=aa.get(t.projection);this.attributions_=null;this.attributions2_=this.adaptAttributions_(t.attributions);this.logo_=t.logo;this.state_=t.state!==undefined?t.state:ao.READY;this.wrapX_=t.wrapX!==undefined?t.wrapX:false};Oh.inherits(Ku,jh);Ku.prototype.adaptAttributions_=function(t){if(!t){return null}if(t instanceof $u){this.attributions_=[t];return function(i){return[t.getHTML()]}}if(Array.isArray(t)){if(t[0]instanceof $u){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(t){return i}}this.attributions_=t.map((function(t){return new $u({html:t})}));return function(i){return t}}if(typeof t==="function"){return t}this.attributions_=[new $u({html:t})];return function(i){return[t]}};Ku.prototype.forEachFeatureAtCoordinate=Oh.nullFunction;Ku.prototype.getAttributions=function(){return this.attributions_};Ku.prototype.getAttributions2=function(){return this.attributions2_};Ku.prototype.getLogo=function(){return this.logo_};Ku.prototype.getProjection=function(){return this.projection_};Ku.prototype.getResolutions=function(){};Ku.prototype.getState=function(){return this.state_};Ku.prototype.getWrapX=function(){return this.wrapX_};Ku.prototype.refresh=function(){this.changed()};Ku.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t);this.changed()};Ku.prototype.setLogo=function(t){this.logo_=t};Ku.prototype.setState=function(t){this.state_=t;this.changed()};var Qu=function(t){Ku.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=t.opaque!==undefined?t.opaque:false;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;this.tileCache=new Xu(t.cacheSize);this.tmpSize=[0,0];this.key_="";this.tileOptions={transition:t.transition}};Oh.inherits(Qu,Ku);Qu.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};Qu.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);if(s){s.expireCache(i)}};Qu.prototype.forEachLoadedTile=function(t,i,s,e){var r=this.getTileCacheForProjection(t);if(!r){return false}var n=true;var h,a,o;for(var f=s.minX;f<=s.maxX;++f){for(var u=s.minY;u<=s.maxY;++u){a=ju.getKeyZXY(i,f,u);o=false;if(r.containsKey(a)){h=r.get(a);o=h.getState()===Ya.LOADED;if(o){o=e(h)!==false}}if(!o){n=false}}}return n};Qu.prototype.getGutter=function(t){return 0};Qu.prototype.getKey=function(){return this.key_};Qu.prototype.setKey=function(t){if(this.key_!==t){this.key_=t;this.changed()}};Qu.prototype.getOpaque=function(t){return this.opaque_};Qu.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};Qu.prototype.getTile=function(t,i,s,e,r){};Qu.prototype.getTileGrid=function(){return this.tileGrid};Qu.prototype.getTileGridForProjection=function(t){if(!this.tileGrid){return Zu.getForProjection(t)}else{return this.tileGrid}};Qu.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();if(i&&!aa.equivalent(i,t)){return null}else{return this.tileCache}};Qu.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_};Qu.prototype.getTilePixelSize=function(t,i,s){var e=this.getTileGridForProjection(s);var r=this.getTilePixelRatio(i);var n=vo.toSize(e.getTileSize(t),this.tmpSize);if(r==1){return n}else{return vo.scale(n,r,this.tmpSize)}};Qu.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=i!==undefined?i:this.getProjection();var e=this.getTileGridForProjection(s);if(this.getWrapX()&&s.isGlobal()){t=Zu.wrapX(e,t,s)}return ju.withinExtentAndZ(t,e)?t:null};Qu.prototype.refresh=function(){this.tileCache.clear();this.changed()};Qu.prototype.useTile=Oh.nullFunction;Qu.Event=function(t,i){Dh.call(this,t);this.tile=i};Oh.inherits(Qu.Event,Dh);var tl={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var il=function(t){Qu.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition});this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Vu.nullTileUrlFunction;this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}if(t.tileUrlFunction){this.setTileUrlFunction(t.tileUrlFunction)}this.tileLoadingKeys_={}};Oh.inherits(il,Qu);il.prototype.getTileLoadFunction=function(){return this.tileLoadFunction};il.prototype.getTileUrlFunction=function(){return this.tileUrlFunction};il.prototype.getUrls=function(){return this.urls};il.prototype.handleTileChange=function(t){var i=t.target;var s=Oh.getUid(i);var e=i.getState();var r;if(e==Ya.LOADING){this.tileLoadingKeys_[s]=true;r=tl.TILELOADSTART}else if(s in this.tileLoadingKeys_){delete this.tileLoadingKeys_[s];r=e==Ya.ERROR?tl.TILELOADERROR:e==Ya.LOADED||e==Ya.ABORT?tl.TILELOADEND:undefined}if(r!=undefined){this.dispatchEvent(new Qu.Event(r,i))}};il.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()};il.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof i!=="undefined"){this.setKey(i)}else{this.changed()}};il.prototype.setUrl=function(t){var i=this.urls=Vu.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Vu.createFromTemplates(i,this.tileGrid),t)};il.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Vu.createFromTemplates(t,this.tileGrid),i)};il.prototype.useTile=function(t,i,s){var e=ju.getKeyZXY(t,i,s);if(this.tileCache.containsKey(e)){this.tileCache.get(e)}};var sl=function(t){il.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:sl.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:qu;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false};Oh.inherits(sl,il);sl.prototype.canExpireCache=function(){if(!Oh.ENABLE_RASTER_REPROJECTION){return il.prototype.canExpireCache.call(this)}if(this.tileCache.canExpireCache()){return true}else{for(var t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}}return false};sl.prototype.expireCache=function(t,i){if(!Oh.ENABLE_RASTER_REPROJECTION){il.prototype.expireCache.call(this,t,i);return}var s=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==s?i:{});for(var e in this.tileCacheForProjection){var r=this.tileCacheForProjection[e];r.expireCache(r==s?i:{})}};sl.prototype.getGutter=function(t){if(Oh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!aa.equivalent(this.getProjection(),t)){return 0}else{return this.getGutterInternal()}};sl.prototype.getGutterInternal=function(){return 0};sl.prototype.getOpaque=function(t){if(Oh.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!aa.equivalent(this.getProjection(),t)){return false}else{return il.prototype.getOpaque.call(this,t)}};sl.prototype.getTileGridForProjection=function(t){if(!Oh.ENABLE_RASTER_REPROJECTION){return il.prototype.getTileGridForProjection.call(this,t)}var i=this.getProjection();if(this.tileGrid&&(!i||aa.equivalent(i,t))){return this.tileGrid}else{var s=Oh.getUid(t).toString();if(!(s in this.tileGridForProjection)){this.tileGridForProjection[s]=Zu.getForProjection(t)}return this.tileGridForProjection[s]}};sl.prototype.getTileCacheForProjection=function(t){if(!Oh.ENABLE_RASTER_REPROJECTION){return il.prototype.getTileCacheForProjection.call(this,t)}var i=this.getProjection();if(!i||aa.equivalent(i,t)){return this.tileCache}else{var s=Oh.getUid(t).toString();if(!(s in this.tileCacheForProjection)){this.tileCacheForProjection[s]=new Xu(this.tileCache.highWaterMark)}return this.tileCacheForProjection[s]}};sl.prototype.createTile_=function(t,i,s,e,r,n){var h=[t,i,s];var a=this.getTileCoordForTileUrlFunction(h,r);var o=a?this.tileUrlFunction(a,e,r):undefined;var f=new this.tileClass(h,o!==undefined?Ya.IDLE:Ya.EMPTY,o!==undefined?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);f.key=n;Ph.listen(f,Wh.CHANGE,this.handleTileChange,this);return f};sl.prototype.getTile=function(t,i,s,e,r){var n=this.getProjection();if(!Oh.ENABLE_RASTER_REPROJECTION||!n||!r||aa.equivalent(n,r)){return this.getTileInternal(t,i,s,e,n||r)}else{var h=this.getTileCacheForProjection(r);var a=[t,i,s];var o;var f=ju.getKey(a);if(h.containsKey(f)){o=h.get(f)}var u=this.getKey();if(o&&o.key==u){return o}else{var l=this.getTileGridForProjection(n);var v=this.getTileGridForProjection(r);var c=this.getTileCoordForTileUrlFunction(a,r);var d=new Hu(n,l,r,v,a,c,this.getTilePixelRatio(e),this.getGutterInternal(),function(t,i,s,e){return this.getTileInternal(t,i,s,e,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);d.key=u;if(o){d.interimTile=o;d.refreshInterimChain();h.replace(f,d)}else{h.set(f,d)}return d}}};sl.prototype.getTileInternal=function(t,i,s,e,r){var n=null;var h=ju.getKeyZXY(t,i,s);var a=this.getKey();if(!this.tileCache.containsKey(h)){n=this.createTile_(t,i,s,e,r,a);this.tileCache.set(h,n)}else{n=this.tileCache.get(h);if(n.key!=a){var o=n;n=this.createTile_(t,i,s,e,r,a);if(o.getState()==Ya.IDLE){n.interimTile=o.interimTile}else{n.interimTile=o}n.refreshInterimChain();this.tileCache.replace(h,n)}}return n};sl.prototype.setRenderReprojectionEdges=function(t){if(!Oh.ENABLE_RASTER_REPROJECTION||this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection){this.tileCacheForProjection[i].clear()}this.changed()};sl.prototype.setTileGridForProjection=function(t,i){if(Oh.ENABLE_RASTER_REPROJECTION){var s=aa.get(t);if(s){var e=Oh.getUid(s).toString();if(!(e in this.tileGridForProjection)){this.tileGridForProjection[e]=i}}}};sl.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var el={KVP:"KVP",REST:"REST"};var rl=function(t){this.matrixIds_=t.matrixIds;Ju.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};Oh.inherits(rl,Ju);rl.prototype.getMatrixId=function(t){return this.matrixIds_[t]};rl.prototype.getMatrixIds=function(){return this.matrixIds_};rl.createFromCapabilitiesMatrixSet=function(t,i,s){var e=[];var r=[];var n=[];var h=[];var a=[];var o=s!==undefined?s:[];var f="SupportedCRS";var u="TileMatrix";var l="Identifier";var v="ScaleDenominator";var c="TopLeftCorner";var d="TileWidth";var m="TileHeight";var p=t[f];var z=aa.get(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||aa.get(p);var M=z.getMetersPerUnit();var _=z.getAxisOrientation().substr(0,2)=="ne";t[u].sort((function(t,i){return i[v]-t[v]}));t[u].forEach((function(t,i,s){var f;if(o.length>0){f=Bh.find(o,(function(i,s,e){return t[l]==i[u]}))}else{f=true}if(f){r.push(t[l]);var p=t[v]*28e-5/M;var z=t[d];var g=t[m];if(_){n.push([t[c][1],t[c][0]])}else{n.push(t[c])}e.push(p);h.push(z==g?z:[z,g]);a.push([t["MatrixWidth"],-t["MatrixHeight"]])}}));return new rl({extent:i,origins:n,resolutions:e,matrixIds:r,tileSizes:h,sizes:a})};var nl={};nl.appendParams=function(t,i){var s=[];Object.keys(i).forEach((function(t){if(i[t]!==null&&i[t]!==undefined){s.push(t+"="+encodeURIComponent(i[t]))}}));var e=s.join("&");t=t.replace(/[?&]$/,"");t=t.indexOf("?")===-1?t+"?":t+"&";return t+e};var hl=function(t){this.version_=t.version!==undefined?t.version:"1.0.0";this.format_=t.format!==undefined?t.format:"image/jpeg";this.dimensions_=t.dimensions!==undefined?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;var i=t.urls;if(i===undefined&&t.url!==undefined){i=Vu.expandUrl(t.url)}this.requestEncoding_=t.requestEncoding!==undefined?t.requestEncoding:el.KVP;var s=this.requestEncoding_;var e=t.tileGrid;var r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};if(s==el.KVP){Rh.assign(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_})}var n=this.dimensions_;this.createFromWMTSTemplate_=function(t){t=s==el.KVP?nl.appendParams(t,r):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in r?r[i.toLowerCase()]:t}));return function(i,r,h){if(!i){return undefined}else{var a={TileMatrix:e.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Rh.assign(a,n);var o=t;if(s==el.KVP){o=nl.appendParams(o,a)}else{o=o.replace(/\{(\w+?)\}/g,(function(t,i){return a[i]}))}return o}}};var h=i&&i.length>0?Vu.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Vu.nullTileUrlFunction;sl.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:e,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:h,urls:i,wrapX:t.wrapX!==undefined?t.wrapX:false,transition:t.transition});this.setKey(this.getKeyForDimensions_())};Oh.inherits(hl,sl);hl.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Vu.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)};hl.prototype.getDimensions=function(){return this.dimensions_};hl.prototype.getFormat=function(){return this.format_};hl.prototype.getLayer=function(){return this.layer_};hl.prototype.getMatrixSet=function(){return this.matrixSet_};hl.prototype.getRequestEncoding=function(){return this.requestEncoding_};hl.prototype.getStyle=function(){return this.style_};hl.prototype.getVersion=function(){return this.version_};hl.prototype.getKeyForDimensions_=function(){var t=0;var i=[];for(var s in this.dimensions_){i[t++]=s+"-"+this.dimensions_[s]}return i.join("/")};hl.prototype.updateDimensions=function(t){Rh.assign(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())};hl.optionsFromCapabilities=function(t,i){var s=t["Contents"]["Layer"];var e=Bh.find(s,(function(t,s,e){return t["Identifier"]==i["layer"]}));if(e===null){return null}var r=t["Contents"]["TileMatrixSet"];var n,h,a;if(e["TileMatrixSetLink"].length>1){if("projection"in i){n=Bh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){var n=Bh.find(r,(function(i){return i["Identifier"]==t["TileMatrixSet"]}));var h=n["SupportedCRS"];var a=aa.get(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||aa.get(h);var o=aa.get(i["projection"]);if(a&&o){return aa.equivalent(a,o)}else{return h==i["projection"]}}))}else{n=Bh.findIndex(e["TileMatrixSetLink"],(function(t,s,e){return t["TileMatrixSet"]==i["matrixSet"]}))}}else{n=0}if(n<0){n=0}h=e["TileMatrixSetLink"][n]["TileMatrixSet"];a=e["TileMatrixSetLink"][n]["TileMatrixSetLimits"];var o=e["Format"][0];if("format"in i){o=i["format"]}n=Bh.findIndex(e["Style"],(function(t,s,e){if("style"in i){return t["Title"]==i["style"]}else{return t["isDefault"]}}));if(n<0){n=0}var f=e["Style"][n]["Identifier"];var u={};if("Dimension"in e){e["Dimension"].forEach((function(t,i,s){var e=t["Identifier"];var r=t["Default"];if(r===undefined){r=t["Value"][0]}u[e]=r}))}var l=t["Contents"]["TileMatrixSet"];var v=Bh.find(l,(function(t,i,s){return t["Identifier"]==h}));var c;var d=v["SupportedCRS"];if(d){c=aa.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||aa.get(d)}if("projection"in i){var m=aa.get(i["projection"]);if(m){if(!c||aa.equivalent(m,c)){c=m}}}var p=e["WGS84BoundingBox"];var z,M;if(p!==undefined){var _=aa.get("EPSG:4326").getExtent();M=p[0]==_[0]&&p[2]==_[2];z=aa.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();if(g){if(!Zh.containsExtent(g,z)){z=undefined}}}var b=rl.createFromCapabilitiesMatrixSet(v,z,a);var x=[];var w=i["requestEncoding"];w=w!==undefined?w:"";if("OperationsMetadata"in t&&"GetTile"in t["OperationsMetadata"]){var y=t["OperationsMetadata"]["GetTile"]["DCP"]["HTTP"]["Get"];for(var k=0,E=y.length;k<E;++k){if(y[k]["Constraint"]){var N=Bh.find(y[k]["Constraint"],(function(t){return t["name"]=="GetEncoding"}));var C=N["AllowedValues"]["Value"];if(w===""){w=C[0]}if(w===el.KVP){if(Bh.includes(C,el.KVP)){x.push(y[k]["href"])}}else{break}}else if(y[k]["href"]){w=el.KVP;x.push(y[k]["href"])}}}if(x.length===0){w=el.REST;e["ResourceURL"].forEach((function(t){if(t["resourceType"]==="tile"){o=t["format"];x.push(t["template"])}}))}return{urls:x,layer:i["layer"],matrixSet:h,format:o,projection:c,requestEncoding:w,tileGrid:b,style:f,dimensions:u,wrapX:M,crossOrigin:i["crossOrigin"]}};var al={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var ol={};ol.DOCUMENT=document.implementation.createDocument("","",null);ol.createElementNS=function(t,i){return ol.DOCUMENT.createElementNS(t,i)};ol.getAllTextContent=function(t,i){return ol.getAllTextContent_(t,i,[]).join("")};ol.getAllTextContent_=function(t,i,s){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE){if(i){s.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""))}else{s.push(t.nodeValue)}}else{var e;for(e=t.firstChild;e;e=e.nextSibling){ol.getAllTextContent_(e,i,s)}}return s};ol.isDocument=function(t){return t instanceof Document};ol.isNode=function(t){return t instanceof Node};ol.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""};ol.setAttributeNS=function(t,i,s,e){t.setAttributeNS(i,s,e)};ol.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")};ol.makeArrayExtender=function(t,i){return function(s,e){var r=t.call(i,s,e);if(r!==undefined){var n=e[e.length-1];Bh.extend(n,r)}}};ol.makeArrayPusher=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){var n=e[e.length-1];n.push(r)}}};ol.makeReplacer=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){e[e.length-1]=r}}};ol.makeObjectPropertyPusher=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;var o;if(a in h){o=h[a]}else{o=h[a]=[]}o.push(n)}}};ol.makeObjectPropertySetter=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;h[a]=n}}};ol.makeChildAppender=function(t,i){return function(s,e,r){t.call(i!==undefined?i:this,s,e,r);var n=r[r.length-1];var h=n.node;h.appendChild(s)}};ol.makeArraySerializer=function(t,i){var s,e;return function(i,r,n){if(s===undefined){s={};var h={};h[i.localName]=t;s[i.namespaceURI]=h;e=ol.makeSimpleNodeFactory(i.localName)}ol.serialize(s,e,r,n)}};ol.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,e,r){var n=e[e.length-1];var h=n.node;var a=s;if(a===undefined){a=r}var o=i;if(i===undefined){o=h.namespaceURI}return ol.createElementNS(o,a)}};ol.OBJECT_PROPERTY_NODE_FACTORY=ol.makeSimpleNodeFactory();ol.makeSequence=function(t,i){var s=i.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=t[i[r]]}return e};ol.makeStructureNS=function(t,i,s){var e=s!==undefined?s:{};var r,n;for(r=0,n=t.length;r<n;++r){e[t[r]]=i}return e};ol.parseNode=function(t,i,s,e){var r;for(r=i.firstElementChild;r;r=r.nextElementSibling){var n=t[r.namespaceURI];if(n!==undefined){var h=n[r.localName];if(h!==undefined){h.call(e,r,s)}}}};ol.pushParseAndPop=function(t,i,s,e,r){e.push(t);ol.parseNode(i,s,e,r);return e.pop()};ol.serialize=function(t,i,s,e,r,n){var h=(r!==undefined?r:s).length;var a,o;for(var f=0;f<h;++f){a=s[f];if(a!==undefined){o=i.call(n,a,e,r!==undefined?r[f]:undefined);if(o!==undefined){t[o.namespaceURI][o.localName].call(n,o,a,e)}}}};ol.pushSerializeAndPop=function(t,i,s,e,r,n,h){r.push(t);ol.serialize(i,s,e,r,n,h);return r.pop()};var fl={};fl.loadFeaturesXhr=function(t,i,s,e){return function(r,n,h){var a=new XMLHttpRequest;a.open("GET",typeof t==="function"?t(r,n,h):t,true);if(i.getType()==al.ARRAY_BUFFER){a.responseType="arraybuffer"}a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=i.getType();var n;if(r==al.JSON||r==al.TEXT){n=a.responseText}else if(r==al.XML){n=a.responseXML;if(!n){n=ol.parse(a.responseText)}}else if(r==al.ARRAY_BUFFER){n=a.response}if(n){s.call(this,i.readFeatures(n,{featureProjection:h}),i.readProjection(n),i.getLastExtent())}else{e.call(this)}}else{e.call(this)}}.bind(this);a.onerror=function(){e.call(this)}.bind(this);a.send()}};fl.xhr=function(t,i){return fl.loadFeaturesXhr(t,i,(function(t,i){this.addFeatures(t)}),Oh.nullFunction)};var ul={};ul.all=function(t,i){return[[-Infinity,-Infinity,Infinity,Infinity]]};ul.bbox=function(t,i){return[t]};ul.tile=function(t){return function(i,s){var e=t.getZForResolution(s);var r=t.getTileRangeForExtentAndZ(i,e);var n=[];var h=[e,0,0];for(h[1]=r.minX;h[1]<=r.maxX;++h[1]){for(h[2]=r.minY;h[2]<=r.maxY;++h[2]){n.push(t.getTileCoordExtent(h))}}return n}};var ll={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var vl=function(t){var i=t||{};Ku.call(this,{attributions:i.attributions,logo:i.logo,projection:undefined,state:ao.READY,wrapX:i.wrapX!==undefined?i.wrapX:true});this.loader_=Oh.nullFunction;this.format_=i.format;this.overlaps_=i.overlaps==undefined?true:i.overlaps;this.url_=i.url;if(i.loader!==undefined){this.loader_=i.loader}else if(this.url_!==undefined){Uh.assert(this.format_,7);this.loader_=fl.xhr(this.url_,this.format_)}this.strategy_=i.strategy!==undefined?i.strategy:ul.all;var s=i.useSpatialIndex!==undefined?i.useSpatialIndex:true;this.featuresRtree_=s?new pu:null;this.loadedExtentsRtree_=new pu;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;var e,r;if(i.features instanceof Sa){e=i.features;r=e.getArray()}else if(Array.isArray(i.features)){r=i.features}if(!s&&e===undefined){e=new Sa(r)}if(r!==undefined){this.addFeaturesInternal(r)}if(e!==undefined){this.bindFeaturesCollection_(e)}};Oh.inherits(vl,Ku);vl.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()};vl.prototype.addFeatureInternal=function(t){var i=Oh.getUid(t).toString();if(!this.addToIndex_(i,t)){return}this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var e=s.getExtent();if(this.featuresRtree_){this.featuresRtree_.insert(e,t)}}else{this.nullGeometryFeatures_[i]=t}this.dispatchEvent(new vl.Event(ll.ADDFEATURE,t))};vl.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[Ph.listen(i,Wh.CHANGE,this.handleFeatureChange_,this),Ph.listen(i,Ah.PROPERTYCHANGE,this.handleFeatureChange_,this)]};vl.prototype.addToIndex_=function(t,i){var s=true;var e=i.getId();if(e!==undefined){if(!(e.toString()in this.idIndex_)){this.idIndex_[e.toString()]=i}else{s=false}}else{Uh.assert(!(t in this.undefIdIndex_),30);this.undefIdIndex_[t]=i}return s};vl.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()};vl.prototype.addFeaturesInternal=function(t){var i,s,e,r;var n=[];var h=[];var a=[];for(s=0,e=t.length;s<e;s++){r=t[s];i=Oh.getUid(r).toString();if(this.addToIndex_(i,r)){h.push(r)}}for(s=0,e=h.length;s<e;s++){r=h[s];i=Oh.getUid(r).toString();this.setupChangeEvents_(i,r);var o=r.getGeometry();if(o){var f=o.getExtent();n.push(f);a.push(r)}else{this.nullGeometryFeatures_[i]=r}}if(this.featuresRtree_){this.featuresRtree_.load(n,a)}for(s=0,e=h.length;s<e;s++){this.dispatchEvent(new vl.Event(ll.ADDFEATURE,h[s]))}};vl.prototype.bindFeaturesCollection_=function(t){var i=false;Ph.listen(this,ll.ADDFEATURE,(function(s){if(!i){i=true;t.push(s.feature);i=false}}));Ph.listen(this,ll.REMOVEFEATURE,(function(s){if(!i){i=true;t.remove(s.feature);i=false}}));Ph.listen(t,Ia.ADD,(function(t){if(!i){i=true;this.addFeature(t.element);i=false}}),this);Ph.listen(t,Ia.REMOVE,(function(t){if(!i){i=true;this.removeFeature(t.element);i=false}}),this);this.featuresCollection_=t};vl.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_){var s=this.featureChangeKeys_[i];s.forEach(Ph.unlistenByKey)}if(!this.featuresCollection_){this.featureChangeKeys_={};this.idIndex_={};this.undefIdIndex_={}}}else{if(this.featuresRtree_){this.featuresRtree_.forEach(this.removeFeatureInternal,this);for(var e in this.nullGeometryFeatures_){this.removeFeatureInternal(this.nullGeometryFeatures_[e])}}}if(this.featuresCollection_){this.featuresCollection_.clear()}if(this.featuresRtree_){this.featuresRtree_.clear()}this.loadedExtentsRtree_.clear();this.nullGeometryFeatures_={};var r=new vl.Event(ll.CLEAR);this.dispatchEvent(r);this.changed()};vl.prototype.forEachFeature=function(t,i){if(this.featuresRtree_){return this.featuresRtree_.forEach(t,i)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(t,i)}};vl.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){var e=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(e,(function(e){var r=e.getGeometry();if(r.intersectsCoordinate(t)){return i.call(s,e)}else{return undefined}}))};vl.prototype.forEachFeatureInExtent=function(t,i,s){if(this.featuresRtree_){return this.featuresRtree_.forEachInExtent(t,i,s)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(i,s)}};vl.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(e){var r=e.getGeometry();if(r.intersectsExtent(t)){var n=i.call(s,e);if(n){return n}}}))};vl.prototype.getFeaturesCollection=function(){return this.featuresCollection_};vl.prototype.getFeatures=function(){var t;if(this.featuresCollection_){t=this.featuresCollection_.getArray()}else if(this.featuresRtree_){t=this.featuresRtree_.getAll();if(!Rh.isEmpty(this.nullGeometryFeatures_)){Bh.extend(t,Rh.getValues(this.nullGeometryFeatures_))}}return t};vl.prototype.getFeaturesAtCoordinate=function(t){var i=[];this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)}));return i};vl.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)};vl.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0];var e=t[1];var r=null;var n=[NaN,NaN];var h=Infinity;var a=[-Infinity,-Infinity,Infinity,Infinity];var o=i?i:Kh.TRUE;this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry();var f=h;h=i.closestPointXY(s,e,n,h);if(h<f){r=t;var u=Math.sqrt(h);a[0]=s-u;a[1]=e-u;a[2]=s+u;a[3]=e+u}}}));return r};vl.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)};vl.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return i!==undefined?i:null};vl.prototype.getFormat=function(){return this.format_};vl.prototype.getOverlaps=function(){return this.overlaps_};vl.prototype.getResolutions=function(){};vl.prototype.getUrl=function(){return this.url_};vl.prototype.handleFeatureChange_=function(t){var i=t.target;var s=Oh.getUid(i).toString();var e=i.getGeometry();if(!e){if(!(s in this.nullGeometryFeatures_)){if(this.featuresRtree_){this.featuresRtree_.remove(i)}this.nullGeometryFeatures_[s]=i}}else{var r=e.getExtent();if(s in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[s];if(this.featuresRtree_){this.featuresRtree_.insert(r,i)}}else{if(this.featuresRtree_){this.featuresRtree_.update(r,i)}}}var n=i.getId();if(n!==undefined){var h=n.toString();if(s in this.undefIdIndex_){delete this.undefIdIndex_[s];this.idIndex_[h]=i}else{if(this.idIndex_[h]!==i){this.removeFromIdIndex_(i);this.idIndex_[h]=i}}}else{if(!(s in this.undefIdIndex_)){this.removeFromIdIndex_(i);this.undefIdIndex_[s]=i}}this.changed();this.dispatchEvent(new vl.Event(ll.CHANGEFEATURE,i))};vl.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Rh.isEmpty(this.nullGeometryFeatures_)};vl.prototype.loadFeatures=function(t,i,s){var e=this.loadedExtentsRtree_;var r=this.strategy_(t,i);var n,h;for(n=0,h=r.length;n<h;++n){var a=r[n];var o=e.forEachInExtent(a,(function(t){return Zh.containsExtent(t.extent,a)}));if(!o){this.loader_.call(this,a,i,s);e.insert(a,{extent:a.slice()})}}};vl.prototype.removeLoadedExtent=function(t){var i=this.loadedExtentsRtree_;var s;i.forEachInExtent(t,(function(i){if(Zh.equals(i.extent,t)){s=i;return true}}));if(s){i.remove(s)}};vl.prototype.removeFeature=function(t){var i=Oh.getUid(t).toString();if(i in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[i]}else{if(this.featuresRtree_){this.featuresRtree_.remove(t)}}this.removeFeatureInternal(t);this.changed()};vl.prototype.removeFeatureInternal=function(t){var i=Oh.getUid(t).toString();this.featureChangeKeys_[i].forEach(Ph.unlistenByKey);delete this.featureChangeKeys_[i];var s=t.getId();if(s!==undefined){delete this.idIndex_[s.toString()]}else{delete this.undefIdIndex_[i]}this.dispatchEvent(new vl.Event(ll.REMOVEFEATURE,t))};vl.prototype.removeFromIdIndex_=function(t){var i=false;for(var s in this.idIndex_){if(this.idIndex_[s]===t){delete this.idIndex_[s];i=true;break}}return i};vl.prototype.setLoader=function(t){this.loader_=t};vl.Event=function(t,i){Dh.call(this,t);this.feature=i};Oh.inherits(vl.Event,Dh);var cl={};cl.lineString=function(t,i,s,e,r,n){var h=NaN;var a=NaN;var o=(s-i)/e;if(o===1){h=t[i];a=t[i+1]}else if(o==2){h=(1-r)*t[i]+r*t[i+e];a=(1-r)*t[i+1]+r*t[i+e+1]}else if(o!==0){var f=t[i];var u=t[i+1];var l=0;var v=[0];var c;for(c=i+e;c<s;c+=e){var d=t[c];var m=t[c+1];l+=Math.sqrt((d-f)*(d-f)+(m-u)*(m-u));v.push(l);f=d;u=m}var p=r*l;var z=Bh.binarySearch(v,p);if(z<0){var M=(p-v[-z-2])/(v[-z-1]-v[-z-2]);var _=i+(-z-2)*e;h=qh.lerp(t[_],t[_+e],M);a=qh.lerp(t[_+1],t[_+e+1],M)}else{h=t[i+z*e];a=t[i+z*e+1]}}if(n){n[0]=h;n[1]=a;return n}else{return[h,a]}};cl.lineStringCoordinateAtM=function(t,i,s,e,r,n){if(s==i){return null}var h;if(r<t[i+e-1]){if(n){h=t.slice(i,i+e);h[e-1]=r;return h}else{return null}}else if(t[s-1]<r){if(n){h=t.slice(s-e,s);h[e-1]=r;return h}else{return null}}if(r==t[i+e-1]){return t.slice(i,i+e)}var a=i/e;var o=s/e;while(a<o){var f=a+o>>1;if(r<t[(f+1)*e-1]){o=f}else{a=f+1}}var u=t[a*e-1];if(r==u){return t.slice((a-1)*e,(a-1)*e+e)}var l=t[(a+1)*e-1];var v=(r-u)/(l-u);h=[];var c;for(c=0;c<e-1;++c){h.push(qh.lerp(t[(a-1)*e+c],t[a*e+c],v))}h.push(r);return h};cl.lineStringsCoordinateAtM=function(t,i,s,e,r,n,h){if(h){return cl.lineStringCoordinateAtM(t,i,s[s.length-1],e,r,n)}var a;if(r<t[e-1]){if(n){a=t.slice(0,e);a[e-1]=r;return a}else{return null}}if(t[t.length-1]<r){if(n){a=t.slice(t.length-e);a[e-1]=r;return a}else{return null}}var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];if(i==u){continue}if(r<t[i+e-1]){return null}else if(r<=t[u-1]){return cl.lineStringCoordinateAtM(t,i,u,e,r,false)}i=u}return null};var dl=function(t,i){ua.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};Oh.inherits(dl,ua);dl.prototype.appendCoordinate=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.slice()}else{Bh.extend(this.flatCoordinates,t)}this.changed()};dl.prototype.clone=function(){var t=new dl(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};dl.prototype.closestPointXY=function(t,i,s,e){if(e<Zh.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(va.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return va.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,false,t,i,s,e)};dl.prototype.forEachSegment=function(t,i){return ga.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};dl.prototype.getCoordinateAtM=function(t,i){if(this.layout!=$h.XYM&&this.layout!=$h.XYZM){return null}var s=i!==undefined?i:false;return cl.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,s)};dl.prototype.getCoordinates=function(){return da.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};dl.prototype.getCoordinateAt=function(t,i){return cl.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};dl.prototype.getLength=function(){return Sf.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};dl.prototype.getFlatMidpoint=function(){if(this.flatMidpointRevision_!=this.getRevision()){this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_);this.flatMidpointRevision_=this.getRevision()}return this.flatMidpoint_};dl.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=ma.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new dl(null);s.setFlatCoordinates($h.XY,i);return s};dl.prototype.getType=function(){return Xh.LINE_STRING};dl.prototype.intersectsExtent=function(t){return ba.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};dl.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates($h.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=ca.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};dl.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var ml={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var pl=function(t){var i=t?t:{};var s=Rh.assign({},i);delete s.preload;delete s.useInterimTilesOnError;Mo.call(this,s);this.setPreload(i.preload!==undefined?i.preload:0);this.setUseInterimTilesOnError(i.useInterimTilesOnError!==undefined?i.useInterimTilesOnError:true);this.type=qo.TILE};Oh.inherits(pl,Mo);pl.prototype.getPreload=function(){return this.get(ml.PRELOAD)};pl.prototype.setPreload=function(t){this.set(ml.PRELOAD,t)};pl.prototype.getUseInterimTilesOnError=function(){return this.get(ml.USE_INTERIM_TILES_ON_ERROR)};pl.prototype.setUseInterimTilesOnError=function(t){this.set(ml.USE_INTERIM_TILES_ON_ERROR,t)};var zl=function(t){var i=t?t:{};var s=Rh.assign({},i);delete s.style;delete s.renderBuffer;delete s.updateWhileAnimating;delete s.updateWhileInteracting;Mo.call(this,s);this.declutter_=i.declutter!==undefined?i.declutter:false;this.renderBuffer_=i.renderBuffer!==undefined?i.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(i.style);this.updateWhileAnimating_=i.updateWhileAnimating!==undefined?i.updateWhileAnimating:false;this.updateWhileInteracting_=i.updateWhileInteracting!==undefined?i.updateWhileInteracting:false;this.renderMode_=i.renderMode||Xo.VECTOR;this.type=qo.VECTOR};Oh.inherits(zl,Mo);zl.prototype.getDeclutter=function(){return this.declutter_};zl.prototype.setDeclutter=function(t){this.declutter_=t};zl.prototype.getRenderBuffer=function(){return this.renderBuffer_};zl.prototype.getRenderOrder=function(){return this.get(zl.Property_.RENDER_ORDER)};zl.prototype.getStyle=function(){return this.style_};zl.prototype.getStyleFunction=function(){return this.styleFunction_};zl.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_};zl.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_};zl.prototype.setRenderOrder=function(t){this.set(zl.Property_.RENDER_ORDER,t)};zl.prototype.setStyle=function(t){this.style_=t!==undefined?t:Wu.defaultFunction;this.styleFunction_=t===null?undefined:Wu.createFunction(this.style_);this.changed()};zl.prototype.getRenderMode=function(){return this.renderMode_};zl.Property_={RENDER_ORDER:"renderOrder"};var Ml={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};var _l=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV");this.innerElement_.className=s+"-inner";this.element_=document.createElement("DIV");this.element_.className=s+" "+po.CLASS_UNSELECTABLE;this.element_.appendChild(this.innerElement_);this.viewState_=null;this.minWidth_=i.minWidth!==undefined?i.minWidth:64;this.renderedVisible_=false;this.renderedWidth_=undefined;this.renderedHTML_="";var e=i.render?i.render:_l.render;mo.call(this,{element:this.element_,render:e,target:i.target});Ph.listen(this,jh.getChangeEventType(_l.Property_.UNITS),this.handleUnitsChanged_,this);this.setUnits(i.units||Ml.METRIC)};Oh.inherits(_l,mo);_l.LEADING_DIGITS=[1,2,5];_l.prototype.getUnits=function(){return this.get(_l.Property_.UNITS)};_l.render=function(t){var i=t.frameState;if(!i){this.viewState_=null}else{this.viewState_=i.viewState}this.updateElement_()};_l.prototype.handleUnitsChanged_=function(){this.updateElement_()};_l.prototype.setUnits=function(t){this.set(_l.Property_.UNITS,t)};_l.prototype.updateElement_=function(){var t=this.viewState_;if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}var i=t.center;var s=t.projection;var e=this.getUnits();var r=e==Ml.DEGREES?ta.DEGREES:ta.METERS;var n=aa.getPointResolution(s,t.resolution,i,r);if(e!=Ml.DEGREES){n*=s.getMetersPerUnit()}var h=this.minWidth_*n;var a="";if(e==Ml.DEGREES){var o=aa.METERS_PER_UNIT[ta.DEGREES];if(s.getUnits()==ta.DEGREES){h*=o}else{n/=o}if(h<o/60){a="″";n*=3600}else if(h<o){a="′";n*=60}else{a="°"}}else if(e==Ml.IMPERIAL){if(h<.9144){a="in";n/=.0254}else if(h<1609.344){a="ft";n/=.3048}else{a="mi";n/=1609.344}}else if(e==Ml.NAUTICAL){n/=1852;a="nm"}else if(e==Ml.METRIC){if(h<.001){a="μm";n*=1e6}else if(h<1){a="mm";n*=1e3}else if(h<1e3){a="m"}else{a="km";n/=1e3}}else if(e==Ml.US){if(h<.9144){a="in";n*=39.37}else if(h<1609.344){a="ft";n/=.30480061}else{a="mi";n/=1609.3472}}else{Uh.assert(false,33)}var f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));var u,l;while(true){u=_l.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3));l=Math.round(u/n);if(isNaN(l)){this.element_.style.display="none";this.renderedVisible_=false;return}else if(l>=this.minWidth_){break}++f}var v=u+" "+a;if(this.renderedHTML_!=v){this.innerElement_.innerHTML=v;this.renderedHTML_=v}if(this.renderedWidth_!=l){this.innerElement_.style.width=l+"px";this.renderedWidth_=l}if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}};_l.Property_={UNITS:"units"};var gl={FRACTION:"fraction",PIXELS:"pixels"};var bl=function(t,i,s,e,r,n){Fh.call(this);this.hitDetectionImage_=null;this.image_=!t?new Image:t;if(e!==null){this.image_.crossOrigin=e}this.canvas_=n?document.createElement("CANVAS"):null;this.color_=n;this.imageListenerKeys_=null;this.imageState_=r;this.size_=s;this.src_=i;this.tainting_=false;if(this.imageState_==Vo.LOADED){this.determineTainting_()}};Oh.inherits(bl,Fh);bl.get=function(t,i,s,e,r,n){var h=nf.iconImageCache;var a=h.get(i,e,n);if(!a){a=new bl(t,i,s,e,r,n);h.set(i,e,n,a)}return a};bl.prototype.determineTainting_=function(){var t=ro.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainting_=true}};bl.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Wh.CHANGE)};bl.prototype.handleImageError_=function(){this.imageState_=Vo.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};bl.prototype.handleImageLoad_=function(){this.imageState_=Vo.LOADED;if(this.size_){this.image_.width=this.size_[0];this.image_.height=this.size_[1]}this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.replaceColor_();this.dispatchChangeEvent_()};bl.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_};bl.prototype.getImageState=function(){return this.imageState_};bl.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_){if(this.tainting_){var i=this.size_[0];var s=this.size_[1];var e=ro.createCanvasContext2D(i,s);e.fillRect(0,0,i,s);this.hitDetectionImage_=e.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_};bl.prototype.getSize=function(){return this.size_};bl.prototype.getSrc=function(){return this.src_};bl.prototype.load=function(){if(this.imageState_==Vo.IDLE){this.imageState_=Vo.LOADING;this.imageListenerKeys_=[Ph.listenOnce(this.image_,Wh.ERROR,this.handleImageError_,this),Ph.listenOnce(this.image_,Wh.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}};bl.prototype.replaceColor_=function(){if(this.tainting_||this.color_===null){return}this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);var i=t.getImageData(0,0,this.image_.width,this.image_.height);var s=i.data;var e=this.color_[0]/255;var r=this.color_[1]/255;var n=this.color_[2]/255;for(var h=0,a=s.length;h<a;h+=4){s[h]*=e;s[h+1]*=r;s[h+2]*=n}t.putImageData(i,0,0)};bl.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ph.unlistenByKey);this.imageListenerKeys_=null};var xl={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var wl=function(t){var i=t||{};this.anchor_=i.anchor!==undefined?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=i.anchorOrigin!==undefined?i.anchorOrigin:xl.TOP_LEFT;this.anchorXUnits_=i.anchorXUnits!==undefined?i.anchorXUnits:gl.FRACTION;this.anchorYUnits_=i.anchorYUnits!==undefined?i.anchorYUnits:gl.FRACTION;this.crossOrigin_=i.crossOrigin!==undefined?i.crossOrigin:null;var s=i.img!==undefined?i.img:null;var e=i.imgSize!==undefined?i.imgSize:null;var r=i.src;Uh.assert(!(r!==undefined&&s),4);Uh.assert(!s||s&&e,5);if((r===undefined||r.length===0)&&s){r=s.src||Oh.getUid(s).toString()}Uh.assert(r!==undefined&&r.length>0,6);var n=i.src!==undefined?Vo.IDLE:Vo.LOADED;this.color_=i.color!==undefined?Jo.asArray(i.color):null;this.iconImage_=bl.get(s,r,e,this.crossOrigin_,n,this.color_);this.offset_=i.offset!==undefined?i.offset:[0,0];this.offsetOrigin_=i.offsetOrigin!==undefined?i.offsetOrigin:xl.TOP_LEFT;this.origin_=null;this.size_=i.size!==undefined?i.size:null;var h=i.opacity!==undefined?i.opacity:1;var a=i.rotateWithView!==undefined?i.rotateWithView:false;var o=i.rotation!==undefined?i.rotation:0;var f=i.scale!==undefined?i.scale:1;var u=i.snapToPixel!==undefined?i.snapToPixel:true;Pu.call(this,{opacity:h,rotation:o,scale:f,snapToPixel:u,rotateWithView:a})};Oh.inherits(wl,Pu);wl.prototype.clone=function(){return new wl({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:this.size_!==null?this.size_.slice():undefined,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};wl.prototype.getAnchor=function(){if(this.normalizedAnchor_){return this.normalizedAnchor_}var t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==gl.FRACTION||this.anchorYUnits_==gl.FRACTION){if(!i){return null}t=this.anchor_.slice();if(this.anchorXUnits_==gl.FRACTION){t[0]*=i[0]}if(this.anchorYUnits_==gl.FRACTION){t[1]*=i[1]}}if(this.anchorOrigin_!=xl.TOP_LEFT){if(!i){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_==xl.TOP_RIGHT||this.anchorOrigin_==xl.BOTTOM_RIGHT){t[0]=-t[0]+i[0]}if(this.anchorOrigin_==xl.BOTTOM_LEFT||this.anchorOrigin_==xl.BOTTOM_RIGHT){t[1]=-t[1]+i[1]}}this.normalizedAnchor_=t;return this.normalizedAnchor_};wl.prototype.getColor=function(){return this.color_};wl.prototype.getImage=function(t){return this.iconImage_.getImage(t)};wl.prototype.getImageSize=function(){return this.iconImage_.getSize()};wl.prototype.getHitDetectionImageSize=function(){return this.getImageSize()};wl.prototype.getImageState=function(){return this.iconImage_.getImageState()};wl.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)};wl.prototype.getOrigin=function(){if(this.origin_){return this.origin_}var t=this.offset_;if(this.offsetOrigin_!=xl.TOP_LEFT){var i=this.getSize();var s=this.iconImage_.getSize();if(!i||!s){return null}t=t.slice();if(this.offsetOrigin_==xl.TOP_RIGHT||this.offsetOrigin_==xl.BOTTOM_RIGHT){t[0]=s[0]-i[0]-t[0]}if(this.offsetOrigin_==xl.BOTTOM_LEFT||this.offsetOrigin_==xl.BOTTOM_RIGHT){t[1]=s[1]-i[1]-t[1]}}this.origin_=t;return this.origin_};wl.prototype.getSrc=function(){return this.iconImage_.getSrc()};wl.prototype.getSize=function(){return!this.size_?this.iconImage_.getSize():this.size_};wl.prototype.listenImageChange=function(t,i){return Ph.listen(this.iconImage_,Wh.CHANGE,t,i)};wl.prototype.load=function(){this.iconImage_.load()};wl.prototype.unlistenImageChange=function(t,i){Ph.unlisten(this.iconImage_,Wh.CHANGE,t,i)};const yl=`<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const kl=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;position:relative;width:100%;aspect-ratio:1/1}stzh-olmap[hidden],stzh-olmap[stzh-hidden]{display:none}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media print{stzh-olmap{page-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall));background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall))}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3 + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{padding:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-xlarge)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';const El=kl;window.proj4=Ai;window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const Nl={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`};const Cl=Object.assign(Object.assign({},Nl),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`});const Il=Object.assign(Object.assign({},Nl),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`});const Sl=class{constructor(s){t(this,s);this.stzhInitialized=i(this,"stzhInitialized",7);this.stzhPostRender=i(this,"stzhPostRender",7);this.stzhMoveStart=i(this,"stzhMoveStart",7);this.stzhMoveEnd=i(this,"stzhMoveEnd",7);this.stzhMovePanZoom=i(this,"stzhMovePanZoom",7);this._layers={};this.geoPositionChanged=false;this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})};this.handleDoubleClick=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})};this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"});this.writeExtentToUrl().catch()};this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleInsideModalOpen=()=>{if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}};this.handlePrintButtonClick=()=>{if(!this.printIframe){this.printIframe=document.createElement("iframe");Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"});this.element.append(this.printIframe)}this.printIframe.innerHTML="";const t=this.printIframe.contentWindow;const i=this.constructor.style.replace('@charset "UTF-8";',"");const s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let e;this.map.once("postcompose",(function(t){const i=t.context.canvas;e=i.toDataURL("image/png")}));this.map.renderSync();t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${e}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `;setTimeout((()=>{try{t.document.execCommand("print",false,null)}catch(i){t.print()}}),1e3)};this.localization=undefined;this.hostname="www.ogc.stadt-zuerich.ch";this.scaleControl=true;this.layerControl=true;this.printControl=true;this.locationControl=false;this.layer="streets";this.zoom=7;this.zoomLocation=7;this.center=[2683311,1247082];this.centerMarker=true;this.pinchRotateThreshold=.3;this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333];this.writeExtentToUrlEnabled=false;this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}};this._initialExtent=undefined}layersWatcher(t){if(typeof t==="string"){this._layers=JSON.parse(t)}else{this._layers=t}}resolutionsWatcher(t){if(typeof t==="string"){this._resolutions=JSON.parse(t)}else{this._resolutions=t}}zoomWatcher(t){if(this.map){this.map.getView().setZoom(t)}}scaleControlWatcher(t){if(!this.map){return}if(t){this.scaleControlOl=new _l({units:"metric"});this.map.addControl(this.scaleControlOl)}else{if(this.scaleControl){this.map.removeControl(this.scaleControlOl)}this.scaleControlOl=null}}printControlWatcher(t){if(!this.map){return}if(t){this.printControlElement=document.createElement("button");this.printControlElement.className="ol-print";this.printControlElement.type="button";this.printControlElement.ariaLabel=this.localization.printLabel;this.printControlElement.addEventListener("click",this.handlePrintButtonClick);this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>';this.printControlOl=new mo({element:this.printControlElement});this.map.addControl(this.printControlOl)}else{if(this.printControlOl){this.map.removeControl(this.printControlOl)}this.printControlOl=null;this.printControlElement=null}}layerControlWatcher(t){if(!this.map||this.layersArray.length===1){return}if(t){this.layerControlElement=document.createElement("button");this.layerControlElement.className="ol-layer";this.layerControlElement.type="button";this.layerControlElement.addEventListener("click",(()=>{this.layer=this.layer==="streets"?"satellite":"streets"}));this.layerControlImageElement=document.createElement("img");this.layerControlImageElement.className="ol-layer__thumbnail";this.layerControlImageElement.setAttribute("role","presentation");this.layerControlImageElement.setAttribute("alt","");this.layerControlTextElement=document.createElement("span");this.layerControlTextElement.className="ol-layer__text";this.layerControlElement.appendChild(this.layerControlImageElement);this.layerControlElement.appendChild(this.layerControlTextElement);this.layerControlOl=new mo({element:this.layerControlElement});this.map.addControl(this.layerControlOl)}else{if(this.layerControlOl){this.map.removeControl(this.layerControlOl)}this.layerControlOl=null;this.layerControlElement=null;this.layerControlImageElement=null;this.layerControlTextElement=null}}locationControlWatcher(t){if(!this.map){return}if(t){this.locationControlElement=document.createElement("button");this.locationControlElement.type="button";this.locationControlElement.className="ol-location";this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>';this.locationControlElement.addEventListener("click",(()=>{const t=this.geolocation.getTracking();if(t){this.disableLocationTracking().catch()}else{this.enableLocationTracking().catch()}}));this.locationControlOl=new mo({element:this.locationControlElement});this.geolocation=new Ca({projection:this.map.getView().getProjection()});this.positionMarkerOl=new Gu;this.positionMarkerOl.setId("position");const t=new Wu({image:new wl(Il)});this.positionMarkerOl.setStyle(t);this.positionLayer.getSource().addFeature(this.positionMarkerOl);this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new za(t));if(!this.geoPositionChanged&&Zh.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())){this.geoPositionChanged=true;this.map.getView().setCenter(t);if(this.zoomLocation){this.map.getView().setZoom(this.zoomLocation)}}}));this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null);this.setLocationControlState(t)}));this.geolocation.on("error",(()=>{this.setLocationControlState(false)}));this.map.addControl(this.locationControlOl)}else{this.disableLocationTracking().catch();if(this.locationControlOl){this.map.removeControl(this.locationControlOl)}if(this.positionMarkerOl){this.positionLayer.getSource().removeFeature(this.positionMarkerOl)}this.locationControlOl=null;this.locationControlElement=null;this.geolocation=null;this.positionMarkerOl=null}}layerWatcher(t){if(!this.map){return}Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(true);this.map.getView().set("projection",this.projections[t]);const e=this.layersArray.find((([t])=>t!==this.layer));if(e){if(this.layerControlImageElement){this.layerControlImageElement.src=e[1].thumbnailUrl}if(this.layerControlTextElement){let t="";if(i==="streets"){t=this.localization.streetsLayerTitle}else if(i==="satellite"){t=this.localization.satelliteLayerTitle}this.layerControlTextElement.textContent=e[1].title||t}}}else{s.setVisible(false)}}))}centerWatcher(t){if(typeof t==="string"){this._center=JSON.parse(t)}else{this._center=t}if(this.map&&!this._initialExtent){this.map.getView().setCenter(this._center);if(this.centerMarkerOl){this.centerMarkerOl.setGeometry(new za(this._center))}}}async centerMarkerWatcher(t){if(t){this.centerMarkerOl=await this.addIconMarker(this._center)}else if(this.centerMarkerOl){this.removeIconMarker(this.centerMarkerOl)}}async getMap(){return this.map}async writeExtentToUrl(){if(this.writeExtentToUrlEnabled){const t=this.map.getView();const i=t.calculateExtent(this.map.getSize());const[s,e,r,n]=i;const h=new URLSearchParams(window.location.search);h.set("extent[0]",s.toFixed(10));h.set("extent[1]",e.toFixed(10));h.set("extent[2]",r.toFixed(10));h.set("extent[3]",n.toFixed(10));const a=`${window.location.pathname}?${h.toString()}`;history.replaceState(null,"",a)}}async getVisibleMarkers(){const t=this.iconLayer.getSource();const i=t.getFeatures();if(i.length===0){return[]}const s=this.map.getView().calculateExtent(this.map.getSize());return i.filter((t=>{const i=t.getGeometry().getExtent();return Zh.intersects(s,i)}))}async findMarkerById(t){const i=this.iconLayer.getSource().getFeatures();return i.find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new Gu({geometry:new za(t)});const e=new Wu({image:new wl(Nl)});if(i&&i.id){s.setProperties({id:i.id});s.setId(i.id)}s.setProperties({stzh:i});s.setStyle(e);this.iconLayer.getSource().addFeature(s);return s}async addIconMarkers(t){for(const i of t){await this.addIconMarker(i.coordinates,i.props)}return true}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource();const s=i.getFeatures();if(s.length===0){return}let e=Zh.createEmpty();s.forEach((t=>{Zh.extend(e,t.getGeometry().getExtent())}));this.map.getView().fit(e,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new Wu({image:new wl(Cl)}))}async setIconMarkerInactive(t){t.setStyle(new Wu({image:new wl(Nl)}))}async setAllIconMarkersInactive(){const t=this.iconLayer.getSource();const i=t.getFeatures();i.forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=true){this.setLocationControlState(true);this.geoPositionChanged=!t;if(this.geolocation){this.geolocation.setTracking(true)}}async disableLocationTracking(){this.setLocationControlState(false);if(this.geolocation){this.geolocation.setTracking(false)}}async getDistance(t,i){const s=new dl([t,i]);const e=Yh.getLength(s,{projection:this.map.getView().getProjection()});return e}handleLoad(){if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}}showPopover(t,i){if(i.imageUri){this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`}let s='<div class="stzh-olmap__popover-content">';if(i.title){s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`}if(i.text){s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`}if(i.data&&i.data.length){i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name="${t.icon}"></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`}))}s+="</div>";this.popoverElement.innerHTML+=s;if(i.href){this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`}const e=new Ru({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:false,autoPanAnimation:{duration:300}});this.map.addOverlay(e);this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent);const s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});const e=this.map.getTargetElement();if(s){e.style.cursor="pointer"}else{e.style.cursor=""}}))}setLocationControlState(t){if(this.positionLayer){this.positionLayer.setVisible(t)}if(this.locationControlElement){this.locationControlElement.classList.toggle("active",t)}}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel;t.name="plus";t.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel;i.name="minus";i.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const s=document.createElement("div");s.innerHTML=yl;const e=document.createElement("span");e.innerText=this.localization.rotateLabel;s.appendChild(e);const r=new Tu({controls:xo.defaults({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new Sa([new So,new Eo,new Io,new Fo({threshold:this.pinchRotateThreshold}),new Wo,new Po,new Lo,new Ao]),loadTilesWhileAnimating:true,loadTilesWhileInteracting:true,target:this.mapElement,logo:false});return r}createRasterLayer(t,i){return new pl({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){if(!this.projections){this.projections={}}this.projections[t]=new sa({code:"EPSG:2056",extent:i.extent});return this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:e,matrixSet:r,origin:n}=i;const h=[];for(let t=0;t<this._resolutions.length;t++){h.push(t)}const a=new rl({origin:n,resolutions:this._resolutions,matrixIds:h,tileSize:[512,512]});return new hl({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:e,matrixSet:r,requestEncoding:"REST"})}createIconLayer(){return new zl({source:new vl({})})}initMap(){this.map=this.createMap();this.map.on("postrender",this.handlePostRender);this.map.on("movestart",this.handleMoveStart);this.map.on("dblclick",this.handleDoubleClick);this.map.on("moveend",this.handleMoveEnd);this.map.on("pointerdrag",this.handlePointerdrag);this.map.on("change:resolution",this.handleChangeResolution);this.layersArray=Object.entries(this._layers);if(this.layersArray.length>2){throw new Error("There are only two different layers allowed.")}this.rasterLayers={};this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname);this.rasterLayers[t]=this.createRasterLayer(t,i.options);this.map.addLayer(this.rasterLayers[t])}));this.positionLayer=this.createIconLayer();this.positionLayer.setVisible(false);this.map.addLayer(this.positionLayer);this.iconLayer=this.createIconLayer();this.map.addLayer(this.iconLayer);const t=new eo({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});if(this._initialExtent){t.fit(this._initialExtent,{size:this.map.getSize()})}this.map.setView(t);this.centerWatcher(this.center);this.scaleControlWatcher(this.scaleControl);this.printControlWatcher(this.printControl);this.locationControlWatcher(this.locationControl);this.layerControlWatcher(this.layerControl);this.layerWatcher(this.layer);this.centerMarkerWatcher(this.centerMarker);this.initializeMarkerHover();this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch();this.popoverElement.innerHTML="";this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof za){this.setIconMarkerActive(t).catch();const i=t.getProperties();if(i.stzh){this.showPopover(i.geometry.flatCoordinates,i.stzh)}return true}}))}));requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})}));this.handleMoveEnd()}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers);this.resolutionsWatcher(this.resolutions);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap")}const t=new URLSearchParams(window.location.search);const i=[parseFloat(t.get("extent[0]")),parseFloat(t.get("extent[1]")),parseFloat(t.get("extent[2]")),parseFloat(t.get("extent[3]"))];if(!isNaN(i[0])&&!isNaN(i[1])&&!isNaN(i[2])&&!isNaN(i[3])){this._initialExtent=i}}componentWillUpdate(){if(this.map){this.map.setTarget(null);this.map=null}}componentDidRender(){if(this.map){return}this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");if(t){t.addEventListener("stzhOpen",this.handleInsideModalOpen)}}disconnectedCallback(){if(this.map){this.map.setTarget(null);this.map=null}const t=this.element.closest("stzh-dialog");if(t){t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}}render(){const t={"stzh-olmap":true,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl};return s(e,{key:"99dd4e3f9353ceb8c7b04cac7dd727a227241bdf"},s("div",{key:"12fd4d34b229c5c87f06f657612dea80e2d8339f",class:t},s("div",{key:"f90f41e9756a3607287725e557895df6118daf14",ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),s("div",{key:"2d196d427c0d1139cfed8b47d4fb6464aac0b916",ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return r(this)}static get watchers(){return{layers:["layersWatcher"],resolutions:["resolutionsWatcher"],zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};Sl.style=El;export{_ as stzh_checkbox,w as stzh_header,Sl as stzh_olmap};
|
|
8
|
-
//# sourceMappingURL=p-
|
|
8
|
+
//# sourceMappingURL=p-2b24520c.entry.js.map
|