import e from"../../node_modules/lodash/isEmpty.js";import o from"../../node_modules/lodash/isNil.js";import t,{useMemo as r}from"react";import l from"./ObjectTypeahead.js";import a from"./StringTypeahead.js";function s({allowNew:s,disableSorting:m,labelKey:i,options:n,sortBy:p,clearable:d=!0,...c}){const y=r((()=>m?n:o(p)?o(i)||e(n)||"string"!=typeof i(n[0])?[...n].sort():[...n].sort(((e,o)=>i(e).localeCompare(i(o)))):[...n].sort(p)),[m,p,i,n]),b=document.getElementById("portal-root");return!0===s?t.createElement(a,{...c,allowNew:!0,labelKey:i,menuPortalTarget:b,options:y,isClearable:d}):t.createElement(l,{...c,labelKey:i,menuPortalTarget:b,options:y,isClearable:d})}export{s as default};
//# sourceMappingURL=Typeahead.js.map
