"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[1323],{31323:(e,t,o)=>{o.r(t),o.d(t,{default:()=>v,useCreatable:()=>d});var n=o(87462),i=o(99196),a=o(91253),r=o(65342),l=o(1413),u=o(42982),s=o(45987),c=o(37274),p=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],g=function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,o=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase(),n=String(t.getOptionValue(e)).toLowerCase(),i=String(t.getOptionLabel(e)).toLowerCase();return n===o||i===o},f={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,o,n){return!(!e||t.some((function(t){return g(e,t,n)}))||o.some((function(t){return g(e,t,n)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function d(e){var t=e.allowCreateWhileLoading,o=void 0!==t&&t,n=e.createOptionPosition,r=void 0===n?"last":n,g=e.formatCreateLabel,d=void 0===g?f.formatCreateLabel:g,v=e.isValidNewOption,O=void 0===v?f.isValidNewOption:v,C=e.getNewOptionData,b=void 0===C?f.getNewOptionData:C,w=e.onCreateOption,L=e.options,h=void 0===L?[]:L,m=e.onChange,N=(0,s.Z)(e,p),V=N.getOptionValue,Z=void 0===V?a.g:V,D=N.getOptionLabel,P=void 0===D?a.b:D,S=N.inputValue,W=N.isLoading,_=N.isMulti,k=N.value,M=N.name,y=(0,i.useMemo)((function(){return O(S,(0,c.H)(k),h,{getOptionValue:Z,getOptionLabel:P})?b(S,d(S)):void 0}),[d,b,P,Z,S,O,h,k]),A=(0,i.useMemo)((function(){return!o&&W||!y?h:"first"===r?[y].concat((0,u.Z)(h)):[].concat((0,u.Z)(h),[y])}),[o,r,W,y,h]),H=(0,i.useCallback)((function(e,t){if("select-option"!==t.action)return m(e,t);var o=Array.isArray(e)?e:[e];if(o[o.length-1]!==y)m(e,t);else if(w)w(S);else{var n=b(S,S),i={action:"create-option",name:M,option:n};m((0,c.D)(_,[].concat((0,u.Z)((0,c.H)(k)),[n]),n),i)}}),[b,S,_,M,y,w,m,k]);return(0,l.Z)((0,l.Z)({},N),{},{options:A,onChange:H})}o(91850),o(73469);var v=(0,i.forwardRef)((function(e,t){var o=d((0,r.u)(e));return i.createElement(a.S,(0,n.Z)({ref:t},o))}))}}]);