import{r as a}from"./app-DTeOhhdM.js";import{P as we,C as Ue,O as m,u as Je,h as Mt,d as C,f as Xe,e as qe,j as Vt,m as d,g as Z,p as Kt,c as M,T as ze,v as Me,r as We,k as Gt,o as de,n as _t,V as Bt,U as Ht,l as ke,w as $t,R as Ze,Z as Se,i as Ut}from"./AuthenticatedLayout-DNj-hWy1.js";import{T as Jt,C as Pe}from"./index.esm-xhUioO7y.js";import{I as Xt}from"./inputtext.esm-DvYkLvTo.js";function V(){return V=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var n=arguments[l];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},V.apply(this,arguments)}function pe(e){"@babel/helpers - typeof";return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},pe(e)}function qt(e,l){if(pe(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,l);if(pe(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(e)}function zt(e){var l=qt(e,"string");return pe(l)==="symbol"?l:String(l)}function ce(e,l,n){return l=zt(l),l in e?Object.defineProperty(e,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[l]=n,e}function Ee(e,l){(l==null||l>e.length)&&(l=e.length);for(var n=0,t=new Array(l);n<l;n++)t[n]=e[n];return t}function Wt(e){if(Array.isArray(e))return Ee(e)}function Zt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ye(e,l){if(e){if(typeof e=="string")return Ee(e,l);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,l)}}function Yt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e){return Wt(e)||Zt(e)||Ye(e)||Yt()}function Qt(e){if(Array.isArray(e))return e}function en(e,l){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var t,p,O,f,w=[],I=!0,v=!1;try{if(O=(n=n.call(e)).next,l!==0)for(;!(I=(t=O.call(n)).done)&&(w.push(t.value),w.length!==l);I=!0);}catch(j){v=!0,p=j}finally{try{if(!I&&n.return!=null&&(f=n.return(),Object(f)!==f))return}finally{if(v)throw p}}return w}}function tn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function me(e,l){return Qt(e)||en(e,l)||Ye(e,l)||tn()}var nn={root:function(l){var n=l.props,t=l.focusedState,p=l.overlayVisibleState;return M("p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":n.display==="chip","p-disabled":n.disabled,"p-multiselect-clearable":n.showClear&&!n.disabled,"p-focus":t,"p-inputwrapper-filled":m.isNotEmpty(n.value),"p-inputwrapper-focus":t||p})},label:function(l){var n=l.props,t=l.empty;return M("p-multiselect-label",{"p-placeholder":t&&n.placeholder,"p-multiselect-label-empty":t&&!n.placeholder&&!n.selectedItemTemplate,"p-multiselect-items-label":!t&&n.display!=="chip"&&n.value.length>n.maxSelectedLabels})},panel:function(l){var n=l.panelProps,t=l.context,p=l.allowOptionSelect;return M("p-multiselect-panel p-component",{"p-multiselect-inline":n.inline,"p-multiselect-flex":n.flex,"p-multiselect-limited":!p,"p-input-filled":t&&t.inputStyle==="filled"||de.inputStyle==="filled","p-ripple-disabled":t&&t.ripple===!1||de.ripple===!1})},list:function(l){var n=l.virtualScrollerOptions;return"p-multiselect-items p-component"},labelContainer:"p-multiselect-label-container",triggerIcon:"p-multiselect-trigger-icon p-c",trigger:"p-multiselect-trigger",clearIcon:"p-multiselect-clear-icon",tokenLabel:"p-multiselect-token-label",token:"p-multiselect-token",removeTokenIcon:"p-multiselect-token-icon",wrapper:"p-multiselect-items-wrapper",emptyMessage:"p-multiselect-empty-message",itemGroup:"p-multiselect-item-group",closeButton:"p-multiselect-close p-link",header:"p-multiselect-header",closeIcon:"p-multiselect-close-icon",headerCheckboxContainer:"p-multiselect-select-all",headerCheckboxIcon:"p-multiselect-select-all p-checkbox-icon p-c",headerSelectAllLabel:"p-multiselect-select-all-label",filterContainer:"p-multiselect-filter-container",filterIcon:"p-multiselect-filter-icon",item:function(l){var n=l.itemProps;return M("p-multiselect-item",{"p-highlight":n.selected,"p-disabled":n.disabled})},checkboxContainer:"p-checkbox p-component",checkboxIcon:"p-checkbox-icon p-c",checkbox:function(l){var n=l.itemProps;return M("p-checkbox-box",{"p-highlight":n.selected})},transition:"p-connected-overlay"},ln=`
@layer primereact {
    .p-multiselect {
        display: inline-flex;
        user-select: none;
        cursor: pointer;
    }
    
    .p-multiselect-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        cursor: pointer;
    }
    
    .p-multiselect-label-container {
        overflow: hidden;
        flex: 1 1 auto;
        cursor: pointer;
    }
    
    .p-multiselect-label  {
        display: block;
        white-space: nowrap;
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .p-multiselect-label-empty {
        overflow: hidden;
        visibility: hidden;
    }
    
    .p-multiselect-token {
        cursor: default;
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
    }
    
    .p-multiselect-token-icon {
        cursor: pointer;
    }
    
    .p-multiselect .p-multiselect-panel {
        min-width: 100%;
    }
    
    .p-multiselect-inline.p-multiselect-panel {
        border: none;
        position: initial;
        background: none;
        box-shadow: none;
    }
    
    .p-multiselect-inline.p-multiselect-panel .p-multiselect-items {
        padding: 0;
    }
    
    .p-multiselect-flex.p-multiselect-panel .p-multiselect-items {
        display: flex;
        flex-wrap: wrap;
    }
    
    .p-multiselect-items-wrapper {
        overflow: auto;
    }
    
    .p-multiselect-items {
        margin: 0;
        padding: 0;
        list-style-type: none;
    }
    
    .p-multiselect-item {
        cursor: pointer;
        display: flex;
        align-items: center;
        font-weight: normal;
        white-space: nowrap;
        position: relative;
        overflow: hidden;
    }
    
    .p-multiselect-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .p-multiselect-select-all-label {
        margin-left: 0.5rem;
    }
    
    .p-multiselect-filter-container {
        position: relative;
        flex: 1 1 auto;
    }
    
    .p-multiselect-filter-icon {
        position: absolute;
        top: 50%;
        margin-top: -.5rem;
    }
    
    .p-multiselect-filter-container .p-inputtext {
        width: 100%;
    }
    
    .p-multiselect-close {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden;
        position: relative;
        margin-left: auto;
    }
    
    .p-multiselect-clear-icon {
        position: absolute;
        top: 50%;
        margin-top: -.5rem;
    }
    
    .p-fluid .p-multiselect {
        display: flex;
    }
}
`,rn={root:function(l){var n=l.props;return n.showClear&&!n.disabled&&{position:"relative"}},itemGroup:function(l){var n=l.scrollerOptions;return{height:n.props?n.props.itemSize:void 0}}},fe=Ue.extend({defaultProps:{__TYPE:"MultiSelect",appendTo:null,ariaLabelledBy:null,checkboxIcon:null,className:null,clearIcon:null,closeIcon:null,dataKey:null,disabled:!1,display:"comma",dropdownIcon:null,emptyMessage:null,emptyFilterMessage:null,filter:!1,filterBy:null,filterInputAutoFocus:!0,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,fixedPlaceholder:!1,flex:!1,id:null,inline:!1,inputId:null,inputRef:null,itemCheckboxIcon:null,itemClassName:null,itemTemplate:null,maxSelectedLabels:null,name:null,onBlur:null,onChange:null,onClick:null,onFilter:null,onFocus:null,onHide:null,onRemove:null,onSelectAll:null,onShow:null,optionDisabled:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,overlayVisible:!1,panelClassName:null,panelFooterTemplate:null,panelHeaderTemplate:null,panelStyle:null,placeholder:null,removeIcon:null,resetFilterOnHide:!1,scrollHeight:"200px",selectAll:!1,selectedItemTemplate:null,selectedItemsLabel:"{0} items selected",selectionLimit:null,showClear:!1,showSelectAll:!0,style:null,tabIndex:0,tooltip:null,tooltipOptions:null,transitionOptions:null,useOptionAsValue:!1,value:null,virtualScrollerOptions:null,children:void 0},css:{classes:nn,styles:ln,inlineStyles:rn}}),an={icon:"p-checkbox-icon p-c",input:function(l){var n=l.props,t=l.checked,p=l.focusedState;return M("p-checkbox-box",{"p-highlight":t,"p-disabled":n.disabled,"p-focus":p})},root:function(l){var n=l.props,t=l.checked,p=l.focusedState;return M("p-checkbox p-component",{"p-checkbox-checked":t,"p-checkbox-disabled":n.disabled,"p-checkbox-focused":p})}},on=`
.p-checkbox {
    display: inline-flex;
    cursor: pointer;
    user-select: none;
    vertical-align: bottom;
    position: relative;
}

.p-checkbox.p-checkbox-disabled {
    cursor: auto;
}

.p-checkbox-box {
    display: flex;
    justify-content: center;
    align-items: center;
}        
`,ve=Ue.extend({defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,name:null,onChange:null,onClick:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},css:{classes:an,styles:on}});function Ve(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l&&(t=t.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,t)}return n}function Ke(e){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?Ve(Object(n),!0).forEach(function(t){ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Qe=a.memo(a.forwardRef(function(e,l){var n=a.useContext(we),t=ve.getProps(e,n),p=a.useState(!1),O=me(p,2),f=O[0],w=O[1],I=ve.setMetaData({props:t,state:{focused:f},context:{checked:t.checked===t.trueValue,disabled:t.disabled}}),v=I.ptm,j=I.cx,H=I.isUnstyled;Je(ve.css.styles,H,{name:"checkbox",styled:!0});var K=a.useRef(null),P=a.useRef(t.inputRef),k=function(h){if(!(t.disabled||t.readOnly)&&(t.onChange||t.onClick)){var B=$(),Y=h.target instanceof HTMLDivElement||h.target instanceof HTMLSpanElement||h.target instanceof Object,W=h.target===P.current,Q=Y&&h.target.checked!==B;if(W||Q){var le=B?t.falseValue:t.trueValue,re={originalEvent:h,value:t.value,checked:le,stopPropagation:function(){h.stopPropagation()},preventDefault:function(){h.preventDefault()},target:{type:"checkbox",name:t.name,id:t.id,value:t.value,checked:le}};if(t.onClick&&t.onClick(re),h.defaultPrevented)return;t.onChange&&t.onChange(re)}C.focus(P.current),h.preventDefault()}},N=function(){w(!0)},G=function(){w(!1)},A=function(h){(h.code==="Space"||h.key===" ")&&k(h)},$=function(){return t.checked===t.trueValue};a.useImperativeHandle(l,function(){return{props:t,focus:function(){return C.focus(P.current)},getElement:function(){return K.current},getInput:function(){return P.current}}}),a.useEffect(function(){m.combinedRefs(P,t.inputRef)},[P,t.inputRef]),qe(function(){P.current.checked=$()},[t.checked,t.trueValue]),Xe(function(){t.autoFocus&&C.focus(P.current,t.autoFocus)});var x=$(),U=m.isNotEmpty(t.tooltip),R=ve.getOtherProps(t),_=m.reduceKeys(R,C.ARIA_PROPS),J=d({className:j("icon")},v("icon")),S=x?t.icon||a.createElement(Pe,J):null,o=Z.getJSXIcon(S,Ke({},J),{props:t,checked:x}),b=d({id:t.id,className:M(t.className,j("root",{checked:x,focusedState:f})),style:t.style,onClick:function(h){return k(h)},onContextMenu:t.onContextMenu,onMouseDown:t.onMouseDown},R,v("root")),D=d({className:"p-hidden-accessible"},v("hiddenInputWrapper")),E=d(Ke({id:t.inputId,type:"checkbox",name:t.name,tabIndex:t.tabIndex,defaultChecked:x,onFocus:function(h){return N()},onBlur:function(h){return G()},onKeyDown:function(h){return A(h)},disabled:t.disabled,readOnly:t.readOnly,required:t.required},_),v("hiddenInput")),L=d({className:j("input",{checked:x,focusedState:f}),"data-p-highlight":x,"data-p-disabled":t.disabled,"data-p-focus":f},v("input"));return a.createElement(a.Fragment,null,a.createElement("div",V({ref:K},b),a.createElement("div",D,a.createElement("input",V({ref:P},E))),a.createElement("div",L,o)),U&&a.createElement(ze,V({target:K,content:t.tooltip},t.tooltipOptions,{pt:v("tooltip")})))}));Qe.displayName="Checkbox";function Ge(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l&&(t=t.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,t)}return n}function be(e){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?Ge(Object(n),!0).forEach(function(t){ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var et=a.memo(function(e){var l=e.ptm,n=e.cx,t=e.isUnstyled,p={filter:function(o){return f(o)},reset:function(){return e.resetFilter()}},O=function(o,b){return l(o,be({hostName:e.hostName},b))},f=function(o){e.onFilter&&e.onFilter({originalEvent:o,query:o.target.value})},w=function(o){e.onSelectAll&&e.onSelectAll({originalEvent:o,checked:e.selectAll}),o.preventDefault(),o.stopPropagation()},I=function(){var o=d({className:n("filterIcon")},O("filterIcon")),b=e.filterIcon||a.createElement($t,o),D=Z.getJSXIcon(b,be({},o),{props:e});if(e.filter){var E=d({className:n("filterContainer")},O("filterContainer")),L=a.createElement("div",E,a.createElement(Xt,{ref:e.filterRef,type:"text",role:"textbox",value:e.filterValue,onChange:f,className:"p-multiselect-filter",placeholder:e.filterPlaceholder,pt:l("filterInput"),__parentMetadata:{parent:e.metaData}}),D);if(e.filterTemplate){var y={className:E.className,element:L,filterOptions:p,onFilter:f,filterIconClassName:e.filterIconClassName,props:e};L=m.getJSXElement(e.filterTemplate,y)}return a.createElement(a.Fragment,null,L)}return null},v=I(),j=e.id?e.id+"_selectall":Ht(),H=d({htmlFor:j,className:n("headerSelectAllLabel")},O("headerSelectAllLabel")),K=d({className:n("headerCheckboxIcon")},O("headerCheckboxIcon")),P=e.itemCheckboxIcon||a.createElement(Pe,K),k=Z.getJSXIcon(P,be({},K),{selected:e.selected}),N=e.showSelectAll&&a.createElement("div",{className:"p-multiselect-select-all"},a.createElement(Qe,{id:j,checked:e.selectAll,onChange:w,role:"checkbox","aria-checked":e.selectAll,icon:k,pt:l("headercheckbox"),unstyled:t()}),!e.filter&&a.createElement("label",H,e.selectAllLabel)),G=d({className:n("closeIcon"),"aria-hidden":!0},O("closeIcon")),A=e.closeIcon||a.createElement(We,G),$=Z.getJSXIcon(A,be({},G),{props:e}),x=d({className:n("header")},O("header")),U=d({type:"button",className:n("closeButton"),"aria-label":ke("close"),onClick:e.onClose},O("closeButton")),R=a.createElement("button",U,$,a.createElement(Ze,null)),_=a.createElement("div",x,N,v,R);if(e.template){var J={className:"p-multiselect-header",checkboxElement:N,checked:e.selectAll,onChange:w,filterElement:v,closeElement:R,closeElementClassName:"p-multiselect-close p-link",closeIconClassName:"p-multiselect-close-icon",onCloseClick:e.onClose,element:_,itemCheckboxIcon:k,props:e};return m.getJSXElement(e.template,J)}return _});et.displayName="MultiSelectHeader";function _e(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l&&(t=t.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,t)}return n}function cn(e){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?_e(Object(n),!0).forEach(function(t){ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ce=a.memo(function(e){var l=e.ptm,n=e.cx,t=function(N){return l(N,{hostName:e.hostName,context:{selected:e.selected}})},p=function(N){e.onClick&&e.onClick({originalEvent:N,option:e.option}),N.preventDefault(),N.stopPropagation()},O=function(N){e.onKeyDown&&e.onKeyDown({originalEvent:N,option:e.option})},f=d({className:n("checkboxIcon")},t("checkboxIcon")),w=e.checkboxIcon||a.createElement(Pe,f),I=e.selected?Z.getJSXIcon(w,cn({},f),{selected:e.selected}):null,v=e.template?m.getJSXElement(e.template,e.option):e.label,j=e.disabled?null:e.tabIndex||0,H=d({className:n("checkboxContainer")},t("checkboxContainer")),K=d({className:n("checkbox",{itemProps:e}),"data-p-highlight":e.selected},t("checkbox")),P=d({className:M(e.className,e.option.className,n("item",{itemProps:e})),style:e.style,onClick:p,tabIndex:j,onKeyDown:O,role:"option","aria-selected":e.selected,"data-p-highlight":e.selected,"data-p-disabled":e.disabled},t("item"));return a.createElement("li",P,a.createElement("div",H,a.createElement("div",K,I)),a.createElement("span",null,v),a.createElement(Ze,null))});Ce.displayName="MultiSelectItem";function Be(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l&&(t=t.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,t)}return n}function ne(e){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?Be(Object(n),!0).forEach(function(t){ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tt=a.memo(a.forwardRef(function(e,l){var n=a.useRef(null),t=a.useRef(null),p=a.useContext(we),O=e.ptm,f=e.cx,w=e.sx,I=e.isUnstyled,v=function(o,b){return O(o,ne({hostName:e.hostName},b))},j=function(){e.onEnter(function(){if(n.current){var o=e.getSelectedOptionIndex();o!==-1&&setTimeout(function(){return n.current.scrollToIndex(o)},0)}})},H=function(){e.onEntered(function(){e.filter&&e.filterInputAutoFocus&&t.current&&C.focus(t.current,!1)})},K=function(o){n.current&&n.current.scrollToIndex(0),e.onFilterInputChange&&e.onFilterInputChange(o)},P=function(){return!(e.visibleOptions&&e.visibleOptions.length)&&e.hasFilter},k=function(){return a.createElement(et,{hostName:e.hostName,id:e.id,filter:e.filter,filterRef:t,filterValue:e.filterValue,filterTemplate:e.filterTemplate,onFilter:K,filterPlaceholder:e.filterPlaceholder,onClose:e.onCloseClick,showSelectAll:e.showSelectAll,selectAll:e.isAllSelected(),selectAllLabel:e.selectAllLabel,onSelectAll:e.onSelectAll,template:e.panelHeaderTemplate,resetFilter:e.resetFilter,closeIcon:e.closeIcon,filterIcon:e.filterIcon,itemCheckboxIcon:e.itemCheckboxIcon,ptm:O,cx:f,isUnstyled:I,metaData:e.metaData})},N=function(){if(e.panelFooterTemplate){var o=m.getJSXElement(e.panelFooterTemplate,e,e.onOverlayHide);return a.createElement("div",{className:"p-multiselect-footer"},o)}return null},G=function(o,b){var D=e.getOptionGroupChildren(o);return D.map(function(E,L){var y=e.getOptionLabel(E),h=L+"_"+e.getOptionRenderKey(E),B=e.isOptionDisabled(E),Y=B?null:e.tabIndex||0,W=e.isSelected(E);return a.createElement(Ce,{hostName:e.hostName,key:h,label:y,option:E,style:b,template:e.itemTemplate,selected:W,onClick:e.onOptionSelect,onKeyDown:e.onOptionKeyDown,tabIndex:Y,disabled:B,className:e.itemClassName,checkboxIcon:e.checkboxIcon,ptm:O,cx:f})})},A=function(){var o=m.getJSXElement(e.emptyFilterMessage,e)||ke("emptyFilterMessage"),b=d({className:f("emptyMessage")},v("emptyMessage"));return a.createElement("li",b,o)},$=function(){var o=m.getJSXElement(e.emptyMessage,e)||ke("emptyMessage"),b=d({className:f("emptyMessage")},v("emptyMessage"));return a.createElement("li",b,o)},x=function(o,b){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E={height:D.props?D.props.itemSize:void 0};if(e.optionGroupLabel){var L=e.optionGroupTemplate?m.getJSXElement(e.optionGroupTemplate,o,b):e.getOptionGroupLabel(o),y=G(o,E),h=b+"_"+e.getOptionGroupRenderKey(o),B=d({className:f("itemGroup"),style:w("itemGroup",{scrollerOptions:D})},v("itemGroup"));return a.createElement(a.Fragment,{key:h},a.createElement("li",B,L),y)}else{var Y=e.getOptionLabel(o),W=b+"_"+e.getOptionRenderKey(o),Q=e.isOptionDisabled(o),le=Q?null:e.tabIndex||0,re=e.isSelected(o);return a.createElement(Ce,{hostName:e.hostName,key:W,label:Y,option:o,style:E,template:e.itemTemplate,selected:re,onClick:e.onOptionSelect,onKeyDown:e.onOptionKeyDown,tabIndex:le,disabled:Q,className:e.itemClassName,checkboxIcon:e.checkboxIcon,ptm:O,cx:f})}},U=function(){return m.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(x):e.hasFilter?A():$()},R=function(){if(e.virtualScrollerOptions){var o=ne(ne({},e.virtualScrollerOptions),{style:ne(ne({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:M("p-multiselect-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,autoSize:!0,onLazyLoad:function(y){return e.virtualScrollerOptions.onLazyLoad(ne(ne({},y),{filter:e.filterValue}))},itemTemplate:function(y,h){return y&&x(y,h.index,h)},contentTemplate:function(y){var h=P()?A():y.children,B=d({ref:y.contentRef,style:y.style,className:M(y.className,f("list",{virtualScrollerProps:e.virtualScrollerOptions})),role:"listbox","aria-multiselectable":!0},v("list"));return a.createElement("ul",B,h)}});return a.createElement(Bt,V({ref:n},o,{pt:O("virtualScroller"),__parentMetadata:{parent:e.metaData}}))}else{var b=U(),D=d({className:f("wrapper"),style:{maxHeight:e.scrollHeight}},v("wrapper")),E=d({className:f("list"),role:"listbox","aria-multiselectable":!0},v("list"));return a.createElement("div",D,a.createElement("ul",E,b))}},_=function(){var o=e.allowOptionSelect(),b=k(),D=R(),E=N(),L=d({className:M(e.panelClassName,f("panel",{panelProps:e,context:p,allowOptionSelect:o})),style:e.panelStyle,onClick:e.onClick},v("panel"));if(e.inline)return a.createElement("div",V({ref:l},L),D,E);var y=d({classNames:f("transition"),in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:j,onEntered:H,onExit:e.onExit,onExited:e.onExited},v("transition"));return a.createElement(_t,V({nodeRef:l},y),a.createElement("div",V({ref:l},L),b,D,E))},J=_();return e.inline?J:a.createElement(Gt,{element:J,appendTo:e.appendTo})}));tt.displayName="MultiSelectPanel";function He(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l&&(t=t.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,t)}return n}function q(e){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?He(Object(n),!0).forEach(function(t){ce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ie(e,l){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=un(e))||l){n&&(e=n);var t=0,p=function(){};return{s:p,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(v){throw v},f:p}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var O=!0,f=!1,w;return{s:function(){n=n.call(e)},n:function(){var v=n.next();return O=v.done,v},e:function(v){f=!0,w=v},f:function(){try{!O&&n.return!=null&&n.return()}finally{if(f)throw w}}}}function un(e,l){if(e){if(typeof e=="string")return $e(e,l);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(e,l)}}function $e(e,l){(l==null||l>e.length)&&(l=e.length);for(var n=0,t=new Array(l);n<l;n++)t[n]=e[n];return t}var sn=a.memo(a.forwardRef(function(e,l){var n=a.useContext(we),t=fe.getProps(e,n),p=a.useState(""),O=me(p,2),f=O[0],w=O[1],I=a.useState(!1),v=me(I,2),j=v[0],H=v[1],K=a.useState(t.inline),P=me(K,2),k=P[0],N=P[1],G=a.useRef(null),A=a.useRef(t.inputRef),$=a.useRef(null),x=a.useRef(null),U=f&&f.trim().length>0,R=m.isEmpty(t.value),_=t.optionValue?null:t.dataKey,J={props:t,state:{filterState:f,focused:j,overlayVisible:k}},S=fe.setMetaData(J),o=S.ptm,b=S.cx,D=S.sx,E=S.isUnstyled;Je(fe.css.styles,E,{name:"multiselect"});var L=Mt({target:G,overlay:x,listener:function(r,i){var u=i.type,s=i.valid;s&&(u==="outside"?!De(r)&&!ft(r)&&X():X())},when:k}),y=me(L,2),h=y[0],B=y[1],Y=function(r){Ut.emit("overlay-click",{originalEvent:r,target:G.current})},W=function(){return!t.selectionLimit||!t.value||t.value&&t.value.length<t.selectionLimit},Q=function(r){var i=r.originalEvent,u=r.option;if(!(t.disabled||ee(u))){var s=z(u),g=je(u),T=ae(u),F=W();T?ue(i,t.value.filter(function(oe){return!m.equals(g?oe:z(oe),s,_)}),u):F&&ue(i,[].concat(xe(t.value||[]),[s]),u)}},le=function(r){var i=r.originalEvent,u=i.currentTarget;switch(i.which){case 40:var s=re(u);s&&s.focus(),i.preventDefault();break;case 38:var g=ye(u);g&&g.focus(),i.preventDefault();break;case 13:case 32:Q(r),i.preventDefault();break;case 27:X(),C.focus(A.current);break}},re=function c(r){var i=r.nextElementSibling;return i?C.getAttribute(i,"data-p-disabled")===!0||C.getAttribute(i,"data-pc-section")==="itemgroup"?c(i):i:null},ye=function c(r){var i=r.previousElementSibling;return i?C.getAttribute(i,"data-p-disabled")===!0||C.getAttribute(i,"data-pc-section")==="itemgroup"?c(i):i:null},nt=function(r){!t.inline&&!t.disabled&&!mt(r)&&C.getAttribute(r.target,"data-pc-section")!=="removetokenicon"&&!De(r)&&(k?X():se(),C.focus(A.current),r.preventDefault())},lt=function(r){switch(r.which){case 40:if(t.inline)break;!k&&r.altKey&&(se(),r.preventDefault());break;case 32:if(t.inline)break;k?X():se(),r.preventDefault();break;case 27:if(t.inline)break;X();break;case 9:if(k){var i=C.getFirstFocusableElement(x.current);i&&(i.focus(),r.preventDefault())}break}},rt=function(r){if(t.onSelectAll)t.onSelectAll(r);else{var i=null;if(r.checked){if(i=[],te){var u=te.filter(function(g){return ee(g)&&ae(g)});i=u.map(function(g){return z(g)})}}else if(te){var s=te.filter(function(g){return!ee(g)||ae(g)});t.optionGroupLabel?(i=[],s.forEach(function(g){return i=[].concat(xe(i),xe(ie(g).filter(function(T){return!ee(T)}).map(function(T){return z(T)})))})):i=s.map(function(g){return z(g)})}ue(r.originalEvent,i,i)}},ue=function(r,i,u){t.onChange&&t.onChange({originalEvent:r,value:i,selectedOption:u,stopPropagation:function(){r.stopPropagation()},preventDefault:function(){r.preventDefault()},target:{name:t.name,id:t.id,value:i}})},at=function(r){var i=r.query;w(i),t.onFilter&&t.onFilter({originalEvent:r,filter:i})},Ne=function(){w(""),t.onFilter&&t.onFilter({filter:""})},it=function(){var r=C.findSingle(x.current,"li.p-highlight");r&&r.scrollIntoView&&r.scrollIntoView({block:"nearest",inline:"nearest"})},se=function(){N(!0)},X=function(){N(!1)},ot=function(r){Se.set("overlay",x.current,n&&n.autoZIndex||de.autoZIndex,n&&n.zIndex.overlay||de.zIndex.overlay),C.addStyles(x.current,{position:"absolute",top:"0",left:"0"}),he(),it(),r&&r()},ct=function(r){r&&r(),h(),t.onShow&&t.onShow()},ut=function(){B()},st=function(){t.filter&&t.resetFilterOnHide&&Ne(),Se.clear(x.current),t.onHide&&t.onHide()},he=function(){C.alignOverlay(x.current,$.current.parentElement,t.appendTo||n&&n.appendTo||de.appendTo)},De=function(r){return C.getAttribute(r.target,"data-pc-section")==="clearicon"},ft=function(r){return C.getAttribute(r.target,"data-pc-section")==="headercheckboxcontainer"},mt=function(r){return x.current&&x.current.contains(r.target)},dt=function(r){X(),C.focus(A.current),r.preventDefault(),r.stopPropagation()},pt=function(){if(t.value!=null&&t.options)if(t.optionGroupLabel){var r=0,i=t.options.findIndex(function(u,s){return(r=s)&&Le(t.value,ie(u))!==-1});return i!==-1?{group:r,option:i}:-1}else return Le(t.value,t.options);return-1},Le=function(r,i){return i.findIndex(function(u){return r.some(function(s){return m.equals(s,z(u),_)})})},ae=function(r){if(t.value){var i=z(r),u=je(r);return t.value.some(function(s){return m.equals(u?s:z(s),i,_)})}return!1},Fe=function(r){var i;if(t.options)if(t.optionGroupLabel){var u=Ie(t.options),s;try{for(u.s();!(s=u.n()).done;){var g=s.value;if(i=ge(r,ie(g)),i)break}}catch(T){u.e(T)}finally{u.f()}}else i=ge(r,t.options),m.isEmpty(i)&&(i=ge(r,t.value));return i?Oe(i):null},ge=function(r,i){return i.find(function(u){return m.equals(z(u),r,_)})},vt=function(r){H(!0),t.onFocus&&t.onFocus(r)},bt=function(r){H(!1),t.onBlur&&t.onBlur(r)},yt=function(){if(t.onSelectAll)return t.selectAll;if(m.isEmpty(te))return!1;var r=te.filter(function(F){return!ee(F)});if(t.optionGroupLabel){var i=!0,u=Ie(r),s;try{for(u.s();!(s=u.n()).done;){var g=s.value,T=ie(g).filter(function(F){return!ee(F)});T.some(function(F){return!ae(F)})===!0&&(i=!1)}}catch(F){u.e(F)}finally{u.f()}return i}else return!r.some(function(F){return!ae(F)})},Oe=function(r){return t.optionLabel?m.resolveFieldData(r,t.optionLabel):r&&r.label!==void 0?r.label:r},z=function(r){if(t.useOptionAsValue)return r;if(t.optionValue){var i=m.resolveFieldData(r,t.optionValue);return i!==null?i:r}return r&&r.value!==void 0?r.value:r},ht=function(r){return t.dataKey?m.resolveFieldData(r,t.dataKey):Oe(r)},gt=function(r){return m.resolveFieldData(r,t.optionGroupLabel)},Ot=function(r){return m.resolveFieldData(r,t.optionGroupLabel)},ie=function(r){return m.resolveFieldData(r,t.optionGroupChildren)},ee=function(r){return t.optionDisabled?m.isFunction(t.optionDisabled)?t.optionDisabled(r):m.resolveFieldData(r,t.optionDisabled):r&&r.disabled!==void 0?r.disabled:!1},je=function(r){return!t.useOptionAsValue&&t.optionValue||r&&r.value!==void 0},St=function(r,i){var u=t.value.filter(function(s){return!m.equals(s,i,_)});t.onRemove&&t.onRemove({originalEvent:r,value:u}),ue(r,u,i)},Ae=function(){var r=/{(.*?)}/;return r.test(t.selectedItemsLabel)?t.selectedItemsLabel.replace(t.selectedItemsLabel.match(r)[0],t.value.length+""):t.selectedItemsLabel},xt=function(){var r;return!R&&!t.fixedPlaceholder?m.isNotEmpty(t.maxSelectedLabels)&&t.value.length>t.maxSelectedLabels?Ae():m.isArray(t.value)?t.value.reduce(function(i,u,s){return i+(s!==0?", ":"")+Fe(u)},""):"":r},It=function(){if(t.selectedItemTemplate)return R?m.getJSXElement(t.selectedItemTemplate):m.isNotEmpty(t.maxSelectedLabels)&&t.value.length>t.maxSelectedLabels?Ae():t.value.map(function(i,u){var s=m.getJSXElement(t.selectedItemTemplate,i);return a.createElement(a.Fragment,{key:u},s)});if(t.display==="chip"&&!R){var r=t.value.slice(0,t.maxSelectedLabels||t.value.length);return r.map(function(i,u){var s=Fe(i),g=d({key:u,className:b("removeTokenIcon"),onClick:function(Rt){return St(Rt,i)}},o("removeTokenIcon")),T=!t.disabled&&(t.removeIcon?Z.getJSXIcon(t.removeIcon,q({},g),{props:t}):a.createElement(Jt,g)),F=d({className:b("token")},o("token")),oe=d({key:s+u,className:b("tokenLabel")},o("tokenLabel"));return a.createElement("div",V({},F,{key:s}),a.createElement("span",oe,s),T)})}return xt()},kt=function(){if(U){var r=f.trim().toLocaleLowerCase(t.filterLocale),i=t.filterBy?t.filterBy.split(","):[t.optionLabel||"label"];if(t.optionGroupLabel){var u=[],s=Ie(t.options),g;try{for(s.s();!(g=s.n()).done;){var T=g.value,F=Me.filter(ie(T),i,r,t.filterMatchMode,t.filterLocale);F&&F.length&&u.push(q(q({},T),ce({},t.optionGroupChildren,F)))}}catch(oe){s.e(oe)}finally{s.f()}return u}else return Me.filter(t.options,i,r,t.filterMatchMode,t.filterLocale)}else return t.options};a.useImperativeHandle(l,function(){return{props:t,show:se,hide:X,focus:function(){return C.focus(A.current)},getElement:function(){return G.current},getOverlay:function(){return x.current},getInput:function(){return A.current}}}),Xe(function(){he()}),a.useEffect(function(){m.combinedRefs(A,t.inputRef)},[A,t.inputRef]),a.useEffect(function(){setTimeout(function(){t.overlayVisible?se():X()},100)},[t.overlayVisible]),qe(function(){k&&f&&U&&he()},[k,f,U]),Vt(function(){Se.clear(x.current)});var Et=function(){var r=d({className:b("clearIcon"),onClick:function(g){return ue(g,[],[])}},o("clearIcon")),i=t.clearIcon||a.createElement(We,r),u=Z.getJSXIcon(i,q({},r),{props:t});return!R&&t.showClear&&!t.disabled?u:null},Ct=function(){var r=It(),i=d({ref:$,className:b("labelContainer")},o("labelContainer")),u=d({className:b("label",{empty:R})},o("label"));return a.createElement("div",i,a.createElement("div",u,r||t.placeholder||"empty"))},te=kt(),wt=m.isNotEmpty(t.tooltip),Te=fe.getOtherProps(t),Pt=m.reduceKeys(Te,C.ARIA_PROPS),Re=d({className:b("triggerIcon")},o("triggerIcon")),Nt=d({className:b("trigger")},o("trigger")),Dt=a.createElement("div",Nt,t.dropdownIcon?Z.getJSXIcon(t.dropdownIcon,q({},Re),{props:t}):a.createElement(Kt,Re)),Lt=!t.inline&&Ct(),Ft=!t.inline&&Et(),jt=d(q(q({ref:G,id:t.id,style:q(q({},t.style),D("root")),className:M(t.className,b("root",{focusedState:j,overlayVisibleState:k}))},Te),{},{onClick:nt}),fe.getOtherProps(t),o("root")),At=d({className:"p-hidden-accessible"},o("hiddenInputWrapper")),Tt=d(q({ref:A,id:t.inputId,name:t.name,type:"text",onFocus:vt,onBlur:bt,onKeyDown:lt,role:"listbox","aria-expanded":k,disabled:t.disabled,tabIndex:t.tabIndex},Pt),o("input"));return a.createElement(a.Fragment,null,a.createElement("div",jt,a.createElement("div",At,a.createElement("input",V({},Tt,{readOnly:!0}))),!t.inline&&a.createElement(a.Fragment,null,Lt,Ft,Dt),a.createElement(tt,V({hostName:"MultiSelect",ref:x,visibleOptions:te},t,{onClick:Y,onOverlayHide:X,filterValue:f,hasFilter:U,onFilterInputChange:at,resetFilter:Ne,onCloseClick:dt,onSelectAll:rt,getOptionLabel:Oe,getOptionRenderKey:ht,isOptionDisabled:ee,getOptionGroupChildren:ie,getOptionGroupLabel:Ot,getOptionGroupRenderKey:gt,isSelected:ae,getSelectedOptionIndex:pt,isAllSelected:yt,onOptionSelect:Q,allowOptionSelect:W,onOptionKeyDown:le,in:k,onEnter:ot,onEntered:ct,onExit:ut,onExited:st,ptm:o,cx:b,sx:D,isUnstyled:E,metaData:J}))),wt&&a.createElement(ze,V({target:G,content:t.tooltip},t.tooltipOptions,{pt:o("tooltip")})))}));sn.displayName="MultiSelect";export{sn as M};
