"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[776],{84295(t,e,o){o.d(e,{A:()=>u});var n=o(68102),a=o(36418),i=o(22580),r=o(36512),l=o(50026),u=(o(40140),o(93759),(0,a.forwardRef)(function(t,e){var o=(0,r.u)(t),u=(0,l.u)(o);return a.createElement(i.S,(0,n.A)({ref:e},u))}))},50026(t,e,o){o.d(e,{u:()=>f});var n=o(27405),a=o(94300),i=o(81515),r=o(36418),l=o(7453),u=o(22580),p=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],s=function(){var t=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,o=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase(),n=String(e.getOptionValue(t)).toLowerCase(),a=String(e.getOptionLabel(t)).toLowerCase();return n===o||a===o},c={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,e,o,n){return!(!t||e.some(function(e){return s(t,e,n)})||o.some(function(e){return s(t,e,n)}))},getNewOptionData:function(t,e){return{label:e,value:t,__isNew__:!0}}};function f(t){var e=t.allowCreateWhileLoading,o=void 0!==e&&e,s=t.createOptionPosition,f=void 0===s?"last":s,g=t.formatCreateLabel,d=void 0===g?c.formatCreateLabel:g,v=t.isValidNewOption,w=void 0===v?c.isValidNewOption:v,C=t.getNewOptionData,O=void 0===C?c.getNewOptionData:C,m=t.onCreateOption,h=t.options,b=void 0===h?[]:h,L=t.onChange,A=(0,i.A)(t,p),N=A.getOptionValue,V=void 0===N?u.g:N,S=A.getOptionLabel,_=void 0===S?u.b:S,k=A.inputValue,D=A.isLoading,M=A.isMulti,y=A.value,H=A.name,P=(0,r.useMemo)(function(){return w(k,(0,l.H)(y),b,{getOptionValue:V,getOptionLabel:_})?O(k,d(k)):void 0},[d,O,_,V,k,w,b,y]),W=(0,r.useMemo)(function(){return!o&&D||!P?b:"first"===f?[P].concat((0,a.A)(b)):[].concat((0,a.A)(b),[P])},[o,f,D,P,b]),x=(0,r.useCallback)(function(t,e){if("select-option"!==e.action)return L(t,e);var o=Array.isArray(t)?t:[t];if(o[o.length-1]!==P)L(t,e);else if(m)m(k);else{var n=O(k,k),i={action:"create-option",name:H,option:n};L((0,l.D)(M,[].concat((0,a.A)((0,l.H)(y)),[n]),n),i)}},[O,k,M,H,P,m,L,y]);return(0,n.A)((0,n.A)({},A),{},{options:W,onChange:x})}},22628(t,e,o){var n=o(28612),a=o(37095),i=o(31091),r=o(66960),l=o(33392),u=o(35599),p=o(73005),s=o(30670),c=Array,f=Math.max,g=Math.min;n({target:"Array",proto:!0},{toSpliced:function(t,e){var o,n,a,d,v=u(this),w=r(v),C=l(t,w),O=arguments.length,m=0;for(0===O?o=n=0:1===O?(o=0,n=w-C):(o=O-2,n=g(f(p(e),0),w-C)),a=i(w+o-n),d=c(a);m<C;m++)s(d,m,v[m]);for(;m<C+o;m++)s(d,m,arguments[m-C+2]);for(;m<a;m++)s(d,m,v[m+n-o]);return d}}),a("toSpliced")}}]);
//# sourceMappingURL=776.06b719f9d765cd457c6f.js.map