"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[74635],{287654(e,t,n){n.d(t,{A:()=>o});const o=(0,n(602086).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},388294(e,t,n){n.d(t,{A:()=>i});var o=n(602086),s=n(287654);function i(e){const{children:t}=e,{isStandalone:n,footer:[,i]}=(0,o.useContext)(s.A);return(0,o.useLayoutEffect)(()=>{if(!n)return i(t),()=>i(null)},[n,t]),o.createElement(o.Fragment,null,n&&t)}},397281(e,t,n){n.d(t,{A:()=>_});var o=n(602086),s=n(53946),i=n(68898),r=n(226883),a=n(120582),l=n(144555),d=n(188430),c=n(711883),m=n(949324),u=n(992450),p=n(77863),h=n(643536),f=n(269758),A=n(968073),g=n(675132),v=n(3249),b=n(8364),y=n(190643),x=n(77699),C=n(426107),E=n(381157),S=n(798282);const O=o.forwardRef((e,t)=>{const{searchInputProps:n,customSearchFilter:O,items:_=[],localizationTexts:M,selectedKeys:N,indeterminateKeys:I,onSelectionChange:j,onIndeterminateKeysChange:L,isVirtualized:T,treeProps:D,onSelectAll:$,onDeselectAll:k,searchInputRef:w,searchInputControl:P,height:R=A.iq,footerActions:B,onClearFilter:V,layout:F="list",autoFocus:K=!1,isAllSelected:U,isSelectAllDisabled:H=!1,hasSelectAllControl:z=!0,virtualizerProps:q,setSelectedKeys:G,gap:Y="spacious",loadMore:J,isLoading:Q,treeLoadMoreItemProps:X,onKeyDown:W,treeMetadata:Z,...ee}=e,te=o.useMemo(()=>"all"===N&&(null==Z?void 0:Z.allKeys)?Z.allKeys:N,[N,null==Z?void 0:Z.allKeys]),ne=o.useMemo(()=>({...A.nX,...M}),[M]),oe=(0,r.U)(w),{value:se,defaultValue:ie,onChange:re,...ae}=o.useMemo(()=>(0,i.v)(A.Ul,n),[n]),{items:le,onValueChange:de,clearFilter:ce,isItemsEmpty:me,isSearching:ue}=(0,b.A)(_,O,re,ie),pe="tree"===F?y.A:x.A,he=o.useMemo(()=>"tree"===F?(0,g.FS)(_):void 0,[_,F]);o.useEffect(()=>{V&&V(ce)},[ce,V]);const{keyboardProps:fe}=(0,s.d)({onKeyDown:e=>{null==W||W(e),(0,C.Ay)(e,()=>{var e,t;null===(t=null===(e=oe.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.focus()},{whitelistedKeys:new Set(["Escape"])})}}),Ae=o.useCallback(()=>(0,v.Qu)(le,null==D?void 0:D.disabledKeys),[le,null==D?void 0:D.disabledKeys]),ge=o.useCallback(()=>null==$?void 0:$(Ae()),[$,Ae]),ve=o.useCallback(()=>null==k?void 0:k(Ae()),[k,Ae]),be=o.useMemo(()=>!!U&&U(Ae()),[U,Ae]),ye=o.useCallback(()=>o.createElement(f.A,{height:A.rh},ne.NO_RESULTS_LABEL),[ne.NO_RESULTS_LABEL]),xe=(0,l.A)(le)&&(0,d.A)(null==D?void 0:D.renderEmptyState)?ye:null==D?void 0:D.renderEmptyState,Ce=o.useMemo(()=>(0,v.nI)(le,null==D?void 0:D.disabledKeys),[le,null==D?void 0:D.disabledKeys]),Ee=ue?void 0:J,Se=!ue&&Q,Oe=H||me||Ce;return o.createElement(c.A,{ref:t,height:R,isVirtualized:T,...fe,...ee},o.createElement(E.A,{ref:oe,variant:"inline",placeholder:ne.SEARCH_PLACEHOLDER,value:se,onChange:de,defaultValue:(0,a.A)(ie,""),...ae,"aria-label":ne.SEARCH_PLACEHOLDER,control:P,autoFocus:K}),!me&&o.createElement(S.A,null),o.createElement(h.A,{isVirtualized:T},o.createElement(pe,{items:le,width:"full",height:T?A.rh:"auto",isVirtualized:T,onSelectionChange:j,selectedKeys:te,indeterminateKeys:I,onIndeterminateKeysChange:L,escapeKeyBehavior:"none",defaultExpandedKeys:he,virtualizerProps:q,gap:Y,loadMore:Ee,isLoading:Se,treeLoadMoreItemProps:X,renderEmptyState:xe,dependencies:[le],...D})),(z||B&&B.length>0)&&o.createElement(m.A,{hasCustomButtons:!!(B&&B.length>0)},z&&o.createElement(u.A,{isAllSelected:!Oe&&be,onSelectAllPress:ge,onDeselectAllPress:ve,localizationTexts:ne,isDisabled:Oe}),B&&B.length>0&&o.createElement(p.A,{controls:B})))});O.displayName="PickList_Default";var _=o.memo(O)},352844(e,t,n){n.d(t,{c:()=>r,z:()=>i});var o=n(241792),s=n(260334);const i=e=>o.Yj().min(1).max(32).refine(t=>!e.some(e=>e.name===t),{message:(0,s.rn)("COMMON_PLEASE_ENTER_UNIQUE_NAME")}),r=e=>o.Ik({name:i(e),member_macs:o.YO(o.Yj()).min(1)})},493849(e,t,n){var o;n.d(t,{k:()=>o}),function(e){e.CLIENTS="CLIENTS",e.USERS="USERS"}(o||(o={}))},486061(e,t,n){n.d(t,{VT:()=>r,i9:()=>s,ng:()=>a,nt:()=>i});var o=n(751271);const s=n(409844).AH`
  font-size: ${o.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,i=112,r=20,a=345},531984(e,t,n){n.d(t,{w:()=>r});var o=n(602086),s=n(977872),i=n(205521);const r=e=>{const t=(0,s.wA)();(0,o.useEffect)(()=>{t((0,i.SQ)(e))},[t,e])}},762542(e,t,n){n.d(t,{y:()=>s});var o=n(531984);const s=e=>(0,o.w)(e.formState.isDirty)},535322(e,t,n){n.d(t,{A:()=>h,I:()=>o});var o,s=n(274934),i=n(505817),r=n(753583),a=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const u=(0,a.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${i.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,a.A)(r.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${i.Ay[`desktop-border-divider-${t}`]};`:""}
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:i,flex:r,width:a,nested:l,...d})=>"items"in d?(0,s.jsx)(p,{marginBottom:t,margin:n,padding:i,flex:r,nested:l,...d}):(0,s.jsx)(u,{nested:l,width:a,marginBottom:t,margin:n,padding:i,flex:r,isButtonList:e===o.BUTTON_LIST,...d,children:d.children})},597750(e,t,n){n.d(t,{A:()=>r});var o=n(274934),s=n(486061),i=n(100978);const r=({maxWidth:e,label:t,children:n,...r})=>(0,o.jsxs)(i.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?s.ng:e,...r,children:[t,n]})},164487(e,t,n){n.d(t,{A:()=>d});var o=n(274934),s=n(903952),i=n(184931),r=n(309130),a=n(304151),l=n(100978);const d=({tooltip:e,htmlFor:t,children:n,labelProps:d,wrapperProps:c,tooltipProps:m})=>{const u=(0,i.iL)();return(0,o.jsxs)(l.A,{alignItems:"center",gap:r.YC,...c,children:[(0,o.jsx)(s.A,{as:"label",htmlFor:t,color:"tertiary",...d,style:{opacity:u?r.xN:void 0,...d?.style},children:n}),e?(0,o.jsx)(a.A,{description:e,...m}):null]})}},89469(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(602086),i=n(309130),r=n(100978);const a=(0,s.forwardRef)((e,t)=>(0,o.jsx)(r.A,{ref:t,flexDirection:"column",gap:i.kc,width:"100%",...e}))},756782(e,t,n){n.d(t,{A:()=>g});var o=n(274934),s=n(505817),i=n(602086),r=n(179102),a=n(247816),l=n(309130),d=n(590979),c=n(147045),m=n(291508),u=n(304151),p=n(100978),h=n(535322),f=n(89469);const A=(0,a.A)(h.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?s.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,g=({children:e,title:t,tooltip:n,tooltipProps:s,[c.L]:a,titleAction:m,isOutlined:h})=>{const g=(e=>i.Children.toArray(e).length>0)(e);return(0,o.jsx)(A,{marginBottom:"none",...d.A.addDataTestId(a??""),isOutlined:h,children:(0,o.jsxs)(p.A,{flexDirection:"column",...g&&{gap:l.Ln},width:"100%",children:[t?(0,o.jsxs)(p.A,{alignItems:"center",gap:l.YC,justifyContent:"space-between",width:"100%",children:[(0,o.jsxs)(p.A,{gap:l.YC,alignItems:"center",children:[(0,o.jsx)(r.A,{variant:"heading-medium",children:t}),n?(0,o.jsx)(u.A,{description:n,portal:!0,...s}):null]}),m?(0,o.jsx)(p.A,{children:m}):null]}):null,g?(0,o.jsx)(f.A,{children:e}):null]})})}},115114(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(388294),i=n(247816),r=n(409844),a=n(751636);const l=(0,i.A)("div")`
  height: 66px;
`,d=r.AH`
  padding: 0px !important;
`,c=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:i,...r})=>e?(0,o.jsx)(s.A,{children:(0,o.jsx)(a.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:i,className:d,...r})}):(0,o.jsx)(l,{})},751636(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(526744),i=n(470070),r=n(247816),a=n(291508),l=n(309130);const d=(0,r.A)("footer",(0,a.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:r,onFormSubmit:a,onFormReset:l,onFormCancel:c,className:m,submitButtonText:u,customButton:p,applyButton:h,hideCancelButton:f,form:A,testConfigFooter:g})=>(0,o.jsx)(d,{className:m,hasFormResetButton:!!l,children:g||(0,o.jsxs)(o.Fragment,{children:[p,f?null:(0,o.jsx)(s.A,{name:"cancel",variant:"default",type:"button",onClick:c,disabled:!e&&!t,children:(0,o.jsx)(i.sA,{id:"COMMON_ACTION_CANCEL"})}),l?(0,o.jsx)(s.A,{name:"reset",variant:"default",type:"button",onClick:l,disabled:!t,children:(0,o.jsx)(i.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,h||(0,o.jsx)(s.A,{name:"submit",variant:"primary",type:"submit",onClick:a,disabled:!t||n||r,form:A,children:(0,o.jsx)(i.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})})]})})},274635(e,t,n){n.r(t),n.d(t,{default:()=>z});var o=n(274934),s=n(977872),i=n(602086),r=n(159469),a=n(464920),l=n(762542),d=n(635891),c=n(877840),m=n(121713),u=n(42220),p=n(117948),h=n(314191),f=n(656647),A=n(100978),g=n(650632),v=n(831433),b=n(34118);const y=function({form:e,name:t,additionalInfo:n="mac",excludeUnifiDevices:r,getGroup:a,groups:l,...d}){const c=(0,u.FH)({control:e.control,name:t}),m=(0,s.d4)(b.GB),y=(0,i.useMemo)(()=>{const e=m.filter(e=>!(r&&"unifi_device"in e&&e.unifi_device)),t=(c||[]).filter(t=>!e.some(e=>"mac"in e&&e.mac===t)).map(e=>({mac:e,name:e})),n=[...e,...t].flatMap(e=>"mac"in e?[e]:[]);return(l&&a?(0,p.A)(Object.entries((0,h.A)(n,a)),([e])=>l[e]?.order??0).map(([e,t])=>({id:e,label:l[e]?.label,options:t})).filter(e=>e.options.length>0):[{id:void 0,label:void 0,options:n}]).flatMap(({options:e,label:t,id:n})=>[...t&&n?[{type:"SECTION",title:t,id:n,children:[]}]:[],...e.map(e=>({type:"CHECKBOX",title:(0,v.tn)(e),id:e.mac,checkboxProps:{symbol:(0,o.jsx)(A.A,{maxWidth:24,maxHeight:24,children:(0,o.jsx)(g.A,{client:e})})},children:[]}))])},[n,m.length,c,r]),x=(0,i.useCallback)(()=>{e.setValue(t,y.map(e=>e.id),{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})},[y,e,t]),C=(0,i.useCallback)(()=>{const n=new Set(e.getValues(t));return y.length>0&&y.every(e=>n.has(e.id))},[y,e,t]);return(0,o.jsx)(f.A,{control:e.control,name:t,options:y,isVirtualized:!0,onSelectAll:x,isAllSelected:C,...d})};var x=n(449339),C=n(309130),E=n(756782),S=n(535322),O=n(205521),_=n(700444),M=n(470070),N=n(493849),I=n(169642),j=n(352844),L=n(823469),T=n(897166),D=n(969288),$=n(115114),k=n(179102),w=n(613468),P=n(246303),R=n(207555),B=n(266824),V=n(83985),F=n(775211);const K=({existingRecord:e})=>{const t=(0,s.wA)();return(0,o.jsx)("div",{children:(0,o.jsxs)(R.A,{children:[(0,o.jsx)(P.A,{children:(0,o.jsx)(B.A,{fontSize:"medium",variant:"destructive",children:(0,o.jsx)(M.sA,{id:"COMMON_ACTION_DELETE"})})}),(0,o.jsx)(w.A,{actionButtons:(0,o.jsx)(V.A,{variant:"destructive",onPress:async()=>{await t((0,L.aX)(e.id)),await t((0,F.rt)())},children:(0,o.jsx)(M.sA,{id:"COMMON_ACTION_DELETE"})}),title:(0,o.jsx)(M.sA,{id:"COMMON_ARE_YOU_SURE"}),children:(0,o.jsx)(k.A,{variant:"inherit",size:"medium",children:(0,o.jsx)(M.sA,{id:"COMMON_CLIENT_GROUP_DELETE_CONFIRMATION",values:{name:e?.name}})})})]})})},U="network-members-group-form",H=({activeItem:e})=>{const t=e&&e.id!==D.R6?e:void 0,n=(0,s.wA)(),u=(0,s.d4)(T.EL),p=(0,s.d4)(I.y),h=(0,i.useMemo)(()=>p.filter(e=>e.id!==t?.id),[t?.id,p]),f=(0,i.useMemo)(()=>(0,j.c)(h),[h]),g=(0,m.m)({schema:f,defaultValues:{name:t?.name||"",member_macs:t?.members||[]}});(0,l.y)(g);const v=g.handleSubmit(e=>n((0,L.YH)({id:t?.id,name:e.name,members:e.member_macs,type:t?.type||N.k.CLIENTS})).then(async e=>(await n((0,L.O$)(void 0,{resolveWithExisting:!1})),e)).then(e=>{n((0,O.SQ)(!1)),n((0,O.XP)({type:x.H.NETWORK_MEMBERS_GROUP,id:e.id}))}).then(()=>g.reset()).catch(e=>{const t=(0,a.F)(e)?e:void 0;n((0,_.ox)({icon:r.C.danger,message:"COMMON_CLIENT_GROUP_FAILED_SAVE",errorMessage:t?.msg,errorValues:t?.details}))}));return(0,o.jsx)("form",{onSubmit:v,id:U,children:(0,o.jsxs)(c.A,{isDisabled:u,children:[(0,o.jsxs)(A.A,{gap:C.kc,flexDirection:"column",width:"100%",children:[(0,o.jsxs)(E.A,{children:[(0,o.jsx)(d.A,{control:g.control,name:"name",label:(0,o.jsx)(M.sA,{id:"COMMON_NAME"})}),(0,o.jsx)(y,{form:g,name:"member_macs"})]}),t?(0,o.jsx)(S.A,{children:(0,o.jsx)(K,{existingRecord:t})}):null]}),(0,o.jsx)($.A,{onFormCancel:()=>g.reset(),isDirty:g.formState.isDirty||!t,hideCancelButton:!g.formState.isDirty,form:U,isSubmitting:g.formState.isSubmitting,submitButtonText:t?"COMMON_ACTION_SAVE":"COMMON_ACTION_CREATE"})]})})},z=({activeItem:e})=>(0,o.jsx)(H,{activeItem:e},e.id)},121713(e,t,n){n.d(t,{m:()=>h});var o=n(602086),s=n(977872),i=n(42220),r=n(369289),a=n(721533),l=n(700444),d=n(159469),c=n(260334);const m=(e,t=[])=>{if(!e||"object"!=typeof e)return[];const n=e;return[...Object.keys(n).filter(e=>"ref"!==e).flatMap(e=>m(n[e],[...t,e])),..."string"==typeof n.message&&n.message?[{path:n.ref?.name??t.join("."),message:n.message}]:[]]},u=e=>[...Array.from(document.getElementsByName(e)),document.getElementById(e),document.querySelector(`label[for="${e}"]`),document.querySelector(`[data-field-error="${e}"]`)].find(e=>e instanceof HTMLElement&&null!==e.offsetParent)??null,p=e=>{const t=(e.split(".").pop()??e).replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e};function h({schema:e,defaultValues:t,presets:n,mode:h="onTouched"}){const f=(0,s.wA)(),A=(0,c.L_)(),g=(0,o.useMemo)(()=>n?(0,r.A)(n,e=>e.defaultValues):{},[n]),v=(0,o.useMemo)(()=>({...t,...g}),[g,t]),b=(0,i.mN)({resolver:(0,a.u)(e),shouldFocusError:!0,defaultValues:v,shouldUseNativeValidation:!1,mode:h}),y=(0,o.useRef)(v);y.current=v;const x=(0,o.useRef)(null),{submitCount:C}=b.formState;(0,o.useEffect)(()=>{const e=x.current;if(x.current=null,!e)return;const t=m(e),n=t[0],o=n?.path??Object.keys(e)[0];if(o)try{const e=t.map(e=>u(e.path)).find(Boolean)??(t.length?null:u(o));if(e)e.scrollIntoView?.({behavior:"smooth",block:"center"}),e.focus?.({preventScroll:!0});else{const e=n&&A(n.message);f((0,l.ox)(n&&e?{icon:d.C.danger,title:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE",translateTitle:!0,message:"COMMON_VALIDATION_HIDDEN_FIELDS_DETAIL",values:{field:p(n.path),message:e}}:{icon:d.C.danger,message:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE"}))}}catch{}},[C,f,A]);const E=(0,o.useCallback)((...e)=>{const[t,...n]=e;return b.reset(t?{...t,...g}:y.current,...n)},[g,b]);return{...b,reset:E,formState:{...b.formState,isDirty:!!Object.keys(b.formState.dirtyFields).length,isSubmitting:b.formState.isSubmitting,defaultValues:b.formState.defaultValues},handleSubmit:(...e)=>b.handleSubmit(e[0],(t,...n)=>{x.current=t,e[1]?.(t,...n)})}}},877840(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(602086),i=n(184931),r=n(712642);const a=({isDisabled:e,isAdditive:t=!0,children:n})=>{const a=(0,i.pv)(),l=(0,s.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),d=(0,s.useMemo)(()=>({fields:t?l.fields||a.fields:l.fields,labels:t?l.labels||a.labels:l.labels,tooltipIcons:t?l.tooltipIcons||a.tooltipIcons:l.tooltipIcons,tooltipPopovers:t?l.tooltipPopovers||a.tooltipPopovers:l.tooltipPopovers}),[t,l.fields,l.labels,l.tooltipIcons,l.tooltipPopovers,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers]);return(0,o.jsx)(r.I.Provider,{value:d,children:n})}},260334(e,t,n){n.d(t,{L_:()=>c,MS:()=>d,rn:()=>l});var o=n(602086),s=n(949812),i=n(765282),r=n(470070);const a="{::}",l=(e,t)=>`${e}${a}${JSON.stringify(t??{})}`,d=(e,t)=>{if("string"!=typeof t)return;const[n,...o]=t.split(a);if(!n||!o.length)return t;let s={};try{s=Object.fromEntries(Object.entries(JSON.parse(o.join(a))).map(([t,n])=>[t,"string"==typeof n?d(e,n):n]))}catch{}return e.formatMessage({id:n},s)};function c(){const{formatMessage:e}=(0,r.tz)();return(0,o.useCallback)(t=>d({formatMessage:e},t),[e])}s.pJ((e,t)=>e.message?{message:e.message}:e.code===i.eq.too_small&&"string"===e.type?{message:l("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===i.eq.too_big&&"string"===e.type?{message:l("COMMON_MAX_CHARS",{name:l("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===i.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:l("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===i.eq.too_small&&"array"===e.type?{message:l("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===i.eq.invalid_type&&"undefined"===e.received?{message:l("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===i.eq.invalid_type&&"number"===e.expected?{message:l("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},656647(e,t,n){n.d(t,{A:()=>h});var o=n(274934),s=n(602086),i=n(42220),r=n(399935),a=n(397281),l=n(164487),d=n(597750),c=n(309130),m=n(260334),u=n(184931);const p=()=>{},h=function({control:e,name:t,tooltip:n,label:h,options:f,isVirtualized:A,isAllSelected:g,onSelectAll:v,disabledKeys:b,maxSelections:y}){const x=(0,u.mQ)(),C=(0,m.L_)(),{field:E,fieldState:S,formState:O}=(0,i.as)({control:e,name:t}),_=(0,s.useMemo)(()=>new Set(E.value),[E.value]),M=(0,s.useMemo)(()=>x?f.map(e=>e.id):b||f.flatMap(e=>"CHECKBOX"===e.type&&(e.checkboxProps?.isDisabled||y&&_.size>=y&&!_.has(e.id))?[e.id]:[]),[x,f,b,y,_]),N=(0,s.useCallback)(()=>E.onChange(f.map(e=>e.id)),[f,E]),I=(0,s.useMemo)(()=>g||(()=>!!f.length&&f.every(e=>_.has(e.id))),[g,f,_]),j=(0,s.useCallback)(()=>E.onChange([]),[E]),L=(0,s.useMemo)(()=>({disabledKeys:M}),[M]),T=(0,s.useCallback)(e=>{E.onChange("all"!==e?[...e]:f.map(e=>e.id))},[E,f]);return(0,o.jsxs)(d.A,{style:{opacity:x?c.xN:void 0},children:[h?(0,o.jsx)(l.A,{tooltip:n,children:h}):null,(0,o.jsx)(a.A,{onSelectionChange:T,"aria-disabled":x,selectedKeys:_,treeProps:L,items:f,isVirtualized:A,setSelectedKeys:p,onSelectAll:v??N,onDeselectAll:j,isAllSelected:I,hasSelectAllControl:!y}),S.invalid?(0,o.jsx)(r.A,{isInvalid:!0,label:C((0,i.Jt)(O.errors,t)?.message)}):void 0]})}},635891(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(42220),i=n(699709),r=n(775250),a=n(309130),l=n(260334),d=n(184931);const c=function({control:e,name:t,label:n,placeholder:c,tooltip:m,tooltipProps:u,autoFocus:p,motif:h,onChange:f,onBlur:A,onAfterChange:g,onPaste:v,onKeyDown:b,passwordToggle:y,type:x,helperMessage:C,autoComplete:E,contentBefore:S,contentAfter:O,onFocus:_,value:M,invalid:N}){const I=(0,d.mQ)(),j=(0,d.Im)(),L=(0,d.q)(),T=(0,l.L_)();return(0,o.jsx)(s.xI,{control:e,name:t,render:({field:e,fieldState:l,formState:d})=>(0,o.jsx)(i.A,{type:x||(y?"password":"text"),variant:"secondary",width:"100%",autoFocus:p,...e,onChange:t=>{f?f(t,e,d):e.onChange(t),g?.(t)},onBlur:t=>{A?A(t,e,d):e.onBlur()},onFocus:_,onPaste:v,disabled:I,value:M??e.value?.toString(),invalid:N||(l.invalid?(0,o.jsxs)(r.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[T((0,s.Jt)(d.errors,t)?.message)||!0," "]}):void 0),label:n,placeholder:c,labelTooltip:m,labelTooltipProps:{style:{opacity:j?a.xN:void 0,pointerEvents:L?"none":void 0,...u?.style},...u},motif:h,passwordToggle:y,helperMessage:C,autoComplete:E,onKeyDown:b,contentBefore:S,contentAfter:O})})}},721533(e,t,n){n.d(t,{u:()=>c});var o=n(42220);const s=(e,t,n)=>{if(e&&"reportValidity"in e){const s=(0,o.Jt)(n,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},i=(e,t)=>{for(const n in t.fields){const o=t.fields[n];o&&o.ref&&"reportValidity"in o.ref?s(o.ref,n,e):o&&o.refs&&o.refs.forEach(t=>s(t,n,e))}},r=(e,t)=>{t.shouldUseNativeValidation&&i(e,t);const n={};for(const s in e){const i=(0,o.Jt)(t.fields,s),r=Object.assign(e[s]||{},{ref:i&&i.ref});if(a(t.names||Object.keys(e),s)){const e=Object.assign({},(0,o.Jt)(n,s));(0,o.hZ)(e,"root",r),(0,o.hZ)(n,s,e)}else(0,o.hZ)(n,s,r)}return n},a=(e,t)=>{const n=l(t);return e.some(e=>l(e).match(`^${n}\\.\\d+`))};function l(e){return e.replace(/\]|\[/g,"")}function d(e,t){for(var n={};e.length;){var s=e[0],i=s.code,r=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var l=s.unionErrors[0].errors[0];n[a]={message:l.message,type:l.code}}else n[a]={message:r,type:i};if("unionErrors"in s&&s.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var d=n[a].types,c=d&&d[s.code];n[a]=(0,o.Gb)(a,t,n,i,c?[].concat(c,s.message):s.message)}e.shift()}return n}function c(e,t,n){return void 0===n&&(n={}),function(o,s,a){try{return Promise.resolve(function(s,r){try{var l=Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](o,t)).then(function(e){return a.shouldUseNativeValidation&&i({},a),{errors:{},values:n.raw?Object.assign({},o):e}})}catch(e){return r(e)}return l&&l.then?l.then(void 0,r):l}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:r(d(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}}},314191(e,t,n){n.d(t,{A:()=>r});var o=n(967059),s=n(24627),i=Object.prototype.hasOwnProperty;const r=(0,s.A)(function(e,t,n){i.call(e,n)?e[n].push(t):(0,o.A)(e,n,[t])})}}]);