(()=>{"use strict";var t={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 r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function s(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 o(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=r;var u,c,d=Array.isArray(i);return d!==Array.isArray(t)?r(i,l):d?l.arrayMerge(t,i,l):(c={},(u=l).isMergeableObject(t)&&n(t).forEach(function(e){c[e]=r(t[e],u)}),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&u.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,u)(t[e],i[e],u):c[e]=r(i[e],u))}),c)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}(()=>{i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e}})(),(()=>{i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}})(),(()=>{i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{var t=i(857),e=i.n(t);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()}}}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],n=e.replace(/^data(|-)/,""),o=r.toLowerCamelCase(n,"-");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 a=t.dataset[o];if(void 0===a){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return r.parsePrimitive(a)}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 r=t.querySelector(e)||!1;if(i&&!1===r)throw Error('The required element "'.concat(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&&!s.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 "'.concat(e,'" must exist in parent node!'));return r}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]}}class n{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,s=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(s[0],n),this.listeners.push({splitEventName:s,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}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class o{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 i=r.toDashCase(this._pluginName),n=s.getDataAttribute(this.el,"data-".concat(i,"-config"),!1),o=s.getAttribute(this.el,"data-".concat(i,"-options"),!1),a=[this.constructor.options,this.options,t];n&&a.push(window.PluginConfigManager.get(this._pluginName,n));try{o&&a.push(JSON.parse(o))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(i,'-options" could not be parsed to json: ').concat(t.message))}return e().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={},i=!1){if(!s.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new n(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}class a extends o{init(){this.el.addEventListener("click",this._handleClick.bind(this))}_handleClick(){let t=this.el.closest("form[data-form-ajax-submit]");t||this._onScrollTo();let e=window.PluginManager.getPluginInstanceFromElement(t,"FormAjaxSubmit");e&&e.addCallback(()=>{this._onScrollTo()})}_onScrollTo(){let t=s.querySelector(document,this.options.targetSelector);t&&t.scrollIntoView({behavior:"smooth"})}}a.options={targetSelector:null};let l=window.PluginManager;l.register("B2bQuoteScrollToElement",a,"[data-b2b-quote-scroll-to-element]"),l.register("B2bQuoteItemPlugin",class extends o{init(){this._expirationDate=this.el.querySelector(this.options.selectors.expirationDate),this._status=this.el.querySelector(this.options.selectors.status),this._expiredStatus=this.el.querySelector(this.options.selectors.expiredStatus),this.renderExpiredLabel()}renderExpiredLabel(){var t,e,i,r;let s=(e=this._expirationDate)===null||void 0===e?void 0:(t=e.attributes[this.options.attributes.dataExpiration])===null||void 0===t?void 0:t.value;if(s&&new Date(s)<Date.now()){(i=this._expiredStatus)===null||void 0===i||i.classList.remove("d-none"),(r=this._status)===null||void 0===r||r.classList.add("d-none");return}}},"[data-b2b-quote-item-plugin]"),l.register("B2bQuoteDetailPlugin",class extends o{init(){this._expirationDate=this.el.querySelector(this.options.selectors.expirationDate),this._status=this.el.querySelector(this.options.selectors.status),this._expiredStatus=this.el.querySelector(this.options.selectors.expiredStatus),this._declinedButton=this.el.querySelector(this.options.selectors.declinedButton),this._requestChangesButton=this.el.querySelector(this.options.selectors.requestChangesButton),this._checkoutButton=this.el.querySelector(this.options.selectors.checkoutButton),this.renderExpiredLabel()}renderExpiredLabel(){var t,e,i,r,s,n,o;let a=(e=this._expirationDate)===null||void 0===e?void 0:(t=e.attributes[this.options.attributes.dataExpiration])===null||void 0===t?void 0:t.value;if(a&&new Date(a)<Date.now()){(i=this._expiredStatus)===null||void 0===i||i.classList.remove("d-none"),(r=this._status)===null||void 0===r||r.classList.add("d-none"),(s=this._declinedButton)===null||void 0===s||s.setAttribute("disabled","true"),(n=this._requestChangesButton)===null||void 0===n||n.setAttribute("disabled","true"),(o=this._checkoutButton)===null||void 0===o||o.classList.add("disabled");return}}},"[data-b2b-quote-detail-plugin]")})()})();