https://www.evo-ag.de/_assets/fa5d75f93fd301e76fbd9a7276a24d9e/JavaScript/evo.3382.d1efc1a24a022c.js
1"use strict";(self.webpackChunkevo=self.webpackChunkevo||[]).push([[3382],{3382(t,e,i){i.r(e),i.d(e,{default:()=>h});var s=i(4692),a=i.n(s),o=i(663),n=i(4346),c=i(5468),r=i(7187);const h=class{constructor(){const t=".bb-heat-availability-check:not(.bb-heat-availability-check-v2)";this._$component=a()(t),this._$componentContainer=a()(t).find(".bb-heat-availability-check__container"),this._$addressInputField=this._$component.find("#address-input"),this._type=this._$componentContainer.data("type"),this._isInKostenrechner=this._$component.parent().hasClass("heat-availability-check"),this._checkPv="pv"===this._type,this._checkHeatpump="heatpump"===this._type,this._checkContract="contract"===this._type,this._placeIds=[],this._placeData={},this._availableZips=[];this._trackingData={category:{pv:"PV Anlagen Verfügbarkeitscheck",heatpump:"Wärmepumpen Verfügbarkeitscheck",heating:"Fernwärme Verfügbarkeitscheck",contract:"Fernwärme Wartungsverträge Verfügbarkeitscheck"}[this._type],event:{pv:"pva_verfuegbarkeit",heatpump:"heatpump_verfuegbarkeit",heating:"fw_verfuegbarkeit",contract:"fww_verfuegbarkeit"}[this._type]},this._googleSessionToken=null,this._googleSuggetionList=[],a()(window).on("resize",this._onResize.bind(this)),a()(document.body).on("blur",t+" #address-input",this._onInputChange.bind(this)),a()(document.body).on("keydown",t+" #address-input",this._onInputKeydown.bind(this)),a()(document.body).on("click",t+" .bb-button.form__submit",t=>{if(0===Object.keys(this._placeData).length&&""!==this._$addressInputField.val()){t.preventDefault(),t.stopImmediatePropagation();const e=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13});this._$addressInputField[0].dispatchEvent(e),this._$component.find(".form__submit").attr("disabled",!0),window.setTimeout(()=>{this._onStepStartSubmit(t)},150)}}),a()(document.body).on("submit",t+" .content-check form",this._onStepStartSubmit.bind(this)),a()(document.body).on("click",t+" .change-address a",this._onChangeAddressClick.bind(this)),a()(document.body).on("click",t+" .close",this._onChangeAddressClick.bind(this)),a()(document.body).on("onFormSubmit",t+" .form-success form",()=>{window.setTimeout(this._onResize.bind(this),100),window.setTimeout(this._onResize.bind(this),350)}),a()(document.body).on("onFormSubmit",t+" .form-element form",t=>{if(!t.isValid)return;(0,n.sx)(this._trackingData.category,"Abgeschickt - "+this._trackingData.availability,this._trackingData.address),(0,n.mO)(this._trackingData.event,"action","Abgeschickt","status",this._trackingData.availability,"address",this._trackingData.address),this._isInKostenrechner&&((0,n.sx)("Ãbergabestation Preisrechner","Verfügbarkeitscheck abgeschickt",this._$component.find('form input[data-id="buildingType-0"]:checked, form input[data-id="buildingType-1"]:checked').val()),(0,n.mO)("uebergabestation_preisrechner","action","Verfügbarkeitscheck abgeschickt","building",this._$component.find('form input[data-id="buildingType-0"]:checked, form input[data-id="buildingType-1"]:checked').val()))}),this._initGoogleMaps(),this._checkPv?this._loadPvJson():this._checkHeatpump?this._loadHeatpumpJson():this._checkContract?this._loadContractJson():this._loadPlaceIdJson()}async _initGoogleMaps(){try{await(0,c.S)(o.A.map.key),await this._initAutocomplete()}catch(t){}}async _initAutocomplete(){const t=(0,r.sg)(async t=>{await this._fetchSuggestions(t).then(()=>{this._createSuggestionDropdown()})},250);this._$component.find('input[name="address-input"]').on("input",async e=>{await t(e.currentTarget.value)});const e=this._$component.find('input[name="address-input"]');this._enableAddressInputEnterKey(e[0])}async _fetchSuggestions(t){if(!t)return this._googleSessionToken=null,void(this._googleSuggetionList=[]);const{AutocompleteSessionToken:e,AutocompleteSuggestion:i}=await google.maps.importLibrary("places");this._googleSessionToken||(this._googleSessionToken=new e);const s=new google.maps.Circle({center:{lat:50.10061,lng:8.76647},radius:4e3}),{suggestions:a}=await i.fetchAutocompleteSuggestions({input:t,language:"de",sessionToken:this._googleSessionToken,includedPrimaryTypes:["street_address","route","premise","subpremise"],includedReg
1ionCodes:["DE"],locationBias:s.getBounds()});this._googleSuggetionList=a.map(t=>{const e=t.placePrediction;return{prediction:e,placeId:e.placeId,name:e.text?.text,types:e.types}})}_createSuggestionDropdown(){const t=this._$component.find(".mdc__autocomplete");if(!this._googleSuggetionList.length)return void t.hide();let e="";this._googleSuggetionList.map(t=>{e+=`<li class="mdc-list-item" data-place-id="${t.placeId}" data-place-name="${t.name}" role="option" tabindex="-1">${t.name}</li>`}),""!==e&&(t.find(".mdc-list").html(e),t.show()),this._$component.find(".mdc__autocomplete li").on("click",t=>{this._onSuggestionSelect(t)})}async _onSuggestionSelect(t){const e=a()(t.currentTarget),i=e.data("place-id"),s=e.data("place-name"),o=this._googleSuggetionList.find(t=>t.placeId===i).prediction.toPlace();if(await o.fetchFields({fields:["formattedAddress","addressComponents"]}),this._$component.find('input[name="address-input"]').val(e.text()),o.addressComponents){let t="",i="",a="",n="";if(o.addressComponents.forEach(e=>{const s=e.types,o=e.longText;s.includes("street_number")?t=o:s.includes("route")?i=o:s.includes("locality")?n=o:s.includes("postal_code")&&(a=o)}),""===t){const e=(0,r.sY)(s);e&&e?.houseNumber&&(t=e?.houseNumber)}""===t||""===i||""===a||""===n?(this._showAddressInputError(),this._placeData={}):(this._$component.find(".selected-address").text(i+" "+t+", "+a+" "+n),this._$component.find('input[data-id="address"]').val(i+","+t+","+a+","+n),this._trackingData.address=i+", "+a+" "+n,this._placeData={placeId:i+" "+t+","+a+" "+n,zip:a},e.closest(".mdc-list").find(".mdc-list-item").removeClass("mdc-list-item--selected"),e.addClass("mdc-list-item--selected"))}}_enableAddressInputEnterKey(t){const e=t.addEventListener;t.addEventListener=(i,s)=>{if("keydown"===i){const e=s;s=i=>{const s=document.getElementsByClassName("mdc-list-item--selected").length;if(("Enter"===i.key||"Tab"===i.key)&&!s){const i=new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40});e.apply(t,[i])}e.apply(t,[i])}}e.apply(t,[i,s])}}_loadPlaceIdJson(){a().ajax({url:o.A.publicPath+o.A.heatingCheck.jsonPath,cache:!1,dataType:"json",success:t=>{this._placeIds=t.placeIds,this._loadForm(this._$component.find(".form-with-district-heating")),this._loadForm(this._$component.find(".form-maybe-district-heating")),this._loadForm(this._$component.find(".form-no-district-heating"))},error:()=>{}})}_loadPvJson(){a().ajax({url:o.A.publicPath+o.A.heatingCheck.jsonPathPv,cache:!1,dataType:"json",success:t=>{this._availableZips=t.availableZips,this._loadForm(this._$component.find(".form-with-pv"))},error:()=>{}})}_loadHeatpumpJson(){a().ajax({url:o.A.publicPath+o.A.heatingCheck.jsonPathHeatpump,cache:!1,dataType:"json",success:t=>{this._availableZips=t.availableZips,this._loadForm(this._$component.find(".form-with-heatpump"))},error:()=>{}})}_loadContractJson(){a().ajax({url:o.A.publicPath+o.A.heatingCheck.jsonPathContract,cache:!1,dataType:"json",success:t=>{this._availableZips=t.availableZips,this._loadForm(this._$component.find(".form-no-heating-contract"))},error:()=>{}})}_loadForm(t){let e=t.data("url");if(""===e)return!1;o.A.debug&&(e=o.A.proxy+e),a().ajax({url:e,dataType:"html",success:e=>{t.find(".form-element").html(e),t.addClass("frame-type-form_formframework"),a()("body").trigger("bb-form-items-changed"),window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0}))},error:()=>{t.find(".form-element").html(""),t.addClass("frame-type-form_formframework")}})}_loadIframe(t){let e=`<iframe src="${t.data("url")}?address=${this._placeData.placeId}"></iframe>`;t.find(".form-element").html(e),t.find("iframe").iFrameResize({log:!1,checkOrigin:!1,onResized:t=>{if(a()(t.iframe).contents().find(".bb-form-message--success").length>0){const t=a()(a()(".bb-heat-availability-check__form_message:visible")[0]).offset().top-(a()("#bb-header").length?a()("#bb-header")[0].offsetHeight:0);(0,r.BD)(t)}}})}_onInputChange(t){if(a()(t.relatedTarget).hasClass("mdc-list-item"))return;this._placeData={};const e=this._$component.find(".mdc__autocomplete");if(""!==a()(t.target).val()&&e.find(".mdc-list-item").length>0){const t=e.find(".mdc-list-item--selected, .bb-autocomplete--selected");0===t.length?e.find(".mdc-list-item").first().trigger("click"):t.trigger("click")}}_onInputKeydown(t){const e=a()(t.currentTarget).closest(".bb-inputfield-wrapper").find(".mdc__autocomplete"),i=e.find(".mdc-list-item");let s=i.filter(".mdc-list-item--selected");"Enter"===t.key&&(t.preventDefault(),s.length>0?s.click():i.first().trigger("click"),e.slideUp()),"Escape"===t.key&&(t.preventDefault(),e.slideUp()),"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),s.length>
10?"ArrowUp"===t.key?(s=s.prev(),s.length||(s=s=a()(i).last())):(s=s.next(),s.length||(s=s=a()(i).first())):s="ArrowUp"===t.key?a()(i).last():a()(i).first(),i.removeClass("mdc-list-item--selected"),s.addClass("mdc-list-item--selected"))}_onStepStartSubmit(t){if(t.preventDefault(),t.stopImmediatePropagation(),this._$component.find(".form__submit").attr("disabled",!0),this._$component.find(".form-no-district-heating").removeClass("show"),this._$component.find(".form-with-district-heating").removeClass("show"),this._$component.find(".form-maybe-district-heating").removeClass("show"),this._$component.find(".form-no-heating-contract").removeClass("show"),this._$component.find(".form-with-heating-contract").removeClass("show"),this._$component.find(".form-maybe-heating-contract").removeClass("show"),this._$component.find(".form-with-pv").removeClass("show"),this._$component.find(".form-with-heatpump").removeClass("show"),Object.keys(this._placeData).length>0){let e="Angefragt - ",i="Angefragt";const s=a()(t.target).closest(".bb-heat-availability-check__copy-container");if(this._$component.find(".address-input").hide(),this._$component.find(".change-address").show(),this._$component.find(".change-address span").html(this._$addressInputField.val()),this._checkPv)this._$component.find(".frame-type-form_formframework").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--default").addClass("show"),this._availableZips.includes(this._placeData.zip)?(this._trackingData.availability="Verfügbar",this._$component.find(".form-with-pv").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--success").addClass("show"),s.removeClass("show-error").addClass("show-success")):(this._trackingData.availability="Nicht Verfügbar",this._$component.find(".form-no-pv").addClass("show"),s.removeClass("show-success").addClass("show-error"));else if(this._checkHeatpump)this._$component.find(".frame-type-form_formframework").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--default").addClass("show"),this._availableZips.includes(this._placeData.zip)?(this._trackingData.availability="Verfügbar",this._$component.find(".form-with-heatpump").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--success").addClass("show"),s.removeClass("show-error").addClass("show-success")):(this._trackingData.availability="Nicht Verfügbar",this._$component.find(".form-no-heatpump").addClass("show"),s.removeClass("show-success").addClass("show-error"));else if(this._checkContract){const t=this._availableZips.find(t=>t.p===this._placeData.zip);t?(this._loadIframe(this._$component.find(".form-with-heating-contract")),this._loadIframe(this._$component.find(".form-maybe-heating-contract")),this._$component.find(".frame-type-form_formframework").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--default").addClass("show"),t.a?(this._trackingData.availability="Verfügbar",this._$component.find(".form-with-heating-contract").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--success").addClass("show")):(this._trackingData.availability="Vielleicht Verfügbar",this._$component.find(".form-maybe-heating-contract").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--maybe").addClass("show")),s.removeClass("show-error").addClass("show-success")):(this._trackingData.availability="Nicht Verfügbar",this._$component.find(".form-no-heating-contract").addClass("show"),s.removeClass("show-error").addClass("show-success"))}else{const t=this._placeIds.find(t=>t.a===this._placeData.placeId);t?(this._$component.find(".frame-type-form_formframework").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--default").addClass("show"),t.d<=20?(this._trackingData.availability="Verfügbar",this._$component.find(".form-with-district-heating").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--success").addClass("show")):t.d>20&&t.d<=150?(this._trackingData.availability="Vielleicht Verfügbar",this._$component.find(".form-maybe-district-heating").addClass("show"),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--maybe").addClass("show")):(this._trackingData.availability="Nicht Verfügbar",this._$component.find(".form-no-district-heating").addClass("show")),s.removeClass("show-error").addClass("show-success")):(this._trackingData.availability="Nicht Verfügbar",this._$component.find(".form-no-district-heating").addClass("show"),s.removeClass("show-error").addClass("show-success"))}(0,n.sx)(this._trackingData.category,e+this._trackingData.availability,this._trackingData.address),(0,n.mO)(this._trackingData.event,"action",i,"status",this._trackingData.availability,"address",this._trackingData.address),this._isInKostenrechner&&((0,n.sx)("Ãbergabestation Preisrechner","Verfügbarkeitscheck genutzt",this._$component.find('form input[data-id="buildingType-0"]:checked, form input[data-id="buildingType-1"]:checked').val()),(0,n.mO)("uebergabestation_preisrechner","action","Verfügbarkeitscheck genutzt","building",this._$component.find('form input[data-id="buildingType-0"]:checked, form input[data-id="buildingType-1"]:checked').val()));const o=s.find(".content-form");o.addClass("form--visible").slideDown();const c=a()("#bb-header").height()||0;(0,r.BD)(o.offset().top-c)}else""!==this._$addressInputField.val()&&(this._$component.find(".form--submitting").removeClass("form--submitting"),this._showAddressInputError());this._$component.find(".form__submit").attr("disabled",!1)}_showAddressInputError(){const t=this._$addressInputField.closest(".form-element-wrapper");if(!t.hasClass("error")){const e=t.find(".bb-inputfield__error-text");
1t.addClass("error").removeClass("valid"),this._$addressInputField.attr("aria-invalid",!0),e.text(e.data("errormsg")),t.find(".error-msg").slideDown(),this._$addressInputField.focus()}}_onChangeAddressClick(t){t.preventDefault();const e=this._$component.find(".bb-heat-availability-check__copy-container");this._placeData={},this._$addressInputField.val(""),this._$component.find(".address-input").show(),this._$component.find(".change-address").hide(),this._$component.find(".bb-heat-availability-check__icon").removeClass("show"),this._$component.find(".bb-heat-availability-check__icon--default").addClass("show");const i=this._$component.find("[data-scroll]").length>0;e.find(".content-form").removeClass("form--visible").slideUp(()=>{this._$component.find(".form-no-district-heating").removeClass("show"),this._$component.find(".form-with-district-heating").removeClass("show"),this._$component.find(".form-maybe-district-heating").removeClass("show"),this._$component.find(".form-no-pv").removeClass("show"),this._$component.find(".form-with-pv").removeClass("show"),this._$component.find(".form-no-heatpump").removeClass("show"),this._$component.find(".form-with-heatpump").removeClass("show"),i&&(0,r.BD)(this._$component.offset().top-(a()("#bb-header").height()||0))})}_onResize(){const t=this._$component.find(".bb-heat-availability-check__copy-container");if(t.hasClass("show-success")||t.hasClass("show-error")){const e=t.find("> .content-right");t.css("margin-bottom",e.outerHeight()+"px")}}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.