PageSourceSearch

https://senger-naturwelt.de/theme/6ff274c203f2f2b08a92bc1f1dbc5a81…ed-products-restore-configuration.0ccba0.js

js senger-naturwelt.de collected 2026-10-10 01:23:14 UTC 11,011 bytes, 8 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[88148],{148(t,e,i){i.r(e),i.d(e,{default:()=>n});var r=i(179),o=i(795);class n extends r.A{static #t=this.options={...super.options,configuration:[],oldHash:"",imageUploadType:"",fileUploadType:"",selectors:{...super.options.selectors,dropZone:"#customized-products-dropzone-"}};init(){this.options.oldHash&&this.options.oldHash.length>0&&this.options.configuration.quantity&&this.restoreQuantity(),this.restoreUploadValues()}restoreQuantity(){o.A.querySelector(this.buyForm,".product-detail-quantity-select").value=this.options.configuration.quantity}restoreUploadValues(){let t=[this.options.imageUploadType,this.options.fileUploadType];Object.keys(this.options.configuration).forEach(e=>{let i=this.options.configuration[e];i.type&&t.includes(i.type)&&this.restoreFiles(e,i.value)})}restoreFiles(t,e){let i=o.A.querySelector(this.buyForm,`${this.options.selectors.dropZone}${t}`,!1);if(!i)return!1;let r=window.PluginManager.getPluginInstanceFromElement(i.parentNode,"SwagCustomizedProductsFileUpload");return e.forEach(t=>{let e=t.filename,i=new File([],e);r.registry.set(e,{file:i,element:r._appendNewFileElement(e),valid:!0}),r._onUploadSuccess(e,{mediaId:t.mediaId})}),!0}}},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)?u(Array.isArray(t)?[]:{},t,e):t}function o(t,e,i){return t.concat(e).map(function(t){return r(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function s(t,e){try{return e in t}catch(t){return!1}}function u(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||o,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=r;var c,l,d=Array.isArray(i);return d!==Array.isArray(t)?r(i,a):d?a.arrayMerge(t,i,a):(l={},(c=a).isMergeableObject(t)&&n(t).forEach(function(e){l[e]=r(t[e],c)}),n(i).forEach(function(e){(!s(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(s(t,e)&&c.isMergeableObject(i[e])?l[e]=(function(t,e){if(!e.customMerge)return u;var i=e.customMerge(t);return"function"==typeof i?i:u})(e,c)(t[e],i[e],c):l[e]=r(i[e],c))}),l)}u.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return u(t,i,e)},{})},t.exports=u},179(t,e,i){i.d(e,{A:()=>s,l:()=>n});var r=i(737),o=i(795);let n=t=>{if("function"==typeof Event)return new Event(t);let e=document.createEvent("Event");return e.initEvent(t,!0,!0),e};class s extends r.A{static #t=this.options={selectors:{customProductsForm:"form .swag-customized-products",buyForm:"#productDetailPageBuyProductForm",buyWidget:"#productDetailPageBuyProductForm.buy-widget",buyButton:"#productDetailPageBuyProductForm .btn-buy",subscription:{buyForm:"#productDetailPageSubscriptionBuyProductForm",buyWidget:"#productDetailPageSubscriptionBuyProductForm .buy-widget",buyButton:"#productDetailPageSubscriptionBuyProductForm .btn-buy",oneTimeRadio:"#subscription-interval-option-one-time-buy"}}};static #e=this._isSubscription=!1;_init(){this._context={customProductsForm:o.A.querySelector(document,this.options.selectors.customProductsForm),buyForm:o.A.querySelector(document,this.options.selectors.buyForm),buyWidget:o.A.querySelector(document,this.options.selectors.buyWidget),buyButton:o.A.querySelector(document,this.options.selectors.buyButton),subscription:{buyForm:o.A.querySelector(document,this.options.selectors.subscription.buyForm,!1),buyWidget:o.A.querySelector(document,this.options.selectors.subscription.buyWidget,!1),buyButton:o.A.querySelector(document,this.options.selectors.subscription.buyButton,!1),oneTimeRadio:o.A.querySelector(document,this.options.selectors.subscription.oneTimeRadio,!1)}},this._wrapAddEventListener(this._context.buyForm,this._context.subscription.buyForm),this._wrapAddEventListener(this._context.buyButton,this._context.subscription.buy
1Button),super._init()}get buyForm(){return s._isSubscription?this._context.subscription.buyForm:this._context.buyForm}get buyButton(){return s._isSubscription?this._context.subscription.buyButton:this._context.buyButton}get buyWidget(){return s._isSubscription?this._context.subscription.buyWidget:this._context.buyWidget}get customProductsForm(){return this._context.customProductsForm}_wrapAddEventListener(t,e){let i=this._contextSwitchingEventListener.bind(this,t,e);t&&(t.addEventListener=i),e&&(e.addEventListener=i)}_contextSwitchingEventListener(t,e,i,r){for(var o=arguments.length,n=Array(o>4?o-4:0),u=4;u<o;u++)n[u-4]=arguments[u];EventTarget.prototype.addEventListener.apply(t,[i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];s._isSubscription||r(...e)},...n]),e&&EventTarget.prototype.addEventListener.apply(e,[i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];s._isSubscription&&r(...e)},...n])}}},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:()=>u});var r=i(156),o=i.n(r),n=i(707);class s{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,o=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(o[0],n),this.listeners.push({splitEventName:o,opts:i,cb:n}),!0}unsubscribe(t){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 u{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 s(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(){}_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()),o().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=n.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=n.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}}}
1,795(t,e,i){i.d(e,{A:()=>o});var r=i(707);class o{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!o.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===o.hasAttribute(t,e))throw Error(`The required property "${e}" does not exist!`);if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),s=r.A.toLowerCamelCase(n,"-");if(!o.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let u=t.dataset[s];if(void 0===u){if(i)throw Error(`The required data attribute "${e}" does not exist on ${t}!`);return u}return r.A.parsePrimitive(u)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!o.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelector(e)||!1;if(i&&!1===r)throw Error(`The required element "${e}" does not exist in parent node!`);return r}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!o.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelectorAll(e);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${e}" must exist in parent node!`);return r}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,e=`
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 t.querySelectorAll(e)}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-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.