react-luminus-components 1.5.38 → 1.5.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Flexmonster/components/ReportSharingModal/hooks/useReportSharingApi.d.ts +2 -2
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +14 -8
- package/dist/models/api/employee/IEmployee.d.ts +9 -0
- package/dist/models/api/reports/ReportRestrictResultModel.d.ts +10 -0
- package/dist/models/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/components/Flexmonster/components/ReportSharingModal/hooks/useReportSharingApi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as ReportRestrictResultModel } from '../../../../../models/api/reports/ReportRestrictResultModel';
|
|
2
2
|
|
|
3
3
|
declare const useReportSharingApi: (reportVersionId: number) => {
|
|
4
|
-
changeEmployeeRights: (employeeId: number, haveRights: boolean) => Promise<
|
|
4
|
+
changeEmployeeRights: (employeeId: number, haveRights: boolean) => Promise<ReportRestrictResultModel[]>;
|
|
5
5
|
};
|
|
6
6
|
export default useReportSharingApi;
|
package/dist/main.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Prefix can't start with '-' when allowNegative is true.
|
|
7
7
|
prefix: `+o+`
|
|
8
8
|
allowNegative: `+a+`
|
|
9
|
-
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function Ac(e){e=Pc(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var n=e.suffix,r=e.allowNegative,s=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Je);var a=e.onBlur;a===void 0&&(a=Je);var i=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var d=e.defaultValue,m=e.value,x=e.valueIsNumericString,f=e.onValueChange,g=_a(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=On(e),b=h.decimalSeparator,v=h.allowedDecimalSeparators,j=function(L){return Ps(L,e)},R=function(L,M){return kc(L,M,e)},y=yt(m)?d:m,E=x??_c(y,u,n);yt(m)?yt(d)||(E=E||typeof d=="number"):E=E||typeof m=="number";var C=function(L){return ka(L)?L:(typeof L=="number"&&(L=Aa(L)),E&&typeof l=="number"?ks(L,l,!!c):L)},S=La(C(m),C(d),!!E,j,R,f),w=S[0],I=w.numAsString,T=w.formattedValue,_=S[1],P=function(L){var M=L.target,$=L.key,V=M.selectionStart,G=M.selectionEnd,k=M.value;if(k===void 0&&(k=""),($==="Backspace"||$==="Delete")&&G<u.length){L.preventDefault();return}if(V!==G){o(L);return}$==="Backspace"&&k[0]==="-"&&V===u.length+1&&r&&mt(M,1),l&&c&&($==="Backspace"&&k[V-1]===b?(mt(M,V-1),L.preventDefault()):$==="Delete"&&k[V]===b&&L.preventDefault()),v!=null&&v.includes($)&&k[V]===b&&mt(M,V+1);var W=i===!0?",":i;$==="Backspace"&&k[V-1]===W&&mt(M,V-1),$==="Delete"&&k[V]===W&&mt(M,V+1),o(L)},D=function(L){var M=I;if(M.match(/\d/g)||(M=""),s||(M=hc(M)),c&&l&&(M=ks(M,l,c)),M!==I){var $=Ps(M,e);_({formattedValue:$,value:M,floatValue:parseFloat(M)},{event:L,source:zt.event})}a(L)},B=function(L){return L===b?!0:qt(L)},O=function(L){var M=L.currentValue,$=L.lastValue,V=L.formattedValue,G=L.currentValueIndex,k=L.formattedValueIndex,W=M[G],z=V[k],q=Ma($,M),ne=q.to,X=function(ie){return R(ie).indexOf(".")+u.length};return m===0&&c&&l&&M[ne.start]===b&&X(M)<G&&X(V)>k?!1:G>=ne.start&&G<ne.end&&v&&v.includes(W)&&z===b?!0:W===z};return Object.assign(Object.assign({},g),{value:T,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:O,onValueChange:_,format:j,removeFormatting:R,getCaretBoundary:function(L){return Oc(L,e)},onKeyDown:P,onBlur:D})}function Pr(e){var n=Ac(e);return p.createElement(Dc,Object.assign({},n))}const Ba=({InputContainer:e=t.FloatingLabelInput,value:n,onChange:r,debounceMs:s,label:o,withoutLabel:a,placeholder:i,size:l,hidden:c,disabled:u,showClearIcon:d,clearValue:m,className:x,step:f,noSelectOnFocus:g,decimalScale:h,fixedDecimalScale:b=!1,numberPrefix:v,numberSuffix:j,min:R,max:y,hint:E})=>{const C=p.useCallback(()=>{if(!r)return;const P=m??null;r(P?Number(P):null)},[m,r]),S=p.useRef(null),[w,I]=p.useState((n==null?void 0:n.toString())??""),T=p.useCallback(P=>{const D=P;r&&r(D==null||D===""?null:Number(D))},[r]),_=p.useCallback(P=>{var B,O;let D=parseFloat(((O=(B=P.target)==null?void 0:B.value)==null?void 0:O.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(D)&&(D=0),!s){T(D.toString());return}I(D.toString()),S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T(D.toString())},s)},[s,T]);return p.useEffect(()=>{I(n===null?"":n.toString())},[y,R,n]),p.useEffect(()=>{y!==void 0&&Number(w)>y&&I(y.toString()),R!==void 0&&Number(w)<R&&I(R.toString())},[w,y,R,I]),p.useEffect(()=>{!r||n===null||(y!==void 0&&n>y&&r(y),R!==void 0&&n<R&&r(R))},[n,y,R,r]),t.jsxRuntimeExports.jsxs(e,{withoutLabel:a,label:o??"",hidden:c,className:x,hint:E,disabled:u,children:[t.jsxRuntimeExports.jsx(Pr,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:h,fixedDecimalScale:b,prefix:v,suffix:j,defaultValue:"",value:s?w:(n==null?void 0:n.toString())??"",placeholder:i??o,onFocus:P=>{!g&&P.target.select()},onChange:_,hidden:c,disabled:u,className:t.classNames("form-control text-end w-100",{[`form-control-${l}`]:l}),step:f,min:R,max:y}),d&&n!==null&&r&&!u&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:C,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})})]})},Fa=({InputContainer:e=t.RowLabelInput,label:n,options:r,disabled:s,hidden:o,className:a,value:i,onChange:l})=>{const c=p.useCallback(u=>{l&&l(u.target.value)},[l]);return t.jsxRuntimeExports.jsx(e,{isForRadioInput:!0,hidden:o,withoutLabel:!n,label:`${n}`,className:a,disabled:s,children:r.map(u=>t.jsxRuntimeExports.jsx(t.Form.Check,{id:`radio-${u.id}`,label:u.name,type:"radio",value:u.id??"",checked:i===u.id,onChange:c,hidden:o,disabled:s,className:"w-100"},u.id))})},Mc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,resetsFields:s,type:o,required:a,hidden:i,disabled:l,withoutLabel:c,hint:u,onChange:d,className:m})=>{const{register:x,formState:f,setValue:g}=Ee.useFormContext(),h=t.useFormDisabledContext({falseIfNotInit:!0}),[b,v]=p.useState(void 0),[j,R]=p.useState(!1);p.useEffect(()=>{const C=n.split(".");let S=f.errors;C.forEach(w=>{S!==void 0&&(S=S[w])}),v(S)},[f,n]);const y=p.useMemo(()=>l||h,[l,h]),E=b!==void 0;return p.useEffect(()=>{f.isSubmitted&&R(!0)},[f]),t.jsxRuntimeExports.jsxs(e,{isForCheckInput:!0,hidden:i,label:r??"",required:a,disabled:y,isInvalid:E,withoutLabel:c,hint:u,className:m,children:[t.jsxRuntimeExports.jsx(t.Form.Check,{id:`check-${n}`,type:o??"checkbox",label:`${r}${a?" *":""}`,...x(n,{onChange:C=>{s&&s.forEach(S=>g(S,null,{shouldDirty:!0,shouldValidate:j})),d&&d(C.target.value??null)}}),isInvalid:E,hidden:i,disabled:y,className:"w-100"}),b&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:b.message})]})},Lc=({InputContainer:e=t.RowLabelInput,label:n,formField:r,options:s,resetsFields:o,required:a,disabled:i,hidden:l,onChange:c,className:u})=>{const{register:d,formState:m,setValue:x,watch:f}=Ee.useFormContext(),g=t.useFormDisabledContext({falseIfNotInit:!0}),[h,b]=p.useState(void 0),[v,j]=p.useState(!1),R=p.useMemo(()=>s,[s]),y=p.useMemo(()=>i||g,[i,g]);p.useEffect(()=>{const C=r.split(".");let S=m.errors;C.forEach(w=>{S!==void 0&&(S=S[w])}),b(S)},[m,r]),p.useEffect(()=>{m.isSubmitted&&j(!0)},[m]);const E=h!==void 0;return t.jsxRuntimeExports.jsxs(e,{isForRadioInput:!0,hidden:l,withoutLabel:!n,label:n??"",required:a,disabled:y,isInvalid:E,className:u,children:[R.map(C=>t.jsxRuntimeExports.jsx(t.Form.Check,{id:`radio-${C.id}`,label:C.name,type:"radio",value:C.id??"",checked:f(r)===C.id,...d(r,{onChange:S=>{var w;o&&o.forEach(I=>x(I,null,{shouldDirty:!0,shouldValidate:v})),c&&c((w=S.target)!=null&&w.value?S.target.value.toString():null)}}),isInvalid:E,hidden:l,disabled:y,className:"w-100"},C.id)),h&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:h.message})]})},Bc=({label:e,InputContainer:n=t.RowLabelInput,className:r,withoutLabel:s,hidden:o,disabled:a,contactType:i,formField:l,...c})=>{const{watch:u}=Ee.useFormContext(),d=u(l),m=t.useFormDisabledContext({falseIfNotInit:!0}),x=p.useMemo(()=>a||m,[a,m]);return o?null:t.jsxRuntimeExports.jsx(Ta,{contactType:i,value:d,withoutLabel:s,label:e,className:r,children:t.jsxRuntimeExports.jsx(t.HookFormTextInput,{type:"text",formField:l,InputContainer:n,size:"sm",withoutLabel:!0,className:"flex-grow-1",disabled:x,...c})})},Fc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,size:s,defaultSelection:o,resetsFields:a,isNumber:i,required:l,hidden:c,disabled:u,items:d,onSearchQueryChange:m,selectedItemNavigateTo:x,texts:f,dropdownItemsNameWidth:g,isLoading:h,withoutLabel:b,additionalColumns:v,CustomOnChangeComponent:j,icon:R,displayIdAsName:y,onSelect:E,className:C,archiveColumn:S,hint:w,addNewOptionPath:I,refreshOptions:T,MiniDetailComponent:_,miniDetailPlacement:P,suggestedItems:D,suggestedItemsTitle:B})=>{const{formState:O,setValue:L,watch:M,control:$}=Ee.useFormContext(),V=t.useFormDisabledContext({falseIfNotInit:!0}),[G,k]=p.useState(void 0),[W,z]=p.useState(!1),[q,ne]=p.useState(!1),X=M(n)??null,ie=X===(o==null?void 0:o.id)?o==null?void 0:o.name:M(`${n}-DropdownName`),oe=p.useMemo(()=>X==null?null:{id:X??null,name:ie??""},[X,ie]),ve=p.useCallback(()=>{const F=n.split(".");let K=O.errors;F.forEach(te=>{K!==void 0&&(K=K[te])}),k(K)},[O,n]),Z=p.useCallback(F=>{if((F==null?void 0:F.id)===X)return;if(E&&E(F),a&&a.forEach(te=>L(te,null,{shouldDirty:!0,shouldValidate:q})),F===null){L(n,null,{shouldDirty:!0,shouldValidate:q}),L(`${n}-DropdownName`,null);return}let K=null;i?K=(F==null?void 0:F.id)!==null&&(F==null?void 0:F.id)!==""?parseInt(F.id.toString(),10):null:K=F.id===null||F.id===void 0||F.id===""?null:F.id,L(n,K,{shouldDirty:!0,shouldValidate:q}),L(`${n}-DropdownName`,F.name??"")},[L,n,q,i,a,X,E]),A=p.useCallback(F=>{z(!1),Z(F)},[Z]),H=p.useCallback(()=>{z(!1)},[]),Q=p.useRef(null),je=G!==void 0,Me=x!==void 0,Ye=Me&&oe!==null,U=p.useMemo(()=>u||V,[u,V]);return p.useEffect(()=>{ve()},[ve]),p.useEffect(()=>{O.isSubmitted&&ne(!0)},[O]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(e,{label:r??"",required:l,disabled:U,hidden:c,withoutLabel:b,isInvalid:je,inputContainerClassName:t.classNames({"luminus-dropdown-select-open":W}),hint:w,className:C,children:[t.jsxRuntimeExports.jsxs(t.InputAnchorContainer,{currentSelection:oe,selectedItemNavigateTo:x,children:[y&&(oe==null?void 0:oe.name)&&t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:oe.name}),t.jsxRuntimeExports.jsx(Ee.Controller,{control:$,name:n,render:()=>t.jsxRuntimeExports.jsx(t.MiniDetailWrapper,{value:X,MiniDetailComponent:_,miniDetailPlacement:P,children:t.jsxRuntimeExports.jsx(t.Form.Select,{size:s,onMouseDown:F=>{F.currentTarget.focus(),F.preventDefault()},onClick:()=>{!Me&&!U&&z(!0)},ref:Q,value:X??"",onChange:()=>{},isInvalid:je,hidden:c,className:t.classNames("w-100",{"luminus-dropdown-picker-disabled":U,"luminus-dropdown-picker-link":Ye}),children:t.jsxRuntimeExports.jsx("option",{value:X,children:y?X:(ie==null?void 0:ie.length)>0?ie:X})})})}),j||!U&&Me?t.jsxRuntimeExports.jsxs("div",{className:"custom-picker-button",children:[!j&&!U&&Me&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"secondary",onClick:F=>{F.preventDefault(),F.stopPropagation(),z(!0)},children:R??t.jsxRuntimeExports.jsx(t.MdOutlineEdit,{})}),j??null]}):null]}),G&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:G.message}),Q.current&&t.jsxRuntimeExports.jsx(t.SimplePicker,{show:W,onCancel:H,items:d,currentSelection:oe,onSelectionChange:A,onSearchQueryChange:m,texts:f,itemsNameWidth:g,additionalColumns:v,displayIdAsName:y,isLoading:h,disabled:U,inputRef:Q,archiveColumn:S,addNewOptionPath:I,refreshOptions:T,suggestedItems:D,suggestedItemsTitle:B})]})})},Vc=({InputContainer:e=t.RowLabelInput,label:n,formField:r,hidden:s,required:o,placeholder:a,disabled:i,showClearIcon:l,resetsFields:c,multiple:u,accept:d,withoutLabel:m,hint:x,className:f})=>{const{watch:g,setValue:h,register:b,formState:v}=Ee.useFormContext(),j=t.useFormDisabledContext({falseIfNotInit:!0}),[R,y]=p.useState(!1),[E,C]=p.useState(void 0),S=p.useCallback(()=>{h(r,"")},[h,r]),w=p.useCallback(()=>{const _=r.split(".");let P=v.errors;_.forEach(D=>{P!==void 0&&(P=P[D])}),C(P)},[v,r]);p.useEffect(w,[w]),p.useEffect(()=>{v.isSubmitted&&y(!0)},[v]);const I=p.useMemo(()=>i||j,[i,j]),T=E!==void 0;return t.jsxRuntimeExports.jsxs(e,{label:n??"",required:o,disabled:I,hidden:s,withoutLabel:m,isInvalid:T,hint:x,className:f,children:[t.jsxRuntimeExports.jsx(t.FormControl,{type:"file",multiple:u,accept:d.join(", "),placeholder:a??n,isInvalid:T,hidden:s,disabled:I,className:"w-100",...b(r,{onChange:()=>{c&&c.forEach(_=>h(_,null,{shouldDirty:!0,shouldValidate:R}))}})}),l&&g(r)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:S,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),E&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:E.message})]})},Va=({children:e,onStorno:n,noSpacer:r})=>{const{formState:s}=Ee.useFormContext(),o=t.useFormDisabledContext({falseIfNotInit:!0}),[a,i]=p.useState(!1);return p.useEffect(()=>{i(Object.keys(s.dirtyFields).length>0)},[s]),a?t.jsxRuntimeExports.jsx(Ca,{onStorno:n,noSpacer:r,disabled:o,children:e}):null},Nn=({InputContainer:e=t.RowLabelInput,options:n,formField:r,label:s,size:o,resetsFields:a,isNumber:i,required:l,hidden:c,disabled:u,withoutLabel:d,noSortOptions:m,suffixIdToName:x,onSelect:f,className:g,appendCurrentSelectionWithName:h,hint:b,addNewOptionPath:v,refreshOptions:j,MiniDetailComponent:R,miniDetailPlacement:y,selectedItemNavigateTo:E,noRemoveButton:C})=>{const{texts:{customSelect:S}}=p.useContext(t.LuminusComponentsContext),{formState:w,setValue:I,watch:T,control:_}=Ee.useFormContext(),P=t.useFormDisabledContext({falseIfNotInit:!0}),[D,B]=p.useState(void 0),[O,L]=p.useState(!1),[M,$]=p.useState(!1),[V,G]=p.useState(""),k=T(r),W=p.useMemo(()=>n.find(H=>H.id===k)??null,[n,k]),z=p.useCallback(()=>{const H=r.split(".");let Q=w.errors;H.forEach(je=>{Q!==void 0&&(Q=Q[je])}),B(Q)},[w,r]),q=p.useCallback(H=>{if((H==null?void 0:H.id)===k)return;if(f&&f(H),a&&a.forEach(je=>I(je,null,{shouldDirty:!0,shouldValidate:M})),H===null){I(r,null,{shouldDirty:!0,shouldValidate:M});return}let Q=null;i?Q=(H==null?void 0:H.id)!==null&&(H==null?void 0:H.id)!==""?parseInt(H.id.toString(),10):null:Q=H.id===null||H.id===void 0||H.id===""?null:H.id,I(r,Q,{shouldDirty:!0,shouldValidate:M})},[I,r,i,a,k,M,f]),ne=p.useCallback(H=>{L(!1),q(H)},[q]),X=p.useCallback(H=>{G(H)},[]),ie=p.useMemo(()=>u||P,[u,P]);p.useEffect(()=>{z()},[z]),p.useEffect(()=>{w.isSubmitted&&$(!0)},[w]);const oe=p.useCallback(H=>{var Q;return H===null?"":!H.name||H.name.length===0?((Q=H.id)==null?void 0:Q.toString())??"":x?`${H.name} (${H.id})`:H.name},[x]),ve=p.useMemo(()=>{const H=n?[...n]:[];return h!==void 0&&k&&(H.some(Q=>Q.id===k)||H.push({id:k,name:h})),H.map(Q=>({id:Q.id,name:oe(Q)})).filter(Q=>t.stringSearchWithin(Q.name,V)).sort((Q,je)=>m?0:(Q.name??"").localeCompare(je.name??""))},[n,m,V,oe,h,k]),Z=p.useRef(null),A=D!==void 0;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(e,{label:s??"",required:l,disabled:ie,hidden:c,withoutLabel:d,isInvalid:A,inputContainerClassName:t.classNames({"luminus-dropdown-select-open":O}),hint:b,className:g,children:[t.jsxRuntimeExports.jsx(t.InputAnchorContainer,{currentSelection:W,selectedItemNavigateTo:E,children:t.jsxRuntimeExports.jsx(Ee.Controller,{control:_,name:r,render:()=>t.jsxRuntimeExports.jsx(t.MiniDetailWrapper,{value:k,MiniDetailComponent:R,miniDetailPlacement:y,children:t.jsxRuntimeExports.jsx(t.Form.Select,{size:o,onMouseDown:H=>{H.currentTarget.focus(),H.preventDefault()},onClick:()=>{L(!0)},ref:Z,value:k??"",onChange:()=>{},isInvalid:A,hidden:c,disabled:ie,className:"w-100",children:t.jsxRuntimeExports.jsx("option",{value:(W==null?void 0:W.id)??"",children:oe(W)})})})})}),D&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:D.message}),Z.current&&t.jsxRuntimeExports.jsx(t.SimplePicker,{show:O,onCancel:()=>L(!1),items:ve,currentSelection:W??null,onSelectionChange:ne,onSearchQueryChange:X,texts:S,disabled:ie,inputRef:Z,autoHideSearch:!0,allItemsLength:n.length,addNewOptionPath:v,refreshOptions:j,noRemoveButton:C})]})})},$c=({InputContainer:e=t.RowLabelInput,formField:n,label:r,placeholder:s,size:o,resetsFields:a,showClearIcon:i,clearValue:l,required:c,hidden:u,disabled:d,withoutLabel:m,step:x,stepperStep:f=1,className:g,min:h,max:b,onChange:v,hint:j})=>{const{register:R,formState:y,setValue:E,watch:C}=Ee.useFormContext(),S=t.useFormDisabledContext({falseIfNotInit:!0}),[w,I]=p.useState(void 0),[T,_]=p.useState(!1),P=p.useCallback(($,V,G)=>{E($,ke.limitNumber(V,h,b),G)},[b,h,E]),D=p.useCallback(()=>{const $=l??null;P(n,$!==null?Number($):null,{shouldDirty:!0,shouldValidate:T})},[l,P,n,T]),B=p.useCallback(()=>{const $=n.split(".");let V=y.errors;$.forEach(G=>{V!==void 0&&(V=V[G])}),I(V)},[y,n]),O=p.useMemo(()=>d||S,[d,S]);p.useEffect(()=>{B()},[B]),p.useEffect(()=>{y.isSubmitted&&_(!0)},[y]);const L=w!==void 0,M=C(n);return t.jsxRuntimeExports.jsxs(e,{label:r??"",required:c,disabled:O,hidden:u,withoutLabel:m,isInvalid:L,hint:j,className:g,children:[t.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsxRuntimeExports.jsx(t.Form.Control,{type:"number",placeholder:s??r,size:o,...R(n,{setValueAs:$=>$==null||$===""?null:ke.limitNumber(Number($),h,b),min:h,max:b,onChange:$=>{var V;a&&a.forEach(G=>E(G,null,{shouldDirty:!0,shouldValidate:T})),v&&v((V=$.target)!=null&&V.value?Number($.target.value)??null:null)}}),isInvalid:L,hidden:u,disabled:O,className:"w-100 luminus-numeric-stepper",step:x,min:h,max:b}),t.jsxRuntimeExports.jsx("div",{className:"stepper-icon left",children:!d&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:$=>{$.preventDefault(),$.stopPropagation(),P(n,((M?Number(M):0)-f).toString(),{shouldDirty:!0,shouldValidate:T})},children:t.jsxRuntimeExports.jsx(t.FaMinus,{})})}),t.jsxRuntimeExports.jsx("div",{className:"stepper-icon right",children:!d&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:$=>{$.preventDefault(),$.stopPropagation(),P(n,((M?Number(M):0)+f).toString(),{shouldDirty:!0,shouldValidate:T})},children:t.jsxRuntimeExports.jsx(t.FaPlus,{})})})]}),i&&C(n)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:D,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),w&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:w.message})]})},Gc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,placeholder:s,resetsFields:o,showClearIcon:a,clearValue:i,required:l,hidden:c,disabled:u,withoutLabel:d,step:m,size:x,CustomOnChangeComponent:f,noSelectOnFocus:g,className:h,decimalScale:b=2,fixedDecimalScale:v=!1,numberPrefix:j,numberSuffix:R,min:y,max:E,onChange:C,hint:S})=>{const{formState:w,setValue:I,watch:T,control:_}=Ee.useFormContext(),P=t.useFormDisabledContext({falseIfNotInit:!0}),[D,B]=p.useState(void 0),[O,L]=p.useState(!1),M=p.useCallback(()=>{const W=i??null;I(n,W!==null?Number(W):null,{shouldDirty:!0,shouldValidate:O})},[i,I,n,O]),$=p.useCallback(()=>{const W=n.split(".");let z=w.errors;W.forEach(q=>{z!==void 0&&(z=z[q])}),B(z)},[w,n]),V=p.useMemo(()=>u||P,[u,P]);p.useEffect(()=>{$()},[$]),p.useEffect(()=>{w.isSubmitted&&L(!0)},[w]);const G=T(n);p.useEffect(()=>{E!==void 0&&G>E&&I(n,E),y!==void 0&&G<y&&I(n,y)},[n,G,E,y,I]);const k=D!==void 0;return t.jsxRuntimeExports.jsxs(e,{label:r??"",required:l,disabled:V,hidden:c,withoutLabel:d,isInvalid:k,hint:S,className:h,children:[t.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsxRuntimeExports.jsx(Ee.Controller,{control:_,name:n,render:({field:{ref:W,onChange:z,name:q,value:ne}})=>t.jsxRuntimeExports.jsx(Pr,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:b,fixedDecimalScale:v,prefix:j,suffix:R,defaultValue:"",name:q,value:ne??"",placeholder:s??r,onFocus:X=>{!g&&X.target.select()},onChange:X=>{var ve,Z;const ie=parseFloat(((Z=(ve=X.target)==null?void 0:ve.value)==null?void 0:Z.replaceAll(" ","").replaceAll(",","."))??0);o&&o.forEach(A=>I(A,null,{shouldDirty:!0,shouldValidate:O}));const oe=ie==null||Number.isNaN(ie)?null:Number(ie);z(oe),C&&C(oe)},hidden:c,disabled:V,className:t.classNames("form-control text-end w-100",{"is-invalid":k},{[`form-control-${x}`]:x}),step:m,getInputRef:W,min:y,max:E})}),f&&t.jsxRuntimeExports.jsx("div",{className:"custom-picker-button",children:f})]}),a&&T(n)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:M,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),D&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:D.message})]})},Uc=({color:e="primary",icon:n=t.jsxRuntimeExports.jsx(t.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:s="*",onUpload:o,multiple:a,className:i,children:l,...c})=>{const u=d=>{d.target.files&&(o(d.target.files),d.target.value="")};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:t.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${i??""}`,t.classes.item),...c,children:[n,l]}),t.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:s,onChange:u,hidden:!0,multiple:a})]})},Ar=["slice","options","formats","conditions"],As=e=>{const n=e.current.flexmonster.getReport({withDefaults:!0});if(typeof n=="string")throw alert("report is string"),new Error("report is string");const r={};return Ar.forEach(s=>{r[s]=n[s]}),JSON.stringify(r)},Wc=e=>{if(e.settings){const n=JSON.parse(e.settings);return Ar.forEach(r=>{n[r]===void 0&&(n[r]=null)}),n}return{}},Hc=e=>{const n={};return Ar.forEach(r=>{n[r]=(e==null?void 0:e[r])??void 0}),n},zc=e=>e&&e.type==="header"&&e.member&&e.member.caption!=="All"&&e.label==="",Ms=(e,n)=>e.hierarchy&&e.hierarchy.uniqueName===n,Ls=e=>!e.member&&!e.isDrillThrough,Bs=(e,n)=>typeof e=="function"?e(n):e.replace(":id",n),$a=({dataSource:e,settings:n,pivotRef:r,localization:s,licenseKey:o,hyperlinkColumn:a,roomPasportization:i,enabled:l=!0})=>{const{texts:{reports:c}}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(!1),m=p.useRef(null),x=r??m,f=p.useMemo(()=>({localization:s}),[s]),g=p.useCallback(E=>{const C=E.find(w=>w.id==="fm-tab-export");if((C==null?void 0:C.menu)==null||x.current==null)return E;const S=C.menu.find(w=>w.id==="fm-tab-export-pdf");return S&&(S.handler=()=>{x.current.flexmonster.exportTo("pdf",{useCustomizeCellForData:!0,fontUrl:"https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf"})}),E},[x]),h=p.useCallback(E=>{E=g(E),delete E[0],delete E[1],delete E[2];const C=[{id:"fm-tab-expand",title:c.expandAll,handler:x.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:c.collapseAll,handler:x.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return E.unshift({id:"fm-tab-expand",title:c.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:C,rightGroup:!0}),E},[x,c.collapseAll,c.expand,c.expandAll,g]),b=E=>{const C=E.getTabs();E.getTabs=()=>h(C)},v=p.useMemo(()=>e&&e.mapping?Object.values(e.mapping).filter(E=>E.caption.includes("P:")).map(E=>({uniqueName:E.caption.replace("P:",""),caption:E.caption})):[],[e]),j=p.useMemo(()=>{var C,S,w,I;const E=(C=x.current)==null?void 0:C.flexmonster.getReport();return E&&E.slice?{...E.slice,rows:[...((S=E.slice.rows)==null?void 0:S.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v],columns:[...((w=E.slice.columns)==null?void 0:w.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v],measures:[...((I=E.slice.measures)==null?void 0:I.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v]}:null},[v,x]);p.useEffect(()=>{var E,C,S,w;if(u&&l){if(i&&j){const I=(E=x.current)==null?void 0:E.flexmonster.getReport(),T=I&&I.options?{...I.options,grid:{...(C=I.options)==null?void 0:C.grid,autoSwitchToCompact:!1}}:{};(S=x.current)==null||S.flexmonster.setReport({...I,dataSource:e,slice:j,options:T})}else(w=x.current)==null||w.flexmonster.updateData(e);console.log("Updating flexmonster dataSource to: ",e)}},[e,l,u,v,x,i,j]),p.useEffect(()=>{var w,I,T,_,P;if(!u||!l||n==null)return;const E=(w=x.current)==null?void 0:w.flexmonster.getReport();if(E===void 0||typeof E=="string")return;const C=Hc(n);C.options={...n==null?void 0:n.options,grid:{...(I=n==null?void 0:n.options)==null?void 0:I.grid,autoSwitchToCompact:!1},showFieldListSearch:!0,datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm:ss"},i&&(C.slice={...n==null?void 0:n.slice,rows:[...((_=(T=n==null?void 0:n.slice)==null?void 0:T.rows)==null?void 0:_.filter(D=>{var B;return!((B=D.caption)!=null&&B.includes("P:"))}))??[],...v]});const S={...E,...C};(P=x.current)==null||P.flexmonster.setReport(S)},[l,u,v,x,i,n]);const R=p.useCallback((E,C)=>{var D,B;if(zc(C)){E.text=((D=C.member)==null?void 0:D.caption)??"";const O=E.style["padding-left"]??"4px",L=parseInt(O,10);E.style["padding-left"]=L+11+"px"}if(!a||!Ms(C,a.idColumn)||Ls(C))return;const S=(B=C.escapedLabel)==null?void 0:B.toString();if(S===void 0)return;const w=Bs(a.url,S),I="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",T=C.type==="header"?"onclick='event.stopImmediatePropagation()'":"",_=C.isDrillThrough||C.type==="header"?`href='${w}' target='_blank'`:"";E.style&&(E.style["z-index"]=1);const P=`<a ${_} ${I} ${T}>${C.escapedLabel}</a>`;E.text=P},[a]),y=p.useCallback(E=>{if(!a||!Ms(E,a.idColumn)||Ls(E))return;const C=Bs(a.url,E.escapedLabel??"");window.open(C??"","_blank","noreferrer")},[a]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(jl.Pivot,{ref:x,global:f,licenseKey:o,toolbar:!0,height:"100%",beforetoolbarcreated:b,ready:()=>{d(!0)},width:"100%",customizeCell:R,cellclick:y})})},qc=(e,n,r,s)=>{const{texts:{reports:o}}=p.useContext(t.LuminusComponentsContext),{prompt:a}=t.usePrompt(),{confirm:i}=t.useConfirm(),l=t.useAxios(),{user:c}=p.useContext(t.UserContext),{startLoading:u,stopLoading:d}=p.useContext(t.LoadingContext),{addNotification:m}=t.useNotifications(),x=p.useCallback(async j=>{u("report-versionSavingAs");try{const R=await l.post("/reports/version",j);m(o.saveSuccessful,"success"),await s(R.data)}finally{d("report-versionSavingAs")}},[m,s,l,o.saveSuccessful,u,d]),f=p.useCallback(async()=>{if(r===null){m("none open","warning");return}if(!await i(o.confirmOverwriteSave))return;const R=As(n);x({reportSourceName:e,reportVersionId:r,settings:R})},[m,i,n,e,o.confirmOverwriteSave,x,r]),g=p.useCallback(async()=>{const j=await a(o.enterName,{input:"input",required:!0});if(j===null)return;const R=As(n);x({reportSourceName:e,name:j,settings:R})},[n,a,e,o.enterName,x]),h=p.useCallback(async()=>{u("report-versionSavingAs");try{await l.put("/reports/archive",{reportVersionId:r??void 0,reportSourceName:e}),m(o.deleteSuccessful,"success")}finally{d("report-versionSavingAs")}},[m,l,e,o.deleteSuccessful,r,u,d]),b=p.useCallback(async()=>{u("report-versionSavingAs");try{await l.post("/reports/version-restrictions",{reportVersionId:r??void 0,userRestricts:[{employeeId:c.personalNumber,addRights:!1}]}),m(o.detachSuccessful,"success")}finally{d("report-versionSavingAs")}},[m,l,o.detachSuccessful,r,u,d,c.personalNumber]),v=p.useCallback(async j=>{if(r===null){m(o.noReportVersionSelected,"warning");return}u("report-versionRenaming");try{await l.put("/reports/rename",{reportVersionId:r,reportSourceName:e,newName:j}),m(o.renameSuccessful,"success")}finally{d("report-versionRenaming")}},[m,l,o.renameSuccessful,o.noReportVersionSelected,r,e,u,d]);return{saveAs:g,save:f,archive:h,detach:b,rename:v}},Yc=e=>{const n=t.useAxios(),{startLoading:r,stopLoading:s}=p.useContext(t.LoadingContext);return{changeEmployeeRights:p.useCallback(async(a,i)=>{let l=null;r("reportSharing-addPerson");try{l=(await n.post("/reports/version-restrictions",{reportVersionId:e,userRestricts:[{employeeId:a,addRights:i}]})).data}finally{s("reportSharing-addPerson")}return l},[n,e,r,s])}},Kc=({isOpen:e,onHide:n,usersData:r,reportVersionId:s,EmployeePicker:o,setReportVersion:a})=>{const{ProjectIconComponent:i,texts:{reports:l}}=p.useContext(t.LuminusComponentsContext),{confirm:c}=t.useConfirm(),[u,d]=p.useState(null),{changeEmployeeRights:m}=Yc(s),x=p.useCallback(h=>{a(b=>b===null?null:{...b,users:h.filter(v=>v.isReportOwner===!1)})},[a]),f=p.useCallback(async()=>{if(u===null)return;const h=await m(u.id,!0);x(h),d(null)},[u,m,x]),g=p.useCallback(async h=>{if(!await c(l.removeSharingWith(h)))return;const v=await m(h,!1);x(v)},[m,c,l,x]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:n,children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:l.reportSharing})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",children:l.sharedWith}),t.jsxRuntimeExports.jsxs(t.ListGroup,{variant:"flush",children:[r&&r.length===0?t.jsxRuntimeExports.jsx("div",{className:"px-2 text-muted",children:l.noone.toLowerCase()}):null,r==null?void 0:r.map(h=>t.jsxRuntimeExports.jsxs(t.ListGroupItem,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[h.lastName," ",h.firstName," [",h.id,"]",t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>g(h.id),children:t.jsxRuntimeExports.jsx(i,{icon:"delete"})})]},h.id))]}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",className:"mt-2 mb-2",children:l.addSharing}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"flex-grow-1",children:t.jsxRuntimeExports.jsx(o,{label:l.shareWith,onSelect:h=>{if(h===null||typeof h.id!="number"){d(null);return}d(h)},value:u})}),t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:f,disabled:u===null,children:l.add})]})]})]})},Xc=(e,n)=>{const[r,s]=p.useState(null);return p.useEffect(()=>{e.then(({default:o})=>{const a=n!==void 0?n(o):o;s(a)})},[n,e]),{mappings:r}},Qc=({reportType:e,title:n,data:r,filterElements:s,getReportRoute:o,localization:a,licenseKey:i,EmployeePicker:l,localizationJsonFile:c,localizationTransformer:u,hyperlinkColumn:d,roomPasportization:m=!1})=>{const{texts:{reports:x}}=p.useContext(t.LuminusComponentsContext),{confirm:f}=t.useConfirm(),{prompt:g}=t.usePrompt(),h=se.useNavigate(),[b]=se.useSearchParams(),{id:v}=se.useParams(),j=p.useMemo(()=>v===void 0?null:Number(v),[v]),R=p.useCallback(A=>{const H=A===null?"":A.toString();h(se.generatePath(o(e),{id:H})+"?"+b.toString(),{replace:!0,flushSync:!0})},[o,h,e,b]),[y,E]=p.useState(!1),C=p.useRef(null),{user:S}=p.useContext(t.UserContext),{data:w,reloadData:I}=ge.useGetApiData(`/reports/${e}`),{mappings:T}=Xc(c,u),[_,P]=p.useState(void 0),D=p.useCallback(A=>{const H=A.target.value,Q=H===""?null:Number(H);R(Q)},[R]),B=p.useCallback(async A=>{await I(),R(A)},[I,R]),{data:O,setData:L,isLoading:M,reloadData:$}=ge.useGetApiData(`/reports/version/${j}`,{enabled:j!==null,nullStateBeforeLoad:!1,nullStateOnFail:!0});p.useEffect(()=>{var H;if(M){P(void 0);return}if(O===null){P({});return}const A=Wc(O)??{};P(A),(H=C.current)==null||H.flexmonster.refresh()},[O,M]);const{save:V,saveAs:G,archive:k,detach:W,rename:z}=qc(e,C,j,B),q=p.useMemo(()=>({data:r??[],mapping:T??void 0}),[r,T]),ne=p.useCallback(async()=>{var H;await f(x.confirmRevertChanges)&&((H=C.current)==null||H.flexmonster.setReport({dataSource:q,..._}))},[f,q,x.confirmRevertChanges,_]),X=p.useMemo(()=>(O==null?void 0:O.ownerId)===S.personalNumber,[O==null?void 0:O.ownerId,S.personalNumber]),ie=p.useMemo(()=>{var A;return(A=O==null?void 0:O.users)==null?void 0:A.some(H=>H.id===S.personalNumber&&!H.isReportOwner)},[O==null?void 0:O.users,S.personalNumber]),oe=p.useCallback(async()=>{await f(x.confirmDelete(O==null?void 0:O.name))&&(await k(),R(null),await I())},[k,f,I,O==null?void 0:O.name,x,R]),ve=p.useCallback(async()=>{await f(x.confirmDetach(O==null?void 0:O.name))&&(await W(),R(null),await I())},[f,W,I,O==null?void 0:O.name,x,R]),Z=p.useCallback(async()=>{const A=await g(x.enterNewName,{input:"input",required:!0});A!==null&&(await z(A),await Promise.allSettled([I(),$()]))},[g,x.enterNewName,z,I,$]);return p.useEffect(()=>{var A,H;j===null&&R(((A=w==null?void 0:w.reportVersions.find(Q=>Q.isSystem===!0))==null?void 0:A.reportVersionId)??((H=w==null?void 0:w.reportVersions[0])==null?void 0:H.reportVersionId)??null)},[w==null?void 0:w.reportVersions,j,R]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.PageContainer,{variant:"fullScreen",title:t.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-start gap-3 align-items-center",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h3",children:n}),s,t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxRuntimeExports.jsxs(t.FormSelect,{size:"sm",value:j??void 0,onChange:D,children:[t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectSystem,children:w==null?void 0:w.reportVersions.filter(A=>A.isSystem===!0).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:A.name},A.reportVersionId))}),t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectYour,children:w==null?void 0:w.reportVersions.filter(A=>A.ownerId===S.personalNumber).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:A.name},A.reportVersionId))}),t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectSharedWithYou,children:w==null?void 0:w.reportVersions.filter(A=>A.isSystem===!1&&A.ownerId!==S.personalNumber).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:`${A.name} [${A.ownerId}]`},A.reportVersionId))})]}),t.jsxRuntimeExports.jsx(t.ContextButton,{icon:t.jsxRuntimeExports.jsx(t.MdSave,{}),onClick:V,disabled:j===null||(O==null?void 0:O.isSystem)||!X,children:x.save}),t.jsxRuntimeExports.jsx(t.ContextButton,{icon:t.jsxRuntimeExports.jsx(t.MdSaveAs,{}),onClick:G,className:"flex-shrink-0",children:x.saveAs}),t.jsxRuntimeExports.jsxs(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle}),children:[t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:ne,children:x.revertChanges}),t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:()=>E(!0),disabled:!X||(O==null?void 0:O.isSystem),children:x.share}),X&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:Z,children:x.rename}):null,X&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{color:"danger",onClick:oe,children:x.delete}):null,ie&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{color:"danger",onClick:ve,children:x.detach}):null]})]})]}),children:q.data&&q.data.length>0?t.jsxRuntimeExports.jsx("div",{className:"h-100 w-100",children:t.jsxRuntimeExports.jsx($a,{dataSource:q,settings:_,pivotRef:C,enabled:q.data&&q.data.length>0,roomPasportization:m,localization:a,licenseKey:i,hyperlinkColumn:d})}):t.jsxRuntimeExports.jsx(t.Alert,{children:x.emptyReportDataSource})}),O!==null?t.jsxRuntimeExports.jsx(Kc,{isOpen:y,onHide:()=>E(!1),usersData:O.users??null,setReportVersion:L,reportVersionId:O==null?void 0:O.reportVersionId,EmployeePicker:l}):null]})},Jc=({cell:{value:e}})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e?t.jsxRuntimeExports.jsx(t.AvatarIcon,{name:e,size:21,fontSize:12}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})}),Zc=({knownTypes:e,typeFilters:n,onChangeTypeFilters:r})=>t.jsxRuntimeExports.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:e.map(s=>t.jsxRuntimeExports.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:t.classNames(`border-${s}`,n.includes(s)&&`bg-${s}`),onClick:()=>{n.includes(s)?r(n.filter(o=>o!==s)):r([...n,s])}},s))}),eu=({linksTo:e,onClick:n,children:r})=>e?t.jsxRuntimeExports.jsx(se.Link,{to:e,className:"text-decoration-none",onClick:n,children:r}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r}),tu=({message:e,onDeleteMessage:n,onClickMessage:r,getIcon:s,getLinksTo:o})=>{const{ProjectIconComponent:a,localizationContext:i}=p.useContext(t.LuminusComponentsContext),{dateFnsLocale:l}=p.useContext(i),c=e.dateTime?t.parseISO(e.dateTime):null,u=c?Nl(new Date(Date.now()),c):0;return t.jsxRuntimeExports.jsxs("div",{children:[c&&t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:t.format(c,"dd.MM.yyyy HH:mm"),placement:"left",children:t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",children:u>2?t.format(c,"dd.MM.yyyy"):Sl(c,new Date(Date.now()),{locale:l.code})})})})}),t.jsxRuntimeExports.jsx(eu,{linksTo:o(e)??void 0,onClick:r,children:t.jsxRuntimeExports.jsx(dl,{level:e.type,noIcon:!0,children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start gap-2",children:[s(e),t.jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"fw-bold",children:e.subject}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:d=>{d.preventDefault(),d.stopPropagation(),n(e.id)},children:t.jsxRuntimeExports.jsx(a,{icon:"delete"})})]}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:e.text})]})]})})})]})},Fs=["info","warning","danger"],Vs=({messages:e,isLoading:n,onDeleteMessage:r,onClickMessage:s,getIcon:o,getLinksTo:a})=>{const{texts:{messageBoard:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(Fs),u=p.useMemo(()=>e.filter(d=>l.includes(d.type??"")),[l,e]);return t.jsxRuntimeExports.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[t.jsxRuntimeExports.jsx(Zc,{knownTypes:Fs,typeFilters:l,onChangeTypeFilters:d=>c(d)}),n&&t.jsxRuntimeExports.jsxs("div",{className:"p-3 w-100",children:[t.jsxRuntimeExports.jsx(Qe,{as:Ns.Title,animation:"glow",children:t.jsxRuntimeExports.jsx(Qe,{xs:6})}),t.jsxRuntimeExports.jsxs(Qe,{as:Ns.Text,animation:"glow",children:[t.jsxRuntimeExports.jsx(Qe,{xs:7})," ",t.jsxRuntimeExports.jsx(Qe,{xs:4})," ",t.jsxRuntimeExports.jsx(Qe,{xs:4})," ",t.jsxRuntimeExports.jsx(Qe,{xs:6})," ",t.jsxRuntimeExports.jsx(Qe,{xs:8})]})]}),!n&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e.length===0&&t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",className:"mt-2",children:i.noMessages}),t.jsxRuntimeExports.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:u.map(d=>t.jsxRuntimeExports.jsx(tu,{message:d,onDeleteMessage:r,onClickMessage:s,getIcon:o,getLinksTo:a},d.id))})]})]})},Hn={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},nu=({renderAsNotifPanel:e,notifIcon:n,apiUrls:{apiGet:r=Hn.apiGet,apiDelete:s=Hn.apiDelete}=Hn,getIcon:o,getLinksTo:a})=>{const l=t.useAxios(),[c,u]=p.useState([]),[d,m]=p.useState(!1),[x,f]=p.useState(!1),[g,h]=p.useState(!1),b=p.useCallback(async()=>{f(!0),await l.get(r).then(({data:E})=>{u(E),m(!0),f(!1)}).catch(()=>{u([]),f(!1)})},[r,l]),v=p.useCallback(async E=>l.delete(`${s}${E}`).then(()=>!0).catch(()=>!1),[s,l]),j=p.useCallback(E=>{v(E).then(C=>{C&&u(c.filter(S=>S.id!==E))})},[v,c]);p.useEffect(()=>{b();const E=setInterval(()=>b(),60*1e3);return()=>{clearInterval(E)}},[b]);const R=c.filter(E=>E.type==="danger").length,y=d?!1:x;return e?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"position-relative",children:[t.jsxRuntimeExports.jsx(t.IconButton,{size:"md",onClick:()=>h(!g),children:n}),R>0&&t.jsxRuntimeExports.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:R})]}),t.jsxRuntimeExports.jsx(Ss,{show:g,onHide:()=>h(!1),placement:"end",children:t.jsxRuntimeExports.jsx(Ss.Body,{children:t.jsxRuntimeExports.jsx(Vs,{messages:c,isLoading:y,onDeleteMessage:j,onClickMessage:()=>h(!1),getIcon:o,getLinksTo:a})})})]}):t.jsxRuntimeExports.jsx(Vs,{messages:c,isLoading:y,onDeleteMessage:j,getIcon:o,getLinksTo:a})},ru="_tab-panel_d8l8q_1",su="_full-height-no-overflow_d8l8q_5",ou="_disabled_d8l8q_12",zn={"tab-panel":"_tab-panel_d8l8q_1",tabPanel:ru,"full-height-no-overflow":"_full-height-no-overflow_d8l8q_5",fullHeightNoOverflow:su,disabled:ou},Ga=({eventKey:e,activeTab:n,fullHeightNoOverflow:r,disabled:s,className:o,children:a})=>e!==n?null:t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-tab-panel",zn.tabPanel,{[zn.fullHeightNoOverflow]:r},{disabled:s},{[zn.disabled]:s},o),children:a}),au="_join-line_1q9e8_1",iu={"join-line":"_join-line_1q9e8_1",joinLine:au},Mr=({activeTab:e,onSelect:n,children:r,vertical:s,verticalStepper:o})=>t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-tabs d-flex mb-2",{"gap-1":!o},{"gap-0":o},{"flex-column":s||o}),children:r.map((a,i)=>{const l=a.type,c=a.props;if(!c)return null;const u=c.eventKey,d=c.children,m=c.className,x=c.onClick;return t.jsxRuntimeExports.jsxs(p.Fragment,{children:[t.jsxRuntimeExports.jsx(l,{...c,className:t.classNames({active:e===u},m),onClick:()=>{n(u),x&&x(u)},vertical:s||o,children:d}),o&&i<r.length-1&&t.jsxRuntimeExports.jsx("div",{className:t.classNames("join-line",iu.joinLine)})]},c.eventKey)})}),lu="_tab_1tbi7_1",cu="_disabled_1tbi7_7",uu="_vertical_1tbi7_13",qn={tab:lu,disabled:cu,vertical:uu},Lr=({eventKey:e,className:n,onClick:r,disabled:s,vertical:o,children:a})=>t.jsxRuntimeExports.jsx("div",{role:"button",className:t.classNames("luminus-tab text-primary rounded",qn.tab,n,{disabled:s},{[qn.disabled]:s},{vertical:o},{[qn.vertical]:o}),onClick:()=>r&&!s&&r(e),children:typeof a=="string"?t.jsxRuntimeExports.jsx(t.Typography,{variant:o?"body":"h6",className:o?"":"text-primary",children:a}):a}),du=({tabs:e,activeTab:n,onSelect:r,...s})=>{var i;const{ProjectIconComponent:o}=p.useContext(t.LuminusComponentsContext),{isMobile:a}=t.useWindowSize();return a?t.jsxRuntimeExports.jsx(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle,text:((i=e.find(l=>l.id===n))==null?void 0:i.name)??"",icon:t.jsxRuntimeExports.jsx(o,{icon:"chevron-down"})}),...s,children:e.map(l=>t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:()=>r(l.id),children:l.name},l.id))}):t.jsxRuntimeExports.jsx(Mr,{activeTab:n,onSelect:l=>r(l),...s,children:e.map(l=>t.jsxRuntimeExports.jsx(Lr,{eventKey:l.id,children:l.name},l.id))})},pu="_selection_1dtmm_1",mu="_selectionBg_1dtmm_10",xu="_selectionItemsContainer_1dtmm_18",fu="_selectionItems_1dtmm_18",pn={selection:pu,selectionBg:mu,selectionItemsContainer:xu,selectionItems:fu},Br=({icon:e,setIcon:n,IconComponent:r,IconTypeArray:s})=>{const[o,a]=p.useState(!1),i=l=>{n(l),a(!1)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{className:"rounded m-1",onClick:()=>a(!0),children:t.jsxRuntimeExports.jsx(r,{icon:e})}),o&&t.jsxRuntimeExports.jsxs("div",{className:pn.selection,children:[t.jsxRuntimeExports.jsx("div",{className:pn.selectionBg,onClick:()=>a(!1)}),t.jsxRuntimeExports.jsx("div",{className:pn.selectionItemsContainer,children:t.jsxRuntimeExports.jsx("div",{className:pn.selectionItems,children:s.filter((l,c,u)=>u.indexOf(l)===c).map(l=>t.jsxRuntimeExports.jsx(t.IconButton,{className:"rounded",onClick:()=>i(l),children:t.jsxRuntimeExports.jsx(r,{icon:l})},l))})})]})]})},Fr=()=>{const e=p.useContext(t.ShortcutLinksContext);if(e===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return e},gu=({shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteLocation:o})=>{const{ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(e.icon),[c,u]=p.useState(e.name);console.log(i,typeof i);const d=p.useMemo(()=>!(i===e.icon&&c===e.name),[i,c,e.icon,e.name]),m=p.useCallback(()=>{l(e.icon),u(e.name)},[e]),x=p.useCallback(()=>{s({...e,icon:i,name:c})},[s,i,c,e]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",maxLength:20,value:c,onChange:u,className:"d-flex-grow-1",InputContainer:t.NoInputContainer,size:"sm"})}),t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center align-items-center",children:t.jsxRuntimeExports.jsx(Br,{icon:i,setIcon:l,IconComponent:n,IconTypeArray:r})})}),t.jsxRuntimeExports.jsx("td",{className:"align-middle",style:{width:"7em"},children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-end",children:[d&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{onClick:m,color:"secondary",className:"d-inline",children:t.jsxRuntimeExports.jsx(a,{icon:"cancel"})}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:x,color:"success",className:"d-inline",children:t.jsxRuntimeExports.jsx(a,{icon:"check"})})]}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:o,color:"danger",children:t.jsxRuntimeExports.jsx(a,{icon:"delete"})})]})})]})},vu=({shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteShortcutLink:o})=>{const a=p.useCallback(()=>{o(e.id)},[o,e.id]);return t.jsxRuntimeExports.jsx("tr",{className:"mb-3",children:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.url.length<=23?t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:e.url}):t.jsxRuntimeExports.jsx(t.SimpleTooltip,{placement:"bottom",text:e.url,children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",children:[e.url.slice(0,21),"..."]})})}),t.jsxRuntimeExports.jsx(gu,{shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteLocation:a})]})})},hu=({IconComponent:e,IconTypeArray:n})=>{const{texts:r}=p.useContext(t.LuminusComponentsContext),{shortcutLinks:s,editShortcutLink:o,deleteShortcutLink:a}=Fr();return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s!==null&&s.length>0?t.jsxRuntimeExports.jsxs(Ul,{size:"sm",title:r.shortcutLinks.shortcutLinksSetting,children:[t.jsxRuntimeExports.jsx("thead",{className:"fw-bold",children:t.jsxRuntimeExports.jsxs("tr",{children:[t.jsxRuntimeExports.jsx("th",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.target})}),t.jsxRuntimeExports.jsx("th",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.name})}),t.jsxRuntimeExports.jsx("th",{className:"text-center",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.icon})}),t.jsxRuntimeExports.jsx("th",{})]})}),t.jsxRuntimeExports.jsx("tbody",{children:s==null?void 0:s.map(i=>t.jsxRuntimeExports.jsx(vu,{shortcutLink:i,IconComponent:e,IconTypeArray:n,editShortcutLink:o,deleteShortcutLink:a},i.id))})]}):t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",children:r.shortcutLinks.addLinksToEditThemHereInfo})})},hr=5,bu="_linkButton_pnlvi_1",ju="_linkAddButton_pnlvi_31",Eu="_createLinkRow_pnlvi_39",Rt={linkButton:bu,linkAddButton:ju,createLinkRow:Eu},yu=({shortcutLink:e,IconComponent:n})=>t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:e.name,placement:"bottom",children:t.jsxRuntimeExports.jsx(se.Link,{to:e.url,className:Rt.linkButton,children:t.jsxRuntimeExports.jsx(n,{icon:e.icon})})}),Ru=({closeModal:e,isOpen:n,createLink:r,pageTitlePrefix:s,IconComponent:o,IconTypeArray:a})=>{const i=se.useLocation(),{texts:l}=p.useContext(t.LuminusComponentsContext),[c,u]=p.useState("star-outline"),[d,m]=p.useState(s?document.title.replace(s,""):document.title),x=p.useCallback(async()=>{await r({icon:c,name:d,url:i.pathname+i.search}),e()},[e,r,c,i.pathname,i.search,d]),f=p.useMemo(()=>i.pathname+i.search,[i.pathname,i.search]);return t.jsxRuntimeExports.jsx(t.Modal,{show:n,onHide:e,size:"sm",children:t.jsxRuntimeExports.jsxs("div",{onKeyDown:g=>{g.code!=="Escape"&&g.stopPropagation()},children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:l.shortcutLinks.newShortcut})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.target}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:f.length<=23?f:t.jsxRuntimeExports.jsx(t.SimpleTooltip,{placement:"bottom",text:f,children:t.jsxRuntimeExports.jsxs("span",{children:[f.slice(0,21),"..."]})})})]}),t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.name}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",maxLength:25,value:d,onChange:m,className:"w-100",InputContainer:t.RowLabelInput,withoutLabel:!0})})]}),t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.icon}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsxRuntimeExports.jsx(Br,{icon:c,setIcon:u,IconComponent:o,IconTypeArray:a})})]})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:x,children:l.shortcutLinks.addShortcut})})]})})},Cu=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:r,createLink:s})=>{const{ProjectIconComponent:o,texts:a}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(!1),[c]=t.a(i,100);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:a.shortcutLinks.addShortcut,placement:"bottom",children:t.jsxRuntimeExports.jsx("button",{type:"button",className:t.classNames(Rt.linkButton,Rt.linkAddButton),onClick:()=>l(!0),children:t.jsxRuntimeExports.jsx(o,{icon:"add"})})}),(i||c)&&t.jsxRuntimeExports.jsx(Ru,{IconComponent:e,IconTypeArray:n,closeModal:()=>l(!1),createLink:s,isOpen:i,pageTitlePrefix:r})]})},Nu=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:r})=>{const{shortcutLinks:s,createShortcutLink:o}=Fr(),a=p.useMemo(()=>s!==null&&s.length<hr,[s]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2",children:[s==null?void 0:s.slice(0,hr).map((i,l)=>i!==null?t.jsxRuntimeExports.jsx(yu,{shortcutLink:i,IconComponent:e},l):null),a&&t.jsxRuntimeExports.jsx(Cu,{IconComponent:e,IconTypeArray:n,pageTitlePrefix:r,createLink:o})]})})},wu=e=>{const n=t.useAxios(),{startLoading:r,stopLoading:s}=p.useContext(t.LoadingContext),o=p.useCallback(async l=>{r("submit-createShortcutLink");try{await n.post(`/dynamicForms/insert?referenceId=${e}`,l)}finally{s("submit-createShortcutLink")}},[n,e,r,s]),a=p.useCallback(async l=>{r("submit-updateShortcutLink");try{await n.post(`/dynamicForms/update?referenceId=${e}`,l)}finally{s("submit-updateShortcutLink")}},[n,e,r,s]),i=p.useCallback(async l=>{r("delete-deleteShortcutLink");try{await n.delete(`/dynamicForms/delete?referenceId=${e}&pk=${l.toString()}`)}finally{s("delete-deleteShortcutLink")}},[n,e,r,s]);return{create:o,update:a,remove:i}},Su=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},$s=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},Du=({children:e,referenceId:n})=>{const{user:r}=p.useContext(t.UserContext),s=p.useCallback(f=>f.map(g=>({id:g.id,icon:g.icon,name:g.name,url:g.url})),[]),{data:o,reloadData:a}=ge.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${n}&employee=${r==null?void 0:r.personalNumber}`,{silent:!0,dataTransformer:s,enabled:r!==null}),{create:i,update:l,remove:c}=wu(n),u=p.useCallback(async f=>{const g=$s(r);if(Su(o).length>=hr)throw new Error("Cannot add more shortcut links.");await i({...f,employee:g.personalNumber}),await a()},[i,a,o,r]),d=p.useCallback(async f=>{const g=$s(r);await l({...f,employee:g.personalNumber}),await a()},[a,l,r]),m=p.useCallback(async f=>{await c(f),await a()},[a,c]),x=p.useMemo(()=>({shortcutLinks:o,createShortcutLink:u,editShortcutLink:d,deleteShortcutLink:m}),[u,m,d,o]);return t.jsxRuntimeExports.jsx(t.ShortcutLinksContext.Provider,{value:x,children:e})},Iu=({targets:e,removeNotifTarget:n})=>{const{ProjectIconComponent:r}=p.useContext(t.LuminusComponentsContext);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e&&e.sort((s,o)=>(s.employeeId??0)-(o.employeeId??0)).map(s=>t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-between mb-1",children:[t.jsxRuntimeExports.jsx("div",{className:"text-secondary",children:t.jsxRuntimeExports.jsx("span",{className:"d-flex gap-2 ",children:s.employeeId&&s.roleName===null?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(r,{icon:"user"}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"subtitle",children:s.employeeName})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(r,{icon:"role"}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"subtitle",children:s.roleName})]})})}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"danger",onClick:()=>n(s.id),children:t.jsxRuntimeExports.jsx(r,{icon:"delete"})})]},s.id))})},Tu=({show:e,onHide:n,roles:r,onAddTarget:s,EmployeePicker:o,templateId:a})=>{const{texts:{notifCentrum:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(null),[u,d]=p.useState(null),[m,x]=p.useState("R"),f=p.useCallback(()=>{c(null),d(null),n()},[n]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>f(),children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:i.addNewTarget})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(Fa,{options:[{id:"E",name:i.employee},{id:"R",name:i.role}],value:m,onChange:g=>x(g),InputContainer:t.RowLabelInput}),m==="E"?t.jsxRuntimeExports.jsx(o,{InputContainer:t.RowLabelInput,label:i.employee,value:{id:(l==null?void 0:l.id)??null,name:(l==null?void 0:l.name)??""},onSelect:g=>c({id:Number(g==null?void 0:g.id)??null,name:(g==null?void 0:g.name)??""})}):t.jsxRuntimeExports.jsx(t.CustomSelectInput,{InputContainer:t.RowLabelInput,label:i.role,options:r.map(g=>({id:g,name:g})),value:u,onChange:g=>d((g==null?void 0:g.toString())??"")})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:()=>{s({templateId:a??0,targetId:null,employeeId:(l==null?void 0:l.id)??null,roleName:u},(l==null?void 0:l.name)??null),f()},children:i.add})})]})},_u=({templates:e,selectedTemplateId:n,setSelectedTemplateId:r,roles:s,onAddNotifTarget:o,onRemoveNotifTarget:a,EmployeePicker:i})=>{const{texts:{notifCentrum:l},ProjectIconComponent:c}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.ListGroup,{className:"overflow-auto h-max-100 p-2",children:e.map(m=>t.jsxRuntimeExports.jsxs(t.ListGroup.Item,{action:n!==m.id,className:`p-0 mb-2 border rounded shadow-sm ${n===m.id?"border-1 border-primary":""}`,onClick:()=>r(m.id),children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-between align-items-center border-1 border-bottom border-primary p-2",children:[t.jsxRuntimeExports.jsx("div",{className:"text-primary",children:m.destinationId===1?t.jsxRuntimeExports.jsx(c,{icon:"mail-envelope"}):t.jsxRuntimeExports.jsx(c,{icon:"dashboard"})}),t.jsxRuntimeExports.jsx(t.Typography,{className:"text-truncate text-primary",variant:"subtitle",children:m.subjectTemplate}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>d(!0),children:t.jsxRuntimeExports.jsx(c,{icon:"add"})})]}),t.jsxRuntimeExports.jsx("div",{className:"my-2 ps-3 pe-2",children:m.targets.length>0?t.jsxRuntimeExports.jsx(Iu,{targets:m.targets,removeNotifTarget:a}):t.jsxRuntimeExports.jsx(t.Alert,{size:"sm",variant:"warning",children:l.noTargets})})]},m.id))}),t.jsxRuntimeExports.jsx(Tu,{show:u,onHide:()=>d(!1),roles:s??[],onAddTarget:o,EmployeePicker:i,templateId:n})]})},ku=({show:e,onHide:n,template:r,onEdit:s})=>{const{texts:{notifCentrum:o}}=p.useContext(t.LuminusComponentsContext),[a,i]=p.useState(null),[l,c]=p.useState(null);p.useEffect(()=>{r&&(i(r.subjectTemplate),c(r.textTemplate))},[r]);const u=p.useCallback(()=>{!a||!l||(s(a,l),n())},[l,s,n,a]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r&&t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:n,size:"lg",scrollable:!0,children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:o.editTemplate})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{style:{minHeight:"50vh"},children:[t.jsxRuntimeExports.jsxs(t.Form.Group,{controlId:"subject",children:[t.jsxRuntimeExports.jsx(t.Form.Label,{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"text-primary",children:o.subject})}),t.jsxRuntimeExports.jsx(t.Form.Control,{value:a??"",onChange:d=>i(d.target.value)})]}),t.jsxRuntimeExports.jsxs(t.Form.Group,{controlId:"text",children:[t.jsxRuntimeExports.jsx(t.Form.Label,{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"text-primary",children:o.text})}),t.jsxRuntimeExports.jsx(t.Form.Control,{as:"textarea",rows:10,value:l??"",onChange:d=>c(d.target.value),style:{resize:"vertical",minHeight:"400px"}})]})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:()=>{console.log(a),console.log(l),u()},children:o.save})})]})})},Ou=({kinds:e,targetSystem:n,reloadActions:r,reloadHistory:s,reloadRoles:o,onRemoveTarget:a,onPostTarget:i,onTemplateEdit:l,EmployeePicker:c})=>{var $,V,G;const{texts:{notifCentrum:u},ProjectIconComponent:d}=p.useContext(t.LuminusComponentsContext),{confirm:m}=t.useConfirm(),[x,f]=p.useState(null),[g,h]=p.useState(null),[b,v]=p.useState(!1),[j,R]=p.useState(null),[y,E]=ge.useLocalStorageState("notif-kind-id",null);p.useEffect(()=>{var k;e.length>0?E(((k=e.at(0))==null?void 0:k.id)??null):E(null)},[e,E]);const[C,S]=p.useState([]);p.useEffect(()=>{y&&r(y).then(k=>{S(k)}).catch(k=>{console.log(k),S([])})},[r,y]);const[w,I]=ge.useLocalStorageState("notif-action-id",(($=C==null?void 0:C.at(0))==null?void 0:$.id)??null),[T,_]=p.useState([]);p.useEffect(()=>{w===null||x===null||s(w,x).then(k=>{_(k)}).catch(k=>{console.log(k),_([])})},[r,s,w,y,x]);const[P,D]=p.useState([]);p.useEffect(()=>{w!==null&&o(w).then(k=>{D(k)}).catch(k=>{console.log(k),D([])})},[o,w]);const B=p.useMemo(()=>{var k;return!C||!w?[]:((k=C.find(W=>W.id===w))==null?void 0:k.templates)??[]},[C,w]),O=p.useCallback((k,W)=>{i(k,W).then(z=>{S(C?[...C.map(q=>q.id!==w?q:{...q,templates:[...q.templates.map(ne=>ne.id!==x?ne:{...ne,targets:[...ne.targets,z]})]})]:[])}).catch(z=>console.log(z))},[C,i,w,x,S]),L=p.useCallback((k,W)=>{x&&l(x,k,W).then(()=>{S(C?[...C.map(z=>z.id!==w?z:{...z,templates:[...z.templates.map(q=>q.id!==x?q:{...q,subjectTemplate:k,textTemplate:W})]})]:[])}).catch(z=>console.log(z))},[C,l,w,x]),M=p.useCallback(async k=>{await m(u.confirmTargetDelete)&&a(k).then(()=>S(C?[...C.map(W=>W.id!==w?W:{...W,templates:[...W.templates.map(z=>z.id!==x?z:{...z,targets:z.targets.filter(q=>q.id!==k)})]})]:[]))},[C,m,u,a,w,x]);return t.jsxRuntimeExports.jsxs("div",{className:"h-100 overflow-hidden",children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[t.jsxRuntimeExports.jsxs("div",{className:"row w-100",children:[t.jsxRuntimeExports.jsx("div",{className:"col-2",children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{label:u.kind,size:"sm",noEmptyOption:!0,options:((V=e.filter(k=>(k.targetSystem&n)>0))==null?void 0:V.map(k=>({id:k.id,name:k.name})))??[],value:y??null,onChange:k=>E(Number(k)),dropdownWidth:200})}),t.jsxRuntimeExports.jsx("div",{className:"col-3",children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{label:u.subkind,size:"sm",noEmptyOption:!0,options:(C==null?void 0:C.map(k=>({id:k.id,name:k.name})))??[],value:w??null,onChange:k=>I(Number(k)),dropdownWidth:250})})]}),t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdown,{children:t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{hideOn:"always",cKey:"template-edit",onClick:()=>v(!0),disabled:x===null,icon:t.jsxRuntimeExports.jsx(d,{icon:"edit"}),children:u.editTemplate})})]}),t.jsxRuntimeExports.jsxs("div",{className:"vh-100 overflow-hidden d-flex gap-1",children:[t.jsxRuntimeExports.jsx("div",{className:"h-75 w-25 overflow-hidden",children:t.jsxRuntimeExports.jsx(_u,{templates:B,roles:P??[],onAddNotifTarget:O,onRemoveNotifTarget:M,selectedTemplateId:x,setSelectedTemplateId:k=>{f(k),h(null)},EmployeePicker:c})}),x&&t.jsxRuntimeExports.jsx("div",{className:"h-75 w-75 overflow-hidden border rounded bg-white",children:t.jsxRuntimeExports.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:(g==null?void 0:g.message)??((G=B.find(k=>k.id===x))==null?void 0:G.textTemplate)})}),x&&t.jsxRuntimeExports.jsx("div",{className:"w-25 h-75 overflow-y-scroll",children:T.length>0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",value:j,onChange:k=>R((k==null?void 0:k.toString())??""),InputContainer:t.FloatingLabelInput,label:u.historyLookup,size:"sm",className:"mx-1 mb-1"}),t.jsxRuntimeExports.jsx("div",{children:T.filter(k=>{var W;return j?(W=k.recipients)==null?void 0:W.map(z=>z.name).join(",").toLocaleLowerCase().includes(j):k}).map(k=>{var W;return t.jsxRuntimeExports.jsxs("div",{role:"button",onClick:()=>h(k),className:`d-flex flex-column align-items-center bg-white border rounded w-auto p-2 mx-1 mb-1 ${(g==null?void 0:g.id)===k.id?"border-primary":""}`,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:t.format(k.date,"dd.MM.yyyy")}),t.jsxRuntimeExports.jsx("div",{className:"d-flex gap-1",children:(W=k.recipients)==null?void 0:W.map(z=>t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",children:`${z.name}`},z.email))})]},k.id)})})]}):t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",children:"Empty"})}),t.jsxRuntimeExports.jsx(ku,{show:b,onHide:()=>v(!1),template:B.find(k=>k.id===x)??null,onEdit:L})]})]})},Pu=({history:e,onClick:n,BnfTableComponent:r})=>{const{texts:{notifCentrum:s}}=p.useContext(t.LuminusComponentsContext),o=p.useMemo(()=>[{caption:"notificationHistory.id",fieldName:"id",type:"number",isVisible:!1},{caption:"notificationHistory.recipientId",fieldName:"recipientId",type:"number",isVisible:!1},{caption:"notificationHistory.recipientFullName",fieldName:"recipientFullName",type:"string",isVisible:!1},{caption:"notificationHistory.actionKindId",fieldName:"actionKindId",type:"number",isVisible:!1},{caption:s.subkind,fieldName:"actionKindName",type:"string",filterType:"select"},{caption:"notificationHistory.actionId",fieldName:"actionId",type:"number",isVisible:!1},{caption:s.subkind,fieldName:"actionName",type:"string",filterType:"select"},{caption:s.date,fieldName:"date",type:"string"},{caption:s.subject,fieldName:"subject",type:"string"},{caption:"notificationHistory.message",fieldName:"message",type:"string",isVisible:!1}],[s]),a=p.useCallback(i=>{n(i.id)},[n]);return t.jsxRuntimeExports.jsx(r,{columnsDef:o,data:e,useScrollableContainer:!0,paginationMode:"enabled",bottomBarProps:{hideFullScreen:!0},onRowClick:a})},Au=({reloadUserHistory:e,EmployeePicker:n,BnfTableComponent:r})=>{const{texts:{notifCentrum:s}}=p.useContext(t.LuminusComponentsContext),[o,a]=p.useState(null),[i,l]=ge.useLocalStorageState("notif-user",null),[c,u]=p.useState([]);return p.useEffect(()=>{i!==null&&e(i.id).then(d=>{u(d)}).catch(d=>{console.log(d),u([])})},[i,e]),t.jsxRuntimeExports.jsxs("div",{className:"h-100 overflow-hidden d-flex flex-column gap-1",children:[t.jsxRuntimeExports.jsx("div",{className:"row",children:t.jsxRuntimeExports.jsx("div",{className:"col-3",children:t.jsxRuntimeExports.jsx(n,{label:s.employee,value:i,size:"sm",onSelect:d=>l(d?{id:Number(d.id),name:d.name}:null)})})}),t.jsxRuntimeExports.jsxs("div",{className:"vh-100 overflow hidden row",children:[t.jsxRuntimeExports.jsx("div",{className:"col-5 h-75 overflow-hidden",children:t.jsxRuntimeExports.jsx(Pu,{history:c??[],onClick:d=>a((c==null?void 0:c.find(m=>m.id===d))??null),BnfTableComponent:r})}),o&&t.jsxRuntimeExports.jsx("div",{className:"col bg-darker h-75",children:t.jsxRuntimeExports.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:o==null?void 0:o.message})})]})]})},Ua=({result:e,onClose:n,tableIdentifier:r,BnfTableComponent:s})=>{var l,c,u,d,m;const{texts:{imports:o},ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),i=p.useMemo(()=>[{fieldName:"row",caption:o.row,type:"number",width:100},{fieldName:"column",caption:o.column,type:"number",width:100},{fieldName:"error",caption:o.error,type:"string",width:500}],[o.row,o.column,o.error]);return e?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(t.Alert,{variant:e.success?"success":"danger",size:"sm",className:"mb-2 p-2",children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-3 align-items-start",children:[t.jsxRuntimeExports.jsxs("div",{className:"w-100",children:[t.jsxRuntimeExports.jsx("div",{className:"w-100 text-center",children:e.success?o.importSuccess:o.importFailed}),e.success&&((l=e.data)!=null&&l.added||(c=e.data)!=null&&c.updated||(u=e.data)!=null&&u.deleted)?t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-2",children:t.jsxRuntimeExports.jsxs("div",{className:"list-group",children:[e.data.added?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importAdded(e.data.added)," "]})}):null,e.data.updated?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importUpdated(e.data.updated)," "]})}):null,e.data.deleted?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importDeleted(e.data.deleted)," "]})}):null]})}):null,!e.success&&((m=(d=e.data)==null?void 0:d.errors)==null?void 0:m.length)>0?t.jsxRuntimeExports.jsx("div",{className:"mt-3",children:t.jsxRuntimeExports.jsx(s,{columnsDef:i,data:e.data.errors,useScrollableContainer:!0,tableId:r})}):null]}),n!==void 0?t.jsxRuntimeExports.jsx(t.IconButton,{color:e.success?"success":"danger",className:t.classNames("hover-darken",e.success?"bg-success-subtle":"bg-danger-subtle"),onClick:n,children:t.jsxRuntimeExports.jsx(a,{icon:"close"})}):null]})})}):null},Mu="_upload-box_9ka79_1",Lu="_browse-btn_9ka79_15",Yn={"upload-box":"_upload-box_9ka79_1",uploadBox:Mu,"browse-btn":"_browse-btn_9ka79_15",browseBtn:Lu},Wa=({file:e,onFileChange:n,onImport:r,children:s,multiple:o,accept:a})=>{const{ProjectIconComponent:i,texts:{imports:l}}=p.useContext(t.LuminusComponentsContext),c=p.useCallback(async d=>{d.length>0&&n(o===!0?[...d]:d[0])},[e,o,n]),u=p.useCallback(d=>{var x;d.preventDefault();const m=(x=d.dataTransfer)==null?void 0:x.files;m&&(m==null?void 0:m.length)>0&&c(m)},[c]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e!==null?t.jsxRuntimeExports.jsxs("div",{className:"d-flex border rounded p-1 ps-2 bg-white justify-content-between align-items-center mb-2",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:o?e.map(d=>d.name).join(", "):e.name}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-3",children:[s??null,t.jsxRuntimeExports.jsx(t.PrimaryButton,{className:"text-nowrap",size:"sm",disabled:e===null,onClick:r,children:l.start})]})]}):null,t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Yn.uploadBox,{[Yn.active]:e!==null}),onDrop:u,onDragOver:d=>d.preventDefault(),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:l.dropHint}),t.jsxRuntimeExports.jsx("input",{type:"file",hidden:!0,id:"browse",onChange:d=>{var m;return((m=d.target)==null?void 0:m.files)&&c(d.target.files)},multiple:o,accept:a}),t.jsxRuntimeExports.jsx("label",{htmlFor:"browse",className:Yn.browseBtn,children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",className:"d-flex gap-2 align-items-center",children:[t.jsxRuntimeExports.jsx(i,{icon:"file-upload"}),l.pickFileHint]})})]})]})},Bu=({otherSettingId:e,languageOptions:n,tableIdentifier:r,SettingsOutlet:s,BnfTableComponent:o,importLocalization:a})=>{const{texts:{localizations:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(n[0].id),[u,d]=p.useState(null),[m,x]=p.useState(null),f=p.useCallback(async()=>{if(u===null)return;const g=await a({file:u,lang:l});g.status==="success"&&x(g.data)},[a,l,u]);return t.jsxRuntimeExports.jsx(s,{itemId:e,title:i.localizationImport,children:m?t.jsxRuntimeExports.jsx(Ua,{result:m,onClose:()=>x(null),BnfTableComponent:o,tableIdentifier:r}):t.jsxRuntimeExports.jsx(Wa,{file:u,onFileChange:d,onImport:f,children:t.jsxRuntimeExports.jsx("div",{style:{minWidth:140},children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{value:l,onChange:g=>typeof g=="string"?c(g):null,options:n,label:i.importedLanguage})})})})},Fu=(e,n)=>{const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const a=r[o],i=s[a];if(typeof i=="string")return i;if(i===void 0)return;s=i}},Vu=({selLng:e,lngsData:n,localizationKey:r,reloadData:s,saveChanges:o})=>{const{ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),i=p.useMemo(()=>{const m=n.get(e);if(m===void 0)return"";const x=Fu(m,r);return m!==void 0&&x!==void 0?x:""},[n,r,e]),[l,c]=p.useState(i),u=p.useCallback(async()=>{await o([{fileName:e+".json",items:[{key:r,value:l}]}]),await s()},[r,s,o,e,l]),d=p.useMemo(()=>l!==i,[i,l]);return t.jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[t.jsxRuntimeExports.jsx(t.TextInput,{label:e+r,type:"text",value:l,onChange:m=>{c(typeof m!="string"?"":m)},InputContainer:t.RowLabelInput,withoutLabel:!0,className:"flex-grow-1"}),d?t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>c(i),children:t.jsxRuntimeExports.jsx(a,{icon:"cancel"})}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:u,children:t.jsxRuntimeExports.jsx(a,{icon:"check"})})]}):null]})},$u="_keysTable_1j6ns_1",Gu="_subgrid_1j6ns_14",Uu="_lngSelectRow_1j6ns_19",Wu="_tableItem_1j6ns_26",Hu="_tableFooter_1j6ns_29",zu="_tableFullWidth_1j6ns_35",qu="_tableBody_1j6ns_39",Yu="_lngSelect_1j6ns_19",Ku="_addLng_1j6ns_52",Xu="_fileSelect_1j6ns_57",Qu="_searchBox_1j6ns_61",Se={keysTable:$u,subgrid:Gu,lngSelectRow:Uu,tableItem:Wu,tableFooter:Hu,tableFullWidth:zu,tableBody:qu,lngSelect:Yu,addLng:Ku,fileSelect:Xu,searchBox:Qu},mn=50,Ju=(e,n)=>{const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const a=r[o],i=s[a];if(typeof i=="string")return i;if(i===void 0)return;s=i}},Zu=({languageOptions:e,envMode:n,getOtherSettingsUrl:r,downloadXls:s,saveChanges:o,localizationFilesOptions:a,remoteLocalesRoot:i})=>{const{texts:{localizations:l},ProjectIconComponent:c}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(1),[m,x]=p.useState(new Map),[f,g]=p.useState(null),[h,b]=p.useState(""),[v,j]=p.useState(new Set),R=p.useCallback(D=>{x(new Map),j(D)},[]),y=p.useMemo(()=>e.filter(D=>!v.has(D.id)),[v,e]),E=p.useMemo(()=>{if(m.size===0)return[];const D=new Set,B=(V,G="")=>{if(typeof V[1]=="object"){Object.entries(V[1]).forEach(k=>B(k,G+V[0]+"."));return}D.add(G+V[0])};Array.from(m).forEach(V=>{Object.entries(V[1]).forEach(G=>B(G))});const O=Array.from(D),L=a.find(V=>V.path===f);return((L==null?void 0:L.type)==="report"?O.filter(V=>{const G=V.split(".");return G[G.length-1]==="caption"}):O).map(V=>({key:V,lngData:new Map(Array.from(v).map(G=>{const k=m.get(G);return[G,(k===void 0?void 0:Ju(k,V))??""]}))}))},[m,a,f,v]),C=p.useMemo(()=>E.filter(D=>t.stringSearchWithin(D.key,h)||Array.from(D.lngData).some(B=>typeof(B==null?void 0:B[1])!="string"?!1:t.stringSearchWithin((B==null?void 0:B[1])??"",h))),[h,E]),S=p.useMemo(()=>Math.ceil(C.length/mn),[C.length]),w=p.useCallback(D=>{D!==null&&d(()=>Math.max(1,Math.min(D,S)))},[S]),I=p.useCallback(async()=>{if(f===null)return;const D=Array.from(v).map(O=>(async()=>{const L=await t.axios.get(`${i}${f==null?void 0:f.replace("{{lng}}",O)}&v=${new Date().getTime()}`,{responseType:"json"});return[O,L.data]})()),B=await Promise.allSettled(D);x(new Map(B.map(O=>O.status==="fulfilled"?O.value:["",{}])))},[i,f,v]),T=p.useCallback(async()=>{I()},[I]),_=p.useMemo(()=>y.length>0,[y.length]),P=p.useMemo(()=>v.size+1+(_?1:0),[_,v.size]);return p.useEffect(()=>{w(u)},[w,u,C]),p.useEffect(()=>{I()},[I]),i===void 0?t.jsxRuntimeExports.jsx(t.PageContainer,{children:t.jsxRuntimeExports.jsxs(t.Alert,{variant:"danger",className:"fw-bold",children:[l.cantRunLocalizationSettings,t.jsxRuntimeExports.jsx("br",{}),t.jsxRuntimeExports.jsx("br",{}),l.envNotConnectedToRemote(n.toUpperCase())]})}):t.jsxRuntimeExports.jsx(t.PageContainer,{title:t.jsxRuntimeExports.jsx("div",{className:"d-flex gap-4",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"h3",children:l.localizationSettings})}),helmet:l.localizationSettings,variant:"fullScreen",children:t.jsxRuntimeExports.jsxs("div",{className:Se.keysTable,style:{"--keys-table-columns":P,"--adding-column":_?1:0},children:[t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.tableFullWidth,"d-flex align-items-center justify-content-between gap-2 px-2 mt-1"),children:[t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:a.map(D=>({id:D.path,name:D.nameTranslationKey})),value:f,onChange:D=>typeof D!="number"?g(D):null,size:"sm",label:l.localizationFile,className:Se.fileSelect,noSortOptions:!0}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.searchBox,"d-flex align-items-center gap-2 border rounded"),children:[t.jsxRuntimeExports.jsx(c,{icon:"search",className:"text-muted",size:18,iconProps:{className:"mt- me-n4"}}),t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",value:h,onChange:D=>b(typeof D=="string"?D:""),size:"sm",showClearIcon:h!=="",withoutLabel:!0,placeholder:"vyhledávat...",className:"placeholder-muted bg-transparent border-0 my-0 py-0 w-100"})]}),t.jsxRuntimeExports.jsxs(t.ResponsiveContextDropdown,{children:[t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{cKey:"export",hideOn:"always",onClick:s,icon:t.jsxRuntimeExports.jsx(t.FileExtensionIcon,{fileExtension:"xls"}),children:l.xlsExport}),t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{cKey:"import",hideOn:"always",to:r("localizationImport"),icon:t.jsxRuntimeExports.jsx(c,{icon:"link"}),children:l.import})]})]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.lngSelectRow),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:l.key}),Array.from(v).map((D,B)=>t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:e.filter(O=>O.id===D||!v.has(O.id)),value:D,onChange:O=>R(L=>O===null?(L.delete(D),new Set(L)):(typeof O=="string"&&(L.delete(D),L.add(O)),new Set(L))),size:"sm",label:`${l.language} ${B+1}`,withoutLabel:!0,InputContainer:t.RowLabelInput,className:t.classNames(Se.lngSelect)},D)),_?t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:y,value:null,onChange:D=>R(B=>(typeof D=="string"&&B.add(D),new Set(B))),size:"sm",label:l.addLanguage,InputContainer:t.RowLabelInput,className:t.classNames(Se.lngSelect,Se.addLng)}):null]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.tableBody),children:[E.length===0||C.length===0?t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",className:t.classNames(Se.tableFullWidth,Se.emptyTableAlert,"my-n1"),children:E.length===0?l.noDataLoaded:C.length===0?l.noDataFiltered:null}):null,C.slice(mn*(u-1),mn*u).map(D=>t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.tableItem),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",children:D.key}),Array.from(v).map(B=>t.jsxRuntimeExports.jsx(Vu,{localizationKey:D.key,lngsData:m,selLng:B,reloadData:T,saveChanges:o},B))]},D.key))]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames("d-flex align-items-center justify-content-around gap-3 px-2 py-0",Se.tableFooter),children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:[l.keyCount,":"," ",t.jsxRuntimeExports.jsx("span",{className:"fw-bold",children:C.length})]})}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:[l.page,": "]}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>w(u-1),children:t.jsxRuntimeExports.jsx(c,{icon:"minus"})}),t.jsxRuntimeExports.jsx("div",{style:{width:30},children:t.jsxRuntimeExports.jsx(Ba,{value:u,onChange:w,InputContainer:t.RowLabelInput,withoutLabel:!0,size:"sm"})}),t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:["/",Math.ceil(C.length/mn)]}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>w(u+1),children:t.jsxRuntimeExports.jsx(c,{icon:"plus"})})]})]})]})]})})},Gs=3,Ha=(e,n,r)=>{var o;if((n==null?void 0:n.customPathBuilder)!==void 0)return n.customPathBuilder(e,n);const s=(o=r.find(a=>a.key===e.type))==null?void 0:o.toPath;return s?`${s}/${e.searchKey}`:"/not-found"},za=(e,n)=>{var r;return((r=n==null?void 0:n.customNameBuilder)==null?void 0:r.call(n,e))??e.name},qa=(e,n,r,s,o)=>{const a=t.useAxios(),[i,l]=p.useState(!1),[c,u]=p.useState([]),d=e==="",m=p.useCallback(()=>{u([]),!(n.length<Gs)&&(l(!0),a.get(ke.generateApiPath(r,{path:{query:n},query:{type:d?void 0:e,count:s?void 0:d?5:20}})).then(({data:g})=>{u(g),l(!1)}).catch(()=>{l(!1)}))},[a,s,d,n,r,e]),x=p.useMemo(()=>{if(o===void 0)return[];if(n.length<Gs||!["XAP","",null].includes(e))return[];const g=[];return o.forEach(h=>{const b=h.items.filter(v=>t.stringSearchWithin(v.name,decodeURIComponent(n)));b.length>0&&g.push({key:{...h.key,totalCount:b.length},items:b})}),g},[n,o,e]),f=p.useMemo(()=>x.concat(c),[c,x]);return p.useEffect(()=>{m()},[m]),{isLoading:i,searchItems:f}},ed="_input-group_1hcpm_1",td="_input-group-text_1hcpm_5",nd="_left_1hcpm_9",rd="_right_1hcpm_13",sd="_input_1hcpm_1",od="_submit-button_1hcpm_20",ot={"input-group":"_input-group_1hcpm_1",inputGroup:ed,"input-group-text":"_input-group-text_1hcpm_5",inputGroupText:td,left:nd,right:rd,input:sd,"submit-button":"_submit-button_1hcpm_20",submitButton:od},ad=({searchTypes:e,selectedType:n,setSelectedType:r})=>t.jsxRuntimeExports.jsx(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle,icon:null,text:n==null?void 0:n.text}),children:e.map(s=>t.jsxRuntimeExports.jsx(t.DropdownItem,{icon:null,onClick:()=>r(s.key),children:s.text},s.key))}),id="_dropdown_1ddrg_1",ld="_open_1ddrg_12",cd="_loading-container_1ddrg_15",ud="_groups-container_1ddrg_22",dd="_group_1ddrg_22",pd="_header_1ddrg_26",md="_item_1ddrg_33",ut={dropdown:id,open:ld,"loading-container":"_loading-container_1ddrg_15",loadingContainer:cd,"groups-container":"_groups-container_1ddrg_22",groupsContainer:ud,group:dd,header:pd,item:md},xd=({item:e,searchTypes:n,onCancel:r})=>{const s=p.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=p.useMemo(()=>Ha(e,s,n),[e,s,n]),a=p.useMemo(()=>za(e,s),[e,s]);return t.jsxRuntimeExports.jsxs(se.Link,{to:o,className:t.classNames("search-item d-flex gap-3 align-items-center justify-content-between",ut.item),onClick:r,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:a}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",className:"text-primary",children:t.jsxRuntimeExports.jsx(t.MdOutlineArrowOutward,{})})]})},fd=({show:e,query:n,onCancel:r,groups:s,isLoading:o,searchTypes:a})=>{const{texts:{appSearch:i}}=p.useContext(t.LuminusComponentsContext),l=p.useRef(null);return t.useClickOutside([l],r),t.jsxRuntimeExports.jsx("div",{ref:l,className:t.classNames("luminus-app-search-dropdown shadow rounded",ut.dropdown,{[ut.open]:e}),children:o?t.jsxRuntimeExports.jsx("div",{className:ut.loadingContainer,children:t.jsxRuntimeExports.jsx(t.Spinner,{animation:"border",variant:"primary"})}):t.jsxRuntimeExports.jsx("div",{className:ut.groupsContainer,children:s==null?void 0:s.map(c=>{var u;return t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ut.group),children:[t.jsxRuntimeExports.jsxs(se.Link,{to:`/search?query=${n}&type=${c.key.category}`,className:t.classNames("group-header",ut.header),onClick:r,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:"text-primary",children:c.key.categoryName}),t.jsxRuntimeExports.jsxs(t.Typography,{variant:"caption",children:[c.items.length," ",i.amountFrom," ",c.key.totalCount]})]}),(u=c.items)==null?void 0:u.map((d,m)=>t.jsxRuntimeExports.jsx(xd,{item:d,onCancel:r,searchTypes:a},m))]},c.key.category)})})})},gd=({searchTypes:e,navigateFunction:n,currentPath:r,homePath:s="/",className:o,staticAppItems:a,searchEndpointUri:i})=>{var y;const{texts:{appSearch:l}}=p.useContext(t.LuminusComponentsContext),[c,u]=p.useState(e.length>0?((y=e.at(0))==null?void 0:y.key)??null:null),d=p.useMemo(()=>e.find(E=>E.key===c)??null,[e,c]),[m,x]=p.useState(""),[f,g]=t.a(encodeURIComponent(m),500),{isLoading:h,searchItems:b}=qa(c,f,i,!1,a),[v,j]=p.useState(!1);p.useEffect(()=>{(b.length>0||h)&&j(!0)},[b,h]);const R=p.useRef(null);return p.useEffect(()=>{var E;x(""),r===s&&((E=R.current)==null||E.focus())},[r,s]),t.jsxRuntimeExports.jsx(t.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:E=>{E.preventDefault(),E.stopPropagation(),g.flush(),j(!1),f.length>2&&n(`/search?query=${f}${d&&d.key&&`&type=${d==null?void 0:d.key}`}`)},children:t.jsxRuntimeExports.jsxs(yn,{className:t.classNames(ot.inputGroup,o),children:[t.jsxRuntimeExports.jsx(yn.Text,{className:t.classNames("p-1 rounded",ot.inputGroupText,ot.left),children:t.jsxRuntimeExports.jsx(ad,{searchTypes:e,selectedType:d,setSelectedType:u})}),t.jsxRuntimeExports.jsx(t.Form.Control,{ref:R,placeholder:l.searchPlaceholder,type:"text",size:"sm",className:t.classNames("luminus-app-search-input",ot.input),value:m,onChange:E=>{var C;return x(((C=E.target)==null?void 0:C.value)??"")},onFocus:()=>b.length>0&&j(!0)}),t.jsxRuntimeExports.jsx(yn.Text,{className:t.classNames("p-0 rounded",ot.inputGroupText,ot.right),children:t.jsxRuntimeExports.jsx("button",{type:"submit",className:t.classNames("text-primary",ot.submitButton),children:t.jsxRuntimeExports.jsx(t.FaSearch,{})})}),t.jsxRuntimeExports.jsx(fd,{query:f,searchTypes:e,show:v,onCancel:()=>j(!1),groups:b,isLoading:h})]})})},vd=({item:e,searchTypes:n})=>{const{ProjectIconComponent:r}=p.useContext(t.LuminusComponentsContext),s=p.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=p.useMemo(()=>Ha(e,s,n),[e,s,n]),a=p.useMemo(()=>za(e,s),[e,s]);return t.jsxRuntimeExports.jsxs(se.Link,{to:o,className:"text-nowrap list-group-item list-group-item-action d-flex justify-content-between align-items-center",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:a}),t.jsxRuntimeExports.jsx(r,{icon:"chevron-right",className:"text-primary"})]})},hd=({query:e,type:n,appSearchTypes:r,searchEndpointUri:s,staticAppItems:o})=>{var d,m;const{texts:{appSearch:a}}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(""),{searchItems:c,isLoading:u}=qa(n,e,s,!0,o);return p.useEffect(()=>{var x;i||c===null||c.length===0||l(((x=c[0].key)==null?void 0:x.category)??"")},[c,i]),c===null?null:t.jsxRuntimeExports.jsx(t.PageContainer,{variant:"fullScreen",children:u?t.jsxRuntimeExports.jsx(Ie.Loading,{}):c.length===0?t.jsxRuntimeExports.jsx("div",{className:"alert alert-warning",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:a.noResultsFor(e)})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Mr,{activeTab:i,onSelect:x=>l((x==null?void 0:x.toString())??""),children:c.map(x=>{var f,g;return t.jsxRuntimeExports.jsx(Lr,{eventKey:((f=x.key)==null?void 0:f.category)??"",children:((g=x.key)==null?void 0:g.categoryName)??""},x.key.category)})}),t.jsxRuntimeExports.jsx(Ga,{eventKey:i,activeTab:i,fullHeightNoOverflow:!0,children:t.jsxRuntimeExports.jsx("div",{className:"list-group h-100 overflow-auto",children:(m=(d=c.find(x=>x.key.category===i))==null?void 0:d.items)==null?void 0:m.map((x,f)=>t.jsxRuntimeExports.jsx(vd,{item:x,searchTypes:r},f))})})]})})},bd=()=>{const{texts:{userSettings:e}}=p.useContext(t.LuminusComponentsContext),[n,r]=ge.useLocalStorageState("file-download-try-opening",!0);return t.jsxRuntimeExports.jsx(nt,{collapsible:!0,title:e.downloads,defaultOpen:!0,children:t.jsxRuntimeExports.jsx(Nt,{type:"switch",value:n===void 0?!0:n,onChange:r,label:e.tryOpenFileLabel})})},jd=({show:e,handleClose:n,onConfirm:r,apiCreateBackup:s})=>{const{texts:{userSettings:o}}=p.useContext(t.LuminusComponentsContext),{zStringRequired:a}=t.useZodSchemaTypes(),{addNotification:i}=t.useNotifications(),l=t.useAxios(),{startLoading:c,stopLoading:u}=p.useContext(t.LoadingContext),[d,m]=p.useState(null),x=t.z.object({name:a()}),f=Ee.useForm({resolver:t.t(x)}),g=p.useCallback(async(b,v)=>(c("localStorageSettingPost"),l.post(s,{name:b,setting:v}).then(()=>!0).catch(()=>!1).finally(()=>u("localStorageSettingPost"))),[l,s,c,u]),h=async b=>{await g(b.name,JSON.stringify(d))&&(i(o.localStorageCreateBackupSuccess,"success"),r())};return p.useEffect(()=>{e&&m(ke.dumpLocalStorage())},[e]),t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>n(),children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:o.localStorageCreateBackup})}),t.jsxRuntimeExports.jsx(Ee.FormProvider,{...f,children:t.jsxRuntimeExports.jsxs(t.Form,{onSubmit:f.handleSubmit(h),noValidate:!0,children:[t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",children:o.localStorageCreateBackupInfo(Object.keys(d||{}).length)}),t.jsxRuntimeExports.jsx(t.HookFormTextInput,{required:!0,label:o.localStorageCreateBackupName,formField:"name",type:"text"})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{type:"submit",children:o.localStorageCreateBackupSave})})]})})]})},xn={apiGetBackups:"/localStorageSettings",apiCreateBackup:"/localStorageSettings",apiDeleteBackup:"/localStorageSettings"},Ed=({apiUrls:{apiGetBackups:e=xn.apiGetBackups,apiCreateBackup:n=xn.apiCreateBackup,apiDeleteBackup:r=xn.apiDeleteBackup}=xn})=>{const{ProjectIconComponent:s,texts:{userSettings:o}}=p.useContext(t.LuminusComponentsContext),{confirm:a}=t.useConfirm(),i=t.useAxios(),{startLoading:l,stopLoading:c}=p.useContext(t.LoadingContext),{addNotification:u}=t.useNotifications(),[d,m]=p.useState(!1),{data:x,setData:f,reloadData:g}=ge.useGetApiData(e),h=p.useCallback(async j=>(l("localStorageSettingDelete"),i.delete(`${r}/${j}`).then(()=>!0).catch(()=>!1).finally(()=>c("localStorageSettingDelete"))),[i,r,l,c]),b=p.useCallback(async j=>{await a(o.localStorageDeleteBackupConfirm)&&await h(j)&&(u(o.localStorageDeleteBackupSuccess,"success"),f(R=>(R==null?void 0:R.filter(y=>y.id!==j))??null))},[a,o,h,u,f]),v=p.useCallback(async j=>{j.setting&&await a(o.localStorageLoadBackup)&&(ke.restoreLocalStorage(j.setting)?u(o.localStorageLoadBackupSuccess,"success"):u(o.localStorageLoadBackupError,"danger"))},[a,o,u]);return t.jsxRuntimeExports.jsxs(nt,{collapsible:!0,title:o.localStorage,defaultOpen:!0,children:[t.jsxRuntimeExports.jsx(t.ContextButton,{className:"mb-2",onClick:()=>m(!0),children:o.localStorageCreateBackup}),x&&x.length>0?t.jsxRuntimeExports.jsx("div",{className:"list-group",children:x.map((j,R)=>t.jsxRuntimeExports.jsxs("div",{role:"button",className:"list-group-item list-group-item-action d-flex justify-content-between align-items-center",onClick:()=>v(j),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:j.name}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-3",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"text-muted",children:j.date?t.formatDate(j.date):""}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"danger",onClick:y=>{y.stopPropagation(),b(j.id)},children:t.jsxRuntimeExports.jsx(s,{icon:"delete"})})]})]},R))}):x?t.jsxRuntimeExports.jsx(t.Alert,{variant:"secondary",size:"sm",children:o.localStorageNoBackups}):null,t.jsxRuntimeExports.jsx(jd,{show:d,handleClose:()=>m(!1),onConfirm:()=>{m(!1),g()},apiCreateBackup:n})]})},yd=()=>{const{texts:{userSettings:e}}=p.useContext(t.LuminusComponentsContext),[n,r]=ge.useLocalStorageState("search-use-asterisk",!0);return t.jsxRuntimeExports.jsx(nt,{collapsible:!0,title:e.searchSettings,defaultOpen:!0,children:t.jsxRuntimeExports.jsx(Nt,{type:"switch",value:n===void 0?!0:n,onChange:r,label:e.searchSettingsUseAsterisk})})},Rd="_widgets-row_13gg1_1",Cd="_widget_13gg1_1",Nd="_widget-img_13gg1_5",wd="_widget-title-spacer_13gg1_14",Sd="_widget-title_13gg1_14",Dd="_title_13gg1_28",Le={"widgets-row":"_widgets-row_13gg1_1",widgetsRow:Rd,widget:Cd,"widget-img":"_widget-img_13gg1_5",widgetImg:Nd,"widget-title-spacer":"_widget-title-spacer_13gg1_14",widgetTitleSpacer:wd,"widget-title":"_widget-title_13gg1_14",widgetTitle:Sd,title:Dd},Id=({show:e,widgetGroups:n,widgets:r,handleClose:s,onWidgetPicked:o,texts:a})=>{const[i,l]=p.useState(""),c=p.useMemo(()=>r.filter(d=>d.id!==-1&&t.stringSearchWithin(d.name,i)),[r,i]),u=p.useMemo(()=>n.filter(d=>c.some(m=>m.group===d.id)),[n,c]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>s(),size:"lg",children:[t.jsxRuntimeExports.jsxs(t.Modal.Header,{closeButton:!0,children:[t.jsxRuntimeExports.jsx(t.Modal.Title,{className:"w-100",children:a.pickWidgetToAdd}),t.jsxRuntimeExports.jsx(t.Form.Control,{type:"search",size:"sm",value:i,placeholder:a.searchPlaceholder,onChange:d=>{var m;return l(((m=d.target)==null?void 0:m.value)??"")},className:"me-3",style:{maxWidth:"200px"}})]}),t.jsxRuntimeExports.jsx(t.Modal.Body,{className:"flex-column gap-3",children:c.length===0?t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",children:a.noWidgets}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u.map(d=>t.jsxRuntimeExports.jsx(Yt,{defaultOpen:!0,title:d.name??"",children:t.jsxRuntimeExports.jsx("div",{className:"p-1",children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("row gx-3 gy-3",Le.widgetsRow),children:c.filter(m=>m.group===d.id).map(m=>t.jsxRuntimeExports.jsx("div",{className:"col col-4",children:t.jsxRuntimeExports.jsxs("div",{role:"button",className:t.classNames("p-0 pt-2 bg-white rounded shadow-sm",Le.widget),onClick:()=>o(m.id),children:[t.jsxRuntimeExports.jsx("div",{className:Le.widgetImg,style:{backgroundImage:m.img?`url(${m.img})`:void 0}}),t.jsxRuntimeExports.jsx("div",{className:Le.widgetTitleSpacer}),t.jsxRuntimeExports.jsx("div",{className:t.classNames(Le.widgetTitle,"rounded"),children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:t.classNames(Le.title,"text-white text-truncate"),children:m.name})})]},m.id)}))})})},d.id)),c.some(d=>d.group===void 0)&&t.jsxRuntimeExports.jsx(Yt,{defaultOpen:!0,title:a.otherWidgets,children:t.jsxRuntimeExports.jsx("div",{className:"p-1",children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("row gx-3 gy-3",Le.widgetsRow),children:c.filter(d=>d.group===void 0).map(d=>t.jsxRuntimeExports.jsx("div",{className:"col col-4",children:t.jsxRuntimeExports.jsxs("div",{role:"button",className:t.classNames("p-0 pt-2 bg-white rounded shadow-sm",Le.widget),onClick:()=>o(d.id),children:[t.jsxRuntimeExports.jsx("div",{className:Le.widgetImg,style:{backgroundImage:d.img?`url(${d.img})`:void 0}}),t.jsxRuntimeExports.jsx("div",{className:Le.widgetTitleSpacer}),t.jsxRuntimeExports.jsx("div",{className:t.classNames(Le.widgetTitle,"rounded"),children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:t.classNames(Le.title,"text-white text-truncate"),children:d.name})})]},d.id)}))})})})]})})]})},Td="_widget_19xgl_1",_d="_mobile_19xgl_7",Us={widget:Td,mobile:_d},Ws=({widgetGroups:e,availableWidgets:n,onAdd:r,texts:s})=>{const[o,a]=p.useState(!1),{isMobile:i}=t.useWindowSize();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-empty-widget",Us.widget,{[Us.mobile]:i}),children:t.jsxRuntimeExports.jsx(t.IconButton,{onClick:()=>a(!0),children:t.jsxRuntimeExports.jsx(t.MdOutlineAddCircleOutline,{})})}),t.jsxRuntimeExports.jsx(Id,{show:o,widgetGroups:e,widgets:n,handleClose:()=>a(!1),onWidgetPicked:l=>{a(!1),r(l)},texts:s})]})},kd="_dashboard_1gf59_1",Od="_widgets-grid_1gf59_1",Pd="_widget-wrapper_1gf59_8",Ad="_full-width_1gf59_13",Md="_widget-edit_1gf59_16",Ld="_remove-icon_1gf59_19",Bd="_full-width-icon_1gf59_26",Fd="_widget-edit-overlay_1gf59_36",Vd="_mobile_1gf59_45",ze={dashboard:kd,"widgets-grid":"_widgets-grid_1gf59_1",widgetsGrid:Od,"widget-wrapper":"_widget-wrapper_1gf59_8",widgetWrapper:Pd,"full-width":"_full-width_1gf59_13",fullWidth:Ad,"widget-edit":"_widget-edit_1gf59_16",widgetEdit:Md,"remove-icon":"_remove-icon_1gf59_19",removeIcon:Ld,"full-width-icon":"_full-width-icon_1gf59_26",fullWidthIcon:Bd,"widget-edit-overlay":"_widget-edit-overlay_1gf59_36",widgetEditOverlay:Fd,mobile:Vd},$d=(e,n="dashboardConfig")=>{const[r,s]=p.useState({widgets:[]});p.useEffect(()=>{const a=localStorage.getItem(n);a?s(JSON.parse(a)):e&&s(e)},[e,n]);const o=p.useCallback(a=>{s(a),localStorage.setItem(n,JSON.stringify(a))},[n]);return{dashboardConfig:r,onChangeDashboardConfig:o}},Gd=({widgetGroups:e,availableWidgets:n,editMode:r,defaultDashboardConfig:s,dashboardConfigKey:o})=>{var f;const{texts:{homeDashboard:a}}=p.useContext(t.LuminusComponentsContext),{dashboardConfig:i,onChangeDashboardConfig:l}=$d(s,o),c=p.useCallback((g,h)=>{var b,v;g===((b=i.widgets)==null?void 0:b.length)?l({...i,widgets:[...i.widgets,{widgetId:h,fullWidth:!1}]}):l({...i,widgets:((v=i.widgets)==null?void 0:v.map((j,R)=>R===g?{widgetId:h,fullWidth:!1}:j))??[]})},[i,l]),u=p.useCallback(g=>{var h,b;((h=i.widgets[g])==null?void 0:h.widgetId)===-1?l({...i,widgets:((b=i.widgets)==null?void 0:b.filter((v,j)=>j!==g))??[]}):c(g,-1)},[i,l,c]),d=p.useCallback(g=>{var h;l({...i,widgets:((h=i.widgets)==null?void 0:h.map((b,v)=>v===g?{...b,fullWidth:!b.fullWidth}:b))??[]})},[i,l]),m=p.useCallback((g,h,b)=>g?t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ze.widgetWrapper,{[ze.widgetEdit]:r&&g.id!==-1},{[ze.fullWidth]:b}),children:[r&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>u(h),className:t.classNames(ze.removeIcon),children:t.jsxRuntimeExports.jsx(t.MdOutlineDelete,{})}),t.jsxRuntimeExports.jsx(t.IconButton,{color:b?"danger":"primary",onClick:()=>d(h),className:t.classNames(ze.fullWidthIcon),children:t.jsxRuntimeExports.jsx(t.MdOutlineExpand,{})})]}),g.id===-1?r&&t.jsxRuntimeExports.jsx("div",{className:ze.widgetWrapper,children:t.jsxRuntimeExports.jsx(Ws,{widgetGroups:e,availableWidgets:n,onAdd:v=>c(h,v),texts:a})}):t.jsxRuntimeExports.jsx(ec,{title:g.title,children:t.jsxRuntimeExports.jsx(g.WidgetElement,{title:g.title})}),g.id>-1&&r&&t.jsxRuntimeExports.jsx("div",{className:ze.widgetEditOverlay})]},h):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{}),[r,e,c,u,d,n,a]),{isMobile:x}=t.useWindowSize();return t.jsxRuntimeExports.jsx("div",{className:t.classNames(ze.dashboard,{[ze.mobile]:x}),children:t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ze.widgetsGrid),children:[(f=i.widgets)==null?void 0:f.map((g,h)=>m(n.find(b=>b.id===g.widgetId),h,g.fullWidth)),r&&t.jsxRuntimeExports.jsx(Ws,{widgetGroups:e,availableWidgets:n,onAdd:g=>{var h;return c((h=i.widgets)==null?void 0:h.length,g)},texts:a})]})})},Ud="_badge_193ci_1",Wd="_sm_193ci_6",Hd="_md_193ci_10",zd="_lg_193ci_14",qd="_light_193ci_18",Kn={badge:Ud,sm:Wd,md:Hd,lg:zd,light:qd},Yd=({children:e,color:n="primary",size:r="md",rounded:s,className:o,variant:a="filled",...i})=>{const l=p.useMemo(()=>a==="filled"?t.classNames(`bg-${n}`):a==="outline"?t.classNames(`text-${n} border-${n} border bg-white`):"",[n,a]);return t.jsxRuntimeExports.jsx("span",{className:t.classNames("luminus-badge badge",l,o,{"rounded-pill":s},{"text-dark":n==="light"},{[Kn.light]:n==="light"},Kn.badge,Kn[r]),...i,children:e})},Kd="_collapse-icon_1ahhn_1",Xd="_collapsed_1ahhn_6",Hs={"collapse-icon":"_collapse-icon_1ahhn_1",collapseIcon:Kd,collapsed:Xd},Yt=({title:e,children:n,className:r,...s})=>{const o=s.controlled?!1:s.defaultOpen??!1,[a,i]=p.useState(o),l=s.controlled?s.isOpen:a;return p.useEffect(()=>{i(o)},[o]),t.jsxRuntimeExports.jsxs("div",{className:r??"",children:[t.jsxRuntimeExports.jsxs("div",{role:"button",className:"d-flex align-items-center justify-content-between pb-3 pt-2",onClick:()=>s.controlled?s.onToggle(!s.isOpen):i(!a),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",children:e}),t.jsxRuntimeExports.jsx(t.MdOutlineChevronRight,{className:t.classNames(Hs.collapseIcon,{[Hs.collapsed]:l})})]}),t.jsxRuntimeExports.jsx(sa,{in:l,children:t.jsxRuntimeExports.jsx("div",{children:n})}),t.jsxRuntimeExports.jsx("hr",{className:`my-0 ${l?"mt-3":""}`})]})},Qd="_card_19733_1",Jd="_header_19733_6",Zd="_header-content_19733_13",ep="_title_19733_19",tp="_collapse-icon_19733_22",np="_collapsed_19733_27",rp="_content_19733_30",at={card:Qd,header:Jd,"header-content":"_header-content_19733_13",headerContent:Zd,title:ep,"collapse-icon":"_collapse-icon_19733_22",collapseIcon:tp,collapsed:np,content:rp},nt=({title:e,headerContent:n,children:r,className:s,headerClassName:o,contentClassName:a,dontRenderIfNoChildren:i,...l})=>{const c=l.collapsible?l.controlled?!1:l.defaultOpen??!1:!0,[u,d]=p.useState(c),m=l.collapsible?l.controlled?l.isOpen:u:!0;p.useEffect(()=>{d(c)},[c]);const x=p.useMemo(()=>!r||!r.toString()||r.toString().split(",").filter(f=>f&&f!=="false").length===0,[r]);return i&&x?null:t.jsxRuntimeExports.jsxs("div",{className:t.classNames("luminus-card rounded shadow-sm",at.card,{[s??""]:s}),children:[t.jsxRuntimeExports.jsxs("div",{role:l.collapsible?"button":void 0,className:t.classNames("header",at.header,{[o??""]:o}),onClick:()=>{l.collapsible&&(l.controlled?l.onToggle(!l.isOpen):d(!u))},children:[t.jsxRuntimeExports.jsxs("div",{className:t.classNames("header-content",at.headerContent),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",className:t.classNames("text-primary",at.title),children:e}),n??null]}),l.collapsible&&t.jsxRuntimeExports.jsx(t.MdOutlineChevronRight,{className:t.classNames(at.collapseIcon,{[at.collapsed]:m})})]}),t.jsxRuntimeExports.jsx(sa,{in:m,children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("card-content border-top border-primary",at.content,{[a??""]:a}),children:r})})]})};function Kt(e){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kt(e)}function sp(e,n){if(Kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,n||"default");if(Kt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function op(e){var n=sp(e,"string");return Kt(n)=="symbol"?n:n+""}function ap(e,n,r){return(n=op(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function zs(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,s)}return r}function qs(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?zs(Object(r),!0).forEach(function(s){ap(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zs(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function _e(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Ys=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Xn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ks={INIT:"@@redux/INIT"+Xn(),REPLACE:"@@redux/REPLACE"+Xn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Xn()}};function ip(e){if(typeof e!="object"||e===null)return!1;for(var n=e;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}function lp(e){if(e===void 0)return"undefined";if(e===null)return"null";var n=typeof e;switch(n){case"boolean":case"string":case"number":case"symbol":case"function":return n}if(Array.isArray(e))return"array";if(dp(e))return"date";if(up(e))return"error";var r=cp(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return n.slice(8,-1).toLowerCase().replace(/\s/g,"")}function cp(e){return typeof e.constructor=="function"?e.constructor.name:null}function up(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function dp(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function dt(e){var n=typeof e;return process.env.NODE_ENV!=="production"&&(n=lp(e)),n}function Ya(e,n,r){var s;if(typeof n=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?_e(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof n=="function"&&typeof r>"u"&&(r=n,n=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?_e(1):"Expected the enhancer to be a function. Instead, received: '"+dt(r)+"'");return r(Ya)(e,n)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?_e(2):"Expected the root reducer to be a function. Instead, received: '"+dt(e)+"'");var o=e,a=n,i=[],l=i,c=!1;function u(){l===i&&(l=i.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?_e(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function m(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?_e(4):"Expected the listener to be a function. Instead, received: '"+dt(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?_e(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(h),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?_e(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var j=l.indexOf(h);l.splice(j,1),i=null}}}function x(h){if(!ip(h))throw new Error(process.env.NODE_ENV==="production"?_e(7):"Actions must be plain objects. Instead, the actual type was: '"+dt(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?_e(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?_e(9):"Reducers may not dispatch actions.");try{c=!0,a=o(a,h)}finally{c=!1}for(var b=i=l,v=0;v<b.length;v++){var j=b[v];j()}return h}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?_e(10):"Expected the nextReducer to be a function. Instead, received: '"+dt(h));o=h,x({type:Ks.REPLACE})}function g(){var h,b=m;return h={subscribe:function(j){if(typeof j!="object"||j===null)throw new Error(process.env.NODE_ENV==="production"?_e(11):"Expected the observer to be an object. Instead, received: '"+dt(j)+"'");function R(){j.next&&j.next(d())}R();var y=b(R);return{unsubscribe:y}}},h[Ys]=function(){return this},h}return x({type:Ks.INIT}),s={dispatch:x,subscribe:m,getState:d,replaceReducer:f},s[Ys]=g,s}function Xs(e,n){return function(){return n(e.apply(this,arguments))}}function Qs(e,n){if(typeof e=="function")return Xs(e,n);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?_e(16):"bindActionCreators expected an object or a function, but instead received: '"+dt(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var s in e){var o=e[s];typeof o=="function"&&(r[s]=Xs(o,n))}return r}function Ka(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.length===0?function(s){return s}:n.length===1?n[0]:n.reduce(function(s,o){return function(){return s(o.apply(void 0,arguments))}})}function pp(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return function(){var o=s.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?_e(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:o.getState,dispatch:function(){return a.apply(void 0,arguments)}},l=n.map(function(c){return c(i)});return a=Ka.apply(void 0,l)(o.dispatch),qs(qs({},o),{},{dispatch:a})}}}var Vr=p.createContext(null);process.env.NODE_ENV!=="production"&&(Vr.displayName="ReactRedux");function mp(e){e()}var Xa=mp,xp=function(n){return Xa=n},fp=function(){return Xa};function gp(){var e=fp(),n=null,r=null;return{clear:function(){n=null,r=null},notify:function(){e(function(){for(var o=n;o;)o.callback(),o=o.next})},get:function(){for(var o=[],a=n;a;)o.push(a),a=a.next;return o},subscribe:function(o){var a=!0,i=r={callback:o,next:null,prev:r};return i.prev?i.prev.next=i:n=i,function(){!a||n===null||(a=!1,i.next?i.next.prev=i.prev:r=i.prev,i.prev?i.prev.next=i.next:n=i.next)}}}}var Js={notify:function(){},get:function(){return[]}};function Qa(e,n){var r,s=Js;function o(m){return c(),s.subscribe(m)}function a(){s.notify()}function i(){d.onStateChange&&d.onStateChange()}function l(){return!!r}function c(){r||(r=n?n.addNestedSub(i):e.subscribe(i),s=gp())}function u(){r&&(r(),r=void 0,s.clear(),s=Js)}var d={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:i,isSubscribed:l,trySubscribe:c,tryUnsubscribe:u,getListeners:function(){return s}};return d}var Ja=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect;function Za(e){var n=e.store,r=e.context,s=e.children,o=p.useMemo(function(){var l=Qa(n);return{store:n,subscription:l}},[n]),a=p.useMemo(function(){return n.getState()},[n]);Ja(function(){var l=o.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==n.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[o,a]);var i=r||Vr;return p.createElement(i.Provider,{value:o},s)}process.env.NODE_ENV!=="production"&&(Za.propTypes={store:t.Oe.shape({subscribe:t.Oe.func.isRequired,dispatch:t.Oe.func.isRequired,getState:t.Oe.func.isRequired}),context:t.Oe.object,children:t.Oe.any});var $r=t.requireReactIs(),vp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},hp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},bp={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ei={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Gr={};Gr[$r.ForwardRef]=bp;Gr[$r.Memo]=ei;function Zs(e){return $r.isMemo(e)?ei:Gr[e.$$typeof]||vp}var jp=Object.defineProperty,Ep=Object.getOwnPropertyNames,eo=Object.getOwnPropertySymbols,yp=Object.getOwnPropertyDescriptor,Rp=Object.getPrototypeOf,to=Object.prototype;function ti(e,n,r){if(typeof n!="string"){if(to){var s=Rp(n);s&&s!==to&&ti(e,s,r)}var o=Ep(n);eo&&(o=o.concat(eo(n)));for(var a=Zs(e),i=Zs(n),l=0;l<o.length;++l){var c=o[l];if(!hp[c]&&!(r&&r[c])&&!(i&&i[c])&&!(a&&a[c])){var u=yp(n,c);try{jp(e,c,u)}catch{}}}}return e}var Cp=ti;const no=t.getDefaultExportFromCjs(Cp);var br={exports:{}},de={};/** @license React v17.0.2
|
|
9
|
+
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function Ac(e){e=Pc(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var n=e.suffix,r=e.allowNegative,s=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Je);var a=e.onBlur;a===void 0&&(a=Je);var i=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var d=e.defaultValue,m=e.value,x=e.valueIsNumericString,f=e.onValueChange,g=_a(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=On(e),b=h.decimalSeparator,v=h.allowedDecimalSeparators,j=function(L){return Ps(L,e)},R=function(L,M){return kc(L,M,e)},y=yt(m)?d:m,E=x??_c(y,u,n);yt(m)?yt(d)||(E=E||typeof d=="number"):E=E||typeof m=="number";var C=function(L){return ka(L)?L:(typeof L=="number"&&(L=Aa(L)),E&&typeof l=="number"?ks(L,l,!!c):L)},S=La(C(m),C(d),!!E,j,R,f),w=S[0],I=w.numAsString,T=w.formattedValue,_=S[1],P=function(L){var M=L.target,$=L.key,V=M.selectionStart,G=M.selectionEnd,k=M.value;if(k===void 0&&(k=""),($==="Backspace"||$==="Delete")&&G<u.length){L.preventDefault();return}if(V!==G){o(L);return}$==="Backspace"&&k[0]==="-"&&V===u.length+1&&r&&mt(M,1),l&&c&&($==="Backspace"&&k[V-1]===b?(mt(M,V-1),L.preventDefault()):$==="Delete"&&k[V]===b&&L.preventDefault()),v!=null&&v.includes($)&&k[V]===b&&mt(M,V+1);var W=i===!0?",":i;$==="Backspace"&&k[V-1]===W&&mt(M,V-1),$==="Delete"&&k[V]===W&&mt(M,V+1),o(L)},D=function(L){var M=I;if(M.match(/\d/g)||(M=""),s||(M=hc(M)),c&&l&&(M=ks(M,l,c)),M!==I){var $=Ps(M,e);_({formattedValue:$,value:M,floatValue:parseFloat(M)},{event:L,source:zt.event})}a(L)},B=function(L){return L===b?!0:qt(L)},O=function(L){var M=L.currentValue,$=L.lastValue,V=L.formattedValue,G=L.currentValueIndex,k=L.formattedValueIndex,W=M[G],z=V[k],q=Ma($,M),ne=q.to,X=function(ie){return R(ie).indexOf(".")+u.length};return m===0&&c&&l&&M[ne.start]===b&&X(M)<G&&X(V)>k?!1:G>=ne.start&&G<ne.end&&v&&v.includes(W)&&z===b?!0:W===z};return Object.assign(Object.assign({},g),{value:T,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:O,onValueChange:_,format:j,removeFormatting:R,getCaretBoundary:function(L){return Oc(L,e)},onKeyDown:P,onBlur:D})}function Pr(e){var n=Ac(e);return p.createElement(Dc,Object.assign({},n))}const Ba=({InputContainer:e=t.FloatingLabelInput,value:n,onChange:r,debounceMs:s,label:o,withoutLabel:a,placeholder:i,size:l,hidden:c,disabled:u,showClearIcon:d,clearValue:m,className:x,step:f,noSelectOnFocus:g,decimalScale:h,fixedDecimalScale:b=!1,numberPrefix:v,numberSuffix:j,min:R,max:y,hint:E})=>{const C=p.useCallback(()=>{if(!r)return;const P=m??null;r(P?Number(P):null)},[m,r]),S=p.useRef(null),[w,I]=p.useState((n==null?void 0:n.toString())??""),T=p.useCallback(P=>{const D=P;r&&r(D==null||D===""?null:Number(D))},[r]),_=p.useCallback(P=>{var B,O;let D=parseFloat(((O=(B=P.target)==null?void 0:B.value)==null?void 0:O.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(D)&&(D=0),!s){T(D.toString());return}I(D.toString()),S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T(D.toString())},s)},[s,T]);return p.useEffect(()=>{I(n===null?"":n.toString())},[y,R,n]),p.useEffect(()=>{y!==void 0&&Number(w)>y&&I(y.toString()),R!==void 0&&Number(w)<R&&I(R.toString())},[w,y,R,I]),p.useEffect(()=>{!r||n===null||(y!==void 0&&n>y&&r(y),R!==void 0&&n<R&&r(R))},[n,y,R,r]),t.jsxRuntimeExports.jsxs(e,{withoutLabel:a,label:o??"",hidden:c,className:x,hint:E,disabled:u,children:[t.jsxRuntimeExports.jsx(Pr,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:h,fixedDecimalScale:b,prefix:v,suffix:j,defaultValue:"",value:s?w:(n==null?void 0:n.toString())??"",placeholder:i??o,onFocus:P=>{!g&&P.target.select()},onChange:_,hidden:c,disabled:u,className:t.classNames("form-control text-end w-100",{[`form-control-${l}`]:l}),step:f,min:R,max:y}),d&&n!==null&&r&&!u&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:C,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})})]})},Fa=({InputContainer:e=t.RowLabelInput,label:n,options:r,disabled:s,hidden:o,className:a,value:i,onChange:l})=>{const c=p.useCallback(u=>{l&&l(u.target.value)},[l]);return t.jsxRuntimeExports.jsx(e,{isForRadioInput:!0,hidden:o,withoutLabel:!n,label:`${n}`,className:a,disabled:s,children:r.map(u=>t.jsxRuntimeExports.jsx(t.Form.Check,{id:`radio-${u.id}`,label:u.name,type:"radio",value:u.id??"",checked:i===u.id,onChange:c,hidden:o,disabled:s,className:"w-100"},u.id))})},Mc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,resetsFields:s,type:o,required:a,hidden:i,disabled:l,withoutLabel:c,hint:u,onChange:d,className:m})=>{const{register:x,formState:f,setValue:g}=Ee.useFormContext(),h=t.useFormDisabledContext({falseIfNotInit:!0}),[b,v]=p.useState(void 0),[j,R]=p.useState(!1);p.useEffect(()=>{const C=n.split(".");let S=f.errors;C.forEach(w=>{S!==void 0&&(S=S[w])}),v(S)},[f,n]);const y=p.useMemo(()=>l||h,[l,h]),E=b!==void 0;return p.useEffect(()=>{f.isSubmitted&&R(!0)},[f]),t.jsxRuntimeExports.jsxs(e,{isForCheckInput:!0,hidden:i,label:r??"",required:a,disabled:y,isInvalid:E,withoutLabel:c,hint:u,className:m,children:[t.jsxRuntimeExports.jsx(t.Form.Check,{id:`check-${n}`,type:o??"checkbox",label:`${r}${a?" *":""}`,...x(n,{onChange:C=>{s&&s.forEach(S=>g(S,null,{shouldDirty:!0,shouldValidate:j})),d&&d(C.target.value??null)}}),isInvalid:E,hidden:i,disabled:y,className:"w-100"}),b&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:b.message})]})},Lc=({InputContainer:e=t.RowLabelInput,label:n,formField:r,options:s,resetsFields:o,required:a,disabled:i,hidden:l,onChange:c,className:u})=>{const{register:d,formState:m,setValue:x,watch:f}=Ee.useFormContext(),g=t.useFormDisabledContext({falseIfNotInit:!0}),[h,b]=p.useState(void 0),[v,j]=p.useState(!1),R=p.useMemo(()=>s,[s]),y=p.useMemo(()=>i||g,[i,g]);p.useEffect(()=>{const C=r.split(".");let S=m.errors;C.forEach(w=>{S!==void 0&&(S=S[w])}),b(S)},[m,r]),p.useEffect(()=>{m.isSubmitted&&j(!0)},[m]);const E=h!==void 0;return t.jsxRuntimeExports.jsxs(e,{isForRadioInput:!0,hidden:l,withoutLabel:!n,label:n??"",required:a,disabled:y,isInvalid:E,className:u,children:[R.map(C=>t.jsxRuntimeExports.jsx(t.Form.Check,{id:`radio-${C.id}`,label:C.name,type:"radio",value:C.id??"",checked:f(r)===C.id,...d(r,{onChange:S=>{var w;o&&o.forEach(I=>x(I,null,{shouldDirty:!0,shouldValidate:v})),c&&c((w=S.target)!=null&&w.value?S.target.value.toString():null)}}),isInvalid:E,hidden:l,disabled:y,className:"w-100"},C.id)),h&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:h.message})]})},Bc=({label:e,InputContainer:n=t.RowLabelInput,className:r,withoutLabel:s,hidden:o,disabled:a,contactType:i,formField:l,...c})=>{const{watch:u}=Ee.useFormContext(),d=u(l),m=t.useFormDisabledContext({falseIfNotInit:!0}),x=p.useMemo(()=>a||m,[a,m]);return o?null:t.jsxRuntimeExports.jsx(Ta,{contactType:i,value:d,withoutLabel:s,label:e,className:r,children:t.jsxRuntimeExports.jsx(t.HookFormTextInput,{type:"text",formField:l,InputContainer:n,size:"sm",withoutLabel:!0,className:"flex-grow-1",disabled:x,...c})})},Fc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,size:s,defaultSelection:o,resetsFields:a,isNumber:i,required:l,hidden:c,disabled:u,items:d,onSearchQueryChange:m,selectedItemNavigateTo:x,texts:f,dropdownItemsNameWidth:g,isLoading:h,withoutLabel:b,additionalColumns:v,CustomOnChangeComponent:j,icon:R,displayIdAsName:y,onSelect:E,className:C,archiveColumn:S,hint:w,addNewOptionPath:I,refreshOptions:T,MiniDetailComponent:_,miniDetailPlacement:P,suggestedItems:D,suggestedItemsTitle:B})=>{const{formState:O,setValue:L,watch:M,control:$}=Ee.useFormContext(),V=t.useFormDisabledContext({falseIfNotInit:!0}),[G,k]=p.useState(void 0),[W,z]=p.useState(!1),[q,ne]=p.useState(!1),X=M(n)??null,ie=X===(o==null?void 0:o.id)?o==null?void 0:o.name:M(`${n}-DropdownName`),oe=p.useMemo(()=>X==null?null:{id:X??null,name:ie??""},[X,ie]),ve=p.useCallback(()=>{const F=n.split(".");let K=O.errors;F.forEach(te=>{K!==void 0&&(K=K[te])}),k(K)},[O,n]),Z=p.useCallback(F=>{if((F==null?void 0:F.id)===X)return;if(E&&E(F),a&&a.forEach(te=>L(te,null,{shouldDirty:!0,shouldValidate:q})),F===null){L(n,null,{shouldDirty:!0,shouldValidate:q}),L(`${n}-DropdownName`,null);return}let K=null;i?K=(F==null?void 0:F.id)!==null&&(F==null?void 0:F.id)!==""?parseInt(F.id.toString(),10):null:K=F.id===null||F.id===void 0||F.id===""?null:F.id,L(n,K,{shouldDirty:!0,shouldValidate:q}),L(`${n}-DropdownName`,F.name??"")},[L,n,q,i,a,X,E]),A=p.useCallback(F=>{z(!1),Z(F)},[Z]),H=p.useCallback(()=>{z(!1)},[]),Q=p.useRef(null),je=G!==void 0,Me=x!==void 0,Ye=Me&&oe!==null,U=p.useMemo(()=>u||V,[u,V]);return p.useEffect(()=>{ve()},[ve]),p.useEffect(()=>{O.isSubmitted&&ne(!0)},[O]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(e,{label:r??"",required:l,disabled:U,hidden:c,withoutLabel:b,isInvalid:je,inputContainerClassName:t.classNames({"luminus-dropdown-select-open":W}),hint:w,className:C,children:[t.jsxRuntimeExports.jsxs(t.InputAnchorContainer,{currentSelection:oe,selectedItemNavigateTo:x,children:[y&&(oe==null?void 0:oe.name)&&t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:oe.name}),t.jsxRuntimeExports.jsx(Ee.Controller,{control:$,name:n,render:()=>t.jsxRuntimeExports.jsx(t.MiniDetailWrapper,{value:X,MiniDetailComponent:_,miniDetailPlacement:P,children:t.jsxRuntimeExports.jsx(t.Form.Select,{size:s,onMouseDown:F=>{F.currentTarget.focus(),F.preventDefault()},onClick:()=>{!Me&&!U&&z(!0)},ref:Q,value:X??"",onChange:()=>{},isInvalid:je,hidden:c,className:t.classNames("w-100",{"luminus-dropdown-picker-disabled":U,"luminus-dropdown-picker-link":Ye}),children:t.jsxRuntimeExports.jsx("option",{value:X,children:y?X:(ie==null?void 0:ie.length)>0?ie:X})})})}),j||!U&&Me?t.jsxRuntimeExports.jsxs("div",{className:"custom-picker-button",children:[!j&&!U&&Me&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"secondary",onClick:F=>{F.preventDefault(),F.stopPropagation(),z(!0)},children:R??t.jsxRuntimeExports.jsx(t.MdOutlineEdit,{})}),j??null]}):null]}),G&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:G.message}),Q.current&&t.jsxRuntimeExports.jsx(t.SimplePicker,{show:W,onCancel:H,items:d,currentSelection:oe,onSelectionChange:A,onSearchQueryChange:m,texts:f,itemsNameWidth:g,additionalColumns:v,displayIdAsName:y,isLoading:h,disabled:U,inputRef:Q,archiveColumn:S,addNewOptionPath:I,refreshOptions:T,suggestedItems:D,suggestedItemsTitle:B})]})})},Vc=({InputContainer:e=t.RowLabelInput,label:n,formField:r,hidden:s,required:o,placeholder:a,disabled:i,showClearIcon:l,resetsFields:c,multiple:u,accept:d,withoutLabel:m,hint:x,className:f})=>{const{watch:g,setValue:h,register:b,formState:v}=Ee.useFormContext(),j=t.useFormDisabledContext({falseIfNotInit:!0}),[R,y]=p.useState(!1),[E,C]=p.useState(void 0),S=p.useCallback(()=>{h(r,"")},[h,r]),w=p.useCallback(()=>{const _=r.split(".");let P=v.errors;_.forEach(D=>{P!==void 0&&(P=P[D])}),C(P)},[v,r]);p.useEffect(w,[w]),p.useEffect(()=>{v.isSubmitted&&y(!0)},[v]);const I=p.useMemo(()=>i||j,[i,j]),T=E!==void 0;return t.jsxRuntimeExports.jsxs(e,{label:n??"",required:o,disabled:I,hidden:s,withoutLabel:m,isInvalid:T,hint:x,className:f,children:[t.jsxRuntimeExports.jsx(t.FormControl,{type:"file",multiple:u,accept:d.join(", "),placeholder:a??n,isInvalid:T,hidden:s,disabled:I,className:"w-100",...b(r,{onChange:()=>{c&&c.forEach(_=>h(_,null,{shouldDirty:!0,shouldValidate:R}))}})}),l&&g(r)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:S,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),E&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:E.message})]})},Va=({children:e,onStorno:n,noSpacer:r})=>{const{formState:s}=Ee.useFormContext(),o=t.useFormDisabledContext({falseIfNotInit:!0}),[a,i]=p.useState(!1);return p.useEffect(()=>{i(Object.keys(s.dirtyFields).length>0)},[s]),a?t.jsxRuntimeExports.jsx(Ca,{onStorno:n,noSpacer:r,disabled:o,children:e}):null},Nn=({InputContainer:e=t.RowLabelInput,options:n,formField:r,label:s,size:o,resetsFields:a,isNumber:i,required:l,hidden:c,disabled:u,withoutLabel:d,noSortOptions:m,suffixIdToName:x,onSelect:f,className:g,appendCurrentSelectionWithName:h,hint:b,addNewOptionPath:v,refreshOptions:j,MiniDetailComponent:R,miniDetailPlacement:y,selectedItemNavigateTo:E,noRemoveButton:C})=>{const{texts:{customSelect:S}}=p.useContext(t.LuminusComponentsContext),{formState:w,setValue:I,watch:T,control:_}=Ee.useFormContext(),P=t.useFormDisabledContext({falseIfNotInit:!0}),[D,B]=p.useState(void 0),[O,L]=p.useState(!1),[M,$]=p.useState(!1),[V,G]=p.useState(""),k=T(r),W=p.useMemo(()=>n.find(H=>H.id===k)??null,[n,k]),z=p.useCallback(()=>{const H=r.split(".");let Q=w.errors;H.forEach(je=>{Q!==void 0&&(Q=Q[je])}),B(Q)},[w,r]),q=p.useCallback(H=>{if((H==null?void 0:H.id)===k)return;if(f&&f(H),a&&a.forEach(je=>I(je,null,{shouldDirty:!0,shouldValidate:M})),H===null){I(r,null,{shouldDirty:!0,shouldValidate:M});return}let Q=null;i?Q=(H==null?void 0:H.id)!==null&&(H==null?void 0:H.id)!==""?parseInt(H.id.toString(),10):null:Q=H.id===null||H.id===void 0||H.id===""?null:H.id,I(r,Q,{shouldDirty:!0,shouldValidate:M})},[I,r,i,a,k,M,f]),ne=p.useCallback(H=>{L(!1),q(H)},[q]),X=p.useCallback(H=>{G(H)},[]),ie=p.useMemo(()=>u||P,[u,P]);p.useEffect(()=>{z()},[z]),p.useEffect(()=>{w.isSubmitted&&$(!0)},[w]);const oe=p.useCallback(H=>{var Q;return H===null?"":!H.name||H.name.length===0?((Q=H.id)==null?void 0:Q.toString())??"":x?`${H.name} (${H.id})`:H.name},[x]),ve=p.useMemo(()=>{const H=n?[...n]:[];return h!==void 0&&k&&(H.some(Q=>Q.id===k)||H.push({id:k,name:h})),H.map(Q=>({id:Q.id,name:oe(Q)})).filter(Q=>t.stringSearchWithin(Q.name,V)).sort((Q,je)=>m?0:(Q.name??"").localeCompare(je.name??""))},[n,m,V,oe,h,k]),Z=p.useRef(null),A=D!==void 0;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(e,{label:s??"",required:l,disabled:ie,hidden:c,withoutLabel:d,isInvalid:A,inputContainerClassName:t.classNames({"luminus-dropdown-select-open":O}),hint:b,className:g,children:[t.jsxRuntimeExports.jsx(t.InputAnchorContainer,{currentSelection:W,selectedItemNavigateTo:E,children:t.jsxRuntimeExports.jsx(Ee.Controller,{control:_,name:r,render:()=>t.jsxRuntimeExports.jsx(t.MiniDetailWrapper,{value:k,MiniDetailComponent:R,miniDetailPlacement:y,children:t.jsxRuntimeExports.jsx(t.Form.Select,{size:o,onMouseDown:H=>{H.currentTarget.focus(),H.preventDefault()},onClick:()=>{L(!0)},ref:Z,value:k??"",onChange:()=>{},isInvalid:A,hidden:c,disabled:ie,className:"w-100",children:t.jsxRuntimeExports.jsx("option",{value:(W==null?void 0:W.id)??"",children:oe(W)})})})})}),D&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:D.message}),Z.current&&t.jsxRuntimeExports.jsx(t.SimplePicker,{show:O,onCancel:()=>L(!1),items:ve,currentSelection:W??null,onSelectionChange:ne,onSearchQueryChange:X,texts:S,disabled:ie,inputRef:Z,autoHideSearch:!0,allItemsLength:n.length,addNewOptionPath:v,refreshOptions:j,noRemoveButton:C})]})})},$c=({InputContainer:e=t.RowLabelInput,formField:n,label:r,placeholder:s,size:o,resetsFields:a,showClearIcon:i,clearValue:l,required:c,hidden:u,disabled:d,withoutLabel:m,step:x,stepperStep:f=1,className:g,min:h,max:b,onChange:v,hint:j})=>{const{register:R,formState:y,setValue:E,watch:C}=Ee.useFormContext(),S=t.useFormDisabledContext({falseIfNotInit:!0}),[w,I]=p.useState(void 0),[T,_]=p.useState(!1),P=p.useCallback(($,V,G)=>{E($,ke.limitNumber(V,h,b),G)},[b,h,E]),D=p.useCallback(()=>{const $=l??null;P(n,$!==null?Number($):null,{shouldDirty:!0,shouldValidate:T})},[l,P,n,T]),B=p.useCallback(()=>{const $=n.split(".");let V=y.errors;$.forEach(G=>{V!==void 0&&(V=V[G])}),I(V)},[y,n]),O=p.useMemo(()=>d||S,[d,S]);p.useEffect(()=>{B()},[B]),p.useEffect(()=>{y.isSubmitted&&_(!0)},[y]);const L=w!==void 0,M=C(n);return t.jsxRuntimeExports.jsxs(e,{label:r??"",required:c,disabled:O,hidden:u,withoutLabel:m,isInvalid:L,hint:j,className:g,children:[t.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsxRuntimeExports.jsx(t.Form.Control,{type:"number",placeholder:s??r,size:o,...R(n,{setValueAs:$=>$==null||$===""?null:ke.limitNumber(Number($),h,b),min:h,max:b,onChange:$=>{var V;a&&a.forEach(G=>E(G,null,{shouldDirty:!0,shouldValidate:T})),v&&v((V=$.target)!=null&&V.value?Number($.target.value)??null:null)}}),isInvalid:L,hidden:u,disabled:O,className:"w-100 luminus-numeric-stepper",step:x,min:h,max:b}),t.jsxRuntimeExports.jsx("div",{className:"stepper-icon left",children:!d&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:$=>{$.preventDefault(),$.stopPropagation(),P(n,((M?Number(M):0)-f).toString(),{shouldDirty:!0,shouldValidate:T})},children:t.jsxRuntimeExports.jsx(t.FaMinus,{})})}),t.jsxRuntimeExports.jsx("div",{className:"stepper-icon right",children:!d&&t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:$=>{$.preventDefault(),$.stopPropagation(),P(n,((M?Number(M):0)+f).toString(),{shouldDirty:!0,shouldValidate:T})},children:t.jsxRuntimeExports.jsx(t.FaPlus,{})})})]}),i&&C(n)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:D,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),w&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:w.message})]})},Gc=({InputContainer:e=t.RowLabelInput,formField:n,label:r,placeholder:s,resetsFields:o,showClearIcon:a,clearValue:i,required:l,hidden:c,disabled:u,withoutLabel:d,step:m,size:x,CustomOnChangeComponent:f,noSelectOnFocus:g,className:h,decimalScale:b=2,fixedDecimalScale:v=!1,numberPrefix:j,numberSuffix:R,min:y,max:E,onChange:C,hint:S})=>{const{formState:w,setValue:I,watch:T,control:_}=Ee.useFormContext(),P=t.useFormDisabledContext({falseIfNotInit:!0}),[D,B]=p.useState(void 0),[O,L]=p.useState(!1),M=p.useCallback(()=>{const W=i??null;I(n,W!==null?Number(W):null,{shouldDirty:!0,shouldValidate:O})},[i,I,n,O]),$=p.useCallback(()=>{const W=n.split(".");let z=w.errors;W.forEach(q=>{z!==void 0&&(z=z[q])}),B(z)},[w,n]),V=p.useMemo(()=>u||P,[u,P]);p.useEffect(()=>{$()},[$]),p.useEffect(()=>{w.isSubmitted&&L(!0)},[w]);const G=T(n);p.useEffect(()=>{E!==void 0&&G>E&&I(n,E),y!==void 0&&G<y&&I(n,y)},[n,G,E,y,I]);const k=D!==void 0;return t.jsxRuntimeExports.jsxs(e,{label:r??"",required:l,disabled:V,hidden:c,withoutLabel:d,isInvalid:k,hint:S,className:h,children:[t.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsxRuntimeExports.jsx(Ee.Controller,{control:_,name:n,render:({field:{ref:W,onChange:z,name:q,value:ne}})=>t.jsxRuntimeExports.jsx(Pr,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:b,fixedDecimalScale:v,prefix:j,suffix:R,defaultValue:"",name:q,value:ne??"",placeholder:s??r,onFocus:X=>{!g&&X.target.select()},onChange:X=>{var ve,Z;const ie=parseFloat(((Z=(ve=X.target)==null?void 0:ve.value)==null?void 0:Z.replaceAll(" ","").replaceAll(",","."))??0);o&&o.forEach(A=>I(A,null,{shouldDirty:!0,shouldValidate:O}));const oe=ie==null||Number.isNaN(ie)?null:Number(ie);z(oe),C&&C(oe)},hidden:c,disabled:V,className:t.classNames("form-control text-end w-100",{"is-invalid":k},{[`form-control-${x}`]:x}),step:m,getInputRef:W,min:y,max:E})}),f&&t.jsxRuntimeExports.jsx("div",{className:"custom-picker-button",children:f})]}),a&&T(n)&&t.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsxRuntimeExports.jsx(t.IconButton,{color:"secondary",size:"sm",onClick:M,children:t.jsxRuntimeExports.jsx(t.MdClear,{})})}),D&&t.jsxRuntimeExports.jsx(t.InvalidFeedback,{message:D.message})]})},Uc=({color:e="primary",icon:n=t.jsxRuntimeExports.jsx(t.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:s="*",onUpload:o,multiple:a,className:i,children:l,...c})=>{const u=d=>{d.target.files&&(o(d.target.files),d.target.value="")};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:t.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${i??""}`,t.classes.item),...c,children:[n,l]}),t.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:s,onChange:u,hidden:!0,multiple:a})]})},Ar=["slice","options","formats","conditions"],As=e=>{const n=e.current.flexmonster.getReport({withDefaults:!0});if(typeof n=="string")throw alert("report is string"),new Error("report is string");const r={};return Ar.forEach(s=>{r[s]=n[s]}),JSON.stringify(r)},Wc=e=>{if(e.settings){const n=JSON.parse(e.settings);return Ar.forEach(r=>{n[r]===void 0&&(n[r]=null)}),n}return{}},Hc=e=>{const n={};return Ar.forEach(r=>{n[r]=(e==null?void 0:e[r])??void 0}),n},zc=e=>e&&e.type==="header"&&e.member&&e.member.caption!=="All"&&e.label==="",Ms=(e,n)=>e.hierarchy&&e.hierarchy.uniqueName===n,Ls=e=>!e.member&&!e.isDrillThrough,Bs=(e,n)=>typeof e=="function"?e(n):e.replace(":id",n),$a=({dataSource:e,settings:n,pivotRef:r,localization:s,licenseKey:o,hyperlinkColumn:a,roomPasportization:i,enabled:l=!0})=>{const{texts:{reports:c}}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(!1),m=p.useRef(null),x=r??m,f=p.useMemo(()=>({localization:s}),[s]),g=p.useCallback(E=>{const C=E.find(w=>w.id==="fm-tab-export");if((C==null?void 0:C.menu)==null||x.current==null)return E;const S=C.menu.find(w=>w.id==="fm-tab-export-pdf");return S&&(S.handler=()=>{x.current.flexmonster.exportTo("pdf",{useCustomizeCellForData:!0,fontUrl:"https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf"})}),E},[x]),h=p.useCallback(E=>{E=g(E),delete E[0],delete E[1],delete E[2];const C=[{id:"fm-tab-expand",title:c.expandAll,handler:x.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:c.collapseAll,handler:x.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return E.unshift({id:"fm-tab-expand",title:c.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:C,rightGroup:!0}),E},[x,c.collapseAll,c.expand,c.expandAll,g]),b=E=>{const C=E.getTabs();E.getTabs=()=>h(C)},v=p.useMemo(()=>e&&e.mapping?Object.values(e.mapping).filter(E=>E.caption.includes("P:")).map(E=>({uniqueName:E.caption.replace("P:",""),caption:E.caption})):[],[e]),j=p.useMemo(()=>{var C,S,w,I;const E=(C=x.current)==null?void 0:C.flexmonster.getReport();return E&&E.slice?{...E.slice,rows:[...((S=E.slice.rows)==null?void 0:S.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v],columns:[...((w=E.slice.columns)==null?void 0:w.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v],measures:[...((I=E.slice.measures)==null?void 0:I.filter(T=>{var _;return!((_=T.caption)!=null&&_.includes("P:"))}))??[],...v]}:null},[v,x]);p.useEffect(()=>{var E,C,S,w;if(u&&l){if(i&&j){const I=(E=x.current)==null?void 0:E.flexmonster.getReport(),T=I&&I.options?{...I.options,grid:{...(C=I.options)==null?void 0:C.grid,autoSwitchToCompact:!1}}:{};(S=x.current)==null||S.flexmonster.setReport({...I,dataSource:e,slice:j,options:T})}else(w=x.current)==null||w.flexmonster.updateData(e);console.log("Updating flexmonster dataSource to: ",e)}},[e,l,u,v,x,i,j]),p.useEffect(()=>{var w,I,T,_,P;if(!u||!l||n==null)return;const E=(w=x.current)==null?void 0:w.flexmonster.getReport();if(E===void 0||typeof E=="string")return;const C=Hc(n);C.options={...n==null?void 0:n.options,grid:{...(I=n==null?void 0:n.options)==null?void 0:I.grid,autoSwitchToCompact:!1},showFieldListSearch:!0,datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm:ss"},i&&(C.slice={...n==null?void 0:n.slice,rows:[...((_=(T=n==null?void 0:n.slice)==null?void 0:T.rows)==null?void 0:_.filter(D=>{var B;return!((B=D.caption)!=null&&B.includes("P:"))}))??[],...v]});const S={...E,...C};(P=x.current)==null||P.flexmonster.setReport(S)},[l,u,v,x,i,n]);const R=p.useCallback((E,C)=>{var D,B;if(zc(C)){E.text=((D=C.member)==null?void 0:D.caption)??"";const O=E.style["padding-left"]??"4px",L=parseInt(O,10);E.style["padding-left"]=L+11+"px"}if(!a||!Ms(C,a.idColumn)||Ls(C))return;const S=(B=C.escapedLabel)==null?void 0:B.toString();if(S===void 0)return;const w=Bs(a.url,S),I="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",T=C.type==="header"?"onclick='event.stopImmediatePropagation()'":"",_=C.isDrillThrough||C.type==="header"?`href='${w}' target='_blank'`:"";E.style&&(E.style["z-index"]=1);const P=`<a ${_} ${I} ${T}>${C.escapedLabel}</a>`;E.text=P},[a]),y=p.useCallback(E=>{if(!a||!Ms(E,a.idColumn)||Ls(E))return;const C=Bs(a.url,E.escapedLabel??"");window.open(C??"","_blank","noreferrer")},[a]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(jl.Pivot,{ref:x,global:f,licenseKey:o,toolbar:!0,height:"100%",beforetoolbarcreated:b,ready:()=>{d(!0)},width:"100%",customizeCell:R,cellclick:y})})},qc=(e,n,r,s)=>{const{texts:{reports:o}}=p.useContext(t.LuminusComponentsContext),{prompt:a}=t.usePrompt(),{confirm:i}=t.useConfirm(),l=t.useAxios(),{user:c}=p.useContext(t.UserContext),{startLoading:u,stopLoading:d}=p.useContext(t.LoadingContext),{addNotification:m}=t.useNotifications(),x=p.useCallback(async j=>{u("report-versionSavingAs");try{const R=await l.post("/reports/version",j);m(o.saveSuccessful,"success"),await s(R.data)}finally{d("report-versionSavingAs")}},[m,s,l,o.saveSuccessful,u,d]),f=p.useCallback(async()=>{if(r===null){m("none open","warning");return}if(!await i(o.confirmOverwriteSave))return;const R=As(n);x({reportSourceName:e,reportVersionId:r,settings:R})},[m,i,n,e,o.confirmOverwriteSave,x,r]),g=p.useCallback(async()=>{const j=await a(o.enterName,{input:"input",required:!0});if(j===null)return;const R=As(n);x({reportSourceName:e,name:j,settings:R})},[n,a,e,o.enterName,x]),h=p.useCallback(async()=>{u("report-versionSavingAs");try{await l.put("/reports/archive",{reportVersionId:r??void 0,reportSourceName:e}),m(o.deleteSuccessful,"success")}finally{d("report-versionSavingAs")}},[m,l,e,o.deleteSuccessful,r,u,d]),b=p.useCallback(async()=>{u("report-versionSavingAs");try{await l.post("/reports/version-restrictions",{reportVersionId:r??void 0,userRestricts:[{employeeId:c.personalNumber,addRights:!1}]}),m(o.detachSuccessful,"success")}finally{d("report-versionSavingAs")}},[m,l,o.detachSuccessful,r,u,d,c.personalNumber]),v=p.useCallback(async j=>{if(r===null){m(o.noReportVersionSelected,"warning");return}u("report-versionRenaming");try{await l.put("/reports/rename",{reportVersionId:r,reportSourceName:e,newName:j}),m(o.renameSuccessful,"success")}finally{d("report-versionRenaming")}},[m,l,o.renameSuccessful,o.noReportVersionSelected,r,e,u,d]);return{saveAs:g,save:f,archive:h,detach:b,rename:v}},Yc=e=>{const n=t.useAxios(),{startLoading:r,stopLoading:s}=p.useContext(t.LoadingContext);return{changeEmployeeRights:p.useCallback(async(a,i)=>{let l=null;r("reportSharing-addPerson");try{l=(await n.post("/reports/version-restrictions",{reportVersionId:e,userRestricts:[{employeeId:a,addRights:i}]})).data}finally{s("reportSharing-addPerson")}return l},[n,e,r,s])}},Kc=({isOpen:e,onHide:n,usersData:r,reportVersionId:s,EmployeePicker:o,setReportVersion:a})=>{const{ProjectIconComponent:i,texts:{reports:l}}=p.useContext(t.LuminusComponentsContext),{confirm:c}=t.useConfirm(),[u,d]=p.useState(null),{changeEmployeeRights:m}=Yc(s),x=p.useCallback(h=>{const b=typeof h=="function"?h(r??[]):h;a(v=>v===null?null:{...v,users:b.filter(j=>j.isReportOwner===!1)})},[a,r]),f=p.useCallback(async()=>{if(u===null)return;const b=(await m(u.id,!0)).map(v=>({id:v.user.id,kid:v.user.kid,firstName:v.user.firstName,lastName:v.user.lastName,isReportOwner:!1}));x(v=>[...v,...b]),d(null)},[u,m,x]),g=p.useCallback(async h=>{if(!await c(l.removeSharingWith(h)))return;await m(h,!1)&&x(j=>(j==null?void 0:j.filter(R=>R.id!==h))??[])},[m,c,l,x]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:n,children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:l.reportSharing})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",children:l.sharedWith}),t.jsxRuntimeExports.jsxs(t.ListGroup,{variant:"flush",children:[r&&r.length===0?t.jsxRuntimeExports.jsx("div",{className:"px-2 text-muted",children:l.noone.toLowerCase()}):null,r==null?void 0:r.map(h=>t.jsxRuntimeExports.jsxs(t.ListGroupItem,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[h.lastName," ",h.firstName," [",h.id,"]",t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>g(h.id),children:t.jsxRuntimeExports.jsx(i,{icon:"delete"})})]},h.id))]}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",className:"mt-2 mb-2",children:l.addSharing}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"flex-grow-1",children:t.jsxRuntimeExports.jsx(o,{label:l.shareWith,onSelect:h=>{if(h===null||typeof h.id!="number"){d(null);return}d(h)},value:u})}),t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:f,disabled:u===null,children:l.add})]})]})]})},Xc=(e,n)=>{const[r,s]=p.useState(null);return p.useEffect(()=>{e.then(({default:o})=>{const a=n!==void 0?n(o):o;s(a)})},[n,e]),{mappings:r}},Qc=({reportType:e,title:n,data:r,filterElements:s,getReportRoute:o,localization:a,licenseKey:i,EmployeePicker:l,localizationJsonFile:c,localizationTransformer:u,hyperlinkColumn:d,roomPasportization:m=!1})=>{const{texts:{reports:x}}=p.useContext(t.LuminusComponentsContext),{confirm:f}=t.useConfirm(),{prompt:g}=t.usePrompt(),h=se.useNavigate(),[b]=se.useSearchParams(),{id:v}=se.useParams(),j=p.useMemo(()=>v===void 0?null:Number(v),[v]),R=p.useCallback(A=>{const H=A===null?"":A.toString();h(se.generatePath(o(e),{id:H})+"?"+b.toString(),{replace:!0,flushSync:!0})},[o,h,e,b]),[y,E]=p.useState(!1),C=p.useRef(null),{user:S}=p.useContext(t.UserContext),{data:w,reloadData:I}=ge.useGetApiData(`/reports/${e}`),{mappings:T}=Xc(c,u),[_,P]=p.useState(void 0),D=p.useCallback(A=>{const H=A.target.value,Q=H===""?null:Number(H);R(Q)},[R]),B=p.useCallback(async A=>{await I(),R(A)},[I,R]),{data:O,setData:L,isLoading:M,reloadData:$}=ge.useGetApiData(`/reports/version/${j}`,{enabled:j!==null,nullStateBeforeLoad:!1,nullStateOnFail:!0});p.useEffect(()=>{var H;if(M){P(void 0);return}if(O===null){P({});return}const A=Wc(O)??{};P(A),(H=C.current)==null||H.flexmonster.refresh()},[O,M]);const{save:V,saveAs:G,archive:k,detach:W,rename:z}=qc(e,C,j,B),q=p.useMemo(()=>({data:r??[],mapping:T??void 0}),[r,T]),ne=p.useCallback(async()=>{var H;await f(x.confirmRevertChanges)&&((H=C.current)==null||H.flexmonster.setReport({dataSource:q,..._}))},[f,q,x.confirmRevertChanges,_]),X=p.useMemo(()=>(O==null?void 0:O.ownerId)===S.personalNumber,[O==null?void 0:O.ownerId,S.personalNumber]),ie=p.useMemo(()=>{var A;return(A=O==null?void 0:O.users)==null?void 0:A.some(H=>H.id===S.personalNumber&&!H.isReportOwner)},[O==null?void 0:O.users,S.personalNumber]),oe=p.useCallback(async()=>{await f(x.confirmDelete(O==null?void 0:O.name))&&(await k(),R(null),await I())},[k,f,I,O==null?void 0:O.name,x,R]),ve=p.useCallback(async()=>{await f(x.confirmDetach(O==null?void 0:O.name))&&(await W(),R(null),await I())},[f,W,I,O==null?void 0:O.name,x,R]),Z=p.useCallback(async()=>{const A=await g(x.enterNewName,{input:"input",required:!0});A!==null&&(await z(A),await Promise.allSettled([I(),$()]))},[g,x.enterNewName,z,I,$]);return p.useEffect(()=>{var A,H;j===null&&R(((A=w==null?void 0:w.reportVersions.find(Q=>Q.isSystem===!0))==null?void 0:A.reportVersionId)??((H=w==null?void 0:w.reportVersions[0])==null?void 0:H.reportVersionId)??null)},[w==null?void 0:w.reportVersions,j,R]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.PageContainer,{variant:"fullScreen",title:t.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-start gap-3 align-items-center",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h3",children:n}),s,t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxRuntimeExports.jsxs(t.FormSelect,{size:"sm",value:j??void 0,onChange:D,children:[t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectSystem,children:w==null?void 0:w.reportVersions.filter(A=>A.isSystem===!0).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:A.name},A.reportVersionId))}),t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectYour,children:w==null?void 0:w.reportVersions.filter(A=>A.ownerId===S.personalNumber).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:A.name},A.reportVersionId))}),t.jsxRuntimeExports.jsx("optgroup",{label:x.versionSelectSharedWithYou,children:w==null?void 0:w.reportVersions.filter(A=>A.isSystem===!1&&A.ownerId!==S.personalNumber).map(A=>t.jsxRuntimeExports.jsx("option",{value:A.reportVersionId,children:`${A.name} [${A.ownerId}]`},A.reportVersionId))})]}),t.jsxRuntimeExports.jsx(t.ContextButton,{icon:t.jsxRuntimeExports.jsx(t.MdSave,{}),onClick:V,disabled:j===null||(O==null?void 0:O.isSystem)||!X,children:x.save}),t.jsxRuntimeExports.jsx(t.ContextButton,{icon:t.jsxRuntimeExports.jsx(t.MdSaveAs,{}),onClick:G,className:"flex-shrink-0",children:x.saveAs}),t.jsxRuntimeExports.jsxs(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle}),children:[t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:ne,children:x.revertChanges}),t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:()=>E(!0),disabled:!X||(O==null?void 0:O.isSystem),children:x.share}),X&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:Z,children:x.rename}):null,X&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{color:"danger",onClick:oe,children:x.delete}):null,ie&&!(O!=null&&O.isSystem)?t.jsxRuntimeExports.jsx(t.DropdownItem,{color:"danger",onClick:ve,children:x.detach}):null]})]})]}),children:q.data&&q.data.length>0?t.jsxRuntimeExports.jsx("div",{className:"h-100 w-100",children:t.jsxRuntimeExports.jsx($a,{dataSource:q,settings:_,pivotRef:C,enabled:q.data&&q.data.length>0,roomPasportization:m,localization:a,licenseKey:i,hyperlinkColumn:d})}):t.jsxRuntimeExports.jsx(t.Alert,{children:x.emptyReportDataSource})}),O!==null?t.jsxRuntimeExports.jsx(Kc,{isOpen:y,onHide:()=>E(!1),usersData:O.users??null,setReportVersion:L,reportVersionId:O==null?void 0:O.reportVersionId,EmployeePicker:l}):null]})},Jc=({cell:{value:e}})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e?t.jsxRuntimeExports.jsx(t.AvatarIcon,{name:e,size:21,fontSize:12}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})}),Zc=({knownTypes:e,typeFilters:n,onChangeTypeFilters:r})=>t.jsxRuntimeExports.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:e.map(s=>t.jsxRuntimeExports.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:t.classNames(`border-${s}`,n.includes(s)&&`bg-${s}`),onClick:()=>{n.includes(s)?r(n.filter(o=>o!==s)):r([...n,s])}},s))}),eu=({linksTo:e,onClick:n,children:r})=>e?t.jsxRuntimeExports.jsx(se.Link,{to:e,className:"text-decoration-none",onClick:n,children:r}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r}),tu=({message:e,onDeleteMessage:n,onClickMessage:r,getIcon:s,getLinksTo:o})=>{const{ProjectIconComponent:a,localizationContext:i}=p.useContext(t.LuminusComponentsContext),{dateFnsLocale:l}=p.useContext(i),c=e.dateTime?t.parseISO(e.dateTime):null,u=c?Nl(new Date(Date.now()),c):0;return t.jsxRuntimeExports.jsxs("div",{children:[c&&t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:t.format(c,"dd.MM.yyyy HH:mm"),placement:"left",children:t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",children:u>2?t.format(c,"dd.MM.yyyy"):Sl(c,new Date(Date.now()),{locale:l.code})})})})}),t.jsxRuntimeExports.jsx(eu,{linksTo:o(e)??void 0,onClick:r,children:t.jsxRuntimeExports.jsx(dl,{level:e.type,noIcon:!0,children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start gap-2",children:[s(e),t.jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"fw-bold",children:e.subject}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:d=>{d.preventDefault(),d.stopPropagation(),n(e.id)},children:t.jsxRuntimeExports.jsx(a,{icon:"delete"})})]}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:e.text})]})]})})})]})},Fs=["info","warning","danger"],Vs=({messages:e,isLoading:n,onDeleteMessage:r,onClickMessage:s,getIcon:o,getLinksTo:a})=>{const{texts:{messageBoard:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(Fs),u=p.useMemo(()=>e.filter(d=>l.includes(d.type??"")),[l,e]);return t.jsxRuntimeExports.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[t.jsxRuntimeExports.jsx(Zc,{knownTypes:Fs,typeFilters:l,onChangeTypeFilters:d=>c(d)}),n&&t.jsxRuntimeExports.jsxs("div",{className:"p-3 w-100",children:[t.jsxRuntimeExports.jsx(Qe,{as:Ns.Title,animation:"glow",children:t.jsxRuntimeExports.jsx(Qe,{xs:6})}),t.jsxRuntimeExports.jsxs(Qe,{as:Ns.Text,animation:"glow",children:[t.jsxRuntimeExports.jsx(Qe,{xs:7})," ",t.jsxRuntimeExports.jsx(Qe,{xs:4})," ",t.jsxRuntimeExports.jsx(Qe,{xs:4})," ",t.jsxRuntimeExports.jsx(Qe,{xs:6})," ",t.jsxRuntimeExports.jsx(Qe,{xs:8})]})]}),!n&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e.length===0&&t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",className:"mt-2",children:i.noMessages}),t.jsxRuntimeExports.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:u.map(d=>t.jsxRuntimeExports.jsx(tu,{message:d,onDeleteMessage:r,onClickMessage:s,getIcon:o,getLinksTo:a},d.id))})]})]})},Hn={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},nu=({renderAsNotifPanel:e,notifIcon:n,apiUrls:{apiGet:r=Hn.apiGet,apiDelete:s=Hn.apiDelete}=Hn,getIcon:o,getLinksTo:a})=>{const l=t.useAxios(),[c,u]=p.useState([]),[d,m]=p.useState(!1),[x,f]=p.useState(!1),[g,h]=p.useState(!1),b=p.useCallback(async()=>{f(!0),await l.get(r).then(({data:E})=>{u(E),m(!0),f(!1)}).catch(()=>{u([]),f(!1)})},[r,l]),v=p.useCallback(async E=>l.delete(`${s}${E}`).then(()=>!0).catch(()=>!1),[s,l]),j=p.useCallback(E=>{v(E).then(C=>{C&&u(c.filter(S=>S.id!==E))})},[v,c]);p.useEffect(()=>{b();const E=setInterval(()=>b(),60*1e3);return()=>{clearInterval(E)}},[b]);const R=c.filter(E=>E.type==="danger").length,y=d?!1:x;return e?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"position-relative",children:[t.jsxRuntimeExports.jsx(t.IconButton,{size:"md",onClick:()=>h(!g),children:n}),R>0&&t.jsxRuntimeExports.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:R})]}),t.jsxRuntimeExports.jsx(Ss,{show:g,onHide:()=>h(!1),placement:"end",children:t.jsxRuntimeExports.jsx(Ss.Body,{children:t.jsxRuntimeExports.jsx(Vs,{messages:c,isLoading:y,onDeleteMessage:j,onClickMessage:()=>h(!1),getIcon:o,getLinksTo:a})})})]}):t.jsxRuntimeExports.jsx(Vs,{messages:c,isLoading:y,onDeleteMessage:j,getIcon:o,getLinksTo:a})},ru="_tab-panel_d8l8q_1",su="_full-height-no-overflow_d8l8q_5",ou="_disabled_d8l8q_12",zn={"tab-panel":"_tab-panel_d8l8q_1",tabPanel:ru,"full-height-no-overflow":"_full-height-no-overflow_d8l8q_5",fullHeightNoOverflow:su,disabled:ou},Ga=({eventKey:e,activeTab:n,fullHeightNoOverflow:r,disabled:s,className:o,children:a})=>e!==n?null:t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-tab-panel",zn.tabPanel,{[zn.fullHeightNoOverflow]:r},{disabled:s},{[zn.disabled]:s},o),children:a}),au="_join-line_1q9e8_1",iu={"join-line":"_join-line_1q9e8_1",joinLine:au},Mr=({activeTab:e,onSelect:n,children:r,vertical:s,verticalStepper:o})=>t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-tabs d-flex mb-2",{"gap-1":!o},{"gap-0":o},{"flex-column":s||o}),children:r.map((a,i)=>{const l=a.type,c=a.props;if(!c)return null;const u=c.eventKey,d=c.children,m=c.className,x=c.onClick;return t.jsxRuntimeExports.jsxs(p.Fragment,{children:[t.jsxRuntimeExports.jsx(l,{...c,className:t.classNames({active:e===u},m),onClick:()=>{n(u),x&&x(u)},vertical:s||o,children:d}),o&&i<r.length-1&&t.jsxRuntimeExports.jsx("div",{className:t.classNames("join-line",iu.joinLine)})]},c.eventKey)})}),lu="_tab_1tbi7_1",cu="_disabled_1tbi7_7",uu="_vertical_1tbi7_13",qn={tab:lu,disabled:cu,vertical:uu},Lr=({eventKey:e,className:n,onClick:r,disabled:s,vertical:o,children:a})=>t.jsxRuntimeExports.jsx("div",{role:"button",className:t.classNames("luminus-tab text-primary rounded",qn.tab,n,{disabled:s},{[qn.disabled]:s},{vertical:o},{[qn.vertical]:o}),onClick:()=>r&&!s&&r(e),children:typeof a=="string"?t.jsxRuntimeExports.jsx(t.Typography,{variant:o?"body":"h6",className:o?"":"text-primary",children:a}):a}),du=({tabs:e,activeTab:n,onSelect:r,...s})=>{var i;const{ProjectIconComponent:o}=p.useContext(t.LuminusComponentsContext),{isMobile:a}=t.useWindowSize();return a?t.jsxRuntimeExports.jsx(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle,text:((i=e.find(l=>l.id===n))==null?void 0:i.name)??"",icon:t.jsxRuntimeExports.jsx(o,{icon:"chevron-down"})}),...s,children:e.map(l=>t.jsxRuntimeExports.jsx(t.DropdownItem,{onClick:()=>r(l.id),children:l.name},l.id))}):t.jsxRuntimeExports.jsx(Mr,{activeTab:n,onSelect:l=>r(l),...s,children:e.map(l=>t.jsxRuntimeExports.jsx(Lr,{eventKey:l.id,children:l.name},l.id))})},pu="_selection_1dtmm_1",mu="_selectionBg_1dtmm_10",xu="_selectionItemsContainer_1dtmm_18",fu="_selectionItems_1dtmm_18",pn={selection:pu,selectionBg:mu,selectionItemsContainer:xu,selectionItems:fu},Br=({icon:e,setIcon:n,IconComponent:r,IconTypeArray:s})=>{const[o,a]=p.useState(!1),i=l=>{n(l),a(!1)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{className:"rounded m-1",onClick:()=>a(!0),children:t.jsxRuntimeExports.jsx(r,{icon:e})}),o&&t.jsxRuntimeExports.jsxs("div",{className:pn.selection,children:[t.jsxRuntimeExports.jsx("div",{className:pn.selectionBg,onClick:()=>a(!1)}),t.jsxRuntimeExports.jsx("div",{className:pn.selectionItemsContainer,children:t.jsxRuntimeExports.jsx("div",{className:pn.selectionItems,children:s.filter((l,c,u)=>u.indexOf(l)===c).map(l=>t.jsxRuntimeExports.jsx(t.IconButton,{className:"rounded",onClick:()=>i(l),children:t.jsxRuntimeExports.jsx(r,{icon:l})},l))})})]})]})},Fr=()=>{const e=p.useContext(t.ShortcutLinksContext);if(e===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return e},gu=({shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteLocation:o})=>{const{ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(e.icon),[c,u]=p.useState(e.name);console.log(i,typeof i);const d=p.useMemo(()=>!(i===e.icon&&c===e.name),[i,c,e.icon,e.name]),m=p.useCallback(()=>{l(e.icon),u(e.name)},[e]),x=p.useCallback(()=>{s({...e,icon:i,name:c})},[s,i,c,e]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",maxLength:20,value:c,onChange:u,className:"d-flex-grow-1",InputContainer:t.NoInputContainer,size:"sm"})}),t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center align-items-center",children:t.jsxRuntimeExports.jsx(Br,{icon:i,setIcon:l,IconComponent:n,IconTypeArray:r})})}),t.jsxRuntimeExports.jsx("td",{className:"align-middle",style:{width:"7em"},children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-end",children:[d&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{onClick:m,color:"secondary",className:"d-inline",children:t.jsxRuntimeExports.jsx(a,{icon:"cancel"})}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:x,color:"success",className:"d-inline",children:t.jsxRuntimeExports.jsx(a,{icon:"check"})})]}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:o,color:"danger",children:t.jsxRuntimeExports.jsx(a,{icon:"delete"})})]})})]})},vu=({shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteShortcutLink:o})=>{const a=p.useCallback(()=>{o(e.id)},[o,e.id]);return t.jsxRuntimeExports.jsx("tr",{className:"mb-3",children:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.url.length<=23?t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:e.url}):t.jsxRuntimeExports.jsx(t.SimpleTooltip,{placement:"bottom",text:e.url,children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",children:[e.url.slice(0,21),"..."]})})}),t.jsxRuntimeExports.jsx(gu,{shortcutLink:e,IconComponent:n,IconTypeArray:r,editShortcutLink:s,deleteLocation:a})]})})},hu=({IconComponent:e,IconTypeArray:n})=>{const{texts:r}=p.useContext(t.LuminusComponentsContext),{shortcutLinks:s,editShortcutLink:o,deleteShortcutLink:a}=Fr();return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s!==null&&s.length>0?t.jsxRuntimeExports.jsxs(Ul,{size:"sm",title:r.shortcutLinks.shortcutLinksSetting,children:[t.jsxRuntimeExports.jsx("thead",{className:"fw-bold",children:t.jsxRuntimeExports.jsxs("tr",{children:[t.jsxRuntimeExports.jsx("th",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.target})}),t.jsxRuntimeExports.jsx("th",{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.name})}),t.jsxRuntimeExports.jsx("th",{className:"text-center",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:r.shortcutLinks.icon})}),t.jsxRuntimeExports.jsx("th",{})]})}),t.jsxRuntimeExports.jsx("tbody",{children:s==null?void 0:s.map(i=>t.jsxRuntimeExports.jsx(vu,{shortcutLink:i,IconComponent:e,IconTypeArray:n,editShortcutLink:o,deleteShortcutLink:a},i.id))})]}):t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",children:r.shortcutLinks.addLinksToEditThemHereInfo})})},hr=5,bu="_linkButton_pnlvi_1",ju="_linkAddButton_pnlvi_31",Eu="_createLinkRow_pnlvi_39",Rt={linkButton:bu,linkAddButton:ju,createLinkRow:Eu},yu=({shortcutLink:e,IconComponent:n})=>t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:e.name,placement:"bottom",children:t.jsxRuntimeExports.jsx(se.Link,{to:e.url,className:Rt.linkButton,children:t.jsxRuntimeExports.jsx(n,{icon:e.icon})})}),Ru=({closeModal:e,isOpen:n,createLink:r,pageTitlePrefix:s,IconComponent:o,IconTypeArray:a})=>{const i=se.useLocation(),{texts:l}=p.useContext(t.LuminusComponentsContext),[c,u]=p.useState("star-outline"),[d,m]=p.useState(s?document.title.replace(s,""):document.title),x=p.useCallback(async()=>{await r({icon:c,name:d,url:i.pathname+i.search}),e()},[e,r,c,i.pathname,i.search,d]),f=p.useMemo(()=>i.pathname+i.search,[i.pathname,i.search]);return t.jsxRuntimeExports.jsx(t.Modal,{show:n,onHide:e,size:"sm",children:t.jsxRuntimeExports.jsxs("div",{onKeyDown:g=>{g.code!=="Escape"&&g.stopPropagation()},children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:l.shortcutLinks.newShortcut})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.target}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:f.length<=23?f:t.jsxRuntimeExports.jsx(t.SimpleTooltip,{placement:"bottom",text:f,children:t.jsxRuntimeExports.jsxs("span",{children:[f.slice(0,21),"..."]})})})]}),t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.name}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",maxLength:25,value:d,onChange:m,className:"w-100",InputContainer:t.RowLabelInput,withoutLabel:!0})})]}),t.jsxRuntimeExports.jsxs("div",{className:Rt.createLinkRow,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"pe-3 text-end",children:l.shortcutLinks.icon}),t.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsxRuntimeExports.jsx(Br,{icon:c,setIcon:u,IconComponent:o,IconTypeArray:a})})]})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:x,children:l.shortcutLinks.addShortcut})})]})})},Cu=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:r,createLink:s})=>{const{ProjectIconComponent:o,texts:a}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(!1),[c]=t.a(i,100);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:a.shortcutLinks.addShortcut,placement:"bottom",children:t.jsxRuntimeExports.jsx("button",{type:"button",className:t.classNames(Rt.linkButton,Rt.linkAddButton),onClick:()=>l(!0),children:t.jsxRuntimeExports.jsx(o,{icon:"add"})})}),(i||c)&&t.jsxRuntimeExports.jsx(Ru,{IconComponent:e,IconTypeArray:n,closeModal:()=>l(!1),createLink:s,isOpen:i,pageTitlePrefix:r})]})},Nu=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:r})=>{const{shortcutLinks:s,createShortcutLink:o}=Fr(),a=p.useMemo(()=>s!==null&&s.length<hr,[s]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2",children:[s==null?void 0:s.slice(0,hr).map((i,l)=>i!==null?t.jsxRuntimeExports.jsx(yu,{shortcutLink:i,IconComponent:e},l):null),a&&t.jsxRuntimeExports.jsx(Cu,{IconComponent:e,IconTypeArray:n,pageTitlePrefix:r,createLink:o})]})})},wu=e=>{const n=t.useAxios(),{startLoading:r,stopLoading:s}=p.useContext(t.LoadingContext),o=p.useCallback(async l=>{r("submit-createShortcutLink");try{await n.post(`/dynamicForms/insert?referenceId=${e}`,l)}finally{s("submit-createShortcutLink")}},[n,e,r,s]),a=p.useCallback(async l=>{r("submit-updateShortcutLink");try{await n.post(`/dynamicForms/update?referenceId=${e}`,l)}finally{s("submit-updateShortcutLink")}},[n,e,r,s]),i=p.useCallback(async l=>{r("delete-deleteShortcutLink");try{await n.delete(`/dynamicForms/delete?referenceId=${e}&pk=${l.toString()}`)}finally{s("delete-deleteShortcutLink")}},[n,e,r,s]);return{create:o,update:a,remove:i}},Su=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},$s=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},Du=({children:e,referenceId:n})=>{const{user:r}=p.useContext(t.UserContext),s=p.useCallback(f=>f.map(g=>({id:g.id,icon:g.icon,name:g.name,url:g.url})),[]),{data:o,reloadData:a}=ge.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${n}&employee=${r==null?void 0:r.personalNumber}`,{silent:!0,dataTransformer:s,enabled:r!==null}),{create:i,update:l,remove:c}=wu(n),u=p.useCallback(async f=>{const g=$s(r);if(Su(o).length>=hr)throw new Error("Cannot add more shortcut links.");await i({...f,employee:g.personalNumber}),await a()},[i,a,o,r]),d=p.useCallback(async f=>{const g=$s(r);await l({...f,employee:g.personalNumber}),await a()},[a,l,r]),m=p.useCallback(async f=>{await c(f),await a()},[a,c]),x=p.useMemo(()=>({shortcutLinks:o,createShortcutLink:u,editShortcutLink:d,deleteShortcutLink:m}),[u,m,d,o]);return t.jsxRuntimeExports.jsx(t.ShortcutLinksContext.Provider,{value:x,children:e})},Iu=({targets:e,removeNotifTarget:n})=>{const{ProjectIconComponent:r}=p.useContext(t.LuminusComponentsContext);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e&&e.sort((s,o)=>(s.employeeId??0)-(o.employeeId??0)).map(s=>t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-between mb-1",children:[t.jsxRuntimeExports.jsx("div",{className:"text-secondary",children:t.jsxRuntimeExports.jsx("span",{className:"d-flex gap-2 ",children:s.employeeId&&s.roleName===null?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(r,{icon:"user"}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"subtitle",children:s.employeeName})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(r,{icon:"role"}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"subtitle",children:s.roleName})]})})}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"danger",onClick:()=>n(s.id),children:t.jsxRuntimeExports.jsx(r,{icon:"delete"})})]},s.id))})},Tu=({show:e,onHide:n,roles:r,onAddTarget:s,EmployeePicker:o,templateId:a})=>{const{texts:{notifCentrum:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(null),[u,d]=p.useState(null),[m,x]=p.useState("R"),f=p.useCallback(()=>{c(null),d(null),n()},[n]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>f(),children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:i.addNewTarget})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(Fa,{options:[{id:"E",name:i.employee},{id:"R",name:i.role}],value:m,onChange:g=>x(g),InputContainer:t.RowLabelInput}),m==="E"?t.jsxRuntimeExports.jsx(o,{InputContainer:t.RowLabelInput,label:i.employee,value:{id:(l==null?void 0:l.id)??null,name:(l==null?void 0:l.name)??""},onSelect:g=>c({id:Number(g==null?void 0:g.id)??null,name:(g==null?void 0:g.name)??""})}):t.jsxRuntimeExports.jsx(t.CustomSelectInput,{InputContainer:t.RowLabelInput,label:i.role,options:r.map(g=>({id:g,name:g})),value:u,onChange:g=>d((g==null?void 0:g.toString())??"")})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:()=>{s({templateId:a??0,targetId:null,employeeId:(l==null?void 0:l.id)??null,roleName:u},(l==null?void 0:l.name)??null),f()},children:i.add})})]})},_u=({templates:e,selectedTemplateId:n,setSelectedTemplateId:r,roles:s,onAddNotifTarget:o,onRemoveNotifTarget:a,EmployeePicker:i})=>{const{texts:{notifCentrum:l},ProjectIconComponent:c}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.ListGroup,{className:"overflow-auto h-max-100 p-2",children:e.map(m=>t.jsxRuntimeExports.jsxs(t.ListGroup.Item,{action:n!==m.id,className:`p-0 mb-2 border rounded shadow-sm ${n===m.id?"border-1 border-primary":""}`,onClick:()=>r(m.id),children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-between align-items-center border-1 border-bottom border-primary p-2",children:[t.jsxRuntimeExports.jsx("div",{className:"text-primary",children:m.destinationId===1?t.jsxRuntimeExports.jsx(c,{icon:"mail-envelope"}):t.jsxRuntimeExports.jsx(c,{icon:"dashboard"})}),t.jsxRuntimeExports.jsx(t.Typography,{className:"text-truncate text-primary",variant:"subtitle",children:m.subjectTemplate}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>d(!0),children:t.jsxRuntimeExports.jsx(c,{icon:"add"})})]}),t.jsxRuntimeExports.jsx("div",{className:"my-2 ps-3 pe-2",children:m.targets.length>0?t.jsxRuntimeExports.jsx(Iu,{targets:m.targets,removeNotifTarget:a}):t.jsxRuntimeExports.jsx(t.Alert,{size:"sm",variant:"warning",children:l.noTargets})})]},m.id))}),t.jsxRuntimeExports.jsx(Tu,{show:u,onHide:()=>d(!1),roles:s??[],onAddTarget:o,EmployeePicker:i,templateId:n})]})},ku=({show:e,onHide:n,template:r,onEdit:s})=>{const{texts:{notifCentrum:o}}=p.useContext(t.LuminusComponentsContext),[a,i]=p.useState(null),[l,c]=p.useState(null);p.useEffect(()=>{r&&(i(r.subjectTemplate),c(r.textTemplate))},[r]);const u=p.useCallback(()=>{!a||!l||(s(a,l),n())},[l,s,n,a]);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r&&t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:n,size:"lg",scrollable:!0,children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:o.editTemplate})}),t.jsxRuntimeExports.jsxs(t.Modal.Body,{style:{minHeight:"50vh"},children:[t.jsxRuntimeExports.jsxs(t.Form.Group,{controlId:"subject",children:[t.jsxRuntimeExports.jsx(t.Form.Label,{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"text-primary",children:o.subject})}),t.jsxRuntimeExports.jsx(t.Form.Control,{value:a??"",onChange:d=>i(d.target.value)})]}),t.jsxRuntimeExports.jsxs(t.Form.Group,{controlId:"text",children:[t.jsxRuntimeExports.jsx(t.Form.Label,{children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",className:"text-primary",children:o.text})}),t.jsxRuntimeExports.jsx(t.Form.Control,{as:"textarea",rows:10,value:l??"",onChange:d=>c(d.target.value),style:{resize:"vertical",minHeight:"400px"}})]})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{onClick:()=>{console.log(a),console.log(l),u()},children:o.save})})]})})},Ou=({kinds:e,targetSystem:n,reloadActions:r,reloadHistory:s,reloadRoles:o,onRemoveTarget:a,onPostTarget:i,onTemplateEdit:l,EmployeePicker:c})=>{var $,V,G;const{texts:{notifCentrum:u},ProjectIconComponent:d}=p.useContext(t.LuminusComponentsContext),{confirm:m}=t.useConfirm(),[x,f]=p.useState(null),[g,h]=p.useState(null),[b,v]=p.useState(!1),[j,R]=p.useState(null),[y,E]=ge.useLocalStorageState("notif-kind-id",null);p.useEffect(()=>{var k;e.length>0?E(((k=e.at(0))==null?void 0:k.id)??null):E(null)},[e,E]);const[C,S]=p.useState([]);p.useEffect(()=>{y&&r(y).then(k=>{S(k)}).catch(k=>{console.log(k),S([])})},[r,y]);const[w,I]=ge.useLocalStorageState("notif-action-id",(($=C==null?void 0:C.at(0))==null?void 0:$.id)??null),[T,_]=p.useState([]);p.useEffect(()=>{w===null||x===null||s(w,x).then(k=>{_(k)}).catch(k=>{console.log(k),_([])})},[r,s,w,y,x]);const[P,D]=p.useState([]);p.useEffect(()=>{w!==null&&o(w).then(k=>{D(k)}).catch(k=>{console.log(k),D([])})},[o,w]);const B=p.useMemo(()=>{var k;return!C||!w?[]:((k=C.find(W=>W.id===w))==null?void 0:k.templates)??[]},[C,w]),O=p.useCallback((k,W)=>{i(k,W).then(z=>{S(C?[...C.map(q=>q.id!==w?q:{...q,templates:[...q.templates.map(ne=>ne.id!==x?ne:{...ne,targets:[...ne.targets,z]})]})]:[])}).catch(z=>console.log(z))},[C,i,w,x,S]),L=p.useCallback((k,W)=>{x&&l(x,k,W).then(()=>{S(C?[...C.map(z=>z.id!==w?z:{...z,templates:[...z.templates.map(q=>q.id!==x?q:{...q,subjectTemplate:k,textTemplate:W})]})]:[])}).catch(z=>console.log(z))},[C,l,w,x]),M=p.useCallback(async k=>{await m(u.confirmTargetDelete)&&a(k).then(()=>S(C?[...C.map(W=>W.id!==w?W:{...W,templates:[...W.templates.map(z=>z.id!==x?z:{...z,targets:z.targets.filter(q=>q.id!==k)})]})]:[]))},[C,m,u,a,w,x]);return t.jsxRuntimeExports.jsxs("div",{className:"h-100 overflow-hidden",children:[t.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[t.jsxRuntimeExports.jsxs("div",{className:"row w-100",children:[t.jsxRuntimeExports.jsx("div",{className:"col-2",children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{label:u.kind,size:"sm",noEmptyOption:!0,options:((V=e.filter(k=>(k.targetSystem&n)>0))==null?void 0:V.map(k=>({id:k.id,name:k.name})))??[],value:y??null,onChange:k=>E(Number(k)),dropdownWidth:200})}),t.jsxRuntimeExports.jsx("div",{className:"col-3",children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{label:u.subkind,size:"sm",noEmptyOption:!0,options:(C==null?void 0:C.map(k=>({id:k.id,name:k.name})))??[],value:w??null,onChange:k=>I(Number(k)),dropdownWidth:250})})]}),t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdown,{children:t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{hideOn:"always",cKey:"template-edit",onClick:()=>v(!0),disabled:x===null,icon:t.jsxRuntimeExports.jsx(d,{icon:"edit"}),children:u.editTemplate})})]}),t.jsxRuntimeExports.jsxs("div",{className:"vh-100 overflow-hidden d-flex gap-1",children:[t.jsxRuntimeExports.jsx("div",{className:"h-75 w-25 overflow-hidden",children:t.jsxRuntimeExports.jsx(_u,{templates:B,roles:P??[],onAddNotifTarget:O,onRemoveNotifTarget:M,selectedTemplateId:x,setSelectedTemplateId:k=>{f(k),h(null)},EmployeePicker:c})}),x&&t.jsxRuntimeExports.jsx("div",{className:"h-75 w-75 overflow-hidden border rounded bg-white",children:t.jsxRuntimeExports.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:(g==null?void 0:g.message)??((G=B.find(k=>k.id===x))==null?void 0:G.textTemplate)})}),x&&t.jsxRuntimeExports.jsx("div",{className:"w-25 h-75 overflow-y-scroll",children:T.length>0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",value:j,onChange:k=>R((k==null?void 0:k.toString())??""),InputContainer:t.FloatingLabelInput,label:u.historyLookup,size:"sm",className:"mx-1 mb-1"}),t.jsxRuntimeExports.jsx("div",{children:T.filter(k=>{var W;return j?(W=k.recipients)==null?void 0:W.map(z=>z.name).join(",").toLocaleLowerCase().includes(j):k}).map(k=>{var W;return t.jsxRuntimeExports.jsxs("div",{role:"button",onClick:()=>h(k),className:`d-flex flex-column align-items-center bg-white border rounded w-auto p-2 mx-1 mb-1 ${(g==null?void 0:g.id)===k.id?"border-primary":""}`,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:t.format(k.date,"dd.MM.yyyy")}),t.jsxRuntimeExports.jsx("div",{className:"d-flex gap-1",children:(W=k.recipients)==null?void 0:W.map(z=>t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",children:`${z.name}`},z.email))})]},k.id)})})]}):t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",children:"Empty"})}),t.jsxRuntimeExports.jsx(ku,{show:b,onHide:()=>v(!1),template:B.find(k=>k.id===x)??null,onEdit:L})]})]})},Pu=({history:e,onClick:n,BnfTableComponent:r})=>{const{texts:{notifCentrum:s}}=p.useContext(t.LuminusComponentsContext),o=p.useMemo(()=>[{caption:"notificationHistory.id",fieldName:"id",type:"number",isVisible:!1},{caption:"notificationHistory.recipientId",fieldName:"recipientId",type:"number",isVisible:!1},{caption:"notificationHistory.recipientFullName",fieldName:"recipientFullName",type:"string",isVisible:!1},{caption:"notificationHistory.actionKindId",fieldName:"actionKindId",type:"number",isVisible:!1},{caption:s.subkind,fieldName:"actionKindName",type:"string",filterType:"select"},{caption:"notificationHistory.actionId",fieldName:"actionId",type:"number",isVisible:!1},{caption:s.subkind,fieldName:"actionName",type:"string",filterType:"select"},{caption:s.date,fieldName:"date",type:"string"},{caption:s.subject,fieldName:"subject",type:"string"},{caption:"notificationHistory.message",fieldName:"message",type:"string",isVisible:!1}],[s]),a=p.useCallback(i=>{n(i.id)},[n]);return t.jsxRuntimeExports.jsx(r,{columnsDef:o,data:e,useScrollableContainer:!0,paginationMode:"enabled",bottomBarProps:{hideFullScreen:!0},onRowClick:a})},Au=({reloadUserHistory:e,EmployeePicker:n,BnfTableComponent:r})=>{const{texts:{notifCentrum:s}}=p.useContext(t.LuminusComponentsContext),[o,a]=p.useState(null),[i,l]=ge.useLocalStorageState("notif-user",null),[c,u]=p.useState([]);return p.useEffect(()=>{i!==null&&e(i.id).then(d=>{u(d)}).catch(d=>{console.log(d),u([])})},[i,e]),t.jsxRuntimeExports.jsxs("div",{className:"h-100 overflow-hidden d-flex flex-column gap-1",children:[t.jsxRuntimeExports.jsx("div",{className:"row",children:t.jsxRuntimeExports.jsx("div",{className:"col-3",children:t.jsxRuntimeExports.jsx(n,{label:s.employee,value:i,size:"sm",onSelect:d=>l(d?{id:Number(d.id),name:d.name}:null)})})}),t.jsxRuntimeExports.jsxs("div",{className:"vh-100 overflow hidden row",children:[t.jsxRuntimeExports.jsx("div",{className:"col-5 h-75 overflow-hidden",children:t.jsxRuntimeExports.jsx(Pu,{history:c??[],onClick:d=>a((c==null?void 0:c.find(m=>m.id===d))??null),BnfTableComponent:r})}),o&&t.jsxRuntimeExports.jsx("div",{className:"col bg-darker h-75",children:t.jsxRuntimeExports.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:o==null?void 0:o.message})})]})]})},Ua=({result:e,onClose:n,tableIdentifier:r,BnfTableComponent:s})=>{var l,c,u,d,m;const{texts:{imports:o},ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),i=p.useMemo(()=>[{fieldName:"row",caption:o.row,type:"number",width:100},{fieldName:"column",caption:o.column,type:"number",width:100},{fieldName:"error",caption:o.error,type:"string",width:500}],[o.row,o.column,o.error]);return e?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(t.Alert,{variant:e.success?"success":"danger",size:"sm",className:"mb-2 p-2",children:t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-3 align-items-start",children:[t.jsxRuntimeExports.jsxs("div",{className:"w-100",children:[t.jsxRuntimeExports.jsx("div",{className:"w-100 text-center",children:e.success?o.importSuccess:o.importFailed}),e.success&&((l=e.data)!=null&&l.added||(c=e.data)!=null&&c.updated||(u=e.data)!=null&&u.deleted)?t.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-2",children:t.jsxRuntimeExports.jsxs("div",{className:"list-group",children:[e.data.added?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importAdded(e.data.added)," "]})}):null,e.data.updated?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importUpdated(e.data.updated)," "]})}):null,e.data.deleted?t.jsxRuntimeExports.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importDeleted(e.data.deleted)," "]})}):null]})}):null,!e.success&&((m=(d=e.data)==null?void 0:d.errors)==null?void 0:m.length)>0?t.jsxRuntimeExports.jsx("div",{className:"mt-3",children:t.jsxRuntimeExports.jsx(s,{columnsDef:i,data:e.data.errors,useScrollableContainer:!0,tableId:r})}):null]}),n!==void 0?t.jsxRuntimeExports.jsx(t.IconButton,{color:e.success?"success":"danger",className:t.classNames("hover-darken",e.success?"bg-success-subtle":"bg-danger-subtle"),onClick:n,children:t.jsxRuntimeExports.jsx(a,{icon:"close"})}):null]})})}):null},Mu="_upload-box_9ka79_1",Lu="_browse-btn_9ka79_15",Yn={"upload-box":"_upload-box_9ka79_1",uploadBox:Mu,"browse-btn":"_browse-btn_9ka79_15",browseBtn:Lu},Wa=({file:e,onFileChange:n,onImport:r,children:s,multiple:o,accept:a})=>{const{ProjectIconComponent:i,texts:{imports:l}}=p.useContext(t.LuminusComponentsContext),c=p.useCallback(async d=>{d.length>0&&n(o===!0?[...d]:d[0])},[e,o,n]),u=p.useCallback(d=>{var x;d.preventDefault();const m=(x=d.dataTransfer)==null?void 0:x.files;m&&(m==null?void 0:m.length)>0&&c(m)},[c]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e!==null?t.jsxRuntimeExports.jsxs("div",{className:"d-flex border rounded p-1 ps-2 bg-white justify-content-between align-items-center mb-2",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:o?e.map(d=>d.name).join(", "):e.name}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-3",children:[s??null,t.jsxRuntimeExports.jsx(t.PrimaryButton,{className:"text-nowrap",size:"sm",disabled:e===null,onClick:r,children:l.start})]})]}):null,t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Yn.uploadBox,{[Yn.active]:e!==null}),onDrop:u,onDragOver:d=>d.preventDefault(),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:l.dropHint}),t.jsxRuntimeExports.jsx("input",{type:"file",hidden:!0,id:"browse",onChange:d=>{var m;return((m=d.target)==null?void 0:m.files)&&c(d.target.files)},multiple:o,accept:a}),t.jsxRuntimeExports.jsx("label",{htmlFor:"browse",className:Yn.browseBtn,children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",className:"d-flex gap-2 align-items-center",children:[t.jsxRuntimeExports.jsx(i,{icon:"file-upload"}),l.pickFileHint]})})]})]})},Bu=({otherSettingId:e,languageOptions:n,tableIdentifier:r,SettingsOutlet:s,BnfTableComponent:o,importLocalization:a})=>{const{texts:{localizations:i}}=p.useContext(t.LuminusComponentsContext),[l,c]=p.useState(n[0].id),[u,d]=p.useState(null),[m,x]=p.useState(null),f=p.useCallback(async()=>{if(u===null)return;const g=await a({file:u,lang:l});g.status==="success"&&x(g.data)},[a,l,u]);return t.jsxRuntimeExports.jsx(s,{itemId:e,title:i.localizationImport,children:m?t.jsxRuntimeExports.jsx(Ua,{result:m,onClose:()=>x(null),BnfTableComponent:o,tableIdentifier:r}):t.jsxRuntimeExports.jsx(Wa,{file:u,onFileChange:d,onImport:f,children:t.jsxRuntimeExports.jsx("div",{style:{minWidth:140},children:t.jsxRuntimeExports.jsx(t.CustomSelectInput,{value:l,onChange:g=>typeof g=="string"?c(g):null,options:n,label:i.importedLanguage})})})})},Fu=(e,n)=>{const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const a=r[o],i=s[a];if(typeof i=="string")return i;if(i===void 0)return;s=i}},Vu=({selLng:e,lngsData:n,localizationKey:r,reloadData:s,saveChanges:o})=>{const{ProjectIconComponent:a}=p.useContext(t.LuminusComponentsContext),i=p.useMemo(()=>{const m=n.get(e);if(m===void 0)return"";const x=Fu(m,r);return m!==void 0&&x!==void 0?x:""},[n,r,e]),[l,c]=p.useState(i),u=p.useCallback(async()=>{await o([{fileName:e+".json",items:[{key:r,value:l}]}]),await s()},[r,s,o,e,l]),d=p.useMemo(()=>l!==i,[i,l]);return t.jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[t.jsxRuntimeExports.jsx(t.TextInput,{label:e+r,type:"text",value:l,onChange:m=>{c(typeof m!="string"?"":m)},InputContainer:t.RowLabelInput,withoutLabel:!0,className:"flex-grow-1"}),d?t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>c(i),children:t.jsxRuntimeExports.jsx(a,{icon:"cancel"})}),t.jsxRuntimeExports.jsx(t.IconButton,{onClick:u,children:t.jsxRuntimeExports.jsx(a,{icon:"check"})})]}):null]})},$u="_keysTable_1j6ns_1",Gu="_subgrid_1j6ns_14",Uu="_lngSelectRow_1j6ns_19",Wu="_tableItem_1j6ns_26",Hu="_tableFooter_1j6ns_29",zu="_tableFullWidth_1j6ns_35",qu="_tableBody_1j6ns_39",Yu="_lngSelect_1j6ns_19",Ku="_addLng_1j6ns_52",Xu="_fileSelect_1j6ns_57",Qu="_searchBox_1j6ns_61",Se={keysTable:$u,subgrid:Gu,lngSelectRow:Uu,tableItem:Wu,tableFooter:Hu,tableFullWidth:zu,tableBody:qu,lngSelect:Yu,addLng:Ku,fileSelect:Xu,searchBox:Qu},mn=50,Ju=(e,n)=>{const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const a=r[o],i=s[a];if(typeof i=="string")return i;if(i===void 0)return;s=i}},Zu=({languageOptions:e,envMode:n,getOtherSettingsUrl:r,downloadXls:s,saveChanges:o,localizationFilesOptions:a,remoteLocalesRoot:i})=>{const{texts:{localizations:l},ProjectIconComponent:c}=p.useContext(t.LuminusComponentsContext),[u,d]=p.useState(1),[m,x]=p.useState(new Map),[f,g]=p.useState(null),[h,b]=p.useState(""),[v,j]=p.useState(new Set),R=p.useCallback(D=>{x(new Map),j(D)},[]),y=p.useMemo(()=>e.filter(D=>!v.has(D.id)),[v,e]),E=p.useMemo(()=>{if(m.size===0)return[];const D=new Set,B=(V,G="")=>{if(typeof V[1]=="object"){Object.entries(V[1]).forEach(k=>B(k,G+V[0]+"."));return}D.add(G+V[0])};Array.from(m).forEach(V=>{Object.entries(V[1]).forEach(G=>B(G))});const O=Array.from(D),L=a.find(V=>V.path===f);return((L==null?void 0:L.type)==="report"?O.filter(V=>{const G=V.split(".");return G[G.length-1]==="caption"}):O).map(V=>({key:V,lngData:new Map(Array.from(v).map(G=>{const k=m.get(G);return[G,(k===void 0?void 0:Ju(k,V))??""]}))}))},[m,a,f,v]),C=p.useMemo(()=>E.filter(D=>t.stringSearchWithin(D.key,h)||Array.from(D.lngData).some(B=>typeof(B==null?void 0:B[1])!="string"?!1:t.stringSearchWithin((B==null?void 0:B[1])??"",h))),[h,E]),S=p.useMemo(()=>Math.ceil(C.length/mn),[C.length]),w=p.useCallback(D=>{D!==null&&d(()=>Math.max(1,Math.min(D,S)))},[S]),I=p.useCallback(async()=>{if(f===null)return;const D=Array.from(v).map(O=>(async()=>{const L=await t.axios.get(`${i}${f==null?void 0:f.replace("{{lng}}",O)}&v=${new Date().getTime()}`,{responseType:"json"});return[O,L.data]})()),B=await Promise.allSettled(D);x(new Map(B.map(O=>O.status==="fulfilled"?O.value:["",{}])))},[i,f,v]),T=p.useCallback(async()=>{I()},[I]),_=p.useMemo(()=>y.length>0,[y.length]),P=p.useMemo(()=>v.size+1+(_?1:0),[_,v.size]);return p.useEffect(()=>{w(u)},[w,u,C]),p.useEffect(()=>{I()},[I]),i===void 0?t.jsxRuntimeExports.jsx(t.PageContainer,{children:t.jsxRuntimeExports.jsxs(t.Alert,{variant:"danger",className:"fw-bold",children:[l.cantRunLocalizationSettings,t.jsxRuntimeExports.jsx("br",{}),t.jsxRuntimeExports.jsx("br",{}),l.envNotConnectedToRemote(n.toUpperCase())]})}):t.jsxRuntimeExports.jsx(t.PageContainer,{title:t.jsxRuntimeExports.jsx("div",{className:"d-flex gap-4",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"h3",children:l.localizationSettings})}),helmet:l.localizationSettings,variant:"fullScreen",children:t.jsxRuntimeExports.jsxs("div",{className:Se.keysTable,style:{"--keys-table-columns":P,"--adding-column":_?1:0},children:[t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.tableFullWidth,"d-flex align-items-center justify-content-between gap-2 px-2 mt-1"),children:[t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:a.map(D=>({id:D.path,name:D.nameTranslationKey})),value:f,onChange:D=>typeof D!="number"?g(D):null,size:"sm",label:l.localizationFile,className:Se.fileSelect,noSortOptions:!0}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.searchBox,"d-flex align-items-center gap-2 border rounded"),children:[t.jsxRuntimeExports.jsx(c,{icon:"search",className:"text-muted",size:18,iconProps:{className:"mt- me-n4"}}),t.jsxRuntimeExports.jsx(t.TextInput,{type:"text",value:h,onChange:D=>b(typeof D=="string"?D:""),size:"sm",showClearIcon:h!=="",withoutLabel:!0,placeholder:"vyhledávat...",className:"placeholder-muted bg-transparent border-0 my-0 py-0 w-100"})]}),t.jsxRuntimeExports.jsxs(t.ResponsiveContextDropdown,{children:[t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{cKey:"export",hideOn:"always",onClick:s,icon:t.jsxRuntimeExports.jsx(t.FileExtensionIcon,{fileExtension:"xls"}),children:l.xlsExport}),t.jsxRuntimeExports.jsx(t.ResponsiveContextDropdownItem,{cKey:"import",hideOn:"always",to:r("localizationImport"),icon:t.jsxRuntimeExports.jsx(c,{icon:"link"}),children:l.import})]})]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.lngSelectRow),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:l.key}),Array.from(v).map((D,B)=>t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:e.filter(O=>O.id===D||!v.has(O.id)),value:D,onChange:O=>R(L=>O===null?(L.delete(D),new Set(L)):(typeof O=="string"&&(L.delete(D),L.add(O)),new Set(L))),size:"sm",label:`${l.language} ${B+1}`,withoutLabel:!0,InputContainer:t.RowLabelInput,className:t.classNames(Se.lngSelect)},D)),_?t.jsxRuntimeExports.jsx(t.CustomSelectInput,{options:y,value:null,onChange:D=>R(B=>(typeof D=="string"&&B.add(D),new Set(B))),size:"sm",label:l.addLanguage,InputContainer:t.RowLabelInput,className:t.classNames(Se.lngSelect,Se.addLng)}):null]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.tableBody),children:[E.length===0||C.length===0?t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",className:t.classNames(Se.tableFullWidth,Se.emptyTableAlert,"my-n1"),children:E.length===0?l.noDataLoaded:C.length===0?l.noDataFiltered:null}):null,C.slice(mn*(u-1),mn*u).map(D=>t.jsxRuntimeExports.jsxs("div",{className:t.classNames(Se.subgrid,Se.tableItem),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"form-label",children:D.key}),Array.from(v).map(B=>t.jsxRuntimeExports.jsx(Vu,{localizationKey:D.key,lngsData:m,selLng:B,reloadData:T,saveChanges:o},B))]},D.key))]}),t.jsxRuntimeExports.jsxs("div",{className:t.classNames("d-flex align-items-center justify-content-around gap-3 px-2 py-0",Se.tableFooter),children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:[l.keyCount,":"," ",t.jsxRuntimeExports.jsx("span",{className:"fw-bold",children:C.length})]})}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:[l.page,": "]}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>w(u-1),children:t.jsxRuntimeExports.jsx(c,{icon:"minus"})}),t.jsxRuntimeExports.jsx("div",{style:{width:30},children:t.jsxRuntimeExports.jsx(Ba,{value:u,onChange:w,InputContainer:t.RowLabelInput,withoutLabel:!0,size:"sm"})}),t.jsxRuntimeExports.jsxs(t.Typography,{variant:"body",children:["/",Math.ceil(C.length/mn)]}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",onClick:()=>w(u+1),children:t.jsxRuntimeExports.jsx(c,{icon:"plus"})})]})]})]})]})})},Gs=3,Ha=(e,n,r)=>{var o;if((n==null?void 0:n.customPathBuilder)!==void 0)return n.customPathBuilder(e,n);const s=(o=r.find(a=>a.key===e.type))==null?void 0:o.toPath;return s?`${s}/${e.searchKey}`:"/not-found"},za=(e,n)=>{var r;return((r=n==null?void 0:n.customNameBuilder)==null?void 0:r.call(n,e))??e.name},qa=(e,n,r,s,o)=>{const a=t.useAxios(),[i,l]=p.useState(!1),[c,u]=p.useState([]),d=e==="",m=p.useCallback(()=>{u([]),!(n.length<Gs)&&(l(!0),a.get(ke.generateApiPath(r,{path:{query:n},query:{type:d?void 0:e,count:s?void 0:d?5:20}})).then(({data:g})=>{u(g),l(!1)}).catch(()=>{l(!1)}))},[a,s,d,n,r,e]),x=p.useMemo(()=>{if(o===void 0)return[];if(n.length<Gs||!["XAP","",null].includes(e))return[];const g=[];return o.forEach(h=>{const b=h.items.filter(v=>t.stringSearchWithin(v.name,decodeURIComponent(n)));b.length>0&&g.push({key:{...h.key,totalCount:b.length},items:b})}),g},[n,o,e]),f=p.useMemo(()=>x.concat(c),[c,x]);return p.useEffect(()=>{m()},[m]),{isLoading:i,searchItems:f}},ed="_input-group_1hcpm_1",td="_input-group-text_1hcpm_5",nd="_left_1hcpm_9",rd="_right_1hcpm_13",sd="_input_1hcpm_1",od="_submit-button_1hcpm_20",ot={"input-group":"_input-group_1hcpm_1",inputGroup:ed,"input-group-text":"_input-group-text_1hcpm_5",inputGroupText:td,left:nd,right:rd,input:sd,"submit-button":"_submit-button_1hcpm_20",submitButton:od},ad=({searchTypes:e,selectedType:n,setSelectedType:r})=>t.jsxRuntimeExports.jsx(t.Dropdown,{toggle:t.jsxRuntimeExports.jsx(t.DropdownToggle,{as:t.SimpleDropdownToggle,icon:null,text:n==null?void 0:n.text}),children:e.map(s=>t.jsxRuntimeExports.jsx(t.DropdownItem,{icon:null,onClick:()=>r(s.key),children:s.text},s.key))}),id="_dropdown_1ddrg_1",ld="_open_1ddrg_12",cd="_loading-container_1ddrg_15",ud="_groups-container_1ddrg_22",dd="_group_1ddrg_22",pd="_header_1ddrg_26",md="_item_1ddrg_33",ut={dropdown:id,open:ld,"loading-container":"_loading-container_1ddrg_15",loadingContainer:cd,"groups-container":"_groups-container_1ddrg_22",groupsContainer:ud,group:dd,header:pd,item:md},xd=({item:e,searchTypes:n,onCancel:r})=>{const s=p.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=p.useMemo(()=>Ha(e,s,n),[e,s,n]),a=p.useMemo(()=>za(e,s),[e,s]);return t.jsxRuntimeExports.jsxs(se.Link,{to:o,className:t.classNames("search-item d-flex gap-3 align-items-center justify-content-between",ut.item),onClick:r,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:a}),t.jsxRuntimeExports.jsx(t.Typography,{variant:"caption",className:"text-primary",children:t.jsxRuntimeExports.jsx(t.MdOutlineArrowOutward,{})})]})},fd=({show:e,query:n,onCancel:r,groups:s,isLoading:o,searchTypes:a})=>{const{texts:{appSearch:i}}=p.useContext(t.LuminusComponentsContext),l=p.useRef(null);return t.useClickOutside([l],r),t.jsxRuntimeExports.jsx("div",{ref:l,className:t.classNames("luminus-app-search-dropdown shadow rounded",ut.dropdown,{[ut.open]:e}),children:o?t.jsxRuntimeExports.jsx("div",{className:ut.loadingContainer,children:t.jsxRuntimeExports.jsx(t.Spinner,{animation:"border",variant:"primary"})}):t.jsxRuntimeExports.jsx("div",{className:ut.groupsContainer,children:s==null?void 0:s.map(c=>{var u;return t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ut.group),children:[t.jsxRuntimeExports.jsxs(se.Link,{to:`/search?query=${n}&type=${c.key.category}`,className:t.classNames("group-header",ut.header),onClick:r,children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:"text-primary",children:c.key.categoryName}),t.jsxRuntimeExports.jsxs(t.Typography,{variant:"caption",children:[c.items.length," ",i.amountFrom," ",c.key.totalCount]})]}),(u=c.items)==null?void 0:u.map((d,m)=>t.jsxRuntimeExports.jsx(xd,{item:d,onCancel:r,searchTypes:a},m))]},c.key.category)})})})},gd=({searchTypes:e,navigateFunction:n,currentPath:r,homePath:s="/",className:o,staticAppItems:a,searchEndpointUri:i})=>{var y;const{texts:{appSearch:l}}=p.useContext(t.LuminusComponentsContext),[c,u]=p.useState(e.length>0?((y=e.at(0))==null?void 0:y.key)??null:null),d=p.useMemo(()=>e.find(E=>E.key===c)??null,[e,c]),[m,x]=p.useState(""),[f,g]=t.a(encodeURIComponent(m),500),{isLoading:h,searchItems:b}=qa(c,f,i,!1,a),[v,j]=p.useState(!1);p.useEffect(()=>{(b.length>0||h)&&j(!0)},[b,h]);const R=p.useRef(null);return p.useEffect(()=>{var E;x(""),r===s&&((E=R.current)==null||E.focus())},[r,s]),t.jsxRuntimeExports.jsx(t.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:E=>{E.preventDefault(),E.stopPropagation(),g.flush(),j(!1),f.length>2&&n(`/search?query=${f}${d&&d.key&&`&type=${d==null?void 0:d.key}`}`)},children:t.jsxRuntimeExports.jsxs(yn,{className:t.classNames(ot.inputGroup,o),children:[t.jsxRuntimeExports.jsx(yn.Text,{className:t.classNames("p-1 rounded",ot.inputGroupText,ot.left),children:t.jsxRuntimeExports.jsx(ad,{searchTypes:e,selectedType:d,setSelectedType:u})}),t.jsxRuntimeExports.jsx(t.Form.Control,{ref:R,placeholder:l.searchPlaceholder,type:"text",size:"sm",className:t.classNames("luminus-app-search-input",ot.input),value:m,onChange:E=>{var C;return x(((C=E.target)==null?void 0:C.value)??"")},onFocus:()=>b.length>0&&j(!0)}),t.jsxRuntimeExports.jsx(yn.Text,{className:t.classNames("p-0 rounded",ot.inputGroupText,ot.right),children:t.jsxRuntimeExports.jsx("button",{type:"submit",className:t.classNames("text-primary",ot.submitButton),children:t.jsxRuntimeExports.jsx(t.FaSearch,{})})}),t.jsxRuntimeExports.jsx(fd,{query:f,searchTypes:e,show:v,onCancel:()=>j(!1),groups:b,isLoading:h})]})})},vd=({item:e,searchTypes:n})=>{const{ProjectIconComponent:r}=p.useContext(t.LuminusComponentsContext),s=p.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=p.useMemo(()=>Ha(e,s,n),[e,s,n]),a=p.useMemo(()=>za(e,s),[e,s]);return t.jsxRuntimeExports.jsxs(se.Link,{to:o,className:"text-nowrap list-group-item list-group-item-action d-flex justify-content-between align-items-center",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:a}),t.jsxRuntimeExports.jsx(r,{icon:"chevron-right",className:"text-primary"})]})},hd=({query:e,type:n,appSearchTypes:r,searchEndpointUri:s,staticAppItems:o})=>{var d,m;const{texts:{appSearch:a}}=p.useContext(t.LuminusComponentsContext),[i,l]=p.useState(""),{searchItems:c,isLoading:u}=qa(n,e,s,!0,o);return p.useEffect(()=>{var x;i||c===null||c.length===0||l(((x=c[0].key)==null?void 0:x.category)??"")},[c,i]),c===null?null:t.jsxRuntimeExports.jsx(t.PageContainer,{variant:"fullScreen",children:u?t.jsxRuntimeExports.jsx(Ie.Loading,{}):c.length===0?t.jsxRuntimeExports.jsx("div",{className:"alert alert-warning",children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",children:a.noResultsFor(e)})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Mr,{activeTab:i,onSelect:x=>l((x==null?void 0:x.toString())??""),children:c.map(x=>{var f,g;return t.jsxRuntimeExports.jsx(Lr,{eventKey:((f=x.key)==null?void 0:f.category)??"",children:((g=x.key)==null?void 0:g.categoryName)??""},x.key.category)})}),t.jsxRuntimeExports.jsx(Ga,{eventKey:i,activeTab:i,fullHeightNoOverflow:!0,children:t.jsxRuntimeExports.jsx("div",{className:"list-group h-100 overflow-auto",children:(m=(d=c.find(x=>x.key.category===i))==null?void 0:d.items)==null?void 0:m.map((x,f)=>t.jsxRuntimeExports.jsx(vd,{item:x,searchTypes:r},f))})})]})})},bd=()=>{const{texts:{userSettings:e}}=p.useContext(t.LuminusComponentsContext),[n,r]=ge.useLocalStorageState("file-download-try-opening",!0);return t.jsxRuntimeExports.jsx(nt,{collapsible:!0,title:e.downloads,defaultOpen:!0,children:t.jsxRuntimeExports.jsx(Nt,{type:"switch",value:n===void 0?!0:n,onChange:r,label:e.tryOpenFileLabel})})},jd=({show:e,handleClose:n,onConfirm:r,apiCreateBackup:s})=>{const{texts:{userSettings:o}}=p.useContext(t.LuminusComponentsContext),{zStringRequired:a}=t.useZodSchemaTypes(),{addNotification:i}=t.useNotifications(),l=t.useAxios(),{startLoading:c,stopLoading:u}=p.useContext(t.LoadingContext),[d,m]=p.useState(null),x=t.z.object({name:a()}),f=Ee.useForm({resolver:t.t(x)}),g=p.useCallback(async(b,v)=>(c("localStorageSettingPost"),l.post(s,{name:b,setting:v}).then(()=>!0).catch(()=>!1).finally(()=>u("localStorageSettingPost"))),[l,s,c,u]),h=async b=>{await g(b.name,JSON.stringify(d))&&(i(o.localStorageCreateBackupSuccess,"success"),r())};return p.useEffect(()=>{e&&m(ke.dumpLocalStorage())},[e]),t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>n(),children:[t.jsxRuntimeExports.jsx(t.Modal.Header,{closeButton:!0,children:t.jsxRuntimeExports.jsx(t.Modal.Title,{children:o.localStorageCreateBackup})}),t.jsxRuntimeExports.jsx(Ee.FormProvider,{...f,children:t.jsxRuntimeExports.jsxs(t.Form,{onSubmit:f.handleSubmit(h),noValidate:!0,children:[t.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[t.jsxRuntimeExports.jsx(t.Alert,{variant:"info",size:"sm",children:o.localStorageCreateBackupInfo(Object.keys(d||{}).length)}),t.jsxRuntimeExports.jsx(t.HookFormTextInput,{required:!0,label:o.localStorageCreateBackupName,formField:"name",type:"text"})]}),t.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"justify-content-end",children:t.jsxRuntimeExports.jsx(t.PrimaryButton,{type:"submit",children:o.localStorageCreateBackupSave})})]})})]})},xn={apiGetBackups:"/localStorageSettings",apiCreateBackup:"/localStorageSettings",apiDeleteBackup:"/localStorageSettings"},Ed=({apiUrls:{apiGetBackups:e=xn.apiGetBackups,apiCreateBackup:n=xn.apiCreateBackup,apiDeleteBackup:r=xn.apiDeleteBackup}=xn})=>{const{ProjectIconComponent:s,texts:{userSettings:o}}=p.useContext(t.LuminusComponentsContext),{confirm:a}=t.useConfirm(),i=t.useAxios(),{startLoading:l,stopLoading:c}=p.useContext(t.LoadingContext),{addNotification:u}=t.useNotifications(),[d,m]=p.useState(!1),{data:x,setData:f,reloadData:g}=ge.useGetApiData(e),h=p.useCallback(async j=>(l("localStorageSettingDelete"),i.delete(`${r}/${j}`).then(()=>!0).catch(()=>!1).finally(()=>c("localStorageSettingDelete"))),[i,r,l,c]),b=p.useCallback(async j=>{await a(o.localStorageDeleteBackupConfirm)&&await h(j)&&(u(o.localStorageDeleteBackupSuccess,"success"),f(R=>(R==null?void 0:R.filter(y=>y.id!==j))??null))},[a,o,h,u,f]),v=p.useCallback(async j=>{j.setting&&await a(o.localStorageLoadBackup)&&(ke.restoreLocalStorage(j.setting)?u(o.localStorageLoadBackupSuccess,"success"):u(o.localStorageLoadBackupError,"danger"))},[a,o,u]);return t.jsxRuntimeExports.jsxs(nt,{collapsible:!0,title:o.localStorage,defaultOpen:!0,children:[t.jsxRuntimeExports.jsx(t.ContextButton,{className:"mb-2",onClick:()=>m(!0),children:o.localStorageCreateBackup}),x&&x.length>0?t.jsxRuntimeExports.jsx("div",{className:"list-group",children:x.map((j,R)=>t.jsxRuntimeExports.jsxs("div",{role:"button",className:"list-group-item list-group-item-action d-flex justify-content-between align-items-center",onClick:()=>v(j),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",children:j.name}),t.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-3",children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"body2",className:"text-muted",children:j.date?t.formatDate(j.date):""}),t.jsxRuntimeExports.jsx(t.IconButton,{size:"sm",color:"danger",onClick:y=>{y.stopPropagation(),b(j.id)},children:t.jsxRuntimeExports.jsx(s,{icon:"delete"})})]})]},R))}):x?t.jsxRuntimeExports.jsx(t.Alert,{variant:"secondary",size:"sm",children:o.localStorageNoBackups}):null,t.jsxRuntimeExports.jsx(jd,{show:d,handleClose:()=>m(!1),onConfirm:()=>{m(!1),g()},apiCreateBackup:n})]})},yd=()=>{const{texts:{userSettings:e}}=p.useContext(t.LuminusComponentsContext),[n,r]=ge.useLocalStorageState("search-use-asterisk",!0);return t.jsxRuntimeExports.jsx(nt,{collapsible:!0,title:e.searchSettings,defaultOpen:!0,children:t.jsxRuntimeExports.jsx(Nt,{type:"switch",value:n===void 0?!0:n,onChange:r,label:e.searchSettingsUseAsterisk})})},Rd="_widgets-row_13gg1_1",Cd="_widget_13gg1_1",Nd="_widget-img_13gg1_5",wd="_widget-title-spacer_13gg1_14",Sd="_widget-title_13gg1_14",Dd="_title_13gg1_28",Le={"widgets-row":"_widgets-row_13gg1_1",widgetsRow:Rd,widget:Cd,"widget-img":"_widget-img_13gg1_5",widgetImg:Nd,"widget-title-spacer":"_widget-title-spacer_13gg1_14",widgetTitleSpacer:wd,"widget-title":"_widget-title_13gg1_14",widgetTitle:Sd,title:Dd},Id=({show:e,widgetGroups:n,widgets:r,handleClose:s,onWidgetPicked:o,texts:a})=>{const[i,l]=p.useState(""),c=p.useMemo(()=>r.filter(d=>d.id!==-1&&t.stringSearchWithin(d.name,i)),[r,i]),u=p.useMemo(()=>n.filter(d=>c.some(m=>m.group===d.id)),[n,c]);return t.jsxRuntimeExports.jsxs(t.Modal,{show:e,onHide:()=>s(),size:"lg",children:[t.jsxRuntimeExports.jsxs(t.Modal.Header,{closeButton:!0,children:[t.jsxRuntimeExports.jsx(t.Modal.Title,{className:"w-100",children:a.pickWidgetToAdd}),t.jsxRuntimeExports.jsx(t.Form.Control,{type:"search",size:"sm",value:i,placeholder:a.searchPlaceholder,onChange:d=>{var m;return l(((m=d.target)==null?void 0:m.value)??"")},className:"me-3",style:{maxWidth:"200px"}})]}),t.jsxRuntimeExports.jsx(t.Modal.Body,{className:"flex-column gap-3",children:c.length===0?t.jsxRuntimeExports.jsx(t.Alert,{variant:"warning",children:a.noWidgets}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u.map(d=>t.jsxRuntimeExports.jsx(Yt,{defaultOpen:!0,title:d.name??"",children:t.jsxRuntimeExports.jsx("div",{className:"p-1",children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("row gx-3 gy-3",Le.widgetsRow),children:c.filter(m=>m.group===d.id).map(m=>t.jsxRuntimeExports.jsx("div",{className:"col col-4",children:t.jsxRuntimeExports.jsxs("div",{role:"button",className:t.classNames("p-0 pt-2 bg-white rounded shadow-sm",Le.widget),onClick:()=>o(m.id),children:[t.jsxRuntimeExports.jsx("div",{className:Le.widgetImg,style:{backgroundImage:m.img?`url(${m.img})`:void 0}}),t.jsxRuntimeExports.jsx("div",{className:Le.widgetTitleSpacer}),t.jsxRuntimeExports.jsx("div",{className:t.classNames(Le.widgetTitle,"rounded"),children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:t.classNames(Le.title,"text-white text-truncate"),children:m.name})})]},m.id)}))})})},d.id)),c.some(d=>d.group===void 0)&&t.jsxRuntimeExports.jsx(Yt,{defaultOpen:!0,title:a.otherWidgets,children:t.jsxRuntimeExports.jsx("div",{className:"p-1",children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("row gx-3 gy-3",Le.widgetsRow),children:c.filter(d=>d.group===void 0).map(d=>t.jsxRuntimeExports.jsx("div",{className:"col col-4",children:t.jsxRuntimeExports.jsxs("div",{role:"button",className:t.classNames("p-0 pt-2 bg-white rounded shadow-sm",Le.widget),onClick:()=>o(d.id),children:[t.jsxRuntimeExports.jsx("div",{className:Le.widgetImg,style:{backgroundImage:d.img?`url(${d.img})`:void 0}}),t.jsxRuntimeExports.jsx("div",{className:Le.widgetTitleSpacer}),t.jsxRuntimeExports.jsx("div",{className:t.classNames(Le.widgetTitle,"rounded"),children:t.jsxRuntimeExports.jsx(t.Typography,{variant:"body",className:t.classNames(Le.title,"text-white text-truncate"),children:d.name})})]},d.id)}))})})})]})})]})},Td="_widget_19xgl_1",_d="_mobile_19xgl_7",Us={widget:Td,mobile:_d},Ws=({widgetGroups:e,availableWidgets:n,onAdd:r,texts:s})=>{const[o,a]=p.useState(!1),{isMobile:i}=t.useWindowSize();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:t.classNames("luminus-empty-widget",Us.widget,{[Us.mobile]:i}),children:t.jsxRuntimeExports.jsx(t.IconButton,{onClick:()=>a(!0),children:t.jsxRuntimeExports.jsx(t.MdOutlineAddCircleOutline,{})})}),t.jsxRuntimeExports.jsx(Id,{show:o,widgetGroups:e,widgets:n,handleClose:()=>a(!1),onWidgetPicked:l=>{a(!1),r(l)},texts:s})]})},kd="_dashboard_1gf59_1",Od="_widgets-grid_1gf59_1",Pd="_widget-wrapper_1gf59_8",Ad="_full-width_1gf59_13",Md="_widget-edit_1gf59_16",Ld="_remove-icon_1gf59_19",Bd="_full-width-icon_1gf59_26",Fd="_widget-edit-overlay_1gf59_36",Vd="_mobile_1gf59_45",ze={dashboard:kd,"widgets-grid":"_widgets-grid_1gf59_1",widgetsGrid:Od,"widget-wrapper":"_widget-wrapper_1gf59_8",widgetWrapper:Pd,"full-width":"_full-width_1gf59_13",fullWidth:Ad,"widget-edit":"_widget-edit_1gf59_16",widgetEdit:Md,"remove-icon":"_remove-icon_1gf59_19",removeIcon:Ld,"full-width-icon":"_full-width-icon_1gf59_26",fullWidthIcon:Bd,"widget-edit-overlay":"_widget-edit-overlay_1gf59_36",widgetEditOverlay:Fd,mobile:Vd},$d=(e,n="dashboardConfig")=>{const[r,s]=p.useState({widgets:[]});p.useEffect(()=>{const a=localStorage.getItem(n);a?s(JSON.parse(a)):e&&s(e)},[e,n]);const o=p.useCallback(a=>{s(a),localStorage.setItem(n,JSON.stringify(a))},[n]);return{dashboardConfig:r,onChangeDashboardConfig:o}},Gd=({widgetGroups:e,availableWidgets:n,editMode:r,defaultDashboardConfig:s,dashboardConfigKey:o})=>{var f;const{texts:{homeDashboard:a}}=p.useContext(t.LuminusComponentsContext),{dashboardConfig:i,onChangeDashboardConfig:l}=$d(s,o),c=p.useCallback((g,h)=>{var b,v;g===((b=i.widgets)==null?void 0:b.length)?l({...i,widgets:[...i.widgets,{widgetId:h,fullWidth:!1}]}):l({...i,widgets:((v=i.widgets)==null?void 0:v.map((j,R)=>R===g?{widgetId:h,fullWidth:!1}:j))??[]})},[i,l]),u=p.useCallback(g=>{var h,b;((h=i.widgets[g])==null?void 0:h.widgetId)===-1?l({...i,widgets:((b=i.widgets)==null?void 0:b.filter((v,j)=>j!==g))??[]}):c(g,-1)},[i,l,c]),d=p.useCallback(g=>{var h;l({...i,widgets:((h=i.widgets)==null?void 0:h.map((b,v)=>v===g?{...b,fullWidth:!b.fullWidth}:b))??[]})},[i,l]),m=p.useCallback((g,h,b)=>g?t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ze.widgetWrapper,{[ze.widgetEdit]:r&&g.id!==-1},{[ze.fullWidth]:b}),children:[r&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.IconButton,{color:"danger",onClick:()=>u(h),className:t.classNames(ze.removeIcon),children:t.jsxRuntimeExports.jsx(t.MdOutlineDelete,{})}),t.jsxRuntimeExports.jsx(t.IconButton,{color:b?"danger":"primary",onClick:()=>d(h),className:t.classNames(ze.fullWidthIcon),children:t.jsxRuntimeExports.jsx(t.MdOutlineExpand,{})})]}),g.id===-1?r&&t.jsxRuntimeExports.jsx("div",{className:ze.widgetWrapper,children:t.jsxRuntimeExports.jsx(Ws,{widgetGroups:e,availableWidgets:n,onAdd:v=>c(h,v),texts:a})}):t.jsxRuntimeExports.jsx(ec,{title:g.title,children:t.jsxRuntimeExports.jsx(g.WidgetElement,{title:g.title})}),g.id>-1&&r&&t.jsxRuntimeExports.jsx("div",{className:ze.widgetEditOverlay})]},h):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{}),[r,e,c,u,d,n,a]),{isMobile:x}=t.useWindowSize();return t.jsxRuntimeExports.jsx("div",{className:t.classNames(ze.dashboard,{[ze.mobile]:x}),children:t.jsxRuntimeExports.jsxs("div",{className:t.classNames(ze.widgetsGrid),children:[(f=i.widgets)==null?void 0:f.map((g,h)=>m(n.find(b=>b.id===g.widgetId),h,g.fullWidth)),r&&t.jsxRuntimeExports.jsx(Ws,{widgetGroups:e,availableWidgets:n,onAdd:g=>{var h;return c((h=i.widgets)==null?void 0:h.length,g)},texts:a})]})})},Ud="_badge_193ci_1",Wd="_sm_193ci_6",Hd="_md_193ci_10",zd="_lg_193ci_14",qd="_light_193ci_18",Kn={badge:Ud,sm:Wd,md:Hd,lg:zd,light:qd},Yd=({children:e,color:n="primary",size:r="md",rounded:s,className:o,variant:a="filled",...i})=>{const l=p.useMemo(()=>a==="filled"?t.classNames(`bg-${n}`):a==="outline"?t.classNames(`text-${n} border-${n} border bg-white`):"",[n,a]);return t.jsxRuntimeExports.jsx("span",{className:t.classNames("luminus-badge badge",l,o,{"rounded-pill":s},{"text-dark":n==="light"},{[Kn.light]:n==="light"},Kn.badge,Kn[r]),...i,children:e})},Kd="_collapse-icon_1ahhn_1",Xd="_collapsed_1ahhn_6",Hs={"collapse-icon":"_collapse-icon_1ahhn_1",collapseIcon:Kd,collapsed:Xd},Yt=({title:e,children:n,className:r,...s})=>{const o=s.controlled?!1:s.defaultOpen??!1,[a,i]=p.useState(o),l=s.controlled?s.isOpen:a;return p.useEffect(()=>{i(o)},[o]),t.jsxRuntimeExports.jsxs("div",{className:r??"",children:[t.jsxRuntimeExports.jsxs("div",{role:"button",className:"d-flex align-items-center justify-content-between pb-3 pt-2",onClick:()=>s.controlled?s.onToggle(!s.isOpen):i(!a),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",children:e}),t.jsxRuntimeExports.jsx(t.MdOutlineChevronRight,{className:t.classNames(Hs.collapseIcon,{[Hs.collapsed]:l})})]}),t.jsxRuntimeExports.jsx(sa,{in:l,children:t.jsxRuntimeExports.jsx("div",{children:n})}),t.jsxRuntimeExports.jsx("hr",{className:`my-0 ${l?"mt-3":""}`})]})},Qd="_card_19733_1",Jd="_header_19733_6",Zd="_header-content_19733_13",ep="_title_19733_19",tp="_collapse-icon_19733_22",np="_collapsed_19733_27",rp="_content_19733_30",at={card:Qd,header:Jd,"header-content":"_header-content_19733_13",headerContent:Zd,title:ep,"collapse-icon":"_collapse-icon_19733_22",collapseIcon:tp,collapsed:np,content:rp},nt=({title:e,headerContent:n,children:r,className:s,headerClassName:o,contentClassName:a,dontRenderIfNoChildren:i,...l})=>{const c=l.collapsible?l.controlled?!1:l.defaultOpen??!1:!0,[u,d]=p.useState(c),m=l.collapsible?l.controlled?l.isOpen:u:!0;p.useEffect(()=>{d(c)},[c]);const x=p.useMemo(()=>!r||!r.toString()||r.toString().split(",").filter(f=>f&&f!=="false").length===0,[r]);return i&&x?null:t.jsxRuntimeExports.jsxs("div",{className:t.classNames("luminus-card rounded shadow-sm",at.card,{[s??""]:s}),children:[t.jsxRuntimeExports.jsxs("div",{role:l.collapsible?"button":void 0,className:t.classNames("header",at.header,{[o??""]:o}),onClick:()=>{l.collapsible&&(l.controlled?l.onToggle(!l.isOpen):d(!u))},children:[t.jsxRuntimeExports.jsxs("div",{className:t.classNames("header-content",at.headerContent),children:[t.jsxRuntimeExports.jsx(t.Typography,{variant:"h6",className:t.classNames("text-primary",at.title),children:e}),n??null]}),l.collapsible&&t.jsxRuntimeExports.jsx(t.MdOutlineChevronRight,{className:t.classNames(at.collapseIcon,{[at.collapsed]:m})})]}),t.jsxRuntimeExports.jsx(sa,{in:m,children:t.jsxRuntimeExports.jsx("div",{className:t.classNames("card-content border-top border-primary",at.content,{[a??""]:a}),children:r})})]})};function Kt(e){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kt(e)}function sp(e,n){if(Kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,n||"default");if(Kt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function op(e){var n=sp(e,"string");return Kt(n)=="symbol"?n:n+""}function ap(e,n,r){return(n=op(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function zs(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,s)}return r}function qs(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?zs(Object(r),!0).forEach(function(s){ap(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zs(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function _e(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Ys=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Xn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ks={INIT:"@@redux/INIT"+Xn(),REPLACE:"@@redux/REPLACE"+Xn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Xn()}};function ip(e){if(typeof e!="object"||e===null)return!1;for(var n=e;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}function lp(e){if(e===void 0)return"undefined";if(e===null)return"null";var n=typeof e;switch(n){case"boolean":case"string":case"number":case"symbol":case"function":return n}if(Array.isArray(e))return"array";if(dp(e))return"date";if(up(e))return"error";var r=cp(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return n.slice(8,-1).toLowerCase().replace(/\s/g,"")}function cp(e){return typeof e.constructor=="function"?e.constructor.name:null}function up(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function dp(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function dt(e){var n=typeof e;return process.env.NODE_ENV!=="production"&&(n=lp(e)),n}function Ya(e,n,r){var s;if(typeof n=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?_e(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof n=="function"&&typeof r>"u"&&(r=n,n=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?_e(1):"Expected the enhancer to be a function. Instead, received: '"+dt(r)+"'");return r(Ya)(e,n)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?_e(2):"Expected the root reducer to be a function. Instead, received: '"+dt(e)+"'");var o=e,a=n,i=[],l=i,c=!1;function u(){l===i&&(l=i.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?_e(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function m(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?_e(4):"Expected the listener to be a function. Instead, received: '"+dt(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?_e(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(h),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?_e(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var j=l.indexOf(h);l.splice(j,1),i=null}}}function x(h){if(!ip(h))throw new Error(process.env.NODE_ENV==="production"?_e(7):"Actions must be plain objects. Instead, the actual type was: '"+dt(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?_e(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?_e(9):"Reducers may not dispatch actions.");try{c=!0,a=o(a,h)}finally{c=!1}for(var b=i=l,v=0;v<b.length;v++){var j=b[v];j()}return h}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?_e(10):"Expected the nextReducer to be a function. Instead, received: '"+dt(h));o=h,x({type:Ks.REPLACE})}function g(){var h,b=m;return h={subscribe:function(j){if(typeof j!="object"||j===null)throw new Error(process.env.NODE_ENV==="production"?_e(11):"Expected the observer to be an object. Instead, received: '"+dt(j)+"'");function R(){j.next&&j.next(d())}R();var y=b(R);return{unsubscribe:y}}},h[Ys]=function(){return this},h}return x({type:Ks.INIT}),s={dispatch:x,subscribe:m,getState:d,replaceReducer:f},s[Ys]=g,s}function Xs(e,n){return function(){return n(e.apply(this,arguments))}}function Qs(e,n){if(typeof e=="function")return Xs(e,n);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?_e(16):"bindActionCreators expected an object or a function, but instead received: '"+dt(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var s in e){var o=e[s];typeof o=="function"&&(r[s]=Xs(o,n))}return r}function Ka(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.length===0?function(s){return s}:n.length===1?n[0]:n.reduce(function(s,o){return function(){return s(o.apply(void 0,arguments))}})}function pp(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return function(){var o=s.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?_e(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:o.getState,dispatch:function(){return a.apply(void 0,arguments)}},l=n.map(function(c){return c(i)});return a=Ka.apply(void 0,l)(o.dispatch),qs(qs({},o),{},{dispatch:a})}}}var Vr=p.createContext(null);process.env.NODE_ENV!=="production"&&(Vr.displayName="ReactRedux");function mp(e){e()}var Xa=mp,xp=function(n){return Xa=n},fp=function(){return Xa};function gp(){var e=fp(),n=null,r=null;return{clear:function(){n=null,r=null},notify:function(){e(function(){for(var o=n;o;)o.callback(),o=o.next})},get:function(){for(var o=[],a=n;a;)o.push(a),a=a.next;return o},subscribe:function(o){var a=!0,i=r={callback:o,next:null,prev:r};return i.prev?i.prev.next=i:n=i,function(){!a||n===null||(a=!1,i.next?i.next.prev=i.prev:r=i.prev,i.prev?i.prev.next=i.next:n=i.next)}}}}var Js={notify:function(){},get:function(){return[]}};function Qa(e,n){var r,s=Js;function o(m){return c(),s.subscribe(m)}function a(){s.notify()}function i(){d.onStateChange&&d.onStateChange()}function l(){return!!r}function c(){r||(r=n?n.addNestedSub(i):e.subscribe(i),s=gp())}function u(){r&&(r(),r=void 0,s.clear(),s=Js)}var d={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:i,isSubscribed:l,trySubscribe:c,tryUnsubscribe:u,getListeners:function(){return s}};return d}var Ja=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect;function Za(e){var n=e.store,r=e.context,s=e.children,o=p.useMemo(function(){var l=Qa(n);return{store:n,subscription:l}},[n]),a=p.useMemo(function(){return n.getState()},[n]);Ja(function(){var l=o.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==n.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[o,a]);var i=r||Vr;return p.createElement(i.Provider,{value:o},s)}process.env.NODE_ENV!=="production"&&(Za.propTypes={store:t.Oe.shape({subscribe:t.Oe.func.isRequired,dispatch:t.Oe.func.isRequired,getState:t.Oe.func.isRequired}),context:t.Oe.object,children:t.Oe.any});var $r=t.requireReactIs(),vp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},hp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},bp={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ei={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Gr={};Gr[$r.ForwardRef]=bp;Gr[$r.Memo]=ei;function Zs(e){return $r.isMemo(e)?ei:Gr[e.$$typeof]||vp}var jp=Object.defineProperty,Ep=Object.getOwnPropertyNames,eo=Object.getOwnPropertySymbols,yp=Object.getOwnPropertyDescriptor,Rp=Object.getPrototypeOf,to=Object.prototype;function ti(e,n,r){if(typeof n!="string"){if(to){var s=Rp(n);s&&s!==to&&ti(e,s,r)}var o=Ep(n);eo&&(o=o.concat(eo(n)));for(var a=Zs(e),i=Zs(n),l=0;l<o.length;++l){var c=o[l];if(!hp[c]&&!(r&&r[c])&&!(i&&i[c])&&!(a&&a[c])){var u=yp(n,c);try{jp(e,c,u)}catch{}}}}return e}var Cp=ti;const no=t.getDefaultExportFromCjs(Cp);var br={exports:{}},de={};/** @license React v17.0.2
|
|
10
10
|
* react-is.production.min.js
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/dist/main.es.js
CHANGED
|
@@ -2320,20 +2320,26 @@ e.label === "", so = (e, t) => e.hierarchy && e.hierarchy.uniqueName === t, lo =
|
|
|
2320
2320
|
}, [t, e, n, r]) };
|
|
2321
2321
|
}, Yp = ({ isOpen: e, onHide: t, usersData: n, reportVersionId: r, EmployeePicker: i, setReportVersion: o }) => {
|
|
2322
2322
|
const { ProjectIconComponent: s, texts: { reports: l } } = G(Q), { confirm: c } = St(), [d, u] = B(null), { changeEmployeeRights: p } = qp(r), f = T((h) => {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2323
|
+
const b = typeof h == "function" ? h(n ?? []) : h;
|
|
2324
|
+
o((v) => v === null ? null : {
|
|
2325
|
+
...v,
|
|
2326
|
+
users: b.filter((x) => x.isReportOwner === !1)
|
|
2326
2327
|
});
|
|
2327
|
-
}, [o]), m = T(async () => {
|
|
2328
|
+
}, [o, n]), m = T(async () => {
|
|
2328
2329
|
if (d === null)
|
|
2329
2330
|
return;
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2331
|
+
const b = (await p(d.id, !0)).map((v) => ({
|
|
2332
|
+
id: v.user.id,
|
|
2333
|
+
kid: v.user.kid,
|
|
2334
|
+
firstName: v.user.firstName,
|
|
2335
|
+
lastName: v.user.lastName,
|
|
2336
|
+
isReportOwner: !1
|
|
2337
|
+
}));
|
|
2338
|
+
f((v) => [...v, ...b]), u(null);
|
|
2332
2339
|
}, [d, p, f]), g = T(async (h) => {
|
|
2333
2340
|
if (!await c(l.removeSharingWith(h)))
|
|
2334
2341
|
return;
|
|
2335
|
-
|
|
2336
|
-
f(v);
|
|
2342
|
+
await p(h, !1) && f((x) => (x == null ? void 0 : x.filter((j) => j.id !== h)) ?? []);
|
|
2337
2343
|
}, [p, c, l, f]);
|
|
2338
2344
|
return /* @__PURE__ */ a.jsxs(de, { show: e, onHide: t, children: [
|
|
2339
2345
|
/* @__PURE__ */ a.jsx(de.Header, { closeButton: !0, children: /* @__PURE__ */ a.jsx(de.Title, { children: l.reportSharing }) }),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as IEmployee } from '../employee/IEmployee';
|
|
2
|
+
|
|
3
|
+
export default interface ReportRestrictResultModel {
|
|
4
|
+
reportVersionId: number;
|
|
5
|
+
reportName: string;
|
|
6
|
+
reportVersionName: string;
|
|
7
|
+
owner: IEmployee;
|
|
8
|
+
user: IEmployee;
|
|
9
|
+
addedOrRemoved: boolean;
|
|
10
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export type { default as DocumentListModel } from './api/documents/DocumentListM
|
|
|
94
94
|
export type { default as DocumentUploadModel } from './api/documents/DocumentUploadModel';
|
|
95
95
|
export type { default as DocumentsCreateFolderModel } from './api/documents/DocumentsCreateFolderModel';
|
|
96
96
|
export type { default as ReportModel } from './api/reports/ReportModel';
|
|
97
|
+
export type { default as ReportRestrictResultModel } from './api/reports/ReportRestrictResultModel';
|
|
97
98
|
export type { default as ReportRestrictItem } from './api/reports/ReportRestrictItem';
|
|
98
99
|
export type { default as ReportRestrictModel } from './api/reports/ReportRestrictModel';
|
|
99
100
|
export type { default as ReportVersionModel } from './api/reports/ReportVersionModel';
|
|
@@ -123,6 +124,7 @@ export type { default as ApprovalDefinitionLevelModel } from './api/approval/App
|
|
|
123
124
|
export type { default as ApprovalDefinitionLevelApproverModel } from './api/approval/ApprovalDefinitionLevelApproverModel';
|
|
124
125
|
export type { default as ApprovalDelegationModel } from './api/approval/ApprovalDelegationModel';
|
|
125
126
|
export type { default as EmployeeSmallModel } from './api/employee/EmployeeSmallModel';
|
|
127
|
+
export type { default as IEmployee } from './api/employee/IEmployee';
|
|
126
128
|
export type { default as LocalStorageSettingsModel } from './api/localStorageSettings/LocalStorageSettingsModel';
|
|
127
129
|
export type { default as ReloadDataWithReturnType } from './types/useGetApiData/ReloadDataWithReturnType';
|
|
128
130
|
export type { default as ReloadDataType } from './types/useGetApiData/ReloadDataType';
|