PageSourceSearch

https://www.autokaufmann.de/theme/eab5560fc83d1e2c18fd7f1e3c7c5a92…x.form-contry-state-select.plugin.a66b89.js

js autokaufmann.de collected 2026-10-05 11:12:33 UTC 14,087 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkacris_tax=self.webpackChunkacris_tax||[]).push([[39578],{68(t,e,i){i.d(e,{A:()=>r});class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",t,i);return this._sendRequest(r,null,e)}post(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let n=this._createPreparedRequest("POST",t,r);return this._sendRequest(n,e,i)}delete(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let n=this._createPreparedRequest("DELETE",t,r);return this._sendRequest(n,e,i)}patch(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let n=this._createPreparedRequest("PATCH",t,r);return this._sendRequest(n,e,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn(`the request to ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}},156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function n(t,e,i){return t.concat(e).map(function(t){return r(t,i)})}function s(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=r;var d,u,c=Array.isArray(i);return c!==Array.isArray(t)?r(i,l):c?l.arrayMerge(t,i,l):(u={},(d=l).isMergeableObject(t)&&s(t).forEach(function(e){u[e]=r(t[e],d)}),s(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&d.isMergeableObject(i[e])?u[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,d)(t[e],i[e],d):u[e]=r(i[e],d))}),u)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a},578(t,e,i){i.r(e),i.d(e,{default:()=>l});var r=i(737),n=i(68);class s extends r.A{static #t=this.options={countrySelectSelector:".country-select",initialCountryAttribute:"data-initial-country-id",countryStateSelectSelector:".country-state-select",initialCountryStateAttribute:"data-initial-country-state-id",countryStatePlaceholderSelector:'[data-placeholder-option="true"]',vatIdFieldInput:"#vatIds",zipcodeFieldInput:'[data-input-name="zipcodeInput"]',vatIdRequired:"data-vat-id-required",vatIdPattern:"data-vat-id-pattern",checkVatIdPattern:"data-check-vat-id-pattern",stateRequired:"data-state-required",stateDisplayed:"data-display-state-in-registration",zipcodeRequired:"data-zipcode-required",scopeElementSelector:null,prefix:null};init(){this.initClient(),this.initSelects(),this._getFormFieldToggleInstance(),this._formFieldToggleInstance&&this._formFieldToggleInstance.$emitter.subscribe("onChange",this._onFormFieldToggleChange.bind(this))}initClient(){this._client=new n.A}initSelects(){this.scopeElement=this.el,this.options.scopeElementSelector&&(this.scopeElement=document.querySelector(this.options.scopeElementSelector));
1let{countrySelectSelector:t,countryStateSelectSelector:e,initialCountryAttribute:i,initialCountryStateAttribute:r}=s.options,n=this.scopeElement.querySelector(t),o=this.scopeElement.querySelector(e),a=n.getAttribute(i),l=o.getAttribute(r),d=n.options[n.selectedIndex],u=!!d.getAttribute(this.options.vatIdRequired),c=d.getAttribute(this.options.vatIdPattern),p="1"===d.getAttribute(this.options.checkVatIdPattern),h=document.querySelector(this.options.vatIdFieldInput),g=!!d.getAttribute(this.options.stateRequired),m=this._getStateDisplayed(d,g),b=this.scopeElement.querySelectorAll(this.options.zipcodeFieldInput),y=!!d.getAttribute(this.options.zipcodeRequired);n.addEventListener("change",this.onChangeCountry.bind(this)),a&&(this.requestStateData(a,l,g,m),y&&this._updateZipcodeFields(b,y),h&&this._updateVatIdField(h,u,c,p))}onChangeCountry(t){let e=t.target.value,i=t.target.options[t.target.selectedIndex],r=!!i.getAttribute(this.options.stateRequired),n=this._getStateDisplayed(i,r);this.requestStateData(e,null,r,n);let s=!!i.getAttribute(this.options.vatIdRequired),o=i.getAttribute(this.options.vatIdPattern),a="1"===i.getAttribute(this.options.checkVatIdPattern),l=document.querySelector(this.options.vatIdFieldInput),d=this.scopeElement.querySelectorAll(this.options.zipcodeFieldInput),u=!!i.getAttribute(this.options.zipcodeRequired);this._updateZipcodeFields(d,u),l&&this._updateVatIdField(l,s,o,a)}requestStateData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];fetch(`${window.router["frontend.country.country-data"]}?countryId=${encodeURIComponent(t)}`,{headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"}}).then(t=>t.json()).then(t=>this._updateStateSelect(t.states,i,e,r))}_updateVatIdField(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(!this._differentShippingCheckbox||"billingAddress"!==this.options.prefix)&&(e?window.formValidation.setFieldRequired(t):window.formValidation.setFieldNotRequired(t),r&&i?t.setAttribute("pattern",i):t.removeAttribute("pattern"),t.value.trim().length>0&&window.formValidation.validateField(t))}_updateZipcodeFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.forEach(t=>{!0===e?window.formValidation.setFieldRequired(t):window.formValidation.setFieldNotRequired(t)})}_updateStateSelect(t,e,i){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=this.scopeElement.querySelector(this.options.countryStateSelectSelector),s=n.querySelector(this.options.countryStatePlaceholderSelector);this._removeStateOptions(n),this._addStateOptions(e||r?t:[],i,n),e?(window.formValidation.setFieldRequired(n),s.setAttribute("disabled","disabled")):(window.formValidation.setFieldNotRequired(n),s.removeAttribute("disabled"))}_removeStateOptions(t){let e=`option:not(${this.options.countryStatePlaceholderSelector})`,i=t;t||(i=this.scopeElement.querySelector(this.options.countryStateSelectSelector)),i.querySelectorAll(e).forEach(t=>t.remove())}_addStateOptions(t,e,i){let r=i;if(i||(r=this.scopeElement.querySelector(this.options.countryStateSelectSelector)),0===t.length){r.parentNode.classList.add("d-none"),r.setAttribute("disabled","disabled");return}t.map(t=>this._createStateOptionEl(t,e)).forEach(t=>{r.append(t)}),r.parentNode.classList.remove("d-none"),r.removeAttribute("disabled")}_createStateOptionEl(t,e){let i=document.createElement("option");return i.setAttribute("value",t.id),i.innerText=t.translated.name,t.id===e&&i.setAttribute("selected","selected"),i}_getFormFieldToggleInstance(){let t=document.querySelector('[data-form-field-toggle-target=".js-form-field-toggle-shipping-address"]');t&&(this._formFieldToggleInstance=window.PluginManager.getPluginInstanceFromElement(t,"FormFieldToggle"))}_onFormFieldToggleChange(t){this._differentShippingCheckbox=t.target.checked;let e=this._differentShippingCheckbox?".register-shipping":".register-billing",i=document.querySelector(e).querySelector(this.options.countrySelectSelector),r=i.options[i.selectedIndex],n=!!r.getAttribute(this.options.vatIdRequired),s=r.getAttribute(this.options.vatIdPattern),o="1"===r.getAttribute(this.options.checkVatIdPattern),a=document.querySelector(this.options.vatIdFieldInput);
1a&&this._updateVatIdField(a,n,s,o)}_getStateDisplayed(t,e){if(e||!t.hasAttribute(this.options.stateDisplayed))return!0;let i=t.getAttribute(this.options.stateDisplayed);return""!==i&&"0"!==i&&"false"!==i}}var o=i(156),a=i.n(o);class l extends s{static #t=this.options=a()(s.options,{addressVatIdFieldInput:"#addressVatId"});init(){super.init(),this._initAddressVatIdRequired(),this._registerCompanyFieldEvent()}_updateVatIdField(t,e){t&&(super._updateVatIdField(t,e),this._updateAddressVatIdRequired())}_updateAddressVatIdRequired(){let t;let e=document.querySelector(this.options.addressVatIdFieldInput);if(!e)return;let i="true"===e.getAttribute("data-vat-id-config-required");if("true"===e.getAttribute("data-vat-id-only-with-company")){let e=this._getCompanyField(),r=null!==e&&""!==e.value.trim();t=i&&r}else t=i;t?window.formValidation.setFieldRequired(e):window.formValidation.setFieldNotRequired(e)}_initAddressVatIdRequired(){this._updateAddressVatIdRequired()}_registerCompanyFieldEvent(){let t=document.querySelector(this.options.addressVatIdFieldInput);if(!t||"true"!==t.getAttribute("data-vat-id-only-with-company"))return;let e=this._getCompanyField();e&&(e.addEventListener("input",this._updateAddressVatIdRequired.bind(this)),e.addEventListener("change",this._updateAddressVatIdRequired.bind(this)))}_getCompanyField(){let t=this.el.closest("form")||document;return t.querySelector('[name="address[company]"]')||t.querySelector('[name="shippingAddress[company]"]')||t.querySelector('[name="billingAddress[company]"]')||t.querySelector('[name="company"]')||null}}},707(t,e,i){i.d(e,{A:()=>r});class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},737(t,e,i){i.d(e,{A:()=>a});var r=i(156),n=i.n(r),s=i(707);class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,n=t.split("."),s=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=s;s=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(n[0],s),this.listeners.push({splitEventName:n,opts:i,cb:s}),!0}unsubscribe(t){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${t}.MyCustomPlugin"`);let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class a{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}destroy(){}
1_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),n().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}}]);

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.