1"use strict";(self.webpackChunkswag_customized_products=self.webpackChunkswag_customized_products||[]).push([[52956],{156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l(Array.isArray(e)?[]:{},e,t):e}function n(e,t,i){return e.concat(t).map(function(e){return r(e,i)})}function s(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function l(e,i,a){(a=a||{}).arrayMerge=a.arrayMerge||n,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=r;var u,d,c=Array.isArray(i);return c!==Array.isArray(e)?r(i,a):c?a.arrayMerge(e,i,a):(d={},(u=a).isMergeableObject(e)&&s(e).forEach(function(t){d[t]=r(e[t],u)}),s(i).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&u.isMergeableObject(i[t])?d[t]=(function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l})(t,u)(e[t],i[t],u):d[t]=r(i[t],u))}),d)}l.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return l(e,i,t)},{})},e.exports=l},707(e,t,i){i.d(t,{A:()=>r});class r{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let i=r.toUpperCamelCase(e,t);return r.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>r.ucFirst(e.toLowerCase())).join(""):r.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},737(e,t,i){i.d(t,{A:()=>l});var r=i(156),n=i.n(r),s=i(707);class o{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,n=e.split("."),s=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=s;s=function(i){r.unsubscribe(e),t(i)}}return this.el.addEventListener(n[0],s),this.listeners.push({splitEventName:n,opts:i,cb:s}),!0}unsubscribe(e){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. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class l{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),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(){}_init(){this._initialized||(this.init(),this._initialized=!0)}
1_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),n().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},795(e,t,i){i.d(t,{A:()=>n});var r=i(707);class n{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!n.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===n.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);if("function"!=typeof e.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),o=r.A.toLowerCamelCase(s,"-");if(!n.isNode(e)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let l=e.dataset[o];if(void 0===l){if(i)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return l}return r.A.parsePrimitive(l)}static querySelector(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let r=e.querySelector(t)||!1;if(i&&!1===r)throw Error(`The required element "${t}" does not exist in parent node!`);return r}static querySelectorAll(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let r=e.querySelectorAll(t);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${t}" must exist in parent node!`);return r}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=` 2 input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]), 3 select:not([tabindex^="-"]):not([disabled]), 4 textarea:not([tabindex^="-"]):not([disabled]), 5 button:not([tabindex^="-"]):not([disabled]), 6 a[href]:not([tabindex^="-"]):not([disabled]), 7 [tabindex]:not([tabindex^="-"]):not([disabled]) 8 `;return e.querySelectorAll(t)}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}},956(e,t,i){i.r(t),i.d(t,{default:()=>s});var r=i(737),n=i(795);class s extends r.A{static #e=this.options={errorElementSelector:".customized-products-error-subtitle",fieldType:null,onEvent:"change",translations:{numberfield:{required:"No snippet provided (required)",min:"No snippet provided (min)",max:"No snippet provided (max)"},textfield:{required:"No snippet provided (required)",min:"No snippet provided (min)",max:"No snippet provided (max)"},fileupload:{required:"No snippet provided (required)",fileCount:"No snippet provided (fileCount)",fileType:"No snippet provided (fileType)",fileSize:"No snippet provided (fileSize)",generic:"No snippet provided (generic)"}},validationFunctions:{numberfield(e){let t=parseInt(e.value,10),i=parseInt(e.min,10),r=parseInt(e.max,10);return!Number.isInteger(t)&&e.required?this.options.translations.numberfield.required:t<i?this.options.translations.numberfield.min:t>r?this.options.translations.numberfield.max:null},textfield(e){let{value:t,required:i,minLength:r,maxLength:n}=e;return!t.length&&i?this.options.translations.textfield.required:-1!==r&&t.length<r?this.options.translations.textfield.min:-1!==n&&t.length>n?this.options.translations.textfield.max:null}}};init(){this.el.addEventListener(this.options.onEvent,this.validateField.bind(this)),this.validateField(!0)}isValid(){return this.validateField(),this.isFieldValid}validateField(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&window.PluginManager.getPluginInstanceFromElement(this.el.closest(".swag-customized-products"),"SwagCustomizedProductsFormValidator").onFormChange();let{fieldType:t}=this.options;if(!t){let e=this.el.getAttribute("type");if("number"===e)t="numberfield";else if("text"===e)t="textfield";else throw Error("Could not detect fieldtype by input type. Please provide the fieldType option")}let i=this.options.validationFunctions[t];if(!i)throw Error(`No validation function for fieldType "${t}"`);let r=i.call(this,this.el);if(null===r){this.hideError();return}this.showError(r)}getErrorElement(){return n.A.querySelector(this.el.parentElement,this.options.errorElementSelector)}hideError(){this.getErrorElement().style.display="none",this.el.classList.remove("is-error"),this.isFieldValid=!0}showError(e){let t=this.getErrorElement();t.style.display="block",t.innerText=e,this.el.classList.add("is-error"),this.isFieldValid=!1}constructor(...e){super(...e),this.isFieldValid=!0}}}}]);
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.