import e from"react";import{Flex as t}from"@vibe/layout/mockedClassNames";import r from"../MultiSelectedValues/MultiSelectedValues.js";import l from"./DropdownInput.js";import{useDropdownContext as i}from"../../context/DropdownContext.js";import a from"./TriggerActions.js";import n from"./Trigger.module.scss.js";import{getStyle as o}from"../../../../../helpers/typesciptCssModulesHelper.js";import s from"classnames";import m from"./DropdownChip.js";var d=function(){var d,u=i(),p=u.selectedItems,c=void 0===p?[]:p,v=u.contextOnOptionRemove,f=u.multiline,b=u.disabled,g=u.readOnly,E=u.error,y=u.searchable,j=u.getToggleButtonProps,h=u.label,x=u.getLabelProps,C=u.ariaLabel,O=u.minVisibleCount;return e.createElement(t,{justify:"space-between",align:"center"},e.createElement("div",Object.assign({className:s(n.triggerWrapper,o(n,u.size))},y?{}:j({"aria-haspopup":"dialog","aria-labelledby":h?x().id:void 0,"aria-label":C||(h||null===(d=x())||void 0===d?void 0:d.id),"aria-disabled":b?"true":void 0,"aria-invalid":E?"true":void 0,"aria-readonly":g?"true":void 0})),c.length>0?e.createElement("div",{className:n.multiWrapper},f?e.createElement(t,{gap:"xs",wrap:!0},c.map((function(r,i){var a,n;return e.createElement(t,{key:(null!==(n=null!==(a=r.id)&&void 0!==a?a:r.value)&&void 0!==n?n:i)+""},e.createElement("div",{style:{flexShrink:0}},e.createElement(m,{item:r,onDelete:function(){null==v||v(r)},readOnly:g,disabled:b})),i===c.length-1&&e.createElement(l,{inputSize:"small"}))}))):e.createElement(r,{disabled:b,readOnly:g,selectedItems:c,onRemove:function(e){null==v||v(e)},renderInput:function(){return e.createElement(l,{inputSize:"small"})},minVisibleCount:O})):e.createElement(l,null)),e.createElement(a,null))};export{d as default};
//# sourceMappingURL=MultiSelectTrigger.js.map
