PageSourceSearch

https://www.weisshaus.at/theme/7c4f9c0b6995d7f3d0781ad684d89389/js…/swkweb-product-set.js?1790863754

js weisshaus.at collected 2026-10-02 19:30:34 UTC 32,263 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={293(t,e,i){i.d(e,{A:()=>r});var s=i(603),n=i(410);class r{constructor(t,e,i){this._el=t,this._parent=e,this._path=`${this._parent._fullPath||""}/`,this._slots=new Map,this.quantity=1,this._initPrice(),this._initSlots(i||new n.A)}get isValid(){for(let t of this._slots.values())if(!t.isValid)return!1;return!0}get totalPrice(){return this.getTotalQuantityPrice(1)}get maxPurchase(){let t=this._parent.maxPurchase;for(let e of this._slots.values())if(0!==e.selectedOptions.size)for(let i of e.selectedOptions.values())t=Math.min(t,i.maxPurchase);return t}get slots(){return this._slots}getConfigurator(){return this._parent.getConfigurator()}slotUpdated(){this._parent.setUpdated(this)}getTotalQuantityPrice(t){let e=t*this.quantity,i=this._basePrice.getQuantityPrice(e);for(let t of this._slots.values())if(0!==t.selectedOptions.size)for(let s of t.selectedOptions.values())i=i.add(s.getTotalQuantityPrice(e).multiply(s.quantity));return i}_initSlots(t){for(let t of this._el.querySelectorAll("[data-swkweb-product-set-slot]")){let{swkwebProductSetSlotId:e,swkwebProductSetSlotTemplate:i}=t.dataset;if(!e)throw Error("Missing slot id");let s=window.SwkwebProductSetSlotRegistry.get(i);this._slots.set(e,new s(e,t,this,i))}for(let e of this._slots.values())e.init(t),this.getConfigurator().$emitter.publish("swkwebProductSet/onSlotInit",{slot:e})}_initPrice(){let t=JSON.parse(this._el.dataset.swkwebProductSetPrice);this._basePrice=new s.A(t.price,t.prices)}toJSON(){return{slots:[...this._slots.values()]}}}},410(t,e,i){i.d(e,{A:()=>n});var s=i(573);class n extends s.A{static createFromString(t){return new this(JSON.parse(atob(t.replace("-","+").replace("_","/"))))}toString(){return btoa(JSON.stringify(this._configuration)).replace("+","-").replace("/","_")}static _transformUuid(t){if(32!==t.length)throw Error(`Invalid UUID: ${t}`);return t.slice(-8)}}},573(t,e,i){i.d(e,{A:()=>s});class s{constructor(t){if(this.constructor instanceof s)throw Error("The base product set preselection class must not be instantiated.");this._configuration=t||{}}static createFromString(t){throw Error("Method createFromString not implemented.")}static createFromSet(t){return new this(this.__buildSetConfiguration(t))}toString(){throw Error("Method toString not implemented.")}getQuantity(t){let e;try{e=this._getOptionByPath(t)}catch{return 0}return e.q||0}isSelectedVariantGroupOption(t,e,i){let s;try{s=this._getOptionByPath(t).v}catch{return!1}if("object"!=typeof s||null===s)return!1;let n=s[this.constructor._transformUuid(e)];return this.constructor._transformUuid(i)===n}getFieldValue(t,e){let i;try{i=this._getOptionByPath(t).f}catch{return}if("object"==typeof i&&null!==i)return i[this.constructor._transformUuid(e)]}static _transformUuid(t){throw Error("Method _transformUuid not implemented.")}_getOptionByPath(t){let e=t.trim("/").split("/").filter(Boolean);if(e.length%2!=0)throw Error("Invalid product set option path.");let i=this._configuration;for(let s of e){s.includes("-")&&(s=s.substring(0,s.indexOf("-")));let e=this.constructor._transformUuid(s);if("s"in i&&(i=i.s),"object"!=typeof(i=i[e])||null===i)throw Error(`Option at path ${t} not found.`)}return i}static __buildSetConfiguration(t){let e={};for(let i of t.slots.values())0!==i.selectedOptions.size&&(e[this._transformUuid(i._id)]=this.__buildSlotConfiguration(i));return e}static __buildSlotConfiguration(t){let e={};for(let i of t.selectedOptions.values())e[this._transformUuid(i._id)]=this.__buildOptionConfiguration(i);return e}static __buildOptionConfiguration(t){let e={q:t.quantity};t.isVariantConfigurator&&(e.v=Object.fromEntries(Object.entries(t.variantConfiguration).map(t=>{let[e,i]=t;return[this._transformUuid(e),this._transformUuid(i)]}))),t.isNestedSet&&t._nestedSet&&(e.s=this.__buildSetConfiguration(t._nestedSet));let i={};for(let e of t._fields)null!==e.value&&(i[this._transformUuid(e.identifier)]=e.value);return Object.keys(i).length>0&&(e.f=i),e}}},603(t,e,i){i.d(e,{A:()=>n});class s{constructor(t,e){this._unitPrice=t,this._listPrice=e}get unitPrice(){return this._unitPrice}get listPrice(){return this._listPrice||this.unitPrice}add(t){return new s(this.unitPrice+t.unitPrice,this.listPrice+t.listPrice)}multiply(t){return new s(this.unitPrice*t,this.listPrice*t)}}class n{constructor(t,e){this.defaultPrice=t,this.graduatedPrices=e}set defaultPrice(t){this._defaultPrice=new s(t.unitPrice,t.listPrice)}set graduatedPrices(t){t.sort((t,e)=>t.quantity-e.quantity),this._graduatedPrices=new Map(t.map(t=>[t.quantity,new s(t.unitPrice,t.listPrice)]))}getQuantityPrice(t){let e;if(0===t)return new s(0,0);if(0!==this._graduatedPrices.length){let i=1,s=this._graduatedPrices.size;
1for(let[n,r]of this._graduatedPrices)if(!(t>=i)||!(t<=n)&&--s)i=n+1;else{e=r;break}}if(e||(e=this._defaultPrice),!e)throw Error(`No price found for ${this} and quantity ${t}`);return new s(e.unitPrice,e.listPrice)}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}i.m=t,i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce((e,s)=>(i.f[s](t,e),e),[])),i.u=t=>"./js/swkweb-product-set/"+({19750:"swkweb-product-set.product-set-configurator.plugin",23790:"swkweb-product-set.product-set-sticky-bar.plugin",26013:"swkweb-product-set.product-set-summary.plugin",73781:"swkweb-product-set.product-set-sticky-element.plugin",75299:"swkweb-product-set.product-set-slider.plugin"})[t]+"."+({19750:"ad9243",23790:"0d7795",26013:"d2ce9e",73781:"75313f",75299:"4ecff8"})[t]+".js",i.miniCssF=t=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={};i.l=(e,s,n,r)=>{if(t[e]){t[e].push(s);return}if(void 0!==n)for(var o,a,l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e){o=d;break}}o||(a=!0,(o=document.createElement("script")).charset="utf-8",i.nc&&o.setAttribute("nonce",i.nc),o.src=e),t[e]=[s];var c=(i,s)=>{o.onerror=o.onload=null,clearTimeout(h);var n=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(t=>t(s)),i)return i(s)},h=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),a&&document.head.appendChild(o)}})(),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{i.g.importScripts&&(t=i.g.location+"");var t,e=i.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=s[n--].src}if(!t)throw Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t+"../../"})(),(()=>{var t={53875:0};i.f.j=(e,s)=>{var n=i.o(t,e)?t[e]:void 0;if(0!==n){if(n)s.push(n[2]);else{var r=new Promise((i,s)=>n=t[e]=[i,s]);s.push(n[2]=r);var o=i.p+i.u(e),a=Error();i.l(o,s=>{if(i.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var r=s&&("load"===s.type?"missing":s.type),o=s&&s.target&&s.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}}};var e=(e,s)=>{var n,r,[o,a,l]=s,u=0;if(o.some(e=>0!==t[e])){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);l&&l(i)}for(e&&e(s);u<o.length;u++)r=o[u],i.o(t,r)&&t[r]&&t[r][0](),t[r]=0},s=self.webpackChunk=self.webpackChunk||[];s.forEach(e.bind(null,0)),s.push=e.bind(null,s.push.bind(s))})();class s{constructor(t,e,i,n){if(this.constructor instanceof s)throw Error("The base product set slot class must not be instantiated.");this._id=t,this._el=e,this._set=i,this._options=new Map,this._path=`${this._set._path}${this._id}`,this._selectedOptionsCountElement=this._el.querySelector(".swkweb-product-set-slot-selected"),this._sliderSlotState=this.getConfigurator().el.querySelector(`.carousel-indicators li[data-swkweb-set-slot-id="${this._id}"]`),this._readConfig(n)}static get template(){throw Error("Product set slot classes have to implement the getTemplate() method.")}init(t){for(let e of this._options.values())e.init(t);this._update()}get selectedOptions(){return new Map([...this._options].filter(t=>{let[,e]=t;return e.isSelected}))}get selectedOptionsCount(){return 0===this.selectedOptions.size?0:this._limitTotalOptions?[...this.selectedOptions.values()].reduce(function(t,e){return t+e.quantity},0):this.selectedOptions.size}get isValid(){if(this._minimumSelectedOptions>this.selectedOptionsCount||this.selectedOptionsCount>this._maximumSelectedOptions)return!1;for(let t of this.selectedOptions.values())if(!t.isValid)return!1;return!0}getConfigurator(){return this._set.getConfigurator()}_isSelected(t){return this.selectedOptions.has(t)}_selectOption(t){let e;let i=this._options.get(t);(e=i.quantitySelect?parseInt(i.quantitySelect.value,10):i.minimumQuantity)||!i.isVariantConfigurator||(e=1),this._updateOptionQuantity(t,e),this.getConfigurator().$emitter.publish("swkwebProductSet/onSlotOptionSelected",{option:i,quantity:e})}_unselectOption(t){this._updateOptionQuantity(t,0)}_updateOptionQuantity(t,e){let i=this._options.get(t);e>0?(e=Math.max(e,i.minimumQuantity),this._limitTotalOptions?this.selectedOptionsCount-(i.isSelected?i.quantity:0)+e>this._maximumSelectedOptions&&(e=0):!i.isSelected&&this.selectedOptionsCount>=this._maximumSelectedOptions&&(e=0)):e=0,i.quantity=e,this._update(),this.getConfigurator().$emitter.publish("swkwebProductSet/onSlotOptionQuantityUpdated",{option:i,quantity:e})}
1_update(){this._selectedOptionsCountElement&&(this._selectedOptionsCountElement.innerHTML=this.selectedOptionsCount),this._sliderSlotState&&(this.selectedOptionsCount>0?this._sliderSlotState.classList.add("is-selected"):this._sliderSlotState.classList.remove("is-selected")),this.isValid?(this._el.classList.add("is-valid"),this._el.classList.remove("is-invalid"),this._sliderSlotState&&(this._sliderSlotState.classList.add("is-valid"),this._sliderSlotState.classList.remove("is-invalid"))):(this._el.classList.add("is-invalid"),this._el.classList.remove("is-valid"),this._sliderSlotState&&(this._sliderSlotState.classList.add("is-invalid"),this._sliderSlotState.classList.remove("is-valid"))),this._set.slotUpdated()}_resetOptions(){for(let t of this._options.keys())this._unselectOption(t)}_readConfig(t){let e=JSON.parse(this._el.dataset.swkwebProductSetSlotConfig);if("object"!=typeof e.options||0===Object.keys(e.options).length)throw Error("Invalid product set slot configuration.");for(let[i,s]of Object.entries(e.options)){let e=new(window.SwkwebProductSetOptionRegistry.get(t))(s,this);this._options.set(i,e)}this._label=e.name,this._minimumSelectedOptions=e.minimumSelectedOptions||0,this._maximumSelectedOptions=e.maximumSelectedOptions||1,this._limitTotalOptions=e.limitAggregatedOptionQuantities||!1}toJSON(){return{id:this._id,selectedOptions:[...this.selectedOptions.values()]}}}window.SwkwebProductSetSlot=s;class n extends window.SwkwebProductSetSlot{init(t){for(let e of(super.init(t),this._clickOptions=this._el.querySelectorAll(".swkweb-product-set-option"),this._clickOptions)){let t=e.attributes.value?.nodeValue;if(!t){console.warn("Option ID is missing");continue}let i=this._options.get(t);i&&(i._el.addEventListener("click",this._onClickOption.bind(this,t)),i.quantity>0&&this._selectOption(i._id))}}_onClickOption(t,e){if(this.__isValidClickTarget(e.target)){if(this._isSelected(t))this._unselectOption(t);else{let e=this._options.get(t);this._isRadioMode()&&0!==e._maxPurchse&&this._resetOptions(),this._selectOption(t)}this.getConfigurator().$emitter.publish("swkwebProductSet/onToggleSlotOptionClicked",{slot:this,optionId:t,event:e})}}_selectOption(t){super._selectOption(t);let e=this._options.get(t);e&&e.isSelected&&e._el.classList.add("is-selected")}_update(){super._update();let t=this.selectedOptionsCount;if(t>=this._maximumSelectedOptions?this._el.classList.add("is-maximum-options-selected"):this._el.classList.remove("is-maximum-options-selected"),this._limitTotalOptions){let e=this._maximumSelectedOptions-t;for(let t of this._options.values())if(!t.isSelected&&t.minimumQuantity>e?t._el.classList.add("not-selectable"):t._el.classList.remove("not-selectable"),t.quantitySelect){let i;for(let s of(i=t.isSelected?e+t.quantity:e,t.quantitySelect.options))s.value>i?s.disabled=!0:s.disabled=!1}}this.getConfigurator().$emitter.publish("swkwebProductSet/onToggleSlotUpdated",{slot:this})}_unselectOption(t){let e=this._options.get(t);super._unselectOption(t),e&&!e.isSelected&&e._el.classList.remove("is-selected")}__isValidClickTarget(t){if(t.matches(this._noTriggerSelector))return!1;let e=t;do if(e.matches(this._parentNoTriggerSelector))return!1;while(e!==this._el&&(e=e.parentNode))return!0}_isRadioMode(){return this._el.classList.contains("is-radio")&&1===this._maximumSelectedOptions}constructor(...t){super(...t),this._noTriggerSelector=".option-quantity-select, .option-quantity-select option, .swkweb-product-set-option-variant-select, .swkweb-product-set-option-variant-select option",this._parentNoTriggerSelector=".swkweb-product-set-option-nested-set, .swkweb-product-set-option-fields"}}class r extends window.SwkwebProductSetSlot{static get template(){return"dropdown"}init(t){if(super.init(t),this._optionSelect=this._el.querySelector("select"),!(this._optionSelect instanceof HTMLSelectElement))throw Error("The dropdown slot must contain a select element");this._optionImage=this._el.querySelector(".swkweb-product-set-option-image"),this._optionImagePlaceholder=this._el.querySelector(".swkweb-product-set-option-image-placeholder"),this._modalTrigger=this._el.querySelector(".swkweb-product-set-option-modal-trigger"),this._optionDetail
1s=this._el.querySelectorAll(".swkweb-product-set-option-details");let e=Array.from(this._options.values()).find(e=>t.getQuantity(e._path)>0)?._id||this._optionSelect.value;e&&(this._optionSelect.value=e,this._selectOption(e)),this._updateSlot(e),this._registerEventListener()}_registerEventListener(){if(this._optionSelect.addEventListener("change",this._onChangeOptionSelect.bind(this)),this._optionDetails)for(let t of this._optionDetails){let e=this._options.get(t.dataset.optionId);e&&(e.optionDetails=t);let i=t.querySelector(".swkweb-product-set-option-quantity .option-quantity-select");i&&e&&(i.addEventListener("change",this._onChangeOptionQuantity.bind(this)),e.quantitySelect=i)}}_onChangeOptionSelect(){let t=this._optionSelect.value;this._resetOptions(),this._updateSlot(t),t&&this._selectOption(t)}_updateSlot(t){let e=this._optionSelect.selectedOptions.item(0);if(this._updateOptionImage(e.dataset.imageSrc||null),!t){this._updateModalTriggerUrl(null),this._updateOptionDetails(null);return}this._updateModalTriggerUrl(e.dataset.url||null),this._updateOptionDetails(t)}_onChangeOptionQuantity(t){let e=t.target.dataset.optionId;if(!e||!this._isSelected(e))return;let i=parseInt(t.target.value,10);this._updateOptionQuantity(e,i)}_updateModalTriggerUrl(t){this._modalTrigger&&(t?(this._modalTrigger.dataset.url=t,this._modalTrigger.style.display=null):(this._modalTrigger.dataset.url="",this._modalTrigger.style.display="none"))}_updateOptionImage(t){if(this._optionImage&&this._optionImagePlaceholder){if(t){let e=document.createElement("img");e.src=t,this._optionImage.replaceChildren(e),this._optionImage.style.display=null,this._optionImagePlaceholder.style.display="none"}else this._optionImage.style.display="none",this._optionImagePlaceholder.style.display=null}}_updateOptionDetails(t){for(let e of this._optionDetails){let i=e.dataset.optionId;t&&t===i?e.style.display=null:e.style.display="none"}}}class o extends window.SwkwebProductSetSlot{static get template(){return"static"}init(t){for(let e of(super.init(t),this._options.keys()))this._selectOption(e)}}class a extends window.SwkwebProductSetSlot{static get template(){return"invisible"}init(t){for(let e of(super.init(t),this._options.keys()))this._selectOption(e)}}let l=Object.freeze(new class{constructor(){this._domParser=new DOMParser}replaceFromMarkup(t,e){let i=t;"string"==typeof i&&(i=this._createMarkupFromString(i)),"string"==typeof e&&(e=[e]),this._replaceSelectors(i,e)}replaceElement(t,e){return("string"==typeof t&&(t=document.querySelectorAll(t)),"string"==typeof e&&(e=document.querySelectorAll(e)),t instanceof NodeList&&e instanceof NodeList&&e.length>t.length)?(e.forEach(e=>{t.forEach(t=>{t.innerHTML&&t.className===e.className&&(e.innerHTML=t.innerHTML)})}),!0):t instanceof NodeList&&t.length?(t.forEach((t,i)=>{t.innerHTML&&(e[i].innerHTML=t.innerHTML)}),!0):e instanceof NodeList&&e.length?(e.forEach(e=>{t.innerHTML&&(e.innerHTML=t.innerHTML)}),!0):!!e&&!!t&&!!t.innerHTML&&(e.innerHTML=t.innerHTML,!0)}_replaceSelectors(t,e){e.forEach(e=>{let i=t.querySelectorAll(e),s=document.querySelectorAll(e);this.replaceElement(i,s)})}_createMarkupFromString(t){return this._domParser.parseFromString(t,"text/html")}});class u{static replaceFromMarkup(t,e){l.replaceFromMarkup(t,e)}static replaceElement(t,e){return l.replaceElement(t,e)}}var d=i(603),c=i(293);class h{constructor(t,e){if(this._isLoading=!1,this._slot=e,this._nestedSet=null,this._isLoading=!1,this._assignOptionConfig(t),this._path=`${this._slot._path}/${this._id}`,this._el=this._slot._el.querySelector(`[value="${this._id}"]`),!this._el)throw Error(`Could not find option element ${this._id}`);this._initOptionElements(),this._registerEvents()}static get template(){return null}get _fullPath(){let t=this._path;return this._variantId&&(t+=`-${this._variantId}`),t}get quantity(){return this._quantity}set quantity(t){if(!this.isVariantConfigurator&&(!Number.isInteger(t)||t>this._maximumQuantity||0!==t&&t<this._minimumQuantity))throw Error("Invalid quantity");0===this._quantity&&t>0?this._onOptionSelected():this._quantity>0&&0===t&&this._onOptionDeselected(),this._nestedSet&&(this._nestedSet.quantity=t),this._quantity=t}get minimumQuantity(){return this._minimumQuantity}get maximumQuantity(){return this._maximumQuantity}get totalQuantity(){return parseInt(this._quantity,10)}get maxPurchase(){return parseInt(this._maxPurchase/this.totalQuantity,10)}get isNestedSet(){return this._isNestedSet}get isSelected(){return this.quantity>0}get isVariantConfigurator(){return!!this._productVariantContainer}get optionQuantitySelect(){return this._optionContent.querySelector(".option-quantity-select")}get optionVariantConfiguratorContainer(){return this._optionContent.querySelector(".swkweb-product-set-option-variant-configurator")}get optionFieldContainer(){return this._optionContent.querySelector(".swkweb-product-set-option-fields")}get optionImageElement(){return this._optionImage}get optionVariantCharacteristics(){return this._optionContent.querySelector(".swkweb-product-set-option-variant-characteristics")}get hasValidVariantSelection(){if(!this.isVariantConfigurator)return!0;
1if(!this._variantId)return!1;for(let t of this._variantGroupSelects)if(""===t.value)return!1;return!0}get isValid(){return!(this._maxPurchase<=0||!this.hasValidVariantSelection||this._nestedSet&&!this._nestedSet.isValid||this._fields.some(t=>t.isLoading||!t.isValid))}get variantConfiguration(){if(!this.isVariantConfigurator)return null;let t={};for(let e of this._variantGroupSelects)e.name&&e.value&&(t[e.name]=e.value);return t}init(t){if(this._quantity=t.getQuantity(this._path),this.quantitySelect&&this._quantity>0&&(this.quantitySelect.value=this._quantity),this._variantGroupSelects&&this._variantGroupSelects.length)for(let[e,i]of this._variantGroupSelects.entries()){let s=i.name;for(let e of i.querySelectorAll("option")){let n=e.value;if(""!==n&&t.isSelectedVariantGroupOption(this._path,s,n)){i.selectedIndex=e.index;break}}if(i.selectedIndex===i.querySelector("option[selected]").index||e===this._variantGroupSelects.length-1){this._updateVariant(i,t).then(()=>{this._applyFieldPreselection(t)});break}}else this._quantity>0&&(this._onOptionSelected(t),this._applyFieldPreselection(t))}getOptionQuantityPrice(t){return this._price.getQuantityPrice(t*this.totalQuantity)}getTotalQuantityPrice(t){let e=this.getOptionQuantityPrice(t);return this._nestedSet&&(e=e.add(this._nestedSet.getTotalQuantityPrice(t))),e}getConfigurator(){return this._slot.getConfigurator()}setUpdated(){this._slot._update()}updateLoadingIndicator(t){void 0!==t&&(this._isLoading=t),this._isLoading||this._fields.some(t=>t.isLoading)?this._el.classList.add("is-loading"):this._el.classList.remove("is-loading")}_registerEvents(){if(this._productVariantContainer=this.optionVariantConfiguratorContainer,this.quantitySelect=this.optionQuantitySelect,this.quantitySelect&&this.quantitySelect.addEventListener("change",this._onChangeOptionQuantity.bind(this)),this._productVariantContainer&&(this._variantGroupSelects=this._productVariantContainer.querySelectorAll(".swkweb-product-set-option-variant-select"),this._variantGroupSelects.forEach(t=>{t.addEventListener("change",this._onVariantChange.bind(this))})),this._fields=[],this.optionFieldContainer)for(let t of this.optionFieldContainer.querySelectorAll(".swkweb-product-set-option-field"))this._fields.push(window.SwkwebProductSetOptionFieldRegistry.get(t,this));window.PluginManager.initializePlugin("AjaxModal","[data-ajax-modal][data-url]")}_onOptionSelected(t){this._updateVariantGroupSelectsState(!0),this._isNestedSet&&this._updateNestedSet(t)}_onOptionDeselected(){this._updateVariantGroupSelectsState(!1),this._removeNestedSet()}_onVariantChange(t){this._slot._selectOption(this._id),this._updateVariant(t.currentTarget)}_onChangeOptionQuantity(){this._slot._selectOption(this._id)}_onOptionFieldChange(){this.setUpdated()}_updateNestedSet(t){this._loadOption(null,t)}_removeNestedSet(){if(!this._nestedSet)return;let t=this._nestedSet;this._nestedSet=null,t._el.remove()}_updateVariant(t,e){return this._loadOption({switched:t.name},e)}_loadOption(t,e){for(let e of(this.updateLoadingIndicator(!0),(t=t||{}).template=this._slot.constructor.template,t.options={},this._variantGroupSelects||[]))t.options[e.name]=e.value;return this.getConfigurator().loadOption(this._path,t).then(t=>{this._assignOptionConfig(t.optionConfig),this._updateOptionTemplate(t,e),this._slot._update(),t.optionConfig.variantId&&this.getConfigurator().$emitter.publish("swkwebProductSet/onOptionVariantUpdated",{option:this,variantInformation:t})}).finally(()=>{this.updateLoadingIndicator(!1)})}_updateOptionTemplate(t,e,i,s){i=i||this._el,s=s||".swkweb-product-set-option";let n=new DOMParser().parseFromString(t.html,"text/html").querySelector(s);for(let e of(u.replaceElement(this._productVariantContainer,n.querySelector(".swkweb-product-set-option-variant-configurator"),!1),u.replaceElement(n,i),this._variantGroupSelects||[])){let s=i.querySelector(`[name="${e.name}"]`);if(s.selectedIndex=e.selectedIndex,this._updateVariantSelectState(s),t.enabledOptions)for(let e of s.options)e.value&&(t.enabledOptions.includes(e.value)?e.disabled=!1:e.disabled=!0)}this._initOptionElements(),this._registerEvents();let r=i.querySelector("[data-swkweb-product-set]",!1);this._nestedSet=r?new c.A(r,this,e):null,this.getConfigurator().$emitter.publish("swkwebProductSet/onOptionTemplateUpdated",{option:this,oldElement:i,newElement:n})}_applyFieldPreselection(t){for(let e of this._fields){let i=t.getFieldValue(this._path,e.identifier);void 0!==i&&(e.value=i)}}_updateVariantGroupSelectsState(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this._variantGroupSelects?.length)for(let e of this._variantGroupSelects)this._updateV
1ariantSelectState(e,t)}_updateVariantSelectState(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!(e??this.isSelected)||t.value?t.classList.remove("is-invalid"):t.classList.add("is-invalid")}_assignOptionConfig(t){this._id=t.id,this._label=t.label,this._minimumQuantity=t.minimumQuantity,this._maximumQuantity=t.maximumQuantity,this._maxPurchase=t.maxPurchase,this._isNestedSet=t.isNestedSet,this._price=new d.A(t.price,t.prices),this._variantId=t.variantId||null,this.getConfigurator().$emitter.publish("swkwebProductSet/onOptionConfigUpdated",{option:this,optionConfig:t})}_initOptionElements(){this._optionContent=this._el.querySelector(`.swkweb-product-set-option-content[data-option-id="${this._id}"]`)||this._el.querySelector(".swkweb-product-set-option-content")||this._el,this._optionImage=this._el.querySelector(".swkweb-product-set-option-image")||this._el.querySelector(".swkweb-product-set-option-image-placeholder")}toJSON(){let t={id:this._id,quantity:this.totalQuantity};if(this._variantId&&(t.variantId=this._variantId),this._nestedSet&&(t.nestedSet=this._nestedSet.toJSON()),this._fields)for(let e of(t.fields={},this._fields))t.fields[e.identifier]=e.value;return t}}class p{constructor(t,e){this.el=t,this.option=e;let{swkwebProductSetOptionFieldId:i,swkwebProductSetOptionFieldLabel:s}=t.dataset;if(!i||!s)throw Error("Invalid option field configuration");this.identifier=i,this.label=s,this.init(t,e)}get value(){return this.input.value||null}set value(t){this.input.value=t}get printableValue(){return this.value||null}get isValid(){return this.input.validity.valid}get isLoading(){return!1}init(t,e){let i=t.querySelector("input, select");if(!(i instanceof HTMLInputElement||i instanceof HTMLSelectElement))throw Error("Invalid option field input.");this.input=i,this.input.addEventListener("change",this.onInputChanged.bind(this))}onInputChanged(){this.valueChanged()}valueChanged(){this.input.dispatchEvent(new Event("swkweb.product-set.field.value-changed")),this.option.setUpdated()}getConfigurator(){return this.option.getConfigurator()}}window.SwkwebProductSetOptionField=p,window.SwkwebProductSetSlotRegistry=new class{constructor(){this._registry=new Map}register(t){if(!(t.prototype instanceof window.SwkwebProductSetSlot))throw TypeError("Invalid product set slot class.");this._registry.set(t.template,t)}get(t){if(!this._registry.has(t))throw Error("Invalid product set slot template.");return this._registry.get(t)}},window.SwkwebProductSetSlotRegistry.register(class extends n{static get template(){return"box"}}),window.SwkwebProductSetSlotRegistry.register(r),window.SwkwebProductSetSlotRegistry.register(class extends n{static get template(){return"list"}}),window.SwkwebProductSetSlotRegistry.register(o),window.SwkwebProductSetSlotRegistry.register(class extends n{static get template(){return"slider"}}),window.SwkwebProductSetSlotRegistry.register(a),window.SwkwebProductSetOptionRegistry=new class{constructor(){this._registry=new Map}register(t){if(!(t.prototype instanceof h)||null===t.template)throw TypeError("Invalid product set option class.");this._registry.set(t.template,t)}get(t){return this._registry.has(t)?this._registry.get(t):h}},window.SwkwebProductSetOptionRegistry.register(class extends h{static get template(){return"dropdown"}_updateOptionTemplate(t,e){super._updateOptionTemplate(t,e,this.optionDetails,".swkweb-product-set-option-details")}get optionImageElement(){return this._slot._optionImage}get optionVariantCharacteristics(){return this._slot._el.querySelector(`.swkweb-product-set-option-details[data-option-id="${this._id}"] .swkweb-product-set-option-variant-characteristics`)}get optionQuantitySelect(){return this._slot._el.querySelector(`.swkweb-product-set-option-details[data-option-id="${this._id}"] .option-quantity-select`)}get optionVariantConfiguratorContainer(){return this._slot._el.querySelector(`.swkweb-product-set-option-details[data-option-id="${this._id}"] .swkweb-product-set-option-variant-configurator`)}get optionFieldContainer(){return this._slot._el.querySelector(`.swkweb-product-set-option-detail
1s[data-option-id="${this._id}"] .swkweb-product-set-option-fields`)}}),window.SwkwebProductSetOptionFieldRegistry=new class{register(t,e){this.fieldConstructors.set(t,e)}get(t,e){let i=t.dataset.swkwebProductSetOptionFieldType;if(void 0===i)throw Error("The product set option field element does not have the required data attributes.");let s=this.fieldConstructors.get(i);if(void 0===s)throw Error(`Unsupported product set option field type: ${i}.`);return new s(t,e)}constructor(){this.fieldConstructors=new Map}},window.SwkwebProductSetOptionFieldRegistry.register("checkbox",class extends p{get value(){return this.input.checked?"1":"0"}set value(t){this.input.checked=!!t}get printableValue(){return this.input.checked?"✓":"✗"}}),window.SwkwebProductSetOptionFieldRegistry.register("number",p),window.SwkwebProductSetOptionFieldRegistry.register("text",p),window.SwkwebProductSetOptionFieldRegistry.register("select",class extends p{get printableValue(){return this.input instanceof HTMLSelectElement?this.value&&this.input.options[this.input.selectedIndex].text||null:super.printableValue}}),window.SwkwebProductSetOptionFieldRegistry.register("upload",class extends p{constructor(t,e){super(t,e),this.uploadId=null,this.fileName=null,this.isProcessing=!1,this.hasErrors=!1,this.messageContainer=this.el.querySelector(".swkweb-product-set-option-field-upload__message"),this.inputContainer=this.el.querySelector(".swkweb-product-set-option-field-upload__input-container"),this.infoContainer=this.el.querySelector(".swkweb-product-set-option-field-upload__info-container"),this.fileNameElement=this.el.querySelector(".swkweb-product-set-option-field-upload__file-name"),this.clearButton=this.el.querySelector(".swkweb-product-set-option-field-upload__clear-button"),this.registerEvents()}registerEvents(){this.clearButton?.addEventListener("click",this.onClearButtonClick.bind(this))}get value(){return this.uploadId}set value(t){this.updateUpload(null,null!==t),null!==t&&this.getConfigurator().getUpload(t).then(t=>{this.updateUpload(t.id||null,!1,!t.id,t.fileName||null,t.message||null)})}get printableValue(){return this.assertInputType(this.input),this.uploadId&&this.fileName||null}get isValid(){return super.isValid&&!this.hasErrors&&(!this.input.required||null!==this.uploadId)}get isLoading(){return super.isLoading||this.isProcessing}onInputChanged(){this.assertInputType(this.input),this.updateUpload(null,!0);let t=this.input.files;if(t?.length!==1){this.updateUpload(null,!1);return}this.getConfigurator().uploadFile(this.option._fullPath,this.identifier,t[0]).then(t=>{this.updateUpload(t.id||null,!1,!t.success,t.fileName,t.message)})}onClearButtonClick(){this.input.value="",this.updateUpload(null,!1)}updateUpload(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;this.uploadId=t,this.isProcessing=e,this.hasErrors=i,this.messageContainer&&(this.messageContainer.textContent=n||""),this.fileName=s||null,null!==this.printableValue?(this.inputContainer?.classList.add("d-none"),this.infoContainer?.classList.remove("d-none")):(this.inputContainer?.classList.remove("d-none"),this.infoContainer?.classList.add("d-none")),this.fileNameElement&&(this.fileNameElement.textContent=this.printableValue||""),this.option.updateLoadingIndicator(this.isLoading),this.valueChanged()}assertInputType(t){if(!(t instanceof HTMLInputElement))throw Error("Invalid input type")}}),window.PluginManager.register("SwkwebProductSetConfigurator",()=>i.e(19750).then(i.bind(i,750)),"[data-swkweb-product-set-configurator]"),window.PluginManager.register("SwkwebProductSetSummary",()=>i.e(26013).then(i.bind(i,13)),"[data-swkweb-product-set-summary]"),window.PluginManager.register("SwkwebProductSetStickyBar",()=>i.e(23790).then(i.bind(i,790)),"[data-swkweb-sticky-bar]"),window.PluginManager.register("SwkwebProductSetStickyElement",()=>i.e(73781).then(i.bind(i,781)),"[data-swkweb-product-set-sticky-element]"),window.PluginManager.register("SwkwebProductSetSlider",()=>i.e(75299).then(i.bind(i,299)),"[data-swkweb-product-set-slider]")})();

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.