1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[99710],{710(e,t,i){i.r(t),i.d(t,{default:()=>l});let{PluginBaseClass:s}=window;class l extends s{static #e=this.options={selectEventGroupName:"ix-packstation",selectEventName:"ix-external-shipping-address-provider-change",selectEventShowMap:"ix-packstation-show-map",formIds:["address-AddressStreet","addressAddressZipcode","addressAddressCity","shippingAddress-AddressStreet","shippingAddressAddressZipcode","shippingAddressAddressCity"],typeName:"Hermes-Paket-Shop",changeAddressId:"ixHermesPaketshopChangeAddress",changeAddressName:"HERMES Paketshop ändern"};_registerEvents(){this.addressElement.addEventListener(this.options.selectEventName,e=>{e.detail.group!==this.options.selectEventGroupName&&(this._resetFieldValues(),this._changeLabel(""),this._unrestrictDeliveryCountry(),this._moveAdditionalField1("back"),this._hideMap(),this._hideFields(!1)),this.el.parentElement.querySelectorAll("#ix-packstation-packstation, #ix-packstation-filiale").forEach(t=>{t.id!==e.detail.id&&(t.checked=!1)})}),this.el.parentElement.querySelectorAll("#ix-packstation-packstation, #ix-packstation-filiale").forEach(e=>{e.addEventListener("click",(function(e){if(this._resetFieldValues(),e.target.checked){this.el.dispatchEvent(new CustomEvent(this.options.selectEventName,{bubbles:!0,detail:{id:e.target.id,group:this.options.selectEventGroupName}}));let t="";switch(e.target.id){case"ix-packstation-filiale":t="f";break;case"ix-packstation-packstation":t="p"}this.el.dispatchEvent(new CustomEvent(this.options.selectEventShowMap,{bubbles:!0,detail:{type:t}})),this.type=t,this._hideFields(!0),this._changeLabel(t),this._restrictDeliveryCountry(),this._showMap(),this._moveAdditionalField1("start")}else this._hideFields(!1),this._changeLabel(""),this._unrestrictDeliveryCountry(),this._hideMap(),this._moveAdditionalField1("back")}).bind(this))})}_setHtmlElements(){this.addressElement=this.el.parentElement.parentElement.parentElement,this.ixPackstationWrapper=this.addressElement.querySelector("#ixPackstationWrapper"),this.streetElement=this.addressElement.querySelector("#"+this.options.prefix+"-AddressStreet"),this.streetLabel=this.addressElement.querySelector('label[for="'+this.options.prefix+'-AddressStreet"]'),this.zipElement=this.addressElement.querySelector("#"+this.options.prefix+"AddressZipcode"),this.cityElement=this.addressElement.querySelector("#"+this.options.prefix+"AddressCity"),this.additionalField1Element=this.addressElement.querySelector("#"+this.options.prefix+"AdditionalField1"),this.additionalField1Label=this.addressElement.querySelector('label[for="'+this.options.prefix+'AdditionalField1"]'),this.countryElement=this.addressElement.querySelector("#"+this.options.prefix+"AddressCountry"),this.dhlTypeElement=this.addressElement.querySelector("#ix-packstation-input"),this.isDhlPackstationCheckbox=this.addressElement.querySelector("#ix-packstation-packstation"),this.isDhlFilialeCheckbox=this.addressElement.querySelector("#ix-packstation-filiale")}_setData(){let e="",t=!1,i=!1;this.options.type&&""!==this.options.type?(e=this.options.type,i=!0):this.isDhlPackstationCheckbox.checked?(e="p",t=!0):this.isDhlFilialeCheckbox.checked&&(e="f",t=!0),""!==e&&(this._changeLabel(e),this._hideFields(!0),this._showMap(),this._moveAdditionalField1("start"),this._restrictDeliveryCountry()),i&&this.setDhlPackstationHtml(this.streetElement.value,this.zipElement.value,this.cityElement.value),t&&window.PluginManager.initializePlugins().then(()=>{this.el.dispatchEvent(new CustomEvent(this.options.selectEventShowMap,{bubbles:!0,detail:{type:e}}))})}init(){this._setHtmlElements(),this._registerEvents(),this._setData()}setDhlPackstationHtml(e,t,i){let s=this.type??this.options.type;this.ixPackstationWrapper.innerHTML=` 2 <div style="display: flex; gap: 10px;"> 3 <div style="flex: 1"> 4 <p class="mb-0"> 5 Gew\xe4hlte DHL ${"p"===s?"Packstation":"Filiale"}: 6 </p> 7 <p class="mb-0"> 8 ${e} 9 </p> 10 <p class="mb-0"> 11 ${t} ${i} 12 </p> 13 </div> 14 <div style="flex: 1"> 15 <button 16 class="btn-block btn btn-secondary" 17 type="button" 18 id="${this.options.changeAddressId}" 19 > 20 DHL ${"p"===s?"Packstation":"Filiale"} \xe4ndern 21 </button> 22 </div> 23 </div>`,this.ixPackstationWrapper.querySelector("#"+this.options.changeAddressId).addEventListener("click",e=>{this.el.dispatchEvent(new CustomEvent(this.options.selectEventShowMap,{bubbles:!0,detail:{type:s}}))})}_changeLabel(e){""===e?(this.streetLabel.innerHTML=this.options.defaultValueStreet,this.streetElement.removeAttribute("maxlength"),this.additionalField1Label.
23innerHTML=this.options.defaultValueAdditionalField1,this.additionalField1Element.removeAttribute("maxlength"),this.options.defaultIsRequiredAdditionalField1?(this.additionalField1Element.setAttribute("required","required"),this.additionalField1Element.setAttribute("data-validation","required")):(this.additionalField1Element.removeAttribute("required"),this.additionalField1Element.removeAttribute("data-validation"))):"f"===e?(this.streetLabel.innerHTML=this.options.filialeValueStreet,this.streetElement.setAttribute("maxlength","30"),this.additionalField1Label.innerHTML=this.options.filialeValueAdditionalField1,this.additionalField1Element.setAttribute("maxlength","30"),this.options.filialeIsRequiredAdditionalField1?(this.additionalField1Element.setAttribute("required","required"),this.additionalField1Element.setAttribute("data-validation","required")):(this.additionalField1Element.removeAttribute("required"),this.additionalField1Element.removeAttribute("data-validation"))):"p"===e&&(this.streetLabel.innerHTML=this.options.packstationValueStreet,this.streetElement.setAttribute("maxlength","30"),this.additionalField1Label.innerHTML=this.options.packstationValueAdditionalField1,this.additionalField1Element.setAttribute("maxlength","30"),this.options.packstationIsRequiredAdditionalField1?(this.additionalField1Element.setAttribute("required","required"),this.additionalField1Element.setAttribute("data-validation","required")):(this.additionalField1Element.removeAttribute("required"),this.additionalField1Element.removeAttribute("data-validation")))}_moveAdditionalField1(e){let t=this.additionalField1Element?.parentElement?.parentElement;if(t){if(this.additionalField1Element.disabled=!1,"back"===e&&this.parentAddressAdditionalField1Div){let e=t?.parentElement;this.parentAddressAdditionalField1Div.appendChild(t),e&&e.remove(),this.parentAddressAdditionalField1Div=null;return}if("start"===e&&!this.parentAddressAdditionalField1Div){this.parentAddressAdditionalField1Div=t.parentElement;let e=document.createElement("div");for(let t of this.parentAddressAdditionalField1Div.attributes)e.setAttribute(t.name,t.value);e.appendChild(t),this.el.parentElement.nextElementSibling.after(e)}}}_showMap(){this.ixPackstationWrapper.classList.remove("d-none")}_hideMap(){this.ixPackstationWrapper.classList.add("d-none")}_hideFields(e){e?this.addressElement.querySelectorAll(".form-group input, .form-group select").forEach(e=>{this.options.formIds.includes(e.id)&&e.parentElement.parentElement.classList.add("d-none")}):this.addressElement.querySelectorAll(".form-group input, .form-group select").forEach(e=>{this.options.formIds.includes(e.id)&&e.parentElement.parentElement.classList.remove("d-none")})}_resetFieldValues(){this.streetElement.value="",this.zipElement.value="",this.cityElement.value="",this.additionalField1Element.value="",this.dhlTypeElement.value=""}_restrictDeliveryCountry(){for(let e of(this.countryElement.value=this.options.restrictedDeliveryCountryId,this.countryElement.options))e.value!==this.options.restrictedDeliveryCountryId&&(e.disabled=!0)}_unrestrictDeliveryCountry(){for(let e of this.countryElement.options)e.value!==this.options.restrictedDeliveryCountryId&&(e.disabled=!1)}}}}]);
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.