function calculateSubscriptionPrice(t){return this.params=t||{},this.roundPrice=t=>{const e=currency_decimal_separator;currency_decimal_separator=".";const i=format_price(t,{mask:"#####0.00"});return currency_decimal_separator=e,i},this.formatPrice=t=>format_price(t,{mask:this.currencyFormat,currency:this.symbol,currency_space:this.currencySpace,currency_before_price:this.currencyBeforeValue}),this.percentagePrice=(t,e,i,n)=>{let s=0===n?0:i*(n/100);return s+=e,s=t-s,s>0?s:0},this.quotaPrice=(t,e,i)=>{let n=e+i;return n=t-n,n>0?n:0},this.calculatePercent=(t,e)=>100-100*e/t,this.netPrice=(t,e)=>{const i=t-t*e/100;return i>0?i:0},this.init=()=>{const{max:e,maxNet:i,save:n,before:s,rebateValue:o,rebateType:r,currencyFormat:a,symbol:l,currencySpace:c,currencyBeforeValue:u}=t;if(!e&&!o)return!1;this.currencyFormat=a||app_shop.vars?.currency?.format||app_shop.vars?.currency_format,this.symbol=l||app_shop.vars?.currency?.symbol||app_shop.vars?.symbol,this.currencySpace=c||app_shop.vars?.currency?.space||app_shop.vars?.currency_space,this.currencyBeforeValue=u||app_shop.vars?.currency?.beforeValue||app_shop.vars.currency_before_value,this.rebateType=r||"percentage";const h="percentage"===this.rebateType?this.percentagePrice(+e,+n,+s,+o):this.quotaPrice(+e,+n,+o),d=this.calculatePercent(e,h),p=this.netPrice(i,d);return{gross:{value:this.roundPrice(h),formatted:this.formatPrice(h)},net:{value:this.roundPrice(p),formatted:this.formatPrice(p)},percent:Math.round(d)}},this.init()}class VanillaCalendar{constructor(t,e){this.HTMLElement="object"==typeof t?t:document.querySelector(t),this.HTMLElement&&(this.type=e?.type??"default",this.date={min:e?.date?.min??"1970-01-01",max:e?.date?.max??"2470-12-31",today:e?.date?.today??new Date},this.info={top:e?.info?.top??!1,bottom:e?.info?.bottom??!1},this.customDayNames=e?.customDayNames??[],this.settings={lang:e?.settings?.lang??app_shop?.vars?.language?.symbol??"pl",iso8601:e?.settings?.iso8601??!0,workingDays:e?.settings?.workingDays??null,disabled:{weekDay:e?.settings?.disabled?.weekDay??null,weekends:e?.settings?.disabled?.weekends??!1},range:{min:e?.settings?.range?.min??this.date.min,max:e?.settings?.range?.max??this.date.max,disabled:e?.settings?.range?.disabled??null,enabled:e?.settings?.range?.enabled??null},selection:{day:e?.settings?.selection?.day??"single",month:e?.settings?.selection?.month??!0,year:e?.settings?.selection?.year??!0,time:e?.settings?.selection?.time??!1,controlTime:e?.settings?.selection?.controlTime??"all",stepHours:e?.settings?.selection?.stepHours??1,stepMinutes:e?.settings?.selection?.stepMinutes??1},selected:{dates:e?.settings?.selected?.dates??null,month:e?.settings?.selected?.month??null,year:e?.settings?.selected?.year??null,holidays:e?.settings?.selected?.holidays??null,time:e?.settings?.selected?.time??null},visibility:{templateHeader:e?.settings?.visibility?.templateHeader??"%M %Y",monthShort:e?.settings?.visibility?.monthShort??!0,weekNumbers:e?.settings?.visibility?.weekNumbers??!1,weekend:e?.settings?.visibility?.weekend??!0,today:e?.settings?.visibility?.today??!0,disabled:e?.settings?.visibility?.disabled??!1}},this.locale={months:e?.locale?.months??[],weekday:e?.locale?.weekday??[]},this.actions={clickDay:e?.actions?.clickDay??null,clickMonth:e?.actions?.clickMonth??null,clickYear:e?.actions?.clickYear??null,changeTime:e?.actions?.changeTime??null},this.popups=e?.popups??null,this.currentType=this.type,this.selectedKeeping=null,this.userTime=!1)}generateDate(t){const e=t.getUTCFullYear();let i=t.getUTCMonth()+1,n=t.getUTCDate();return i=i<10?`0${i}`:i,n=n<10?`0${n}`:n,`${e}-${i}-${n}`}transformTime12(t){const e=Number(t);let i=e;return 0===e?i="12":13===e?i="01":14===e?i="02":15===e?i="03":16===e?i="04":17===e?i="05":18===e?i="06":19===e?i="07":20===e?i="08":21===e?i="09":22===e?i="10":23===e&&(i="11"),i}transformTime24(t,e){const i=Number(t);let n=i;return"AM"===e?12===i&&(n="00"):"PM"===e&&(1===i?n="13":2===i?n="14":3===i?n="15":4===i?n="16":5===i?n="17":6===i?n="18":7===i?n="19":8===i?n="20":9===i?n="21":10===i?n="22":11===i&&(n="23")),n}setVariablesDates(){null!==this.settings.selected.dates?this.selectedDates=this.settings.selected.dates:this.selectedDates=[],null!==this.settings.selected.month&&this.settings.selected.month>=0&&this.settings.selected.month<12?this.selectedMonth=this.settings.selected.month:this.selectedMonth=this.date.today.getUTCMonth(),null!==this.settings.selected.year&&this.settings.selected.year>=0&&this.settings.selected.year<=9999?this.selectedYear=this.settings.selected.year:this.selectedYear=this.date.today.getUTCFullYear(),this.viewYear=this.selectedYear,this.dateMin=this.settings.visibility.disabled?new Date(this.date.min):new Date(this.settings.range.min),this.dateMax=this.settings.visibility.disabled?new Date(this.date.max):new Date(this.settings.range.max);const t=!0===this.settings.selection.time||12===this.settings.selection.time;if(t||24===this.settings.selection.time){if("string"==typeof this.settings.selected.time){const e=t?/^([0-9]|0[1-9]|1[0-2]):([0-5][0-9])|(AM|PM)/g:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])/g;this.settings.selected.time.replace(e,((e,i,n,s)=>{i&&n&&(this.userTime=!0,this.selectedHours=i,this.selectedMinutes=n),s&&t?this.selectedKeeping=s:t&&(this.selectedKeeping="AM")}))}!this.userTime&&t?(this.selectedHours=this.transformTime12(this.date.today.getHours()),this.selectedMinutes=this.date.today.getMinutes(),this.selectedKeeping=Number(this.date.today.getHours())>12?"PM":"AM"):this.userTime||(this.selectedHours=this.date.today.getHours(),this.selectedMinutes=this.date.today.getMinutes()),this.selectedHours=Number(this.selectedHours)<10?`0${Number(this.selectedHours)}`:`${this.selectedHours}`,this.selectedMinutes=Number(this.selectedMinutes)<10?`0${Number(this.selectedMinutes)}`:`${this.selectedMinutes}`,this.selectedTime=`${this.selectedHours}:${this.selectedMinutes}${this.selectedKeeping?` ${this.selectedKeeping}`:""}`}else this.settings.selection.time&&(this.settings.selection.time=null)}createDOM(){"default"===this.currentType?(this.HTMLElement.classList.add("vanilla-calendar_default"),this.HTMLElement.classList.remove("vanilla-calendar_month"),this.HTMLElement.classList.remove("vanilla-calendar_year"),this.HTMLElement.innerHTML=`\n      ${this.info.top?'\n      <div class="vanilla-calendar-info --top"></div>\n      ':""}\n      <div class="vanilla-calendar-header">\n        <button type="button"\n          class="vanilla-calendar-arrow vanilla-calendar-arrow_prev"\n          data-calendar-arrow="prev"\n          title="Prev">\n        </button>\n        <div class="vanilla-calendar-header__content"></div>\n        <button type="button"\n          class="vanilla-calendar-arrow vanilla-calendar-arrow_next"\n          data-calendar-arrow="next"\n          title="Next">\n        </button>\n      </div>\n      ${this.settings.visibility.weekNumbers?'\n      <div class="vanilla-calendar-column">\n        <b class="vanilla-calendar-column__title">#</b>\n        <div class="vanilla-calendar-column__content vanilla-calendar-week-numbers"></div>\n      </div>\n      ':""}\n      <div class="vanilla-calendar-content">\n        <div class="vanilla-calendar-week"></div>\n        <div class="vanilla-calendar-days"></div>\n        ${this.settings.selection.time?'\n        <div class="vanilla-calendar-time"></div>\n        ':""}\n      </div>\n      ${this.info.bottom?'\n      <div class="vanilla-calendar-info --bottom"></div>\n      ':""}\n    `):"month"===this.currentType?(this.HTMLElement.classList.remove("vanilla-calendar_default"),this.HTMLElement.classList.add("vanilla-calendar_month"),this.HTMLElement.classList.remove("vanilla-calendar_year"),this.HTMLElement.innerHTML='\n      <div class="vanilla-calendar-header">\n        <div class="vanilla-calendar-header__content"></div>\n      </div>\n      <div class="vanilla-calendar-content">\n        <div class="vanilla-calendar-months"></div>\n      </div>'):"year"===this.currentType&&(this.HTMLElement.classList.remove("vanilla-calendar_default"),this.HTMLElement.classList.remove("vanilla-calendar_month"),this.HTMLElement.classList.add("vanilla-calendar_year"),this.HTMLElement.innerHTML='\n      <div class="vanilla-calendar-header">\n        <button type="button"\n          class="vanilla-calendar-arrow vanilla-calendar-arrow_prev"\n          title="prev">\n        </button>\n        <div class="vanilla-calendar-header__content"></div>\n        <button type="button"\n          class="vanilla-calendar-arrow vanilla-calendar-arrow_next"\n          title="next">\n        </button>\n      </div>\n      <div class="vanilla-calendar-content">\n        <div class="vanilla-calendar-years"></div>\n      </div>')}createHeader(){const t=this.HTMLElement.querySelector(".vanilla-calendar-header__content"),e=this.settings.selection.month?"":" vanilla-calendar-month_disabled",i=this.settings.selection.year?"":" vanilla-calendar-year_disabled",n=`\n    <button type="button"\n      class="vanilla-calendar-month${e}"\n      data-calendar-selected-month="${this.selectedMonth}">\n      ${this.locale.months[this.selectedMonth]}\n    </button>`.replace(/[\n\t]/g,""),s=`\n    <button type="button"\n      class="vanilla-calendar-year${i}"\n      data-calendar-selected-year="${this.selectedYear}">\n      ${this.selectedYear}\n    </button>`.replace(/[\n\t]/g,"");let o=this.settings.visibility.templateHeader.replace("%M",n);o=o.replace("%Y",s),t.innerHTML=o}controlArrows(){if(!["default","year"].includes(this.currentType))return;const t=this.HTMLElement.querySelector(".vanilla-calendar-arrow_prev"),e=this.HTMLElement.querySelector(".vanilla-calendar-arrow_next");(()=>{if("default"!==this.currentType)return;const i=this.selectedMonth===this.dateMin.getUTCMonth(),n=this.selectedMonth===this.dateMax.getUTCMonth(),s=!this.settings.selection.year||this.selectedYear===this.dateMin.getUTCFullYear(),o=!this.settings.selection.year||this.selectedYear===this.dateMax.getUTCFullYear();i&&s||!this.settings.selection.month?t.style.visibility="hidden":t.style.visibility=null,n&&o||!this.settings.selection.month?e.style.visibility="hidden":e.style.visibility=null})(),(()=>{"year"===this.currentType&&(this.dateMin.getUTCFullYear()&&this.viewYear-7<=this.dateMin.getUTCFullYear()?t.style.visibility="hidden":t.style.visibility=null,this.dateMax.getUTCFullYear()&&this.viewYear+7>=this.dateMax.getUTCFullYear()?e.style.visibility="hidden":e.style.visibility=null)})()}createWeek(){const t=this.HTMLElement.querySelector(".vanilla-calendar-week"),e=document.createElement("b");e.className="vanilla-calendar-week__day";const i=[...this.locale.weekday];this.settings.iso8601&&i.push(i.shift()),t.innerHTML="";for(let n=0;n<i.length;n++){const s=i[n],o=e.cloneNode(!0);this.settings.visibility.weekend&&this.settings.iso8601?5!==n&&6!==n||o.classList.add("vanilla-calendar-week__day_weekend"):this.settings.visibility.weekend&&!this.settings.iso8601&&(0!==n&&6!==n||o.classList.add("vanilla-calendar-week__day_weekend")),o.innerText=`${s}`,t.append(o)}}getWeekNumber(t){const e=new Date(t).getUTCDate(),i=new Date(t).getUTCMonth(),n=new Date(t).getUTCFullYear(),s=new Date(n,i,e),o=new Date(Date.UTC(s.getUTCFullYear(),0,1)),r=Math.ceil(((s-o)/864e5+1)/7);return{year:s.getUTCFullYear(),week:r}}createWeekNumbers(t,e){if(!this.settings.visibility.weekNumbers)return;const i=this.HTMLElement.querySelector(".vanilla-calendar-week-numbers"),n=this.HTMLElement.querySelectorAll(".vanilla-calendar-day__btn"),s=Math.ceil((t+e)/7),o=document.createElement("span");o.className="vanilla-calendar-week-number",i.innerHTML="";for(let t=0;t<s;t++){const e=this.getWeekNumber(n[7*t].dataset.calendarDay),s=o.cloneNode(!0);s.innerText=`${e.week}`,s.dataset.calendarYearWeek=`${e.year}`,i.append(s)}}createPopup(t){if(this.popups)for(const e in this.popups)if(Object.hasOwnProperty.call(this.popups,e)){const i=t.querySelector(`[data-calendar-day="${e}"]`);if(i){const t=this.popups[e];i.classList.add(t.modifier),i.parentNode.innerHTML+=`<div class="vanilla-calendar-day__popup">${t.html}</div>`}}}createDays(){const t=new Date(Date.UTC(this.selectedYear,this.selectedMonth,1)),e=new Date(Date.UTC(this.selectedYear,this.selectedMonth+1,0)).getUTCDate();let i=Number(t.getUTCDay());this.settings.iso8601&&(i=Number((0!==t.getUTCDay()?t.getUTCDay():7)-1));const n=this.HTMLElement.querySelector(".vanilla-calendar-days"),s=document.createElement("div"),o=document.createElement("button");s.className="vanilla-calendar-day",o.className="vanilla-calendar-day__btn",o.type="button",["single","multiple","multiple-ranged"].includes(this.settings.selection.day)&&n.classList.add("vanilla-calendar-days_selecting"),n.innerHTML="";const r=(t,e,i,n)=>{!this.settings.visibility.weekend||0!==e&&6!==e||t.classList.add("vanilla-calendar-day__btn_weekend"),Array.isArray(this.settings.selected.holidays)&&this.settings.selected.holidays.forEach((e=>{e===i&&t.classList.add("vanilla-calendar-day__btn_holiday")}));let s=this.date.today.getUTCDate(),o=this.date.today.getUTCMonth()+1;s=s<10?`0${s}`:s,o=o<10?`0${o}`:o;const r=`${this.date.today.getUTCFullYear()}-${o}-${s}`;if(this.settings.visibility.today&&t.dataset.calendarDay===r&&t.classList.add("vanilla-calendar-day__btn_today"),0===this.selectedDates.indexOf(i)||this.selectedDates[0]&&this.selectedDates.indexOf(i)===this.selectedDates.length-1?t.classList.add("vanilla-calendar-day__btn_selected"):"multiple-ranged"===this.settings.selection.day&&this.selectedDates.indexOf(i)>0?(t.classList.add("vanilla-calendar-day__btn_selected"),t.classList.add("vanilla-calendar-day__btn_intermediate")):this.selectedDates.indexOf(i)>0&&t.classList.add("vanilla-calendar-day__btn_selected"),(this.settings.range.min>i||this.settings.range.max<i)&&t.classList.add("vanilla-calendar-day__btn_disabled"),this.settings.selection.month||n||t.classList.add("vanilla-calendar-day__btn_disabled"),this.settings.selection.year||new Date(i).getFullYear()===this.selectedYear||t.classList.add("vanilla-calendar-day__btn_disabled"),Array.isArray(this.settings.range.disabled)?this.settings.range.disabled.forEach((e=>{e===i&&t.classList.add("vanilla-calendar-day__btn_disabled")})):Array.isArray(this.settings.range.enabled)&&(t.classList.add("vanilla-calendar-day__btn_disabled"),this.settings.range.enabled.forEach((e=>{e===i&&t.classList.remove("vanilla-calendar-day__btn_disabled")}))),!this.settings.disabled.weekends||0!==e&&6!==e||t.classList.add("vanilla-calendar-day__btn_disabled"),Array.isArray(this.settings.disabled.weekDay)&&this.settings.disabled.weekDay.forEach((i=>{i===e&&t.classList.add("vanilla-calendar-day__btn_disabled")})),Array.isArray(this.settings.workingDays)&&(this.settings.workingDays.includes(e)||t.classList.add("vanilla-calendar-day__btn_disabled")),this.customDayNames?.length){const e=this.customDayNames.find((t=>t.date===i));if(e){const{class:i="",name:n}=e||{};t.classList.add(i),n&&(t.innerHTML=n)}}},a=(t,e,i,a,l)=>{const c=s.cloneNode(!0),u=o.cloneNode(!0);l&&u.classList.add(l),u.innerText=t,u.dataset.calendarDay=i,r(u,e,i,a),c.append(u),n.append(c)};(()=>{let t=new Date(Date.UTC(this.selectedYear,this.selectedMonth,0)).getUTCDate()-i,e=this.selectedYear,n=this.selectedMonth;0===this.selectedMonth?(n=this.locale.months.length,e=this.selectedYear-1):this.selectedMonth<10&&(n=`0${this.selectedMonth}`);for(let s=0;s<i;s++){t+=1;const i=`${e}-${n}-${t}`,s=new Date(Date.UTC(this.selectedYear,this.selectedMonth,t-1)).getUTCMonth()-1,o=new Date(Date.UTC(this.selectedYear,s,t)).getUTCDay();a(t,o,i,!1,"vanilla-calendar-day__btn_prev")}})(),(()=>{for(let t=1;t<=e;t++){const e=new Date(Date.UTC(this.selectedYear,this.selectedMonth,t)),i=this.generateDate(e),n=e.getUTCDay();a(t,n,i,!0)}})(),(()=>{const t=i+e,n=Math.ceil(t/this.locale.weekday.length),s=this.locale.weekday.length*n-t;let o=this.selectedYear,r=this.selectedMonth+2;this.selectedMonth+1===this.locale.months.length?(r="01",o=this.selectedYear+1):this.selectedMonth+2<10&&(r=`0${this.selectedMonth+2}`);for(let t=1;t<=s;t++){const e=`${o}-${r}-${t<10?`0${t}`:t}`,i=new Date(Date.UTC(this.selectedYear,this.selectedMonth,t)).getUTCMonth()+1,n=new Date(Date.UTC(this.selectedYear,i,t)).getUTCDay();a(t,n,e,!1,"vanilla-calendar-day__btn_next")}})(),this.createPopup(n),this.createWeekNumbers(i,e)}changeMonth(t){const e=this.locale.months.length-1;switch(t){case"prev":0!==this.selectedMonth?this.selectedMonth-=1:this.settings.selection.year&&(this.selectedYear-=1,this.selectedMonth=e);break;case"next":this.selectedMonth!==e?this.selectedMonth+=1:this.settings.selection.year&&(this.selectedYear+=1,this.selectedMonth=0)}this.settings.selected.month=this.selectedMonth,this.settings.selected.year=this.selectedYear,this.createHeader(),this.controlArrows(),this.createDays()}createYears(){this.currentType="year",this.createDOM(),this.createHeader(),this.controlArrows();const t=this.HTMLElement.querySelector(".vanilla-calendar-years");this.settings.selection.year&&t.classList.add("vanilla-calendar-years_selecting");const e=document.createElement("button");e.type="button",e.className="vanilla-calendar-years__year";for(let i=this.viewYear-7;i<this.viewYear+8;i++){const n=i,s=e.cloneNode(!0);n===this.selectedYear&&s.classList.add("vanilla-calendar-years__year_selected"),n<this.dateMin.getUTCFullYear()&&s.classList.add("vanilla-calendar-years__year_disabled"),n>this.dateMax.getUTCFullYear()&&s.classList.add("vanilla-calendar-years__year_disabled"),s.dataset.calendarYear=n,s.innerText=`${n}`,t.append(s)}}createMonths(){this.currentType="month",this.createDOM(),this.createHeader();const t=this.HTMLElement.querySelector(".vanilla-calendar-months");this.settings.selection.month&&t.classList.add("vanilla-calendar-months_selecting");const e=document.createElement("button");e.type="button",e.className="vanilla-calendar-months__month";for(let i=0;i<this.locale.months.length;i++){const n=this.locale.months[i],s=e.cloneNode(!0);i===this.selectedMonth&&s.classList.add("vanilla-calendar-months__month_selected"),i<this.dateMin.getUTCMonth()&&this.selectedYear===this.dateMin.getUTCFullYear()&&s.classList.add("vanilla-calendar-months__month_disabled"),i>this.dateMax.getUTCMonth()&&this.selectedYear===this.dateMax.getUTCFullYear()&&s.classList.add("vanilla-calendar-months__month_disabled"),s.dataset.calendarMonth=i,s.title=`${n}`,s.innerText=`${this.settings.visibility.monthShort?n.substring(0,3):n}`,t.append(s)}}controlTime(t){const e=this.HTMLElement.querySelector('.vanilla-calendar-time__range input[name="hours"]'),i=this.HTMLElement.querySelector('.vanilla-calendar-time__range input[name="minutes"]'),n=this.HTMLElement.querySelector('.vanilla-calendar-time__hours input[name="hours"]'),s=this.HTMLElement.querySelector('.vanilla-calendar-time__minutes input[name="minutes"]'),o=this.HTMLElement.querySelector(".vanilla-calendar-time__keeping"),r=(t,e)=>{t.addEventListener("mouseover",(()=>e.classList.add("is-focus")))},a=(t,e)=>{t.addEventListener("mouseout",(()=>e.classList.remove("is-focus")))},l=(t,e,i)=>{"hours"===i?this.selectedHours=`${e}`:"minutes"===i&&(this.selectedMinutes=`${e}`),this.selectedTime=`${this.selectedHours}:${this.selectedMinutes}${this.selectedKeeping?` ${this.selectedKeeping}`:""}`,this.settings.selected.time=this.selectedTime,this.actions.changeTime&&this.actions.changeTime(t,this.selectedTime,this.selectedHours,this.selectedMinutes,this.selectedKeeping)},c=(t,e,i,n)=>{t.addEventListener("input",(t=>{let s=Number(t.target.value);s=s<10?`0${s}`:`${s}`,"hours"===i&&12===n?Number(t.target.value)<n&&Number(t.target.value)>0?(e.value=s,this.selectedKeeping="AM",o.innerText=this.selectedKeeping,l(t,s,i)):(0===Number(t.target.value)?(this.selectedKeeping="AM",o.innerText="AM"):(this.selectedKeeping="PM",o.innerText="PM"),e.value=this.transformTime12(t.target.value),l(t,this.transformTime12(t.target.value),i)):(e.value=s,l(t,s,i))}))},u=(t,e,i,n)=>{e.addEventListener("change",(e=>{let s=Number(e.target.value);s=s<10?`0${s}`:`${s}`,"hours"===i&&12===n?e.target.value&&Number(e.target.value)<=n&&Number(e.target.value)>0?(e.target.value=s,t.value=this.transformTime24(s,this.selectedKeeping),l(e,s,i)):e.target.value&&Number(e.target.value)<24&&(Number(e.target.value)>n||0===Number(e.target.value))?(0===Number(e.target.value)?(this.selectedKeeping="AM",o.innerText="AM"):(this.selectedKeeping="PM",o.innerText="PM"),e.target.value=this.transformTime12(e.target.value),t.value=s,l(e,this.transformTime12(e.target.value),i)):e.target.value=this.selectedHours:e.target.value&&Number(e.target.value)<=n&&Number(e.target.value)>=0?(e.target.value=s,t.value=s,l(e,s,i)):"hours"===i?e.target.value=this.selectedHours:"minutes"===i&&(e.target.value=this.selectedMinutes)}))};r(e,n),r(i,s),a(e,n),a(i,s),c(e,n,"hours",24===t?23:t),c(i,s,"minutes"),u(e,n,"hours",24===t?23:t),u(i,s,"minutes",59),o&&o.addEventListener("click",(t=>{o.innerText.includes("AM")?this.selectedKeeping="PM":this.selectedKeeping="AM",e.value=this.transformTime24(this.selectedHours,this.selectedKeeping),l(t,this.selectedHours,"hours"),o.innerText=this.selectedKeeping}))}createTime(){const t=this.HTMLElement.querySelector(".vanilla-calendar-time");if(!t)return;const e=!0===this.settings.selection.time?12:this.settings.selection.time,i="range"===this.settings.selection.controlTime;t.innerHTML=`\n    <div class="vanilla-calendar-time__content">\n      <label class="vanilla-calendar-time__hours">\n        <input type="text"\n          name="hours"\n          maxlength="2"\n          value="${this.selectedHours}"\n          ${i?"disabled":""}>\n      </label>\n      <label class="vanilla-calendar-time__minutes">\n        <input type="text"\n          name="minutes"\n          maxlength="2"\n          value="${this.selectedMinutes}"\n          ${i?"disabled":""}>\n      </label>\n      ${12===e?`\n      <button type="button"\n        class="vanilla-calendar-time__keeping"\n        ${i?"disabled":""}>${this.selectedKeeping}</button>\n      `:""}\n    </div>\n    <div class="vanilla-calendar-time__ranges">\n      <label class="vanilla-calendar-time__range">\n        <input type="range"\n          name="hours"\n          min="0"\n          max="23"\n          step="${this.settings.selection.stepHours}"\n          value="${this.selectedKeeping?this.transformTime24(this.selectedHours,this.selectedKeeping):this.selectedHours}">\n      </label>\n      <label class="vanilla-calendar-time__range">\n        <input type="range"\n          name="minutes"\n          min="0"\n          max="59"\n          step="${this.settings.selection.stepMinutes}"\n          value="${this.selectedMinutes}">\n      </label>\n    </div>`,this.controlTime(e)}getLocale(){if("define"!==this.settings.lang){this.locale.weekday=[];for(let t=0;t<7;t++){let e=new Date(0,0,t).toLocaleString(this.settings.lang,{weekday:"short"});e=`${e.charAt(0).toUpperCase()}${e.substring(1,e.length)}`,e=e.replace(/\./,""),this.locale.weekday.push(e)}this.locale.months=[];for(let t=0;t<12;t++){let e=new Date(0,t).toLocaleString(this.settings.lang,{month:"long"});e=`${e.charAt(0).toUpperCase()}${e.substring(1,e.length)}`,e=e.replace(/\./,""),this.locale.months.push(e)}}}createInfo(){if(this.info.top){this.HTMLElement.querySelector(".vanilla-calendar-info.--top").innerHTML=this.info.top}if(this.info.bottom){this.HTMLElement.querySelector(".vanilla-calendar-info.--bottom").innerHTML=this.info.bottom}}update(){this.setVariablesDates(),this.getLocale(),this.createDOM(),this.createHeader(),this.controlArrows(),this.createTime(),this.createInfo(),"default"===this.currentType?(this.createWeek(),this.createDays()):"month"===this.currentType?this.createMonths():"year"===this.currentType&&this.createYears()}click(){this.HTMLElement.addEventListener("click",(t=>{const e=t.target.closest(".vanilla-calendar-arrow"),i=t.target.closest(".vanilla-calendar-arrow_prev"),n=t.target.closest(".vanilla-calendar-arrow_next"),s=t.target.closest(".vanilla-calendar-day__btn"),o=t.target.closest(".vanilla-calendar-day__btn_prev"),r=t.target.closest(".vanilla-calendar-day__btn_next"),a=t.target.closest(".vanilla-calendar-year"),l=t.target.closest(".vanilla-calendar-years__year"),c=t.target.closest(".vanilla-calendar-month"),u=t.target.closest(".vanilla-calendar-months__month"),h=()=>{s.classList.contains("vanilla-calendar-day__btn_selected")?this.selectedDates.splice(this.selectedDates.indexOf(s.dataset.calendarDay),1):(this.selectedDates=[],this.selectedDates.push(s.dataset.calendarDay))},d=()=>{s.classList.contains("vanilla-calendar-day__btn_selected")?this.selectedDates.splice(this.selectedDates.indexOf(s.dataset.calendarDay),1):this.selectedDates.push(s.dataset.calendarDay)},p=()=>{if(this.selectedDates.length>1&&(this.selectedDates=[]),this.selectedDates.push(s.dataset.calendarDay),!this.selectedDates[1])return;const t=new Date(Date.UTC(new Date(this.selectedDates[0]).getUTCFullYear(),new Date(this.selectedDates[0]).getUTCMonth(),new Date(this.selectedDates[0]).getUTCDate())),e=new Date(Date.UTC(new Date(this.selectedDates[1]).getUTCFullYear(),new Date(this.selectedDates[1]).getUTCMonth(),new Date(this.selectedDates[1]).getUTCDate())),i=t=>{const e=this.generateDate(t);this.settings.range.disabled&&this.settings.range.disabled.includes(e)||this.selectedDates.push(e)};if(this.selectedDates=[],e>t)for(let n=t;n<=e;n.setUTCDate(n.getUTCDate()+1))i(n);else for(let n=t;n>=e;n.setUTCDate(n.getUTCDate()-1))i(n)};(()=>{e&&"year"!==this.currentType&&"month"!==this.currentType&&this.changeMonth(t.target.dataset.calendarArrow)})(),(()=>{if(["single","multiple","multiple-ranged"].includes(this.settings.selection.day)&&s){switch(this.settings.selection.day){case"single":h();break;case"multiple":d();break;case"multiple-ranged":p()}this.actions.clickDay&&this.actions.clickDay(t,this.selectedDates),this.settings.selected.dates=this.selectedDates,o?this.changeMonth("prev"):r?this.changeMonth("next"):this.createDays()}})(),(()=>{this.settings.selection.year&&(e&&"year"===this.currentType?(n?this.viewYear+=15:i&&(this.viewYear-=15),this.createYears()):"year"!==this.currentType&&a?this.createYears():"year"===this.currentType&&a?(this.currentType=this.type,this.update()):l&&(this.selectedYear=Number(l.dataset.calendarYear),this.currentType=this.type,this.selectedMonth<this.dateMin.getUTCMonth()&&this.selectedYear===this.dateMin.getUTCFullYear()&&(this.settings.selected.month=this.dateMin.getUTCMonth()),this.selectedMonth>this.dateMax.getUTCMonth()&&this.selectedYear===this.dateMax.getUTCFullYear()&&(this.settings.selected.month=this.dateMax.getUTCMonth()),this.actions.clickYear&&this.actions.clickYear(t,this.selectedYear),this.settings.selected.year=this.selectedYear,this.update()))})(),(()=>{this.settings.selection.month&&("month"!==this.currentType&&c?this.createMonths():"month"===this.currentType&&c?(this.currentType=this.type,this.update()):u&&(this.selectedMonth=Number(u.dataset.calendarMonth),this.currentType=this.type,this.actions.clickMonth&&this.actions.clickMonth(t,this.selectedMonth),this.settings.selected.month=this.selectedMonth,this.update()))})()}))}init(){this.HTMLElement&&(this.update(),this.click())}}function FormValidation(t){const{form:e,formSelector:i,afterValidate:n,afterValidateForm:s}=t||{};this.debounce=(t,e=500)=>{let i;return(...n)=>{clearTimeout(i),i=setTimeout((()=>t(...n)),e)}},this.fetchData=async t=>{try{const e=await fetch(`${app_shop?.urls?.graphql||"/graphql/v1/"}?query=validateClientData`,{method:"POST",body:JSON.stringify({query:`query {${t}}`})});return await e.json()}catch(t){return!1}},this.vars={passwordLengthMin:6,passwordLengthMax:30,changedInputs:[]},this.callbacks={validate:n,validateAll:s},this.errorCode={birth_date:app_shop?.txt?.errorCode?.birth_date||"Wpisz poprawną datę urodzenia w formacie RRRR-MM-DD",illegal_characters_client_city:app_shop?.txt?.errorCode?.illegal_characters_client_city||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_firm:app_shop?.txt?.errorCode?.illegal_characters_client_firm||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_firstname:app_shop?.txt?.errorCode?.illegal_characters_client_firstname||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_lastname:app_shop?.txt?.errorCode?.illegal_characters_client_lastname||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_nip:app_shop?.txt?.errorCode?.illegal_characters_client_nip||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_phone:app_shop?.txt?.errorCode?.illegal_characters_client_phone||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_phone2:app_shop?.txt?.errorCode?.illegal_characters_client_phone2||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_client_street:app_shop?.txt?.errorCode?.illegal_characters_client_street||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_additional:app_shop?.txt?.errorCode?.illegal_characters_delivery_additional||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_city:app_shop?.txt?.errorCode?.illegal_characters_delivery_city||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_firstname:app_shop?.txt?.errorCode?.illegal_characters_delivery_firstname||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_lastname:app_shop?.txt?.errorCode?.illegal_characters_delivery_lastname||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_phone:app_shop?.txt?.errorCode?.illegal_characters_delivery_phone||"Jeden z użytych znaków jest niedozwolony.",illegal_characters_delivery_street:app_shop?.txt?.errorCode?.illegal_characters_delivery_street||"Jeden z użytych znaków jest niedozwolony.",incorect_delivery_region:app_shop?.txt?.errorCode?.incorect_delivery_region||"Wybierz kraj odbiorcy przesyłki.",incorect_delivery_zipcode:app_shop?.txt?.errorCode?.incorect_delivery_zipcode||"Wpisz kod pocztowy odbiorcy przesyłki.",incorect_email:app_shop?.txt?.errorCode?.incorect_email||"Błędnie wpisany e-mail. Wpisz pełny adres e-mail, np. jan@kowalski.com",incorect_invoice_phone:app_shop?.txt?.errorCode?.incorect_invoice_phone||"Wpisz telefon klienta.",incorect_invoice_zipcode:app_shop?.txt?.errorCode?.incorect_invoice_zipcode||"Wpisz kod pocztowy klienta.",incorect_login:app_shop?.txt?.errorCode?.incorect_login||"Błędnie wpisany login. Login musi mieć minimum 3, a maksimum 40 znaków. Możesz użyć liter i cyfr oraz symboli @ . - _.",incorect_nip:app_shop?.txt?.errorCode?.incorect_nip||"Niepoprawny NIP dla wybranego kraju.",incorect_phone:app_shop?.txt?.errorCode?.incorect_phone||"Wpisz swój telefon.",incorect_shops:app_shop?.txt?.errorCode?.incorect_shops||"Wybierz sklep z listy.",incorect_zipcode:app_shop?.txt?.errorCode?.incorect_zipcode||"Błędnie wpisany kod pocztowy.",incorrect_region:app_shop?.txt?.errorCode?.incorrect_region||"Błędnie wybrany region.",invalid_format:app_shop?.txt?.errorCode?.invalid_format||"Nieprawidłowy format. Pole musi zawierać przynajmniej jedną literę.",login_equals_password:app_shop?.txt?.errorCode?.login_equals_password||"Hasło jest takie samo jak login. Wpisz inne hasło.",login_taken:app_shop?.txt?.errorCode?.login_taken||"Podany login jest już zajęty",login_taken_login_propose:app_shop?.txt?.errorCode?.login_taken_login_propose||"Podany login jest już zajęty.<br/><br/>Proponowany login: ",no_city:app_shop?.txt?.errorCode?.no_city||"Wpisz w to pole nazwę miasta.",no_delivery_city:app_shop?.txt?.errorCode?.no_delivery_city||"Wpisz miejscowość odbiorcy przesyłki.",no_delivery_firstname:app_shop?.txt?.errorCode?.no_delivery_firstname||"Wpisz imię odbiorcy przesyłki.",no_delivery_lastname:app_shop?.txt?.errorCode?.no_delivery_lastname||"Wpisz nazwisko odbiorcy przesyłki.",no_delivery_street:app_shop?.txt?.errorCode?.no_delivery_street||"Wpisz ulicę i numer domu odbiorcy przesyłki.",no_firmname:app_shop?.txt?.errorCode?.no_firmname||"Błędnie wpisana nazwa firmy.",no_firstname:app_shop?.txt?.errorCode?.no_firstname||"Wpisz w to pole swoje imię.",no_invoice_city:app_shop?.txt?.errorCode?.no_invoice_city||"Wpisz miejscowość klienta.",no_invoice_firmname:app_shop?.txt?.errorCode?.no_invoice_firmname||"Wpisz nazwę firmy klienta.",no_invoice_firstname:app_shop?.txt?.errorCode?.no_invoice_firstname||"Wpisz imię klienta.",no_invoice_lastname:app_shop?.txt?.errorCode?.no_invoice_lastname||"Wpisz nazwisko klienta.",no_invoice_street:app_shop?.txt?.errorCode?.no_invoice_street||"Wpisz ulicę i numer domu klienta.",no_invoice_street_number:app_shop?.txt?.errorCode?.no_invoice_street_number||"Wpisz ulicę i numer domu klienta.",no_login:app_shop?.txt?.errorCode?.no_login||"Wpisz w to pole swój login.",no_name:app_shop?.txt?.errorCode?.no_name||"Wpisz w to pole swoje nazwisko.",no_password:app_shop?.txt?.errorCode?.no_password||"Wpisz w to pole swoje hasło.",no_street:app_shop?.txt?.errorCode?.no_street||"Wpisz nazwę ulicy lub miejscowości.",no_street_number:app_shop?.txt?.errorCode?.no_street_number||"Podaj nr domu.",no_street_number_uk:app_shop?.txt?.errorCode?.no_street_number_uk||"Brakuje numeru domu.",not_equal_passwords:app_shop?.txt?.errorCode?.not_equal_passwords||"Wpisane hasła nie są takie same. Wpisz ponownie hasło i potwierdzenie.",password_to_long:app_shop?.txt?.errorCode?.password_to_long||"Za długie hasło. Wpisz krótsze hasło (maksimum",password_to_short:app_shop?.txt?.errorCode?.password_to_short||"Zbyt krótkie hasło. Wpisz dłuższe hasło (minimum",used_login:app_shop?.txt?.errorCode?.used_login||"Podany login jest już zajęty",incorrect_iban:app_shop?.txt?.errorCode?.incorrect_iban||app_shop.txt.txt_validation5||"Format numeru konta bankowego jest niepoprawny"},this.txt={mandatoryField:app_shop?.txt?.formValidation?.mandatoryField||"Proszę wypełnić to pole.",zipcodeFormat:app_shop?.txt?.formValidation?.zipcodeFormat||"Poprawne formaty kodu pocztowego dla wybranego kraju to [X - cyfra; Y - litera]:",characters:app_shop?.txt?.formValidation?.characters||"znaków).",noOptionSelected:app_shop?.txt?.formValidation?.noOptionSelected||"Proszę wybrać opcję.",minimalCharacters:app_shop?.txt?.formValidation?.minimalCharacters||app_shop.txt.txt_validation1||"Minimalna liczba znaków dla tego pola to ",maximumCharacters:app_shop?.txt?.formValidation?.maximumCharacters||app_shop.txt.txt_validation2||"Maksymalna liczba znaków dla tego pola to "},this.queries={VALIDATE_FIRSTNAME_QUERY:t=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        firstname: "${t?.replace?.(/"/g,'\\"')}"\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_LASTNAME_QUERY:t=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        lastname: "${t?.replace?.(/"/g,'\\"')}"\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_ADDITIONAL_QUERY:t=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        companyName: "${t?.replace?.(/"/g,'\\"')}"\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_NIP_QUERY:(t,e)=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        country: ${e}\n      }\n      taxNumber: "${t?.replace?.(/"/g,'\\"')}"\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_STREET_QUERY:(t,e)=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        street: "${t?.replace?.(/"/g,'\\"')}"\n        country: ${e}\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_ZIPCODE_QUERY:(t,e)=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        zipcode: "${t?.replace?.(/"/g,'\\"')}"\n        country: ${e}\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_CITY_QUERY:t=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        city: "${t?.replace?.(/"/g,'\\"')}"\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_PHONE_QUERY:(t,e)=>`validateClientData(ClientDataInput: { clientData: {\n      clientBillingData: {\n        phone: "${t?.replace?.(/"/g,'\\"')}"\n        country: ${e}\n      }\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_EMAIL_QUERY:t=>`validateClientData(ClientDataInput: {clientData: {\n      email: "${t?.replace?.(/"/g,'\\"')}"\n    }}) {\n      messages {\n        code\n        message\n      }\n      clientExists\n    }`,VALIDATE_BIRTHDATE_QUERY:t=>`validateClientData(ClientDataInput: {clientData: {\n      birthDate: "${t?.replace?.(/"/g,'\\"')}"\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_LOGIN_QUERY:t=>`validateClientData(ClientDataInput: {loginAndPassword: {\n      login: "${t?.replace?.(/"/g,'\\"')}"\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_PASSWORD_QUERY:t=>`validateClientData(ClientDataInput: {loginAndPassword: {\n      password: "${t?.replace?.(/"/g,'\\"')}"\n    }}) {\n      messages {\n        code\n        message\n      }\n    }`,VALIDATE_INPUTS_QUERY:t=>JSON.stringify({query:`query {\n        validateClientData(${t}) {\n          messages {\n            code\n            message\n          }\n        }\n      }`})},this.events={onInput:t=>{const{target:e}=t;this.vars.changedInputs.push(e),this.debounces.validateInput(e)},onChange:t=>{const{target:e}=t;this.validateCheckbox(e)},onSubmit:async t=>{if("true"===this.form.dataset.handled)return void delete this.form.dataset.handled;t.preventDefault();await this.validateForm()?(this.form.classList.remove("--fail-validation"),this.form.dataset.handled="true",this.form.submit()):this.form.classList.add("--fail-validation")}},this.concatErrorMessages=t=>{const{code:e}=t[0];switch(e){case"incorect_zipcode":return`${this.errorCode[e]} ${this.txt.zipcodeFormat} ${t[1]?.message}`;case"password_to_short":return`${this.errorCode[e]} ${this.vars.passwordLengthMin} ${this.txt.characters}`;case"password_to_long":return`${this.errorCode[e]} ${this.vars.passwordLengthMax} ${this.txt.characters}`;default:return this.errorCode[e]}},this.validateFirstnameGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_FIRSTNAME_QUERY(s);if(i)return this.queries.VALIDATE_FIRSTNAME_QUERY(s);const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateLastnameGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_LASTNAME_QUERY(s);if(i)return this.queries.VALIDATE_LASTNAME_QUERY(s);const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateAdditionalGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_ADDITIONAL_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateNipGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,{region:o}=e.dataset,r=this.queries.VALIDATE_NIP_QUERY(s,o);if(i)return r;const a=n||await this.fetchData(r),{messages:l}=a?.data?.validateClientData||a;return l?.length?this.concatErrorMessages(l):""},this.validateStreetGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,{concatFrom:o,region:r}=e.dataset,a=this.form?.querySelector(o),l=`${s} ${a?.value||""}`,c=this.queries.VALIDATE_STREET_QUERY(l,r);if(i)return c;const u=n||await this.fetchData(c),{messages:h}=u?.data?.validateClientData||u;return h?.length?a&&"no_street_number"===h[0].code?(this.setValidityState(a,this.concatErrorMessages(h)),""):this.concatErrorMessages(h):(a&&this.setValidityState(a,""),"")},this.validateZipcodeGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,{region:o}=e.dataset,r=this.queries.VALIDATE_ZIPCODE_QUERY(s,o);if(i)return r;const a=n||await this.fetchData(r),{messages:l}=a?.data?.validateClientData||a;return l?.length?this.concatErrorMessages(l):""},this.validateCityGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_CITY_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validatePhone=t=>{const{input:e,getQuery:i}=t;if(i)return"";const{value:n}=e;return n.length>=9?"":this.concatErrorMessages([{code:"incorect_phone"}])},this.validatePhoneGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,{concatFrom:o,region:r}=e.dataset,a=this.form?.querySelector(o),l=a?.value||"",c=l?`${l}${s}`:s;if(!r)return this.validatePhone(t);const u=this.queries.VALIDATE_PHONE_QUERY(c,r);if(i)return u;const h=n||await this.fetchData(u),{messages:d}=h?.data?.validateClientData||h;return d?.length?this.concatErrorMessages(d):""},this.validateEmailGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_EMAIL_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateBirthdateGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_BIRTHDATE_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateLoginGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_LOGIN_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validatePasswordGQL=async t=>{const{input:e,getQuery:i,response:n}=t,{value:s}=e,o=this.queries.VALIDATE_PASSWORD_QUERY(s);if(i)return o;const r=n||await this.fetchData(o),{messages:a}=r?.data?.validateClientData||r;return a?.length?this.concatErrorMessages(a):""},this.validateIBANGQL=async t=>{const{input:e,getQuery:i}=t,{value:n}=e;if(i)return"";const s=await fetch(`/ajax/payments.php?action=verify_iban&bankAccount=${n}`),o=await s.json(),{errno:r}=o||{};return r?this.concatErrorMessages([{code:"incorrect_iban"}]):""},this.getInputQueries=async t=>(await Promise.all(t.map((async t=>{const e=await this.validateGraphQL({input:t,getQuery:!0});return`${t.id}:${e}`})))).join(""),this.validateInputsGQL=async t=>{const e=await this.getInputQueries(t),i=await this.fetchData(e);i?.data&&Object.keys(i.data).forEach((async e=>{const[n]=t.filter((t=>t.id===e));if(!n)return;const s=await this.validateGraphQL({input:n,response:i.data[e]});this.setValidityState(n,s)}))},this.clientExists=async t=>{const e=this.queries.VALIDATE_EMAIL_QUERY(t),i=await this.fetchData(e),{clientExists:n}=i?.data?.validateClientData||i;return n},this.validateMinLength=t=>{const e=t.getAttribute("minlength");return e?+e<=t.value.length?"":`${this.txt.minimalCharacters}${e}`:""},this.validateMaxLength=t=>{const e=t.getAttribute("maxlength");return e?+e>=t.value.length?"":`${this.txt.maximumCharacters}${e}`:""},this.validateInputs=async t=>{t.forEach((t=>{const e=this.validateNotEmpty(t)||this.validateMinLength(t)||this.validateMaxLength(t);""!==e&&this.setValidityState(t,e)}));const e=[...t].filter((t=>t.closest(".f-feedback:not(.--error)")));if(!e.length)return;[...e].filter((t=>!t.hasAttribute("data-graphql"))).forEach((t=>{this.setValidityState(t,"")}));const i=[...e].filter((t=>t.hasAttribute("data-graphql")));i.length&&await this.validateInputsGQL(i)},this.isPhoneNumber=t=>new RegExp("^[0-9*#+() ]+$").test(t),this.getGQLType=t=>{const{graphql:e}=t.dataset,i=e.split(" ");if(2===i.filter((t=>"phone"===t||"email"===t)).length){return this.isPhoneNumber(t.value)?"phone":"email"}return i[0]},this.validateGraphQL=async t=>{const{input:e,getQuery:i,response:n}=t,{graphql:s}=e.dataset;if(!s)return!1;const o=s.split(" ");switch(1===o.length?o[0]:this.getGQLType(e)){case"firstname":return await this.validateFirstnameGQL({input:e,getQuery:i,response:n});case"lastname":return await this.validateLastnameGQL({input:e,getQuery:i,response:n});case"additional":case"firm":return await this.validateAdditionalGQL({input:e,getQuery:i,response:n});case"nip":return await this.validateNipGQL({input:e,getQuery:i,response:n});case"street":return await this.validateStreetGQL({input:e,getQuery:i,response:n});case"zipcode":return await this.validateZipcodeGQL({input:e,getQuery:i,response:n});case"city":return await this.validateCityGQL({input:e,getQuery:i,response:n});case"phone":return await this.validatePhoneGQL({input:e,getQuery:i,response:n});case"email":return await this.validateEmailGQL({input:e,getQuery:i,response:n});case"birthdate":return await this.validateBirthdateGQL({input:e,getQuery:i,response:n});case"login":return await this.validateLoginGQL({input:e,getQuery:i,response:n});case"password":return await this.validatePasswordGQL({input:e,getQuery:i,response:n});case"iban":return await this.validateIBANGQL({input:e,getQuery:i,response:n});default:return this.setValidityState(e,"")}},this.validateInput=async t=>{const e=[...new Set(this.vars.changedInputs)].filter((t=>"username"!==t.autocomplete&&"current-password"!==t.autocomplete));if(this.vars.changedInputs=[],e.length>1)return this.removeAllValidityState(),this.validateForm(),!1;const{concatTo:i}=t.dataset;if(i)return this.validateInput(this.form.querySelector(i));let n=this.validateNotEmpty(t)||this.validateMinLength(t)||this.validateMaxLength(t);if(""!==n)return this.setValidityState(t,n);return t.getAttribute("data-graphql")?(n=await this.validateGraphQL({input:t}),this.setValidityState(t,n)):this.setValidityState(t,n)},this.validateSelects=t=>{t.forEach((t=>{this.validateSelect(t)}))},this.validateSelect=t=>{if(!t)return!0;let e="";return t.closest(".--placeholder")&&t.selectedIndex<1?(e=this.txt.noOptionSelected,this.setValidityState(t,e)):this.setValidityState(t,e)},this.validateCheckboxes=t=>{t.forEach((t=>{this.validateCheckbox(t)}))},this.validateCheckbox=t=>!t||(t.checked?this.setValidityState(t,"",!0):this.setValidityState(t,"error",!0)),this.validateObjectGQL=async(t={})=>{let e="";for(const[i,n]of Object.entries(t)){const s={dataset:{}};s.value="street"===i&&t.streetNumber?`${n} ${t.streetNumber}`:n,s.dataset.region=t.region,s.dataset.graphql=i;const o=await this.validateGraphQL({input:s,getQuery:!0});o&&(e+=`${i}:${o}`)}if(""===e)return!0;const i=await this.fetchData(e);if(!i?.data)return!0;const n=[];for(const[e,s]of Object.entries(i.data)){const o={dataset:{}};o.value="street"===e&&t.streetNumber?`${s} ${t.streetNumber}`:s,o.dataset.region=t.region,o.dataset.graphql=e,n.push(await this.validateGraphQL({input:o,response:i.data[e]}))}return!n.filter((t=>""!==t)).length},this.validateObjectRequired=(t={},e=[])=>{if(!e.length)return!0;for(const[i,n]of Object.entries(t))if(e.includes(i)&&""===n)return validRequired=!1,!1;return!0},this.validateObject=async(t={},e)=>{if(!this.validateObjectRequired(t,e))return!1;return!!await this.validateObjectGQL(t,e)},this.validateForm=async t=>{const e=t||this.form,i=e.querySelectorAll('.f-control.--validate:not(:disabled):not([type="checkbox"])'),n=[...i].filter((t=>t.closest(".f-feedback:not(.--error):not(.--success)")));await this.validateInputs(n);const s=e.querySelectorAll("select.f-select.--validate:not(:disabled), div.f-select.--validate select:not(:disabled)"),o=[...s].filter((t=>t.closest(".f-feedback:not(.--error):not(.--success)")));this.validateSelects(o);const r=e.querySelectorAll('.f-control.--validate[type="checkbox"]:not(:disabled)'),a=[...r].filter((t=>t.closest(".--checkbox:not(.--error):not(.--success), .--switch:not(.--error):not(.--success)")));this.validateCheckboxes(a);const l=[...i].filter((t=>t.closest(".f-feedback.--error"))),c=[...s].filter((t=>t.closest(".f-feedback.--error"))),u=[...r].filter((t=>t.closest(".--checkbox.--error, .--switch.--error, .f-feedback.--error")));return l.length||c.length||u.length?("function"==typeof this.callbacks.validateAll&&this.callbacks.validateAll(t,!1),!1):("function"==typeof this.callbacks.validateAll&&this.callbacks.validateAll(t,!0),!0)},this.validateNotEmpty=t=>t.required||0!==t.value.length?t.value.length>0?"":this.txt.mandatoryField:"",this.createMessageElement=t=>{const e=document.createElement("div");return e.classList.add("f-message"),t.append(e),e},this.setValidityState=(t,e,i)=>{if(!(t&&t instanceof HTMLElement))return!1;const n=t.closest(".f-feedback")||t.parentNode;n.classList.remove("--success","--error");const s=!i&&(n.querySelector(".f-message")||this.createMessageElement(n));return n.classList.toggle("--empty",""===t.value),""===e?(n.classList.add("--success"),s&&(s.textContent=""),"function"==typeof this.callbacks.validate&&this.callbacks.validate(t,!0),!0):(n.classList.add("--error"),s&&(s.textContent=e),"function"==typeof this.callbacks.validate&&this.callbacks.validate(t,!1),!1)},this.getValidityState=t=>{if(!t)return"";const e=t.closest(".f-feedback")||t.parentNode;return e.classList.contains("--success")?"success":e.classList.contains("--error")?"error":""},this.removeAllValidityState=t=>{(t||this.form).querySelectorAll(".f-control.--validate").forEach((t=>{this.removeValidityState(t)}))},this.removeValidityState=t=>{const e=t.closest(".f-feedback")||t.parentNode;e.classList.remove("--success","--error");const i=e.querySelector(".f-message");i&&(i.textContent="")},this.removeEvents=()=>{this.form&&(this.form.querySelectorAll(".f-control.--validate").forEach((t=>{"checkbox"!==t.type?t.removeEventListener("input",this.events.onInput):t.removeEventListener("change",this.events.onChange)})),"FORM"===this.form.tagName&&this.form.removeEventListener("submit",this.events.onSubmit))},this.initEvents=()=>{this.form&&(this.form.querySelectorAll(".f-control.--validate").forEach((t=>{"checkbox"!==t.type?t.addEventListener("input",this.events.onInput):t.addEventListener("change",this.events.onChange)})),"FORM"===this.form.tagName&&this.form.addEventListener("submit",this.events.onSubmit))},this.init=()=>{this.form=e||document.querySelector(i)||document,this.initEvents()},this.destroy=()=>{this.removeEvents()},this.reInit=()=>{this.destroy(),this.init()},this.debounces={validateInput:this.debounce(this.validateInput)}}app_shop.graphql||(app_shop.graphql={}),app_shop.graphql.trackingEvents=async t=>{const{headers:e}=t||{};if(!e)return!1;const i=e.get("x-iai-tracking-events");if(!i||+i<1)return!1;const n=JSON.stringify({query:"query {\n      trackingEvents\n    }"});try{const t=await fetch(app_shop?.urls?.graphql||"/graphql/v1/",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:n}),e=await t.json();return e.data.trackingEvents?.forEach((t=>{const e=new Function(t);try{e()}catch(t){}})),e.data.trackingEvents}catch(t){return[]}},app_shop.fn.ajaxLoadSite=function(t){if((()=>{const t=document.getElementById("ajaxLoadSite"),e=document.getElementById("ajaxLoadSite_cover");t&&t.remove(),e&&e.remove()})(),!t)return;const e=`\n    <div id="ajaxLoadSite_cover" style="height:${document.body.scrollHeight}px;width:100%;position:absolute;left:0;top:0;"></div>\n    <div id="ajaxLoadSite" style="left:50%;transform:translateX(-50%);"></div>\n  `;document.body.insertAdjacentHTML("beforeend",e)},app_shop.fn.ajaxLoadSiteMessage=function(t){const e=document.getElementById("ajaxLoadSite");e&&e.append(t)},app_shop.fn.cookie={get:function(t){const e=document.cookie.split(";");for(let i=0;i<e.length;i++){const n=e[i].trim(),[s,o]=n.split("=");if(s===t)return decodeURIComponent(o)}return null},set:function(t,e,i){let n="";if(i){const t=new Date;t.setTime(t.getTime()+24*i*60*60*1e3),n=`; expires=${t.toUTCString()}`}document.cookie=`${t}=${encodeURIComponent(e)}${n}; path=/`},remove:function(t){this.set(t,"",-1)}};var projectorv3_disable_ajax=projectorv3_disable_ajax||1,projectorClass=function(){classObj=this,this.currency="",this.curr_class="",this.firstRun=!0,this.onDisableAlert=!0,this.timeoutAjax=18e3,this.errorMsg=[],this.currentSizeObj={},this.configObj={},this.action="",this.innerHTML="",this.nettoPrice="net"===app_shop.vars.priceType,this.options=[],this.options.hide_unit=!1,this.options.friendly_shipping_format=[],this.options.endStartFunction=function(){},this.options.endInitFunction=function(){},this.options.beginStartFunction=function(){},this.options.endShippingFunction=function(){},this.options.formatPrice=function(t){},this.externalFormatFn=!1,this.options.endGetAjaxProductDataFunction=function(){},this.options.clearXMLGetAjaxProductDataFunction=function(t){},this.options.beginGetAjaxProductDataFunction=function(){},this.options.endSetCurrentSizeFunction=function(){},this.options.ajaxAddFunction=function(t){classObj.alert(classObj.txt.dodano_produkt)},this.options.contenersPrefix="projector_",this.options.curr_before_price=!1,this.options.choiceSize=!1,this.options.contact_link="/contact.php",this.options.hoursBeforeOrderBy=3,this.isStarted=!1,this.prefix=this.options.contenersPrefix,this.actions={},this.txt=[],this.txt.oszczedzasz="Oszczędzasz ",this.txt.taniej="%, czyli ",this.txt.wzestawie=" kupując w zestawie",this.txt.niedostepny="Produkt niedostępny",this.txt.tylkotel="Cena na telefon. Skontaktuj się ze sprzedawcą",this.txt.tylko_punkty="Towar dostępny tylko w programie lojalnościowym.",this.txt.gratis="Dostawa gratis!",this.txt.gratis_produkt="Gratis!",this.txt.niemastanu="Produkt niedostępny",this.txt.status_24="24 godz.",this.txt.status_48="48 godz.",this.txt.status_natychmiast="w ciągu 24h",this.txt.day=" dzień ",this.txt.days=" dni ",this.txt.hour=" godz. ",this.txt.hours=" godz. ",this.txt.min=" min ",this.txt.mins=" min ",this.txt.za=" za ",this.txt.proc="%",this.txt.wybrany_rozmiar="Rozmiar",this.txt.wysylka="Wysyłka ",this.txt.wysylka_za="Wysyłka w ciągu ",this.txt.dostepny="Dostawa ",this.txt.dostepny_za="Dostawa za ",this.txt.pkt="pkt.",this.txt.status_full="większa ilość",this.txt.status_amount_null="brak w magazynie",this.txt.forpointsonly="Produkt możesz kupić za punkty",this.txt.disable_desc="Skontaktuj się z nami",this.txt.choiceSize="Wybierz rozmiar",this.txt.maksymalnie="Maksymalnie możesz zamówić",this.txt.minimalnie="Minimalnie możesz zamówić",this.txt.brak_magazyn="Brak na magazynie",this.txt.dodano_produkt="Produkt został dodany.",this.txt.dodano_produkt_blad="Wystąpił błąd podczas dodawania produktu.",this.txt.ilosc_mm="",this.txt.ilosc_mo="",this.txt.ilosc_mo_inf="",this.txt.infinity="",this.txt.koszt_od="Koszt od ",this.txt.wysylka_total_begin="<br/>(z tow. z koszyka ",this.txt.wysylka_total_end=")",this.txt.nawias_end="",this.txt.amount="",this.txt.order_by="Zamów do ",this.txt.it_will_ship_today=" to wyślemy dzisiaj";var t=!0;this.isset=function(t){return void 0!==window[t]},this.getAttr=function(t,e){return t&&t.hasAttribute(e)?t.getAttribute(e):""},this.getData=function(t){try{return t}catch(t){}},this.getIndex=function(t,e){var i=0;for(var n in t){if(e===i)return n;i++}return null},this.formatPrice=function(t,e,i,n,s){return currency=i||this.currentSizeObj.currency,s=!!s,e&&(this.configObj.rebateNumber&&s&&(t=this.configObj.rebateNumber.price),t*=this.configObj.valueOfNumberInput),n?parseFloat(t.toFixed(2)):this.externalFormatFn?this.options.formatPrice({price:t,currency:currency}):this.options.curr_before_price?'<span class="projector_price"><span class="projector_currency">'+currency+"</span>"+(1*t).toFixed(2)+"</span>":'<span class="projector_price">'+(1*t).toFixed(2)+'<span class="projector_currency">'+currency+"</span></span>"},this.status_description=function(){if(this.hide(document.querySelector("#"+this.prefix+"status_gfx")),document.querySelector("#"+this.prefix+"status")?.classList.add("--status-hide"),this.currentSizeObj.amount_mm&&this.currentSizeObj.amount_mo&&""!=this.txt.ilosc_mm){var t=this.currentSizeObj.amount_mm,e=this.currentSizeObj.amount_mo,i=t+" "+(t>1?this.currentSizeObj.unit_plural:this.currentSizeObj.unit),n=e+" "+(e>1?this.currentSizeObj.unit_plural:this.currentSizeObj.unit),s=this.txt.ilosc_mm.format(i),o=this.txt.ilosc_mo.format(n);if(t>0&&-1==e)return document.querySelector("#"+this.prefix+"status_description")&&(document.querySelector("#"+this.prefix+"status_description").innerHTML='<div id="#'+this.prefix+'amount_mm">'+s+'</div><div id="#'+this.prefix+'amount_mo">'+this.txt.ilosc_mo_inf+"</div>"),!1;if(t>0&&e>0)return document.querySelector("#"+this.prefix+"status_description")&&(document.querySelector("#"+this.prefix+"status_description").innerHTML='<div id="#'+this.prefix+'amount_mm">'+s+'</div><div id="#'+this.prefix+'amount_mo">'+o+"</div>"),!1}this.currentSizeObj.availability.delivery_date&&"disable"==this.currentSizeObj.availability.status?document.querySelector("#"+this.prefix+"status_description")&&(document.querySelector("#"+this.prefix+"status_description").innerHTML=this.currentSizeObj.availability.status_description+" <span>"+this.currentSizeObj.availability.delivery_date+"</span>"):this.currentSizeObj.availability.status_description?(document.querySelector("#"+this.prefix+"status_description")&&(document.querySelector("#"+this.prefix+"status_description").innerHTML=this.currentSizeObj.availability.status_description),document.querySelector("#"+this.prefix+"status_description")?.classList.remove("--status-hide","--phone-disable")):"disable"==this.currentSizeObj.availability.status?(document.querySelector("#"+this.prefix+"status")?.classList.add("--status-hide","--phone-disable"),this.hide(document.querySelector("#"+this.prefix+"status_description_wrapper"))):(document.querySelector("#"+this.prefix+"status")?.classList.remove("--status-hide","--phone-disable"),this.hide(document.querySelector("#"+this.prefix+"status_description_wrapper"))),this.currentSizeObj.availability.status_gfx&&(this.show(document.querySelector("#"+this.prefix+"status_gfx")),document.querySelector("#"+this.prefix+"status_gfx")?.setAttribute("src",this.currentSizeObj.availability.status_gfx),document.querySelector("#"+this.prefix+"status")?.classList.remove("--status-hide"))},this.sellBy=function(t,e,i){if("disable"==this.currentSizeObj.availability.status)return!this.onDisableAlert||"product_bundle"==this.currentSizeObj.product_type&&1==this.firstRun||this.alert(this.txt.niedostepny),t;if(t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),isNaN(i)||i<=t){if(0===Object.keys(product_data.order_quantity_range).length)return t.toFixed(e);t=t.toFixed(e)}number=Math.floor(i/t)*t,number=(i/t*t-number).toFixed(e+1)>0?(1*number+t).toFixed(e):number.toFixed(e),number=parseFloat(number);var n=this.currentSizeObj.amount,s=t;if(0!==Object.keys(product_data.order_quantity_range).length){var o=product_data.order_quantity_range;if(o.max_quantity_per_order){var r=parseFloat(o.max_quantity_per_order);n=n>r||-1==n?r:n}if(o.max_size_quantity_per_order){var a=parseFloat(o.max_size_quantity_per_order);n=n>a||-1==n?a:n}if(o.min_quantity_per_order){var l=parseFloat(o.min_quantity_per_order);s=l>s?l:s}if(o.min_size_quantity_per_order){var c=parseFloat(o.min_size_quantity_per_order);s=c>s?c:s}if(o.minimum_quantity_subscription){var u=parseFloat(o.minimum_quantity_subscription);s=u>s?u:s}}if(s&&number<s){if(this.isStarted){const i=(Math.ceil(parseFloat(s)/t)*t).toFixed(e)>1?this.currentSizeObj.unit_plural:this.currentSizeObj.unit;this.alert(this.txt.minimalnie+" "+(Math.ceil(parseFloat(s)/t)*t).toFixed(e)+" "+i)}return this.isStarted=!0,(Math.ceil(parseFloat(s)/t)*t).toFixed(e)}if(number>n&&-1!=n){const i=(Math.floor(parseFloat(n)/t)*t).toFixed(e)>1?this.currentSizeObj.unit_plural:this.currentSizeObj.unit;return this.alert(this.txt.maksymalnie+" "+(Math.floor(parseFloat(n)/t)*t).toFixed(e)+" "+i),this.isStarted=!0,(Math.floor(parseFloat(n)/t)*t).toFixed(e)}return this.isStarted=!0,number},this.projectorInit=function(t){if(!this.isset("product_data"))return this.errorMsg.push("no data"),!1;this.curr_class=document.querySelector("#"+this.prefix+"form")?.className,t.contenersPrefix&&(this.options.contenersPrefix=t.contenersPrefix,this.prefix=t.contenersPrefix),"undefined"!==t.onDisableAlert&&(this.onDisableAlert=t.onDisableAlert),t.beginStartFunction&&(this.options.beginStartFunction=t.beginStartFunction),t.formatPrice&&(this.options.formatPrice=t.formatPrice,this.externalFormatFn=!0),t.endInitFunction&&(this.options.endInitFunction=t.endInitFunction),t.endStartFunction&&(this.options.endStartFunction=t.endStartFunction),t.endShippingFunction&&(this.options.endShippingFunction=t.endShippingFunction),t.endSetCurrentSizeFunction&&(this.options.endSetCurrentSizeFunction=t.endSetCurrentSizeFunction),t.ajaxAddFunction&&(this.options.ajaxAddFunction=t.ajaxAddFunction),t.clearXMLGetAjaxProductDataFunction&&(this.options.clearXMLGetAjaxProductDataFunction=t.clearXMLGetAjaxProductDataFunction),t.endGetAjaxProductDataFunction&&(this.options.endGetAjaxProductDataFunction=t.endGetAjaxProductDataFunction),t.beginGetAjaxProductDataFunction&&(this.options.beginGetAjaxProductDataFunction=t.beginGetAjaxProductDataFunction),t.hide_unit&&(this.options.hide_unit=t.hide_unit),t.curr_before_price&&(this.options.curr_before_price=t.curr_before_price),t.contact_link&&(this.options.contact_link=t.contact_link),t.hoursBeforeOrderBy&&(this.options.hoursBeforeOrderBy=t.hoursBeforeOrderBy),t.getShippingTimeFunction&&t.productParamsFunction&&(this.options.getShippingTimeFunction=t.getShippingTimeFunction,this.options.productParamsFunction=t.productParamsFunction),t.friendly_shipping_format&&(this.options.friendly_shipping_format=t.friendly_shipping_format),product_data.currency&&(this.currency=product_data.currency),this.txt.amount=document.querySelector("#"+this.prefix+"amount")?.innerHTML,product_data.sizes&&product_data.sizes.onesize&&(this.setCurrentSizeObj(this.getIndex(product_data.sizes,0)),this.start()),this.options.endInitFunction()},this.variety=function(t,e,i){return 1==t?e:i},this.formatDate=t=>t.slice(0,10).split("-").reverse().slice(0,-1).join("."),this.shippingTimeBuffer=[],this.timeoutHandle="",this.updateShippingTime=async()=>{const t=await this.options.getShippingTimeFunction(this.options.productParamsFunction());if(t&&t.data&&t.data.shipping&&t.data.shipping.shippingTime){const e=t.data.shipping.shippingTime;this.currentSizeObj.shipping_time={},this.currentSizeObj.shipping_time.unknown_time=e.unknownTime,this.currentSizeObj.shipping_time.today=`${e.shippingTime.today}`,this.currentSizeObj.shipping_time.today_shipment_deadline=e.todayShipmentDeadline,this.currentSizeObj.shipping_time.days=e.shippingTime.time.days,this.currentSizeObj.shipping_time.hours=e.shippingTime.time.hours,this.currentSizeObj.shipping_time.minutes=e.shippingTime.time.minutes,this.currentSizeObj.shipping_time.week_day=e.shippingTime.weekDay,this.currentSizeObj.shipping_time.week_amount=e.shippingTime.weekAmount,this.currentSizeObj.shipping_time.time=e.time}return t},this.shippingTime=async function(t){result=[];const e=md5(this.options.productParamsFunction()),i=this.shippingTimeBuffer.filter((t=>t.key===e));let n={};if(i.length)return i[0];if(projectorv3_disable_ajax&&0==projectorv3_disable_ajax||(n=await this.updateShippingTime()),"disable"!==this.currentSizeObj.availability.status&&this.currentSizeObj.shipping_time){const t=this.currentSizeObj.shipping_time;let i=!1;if(t.today_shipment_deadline){const e=t.today_shipment_deadline.split(":"),n=new Date;n.setHours(e[0],e[1],e[2]);const s=new Date;s.setHours(s.getHours()+this.options.hoursBeforeOrderBy),i=n.getTime()-s.getTime()<0}if(t.today_shipment_deadline&&i){result[0]=this.txt.order_by,result[1]=t.today_shipment_deadline.slice(0,-3)+this.txt.it_will_ship_today;const i={key:e,value:result,response:n};return this.shippingTimeBuffer.push(i),i}if("true"==t.today){result[0]=this.txt.wysylka,result[1]=this.options.friendly_shipping_format[0];const t={key:e,value:result,response:n};return this.shippingTimeBuffer.push(t),t}if(0==+t.days||1==+t.days&&0==+t.hours&&0==+t.minutes){this.txt.tomorrow?(result[0]=this.txt.wysylka,result[1]=this.txt.tomorrow):(result[0]=this.txt.wysylka_za,result[1]=this.txt.status_24);const t={key:e,value:result,response:n};return this.shippingTimeBuffer.push(t),t}if(+t.days>29&&this.txt.shipmentIn){result[0]=this.txt.shipmentIn,result[1]=+t.days+this.txt.days;const i={key:e,value:result,response:n};return this.shippingTimeBuffer.push(i),i}result[0]=this.txt.wysylka,result[1]=this.options.friendly_shipping_format[+t.week_day],+t.week_amount>0&&(result[1]+=`(${this.formatDate(t.time)})`)}const s={key:e,value:result,response:n};return this.shippingTimeBuffer.push(s),s},this.show=function(t){if(!t)return;if(""!==t.style.display)return void(t.style.display="");const{display:e}=getComputedStyle(t);t.style.display="none"!==e?e:"block"},this.hide=function(t){t&&(t.style.display="none")},this.off=function(t){if(!t)return;const e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)},this.start=function(){if(this.options.beginStartFunction(),window.projectorv3_disable_ajax=projectorv3_disable_ajax||1,!this.currentSizeObj.type)return!1;var e=this;const n=document.getElementById("projector_form")?.getAttribute("data-subscription");var s=async function(){(product_data.sizes.uniw||product_data.sizes.onesize)&&e.setCurrentSizeObj("uniw"),"true"===n?e.currentSizeObj.price=product_data.sizes[e.currentSizeObj.type].price_subscription:"false"===n&&(e.currentSizeObj.price=product_data.sizes[e.currentSizeObj.type].price_normal),document.querySelector("#"+e.prefix+"form")&&(document.querySelector("#"+e.prefix+"form").className=e.curr_class+" "+e.currentSizeObj.availability.status),e.configObj.displaySize="onesize"!=e.currentSizeObj.type,e.currentSizeObj.availability&&(e.configObj.disableNumberInput="disable"==e.currentSizeObj.availability.status),e.configObj.disableBuyButton=!1,"disable"!=e.currentSizeObj.availability.status&&"true"!=e.currentSizeObj.phone_price||(e.configObj.disableBuyButton=!0),e.configObj.displayBuySection=!!e.currentSizeObj.gratis;var s=e.currentSizeObj.unit_sellby+"";if(document.querySelector("#"+e.options.contenersPrefix+"number")&&(s=document.querySelector("#"+e.options.contenersPrefix+"number").value),e.configObj.valueOfNumberInput=e.sellBy(e.currentSizeObj.unit_sellby,e.currentSizeObj.unit_precision,s.replace(",",".")),e.currentSizeObj.rebateNumber)for(i in e.configObj.rabatIndex=-1,e.configObj.rabatIndex_last=-1,e.currentSizeObj.rebateNumber){var o=e.currentSizeObj.rebateNumber[i].threshold_end?e.currentSizeObj.rebateNumber[i].threshold_end:e.configObj.valueOfNumberInput;if(parseFloat(e.configObj.valueOfNumberInput)>=parseFloat(e.currentSizeObj.rebateNumber[i].threshold)&&parseFloat(e.configObj.valueOfNumberInput)<=parseFloat(o)){if(e.configObj.rabatIndex=i,e.configObj.rabatIndex_last=i,!e.currentSizeObj.rebateNumber[1*i+1]||parseFloat(e.configObj.valueOfNumberInput)<parseFloat(e.currentSizeObj.rebateNumber[1*i+1].threshold))break}else parseFloat(e.configObj.valueOfNumberInput)>=parseFloat(e.currentSizeObj.rebateNumber[i].threshold)&&(e.configObj.rabatIndex_last=i)}if(e.configObj.rabatIndex&&-1!=e.configObj.rabatIndex?(e.configObj.rebateNumber=e.currentSizeObj.rebateNumber[e.configObj.rabatIndex],e.configObj.rebateNumberNext=e.configObj.rebateNumber):e.configObj.rebateNumber=!1,e.currentSizeObj.rebateNumber&&e.currentSizeObj.rebateNumber[1*e.configObj.rabatIndex+1]&&(e.configObj.rebateNumberNext=e.currentSizeObj.rebateNumber[1*e.configObj.rabatIndex+1]),e.configObj.rabatIndex_last&&e.currentSizeObj.rebateNumber[1*e.configObj.rabatIndex_last+1]&&(e.configObj.rebateNumberNext=e.currentSizeObj.rebateNumber[1*e.configObj.rabatIndex_last+1]),"onesize"==e.currentSizeObj.type||"uniw"==e.currentSizeObj.type?e.hide(document.querySelector("#"+e.prefix+"sizes_cont")):e.show(document.querySelector("#"+e.prefix+"sizes_cont")),e.status_description(),document.querySelector("#"+e.prefix+"amount")){e.show(document.querySelector("#"+e.prefix+"amount"));var r=e.currentSizeObj.amount;0==r?e.hide(document.querySelector("#"+e.prefix+"amount")):-1==r&&(r=e.txt.infinity,""==e.txt.infinity&&e.hide(document.querySelector("#"+e.prefix+"amount"))),1==r?r=r+" "+e.currentSizeObj.unit:r>1&&(r=r+" "+e.currentSizeObj.unit_plural),document.querySelector("#"+e.prefix+"amount")&&(document.querySelector("#"+e.prefix+"amount").innerHTML=e.txt.amount.format(r))}if(e.currentSizeObj.product_type&&"product_virtual"==e.currentSizeObj.product_type&&e.hide(document.querySelector("#"+e.prefix+"amount")),"y"==e.currentSizeObj.availability.visible&&e.currentSizeObj&&e.currentSizeObj.availability.status_description?(e.show(document.querySelector("#"+e.prefix+"status_description_wrapper")),e.currentSizeObj.availability.status_gfx&&e.show(document.querySelector("#"+e.prefix+"status_gfx")),document.querySelector("#"+e.prefix+"status")?.classList.remove("--status-hide")):(e.hide(document.querySelector("#"+e.prefix+"status_description_wrapper")),e.hide(document.querySelector("#"+e.prefix+"status_gfx")),document.querySelector("#"+e.prefix+"status")?.classList.add("--status-hide")),"true"==e.currentSizeObj.availability.delivery_days_undefined&&"true"==e.currentSizeObj.delivery.undefined?e.hide(document.querySelector("#"+e.prefix+"delivery_wrapper")):e.show(document.querySelector("#"+e.prefix+"delivery_wrapper")),e.hide(document.querySelector("#"+e.prefix+"delivery_days")),projectorv3_disable_ajax&&0==projectorv3_disable_ajax){if(e.hide(document.querySelector("#"+e.prefix+"delivery_days")),e.currentSizeObj&&"true"!=e.currentSizeObj.availability.delivery_days_undefined){document.querySelector("#"+e.prefix+"status")?.classList.add("--loading","--time-show");const t=await e.shippingTime();if(t.value.length?(document.querySelector("#"+e.prefix+"delivery_label")&&(e.show(document.querySelector("#"+e.prefix+"delivery_label")),document.querySelector("#"+e.prefix+"delivery_label").innerHTML=t.value[0]),document.querySelector("#"+e.prefix+"delivery_days")&&(e.show(document.querySelector("#"+e.prefix+"delivery_days")),document.querySelector("#"+e.prefix+"delivery_days").innerHTML=t.value[1])):document.querySelector("#"+e.prefix+"status")?.classList.remove("--time-show"),document.querySelector("#"+e.prefix+"status_wrapper")){const t=document.querySelector("#"+e.prefix+"status_wrapper");t.style.minHeight="0px",t.style.minHeight=`${t.offsetHeight}px`}document.querySelector("#"+e.prefix+"status")?.classList.remove("--loading"),e.options.endShippingFunction(t.response)}}else if("true"!=e.currentSizeObj.availability.delivery_days_undefined){var a=e;clearTimeout(a.timeHandle),document.querySelector("#"+a.prefix+"delivery_days")&&document.querySelector("#"+a.prefix+"delivery_days").closest(".product_section")?.classList.add("loading"),a.timeHandle=setTimeout((async function(){document.querySelector("#"+e.prefix+"status")?.classList.add("--loading","--time-show");const t=await e.shippingTime();if(t.value.length?(document.querySelector("#"+e.prefix+"delivery_label")&&(e.show(document.querySelector("#"+e.prefix+"delivery_label")),document.querySelector("#"+e.prefix+"delivery_label").innerHTML=t.value[0]),document.querySelector("#"+e.prefix+"delivery_days")&&(e.show(document.querySelector("#"+e.prefix+"delivery_days")),document.querySelector("#"+e.prefix+"delivery_days").innerHTML=t.value[1])):document.querySelector("#"+e.prefix+"status")?.classList.remove("--time-show"),document.querySelector("#"+e.prefix+"status_wrapper")){const t=document.querySelector("#"+e.prefix+"status_wrapper");t.style.minHeight="0px",t.style.minHeight=`${t.offsetHeight}px`}document.querySelector("#"+e.prefix+"status")?.classList.remove("--loading"),e.options.endShippingFunction(t.response)}),50)}e.hide(document.querySelector("#"+e.prefix+"shipping_unknown")),e.currentSizeObj.product_type&&("product_virtual"==e.currentSizeObj.product_type||"product_service"==e.currentSizeObj.product_type)||"disable"==e.currentSizeObj.availability.status?(e.hide(document.querySelector("#"+e.prefix+"shipping_info")),e.hide(document.querySelector("#"+e.prefix+"shipping_dialog")),e.currentSizeObj.availability.status_description?e.show(document.querySelector("#"+e.prefix+"status_description")):e.hide(document.querySelector("#"+e.prefix+"status_description"))):(e.show(document.querySelector("#"+e.prefix+"shipping_info")),e.show(document.querySelector("#"+e.prefix+"shipping_dialog")),e.hide(document.querySelector("#"+e.prefix+"status_description"))),e.currentSizeObj.delay_time&&"true"==e.currentSizeObj.delay_time.unknown_delivery_time&&"order"==e.currentSizeObj.availability.status?(e.hide(document.querySelector("#"+e.prefix+"shipping_info")),e.hide(document.querySelector("#"+e.prefix+"shipping_dialog")),e.hide(document.querySelector("#"+e.prefix+"status_description")),e.hide(document.querySelector("#"+e.prefix+"status_wrapper")),document.querySelector("#"+e.prefix+"status")?.classList.add("--unknown-show"),e.show(document.querySelector("#"+e.prefix+"shipping_unknown"))):(document.querySelector("#"+e.prefix+"status")?.classList.remove("--unknown-show"),e.show(document.querySelector("#"+e.prefix+"status_wrapper"))),document.querySelector("#"+e.prefix+"shipping")&&(0==e.currentSizeObj.delivery.shipping?document.querySelector("#"+e.prefix+"shipping").innerHTML=e.txt.gratis:(document.querySelector("#"+e.prefix+"shipping").innerHTML=e.txt.koszt_od+e.formatPrice(e.currentSizeObj.delivery.shipping,t),document.querySelector("#"+e.prefix+"shipping")?.setAttribute("data-price",e.txt.koszt_od+e.formatPrice(e.currentSizeObj.delivery.shipping,t,!1,!0))),"true"==e.currentSizeObj.delivery.undefined?e.hide(document.querySelector("#"+e.prefix+"shipping")):e.show(document.querySelector("#"+e.prefix+"shipping"))),e.currentSizeObj.price.advanceprice?(e.show(document.querySelector("#"+e.prefix+"advanceprice_wrapper")),document.querySelector("#"+e.prefix+"advanceprice")&&(document.querySelector("#"+e.prefix+"advanceprice").innerHTML=e.formatPrice(e.currentSizeObj.price.advanceprice,t),document.querySelector("#"+e.prefix+"advanceprice")?.setAttribute("data-price",e.formatPrice(e.currentSizeObj.price.advanceprice,t,!1,!0)))):e.hide(document.querySelector("#"+e.prefix+"advanceprice_wrapper")),e.show(document.querySelector("#"+e.prefix+"sellbyprice_wrapper")),document.querySelector("#"+e.prefix+"sellbyprice")&&(document.querySelector("#"+e.prefix+"sellbyprice").innerHTML=e.nettoPrice?e.currentSizeObj.price.price_net_formatted:e.currentSizeObj.price.price_formatted,document.querySelector("#"+e.prefix+"sellbyprice")?.setAttribute("data-price",e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value)),e.hide(document.querySelector("#"+e.prefix+"prices_wrapper")),e.currentSizeObj.price.srp&&e.currentSizeObj.price.srp>0&&e.currentSizeObj.price.srp!=e.currentSizeObj.price.value?(e.show(document.querySelector("#"+e.prefix+"price_srp_wrapper")),e.show(document.querySelector("#"+e.prefix+"prices_wrapper")),document.querySelector("#"+e.prefix+"price_srp")&&(document.querySelector("#"+e.prefix+"price_srp").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.srp_net:e.currentSizeObj.price.srp,t),document.querySelector("#"+e.prefix+"price_srp")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.srp_net:e.currentSizeObj.price.srp,t,!1,!0)))):e.hide(document.querySelector("#"+e.prefix+"price_srp_wrapper")),e.currentSizeObj.price.price_net&&e.currentSizeObj.price.price_net>0?(e.show(document.querySelector("#"+e.prefix+"price_net_wrapper")),e.show(document.querySelector("#"+e.prefix+"price_net")),document.querySelector("#"+e.prefix+"price_net")&&(document.querySelector("#"+e.prefix+"price_net").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.value:e.currentSizeObj.price.price_net,t),document.querySelector("#"+e.prefix+"price_net")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.value:e.currentSizeObj.price.price_net,t,!1,!0)))):(e.hide(document.querySelector("#"+e.prefix+"price_net_wrapper")),e.hide(document.querySelector("#"+e.prefix+"price_net")));let l="";if("true"==e.currentSizeObj.phone_price)e.currentSizeObj.price.points>0?(e.hide(document.querySelector("#"+e.prefix+"price_value")),e.show(document.querySelector("#"+e.prefix+"prices_wrapper")),document.querySelector("#"+e.prefix+"prices_wrapper")?.classList.add("--only-points")):(e.show(document.querySelector("#"+e.prefix+"price_value")),e.show(document.querySelector("#"+e.prefix+"prices_wrapper")),document.querySelector("#"+e.prefix+"prices_wrapper")?.classList.remove("--only-points"),document.querySelector("#"+e.prefix+"price_value")&&(e.currentSizeObj.availability.status_gfx_tel&&""!=e.currentSizeObj.availability.status_gfx_tel?document.querySelector("#"+e.prefix+"price_value").innerHTML='<a class="projector_prices__contact" target="_blank" href="'+e.options.contact_link+'"><img src="'+e.currentSizeObj.availability.status_gfx_tel+'"/><span>'+e.currentSizeObj.availability.status_description_tel+"</span></a>":document.querySelector("#"+e.prefix+"price_value").innerHTML='<a class="projector_prices__contact" target="_blank" href="'+e.options.contact_link+'">'+e.currentSizeObj.availability.status_description_tel+"</a>"));else if(e.show(document.querySelector("#"+e.prefix+"price_value")),e.show(document.querySelector("#"+e.prefix+"prices_wrapper")),document.querySelector("#"+e.prefix+"prices_wrapper")?.classList.remove("--only-points"),e.currentSizeObj.price.rebateNumber){const t=e.configObj.valueOfNumberInput;if(e.currentSizeObj.price.rebateNumber.items.includes(null))document.querySelector("#"+e.prefix+"price_value")&&(+t>=+e.currentSizeObj.price.rebateNumber.nextleft?(document.querySelector("#"+e.prefix+"price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.rebateNumber.nextprice_net:e.currentSizeObj.price.rebateNumber.nextprice,!0,!1,!1),document.querySelector("#"+e.prefix+"price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.rebateNumber.nextprice_net:e.currentSizeObj.price.rebateNumber.nextprice,!0,!1,!0)),l=e.nettoPrice?e.currentSizeObj.price.rebateNumber.nextprice_net:e.currentSizeObj.price.rebateNumber.nextprice,e.rebateThreshold=e.currentSizeObj.price.rebateNumber.nextthreshold):(document.querySelector("#"+e.prefix+"price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!1),document.querySelector("#"+e.prefix+"price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!0)),e.rebateThreshold=!1));else{const i=[...e.currentSizeObj.price.rebateNumber.items].reverse().find((e=>t>=+e.left));document.querySelector("#"+e.prefix+"price_value")&&(i?(document.querySelector("#"+e.prefix+"price_value").innerHTML=e.formatPrice(e.nettoPrice?i.price_net:i.price,!0,!1,!1),document.querySelector("#"+e.prefix+"price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?i.price_net:i.price,!0,!1,!0)),l=e.nettoPrice?i.price_net:i.price,e.rebateThreshold=i.threshold):(document.querySelector("#"+e.prefix+"price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!1),document.querySelector("#"+e.prefix+"price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!0)),e.rebateThreshold=!1))}}else document.querySelector("#"+e.prefix+"price_value")&&(document.querySelector("#"+e.prefix+"price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!1),document.querySelector("#"+e.prefix+"price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.price_net:e.currentSizeObj.price.value,!0,!1,!0)));if(e.currentSizeObj.price.maxprice?e.currentSizeObj.price.maxprice>0?(e.show(document.querySelector("#"+e.prefix+"price_maxprice")),document.querySelector("#"+e.prefix+"price_maxprice")&&(document.querySelector("#"+e.prefix+"price_maxprice").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t),document.querySelector("#"+e.prefix+"price_maxprice")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t,!1,!0)))):e.hide(document.querySelector("#"+e.prefix+"price_maxprice")):""!=l?(e.currentSizeObj.price.maxprice=e.currentSizeObj.price.value,e.currentSizeObj.price.maxprice_net=e.currentSizeObj.price.price_net,e.currentSizeObj.price.maxprice>0?(e.show(document.querySelector("#"+e.prefix+"price_maxprice")),document.querySelector("#"+e.prefix+"price_maxprice")&&(document.querySelector("#"+e.prefix+"price_maxprice").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t),document.querySelector("#"+e.prefix+"price_maxprice")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t,!1,!0)))):e.hide(document.querySelector("#"+e.prefix+"price_maxprice"))):e.hide(document.querySelector("#"+e.prefix+"price_maxprice")),e.currentSizeObj.price.omnibus_price&&document.querySelector("#"+e.prefix+"omnibus_price_value")&&(document.querySelector("#"+e.prefix+"omnibus_price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.omnibus_price_net:e.currentSizeObj.price.omnibus_price,t),document.querySelector("#"+e.prefix+"omnibus_price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.omnibus_price_net:e.currentSizeObj.price.omnibus_price,t,!1,!0))),e.currentSizeObj.price.beforerebate&&document.querySelector("#"+e.prefix+"price_beforerebate")&&(document.querySelector("#"+e.prefix+"price_beforerebate").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.beforerebate_net:e.currentSizeObj.price.beforerebate,t),document.querySelector("#"+e.prefix+"price_beforerebate")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.beforerebate_net:e.currentSizeObj.price.beforerebate,t,!1,!0))),e.currentSizeObj.price.maxprice&&document.querySelector("#"+e.prefix+"new_price_value")&&(document.querySelector("#"+e.prefix+"new_price_value").innerHTML=e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t),document.querySelector("#"+e.prefix+"new_price_value")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.price.maxprice_net:e.currentSizeObj.price.maxprice,t,!1,!0))),e.options.hide_unit?(e.hide(document.querySelector("#"+e.prefix+"price_unit_sellby")),e.hide(document.querySelector("#"+e.prefix+"price_unit"))):1==e.configObj.valueOfNumberInput?(e.hide(document.querySelector("#"+e.prefix+"price_unit_sellby")),document.querySelector("#"+e.prefix+"price_unit_sellby")&&(document.querySelector("#"+e.prefix+"price_unit_sellby").innerHTML=e.configObj.valueOfNumberInput),document.querySelector("#"+e.prefix+"price_unit")&&(document.querySelector("#"+e.prefix+"price_unit").innerHTML=e.currentSizeObj.unit)):(e.show(document.querySelector("#"+e.prefix+"price_unit_sellby")),document.querySelector("#"+e.prefix+"price_unit_sellby")&&(document.querySelector("#"+e.prefix+"price_unit_sellby").innerHTML=e.configObj.valueOfNumberInput),document.querySelector("#"+e.prefix+"price_unit")&&(document.querySelector("#"+e.prefix+"price_unit").innerHTML=e.currentSizeObj.unit_plural?e.currentSizeObj.unit_plural:e.currentSizeObj.unit)),e.currentSizeObj.bundle_price||e.currentSizeObj.price.yousave_percent?e.show(document.querySelector("#"+e.prefix+"yousave_bundle_wrapper")):e.hide(document.querySelector("#"+e.prefix+"yousave_bundle_wrapper")),yousaveTmp=e.nettoPrice?e.currentSizeObj.price.yousave_net:e.currentSizeObj.price.yousave,yousave_percentTmp=e.currentSizeObj.price.yousave_percent,""!=l&&(yousaveTmp=e.nettoPrice?+e.currentSizeObj.price.maxprice_net-+l:+e.currentSizeObj.price.maxprice-+l,yousave_percentTmp=(100*+yousaveTmp/(e.nettoPrice?+e.currentSizeObj.price.maxprice_net:+e.currentSizeObj.price.maxprice)).toFixed()),0==+yousave_percentTmp&&(yousave_percentTmp=(+yousaveTmp/(e.nettoPrice?+e.currentSizeObj.price.price_net:+e.currentSizeObj.price.value)*100).toFixed(1)),document.querySelector("#"+e.prefix+"price_yousave")&&("true"!=e.currentSizeObj.phone_price&&e.currentSizeObj.bundle_price&&e.currentSizeObj.bundle_price.amount_diff_gross>0?(e.show(document.querySelector("#"+e.prefix+"price_yousave")),document.querySelector("#"+e.prefix+"price_yousave").innerHTML=e.txt.oszczedzasz+e.currentSizeObj.bundle_price.percent_diff+e.txt.taniej+e.formatPrice(e.nettoPrice?e.currentSizeObj.bundle_price.amount_diff_net:e.currentSizeObj.bundle_price.amount_diff_gross,t)+e.txt.wzestawie,document.querySelector("#"+e.prefix+"price_yousave")?.setAttribute("data-price",e.formatPrice(e.nettoPrice?e.currentSizeObj.bundle_price.amount_diff_net:e.currentSizeObj.bundle_price.amount_diff_gross,t,!1,!0))):"true"!=e.currentSizeObj.phone_price&&yousaveTmp?(e.show(document.querySelector("#"+e.prefix+"price_yousave")),document.querySelector("#"+e.prefix+"price_yousave").innerHTML=e.txt.oszczedzasz+yousave_percentTmp+e.txt.taniej+e.formatPrice(yousaveTmp,t)+e.txt.nawias_end,document.querySelector("#"+e.prefix+"price_yousave")?.setAttribute("data-price",e.formatPrice(yousaveTmp,t,!1,!0))):e.hide(document.querySelector("#"+e.prefix+"price_yousave"))),e.hide(document.querySelector("#"+e.prefix+"price_points_wrapper")),e.currentSizeObj.price.points>0&&(e.show(document.querySelector("#"+e.prefix+"price_points")),document.querySelector("#"+e.prefix+"price_points")&&(document.querySelector("#"+e.prefix+"price_points").innerHTML=e.formatPrice(e.currentSizeObj.price.points,t,e.txt.pkt,!0).toFixed(2)+e.txt.pkt,document.querySelector("#"+e.prefix+"price_points")?.setAttribute("data-price",e.formatPrice(e.currentSizeObj.price.points,t,e.txt.pkt,!0).toFixed(2))),e.show(document.querySelector("#"+e.prefix+"points_wrapper")),e.show(document.querySelector("#"+e.prefix+"price_points_wrapper"))),e.currentSizeObj.price.points_recive>0?(e.show(document.querySelector("#"+e.prefix+"points_wrapper")),e.show(document.querySelector("#"+e.prefix+"points_recive_points")),document.querySelector("#"+e.prefix+"points_recive_points")&&(document.querySelector("#"+e.prefix+"points_recive_points").innerHTML=e.formatPrice(e.currentSizeObj.price.points_recive,t,e.txt.pkt,!0).toFixed(2)+e.txt.pkt,document.querySelector("#"+e.prefix+"points_recive_points")?.setAttribute("data-price",e.formatPrice(e.currentSizeObj.price.points_recive,t,e.txt.pkt,!0).toFixed(2))),e.show(document.querySelector("#"+e.prefix+"price_points_recive_wrapper"))):e.hide(document.querySelector("#"+e.prefix+"price_points_recive_wrapper")),e.currentSizeObj.for_points,e.hide(document.querySelector("#"+e.prefix+"tell_availability")),document.querySelector("#"+e.prefix+"tell_availability")){document.querySelector("#"+e.prefix+"tell_availability").querySelectorAll("input").forEach((t=>t.disabled=!0))}var c=e;if(e.configObj.addBasketFnBtn)e.off(document.querySelector("#"+e.prefix+"button_basket")),document.querySelector("#"+e.prefix+"button_basket")&&document.querySelector("#"+e.prefix+"button_basket").addEventListener("click",(function(t){c.configObj.addBasketFnBtn(),t.preventDefault()})),document.querySelector("#"+e.prefix+"button_basket")?.classList.remove("disabled");else if(e.configObj.disableBuyButtonTXT){var u=e.configObj.disableBuyButtonTXT;document.querySelector("#"+e.prefix+"button_basket")&&document.querySelector("#"+e.prefix+"button_basket").addEventListener("click",(function(t){classObj.alert(u),t.preventDefault()})),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!0)}else if("disable"==e.currentSizeObj.availability.status){if(e.hide(document.querySelector("#"+e.prefix+"price_points_wrapper")),document.querySelector("#"+e.prefix+"button_basket")&&document.querySelector("#"+e.prefix+"button_basket").addEventListener("click",(function(t){classObj.alert(classObj.txt.niedostepny),t.preventDefault()})),document.querySelector("#"+e.prefix+"button_basket")?.classList.add("disabled"),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!0),e.show(document.querySelector("#"+e.prefix+"tell_availability")),document.querySelector("#"+e.prefix+"tell_availability")){document.querySelector("#"+e.prefix+"tell_availability").querySelectorAll("input").forEach((t=>t.disabled=!1))}}else"true"==e.currentSizeObj.phone_price&&e.currentSizeObj.price.points>0?(document.querySelector("#"+e.prefix+"button_basket")&&document.querySelector("#"+e.prefix+"button_basket").addEventListener("click",(function(t){classObj.alert(classObj.txt.tylko_punkty),t.preventDefault()})),document.querySelector("#"+e.prefix+"button_basket")?.classList.add("disabled"),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!0)):"true"==e.currentSizeObj.phone_price?(document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!1),document.querySelector("#"+e.prefix+"button_basket")&&document.querySelector("#"+e.prefix+"button_basket").addEventListener("click",(function(t){classObj.alert(classObj.txt.tylkotel),t.preventDefault()})),document.querySelector("#"+e.prefix+"button_basket")?.classList.add("disabled"),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!0),document.querySelector("#"+e.prefix+"form")?.classList.add("--phone")):(e.off(document.querySelector("#"+e.prefix+"button_basket")),document.querySelector("#"+e.prefix+"button_basket")?.classList.remove("disabled"),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!1),document.querySelector("#"+e.prefix+"form")?.classList.remove("--phone"));return e.currentSizeObj.gratis&&(e.hide(document.querySelector("#"+e.prefix+"buy_section")),e.hide(document.querySelector("#"+e.prefix+"price_points_wrapper"))),e.currentSizeObj.price.basket_enable&&"y"==e.currentSizeObj.price.basket_enable&&"true"==e.currentSizeObj.phone_price&&(e.off(document.querySelector("#"+e.prefix+"button_basket")),document.querySelector("#"+e.prefix+"button_basket")?.classList.remove("disabled"),document.querySelector("#"+e.prefix+"number")&&(document.querySelector("#"+e.prefix+"number").disabled=!1),document.querySelector("#"+e.prefix+"price_value")&&(document.querySelector("#"+e.prefix+"price_value").innerHTML='<span class="'+e.prefix+'_price_gratis">'+e.txt.gratis_produkt+"</span>")),document.querySelector("#"+e.options.contenersPrefix+"number")&&(document.querySelector("#"+e.options.contenersPrefix+"number").value=e.configObj.valueOfNumberInput),document.querySelector("#"+e.options.contenersPrefix+"buy_section .f-dropdown-button")&&(document.querySelector("#"+e.options.contenersPrefix+"buy_section .f-dropdown-button").textContent=e.configObj.valueOfNumberInput),e.configObj.rebateNumberNext&&(document.querySelector("#"+e.prefix+"product_rebatenumber_value")&&(document.querySelector("#"+e.prefix+"product_rebatenumber_value").textContent=(e.configObj.rebateNumberNext.value+e.txt.proc).replace(/\.00/gi,"")),document.querySelector("#"+e.prefix+"product_rebatenumber_threshold")&&(document.querySelector("#"+e.prefix+"product_rebatenumber_threshold").textContent=e.configObj.rebateNumberNext.threshold.replace(/\.00/gi,""))),e.firstRun=!1,e.options.endStartFunction(),!0};const o=async t=>{const e=await fetch(t);return await e.json()};product_data.sizes[e.currentSizeObj.type].availability?"true"!==n||product_data.sizes[e.currentSizeObj.type].price_subscription?"false"!==n||product_data.sizes[e.currentSizeObj.type].price_normal?s():o("/ajax/projector.php?action=get&product="+product_data.product_id+"&size="+e.currentSizeObj.type+"&get=sizeprices").then((t=>{product_data.sizes[e.currentSizeObj.type].price=t.sizeprices,product_data.sizes[e.currentSizeObj.type].price_normal=t.sizeprices,s()})):o("/ajax/projector.php?action=get&product="+product_data.product_id+"&size="+e.currentSizeObj.type+"&get=sizeprices&subscription=1").then((t=>{product_data.sizes[e.currentSizeObj.type].price=t.sizeprices,product_data.sizes[e.currentSizeObj.type].price_subscription=t.sizeprices,s()})):product_data.sizes&&("product_bundle"!=product_data.product_type?o("/ajax/projector.php?action=get&product="+product_data.product_id+"&size="+e.currentSizeObj.type+"&get=sizeavailability,sizedelivery,sizeprices"+("true"===n?"&subscription=1":"")).then((t=>{product_data.sizes[e.currentSizeObj.type].availability=t.sizeavailability,product_data.sizes[e.currentSizeObj.type].delivery=t.sizedelivery,product_data.sizes[e.currentSizeObj.type].price=t.sizeprices,product_data.sizes[e.currentSizeObj.type].delay_time=t.sizeavailability.delay_time,"true"===n?product_data.sizes[e.currentSizeObj.type].price_subscription=t.sizeprices:product_data.sizes[e.currentSizeObj.type].price_normal=t.sizeprices,s()})):"product_bundle"==product_data.product_type&&app_shop.fn.update_bundle&&app_shop.fn.update_bundle())},this.liczProcent=function(t,e){return(t=parseFloat(t))-t*((e=parseFloat(e))/100)},this.addAction=function(t,e,i){this.actions[t]||(this.actions[t]={}),this.actions[t][e]=i},this.getConfigObj=function(){return this.configObj},this.alert=function(t){Alertek.show_alert(t)},this.setCurrentSizeObj=async function(t){if(projectorv3_disable_ajax&&0==projectorv3_disable_ajax)product_data.sizes[t]?(this.currentSizeObj=product_data.sizes[t],this.currentSizeObj.product_type=product_data.product_type,this.currentSizeObj.currency=product_data.currency,this.currentSizeObj.unit=product_data.unit,this.currentSizeObj.unit_plural=product_data.unit_plural?product_data.unit_plural:"",this.currentSizeObj.unit_sellby=""!=product_data.unit_sellby?product_data.unit_sellby:1,this.currentSizeObj.unit_precision=""!=product_data.unit_precision?product_data.unit_precision:0):this.errorMsg.push("setCurrentSize no data"),this.options.endSetCurrentSizeFunction();else{var e=this,i=function(){"onesize"==t&&(t="uniw"),product_data.sizes[t]?(e.currentSizeObj=product_data.sizes[t],e.currentSizeObj.product_type=product_data.product_type,e.currentSizeObj.currency=product_data.currency,e.currentSizeObj.unit=product_data.unit,e.currentSizeObj.unit_plural=product_data.unit_plural?product_data.unit_plural:"",e.currentSizeObj.unit_sellby=""!=product_data.unit_sellby?product_data.unit_sellby:1,e.currentSizeObj.unit_precision=""!=product_data.unit_precision?product_data.unit_precision:0,product_data.for_points&&(e.currentSizeObj.for_points=product_data.for_points)):e.errorMsg.push("setCurrentSize no data")};if(product_data.sizes)i();else{const t=await fetch("/ajax/projector.php?action=get&product="+product_data.product_id+"&get=sizes"),n=await t.json();if(n.sizes){product_data.sizes={};for(const t of n.sizes.items)product_data.sizes[t.type]=t;i(),e.start()}}this.options.endSetCurrentSizeFunction()}},this.getCurrentSizeObj=function(t){return this.currentSizeObj},this.getCalculatedPrice=(t="price")=>{switch(t){case"advance":return{value:parseFloat(document.querySelector(`#${this.prefix}advanceprice`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}advanceprice`)?.innerHTML};case"srp":return{value:parseFloat(document.querySelector(`#${this.prefix}price_srp`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_srp`)?.innerHTML};case"net":return{value:parseFloat(document.querySelector(`#${this.prefix}price_net`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_net`)?.innerHTML};case"max":return{value:parseFloat(document.querySelector(`#${this.prefix}price_maxprice`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_maxprice`)?.innerHTML};case"omnibus":return{value:parseFloat(document.querySelector(`#${this.prefix}omnibus_price_value`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}omnibus_price_value`)?.innerHTML};case"before":return{value:parseFloat(document.querySelector(`#${this.prefix}price_beforerebate`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_beforerebate`)?.innerHTML};case"new":return{value:parseFloat(document.querySelector(`#${this.prefix}new_price_value`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}new_price_value`)?.innerHTML};case"points":return{value:parseFloat(document.querySelector(`#${this.prefix}price_points`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_points`)?.innerHTML};case"pointsRecive":return{value:parseFloat(document.querySelector(`#${this.prefix}points_recive_points`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}points_recive_points`)?.innerHTML};default:return{value:parseFloat(document.querySelector(`#${this.prefix}price_value`)?.getAttribute("data-price")),formatted:document.querySelector(`#${this.prefix}price_value`)?.innerHTML}}}};app_shop.vars.xhr="",app_shop.getFile=t=>{const e=document.createElement("script");e.src=`${app_shop.urls.prefix}${t}.js`,document.body.appendChild(e)},app_shop.getOuterJS=t=>{t.forEach((t=>{const e=document.createElement("script");e.src=`${app_shop.urls.prefix}${t}.js`,document.body.appendChild(e)}))},app_shop.run=(t,e,i,n)=>{(Array.isArray(e)?e:[e]).forEach((e=>{app_shop.fnrun[e]=app_shop.fnrun[e]||[],app_shop.fnrun[e].push({w:i,fn:t,a:n})}))},app_shop.runArr=(t,e,i)=>{t&&t.forEach((t=>{const{w:e,fn:n,a:s}=t;(!e||null!==document.querySelector(e))&&(i&&e&&!s||n())}))};class iaiGetAjax{constructor(){this.data={},this.cache={},this.fn={}}addToData(t,e,i){this.data[t]||(this.data[t]=e,this.fn[t]=i)}projector(t){this.addToData("Projector",{format:"json",params:{}},t)}basket(t){this.addToData("Basket",{},t)}wishlist(t){this.addToData("Wishlist",{},t)}comparers(t){this.addToData("Comparers",{},t)}snippets(t,e){this.addToData("Snippets",{format:"json",params:{mobile:e.mobile,tablet:e.tablet,pc:e.pc,request_uri:e.request_uri,additional_ajax:e.additional_ajax}},t)}toplayersAndWidgets(t,e){this.addToData("ToplayersAndWidgets",{format:"json",params:{mobile:e.mobile,tablet:e.tablet,pc:e.pc,request_uri:e.request_uri,additional_ajax:e.additional_ajax}},t)}reInit(t=[]){t.length?(Object.keys(this.data).forEach((e=>{t.includes(e)||(delete this.data[e],delete this.fn[e],delete this.cache[e])})),this.init()):this.init()}init(){const t=`request=${JSON.stringify(this.data)}`;fetch("/ajax/get.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}).then((t=>t.json())).then((t=>{this.cache=t,Object.values(this.fn).forEach((t=>t(this.cache)))})).catch((t=>{}))}}const iaiGet=new iaiGetAjax;app_shop.fn.change_url=t=>{history.pushState&&history.pushState({foo:"bar"},"",decodeURIComponent(t))},app_shop.fn.evalJSFromHtml=function(t){(t?.querySelectorAll("script.ajaxLoad")||[]).forEach((t=>{const e=document.createElement("script");e.innerHTML=t.innerHTML,document.body.appendChild(e)}))},app_shop.fn.load=async(t,e,i,n="")=>{const s=`${t}${n}`,o=new AbortController,r=setTimeout((()=>o.abort()),16e3);e.forEach((([t])=>document.querySelector(t)?.classList.add("load-content")));try{const n=await fetch(s,{signal:o.signal}),r=await n.text(),a=(new DOMParser).parseFromString(r,"text/html");e.forEach((t=>{const[e,i]=t,n=document.querySelector(e),s=a.querySelector(i);n&&s&&(n.outerHTML=s.outerHTML)})),app_shop.fn.change_url(t),app_shop.fn.evalJSFromHtml(a),i&&i(a)}catch(e){window.location.href=t}finally{clearTimeout(r)}},app_shop.fn.variety=(t,e,i)=>1==+t?e:i,app_shop.fn.setGrid=()=>{if(1===app_shop.vars.view){return void document.querySelectorAll(".setMobileGrid").forEach((t=>{const e=t.dataset.item,i=document.querySelector(e);if(!i)return;const n=document.createElement("del");n.className="domHandler",n.dataset.item=e,n.style.display="none",t.before(n),t.append(i)}))}document.querySelectorAll(".domHandler").forEach((t=>{const e=t.dataset.item,i=document.querySelector(e);i&&(t.after(i),t.remove())}))},app_shop.fn.runAjaxFn=()=>{if(app_shop.runArr(app_shop.fnrun.all,"all",!0),app_shop.vars.view)return void app_shop.runArr(app_shop.fnrun[app_shop.vars.view],app_shop.vars.view,!0);const t=document.getElementById("viewType");if(!t)return;const{width:e}=window.getComputedStyle(t);app_shop.vars.view=parseInt(e,10),app_shop.runArr(app_shop.fnrun[app_shop.vars.view],app_shop.vars.view,!0)},app_shop.runApp=()=>{const t=document.getElementById("viewType"),{width:e}=window.getComputedStyle(t)||{};app_shop.vars.view=parseInt(e,10)||1,app_shop.runArr(app_shop.fnrun.all,"all"),app_shop.runArr(app_shop.fnrun[app_shop.vars.view],app_shop.vars.view),app_shop.fn.setGrid(),app_shop.getOuterJS(app_shop.files),iaiGet.init();let i,n=app_shop.vars.view;const s=()=>{clearTimeout(i),i=setTimeout((()=>{const{width:e}=window.getComputedStyle(t);app_shop.vars.view=parseInt(e,10),app_shop.vars.view!==n&&(n=app_shop.vars.view,app_shop.runArr(app_shop.fnrun[app_shop.vars.view],app_shop.vars.view),app_shop.fn.setGrid())}),100)};window.removeEventListener("resize",s),window.addEventListener("resize",s)},app_shop.fn.getRwdSrc=t=>{if(!t)return"";const{src_mobile:e,src_tablet:i,src_desktop:n}=t.dataset||t.data()||{},s=[e,i,n,n][app_shop.vars.view-1];return s||""},app_shop.fn.rwdBanner=(t,e)=>{t&&e&&e.forEach((e=>{app_shop.run((()=>{document.querySelectorAll(t).forEach((t=>{t.querySelectorAll("img.rwd-src").forEach((t=>{t.setAttribute("src",app_shop.fn.getRwdSrc(t))}))}))}),e,t)}))},String.prototype.format=function(...t){let e=this;return t.forEach((t=>{e=e.replace(/%[a-z]/,t)})),e},app_shop.fn.news_data=function(t){const{data:e,month_names:i,format:n="%d-%m-%y"}=t||{};if(!e)return!1;const s=e.split("-");return!(s.length<3)&&(i&&(s[1]=i[parseInt(s[1],10)-1]),n.format(s[2],s[1],s[0]))},app_shop.fn.setHeight=t=>{const{selector:e,selectors:i,container:n}=t||{};if(!e&&!i||!n)return;const s=document.querySelector(n);if(!s)return;const o=t=>{if(!t)return 0;const{marginLeft:e,marginRight:i}=window.getComputedStyle(t);return t.offsetWidth+parseInt(e,10)+parseInt(i,10)},r=o(s),a=o(s.firstElementChild),l=t=>{if(!document.querySelectorAll(t).length)return;if(!a)return;const e=Math.round(r/a);if(!e)return;const i=[...s.children];for(let n=0;n<i.length;n+=e){const s=i.slice(n,n+e).map((e=>e.querySelector(t))),o=Math.max(...s.map((t=>t?.offsetHeight)));s.forEach((t=>{t&&(t.style.minHeight=`${o}px`)}))}};e&&l(e),i?.length&&i.forEach((t=>l(t)))};var markerClusterer=function(t){"use strict";function e(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}class i{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}}class n{constructor(t){let{markers:e,position:i}=t;this.markers=e,i&&(i instanceof google.maps.LatLng?this._position=i:this._position=new google.maps.LatLng(i))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(i.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((t=>i.getVisible(t))).length}push(t){this.markers.push(t)}delete(){this.marker&&(i.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const s=(t,e,n,s)=>{const r=o(t.getBounds(),e,s);return n.filter((t=>r.contains(i.getPosition(t))))},o=(t,e,i)=>{const{northEast:n,southWest:s}=l(t,e),o=c({northEast:n,southWest:s},i);return u(o,e)},r=(t,e,i)=>{const n=o(t,e,i),s=n.getNorthEast(),r=n.getSouthWest();return[r.lng(),r.lat(),s.lng(),s.lat()]},a=(t,e)=>{const i=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,s=Math.sin(i/2),o=Math.sin(n/2),r=s*s+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*o*o;return 2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))*6371},l=(t,e)=>({northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}),c=(t,e)=>{let{northEast:i,southWest:n}=t;return i.x+=e,i.y-=e,n.x-=e,n.y+=e,{northEast:i,southWest:n}},u=(t,e)=>{let{northEast:i,southWest:n}=t;const s=e.fromDivPixelToLatLng(n),o=e.fromDivPixelToLatLng(i);return new google.maps.LatLngBounds(s,o)};class h{constructor(t){let{maxZoom:e=16}=t;this.maxZoom=e}noop(t){let{markers:e}=t;return p(e)}}class d extends h{constructor(t){var{viewportPadding:i=60}=t;super(e(t,["viewportPadding"])),this.viewportPadding=60,this.viewportPadding=i}calculate(t){let{markers:e,map:i,mapCanvasProjection:n}=t;return i.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:s(i,n,e,this.viewportPadding),map:i,mapCanvasProjection:n})}}}const p=t=>t.map((t=>new n({position:i.getPosition(t),markers:[t]})));var _=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var n,s,o;if(Array.isArray(e)){if((n=e.length)!=i.length)return!1;for(s=n;0!=s--;)if(!t(e[s],i[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(i,o[s]))return!1;for(s=n;0!=s--;){var r=o[s];if(!t(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}));const m=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const s=m[15&i];if(!s)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[r]=new Uint32Array(t,4,1);return new f(r,o,s,t)}constructor(t,e=64,i=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=m.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,r=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-r%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+r+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+r+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+r+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+s]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return g(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:r}=this,a=[0,s.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=r){for(let r=h;r<=u;r++){const a=o[2*r],c=o[2*r+1];a>=t&&a<=i&&c>=e&&c<=n&&l.push(s[r])}continue}const d=h+u>>1,p=o[2*d],_=o[2*d+1];p>=t&&p<=i&&_>=e&&_<=n&&l.push(s[d]),(0===c?t<=p:e<=_)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?i>=p:n>=_)&&(a.push(d+1),a.push(u),a.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:s,nodeSize:o}=this,r=[0,n.length-1,0],a=[],l=i*i;for(;r.length;){const c=r.pop()||0,u=r.pop()||0,h=r.pop()||0;if(u-h<=o){for(let i=h;i<=u;i++)x(s[2*i],s[2*i+1],t,e)<=l&&a.push(n[i]);continue}const d=h+u>>1,p=s[2*d],_=s[2*d+1];x(p,_,t,e)<=l&&a.push(n[d]),(0===c?t-i<=p:e-i<=_)&&(r.push(h),r.push(d-1),r.push(1-c)),(0===c?t+i>=p:e+i>=_)&&(r.push(d+1),r.push(u),r.push(1-c))}return a}}function g(t,e,i,n,s,o){if(s-n<=i)return;const r=n+s>>1;y(t,e,r,n,s,o),g(t,e,i,n,r-1,1-o),g(t,e,i,r+1,s,1-o)}function y(t,e,i,n,s,o){for(;s>n;){if(s-n>600){const r=s-n+1,a=i-n+1,l=Math.log(r),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(r-c)/r)*(a-r/2<0?-1:1);y(t,e,i,Math.max(n,Math.floor(i-a*c/r+u)),Math.min(s,Math.floor(i+(r-a)*c/r+u)),o)}const r=e[2*i+o];let a=n,l=s;for(v(t,e,n,i),e[2*s+o]>r&&v(t,e,n,s);a<l;){for(v(t,e,a,l),a++,l--;e[2*a+o]<r;)a++;for(;e[2*l+o]>r;)l--}e[2*n+o]===r?v(t,e,n,l):(l++,v(t,e,l,s)),l<=i&&(n=l+1),i<=l&&(s=l-1)}}function v(t,e,i,n){b(t,i,n),b(e,2*i,2*n),b(e,2*i+1,2*n+1)}function b(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function x(t,e,i,n){const s=t-i,o=e-n;return s*s+o*o}const w={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},L=Math.fround||(S=new Float32Array(1),t=>(S[0]=+t,S[0]));var S;const k=3,C=5,T=6;class M{constructor(t){this.options=Object.assign(Object.create(w),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:n}=this.options;t.length;this.points=t;const s=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i.geometry)continue;const[n,o]=i.geometry.coordinates,r=L(E(n)),a=L(O(o));s.push(r,a,1/0,e,-1,1),this.options.reduce&&s.push(0)}let o=this.trees[n+1]=this._createTree(s);for(let t=n;t>=i;t--){Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t))}return this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,s=180;else if(i>s){const t=this.getClusters([i,n,180,o],e),r=this.getClusters([-180,n,s,o],e);return t.concat(r)}const r=this.trees[this._limitZoom(e)],a=r.range(E(i),O(o),E(s),O(n)),l=r.data,c=[];for(const t of a){const e=this.stride*t;c.push(l[e+C]>1?P(l,e,this.clusterProps):this.points[l[e+k]])}return c}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[i];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const r=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=o[e*this.stride],l=o[e*this.stride+1],c=s.within(a,l,r),u=[];for(const e of c){const i=e*this.stride;o[i+4]===t&&u.push(o[i+C]>1?P(o,i,this.clusterProps):this.points[o[i+k]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,i){e=e||10,i=i||0;const n=[];return this._appendLeaves(n,t,e,i,0),n}getTile(t,e,i){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:r}=this.options,a=r/o,l=(i-a)/s,c=(i+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,l,(e+1+a)/s,c),n.data,e,i,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,l,1,c),n.data,s,i,s,u),e===s-1&&this._addTileFeatures(n.range(0,l,a/s,c),n.data,-1,i,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,n,s){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?s+o.point_count<=n?s+=o.point_count:s=this._appendLeaves(t,o.cluster_id,i,n,s):s<n?s++:t.push(e),t.length===i)break}return s}_createTree(t){const e=new f(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<t.length;i+=this.stride)e.add(t[i],t[i+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,i,n,s,o){for(const r of t){const t=r*this.stride,a=e[t+C]>1;let l,c,u;if(a)l=z(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const i=this.points[e[t+k]];l=i.properties;const[n,s]=i.geometry.coordinates;c=E(n),u=O(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*s-i)),Math.round(this.options.extent*(u*s-n))]],tags:l};let d;d=a||this.options.generateId?e[t+k]:this.points[e[t+k]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:n,reduce:s,minPoints:o}=this.options,r=i/(n*Math.pow(2,e)),a=t.data,l=[],c=this.stride;for(let i=0;i<a.length;i+=c){if(a[i+2]<=e)continue;a[i+2]=e;const n=a[i],u=a[i+1],h=t.within(a[i],a[i+1],r),d=a[i+C];let p=d;for(const t of h){const i=t*c;a[i+2]>e&&(p+=a[i+C])}if(p>d&&p>=o){let t,o=n*d,r=u*d,_=-1;const m=((i/c|0)<<5)+(e+1)+this.points.length;for(const n of h){const l=n*c;if(a[l+2]<=e)continue;a[l+2]=e;const u=a[l+C];o+=a[l]*u,r+=a[l+1]*u,a[l+4]=m,s&&(t||(t=this._map(a,i,!0),_=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,l)))}a[i+4]=m,l.push(o/p,r/p,1/0,m,-1,p),s&&l.push(_)}else{for(let t=0;t<c;t++)l.push(a[i+t]);if(p>1)for(const t of h){const i=t*c;if(!(a[i+2]<=e)){a[i+2]=e;for(let t=0;t<c;t++)l.push(a[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+C]>1){const n=this.clusterProps[t[e+T]];return i?Object.assign({},n):n}const n=this.points[t[e+k]].properties,s=this.options.map(n);return i&&s===n?Object.assign({},s):s}}function P(t,e,i){return{type:"Feature",id:t[e+k],properties:z(t,e,i),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),I(t[e+1])]}};var n}function z(t,e,i){const n=t[e+C],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+T],r=-1===o?{}:Object.assign({},i[o]);return Object.assign(r,{cluster:!0,cluster_id:t[e+k],point_count:n,point_count_abbreviated:s})}function E(t){return t/360+.5}function O(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function I(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}class A extends h{constructor(t){var{maxZoom:i,radius:n=60}=t,s=e(t,["maxZoom","radius"]);super({maxZoom:i}),this.state={zoom:-1},this.superCluster=new M(Object.assign({maxZoom:this.maxZoom,radius:n},s))}calculate(t){let e=!1;const n={zoom:t.map.getZoom()};if(!_(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const n=this.markers.map((t=>{const e=i.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(n)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!_(this.state,n)),this.state=n,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster(t){let{map:e}=t;return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,s]},properties:o}=t;if(o.cluster)return new n({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:s,lng:e}});const r=o.marker;return new n({markers:[r],position:i.getPosition(r)})}}class j{constructor(t,e){this.markers={sum:t.length};const i=e.map((t=>t.count)),n=i.reduce(((t,e)=>t+e),0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...i),max:Math.max(...i)}}}}class B{render(t,e,n){let{count:s,position:o}=t;const r=`<svg fill="${s>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${s}</text>\n</svg>`,a=`Cluster of ${s} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+s;if(i.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(r,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const e={map:n,position:o,zIndex:l,title:a,content:t};return new google.maps.marker.AdvancedMarkerElement(e)}const c={position:o,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(r)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(c)}}class Z{constructor(){!function(t,e){for(let i in e.prototype)t.prototype[i]=e.prototype[i]}(Z,google.maps.OverlayView)}}var q;t.MarkerClustererEvents=void 0,(q=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",q.CLUSTERING_END="clusteringend",q.CLUSTER_CLICK="click";const D=(t,e,i)=>{i.fitBounds(e.bounds)};return t.AbstractAlgorithm=h,t.AbstractViewportAlgorithm=d,t.Cluster=n,t.ClusterStats=j,t.DefaultRenderer=B,t.GridAlgorithm=class extends d{constructor(t){var{maxDistance:i=4e4,gridSize:n=40}=t;super(e(t,["maxDistance","gridSize"])),this.clusters=[],this.state={zoom:-1},this.maxDistance=i,this.gridSize=n}calculate(t){let{markers:e,map:i,mapCanvasProjection:n}=t;const o={zoom:i.getZoom()};let r=!1;return this.state.zoom>=this.maxZoom&&o.zoom>=this.maxZoom||(r=!_(this.state,o)),this.state=o,i.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:r}:{clusters:this.cluster({markers:s(i,n,e,this.viewportPadding),map:i,mapCanvasProjection:n})}}cluster(t){let{markers:e,map:i,mapCanvasProjection:n}=t;return this.clusters=[],e.forEach((t=>{this.addToClosestCluster(t,i,n)})),this.clusters}addToClosestCluster(t,e,s){let r=this.maxDistance,l=null;for(let e=0;e<this.clusters.length;e++){const n=this.clusters[e],s=a(n.bounds.getCenter().toJSON(),i.getPosition(t).toJSON());s<r&&(r=s,l=n)}if(l&&o(l.bounds,s,this.gridSize).contains(i.getPosition(t)))l.push(t);else{const e=new n({markers:[t]});this.clusters.push(e)}}},t.MarkerClusterer=class extends Z{constructor(t){let{map:e,markers:i=[],algorithmOptions:n={},algorithm:s=new A(n),renderer:o=new B,onClusterClick:r=D}=t;super(),this.markers=[...i],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=r,e&&this.setMap(e)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach((t=>{this.addMarker(t,!0)})),e||this.render()}removeMarker(t,e){const n=this.markers.indexOf(t);return-1!==n&&(i.setMap(t,null),this.markers.splice(n,1),e||this.render(),!0)}removeMarkers(t,e){let i=!1;return t.forEach((t=>{i=this.removeMarker(t,!0)||i})),i&&!e&&this.render(),i}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);const{clusters:n,changed:s}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(s||null==s){const t=new Set;for(const e of n)1==e.markers.length&&t.add(e.markers[0]);const e=[];for(const n of this.clusters)null!=n.marker&&(1==n.markers.length?t.has(n.marker)||i.setMap(n.marker,null):e.push(n.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame((()=>e.forEach((t=>i.setMap(t,null)))))}google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach((t=>i.setMap(t,null))),this.clusters.forEach((t=>t.delete())),this.clusters=[]}renderClusters(){const e=new j(this.markers,this.clusters),n=this.getMap();this.clusters.forEach((s=>{1===s.markers.length?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,e,n),s.markers.forEach((t=>i.setMap(t,null))),this.onClusterClick&&s.marker.addListener("click",(e=>{google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTER_CLICK,s),this.onClusterClick(e,s,n)}))),i.setMap(s.marker,n)}))}},t.MarkerUtils=i,t.NoopAlgorithm=class extends h{constructor(t){super(e(t,[]))}calculate(t){let{markers:e,map:i,mapCanvasProjection:n}=t;return{clusters:this.cluster({markers:e,map:i,mapCanvasProjection:n}),changed:!1}}cluster(t){return this.noop(t)}},t.SuperClusterAlgorithm=A,t.SuperClusterViewportAlgorithm=class extends d{constructor(t){var{maxZoom:i,radius:n=60,viewportPadding:s=60}=t,o=e(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:i,viewportPadding:s}),this.superCluster=new M(Object.assign({maxZoom:this.maxZoom,radius:n},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const e={zoom:Math.round(t.map.getZoom()),view:r(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let n=!_(this.state,e);if(!_(t.markers,this.markers)){n=!0,this.markers=[...t.markers];const e=this.markers.map((t=>{const e=i.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(e)}return n&&(this.clusters=this.cluster(t),this.state=e),{clusters:this.clusters,changed:n}}cluster(t){let{map:e,mapCanvasProjection:i}=t;const n={zoom:Math.round(e.getZoom()),view:r(e.getBounds(),i,this.viewportPadding)};return this.superCluster.getClusters(n.view,n.zoom).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,s]},properties:o}=t;if(o.cluster)return new n({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:s,lng:e}});const r=o.marker;return new n({markers:[r],position:i.getPosition(r)})}},t.defaultOnClusterClickHandler=D,t.distanceBetweenPoints=a,t.extendBoundsToPaddedViewport=o,t.extendPixelBounds=c,t.filterMarkersToPaddedViewport=s,t.getPaddedViewport=r,t.noop=p,t.pixelBoundsToLatLngBounds=u,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
/* @preserve
 * Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,(function(t){"use strict";function e(t){for(var e,i,n=1,s=arguments.length;n<s;n++)for(e in i=arguments[n])t[e]=i[e];return t}var i=Object.create||function(t){return n.prototype=t,new n};function n(){}function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var o=0;function r(t){return"_leaflet_id"in t||(t._leaflet_id=++o),t._leaflet_id}function a(t,e,i){var n,s,o=function(){n=!1,s&&(r.apply(i,s),s=!1)},r=function(){n?s=arguments:(t.apply(i,arguments),setTimeout(o,e),n=!0)};return r}function l(t,e,i){var n=e[1],s=n-(e=e[0]);return t===n&&i?t:((t-e)%s+s)%s+e}function c(){return!1}function u(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return h(t).split(/\s+/)}function p(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function _(t,e,i){var n,s=[];for(n in t)s.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+s.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function f(t,e){return t.replace(m,(function(t,i){if(void 0===(i=e[i]))throw new Error("No value provided for variable "+t);return"function"==typeof i?i(e):i}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var x=0;function w(t){var e=+new Date,i=Math.max(0,16-(e-x));return x=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||b("RequestAnimationFrame")||w,k=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||S!==w)return S.call(window,s(t,e));t.call(e)}function T(t){t&&k.call(window,t)}var M={__proto__:null,extend:e,create:i,bind:s,get lastId(){return o},stamp:r,throttle:a,wrapNum:l,falseFn:c,formatNum:u,trim:h,splitWords:d,setOptions:p,getParamString:_,template:f,isArray:g,indexOf:y,emptyImageUrl:v,requestFn:S,cancelFn:k,requestAnimFrame:C,cancelAnimFrame:T};function P(){}P.extend=function(t){function n(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var s,o=n.__super__=this.prototype,r=i(o);for(s in(r.constructor=n).prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(n[s]=this[s]);if(t.statics&&e(n,t.statics),t.includes){var a=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){a=g(a)?a:[a];for(var l=0;l<a.length;l++)a[l],L.Mixin.Events}e.apply(null,[r].concat(t.includes))}return e(r,t),delete r.statics,delete r.includes,r.options&&(r.options=o.options?i(o.options):{},e(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},n},P.include=function(t){var i=this.prototype.options;return e(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},P.mergeOptions=function(t){return e(this.prototype.options,t),this},P.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var z={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var s=0,o=(t=d(t)).length;s<o;s++)this._on(t[s],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=d(t);for(var s=1===arguments.length,o=0,r=t.length;o<r;o++)s?this._off(t[o]):this._off(t[o],e,i)}else delete this._events;return this},_on:function(t,e,i){if("function"!=typeof e);else{this._events=this._events||{};for(var n=this._events[t],s=(t=(n||(this._events[t]=n=[]),{fn:e,ctx:i=i===this?void 0:i}),n),o=0,r=s.length;o<r;o++)if(s[o].fn===e&&s[o].ctx===i)return;s.push(t)}},_off:function(t,e,i){var n,s,o;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(s=0,o=n.length;s<o;s++)n[s].fn=c;delete this._events[t]}else if(i===this&&(i=void 0),"function"!=typeof e);else for(s=0,o=n.length;s<o;s++){var r=n[s];if(r.ctx===i&&r.fn===e)return this._firingCount&&(r.fn=c,this._events[t]=n=n.slice()),void n.splice(s,1)}},fire:function(t,i,n){if(!this.listens(t,n))return this;var s=e({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var r=0,a=o.length;r<a;r++){var l=o[r];l.fn.call(l.ctx||this,s)}this._firingCount--}}return n&&this._propagateEvent(s),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[r(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[r(t)],this},_propagateEvent:function(t){for(var i in this._eventParents)this._eventParents[i].fire(t.type,e({layer:t.target,propagatedFrom:t.target},t),!0)}},E=(z.addEventListener=z.on,z.removeEventListener=z.clearAllEventListeners=z.off,z.addOneTimeEventListener=z.once,z.fireEvent=z.fire,z.hasEventListeners=z.listens,P.extend(z));function O(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function A(t,e,i){return t instanceof O?t:g(t)?new O(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new O(t.x,t.y):new O(t,e,i)}function j(t,e){if(t)for(var i=e?[t,e]:t,n=0,s=i.length;n<s;n++)this.extend(i[n])}function B(t,e){return!t||t instanceof j?t:new j(t,e)}function Z(t,e){if(t)for(var i=e?[t,e]:t,n=0,s=i.length;n<s;n++)this.extend(i[n])}function q(t,e){return t instanceof Z?t:new Z(t,e)}function D(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function N(t,e,i){return t instanceof D?t:g(t)&&"object"!=typeof t[0]?3===t.length?new D(t[0],t[1],t[2]):2===t.length?new D(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new D(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new D(t,e,i)}O.prototype={clone:function(){return new O(this.x,this.y)},add:function(t){return this.clone()._add(A(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(A(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new O(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new O(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=A(t)).x-this.x;t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=A(t)).x===this.x&&t.y===this.y},contains:function(t){return t=A(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},j.prototype={extend:function(t){return t=A(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new O((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new O(this.min.x,this.max.y)},getTopRight:function(){return new O(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t=("number"==typeof t[0]||t instanceof O?A:B)(t))instanceof j?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,s=(t=t.max).x>=e.x&&n.x<=i.x;t=t.y>=e.y&&n.y<=i.y;return s&&t},overlaps:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,s=(t=t.max).x>e.x&&n.x<i.x;t=t.y>e.y&&n.y<i.y;return s&&t},isValid:function(){return!(!this.min||!this.max)}},Z.prototype={extend:function(t){var e,i,n=this._southWest,s=this._northEast;if(t instanceof D)i=e=t;else{if(!(t instanceof Z))return t?this.extend(N(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||s?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),s.lat=Math.max(i.lat,s.lat),s.lng=Math.max(i.lng,s.lng)):(this._southWest=new D(e.lat,e.lng),this._northEast=new D(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t;t=Math.abs(e.lng-i.lng)*t;return new Z(new D(e.lat-n,e.lng-t),new D(i.lat+n,i.lng+t))},getCenter:function(){return new D((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new D(this.getNorth(),this.getWest())},getSouthEast:function(){return new D(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=("number"==typeof t[0]||t instanceof D||"lat"in t?N:q)(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof Z?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=(t=t.getNorthEast()).lat>=e.lat&&n.lat<=i.lat;t=t.lng>=e.lng&&n.lng<=i.lng;return s&&t},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=(t=t.getNorthEast()).lat>e.lat&&n.lat<i.lat;t=t.lng>e.lng&&n.lng<i.lng;return s&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var H={latLngToPoint:function(t,e){return t=this.projection.project(t),e=this.scale(e),this.transformation._transform(t,e)},pointToLatLng:function(t,e){return e=this.scale(e),t=this.transformation.untransform(t,e),this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds;t=this.scale(t);return new j(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t))},infinite:!(D.prototype={equals:function(t,e){return!!t&&(t=N(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return F.distance(this,N(t))},wrap:function(){return F.wrapLatLng(this)},toBounds:function(t){var e=(t=180*t/40075017)/Math.cos(Math.PI/180*this.lat);return q([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new D(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new D(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat;e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new Z(new D(i.lat-n,i.lng-e),new D(t.lat-n,t.lng-e)))}},F=e({},H,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,s=e.lat*i,o=Math.sin((e.lat-t.lat)*i/2);e=Math.sin((e.lng-t.lng)*i/2),t=o*o+Math.cos(n)*Math.cos(s)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),W={R:W=6378137,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE;i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new O(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new D((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new j([-(W*=Math.PI),-W],[W,W])};function G(t,e,i,n){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function R(t,e,i,n){return new G(t,e,i,n)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new O((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var $=e({},F,{code:"EPSG:3857",projection:W,transformation:R($=.5/(Math.PI*W.R),.5,-$,.5)}),V=e({},$,{code:"EPSG:900913"});function Y(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function U(t,e){for(var i,n,s,o,r="",a=0,l=t.length;a<l;a++){for(i=0,n=(s=t[a]).length;i<n;i++)r+=(i?"L":"M")+(o=s[i]).x+" "+o.y;r+=e?Mt.svg?"z":"x":""}return r||"M0 0"}var Q=document.documentElement.style,J="ActiveXObject"in window,X=J&&!document.addEventListener,K="msLaunchUri"in navigator&&!("documentMode"in document),tt=Tt("webkit"),et=Tt("android"),it=Tt("android 2")||Tt("android 3"),nt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),st=(nt=et&&Tt("Google")&&nt<537&&!("AudioNode"in window),!!window.opera),ot=!K&&Tt("chrome"),rt=Tt("gecko")&&!tt&&!st&&!J,at=!ot&&Tt("safari"),lt=Tt("phantom"),ct="OTransition"in Q,ut=0===navigator.platform.indexOf("Win"),ht=J&&"transition"in Q,dt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!it,pt=(Q="MozPerspective"in Q,!window.L_DISABLE_3D&&(ht||dt||Q)&&!ct&&!lt),_t=(Wi="undefined"!=typeof orientation||Tt("mobile"))&&tt,mt=Wi&&dt,ft=!window.PointerEvent&&window.MSPointerEvent,gt=!(!window.PointerEvent&&!ft),yt="ontouchstart"in window||!!window.TouchEvent,vt=!window.L_NO_TOUCH&&(yt||gt),bt=Wi&&st,xt=Wi&&rt,wt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Lt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(t){}return t}(),St=!!document.createElement("canvas").getContext,kt=!(!document.createElementNS||!Y("svg").createSVGRect),Ct=!!kt&&((Ct=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Ct.firstChild&&Ct.firstChild.namespaceURI));function Tt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Mt={ie:J,ielt9:X,edge:K,webkit:tt,android:et,android23:it,androidStock:nt,opera:st,chrome:ot,gecko:rt,safari:at,phantom:lt,opera12:ct,win:ut,ie3d:ht,webkit3d:dt,gecko3d:Q,any3d:pt,mobile:Wi,mobileWebkit:_t,mobileWebkit3d:mt,msPointer:ft,pointer:gt,touch:vt,touchNative:yt,mobileOpera:bt,mobileGecko:xt,retina:wt,passiveEvents:Lt,canvas:St,svg:kt,vml:!kt&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Ct},Pt=Mt.msPointer?"MSPointerDown":"pointerdown",zt=Mt.msPointer?"MSPointerMove":"pointermove",Et=Mt.msPointer?"MSPointerUp":"pointerup",Ot=Mt.msPointer?"MSPointerCancel":"pointercancel",It={touchstart:Pt,touchmove:zt,touchend:Et,touchcancel:Ot},At={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ze(e),Nt(t,e)},touchmove:Nt,touchend:Nt,touchcancel:Nt},jt={},Bt=!1;function Zt(t){jt[t.pointerId]=t}function qt(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function Dt(t){delete jt[t.pointerId]}function Nt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],jt)e.touches.push(jt[i]);e.changedTouches=[e],t(e)}}var Ht=200;var Ft,Wt,Gt,Rt,$t,Vt,Yt=ue(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ut=ue(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Qt="webkitTransition"===Ut||"OTransition"===Ut?Ut+"End":"transitionend";function Jt(t){return"string"==typeof t?document.getElementById(t):t}function Xt(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function Kt(t,e,i){return(t=document.createElement(t)).className=e||"",i&&i.appendChild(t),t}function te(t){var e=t.parentNode;e&&e.removeChild(t)}function ee(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ie(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ne(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function se(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=le(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function oe(t,e){var i;if(void 0!==t.classList)for(var n=d(e),s=0,o=n.length;s<o;s++)t.classList.add(n[s]);else se(t,e)||ae(t,((i=le(t))?i+" ":"")+e)}function re(t,e){void 0!==t.classList?t.classList.remove(e):ae(t,h((" "+le(t)+" ").replace(" "+e+" "," ")))}function ae(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function le(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function ce(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}}function ue(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function he(t,e,i){e=e||new O(0,0),t.style[Yt]=(Mt.ie3d?"translate("+e.x+"px,"+e.y+"px)":"translate3d("+e.x+"px,"+e.y+"px,0)")+(i?" scale("+i+")":"")}function de(t,e){t._leaflet_pos=e,Mt.any3d?he(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function pe(t){return t._leaflet_pos||new O(0,0)}function _e(){be(window,"dragstart",ze)}function me(){we(window,"dragstart",ze)}function fe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ge(),Vt=($t=t).style.outline,t.style.outline="none",be(window,"keydown",ge))}function ge(){$t&&($t.style.outline=Vt,Vt=$t=void 0,we(window,"keydown",ge))}function ye(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function ve(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}function be(t,e,i,n){if(e&&"object"==typeof e)for(var s in e)ke(t,s,e[s],i);else for(var o=0,r=(e=d(e)).length;o<r;o++)ke(t,e[o],i,n);return this}Rt="onselectstart"in document?(Gt=function(){be(window,"selectstart",ze)},function(){we(window,"selectstart",ze)}):(Wt=ue(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),Gt=function(){var t;Wt&&(t=document.documentElement.style,Ft=t[Wt],t[Wt]="none")},function(){Wt&&(document.documentElement.style[Wt]=Ft,Ft=void 0)}),J={__proto__:null,TRANSFORM:Yt,TRANSITION:Ut,TRANSITION_END:Qt,get:Jt,getStyle:Xt,create:Kt,remove:te,empty:ee,toFront:ie,toBack:ne,hasClass:se,addClass:oe,removeClass:re,setClass:ae,getClass:le,setOpacity:ce,testProp:ue,setTransform:he,setPosition:de,getPosition:pe,get disableTextSelection(){return Gt},get enableTextSelection(){return Rt},disableImageDrag:_e,enableImageDrag:me,preventOutline:fe,restoreOutline:ge,getSizedParentNode:ye,getScale:ve};var xe="_leaflet_events";function we(t,e,i,n){if(1===arguments.length)Le(t),delete t[xe];else if(e&&"object"==typeof e)for(var s in e)Ce(t,s,e[s],i);else if(e=d(e),2===arguments.length)Le(t,(function(t){return-1!==y(e,t)}));else for(var o=0,r=e.length;o<r;o++)Ce(t,e[o],i,n);return this}function Le(t,e){for(var i in t[xe]){var n=i.split(/\d/)[0];e&&!e(n)||Ce(t,n,null,null,i)}}var Se={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function ke(t,e,i,n){var s,o,a=e+r(i)+(n?"_"+r(n):"");t[xe]&&t[xe][a]||(o=s=function(e){return i.call(n||t,e||window.event)},!Mt.touchNative&&Mt.pointer&&0===e.indexOf("touch")?s=function(t,e,i){return"touchstart"!==e||Bt||(document.addEventListener(Pt,Zt,!0),document.addEventListener(zt,qt,!0),document.addEventListener(Et,Dt,!0),document.addEventListener(Ot,Dt,!0),Bt=!0),At[e]?(i=At[e].bind(this,i),t.addEventListener(It[e],i,!1),i):L.Util.falseFn}(t,e,s):Mt.touch&&"dblclick"===e?s=function(t,e){t.addEventListener("dblclick",e);var i,n=0;function s(t){var s;1!==t.detail?i=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((s=Date.now())-n<=Ht?2==++i&&e(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):i=1,n=s)}return t.addEventListener("click",s),{dblclick:e,simDblclick:s}}(t,s):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Se[e]||e,s,!!Mt.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Se[e],s=function(e){e=e||window.event,je(t,e)&&o(e)},!1):t.addEventListener(e,o,!1):t.attachEvent("on"+e,s),t[xe]=t[xe]||{},t[xe][a]=s)}function Ce(t,e,i,n,s){var o,a;s=s||e+r(i)+(n?"_"+r(n):""),(i=t[xe]&&t[xe][s])&&(!Mt.touchNative&&Mt.pointer&&0===e.indexOf("touch")?(n=t,a=i,It[o=e]&&n.removeEventListener(It[o],a,!1)):Mt.touch&&"dblclick"===e?(n=i,(a=t).removeEventListener("dblclick",n.dblclick),a.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(Se[e]||e,i,!1):t.detachEvent("on"+e,i),t[xe][s]=null)}function Te(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Me(t){return ke(t,"wheel",Te),this}function Pe(t){return be(t,"mousedown touchstart dblclick contextmenu",Te),t._leaflet_disable_click=!0,this}function ze(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ee(t){return ze(t),Te(t),this}function Oe(t,e){if(!e)return new O(t.clientX,t.clientY);var i=ve(e),n=i.boundingClientRect;return new O((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Ie=Mt.win&&Mt.chrome?2*window.devicePixelRatio:Mt.gecko?window.devicePixelRatio:1;function Ae(t){return Mt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ie:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function je(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}X={__proto__:null,on:be,off:we,stopPropagation:Te,disableScrollPropagation:Me,disableClickPropagation:Pe,preventDefault:ze,stop:Ee,getMousePosition:Oe,getWheelDelta:Ae,isExternalTarget:je,addListener:be,removeListener:we};var Be=E.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=pe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t)),e&&t._round(),de(this._el,t),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Ze=E.extend({options:{crs:$,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=p(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(N(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Ut&&Mt.any3d&&!Mt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),be(this._proxy,Qt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,i,n){return i=void 0===i?this._zoom:this._limitZoom(i),t=this._limitCenter(N(t),i,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=e({animate:n.animate},n.zoom),n.pan=e({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==i?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,i,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,i),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2);t=(t instanceof O?t:this.latLngToContainerPoint(t)).subtract(s).multiplyBy(1-1/n),n=this.containerPointToLatLng(s.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=A(e.paddingTopLeft||e.padding||[0,0]),n=A(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n));return(s="number"==typeof e.maxZoom?Math.min(e.maxZoom,s):s)===1/0?{center:t.getCenter(),zoom:s}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),s),i=this.project(t.getNorthEast(),s),{center:this.unproject(n.add(i).divideBy(2).add(e),s),zoom:s})},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){return e=e||{},(t=A(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Be,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(oe(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend");var i},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!Mt.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),s=this.project(t),o=this.getSize(),r=this._zoom,a=(t=N(t),e=void 0===e?r:e,Math.max(o.x,o.y)),l=a*this.getZoomScale(r,e),c=s.distanceTo(n)||1,u=1.42,h=u*u;function d(t){return t=(l*l-a*a+(t?-1:1)*h*h*c*c)/(2*(t?l:a)*h*c),(t=Math.sqrt(t*t+1)-t)<1e-9?-18:Math.log(t)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function _(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);var f=Date.now(),g=(d(1)-m)/u,y=i.duration?1e3*i.duration:1e3*g*.8;return this._moveStart(!0,i.noMoveStart),function i(){var o=(Date.now()-f)/y,l=(1-Math.pow(1-o,1.5))*g;o<=1?(this._flyToFrame=C(i,this),this._move(this.unproject(n.add(s.subtract(n).multiplyBy(function(t){return a*(_(m)*(p(t=m+u*t)/_(t))-p(m))/h}(l)/c)),r),this.getScaleZoom(a/(o=l,a*(_(m)/_(m+u*o))),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){return t=this._getBoundsCenterZoom(t,e),this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter();t=this._limitCenter(i,this._zoom,q(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=A((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=A(e.paddingBottomRight||e.padding||[0,0]),s=this.project(this.getCenter()),o=(t=this.project(t),(i=B([(o=this.getPixelBounds()).min.add(i),o.max.subtract(n)])).getSize());return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(o),s.x+=n.x<0?-i.x:i.x,s.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(s),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize(),n=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),o=i.divideBy(2).round(),r=n.divideBy(2).round();return(o=o.subtract(r)).x||o.y?(t.animate&&t.pan?this.panBy(o):(t.pan&&this._rawPanBy(o),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=s(this._handleGeolocationResponse,this),n=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,n,t):navigator.geolocation.getCurrentPosition(i,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new D(t.coords.latitude,t.coords.longitude),s=n.toBounds(2*t.coords.accuracy),o=this._locateOptions,r=(o.setView&&(e=this.getBoundsZoom(s),this.setView(n,o.maxZoom?Math.min(e,o.maxZoom):e)),{latlng:n,bounds:s,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e?(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable(),this):this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),te(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)te(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){return e=Kt("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane),t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new Z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=A(i||[0,0]);var n=this.getZoom()||0,s=this.getMinZoom(),o=this.getMaxZoom(),r=t.getNorthWest(),a=(t=t.getSouthEast(),i=this.getSize().subtract(i),t=B(this.project(t,n),this.project(r,n)).getSize(),r=Mt.any3d?this.options.zoomSnap:1,i.x/t.x);i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(s,Math.min(o,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new O(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){return new j(t=this._getTopLeftPoint(t,e),t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e,t=i.zoom(t*i.scale(e));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(N(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(A(t),e)},layerPointToLatLng:function(t){return t=A(t).add(this.getPixelOrigin()),this.unproject(t)},latLngToLayerPoint:function(t){return this.project(N(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(N(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(N(t),N(e))},containerPointToLayerPoint:function(t){return A(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return A(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){return t=this.containerPointToLayerPoint(A(t)),this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(N(t)))},mouseEventToContainerPoint:function(t){return Oe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){if(!(t=this._container=Jt(t)))throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");be(t,"scroll",this._onScroll,this),this._containerId=r(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&Mt.any3d,oe(t,"leaflet-container"+(Mt.touch?" leaflet-touch":"")+(Mt.retina?" leaflet-retina":"")+(Mt.ielt9?" leaflet-oldie":"")+(Mt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),Xt(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),de(this._mapPane,new O(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(oe(t.markerPane,"leaflet-zoom-hide"),oe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){de(this._mapPane,new O(0,0));var i=!this._loaded,n=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var s=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((s||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){de(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?we:be;e((this._targets[r(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Mt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],s="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,a=!1;o;){if((i=this._targets[r(o)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(s&&!je(o,t))break;if(n.push(i),s)break}if(o===this._container)break;o=o.parentNode}return n.length||a||s||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&fe(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,n){"click"===t.type&&((l=e({},t)).type="preclick",this._fireDOMEvent(l,l.type,n));var s=this._findEventTargets(t,i);if(n){for(var o=[],r=0;r<n.length;r++)n[r].listens(i,!0)&&o.push(n[r]);s=o.concat(s)}if(s.length){"contextmenu"===i&&ze(t);var a,l=s[0],c={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(a=l.getLatLng&&(!l._radius||l._radius<=10),c.containerPoint=a?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=a?l.getLatLng():this.layerPointToLatLng(c.layerPoint)),r=0;r<s.length;r++)if(s[r].fire(i,c,!0),c.originalEvent._stopped||!1===s[r].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,i))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return pe(this._mapPane)||new O(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){return i=this._getNewPixelOrigin(i,e),this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){return i=this._getNewPixelOrigin(i,e),B([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2);s=new j(n.subtract(s),n.add(s));return(s=this._getBoundsOffset(s,i,e)).round().equals([0,0])?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=new j((i=this.getPixelBounds()).min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,i){return i=(e=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i))).min.subtract(t.min),e=e.max.subtract(t.max),new O(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Mt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){re(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){return t=this._getCenterOffset(t)._trunc(),!(!0!==(e&&e.animate)&&!this.getSize().contains(t)||(this.panBy(t,e),0))},_createAnimProxy:function(){var t=this._proxy=Kt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=Yt,i=this._proxy.style[e];he(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){te(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();he(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e);n=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,oe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&re(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function qe(t){return new Ne(t)}var De,Ne=P.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition();t=t._controlCorners[i];return oe(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(te(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),He=(Ze.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=Kt("div",e+"control-container",this._container);function n(n,s){t[n+s]=Kt("div",e+n+" "+e+s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)te(this._controlCorners[t]);te(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),Ne.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in p(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Ne.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){return t.off("add remove",this._onLayerChange,this),(t=this._getLayer(r(t)))&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){oe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(oe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):re(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return re(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=Kt("div",t),i=this.options.collapsed,n=(e.setAttribute("aria-haspopup",!0),Pe(e),Me(e),this._section=Kt("section",t+"-list")),s=(i&&(this._map.on("click",this.collapse,this),be(e,{mouseenter:function(){be(n,"click",ze),this.expand(),setTimeout((function(){we(n,"click",ze)}))},mouseleave:this.collapse},this)),this._layersLink=Kt("a",t+"-toggle",e));s.href="#",s.title="Layers",s.setAttribute("role","button"),be(s,"click",ze),be(s,"focus",this.expand,this),i||this.expand(),this._baseLayersList=Kt("div",t+"-base",n),this._separator=Kt("div",t+"-separator",n),this._overlaysList=Kt("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&r(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ee(this._baseLayersList),ee(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,s=0;s<this._layers.length;s++)i=this._layers[s],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target));(t=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null)&&this._map.fire(t,e)},_createRadioElement:function(t,e){return t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",(e=document.createElement("div")).innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),s=((n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+r(this),n),this._layerControlInputs.push(e),e.layerId=r(t.layer),be(e,"click",this._onInputClick,this),document.createElement("span"))).innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],s=[];this._handlingClick=!0;for(var o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||s.push(e);for(o=0;o<s.length;o++)this._map.hasLayer(s[o])&&this._map.removeLayer(s[o]);for(o=0;o<n.length;o++)this._map.hasLayer(n[o])||this._map.addLayer(n[o]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}})),Fe=Ne.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=Kt("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,s){return(i=Kt("a",i,n)).innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Pe(i),be(i,"click",Ee),be(i,"click",s,this),be(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";re(this._zoomInButton,e),re(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(oe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(oe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),We=(Ze.mergeOptions({zoomControl:!0}),Ze.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Fe,this.addControl(this.zoomControl))})),Ne.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=Kt("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=Kt("div",e,i)),t.imperial&&(this._iScale=Kt("div",e,i))},_update:function(){var t=(e=this._map).getSize().y/2,e=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i;5280<(t=3.2808399*t)?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+" mi",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+" ft",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1);return e*(10<=(t=t/e)?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ge=Ne.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Mt.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=Kt("div","leaflet-control-attribution"),Pe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}}),Re=(K=(Ze.mergeOptions({attributionControl:!0}),Ze.addInitHook((function(){this.options.attributionControl&&(new Ge).addTo(this)})),Ne.Layers=He,Ne.Zoom=Fe,Ne.Scale=We,Ne.Attribution=Ge,qe.layers=function(t,e,i){return new He(t,e,i)},qe.zoom=function(t){return new Fe(t)},qe.scale=function(t){return new We(t)},qe.attribution=function(t){return new Ge(t)},P.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),tt=(K.addTo=function(t,e){return t.addHandler(e,this),this},{Events:z}),Mt.touch?"touchstart mousedown":"mousedown"),$e=E.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(be(this._dragStartTarget,Re,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&($e._dragging===this&&this.finishDrag(!0),we(this._dragStartTarget,Re,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,se(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?$e._dragging===this&&this.finishDrag():$e._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(($e._dragging=this)._preventOutline&&fe(this._element),_e(),Gt(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=ye(this._element),this._startPoint=new O(i.clientX,i.clientY),this._startPos=pe(this._element),this._parentScale=ve(e),i="mousedown"===t.type,be(document,i?"mousemove":"touchmove",this._onMove,this),be(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new O((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,ze(t),this._moved||(this.fire("dragstart"),this._moved=!0,oe(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),oe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),de(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){re(document.body,"leaflet-dragging"),this._lastTarget&&(re(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),we(document,"mousemove touchmove",this._onMove,this),we(document,"mouseup touchend touchcancel",this._onUp,this),me(),Rt(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,$e._dragging=!1}});function Ve(t,e){return e&&t.length?function(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,function t(e,i,n,s,o){var r,a,l,c=0;for(a=s+1;a<=o-1;a++)c<(l=Xe(e[a],e[s],e[o],!0))&&(r=a,c=l);n<c&&(i[r]=1,t(e,i,n,s,r),t(e,i,n,r,o))}(t,n,e,0,i-1);var s,o=[];for(s=0;s<i;s++)n[s]&&o.push(t[s]);return o}(t=function(t,e){for(var i=[t[0]],n=1,s=0,o=t.length;n<o;n++)(function(t,e){var i=e.x-t.x;return i*i+(e=e.y-t.y)*e})(t[n],t[s])>e&&(i.push(t[n]),s=n);return s<o-1&&i.push(t[o-1]),i}(t,e*=e),e):t.slice()}function Ye(t,e,i){return Math.sqrt(Xe(t,e,i,!0))}function Ue(t,e,i,n,s){var o,r,a,l=n?De:Je(t,i),c=Je(e,i);for(De=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=Je(r=Qe(t,e,o=l||c,i,s),i),o===l?(t=r,l=a):(e=r,c=a)}}function Qe(t,e,i,n,s){var o,r,a=e.x-t.x,l=(e=e.y-t.y,n.min);n=n.max;return 8&i?(o=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(o=t.x+a*(l.y-t.y)/e,r=l.y):2&i?(o=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(o=l.x,r=t.y+e*(l.x-t.x)/a),new O(o,r,s)}function Je(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Xe(t,e,i,n){var s=e.x,o=(e=e.y,i.x-s),r=i.y-e,a=o*o+r*r;return 0<a&&(1<(a=((t.x-s)*o+(t.y-e)*r)/a)?(s=i.x,e=i.y):0<a&&(s+=o*a,e+=r*a)),o=t.x-s,r=t.y-e,n?o*o+r*r:new O(s,e)}function Ke(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ti(t){return Ke(t)}function ei(t,e,i){for(var n,s,o,r,a,l,c,u=[1,4,2,8],h=0,d=t.length;h<d;h++)t[h]._code=Je(t[h],e);for(o=0;o<4;o++){for(l=u[o],n=[],h=0,s=(d=t.length)-1;h<d;s=h++)r=t[h],a=t[s],r._code&l?a._code&l||((c=Qe(a,r,l,e,i))._code=Je(c,e),n.push(c)):(a._code&l&&((c=Qe(a,r,l,e,i))._code=Je(c,e),n.push(c)),n.push(r));t=n}return t}et={__proto__:null,simplify:Ve,pointToSegmentDistance:Ye,closestPointOnSegment:function(t,e,i){return Xe(t,e,i)},clipSegment:Ue,_getEdgeIntersection:Qe,_getBitCode:Je,_sqClosestPointOnSegment:Xe,isFlat:Ke,_flat:ti};it={__proto__:null,clipPolygon:ei},nt={project:function(t){return new O(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new j([-180,-90],[180,90])},st={R:6378137,R_MINOR:6356752.314245179,bounds:new j([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,s=this.R_MINOR/i,o=(s=Math.sqrt(1-s*s))*Math.sin(n);o=Math.tan(Math.PI/4-n/2)/Math.pow((1-o)/(1+o),s/2),n=-i*Math.log(Math.max(o,1e-10));return new O(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,s=this.R_MINOR/n,o=Math.sqrt(1-s*s),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,c=.1;l<15&&1e-7<Math.abs(c);l++)e=o*Math.sin(a),e=Math.pow((1-e)/(1+e),o/2),a+=c=Math.PI/2-2*Math.atan(r*e)-a;return new D(a*i,t.x*i/n)}},ot={__proto__:null,LonLat:nt,Mercator:st,SphericalMercator:W},at=e({},F,{code:"EPSG:3395",projection:st,transformation:R(rt=.5/(Math.PI*st.R),.5,-rt,.5)});var ii=e({},F,{code:"EPSG:4326",projection:nt,transformation:R(1/180,1,-1/180,.5)}),ni=(lt=e({},H,{projection:nt,transformation:R(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng;e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),ct=(H.Earth=F,H.EPSG3395=at,H.EPSG3857=$,H.EPSG900913=V,H.EPSG4326=ii,H.Simple=lt,E.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",(function(){i.off(e,this)}),this)),this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this}))}})),Ze.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[r(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=r(t),this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t].options;e=void 0===s.minZoom?e:Math.min(e,s.minZoom),i=void 0===s.maxZoom?i:Math.max(i,s.maxZoom)}this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),ct.extend({initialize:function(t,e){var i,n;if(p(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){return t=t in this._layers?t:this.getLayerId(t),this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:r})),si=ni.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ni.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ni.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,e=new Z;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),oi=P.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){p(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}return i=this._createImg(i,e&&"IMG"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i},_setIconStyles:function(t,e){var i=this.options,n=A(n="number"==typeof(n=i[e+"Size"])?[n,n]:n),s=A("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Mt.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),ri=oi.extend({options:{iconUrl:"/gfx/standards/marker-icon.png",iconRetinaUrl:"/gfx/standards/marker-icon-2x.png",shadowUrl:"/gfx/standards/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof ri.imagePath&&(ri.imagePath=this._detectIconPath()),(this.options.imagePath||ri.imagePath)+oi.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Kt("div","leaflet-default-icon-path",document.body),e=Xt(t,"background-image")||Xt(t,"backgroundImage");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$="leaflet.css"]'))?t.href.substring(0,t.href.length-11-1):""}}),ai=K.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new $e(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),oe(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&re(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,s=this._marker.options.autoPanPadding,o=pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin();(a=B(r.min._subtract(a).add(s),r.max._subtract(a).subtract(s))).contains(o)||(s=A((Math.max(a.max.x,o.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,o.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,o.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,o.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(s,{animate:!1}),this._draggable._newPos._add(s),this._draggable._startPos._add(s),de(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=pe(e._icon),s=e._map.layerPointToLatLng(n);i&&de(i,n),e._latlng=s,t.latlng=s,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),li=ct.extend({options:{icon:new ri,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){p(this,e),this._latlng=N(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=N(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t,e=this.options,i="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=!1,s=!1;(t=((t=e.icon.createIcon(this._icon))!==this._icon&&(this._icon&&this._removeIcon(),n=!0,e.title&&(t.title=e.title),"IMG"===t.tagName&&(t.alt=e.alt||"")),oe(t,i),e.keyboard&&(t.tabIndex="0",t.setAttribute("role","button")),this._icon=t,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&be(t,"focus",this._panOnFocus,this),e.icon.createShadow(this._shadow)))!==this._shadow&&(this._removeShadow(),s=!0),t&&(oe(t,i),t.alt=""),this._shadow=t,e.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),t&&s&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&we(this._icon,"focus",this._panOnFocus,this),te(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&te(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&de(this._icon,t),this._shadow&&de(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round(),this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(oe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ai&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ai(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&ce(this._icon,t),this._shadow&&ce(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?A(e.iconSize):A(0,0),e=e.iconAnchor?A(e.iconAnchor):A(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),ci=ct.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return p(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ui=ci.extend({options:{fill:!0,radius:10},initialize:function(t,e){p(this,e),this._latlng=N(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=N(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return ci.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance();t=[t+i,e+i];this._pxBounds=new j(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),hi=ui.extend({initialize:function(t,i,n){if(p(this,i="number"==typeof i?e({},n,{radius:i}):i),this._latlng=N(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new Z(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:ci.prototype.setStyle,_project:function(){var t,e,i,n,s,o=this._latlng.lng,r=this._latlng.lat,a=this._map,l=a.options.crs;l.distance===F.distance?(n=Math.PI/180,s=this._mRadius/F.R/n,t=a.project([r+s,o]),e=a.project([r-s,o]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(s*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=s/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,o-n]).x,this._radiusY=e.y-t.y):(s=l.unproject(l.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(s).x),this._updateBounds()}}),di=ci.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){p(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=Xe,s=0,o=this._parts.length;s<o;s++)for(var r=this._parts[s],a=1,l=r.length;a<l;a++){var c,u,h=n(t,c=r[a-1],u=r[a],!0);h<e&&(e=h,i=n(t,c,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,s,o,r=this._rings[0],a=r.length;if(!a)return null;for(e=t=0;t<a-1;t++)e+=r[t].distanceTo(r[t+1])/2;if(0===e)return this._map.layerPointToLatLng(r[0]);for(i=t=0;t<a-1;t++)if(n=r[t],s=r[t+1],e<(i+=o=n.distanceTo(s)))return this._map.layerPointToLatLng([s.x-(o=(i-e)/o)*(s.x-n.x),s.y-o*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=N(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new Z,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ke(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ke(t),n=0,s=t.length;n<s;n++)i?(e[n]=N(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new j;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=new O(t=this._clickTolerance(),t);this._rawPxBounds&&(this._pxBounds=new j([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,s,o=t[0]instanceof D,r=t.length;if(o){for(s=[],n=0;n<r;n++)s[n]=this._map.latLngToLayerPoint(t[n]),i.extend(s[n]);e.push(s)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,s,o=this._parts,r=0,a=0,l=this._rings.length;r<l;r++)for(e=0,i=(s=this._rings[r]).length;e<i-1;e++)(n=Ue(s[e],s[e+1],t,e,!0))&&(o[a]=o[a]||[],o[a].push(n[0]),n[1]===s[e+1]&&e!==i-2||(o[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Ve(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,s,o,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,o=this._parts.length;i<o;i++)for(n=0,s=(r=(a=this._parts[i]).length)-1;n<r;s=n++)if((e||0!==n)&&Ye(t,a[s],a[n])<=l)return!0;return!1}});di._flat=ti;var pi=di.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,s,o,r,a,l,c=this._rings[0],u=c.length;if(!u)return null;for(t=o=r=a=0,e=u-1;t<u;e=t++)i=c[t],n=c[e],s=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*s,a+=(i.y+n.y)*s,o+=3*s;return l=0===o?c[0]:[r/o,a/o],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=(t=di.prototype._convertLatLngs.call(this,t)).length;return 2<=e&&t[0]instanceof D&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){di.prototype._setLatLngs.call(this,t),Ke(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(Ke(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=new O(e=this.options.weight,e);t=new j(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,s=this._rings.length;n<s;n++)(i=ei(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,s,o,r,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(s=0,a=this._parts.length;s<a;s++)for(o=0,r=(l=(e=this._parts[s]).length)-1;o<l;r=o++)i=e[o],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||di.prototype._containsPoint.call(this,t,!0)}}),_i=si.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=g(t)?t:t.features;if(s){for(e=0,i=s.length;e<i;e++)((n=s[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var o=this.options;if(o.filter&&!o.filter(t))return this;var r=mi(t,o);return r?(r.feature=wi(t),r.defaultOptions=r.options,this.resetStyle(r),o.onEachFeature&&o.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=e({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function mi(t,e){var i,n,s,o,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],c=e&&e.pointToLayer,u=e&&e.coordsToLatLng||gi;if(!a&&!r)return null;switch(r.type){case"Point":return fi(c,t,i=u(a),e);case"MultiPoint":for(s=0,o=a.length;s<o;s++)i=u(a[s]),l.push(fi(c,t,i,e));return new si(l);case"LineString":case"MultiLineString":return n=yi(a,"LineString"===r.type?0:1,u),new di(n,e);case"Polygon":case"MultiPolygon":return n=yi(a,"Polygon"===r.type?1:2,u),new pi(n,e);case"GeometryCollection":for(s=0,o=r.geometries.length;s<o;s++){var h=mi({geometry:r.geometries[s],type:"Feature",properties:t.properties},e);h&&l.push(h)}return new si(l);default:throw new Error("Invalid GeoJSON object.")}}function fi(t,e,i,n){return t?t(e,i):new li(i,n&&n.markersInheritOptions&&n)}function gi(t){return new D(t[1],t[0],t[2])}function yi(t,e,i){for(var n,s=[],o=0,r=t.length;o<r;o++)n=e?yi(t[o],e-1,i):(i||gi)(t[o]),s.push(n);return s}function vi(t,e){return void 0!==(t=N(t)).alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function bi(t,e,i,n){for(var s=[],o=0,r=t.length;o<r;o++)s.push(e?bi(t[o],e-1,i,n):vi(t[o],n));return!e&&i&&s.push(s[0]),s}function xi(t,i){return t.feature?e({},t.feature,{geometry:i}):wi(i)}function wi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Li(t,e){return new _i(t,e)}ut={toGeoJSON:function(t){return xi(this,{type:"Point",coordinates:vi(this.getLatLng(),t)})}},li.include(ut),hi.include(ut),ui.include(ut),di.include({toGeoJSON:function(t){var e=!Ke(this._latlngs);return xi(this,{type:(e?"Multi":"")+"LineString",coordinates:bi(this._latlngs,e?1:0,!1,t)})}}),pi.include({toGeoJSON:function(t){var e=!Ke(this._latlngs),i=e&&!Ke(this._latlngs[0]);t=bi(this._latlngs,i?2:e?1:0,!0,t);return xi(this,{type:(i?"Multi":"")+"Polygon",coordinates:t=e?t:[t]})}}),ni.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),xi(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){e.toGeoJSON&&(e=e.toGeoJSON(t),i?n.push(e.geometry):"FeatureCollection"===(e=wi(e)).type?n.push.apply(n,e.features):n.push(e))})),i?xi(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});ht=Li;var Si=ct.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(oe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){te(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ie(this._image),this},bringToBack:function(){return this._map&&ne(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:Kt("img");oe(e,"leaflet-image-layer"),this._zoomAnimated&&oe(e,"leaflet-zoom-animated"),this.options.className&&oe(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom);t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;he(this._image,t,e)},_reset:function(){var t=this._image,e=new j(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();de(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ce(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Si.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:Kt("video");if(oe(e,"leaflet-image-layer"),this._zoomAnimated&&oe(e,"leaflet-zoom-animated"),this.options.className&&oe(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var r=0;r<this._url.length;r++){var a=Kt("source");a.src=this._url[r],e.appendChild(a)}}}}),Ci=Si.extend({_initImage:function(){var t=this._image=this._url;oe(t,"leaflet-image-layer"),this._zoomAnimated&&oe(t,"leaflet-zoom-animated"),this.options.className&&oe(t,this.options.className),t.onselectstart=c,t.onmousemove=c}}),Ti=ct.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0},initialize:function(t,e){p(this,t),this._source=e},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&ce(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&ce(this._container,1),this.bringToFront(),this.options.interactive&&(oe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(ce(this._container,0),this._removeTimeout=setTimeout(s(te,void 0,this._container),200)):te(this._container),this.options.interactive&&(re(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=N(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ie(this._container),this},bringToBack:function(){return this._map&&ne(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof si){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error("Unable to get source layer LatLng.");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=A(this.options.offset),i=this._getAnchor(),this._zoomAnimated?de(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+"px",this._container.style.left=i+"px")},_getAnchor:function(){return[0,0]}}),Mi=(Ze.include({_initOverlay:function(t,e,i,n){var s=e;return s instanceof t||(s=new t(n).setContent(e)),i&&s.setLatLng(i),s}}),ct.include({_initOverlay:function(t,e,i,n){var s=i;return s instanceof t?(p(s,n),s._source=this):(s=e&&!n?e:new t(n,this)).setContent(i),s}}),Ti.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ti.prototype.openOn.call(this,t)},onAdd:function(t){Ti.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ci||this._source.on("preclick",Te))},onRemove:function(t){Ti.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ci||this._source.off("preclick",Te))},getEvents:function(){var t=Ti.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=Kt("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=Kt("div",t+"-content-wrapper",e);this._contentNode=Kt("div",t+"-content",i),Pe(e),Me(this._contentNode),be(e,"contextmenu",Te),this._tipContainer=Kt("div",t+"-tip-container",e),this._tip=Kt("div",t+"-tip",this._tipContainer),this.options.closeButton&&((i=this._closeButton=Kt("a",t+"-close-button",e)).setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">&#215;</span>',be(i,"click",this.close,this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width="",e.whiteSpace="nowrap",t.offsetWidth),n=(i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="",t.offsetHeight),this.options.maxHeight),s="leaflet-popup-scrolled";n&&n<i?(e.height=n+"px",oe(t,s)):re(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);var e=this._getAnchor();de(this._container,t.add(e))},_adjustPan:function(t){var e,i,n,s,o,r,a,l;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),e=this._map,i=parseInt(Xt(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+i,l=this._containerWidth,(n=new O(this._containerLeft,-i-this._containerBottom))._add(pe(this._container)),n=e.layerPointToContainerPoint(n),o=A(this.options.autoPanPadding),s=A(this.options.autoPanPaddingTopLeft||o),o=A(this.options.autoPanPaddingBottomRight||o),r=e.getSize(),a=0,n.x+l+o.x>r.x&&(a=n.x+l-r.x+o.x),n.x-a-s.x<(l=0)&&(a=n.x-s.x),n.y+i+o.y>r.y&&(l=n.y+i-r.y+o.y),n.y-l-s.y<0&&(l=n.y-s.y),(a||l)&&e.fire("autopanstart").panBy([a,l],{animate:t&&"moveend"===t.type}))},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Pi=(Ze.mergeOptions({closePopupOnClick:!0}),Ze.include({openPopup:function(t,e,i){return this._initOverlay(Mi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),ct.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Mi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Ee(t),e=t.layer||t.target,this._popup._source!==e||e instanceof ci?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ti.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ti.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ti.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ti.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Kt("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,s=i.latLngToContainerPoint(i.getCenter()),o=(i=i.layerPointToContainerPoint(t),this.options.direction),r=n.offsetWidth,a=n.offsetHeight,l=A(this.options.offset),c=this._getAnchor();i="top"===o?(e=r/2,a):"bottom"===o?(e=r/2,0):(e="center"===o?r/2:"right"===o?0:"left"===o?r:i.x<s.x?(o="right",0):(o="left",r+2*(l.x+c.x)),a/2);t=t.subtract(A(e,i,!0)).add(l).add(c),re(n,"leaflet-tooltip-right"),re(n,"leaflet-tooltip-left"),re(n,"leaflet-tooltip-top"),re(n,"leaflet-tooltip-bottom"),oe(n,"leaflet-tooltip-"+o),de(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&ce(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),this._setPosition(t)},_getAnchor:function(){return A(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),zi=(Ze.include({openTooltip:function(t,e,i){return this._initOverlay(Pi,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),ct.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Pi,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&this._tooltip._prepareOpen(t)&&this._tooltip.openOn(this._map),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){!this._tooltip||!this._map||this._map.dragging&&this._map.dragging.moving()||(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),oi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){t=t&&"DIV"===t.tagName?t:document.createElement("div");var e=this.options;return e.html instanceof Element?(ee(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:"",e.bgPos&&(e=A(e.bgPos),t.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));oi.Default=ri;var Ei=ct.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Mt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){p(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),te(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ie(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ne(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof O?t:new O(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),s=0,o=i.length;s<o;s++)e=i[s].style.zIndex,i[s]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Mt.ielt9){ce(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var s,o=this._tiles[t];o.current&&o.loaded&&(s=Math.min(1,(e-o.loaded)/200),ce(o.el,s),s<1?i=!0:(o.active?n=!0:this._onOpaqueTile(o),o.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(T(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=Kt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(te(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],s=this._map;return n||((n=this._levels[t]={}).el=Kt("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=s.project(s.unproject(s.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,s.getCenter(),s.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)te(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){i-=1;var s=((s=new O(+(t=Math.floor(t/2)),+(e=Math.floor(e/2)))).z=i,this._tileCoordsToKey(s));return(s=this._tiles[s])&&s.active?s.retain=!0:(s&&s.loaded&&(s.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var s=2*t;s<2*t+2;s++)for(var o=2*e;o<2*e+2;o++){var r=((r=new O(s,o)).z=i+1,this._tileCoordsToKey(r));(r=this._tiles[r])&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(s,o,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo),this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var s=Math.round(e),o=(s=void 0!==this.options.maxZoom&&s>this.options.maxZoom||void 0!==this.options.minZoom&&s<this.options.minZoom?void 0:this._clampZoom(s),this.options.updateWhenZooming&&s!==this._tileZoom);n&&!o||(this._tileZoom=s,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==s&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom);e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();Mt.any3d?he(t.el,e,n):de(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,s=this._map.getPixelWorldBounds(this._tileZoom);s&&(this._globalTileRange=this._pxBoundsToTileRange(s)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=(i=this._map)._animatingZoom?Math.max(i._animateToZoom,i.getZoom()):i.getZoom(),i=(e=i.getZoomScale(e,this._tileZoom),t=i.project(t,this._tileZoom).floor(),i.getSize().divideBy(2*e));return new j(t.subtract(i),t.add(i))},_update:function(t){if(n=this._map){var e=this._clampZoom(n.getZoom());if(void 0===t&&(t=n.getCenter()),void 0!==this._tileZoom){var i,n=this._getTiledPixelBounds(t),s=this._pxBoundsToTileRange(n),o=s.getCenter(),r=[],a=(n=this.options.keepBuffer,new j(s.getBottomLeft().subtract([n,-n]),s.getTopRight().add([n,-n])));if(!(isFinite(s.min.x)&&isFinite(s.min.y)&&isFinite(s.max.x)&&isFinite(s.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(i in this._tiles){var l=this._tiles[i].coords;l.z===this._tileZoom&&a.contains(new O(l.x,l.y))||(this._tiles[i].current=!1)}if(1<Math.abs(e-this._tileZoom))this._setView(t,e);else{for(var c=s.min.y;c<=s.max.y;c++)for(var u=s.min.x;u<=s.max.x;u++){var h,d=new O(u,c);d.z=this._tileZoom,this._isValidTile(d)&&((h=this._tiles[this._tileCoordsToKey(d)])?h.current=!0:r.push(d))}if(r.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var p=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],p);this._level.el.appendChild(p)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),q(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i);i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){return t=new Z((t=this._tileCoordsToNwSe(t))[0],t[1]),this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=new O(+(t=t.split(":"))[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(te(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){oe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,Mt.ielt9&&this.options.opacity<1&&ce(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&C(s(this._tileReady,this,t,null,o)),de(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(ce(i.el,0),T(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(oe(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Mt.ielt9||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new O(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new j(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),Oi=Ei.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Mt.retina&&0<e.maxZoom&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return be(i,"load",s(this._tileOnLoad,this,e,i)),be(i,"error",s(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var i={r:Mt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(i.y=t),i["-y"]=t),f(this._url,e(i,this.options))},_tileOnLoad:function(t,e){Mt.ielt9?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){return t=Math.abs(t.x+t.y)%this.options.subdomains.length,this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=c,i.onerror=c,i.complete||(i.src=v,e=this._tiles[t].coords,te(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",v),Ei.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return Ei.prototype._tileReady.call(this,t,e,i)}});function Ii(t,e){return new Oi(t,e)}var Ai=Oi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,i){this._url=t;var n,s=e({},this.defaultWmsParams);for(n in i)n in this.options||(s[n]=i[n]);t=(i=p(this,i)).detectRetina&&Mt.retina?2:1;var o=this.getTileSize();s.width=o.x*t,s.height=o.y*t,this.wmsParams=s},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,Oi.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=(e=(i=B((i=this._crs).project(e[0]),i.project(e[1]))).min,i.max);e=(1.3<=this._wmsVersion&&this._crs===ii?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(",");return(i=Oi.prototype.getTileUrl.call(this,t))+_(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(t,i){return e(this.wmsParams,t),i||this.redraw(),this}});Oi.WMS=Ai,Ii.wms=function(t,e){return new Ai(t,e)};var ji=ct.extend({options:{padding:.1},initialize:function(t){p(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&oe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e);n=n.multiplyBy(-i).add(s).subtract(this._map._getNewPixelOrigin(t,e));Mt.any3d?he(this._container,n,i):de(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new j(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Bi=ji.extend({options:{tolerance:0},getEvents:function(){var t=ji.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ji.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");be(t,"mousemove",this._onMouseMove,this),be(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),be(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,te(this._container),we(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(ji.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=Mt.retina?2:1,de(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Mt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){ji.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),t=(this._layers[r(t)]=t)._order={layer:t,prev:this._drawLast,next:null},this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=(i=t._order).next,i=i.prev;e?e.prev=i:this._drawLast=i,i?i.next=e:this._drawFirst=e,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],s=0;s<i.length;s++){if(e=Number(i[s]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new j,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,s,o,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,s=r[i].length;n<s;n++)o=r[i][n],l[n?"lineTo":"moveTo"](o.x,o.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){var e,i,n,s;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(s=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,s)),i.beginPath(),i.arc(e.x,e.y/s,n,0,2*Math.PI,!1),1!=s&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),s=this._drawFirst;s;s=s.next)(e=s.layer).options.interactive&&e._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(re(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(oe(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(s((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Zi(t){return Mt.canvas?new Bi(t):null}var qi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Di=(dt={_initContainer:function(){this._container=Kt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ji.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=qi("shape");oe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=qi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;te(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,s=t._container;s.stroked=!!n.stroke,s.filled=!!n.fill,n.stroke?(e=e||(t._stroke=qi("stroke")),s.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(s.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=qi("fill")),s.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(s.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ie(t._container)},_bringToBack:function(t){ne(t._container)}},Mt.vml?qi:Y),Ni=ji.extend({_initContainer:function(){this._container=Di("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Di("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){te(this._container),we(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(ji.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),de(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=Di("path");t.options.className&&oe(e,t.options.className),t.options.interactive&&oe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){te(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path;t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,U(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ";e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ie(t._path)},_bringToBack:function(t){ne(t._path)}});function Hi(t){return Mt.svg||Mt.vml?new Ni(t):null}Mt.vml&&Ni.include(dt),Ze.include({getRenderer:function(t){return t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Zi(t)||Hi(t)}});var Fi=pi.extend({initialize:function(t,e){pi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Ni.create=Di,Ni.pointsToPath=U,_i.geometryToLayer=mi,_i.coordsToLatLng=gi,_i.coordsToLatLngs=yi,_i.latLngToCoords=vi,_i.latLngsToCoords=bi,_i.getFeature=xi,_i.asFeature=wi,Ze.mergeOptions({boxZoom:!0});Q=K.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){be(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){we(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){te(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Gt(),_e(),this._startPoint=this._map.mouseEventToContainerPoint(t),be(document,{contextmenu:Ee,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Kt("div","leaflet-zoom-box",this._container),oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=(t=new j(this._point,this._startPoint)).getSize();de(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(te(this._box),re(this._container,"leaflet-crosshair")),Rt(),me(),we(document,{contextmenu:Ee,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0),t=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ze.addInitHook("addHandler","boxZoom",Q),Ze.mergeOptions({doubleClickZoom:!0}),pt=K.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta;i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}});var Wi=(Ze.addInitHook("addHandler","doubleClickZoom",pt),Ze.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),K.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new $e(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),oe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){re(this._map._container,"leaflet-grab"),re(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=q(this._map.options.maxBounds),this._offsetLimit=B(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=((s=this._draggable._newPos.x)-e+i)%t+e-i,s=(s+e+i)%t-e-i;t=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,s,o=this._map,r=o.options,a=!r.inertia||t.noInertia||this._times.length<2;o.fire("dragend",t),a?o.fire("moveend"):(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(s=t.multiplyBy(-n/2).round()).x||s.y?(s=o._limitOffset(s,o.options.maxBounds),C((function(){o.panBy(s,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})}))):o.fire("moveend"))}})),Gi=(_t=(Ze.addInitHook("addHandler","dragging",Wi),Ze.mergeOptions({keyboard:!0,keyboardPanDelta:80}),K.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),be(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),we(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,s=i.left.length;n<s;n++)e[i.left[n]]=[-1*t,0];for(n=0,s=i.right.length;n<s;n++)e[i.right[n]]=[t,0];for(n=0,s=i.down.length;n<s;n++)e[i.down[n]]=[0,t];for(n=0,s=i.up.length;n<s;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,s=i.zoomIn.length;n<s;n++)e[i.zoomIn[n]]=t;for(n=0,s=i.zoomOut.length;n<s;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){be(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){we(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=A(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ee(t)}}})),mt=(Ze.addInitHook("addHandler","keyboard",_t),Ze.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),K.extend({addHooks:function(){be(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){we(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Ae(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),e=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),e),Ee(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel));n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),ft=(Ze.addInitHook("addHandler","scrollWheelZoom",mt),Ze.mergeOptions({tapHold:Mt.touchNative&&Mt.safari&&Mt.mobile,tapTolerance:15}),K.extend({addHooks:function(){be(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){we(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new O(e.clientX,e.clientY),this._holdTimeout=setTimeout(s((function(){this._cancel(),this._isTapValid()&&(be(document,"touchend",ze),be(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),600),be(document,"touchend touchcancel contextmenu",this._cancel,this),be(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){we(document,"touchend",ze),we(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),we(document,"touchend touchcancel contextmenu",this._cancel,this),we(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0],this._newPos=new O(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){(t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY}))._simulated=!0,e.target.dispatchEvent(t)}})),gt=(Ze.addInitHook("addHandler","tapHold",ft),Ze.mergeOptions({touchZoom:Mt.touch,bounceAtZoomLimits:!0}),K.extend({addHooks:function(){oe(this._map._container,"leaflet-touch-zoom"),be(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){re(this._map._container,"leaflet-touch-zoom"),we(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),be(document,"touchmove",this._onTouchMove,this),be(document,"touchend touchcancel",this._onTouchEnd,this),ze(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{if(i=i._add(n)._divideBy(2)._subtract(this._centerPoint),1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest),n=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1}),this._animRequest=C(n,this,!0),ze(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),we(document,"touchmove",this._onTouchMove,this),we(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),Ze.addInitHook("addHandler","touchZoom",gt),Ze.BoxZoom=Q,Ze.DoubleClickZoom=pt,Ze.Drag=Wi,Ze.Keyboard=_t,Ze.ScrollWheelZoom=mt,Ze.TapHold=ft,Ze.TouchZoom=gt,t.Bounds=j,t.Browser=Mt,t.CRS=H,t.Canvas=Bi,t.Circle=hi,t.CircleMarker=ui,t.Class=P,t.Control=Ne,t.DivIcon=zi,t.DivOverlay=Ti,t.DomEvent=X,t.DomUtil=J,t.Draggable=$e,t.Evented=E,t.FeatureGroup=si,t.GeoJSON=_i,t.GridLayer=Ei,t.Handler=K,t.Icon=oi,t.ImageOverlay=Si,t.LatLng=D,t.LatLngBounds=Z,t.Layer=ct,t.LayerGroup=ni,t.LineUtil=et,t.Map=Ze,t.Marker=li,t.Mixin=tt,t.Path=ci,t.Point=O,t.PolyUtil=it,t.Polygon=pi,t.Polyline=di,t.Popup=Mi,t.PosAnimation=Be,t.Projection=ot,t.Rectangle=Fi,t.Renderer=ji,t.SVG=Ni,t.SVGOverlay=Ci,t.TileLayer=Oi,t.Tooltip=Pi,t.Transformation=G,t.Util=M,t.VideoOverlay=ki,t.bind=s,t.bounds=B,t.canvas=Zi,t.circle=function(t,e,i){return new hi(t,e,i)},t.circleMarker=function(t,e){return new ui(t,e)},t.control=qe,t.divIcon=function(t){return new zi(t)},t.extend=e,t.featureGroup=function(t,e){return new si(t,e)},t.geoJSON=Li,t.geoJson=ht,t.gridLayer=function(t){return new Ei(t)},t.icon=function(t){return new oi(t)},t.imageOverlay=function(t,e,i){return new Si(t,e,i)},t.latLng=N,t.latLngBounds=q,t.layerGroup=function(t,e){return new ni(t,e)},t.map=function(t,e){return new Ze(t,e)},t.marker=function(t,e){return new li(t,e)},t.point=A,t.polygon=function(t,e){return new pi(t,e)},t.polyline=function(t,e){return new di(t,e)},t.popup=function(t,e){return new Mi(t,e)},t.rectangle=function(t,e){return new Fi(t,e)},t.setOptions=p,t.stamp=r,t.svg=Hi,t.svgOverlay=function(t,e,i){return new Ci(t,e,i)},t.tileLayer=Ii,t.tooltip=function(t,e){return new Pi(t,e)},t.transformation=R,t.version="1.8.0",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Gi,this},window.L=t})),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).Leaflet=t.Leaflet||{},t.Leaflet.markercluster={}))}(this,(function(t){"use strict";var e=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var e=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(t){if(t instanceof L.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var e=t,i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer:function(t){return t instanceof L.LayerGroup?this.removeLayers([t]):(t.getLatLng?this._map?t.__parent&&(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow())):(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t})):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t})),this)},addLayers:function(t,e){if(!L.Util.isArray(t))return this.addLayer(t);var i,n=this._featureGroup,s=this._nonPointGroup,o=this.options.chunkedLoading,r=this.options.chunkInterval,a=this.options.chunkProgress,l=t.length,c=0,u=!0;if(this._map){var h=(new Date).getTime(),d=L.bind((function(){var p=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();c<l;c++){if(o&&c%200==0){var _=(new Date).getTime()-p;if(r<_)break}if((i=t[c])instanceof L.LayerGroup)u&&(t=t.slice(),u=!1),this._extractNonGroupLayers(i,t),l=t.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),e||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var m=i.__parent.getAllChildMarkers(),f=m[0]===i?m[1]:m[0];n.removeLayer(f)}}else s.addLayer(i),e||this.fire("layeradd",{layer:i})}a&&a(c,l,(new Date).getTime()-h),c===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)}),this);d()}else for(var p=this._needsClustering;c<l;c++)(i=t[c])instanceof L.LayerGroup?(u&&(t=t.slice(),u=!1),this._extractNonGroupLayers(i,t),l=t.length):i.getLatLng?this.hasLayer(i)||p.push(i):s.addLayer(i);return this},removeLayers:function(t){var e,i,n=t.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(r&&(t=t.slice(),r=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),o.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=t.slice(),l=n;for(e=0;e<l;e++)(i=a[e])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),l=a.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(r&&(t=t.slice(),r=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),s.hasLayer(i)&&(s.removeLayer(i),i.clusterShow&&i.clusterShow())):(o.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer((function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent}),this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var t=new L.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(var e=this._needsClustering.length-1;0<=e;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n,s,o=this._needsClustering.slice(),r=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),n=o.length-1;0<=n;n--){for(i=!0,s=r.length-1;0<=s;s--)if(r[s].layer===o[n]){i=!1;break}i&&t.call(e,o[n])}this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var t=[];return this.eachLayer((function(e){t.push(e)})),t},getLayer:function(t){var e=null;return t=parseInt(t,10),this.eachLayer((function(i){L.stamp(i)===t&&(e=i)})),e},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;0<=e;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;0<=e;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){var i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd:function(t){var e,i,n;if(this._map=t,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){for(var e=t;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(var i=t.length-1;0<=i;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){for(var i=this._map,n=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());s<=e&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart:function(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved:function(t){if(!this._ignoreMove&&!t.target.__dragStart){var e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild:function(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd:function(t){var e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer:function(t,e,i){var n=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);var l,c=t.__parent,u=c._markers;for(this._arraySplice(u,t);c&&(c._childCount--,c._boundsNeedUpdate=!0,!(c._zoom<a));)e&&c._childCount<=1?(l=c._markers[0]===t?c._markers[1]:c._markers[0],n[c._zoom].removeObject(c,r.project(c._cLatLng,c._zoom)),s[c._zoom].addObject(l,r.project(l.getLatLng(),c._zoom)),this._arraySplice(c.__parent._childClusters,c),c.__parent._markers.push(l),l.__parent=c.__parent,c._icon&&(o.removeLayer(c),i||o.addLayer(l))):c._iconNeedsUpdate=!0,c=c.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire:function(t,e,i){if(e&&e.layer instanceof L.MarkerCluster){if(e.originalEvent&&this._isOrIsParent(e.layer._icon,e.originalEvent.relatedTarget))return;t="cluster"+t}L.FeatureGroup.prototype.fire.call(this,t,e,i)},listens:function(t,e){return L.FeatureGroup.prototype.listens.call(this,t,e)||L.FeatureGroup.prototype.listens.call(this,"cluster"+t,e)},_defaultIconCreateFunction:function(t){var e=t.getChildCount(),i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new L.DivIcon({html:"<div><span>"+e+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,s=this.options.spiderfyOnEveryZoom;(e||n||s)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){var e=t.layer,i=e;if("clusterkeypress"!==t.type||!t.originalEvent||13===t.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(t){var e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),2<t.layer.getChildCount()&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,s=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),s.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=Math.ceil(this._map.getMaxZoom()),e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var s=t;e<=s;s--)this._gridClusters[s]=new L.DistanceGrid(n(s)),this._gridUnclustered[s]=new L.DistanceGrid(n(s));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer:function(t,e){var i,n,s=this._gridClusters,o=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);r<=e;e--){i=this._map.project(t.getLatLng(),e);var a=s[e].getNearObject(i);if(a)return a._addChild(t),void(t.__parent=a);if(a=o[e].getNearObject(i)){var l=a.__parent;l&&this._removeLayer(a,!1);var c=new this._markerCluster(this,e,a,t);s[e].addObject(c,this._map.project(c._cLatLng,e)),a.__parent=c;var u=t.__parent=c;for(n=e-1;n>l._zoom;n--)u=new this._markerCluster(this,n,u),s[n].addObject(u,this._map.project(a.getLatLng(),n));return l._addChild(u),void this._removeFromGridUnclustered(a,e)}o[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer((function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()}))},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(t){var e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()},_extractNonGroupLayers:function(t,e){var i,n=t.getLayers(),s=0;for(e=e||[];s<n.length;s++)(i=n[s])instanceof L.LayerGroup?this._extractNonGroupLayers(i,e):e.push(i);return e},_overrideMarkerIcon:function(t){return t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[t]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(t,e){var i,n=this._getExpandedVisibleBounds(),s=this._featureGroup,o=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(n,t,o,(function(o){var r,a=o._latlng,l=o._markers;for(n.contains(a)||(a=null),o._isSingleParent()&&t+1===e?(s.removeLayer(o),o._recursivelyAddChildrenToMap(null,e,n)):(o.clusterHide(),o._recursivelyAddChildrenToMap(a,e,n)),i=l.length-1;0<=i;i--)r=l[i],n.contains(r._latlng)||s.removeLayer(r)})),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,e),s.eachLayer((function(t){t instanceof L.MarkerCluster||!t._icon||t.clusterShow()})),this._topClusterLevel._recursively(n,t,e,(function(t){t._recursivelyRestoreChildPositions(e)})),this._ignoreMove=!1,this._enqueue((function(){this._topClusterLevel._recursively(n,t,o,(function(t){s.removeLayer(t),t.clusterShow()})),this._animationEnd()}))},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(2<e._childCount?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue((function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()}))):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(t,e,i){var n=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,s,e+1,i);var o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue((function(){if(1===t._childCount){var r=t._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else t._recursively(n,i,s,(function(t){t._recursivelyRemoveChildrenFromMap(n,s,e+1)}));o._animationEnd()}))},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t,e){t=t||[];for(var i=this._childClusters.length-1;0<=i;i--)this._childClusters[i].getAllChildMarkers(t,e);for(var n=this._markers.length-1;0<=n;n--)e&&this._markers[n].__dragStart||t.push(this._markers[n]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(t){for(var e,i=this._childClusters.slice(),n=this._group._map,s=n.getBoundsZoom(this._bounds),o=this._zoom+1,r=n.getZoom();0<i.length&&o<s;){o++;var a=[];for(e=0;e<i.length;e++)a=a.concat(i[e]._childClusters);i=a}o<s?this._group._map.setView(this._latlng,o):s<=r?this._group._map.setView(this._latlng,r+1):this._group._map.fitBounds(this._bounds,t)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){var t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){var t,e,i,n,s=this._markers,o=this._childClusters,r=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),t=0;t<s.length;t++)i=s[t]._latlng,this._bounds.extend(i),r+=i.lat,a+=i.lng;for(t=0;t<o.length;t++)(e=o[t])._boundsNeedUpdate&&e._recalculateBounds(),this._bounds.extend(e._bounds),i=e._wLatLng,n=e._childCount,r+=i.lat*n,a+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(r/l,a/l),this._boundsNeedUpdate=!1}},_addToMap:function(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(t,e,i){this._recursively(t,this._group._map.getMinZoom(),i-1,(function(t){var i,n,s=t._markers;for(i=s.length-1;0<=i;i--)(n=s[i])._icon&&(n._setPos(e),n.clusterHide())}),(function(t){var i,n,s=t._childClusters;for(i=s.length-1;0<=i;i--)(n=s[i])._icon&&(n._setPos(e),n.clusterHide())}))},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i,n){this._recursively(t,n,e,(function(s){s._recursivelyAnimateChildrenIn(t,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),i),s._isSingleParent()&&i-1===n?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(t,e,i)):s.clusterHide(),s._addToMap()}))},_recursivelyBecomeVisible:function(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,(function(t){t.clusterShow()}))},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,this._group._map.getMinZoom()-1,e,(function(n){if(e!==n._zoom)for(var s=n._markers.length-1;0<=s;s--){var o=n._markers[s];i.contains(o._latlng)&&(t&&(o._backupLatlng=o.getLatLng(),o.setLatLng(t),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}}),(function(e){e._addToMap(t)}))},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;0<=e;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;0<=n;n--)this._childClusters[n]._restorePosition();else for(var s=this._childClusters.length-1;0<=s;s--)this._childClusters[s]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i,n){var s,o;this._recursively(t,e-1,i-1,(function(t){for(o=t._markers.length-1;0<=o;o--)s=t._markers[o],n&&n.contains(s._latlng)||(t._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())}),(function(t){for(o=t._childClusters.length-1;0<=o;o--)s=t._childClusters[o],n&&n.contains(s._latlng)||(t._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())}))},_recursively:function(t,e,i,n,s){var o,r,a=this._childClusters,l=this._zoom;if(e<=l&&(n&&n(this),s&&l===i&&s(this)),l<e||l<i)for(o=a.length-1;0<=o;o--)(r=a[o])._boundsNeedUpdate&&r._recalculateBounds(),t.intersects(r._bounds)&&r._recursively(t,e,i,n,s)},_isSingleParent:function(){return 0<this._childClusters.length&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),s=this._grid,o=s[n]=s[n]||{},r=o[i]=o[i]||[],a=L.Util.stamp(t);this._objectPoint[a]=e,r.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,s=this._getCoord(e.x),o=this._getCoord(e.y),r=this._grid,a=r[o]=r[o]||{},l=a[s]=a[s]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=l.length;i<n;i++)if(l[i]===t)return l.splice(i,1),1===n&&delete a[s],!0},eachObject:function(t,e){var i,n,s,o,r,a,l=this._grid;for(i in l)for(n in r=l[i])for(s=0,o=(a=r[n]).length;s<o;s++)t.call(e,a[s])&&(s--,o--)},getNearObject:function(t){var e,i,n,s,o,r,a,l,c=this._getCoord(t.x),u=this._getCoord(t.y),h=this._objectPoint,d=this._sqCellSize,p=null;for(e=u-1;e<=u+1;e++)if(s=this._grid[e])for(i=c-1;i<=c+1;i++)if(o=s[i])for(n=0,r=o.length;n<r;n++)a=o[n],((l=this._sqDist(h[L.Util.stamp(a)],t))<d||l<=d&&null===p)&&(d=l,p=a);return p},_getCoord:function(t){var e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},L.QuickHull={getDistant:function(t,e){var i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){var i,n,s,o=0,r=null,a=[];for(i=e.length-1;0<=i;i--)n=e[i],0<(s=this.getDistant(n,t))&&(a.push(n),o<s&&(o=s,r=n));return{maxPoint:r,newPoints:a}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull:function(t){var e,i,n=!1,s=!1,o=!1,r=!1,a=null,l=null,c=null,u=null,h=null;for(e=t.length-1;0<=e;e--){var d=t[e];(!1===n||d.lat>n)&&(n=(a=d).lat),(!1===s||d.lat<s)&&(s=(l=d).lat),(!1===o||d.lng>o)&&(o=(c=d).lng),(!1===r||d.lng<r)&&(r=(u=d).lng)}return i=s!==n?(h=l,a):(h=u,c),[].concat(this.buildConvexHull([h,i],t),this.buildConvexHull([i,h],t))}},L.MarkerCluster.include({getConvexHull:function(){var t,e,i=this.getAllChildMarkers(),n=[];for(e=i.length-1;0<=e;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),t=(this._group._spiderfied=this)._group.options.spiderfyShapePositions?this._group.options.spiderfyShapePositions(e.length,i):e.length>=this._circleSpiralSwitchover?this._generatePointsSpiral(e.length,i):(i.y+=10,this._generatePointsCircle(e.length,i)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,s=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI,o=this._2PI/t,r=[];for(s=Math.max(s,35),r.length=t,i=0;i<t;i++)n=this._circleStartAngle+i*o,r[i]=new L.Point(e.x+s*Math.cos(n),e.y+s*Math.sin(n))._round();return r},_generatePointsSpiral:function(t,e){var i,n=this._group.options.spiderfyDistanceMultiplier,s=n*this._spiralLengthStart,o=n*this._spiralFootSeparation,r=n*this._spiralLengthFactor*this._2PI,a=0,l=[];for(i=l.length=t;0<=i;i--)i<t&&(l[i]=new L.Point(e.x+s*Math.cos(a),e.y+s*Math.sin(a))._round()),s+=r/(a+=o/s+5e-4*i);return l},_noanimationUnspiderfy:function(){var t,e,i=this._group,n=i._map,s=i._featureGroup,o=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),e=o.length-1;0<=e;e--)t=o[e],s.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:o}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(t,e){var i,n,s,o,r=this._group,a=r._map,l=r._featureGroup,c=this._group.options.spiderLegPolylineOptions;for(r._ignoreMove=!0,i=0;i<t.length;i++)o=a.layerPointToLatLng(e[i]),n=t[i],s=new L.Polyline([this._latlng,o],c),a.addLayer(s),n._spiderLeg=s,n._preSpiderfyLatlng=n._latlng,n.setLatLng(o),n.setZIndexOffset&&n.setZIndexOffset(1e6),l.addLayer(n);this.setOpacity(.3),r._ignoreMove=!1,r.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(t,e){var i,n,s,o,r,a,l=this,c=this._group,u=c._map,h=c._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),_=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),f=m.opacity;for(void 0===f&&(f=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),_?(m.opacity=0,m.className=(m.className||"")+" leaflet-cluster-spider-leg"):m.opacity=f,c._ignoreMove=!0,i=0;i<t.length;i++)n=t[i],a=u.layerPointToLatLng(e[i]),s=new L.Polyline([d,a],m),u.addLayer(s),n._spiderLeg=s,_&&(r=(o=s._path).getTotalLength()+.1,o.style.strokeDasharray=r,o.style.strokeDashoffset=r),n.setZIndexOffset&&n.setZIndexOffset(1e6),n.clusterHide&&n.clusterHide(),h.addLayer(n),n._setPos&&n._setPos(p);for(c._forceLayout(),c._animationStart(),i=t.length-1;0<=i;i--)a=u.layerPointToLatLng(e[i]),(n=t[i])._preSpiderfyLatlng=n._latlng,n.setLatLng(a),n.clusterShow&&n.clusterShow(),_&&((o=(s=n._spiderLeg)._path).style.strokeDashoffset=0,s.setStyle({opacity:f}));this.setOpacity(.3),c._ignoreMove=!1,setTimeout((function(){c._animationEnd(),c.fire("spiderfied",{cluster:l,markers:t})}),200)},_animationUnspiderfy:function(t){var e,i,n,s,o,r,a=this,l=this._group,c=l._map,u=l._featureGroup,h=t?c._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):c.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=d.length-1;0<=i;i--)(e=d[i])._preSpiderfyLatlng&&(e.closePopup(),e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,r=!0,e._setPos&&(e._setPos(h),r=!1),e.clusterHide&&(e.clusterHide(),r=!1),r&&u.removeLayer(e),p&&(o=(s=(n=e._spiderLeg)._path).getTotalLength()+.1,s.style.strokeDashoffset=o,n.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout((function(){var t=0;for(i=d.length-1;0<=i;i--)(e=d[i])._spiderLeg&&t++;for(i=d.length-1;0<=i;i--)(e=d[i])._spiderLeg&&(e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),1<t&&u.removeLayer(e),c.removeLayer(e._spiderLeg),delete e._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:d})}),200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(t){return t?t instanceof L.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof L.LayerGroup?t=t._layers:t instanceof L.MarkerCluster?t=t.getAllChildMarkers():t instanceof L.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){var e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(t){var e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(t,e){var i=this.options.icon;return L.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),t.MarkerClusterGroup=e,t.MarkerCluster=i,Object.defineProperty(t,"__esModule",{value:!0})}));const appModules={_debug:(t,e)=>{},list:new Map,types:["module","script"],positions:["head","body_top","body_bottom","before_shop_js","after_shop_js"],loadTimeout:5e3,shopJsName:"shop.js",validators:{moduleValid:(t,e)=>!t&&!e||(appModules._debug("load",`link wybranego modułu nie jest poprawny: ${t}`),!1),moduleInstalled:t=>!!appModules.list.has(t)||(appModules._debug("moduleInstalled","wskazany moduł nie został zainstalowany."),!1),allowedType:t=>{const{types:e}=appModules;return!!e.includes(t)||(appModules._debug("allowedType",`type skryptu musi być jedną z opcji: ${e.join(", ")}`),!1)},scriptPosition:t=>{const{positions:e}=appModules;return!!e.includes(t)||(appModules._debug("scriptPosition",`pozycja osadzenia skryptu musi być jedną z opcji: ${e.join(", ")}`),!1)},scriptNotLoaded:t=>!(document.querySelectorAll(`script[src*="${t}"]`).length>0)||(appModules._debug("scriptNotLoaded",`skrypt z linkiem ${t} został już załadowany`),!1),validateLink:t=>!!t||(appModules._debug("scriptNotLoaded",`skrypt z linkiem ${t} został już załadowany`),!1)},getModule:t=>appModules.list.has(t)?appModules.list.get(t):{link:"",content:null},installModule:(t,e)=>"string"!=typeof t||"string"!=typeof e?(appModules._debug("installModule","link/name musi być stringiem."),!1):appModules.list.has(t)?(appModules._debug("installModule",`wskazany moduł został już zainstalowany: ${t}`),!1):(appModules.list.set(t,{link:e,content:null}),!0),load:async(t,{type:e="module",position:i="head",scriptAttrs:n={}}={})=>{const{link:s,content:o}=appModules.getModule(t),{moduleInstalled:r,allowedType:a,scriptPosition:l}=appModules.validators;return!!r(t)&&(!!a(e)&&(o||("module"===e?appModules._loadModule({name:t,link:s}):"script"===e?!!l(i)&&appModules._loadScript({link:s,position:i,scriptAttrs:n}):void 0)))},_updateModule:(t,e)=>{if(appModules.list.has(t)){const i=appModules.getModule(t);return appModules.list.set(t,{...i,content:e}),!0}return!1},_loadModule:async({name:t,link:e})=>{try{const i=await import(e);return appModules._updateModule(t,i),i}catch(t){return appModules._debug("load",`Wystąpił błąd pobierania modułu: ${t}`),!1}},_loadScript:async({link:t="",position:e="head",scriptAttrs:i={}}={})=>new Promise(((n,s)=>{try{if(!appModules.validators.validateLink(t))return s(!1);if(!appModules.validators.scriptNotLoaded(t))return s(!1);const o=document.createElement("script");o.src=t,((t,e)=>{if(Object.getPrototypeOf(e)!==Object.prototype)return!1;Object.entries(e).forEach((([e,i])=>{t.setAttribute(e,i)}))})(o,i),o.addEventListener("load",(()=>{n(!0)})),o.addEventListener("error",((t,e,i,n,o)=>{appModules._debug("load",`błąd ładowania skryptu: ${t}, ${e}, ${i}, ${n}, ${o}`),s(!1)})),appModules._appendScript(o,e)}catch(t){appModules._debug("load",`błąd osadzania skryptu: ${t}`),s(!1)}})),_appendScript(t,e){const{shopJsName:i}=appModules;switch(e){case"body_top":document.body.insertAdjacentElement("afterbegin",t);break;case"body_bottom":document.body.insertAdjacentElement("beforeend",t);break;case"before_shop_js":{const e=document.querySelector(`script[src*="${i}"]`);if(!e){appModules._debug("_loadScript","before_shop_js - nie znaleziono tagu script z shop.js");break}e.insertAdjacentElement("beforeend",t);break}case"after_shop_js":{const e=document.querySelector(`script[src*="${i}"]`);if(!e){appModules._debug("_loadScript","after_shop_js - nie znaleziono tagu script z shop.js");break}e.insertAdjacentElement("afterend",t);break}default:document.head.appendChild(t)}}};window.errorLog=async t=>{const e=new URLSearchParams(`JSerror=${t?.stack?.toString()}`)||`JSerror=${t}`;try{await fetch(`/graphql/v1/?${e.toString()}`,{method:"POST",body:"query {\n        hello\n      }"})}catch(t){return!1}},function(t){"use strict";function e(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function i(t,i,n,s,o,r){return e(function(t,e){return t<<e|t>>>32-e}(e(e(i,t),e(s,r)),o),n)}function n(t,e,n,s,o,r,a){return i(e&n|~e&s,t,e,o,r,a)}function s(t,e,n,s,o,r,a){return i(e&s|n&~s,t,e,o,r,a)}function o(t,e,n,s,o,r,a){return i(e^n^s,t,e,o,r,a)}function r(t,e,n,s,o,r,a){return i(n^(e|~s),t,e,o,r,a)}function a(t,i){t[i>>5]|=128<<i%32,t[14+(i+64>>>9<<4)]=i;var a,l,c,u,h,d=1732584193,p=-271733879,_=-1732584194,m=271733878;for(a=0;a<t.length;a+=16)l=d,c=p,u=_,h=m,p=r(p=r(p=r(p=r(p=o(p=o(p=o(p=o(p=s(p=s(p=s(p=s(p=n(p=n(p=n(p=n(p,_=n(_,m=n(m,d=n(d,p,_,m,t[a],7,-680876936),p,_,t[a+1],12,-389564586),d,p,t[a+2],17,606105819),m,d,t[a+3],22,-1044525330),_=n(_,m=n(m,d=n(d,p,_,m,t[a+4],7,-176418897),p,_,t[a+5],12,1200080426),d,p,t[a+6],17,-1473231341),m,d,t[a+7],22,-45705983),_=n(_,m=n(m,d=n(d,p,_,m,t[a+8],7,1770035416),p,_,t[a+9],12,-1958414417),d,p,t[a+10],17,-42063),m,d,t[a+11],22,-1990404162),_=n(_,m=n(m,d=n(d,p,_,m,t[a+12],7,1804603682),p,_,t[a+13],12,-40341101),d,p,t[a+14],17,-1502002290),m,d,t[a+15],22,1236535329),_=s(_,m=s(m,d=s(d,p,_,m,t[a+1],5,-165796510),p,_,t[a+6],9,-1069501632),d,p,t[a+11],14,643717713),m,d,t[a],20,-373897302),_=s(_,m=s(m,d=s(d,p,_,m,t[a+5],5,-701558691),p,_,t[a+10],9,38016083),d,p,t[a+15],14,-660478335),m,d,t[a+4],20,-405537848),_=s(_,m=s(m,d=s(d,p,_,m,t[a+9],5,568446438),p,_,t[a+14],9,-1019803690),d,p,t[a+3],14,-187363961),m,d,t[a+8],20,1163531501),_=s(_,m=s(m,d=s(d,p,_,m,t[a+13],5,-1444681467),p,_,t[a+2],9,-51403784),d,p,t[a+7],14,1735328473),m,d,t[a+12],20,-1926607734),_=o(_,m=o(m,d=o(d,p,_,m,t[a+5],4,-378558),p,_,t[a+8],11,-2022574463),d,p,t[a+11],16,1839030562),m,d,t[a+14],23,-35309556),_=o(_,m=o(m,d=o(d,p,_,m,t[a+1],4,-1530992060),p,_,t[a+4],11,1272893353),d,p,t[a+7],16,-155497632),m,d,t[a+10],23,-1094730640),_=o(_,m=o(m,d=o(d,p,_,m,t[a+13],4,681279174),p,_,t[a],11,-358537222),d,p,t[a+3],16,-722521979),m,d,t[a+6],23,76029189),_=o(_,m=o(m,d=o(d,p,_,m,t[a+9],4,-640364487),p,_,t[a+12],11,-421815835),d,p,t[a+15],16,530742520),m,d,t[a+2],23,-995338651),_=r(_,m=r(m,d=r(d,p,_,m,t[a],6,-198630844),p,_,t[a+7],10,1126891415),d,p,t[a+14],15,-1416354905),m,d,t[a+5],21,-57434055),_=r(_,m=r(m,d=r(d,p,_,m,t[a+12],6,1700485571),p,_,t[a+3],10,-1894986606),d,p,t[a+10],15,-1051523),m,d,t[a+1],21,-2054922799),_=r(_,m=r(m,d=r(d,p,_,m,t[a+8],6,1873313359),p,_,t[a+15],10,-30611744),d,p,t[a+6],15,-1560198380),m,d,t[a+13],21,1309151649),_=r(_,m=r(m,d=r(d,p,_,m,t[a+4],6,-145523070),p,_,t[a+11],10,-1120210379),d,p,t[a+2],15,718787259),m,d,t[a+9],21,-343485551),d=e(d,l),p=e(p,c),_=e(_,u),m=e(m,h);return[d,p,_,m]}function l(t){var e,i="",n=32*t.length;for(e=0;e<n;e+=8)i+=String.fromCharCode(t[e>>5]>>>e%32&255);return i}function c(t){var e,i=[];for(i[(t.length>>2)-1]=void 0,e=0;e<i.length;e+=1)i[e]=0;var n=8*t.length;for(e=0;e<n;e+=8)i[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return i}function u(t){var e,i,n="";for(i=0;i<t.length;i+=1)e=t.charCodeAt(i),n+="0123456789abcdef".charAt(e>>>4&15)+"0123456789abcdef".charAt(15&e);return n}function h(t){return unescape(encodeURIComponent(t))}function d(t){return function(t){return l(a(c(t),8*t.length))}(h(t))}function p(t,e){return function(t,e){var i,n,s=c(t),o=[],r=[];for(o[15]=r[15]=void 0,s.length>16&&(s=a(s,8*t.length)),i=0;i<16;i+=1)o[i]=909522486^s[i],r[i]=1549556828^s[i];return n=a(o.concat(c(e)),512+8*e.length),l(a(r.concat(n),640))}(h(t),h(e))}function _(t,e,i){return e?i?p(e,t):function(t,e){return u(p(t,e))}(e,t):i?d(t):function(t){return u(d(t))}(t)}"function"==typeof define&&define.amd?define((function(){return _})):"object"==typeof module&&module.exports?module.exports=_:t.md5=_}(window),window.format_price=function(t,e){var i=t,n=(e=e||{}).mask||"###&nbsp;##0,00";currency_grouping_separator&&(n=n.replace(",",currency_grouping_separator)),currency_decimal_separator&&(n=n.replace(".",currency_decimal_separator));var s=e.currency||"",o=e.currency_space?" ":"",r=!!e.currency_before_price;if(!n||isNaN(+i))return i;var a=(i="-"==n.charAt(0)?-i:+i)<0?i=-i:0,l=n.match(/[^\d\-\+#]/g),c=l&&l[l.length-1]||".",u=l&&l[1]&&l[0]||",";n=n.split(c);i=+(i=i.toFixed(n[1]&&n[1].length))+"";var h=n[1]&&n[1].lastIndexOf("0"),d=i.split(".");(!d[1]||d[1]&&d[1].length<=h)&&(i=(+i).toFixed(h+1));var p=n[0].split(u);n[0]=p.join("");var _=n[0]&&n[0].indexOf("0");if(_>-1)for(;d[0].length<n[0].length-_;)d[0]="0"+d[0];else 0==+d[0]&&(d[0]="");(i=i.split("."))[0]=d[0];var m=p[1]&&p[p.length-1].length;if(m){for(var f=i[0],g="",y=f.length%m,v=0,b=f.length;v<b;v++)g+=f.charAt(v),!((v-y+1)%m)&&v<b-m&&(g+=u);i[0]=g}i[1]=n[1]&&i[1]?c+i[1]:"";t=(a?"-":"")+i[0]+i[1];return t=r?s+o+t:t+o+s},app_shop.fn.fontCallback=()=>{void 0!==app_shop.fn.fontCallbackMenu&&app_shop.fn.fontCallbackMenu()};var google_map_style_array=[{featureType:"landscape",stylers:[{saturation:-100},{lightness:65},{visibility:"on"}]},{featureType:"poi",stylers:[{saturation:-100},{lightness:51},{visibility:"simplified"}]},{featureType:"road.highway",stylers:[{saturation:-100},{visibility:"simplified"}]},{featureType:"road.arterial",stylers:[{saturation:-100},{lightness:30},{visibility:"on"}]},{featureType:"road.local",stylers:[{saturation:-100},{lightness:40},{visibility:"on"}]},{featureType:"transit",stylers:[{saturation:-100},{visibility:"simplified"}]},{featureType:"administrative.province",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"on"},{lightness:-25},{saturation:-100}]},{featureType:"water",elementType:"geometry",stylers:[{hue:"#ffff00"},{lightness:-25},{saturation:-97}]}];app_shop.run((function(){document.documentElement.classList.remove("_mobile")}),[2,3,4],"body",!0),app_shop.run((function(){document.documentElement.classList.add("_mobile")}),1,"body",!0),app_shop.run((()=>{document.querySelectorAll(".cm img.rwd-src").forEach((t=>{t.setAttribute("src",app_shop.fn.getRwdSrc(t))}))}),[1,2,3,4],".cm img.rwd-src"),app_shop.run((function(){document.querySelectorAll("img.b-lazy").forEach((t=>{t.closest("a")?.classList.add("loading")})),app_shop.vars.bLazy=new Blazy({breakpoints:[{width:420,src:"data-src-small"}],success:function(t){t.closest(".loading")?.classList.remove("loading")}}),app_shop.fn.addFocusEventListeners();const t=document.querySelectorAll(".form-group .form-control, .f-group .f-control");setTimeout((()=>{t.forEach((t=>app_shop.fn.addFocused.call(t)))}),500),app_shop.fn.setupFileInputListeners(),app_shop.fn.backTop({txt:'<i class="icon-angle-up"></i>'});let e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${e}px`),window.addEventListener("resize",(()=>{e=.01*window.innerHeight,document.documentElement.style.setProperty("--vh",`${e}px`)}))}),"all"),app_shop.fn.fixed_scroll=(t,e)=>{let i=window.scrollY;const n=window;window.addEventListener("scroll",(function(s){n.scrollY>i&&n.scrollY>0?!t.classList.contains(e)&&t.classList.add(e):t.classList.contains(e)&&t.classList.remove(e),i=n.scrollY}))},app_shop.fn.isIos=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,app_shop.vars.isIos=app_shop.fn.isIos(),app_shop.fn.isSafari=()=>isSafari=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),app_shop.vars.isSafari=app_shop.fn.isSafari(),app_shop.run((function(){app_shop.fn.fixed_scroll(document.documentElement,"scroll"),app_shop.vars.isIos&&document.documentElement.classList.add("--ios"),app_shop.vars.isSafari&&document.documentElement.classList.add("--safari")}),[1,2],"#container"),app_shop.run((function(){document.querySelectorAll(".moreInfo__show").forEach((t=>{t.addEventListener("click",(function(){this.parentElement.classList.toggle("--hover"),this.parentElement.querySelector(".moreInfo")?.classList.toggle("--hover")}))}))}),"all",".moreInfo__show"),app_shop.txt.txt_77752_1="Nie można wgrać pliku %s, ponieważ przekracza maksymalny dozwolony rozmiar %dMB.",app_shop.txt.txt_77752_2="Nie można wgrać pliku %s, ponieważ załączanie plików tego typu jest niedozwolone.",app_shop.txt.txt_77752_3="Dopuszczalne formaty zdjęć: .jpg.",app_shop.txt.txt_77752_4="Maksymalny rozmiar zdjęcia to: %spx.";var hotspotAjaxWrapType="";app_shop.txt.txt_validation1="Minimalna liczba znaków dla tego pola to ",app_shop.txt.txt_validation2="Maksymalna liczba znaków dla tego pola to ",app_shop.txt.txt_validation3="Błędnie wpisany e-mail. Wpisz pełny adres e-mail, np. jan@kowalski.com.",app_shop.txt.txt_validation4="Te pole jest obowiązkowe.",app_shop.txt.txt_validation5="Format numeru konta bankowego jest niepoprawny ",app_shop.txt.txt_validation6="Numer telefonu powinien zawierać minimum 9 znaków ",app_shop.txt.hotspot_prev="Poprzedni z tej kategorii",app_shop.txt.hotspot_next="Następny z tej kategorii";const Alertek={alert_cover:"",cloudID:"",alert_timer:null,fadeIn:()=>{Alertek.cloudID.style.display="block",Alertek.cloudID.style.transition="opacity 0.5s",Alertek.cloudID.style.opacity=0,setTimeout((()=>{Alertek.cloudID.style.opacity=1}),0)},fadeOut:()=>{Alertek.cloudID.style.opacity=0,setTimeout((()=>{Alertek.cloudID.style.display="none"}),500)},Start:(t,e,i=4e3)=>{clearTimeout(Alertek.alert_timer),document.querySelector("#alert_cover")?.remove();const n=document.createElement("div");n.className="alertek"+(e?` ${e}`:""),n.id="alert_cover",n.style.display="none",n.onclick=Alertek.hide_alert,document.body.appendChild(n),e||n.classList.add("menu_messages_message"),Alertek.cloudID=n,t&&(Alertek.cloudID.innerHTML=t,Alertek.fadeIn(),Alertek.alert_timer=setTimeout(Alertek.End,i))},End:()=>{Alertek.fadeOut()},Info:(t,e)=>{Alertek.Start(t,"--info",e)},Warning:(t,e)=>{Alertek.Start(t,"--warning",e)},Error:(t,e)=>{Alertek.Start(t,"--error",e)},Success:(t,e)=>{Alertek.Start(t,"--success",e)},show_alert:(t,e)=>{Alertek.Start(t,!1,e)},hide_alert:()=>{Alertek.End()}};document.documentElement.classList.remove("_mobile"),app_shop.fn.addFocused=function(t,e){if("number"==typeof e)return;const{target:i}=t||{};let n=i?[i]:[this];e instanceof HTMLElement?n=[e]:e&&(n=document.querySelectorAll(e)),n.forEach((t=>{const e=t.nextElementSibling;e&&["control-label","f-label"].some((t=>e.classList.contains(t)))&&t.classList.toggle("focused",""!==t.value)}))},app_shop.fn.addFocusEventListeners=function(t=".form-group .form-control, .f-group .f-control"){["change","input","focus","blur"].forEach((e=>{document.addEventListener(e,(e=>{const{target:i}=e;i.closest&&i?.closest(t)&&app_shop.fn.addFocused(e)}),!0)}))},app_shop.fn.setupFileInputListeners=()=>{document.addEventListener("change",(t=>{const{target:e}=t;e?.closest('input[type="file"]')&&(t=>{if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;(t=>{const{target:e}=t,i=e.nextElementSibling;if(i?.classList.contains("f-label")){if(e.value.length)return i.classList.add("--file"),i.getAttribute("data-label")||i.setAttribute("data-label",i.textContent),void(i.textContent=e.value.split("\\").pop());i.classList.remove("--file"),i.textContent=i.getAttribute("data-label")||""}})(t);const{files:e}=t.target;if(0===e.length)return;const{name:i="",size:n,type:s}=e[0],[o]=i.split(".").reverse();if(app_shop.vars.blacklist_mime?.includes(s)&&app_shop.txt.txt_77752_2)return t.target.value="",void Alertek.Start(app_shop.txt.txt_77752_2.replace("%s",i));if(app_shop.vars.blacklist_extension?.includes(o)&&app_shop.txt.txt_77752_2)return t.target.value="",void Alertek.Start(app_shop.txt.txt_77752_2.replace("%s",i));const{max_filesize:r}=t.target.dataset;r&&n>+r&&app_shop.txt.txt_77752_1&&(t.target.value="",Alertek.Start(app_shop.txt.txt_77752_1.replace("%s",i).replace("%d",(+r/1048576).toFixed(2))))})(t)}),!0)},app_shop.fn.backTop=({txt:t='<i class="icon-chevron-up"></i>'})=>{const e=()=>{const t=window.innerWidth,e=document.getElementById("container")?.offsetWidth,n=.5*(t-e)-20;return n>=(i.offsetWidth||50)?n-(i.offsetWidth||50)+"px":"10px"},i=document.createElement("a");i.id="backTop",i.innerHTML=t,i.style.right=e(),document.body.appendChild(i),i.addEventListener("click",(()=>{window.scrollTo({top:0,behavior:"smooth"})})),window.addEventListener("scroll",(()=>{window.scrollY>2*window.innerHeight?i.style.display="block":i.style.display="none"})),window.addEventListener("resize",(()=>{i.style.right=e()}))},function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.Blazy=e()}(this,(function(){function t(t){var i=t._util;i.elements=function(t){for(var e=[],i=(t=t.root.querySelectorAll(t.selector)).length;i--;e.unshift(t[i]));return e}(t.options),i.count=i.elements.length,i.destroyed&&(i.destroyed=!1,t.options.container&&h(t.options.container,(function(t){c(t,"scroll",i.validateT)})),c(window,"resize",i.saveViewportOffsetT),c(window,"resize",i.validateT),c(window,"scroll",i.validateT)),e(t)}function e(t){for(var e=t._util,n=0;n<e.count;n++){var s,o=e.elements[n],a=o;s=t.options;var l=a.getBoundingClientRect();s.container&&f&&(a=a.closest(s.containerClass))?s=!!i(a=a.getBoundingClientRect(),_)&&i(l,{top:a.top-s.offset,right:a.right+s.offset,bottom:a.bottom+s.offset,left:a.left-s.offset}):s=i(l,_),(s||r(o,t.options.successClass))&&(t.load(o),e.elements.splice(n,1),e.count--,n--)}0===e.count&&t.destroy()}function i(t,e){return t.right>=e.left&&t.bottom>=e.top&&t.left<=e.right&&t.top<=e.bottom}function n(t,e,i){if(!r(t,i.successClass)&&(e||i.loadInvisible||0<t.offsetWidth&&0<t.offsetHeight))if(e=t.getAttribute(p)||t.getAttribute(i.src)){var n=(e=e.split(i.separator))[m&&1<e.length?1:0],l=t.getAttribute(i.srcset),d="img"===t.nodeName.toLowerCase(),_=(e=t.parentNode)&&"picture"===e.nodeName.toLowerCase();if(d||void 0===t.src){var f=new Image,g=function(){i.error&&i.error(t,"invalid"),a(t,i.errorClass),u(f,"error",g),u(f,"load",y)},y=function(){d?_||o(t,n,l):t.style.backgroundImage='url("'+n+'")',s(t,i),u(f,"load",y),u(f,"error",g)};_&&(f=t,h(e.getElementsByTagName("source"),(function(t){var e=i.srcset,n=t.getAttribute(e);n&&(t.setAttribute("srcset",n),t.removeAttribute(e))}))),c(f,"error",g),c(f,"load",y),o(f,n,l)}else t.src=n,s(t,i)}else"video"===t.nodeName.toLowerCase()?(h(t.getElementsByTagName("source"),(function(t){var e=i.src,n=t.getAttribute(e);n&&(t.setAttribute("src",n),t.removeAttribute(e))})),t.load(),s(t,i)):(i.error&&i.error(t,"missing"),a(t,i.errorClass))}function s(t,e){a(t,e.successClass),e.success&&e.success(t),t.removeAttribute(e.src),t.removeAttribute(e.srcset),h(e.breakpoints,(function(e){t.removeAttribute(e.src)}))}function o(t,e,i){i&&t.setAttribute("srcset",i),t.src=e}function r(t,e){return-1!==(" "+t.className+" ").indexOf(" "+e+" ")}function a(t,e){r(t,e)||(t.className+=" "+e)}function l(t){_.bottom=(window.innerHeight||document.documentElement.clientHeight)+t,_.right=(window.innerWidth||document.documentElement.clientWidth)+t}function c(t,e,i){t.attachEvent?t.attachEvent&&t.attachEvent("on"+e,i):t.addEventListener(e,i,{capture:!1,passive:!0})}function u(t,e,i){t.detachEvent?t.detachEvent&&t.detachEvent("on"+e,i):t.removeEventListener(e,i,{capture:!1,passive:!0})}function h(t,e){if(t&&e)for(var i=t.length,n=0;n<i&&!1!==e(t[n],n);n++);}function d(t,e,i){var n=0;return function(){var s=+new Date;s-n<e||(n=s,t.apply(i,arguments))}}var p,_,m,f;return function(i){if(!document.querySelectorAll){var s=document.createStyleSheet();document.querySelectorAll=function(t,e,i,n,o){for(o=document.all,e=[],i=(t=t.replace(/\[for\b/gi,"[htmlFor").split(",")).length;i--;){for(s.addRule(t[i],"k:v"),n=o.length;n--;)o[n].currentStyle.k&&e.push(o[n]);s.removeRule(0)}return e}}var o=this,r=o._util={};r.elements=[],r.destroyed=!0,o.options=i||{},o.options.error=o.options.error||!1,o.options.offset=o.options.offset||100,o.options.root=o.options.root||document,o.options.success=o.options.success||!1,o.options.selector=o.options.selector||".b-lazy",o.options.separator=o.options.separator||"|",o.options.containerClass=o.options.container,o.options.container=!!o.options.containerClass&&document.querySelectorAll(o.options.containerClass),o.options.errorClass=o.options.errorClass||"b-error",o.options.breakpoints=o.options.breakpoints||!1,o.options.loadInvisible=o.options.loadInvisible||!1,o.options.successClass=o.options.successClass||"b-loaded",o.options.validateDelay=o.options.validateDelay||25,o.options.saveViewportOffsetDelay=o.options.saveViewportOffsetDelay||50,o.options.srcset=o.options.srcset||"data-srcset",o.options.src=p=o.options.src||"data-src",f=Element.prototype.closest,m=1<window.devicePixelRatio,(_={}).top=0-o.options.offset,_.left=0-o.options.offset,o.revalidate=function(){t(this)},o.load=function(t,e){var i=this.options;void 0===t.length?n(t,e,i):h(t,(function(t){n(t,e,i)}))},o.destroy=function(){var t=this._util;this.options.container&&h(this.options.container,(function(e){u(e,"scroll",t.validateT)})),u(window,"scroll",t.validateT),u(window,"resize",t.validateT),u(window,"resize",t.saveViewportOffsetT),t.count=0,t.elements.length=0,t.destroyed=!0},r.validateT=d((function(){e(o)}),o.options.validateDelay,o),r.saveViewportOffsetT=d((function(){l(o.options.offset)}),o.options.saveViewportOffsetDelay,o),l(o.options.offset),h(o.options.breakpoints,(function(t){if(t.width>=window.screen.width)return p=t.src,!1})),setTimeout((function(){t(o)}))}}));const SelectToDropdown=function(t){return this.params=t,this.init=()=>{const{direction:t="down",selector:e,generateDropdownCallback:i,clickDropdownCallback:n,afterClickDropdownCallback:s,disableMobileView:o}=this.params;this.selects=document.querySelectorAll(e),this.direction=t,this.generateDropdownCallback=i,this.clickDropdownCallback=n,this.afterClickDropdownCallback=s,this.disableMobileView=o,this.selects.length&&(this.generateDropdown(),document.addEventListener("click",this.closeDropdown))},this.transformOptionListByDirection=t=>"top"===this.direction?t.reverse().join(""):t.join(""),this.generateDropdown=()=>{this.selects.forEach((t=>{t.selectedIndex<0&&(t.selectedIndex=0);const e=[...t.querySelectorAll("option")].map(((t,e)=>`\n        <li class="f-dropdown-li${t.hasAttribute("class")?` ${t.getAttribute("class")}`:""}${t.disabled?" --disabled":""}">\n          <a class="f-dropdown-item${t.selected?" --selected":""}" href="#${t.getAttribute("value")}" data-index="${e}" data-value="${t.getAttribute("value")}" ${[...t.attributes].filter((t=>t.name.startsWith("data-"))).map((t=>`${t.name}="${t.value}"`)).join(" ")}>${t.innerHTML}</a>\n        </li>\n      `)),i=`<div class="f-dropdown f-group ${t.getAttribute("class")} ${this.disableMobileView?"--disable-mobile-view":""}" data-direction="${this.direction}">\n        <button type="button" class="f-control f-dropdown-toggle${t.disabled?" --disabled":""}${t.hasAttribute("readonly")?" --readonly":""}" data-indexcurrent="${t.options[t.selectedIndex].index}">\n          ${t.hasAttribute("data-label")?`<strong class="f-dropdown-label">${t.getAttribute("data-label")}</strong>`:""}\n          <span class="f-dropdown-button">${t.options[t.selectedIndex].text}</span>\n        </button>\n        <ul class="f-dropdown-menu">\n          ${this.transformOptionListByDirection(e)}\n        </ul>\n      </div>`,n=document.createElement("div");n.innerHTML=i;const s=n.firstChild;t.insertAdjacentElement("afterend",s),s.insertBefore(t,s.firstChild),Object.values(t.classList).forEach((e=>t.classList.replace(e,`${e}-select`))),this.openDropdown(s),this.clickDropdown(s),this.disableMobileView||this.mobileView(s),this.generateDropdownCallback&&this.generateDropdownCallback(s)}))},this.mobileView=t=>{t.querySelector("select").addEventListener("change",(function(){const e=this.selectedIndex;t.querySelectorAll(".f-dropdown-li").forEach((t=>{parseInt(t.querySelector(".f-dropdown-item").getAttribute("data-index"),10)===e&&t.click()}))}))},this.openDropdown=t=>{t.querySelector("button.f-dropdown-toggle").addEventListener("click",(function(t){if(t.preventDefault(),this.classList.contains("--disabled"))return!1;this.parentNode.classList.toggle("--open"),document.documentElement.classList.toggle("--dropdown-open",this.parentNode.classList.contains("--open"))}))},this.closeDropdown=t=>{document.querySelectorAll(".f-dropdown").forEach((e=>!!e.classList.contains("--open")&&((!t||"click"!==t.type||e===t||!e.contains(t.target))&&(e.classList.remove("--open"),void document.documentElement.classList.remove("--dropdown-open")))))},this.clickDropdown=t=>{if(this.clickDropdownCallback)this.clickDropdownCallback(t);else{const e=this.afterClickDropdownCallback;t.querySelectorAll(".f-dropdown-li").forEach((i=>{i.addEventListener("click",(function(i){i.preventDefault();const n=this.querySelector(".f-dropdown-item"),s=t.querySelectorAll(".f-dropdown-item"),o=n.getAttribute("data-index"),r=n.innerHTML,a=t.querySelector("select"),l=t.querySelector("button.f-dropdown-toggle"),c=l.querySelector(".f-dropdown-button"),u=t.querySelector(".f-dropdown-item.--selected");s.forEach((t=>t.classList.remove("--selected","--prev"))),u.classList.add("--prev"),n.classList.add("--selected"),a.selectedIndex=o,c.innerHTML=r,l.setAttribute("data-indexcurrent",n.getAttribute("data-index")),t.classList.remove("--open"),document.documentElement.classList.remove("--dropdown-open"),e&&e(this)}))}))}},this.destroy=()=>{this.selects.forEach((t=>{const e=t.closest(".f-dropdown");e&&(e.insertAdjacentElement("afterend",t),e.remove(),t.classList.forEach((e=>t.classList.replace(e,e.slice(0,-7)))))}))},this.reInit=()=>{this.destroy(),this.init()},this.init()};function FixedElement(t="element",e="--fixed",i="spacerClass",n="top",s=(()=>{})){const o=this;let r=!1;const a=document.querySelector(t),l={elH:a.getBoundingClientRect().height,elOffset:a.getBoundingClientRect().top+a.ownerDocument.defaultView.pageYOffset};this.revalidate=()=>{l.elH=a.getBoundingClientRect().height;const t=document.querySelector(`.${i}`);l.elOffset=t?t.getBoundingClientRect().top+t.ownerDocument.defaultView.pageYOffset:a.getBoundingClientRect().top+a.ownerDocument.defaultView.pageYOffset,r=!0},this.modifyElement=()=>{("top"===n?window.scrollY>l.elOffset:"bottom"===n?window.scrollY-l.elH+window.screen.height<l.elOffset:void 0)?!a.classList.contains(e)&&(a.classList.add(e),(t=>{let e=document.createElement("div");e.className=i,e.style.paddingTop=`${t}px`,a.after(e)})(l.elH),s(!0)):a.classList.contains(e)&&(a.classList.remove(e),(()=>{const t=document.querySelector(`.${i}`);t&&t.parentNode.removeChild(t)})(),s(!1))},this.init=()=>{if(null===a)return!1;window.addEventListener("scroll",(()=>{r=!0})),scroll=setInterval((function(){r&&(r=!1,o.modifyElement())}),30),o.modifyElement()},this.clear=()=>{clearInterval(scroll)}}app_shop.fn.changeLiteral=(t,e,i)=>{const n=t%10,s=t%100,o=[];return!0!==i&&o.push(t),1===t&&e[1]?o.push(e[1]):(0===t||n>=0&&n<=1||n>=5&&n<=9||s>10&&s<20)&&e[0]?o.push(e[0]):(s<10||s>20)&&n>=2&&n<=4&&e[2]&&o.push(e[2]),o.join(" ")},Modal=function(t){const e=this;if(this.params=t||{},this.viewportElement=document.querySelector('head meta[name="viewport"]'),this.viewportContentCopy=app_shop.vars?.meta?.viewportContent,this.txt={"Zamknij modal":"Zamknij modal"},this.changeViewport=()=>{const{viewportContent:t}=this.params;if(!this.viewportElement&&!this.changeViewportFlag)return;const e="string"==typeof t&&t||"user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width, viewport-fit=cover";this.viewportElement.setAttribute("content",e)},this.restoreViewport=()=>{(this.viewportElement||this.changeViewportFlag)&&this.viewportContentCopy&&this.viewportElement.setAttribute("content",this.viewportContentCopy)},this.closeModal=()=>{const t=document.getElementById("modal");this.beforeClose&&this.beforeClose(t);const e=document.getElementById("modal_placeholder");if(e){const i=t.querySelector(".modal__content > *");e.insertAdjacentElement("afterend",i),e.parentNode.removeChild(e)}t.parentNode.removeChild(t),document.documentElement.classList.remove("--modal"),document.removeEventListener("click",this.events.eventDelegation,!0),document.removeEventListener("keydown",this.events.escClick),this.enableTabIndexes&&document.removeEventListener("keyup",this.events.tabFocusClick),this.afterClose&&this.afterClose(t,this),this.changeViewportFlag&&this.restoreViewport()},this.createElement=t=>{const{element:e,classes:i,id:n,href:s,attributes:o}=t,r=document.createElement(e);return void 0!==i&&(r.className=i),void 0!==n&&(r.id=n),void 0!==s&&(r.href=s),void 0!==o&&Array.isArray(o)&&o.forEach((({name:t,value:e})=>{r.setAttribute(t,e)})),r},this.injectionElement=(t,e)=>{if(this.element||this.html)if(this.html)t.innerHTML=this.html;else if(this.element&&(!("function"==typeof jQuery&&this.element instanceof jQuery)||this.element.length)){if("function"==typeof jQuery&&this.element instanceof jQuery)return document.body.contains(this.element[0])&&this.element[0].insertAdjacentElement("afterend",e),void t.appendChild(this.element[0]);document.body.contains(this.element)&&this.element.insertAdjacentElement("afterend",e),t.appendChild(this.element)}},this.createModal=()=>{document.getElementById("modal")&&this.closeModal();const t=this.createElement({element:"div",classes:this.classList?`modal ${this.classList}`:"modal",id:"modal",attributes:[{name:"role",value:"dialog"}]}),e=this.createElement({element:"div",classes:"modal__wrapper"}),i=this.createElement({element:"div",id:"modal_placeholder"}),n=this.createElement({element:"a",classes:"modal__close",href:"#modalClose",attributes:[{name:"aria-label",value:this.txt["Zamknij modal"]}]}),s=this.createElement({element:"div",classes:"modal__content"});this.injectionElement(s,i),e.appendChild(n),e.appendChild(s),t.appendChild(e),document.documentElement.classList.add("--modal"),this.initEvents(),this.changeViewportFlag&&this.restoreViewport(),this.changeViewportFlag&&this.changeViewport(),this.beforeShow&&this.beforeShow(t,this),document.body.appendChild(t),this.classList&&this.classList.includes("--absolute")&&window.scrollTo(0,0),app_shop?.vars?.bLazy?.revalidate(),this.afterShow&&this.afterShow(t,this),this.enableTabIndexes&&(this.assignTabIndexes(),this.setFocusOnFirstElement&&this.focusFirstElement())},this.assignTabIndexes=()=>{const t=document.querySelector('#modal[role="dialog"]');if(!t)return;let e=1;const i=t=>{t.matches(this.allowedElementsForTabIndex)&&t.setAttribute("tabindex",e++),[...t.children].forEach((t=>{i(t)}))};i(t)},this.focusFirstElement=(t=!1)=>{const e=document.querySelector('#modal[role="dialog"]');e&&(t?e.querySelector("[tabindex]")?.focus?.():e.querySelector("[tabindex]:not(.modal__close)")?.focus?.())},this.getFocusableElements=()=>{const t=document.querySelector('#modal[role="dialog"]');return t?[...t.querySelectorAll("[tabindex]")]:[]},this.restoreModalFocus=(t=(()=>{}),i=!1)=>{const n=e.getFocusableElements(),s=document.activeElement;n.includes(s)||(t(),e.focusFirstElement(i))},this.events={eventDelegation:t=>{const i=document.getElementById("modal"),n=!(!document.getElementById("topLayerBackDrop")||"none"===document.getElementById("topLayerBackDrop").style.display),s=!(!document.querySelector(".iai_cookie")||document.querySelector(".iai_cookie").classList.contains("d-none"));for(const e of this.notCloseSelectors)if(t.target.closest(e))return!1;const o=document.activeElement.closest(".cop_pickup_map__wrapper");return(!i||i.querySelector(".modal__wrapper").contains(t.target)||n||s||"INPUT"===document.activeElement.tagName||o)&&!t.target.closest(".modal__close")||(t.preventDefault(),e.closeModal()),!1},escClick:t=>{"Escape"===t.key&&e.closeModal()},onFocus:t=>{e.restoreModalFocus((()=>{t.preventDefault()}))},tabFocusClick:t=>{const{key:i}=t,n="Tab"===i,s="ArrowLeft"===i,o="ArrowRight"===i;if(e.enableTabIndexes&&(n||s||o)){const i=e.getFocusableElements(),n=document.activeElement;e.restoreModalFocus((()=>{t.preventDefault()}),!0),(s||o)&&i.forEach(((t,e,i)=>{if(t===n){if(s){const t=e>=1?e-1:i.length-1;i[t]?.focus?.()}if(o){const t=e<=i.length-2?e+1:0;i[t]?.focus?.()}}}))}}},this.initEvents=()=>{document.removeEventListener("click",this.events.eventDelegation,!0),document.addEventListener("click",this.events.eventDelegation,!0),document.removeEventListener("keydown",this.events.escClick),document.addEventListener("keydown",this.events.escClick),this.enableTabIndexes&&(document.removeEventListener("keyup",this.events.tabFocusClick),document.addEventListener("keyup",this.events.tabFocusClick))},this.init=()=>{const{element:t,html:e,classList:i,beforeShow:n,afterShow:s,beforeClose:o,afterClose:r,notCloseSelectors:a,changeViewport:l,enableTabIndexes:c,setFocusOnFirstElement:u,allowedElementsForTabIndex:h}=this.params;this.element=t||!1,this.html=e||!1,this.beforeShow=n||!1,this.afterShow=s||!1,this.beforeClose=o||!1,this.afterClose=r||!1,this.classList=i||!1,this.notCloseSelectors=a||[],this.changeViewportFlag=l??!0,this.enableTabIndexes=c??!0,this.setFocusOnFirstElement=u??!1,this.allowedElementsForTabIndex=h??"a, button",this.createModal()},!this.params.notInit)return this.init()},app_shop.run((function(){document.querySelectorAll("form:not(.is-validated)").forEach((t=>{t.addEventListener("submit",(t=>{t.target.classList.add("--submitting"),t.target.addEventListener("submit",(t=>(t.preventDefault(),!1)))}))}))}),"all","form"),app_shop.run((function(){document.querySelectorAll("[data-change-literal-days]").forEach((t=>{const e=+t.getAttribute("data-change-literal-days");t.textContent=app_shop.fn.changeLiteral(e,["dni","dzień","dni"],!1)}))}),"all","[data-change-literal-days]",!0),app_shop.run((function(){document.querySelectorAll("[data-change-literal-days-up-to]").forEach((t=>{const e=+t.getAttribute("data-change-literal-days-up-to");t.textContent=app_shop.fn.changeLiteral(e,["dni","dnia","dni"],!1)}))}),"all","[data-change-literal-days-up-to]",!0),app_shop.run((function(){document.addEventListener("click",(t=>{const{target:e}=t;if(e.closest(".l_welcome__element.--logout")||e.closest(".logout_link"))for(let t=0;t<sessionStorage.length;){const e=sessionStorage.key(t);e.startsWith("expchck")?sessionStorage.removeItem(e):t+=1}}))}),"all",".l_welcome__element.--logout, .logout_link"),RegionForced=function(t){this.params=t||{},this.txt={label:"Twój wybrany kraj dostawy to ",labelZipcode:"Twój wybrany region dostawy to ",currency:"Ceny wyświetlane w walucie: ",timeAndCosts:"Czasy i koszty dostawy wyświetlane dla kraju: ",timeAndCostsZipcode:"Czasy i koszty dostawy wyświetlane dla regionu: ",andRegion:" i regionu: ",continue:"Kontynuuj",restoreDefault:"Przywróć domyślny kraj dostawy: ",restoreDefaultZipcode:"Przywróć domyślny region dostawy: "},this.events={unsetRegion:t=>(t.preventDefault(),this.unsetTemporaryRegion(),!1),unsetZipcode:t=>(t.preventDefault(),this.unsetTemporaryZipcode(),!1),unsetRegionAndZipcode:t=>(t.preventDefault(),this.unsetTemporaryRegionAndZipcode(),!1),continue:t=>(t.preventDefault(),this.modifyCookie(),this.modal.closeModal(),!1)},this.queries={unsetRegion:()=>JSON.stringify({query:"mutation {\n        unsetTemporaryRegion {\n          status\n          error {\n            code\n            message\n          }\n        }\n      }"}),unsetZipcode:()=>JSON.stringify({query:"mutation {\n        unsetTemporaryZipcode {\n          status\n          error {\n            code\n            message\n          }\n        }\n      }"}),unsetRegionAndZipcode:()=>JSON.stringify({query:"mutation {\n        unsetTemporaryRegion {\n          status\n          error {\n            code\n            message\n          }\n        }\n        unsetTemporaryZipcode {\n          status\n          error {\n            code\n            message\n          }\n        }\n      }"})},this.fetchData=async(t={})=>{const{data:e,link:i,linkParameter:n=""}=t;if(!e)return!1;try{const t=await fetch(`${i||app_shop.urls.graphql||"/graphql/v1"}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:e});return await t.json()}catch(t){return!1}},this.unsetTemporaryRegion=async()=>{const t=document.querySelector(".modal");t&&t.classList.add("--loading");const e=await this.fetchData({data:this.queries.unsetRegion(),linkParameter:"?mutation=unsetRegion"}),{status:i}=e?.data?.unsetTemporaryRegion;t&&t.classList.add("--remove"),"success"===i&&(document.cookie="setRegionForced=; path=/; Max-Age=-99999999;",window.location.reload())},this.unsetTemporaryZipcode=async()=>{const t=document.querySelector(".modal");t&&t.classList.add("--loading");const e=await this.fetchData({data:this.queries.unsetZipcode(),linkParameter:"?mutation=unsetZipcode"}),{status:i}=e?.data?.unsetTemporaryZipcode;t&&t.classList.add("--remove"),"success"===i&&(document.cookie="setZipcodeForced=; path=/; Max-Age=-99999999;",window.location.reload())},this.unsetTemporaryRegionAndZipcode=async()=>{const t=document.querySelector(".modal");t&&t.classList.add("--loading");const e=await this.fetchData({data:this.queries.unsetRegionAndZipcode(),linkParameter:"?mutation=unsetRegionAndZipcode"}),{status:i}=e?.data?.unsetTemporaryRegion;t&&t.classList.add("--remove"),"success"===i&&(document.cookie="setRegionForced=; path=/; Max-Age=-99999999;",document.cookie="setZipcodeForced=; path=/; Max-Age=-99999999;",window.location.reload())},this.getCookieByName=t=>{const e=`; ${document.cookie}`.split(`; ${t}=`);return 2===e.length&&e.pop().split(";").shift()},this.create=({currentCountry:t,defaultCountry:e,currentZipcode:i,defaultZipcode:n})=>{const s=!t&&i,o=!s&&i,r=document.createElement("div");r.classList.add("region_forced"),r.innerHTML=`<div class="region_forced__label">\n      <span class="region_forced__label_text">${s?this.txt.labelZipcode:this.txt.label}</span>\n      <strong class="region_forced__label_value">${s?i:t}</strong>\n    </div>\n    <div class="region_forced__body">\n      <div class="region_forced__item --currency">\n        <span classs="region_forced__item_text">${this.txt.currency}</span>\n        <strong class="region_forced__item_value">${app_shop?.vars?.currency?.id}</strong>\n      </div>\n      <div class="region_forced__item --delivery">\n        <span classs="region_forced__item_text">${s?this.txt.timeAndCostsZipcode:this.txt.timeAndCosts}</span>\n        <strong class="region_forced__item_value">${s?i:t}</strong>\n        ${o?`<span class="region_forced__and_region">${this.txt.andRegion}<strong>${i}</strong></span>`:""}\n      </div>\n    </div>\n    <div class="region_forced__buttons">\n      <button class="region_forced__continue btn --solid --large" type="button">${this.txt.continue}</button>\n      <a href="#unsetTemporaryRegion" class="region_forced__unset">${s?this.txt.restoreDefaultZipcode:this.txt.restoreDefault}<strong>${s?n:e}</strong></a>\n    </div>`,this.modal=new Modal({element:r,classList:"--region-forced"});let a="region";s&&(a="zipcode"),o&&(a="regionAndZipcode"),this.initEvents({type:a})},this.modifyCookie=()=>{const t=this.getCookieByName("setRegionForced"),e=this.getCookieByName("setZipcodeForced"),i=JSON.parse(t),n=JSON.parse(e);i&&(i.showModal=!1,document.cookie=`setRegionForced=${JSON.stringify(i)}; path=/;`),n&&(n.showModal=!1,document.cookie=`setZipcodeForced=${JSON.stringify(n)}; path=/;`)},this.initEvents=({type:t})=>{const e=document.querySelector(".region_forced__unset");e&&("region"===t&&e.addEventListener("click",this.events.unsetRegion),"zipcode"===t&&e.addEventListener("click",this.events.unsetZipcode),"regionAndZipcode"===t&&e.addEventListener("click",this.events.unsetRegionAndZipcode));const i=document.querySelector(".region_forced__continue");i&&i.addEventListener("click",this.events.continue)},this.init=()=>{const t=this.getCookieByName("setRegionForced"),e=this.getCookieByName("setZipcodeForced");if(!t&&!e)return;const i=JSON.parse(t),n=JSON.parse(e),{currentCountry:s,defaultCountry:o,showModal:r}=i||{},{currentZipcode:a,defaultZipcode:l,showModal:c}=n||{};(r||c)&&this.create({currentCountry:s,defaultCountry:o,currentZipcode:a,defaultZipcode:l})}},app_shop.fn.regionForced=new RegionForced,app_shop.run((function(){app_shop.fn.regionForced.init()}),"all","#container:not(.place-order_page):not(.prepaid_page)"),app_shop.txt||(app_shop.txt={}),app_shop.txt.errorCode||(app_shop.txt.errorCode={}),app_shop.txt.errorCode.birth_date="Wpisz poprawną datę urodzenia w formacie RRRR-MM-DD",app_shop.txt.errorCode.illegal_characters_client_city="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_firm="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_firstname="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_lastname="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_nip="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_phone="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_phone2="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_client_street="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_additional="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_city="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_firstname="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_lastname="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_phone="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.illegal_characters_delivery_street="Jeden z użytych znaków jest niedozwolony.",app_shop.txt.errorCode.incorect_delivery_region="Wybierz kraj odbiorcy przesyłki.",app_shop.txt.errorCode.incorect_delivery_zipcode="Wpisz kod pocztowy odbiorcy przesyłki.",app_shop.txt.errorCode.incorect_email="Błędnie wpisany e-mail. Wpisz pełny adres e-mail, np. jan@kowalski.com",app_shop.txt.errorCode.incorect_invoice_phone="Wpisz telefon klienta.",app_shop.txt.errorCode.incorect_invoice_zipcode="Wpisz kod pocztowy klienta.",app_shop.txt.errorCode.incorect_login="Błędnie wpisany login. Login musi mieć minimum 3, a maksimum 40 znaków. Możesz użyć liter i cyfr oraz symboli @ . - _.",app_shop.txt.errorCode.incorect_nip="Błędnie wpisany NIP.",app_shop.txt.errorCode.incorect_phone="Wpisz swój telefon.",app_shop.txt.errorCode.incorect_shops="Wybierz sklep z listy.",app_shop.txt.errorCode.incorect_zipcode="Błędnie wpisany kod pocztowy.",app_shop.txt.errorCode.incorrect_region="Błędnie wybrany region.",app_shop.txt.errorCode.invalid_format="Nieprawidłowy format. Pole musi zawierać przynajmniej jedną literę.",app_shop.txt.errorCode.login_equals_password="Hasło jest takie samo jak login. Wpisz inne hasło.",app_shop.txt.errorCode.login_taken="Podany login jest już zajęty.",app_shop.txt.errorCode.login_taken_login_propose="Podany login jest już zajęty.<br/><br/>Proponowany login: ",app_shop.txt.errorCode.no_city="Wpisz w to pole nazwę miasta.",app_shop.txt.errorCode.no_delivery_city="Wpisz miejscowość odbiorcy przesyłki.",app_shop.txt.errorCode.no_delivery_firstname="Wpisz imię odbiorcy przesyłki.",app_shop.txt.errorCode.no_delivery_lastname="Wpisz nazwisko odbiorcy przesyłki.",app_shop.txt.errorCode.no_delivery_street="Wpisz ulicę i numer domu odbiorcy przesyłki.",app_shop.txt.errorCode.no_firmname="Błędnie wpisana nazwa firmy.",app_shop.txt.errorCode.no_firstname="Wpisz w to pole swoje imię.",app_shop.txt.errorCode.no_invoice_city="Wpisz miejscowość klienta.",app_shop.txt.errorCode.no_invoice_firmname="Wpisz nazwę firmy klienta.",app_shop.txt.errorCode.no_invoice_firstname="Wpisz imię klienta.",app_shop.txt.errorCode.no_invoice_lastname="Wpisz nazwisko klienta.",app_shop.txt.errorCode.no_invoice_street="Wpisz ulicę i numer domu klienta.",app_shop.txt.errorCode.no_invoice_street_number="Wpisz ulicę i numer domu klienta.",app_shop.txt.errorCode.no_login="Wpisz w to pole swój login.",app_shop.txt.errorCode.no_name="Wpisz w to pole swoje nazwisko.",app_shop.txt.errorCode.no_password="Wpisz w to pole swoje hasło.",app_shop.txt.errorCode.no_street="Wpisz nazwę ulicy lub miejscowości.",app_shop.txt.errorCode.no_street_number="Podaj nr domu.",app_shop.txt.errorCode.no_street_number_uk="Brakuje numeru domu.",app_shop.txt.errorCode.not_equal_passwords="Wpisane hasła nie są takie same. Wpisz ponownie hasło i potwierdzenie.",app_shop.txt.errorCode.password_to_long="Za długie hasło. Wpisz krótsze hasło (maksimum.",app_shop.txt.errorCode.password_to_short="Zbyt krótkie hasło. Wpisz dłuższe hasło (minimum.",app_shop.txt.errorCode.used_login="Podany login jest już zajęty.",app_shop.txt.errorCode.incorrect_iban="Format numeru konta bankowego jest niepoprawny",app_shop.txt.formValidation||(app_shop.txt.formValidation={}),app_shop.txt.formValidation.mandatoryField="Proszę wypełnić to pole.",app_shop.txt.formValidation.zipcodeFormat="Poprawne formaty kodu pocztowego dla wybranego kraju to [X - cyfra; Y - litera]:",app_shop.txt.formValidation.characters="znaków).",app_shop.txt.formValidation.minimalCharacters="Minimalna liczba znaków dla tego pola to ",app_shop.txt.formValidation.maximumCharacters="Maksymalna liczba znaków dla tego pola to ",app_shop.txt.formValidation.noOptionSelected="Proszę wybrać opcję.";const omnibusDetailsTxt={"Najniższa cena produktu w okresie 30 dni przed wprowadzeniem obniżki":"Najniższa cena z 30 dni przed obniżką","Cena regularna":"Cena regularna","Cena bez kodu":"Cena bez kodu","Cena nadchodząca od":"Cena nadchodząca od",Promocja:"Promocja",Okazja:"Okazja","Kod rabatowy":"Kod rabatowy"};function Bars(){this.calculatePosition=(t,e)=>t.reduce(((t,i,n)=>n<e?t+i.offsetHeight:t),0),this.setPosition=()=>{const t=[...document.querySelectorAll(".bars_top .bars__item[data-fixed]")];t.forEach(((e,i)=>{e.style.setProperty("--position",this.calculatePosition(t,i))}));const e=[...document.querySelectorAll(".bars_bottom .bars__item[data-fixed]")].reverse();e.forEach(((t,i)=>{t.style.setProperty("--position",this.calculatePosition(e,i))}))},this.fixed=()=>{const t=document.querySelectorAll(".bars__item[data-fixed]");let e=0,i=0;t.forEach((t=>{const n=+getComputedStyle(t).getPropertyValue("--position"),s=t.getBoundingClientRect().top-n,o=t.getBoundingClientRect().bottom+n-window.innerHeight;s<0||o>=0?(t.style.setProperty("min-height",`${t.offsetHeight}px`),t.classList.add("--fixed"),t.closest(".bars_top")?e+=t.offsetHeight:i+=t.offsetHeight):(t.classList.remove("--fixed"),t.style.removeProperty("min-height"))})),document.documentElement.style.setProperty("--top-fixed-bars-height",`${e}px`),document.documentElement.style.setProperty("--bottom-fixed-bars-height",`${i}px`)},this.closeBarClick=t=>{const{target:e}=t;if(e.closest(".bars__close")){t.preventDefault();const i=e.closest(".bars__item");i.parentNode.removeChild(i),this.saveClosing(i),this.reset()}},this.removeClosedBars=()=>{(JSON.parse(localStorage.getItem("closedBars"))||[]).forEach((t=>{const e=document.getElementById(t);e&&e.parentNode.removeChild(e)})),this.checkEmptyBars()},this.checkEmptyBars=()=>{const t=document.querySelector(".bars_top");0===t?.childNodes.length&&t.parentNode.removeChild(t);const e=document.querySelector(".bars_bottom");0===e?.childNodes.length&&e.parentNode.removeChild(e)},this.saveClosing=t=>{const{id:e}=t,i=JSON.parse(localStorage.getItem("closedBars"))||[];i.push(e),localStorage.setItem("closedBars",JSON.stringify(i))},this.setBarsHeight=()=>{if(document.documentElement.classList.contains("--scroll-down"))return!1;const t=document.querySelector(".bars_top")?.offsetHeight;return document.documentElement.style.setProperty("--bars-height",`${t}px`),!0},this.clearAll=()=>{document.querySelectorAll(".bars__item[data-fixed]").forEach((t=>{t.classList.remove("--fixed"),t.style.removeProperty("--position"),t.style.removeProperty("min-height")}))},this.destroy=()=>{document.removeEventListener("scroll",this.fixed),document.removeEventListener("click",this.closeBarClick),window.removeEventListener("resize",this.setBarsHeight),this.clearAll()},this.reset=()=>{this.destroy(),this.init()},this.init=()=>{this.removeClosedBars(),document.addEventListener("click",this.closeBarClick),app_shop.vars.view<3&&(this.setBarsHeight(),window.addEventListener("resize",this.setBarsHeight)),app_shop.vars.view>2&&(this.setPosition(),this.fixed(),document.addEventListener("scroll",this.fixed))}}app_shop.fn.getOmnibusDetails=t=>{const{productData:e,sizeId:i,priceType:n=app_shop.vars.priceType}=t||{};if(!e)return!1;const s=e.sizes.find((t=>t.id===i))||e;if(!s?.price)return!1;const o={add:[],remove:["--omnibus","--omnibus-short","--omnibus-code","--omnibus-code-short","--omnibus-new-price","--omnibus-higher"]},r={},a=s.price?.omnibusPriceDetails?.unit?.[n]?.formatted||s.price.omnibusPrice[n]?.formatted;if(!a)return{classes:o};o.add.push("--omnibus"),o.remove=o.remove.filter((t=>"--omnibus"!==t));const l=e?.unit?.sellBy,c=!(!s?.price?.unit?.[n]?.formatted||!s.price.max?.[n]?.value)&&format_price(parseFloat(s.price.max?.[n]?.value)*parseFloat(l),{mask:app_shop.vars.currency_format,currency:app_shop.vars?.currency?.symbol,currency_space:app_shop.vars.currency_space,currency_before_price:app_shop.vars.currency_before_value})||s.price.max?.[n]?.formatted;c&&c!==a||(o.add.push("--omnibus-short"),o.remove=o.remove.filter((t=>"--omnibus-short"!==t))),app_shop.vars.omnibus?.rebateCodeActivate&&s.price?.rebateCodeActive&&(o.add.push("--omnibus-code"),r.rebateCodeActive=`<span class="label --code --omnibus">${omnibusDetailsTxt?.["Kod rabatowy"]}</span>`,o.remove=o.remove.filter((t=>"--omnibus-code"!==t)));const u=s.price.beforeRebateDetails?.unit?.[n]?.formatted||s.price.beforeRebate[n]?.formatted;app_shop.vars.omnibus?.rebateCodeActivate&&u===a&&s.price?.rebateCodeActive&&(o.add.push("--omnibus-code-short"),o.remove=o.remove.filter((t=>"--omnibus-code-short"!==t)));const h=s.price.omnibusPriceDetails?.newPriceEffectiveUntil?.formatted;h&&c&&(o.add.push("--omnibus-new-price"),o.remove=o.remove.filter((t=>"--omnibus-new-price"!==t)));const d=s.price.omnibusPriceDetails?.omnibusPriceIsHigherThanSellingPrice;d&&(o.add.push("--omnibus-higher"),o.remove=o.remove.filter((t=>"--omnibus-higher"!==t))),d&&!h||r?.rebateCodeActive||(r.bargain=`<span class="label --bargain --omnibus">${omnibusDetailsTxt?.Okazja}</span>`),0===Object.keys(r)?.length&&(r.bargain=`<span class="label --promo --omnibus">${omnibusDetailsTxt?.Promocja}</span>`);let p="";d?p="-":0!==s.price.omnibusPriceDetails?.youSavePercent&&(p="+");const _=`${p}${s.price.omnibusPriceDetails?.youSavePercent}%`,m={price:a,visible:!0,percent:_,html:`<span class="omnibus_price__text">${omnibusDetailsTxt["Najniższa cena produktu w okresie 30 dni przed wprowadzeniem obniżki"]}: </span><del class="omnibus_price__value">${a}</del><span class="price_percent">${_}</span>`},f=c?{max:{price:c,visible:!0,percent:`-${s.price.youSavePercent}%`,html:`<span class="omnibus_label">${omnibusDetailsTxt["Cena regularna"]}: </span>\n        <del>${c}</del><span class="price_percent">-${s.price.youSavePercent}%</span>`}}:{},g=u?{beforeRebate:{price:u,visible:!!o.add.includes("--omnibus-code"),percent:`-${s.price.beforeRebateDetails?.youSavePercent}%`,html:`<span class="omnibus_label">${omnibusDetailsTxt["Cena bez kodu"]}: </span>\n        <del>${u}</del>\n        <span class="price_percent">-${s.price.beforeRebateDetails?.youSavePercent}%</span>`}}:{},y=h?{newPriceEffectiveUntil:{date:h,price:c,visible:!!o.add.includes("--omnibus-new-price"),html:`<span class="omnibus_label">${omnibusDetailsTxt["Cena nadchodząca od"]} </span>\n        <span class="new_price__date">${h}: </span>\n        <span class="new_price__value">${c}</span>`}}:{};return{classes:o,omnibus:m,...f,...g,...y,...{omnibusLabel:{name:Object.keys(r)?.[0]||"",html:r[Object.keys(r)?.[0]]}}}},app_shop.run((()=>{let t=!1;const e={"Przejdź do zawartości strony":"Przejdź do zawartości strony","Przejdź do wyszukiwarki":"Przejdź do wyszukiwarki"},i=`<div class="buttons tabfocus__buttons">\n    <button class="btn --outline --medium" id="tabFocusModalMainContent">${e["Przejdź do zawartości strony"]}</button>\n    <button class="btn --outline --medium" id="tabFocusModalSearch">${e["Przejdź do wyszukiwarki"]}</button>\n  </div>`,n=e=>{t=void 0!==e?e:!t},s=(t,e)=>{n(!0),t.querySelector("#tabFocusModalMainContent")?.addEventListener("click",(t=>{e.closeModal(),setTimeout((()=>{[...document.querySelectorAll("#layout [tabindex]")].find((t=>t.checkVisibility()))?.focus?.(),n(!1)}),100)})),t.querySelector("#tabFocusModalSearch")?.addEventListener("click",(()=>{e.closeModal(),setTimeout((()=>{document.querySelector(".menu_search__input")?.focus?.(),n(!1)}),100)}))};let o=0;document.addEventListener("keyup",(e=>{app_shop.vars.view<3||document.documentElement.classList.contains("touch")||"Tab"===e.key&&!1===t&&o++<1&&new Modal({classList:"--tab-focus",html:i,afterShow:s,setFocusOnFirstElement:!0})}))}),"all",".main_page"),app_shop.run((function(){app_shop.fn.bars=new Bars,app_shop.fn.bars.init()}),"all","html:not(.order_process)"),app_shop.run((function(){app_shop.fn.bars.reset()}),[1,2,3,4],"html:not(.order_process)"),app_shop.run((()=>{const t=document.getElementById("rabateCode");if(!t)return void document.documentElement.classList.remove("--rabateCode");if(app_shop.fn.cookie.get("rabateCode_clicked"))return t.remove(),void document.documentElement.classList.remove("--rabateCode");document.documentElement.classList.add("--rabateCode");const e=document.querySelector("#rabateCode .rabateCode__close");e&&e.addEventListener("click",(e=>{e.preventDefault(),app_shop.fn.cookie.set("rabateCode_clicked",!0,1),t.remove(),document.documentElement.classList.remove("--rabateCode")}))}),"all",".--rabateCode"),app_shop.run((()=>{const t=document.getElementById("freeShipping");if(!t)return void document.documentElement.classList.remove("--freeShipping");if(app_shop.fn.cookie.get("freeeshipping_clicked"))return t.remove(),void document.documentElement.classList.remove("--freeShipping");document.documentElement.classList.add("--freeShipping");const e=document.querySelector("#freeShipping .freeShipping__close");e&&e.addEventListener("click",(e=>{e.preventDefault(),app_shop.fn.cookie.set("freeeshipping_clicked",!0,1),t.remove(),document.documentElement.classList.remove("--freeShipping")}))}),"all",".--freeShipping"),app_shop.run((function(){app_shop.fn.searchResults=new SearchResults({resultsLimit:6,inputLengthToStartSearching:2})}),"all","#menu_search");const searchTxt={categories:"Kategorie",cms:"Informacje",beforeProducer:"Producent: ",beforeSeries:"Seria: ",separator:" / ",buttonAllText:"Pokaż wszystkie",telPrice:"Cena na telefon"};SearchResults=function(t){const e=this;return this.params=t||{},this.vars={typingTimer:"",doneTypingInterval:500,searchResultQuery:"/graphql/v1/"},this.fetchData=async()=>{const t=this.searchInput.value;if(t.length<this.inputLengthToStartSearching)return!1;if(sessionStorage.getItem(`search_${t}`))return JSON.parse(sessionStorage.getItem(`search_${t}`));const e=JSON.stringify({query:`query {\n        productsTextSearch(searchInput: {\n            text: "${t}",\n            limit: ${this.resultsLimit}\n          }) {\n            products {\n              name, link, iconSmall, iconSmallSecond,\n              price {\n                  price {\n                      gross {\n                        value\n                        formatted\n                      }\n                      net {\n                        value\n                        formatted\n                      }\n                  }\n              }\n            }\n            series {\n                name, link\n            }\n            producers {\n                name, link\n            }\n            menuNodes {\n                name, link\n            }\n            cms {\n                name, link\n            }\n            searchQueries {\n                name, link\n            }\n          }\n        }`});try{const i=await fetch(this.vars.searchResultQuery,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:e}),n=(await i.json()).data.productsTextSearch;return sessionStorage.setItem(`search_${t}`,JSON.stringify(n)),n}catch(t){return!1}},this.openResults=()=>{this.searchInput.closest("form").classList.add("--open"),this.resultsWrapper.scrollTop=0,document.documentElement.classList.add("--results-open"),document.querySelector("#container.main_page")&&document.documentElement.classList.add("--results-main-open")},this.closeResults=()=>{this.searchInput.closest("form").classList.remove("--open"),document.documentElement.classList.remove("--results-open"),document.querySelector("#container.main_page")&&document.documentElement.classList.remove("--results-main-open")},this.buildResult=async()=>{this.searchInput.closest("form").classList.add("--loading");const t=await this.fetchData();if(this.searchInput.closest("form").classList.remove("--loading"),this.resultsWrapper.innerHTML="",t){if(!Object.values(t).filter((t=>t?t.length:"")).length)return this.closeResults(),!1;if(this.openResults(),t.searchQueries&&t.searchQueries.length){const e=this.searchInput.value,i=new RegExp(e,"i");this.resultsWrapper.innerHTML+=`\n          <div class="search_result__block --queries">\n            ${t.searchQueries.map((t=>`<a class="search_result__item --query" href="${t.link}">${t.name.replace(i,"<b>$&</b>")}</a>`)).join("")}\n          </div>\n        `}Object.keys(t).filter((t=>"searchQueries"!==t)).some((e=>t[e]?t[e].length:""))&&(this.resultsWrapper.innerHTML+='<div class="search_result__block --others"></div>',t.products&&t.products.length&&(this.resultsWrapper.querySelector(".search_result__block.--others").innerHTML+=`\n            <div class="search_result__sub --products">\n              ${t.products.map((t=>`\n                <a class="search_result__item --product" href="${t.link}">\n                  <span class="search_result__icon">${void 0!==t.iconSmallSecond?`<picture>\n                      <source type="image/webp" srcset="${t.iconSmall}"/>\n                      <img src="${t.iconSmallSecond}" alt="${t.name}">\n                    </picture>`:`<img src="${t.iconSmall}" alt="${t.name}" />`}</span>\n                  <span class="search_result__name_wrapper">\n                    <span class="search_result__name">${t.name}</span>\n                    <span class="search_result__price">${e.netPrice?0!==t.price.price.net.value?t.price.price.net.formatted:searchTxt.telPrice:0!==t.price.price.gross.value?t.price.price.gross.formatted:searchTxt.telPrice}</span>\n                  </span>\n                </a>\n              `)).join("")}\n              <button type="submit" class="search_result__item --button-all${e.buttonAllClass}">${searchTxt.buttonAllText}</button>\n            </div>\n          `),(t.producers&&t.producers.length||t.series&&t.series.length||t.menuNodes&&t.menuNodes.length)&&(this.resultsWrapper.querySelector(".search_result__block.--others").innerHTML+=`\n            <div class="search_result__sub --categories">\n              <strong class="search_result__label">${searchTxt.categories}</strong>\n              <div class="search_result__items">\n                ${t.producers?t.producers.map((t=>`\n                  <a class="search_result__item --producer" href="${t.link}">\n                    <span class="search_result__name_label">${searchTxt.beforeProducer}</span><span class="search_result__name">${t.name}</span>\n                  </a>\n                `)).join(""):""}\n\n                ${t.series?t.series.map((t=>`\n                  <a class="search_result__item --series" href="${t.link}">\n                    <span class="search_result__name_label">${searchTxt.beforeSeries}</span><span class="search_result__name">${t.name}</span>\n                  </a>\n                `)).join(""):""}\n\n                ${t.menuNodes?t.menuNodes.map((t=>`\n                  <a class="search_result__item --menu" href="${t.link}">\n                    <span class="search_result__name">${t.bc?t.bc.item.map((t=>t.title)).join(searchTxt.separator):t.name}</span>\n                  </a>\n                `)).join(""):""}\n              </div>\n            </div>\n          `),t.cms&&t.cms.length&&(this.resultsWrapper.querySelector(".search_result__block.--others").innerHTML+=`\n            <div class="search_result__sub --cms">\n              <strong class="search_result__label">${searchTxt.cms}</strong>\n              <div class="search_result__items">\n                ${t.cms.map((t=>`\n                  <a class="search_result__item --cms" href="${t.link}">\n                    <span class="search_result__name">${t.name}</span>\n                  </a>\n                `)).join("")}\n              </div>\n            </div>\n          `))}else this.closeResults();return this.afterBuildResult&&this.afterBuildResult(t),!0},this.updateSearchInput=()=>{const t=e.resultsWrapper.querySelector(".search_result__item.--active .search_result__name")?e.resultsWrapper.querySelector(".search_result__item.--active .search_result__name").textContent:e.resultsWrapper.querySelector(".search_result__item.--active").textContent;e.searchInput.value=t},this.updateFocusElement=t=>{this.resultsWrapper.querySelectorAll(".search_result__item").forEach((t=>t.classList.remove("--active"))),"null"!=typeof t&&t.classList.add("--active"),"null"!=typeof t&&t.focus(),this.updateSearchInput()},this.initEvents=()=>{const t=document.getElementById("menu_search");t&&t.addEventListener("submit",(function(){const t=e.searchInput.getAttribute("data-value");t&&(e.searchInput.value=t)})),this.searchInput.addEventListener("keyup",(function(t){const i=t.which||t.keyCode||0;37!==i&&38!==i&&39!==i&&40!==i&&(e.searchInput.setAttribute("data-value",this.value),clearTimeout(e.vars.typingTimer),e.vars.typingTimer=setTimeout(e.buildResult,e.vars.doneTypingInterval),document.querySelector("html._mobile:not(.sidebar_open):not(.--search-open) .main_page")&&window.scrollTo(0,0))})),this.searchInput.addEventListener("keydown",(function(t){const i=t.which||t.keyCode||0;return 37===i||38===i||39===i||40===i||(e.searchInput.setAttribute("data-value",this.value),clearTimeout(e.vars.typingTimer),e.searchInput.closest("form").classList.add("--focus"),!document.querySelector(".--search-open")||13!==i)||(t.preventDefault(),this.closest("form").submit(),!1)})),this.searchInput.addEventListener("focus",(function(){window.screen.width<768&&!document.documentElement.classList.contains("--search-open")&&!document.documentElement.classList.contains("sidebar_open")&&(document.documentElement.classList.add("--search-open"),document.documentElement.scrollIntoView()),this.closest("form").classList.add("--focus")})),document.addEventListener("scroll",(function(t){window.scrollY>0?document.documentElement.classList.add("--scroll-down"):document.documentElement.classList.contains("sidebar_open")||document.documentElement.classList.contains("filters_open")||document.documentElement.classList.remove("--scroll-down")})),document.querySelector(".search_result, .search_result__block").addEventListener("scroll",(function(){app_shop.vars.view<3&&document.activeElement.blur()})),document.addEventListener("keydown",(function(t){if(e.searchInput.closest("form.--open.--focus")){const i=t.which||t.keyCode||0;if(37===i||38===i||39===i||40===i){t.preventDefault();const n=[...e.resultsWrapper.querySelectorAll(".search_result__item"),e.resultsWrapper.querySelector(".search_result__button_all")],s=e.resultsWrapper.querySelector(".search_result__item.--query"),o=e.resultsWrapper.querySelector(".search_result__block.--others .search_result__item");switch(i){case 40:{const t=n.indexOf(e.resultsWrapper.querySelector(".search_result__item.--active"));t>-1&&n[t+1]?e.updateFocusElement(n[t+1]):e.updateFocusElement(n[0]);break}case 38:{const t=n.indexOf(e.resultsWrapper.querySelector(".search_result__item.--active"));t>-1&&n[t-1]?e.updateFocusElement(n[t-1]):e.updateFocusElement(n[n.length-1]),e.updateSearchInput();break}case 37:1!==app_shop.vars.view&&s&&o&&e.updateFocusElement(s);break;case 39:1!==app_shop.vars.view&&s&&o&&e.updateFocusElement(o);break;default:return!0}}else 13!==i&&e.searchInput.focus();return!1}})),document.addEventListener("click",(function(t){return t.target.closest(".menu_search__mobile")&&(t.preventDefault(),document.documentElement.classList.add("--search-open"),e.searchInput.focus()),t.target.closest(".--search-open .menu_search__submit")&&(t.preventDefault(),document.documentElement.classList.remove("--search-open","--results-main-open")),t.target.closest("header .navbar-toggler")&&document.documentElement.classList.remove("--results-main-open"),e.searchInput.closest("form").classList.contains("--focus")&&!e.searchInput.closest("form").contains(t.target)&&e.searchInput.closest("form").classList.remove("--focus"),!1}))},this.init=()=>{const{searchInput:t,resultsWrapper:e,resultsLimit:i,inputLengthToStartSearching:n,afterBuildResult:s,buttonAllClass:o}=this.params;this.searchInput=t?document.querySelector(t):document.querySelector(".menu_search__input"),this.resultsWrapper=e?document.querySelector(e):document.querySelector(".search_result"),this.resultsLimit=i||"",this.inputLengthToStartSearching=n||4,this.netPrice="net"===app_shop.vars.priceType,this.afterBuildResult=s||!1,this.buttonAllClass=o||" btn --outline",this.initEvents()},this.init()},app_shop.run((()=>{app_shop.fn.selectPaging=new SelectToDropdown({selector:"#menu_settings  select.form-control:not(.f-dropdown)",generateDropdownCallback:t=>{t.classList.remove("form-control")}});const t=document.querySelector("#menu_settings form");if(!t)return;const e=document.querySelector("#menu_settings .open_trigger");e&&e.addEventListener("click",(()=>{t.classList.toggle("active")}))}),"all","#menu_settings");const DefaultShoppingList=function(){return this.vars={firstListName:"Lista zakupowa"},this.queries={addList:()=>JSON.stringify({query:`mutation {\n        shoppingListCreate(ShoppingListSettingsInput: {\n          name: "${this.vars.firstListName}",\n        }) {\n          status\n          id\n        }\n      }`})},this.fetchData=async t=>{try{const e=await fetch("/graphql/v1/?query=createShoppingList",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:t});await app_shop.graphql.trackingEvents(e);return await e.json()}catch(t){return!1}},this.createList=async()=>{await this.fetchData(this.queries.addList())},this.initEvents=()=>{document.addEventListener("click",(async t=>{const{target:e}=t;e.closest(".slt_link.--empty, .slt_lists__nav_link.--empty, .slm_lists__nav_link.--empty")&&(t.preventDefault(),await this.createList(),window.location.href=e.closest("[href]")?.href)}))},this.initEvents()};app_shop.run((function(){app_shop.fn.defaultShoppingList=new DefaultShoppingList}),"all",".slt_link.--empty, .slt_lists__nav_link.--empty, .slm_lists__nav_link.--empty"),app_shop.fn.customBasket=t=>`\n  <div class="topBasket__row">\n    <a class="topBasket__item --photo" href="${t.link}">\n      ${void 0!==t.icon_second?`<picture>\n          <source type="image/webp" srcset="${t.icon}"/>\n          <img src="${t.icon_second}" alt="${t.name}">\n        </picture>`:`<img src="${t.icon}" alt="${t.name}">`}\n    </a>\n    <a class="topBasket__item --name" href="${t.link}">\n      <span class="topBasket__name">${t.name}</span>\n      ${"uniw"!==t.size?`<span class="topBasket__size">${t.size_name}</span>`:""}\n      ${t.product_version_name?`<span class="topBasket__version">${t.product_version_name}</span>`:""}\n    </a>\n    <span class="topBasket__item --sum">\n      <span class="value">${t.count}</span>\n      <span class="unit">${t.worth_unit}</span>\n    </span>\n    <span class="topBasket__item --prices">${"net"===app_shop.vars.priceType?t.prices.worth_net_formatted:t.prices.worth_gros_formatted}</span>\n  </div>\n`,app_shop.fn.menu_basket_cache=function(){const t=document.getElementById("menu_basket");if(!t)return;iaiGet?.data?.Basket&&iaiGet.reInit?iaiGet.reInit(["Basket"]):iaiGet.basket((e=>{t.classList.remove("--skeleton");const{Basket:{response:{basket:i}={}}={}}=e||{};if(!i)return;app_shop.vars.basket=i;const{products:n=[],user:s={}}=i;app_shop.vars.user=s,t.classList.toggle("--hide",!n.length||n.length>22),t.classList.toggle("--list",n.length>10);const o=t.querySelector(".topBasket__price");if(o){const{worth_net_formatted:t,worth_formatted:e}=i;o.innerHTML="net"===app_shop.vars.priceType?t:e}const r=t.querySelector(".badge");if(r){const{productsCounter:t=0}=i;r.innerHTML=t>0?t:""}const a=t.querySelector("#shipppingCost");if(a){const{shippingCost_net_formatted:t,shippingCost_formatted:e}=i;a.innerHTML="net"===app_shop.vars.priceType?t:e}const l=document.getElementById("freeShipping");if(l){const{toShippingFree:t}=i;l.classList.toggle("--active",0==+t)}if(!n.length)return void("function"==typeof app_shop.fn.afterBasketCallback&&app_shop.fn.afterBasketCallback(i));let c="";n.forEach((t=>{c+=app_shop.fn.customBasket(t)}));const u=t.querySelector(".topBasket__block.--products");u&&(u.innerHTML=c);const h=n.find((t=>""===t.name||"0"!==t.subscription_period));t.classList.toggle("--oneclick-hide",!!h);document.querySelectorAll(".topBasket__details").forEach((t=>{t.removeAttribute("style")})),"function"==typeof app_shop.fn.afterBasketCallback&&app_shop.fn.afterBasketCallback(i)}))};const menu_basket_cache=app_shop.fn.menu_basket_cache;app_shop.run((()=>{app_shop.fn.menu_basket_cache()}),"all","#menu_basket");var submenuWidth="200",dlmenu_showmore="1",dlmenu_shownumber="10",dlmenu_columnHeight="320",dlmenu_columnConcat="1",dlmenu_padding="30",dlmenu_columns="5",dlmenu_wide="true";app_shop.fn.isTouchEnabled=()=>!window.matchMedia("(pointer:fine)").matches,document.documentElement.classList.toggle("no-touch",!app_shop.fn.isTouchEnabled()),document.documentElement.classList.toggle("touch",app_shop.fn.isTouchEnabled()),app_shop.fn.checkOverflow=()=>{if(document.querySelectorAll(".nvabar-nav .--overflow").forEach((t=>t.classList.remove("--overflow"))),app_shop.vars.view<3)return;const t=document.documentElement.clientWidth;document.querySelectorAll(".navbar-nav > .nav-item").forEach((e=>{const i=t-e.getBoundingClientRect().left+window.scrollX;if(i<parseInt(submenuWidth,10)&&e.classList.add("--overflow"),i<2*parseInt(submenuWidth,10)){const t=e.querySelector(".navbar-subnav");if(!t)return;t.classList.add("--overflow")}}))},app_shop.fn.desktopTouchMenu=t=>{const{target:e}=t,i=e.closest(".nav-link");if(!i)return;const n=i.nextElementSibling;if(!n)return;document.querySelectorAll(".nav-item ul").forEach((t=>{t!==n&&t.classList.remove("active")}));document.querySelector("#menu_categories.wide")&&!n.classList.contains("navbar-subnav")||n.classList.contains("active")||(dlmenu_wide&&(app_shop.fn.concatColumns(n),app_shop.fn.setPositionMenu(n)),n.classList.add("active"),t.preventDefault())},app_shop.fn.mobileMenuNav=t=>{const{target:e}=t;if(app_shop.vars.view>2&&e.closest(".noevent"))return;const i=e.closest(".nav-link");if(!i)return;if(!i.nextElementSibling)return;const n=i.closest(".nav-item");n&&(t.preventDefault(),n.classList.toggle("nav-open"))},app_shop.fn.mobileMenuBack=t=>{t.preventDefault();const{target:e}=t,i=e.closest(".nav-open");i&&i.classList.remove("nav-open")},app_shop.fn.moveSearchToAsideMenu=()=>{const t=document.getElementById("menu_search");if(!t)return;const e=document.querySelector('aside .setMobileGrid[data-item="#menu_navbar"]');if(!e)return;if(document.documentElement.classList.contains("sidebar_open")){const i=document.createElement("del");return i.classList.add("handler"),i.dataset.item="#menu_search",i.style.display="none",t.before(i),void e.before(t)}const i=document.querySelector('header .handler[data-item="#menu_search"]');i&&(i.before(t),i.remove())},app_shop.fn.showHideAsideMenu=()=>{document.documentElement.classList.contains("filters_open")||document.documentElement.classList.toggle("sidebar_open"),document.documentElement.classList.remove("filters_open"),app_shop.fn.setMobileCategories?.(),app_shop.fn.moveSearchToAsideMenu(),document.querySelectorAll(".nav-open").forEach((t=>t.classList.remove("nav-open")))},app_shop.fn.extendNavItems=t=>{t.preventDefault();const{target:e}=t,i=e.closest(".nav-link");if(!i)return;const n=i.textContent;i.textContent=i.getAttribute("txt_alt"),i.setAttribute("txt_alt",n);const s=i.closest("ul");s?.classList.toggle("show");const o=i.closest(".navbar-subnav");o?.classList.add("active")},app_shop.fn.concatColumns=t=>{if(!dlmenu_columnConcat)return;let e=document.createElement("li");e.classList.add("nav-item","nav-merge");let i=parseInt(dlmenu_columnHeight,10);t.querySelectorAll("& > .nav-item").forEach((t=>{const{nextElementSibling:n}=t,s=t.offsetHeight,o=n?.offsetHeight;if(t.classList.contains("--all")&&(i=0),s<i&&o+s<i)return t.after(e),e.append(t),void(i-=s);s<i&&(t.after(e),e.append(t),i=parseInt(dlmenu_columnHeight,10),e=document.createElement("li"),e.classList.add("nav-item","nav-merge"))}))},app_shop.fn.setPositionMenu=t=>{const e=document.querySelector("#menu_categories");if(!e)return;const i=e.offsetWidth-dlmenu_padding,n=t.querySelectorAll("& > .nav-item:not(.--all)").length;if(t.classList.add(`--cols${n}`),n<dlmenu_columns&&window.screen.width>=1200||n<dlmenu_columns-1&&window.screen.width<1200){const e=t.offsetWidth,{offsetLeft:n}=t.parentElement,s=n<0?0:n,o=i-(e+s);let r=s- -1*o;r=o>0?s:r,t.style.setProperty("left",`${r}px`)}},app_shop.run((()=>{document.addEventListener("click",(t=>{const{target:e}=t;e.closest(".navbar-toggler")?app_shop.fn.showHideAsideMenu():e.closest("aside .navbar-collapse .nav-link")?app_shop.fn.mobileMenuNav(t):e.closest("aside .nav-header__backLink")?app_shop.fn.mobileMenuBack(t):e.closest("#menu_categories .nav-item.--extend")?app_shop.fn.extendNavItems(t):!document.documentElement.classList.contains("sidebar_open")&&!document.documentElement.classList.contains("filters_open")||e.closest("aside")?!e.classList.contains("nav-link")&&document.querySelector("html.touch")&&document.querySelectorAll(".nav-item ul").forEach((function(t){t.classList.remove("active")})):app_shop.fn.showHideAsideMenu()}));const t=app_shop?.vars?.isIos?"touchstart":"click";document.addEventListener(t,(t=>{const{target:e}=t;e.closest(".touch header .navbar-collapse .nav-link")&&app_shop.fn.desktopTouchMenu(t)})),document.querySelectorAll(".navbar-subnav").forEach((t=>{t.addEventListener("mouseover",(()=>{document.querySelectorAll(".navbar-subnav").forEach((t=>{t.classList.remove("active")}))}))})),dlmenu_wide&&document.querySelectorAll(".no-touch .navbar-nav > .nav-item > .nav-link").forEach((t=>{t.addEventListener("mouseover",(t=>{const{target:e}=t,{nextElementSibling:i}=e,{visited:n}=e.dataset;i&&i?.classList.contains("navbar-subnav")&&(n||(app_shop.fn.concatColumns(i),app_shop.fn.setPositionMenu(i)),e.dataset.visited=!0)}))}))}),"all","#menu_categories"),app_shop.run((()=>{app_shop.vars.view>2&&(document.documentElement.classList.remove("sidebar_open","filters_open"),app_shop.fn.moveSearchToAsideMenu()),dlmenu_wide||app_shop.fn.checkOverflow()}),[1,2,3,4],"#menu_categories"),app_shop.run((function(){document.querySelectorAll("#menu_categories .nav-gfx.nav-hover").forEach((t=>{t.addEventListener("mouseover",(()=>{const e=`${t.offsetHeight}px`;t.style.width=`${t.offsetWidth}px`,t.style.height=e,t.classList.add("--hover")})),t.closest(".nav-item")?.addEventListener?.("mouseleave",(()=>{t.style.width="",t.style.height="",t.classList.remove("--hover")}))}))}),"all","#menu_categories .nav-gfx.nav-hover"),app_shop.run((function(){document.querySelectorAll("#menu_categories .nav-gfx.nav-hover").forEach((t=>{t.style.width="",t.style.height=""}))}),[1,2,3,4],"#menu_categories .nav-gfx.nav-hover"),app_shop.run((()=>{const t=document.querySelector(".slm_lists");if(!t)return;document.querySelectorAll(".slm_lists__label").forEach((e=>{e.addEventListener("click",(()=>{t.classList.toggle("--active")}))}))}),"all",".slm_lists__label");const excludeFromMove=["#menu_contact"];function simple_tooltip(t,e,i){return this.tipHandle="",this.pushSelectors=()=>{app_shop.vars.simpleTooltipOptions.push({targetItems:t,tooltipId:e,onLeft:i})},this.getTooltipOptions=t=>app_shop.vars.simpleTooltipOptions.find((e=>t.closest(e.targetItems))),this.getTooltipContent=(t,e)=>{if(!t.closest(e))return!1;const i=t.closest(e);if(i.nextElementSibling?.classList.contains("tooltipContent"))return i.nextElementSibling.innerHTML.trim();if(i.title){const{title:t}=i;return i.dataset.title=t,i.removeAttribute("title"),t.trim()}return!!i.dataset.title&&i.dataset.title.trim()},this.createTooltip=(t,e)=>{document.getElementById(t)&&document.getElementById(t).remove();const i=document.createElement("div");return i.style.display="block",i.className=t,i.id=t,i.innerHTML=`<p>${e}</p>`,i.addEventListener("mouseenter",(()=>clearTimeout(this.tipHandle))),i.addEventListener("mouseleave",(()=>i.remove())),document.body.appendChild(i),i},this.setTooltipPosition=(t,e)=>{const n=window.scrollY,s=window.innerWidth,o=15;let r=0,a=0;i||!1?(r=t.pageX-e.offsetWidth-o<=0?t.pageX+o:t.pageX-o-e.offsetWidth,a=n+30>=t.pageY-e.offsetHeight?n+o:t.pageY-e.offsetHeight-o):(r=s-30>=e.offsetWidth+t.pageX?t.pageX+o:s-e.offsetWidth-o,a=n+30>=t.pageY-e.offsetHeight?n+o:t.pageY-e.offsetHeight-o),e.style.left=`${r}px`,e.style.top=`${a}px`},this.onMouseMove=t=>{const{target:e}=t,i=this.getTooltipOptions(e);if(!i)return;const n=this.getTooltipContent(e,i.targetItems);if(!n)return;const s=this.createTooltip(i.tooltipId,n);this.setTooltipPosition(t,s)},this.onMouseOut=t=>{const{target:e}=t,i=this.getTooltipOptions(e);if(!i)return;const n=document.getElementById(i.tooltipId);n&&(this.tipHandle=setTimeout((()=>{n.remove()}),500))},this.onTouchStart=t=>{const{target:e}=t;this.getTooltipOptions(e)||app_shop.vars.simpleTooltipOptions.forEach((t=>{const i=document.getElementById(t.tooltipId);i&&(e.closest(`#${t.tooltipId}`)||i.remove())}))},this.initEvents=()=>{document.documentElement.classList.contains("--tooltip-initiated")||(document.documentElement.classList.add("--tooltip-initiated"),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseout",this.onMouseOut),document.addEventListener("touchstart",this.onTouchStart))},this.init=()=>{this.pushSelectors(),this.initEvents()},this.init()}function calculate_instalments(params){let{minPrice:minPrice,maxPrice:maxPrice,totalPrice:totalPrice,link:link,instalmentName:instalmentName,priceType:priceType}=params;"object"!=typeof params&&null!==params&&([minPrice,maxPrice,totalPrice,,link,,instalmentName,,priceType]=arguments),minPrice=parseFloat(minPrice,10)||!1;const minPriceFormat=!!minPrice&&`${format_price(minPrice,{mask:app_shop.vars.currency_format,currency:instalmentData.currency,currency_space:app_shop.vars.currency_space,currency_before_price:app_shop.vars.currency_before_value})}${priceType&&"net"===priceType?app_shop.txt.instalmentNet:""}`;maxPrice=parseFloat(maxPrice,10)||!1;const maxPriceFormat=!!maxPrice&&`${format_price(maxPrice,{mask:app_shop.vars.currency_format,currency:instalmentData.currency,currency_space:app_shop.vars.currency_space,currency_before_price:app_shop.vars.currency_before_value})}${priceType&&"net"===priceType?app_shop.txt.instalmentNet:""}`;totalPrice=parseFloat(totalPrice,10)||!1,link=link||!1,instalmentName=instalmentName||!1,priceType=priceType||!1;let productsPrice="";productsPrice=priceType&&"net"===priceType?document.getElementById("projector_number")?instalmentData.priceNet*document.getElementById("projector_number").value:instalmentData.priceNet:document.getElementById("projector_number")?instalmentData.price*document.getElementById("projector_number").value:instalmentData.price;const productsPriceFormat=`${format_price(productsPrice,{mask:app_shop.vars.currency_format,currency:instalmentData.currency,currency_space:app_shop.vars.currency_space,currency_before_price:app_shop.vars.currency_before_value})}${priceType&&"net"===priceType?app_shop.txt.instalmentNet:""}`;if(link&&-1!==link.indexOf("{calculate_price}")&&(link=link.replace("{calculate_price}","XXX")),0===productsPrice)return eval(link),!1;if(0===instalmentData.basketCount&&(!minPrice&&!maxPrice||minPrice&&productsPrice>=minPrice&&maxPrice&&productsPrice<=maxPrice))return eval(link.replace("XXX",productsPrice)),!1;let infoHTML="";minPrice&&productsPrice<minPrice?infoHTML=`\n      <div class='menu_messages_message'>\n        <div class='menu_messages_message_sub'>\n          <p>${app_shop.txt.instalmentLabelMin}${instalmentName}${app_shop.txt.instalmentLabelTo}${minPriceFormat}</p>\n        </div>\n      </div>\n    `:maxPrice&&productsPrice>maxPrice&&(infoHTML=`\n      <div class='menu_messages_message'>\n        <div class='menu_messages_message_sub'>\n          <p>${app_shop.txt.instalmentLabelMax}${instalmentName}${app_shop.txt.instalmentLabelTo}${maxPriceFormat}</p>\n        </div>\n      </div>\n    `);let sumPrice=0;sumPrice=totalPrice?(totalPrice+productsPrice).toFixed(2):((priceType&&"net"===priceType?instalmentData.basketCostNet:instalmentData.basketCost)+productsPrice).toFixed(2);const sumPriceFormat=`${format_price(sumPrice,{mask:app_shop.vars.currency_format,currency:instalmentData.currency,currency_space:app_shop.vars.currency_space,currency_before_price:app_shop.vars.currency_before_value})}${priceType&&"net"===priceType?app_shop.txt.instalmentNet:""}`;let buttonHTML="";if(document.querySelector("#container.projector_page")&&(buttonHTML=`\n      <button class="instalment_calculator__button ${minPrice&&productsPrice<minPrice||maxPrice&&productsPrice>maxPrice?app_shop.txt.instalmentButtonDisableClassDialog:app_shop.txt.instalmentButtonClassDialog}"${minPrice&&productsPrice<minPrice||maxPrice&&productsPrice>maxPrice?"":` onclick="${link.replace("XXX",productsPrice)}"`}>\n        <span class="instalment_calculator__button_txt">${app_shop.txt.instalmentSingleProduct}</span>\n        <span class="instalment_calculator__button_price">${productsPriceFormat}</span>\n        ${minPrice&&productsPrice<minPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMin}</span>`:""}\n        ${maxPrice&&productsPrice>maxPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMax}</span>`:""}\n      </button>\n    `,0!==instalmentData.basketCount&&(buttonHTML+=`\n        <button class="instalment_calculator__button ${minPrice&&sumPrice<minPrice||maxPrice&&sumPrice>maxPrice?app_shop.txt.instalmentButtonDisableClassDialog:app_shop.txt.instalmentButtonClassDialog}"${minPrice&&sumPrice<minPrice||maxPrice&&sumPrice>maxPrice?"":` onclick="${link.replace("XXX",sumPrice)}"`}>\n          <span class="instalment_calculator__button_txt">${app_shop.txt.instalmentBasketProduct}</span>\n          <span class="instalment_calculator__button_price">${sumPriceFormat}</span>\n          ${minPrice&&sumPrice<minPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMinBasket}</span>`:""}\n          ${maxPrice&&sumPrice>maxPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMaxBasket}</span>`:""}\n        </button>\n      `)),document.querySelector("#container.basketedit_page")){if(minPrice&&productsPrice>=minPrice&&maxPrice&&productsPrice<=maxPrice)return eval(link.replace("XXX",productsPrice)),!1;buttonHTML=`\n      <button class="instalment_calculator__button ${minPrice&&productsPrice<minPrice||maxPrice&&productsPrice>maxPrice?app_shop.txt.instalmentButtonDisableClassDialog:app_shop.txt.instalmentButtonClassDialog}"${minPrice&&productsPrice<minPrice||maxPrice&&productsPrice>maxPrice?"":` onclick="${link.replace("XXX",productsPrice)}"`}>\n        <span class="instalment_calculator__button_txt">${app_shop.txt.instalmentMultiProduct}</span>\n        <span class="instalment_calculator__button_price">${productsPriceFormat}</span>\n        ${minPrice&&productsPrice<minPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMinB}</span>`:""}\n        ${maxPrice&&productsPrice>maxPrice?`<span class="instalment_calculator__button_info">${app_shop.txt.instalmentTextMaxB}</span>`:""}\n      </button>\n    `}Modal({html:infoHTML+buttonHTML,classList:"instalment_calculator"})}app_shop.fn.setGrid=()=>{switch(app_shop.vars.view){case 4:case 3:document.querySelectorAll(".domHandler").forEach((t=>{const e=t.dataset.item,i=document.querySelector(e);i&&(excludeFromMove.includes(e)?i.classList.contains("--clone")&&i.remove():t.after(i),t.remove())}));break;case 2:case 1:if(document.querySelector(".domHandler"))return;document.querySelectorAll(".setMobileGrid").forEach((t=>{const e=t.dataset.item,i=document.querySelector(e);if(!i||t.querySelectorAll(e).length>0)return;const n=document.createElement("del");if(n.classList.add("domHandler"),n.dataset.item=e,n.style.display="none",i.before(n),excludeFromMove.includes(e)){const e=i.cloneNode(!0);e.classList.add("--clone"),t.append(e)}else t.append(i)}))}},app_shop.fn.setMobileCategories=function(){const t=document.querySelector("#mobileCategories");t&&(t.classList.contains("--inited")||(t.classList.add("--inited"),(()=>{const t=document.querySelector("#mobileCategories");document.querySelector("aside")?.prepend(t),t.addEventListener("click",(t=>{const{target:e}=t;e.closest(".mobileCategories__link")&&(t.preventDefault(),(()=>{const t=document.querySelector("aside");document.querySelectorAll(".mobileCategories__link").forEach((e=>{e.classList.remove("--active"),t?.querySelectorAll(e.dataset.ids.split(",")).forEach((t=>{t.style.display="none",t.classList.remove("--active")}))}))})(),(t=>{const e=document.querySelector("aside");t.classList.add("--active"),e?.querySelectorAll(t.dataset.ids.split(",")).forEach((t=>{t.style.display="",t.classList.add("--active")}))})(e.closest(".mobileCategories__link")))}))})()),t.querySelector(".mobileCategories__link")?.click())},app_shop.run((()=>{document.querySelectorAll('.footer_links_sub a[data-gfx-enabled="true"]').forEach((t=>{t.addEventListener("mouseover",(t=>{const e=t.target.closest('a[data-gfx-enabled="true"]').querySelector("img");if(!e)return;const{onmouseover:i}=e.dataset;i&&(e.dataset.tmp=e.src,e.src=i)})),t.addEventListener("mouseout",(t=>{const e=t.target.closest('a[data-gfx-enabled="true"]').querySelector("img");if(!e)return;const{tmp:i}=e.dataset;i&&(e.src=i,delete e.dataset.tmp)}))}))}),"all",'.footer_links_sub a[data-gfx-enabled="true"]'),app_shop.run((()=>{document.querySelectorAll(".footer_tab__header").forEach((t=>{t.addEventListener("click",(e=>{if("true"===t.getAttribute("data-hide-arrow"))return;const i=t.getAttribute("aria-controls"),n=document.getElementById(i),s="true"===t.getAttribute("aria-expanded");app_shop.vars.view<2&&(e.preventDefault(),t.setAttribute("aria-expanded",!s),t.setAttribute("data-previous-state",!s),n.setAttribute("aria-hidden",s))}))}))}),"all",".footer_tab__header, .footer_links_sub"),app_shop.run((()=>{document.querySelectorAll("#footer_links [aria-hidden]").forEach((t=>{if(1===app_shop.vars.view&&!t.hasAttribute("data-previous-state")){const e=t.getAttribute("aria-hidden");t.setAttribute("data-previous-state",e)}const e=t.getAttribute("data-previous-state");t.setAttribute("aria-hidden",e??!1)}))}),[1,2,3,4],".footer_tab__header, .footer_links_sub"),app_shop.run((()=>{const t=document.querySelector("#manageCookies");t?.addEventListener("click",(()=>{"function"==typeof prepareCookiesConfiguration&&prepareCookiesConfiguration()}))}),"all","#manageCookies"),app_shop.run((()=>{simple_tooltip(".showTip","n59581_tooltip_dictionary"),simple_tooltip("#contentcolumn_order1 .showTip_order1","n59581_tooltip"),simple_tooltip("#basketedit_gifts .showTip_gift","n59581_tooltip"),simple_tooltip("#basketedit_productslist .showTip_basket","n59581_tooltip"),simple_tooltip("span.btn_note","n59581_instalment_note")}),"all","body"),app_shop.vars.simpleTooltipOptions=[],app_shop.txt.instalmentLabel="",app_shop.txt.instalmentSingleProduct="Oblicz raty tylko dla tego produktu",app_shop.txt.instalmentMultiProduct="Oblicz raty produktów w koszyku",app_shop.txt.instalmentBasketProduct="Oblicz raty łącznie z wartością koszyka",app_shop.txt.instalmentNoTall="Nie wszystkie umieszczone w koszyku produkty umożliwią zakup tym systemem ratalnym. Przejdź do szczegółów każdego z produktów aby dowiedzieć się które z nich umożliwiają taki zakup. Jeżeli zdecydujesz się na zakup na raty, opłata za te produkty będzie musiała być wniesiona odrębnie pozostałymi sposobami płatności.",app_shop.txt.instalmentTooMany="W koszyku znajduje się zbyt duża ilość produktów aby móc opłacić zamówienie tym systemem ratalnym. Zmniejsz ilość produktów do ",app_shop.txt.instalmentTooMany2=" aby móc skorzystać z systemu rat. Ilość sztuk jednego produktu nie jest limitowana.",app_shop.txt.instalmentLabelTo=" to ",app_shop.txt.instalmentLabelMinBasket="Nie możesz uruchomić symulacji rat dla całego koszyka, ponieważ minimalna kwota umożliwiająca zakupy przez ",app_shop.txt.instalmentTextMin="Zwiększ ilość sztuk produktu, aby uruchomić kalkulator rat.",app_shop.txt.instalmentTextMinBasket="Zwiększ ilość sztuk tego produktu, lub wrzuć do koszyka dodatkowe produkty.",app_shop.txt.instalmentTextMinB="Zwiększ ilość produktów w koszyku, aby uruchomić kalkulator rat.",app_shop.txt.instalmentLabelMax="Maksymalna kwota umożliwiająca zakupy przez ",app_shop.txt.instalmentLabelMaxBasket="Nie możesz uruchomić symulacji rat dla całego koszyka, ponieważ maksymalna kwota umożliwiająca zakupy przez ",app_shop.txt.instalmentTextMax="Zmniejsz ilość sztuk produktu, aby uruchomić kalkulator rat.",app_shop.txt.instalmentTextMaxBasket="Zmniejsz ilość sztuk tego produktu, lub usuń z koszyka niektóre produkty.",app_shop.txt.instalmentTextMaxB="Zmniejsz ilość produktów w koszyku, aby uruchomić kalkulator rat.",app_shop.txt.instalmentLabelMin="Minimalna kwota umożliwiająca zakupy przez ",app_shop.txt.instalmentButtonClassDialog="btn --solid --medium",app_shop.txt.instalmentButtonDisableClassDialog="btn --solid --secondary --medium --disabled",app_shop.txt.instalmentNet=" netto",app_shop.run((function(){Modal({element:document.getElementById("menu_notice")})}),"all","#menu_notice"),app_shop.run((()=>{iaiGet.snippets((t=>{const{Snippets:{response:{items:e={}}={}}={}}=t||{};e&&Object.values(e).forEach((t=>{const{region:e,content:i}=t||{};if(!e||!i)return;const n=document.createElement("div");n.innerHTML=i;const s=[...n.childNodes];switch(e){case"head":s.forEach((t=>{if("SCRIPT"===t.tagName){const e=document.createElement("script");e.text=t.innerHTML,document.head.append(e)}else document.head.append(t)}));break;case"body_top":s.forEach((t=>{if("SCRIPT"===t.tagName){const e=document.createElement("script");e.text=t.innerHTML,document.body?.prepend(e)}else document.body?.prepend(t)}));break;default:s.forEach((t=>{if("SCRIPT"===t.tagName){const e=document.createElement("script");e.text=t.innerHTML,document.body?.append(e)}else document.body?.append(t)}))}}))}),{mobile:1===app_shop.vars.view,tablet:2===app_shop.vars.view,pc:app_shop.vars.view>2,request_uri:app_shop.vars.requestUri,additional_ajax:app_shop.vars.additionalAjax}),iaiGet.toplayersAndWidgets((t=>{const{ToplayersAndWidgets:{response:{items:e={}}={}}={}}=t||{};e&&Object.entries(e).forEach((([t,e])=>{if("script"===t){const t=document.createElement("script");return t.text=e,void document.body?.append(t)}const{content:i}=e||{};if(!i)return;const n=document.createElement("div");n.innerHTML=i;const s=[...n.getElementsByTagName("script")];s.forEach((t=>t.remove())),document.body?.append(...n.childNodes),s.forEach((t=>{const e=document.createElement("script");t.src?e.src=t.src:e.textContent=t.textContent,document.body?.append(e)}))}))}),{mobile:1===app_shop.vars.view,tablet:2===app_shop.vars.view,pc:app_shop.vars.view>2,request_uri:app_shop.vars.requestUri,additional_ajax:app_shop.vars.additionalAjax})}),"all","body"),appModules.installModule("Slider","/gfx/pol/menu_slider_core.js.gzip?r=1741689590"),app_shop.vars.sliderConfig={debugSlider:app_shop?.vars?.customSliderConfig?.debugSlider??!1,sliderList:[]},app_shop.vars.utils={debugFlag:app_shop.vars.sliderConfig.debugSlider,debug(t,e,...i){if(!app_shop.vars.utils.debugFlag)return;const[,,n,s,...o]=(new Error)?.stack?.match(/(:[\d]+)/gim)??[];if(!n||!s)return;n.replace(":",""),s.replace(":","")}},appModules.installModule("SwiperCore","/gfx/pol/menu_slider_modules_1.js.gzip?r=1741689590"),appModules.installModule("SwiperControlls","/gfx/pol/menu_slider_modules_2.js.gzip?r=1741689590"),appModules.installModule("SwiperEffects","/gfx/pol/menu_slider_modules_3.js.gzip?r=1741689590"),appModules.installModule("SwiperNavigation","/gfx/pol/menu_slider_modules_4.js.gzip?r=1741689590"),appModules.installModule("SwiperUtils","/gfx/pol/menu_slider_modules_5.js.gzip?r=1741689590"),app_shop.fn.imageUtils={brightnessValue:120,throttleFn:t=>{let e=null;return(...i)=>{null===e&&(t(...i),e=setTimeout((()=>{e=null}),250))}},calculatePixelBrightness:(t,e)=>{const[i,n,s]=[t[e],t[e+1],t[e+2]];return.299*i+.587*n+.114*s},computeAverageBrightness:({data:t,pixels:e}={})=>{let i=0;const n=Math.min(e,100);for(let e=0;e<n;e++){const e=4*Math.floor(Math.random()*t.length/4);i+=app_shop.fn.imageUtils.calculatePixelBrightness(t,e)}return i/n},getImageLightness:(t,e)=>{const i=new Image;i.onload=t=>{const i=t.target.width,n=t.target.height,s=document.createElement("canvas");s.width=i,s.height=n;const o=s.getContext("2d");o.drawImage(t.target,0,0);const{data:r}=o.getImageData(0,0,i,n),a=i*n,l=app_shop.fn.imageUtils.computeAverageBrightness({data:r,pixels:a}),{brightnessValue:c}=app_shop.fn.imageUtils;e(l<=c)},i.src=t}},app_shop.fn.getImageLightness=(t,e)=>{const i=new Image;i.onload=t=>{const i=document.createElement("canvas");i.width=t.target.width,i.height=t.target.height;const n=i.getContext("2d");n.drawImage(t.target,0,0);const s=n.getImageData(0,0,i.width,i.height).data;let o=0;for(let t=0,e=s.length;t<e;t+=4){const e=s[t],i=s[t+1],n=s[t+2];o+=Math.floor((e+i+n)/3)}const r=Math.floor(o/(t.target.width*t.target.height));"function"==typeof e&&e(r)},i.src=t};