"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[68219],{49992:(e,t,n)=>{n.d(t,{Ay:()=>A,hK:()=>m,wi:()=>s});var a=n(296540),l=n(951272),i=n(758649),r=n(71479),o=n(566723),d=n(699784),c=n(705426);const s=(0,r.A)("footer")`
  display: flex;
  flex-direction: row;
  gap: ${o.Ln};
  padding: 0 ${o.Er} ${o.Er};
`,m=(0,r.A)("footer")`
  flex: 1;
`;function u(e,t){return"function"==typeof e?e(t):e}function p(e,t){return null===e?null:e||t}const A=function({onDismiss:e,title:t,size:n,children:r,className:o,secondaryActions:A,primaryActions:E,cancelAction:f,submitAction:C,shouldCloseOnOverlayClick:b,allowOverflow:g,...h}){return a.createElement(l.l1,{...h},l=>a.createElement(c.A,{size:n,onRequestClose:e,title:t,className:o,contentElement:(e,t)=>a.createElement("div",{...e},a.createElement("form",{onSubmit:l.handleSubmit},t)),allowOverflow:g,shouldCloseOnOverlayClick:b??!l.dirty,footer:a.createElement(s,null,u(A,l),a.createElement(m,null),u(E,l),u(p("function"==typeof f?f(l):f,a.createElement(i.A,{type:"button",onClick:e},a.createElement(d.sA,{id:"COMMON_ACTION_CANCEL"}))),l),u(p("function"==typeof C?C(l):C,a.createElement(i.A,{type:"submit",variant:"primary"},a.createElement(d.sA,{id:"COMMON_ACTION_APPLY_CHANGES"}))),l))},u(r,l)))}},242366:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(296540),l=n(566723),i=n(294303);const r=(0,a.forwardRef)((e,t)=>a.createElement(i.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},329109:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(296540),l=n(691441),i=n(71479),r=n(132196),o=n(373229);const d=(0,i.A)("div")`
  height: 66px;
`,c=r.AH`
  padding: 0px !important;
`,s=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:i,...r})=>e?a.createElement(l.A,null,a.createElement(o.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:i,className:c,...r})):a.createElement(d,null)},349665:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(296540),l=n(705228),i=n(294303);const r=({maxWidth:e,...t})=>a.createElement(i.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?l.ng:e,...t})},369596:(e,t,n)=>{n.d(t,{A:()=>_});var a=n(469733),l=n(296540),i=n(165126),r=n(566401),o=n(951272),d=n(429252),c=n.n(d),s=n(271856),m=n(56016),u=n(963070),p=n(758649),A=n(86838),E=n(718073),f=n(71479),C=n(132196),b=n(79760),g=n(596441),h=n(454195),v=n(566723),O=n(766624),y=n(143811),w=n(294303),N=n(955161),x=n(699784),I=n(602021),T=n(968906),k=n(586371),F=n(333422);const M=y.A,$=(0,f.A)(A.A)`
  padding-top: 0;
  padding-bottom: 0;
`,S=C.AH`
  opacity: ${v.xN};
`;const _=function({fieldName:e,newFields:t,fieldLabels:n={},onAddItem:d,onRemoveItem:A,validationSchema:f,initialValues:C,onEditSubmit:_,fieldVariant:D="secondary",max:V,isWindowTable:H=!1,addButtonText:L="COMMON_ACTION_ADD",validateOnChange:R=!0,validateOnBlur:B=!0,invalid:P,children:W,editColumns:z,tableMaxHeight:G=g.I.getHeight(6,6,g.I.ROW_HEIGHT),onEditActiveChange:Y,editable:j=!0,columns:U,maxTooltipTranslationId:K,editMaxHeight:q,allowSubmitInitial:J,renderHoverContent:Q,manageActions:X,onRowClick:Z,isDisabledOverride:ee}){const te=(0,a.useSelector)(I.EL),ne=ee||te,ae=(0,l.useCallback)(t=>{const n=async()=>A?.(t);return Q?Q(t,n):ne?null:l.createElement(w.A,{alignItems:"center",marginRight:v.kc},l.createElement(p.A,{name:`remove-${e}-${"id"in t?t.id:""}`,size:"inherit",type:"button",variant:"inline",color:"danger",onClick:n},l.createElement(x.sA,{id:"COMMON_ACTION_REMOVE"})))},[Q,ne,e,A]),le=H?m.A:u.A,ie=(0,l.useCallback)(e=>"function"==typeof t?t(e):t,[t]);return l.createElement(o.l1,{enableReinitialize:!0,onSubmit:t=>_?.(t[e]),initialValues:C,validationSchema:f,validateOnChange:R,validateOnBlur:B},({values:t,errors:a,setFieldValue:o,handleSubmit:m,handleReset:u,setTouched:f,dirty:g,touched:I,submitCount:_,resetForm:R})=>{const B=!(0,r.A)(a)||!Object.keys(t).some(e=>(0,b.If)(e,a,I,_)),Q=ie(t);return l.createElement(w.A,{flexDirection:"column",width:"100%"},t[k.Vf]?null:l.createElement(s.A,{portal:!0,description:K&&void 0!==V&&t[e].length>=V?l.createElement(x.sA,{id:K}):void 0,noWrap:!0},l.createElement(w.A,{width:"100%",flexWrap:"wrap",gap:v.kc},Q.map((n,i)=>{const{name:r,inline:c,placeholder:s,type:m,label:u,tooltip:A,tooltipProps:C,parser:v,validated:y,hideMainFormInvalidState:$=!1,translateOptions:S,options:H,autoComplete:W,containerFlexProps:z,editable:G=!0,wrap:Y=!1,propFunc:j,...U}=n,K={};if(!G)return null;v&&(K.onChange=(...e)=>o(r,v(e)));const{valueInputTooltip:q,...X}=j?.(t)||{},Z=(0,b.t$)(r,a,I,_);return l.createElement(l.Fragment,{key:r},l.createElement(F.Op,{inline:c,wrap:Y,...T.A.addDataTestId(n.id),...z},l.createElement(N.A,{condition:!!A,wrapper:e=>"string"==typeof u?((e,t,n,a)=>l.createElement(w.A,{flexDirection:"column",width:"100%"},l.createElement(w.A,{alignItems:"center"},l.createElement(F.D7,{color:"inherit"},l.createElement(x.sA,{id:e})),l.createElement(O.A,{description:l.createElement(x.sA,{id:t}),...a})),n))(u,A,e,C):e},l.createElement(E.A,{description:q?l.createElement(x.sA,{id:q}):void 0},l.createElement(w.A,{flex:"1"},l.createElement(M,{full:!0,name:r,placeholder:s,type:m,label:A?null:u,variant:D,invalid:g&&Z||!$&&!!P&&B,..."dropdown"!==m?{autoComplete:W}:{options:H,translateLabel:"string"==typeof u,translateOptions:S,translatePlaceholder:!0,validated:y},disabled:t[k.Vf]||t[e].length>=V||ne,...K,...U,...X})))),i===Q.length-1&&!ne&&d?l.createElement(w.A,{alignSelf:"flex-start",height:h.b,marginTop:u?k.EE:0},l.createElement(p.A,{...T.A.addDataTestId(`add-new-table-record-${e}`),name:`add-${e}`,size:"medium",type:g?"submit":"button",variant:"inline",onClick:async e=>{e.preventDefault();const n=Q.reduce((e,t)=>(e[t.name]=!0,e),{}),a=await f(n,!0);Q.find(e=>a[e.name])||(d(t),R())},disabled:t[k.Vf]||t[e].length>=V||!g&&!J&&!X?.disabled},l.createElement(x.sA,{id:L}))):null))}))),P&&B?l.createElement(w.A,{width:"80%",marginBottom:t[e]?.length?v.Er:void 0},l.createElement($,{label:P,isInvalid:!0})):null,t[k.Vf]?null:W,t[k.Vf]?l.createElement(l.Fragment,null,l.createElement(F.O2,{editMaxHeight:q},t[e].map((a,i)=>l.createElement(w.A,{key:a.id||`${e}-${i}`,width:"100%",gap:v.kc},(z||U).map((r,d)=>{const c=z&&r.getNewFieldIndex?Q[r.getNewFieldIndex()]:z?{}:Q[d];if(!c)return null;const{type:s,parser:m,validated:u,translateOptions:p,options:A,containerFlexProps:f,inline:C,editable:b=!0,wrap:g,propFunc:h,...v}=c;if(!b)return null;const O={},N=z&&r.getFieldName?.(a)||String(r.id),I=z&&r.getFieldLabel?.(a)||n[r.id];m&&(O.onChange=(...t)=>o(`${e}.${i}.${String(r.id)}`,m(t)));const{valueInputTooltip:T,...k}=h?.(a,t[e])||{};return l.createElement(w.A,{key:`${a.id}-${r.id}`,flexDirection:"column",flex:"1 1 50%",inline:C,...f},l.createElement(E.A,{description:T?l.createElement(x.sA,{id:T}):void 0},l.createElement(w.A,{flex:"1"},l.createElement(y.A,{...O,...v,full:!0,label:I,name:`${e}.${i}.${N}`,type:s||r.getFieldType?.(a),variant:D,fast:!0,..."dropdown"!==s?{}:{options:A,translateLabel:"string"==typeof I,translateOptions:p,translatePlaceholder:!0,type:s,validated:u,portal:!0},...k}))))})))),l.createElement(w.A,{justifyContent:"flex-end",width:"100%",marginTop:v.Ln,gap:v.Ln},l.createElement(p.A,{name:`edit-cancel-${e}`,type:"button",variant:"default",onClick:()=>{u(),o(k.Vf,!1),Y?.(!1)}},l.createElement(x.sA,{id:"COMMON_ACTION_CANCEL"})),l.createElement(p.A,{name:`edit-submit-${e}`,type:t[k.Vf]?"submit":"button",variant:"primary",onClick:m,disabled:c()((0,i.A)(t,k.Vf),(0,i.A)(C,k.Vf))},l.createElement(x.sA,{id:"COMMON_ACTION_SAVE_CHANGES"})))):t[e].length>0?l.createElement(w.A,{position:"relative"},t[e].length?l.createElement(F.AC,{tableMaxHeight:G,rows:t[e].length,isWindowsTable:H,marginTop:v.kc,className:ne?S:void 0,...T.A.addDataTestId(`editable-grid-table-wrapper-${e}`)},l.createElement(le,{columns:U,disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0,items:t[e],renderHoverContent:!ne&&A?ae:void 0,cellClassName:F.KY,onRowClick:Z})):null,l.createElement(w.A,{position:"absolute",top:v.xO,right:0},X,!ne&&j?l.createElement(p.A,{name:`edit-${e}`,size:"medium",type:"button",variant:"inline",onClick:()=>{u(),o(k.Vf,!0),Y?.(!0)}},l.createElement(x.sA,{id:"COMMON_ACTION_EDIT"})):null)):null)})}},373229:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(296540),l=n(758649),i=n(71479),r=n(566723),o=n(699784);const d=(0,i.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${r.S2} ${r.fS};
  gap: ${r.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:i,onFormSubmit:r,onFormReset:c,onFormCancel:s,className:m,submitButtonText:u,customButton:p,applyButton:A,applyButtonFirst:E,hideCancelButton:f,form:C})=>{const b=(0,a.useMemo)(()=>A||a.createElement(l.A,{name:"submit",variant:"primary",type:"submit",onClick:r,disabled:!t||n||i,form:C},a.createElement(o.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})),[A,C,t,n,i,r,u]);return a.createElement(d,{className:m,hasFormResetButton:!!c},E?b:p,f?null:a.createElement(l.A,{name:"cancel",variant:"default",type:"button",onClick:s,disabled:!e&&!t},a.createElement(o.sA,{id:"COMMON_ACTION_CANCEL"})),c?a.createElement(l.A,{name:"reset",variant:"default",type:"button",onClick:c,disabled:!t},a.createElement(o.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,E?p:b)}},553432:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(454195),i=n(566723),r=n(294303);const o=e=>a.createElement(r.A,{paddingTop:i.YC,paddingBottom:i.YC,gap:i.Ln,rowGap:i.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})}}]);