PageSourceSearch

https://americansuppressorassociation.com/theme/25eef4fd170a5497d8…roval-rule-condition-value.plugin.3f8697.js

js americansuppressorassociation.com collected 2026-09-24 21:44:20 UTC 11,270 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[62763],{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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l(Array.isArray(t)?[]:{},t,e):t}function s(t,e,i){return t.concat(e).map(function(t){return n(t,i)})}function o(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function r(t,e){try{return e in t}catch(t){return!1}}function l(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||s,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=n;var u,c,h=Array.isArray(i);return h!==Array.isArray(t)?n(i,a):h?a.arrayMerge(t,i,a):(c={},(u=a).isMergeableObject(t)&&o(t).forEach(function(e){c[e]=n(t[e],u)}),o(i).forEach(function(e){(!r(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(r(t,e)&&u.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l})(e,u)(t[e],i[e],u):c[e]=n(i[e],u))}),c)}l.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return l(t,i,e)},{})},t.exports=l},49:(t,e,i)=>{i.d(e,{Z:()=>s});var n=i(140);class s{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!s.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===s.hasAttribute(t,e))throw Error('The required property "'.concat(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],o=e.replace(/^data(|-)/,""),r=n.Z.toLowerCamelCase(o,"-");if(!s.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 l=t.dataset[r];if(void 0===l){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return l}return n.Z.parsePrimitive(l)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelector(e)||!1;if(i&&!1===n)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return n}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelectorAll(e);if(0===n.length&&(n=!1),i&&!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]}}},140:(t,e,i)=>{i.d(e,{Z:()=>n});class 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 i=n.toUpperCamelCase(t,e);return n.lcFirst(i)}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,i)=>{i.d(e,{Z:()=>a});var n=i(857),s=i.n(n),o=i(49),r=i(140);class l{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(n),n}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,s=t.split("."),o=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=o;o=function(i){n.unsubscribe(t),e(i)}}return this.el.addEventListener(s[0],o),this.listeners.push({splitEventName:s,opts:i,cb:o}),!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}
1reset(){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 a{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=r.Z.toDashCase(this._pluginName),i=o.Z.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),n=o.Z.getAttribute(this.el,"data-".concat(e,"-options"),!1),l=[this.constructor.options,this.options,t];i&&l.push(window.PluginConfigManager.get(this._pluginName,i));try{n&&l.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 s().all(l.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={},i=!1){if(!o.Z.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new l(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}},763:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});var n=i(293);class s extends n.Z{init(){this.customConditionValue=this.el.querySelector(this.options.customConditionValue),this.customConditionForm=this.el.querySelector(this.options.customConditionForm),this.paymentMultiSelection=this.el.querySelector(this.options.selectPayment),this.shippingMultiSelection=this.el.querySelector(this.options.selectShipping),this.singleSelect=this.el.querySelector(this.options.singleSelect),this.multiSelect=this.el.querySelector(this.options.multiSelect),this._getApprovalRuleBase(),this._registerEvents(),this._renderValueField()}_registerEvents(){this.customConditionValue.addEventListener("change",this._onChangeCustomConditionValue.bind(this)),this.singleSelect.addEventListener("change",this._onChangeCustomConditionValue.bind(this)),document.$emitter.subscribe("ApprovalRule/onUpdateConditionType",this._renderValueField.bind(this)),document.$emitter.subscribe("MultiSelect/updateValue",this._updateMultiSelectValue.bind(this))}_getApprovalRuleBase(){this._approvalRuleBase=window.PluginManager.getPluginInstanceFromElement(document.querySelector('[data-b2b-approval-rule-base="true"]'),"B2bApprovalRuleBase")}_renderValueField(){var t;let e=this._approvalRuleBase.getCurrentConditionConfig();if(!e){this.customConditionValue.value=0;return}this.valueConfig=Object.values(e.fields)[0],"string"===this.valueConfig.type&&(this.customConditionValue.type="text"),["int","float"].includes(this.valueConfig.type)&&(this.customConditionValue.type="number",this.customConditionValue.step="int"===this.valueConfig.type?1:.01),this._setSuffix(this.valueConfig.name),this.customConditionValue.value=(t=this._approvalRuleBase.currentCondition.value[this.valueConfig.name])!==null&&void 0!==t?t:0,this._replaceValueFieldWithType(this.valueConfig)}_onChangeCustomConditionValue(t){this._updateConditionValue(t.target.value)}_updateConditionValue(t){var e;let i;i=(({int:parseInt,float:parseFloat})[(e=this.valueConfig)===null||void 0===e?void 0:e.type]||(t=>t))(t),this.saveCurrentCondition(i)}_replaceValueFieldWithType(t){let e="single-select"===t.type,i="multi-entity-id-select"===t.type&&"paymentMethodIds"===t.name,n="multi-entity-id-select"===t.type&&"shippingMethodIds"===t.name,s="multi-select"===t.type;e&&this._renderSingleSelectOptions(t.config),s&&(this.multiSelect.setAttribute("config",JSON.stringify(t.config)),this.multiSelect.setAttribute("init-ids",JSON.stringify(this._approvalRuleBase.currentCondition.value[t.name])),document.$emitter.publish("MultiSelect/updateConfig")),this.singleSelect.classList.toggle("d-none",!e),this.multiSelect.classList.toggle("d-none",!s),this.paymentMultiSelection.classList.toggle("d-none",!i),this.shippingMultiSelection.classList.toggle("d-none",!n),this.customConditionValue.classList.toggle("d-none",i||n||s||e),(i||n)&&(i?this.paymentMultiSelection:this.shippingMultiSelection).setAttribute("init-ids",JSON.stringify(this._approvalRuleBase.currentCondition.value[t.name]))}_setSuffix(t){this.suffix=({volume:"m³",weight:"kg"})[t]||"";let e=this.el.querySelector(this.options.additionField);
1e.classList.toggle("d-none",!this.suffix),this.customConditionForm.classList.toggle("single__input",this.suffix),e.textContent=this.suffix}_updateMultiSelectValue(t){let e=t.detail.value||[];this._updateConditionValue(e)}_renderSingleSelectOptions(t){this.singleSelect.innerHTML="";let e=this._approvalRuleBase.currentCondition.value[this.valueConfig.name];if(!(null==t?void 0:t.options))return;let i=t.options.options,n=document.documentElement.lang;i.forEach((t,i)=>{let s=document.createElement("option");s.value=t.value,s.text=t.label[n]||t.label["en-GB"],s.selected=t.value===e,this.singleSelect.appendChild(s),0!==i||e||this.saveCurrentCondition(t.value)})}saveCurrentCondition(t){var e;let i={type:this._approvalRuleBase.currentCondition.type,value:{...this._approvalRuleBase.currentCondition.value,[(e=this.valueConfig)===null||void 0===e?void 0:e.name]:t}};this._approvalRuleBase.setCurrentCondition(i)}}s.options={customConditionValue:"#customConditionValue",customConditionForm:".form-value",additionField:".field__addition",selectPayment:".select__payment",selectShipping:".select__shipping",singleSelect:".single-select",multiSelect:".multi-select"}}}]);

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.