1"use strict";(self.webpackChunkemployee_management=self.webpackChunkemployee_management||[]).push([[60174],{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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l(Array.isArray(e)?[]:{},e,t):e}function n(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function o(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function r(e,t){try{return t in e}catch(e){return!1}}function l(e,i,a){(a=a||{}).arrayMerge=a.arrayMerge||n,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=s;var c,h,u=Array.isArray(i);return u!==Array.isArray(e)?s(i,a):u?a.arrayMerge(e,i,a):(h={},(c=a).isMergeableObject(e)&&o(e).forEach(function(t){h[t]=s(e[t],c)}),o(i).forEach(function(t){(!r(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(r(e,t)&&c.isMergeableObject(i[t])?h[t]=(function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l})(t,c)(e[t],i[t],c):h[t]=s(i[t],c))}),h)}l.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return l(e,i,t)},{})},e.exports=l},174(e,t,i){i.r(t),i.d(t,{default:()=>n});var s=i(737);class n extends s.A{static #e=this.options={membershipSelectSelector:'[name="employeeId"]',companyFilterSelector:"#b2bContextCompany",defaultCheckboxSelector:"#b2bContextSetDefault",defaultGroupSelector:"[data-b2b-context-default-group]",defaultLabelSelector:'label[for="b2bContextSetDefault"]',orgGroupSelector:"[data-b2b-context-org-filter-org-group]",submitButtonSelector:'.modal-footer button[type="submit"].btn-primary'};init(){this.defaultEmployeeId=this.el.getAttribute("data-b2b-context-default-employee")||"",this.membershipSelect=this.el.querySelector(this.options.membershipSelectSelector),this.companyFilter=this.el.querySelector(this.options.companyFilterSelector),this.defaultCheckbox=this.el.querySelector(this.options.defaultCheckboxSelector),this.defaultGroup=this.el.querySelector(this.options.defaultGroupSelector),this.defaultLabel=this.el.querySelector(this.options.defaultLabelSelector),this.orgGroup=this.el.querySelector(this.options.orgGroupSelector),this.submitButton=this.el.querySelector(this.options.submitButtonSelector),this.enhancedSelects=new Map,this.activeDropdown=null,this.busy=!1,this.closeOnClick=this._closeDropdownOnClick.bind(this),this.closeOnFocus=this._closeDropdownOnFocus.bind(this),this.activeEmployeeId=this.membershipSelect?.value||"",this.initialDefaultChecked=""!==this.activeEmployeeId&&this.activeEmployeeId===this.defaultEmployeeId,this._enhanceSelect(this.companyFilter),this._enhanceSelect(this.membershipSelect),this.membershipSelect&&(this.membershipSelect.addEventListener("change",()=>{this._syncEnhancedSelect(this.membershipSelect),this._onSelectionChange()}),this.companyFilter&&this.companyFilter!==this.membershipSelect&&this.companyFilter.addEventListener("change",()=>{this._syncEnhancedSelect(this.companyFilter),this._onSelectionChange()}),this.defaultCheckbox?.addEventListener("change",()=>this._updateSubmitState()),this.el.addEventListener("show.bs.modal",()=>{this.busy=!0,this._syncDefaultCheckbox()}),this.el.addEventListener("shown.bs.modal",()=>{this.busy=!1,this._closeDropdown(),this._syncEnhancedSelect(this.companyFilter),this._syncEnhancedSelect(this.membershipSelect),this._onSelectionChange()}),this.el.addEventListener("hidden.bs.modal",()=>{this.busy=!1,this._closeDropdown(),this._syncDefaultCheckbox()}),this._onSelectionChange()),this.el.hasAttribute("data-b2b-context-modal-autoshow")&&new bootstrap.Modal(this.el).show()}_enhanceSelect(e){if(!e||this.enhancedSelects.has(e))return;let t=document.createElement("div"),i=document.createElement("button"),s=document.createElement("span"),n=document.createElement("div"),o=document.createElement("div"),r=this.el.querySelector(`label[for="${e.id}"]`);t.classList.add("b2b-context-modal-select"),t.dataset.selectId=e.id,i.type="button",i.classList.add("b2b-context-modal-select-toggle"),i.setAttribute("aria-expanded","fal
1se"),i.setAttribute("aria-haspopup","listbox"),i.disabled=e.disabled,s.classList.add("b2b-context-modal-select-label"),i.appendChild(s),n.classList.add("b2b-context-modal-select-menu"),n.hidden=!0,o.classList.add("b2b-context-modal-select-options"),o.id=`${e.id}-listbox`,o.setAttribute("role","listbox"),n.appendChild(o),i.setAttribute("aria-controls",o.id),r&&(r.id||(r.id=`${e.id}-label`),i.setAttribute("aria-labelledby",r.id),r.addEventListener("click",e=>{e.preventDefault(),i.focus(),i.click()})),i.addEventListener("click",()=>this._toggleDropdown(e)),o.addEventListener("click",t=>this._onOptionClick(e,t)),t.append(i,n),e.insertAdjacentElement("afterend",t),e.tabIndex=-1,e.setAttribute("aria-hidden","true"),e.classList.add("b2b-context-modal-native-select"),this.enhancedSelects.set(e,{root:t,toggle:i,label:s,menu:n,options:o}),this._syncEnhancedSelect(e)}_syncEnhancedSelect(e){if(!e)return;let t=this.enhancedSelects.get(e);if(!t)return;let i=Array.from(e.options).find(e=>""===e.value),s=e.selectedOptions[0]||null,n=Array.from(e.options).filter(e=>""!==e.value),o=s&&""!==s.value?s.textContent?.trim()||"":i?.textContent?.trim()||e.getAttribute("placeholder")||"";t.label.textContent=o,t.toggle.classList.toggle("is-placeholder",!s||""===s.value),t.toggle.disabled=e.disabled||0===n.length,t.options.innerHTML="",n.forEach(i=>{let s=document.createElement("button"),n=i.value===e.value;s.type="button",s.classList.add("b2b-context-modal-select-option"),s.dataset.value=i.value,s.setAttribute("role","option"),s.setAttribute("aria-selected",n?"true":"false"),s.classList.toggle("is-selected",n),s.textContent=i.textContent?.trim()||"",t.options.appendChild(s)}),this.activeDropdown===e&&t.toggle.disabled&&this._closeDropdown()}_toggleDropdown(e){if(this.activeDropdown===e){this._closeDropdown(!0);return}this._openDropdown(e)}_openDropdown(e){let t=this.enhancedSelects.get(e);if(!t||t.toggle.disabled)return;this._closeDropdown(),this.activeDropdown=e,t.root.classList.add("show"),t.menu.hidden=!1,t.toggle.setAttribute("aria-expanded","true");let i=t.options.querySelector(".is-selected"),s=t.options.querySelector(".b2b-context-modal-select-option");(i||s)?.focus(),document.addEventListener("click",this.closeOnClick),document.addEventListener("focusin",this.closeOnFocus)}_closeDropdown(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.activeDropdown)return;let t=this.enhancedSelects.get(this.activeDropdown);if(!t){this.activeDropdown=null,document.removeEventListener("click",this.closeOnClick),document.removeEventListener("focusin",this.closeOnFocus);return}t.root.classList.remove("show"),t.menu.hidden=!0,t.toggle.setAttribute("aria-expanded","false"),e&&t.toggle.focus(),this.activeDropdown=null,document.removeEventListener("click",this.closeOnClick),document.removeEventListener("focusin",this.closeOnFocus)}_closeDropdownOnClick(e){if(!this.activeDropdown)return;let t=this.enhancedSelects.get(this.activeDropdown);!t||t.root.contains(e.target)||this._closeDropdown()}_closeDropdownOnFocus(e){if(!this.activeDropdown)return;let t=this.enhancedSelects.get(this.activeDropdown);!t||t.root.contains(e.target)||this._closeDropdown()}_onOptionClick(e,t){let i=t.target.closest(".b2b-context-modal-select-option");i&&this._selectOption(e,i.dataset.value||"")}_selectOption(e,t){e.value!==t&&(e.value=t,e.dispatchEvent(new Event("change",{bubbles:!0}))),this._closeDropdown(!0)}_onSelectionChange(){this._syncDefaultVisibility(),this._syncDefaultLabel(),this._syncDefaultCheckbox(),this._updateSubmitState()}_syncDefaultVisibility(){if(!this.defaultGroup)return;let e=this.companyFilter??this.membershipSelect;this.defaultGroup.hidden=""===(e?.value||"")}_syncDefaultLabel(){if(!this.defaultLabel)return;let e=this.defaultLabel.getAttribute("data-b2b-default-label-company"),t=this.defaultLabel.getAttribute("data-b2b-default-label-company-org");if(!e||!t)return;let i=!!this.orgGroup&&!this.orgGroup.hidden;this.defaultLabel.textContent=i?t:e}_syncDefaultCheckbox(){if(!this.membershipSelect||!this.defaultCheckbox)return;let e=this.membershipSelect.value||"";this.defaultCheckbox.disabled=this.busy||""===e,this.defaultCheckbox.checked=""!==e&&e===this.defaultEmployeeId}_updateSubmitState(){if(!this.membershipSelect||!this.submitButton)return;let e=this.membershipSelect.value||"",t=""!==e&&e!==this.activeEmployeeId,i=!!this.defaultCheckbox&&this.defaultCheckbox.checked!==this.initialDefaultChecked;this.submitButton.disabled=""===e||!t&&!i}}},707(e,t,i){i.d(t,{A:()=>s});class s{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 i=s.toUpperCamelCase(e,t);return s.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>s.ucFirst(e.toLowerCase())).join(""):s.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},737(e,t,i){i.d(t,{A:()=>l});var s=i(156),n=i.n(s),o=i(707);
1class r{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),o=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=o;o=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(n[0],o),this.listeners.push({splitEventName:n,opts:i,cb:o}),!0}unsubscribe(e){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){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 l{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new r(this.el),this._pluginName=this._getPluginName(i),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(){}destroy(){}_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()),n().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=o.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=o.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}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.