PageSourceSearch

https://www.plusled.dk/theme/dcebea11cd9bf22b2e6fe02519e67336/js/s…ized-products-configuration-share.9750fb.js

js plusled.dk collected 2026-10-05 07:55:50 UTC 16,357 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["swag-customized-products-configuration-share"],{857: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!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function i(t,e,r){return t.concat(e).map(function(t){return n(t,r)})}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,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=n;var u,l,d=Array.isArray(r);return d!==Array.isArray(t)?n(r,c):d?c.arrayMerge(t,r,c):(l={},(u=c).isMergeableObject(t)&&s(t).forEach(function(e){l[e]=n(t[e],u)}),s(r).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&u.isMergeableObject(r[e])?l[e]=(function(t,e){if(!e.customMerge)return a;var r=e.customMerge(t);return"function"==typeof r?r:a})(e,u)(t[e],r[e],u):l[e]=n(r[e],u))}),l)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return a(t,r,e)},{})},t.exports=a},49:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(140);class i{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!i.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 r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===i.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=e.replace(/^data(|-)/,""),o=n.Z.toLowerCamelCase(s,"-");if(!i.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[o];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return n.Z.parsePrimitive(a)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelector(e)||!1;if(r&&!1===n)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return n}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelectorAll(e);if(0===n.length&&(n=!1),r&&!1===n)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return n}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not([tabindex^="-"]):not([disabled])\n        ')}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]}}},266:(t,e,r)=>{r.d(e,{Z:()=>n});class n{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var r of t.entries())e(r[1],r[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(r=>{e(t[r],r)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}},140:(t,e,r)=>{r.d(e,{Z:()=>n});
1class n{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 r=n.toUpperCamelCase(t,e);return n.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},293:(t,e,r)=>{r.d(e,{Z:()=>c});var n=r(857),i=r.n(n),s=r(49),o=r(140);class a{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(n),n}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,i=t.split("."),s=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=s;s=function(r){n.unsubscribe(t),e(r)}}return this.el.addEventListener(i[0],s),this.listeners.push({splitEventName:i,opts:r,cb:s}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),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}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class c{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=o.Z.toDashCase(this._pluginName),r=s.Z.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),n=s.Z.getAttribute(this.el,"data-".concat(e,"-options"),!1),a=[this.constructor.options,this.options,t];r&&a.push(window.PluginConfigManager.get(this._pluginName,r));try{n&&a.push(JSON.parse(n))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(e,'-options" could not be parsed to json: ').concat(t.message))}return i().all(a.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>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}constructor(t,e={},r=!1){if(!s.Z.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}},107:(t,e,r)=>{r.d(e,{Z:()=>n});class n{get(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",n=this._createPreparedRequest("GET",t,r);return this._sendRequest(n,null,e)}post(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("POST",t,n);return this._sendRequest(i,e,r)}delete(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("DELETE",t,n);return this._sendRequest(i,e,r)}patch(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("PATCH",t,n);return this._sendRequest(i,e,r)}
1abort(){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 ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,r){return this._registerOnLoaded(t,r),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,r){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}},801:(t,e,r)=>{r.d(e,{Z:()=>c});var n=r(266);let i="loader",s={BEFORE:"before",INNER:"inner"};class o{create(){if(!this.exists()){if(this.position===s.INNER){this.parent.innerHTML=o.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),o.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(i));n.Z.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(i)).length>0}_getPosition(){return this.position===s.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(i,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return i}constructor(t,e=s.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}let a="element-loader-backdrop";class c extends o{static create(t){t.classList.add("has-element-loader"),c.exists(t)||(c.appendLoader(t),setTimeout(()=>{let e=t.querySelector(".".concat(a));e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(".".concat(a));e&&e.remove()}static exists(t){return t.querySelectorAll(".".concat(a)).length>0}static getTemplate(){return'\n        <div class="'.concat(a,'">\n            <div class="loader" role="status">\n                <span class="').concat("visually-hidden",'">Loading...</span>\n            </div>\n        </div>\n        ')}static appendLoader(t){t.insertAdjacentHTML("beforeend",c.getTemplate())}}},416:(t,e,r)=>{r.d(e,{Z:()=>o,y:()=>s});var n=r(293),i=r(49);let s=t=>{if("function"==typeof Event)return new Event(t);let e=document.createEvent("Event");return e.initEvent(t,!0,!0),e};class o extends n.Z{_init(){this.options.buyButtonSelector&&"#productDetailPageBuyProductForm .btn-buy"!==this.options.buyButtonSelector&&(this.options.selectors.buyButton=this.options.buyButtonSelector),this._context={customProductsForm:i.Z.querySelector(document,this.options.selectors.customProductsForm),buyForm:i.Z.querySelector(document,this.options.selectors.buyForm),buyWidget:i.Z.querySelector(document,this.options.selectors.buyWidget),buyButton:i.Z.querySelector(document,this.options.selectors.buyButton),subscription:{buyForm:i.Z.querySelector(document,this.options.selectors.subscription.buyForm,!1),buyWidget:i.Z.querySelector(document,this.options.selectors.subscription.buyWidget,!1),buyButton:i.Z.querySelector(document,this.options.selectors.subscription.buyButton,!1),oneTimeRadio:i.Z.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.buyButton),super._init()}get buyForm(){return o._isSubscription?this._context.subscription.buyForm:this._context.buyForm}set buyForm(t){console.error("Custom products: Overriding the buyForm like this is deprecated and could result in flaky behavior. Please use the options object instead."),o._isSubscription?this._context.subscription.buyForm=t:this._context.buyForm=t}get buyButton(){return o._isSubscription?this._context.subscription.buy
1Button:this._context.buyButton}set buyButton(t){console.error("Custom products: Overriding the buyButton like this is deprecated and could result in flaky behavior. Please use the options object instead."),o._isSubscription?this._context.subscription.buyButton=t:this._context.buyButton=t}get buyWidget(){return o._isSubscription?this._context.subscription.buyWidget:this._context.buyWidget}get customProductsForm(){return this._context.customProductsForm}_wrapAddEventListener(t,e){let r=this._contextSwitchingEventListener.bind(this,t,e);t&&(t.addEventListener=r),e&&(e.addEventListener=r)}_contextSwitchingEventListener(t,e,r,n){for(var i=arguments.length,s=Array(i>4?i-4:0),a=4;a<i;a++)s[a-4]=arguments[a];EventTarget.prototype.addEventListener.apply(t,[r,function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o._isSubscription||n(...e)},...s]),e&&EventTarget.prototype.addEventListener.apply(e,[r,function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o._isSubscription&&n(...e)},...s])}}o.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"}}},o._isSubscription=!1},66:(t,e,r)=>{r.r(e),r.d(e,{default:()=>u});var n=r(416),i=r(49),s=r(107),o=r(801);function a(t,e,r){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r||t):i.value}})(t,e,r||t)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}class u extends n.Z{init(){this.shareButton=this.el,this.iconPaperclip=i.Z.querySelector(this.buyForm,".swag-customized-products-share-icons .icon-paperclip"),this.client=new s.Z,this.registerEvents()}registerEvents(){this.shareButton.addEventListener("click",this.onShareButtonClicked.bind(this))}onShareButtonClicked(t){t.preventDefault();let e=new FormData(this.buyForm);e.set("absoluteBaseUrl",this.options.absoluteBaseUrl),e.set("baseUrl",this.options.baseUrl),o.Z.create(this.el.closest(".card")),this.client.post(this.options.url,e,this.onConfigurationReceived.bind(this))}onConfigurationReceived(t){let e=JSON.parse(t).shareUrl,r=this.el.parentNode,n=document.createElement("div");n.classList.add("input-group");let i=document.createElement("label");i.setAttribute("for","share-input-label"),i.classList.add("form-label"),i.classList.add("visually-hidden");let s=document.createElement("input");s.setAttribute("readonly",!0),s.setAttribute("name","share-input-label"),s.setAttribute("aria-label","Share URL"),s.classList.add("form-control"),s.setAttribute("value",e),n.appendChild(i),n.appendChild(s);let a=document.createElement("div"),c=document.createElement("button");c.appendChild(this.iconPaperclip.cloneNode(!0)),c.setAttribute("aria-label",this.options.ariaShareLabel),["btn","btn-sm"].forEach(t=>{c.classList.add(t)}),c.addEventListener("click",t=>{t.preventDefault();try{s.select(),s.setSelectionRange(0,-1),document.execCommand("copy")}catch(t){s.classList.add("is-invalid")}s.classList.add("is-valid")}),a.appendChild(c),n.appendChild(a),Array.from(r.children).forEach(t=>{r.removeChild(t)}),r.appendChild(n),o.Z.remove(r.closest(".card"))}}u.options={...a(c(u),"options",u),url:"",absoluteBaseUrl:"",baseUrl:"",ariaShareLabel:""}}}]);

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.