https://www.hagi.com.pl/theme/a8d927afccd27f286556d3dcba21238b/js/…/cr-saved-card-selector.99641f.js
1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28433],{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!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function s(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c,h,p=Array.isArray(r);return p!==Array.isArray(e)?i(r,l):p?l.arrayMerge(e,r,l):(h={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){h[t]=i(e[t],c)}),n(r).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(r[t])?h[t]=(function(e,t){if(!t.customMerge)return o;var r=t.customMerge(e);return"function"==typeof r?r:o})(t,c)(e[t],r[t],c):h[t]=i(r[t],c))}),h)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return o(e,r,t)},{})},e.exports=o},23:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var i=r(373);class s extends i.A{static #e=this.options={itemSelector:"[data-saved-card-item]",tokenInputSelector:"[data-saved-card-token]",displaySelector:"[data-saved-card-display]",placeholderSelector:"[data-saved-card-placeholder]",toggleSelector:"[data-saved-card-toggle]",saveCardWrapperSelector:"[data-save-card-wrapper]"};init(){this._tokenInput=this.el.querySelector(this.options.tokenInputSelector),this._display=this.el.querySelector(this.options.displaySelector),this._placeholder=this.el.querySelector(this.options.placeholderSelector),this._toggle=this.el.querySelector(this.options.toggleSelector),this._saveCardWrapper=this.el.querySelector(this.options.saveCardWrapperSelector),this._items=this.el.querySelectorAll(this.options.itemSelector),this._registerEvents()}_registerEvents(){this._items.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),this._selectCard(e.currentTarget)})})}_selectCard(e){let t=e.dataset.token||"",r=e.dataset.maskedCardNumber||"",i=e.dataset.brandImgUrl||"";this._tokenInput&&(this._tokenInput.value=t,this._tokenInput.dispatchEvent(new Event("change",{bubbles:!0}))),this._renderSelection(t,r,i),this._toggleSaveCardWrapper(t),this._closeDropdown()}_renderSelection(e,t,r){if(this._display&&this._placeholder){if(e&&t){if(this._display.innerHTML="",r){let e=document.createElement("img");e.src=r,e.alt="",e.className="saved-card-brand-icon",this._display.appendChild(e)}let e=document.createElement("span");e.textContent=t,this._display.appendChild(e),this._display.style.display="flex",this._placeholder.style.display="none"}else this._display.style.display="none",this._placeholder.style.display="inline"}}_toggleSaveCardWrapper(e){this._saveCardWrapper&&(this._saveCardWrapper.style.display=e?"none":"")}_closeDropdown(){let e=window.bootstrap;if(this._toggle&&e&&e.Dropdown){let t=e.Dropdown.getInstance(this._toggle);t&&t.hide()}}}},373:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(156),s=r.n(i);class n{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 r=n.toUpperCamelCase(e,t);return n.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class a{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,s=e.split("."),n=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=n;n=function(r){i.unsubscribe(e),t(r)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:r,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}
1reset(){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 o{constructor(e,t={},r=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${r}".`);return}this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),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(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),s().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=n.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-config`);return r?window.PluginConfigManager.get(this._pluginName,r):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-options`);if(r)try{return JSON.parse(r)}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}}}}]);
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.