@inceptionbg/iui 1.0.303 → 1.0.304

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/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import"react-toastify/dist/ReactToastify.min.css";import{FontAwesomeIcon as e}from"@fortawesome/react-fontawesome";export{FontAwesomeIcon}from"@fortawesome/react-fontawesome";import l from"clsx";export{default as clsx}from"clsx";import t from"moment";export{default as moment}from"moment";import{Droppable as i,Draggable as a,DragDropContext as n}from"react-beautiful-dnd";export{DragDropContext,Draggable,Droppable}from"react-beautiful-dnd";import{toast as s}from"react-toastify";export{ToastContainer}from"react-toastify";import o from"i18next";export{changeLanguage,default as i18n}from"i18next";import{useTranslation as c,Trans as r}from"react-i18next";export{I18nextProvider,Trans,useTranslation}from"react-i18next";import{jsx as d,jsxs as u,Fragment as m}from"react/jsx-runtime";import{useState as p,useRef as h,useEffect as f,forwardRef as b,cloneElement as g,Children as C,useCallback as v,isValidElement as N,useMemo as w,Fragment as x}from"react";import{createPortal as y}from"react-dom";import"react-calendar/dist/Calendar.css";import{Calendar as S}from"react-calendar";import k from"moment/moment";import M from"react-select";import{AsyncPaginate as L}from"react-select-async-paginate";import z from"react-select/async-creatable";const D=[5,10,25,50,100],O=[...D,1e3],T=({isOpen:e,children:t,keepContentInDom:i,className:a})=>{const[n,s]=p(),[o,c]=p(e),r=h(null);return f((()=>{e&&c(!0)}),[e]),f((()=>{const e=new ResizeObserver((e=>{const l=Math.ceil(e[0].contentRect.height);s(l)}));let l;return r.current&&(l=r.current,e.observe(l)),()=>{l&&e.unobserve(l)}}),[r]),d("div",{className:l("iui-collapse",a),style:{maxHeight:e?n:0},onTransitionEnd:()=>!e&&c(!1),children:d("div",{ref:r,children:(i||o)&&t})})},R={prefix:"fal",iconName:"arrows-to-line",icon:[448,512,[],"e0a7","M235.3 324.7C231.3 320.7 226.5 320 224 320s-7.299 .6547-11.33 4.698l-79.98 79.98C129.6 407.8 128 411.9 128 416c0 8.523 6.865 16 16 16c4.094 0 8.188-1.562 11.31-4.688L208 374.6V496c0 8.844 7.156 16 16 16s16-7.156 16-16v-121.4l52.69 52.69C295.8 430.4 299.9 432 304 432c9.139 0 16-7.477 16-16c0-4.094-1.562-8.188-4.688-11.31L235.3 324.7zM212.7 187.3C214.4 189 218.3 192 224 192s9.609-2.98 11.33-4.707l79.98-79.98C318.4 104.2 320 100.1 320 96c0-8.527-6.865-16-16-16c-4.094 0-8.188 1.562-11.31 4.688L240 137.4V16C240 7.156 232.8 0 224 0S208 7.156 208 16v121.4L155.3 84.69C152.2 81.56 148.1 80 144 80C134.9 80 128 87.47 128 96c0 4.094 1.562 8.188 4.688 11.31L212.7 187.3zM432 240h-416C7.156 240 0 247.1 0 255.1S7.156 272 16 272h416c8.844 0 16-7.165 16-16.01S440.8 240 432 240z"]},$={prefix:"fal",iconName:"arrows-up-down",icon:[256,512,[],"f07d","M139.3 4.688l112 112C254.4 119.8 256 123.9 256 128s-1.562 8.188-4.688 11.31c-6.25 6.25-16.38 6.25-22.62 0L144 54.63v402.8l84.69-84.69c6.25-6.25 16.38-6.25 22.62 0C254.4 375.8 256 379.9 256 384s-1.562 8.188-4.688 11.31l-112 112c-6.25 6.25-16.38 6.25-22.62 0l-112-112c-6.25-6.25-6.25-16.38 0-22.62s16.38-6.25 22.62 0L112 457.4V54.63L27.31 139.3c-6.25 6.25-16.38 6.25-22.62 0s-6.25-16.38 0-22.62l112-112C122.9-1.562 133.1-1.562 139.3 4.688z"]},I=({tabs:t,initialValue:i,compact:a,keepContentInDom:n,className:s})=>{const o=t.filter((e=>!e.hidden)),[c,r]=p(i||"");return o.length>0?d("div",{className:s,children:d("div",{className:"iui-accordions",children:o.map((t=>u("div",{className:l("iui-accordion",{selected:c===t.value,compact:a}),children:[u("div",{className:l("summary clickable",{disabled:t.disabled}),onClick:t.disabled?void 0:()=>r(c===t.value?"":t.value),children:[u("div",{className:"flex center",children:[t.icon&&d(e,{icon:t.icon,className:"iui-icon"}),t.label]}),d(e,{icon:t.value===c?R:$,className:"collapse-icon"})]}),d(T,{isOpen:c===t.value,keepContentInDom:n,children:d("div",{className:"p-4",children:t.component})})]},t.value)))})}):null},P={prefix:"far",iconName:"circle-check",icon:[512,512,[],"f058","M335 175L224 286.1L176.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C211.7 341.7 217.8 344 224 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S344.4 165.7 335 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"]},A={prefix:"far",iconName:"circle-exclamation",icon:[512,512,[],"f06a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM256 304c13.25 0 24-10.75 24-24v-128C280 138.8 269.3 128 256 128S232 138.8 232 152v128C232 293.3 242.8 304 256 304zM256 337.1c-17.36 0-31.44 14.08-31.44 31.44C224.6 385.9 238.6 400 256 400s31.44-14.08 31.44-31.44C287.4 351.2 273.4 337.1 256 337.1z"]},F={prefix:"far",iconName:"circle-info",icon:[512,512,[],"f05a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"]},E={prefix:"far",iconName:"triangle-exclamation",icon:[512,512,[],"f071","M506.3 417l-213.3-364C284.8 39 270.4 32 256 32C241.6 32 227.2 39 218.1 53l-213.2 364C-10.59 444.9 9.851 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM52.58 432L255.1 84.8L459.4 432H52.58zM256 337.1c-17.36 0-31.44 14.08-31.44 31.44c0 17.36 14.11 31.44 31.48 31.44s31.4-14.08 31.4-31.44C287.4 351.2 273.4 337.1 256 337.1zM232 184v96C232 293.3 242.8 304 256 304s24-10.75 24-24v-96C280 170.8 269.3 160 256 160S232 170.8 232 184z"]},V={error:A,success:P,info:F,warning:E},B=({text:t,severity:i,fitContent:a,className:n,children:s})=>u("div",{className:l("iui-alert",i,n,{"width-fit":a}),children:[d(e,{icon:V[i]}),t,s]}),H=({label:e,color:t,className:i})=>u("div",{className:"flex align-center gap-2",children:[d("div",{className:l("iui-dot-badge",t,i)}),e]}),j=({number:e,className:t,small:i,children:a,color:n="primary"})=>u("div",{className:"iui-badge-parent",children:[a,!!e&&e>0&&d("div",{className:l("iui-badge",n,t,{small:i}),children:e>99?"99+":e})]}),q=b((({label:e,color:t,className:i},a)=>d("div",{ref:a,className:l("iui-pill-badge",t,i),children:e}))),U=b((({label:t,icon:i,iconEnd:a,onClick:n,disabled:s,solid:o,outlined:c,active:r,color:m="primary",size:p="m",className:h,buttonProps:f},b)=>u("button",{ref:b,disabled:s,className:l("iui-btn",h,m,p,{solid:o,outlined:c,active:r}),onClick:n,type:f?.type||n?"button":"submit",...f,children:[i&&d(e,{icon:i}),d("div",{className:"iui-btn-label",children:t}),a&&d(e,{icon:a})]}))),W=document.getElementById("root"),Y=({label:e,position:t="bottom",disabled:i,singleLine:a,className:n,children:s})=>{const[o,c]=p(""),r=h(null),b=h(null);return f((()=>{if(!i&&e){const e=r.current,l=b.current,i=()=>{e&&l&&(X(e,l,t,c),l?.classList.add("visible"))},a=()=>l?.classList.remove("visible");return e?.addEventListener("mouseenter",i),e?.addEventListener("mouseleave",a),()=>{e?.removeEventListener("mouseenter",i),e?.removeEventListener("mouseleave",a)}}}),[i,e,t]),e&&!i?u(m,{children:[g(s,{ref:r}),y(d("div",{ref:b,className:l("tooltip-container",n,{"no-wrap":a}),children:u("div",{className:"tooltip",children:[d("div",{className:l("arrow",o||t)}),d("div",{children:e})]})}),W)]}):s},X=(e,l,t,i)=>{const a=e.getBoundingClientRect(),n=l.getBoundingClientRect();if("bottom"===t||"top"===t){const e=Math.floor(a.bottom+16),s=Math.floor(a.top-n.height-16),o=Math.floor(a.left+a.width/2-n.width/2),c="top"===t?s<0:e+n.height>window.innerHeight;i(c?"bottom"===t?"top":"bottom":""),l.style.top=`${"bottom"===t?c?s:e:c?e:s}px`,l.style.left=`${o}px`}else"right"===t?(l.style.top=Math.floor(a.top+a.height/2-n.height/2)+"px",l.style.left=Math.floor(a.right+16)+"px"):"left"===t&&(l.style.top=Math.floor(a.top+a.height/2-n.height/2)+"px",l.style.left=Math.floor(a.left-n.width-16)+"px")},J=b((({icon:t,onClick:i,disabled:a,className:n,color:s="primary",solid:o,active:c,tooltip:r,buttonProps:u,size:m},p)=>d(Y,{label:r,disabled:a,children:d("button",{ref:p,disabled:a,className:l("iui-btn iui-icon-btn",n,s,m,{active:c,solid:o}),onClick:i,type:u?.type||i?"button":"submit",...u,children:d(e,{icon:t})})}))),K=({children:e})=>d("div",{className:"page-container",children:d("div",{className:"page-content",children:d("div",{className:"widget-container",children:e})})}),Z=({isLoading:e,isFullPage:t,classNameLoader:i,children:a})=>a?C.map(a,(t=>g(t,{className:l(t.props.className,{relative:e}),children:u(m,{children:[t.props.children,e&&d("div",{className:l("loader",i),children:d("span",{className:"spinner"})})]})}))):e?d("div",{className:(t?"full-page-loader":"empty-loader")+" relative",children:d("div",{className:l("loader",i),children:d("span",{className:"spinner"})})}):d(m,{}),G=({isLoading:e})=>e?d("div",{className:"full-screen-loader",children:d("div",{className:"loader",children:d("span",{className:"spinner"})})}):null,_=()=>d("div",{className:"lazy-loader",children:d("div",{className:"loader",children:d("span",{className:"spinner"})})}),Q={prefix:"fal",iconName:"triangle-exclamation",icon:[512,512,[],"f071","M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z"]},ee={prefix:"fal",iconName:"circle-info",icon:[512,512,[],"f05a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z"]},le={warning:Q,info:ee},te=({title:t,icon:i,type:a,span:n,isLoading:s,children:o})=>d(Z,{isLoading:!!s,children:u("div",{className:l("dashboard-widget",a,{[`grid-span${n}`]:!!n}),children:[u("div",{className:"flex gap-3 mb-3",children:[i&&d("div",{className:"icon",children:d(e,{icon:i||le[a]})}),d("h1",{children:t})]}),o]})}),ie={prefix:"fal",iconName:"link",icon:[512,512,[],"f0c1","M591.5 256c50-50 50-131 0-181s-131-50-181 0L387.9 97.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l22.6-22.6c37.5-37.5 98.3-37.5 135.8 0s37.5 98.3 0 135.8L444.3 357.9c-37.4 37.4-98.1 37.4-135.6 0c-35.6-35.6-37.6-92.6-4.7-130.6l5.3-6.1c5.8-6.7 5.1-16.8-1.6-22.6s-16.8-5.1-22.6 1.6l-5.3 6.1c-43.9 50.7-41.2 126.7 6.2 174.1c49.9 49.9 130.9 49.9 180.8 0L591.5 256zM48.5 256c-50 50-50 131 0 181s131 50 181 0l22.6-22.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-22.6 22.6c-37.5 37.5-98.3 37.5-135.8 0s-37.5-98.3 0-135.8L195.7 154.1c37.4-37.4 98.1-37.4 135.6 0c35.6 35.6 37.6 92.6 4.7 130.6l-5.3 6.1c-5.8 6.7-5.1 16.8 1.6 22.6s16.8 5.1 22.6-1.6l5.3-6.1c43.9-50.7 41.2-126.7-6.2-174.1C303.9 81.5 223 81.5 173 131.4L48.5 256z"]},ae={prefix:"fal",iconName:"arrow-up-right-from-square",icon:[384,512,[],"f08e","M336 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l121.4 0L212.7 276.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L480 54.6 480 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-160c0-8.8-7.2-16-16-16L336 0zM64 32C28.7 32 0 60.7 0 96L0 448c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 144c0 17.7-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32L32 96c0-17.7 14.3-32 32-32l144 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L64 32z"]},ne=({links:l})=>{const{t:t}=c();return d(m,{children:d(te,{title:t("FastLinks"),icon:ie,isLoading:!1,children:d("div",{className:"short-links-widget mt-4",children:d("ul",{children:l.map(((l,t)=>u("li",{onClick:l.onClick,className:"clickable",children:[d(e,{icon:l.icon||ae,className:"mr-3"}),l.label]},`short-links-${t}`)))})})})})},se=({condition:e,wrapper:l,children:t})=>e?l(t):t,oe={info:F,error:E},ce=({title:t,titleEl:i,desc:a,descEl:n,isOpen:s,onClose:o,isLoading:r,confirmButton:p,cancelButton:b,additionalButton:g,isKeyboardDisabled:C,hideActionButtons:N,noBackgroundClick:w,noOverflow:x,type:S,size:k,noPadding:M,className:L,children:z})=>{const{t:D}=c(),O=h(null),T=h(null),R=v((()=>{O.current?.classList.add("closing"),setTimeout(o,200)}),[O,o]);return(({isOpen:e,onClose:l,submit:t,isDisabled:i})=>{f((()=>{if(e&&!i){const e=e=>{[{key:"Enter",onAction:t.onEnter,disabled:t.isDisabled},{key:"Escape",onAction:l}].forEach((l=>{l.disabled||l.key!==e.key||(e.preventDefault(),e.stopPropagation(),l.onAction())}))};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}}}),[e,t,l,i])})({isOpen:s,isDisabled:C,onClose:R,submit:{onEnter:()=>{p?p.onFormSubmit?T.current?.requestSubmit():(p.onClick?.(),!p.keepOpen&&R()):b?.onClick?b.onClick():R()},isDisabled:!p?.disabled&&!p?.isKeyboardDisabled}}),f((()=>{if(!w){const e=e=>e.target===O.current&&R();return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}}),[w,R]),s?y(d("div",{ref:O,className:"iui-dialog",children:d(Z,{isLoading:!!r,classNameLoader:"dialog-loader",children:d("div",{className:l("iui-dialog-container",k,S,L),children:u(se,{condition:!!p?.onFormSubmit,wrapper:e=>d("form",{ref:T,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),p?.onFormSubmit?.(),!p?.keepOpen&&R()},children:e}),children:[t&&d("h1",{children:t}),i,u("div",{className:l("iui-dialog-content",{padding:!M,"no-overflow":x}),children:[d(se,{condition:!!S,wrapper:e=>d("div",{className:"flex align-center mb-3",children:e}),children:u(m,{children:[S&&d(e,{icon:oe[S],className:"icon"}),a&&d("p",{className:"new-line",children:a}),n]})}),z]}),!N&&u("div",{className:"iui-dialog-actions",children:[d(U,{label:b?.label||D(p?"Cancel":"Close"),icon:b?.icon,solid:!p,onClick:e=>{e.stopPropagation(),b?.onClick?b.onClick():R()}}),g&&d(U,{label:g.label,icon:g.icon,onClick:g.onClick?e=>{e.stopPropagation(),g.onClick(),!g.keepOpen&&R()}:void 0,solid:g.solid,color:g.color,disabled:g.disabled}),p&&d(U,{label:p.label||"Potvrdi",icon:p.icon,solid:!0,onClick:p.onClick?e=>{e.stopPropagation(),p.onClick(),!p.keepOpen&&R()}:void 0,color:"error"===S?"error":void 0,disabled:p.disabled})]})]})})})}),W):null},re={prefix:"fal",iconName:"trash-can",icon:[448,512,[],"f2ed","M432 64h-96l-33.63-44.75C293.4 7.125 279.1 0 264 0h-80C168.9 0 154.6 7.125 145.6 19.25L112 64h-96C7.201 64 0 71.2 0 80c0 8.799 7.201 16 16 16h416c8.801 0 16-7.201 16-16C448 71.2 440.8 64 432 64zM152 64l19.25-25.62C174.3 34.38 179 32 184 32h80c5 0 9.75 2.375 12.75 6.375L296 64H152zM400 128C391.2 128 384 135.2 384 144v288c0 26.47-21.53 48-48 48h-224C85.53 480 64 458.5 64 432v-288C64 135.2 56.84 128 48 128S32 135.2 32 144v288C32 476.1 67.89 512 112 512h224c44.11 0 80-35.89 80-80v-288C416 135.2 408.8 128 400 128zM144 416V192c0-8.844-7.156-16-16-16S112 183.2 112 192v224c0 8.844 7.156 16 16 16S144 424.8 144 416zM240 416V192c0-8.844-7.156-16-16-16S208 183.2 208 192v224c0 8.844 7.156 16 16 16S240 424.8 240 416zM336 416V192c0-8.844-7.156-16-16-16S304 183.2 304 192v224c0 8.844 7.156 16 16 16S336 424.8 336 416z"]},de=({textId:e,itemUuid:l,setItemUuid:t,reloadItems:i,deleteItemFunction:a})=>{const[n,s]=p(!1),{t:o}=c();return d(ce,{isOpen:!!l,onClose:()=>t(""),title:o(`Delete${e}Title`),desc:o(`Delete${e}Desc`),isLoading:n,type:"info",confirmButton:{label:o("Delete"),icon:re,keepOpen:!0,onClick:()=>{s(!0),a(l).then((()=>{i(),t("")})).catch((()=>{})).finally((()=>s(!1)))}}})},ue=b((({label:e,value:t=!1,setValue:i,required:a,disabled:n,className:s,tooltip:o,children:c},r)=>d(Y,{label:o||"",children:u("label",{ref:r,className:l("iui-checkbox",s,{disabled:n}),children:[d("input",{required:a,disabled:n,type:"checkbox",checked:t&&"middle"!==t,onChange:()=>i(!t)}),d("svg",{className:l("icon",{selected:t&&"middle"!==t}),focusable:"false",viewBox:"0 0 448 512","aria-hidden":"true",children:d("path","middle"===t?{d:"M64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM152 232H296c13.3 0 24 10.7 24 24s-10.7 24-24 24H152c-13.3 0-24-10.7-24-24s10.7-24 24-24z"}:t?{d:"M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}:{d:"M384 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H384zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"})}),e?d("p",{children:e}):c]})}))),me=({label:e,shrink:t,focus:i,required:a,className:n,minWidth:s,helperText:o,errorText:c,error:r,children:p})=>u("div",{className:l("iui-input-container",n,{error:r}),style:{minWidth:s},children:[u("fieldset",{className:l({shrink:t,focus:i}),children:[!!e&&u(m,{children:[d("label",{children:a?`${e} *`:e}),d("legend",{children:a?`${e} *`:e})]}),p]}),r?c&&d("p",{className:"helper-text new-line",children:c}):o&&d("p",{className:"helper-text new-line",children:o})]}),pe=b((({id:t,label:i,value:a,setValue:n,required:s,disabled:o,autoFocus:c,placeholder:r,helperText:m,errorText:h,className:f,inputProps:b,onBlur:g,onFocus:C,error:v,endText:N,endButton:w},x)=>{const[y,S]=p(!1),[k,M]=p(!1);return d(me,{label:i,shrink:!!(a||r||k),focus:y,required:s,helperText:m,errorText:h,error:v??!(!b?.pattern||!a||new RegExp(b.pattern).test(a)),className:f,children:u("div",{className:l("flex align-center",{"with-end-button":w,disabled:o}),children:[d("input",{id:t,ref:x,autoFocus:c,onFocus:e=>{S(!0),k&&M(!1),C?.(e)},onBlur:e=>{S(!1),g?.(e)},placeholder:r,value:a??"",onChange:n?e=>n(e.target.value):void 0,required:s,disabled:o,onAnimationStart:()=>M(!0),...b}),N&&d("p",{className:"ml-n2 mr-2",children:N}),w&&d(e,{className:w.disabled?"disabled":void 0,icon:w.icon,onClick:w.disabled?void 0:w.onClick})]})})})),he=e=>{if(!e)return"";const l=e.toString();let[t,i]=l.split(".");const a=t.replace(/\B(?=(\d{3})+(?!\d))/g,".");return i?`${a},${i}`:l.endsWith(".")?`${a},`:a},fe=b((({value:e,setValue:l,label:t,required:i,disabled:a,autoFocus:n,placeholder:s,helperText:o,errorText:c,error:r,className:u,allowNegative:m,decimalPlaces:h=2,alignLeft:f,endText:b,inputProps:g},C)=>{const[v,N]=p(""),w=document.activeElement;return d(pe,{ref:C,value:he(e),setValue:e=>{const t=w.selectionStart;let i=h?e.replace(/\.$/,",").replaceAll(".","").replace(",","."):e.replaceAll(".","");if(new RegExp(`^${m?"-?":""}\\d*${h?`(?:[.,])?(\\d{1,${h}})?`:""}$`).test(i)||!e){const e=he(i);N(e),l(i),setTimeout((()=>{const l=e.length-v.length>1?t+1:t;w.setSelectionRange&&w.setSelectionRange(l,l)}))}},label:t,required:i,disabled:a,placeholder:s||(h?`0,${"0".repeat(h)}`:"0"),inputProps:{className:f?void 0:"text-right",inputMode:"numeric",...g},className:u,autoFocus:n,helperText:o,errorText:c,endText:b,error:r})})),be={prefix:"far",iconName:"calendar",icon:[448,512,[],"f133","M152 64H296V24C296 10.75 306.7 0 320 0C333.3 0 344 10.75 344 24V64H384C419.3 64 448 92.65 448 128V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V128C0 92.65 28.65 64 64 64H104V24C104 10.75 114.7 0 128 0C141.3 0 152 10.75 152 24V64zM48 448C48 456.8 55.16 464 64 464H384C392.8 464 400 456.8 400 448V192H48V448z"]},ge={prefix:"fas",iconName:"xmark",icon:[320,512,[],"f00d","M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"]},Ce=e=>e?k(e).format("DD.MM.YYYY."):"/",ve=e=>k(e).format("yyyy-MM-DD"),Ne=(e,l)=>e?k(e).format("DD.MM.YYYY. HH:mm"+(l?":ss":"")):"/",we=(e,l)=>e?k(e).format("HH:mm"+(l?":ss":"")):"/",xe=(e,l)=>k(e).add(l,"days").toISOString(),ye=e=>!!e&&k(new Date)>k(e),Se=()=>k().format("DD.MM.YYYY.").toString(),ke=()=>k().format("yyyy-MM-DD").toString(),Me=e=>k(e).diff(new Date,"days"),Le=(e,l)=>`${e}-${l<10?`0${l}`:l}`,ze=({isOpen:e,onClose:t,renderButton:i,placementX:a,placementY:n="auto",size:s,className:o,children:c})=>{const r=h(null),b=h(null),g=h(null),[C,N]=p({offsetLeft:0,offsetTop:0}),[w,x]=p(),S=v((()=>{if(g.current&&r.current){const e=g.current.getBoundingClientRect(),l=r.current.getBoundingClientRect();let t=e.bottom+5;const i=e.left+("right"===a?e.width-l.width:0);"bottom"===n&&x(window.innerHeight-e.bottom-20),"top"===n&&x(window.innerHeight-e.top+40),("auto"===n&&t+l.height>window.innerHeight||"top"===n)&&(t=e.top-l.height-5),N({offsetTop:t,offsetLeft:i})}}),[r,g,a,n]);return f((()=>(e?window.addEventListener("resize",S):window.removeEventListener("resize",S),document.body.style.marginRight=e&&window.innerWidth>document.body.clientWidth?"19px":"",document.body.style.overflow=e?"hidden":"",S(),()=>{window.removeEventListener("resize",S)})),[e,S]),f((()=>{const l=b.current,i=e=>e.target===l&&t();return e?l?.addEventListener("click",i):l?.removeEventListener("click",i),()=>l?.removeEventListener("click",i)}),[e,t]),u(m,{children:[i(g),e?y(d("div",{ref:b,className:"portal-background",children:d("div",{ref:r,className:l("iui-menu",o,s),style:{top:C.offsetTop+"px",left:C.offsetLeft+"px",maxHeight:w||void 0},children:c})}),W):null]})},De={day:{placeholder:"dd",regex:"^[0-9]{2}"},month:{placeholder:"mm",regex:"^[0-9]{2}"},year:{placeholder:"yyyy",regex:"^[0-9]{4}"}},Oe=b((({value:e,setValue:t,setDate:i,values:a,required:n,disabled:s,autoFocus:o,min:c=1,max:r,part:u,previousInput:m,nextInput:b,setFocus:g},C)=>{const[v,N]=p(!1),w=h(null);f((()=>{"year"===u&&4!==e.length||+e>r||+e<c?N(!0):v&&N(!1)}),[u,c,r,e,v]);const x=`^[0-9]{0,${r.toString().length}}$`;return d("input",{ref:C||w,value:e||"",onChange:e=>(e=>{if(e){if(new RegExp(x).test(e)){t(e);const l="year"===u?e:a.year,n="month"===u?e:a.month,s="day"===u?e:a.day;s&&n&&4===l.length&&i(`${l}-${2===n.length?n:`0${n}`}-${2===s.length?s:`0${s}`}`)}}else t("")})(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:e=>{"ArrowLeft"===e.key?(e.preventDefault(),m?.select()):"ArrowRight"===e.key&&(e.preventDefault(),b?.select())},onKeyUp:l=>{"year"!==u&&isFinite(+l.key)&&2===e.length&&b?.select()},onFocus:e=>{g(!0),e.target.select()},onBlur:()=>g(!1),required:n,disabled:s,autoFocus:o,min:c,max:r,inputMode:"numeric",type:"number",tabIndex:"day"!==u?-1:void 0,placeholder:De[u].placeholder,pattern:De[u].regex,className:l({error:v}),style:{width:"year"!==u||e?"month"!==u||e?`${e.length||2}ch`:23:"4ch"}})})),Te=b((({label:i,date:a,setDate:n,required:s,disabled:o,autoFocus:c,helperText:r,error:m,className:b,calendarPlacementX:g},C)=>{const[v,N]=p(a?.split("-")[2]??""),[w,x]=p(a?.split("-")[1]??""),[y,k]=p(a?.split("-")[0]??""),[M,L]=p(!1),[z,D]=p(!1),O=h(null),T=h(null),R=h(null),$=h(null),I=y&&w?new Date(+y,+w,0).getDate():31;return f((()=>{a?[T.current,R.current,$.current].includes(document.activeElement)||(k(a.split("-")[0]??""),x(a.split("-")[1]??""),N(a.split("-")[2]??"")):(k(""),x(""),N(""))}),[a]),d(me,{label:i,shrink:!0,focus:z??M,required:s,helperText:r,className:b,error:m,children:d(ze,{isOpen:M,onClose:()=>L(!1),placementX:g||"left",renderButton:t=>u("div",{ref:t,className:l("date-input",{disabled:o}),children:[u("div",{ref:O,className:"inputs",onClick:()=>T.current?.focus(),children:[d(Oe,{ref:T,value:v,setValue:N,setDate:n,values:{day:v,month:w,year:y},required:s||!!w||!!y,disabled:o,autoFocus:c,max:I,part:"day",nextInput:R.current,setFocus:D}),d("span",{children:"."}),d(Oe,{ref:R,value:w,setValue:x,setDate:n,values:{day:v,month:w,year:y},required:s||!!v||!!y,disabled:o,max:12,part:"month",previousInput:T.current,nextInput:$.current,setFocus:D}),d("span",{children:"."}),d(Oe,{ref:$,value:y,setValue:k,setDate:n,values:{day:v,month:w,year:y},required:s||!!v||!!w,disabled:o,min:1500,max:2500,part:"year",previousInput:R.current,setFocus:D})]}),u("div",{className:"flex",children:[d("div",{className:l("button",{disabled:o}),onClick:()=>!o&&n(""),children:d(e,{icon:ge})}),d("div",{className:l("button",{disabled:o}),onClick:()=>!o&&L(!M),children:d(e,{icon:be})})]})]}),children:d(S,{value:a?t(a).isValid()?new Date(a):new Date:null,onChange:e=>{const l=ve(e);n(l),L(!1)}})})})})),Re=({time:e="00:00",setTime:t,label:i,disabled:a,required:n,className:s})=>{const[o,c]=e.split(":").map((e=>e.padStart(2,"0"))),r=(e,l)=>{let i=isNaN(+e)||"-1"===e?"00":e.replace(/\D/g,"");if(i.length>2&&(i=i.substring(1)),"hh"===l){const e=Math.min(23,parseInt(i)||0).toString().padStart(2,"0");t(`${e}:${c}`)}else{const e=Math.min(59,parseInt(i)||0).toString().padStart(2,"0");t(`${o}:${e}`)}};return d(me,{label:i,shrink:!0,required:n,className:l(s,"time-input-wrapper"),children:u("div",{className:l("time-input",{disabled:a}),children:[d("input",{type:"number",value:o,onChange:e=>r(e.target.value,"hh"),onClick:e=>{e.target.select()},disabled:a,required:n,style:{textAlign:"right"}}),d("span",{className:"fs-m",children:":"}),d("input",{type:"number",value:c,onChange:e=>r(e.target.value,"mm"),onClick:e=>{e.target.select()},disabled:a,required:n})]})})},$e=b((({label:e,value:l,setValue:t,required:i,disabled:a,autoFocus:n,rows:s,placeholder:o,helperText:c,errorText:r,className:u,inputProps:m,error:h},f)=>{const[b,g]=p(!1),[C,v]=p(!1);return d(me,{label:e,shrink:!!(l||o||C),focus:b,required:i,helperText:c,errorText:r,className:u,error:h,children:d("textarea",{ref:f,autoFocus:n,onFocus:()=>{g(!0),C&&v(!1)},onBlur:()=>g(!1),placeholder:i&&o?`${o} *`:o,value:l||"",onChange:e=>t(e.target.value),rows:s,required:i,disabled:a,onAnimationStart:()=>v(!0),...m})})})),Ie=b((({value:e,setValue:t,label:i,required:a,disabled:n,autoFocus:s,placeholder:o,helperText:c,errorText:r,error:u,className:m,allowNegative:p,decimalPlaces:h,align:f,endText:b,inputProps:g},C)=>d(pe,{ref:C,value:e?`${e}`.replaceAll(".",","):"",setValue:e=>{h?(new RegExp(`^${p?"-?":""}\\d*(?:[.,])?(\\d{1,${h}})?$`).test(e)||!e)&&t(e?e.replaceAll(",","."):e):(new RegExp(`^${p?"-?":""}\\d*$`).test(e)||!e)&&t(e)},label:i,required:a,disabled:n,placeholder:o||(h?`0.${"0".repeat(h)}`:"0"),inputProps:{className:l({"text-right":"right"===f}),lang:"sr-RS",inputMode:"numeric",...g},className:m,autoFocus:s,helperText:c,errorText:r,endText:b,error:u}))),Pe={prefix:"fal",iconName:"eye",icon:[576,512,[],"f06e","M288 128C217.3 128 160 185.3 160 256s57.33 128 128 128c70.64 0 128-57.32 128-127.9C416 185.4 358.7 128 288 128zM288 352c-52.93 0-96-43.06-96-96s43.07-96 96-96c52.94 0 96 43.02 96 96.01C384 308.9 340.1 352 288 352zM572.5 238.1C518.3 115.5 410.9 32 288 32S57.69 115.6 3.469 238.1C1.563 243.4 0 251 0 256c0 4.977 1.562 12.6 3.469 17.03C57.72 396.5 165.1 480 288 480s230.3-83.58 284.5-206.1C574.4 268.6 576 260.1 576 256C576 251 574.4 243.4 572.5 238.1zM543.2 260.2C492.3 376 394.5 448 288 448c-106.5 0-204.3-71.98-255-187.3C32.58 259.6 32.05 256.9 31.1 256.2c.0547-1.146 .5859-3.783 .7695-4.363C83.68 135.1 181.5 64 288 64c106.5 0 204.3 71.98 255 187.3c.3945 1.08 .9238 3.713 .9785 4.443C543.9 256.9 543.4 259.6 543.2 260.2z"]},Ae={prefix:"fal",iconName:"eye-slash",icon:[640,512,[],"f070","M272.9 137.2l30.91 24.41c5.301-.9102 10.67-1.638 16.23-1.638c50.78 0 92.05 39.74 95.36 89.74l30.82 24.33C447 268.1 448 262.2 448 256.1C448 185.4 390.7 128 320 128C303.3 128 287.5 131.4 272.9 137.2zM320 448c-106.5 0-204.3-71.98-255-187.3C64.58 259.6 64.05 256.9 63.1 256.2c.0547-1.146 .5859-3.783 .7695-4.363c12.84-29.22 28.7-55.61 46.89-78.8l-25.05-19.78c-20.06 25.52-37.34 54.31-51.13 85.71C33.56 243.4 31.1 251 31.1 256c0 4.977 1.562 12.6 3.469 17.03c54.25 123.4 161.6 206.1 284.5 206.1c48.13 0 93.81-12.96 134.9-35.96l-27.74-21.9C393.6 438.7 357.4 448 320 448zM320 64c106.5 0 204.3 71.98 255 187.3c.3945 1.08 .9238 3.713 .9785 4.443c-.0547 1.145-.5859 3.783-.7695 4.361c-12.84 29.22-28.69 55.61-46.88 78.79l25.05 19.78c20.06-25.52 37.33-54.3 51.13-85.7c1.906-4.43 3.469-12.07 3.469-17.03c0-4.977-1.562-12.6-3.469-17.03c-54.25-123.4-161.6-206.1-284.5-206.1c-48.13 0-93.8 12.96-134.9 35.95l27.74 21.9C246.4 73.33 282.6 64 320 64zM320 384c16.68 0 32.56-3.42 47.17-9.229l-30.92-24.41c-5.307 .9121-10.68 1.644-16.25 1.644c-50.8 0-92.09-39.78-95.37-89.76L193.8 237.9C192.1 243.9 192 249.8 192 256C192 326.7 249.3 384 320 384zM633.9 483.4L25.9 3.42C18.1-2.033 8.936-.8301 3.436 6.061c-5.469 6.938-4.281 17 2.656 22.49l608 480C617 510.9 620.5 512 624 512c4.719 0 9.406-2.094 12.56-6.078C642 498.1 640.8 488.9 633.9 483.4z"]},Fe=e=>{const[l,t]=p(!1);return d(pe,{...e,inputProps:{type:l?"text":"password",autoComplete:e.newPassword?"new-password":void 0,...e.inputProps},endButton:{icon:l?Ae:Pe,onClick:()=>t(!l)}})},Ee=b((({label:e,value:t,selected:i,setSelected:a,required:n,groupName:s,disabled:o,className:c,children:r},m)=>u("div",{ref:m,className:l("iui-radio",c,i===t?"selected":"clickable",{disabled:o}),onClick:i!==t?()=>!o&&a(t):void 0,children:[u("div",{className:"iui-radio-icon",children:[d("svg",{className:l("icon",{selected:i===t}),focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true",children:d("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})}),d("svg",{className:l("icon secondary",{selected:i===t}),focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true",children:d("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"})}),n&&!o&&!i&&d("input",{className:"fake-input",type:"radio",name:s,required:!0,tabIndex:-1,onFocus:()=>m.current?.focus()})]}),e?d("p",{children:e}):r]}))),Ve=({title:e,desc:t,value:i,selected:a,setSelected:n,disabled:s,className:o,children:c})=>d(Ee,{value:i,selected:a,setSelected:n,disabled:s,className:l("radio-large",o),children:u("div",{className:"full-width",children:[d("p",{className:"bold mb-3",children:e}),d("p",{children:t}),d("div",{children:c})]})}),Be={prefix:"fal",iconName:"magnifying-glass",icon:[512,512,[],"f002","M507.3 484.7l-141.5-141.5C397 306.8 415.1 259.7 415.1 208c0-114.9-93.13-208-208-208S-.0002 93.13-.0002 208S93.12 416 207.1 416c51.68 0 98.85-18.96 135.2-50.15l141.5 141.5C487.8 510.4 491.9 512 496 512s8.188-1.562 11.31-4.688C513.6 501.1 513.6 490.9 507.3 484.7zM208 384C110.1 384 32 305 32 208S110.1 32 208 32S384 110.1 384 208S305 384 208 384z"]},He=({onSearch:e,className:l})=>{const[t,i]=p(""),{t:a}=c();return d(pe,{className:l,inputProps:{"aria-label":"search",onKeyDown:l=>{"Enter"===l.key&&(l.stopPropagation(),l.preventDefault(),e(l.target.value))}},label:a("Search"),value:t,setValue:i,endButton:{icon:Be,onClick:()=>e(t)}})},je=e=>({control:e=>({...e,border:"none",borderRadius:4,boxShadow:"none",minHeight:36}),valueContainer:(e,l)=>({...e,padding:l.isMulti?"8px 14px":"10px 14px",fontSize:13}),menu:l=>({...l,marginTop:2,width:e||"100%",minWidth:"100%",borderRadius:8,boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0px 3px 14px 2px rgba(0, 0, 0, 0.12);"}),menuPortal:e=>({...e,zIndex:1001}),input:e=>({...e,padding:0,margin:0,borderRadius:4}),option:(e,l)=>({...e,fontSize:13,backgroundColor:l.isSelected?"var(--primary) !important":l.isFocused?"#eee !important":"inherit"}),noOptionsMessage:e=>({...e,fontSize:13,fontStyle:"italic"}),multiValue:e=>({...e,backgroundColor:"var(--primary-o25)"}),placeholder:e=>({...e,whiteSpace:"nowrap"})}),qe=b((({label:e,options:t,value:i,valuesMulti:a,onChange:n,required:s,disabled:o,placeholder:c="",helperText:r,className:m,minWidth:f,menuWidth:b,autoFocus:g,isClearable:C,isOpen:v,onMenuOpen:N,onMenuClose:w,openDirection:x="auto",noOptionsMessage:y,error:S},k)=>{const[L,z]=p(!1),D=h(null);return u(me,{label:e,shrink:!!(i||a?.length||c),focus:L,required:s,helperText:r,className:l("select-wrapper",m),minWidth:f,error:S,children:[d(M,{value:i??a??null,options:t,onChange:n,placeholder:!e&&s?`${c} *`:c,styles:je(b),isDisabled:o,isOptionDisabled:e=>e.disabled,isClearable:C,isMulti:!!a,menuIsOpen:v,menuPlacement:x,menuPortalTarget:document.querySelector("body"),ref:k||D,onFocus:()=>z(!0),onBlur:()=>z(!1),autoFocus:g,noOptionsMessage:()=>y||"Nema opcija",onMenuOpen:N,onMenuClose:w}),s&&!o&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:i?.value??a?.length??"",onChange:()=>{},onFocus:()=>(k??D).current?.focus()})]})})),Ue=b((({label:e,value:t,valuesMulti:i,loadOptions:a,refresh:n,onChange:s,required:o,disabled:c,placeholder:r="",helperText:m,className:f,minWidth:b,menuWidth:g,autoFocus:C,isMulti:v,isClearable:N,isOpen:w,onMenuOpen:x,onMenuClose:y,openDirection:S="auto",noOptionsMessage:k,error:M},z)=>{const[D,O]=p(!1),T=h(null);return u(me,{label:e,shrink:!!(t||i?.length||r),focus:D,required:o,helperText:m,className:l("select-wrapper",f),minWidth:b,error:M,children:[d(L,{value:t||i||null,loadOptions:a,additional:{page:0},onChange:s,placeholder:!e&&o?`${r} *`:r,styles:je(g),isDisabled:c,isOptionDisabled:e=>e.disabled,isClearable:N,isMulti:v,menuIsOpen:w,menuPlacement:S,menuPortalTarget:document.querySelector("body"),selectRef:z||T,onFocus:()=>O(!0),onBlur:()=>O(!1),autoFocus:C,noOptionsMessage:()=>k||"Nema opcija",cacheUniqs:n||void 0,onMenuOpen:x,onMenuClose:y}),o&&!c&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:t?.value||i?.length||"",onChange:()=>{},onFocus:()=>(z||T).current?.focus()})]})})),We=b((({label:e,value:t,valuesMulti:i,loadOptions:a,refresh:n,onChange:s,onCreate:o,required:r,disabled:m,placeholder:f="",helperText:b,className:g,minWidth:C,menuWidth:v,autoFocus:N,isMulti:w,isClearable:x,isOpen:y,onMenuOpen:S,onMenuClose:k,openDirection:M="auto",noOptionsMessage:L,error:D,defaultData:O,formatOptionLabel:T},R)=>{const[$,I]=p(!1),P=h(null),{t:A}=c();return u(me,{label:e,shrink:!!(t||i?.length||f),focus:$,required:r,helperText:b,className:l("select-wrapper",g),minWidth:C,error:D,children:[d(z,{ref:R||P,required:r,value:t||i||null,loadOptions:a,onChange:s,placeholder:!e&&r?`${f} *`:f,styles:je(v),isDisabled:m,isOptionDisabled:e=>e.disabled,isClearable:x,isMulti:w,menuIsOpen:y,onMenuOpen:S,onMenuClose:k,menuPlacement:M,menuPortalTarget:document.querySelector("body"),onFocus:()=>I(!0),onBlur:()=>I(!1),autoFocus:N,noOptionsMessage:()=>L||"Nema opcija",cacheOptions:n||null,defaultOptions:O||!0,onCreateOption:o,formatOptionLabel:T,formatCreateLabel:e=>d("p",{children:`${A("FreeText")} "${e}"`})}),r&&!m&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:t?.value||t?.label||i?.length||"",onChange:()=>{},onFocus:()=>(R||P).current?.focus()})]})})),Ye=b((({label:t,icon:i,iconRotation:a,onClick:n,to:s,disabled:o,withDevider:c,className:r,children:m},p)=>d("div",{ref:p,className:l("iui-menu-item",r,{clickable:!!n||!!s,disabled:o,"with-devider":c}),onClick:o?void 0:n,children:d(se,{condition:!o&&!!s,wrapper:e=>d(Link,{to:s,children:e}),children:u("div",{className:"flex align-center",children:[i&&d(e,{icon:i,rotation:a,className:"mr-2"}),t&&d("p",{className:"full-width",children:t}),m]})},t)}))),Xe={prefix:"fal",iconName:"ellipsis-vertical",icon:[128,512,[],"f142","M64 384C81.67 384 96 398.3 96 416C96 433.7 81.67 448 64 448C46.33 448 32 433.7 32 416C32 398.3 46.33 384 64 384zM64 224C81.67 224 96 238.3 96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224zM64 128C46.33 128 32 113.7 32 96C32 78.33 46.33 64 64 64C81.67 64 96 78.33 96 96C96 113.7 81.67 128 64 128z"]},Je=({item:e,setSelectedItem:l,setItemToDeleteUuid:t,actions:i})=>{const[a,n]=p(!1),{t:s}=c();return u(ze,{isOpen:a,onClose:()=>n(!1),placementX:"right",renderButton:e=>d(J,{ref:e,icon:Xe,active:a,onClick:e=>{e.stopPropagation(),n(!a)}}),children:[!!l&&d(Ye,{onClick:t=>{t.stopPropagation(),l(e),n(!1)},children:d("p",{children:s("Edit")})}),i?.map((l=>!l.hidden&&d(Ye,{disabled:!!l.disabled,onClick:t=>{t.stopPropagation(),l.onClick(e.uuid),n(!1)},children:d("p",{children:l.label})},l.label))),!!t&&d(Ye,{onClick:l=>{l.stopPropagation(),t(e.uuid),n(!1)},children:d("p",{children:s("Delete")})})]})},Ke={prefix:"fal",iconName:"check",icon:[512,512,[],"f00c","M475.3 123.3l-272 272C200.2 398.4 196.1 400 192 400s-8.188-1.562-11.31-4.688l-144-144c-6.25-6.25-6.25-16.38 0-22.62s16.38-6.25 22.62 0L192 361.4l260.7-260.7c6.25-6.25 16.38-6.25 22.62 0S481.6 117.1 475.3 123.3z"]},Ze={prefix:"fal",iconName:"xmark",icon:[320,512,[],"f00d","M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z"]},Ge=({setData:e,clearItem:l,inputFocusRef:t,defaultDataValue:i})=>u("div",{className:"flex center gap-1",children:[d(J,{icon:Ke,className:"p-1"}),d(J,{icon:Ze,className:"p-1",onClick:()=>{e(i||{}),t?.current?.focus(),l()}})]}),_e=({columns:e,defaultDataValue:l,data:t,setData:i,item:a,clearItem:n,inputFocusRef:s})=>{f((()=>{s?.current?.focus(),i(a??l??{})}),[a,l,s,i]);let o={...t,actions:{value:d(Ge,{setData:i,clearItem:n,defaultDataValue:l,inputFocusRef:s})}};Object.keys(o).forEach((e=>{N(o[e].value)&&(o[e].className="p-1")}));const c={uuid:a?.uuid,cells:o};return d("tr",{"data-id":c.uuid,className:"edit-row",children:e.map((e=>!e.hidden&&d("td",{align:e.align,colSpan:c.cells[e.id]?.span,className:c.cells[e.id]?.className,children:c.cells[e.id]?.value},e.id)))})},Qe=({item:e})=>{const{t:l}=c();return u("div",{className:"table-filter-item",children:[u("p",{className:"label",children:["⁠",e.label]}),d("div",{className:"field",children:e.field}),d(U,{label:l("Delete"),onClick:()=>e.resetField(),size:"m"})]},e.label)},el={prefix:"far",iconName:"filter-circle-xmark",icon:[576,512,[],"e17b","M432 224C352.5 224 288 288.5 288 368s64.47 144 144 144s144-64.47 144-144S511.5 224 432 224zM488.5 401.9c6.242 6.242 6.252 16.37 .0098 22.62c-6.24 6.242-16.37 6.231-22.62-.0113l-33.91-33.91l-33.91 33.91c-6.242 6.242-16.37 6.253-22.62 .0106s-6.232-16.37 .0098-22.62l33.91-33.91l-33.91-33.91c-6.242-6.242-6.251-16.37-.009-22.62s16.37-6.232 22.62 .0106l33.91 33.91l33.91-33.91c6.242-6.242 16.37-6.254 22.61-.0113s6.233 16.37-.009 22.62l-33.91 33.91L488.5 401.9zM223.1 340.7V272.2c0-7.369-2.539-14.51-7.191-20.22L50.77 48.04h410.4l-85.57 105.1c-7.77 9.545-7.061 23.42 1.643 32.13c10.06 10.06 26.62 9.219 35.6-1.812l88.61-108.8c11.26-13.46 13.7-31.89 6.225-47.92C500 10.23 483.8 0 465.3 0H46.65C28.21 0 11.97 10.23 4.283 26.71C-3.195 42.73-.7578 61.16 10.64 74.79l165.4 203.1v67.71c0 12.55 6.178 24.3 16.52 31.45l24.81 19.15C233.1 408.4 256 397.2 256 377.2c0-7.439-3.449-14.46-9.34-19L223.1 340.7z"]},ll={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[],"f002","M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"]},tl=(e,l)=>{const t={...e};return l.forEach((e=>delete t[e])),t},il=(e,l)=>{const t={...e};for(const e in t)e.endsWith(l)&&delete t[e];return t},al=e=>Object.entries(e).reduce(((e,[l,t])=>([null,void 0,""].includes(t)||(e[l]=t),e)),{}),nl=e=>Object.entries(e).reduce(((e,[l,t])=>([null,void 0,""].includes(t)||Array.isArray(t)&&!t.length||(e[l]=t),e)),{}),sl=e=>Object.keys(e).filter((l=>e[l])),ol=e=>e?e.reduce(((e,l)=>({...e,[l]:!0})),{}):{},cl=e=>JSON.parse(JSON.stringify(e)),rl=(e,l)=>JSON.stringify(e)===JSON.stringify(l),dl=(e,l,t,i)=>{const a=e.indexOf(l),n=e.indexOf(i);return a>=0&&n>=0&&("greaterThan"===t?a>n:"greaterThanOrEqualTo"===t?a>=n:"lessThan"===t?a<n:a<=n)},ul=(e,l)=>{const t=new Set(l);return e.filter((e=>t.has(e)))},ml=({columns:e,filters:l,additionalFilters:t,excludeFromSearch:i,searchData:a,setSearchData:n,onSubmit:s,resetData:o,isOpen:r,onClose:m})=>{const[h,f]=p(""),{t:b}=c(),g=w((()=>e.reduce(((e,t)=>l[t]?e.concat(l[t]):e),[])),[e,l]),C=w((()=>g.filter((e=>e?.label.toLowerCase().includes(h.toLowerCase())))),[g,h]);return u(ce,{className:"iui-table-filter",titleEl:u("div",{className:"filters-search",children:[d("h1",{children:b("Filter")}),d(He,{onSearch:f,className:"search-input"})]}),isOpen:r,onClose:()=>{f(""),m()},cancelButton:{icon:ge},additionalButton:{label:b("ResetFilter"),icon:el,onClick:()=>{n(o||{}),s(o||{})},disabled:o?JSON.stringify(a)===JSON.stringify(o):0===Object.keys(a).length},confirmButton:{label:b("Search"),icon:ll,onFormSubmit:()=>{const e=nl(a);s(i?tl(e,i):e)}},children:[C?.map((e=>d(Qe,{item:e},e.label))),t&&d("div",{className:"pb-1",children:t})]})},pl={prefix:"fas",iconName:"angle-left",icon:[256,512,[],"f104","M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"]},hl={prefix:"fas",iconName:"angle-right",icon:[256,512,[],"f105","M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"]},fl={prefix:"fas",iconName:"rotate-right",icon:[512,512,[],"f2f9","M468.9 32.11c13.87 0 27.18 10.77 27.18 27.04v145.9c0 10.59-8.584 19.17-19.17 19.17h-145.7c-16.28 0-27.06-13.32-27.06-27.2c0-6.634 2.461-13.4 7.96-18.9l45.12-45.14c-28.22-23.14-63.85-36.64-101.3-36.64c-88.09 0-159.8 71.69-159.8 159.8S167.8 415.9 255.9 415.9c73.14 0 89.44-38.31 115.1-38.31c18.48 0 31.97 15.04 31.97 31.96c0 35.04-81.59 70.41-147 70.41c-123.4 0-223.9-100.5-223.9-223.9S132.6 32.44 256 32.44c54.6 0 106.2 20.39 146.4 55.26l47.6-47.63C455.5 34.57 462.3 32.11 468.9 32.11z"]},bl=({pagination:{limit:e,offset:l,setLimit:t,setOffset:i,totalRows:a},noTotalRows:n,dataLength:s,footerAction:o,customLimit:r})=>{const{t:m}=c(),p=Math.ceil(a/e);return u("div",{className:"table-footer "+(o?"justify-between":"justify-right"),children:[!!o&&d(J,{icon:o.icon||fl,onClick:o.onClick}),u("div",{className:"pagination",children:[u("div",{className:"flex align-center",children:[d("p",{children:m("rowsPerPage")}),d("select",{value:e,onChange:e=>{const l=Math.floor(+e.target.value);t(l),i(0)},children:(r||D).map((e=>d("option",{value:e,children:e||m("allResults")},e)))}),!n&&d("p",{className:"mr-4",children:e?`${l*e+1}-${l*e+e<=a?l*e+e:a} ${m("of")} ${a}`:`${m("allResults")} ${m("of")} ${a} `})]}),u("div",{className:"flex gap-1 align-center",children:[d("p",n?{children:`${m("page")}: ${l+1}`}:{children:`${m("page")}: ${l+1}/${p}`}),d(J,{disabled:l<1,icon:pl,onClick:()=>i(l-1),size:"s"}),!n&&d("input",{className:"offset-input",placeholder:`1-${p}`,onKeyUp:e=>{if("Enter"===e.key){const l=+e.target.value;"number"==typeof l&&l>=0&&l<=p&&i(l-1),e.target.value=""}}}),d(J,{disabled:n?e>s:l+1>=p,icon:hl,onClick:()=>i(l+1),size:"s"})]})]})]})},gl=({row:e,printTable:l})=>d("tr",{children:e.map((e=>d("th",{colSpan:e.colSpan,rowSpan:e.rowSpan,className:e.color,style:e.minWidth?{minWidth:e.minWidth}:e.width?{width:e.width}:void 0,hidden:e.hidden,children:u("div",{className:"flex align-center",children:["string"==typeof e.label?d("p",{className:`full-width p-3 text-${e.align||"left"}`,children:e.label}):d("div",{className:`full-width px-3 text-${e.align||"left"}`,children:e.label}),!l&&d("div",{className:"vertical-separator"})]})},e.id)))}),Cl=({columns:e,customHeader:t,headerWrap:i,printTable:a,sticky:n})=>d("thead",{className:l({"no-wrap":!i,"sticky-header":n}),children:t?t?.map(((e,l)=>d(gl,{row:e,printTable:a},l))):d(gl,{row:e,printTable:a})}),vl={prefix:"fas",iconName:"print",icon:[512,512,[],"f02f","M448 192H64C28.65 192 0 220.7 0 256v96c0 17.67 14.33 32 32 32h32v96c0 17.67 14.33 32 32 32h320c17.67 0 32-14.33 32-32v-96h32c17.67 0 32-14.33 32-32V256C512 220.7 483.3 192 448 192zM384 448H128v-96h256V448zM432 296c-13.25 0-24-10.75-24-24c0-13.27 10.75-24 24-24s24 10.73 24 24C456 285.3 445.3 296 432 296zM128 64h229.5L384 90.51V160h64V77.25c0-8.484-3.375-16.62-9.375-22.62l-45.25-45.25C387.4 3.375 379.2 0 370.8 0H96C78.34 0 64 14.33 64 32v128h64V64z"]},Nl=e=>Object.keys(e).length,wl=(e,l)=>e.reduce(((e,t)=>t.hidden||t.unavailable||l&&["select","icons","actions"].includes(t.id)?e:e.concat(t.id)),[]),xl=e=>e.reduce(((e,l)=>l.hidden||l.unavailable?e:e.concat(l.id)),[]),yl=e=>Object.entries(e).map((e=>"object"==typeof e[1]?Array.isArray(e[1])?{filter:e[0],type:"ARRAY",value:JSON.stringify(e[1])}:{filter:e[0],type:"OBJECT",value:e[1].value,name:e[1].label}:{filter:e[0],type:"boolean"==typeof e[1]?"BOOLEAN":"STRING",value:e[1]})).filter((e=>![null,void 0,""].includes(e.value))),Sl=e=>{let l={};return e?.forEach((e=>{l[e.filter]="OBJECT"===e.type?{value:e.value,label:e.name}:"ARRAY"===e.type?JSON.parse(e.value):"BOOLEAN"===e.type?"true"===e.value:e.value})),l},kl=({template:e,columnsData:l,setFilters:t,setSort:i})=>{const a=e.filterValues&&Sl(e.filterValues);var n,s;a&&t&&t(a),e.columns&&l?.setColumns((n=l.columns,s=e.columns,n.map((e=>s.includes(e.id)?{...e,hidden:!1}:{...e,hidden:!0})).sort(((e,l)=>s.indexOf(e.id)<s.indexOf(l.id)?-1:1)))),e.sorts&&i&&i(e.sorts[0])},Ml=e=>{const l=document.querySelector(`[data-id="${e}"]`);if(!l)return;const t=l?.closest(".table-container"),i=t.querySelector("thead")?.getBoundingClientRect().height||0,a=l.offsetTop,n=Math.max(0,a-i);t.scrollTo({top:n,behavior:"smooth"})},Ll={prefix:"far",iconName:"file-arrow-down",icon:[384,512,[],"f56d","M216 342.1V240c0-13.25-10.75-24-24-24S168 226.8 168 240v102.1L128.1 303C124.3 298.3 118.2 296 112 296S99.72 298.3 95.03 303c-9.375 9.375-9.375 24.56 0 33.94l80 80c9.375 9.375 24.56 9.375 33.94 0l80-80c9.375-9.375 9.375-24.56 0-33.94s-24.56-9.375-33.94 0L216 342.1zM365.3 93.38l-74.63-74.64C278.6 6.742 262.3 0 245.4 0H64C28.65 0 0 28.65 0 64l.0065 384c0 35.34 28.65 64 64 64H320c35.2 0 64-28.8 64-64V138.6C384 121.7 377.3 105.4 365.3 93.38zM336 448c0 8.836-7.164 16-16 16H64.02c-8.838 0-16-7.164-16-16L48 64.13c0-8.836 7.164-16 16-16h160L224 128c0 17.67 14.33 32 32 32h79.1V448z"]},zl=()=>{f((()=>{const e=window.zE??null;if(e)return e.hide(),()=>e.show()}),[])},Dl=({isOpen:e,onClose:t,columns:i,excludeColumnIds:a=[],customHeader:n,organization:s,filters:o,label:r,optionalNode:h,getPrintData:b,formatPrintData:g,saveXlsx:C,totals:v})=>{const[N,w]=p([]),[x,S]=p(0),[k,M]=p(!1),{t:L}=c();zl();const z=i.filter((e=>!["actions","select",...a].includes(e.id)));return f((()=>(W?.classList.add("hidden"),()=>{W?.classList.remove("hidden")})),[]),f((()=>{M(!0),b({limit:1e3,offset:x}).then((e=>{w((l=>{const t=e.data.length?g(e.data):[],i=[...l,...t];return e.totalRows&&e.totalRows>i.length?S(x+1):M(!1),e.totalRows&&e.totalRows>l.length?i:l}))})).catch((()=>M(!1)))}),[x,g,b]),e?y(u("div",{className:"iui-print-dialog",children:[u("div",{className:"content",children:[u("div",{className:"flex justify-between",children:[s?u("div",{children:[d("p",{className:"name",children:s.name}),s.taxId&&d("p",{children:`${L("TaxId")}: ${s.taxId}`}),s.registrationNumber&&d("p",{children:`${L("BusinessCode")}: ${s.registrationNumber}`}),s.jbkjs&&u("p",{children:["JBKJS: ",s.jbkjs]}),s.email&&u("p",{children:["Email: ",s.email]})]}):d("div",{}),d("div",{className:"text-right",children:d("p",{children:`${L("PrintDate")}: ${Se()}`})})]}),d("h4",{className:"my-3 text-center",children:r}),o&&u("div",{className:"flex justify-between",children:[d("div",{children:o.basic?.map((e=>!!e.value&&d("div",{className:"mb-2",children:d("p",{children:`${e.label}: ${e.value}`})},e.value)))}),o.date&&d("div",{children:o.date.map((e=>(!!e.from||!!e.to)&&d("div",{className:"mb-2 text-right",children:u("p",{children:[e.label," ",!!e.from&&`${L("from")} ${Ce(e.from)}`," ",`${L("to")} ${Ce(e.to||(new Date).toString())}`]})},e.label)))})]}),h?.aboveTable,N&&u("table",{width:"100%",className:"print-table",children:[d(Cl,{columns:z,customHeader:n,headerWrap:!0}),d("tbody",{children:u(m,{children:[N.map((e=>{let t=0;return d("tr",{className:e.className,children:z.map((i=>{const a=e.cells[i.id];return t+=a?.span?-1===a.span||a.span>z.length?z.length-t:a.span:1,z.length>=t&&d("td",{align:a?.align||i.align,className:l(i.color,a?.className,{"word-break":i.break}),colSpan:-1===a?.span?z.length:a?.span,children:a?.printValue??a?.value},i.id)}))},e.uuid)})),!!v&&d("tr",{children:z.map((({id:e})=>d("td",{align:v.cells[e]?.align||"right",colSpan:v.cells[e]?.span,className:"py-3",children:d("strong",{children:v.cells[e]?.value})},e)))})]})})]}),h?.bellowTable]}),u("div",{className:"iui-print-actions no-print",children:[d(U,{label:L("Cancel"),icon:ge,onClick:e=>{e.stopPropagation(),t()},className:"mr-3"}),!!C&&d(U,{label:L("SaveXlsx"),icon:Ll,onClick:()=>C(),className:"mr-3"}),d(U,{label:L("Print"),icon:vl,solid:!0,onClick:()=>window.print()})]}),d(G,{isLoading:k})]}),document.body):null},Ol={prefix:"far",iconName:"arrow-right-arrow-left",icon:[512,512,[],"f0ec","M488 344H79.24l74.29-79.63C162.6 254.7 162.1 239.5 152.4 230.5C142.7 221.4 127.5 221.9 118.5 231.6l-112 120c-8.625 9.219-8.625 23.53 0 32.75l112 120C123.2 509.4 129.6 512 136 512c5.875 0 11.75-2.125 16.38-6.469c9.688-9.031 10.22-24.22 1.156-33.91L79.24 392H488c13.25 0 24-10.75 24-24S501.3 344 488 344zM24 168h408.8l-74.29 79.63c-9.062 9.688-8.531 24.88 1.156 33.91c9.656 9.094 24.88 8.562 33.91-1.156l112-120c8.625-9.219 8.625-23.53 0-32.75l-112-120C388.8 2.562 382.4 0 376 0c-5.875 0-11.75 2.125-16.38 6.469c-9.688 9.031-10.22 24.22-1.156 33.91L432.8 120H24C10.75 120 0 130.8 0 144S10.75 168 24 168z"]},Tl={prefix:"fas",iconName:"grip-dots-vertical",icon:[256,512,[],"e411","M0 96C0 69.49 21.49 48 48 48C74.51 48 96 69.49 96 96C96 122.5 74.51 144 48 144C21.49 144 0 122.5 0 96zM0 256C0 229.5 21.49 208 48 208C74.51 208 96 229.5 96 256C96 282.5 74.51 304 48 304C21.49 304 0 282.5 0 256zM96 416C96 442.5 74.51 464 48 464C21.49 464 0 442.5 0 416C0 389.5 21.49 368 48 368C74.51 368 96 389.5 96 416zM160 96C160 69.49 181.5 48 208 48C234.5 48 256 69.49 256 96C256 122.5 234.5 144 208 144C181.5 144 160 122.5 160 96zM256 256C256 282.5 234.5 304 208 304C181.5 304 160 282.5 160 256C160 229.5 181.5 208 208 208C234.5 208 256 229.5 256 256zM160 416C160 389.5 181.5 368 208 368C234.5 368 256 389.5 256 416C256 442.5 234.5 464 208 464C181.5 464 160 442.5 160 416z"]},Rl=({id:l,items:t,search:n})=>{const[s,o]=p([]);return f((()=>{n.length&&o(t.filter((e=>("string"==typeof e.label?e.label:e.labelForFilter??"").toLocaleLowerCase().includes(n.toLocaleLowerCase()))))}),[n,t]),d(i,{droppableId:l,children:({droppableProps:l,innerRef:i,placeholder:o})=>u("div",{...l,ref:i,className:"list-box",children:[(n.length?s:t).map((l=>d(a,{draggableId:l.id,index:t.indexOf(l),children:({innerRef:t,draggableProps:i,dragHandleProps:a})=>u("div",{className:"item",ref:t,...i,...a,style:{...i.style,top:"unset",left:"unset"},children:[l.label,d(e,{icon:Tl})]})},l.id))),o]})})},$l=({columns:l,setColumns:t,isOpen:i,onClose:a,withSearch:s})=>{const[o,r]=p([]),[h,b]=p([]),[g,C]=p(""),[v,N]=p(""),{t:w}=c();f((()=>{if(i){let e=[],t=[];l.forEach((l=>"actions"!==l.id&&!l.unavailable&&(l.hidden?e.push(l):t.push(l)))),r(e),b(t)}}),[i,l]);return d(n,{onDragEnd:({source:e,destination:l})=>{if(!l)return;const t=[...o],i=[...h],a="hidden"===l.droppableId,n="hidden"===e.droppableId?t:i,s=a?t:i,[c]=n.splice(e.index,1);s.splice(l.index,0,c),e.droppableId!==l.droppableId?(s[l.index].hidden=a,r(t),b(i)):a?r(t):b(i)},children:d(ce,{isOpen:i,onClose:a,confirmButton:{label:w("Confirm"),onClick:()=>{const e=[...h,...o],i=l[l.length-1];"actions"===i.id&&e.push(i),t(e),a()}},cancelButton:{label:w("Cancel")},noBackgroundClick:!0,children:u("div",{className:"dual-list-container",children:[d("p",{className:"pb-3",children:w("DragDropListsInfo")}),u("div",{className:"dual-list-content",children:[u("p",{className:"bold ml-2",children:[w("HiddenColumns"),":"]}),d("div",{}),u("p",{className:"bold ml-2",children:[w("SelectedColumns"),":"]}),s&&u(m,{children:[d(He,{onSearch:C}),d("div",{}),d(He,{onSearch:N})]}),d(Rl,{id:"hidden",items:o,search:g}),d("div",{className:"exchange-icon",children:d(e,{icon:Ol})}),d(Rl,{id:"visible",items:h,search:v})]})]})})})},Il={prefix:"fal",iconName:"arrow-down-wide-short",icon:[576,512,[],"f160","M368 432h-64c-8.844 0-15.1 7.156-15.1 16S295.2 464 304 464h64c8.844 0 16-7.156 16-16S376.8 432 368 432zM432 304h-128c-8.844 0-15.1 7.156-15.1 16S295.2 336 304 336h128c8.844 0 16-7.156 16-16S440.8 304 432 304zM496 176h-192c-8.844 0-15.1 7.156-15.1 16S295.2 208 304 208h192C504.8 208 512 200.8 512 192S504.8 176 496 176zM560 48h-256c-8.844 0-15.1 7.156-15.1 16S295.2 80 304 80h256C568.8 80 576 72.84 576 64S568.8 48 560 48zM224 352c-4.094 0-8.188 1.562-11.31 4.688L144 425.4V48C144 39.16 136.8 32 128 32S112 39.16 112 48v377.4l-68.69-68.69c-6.25-6.25-16.38-6.25-22.62 0s-6.25 16.38 0 22.62l96 96c6.25 6.25 16.38 6.25 22.62 0l96-96c6.25-6.25 6.25-16.38 0-22.62C232.2 353.6 228.1 352 224 352z"]},Pl={prefix:"fal",iconName:"arrow-down-short-wide",icon:[576,512,[],"f884","M304 208h128C440.8 208 448 200.8 448 192s-7.156-16-16-16h-128c-8.844 0-15.1 7.156-15.1 16S295.2 208 304 208zM304 336h192c8.844 0 16-7.156 16-16s-7.156-16-16-16h-192c-8.844 0-15.1 7.156-15.1 16S295.2 336 304 336zM304 80h64c8.844 0 16-7.156 16-16S376.8 48 368 48h-64c-8.844 0-15.1 7.156-15.1 16S295.2 80 304 80zM560 432h-256c-8.844 0-15.1 7.156-15.1 16S295.2 464 304 464h256c8.844 0 16-7.156 16-16S568.8 432 560 432zM224 352c-4.094 0-8.188 1.562-11.31 4.688L144 425.4V48C144 39.16 136.8 32 128 32S112 39.16 112 48v377.4l-68.69-68.69c-6.25-6.25-16.38-6.25-22.62 0s-6.25 16.38 0 22.62l96 96c6.25 6.25 16.38 6.25 22.62 0l96-96c6.25-6.25 6.25-16.38 0-22.62C232.2 353.6 228.1 352 224 352z"]},Al=({sortOptions:l,sort:t,setSort:i})=>(c(),d(m,{children:l.map((l=>d(Ye,{className:"menu-item-m",onClick:()=>i(t===l.desc?l.asc:l.desc),children:u("div",{className:"flex center justify-between full-width",children:[d("p",{className:"mr-5 mb-0",children:l.label}),t===l.desc&&d(e,{icon:Il}),t===l.asc&&d(e,{icon:Pl})]})},l.label)))})),Fl={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"]},El=e=>localStorage.getItem(e),Vl=(e,l)=>localStorage.setItem(e,l),Bl=e=>localStorage.removeItem(e),Hl=()=>localStorage.getItem(`${El("activeUser")}-defaultOrg`),jl=e=>localStorage.setItem(`${El("activeUser")}-defaultOrg`,e),ql=()=>localStorage.getItem(`${El("activeUser")}-activeOrg`),Ul=e=>localStorage.setItem(`${El("activeUser")}-activeOrg`,e),Wl=window.location.host.includes("test.inception.rs")||window.location.host.includes("web-bankt.erstebank.rs")||window.location.host.includes("localhost:")?"https://report-templates.api.test.inception.rs":"https://report-templates.api.inception.rs",Yl=e=>axiosInstance.post("/report-template",{...e,organization:{uuid:ql()},subsystem:moduleId},{headers:{baseUrl:Wl}}),Xl=e=>axiosInstance.delete(`/report-templates/${e}`,{headers:{baseUrl:Wl}}),Jl=({identifier:e,onSelect:l})=>{const[t,i]=p(!1),[a,n]=p([]),[s,o]=p(5),[r,h]=p(0),[b,g]=p(0),[C,N]=p({}),[w,x]=p({}),[y,S]=p(!1),[k,M]=p(""),{t:L}=c(),z=[{id:"name",label:L("Name")},{id:"public",label:L("PublicTemplate")},{id:"actions",label:L("Actions"),width:"70px"}],D=v((()=>{t&&(S(!0),((e,l,t)=>axiosInstance.get("/report-templates",{params:{...e,...l,fetchOptions:t,organizationUuid:ql(),subsystem:moduleId},headers:{baseUrl:Wl}}).then((({data:e})=>({templates:e.reportTemplates,totalRows:e.pagination.totalRows}))))({limit:s,offset:r},{identifier:e,...al(C)},["FILTER_VALUES"]).then((({templates:e,totalRows:t})=>{n(e.map((e=>({uuid:e.uuid,onRowClick:()=>{l(e),i(!1)},cells:{name:{value:e.name},public:{value:L(e.isPublic?"Yes":"No")},actions:{value:d(Je,{item:e,setItemToDeleteUuid:()=>M(e.uuid)}),unclickable:!0}}})))),g(t)})).catch((()=>{})).finally((()=>S(!1))))}),[t,s,r,e,C]);return f(D,[D]),u(m,{children:[d(Ye,{label:L("SelectTemplate"),onClick:()=>i(!0)}),d(ce,{title:L("TemplateList"),isOpen:t,onClose:()=>i(!1),size:"l",children:d(st,{columns:z,data:a,isLoading:y,serverSidePagination:{limit:s,offset:r,setLimit:o,setOffset:h,totalRows:b},filterData:{activeFilterNo:Nl(C),columns:wl(z),filters:Kl(w,x,L),search:C,searchData:w,setSearchData:x,onSubmit:e=>{h(0),N(e)}}})}),d(de,{itemUuid:k,setItemUuid:M,textId:"Template",deleteItemFunction:Xl,reloadItems:D})]})},Kl=(e,l,t)=>({name:{label:t("Name"),field:d(pe,{placeholder:t("AddInput")+"...",value:e.nameLike,setValue:t=>l({...e,nameLike:t})}),resetField:()=>l(tl(e,["nameLike"]))},public:{label:t("PublicTemplates"),field:d(qe,{placeholder:t("Choose"),value:void 0!==e.isPublic?{value:e.isPublic,label:t(e.isPublic?"Yes":"No")}:null,options:[{value:!0,label:t("Yes")},{value:!1,label:t("No")}],onChange:t=>l({...e,isPublic:t.value})}),resetField:()=>l(tl(e,["isPublic"]))}}),Zl=({identifier:e,data:{searchData:l,visibleColumns:t,sorts:i},onSubmitCallback:a,allowPublicCreate:n})=>{const[s,o]=p(!1),[r,h]=p({}),[f,b]=p(!1),{t:g}=c();return u(m,{children:[d(Ye,{label:g("CreateTemplateLong"),onClick:()=>o(!0)}),d(ce,{title:g("CreateTemplate"),isOpen:s,onClose:()=>o(!1),size:"l",isLoading:f,confirmButton:{onFormSubmit:()=>{b(!0);const n=al({identifier:e,name:r.name,isPublic:r.isPublic,filterValues:yl(l),columns:t,sorts:i});Yl(n).then((()=>{o(!1),a()})).catch((()=>{})).finally((()=>b(!1)))},keepOpen:!0},children:u("div",{className:"flex column gap-3",children:[d(pe,{label:g("Name"),value:r.name,setValue:e=>h({...r,name:e})}),n&&d(ue,{label:g("PublicTemplate"),value:r.isPublic,setValue:e=>h({...r,isPublic:e})})]})})]})},Gl=(e="",l=30)=>e.length>l?`${e.substring(0,l)}...`:e,_l=(e,l,t)=>t?l===t?e("CharNumber",{number:l}):e("CharRange",{from:l||1,to:t}):l?e("CharMin",{from:l}):void 0,Ql=(e,l)=>`^.{${e||0},${l||""}}$`,et=({identifier:e,data:{searchData:l,visibleColumns:t,sorts:i},onClose:a})=>{const{t:n}=c();return d(Ye,{label:n("CreateDefaultTemplate"),onClick:()=>{(()=>{const a=al({identifier:e,name:e,isPublic:!1,isDefault:!0,filterValues:yl(l),columns:t,sorts:i});Yl(a)})(),a()}})},lt=({isOpen:e,onClose:l,label:t,organization:i,filters:a,content:n,saveXlsx:s})=>{const{t:o}=c();return zl(),f((()=>(W?.classList.add("hidden"),()=>{W?.classList.remove("hidden")})),[]),e?y(u("div",{className:"iui-print-dialog",children:[u("div",{className:"content",children:[u("div",{className:"flex justify-between",children:[i?u("div",{children:[d("p",{className:"name",children:i.name}),i.taxId&&d("p",{children:`${o("TaxId")}: ${i.taxId}`}),i.registrationNumber&&d("p",{children:`${o("BusinessCode")}: ${i.registrationNumber}`}),i.jbkjs&&u("p",{children:["JBKJS: ",i.jbkjs]}),i.email&&u("p",{children:["Email: ",i.email]})]}):d("div",{}),d("div",{className:"text-right",children:d("p",{children:`${o("PrintDate")}: ${Se()}`})})]}),d("h4",{className:"my-3 text-center",children:t}),a&&u("div",{className:"flex justify-between",children:[d("div",{children:a.basic?.map((e=>!!e.value&&d("div",{className:"mb-2",children:d("p",{children:`${e.label}: ${e.value}`})},e.value)))}),a.date&&d("div",{children:a.date.map((e=>(!!e.from||!!e.to)&&d("div",{className:"mb-2 text-right",children:u("p",{children:[e.label," ",!!e.from&&`${o("from")} ${Ce(e.from)}`," ",`${o("to")} ${Ce(e.to||(new Date).toString())}`]})},e.label)))})]}),n]}),u("div",{className:"iui-print-actions no-print",children:[d(U,{label:o("Cancel"),icon:ge,onClick:e=>{e.stopPropagation(),l()},className:"mr-3"}),!!s&&d(U,{label:o("SaveXlsx"),icon:Ll,onClick:()=>s(),className:"mr-3"}),d(U,{label:o("Print"),icon:vl,solid:!0,onClick:()=>window.print()})]})]}),document.body):null},tt=({columns:e,columnsData:l,filterData:t,sortData:i,printData:a,customPrintData:n,templates:s,additionsalOptions:o})=>{const[r,h]=p(""),[f,b]=p(""),{t:g}=c(),C=()=>b("");return u("div",{className:"table-options gap-2",children:[u("div",{className:"flex align-center gap-2",children:[t&&u(m,{children:[d(j,{number:Nl(t.search),small:!0,children:d(U,{label:g("Filter"),active:"filter"===f,onClick:()=>b("filter"),className:"table-options-btn",size:"s"})}),d(ml,{...t,onSubmit:e=>{t.onSubmit(e),h("")},isOpen:"filter"===f,onClose:C})]}),l&&u(m,{children:[d(U,{label:g("Columns"),active:"columns"===f,onClick:()=>b("columns"),className:"table-options-btn",size:"s"}),"columns"===f&&d($l,{columns:l.columns,setColumns:e=>{l.setColumns(e),h("")},isOpen:!0,onClose:C,withSearch:l.withSearch})]}),i&&d(ze,{renderButton:e=>d(U,{label:g("Sort"),iconEnd:Fl,active:"sort"===f,onClick:()=>b("sort"),ref:e,className:"table-options-btn",size:"s"}),isOpen:"sort"===f,onClose:C,size:i.menuSize,children:d(Al,{...i,setSort:e=>{i.setSort(e),h("")}})}),s&&u(ze,{renderButton:e=>d(U,{label:r?`${g("Templates")} (${Gl(r,30)})`:g("Templates"),iconEnd:Fl,active:"templates"===f,onClick:()=>b("templates"),ref:e,className:"table-options-btn",size:"s"}),isOpen:"templates"===f,onClose:C,children:[d(Jl,{identifier:s.identifier,onSelect:e=>{kl({template:e,columnsData:l,setFilters:e=>{t?.setSearchData(e),t?.onSubmit(il(e,"Obj"))},setSort:i?.setSort}),h(e.name),C()}}),d(Ye,{label:g("RemoveFiltersAndLook"),onClick:()=>{s.onClearFilters(),h(""),C()}}),d(Zl,{identifier:s.identifier,data:s.data,onSubmitCallback:C,allowPublicCreate:s.allowPublicCreate}),d(et,{identifier:s.identifier,data:s.data,onClose:C})]}),o]}),(a??n)&&u(m,{children:[d(U,{label:g("PrintExport"),icon:vl,onClick:()=>b("print"),size:"s"}),"print"===f&&(a?d(Dl,{...a,isOpen:!0,onClose:C,columns:e}):n&&d(lt,{...n,isOpen:!0,onClose:C}))]})]})},it={prefix:"fas",iconName:"ellipsis-vertical",icon:[128,512,[],"f142","M64 360C94.93 360 120 385.1 120 416C120 446.9 94.93 472 64 472C33.07 472 8 446.9 8 416C8 385.1 33.07 360 64 360zM64 200C94.93 200 120 225.1 120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200zM64 152C33.07 152 8 126.9 8 96C8 65.07 33.07 40 64 40C94.93 40 120 65.07 120 96C120 126.9 94.93 152 64 152z"]},at=()=>{const[e,l]=p(!1);return f((()=>{const e=new MutationObserver((e=>{if(e.find((e=>"childList"===e.type))){const e=W.getElementsByClassName("iui-dialog").length>0;l(e)}}));return e.observe(W,{childList:!0}),()=>e.disconnect()}),[]),e},nt={prefix:"fas",iconName:"plus",icon:[448,512,[],"2b","M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"]},st=({columns:t,setColumns:i,withColumnsSearch:a,customHeader:n,data:s,sumRows:o,isLoading:r,headerWrap:h,serverSidePagination:b,customPagination:g,selectedRowUuid:C,footerAction:v,hideFooter:N,noTotalRows:w,showLastBorder:y,className:S,filterData:k,sortData:M,printData:L,customPrintData:z,templates:D,additionsalOptions:O,rowSelect:T,rowHeight:R="m",maxHeight:$,editable:I,keyboard:P})=>{const[A,F]=p(g?.defaultLimit??5),[E,V]=p(0),[B,H]=p([]),[j,q]=p([]),[W,X]=p(""),[J,K]=p({}),[G,_]=p(!1),[Q,ee]=p(!1),[le,te]=p([]),{t:ie}=c(),ae={limit:b?.limit||A,offset:b?.offset||E,setLimit:b?.setLimit||F,setOffset:b?.setOffset||V,totalRows:b?.totalRows||s.length},ne=(({enabled:e,rows:l,selected:t,actions:i})=>{const[a,n]=p(null),s=at();return f((()=>{if(e&&!s){const e=!!i.edit?.item,s=!!i.add?.isAdding,o=o=>{const c=o.ctrlKey||o.metaKey,r=a?l.findIndex((e=>e.uuid===a.uuid)):-1;[{key:"ArrowDown",isActive:!e&&!i.moveDisabled,onAction:()=>{const e=r+1;e<l.length&&(n(l[e]),Ml(l[e].uuid))}},{key:"ArrowUp",isActive:!e&&!i.moveDisabled,onAction:()=>{if(0!==r){const e=r>0?r-1:l.length-1;n(l[e]),Ml(l[e].uuid)}}},{key:"e",normalizedKey:!0,ctrl:!0,isActive:!!i.edit?.enabled&&!!a,onAction:()=>!e&&i.edit?.setItem(a?.item??null)},{key:"Enter",isActive:!e&&!s&&!!a?.onRowClick,onAction:a?.onRowClick},{key:"Escape",isActive:!!a||!!s,onAction:()=>s?i.add?.setIsAdding(!1):i.edit?.item?i.edit?.setItem(null):n(null)},...["Insert","+"].map((l=>({key:l,isActive:!!i.add?.enabled&&!s&&!e,onAction:()=>{i.add?.setIsAdding(!0),n(null)}}))),{key:"Delete",isActive:!e&&!!i.delete?.enabled&&!!a,onAction:()=>i.delete?.onAction??i.delete?.setItemToDeleteUuids(t.enabled&&t.rows&&t.rows.size>0?Array.from(t.rows):[a.uuid])},...i?.additional?.({focusedRow:a,isEditing:e,isAdding:s})||[]].forEach((e=>{e.isActive&&e.key===(e.normalizedKey?o.key.toLowerCase():o.key)&&!!e.ctrl===c&&(o.preventDefault(),o.stopPropagation(),e.onBulkAction&&t?.enabled&&t.rows.size>0?e.onBulkAction(Array.from(t.rows)):e.onAction())}))};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}}}),[e,l,a,i,s]),a})({enabled:!!P?.enabled,rows:j,selected:{enabled:!!T&&le.length>0,rows:T?.selectedRows??new Set,resetSelected:()=>T?.setSelectedRows(new Set)},actions:{moveDisabled:!!P?.actions?.moveDisabled||G,...P?.actions,add:{isAdding:G,setIsAdding:_,enabled:!!I?.EditableRow&&!I.addDisabled},edit:{item:I?.selectedItem,setItem:I?.setSelectedItem,enabled:!!I&&!!I.setSelectedItem&&!P?.actions.editDisabled},additional:e=>[...P?.actions?.additional?.(e)||[],{key:"PageUp",isActive:!e.isEditing,onAction:()=>ae.offset>0&&ae.setOffset(ae.offset-1)},{key:"PageDown",isActive:!e.isEditing,onAction:()=>{(w?ae.limit<=ae.totalRows:ae.offset+1<Math.ceil(ae.totalRows/ae.limit))&&ae.setOffset(ae.offset+1)}},{key:" ",isActive:le.length>0&&!!ne?.uuid,onAction:()=>{const e=ne?.uuid,l=T?.selectedRows.has(e);T?.setSelectedRows((t=>{const i=new Set(t);return i[l?"delete":"add"](e),i}))}}]}});f((()=>{T?.actions.length&&te(T.actions.filter((e=>!e.hidden))||[])}),[T?.actions]),f((()=>{const e=t.filter((e=>!e.hidden&&!e.unavailable));let l;if(T&&le.length>0){const e=j.filter((e=>!e.disableSelect)),t=!!T.selectedRows.size&&e.some((e=>!T.selectedRows.has(e.uuid))),i=!!T.selectedRows.size&&!t;l={id:"select",label:d(ue,{value:t?"middle":i,setValue:()=>{i?T.setSelectedRows(new Set):T.setSelectedRows((l=>{let t=new Set(l);return e.forEach((e=>t.add(e.uuid))),t}))}}),width:"50px"}}let i=[];l&&i.push(l),i=i.concat(e),H(i)}),[t,I,T?.selectedRows,le,b]),f((()=>{const e=b||A<=0?s:s.slice(E*A,E*A+A);T&&le.length>0&&e.map((e=>e.cells.select={value:d(ue,{value:T.selectedRows.has(e.uuid),setValue:l=>{T.setSelectedRows((t=>{const i=new Set(t);return l?i.add(e.uuid):i.delete(e.uuid),i}))},disabled:e.disableSelect}),unclickable:!0})),q(e)}),[s,A,E,T?.selectedRows,le,b]);const oe=I?.EditableRow;return d(Z,{isLoading:!!r,children:u("div",{className:l("iui-table",S,{"pb-3":0===j.length}),children:[u("div",{className:"flex column gap-2",children:[(!!k||!!M||!!i||!!L||!!z)&&d(tt,{columns:B,columnsData:i?{columns:t,setColumns:i,withSearch:a}:void 0,filterData:k,sortData:M,printData:L,customPrintData:z,templates:D,additionsalOptions:O}),!!T&&le.length>0&&u("div",{className:"flex gap-2 align-center pl-3",children:[d("p",{className:"fs-12",children:`${ie("Selected")}: ${T.selectedRows.size}`}),d(ze,{isOpen:Q,onClose:()=>ee(!1),placementX:"left",renderButton:e=>d(U,{ref:e,label:ie("Actions"),icon:it,active:Q,disabled:!T.selectedRows.size,onClick:()=>ee(!Q),size:"s"}),children:le.map((e=>d(Ye,{label:e.label,disabled:e.disabled,onClick:()=>{e.onClick(T.selectedRows),ee(!1),e.clearSelected&&T.setSelectedRows(new Set)}},e.label)))})]})]}),d("div",{className:"table-container",style:{maxHeight:$},children:d(se,{condition:!!I,wrapper:e=>d("form",{onSubmit:e=>{e.preventDefault(),e.stopPropagation(),I.onSubmit(J,(()=>{!I?.keepEditOnSubmit&&I.inputFocusRef?.current?.focus(),I?.selectedItem&&I?.keepEditOnSubmit||(K(I.defaultDataValue??{}),I?.setSelectedItem&&I.setSelectedItem(null))}))},children:e}),children:u("table",{className:"full-width",children:[d(Cl,{columns:B,headerWrap:h,customHeader:n,sticky:!!$}),d("tbody",{className:l({"no-last-border":N&&!y}),children:j.length?d(m,{children:j.map((e=>{const t=e.extendable&&!e.extendable.isLoading&&W===e.uuid;return u(x,{children:[oe&&e.uuid===I?.selectedItem?.uuid&&I.setSelectedItem?d(oe,{columns:B,data:J,setData:K,item:I.selectedItem,clearItem:()=>I.setSelectedItem(null),defaultDataValue:I.defaultDataValue,inputFocusRef:I.inputFocusRef}):d("tr",{"data-id":e.uuid,className:l(e.className,{selected:!!C&&C===e.uuid,clickable:!!e.onRowClick||!!e.extendable,focused:!!ne&&ne.uuid===e.uuid,loading:e.extendable?.isLoading}),onClick:l=>{e.onRowClick&&e.onRowClick(l),e.extendable&&X(W===e.uuid?"":e.uuid)},children:B.map((i=>{const a=e.cells[i.id];return d(Y,{label:a?.tooltip,position:"top",disabled:!a?.tooltip,children:d("td",{"data-th":"select"===i.id?ie("Selected")+":":i.label?i.label+": ":"/",align:a?.align||i.align,onClick:a?.onClick||a?.unclickable?e=>{e.stopPropagation(),a?.onClick&&a?.onClick(e)}:void 0,className:l(i.color,a?.className,R,{link:a?.link,"p-0":!a?.value&&0!==a?.value,"clickable-column":a?.onClick,"word-break":i.break,"no-border":t}),colSpan:a?.span,children:a?.value})},i.id)}))}),t&&d("tr",{children:d("td",{colSpan:B.length,className:R,children:e.extendable.element})})]},e.uuid)}))}):d("tr",{children:d("td",{className:"no-border",colSpan:B.length,children:ie("NoResults")})})}),u("tfoot",{children:[!!oe&&!I.selectedItem&&!I.addDisabled&&(P?.enabled&&!G?d("tr",{"data-id":"add",className:"clickable"+("add"===ne?.uuid?" focused":""),onClick:()=>_(!0),children:d("td",{className:`text-center ${R}`,colSpan:t.length,children:u("div",{className:"flex center gap-2",children:[d(e,{icon:nt,className:"c-primary icon24"}),d("p",{children:I.addLabel||ie("AddItem")})]})})}):d(oe,{columns:B,data:J,setData:K,defaultDataValue:I.defaultDataValue,clearItem:()=>{I.setSelectedItem?.(null),G&&_(!1)},inputFocusRef:I.inputFocusRef})),!!o&&!!j.length&&o.map((e=>d("tr",{children:B.map((({id:l})=>d("td",{align:e.cells[l]?.align||"right",colSpan:e.cells[l]?.span,className:R,children:d("strong",{children:e.cells[l]?.value})},l)))})))]})]})})}),!N&&(!!j.length||w&&(b?.offset||E)>0)&&d(bl,{customLimit:g?.customLimit,pagination:ae,footerAction:v,noTotalRows:w,dataLength:j.length})]})})},ot=({tabs:t,initialValue:i,control:a,onChange:n,noWrap:s,className:o,classNameContent:c})=>{const[r,m]=p(i||t[0].value);return t.length>0?u("div",{className:o,children:[d("div",{className:"iui-tabs",children:t.map((t=>!t.hidden&&u("div",{className:l("iui-tab clickable",{selected:(a?.value||r)===t.value,disabled:t.disabled,"no-wrap":s}),onClick:t.disabled?void 0:()=>{a?a.setValue(t.value):m(t.value),n&&n(t.value)},children:[t.icon&&d(e,{icon:t.icon}),t.label]},t.value)))}),t.map((e=>!e.hidden&&(a?.value||r)===e.value&&d("div",{className:l("iui-tab-content",c),children:e.component},e.value)))]}):null},ct={prefix:"fal",iconName:"chevron-right",icon:[320,512,[],"f054","M85.14 475.8c-3.438-3.141-5.156-7.438-5.156-11.75c0-3.891 1.406-7.781 4.25-10.86l181.1-197.1L84.23 58.86c-6-6.5-5.625-16.64 .9062-22.61c6.5-6 16.59-5.594 22.59 .8906l192 208c5.688 6.156 5.688 15.56 0 21.72l-192 208C101.7 481.3 91.64 481.8 85.14 475.8z"]},rt=({item:e,onClick:t,selectedItemUuid:i,className:a})=>{const[n,s]=p(!1),o=!!e.children?.length;return u("div",{className:l("tree-item",a),children:[u("div",{className:"flex align-center",children:[d("div",{className:"extendable-icon",children:o&&d(J,{icon:ct,onClick:()=>s(!n),size:"s",className:l("rotate",{rotate90:n})})}),d("div",{className:l("tree-item-name clickable",{active:i===e.uuid}),onClick:()=>t(e.uuid),children:e.name})]}),o&&d(T,{isOpen:n,children:e.children?.map((e=>d(rt,{item:e,onClick:t,className:l("ml-3",a),selectedItemUuid:i},e.uuid)))})]})},dt=({data:e,selectedItemUuid:l,onClick:t})=>d("div",{children:e.map((e=>d(rt,{item:e,onClick:t,selectedItemUuid:l},e.uuid)))}),ut={prefix:"fas",iconName:"floppy-disk",icon:[448,512,[],"f0c7","M433.1 129.1l-83.9-83.9C342.3 38.32 327.1 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 152.9 441.7 137.7 433.1 129.1zM224 416c-35.34 0-64-28.66-64-64s28.66-64 64-64s64 28.66 64 64S259.3 416 224 416zM320 208C320 216.8 312.8 224 304 224h-224C71.16 224 64 216.8 64 208v-96C64 103.2 71.16 96 80 96h224C312.8 96 320 103.2 320 112V208z"]},mt=({isLoading:e,noAccess:l,submitButton:t,otherButtons:i,className:a,children:n})=>{const{t:s}=c();return d(Z,{isLoading:e,children:u("form",{className:a,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),!t.disabled&&t.onSubmit(e)},children:[n,(!l||i)&&u("div",{className:"flex center gap-2 mt-3 mb-2",children:[i?.map((l=>!l.hidden&&d(U,{label:l.label,icon:l.icon,disabled:e||l.disabled,outlined:l.outlined,color:l.color,onClick:l.onClick},l.label))),!l&&d(U,{label:t.label??s("Save"),icon:t.icon??ut,disabled:e||t.disabled,outlined:!t.solid,solid:t.solid,color:t.color})]})]})})},pt=({title:e,buttonLabel:l})=>{const{t:t}=c();return u("div",{className:"flex center column mt-5 gap-4",children:[u("svg",{id:"aa03ddf9-f8f2-4819-a4ce-be9b0a220741","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",width:"40%",viewBox:"0 0 1119.60911 699",children:[d("title",{children:"No Access"}),d("circle",{cx:"292.60911",cy:"213",r:"213",fill:"#f2f2f2"}),d("path",{d:"M31.39089,151.64237c0,77.49789,48.6181,140.20819,108.70073,140.20819",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M140.09162,291.85056c0-78.36865,54.255-141.78356,121.30372-141.78356",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("path",{d:"M70.77521,158.66768c0,73.61476,31.00285,133.18288,69.31641,133.18288",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("path",{d:"M140.09162,291.85056c0-100.13772,62.7103-181.16788,140.20819-181.16788",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M117.22379,292.83905s15.41555-.47479,20.06141-3.783,23.713-7.2585,24.86553-1.95278,23.16671,26.38821,5.76263,26.5286-40.43935-2.711-45.07627-5.53549S117.22379,292.83905,117.22379,292.83905Z",transform:"translate(-31.39089 -100.5)",fill:"#a8a8a8"}),d("path",{d:"M168.224,311.78489c-17.40408.14042-40.43933-2.71094-45.07626-5.53548-3.53126-2.151-4.93843-9.86945-5.40926-13.43043-.32607.014-.51463.02-.51463.02s.97638,12.43276,5.61331,15.2573,27.67217,5.67589,45.07626,5.53547c5.02386-.04052,6.7592-1.82793,6.66391-4.47526C173.87935,310.756,171.96329,311.75474,168.224,311.78489Z",transform:"translate(-31.39089 -100.5)",opacity:"0.2"}),d("ellipse",{cx:"198.60911",cy:"424.5",rx:"187",ry:"25.43993",fill:"#3f3d56"}),d("ellipse",{cx:"198.60911",cy:"424.5",rx:"157",ry:"21.35866",opacity:"0.1"}),d("ellipse",{cx:"836.60911",cy:"660.5",rx:"283",ry:"38.5",fill:"#3f3d56"}),d("ellipse",{cx:"310.60911",cy:"645.5",rx:"170",ry:"23.12721",fill:"#3f3d56"}),d("path",{d:"M494,726.5c90,23,263-30,282-90",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M341,359.5s130-36,138,80-107,149-17,172",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M215.40233,637.78332s39.0723-10.82,41.47675,24.04449-32.15951,44.78287-5.10946,51.69566",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M810.09554,663.73988,802.218,714.03505s-38.78182,20.60284-11.51335,21.20881,155.73324,0,155.73324,0,24.84461,0-14.54318-21.81478l-7.87756-52.719Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M785.21906,734.69812c6.193-5.51039,16.9989-11.252,16.9989-11.252l7.87756-50.2952,113.9216.10717,7.87756,49.582c9.185,5.08711,14.8749,8.987,18.20362,11.97818,5.05882-1.15422,10.58716-5.44353-18.20362-21.38921l-7.87756-52.719-113.9216,3.02983L802.218,714.03506S769.62985,731.34968,785.21906,734.69812Z",transform:"translate(-31.39089 -100.5)",opacity:"0.1"}),d("rect",{x:"578.43291",y:"212.68859",width:"513.25314",height:"357.51989",rx:"18.04568",fill:"#2f2e41"}),d("rect",{x:"595.70294",y:"231.77652",width:"478.71308",height:"267.83694",fill:"#3f3d56"}),d("circle",{cx:"835.05948",cy:"223.29299",r:"3.02983",fill:"#f2f2f2"}),d("path",{d:"M1123.07694,621.32226V652.6628a18.04341,18.04341,0,0,1-18.04568,18.04568H627.86949A18.04341,18.04341,0,0,1,609.8238,652.6628V621.32226Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("polygon",{points:"968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 651.452 645.651 962.312 645.651 968.978 667.466",fill:"#2f2e41"}),d("path",{d:"M1125.828,762.03359c-.59383,2.539-2.83591,5.21743-7.90178,7.75032-18.179,9.08949-55.1429-2.42386-55.1429-2.42386s-28.4804-4.84773-28.4804-17.573a22.72457,22.72457,0,0,1,2.49658-1.48459c7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M1125.828,762.03359c-22.251,8.526-42.0843,9.1622-62.43871-4.975-10.26507-7.12617-19.59089-8.88955-26.58979-8.75618,7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z",transform:"translate(-31.39089 -100.5)",opacity:"0.1"}),d("ellipse",{cx:"1066.53846",cy:"654.13477",rx:"7.87756",ry:"2.42386",fill:"#f2f2f2"}),d("circle",{cx:"835.05948",cy:"545.66686",r:"11.51335",fill:"#f2f2f2"}),d("polygon",{points:"968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 968.978 667.466",opacity:"0.1"}),d("rect",{x:"108.60911",y:"159",width:"208",height:"242",fill:"#2f2e41"}),d("rect",{x:"87.60911",y:"135",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"87.60911",y:"237",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"87.60911",y:"339",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"271.60911",y:"150",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"150",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"150",width:"16",height:"16",fill:"#4191ff"}),d("rect",{x:"271.60911",y:"251",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"251",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"251",width:"16",height:"16",fill:"#4191ff"}),d("rect",{x:"271.60911",y:"352",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"352",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"352",width:"16",height:"16",fill:"#4191ff"}),d("circle",{cx:"316.60911",cy:"538",r:"79",fill:"#2f2e41"}),d("rect",{x:"280.60911",y:"600",width:"24",height:"43",fill:"#2f2e41"}),d("rect",{x:"328.60911",y:"600",width:"24",height:"43",fill:"#2f2e41"}),d("ellipse",{cx:"300.60911",cy:"643.5",rx:"20",ry:"7.5",fill:"#2f2e41"}),d("ellipse",{cx:"348.60911",cy:"642.5",rx:"20",ry:"7.5",fill:"#2f2e41"}),d("circle",{cx:"318.60911",cy:"518",r:"27",fill:"#fff"}),d("circle",{cx:"318.60911",cy:"518",r:"9",fill:"#3f3d56"}),d("path",{d:"M271.36733,565.03228c-6.37889-28.56758,14.01185-57.43392,45.544-64.47477s62.2651,10.41,68.644,38.9776-14.51861,39.10379-46.05075,46.14464S277.74622,593.59986,271.36733,565.03228Z",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("ellipse",{cx:"417.21511",cy:"611.34365",rx:"39.5",ry:"12.40027",transform:"translate(-238.28665 112.98044) rotate(-23.17116)",fill:"#2f2e41"}),d("ellipse",{cx:"269.21511",cy:"664.34365",rx:"39.5",ry:"12.40027",transform:"translate(-271.07969 59.02084) rotate(-23.17116)",fill:"#2f2e41"}),d("path",{d:"M394,661.5c0,7.732-19.90861,23-42,23s-43-14.268-43-22,20.90861-6,43-6S394,653.768,394,661.5Z",transform:"translate(-31.39089 -100.5)",fill:"#fff"})]}),d("h1",{className:"fs-32 mt-5",children:e||t("NoAccessTitle")}),d(Link,{to:"/",children:d(U,{label:l||t("ReturnToHomepage"),solid:!0,size:"l"})})]})},ht={prefix:"fal",iconName:"arrow-left",icon:[448,512,[],"f060","M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"]},ft={prefix:"fal",iconName:"circle-question",icon:[512,512,[],"f059","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM240 344c-13.25 0-24 10.75-24 24s10.75 24 24 24s24-10.75 24-24S253.3 344 240 344zM285.6 128H226.4C189.8 128 160 157.8 160 194.4V204c0 8.844 7.156 16 16 16S192 212.8 192 204V194.4C192 175.4 207.4 160 226.4 160h59.25C304.6 160 320 175.4 320 194.4c0 12.48-6.781 24-17.06 29.72L242.5 254.3C231.1 260.7 224 272.7 224 285.8V304C224 312.8 231.2 320 240 320S256 312.8 256 304V285.8c0-1.453 .7813-2.797 1.438-3.172l60.41-30.22C338.9 240.7 352 218.5 352 194.4C352 157.8 322.2 128 285.6 128z"]},bt=({isOpen:e,onClose:l,size:t,form:i,additionalButtons:a,children:n})=>{const s=h(null),{t:o}=c(),r=v((()=>{s.current?.classList.add("closing"),setTimeout(l,200)}),[s,l]);return f((()=>{if(e){setTimeout((()=>{s.current?.classList.add("open")}));const e=e=>{"Escape"===e.code&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}}),[e,r]),e?y(d("div",{ref:s,className:"pullover",onClick:r,children:d("div",{className:`container ${t}`,onClick:e=>e.stopPropagation(),children:d("div",{className:"content",children:i?d(mt,{isLoading:i.isLoading,submitButton:{onSubmit:i.onSubmit,label:i.submitLabel,disabled:i.submitDisabled},otherButtons:[{label:o("Close"),onClick:r},...a?.filter((e=>!e.hidden))||[]],children:d("div",{className:"flex column gap-2 flex-grow",children:n})}):n})})}),W):null},gt=({breadcrumbs:e,actions:l,moreActions:t,backButton:i,help:a,noAccess:n,isLoading:s,isInitiallyLoading:o,children:c})=>{const[h,f]=p(!1),[b,g]=p(!1),C=useNavigate(),v=t?.some((e=>!e.hidden));return d(Z,o?{isLoading:!0,isFullPage:!0}:{isLoading:!!s,children:u("div",{className:"page-container",children:[u("div",{className:"page-header",children:[u("div",{className:"flex align-center gap-3",children:[i?.active&&d(J,{icon:ht,className:"c-primary",onClick:()=>i.url?C(i.url):C(-1)}),d("h1",{className:"breadcrumbs",children:e.reduce(((e,l)=>l?e?`${e} / ${l}`:l:e),"")})]}),!n&&u("div",{className:"flex align-center gap-2",children:[a&&u(m,{children:[d(J,{icon:ft,onClick:()=>g(!b)}),d(bt,{isOpen:b,onClose:()=>g(!1),size:"m",children:d(B,{severity:"info",children:u("div",{children:[d("p",{className:"bold mb-3",children:a.title}),d("p",{children:a.descEl})]})})})]}),v&&d(ze,{isOpen:h,onClose:()=>f(!1),placementX:"right",renderButton:e=>d(J,{ref:e,icon:Xe,active:h,onClick:()=>f(!h)}),children:t?.map((e=>!e.hidden&&d(Ye,{label:e.label,icon:e.icon,iconRotation:e.iconRotation,disabled:e.disabled,withDevider:!0,to:e.to,onClick:e.onClick?()=>{e.onClick(),f(!1)}:void 0},e.label)))}),l?.map((e=>!e.hidden&&d(se,{condition:!!e.to,wrapper:l=>d(Link,{to:e.to,children:l}),children:d(U,{...e,className:"ml-2"},e.label)},e.label)))]})]}),u("div",{className:"page-content",children:[d("div",{className:"flex-grow",children:n?d(pt,{}):c}),d("div",{className:"footer",children:d("p",{children:d(r,{i18nKey:"FooterText"})})})]})]})})},Ct=e=>s.success(e),vt=e=>s.error(e,{autoClose:!1}),Nt=e=>{if(0===e)return"0.00 B";if(void 0===e)return"/";const l=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,l)).toFixed(2)+" "+" KMGTP".charAt(l)+"B"},wt=(e,l,t)=>{const i=e.split(","),a=i[0].match(/:(.*?);/)[1],n=window.atob(i[1]);let s=n.length;const o=new Uint8Array(s);for(;s--;)o[s]=n.charCodeAt(s);return new File([o],`${l}.${t}`,{type:a})},xt=e=>e?.split(".").pop()?.toLowerCase()??"",yt=(e,l)=>e.reduce(((e,t)=>sl(l).includes(t.uuid)?e+t.storedFile.lengthInBytes:e),0),St=(e,l,t,i,a)=>{let n=new XMLHttpRequest;const s=a&&Object.keys(a).map((e=>e+"="+a[e])).join("&");n.open("GET",`${i||api.apiUrl}${l}${s?`?${s}`:""}`,!0),n.setRequestHeader("Authorization","Bearer "+El("token")),n.responseType="blob",n.onload=function(l){if(200===n.status){var i=n.response,a=document.createElement("a");a.href=window.URL.createObjectURL(i),a.download=`${e}.${t}`,a.click()}else vt(o.t("ErrorMessage"))},n.send()},kt=(e,l)=>fetch(e).then((e=>e.blob())).then((e=>new File([e],l,{type:e.type||"image/png"}))),Mt=e=>new Promise(((l,t)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>l(i.result),i.onerror=()=>t(new Error("Failed to read file"))})),Lt=e=>kt(e,e).then((e=>{if(e)return Mt(e);throw new Error("Failed to create file from URL")})),zt=(e,l)=>{const t="img"===l?/^data:([a-z]+\/[a-z]+);base64,(.+)$/:/^data:(.+);base64,(.+)$/,i=e.match(t);if(i){return{contentType:i[1],base64Data:i[2]}}throw new Error("img"===l?"Invalid base64 image format":"Invalid file")},Dt=(e,l,t)=>{const i=document.createElement("canvas");let a=i.getContext("2d"),n=new Image;n.onload=function(){i.width=l%180==0?n.width:n.height,i.height=l%180==0?n.height:n.width,a?.translate(i.width/2,i.height/2),a?.rotate(l*Math.PI/180),a?.drawImage(n,n.width/-2,n.height/-2),t(i.toDataURL())},n.src=e};function Ot({url:e,fileName:l,onSuccess:t,setIsLoading:i}){i?.(!0);const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){const e=new Blob([a.response],{type:"application/octetstream"}),t=(window.URL||window.webkitURL).createObjectURL(e),i=document.createElement("a");i.setAttribute("download",l),i.setAttribute("href",t),document.body.appendChild(i),i.click(),document.body.removeChild(i)},a.onloadend=function(){console.log("Finished downloading file"),t?.(),i?.(!1)},a.send()}const Tt={taxId:"^\\d{9}$",businessCode:"^\\d{8}$",umcn:"^\\d{13}$",idCardNumber:"^\\d{9}$",phoneNumber:"^\\d{8,9}$",port:"^\\d{4}$",year:"^\\d{4}$",number:"^\\d*$",strongPassword:"^.*(?=.{8,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).*$"},Rt=(e,l,t)=>Number(e??0).toLocaleString("sr-RS",{minimumFractionDigits:l??2,maximumFractionDigits:t??l??2}),$t=e=>Number(e??0).toLocaleString("sr-RS"),It=e=>e?.toString().replace(".",",")??0,Pt=e=>{const l=new URLSearchParams(e);return Object.fromEntries(l.entries())},At={Actions:"Akcije",Active:"Aktivan",AddInput:"Unesi",Back:"Nazad",Cancel:"Otkaži",Change:"Promeni",Choose:"Izaberi",Close:"Zatvori",Confirm:"Potvrdi",Create:"Kreiraj",Delete:"Izbriši",Edit:"Izmeni",FreeText:"Slobodan unos",from:"od",Group:"Grupa",Groups:"Grupe",Next:"Dalje",No:"Ne",Ok:"U redu",Options:"Opcije",or:"ili",Save:"Sačuvaj",Search:"Pretraga",Selected:"Označeno",Send:"Pošalji",Sending:"Slanje",Title:"Naslov",to:"do",Yes:"Da",RefreshData:"Osveži podatke",allResults:"Svi",Columns:"Kolone",DragDropListsInfo:"Odaberite kolone za prikazivanje prevlačenjem sa jedne liste na drugu",Filter:"Filteri",HiddenColumns:"Sakrivene kolone",NoResults:"Nema rezultata",of:"od",page:"Strana",Print:"Odštampaj",PrintDate:"Datum izveštaja",PrintExport:"Štampa/Izvoz",ResetFilter:"Resetuj filtere",rowsPerPage:"Broj redova",SaveXlsx:"Sačuvaj XLSX",SelectedColumns:"Odabrane kolone",Sort:"Sortiranje",AddItem:"Dodaj stavku",Templates:"Šabloni",SelectTemplate:"Izaberi šablon",TemplateList:"Lista šablona",PublicTemplate:"Javni šablon",PublicTemplates:"Javni šabloni",DefaultTemplate:"Osnovni šabloni",RemoveFiltersAndLook:"Poništi izgled i filtere",CreateTemplateLong:"Sačuvaj trenutni izgled kao šablon",CreateDefaultTemplate:"Sačuvaj trenutni izgled kao podrazumevani",CreateTemplate:"Sačuvaj šablon",DeleteTemplateDesc:"Da li ste sigurni da želite da izbrišete šablon?",DeleteTemplateTitle:"Brisanje šablona",FastLinks:"Brzi pristup",CharMin:"Minimalan broj karaktera: {{from}}",CharRange:"Broj karaktera od {{from}} do {{-to}}",CharNumber:"Broj karaktera {{number}}",Pending:"U toku",Successfully:"Uspešno",DeletedSuccessfully:"Uspešno izbrisano",ErrorMessage:"Došlo je do greške!",TryAgain:"Pokušaj ponovo"},Ft={Actions:"Акције",Active:"Активан",AddInput:"Унеси",Back:"Назад",Cancel:"Откажи",Change:"Промени",Choose:"Изабери",Close:"Затвори",Confirm:"Потврди",Create:"Креирај",Delete:"Избриши",Edit:"Измени",FreeText:"Слободан унос",from:"од",Group:"Група",Groups:"Групе",Next:"Даље",No:"Не",Ok:"У реду",Options:"Опције",or:"или",Save:"Сачувај",Search:"Претрага",Selected:"Означено",Send:"Пошаљи",Sending:"Слање",Title:"Наслов",to:"до",Yes:"Да",RefreshData:"Освежи податке",allResults:"Сви",Columns:"Колоне",DragDropListsInfo:"Одаберите колоне за приказивање превлачењем са једне листе на другу",Filter:"Филтери",HiddenColumns:"Сакривене колоне",NoResults:"Нема резултата",of:"од",page:"Страна",Print:"Одштампај",PrintDate:"Датум извештаја",PrintExport:"Штампа/Извоз",ResetFilter:"Ресетуј филтере",rowsPerPage:"Број редова",SaveXlsx:"Сачувај XЛСX",SelectedColumns:"Одабране колоне",Sort:"Сортирање",AddItem:"Додај ставку",Templates:"Шаблони",SelectTemplate:"Изабери шаблон",TemplateList:"Листа шаблона",PublicTemplate:"Јавни шаблон",PublicTemplates:"Јавни шаблони",DefaultTemplate:"Основни шаблони",RemoveFiltersAndLook:"Поништи изглед и филтере",CreateTemplateLong:"Сачувај тренутни изглед као шаблон",CreateDefaultTemplate:"Сачувај тренутни изглед као подразумевани",CreateTemplate:"Сачувај шаблон",DeleteTemplateDesc:"Да ли сте сигурни да желите да избришете шаблон?",DeleteTemplateTitle:"Брисање шаблона",CharMin:"Минималан број карактера: {{from}}",CharRange:"Број карактера од {{from}} до {{-to}}",CharNumber:"Број карактера {{number}}",Pending:"У току",Successfully:"Успешно",DeletedSuccessfully:"Успешно избрисано",ErrorMessage:"Дошло је до грешке!",TryAgain:"Покушај поново"},Et=e=>{const[l,t]=p(null),[i,a]=p(!0);return f((()=>{e&&(e=>axiosInstance.get(`/report-templates/${e}/default`,{params:{organizationUuid:ql()},headers:{baseUrl:Wl}}).then((({data:e})=>e)))(e).then(t).catch((()=>{})).finally((()=>a(!1)))}),[e]),{defaultTemplate:l,isLoadingDefaultTemplate:!!e&&i}},Vt=(e,l)=>{f((()=>{if(!l){const l=l=>{"Escape"===l.code&&e()};return document.body.addEventListener("keyup",l),()=>document.body.removeEventListener("keyup",l)}}),[e,l])},Bt=()=>{const[e,l]=p(new Set);return{selectedRows:e,setSelectedRows:l,resetSelectedRows:()=>l(new Set)}},Ht=()=>{const[e,l]=p(!1);return{isMenuOpen:e,onMenuOpen:()=>l(!0),onMenuClose:()=>setTimeout((()=>l(!1)))}};export{I as Accordions,B as Alert,U as Button,ue as Checkbox,T as Collapse,se as ConditionalWrapper,fe as CurrencyInput,K as Dashboard,te as DashboardWidget,Te as DateInput,de as DeleteItemDialog,ce as Dialog,H as DotBadge,ne as FastLinksWidget,Qe as FilterItem,mt as FormWrapper,G as FullScreenLoader,J as IconButton,Je as ItemActionsMenu,Ge as ItemEditOptionsButtons,$e as LargeTextInput,_ as LazyLoader,Z as Loader,ze as Menu,Ye as MenuItem,j as NotificationBadge,Ie as NumberInput,gt as PageWrapper,Fe as PasswordInput,q as PillBadge,Ee as Radio,Ve as RadioLarge,He as SearchInput,qe as Select,Ue as SelectAsyncPaginate,We as SelectCreatable,ml as SetTableFilter,st as Table,_e as TableEditRow,bl as TableFooter,Dl as TablePrint,ot as Tabs,pe as TextInput,Re as TimeInput,Y as Tooltip,dt as Tree,rl as areStringArraysEqual,yt as calculateFilesSize,ye as checkIfExpired,dl as compareArrayItemsIndex,ol as convertArrayToBooleanObject,sl as convertBooleanObjectToArray,Sl as convertReportTemplateFilterToSearch,yl as convertSearchToReportTemplateFilter,wt as dataURLtoFile,xe as dateAddDays,cl as deepCopy,al as deleteEmptyProps,nl as deleteEmptyPropsIncludingArray,tl as deleteProps,il as deletePropsThatEndsWith,St as downloadDocumentFile,Ot as downloadFile,Rt as formatCurrency,$t as formatCurrencyNoDecimals,Ce as formatDate,Ne as formatDateAndTime,ve as formatDateYMD,It as formatDecimalNumber,we as formatTime,Le as formatYearMonth,Nl as getActiveFilterNumber,ql as getActiveOrgUuid,Mt as getBase64FromFile,Lt as getBase64FromUrl,Se as getCurrentDateFormatted,ke as getCurrentDateFormattedYMD,Me as getDaysLeft,Hl as getDefaultOrgUuid,xt as getExtensionFromFilename,kt as getFileFromUrl,_l as getInputHelperText,Ql as getInputMinMaxPattern,xl as getPrintColumns,wl as getVisibleColumnsIds,Ft as i18nIUICyrilic,At as i18nIUILatin,Tt as inputPattern,ul as intersectArrays,El as lsGet,Bl as lsRemove,Vl as lsSet,Gl as maxChar,Pt as parseUrlSearch,W as rootDir,Dt as rotateBase64Image,Ul as setActiveOrgUuid,jl as setDefaultOrgUuid,kl as setTemplateData,Nt as sizeInBytesPretty,zt as splitBase64File,O as tableCustomLimit1000,vt as toastError,Ct as toastSuccess,Et as useDefaultTemplate,at as useDialogObserver,zl as useHideZendesk,Ht as useIsMenuOpen,Vt as useOnEsc,Bt as useTableSelect};
1
+ import"react-toastify/dist/ReactToastify.min.css";import{FontAwesomeIcon as e}from"@fortawesome/react-fontawesome";export{FontAwesomeIcon}from"@fortawesome/react-fontawesome";import l from"clsx";export{default as clsx}from"clsx";import t from"moment";export{default as moment}from"moment";import{Droppable as i,Draggable as a,DragDropContext as n}from"react-beautiful-dnd";export{DragDropContext,Draggable,Droppable}from"react-beautiful-dnd";import{toast as s}from"react-toastify";export{ToastContainer}from"react-toastify";import o from"i18next";export{changeLanguage,default as i18n}from"i18next";import{useTranslation as c,Trans as r}from"react-i18next";export{I18nextProvider,Trans,useTranslation}from"react-i18next";import{jsx as d,jsxs as u,Fragment as m}from"react/jsx-runtime";import{useState as h,useRef as p,useEffect as f,forwardRef as b,cloneElement as g,Children as C,useCallback as v,isValidElement as N,useMemo as w,Fragment as x}from"react";import{createPortal as y}from"react-dom";import"react-calendar/dist/Calendar.css";import{Calendar as S}from"react-calendar";import k from"moment/moment";import M from"react-select";import{AsyncPaginate as L}from"react-select-async-paginate";import z from"react-select/async-creatable";const D=[5,10,25,50,100],O=[...D,1e3],T=({isOpen:e,children:t,keepContentInDom:i,className:a})=>{const[n,s]=h(),[o,c]=h(e),r=p(null);return f((()=>{e&&c(!0)}),[e]),f((()=>{const e=new ResizeObserver((e=>{const l=Math.ceil(e[0].contentRect.height);s(l)}));let l;return r.current&&(l=r.current,e.observe(l)),()=>{l&&e.unobserve(l)}}),[r]),d("div",{className:l("iui-collapse",a),style:{maxHeight:e?n:0},onTransitionEnd:()=>!e&&c(!1),children:d("div",{ref:r,children:(i||o)&&t})})},R={prefix:"fal",iconName:"arrows-to-line",icon:[448,512,[],"e0a7","M235.3 324.7C231.3 320.7 226.5 320 224 320s-7.299 .6547-11.33 4.698l-79.98 79.98C129.6 407.8 128 411.9 128 416c0 8.523 6.865 16 16 16c4.094 0 8.188-1.562 11.31-4.688L208 374.6V496c0 8.844 7.156 16 16 16s16-7.156 16-16v-121.4l52.69 52.69C295.8 430.4 299.9 432 304 432c9.139 0 16-7.477 16-16c0-4.094-1.562-8.188-4.688-11.31L235.3 324.7zM212.7 187.3C214.4 189 218.3 192 224 192s9.609-2.98 11.33-4.707l79.98-79.98C318.4 104.2 320 100.1 320 96c0-8.527-6.865-16-16-16c-4.094 0-8.188 1.562-11.31 4.688L240 137.4V16C240 7.156 232.8 0 224 0S208 7.156 208 16v121.4L155.3 84.69C152.2 81.56 148.1 80 144 80C134.9 80 128 87.47 128 96c0 4.094 1.562 8.188 4.688 11.31L212.7 187.3zM432 240h-416C7.156 240 0 247.1 0 255.1S7.156 272 16 272h416c8.844 0 16-7.165 16-16.01S440.8 240 432 240z"]},$={prefix:"fal",iconName:"arrows-up-down",icon:[256,512,[],"f07d","M139.3 4.688l112 112C254.4 119.8 256 123.9 256 128s-1.562 8.188-4.688 11.31c-6.25 6.25-16.38 6.25-22.62 0L144 54.63v402.8l84.69-84.69c6.25-6.25 16.38-6.25 22.62 0C254.4 375.8 256 379.9 256 384s-1.562 8.188-4.688 11.31l-112 112c-6.25 6.25-16.38 6.25-22.62 0l-112-112c-6.25-6.25-6.25-16.38 0-22.62s16.38-6.25 22.62 0L112 457.4V54.63L27.31 139.3c-6.25 6.25-16.38 6.25-22.62 0s-6.25-16.38 0-22.62l112-112C122.9-1.562 133.1-1.562 139.3 4.688z"]},I=({tabs:t,initialValue:i,compact:a,keepContentInDom:n,className:s})=>{const o=t.filter((e=>!e.hidden)),[c,r]=h(i||"");return o.length>0?d("div",{className:s,children:d("div",{className:"iui-accordions",children:o.map((t=>u("div",{className:l("iui-accordion",{selected:c===t.value,compact:a}),children:[u("div",{className:l("summary clickable",{disabled:t.disabled}),onClick:t.disabled?void 0:()=>r(c===t.value?"":t.value),children:[u("div",{className:"flex center",children:[t.icon&&d(e,{icon:t.icon,className:"iui-icon"}),t.label]}),d(e,{icon:t.value===c?R:$,className:"collapse-icon"})]}),d(T,{isOpen:c===t.value,keepContentInDom:n,children:d("div",{className:"p-4",children:t.component})})]},t.value)))})}):null},P={prefix:"far",iconName:"circle-check",icon:[512,512,[],"f058","M335 175L224 286.1L176.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C211.7 341.7 217.8 344 224 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S344.4 165.7 335 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"]},A={prefix:"far",iconName:"circle-exclamation",icon:[512,512,[],"f06a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM256 304c13.25 0 24-10.75 24-24v-128C280 138.8 269.3 128 256 128S232 138.8 232 152v128C232 293.3 242.8 304 256 304zM256 337.1c-17.36 0-31.44 14.08-31.44 31.44C224.6 385.9 238.6 400 256 400s31.44-14.08 31.44-31.44C287.4 351.2 273.4 337.1 256 337.1z"]},F={prefix:"far",iconName:"circle-info",icon:[512,512,[],"f05a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"]},E={prefix:"far",iconName:"triangle-exclamation",icon:[512,512,[],"f071","M506.3 417l-213.3-364C284.8 39 270.4 32 256 32C241.6 32 227.2 39 218.1 53l-213.2 364C-10.59 444.9 9.851 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM52.58 432L255.1 84.8L459.4 432H52.58zM256 337.1c-17.36 0-31.44 14.08-31.44 31.44c0 17.36 14.11 31.44 31.48 31.44s31.4-14.08 31.4-31.44C287.4 351.2 273.4 337.1 256 337.1zM232 184v96C232 293.3 242.8 304 256 304s24-10.75 24-24v-96C280 170.8 269.3 160 256 160S232 170.8 232 184z"]},V={error:A,success:P,info:F,warning:E},B=({text:t,severity:i,fitContent:a,className:n,children:s})=>u("div",{className:l("iui-alert",i,n,{"width-fit":a}),children:[d(e,{icon:V[i]}),t,s]}),H=({label:e,color:t,className:i})=>u("div",{className:"flex align-center gap-2",children:[d("div",{className:l("iui-dot-badge",t,i)}),e]}),j=({number:e,className:t,small:i,children:a,color:n="primary"})=>u("div",{className:"iui-badge-parent",children:[a,!!e&&e>0&&d("div",{className:l("iui-badge",n,t,{small:i}),children:e>99?"99+":e})]}),q=b((({label:e,color:t,className:i},a)=>d("div",{ref:a,className:l("iui-pill-badge",t,i),children:e}))),U=b((({label:t,icon:i,iconEnd:a,onClick:n,disabled:s,solid:o,outlined:c,active:r,color:m="primary",size:h="m",className:p,buttonProps:f},b)=>u("button",{ref:b,disabled:s,className:l("iui-btn",p,m,h,{solid:o,outlined:c,active:r}),onClick:n,type:f?.type||n?"button":"submit",...f,children:[i&&d(e,{icon:i}),d("div",{className:"iui-btn-label",children:t}),a&&d(e,{icon:a})]}))),W=document.getElementById("root"),Y=({label:e,position:t="bottom",disabled:i,singleLine:a,className:n,children:s})=>{const[o,c]=h(""),r=p(null),b=p(null);return f((()=>{if(!i&&e){const e=r.current,l=b.current,i=()=>{e&&l&&(X(e,l,t,c),l?.classList.add("visible"))},a=()=>l?.classList.remove("visible");return e?.addEventListener("mouseenter",i),e?.addEventListener("mouseleave",a),()=>{e?.removeEventListener("mouseenter",i),e?.removeEventListener("mouseleave",a)}}}),[i,e,t]),e&&!i?u(m,{children:[g(s,{ref:r}),y(d("div",{ref:b,className:l("tooltip-container",n,{"no-wrap":a}),children:u("div",{className:"tooltip",children:[d("div",{className:l("arrow",o||t)}),d("div",{children:e})]})}),W)]}):s},X=(e,l,t,i)=>{const a=e.getBoundingClientRect(),n=l.getBoundingClientRect();if("bottom"===t||"top"===t){const e=Math.floor(a.bottom+16),s=Math.floor(a.top-n.height-16),o=Math.floor(a.left+a.width/2-n.width/2),c="top"===t?s<0:e+n.height>window.innerHeight;i(c?"bottom"===t?"top":"bottom":""),l.style.top=`${"bottom"===t?c?s:e:c?e:s}px`,l.style.left=`${o}px`}else"right"===t?(l.style.top=Math.floor(a.top+a.height/2-n.height/2)+"px",l.style.left=Math.floor(a.right+16)+"px"):"left"===t&&(l.style.top=Math.floor(a.top+a.height/2-n.height/2)+"px",l.style.left=Math.floor(a.left-n.width-16)+"px")},J=b((({icon:t,onClick:i,disabled:a,className:n,color:s="primary",solid:o,active:c,tooltip:r,buttonProps:u,size:m},h)=>d(Y,{label:r,disabled:a,children:d("button",{ref:h,disabled:a,className:l("iui-btn iui-icon-btn",n,s,m,{active:c,solid:o}),onClick:i,type:u?.type||i?"button":"submit",...u,children:d(e,{icon:t})})}))),K=({children:e})=>d("div",{className:"page-container",children:d("div",{className:"page-content",children:d("div",{className:"widget-container",children:e})})}),Z=({isLoading:e,isFullPage:t,classNameLoader:i,children:a})=>a?C.map(a,(t=>g(t,{className:l(t.props.className,{relative:e}),children:u(m,{children:[t.props.children,e&&d("div",{className:l("loader",i),children:d("span",{className:"spinner"})})]})}))):e?d("div",{className:(t?"full-page-loader":"empty-loader")+" relative",children:d("div",{className:l("loader",i),children:d("span",{className:"spinner"})})}):d(m,{}),G=({isLoading:e})=>e?d("div",{className:"full-screen-loader",children:d("div",{className:"loader",children:d("span",{className:"spinner"})})}):null,_=()=>d("div",{className:"lazy-loader",children:d("div",{className:"loader",children:d("span",{className:"spinner"})})}),Q={prefix:"fal",iconName:"triangle-exclamation",icon:[512,512,[],"f071","M256 360c-13.25 0-23.1 10.74-23.1 24c0 13.25 10.75 24 23.1 24c13.25 0 23.1-10.75 23.1-24C280 370.7 269.3 360 256 360zM256 320c8.843 0 15.1-7.156 15.1-16V160c0-8.844-7.155-16-15.1-16S240 151.2 240 160v144C240 312.8 247.2 320 256 320zM504.3 397.3L304.5 59.38C294.4 42.27 276.2 32.03 256 32C235.8 32 217.7 42.22 207.5 59.36l-199.9 338c-10.05 16.97-10.2 37.34-.4218 54.5C17.29 469.5 35.55 480 56.1 480h399.9c20.51 0 38.75-10.53 48.81-28.17C514.6 434.7 514.4 414.3 504.3 397.3zM476.1 435.1C472.7 443.5 464.8 448 455.1 448H56.1c-8.906 0-16.78-4.484-21.08-12c-4.078-7.156-4.015-15.3 .1562-22.36L235.1 75.66C239.4 68.36 247.2 64 256 64c0 0-.0156 0 0 0c8.765 .0156 16.56 4.359 20.86 11.64l199.9 338C480.1 420.7 481.1 428.8 476.1 435.1z"]},ee={prefix:"fal",iconName:"circle-info",icon:[512,512,[],"f05a","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM256 184c13.25 0 24-10.74 24-24c0-13.25-10.75-24-24-24S232 146.7 232 160C232 173.3 242.7 184 256 184zM304 352h-32V240C272 231.2 264.8 224 256 224H224C215.2 224 208 231.2 208 240S215.2 256 224 256h16v96h-32C199.2 352 192 359.2 192 368C192 376.8 199.2 384 208 384h96c8.836 0 16-7.164 16-16C320 359.2 312.8 352 304 352z"]},le={warning:Q,info:ee},te=({title:t,icon:i,type:a,span:n,isLoading:s,children:o})=>d(Z,{isLoading:!!s,children:u("div",{className:l("dashboard-widget",a,{[`grid-span${n}`]:!!n}),children:[u("div",{className:"flex gap-3 mb-3",children:[i&&d("div",{className:"icon",children:d(e,{icon:i||le[a]})}),d("h1",{children:t})]}),o]})}),ie={prefix:"fal",iconName:"link",icon:[512,512,[],"f0c1","M591.5 256c50-50 50-131 0-181s-131-50-181 0L387.9 97.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l22.6-22.6c37.5-37.5 98.3-37.5 135.8 0s37.5 98.3 0 135.8L444.3 357.9c-37.4 37.4-98.1 37.4-135.6 0c-35.6-35.6-37.6-92.6-4.7-130.6l5.3-6.1c5.8-6.7 5.1-16.8-1.6-22.6s-16.8-5.1-22.6 1.6l-5.3 6.1c-43.9 50.7-41.2 126.7 6.2 174.1c49.9 49.9 130.9 49.9 180.8 0L591.5 256zM48.5 256c-50 50-50 131 0 181s131 50 181 0l22.6-22.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-22.6 22.6c-37.5 37.5-98.3 37.5-135.8 0s-37.5-98.3 0-135.8L195.7 154.1c37.4-37.4 98.1-37.4 135.6 0c35.6 35.6 37.6 92.6 4.7 130.6l-5.3 6.1c-5.8 6.7-5.1 16.8 1.6 22.6s16.8 5.1 22.6-1.6l5.3-6.1c43.9-50.7 41.2-126.7-6.2-174.1C303.9 81.5 223 81.5 173 131.4L48.5 256z"]},ae={prefix:"fal",iconName:"arrow-up-right-from-square",icon:[384,512,[],"f08e","M336 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l121.4 0L212.7 276.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L480 54.6 480 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-160c0-8.8-7.2-16-16-16L336 0zM64 32C28.7 32 0 60.7 0 96L0 448c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 144c0 17.7-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32L32 96c0-17.7 14.3-32 32-32l144 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L64 32z"]},ne=({links:l})=>{const{t:t}=c();return d(m,{children:d(te,{title:t("FastLinks"),icon:ie,isLoading:!1,children:d("div",{className:"short-links-widget mt-4",children:d("ul",{children:l.map(((l,t)=>u("li",{onClick:l.onClick,className:"clickable",children:[d(e,{icon:l.icon||ae,className:"mr-3"}),l.label]},`short-links-${t}`)))})})})})},se=({condition:e,wrapper:l,children:t})=>e?l(t):t,oe={info:F,error:E},ce=({title:t,titleEl:i,desc:a,descEl:n,isOpen:s,onClose:o,isLoading:r,confirmButton:h,cancelButton:b,additionalButton:g,isKeyboardDisabled:C,hideActionButtons:N,noBackgroundClick:w,noOverflow:x,type:S,size:k,noPadding:M,className:L,children:z})=>{const{t:D}=c(),O=p(null),T=p(null),R=v((()=>{O.current?.classList.add("closing"),setTimeout(o,200)}),[O,o]);return(({isOpen:e,onClose:l,submit:t,isDisabled:i})=>{f((()=>{if(e&&!i){const e=e=>{[{key:"Enter",onAction:t.onEnter,disabled:t.isDisabled},{key:"Escape",onAction:l}].forEach((l=>{l.disabled||l.key!==e.key||(e.preventDefault(),e.stopPropagation(),l.onAction())}))};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}}}),[e,t,l,i])})({isOpen:s,isDisabled:C,onClose:R,submit:{onEnter:()=>{h?h.onFormSubmit?T.current?.requestSubmit():(h.onClick?.(),!h.keepOpen&&R()):b?.onClick?b.onClick():R()},isDisabled:!h?.disabled&&!h?.isKeyboardDisabled}}),f((()=>{if(!w){const e=e=>e.target===O.current&&R();return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}}),[w,R]),s?y(d("div",{ref:O,className:"iui-dialog",children:d(Z,{isLoading:!!r,classNameLoader:"dialog-loader",children:d("div",{className:l("iui-dialog-container",k,S,L),children:u(se,{condition:!!h?.onFormSubmit,wrapper:e=>d("form",{ref:T,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),h?.onFormSubmit?.(),!h?.keepOpen&&R()},children:e}),children:[t&&d("h1",{children:t}),i,u("div",{className:l("iui-dialog-content",{padding:!M,"no-overflow":x}),children:[d(se,{condition:!!S,wrapper:e=>d("div",{className:"flex align-center mb-3",children:e}),children:u(m,{children:[S&&d(e,{icon:oe[S],className:"icon"}),a&&d("p",{className:"new-line",children:a}),n]})}),z]}),!N&&u("div",{className:"iui-dialog-actions",children:[d(U,{label:b?.label||D(h?"Cancel":"Close"),icon:b?.icon,solid:!h,onClick:e=>{e.stopPropagation(),b?.onClick?b.onClick():R()}}),g&&d(U,{label:g.label,icon:g.icon,onClick:g.onClick?e=>{e.stopPropagation(),g.onClick(),!g.keepOpen&&R()}:void 0,solid:g.solid,color:g.color,disabled:g.disabled}),h&&d(U,{label:h.label||"Potvrdi",icon:h.icon,solid:!0,onClick:h.onClick?e=>{e.stopPropagation(),h.onClick(),!h.keepOpen&&R()}:void 0,color:"error"===S?"error":void 0,disabled:h.disabled})]})]})})})}),W):null},re={prefix:"fal",iconName:"trash-can",icon:[448,512,[],"f2ed","M432 64h-96l-33.63-44.75C293.4 7.125 279.1 0 264 0h-80C168.9 0 154.6 7.125 145.6 19.25L112 64h-96C7.201 64 0 71.2 0 80c0 8.799 7.201 16 16 16h416c8.801 0 16-7.201 16-16C448 71.2 440.8 64 432 64zM152 64l19.25-25.62C174.3 34.38 179 32 184 32h80c5 0 9.75 2.375 12.75 6.375L296 64H152zM400 128C391.2 128 384 135.2 384 144v288c0 26.47-21.53 48-48 48h-224C85.53 480 64 458.5 64 432v-288C64 135.2 56.84 128 48 128S32 135.2 32 144v288C32 476.1 67.89 512 112 512h224c44.11 0 80-35.89 80-80v-288C416 135.2 408.8 128 400 128zM144 416V192c0-8.844-7.156-16-16-16S112 183.2 112 192v224c0 8.844 7.156 16 16 16S144 424.8 144 416zM240 416V192c0-8.844-7.156-16-16-16S208 183.2 208 192v224c0 8.844 7.156 16 16 16S240 424.8 240 416zM336 416V192c0-8.844-7.156-16-16-16S304 183.2 304 192v224c0 8.844 7.156 16 16 16S336 424.8 336 416z"]},de=({textId:e,itemUuid:l,setItemUuid:t,reloadItems:i,deleteItemFunction:a})=>{const[n,s]=h(!1),{t:o}=c();return d(ce,{isOpen:!!l,onClose:()=>t(""),title:o(`Delete${e}Title`),desc:o(`Delete${e}Desc`),isLoading:n,type:"info",confirmButton:{label:o("Delete"),icon:re,keepOpen:!0,onClick:()=>{s(!0),a(l).then((()=>{i(),t("")})).catch((()=>{})).finally((()=>s(!1)))}}})},ue=b((({label:e,value:t=!1,setValue:i,required:a,disabled:n,className:s,tooltip:o,children:c},r)=>d(Y,{label:o||"",children:u("label",{ref:r,className:l("iui-checkbox",s,{disabled:n}),children:[d("input",{required:a,disabled:n,type:"checkbox",checked:t&&"middle"!==t,onChange:()=>i(!t)}),d("svg",{className:l("icon",{selected:t&&"middle"!==t}),focusable:"false",viewBox:"0 0 448 512","aria-hidden":"true",children:d("path","middle"===t?{d:"M64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM152 232H296c13.3 0 24 10.7 24 24s-10.7 24-24 24H152c-13.3 0-24-10.7-24-24s10.7-24 24-24z"}:t?{d:"M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}:{d:"M384 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H384zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"})}),e?d("p",{children:e}):c]})}))),me=({label:e,shrink:t,focus:i,required:a,className:n,minWidth:s,helperText:o,errorText:c,error:r,children:h})=>u("div",{className:l("iui-input-container",n,{error:r}),style:{minWidth:s},children:[u("fieldset",{className:l({shrink:t,focus:i}),children:[!!e&&u(m,{children:[d("label",{children:a?`${e} *`:e}),d("legend",{children:a?`${e} *`:e})]}),h]}),r?c&&d("p",{className:"helper-text new-line",children:c}):o&&d("p",{className:"helper-text new-line",children:o})]}),he=b((({id:t,label:i,value:a,setValue:n,required:s,disabled:o,autoFocus:c,placeholder:r,helperText:m,errorText:p,className:f,inputProps:b,onBlur:g,onFocus:C,error:v,endText:N,endButton:w},x)=>{const[y,S]=h(!1),[k,M]=h(!1);return d(me,{label:i,shrink:!!(a||r||k),focus:y,required:s,helperText:m,errorText:p,error:v??!(!b?.pattern||!a||new RegExp(b.pattern).test(a)),className:f,children:u("div",{className:l("flex align-center",{"with-end-button":w,disabled:o}),children:[d("input",{id:t,ref:x,autoFocus:c,onFocus:e=>{S(!0),k&&M(!1),C?.(e)},onBlur:e=>{S(!1),g?.(e)},placeholder:r,value:a??"",onChange:n?e=>n(e.target.value):void 0,required:s,disabled:o,onAnimationStart:()=>M(!0),...b}),N&&d("p",{className:"ml-n2 mr-2",children:N}),w&&d(e,{className:w.disabled?"disabled":void 0,icon:w.icon,onClick:w.disabled?void 0:w.onClick})]})})})),pe=e=>{if(!e)return"";const l=e.toString();let[t,i]=l.split(".");const a=t.replace(/\B(?=(\d{3})+(?!\d))/g,".");return i?`${a},${i}`:l.endsWith(".")?`${a},`:a},fe=b((({value:e,setValue:l,label:t,required:i,disabled:a,autoFocus:n,placeholder:s,helperText:o,errorText:c,error:r,className:u,allowNegative:m,decimalPlaces:p=2,alignLeft:f,endText:b,inputProps:g},C)=>{const[v,N]=h(""),w=document.activeElement;return d(he,{ref:C,value:pe(e),setValue:e=>{const t=w.selectionStart;let i=p?e.replace(/\.$/,",").replaceAll(".","").replace(",","."):e.replaceAll(".","");if(new RegExp(`^${m?"-?":""}\\d*${p?`(?:[.,])?(\\d{1,${p}})?`:""}$`).test(i)||!e){const e=pe(i);N(e),l(i),setTimeout((()=>{const l=e.length-v.length>1?t+1:t;w.setSelectionRange&&w.setSelectionRange(l,l)}))}},label:t,required:i,disabled:a,placeholder:s||(p?`0,${"0".repeat(p)}`:"0"),inputProps:{className:f?void 0:"text-right",inputMode:"numeric",...g},className:u,autoFocus:n,helperText:o,errorText:c,endText:b,error:r})})),be={prefix:"far",iconName:"calendar",icon:[448,512,[],"f133","M152 64H296V24C296 10.75 306.7 0 320 0C333.3 0 344 10.75 344 24V64H384C419.3 64 448 92.65 448 128V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V128C0 92.65 28.65 64 64 64H104V24C104 10.75 114.7 0 128 0C141.3 0 152 10.75 152 24V64zM48 448C48 456.8 55.16 464 64 464H384C392.8 464 400 456.8 400 448V192H48V448z"]},ge={prefix:"fas",iconName:"xmark",icon:[320,512,[],"f00d","M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"]},Ce=e=>e?k(e).format("DD.MM.YYYY."):"/",ve=e=>k(e).format("yyyy-MM-DD"),Ne=(e,l)=>e?k(e).format("DD.MM.YYYY. HH:mm"+(l?":ss":"")):"/",we=(e,l)=>e?k(e).format("HH:mm"+(l?":ss":"")):"/",xe=(e,l)=>k(e).add(l,"days").toISOString(),ye=e=>!!e&&k(new Date)>k(e),Se=()=>k().format("DD.MM.YYYY.").toString(),ke=()=>k().format("yyyy-MM-DD").toString(),Me=e=>k(e).diff(new Date,"days"),Le=(e,l)=>`${e}-${l<10?`0${l}`:l}`,ze=({isOpen:e,onClose:t,renderButton:i,placementX:a,placementY:n="auto",size:s,className:o,children:c})=>{const r=p(null),b=p(null),g=p(null),[C,N]=h({offsetLeft:0,offsetTop:0}),[w,x]=h(),S=v((()=>{if(g.current&&r.current){const e=g.current.getBoundingClientRect(),l=r.current.getBoundingClientRect();let t=e.bottom+5;const i=e.left+("right"===a?e.width-l.width:0);"bottom"===n&&x(window.innerHeight-e.bottom-20),"top"===n&&x(window.innerHeight-e.top+40),("auto"===n&&t+l.height>window.innerHeight||"top"===n)&&(t=e.top-l.height-5),N({offsetTop:t,offsetLeft:i})}}),[r,g,a,n]);return f((()=>(e?window.addEventListener("resize",S):window.removeEventListener("resize",S),document.body.style.marginRight=e&&window.innerWidth>document.body.clientWidth?"19px":"",document.body.style.overflow=e?"hidden":"",S(),()=>{window.removeEventListener("resize",S)})),[e,S]),f((()=>{const l=b.current,i=e=>e.target===l&&t();return e?l?.addEventListener("click",i):l?.removeEventListener("click",i),()=>l?.removeEventListener("click",i)}),[e,t]),u(m,{children:[i(g),e?y(d("div",{ref:b,className:"portal-background",children:d("div",{ref:r,className:l("iui-menu",o,s),style:{top:C.offsetTop+"px",left:C.offsetLeft+"px",maxHeight:w||void 0},children:c})}),W):null]})},De={day:{placeholder:"dd",regex:"^[0-9]{2}"},month:{placeholder:"mm",regex:"^[0-9]{2}"},year:{placeholder:"yyyy",regex:"^[0-9]{4}"}},Oe=b((({value:e,setValue:t,setDate:i,values:a,required:n,disabled:s,autoFocus:o,min:c=1,max:r,part:u,previousInput:m,nextInput:b,setFocus:g},C)=>{const[v,N]=h(!1),w=p(null);f((()=>{"year"===u&&4!==e.length||+e>r||+e<c?N(!0):v&&N(!1)}),[u,c,r,e,v]);const x=`^[0-9]{0,${r.toString().length}}$`;return d("input",{ref:C||w,value:e||"",onChange:e=>(e=>{if(e){if(new RegExp(x).test(e)){t(e);const l="year"===u?e:a.year,n="month"===u?e:a.month,s="day"===u?e:a.day;s&&n&&4===l.length&&i(`${l}-${2===n.length?n:`0${n}`}-${2===s.length?s:`0${s}`}`)}}else t("")})(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:e=>{"ArrowLeft"===e.key?(e.preventDefault(),m?.select()):"ArrowRight"===e.key&&(e.preventDefault(),b?.select())},onKeyUp:l=>{"year"!==u&&isFinite(+l.key)&&2===e.length&&b?.select()},onFocus:e=>{g(!0),e.target.select()},onBlur:()=>g(!1),required:n,disabled:s,autoFocus:o,min:c,max:r,inputMode:"numeric",type:"number",tabIndex:"day"!==u?-1:void 0,placeholder:De[u].placeholder,pattern:De[u].regex,className:l({error:v}),style:{width:"year"!==u||e?"month"!==u||e?`${e.length||2}ch`:23:"4ch"}})})),Te=b((({label:i,date:a,setDate:n,required:s,disabled:o,autoFocus:c,helperText:r,error:m,className:b,calendarPlacementX:g},C)=>{const[v,N]=h(a?.split("-")[2]??""),[w,x]=h(a?.split("-")[1]??""),[y,k]=h(a?.split("-")[0]??""),[M,L]=h(!1),[z,D]=h(!1),O=p(null),T=p(null),R=p(null),$=p(null),I=y&&w?new Date(+y,+w,0).getDate():31;return f((()=>{a?[T.current,R.current,$.current].includes(document.activeElement)||(k(a.split("-")[0]??""),x(a.split("-")[1]??""),N(a.split("-")[2]??"")):(k(""),x(""),N(""))}),[a]),d(me,{label:i,shrink:!0,focus:z??M,required:s,helperText:r,className:b,error:m,children:d(ze,{isOpen:M,onClose:()=>L(!1),placementX:g||"left",renderButton:t=>u("div",{ref:t,className:l("date-input",{disabled:o}),children:[u("div",{ref:O,className:"inputs",onClick:()=>T.current?.focus(),children:[d(Oe,{ref:T,value:v,setValue:N,setDate:n,values:{day:v,month:w,year:y},required:s||!!w||!!y,disabled:o,autoFocus:c,max:I,part:"day",nextInput:R.current,setFocus:D}),d("span",{children:"."}),d(Oe,{ref:R,value:w,setValue:x,setDate:n,values:{day:v,month:w,year:y},required:s||!!v||!!y,disabled:o,max:12,part:"month",previousInput:T.current,nextInput:$.current,setFocus:D}),d("span",{children:"."}),d(Oe,{ref:$,value:y,setValue:k,setDate:n,values:{day:v,month:w,year:y},required:s||!!v||!!w,disabled:o,min:1500,max:2500,part:"year",previousInput:R.current,setFocus:D})]}),u("div",{className:"flex",children:[d("div",{className:l("button",{disabled:o}),onClick:()=>!o&&n(""),children:d(e,{icon:ge})}),d("div",{className:l("button",{disabled:o}),onClick:()=>!o&&L(!M),children:d(e,{icon:be})})]})]}),children:d(S,{value:a?t(a).isValid()?new Date(a):new Date:null,onChange:e=>{const l=ve(e);n(l),L(!1)}})})})})),Re=({time:e="00:00",setTime:t,label:i,disabled:a,required:n,className:s})=>{const[o,c]=e.split(":").map((e=>e.padStart(2,"0"))),r=(e,l)=>{let i=isNaN(+e)||"-1"===e?"00":e.replace(/\D/g,"");if(i.length>2&&(i=i.substring(1)),"hh"===l){const e=Math.min(23,parseInt(i)||0).toString().padStart(2,"0");t(`${e}:${c}`)}else{const e=Math.min(59,parseInt(i)||0).toString().padStart(2,"0");t(`${o}:${e}`)}};return d(me,{label:i,shrink:!0,required:n,className:l(s,"time-input-wrapper"),children:u("div",{className:l("time-input",{disabled:a}),children:[d("input",{type:"number",value:o,onChange:e=>r(e.target.value,"hh"),onClick:e=>{e.target.select()},disabled:a,required:n,style:{textAlign:"right"}}),d("span",{className:"fs-m",children:":"}),d("input",{type:"number",value:c,onChange:e=>r(e.target.value,"mm"),onClick:e=>{e.target.select()},disabled:a,required:n})]})})},$e=b((({label:e,value:l,setValue:t,required:i,disabled:a,autoFocus:n,rows:s,placeholder:o,helperText:c,errorText:r,className:u,inputProps:m,error:p},f)=>{const[b,g]=h(!1),[C,v]=h(!1);return d(me,{label:e,shrink:!!(l||o||C),focus:b,required:i,helperText:c,errorText:r,className:u,error:p,children:d("textarea",{ref:f,autoFocus:n,onFocus:()=>{g(!0),C&&v(!1)},onBlur:()=>g(!1),placeholder:i&&o?`${o} *`:o,value:l||"",onChange:e=>t(e.target.value),rows:s,required:i,disabled:a,onAnimationStart:()=>v(!0),...m})})})),Ie=b((({value:e,setValue:t,label:i,required:a,disabled:n,autoFocus:s,placeholder:o,helperText:c,errorText:r,error:u,className:m,allowNegative:h,decimalPlaces:p,align:f,endText:b,inputProps:g},C)=>d(he,{ref:C,value:e?`${e}`.replaceAll(".",","):"",setValue:e=>{p?(new RegExp(`^${h?"-?":""}\\d*(?:[.,])?(\\d{1,${p}})?$`).test(e)||!e)&&t(e?e.replaceAll(",","."):e):(new RegExp(`^${h?"-?":""}\\d*$`).test(e)||!e)&&t(e)},label:i,required:a,disabled:n,placeholder:o||(p?`0.${"0".repeat(p)}`:"0"),inputProps:{className:l({"text-right":"right"===f}),lang:"sr-RS",inputMode:"numeric",...g},className:m,autoFocus:s,helperText:c,errorText:r,endText:b,error:u}))),Pe={prefix:"fal",iconName:"eye",icon:[576,512,[],"f06e","M288 128C217.3 128 160 185.3 160 256s57.33 128 128 128c70.64 0 128-57.32 128-127.9C416 185.4 358.7 128 288 128zM288 352c-52.93 0-96-43.06-96-96s43.07-96 96-96c52.94 0 96 43.02 96 96.01C384 308.9 340.1 352 288 352zM572.5 238.1C518.3 115.5 410.9 32 288 32S57.69 115.6 3.469 238.1C1.563 243.4 0 251 0 256c0 4.977 1.562 12.6 3.469 17.03C57.72 396.5 165.1 480 288 480s230.3-83.58 284.5-206.1C574.4 268.6 576 260.1 576 256C576 251 574.4 243.4 572.5 238.1zM543.2 260.2C492.3 376 394.5 448 288 448c-106.5 0-204.3-71.98-255-187.3C32.58 259.6 32.05 256.9 31.1 256.2c.0547-1.146 .5859-3.783 .7695-4.363C83.68 135.1 181.5 64 288 64c106.5 0 204.3 71.98 255 187.3c.3945 1.08 .9238 3.713 .9785 4.443C543.9 256.9 543.4 259.6 543.2 260.2z"]},Ae={prefix:"fal",iconName:"eye-slash",icon:[640,512,[],"f070","M272.9 137.2l30.91 24.41c5.301-.9102 10.67-1.638 16.23-1.638c50.78 0 92.05 39.74 95.36 89.74l30.82 24.33C447 268.1 448 262.2 448 256.1C448 185.4 390.7 128 320 128C303.3 128 287.5 131.4 272.9 137.2zM320 448c-106.5 0-204.3-71.98-255-187.3C64.58 259.6 64.05 256.9 63.1 256.2c.0547-1.146 .5859-3.783 .7695-4.363c12.84-29.22 28.7-55.61 46.89-78.8l-25.05-19.78c-20.06 25.52-37.34 54.31-51.13 85.71C33.56 243.4 31.1 251 31.1 256c0 4.977 1.562 12.6 3.469 17.03c54.25 123.4 161.6 206.1 284.5 206.1c48.13 0 93.81-12.96 134.9-35.96l-27.74-21.9C393.6 438.7 357.4 448 320 448zM320 64c106.5 0 204.3 71.98 255 187.3c.3945 1.08 .9238 3.713 .9785 4.443c-.0547 1.145-.5859 3.783-.7695 4.361c-12.84 29.22-28.69 55.61-46.88 78.79l25.05 19.78c20.06-25.52 37.33-54.3 51.13-85.7c1.906-4.43 3.469-12.07 3.469-17.03c0-4.977-1.562-12.6-3.469-17.03c-54.25-123.4-161.6-206.1-284.5-206.1c-48.13 0-93.8 12.96-134.9 35.95l27.74 21.9C246.4 73.33 282.6 64 320 64zM320 384c16.68 0 32.56-3.42 47.17-9.229l-30.92-24.41c-5.307 .9121-10.68 1.644-16.25 1.644c-50.8 0-92.09-39.78-95.37-89.76L193.8 237.9C192.1 243.9 192 249.8 192 256C192 326.7 249.3 384 320 384zM633.9 483.4L25.9 3.42C18.1-2.033 8.936-.8301 3.436 6.061c-5.469 6.938-4.281 17 2.656 22.49l608 480C617 510.9 620.5 512 624 512c4.719 0 9.406-2.094 12.56-6.078C642 498.1 640.8 488.9 633.9 483.4z"]},Fe=e=>{const[l,t]=h(!1);return d(he,{...e,inputProps:{type:l?"text":"password",autoComplete:e.newPassword?"new-password":void 0,...e.inputProps},endButton:{icon:l?Ae:Pe,onClick:()=>t(!l)}})},Ee=b((({label:e,value:t,selected:i,setSelected:a,required:n,groupName:s,disabled:o,className:c,children:r},m)=>u("div",{ref:m,className:l("iui-radio",c,i===t?"selected":"clickable",{disabled:o}),onClick:i!==t?()=>!o&&a(t):void 0,children:[u("div",{className:"iui-radio-icon",children:[d("svg",{className:l("icon",{selected:i===t}),focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true",children:d("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})}),d("svg",{className:l("icon secondary",{selected:i===t}),focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true",children:d("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"})}),n&&!o&&!i&&d("input",{className:"fake-input",type:"radio",name:s,required:!0,tabIndex:-1,onFocus:()=>m.current?.focus()})]}),e?d("p",{children:e}):r]}))),Ve=({title:e,desc:t,value:i,selected:a,setSelected:n,disabled:s,className:o,children:c})=>d(Ee,{value:i,selected:a,setSelected:n,disabled:s,className:l("radio-large",o),children:u("div",{className:"full-width",children:[d("p",{className:"bold mb-3",children:e}),d("p",{children:t}),d("div",{children:c})]})}),Be={prefix:"fal",iconName:"magnifying-glass",icon:[512,512,[],"f002","M507.3 484.7l-141.5-141.5C397 306.8 415.1 259.7 415.1 208c0-114.9-93.13-208-208-208S-.0002 93.13-.0002 208S93.12 416 207.1 416c51.68 0 98.85-18.96 135.2-50.15l141.5 141.5C487.8 510.4 491.9 512 496 512s8.188-1.562 11.31-4.688C513.6 501.1 513.6 490.9 507.3 484.7zM208 384C110.1 384 32 305 32 208S110.1 32 208 32S384 110.1 384 208S305 384 208 384z"]},He=({onSearch:e,className:l})=>{const[t,i]=h(""),{t:a}=c();return d(he,{className:l,inputProps:{"aria-label":"search",onKeyDown:l=>{"Enter"===l.key&&(l.stopPropagation(),l.preventDefault(),e(l.target.value))}},label:a("Search"),value:t,setValue:i,endButton:{icon:Be,onClick:()=>e(t)}})},je=e=>({control:e=>({...e,border:"none",borderRadius:4,boxShadow:"none",minHeight:36}),valueContainer:(e,l)=>({...e,padding:l.isMulti?"8px 14px":"10px 14px",fontSize:13}),menu:l=>({...l,marginTop:2,width:e||"100%",minWidth:"100%",borderRadius:8,boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0px 3px 14px 2px rgba(0, 0, 0, 0.12);"}),menuPortal:e=>({...e,zIndex:1001}),input:e=>({...e,padding:0,margin:0,borderRadius:4}),option:(e,l)=>({...e,fontSize:13,backgroundColor:l.isSelected?"var(--primary) !important":l.isFocused?"#eee !important":"inherit"}),noOptionsMessage:e=>({...e,fontSize:13,fontStyle:"italic"}),multiValue:e=>({...e,backgroundColor:"var(--primary-o25)"}),placeholder:e=>({...e,whiteSpace:"nowrap"})}),qe=b((({label:e,options:t,value:i,valuesMulti:a,onChange:n,required:s,disabled:o,placeholder:c="",helperText:r,className:m,minWidth:f,menuWidth:b,autoFocus:g,isClearable:C,isOpen:v,onMenuOpen:N,onMenuClose:w,openDirection:x="auto",noOptionsMessage:y,error:S},k)=>{const[L,z]=h(!1),D=p(null);return u(me,{label:e,shrink:!!(i||a?.length||c),focus:L,required:s,helperText:r,className:l("select-wrapper",m),minWidth:f,error:S,children:[d(M,{value:i??a??null,options:t,onChange:n,placeholder:!e&&s?`${c} *`:c,styles:je(b),isDisabled:o,isOptionDisabled:e=>e.disabled,isClearable:C,isMulti:!!a,menuIsOpen:v,menuPlacement:x,menuPortalTarget:document.querySelector("body"),ref:k||D,onFocus:()=>z(!0),onBlur:()=>z(!1),autoFocus:g,noOptionsMessage:()=>y||"Nema opcija",onMenuOpen:N,onMenuClose:w}),s&&!o&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:i?.value??a?.length??"",onChange:()=>{},onFocus:()=>(k??D).current?.focus()})]})})),Ue=b((({label:e,value:t,valuesMulti:i,loadOptions:a,refresh:n,onChange:s,required:o,disabled:c,placeholder:r="",helperText:m,className:f,minWidth:b,menuWidth:g,autoFocus:C,isMulti:v,isClearable:N,isOpen:w,onMenuOpen:x,onMenuClose:y,openDirection:S="auto",noOptionsMessage:k,error:M},z)=>{const[D,O]=h(!1),T=p(null);return u(me,{label:e,shrink:!!(t||i?.length||r),focus:D,required:o,helperText:m,className:l("select-wrapper",f),minWidth:b,error:M,children:[d(L,{value:t||i||null,loadOptions:a,additional:{page:0},onChange:s,placeholder:!e&&o?`${r} *`:r,styles:je(g),isDisabled:c,isOptionDisabled:e=>e.disabled,isClearable:N,isMulti:v,menuIsOpen:w,menuPlacement:S,menuPortalTarget:document.querySelector("body"),selectRef:z||T,onFocus:()=>O(!0),onBlur:()=>O(!1),autoFocus:C,noOptionsMessage:()=>k||"Nema opcija",cacheUniqs:n||void 0,onMenuOpen:x,onMenuClose:y}),o&&!c&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:t?.value||i?.length||"",onChange:()=>{},onFocus:()=>(z||T).current?.focus()})]})})),We=b((({label:e,value:t,valuesMulti:i,loadOptions:a,refresh:n,onChange:s,onCreate:o,required:r,disabled:m,placeholder:f="",helperText:b,className:g,minWidth:C,menuWidth:v,autoFocus:N,isMulti:w,isClearable:x,isOpen:y,onMenuOpen:S,onMenuClose:k,openDirection:M="auto",noOptionsMessage:L,error:D,defaultData:O,formatOptionLabel:T},R)=>{const[$,I]=h(!1),P=p(null),{t:A}=c();return u(me,{label:e,shrink:!!(t||i?.length||f),focus:$,required:r,helperText:b,className:l("select-wrapper",g),minWidth:C,error:D,children:[d(z,{ref:R||P,required:r,value:t||i||null,loadOptions:a,onChange:s,placeholder:!e&&r?`${f} *`:f,styles:je(v),isDisabled:m,isOptionDisabled:e=>e.disabled,isClearable:x,isMulti:w,menuIsOpen:y,onMenuOpen:S,onMenuClose:k,menuPlacement:M,menuPortalTarget:document.querySelector("body"),onFocus:()=>I(!0),onBlur:()=>I(!1),autoFocus:N,noOptionsMessage:()=>L||"Nema opcija",cacheOptions:n||null,defaultOptions:O||!0,onCreateOption:o,formatOptionLabel:T,formatCreateLabel:e=>d("p",{children:`${A("FreeText")} "${e}"`})}),r&&!m&&d("input",{className:"fake-input",required:!0,tabIndex:-1,autoComplete:"off",value:t?.value||t?.label||i?.length||"",onChange:()=>{},onFocus:()=>(R||P).current?.focus()})]})})),Ye=b((({label:t,icon:i,iconRotation:a,onClick:n,to:s,disabled:o,withDevider:c,className:r,children:m},h)=>d("div",{ref:h,className:l("iui-menu-item",r,{clickable:!!n||!!s,disabled:o,"with-devider":c}),onClick:o?void 0:n,children:d(se,{condition:!o&&!!s,wrapper:e=>d(Link,{to:s,children:e}),children:u("div",{className:"flex align-center",children:[i&&d(e,{icon:i,rotation:a,className:"mr-2"}),t&&d("p",{className:"full-width",children:t}),m]})},t)}))),Xe={prefix:"fal",iconName:"ellipsis-vertical",icon:[128,512,[],"f142","M64 384C81.67 384 96 398.3 96 416C96 433.7 81.67 448 64 448C46.33 448 32 433.7 32 416C32 398.3 46.33 384 64 384zM64 224C81.67 224 96 238.3 96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224zM64 128C46.33 128 32 113.7 32 96C32 78.33 46.33 64 64 64C81.67 64 96 78.33 96 96C96 113.7 81.67 128 64 128z"]},Je=({item:e,setSelectedItem:l,setItemToDeleteUuid:t,actions:i})=>{const[a,n]=h(!1),{t:s}=c();return u(ze,{isOpen:a,onClose:()=>n(!1),placementX:"right",renderButton:e=>d(J,{ref:e,icon:Xe,active:a,onClick:e=>{e.stopPropagation(),n(!a)}}),children:[!!l&&d(Ye,{onClick:t=>{t.stopPropagation(),l(e),n(!1)},children:d("p",{children:s("Edit")})}),i?.map((l=>!l.hidden&&d(Ye,{disabled:!!l.disabled,onClick:t=>{t.stopPropagation(),l.onClick(e.uuid),n(!1)},children:d("p",{children:l.label})},l.label))),!!t&&d(Ye,{onClick:l=>{l.stopPropagation(),t(e.uuid),n(!1)},children:d("p",{children:s("Delete")})})]})},Ke={prefix:"fal",iconName:"check",icon:[512,512,[],"f00c","M475.3 123.3l-272 272C200.2 398.4 196.1 400 192 400s-8.188-1.562-11.31-4.688l-144-144c-6.25-6.25-6.25-16.38 0-22.62s16.38-6.25 22.62 0L192 361.4l260.7-260.7c6.25-6.25 16.38-6.25 22.62 0S481.6 117.1 475.3 123.3z"]},Ze={prefix:"fal",iconName:"xmark",icon:[320,512,[],"f00d","M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z"]},Ge=({setData:e,clearItem:l,inputFocusRef:t,defaultDataValue:i})=>u("div",{className:"flex center gap-1",children:[d(J,{icon:Ke,className:"p-1"}),d(J,{icon:Ze,className:"p-1",onClick:()=>{e(i||{}),t?.current?.focus(),l()}})]}),_e=({columns:e,defaultDataValue:l,data:t,setData:i,item:a,clearItem:n,inputFocusRef:s})=>{f((()=>{s?.current?.focus(),i(a??l??{})}),[a,l,s,i]);let o={...t,actions:{value:d(Ge,{setData:i,clearItem:n,defaultDataValue:l,inputFocusRef:s})}};Object.keys(o).forEach((e=>{N(o[e].value)&&(o[e].className="p-1")}));const c={uuid:a?.uuid,cells:o};return d("tr",{"data-id":c.uuid,className:"edit-row",children:e.map((e=>!e.hidden&&d("td",{align:e.align,colSpan:c.cells[e.id]?.span,className:c.cells[e.id]?.className,children:c.cells[e.id]?.value},e.id)))})},Qe=({item:e})=>{const{t:l}=c();return u("div",{className:"table-filter-item",children:[u("p",{className:"label",children:["⁠",e.label]}),d("div",{className:"field",children:e.field}),d(U,{label:l("Delete"),onClick:()=>e.resetField(),size:"m"})]},e.label)},el={prefix:"far",iconName:"filter-circle-xmark",icon:[576,512,[],"e17b","M432 224C352.5 224 288 288.5 288 368s64.47 144 144 144s144-64.47 144-144S511.5 224 432 224zM488.5 401.9c6.242 6.242 6.252 16.37 .0098 22.62c-6.24 6.242-16.37 6.231-22.62-.0113l-33.91-33.91l-33.91 33.91c-6.242 6.242-16.37 6.253-22.62 .0106s-6.232-16.37 .0098-22.62l33.91-33.91l-33.91-33.91c-6.242-6.242-6.251-16.37-.009-22.62s16.37-6.232 22.62 .0106l33.91 33.91l33.91-33.91c6.242-6.242 16.37-6.254 22.61-.0113s6.233 16.37-.009 22.62l-33.91 33.91L488.5 401.9zM223.1 340.7V272.2c0-7.369-2.539-14.51-7.191-20.22L50.77 48.04h410.4l-85.57 105.1c-7.77 9.545-7.061 23.42 1.643 32.13c10.06 10.06 26.62 9.219 35.6-1.812l88.61-108.8c11.26-13.46 13.7-31.89 6.225-47.92C500 10.23 483.8 0 465.3 0H46.65C28.21 0 11.97 10.23 4.283 26.71C-3.195 42.73-.7578 61.16 10.64 74.79l165.4 203.1v67.71c0 12.55 6.178 24.3 16.52 31.45l24.81 19.15C233.1 408.4 256 397.2 256 377.2c0-7.439-3.449-14.46-9.34-19L223.1 340.7z"]},ll={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[],"f002","M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"]},tl=(e,l)=>{const t={...e};return l.forEach((e=>delete t[e])),t},il=(e,l)=>{const t={...e};for(const e in t)e.endsWith(l)&&delete t[e];return t},al=e=>Object.entries(e).reduce(((e,[l,t])=>([null,void 0,""].includes(t)||(e[l]=t),e)),{}),nl=e=>Object.entries(e).reduce(((e,[l,t])=>([null,void 0,""].includes(t)||Array.isArray(t)&&!t.length||(e[l]=t),e)),{}),sl=e=>Object.keys(e).filter((l=>e[l])),ol=e=>e?e.reduce(((e,l)=>({...e,[l]:!0})),{}):{},cl=e=>JSON.parse(JSON.stringify(e)),rl=(e,l)=>JSON.stringify(e)===JSON.stringify(l),dl=(e,l,t,i)=>{const a=e.indexOf(l),n=e.indexOf(i);return a>=0&&n>=0&&("greaterThan"===t?a>n:"greaterThanOrEqualTo"===t?a>=n:"lessThan"===t?a<n:a<=n)},ul=(e,l)=>{const t=new Set(l);return e.filter((e=>t.has(e)))},ml=({columns:e,filters:l,additionalFilters:t,excludeFromSearch:i,searchData:a,setSearchData:n,onSubmit:s,resetData:o,isOpen:r,onClose:m})=>{const[p,f]=h(""),{t:b}=c(),g=w((()=>e.reduce(((e,t)=>l[t]?e.concat(l[t]):e),[])),[e,l]),C=w((()=>g.filter((e=>e?.label.toLowerCase().includes(p.toLowerCase())))),[g,p]);return u(ce,{className:"iui-table-filter",titleEl:u("div",{className:"filters-search",children:[d("h1",{children:b("Filter")}),d(He,{onSearch:f,className:"search-input"})]}),isOpen:r,onClose:()=>{f(""),m()},cancelButton:{icon:ge},additionalButton:{label:b("ResetFilter"),icon:el,onClick:()=>{n(o||{}),s(o||{})},disabled:o?JSON.stringify(a)===JSON.stringify(o):0===Object.keys(a).length},confirmButton:{label:b("Search"),icon:ll,onFormSubmit:()=>{const e=nl(a);s(i?tl(e,i):e)}},children:[C?.map((e=>d(Qe,{item:e},e.label))),t&&d("div",{className:"pb-1",children:t})]})},hl={prefix:"fas",iconName:"angle-left",icon:[256,512,[],"f104","M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"]},pl={prefix:"fas",iconName:"angle-right",icon:[256,512,[],"f105","M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"]},fl={prefix:"fas",iconName:"rotate-right",icon:[512,512,[],"f2f9","M468.9 32.11c13.87 0 27.18 10.77 27.18 27.04v145.9c0 10.59-8.584 19.17-19.17 19.17h-145.7c-16.28 0-27.06-13.32-27.06-27.2c0-6.634 2.461-13.4 7.96-18.9l45.12-45.14c-28.22-23.14-63.85-36.64-101.3-36.64c-88.09 0-159.8 71.69-159.8 159.8S167.8 415.9 255.9 415.9c73.14 0 89.44-38.31 115.1-38.31c18.48 0 31.97 15.04 31.97 31.96c0 35.04-81.59 70.41-147 70.41c-123.4 0-223.9-100.5-223.9-223.9S132.6 32.44 256 32.44c54.6 0 106.2 20.39 146.4 55.26l47.6-47.63C455.5 34.57 462.3 32.11 468.9 32.11z"]},bl=({pagination:{limit:e,offset:l,setLimit:t,setOffset:i,totalRows:a},noTotalRows:n,dataLength:s,footerAction:o,customLimit:r})=>{const{t:m}=c(),h=Math.ceil(a/e);return u("div",{className:"table-footer "+(o?"justify-between":"justify-right"),children:[!!o&&d(J,{icon:o.icon||fl,onClick:o.onClick}),u("div",{className:"pagination",children:[u("div",{className:"flex align-center",children:[d("p",{children:m("rowsPerPage")}),d("select",{value:e,onChange:e=>{const l=Math.floor(+e.target.value);t(l),i(0)},children:(r||D).map((e=>d("option",{value:e,children:e||m("allResults")},e)))}),!n&&d("p",{className:"mr-4",children:e?`${l*e+1}-${l*e+e<=a?l*e+e:a} ${m("of")} ${a}`:`${m("allResults")} ${m("of")} ${a} `})]}),u("div",{className:"flex gap-1 align-center",children:[d("p",n?{children:`${m("page")}: ${l+1}`}:{children:`${m("page")}: ${l+1}/${h}`}),d(J,{disabled:l<1,icon:hl,onClick:()=>i(l-1),size:"s"}),!n&&d("input",{className:"offset-input",placeholder:`1-${h}`,onKeyUp:e=>{if("Enter"===e.key){const l=+e.target.value;"number"==typeof l&&l>=0&&l<=h&&i(l-1),e.target.value=""}}}),d(J,{disabled:n?e>s:l+1>=h,icon:pl,onClick:()=>i(l+1),size:"s"})]})]})]})},gl=({row:e,printTable:l})=>d("tr",{children:e.map((e=>d("th",{colSpan:e.colSpan,rowSpan:e.rowSpan,className:e.color,style:e.minWidth?{minWidth:e.minWidth}:e.width?{width:e.width}:void 0,hidden:e.hidden,children:u("div",{className:"flex align-center",children:["string"==typeof e.label?d("p",{className:`full-width p-3 text-${e.align||"left"}`,children:e.label}):d("div",{className:`full-width px-3 text-${e.align||"left"}`,children:e.label}),!l&&d("div",{className:"vertical-separator"})]})},e.id)))}),Cl=({columns:e,customHeader:t,headerWrap:i,printTable:a,sticky:n})=>d("thead",{className:l({"no-wrap":!i,"sticky-header":n}),children:t?t?.map(((e,l)=>d(gl,{row:e,printTable:a},l))):d(gl,{row:e,printTable:a})}),vl={prefix:"fas",iconName:"print",icon:[512,512,[],"f02f","M448 192H64C28.65 192 0 220.7 0 256v96c0 17.67 14.33 32 32 32h32v96c0 17.67 14.33 32 32 32h320c17.67 0 32-14.33 32-32v-96h32c17.67 0 32-14.33 32-32V256C512 220.7 483.3 192 448 192zM384 448H128v-96h256V448zM432 296c-13.25 0-24-10.75-24-24c0-13.27 10.75-24 24-24s24 10.73 24 24C456 285.3 445.3 296 432 296zM128 64h229.5L384 90.51V160h64V77.25c0-8.484-3.375-16.62-9.375-22.62l-45.25-45.25C387.4 3.375 379.2 0 370.8 0H96C78.34 0 64 14.33 64 32v128h64V64z"]},Nl=e=>Object.keys(e).length,wl=(e,l)=>e.reduce(((e,t)=>t.hidden||t.unavailable||l&&["select","icons","actions"].includes(t.id)?e:e.concat(t.id)),[]),xl=e=>e.reduce(((e,l)=>l.hidden||l.unavailable?e:e.concat(l.id)),[]),yl=e=>Object.entries(e).map((e=>"object"==typeof e[1]?Array.isArray(e[1])?{filter:e[0],type:"ARRAY",value:JSON.stringify(e[1])}:{filter:e[0],type:"OBJECT",value:e[1].value,name:e[1].label}:{filter:e[0],type:"boolean"==typeof e[1]?"BOOLEAN":"STRING",value:e[1]})).filter((e=>![null,void 0,""].includes(e.value))),Sl=e=>{let l={};return e?.forEach((e=>{l[e.filter]="OBJECT"===e.type?{value:e.value,label:e.name}:"ARRAY"===e.type?JSON.parse(e.value):"BOOLEAN"===e.type?"true"===e.value:e.value})),l},kl=({template:e,columnsData:l,setFilters:t,setSort:i})=>{const a=e.filterValues&&Sl(e.filterValues);var n,s;a&&t&&t(a),e.columns&&l?.setColumns((n=l.columns,s=e.columns,n.map((e=>s.includes(e.id)?{...e,hidden:!1}:{...e,hidden:!0})).sort(((e,l)=>s.indexOf(e.id)<s.indexOf(l.id)?-1:1)))),e.sorts&&i&&i(e.sorts[0])},Ml=e=>{const l=document.querySelector(`[data-id="${e}"]`);if(!l)return;const t=l?.closest(".table-container"),i=t.querySelector("thead")?.getBoundingClientRect().height||0,a=l.offsetTop,n=Math.max(0,a-i);t.scrollTo({top:n,behavior:"smooth"})},Ll={prefix:"far",iconName:"file-arrow-down",icon:[384,512,[],"f56d","M216 342.1V240c0-13.25-10.75-24-24-24S168 226.8 168 240v102.1L128.1 303C124.3 298.3 118.2 296 112 296S99.72 298.3 95.03 303c-9.375 9.375-9.375 24.56 0 33.94l80 80c9.375 9.375 24.56 9.375 33.94 0l80-80c9.375-9.375 9.375-24.56 0-33.94s-24.56-9.375-33.94 0L216 342.1zM365.3 93.38l-74.63-74.64C278.6 6.742 262.3 0 245.4 0H64C28.65 0 0 28.65 0 64l.0065 384c0 35.34 28.65 64 64 64H320c35.2 0 64-28.8 64-64V138.6C384 121.7 377.3 105.4 365.3 93.38zM336 448c0 8.836-7.164 16-16 16H64.02c-8.838 0-16-7.164-16-16L48 64.13c0-8.836 7.164-16 16-16h160L224 128c0 17.67 14.33 32 32 32h79.1V448z"]},zl=()=>{f((()=>{const e=window.zE??null;if(e)return e.hide(),()=>e.show()}),[])},Dl=({isOpen:e,onClose:t,columns:i,excludeColumnIds:a=[],customHeader:n,organization:s,filters:o,label:r,optionalNode:p,getPrintData:b,formatPrintData:g,saveXlsx:C,totals:v})=>{const[N,w]=h([]),[x,S]=h(0),[k,M]=h(!1),{t:L}=c();zl();const z=i.filter((e=>!["actions","select",...a].includes(e.id)));return f((()=>(W?.classList.add("hidden"),()=>{W?.classList.remove("hidden")})),[]),f((()=>{M(!0),b({limit:1e3,offset:x}).then((e=>{w((l=>{const t=e.data.length?g(e.data):[],i=[...l,...t];return e.totalRows&&e.totalRows>i.length?S(x+1):M(!1),e.totalRows&&e.totalRows>l.length?i:l}))})).catch((()=>M(!1)))}),[x,g,b]),e?y(u("div",{className:"iui-print-dialog",children:[u("div",{className:"content",children:[u("div",{className:"flex justify-between",children:[s?u("div",{children:[d("p",{className:"name",children:s.name}),s.taxId&&d("p",{children:`${L("TaxId")}: ${s.taxId}`}),s.registrationNumber&&d("p",{children:`${L("BusinessCode")}: ${s.registrationNumber}`}),s.jbkjs&&u("p",{children:["JBKJS: ",s.jbkjs]}),s.email&&u("p",{children:["Email: ",s.email]})]}):d("div",{}),d("div",{className:"text-right",children:d("p",{children:`${L("PrintDate")}: ${Se()}`})})]}),d("h4",{className:"my-3 text-center",children:r}),o&&u("div",{className:"flex justify-between",children:[d("div",{children:o.basic?.map((e=>!!e.value&&d("div",{className:"mb-2",children:d("p",{children:`${e.label}: ${e.value}`})},e.value)))}),o.date&&d("div",{children:o.date.map((e=>(!!e.from||!!e.to)&&d("div",{className:"mb-2 text-right",children:u("p",{children:[e.label," ",!!e.from&&`${L("from")} ${Ce(e.from)}`," ",`${L("to")} ${Ce(e.to||(new Date).toString())}`]})},e.label)))})]}),p?.aboveTable,N&&u("table",{width:"100%",className:"print-table",children:[d(Cl,{columns:z,customHeader:n,headerWrap:!0}),d("tbody",{children:u(m,{children:[N.map((e=>{let t=0;return d("tr",{className:e.className,children:z.map((i=>{const a=e.cells[i.id];return t+=a?.span?-1===a.span||a.span>z.length?z.length-t:a.span:1,z.length>=t&&d("td",{align:a?.align||i.align,className:l(i.color,a?.className,{"word-break":i.break}),colSpan:-1===a?.span?z.length:a?.span,children:a?.printValue??a?.value},i.id)}))},e.uuid)})),!!v&&d("tr",{children:z.map((({id:e})=>d("td",{align:v.cells[e]?.align||"right",colSpan:v.cells[e]?.span,className:"py-3",children:d("strong",{children:v.cells[e]?.value})},e)))})]})})]}),p?.bellowTable]}),u("div",{className:"iui-print-actions no-print",children:[d(U,{label:L("Cancel"),icon:ge,onClick:e=>{e.stopPropagation(),t()},className:"mr-3"}),!!C&&d(U,{label:L("SaveXlsx"),icon:Ll,onClick:()=>C(),className:"mr-3"}),d(U,{label:L("Print"),icon:vl,solid:!0,onClick:()=>window.print()})]}),d(G,{isLoading:k})]}),document.body):null},Ol={prefix:"far",iconName:"arrow-right-arrow-left",icon:[512,512,[],"f0ec","M488 344H79.24l74.29-79.63C162.6 254.7 162.1 239.5 152.4 230.5C142.7 221.4 127.5 221.9 118.5 231.6l-112 120c-8.625 9.219-8.625 23.53 0 32.75l112 120C123.2 509.4 129.6 512 136 512c5.875 0 11.75-2.125 16.38-6.469c9.688-9.031 10.22-24.22 1.156-33.91L79.24 392H488c13.25 0 24-10.75 24-24S501.3 344 488 344zM24 168h408.8l-74.29 79.63c-9.062 9.688-8.531 24.88 1.156 33.91c9.656 9.094 24.88 8.562 33.91-1.156l112-120c8.625-9.219 8.625-23.53 0-32.75l-112-120C388.8 2.562 382.4 0 376 0c-5.875 0-11.75 2.125-16.38 6.469c-9.688 9.031-10.22 24.22-1.156 33.91L432.8 120H24C10.75 120 0 130.8 0 144S10.75 168 24 168z"]},Tl={prefix:"fas",iconName:"grip-dots-vertical",icon:[256,512,[],"e411","M0 96C0 69.49 21.49 48 48 48C74.51 48 96 69.49 96 96C96 122.5 74.51 144 48 144C21.49 144 0 122.5 0 96zM0 256C0 229.5 21.49 208 48 208C74.51 208 96 229.5 96 256C96 282.5 74.51 304 48 304C21.49 304 0 282.5 0 256zM96 416C96 442.5 74.51 464 48 464C21.49 464 0 442.5 0 416C0 389.5 21.49 368 48 368C74.51 368 96 389.5 96 416zM160 96C160 69.49 181.5 48 208 48C234.5 48 256 69.49 256 96C256 122.5 234.5 144 208 144C181.5 144 160 122.5 160 96zM256 256C256 282.5 234.5 304 208 304C181.5 304 160 282.5 160 256C160 229.5 181.5 208 208 208C234.5 208 256 229.5 256 256zM160 416C160 389.5 181.5 368 208 368C234.5 368 256 389.5 256 416C256 442.5 234.5 464 208 464C181.5 464 160 442.5 160 416z"]},Rl=({id:l,items:t,search:n})=>{const[s,o]=h([]);return f((()=>{n.length&&o(t.filter((e=>("string"==typeof e.label?e.label:e.labelForFilter??"").toLocaleLowerCase().includes(n.toLocaleLowerCase()))))}),[n,t]),d(i,{droppableId:l,children:({droppableProps:l,innerRef:i,placeholder:o})=>u("div",{...l,ref:i,className:"list-box",children:[(n.length?s:t).map((l=>d(a,{draggableId:l.id,index:t.indexOf(l),children:({innerRef:t,draggableProps:i,dragHandleProps:a})=>u("div",{className:"item",ref:t,...i,...a,style:{...i.style,top:"unset",left:"unset"},children:[l.label,d(e,{icon:Tl})]})},l.id))),o]})})},$l=({columns:l,setColumns:t,isOpen:i,onClose:a,withSearch:s})=>{const[o,r]=h([]),[p,b]=h([]),[g,C]=h(""),[v,N]=h(""),{t:w}=c();f((()=>{if(i){let e=[],t=[];l.forEach((l=>"actions"!==l.id&&!l.unavailable&&(l.hidden?e.push(l):t.push(l)))),r(e),b(t)}}),[i,l]);return d(n,{onDragEnd:({source:e,destination:l})=>{if(!l)return;const t=[...o],i=[...p],a="hidden"===l.droppableId,n="hidden"===e.droppableId?t:i,s=a?t:i,[c]=n.splice(e.index,1);s.splice(l.index,0,c),e.droppableId!==l.droppableId?(s[l.index].hidden=a,r(t),b(i)):a?r(t):b(i)},children:d(ce,{isOpen:i,onClose:a,confirmButton:{label:w("Confirm"),onClick:()=>{const e=[...p,...o],i=l[l.length-1];"actions"===i.id&&e.push(i),t(e),a()}},cancelButton:{label:w("Cancel")},noBackgroundClick:!0,children:u("div",{className:"dual-list-container",children:[d("p",{className:"pb-3",children:w("DragDropListsInfo")}),u("div",{className:"dual-list-content",children:[u("p",{className:"bold ml-2",children:[w("HiddenColumns"),":"]}),d("div",{}),u("p",{className:"bold ml-2",children:[w("SelectedColumns"),":"]}),s&&u(m,{children:[d(He,{onSearch:C}),d("div",{}),d(He,{onSearch:N})]}),d(Rl,{id:"hidden",items:o,search:g}),d("div",{className:"exchange-icon",children:d(e,{icon:Ol})}),d(Rl,{id:"visible",items:p,search:v})]})]})})})},Il={prefix:"fal",iconName:"arrow-down-wide-short",icon:[576,512,[],"f160","M368 432h-64c-8.844 0-15.1 7.156-15.1 16S295.2 464 304 464h64c8.844 0 16-7.156 16-16S376.8 432 368 432zM432 304h-128c-8.844 0-15.1 7.156-15.1 16S295.2 336 304 336h128c8.844 0 16-7.156 16-16S440.8 304 432 304zM496 176h-192c-8.844 0-15.1 7.156-15.1 16S295.2 208 304 208h192C504.8 208 512 200.8 512 192S504.8 176 496 176zM560 48h-256c-8.844 0-15.1 7.156-15.1 16S295.2 80 304 80h256C568.8 80 576 72.84 576 64S568.8 48 560 48zM224 352c-4.094 0-8.188 1.562-11.31 4.688L144 425.4V48C144 39.16 136.8 32 128 32S112 39.16 112 48v377.4l-68.69-68.69c-6.25-6.25-16.38-6.25-22.62 0s-6.25 16.38 0 22.62l96 96c6.25 6.25 16.38 6.25 22.62 0l96-96c6.25-6.25 6.25-16.38 0-22.62C232.2 353.6 228.1 352 224 352z"]},Pl={prefix:"fal",iconName:"arrow-down-short-wide",icon:[576,512,[],"f884","M304 208h128C440.8 208 448 200.8 448 192s-7.156-16-16-16h-128c-8.844 0-15.1 7.156-15.1 16S295.2 208 304 208zM304 336h192c8.844 0 16-7.156 16-16s-7.156-16-16-16h-192c-8.844 0-15.1 7.156-15.1 16S295.2 336 304 336zM304 80h64c8.844 0 16-7.156 16-16S376.8 48 368 48h-64c-8.844 0-15.1 7.156-15.1 16S295.2 80 304 80zM560 432h-256c-8.844 0-15.1 7.156-15.1 16S295.2 464 304 464h256c8.844 0 16-7.156 16-16S568.8 432 560 432zM224 352c-4.094 0-8.188 1.562-11.31 4.688L144 425.4V48C144 39.16 136.8 32 128 32S112 39.16 112 48v377.4l-68.69-68.69c-6.25-6.25-16.38-6.25-22.62 0s-6.25 16.38 0 22.62l96 96c6.25 6.25 16.38 6.25 22.62 0l96-96c6.25-6.25 6.25-16.38 0-22.62C232.2 353.6 228.1 352 224 352z"]},Al=({sortOptions:l,sort:t,setSort:i})=>(c(),d(m,{children:l.map((l=>d(Ye,{className:"menu-item-m",onClick:()=>i(t===l.desc?l.asc:l.desc),children:u("div",{className:"flex center justify-between full-width",children:[d("p",{className:"mr-5 mb-0",children:l.label}),t===l.desc&&d(e,{icon:Il}),t===l.asc&&d(e,{icon:Pl})]})},l.label)))})),Fl={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"]},El=e=>localStorage.getItem(e),Vl=(e,l)=>localStorage.setItem(e,l),Bl=e=>localStorage.removeItem(e),Hl=()=>localStorage.getItem(`${El("activeUser")}-defaultOrg`),jl=e=>localStorage.setItem(`${El("activeUser")}-defaultOrg`,e),ql=()=>localStorage.getItem(`${El("activeUser")}-activeOrg`),Ul=e=>localStorage.setItem(`${El("activeUser")}-activeOrg`,e),Wl=window.location.host.includes("test.inception.rs")||window.location.host.includes("web-bankt.erstebank.rs")||window.location.host.includes("localhost:")?"https://report-templates.api.test.inception.rs":"https://report-templates.api.inception.rs",Yl=e=>axiosInstance.post("/report-template",{...e,organization:{uuid:ql()},subsystem:moduleId},{headers:{baseUrl:Wl}}),Xl=e=>axiosInstance.delete(`/report-templates/${e}`,{headers:{baseUrl:Wl}}),Jl=({identifier:e,onSelect:l})=>{const[t,i]=h(!1),[a,n]=h([]),[s,o]=h(5),[r,p]=h(0),[b,g]=h(0),[C,N]=h({}),[w,x]=h({}),[y,S]=h(!1),[k,M]=h(""),{t:L}=c(),z=[{id:"name",label:L("Name")},{id:"public",label:L("PublicTemplate")},{id:"actions",label:L("Actions"),width:"70px"}],D=v((()=>{t&&(S(!0),((e,l,t)=>axiosInstance.get("/report-templates",{params:{...e,...l,fetchOptions:t,organizationUuid:ql(),subsystem:moduleId},headers:{baseUrl:Wl}}).then((({data:e})=>({templates:e.reportTemplates,totalRows:e.pagination.totalRows}))))({limit:s,offset:r},{identifier:e,...al(C)},["FILTER_VALUES"]).then((({templates:e,totalRows:t})=>{n(e.map((e=>({uuid:e.uuid,onRowClick:()=>{l(e),i(!1)},cells:{name:{value:e.name},public:{value:L(e.isPublic?"Yes":"No")},actions:{value:d(Je,{item:e,setItemToDeleteUuid:()=>M(e.uuid)}),unclickable:!0}}})))),g(t)})).catch((()=>{})).finally((()=>S(!1))))}),[t,s,r,e,C]);return f(D,[D]),u(m,{children:[d(Ye,{label:L("SelectTemplate"),onClick:()=>i(!0)}),d(ce,{title:L("TemplateList"),isOpen:t,onClose:()=>i(!1),size:"l",children:d(st,{columns:z,data:a,isLoading:y,serverSidePagination:{limit:s,offset:r,setLimit:o,setOffset:p,totalRows:b},filterData:{activeFilterNo:Nl(C),columns:wl(z),filters:Kl(w,x,L),search:C,searchData:w,setSearchData:x,onSubmit:e=>{p(0),N(e)}}})}),d(de,{itemUuid:k,setItemUuid:M,textId:"Template",deleteItemFunction:Xl,reloadItems:D})]})},Kl=(e,l,t)=>({name:{label:t("Name"),field:d(he,{placeholder:t("AddInput")+"...",value:e.nameLike,setValue:t=>l({...e,nameLike:t})}),resetField:()=>l(tl(e,["nameLike"]))},public:{label:t("PublicTemplates"),field:d(qe,{placeholder:t("Choose"),value:void 0!==e.isPublic?{value:e.isPublic,label:t(e.isPublic?"Yes":"No")}:null,options:[{value:!0,label:t("Yes")},{value:!1,label:t("No")}],onChange:t=>l({...e,isPublic:t.value})}),resetField:()=>l(tl(e,["isPublic"]))}}),Zl=({identifier:e,data:{searchData:l,visibleColumns:t,sorts:i},onSubmitCallback:a,allowPublicCreate:n})=>{const[s,o]=h(!1),[r,p]=h({}),[f,b]=h(!1),{t:g}=c();return u(m,{children:[d(Ye,{label:g("CreateTemplateLong"),onClick:()=>o(!0)}),d(ce,{title:g("CreateTemplate"),isOpen:s,onClose:()=>o(!1),size:"l",isLoading:f,confirmButton:{onFormSubmit:()=>{b(!0);const n=al({identifier:e,name:r.name,isPublic:r.isPublic,filterValues:yl(l),columns:t,sorts:i});Yl(n).then((()=>{o(!1),a()})).catch((()=>{})).finally((()=>b(!1)))},keepOpen:!0},children:u("div",{className:"flex column gap-3",children:[d(he,{label:g("Name"),value:r.name,setValue:e=>p({...r,name:e})}),n&&d(ue,{label:g("PublicTemplate"),value:r.isPublic,setValue:e=>p({...r,isPublic:e})})]})})]})},Gl=(e="",l=30)=>e.length>l?`${e.substring(0,l)}...`:e,_l=(e,l,t)=>t?l===t?e("CharNumber",{number:l}):e("CharRange",{from:l||1,to:t}):l?e("CharMin",{from:l}):void 0,Ql=(e,l)=>`^.{${e||0},${l||""}}$`,et=({identifier:e,data:{searchData:l,visibleColumns:t,sorts:i},onClose:a})=>{const{t:n}=c();return d(Ye,{label:n("CreateDefaultTemplate"),onClick:()=>{(()=>{const a=al({identifier:e,name:e,isPublic:!1,isDefault:!0,filterValues:yl(l),columns:t,sorts:i});Yl(a)})(),a()}})},lt=({isOpen:e,onClose:l,label:t,organization:i,filters:a,content:n,saveXlsx:s})=>{const{t:o}=c();return zl(),f((()=>(W?.classList.add("hidden"),()=>{W?.classList.remove("hidden")})),[]),e?y(u("div",{className:"iui-print-dialog",children:[u("div",{className:"content",children:[u("div",{className:"flex justify-between",children:[i?u("div",{children:[d("p",{className:"name",children:i.name}),i.taxId&&d("p",{children:`${o("TaxId")}: ${i.taxId}`}),i.registrationNumber&&d("p",{children:`${o("BusinessCode")}: ${i.registrationNumber}`}),i.jbkjs&&u("p",{children:["JBKJS: ",i.jbkjs]}),i.email&&u("p",{children:["Email: ",i.email]})]}):d("div",{}),d("div",{className:"text-right",children:d("p",{children:`${o("PrintDate")}: ${Se()}`})})]}),d("h4",{className:"my-3 text-center",children:t}),a&&u("div",{className:"flex justify-between",children:[d("div",{children:a.basic?.map((e=>!!e.value&&d("div",{className:"mb-2",children:d("p",{children:`${e.label}: ${e.value}`})},e.value)))}),a.date&&d("div",{children:a.date.map((e=>(!!e.from||!!e.to)&&d("div",{className:"mb-2 text-right",children:u("p",{children:[e.label," ",!!e.from&&`${o("from")} ${Ce(e.from)}`," ",`${o("to")} ${Ce(e.to||(new Date).toString())}`]})},e.label)))})]}),n]}),u("div",{className:"iui-print-actions no-print",children:[d(U,{label:o("Cancel"),icon:ge,onClick:e=>{e.stopPropagation(),l()},className:"mr-3"}),!!s&&d(U,{label:o("SaveXlsx"),icon:Ll,onClick:()=>s(),className:"mr-3"}),d(U,{label:o("Print"),icon:vl,solid:!0,onClick:()=>window.print()})]})]}),document.body):null},tt=({columns:e,columnsData:l,filterData:t,sortData:i,printData:a,customPrintData:n,templates:s,additionsalOptions:o})=>{const[r,p]=h(""),[f,b]=h(""),{t:g}=c(),C=()=>b("");return u("div",{className:"table-options gap-2",children:[u("div",{className:"flex align-center gap-2",children:[t&&u(m,{children:[d(j,{number:Nl(t.search),small:!0,children:d(U,{label:g("Filter"),active:"filter"===f,onClick:()=>b("filter"),className:"table-options-btn",size:"s"})}),d(ml,{...t,onSubmit:e=>{t.onSubmit(e),p("")},isOpen:"filter"===f,onClose:C})]}),l&&u(m,{children:[d(U,{label:g("Columns"),active:"columns"===f,onClick:()=>b("columns"),className:"table-options-btn",size:"s"}),"columns"===f&&d($l,{columns:l.columns,setColumns:e=>{l.setColumns(e),p("")},isOpen:!0,onClose:C,withSearch:l.withSearch})]}),i&&d(ze,{renderButton:e=>d(U,{label:g("Sort"),iconEnd:Fl,active:"sort"===f,onClick:()=>b("sort"),ref:e,className:"table-options-btn",size:"s"}),isOpen:"sort"===f,onClose:C,size:i.menuSize,children:d(Al,{...i,setSort:e=>{i.setSort(e),p("")}})}),s&&u(ze,{renderButton:e=>d(U,{label:r?`${g("Templates")} (${Gl(r,30)})`:g("Templates"),iconEnd:Fl,active:"templates"===f,onClick:()=>b("templates"),ref:e,className:"table-options-btn",size:"s"}),isOpen:"templates"===f,onClose:C,children:[d(Jl,{identifier:s.identifier,onSelect:e=>{kl({template:e,columnsData:l,setFilters:e=>{t?.setSearchData(e),t?.onSubmit(il(e,"Obj"))},setSort:i?.setSort}),p(e.name),C()}}),d(Ye,{label:g("RemoveFiltersAndLook"),onClick:()=>{s.onClearFilters(),p(""),C()}}),d(Zl,{identifier:s.identifier,data:s.data,onSubmitCallback:C,allowPublicCreate:s.allowPublicCreate}),d(et,{identifier:s.identifier,data:s.data,onClose:C})]}),o]}),(a??n)&&u(m,{children:[d(U,{label:g("PrintExport"),icon:vl,onClick:()=>b("print"),size:"s"}),"print"===f&&(a?d(Dl,{...a,isOpen:!0,onClose:C,columns:e}):n&&d(lt,{...n,isOpen:!0,onClose:C}))]})]})},it={prefix:"fas",iconName:"ellipsis-vertical",icon:[128,512,[],"f142","M64 360C94.93 360 120 385.1 120 416C120 446.9 94.93 472 64 472C33.07 472 8 446.9 8 416C8 385.1 33.07 360 64 360zM64 200C94.93 200 120 225.1 120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200zM64 152C33.07 152 8 126.9 8 96C8 65.07 33.07 40 64 40C94.93 40 120 65.07 120 96C120 126.9 94.93 152 64 152z"]},at=()=>{const[e,l]=h(!1);return f((()=>{const e=new MutationObserver((e=>{if(e.find((e=>"childList"===e.type))){const e=W.getElementsByClassName("iui-dialog").length>0;l(e)}}));return e.observe(W,{childList:!0}),()=>e.disconnect()}),[]),e},nt={prefix:"fas",iconName:"plus",icon:[448,512,[],"2b","M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"]},st=({columns:t,setColumns:i,withColumnsSearch:a,customHeader:n,data:s,sumRows:o,isLoading:r,headerWrap:p,serverSidePagination:b,customPagination:g,selectedRowUuid:C,footerAction:v,hideFooter:N,noTotalRows:w,showLastBorder:y,className:S,filterData:k,sortData:M,printData:L,customPrintData:z,templates:D,additionsalOptions:O,rowSelect:T,rowHeight:R="m",maxHeight:$,editable:I,keyboard:P})=>{const[A,F]=h(g?.defaultLimit??5),[E,V]=h(0),[B,H]=h([]),[j,q]=h([]),[W,X]=h(""),[J,K]=h({}),[G,_]=h(!1),[Q,ee]=h(!1),[le,te]=h([]),{t:ie}=c(),ae={limit:b?.limit||A,offset:b?.offset||E,setLimit:b?.setLimit||F,setOffset:b?.setOffset||V,totalRows:b?.totalRows||s.length},ne=(({enabled:e,rows:l,selected:t,actions:i})=>{const[a,n]=h(null),s=at();return f((()=>{if(e&&!s){const e=!!i.edit?.item,s=!!i.add?.isAdding,o=o=>{const c=o.ctrlKey||o.metaKey,r=a?l.findIndex((e=>e.uuid===a.uuid)):-1;[{key:"ArrowDown",isActive:!e&&!i.moveDisabled,onAction:()=>{const e=r+1;e<l.length&&(n(l[e]),Ml(l[e].uuid))}},{key:"ArrowUp",isActive:!e&&!i.moveDisabled,onAction:()=>{if(0!==r){const e=r>0?r-1:l.length-1;n(l[e]),Ml(l[e].uuid)}}},{key:"e",normalizedKey:!0,ctrl:!0,isActive:!!i.edit?.enabled&&!!a,onAction:()=>!e&&i.edit?.setItem(a?.item??null)},{key:"Enter",isActive:!e&&!s&&!!a?.onRowClick,onAction:a?.onRowClick},{key:"Escape",isActive:!!a||!!s,onAction:()=>s?i.add?.setIsAdding(!1):i.edit?.item?i.edit?.setItem(null):n(null)},...["Insert","+"].map((l=>({key:l,isActive:!!i.add?.enabled&&!s&&!e,onAction:()=>{i.add?.setIsAdding(!0),n(null)}}))),{key:"Delete",isActive:!e&&!!i.delete?.enabled&&!!a,onAction:()=>i.delete?.onAction??i.delete?.setItemToDeleteUuids(t.enabled&&t.rows&&t.rows.size>0?Array.from(t.rows):[a.uuid])},...i?.additional?.({focusedRow:a,isEditing:e,isAdding:s})||[]].forEach((e=>{e.isActive&&e.key===(e.normalizedKey?o.key.toLowerCase():o.key)&&!!e.ctrl===c&&(o.preventDefault(),o.stopPropagation(),e.onBulkAction&&t?.enabled&&t.rows.size>0?e.onBulkAction(Array.from(t.rows)):e.onAction())}))};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}}}),[e,l,a,i,s]),a})({enabled:!!P?.enabled,rows:j,selected:{enabled:!!T&&le.length>0,rows:T?.selectedRows??new Set,resetSelected:()=>T?.setSelectedRows(new Set)},actions:{moveDisabled:!!P?.actions?.moveDisabled||G,...P?.actions,add:{isAdding:G,setIsAdding:_,enabled:!!I?.EditableRow&&!I.addDisabled},edit:{item:I?.selectedItem,setItem:I?.setSelectedItem,enabled:!!I&&!!I.setSelectedItem&&!P?.actions.editDisabled},additional:e=>[...P?.actions?.additional?.(e)||[],{key:"PageUp",isActive:!e.isEditing,onAction:()=>ae.offset>0&&ae.setOffset(ae.offset-1)},{key:"PageDown",isActive:!e.isEditing,onAction:()=>{(w?ae.limit<=ae.totalRows:ae.offset+1<Math.ceil(ae.totalRows/ae.limit))&&ae.setOffset(ae.offset+1)}},{key:" ",isActive:le.length>0&&!!ne?.uuid,onAction:()=>{const e=ne?.uuid,l=T?.selectedRows.has(e);T?.setSelectedRows((t=>{const i=new Set(t);return i[l?"delete":"add"](e),i}))}}]}});f((()=>{T?.actions.length&&te(T.actions.filter((e=>!e.hidden))||[])}),[T?.actions]),f((()=>{const e=t.filter((e=>!e.hidden&&!e.unavailable));let l;if(T&&le.length>0){const e=j.filter((e=>!e.disableSelect)),t=!!T.selectedRows.size&&e.some((e=>!T.selectedRows.has(e.uuid))),i=!!T.selectedRows.size&&!t;l={id:"select",label:d(ue,{value:t?"middle":i,setValue:()=>{i?T.setSelectedRows(new Set):T.setSelectedRows((l=>{let t=new Set(l);return e.forEach((e=>t.add(e.uuid))),t}))}}),width:"50px"}}let i=[];l&&i.push(l),i=i.concat(e),H(i)}),[t,I,T?.selectedRows,le,b]),f((()=>{const e=b||A<=0?s:s.slice(E*A,E*A+A);T&&le.length>0&&e.map((e=>e.cells.select={value:d(ue,{value:T.selectedRows.has(e.uuid),setValue:l=>{T.setSelectedRows((t=>{const i=new Set(t);return l?i.add(e.uuid):i.delete(e.uuid),i}))},disabled:e.disableSelect}),unclickable:!0})),q(e)}),[s,A,E,T?.selectedRows,le,b]);const oe=I?.EditableRow;return d(Z,{isLoading:!!r,children:u("div",{className:l("iui-table",S,{"pb-3":0===j.length}),children:[u("div",{className:"flex column gap-2",children:[(!!k||!!M||!!i||!!L||!!z)&&d(tt,{columns:B,columnsData:i?{columns:t,setColumns:i,withSearch:a}:void 0,filterData:k,sortData:M,printData:L,customPrintData:z,templates:D,additionsalOptions:O}),!!T&&le.length>0&&u("div",{className:"flex gap-2 align-center pl-3",children:[d("p",{className:"fs-12",children:`${ie("Selected")}: ${T.selectedRows.size}`}),d(ze,{isOpen:Q,onClose:()=>ee(!1),placementX:"left",renderButton:e=>d(U,{ref:e,label:ie("Actions"),icon:it,active:Q,disabled:!T.selectedRows.size,onClick:()=>ee(!Q),size:"s"}),children:le.map((e=>d(Ye,{label:e.label,disabled:e.disabled,onClick:()=>{e.onClick(T.selectedRows),ee(!1),e.clearSelected&&T.setSelectedRows(new Set)}},e.label)))})]})]}),d("div",{className:"table-container",style:{maxHeight:$},children:d(se,{condition:!!I,wrapper:e=>d("form",{onSubmit:e=>{e.preventDefault(),e.stopPropagation(),I.onSubmit(J,(()=>{!I?.keepEditOnSubmit&&I.inputFocusRef?.current?.focus(),I?.selectedItem&&I?.keepEditOnSubmit||(K(I.defaultDataValue??{}),I?.setSelectedItem&&I.setSelectedItem(null))}))},children:e}),children:u("table",{className:"full-width",children:[d(Cl,{columns:B,headerWrap:p,customHeader:n,sticky:!!$}),d("tbody",{className:l({"no-last-border":N&&!y}),children:j.length?d(m,{children:j.map((e=>{const t=e.extendable&&!e.extendable.isLoading&&W===e.uuid;return u(x,{children:[oe&&e.uuid===I?.selectedItem?.uuid&&I.setSelectedItem?d(oe,{columns:B,data:J,setData:K,item:I.selectedItem,clearItem:()=>I.setSelectedItem(null),defaultDataValue:I.defaultDataValue,inputFocusRef:I.inputFocusRef}):d("tr",{"data-id":e.uuid,className:l(e.className,{selected:!!C&&C===e.uuid,clickable:!!e.onRowClick||!!e.extendable,focused:!!ne&&ne.uuid===e.uuid,loading:e.extendable?.isLoading}),onClick:l=>{e.onRowClick&&e.onRowClick(l),e.extendable&&X(W===e.uuid?"":e.uuid)},children:B.map((i=>{const a=e.cells[i.id];return d(Y,{label:a?.tooltip,position:"top",disabled:!a?.tooltip,children:d("td",{"data-th":"select"===i.id?ie("Selected")+":":i.label?i.label+": ":"/",align:a?.align||i.align,onClick:a?.onClick||a?.unclickable?e=>{e.stopPropagation(),a?.onClick&&a?.onClick(e)}:void 0,className:l(i.color,a?.className,R,{link:a?.link,"p-0":!a?.value&&0!==a?.value,"clickable-column":a?.onClick,"word-break":i.break,"no-border":t}),colSpan:a?.span,children:a?.value})},i.id)}))}),t&&d("tr",{children:d("td",{colSpan:B.length,className:R,children:e.extendable.element})})]},e.uuid)}))}):d("tr",{children:d("td",{className:"no-border",colSpan:B.length,children:ie("NoResults")})})}),u("tfoot",{children:[!!oe&&!I.selectedItem&&!I.addDisabled&&(P?.enabled&&!G?d("tr",{"data-id":"add",className:"clickable"+("add"===ne?.uuid?" focused":""),onClick:()=>_(!0),children:d("td",{className:`text-center ${R}`,colSpan:t.length,children:u("div",{className:"flex center gap-2",children:[d(e,{icon:nt,className:"c-primary icon24"}),d("p",{children:I.addLabel||ie("AddItem")})]})})}):d(oe,{columns:B,data:J,setData:K,defaultDataValue:I.defaultDataValue,clearItem:()=>{I.setSelectedItem?.(null),G&&_(!1)},inputFocusRef:I.inputFocusRef})),!!o&&!!j.length&&o.map((e=>d("tr",{children:B.map((({id:l})=>d("td",{align:e.cells[l]?.align||"right",colSpan:e.cells[l]?.span,className:R,children:d("strong",{children:e.cells[l]?.value})},l)))})))]})]})})}),!N&&(!!j.length||w&&(b?.offset||E)>0)&&d(bl,{customLimit:g?.customLimit,pagination:ae,footerAction:v,noTotalRows:w,dataLength:j.length})]})})},ot=({tabs:t,initialValue:i,control:a,onChange:n,noWrap:s,className:o,classNameContent:c})=>{const[r,m]=h(i||t[0].value);return t.length>0?u("div",{className:o,children:[d("div",{className:"iui-tabs",children:t.map((t=>!t.hidden&&u("div",{className:l("iui-tab clickable",{selected:(a?.value||r)===t.value,disabled:t.disabled,"no-wrap":s}),onClick:t.disabled?void 0:()=>{a?a.setValue(t.value):m(t.value),n&&n(t.value)},children:[t.icon&&d(e,{icon:t.icon}),t.label]},t.value)))}),t.map((e=>!e.hidden&&(a?.value||r)===e.value&&d("div",{className:l("iui-tab-content",c),children:e.component},e.value)))]}):null},ct={prefix:"fal",iconName:"chevron-right",icon:[320,512,[],"f054","M85.14 475.8c-3.438-3.141-5.156-7.438-5.156-11.75c0-3.891 1.406-7.781 4.25-10.86l181.1-197.1L84.23 58.86c-6-6.5-5.625-16.64 .9062-22.61c6.5-6 16.59-5.594 22.59 .8906l192 208c5.688 6.156 5.688 15.56 0 21.72l-192 208C101.7 481.3 91.64 481.8 85.14 475.8z"]},rt=({item:e,onClick:t,selectedItemUuid:i,className:a})=>{const[n,s]=h(!1),o=!!e.children?.length;return u("div",{className:l("tree-item",a),children:[u("div",{className:"flex align-center",children:[d("div",{className:"extendable-icon",children:o&&d(J,{icon:ct,onClick:()=>s(!n),size:"s",className:l("rotate",{rotate90:n})})}),d("div",{className:l("tree-item-name clickable",{active:i===e.uuid}),onClick:()=>t(e.uuid),children:e.name})]}),o&&d(T,{isOpen:n,children:e.children?.map((e=>d(rt,{item:e,onClick:t,className:l("ml-3",a),selectedItemUuid:i},e.uuid)))})]})},dt=({data:e,selectedItemUuid:l,onClick:t})=>d("div",{children:e.map((e=>d(rt,{item:e,onClick:t,selectedItemUuid:l},e.uuid)))}),ut={prefix:"fas",iconName:"floppy-disk",icon:[448,512,[],"f0c7","M433.1 129.1l-83.9-83.9C342.3 38.32 327.1 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 152.9 441.7 137.7 433.1 129.1zM224 416c-35.34 0-64-28.66-64-64s28.66-64 64-64s64 28.66 64 64S259.3 416 224 416zM320 208C320 216.8 312.8 224 304 224h-224C71.16 224 64 216.8 64 208v-96C64 103.2 71.16 96 80 96h224C312.8 96 320 103.2 320 112V208z"]},mt=({isLoading:e,noAccess:l,submitButton:t,otherButtons:i,className:a,children:n})=>{const{t:s}=c();return d(Z,{isLoading:e,children:u("form",{className:a,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),!t.disabled&&t.onSubmit(e)},children:[n,(!l||i)&&u("div",{className:"iui-form-actions",children:[i?.map((l=>!l.hidden&&d(U,{label:l.label,icon:l.icon,disabled:e||l.disabled,outlined:l.outlined,color:l.color,onClick:l.onClick},l.label))),!l&&d(U,{label:t.label??s("Save"),icon:t.icon??ut,disabled:e||t.disabled,outlined:!t.solid,solid:t.solid,color:t.color})]})]})})},ht=({title:e,buttonLabel:l})=>{const{t:t}=c();return u("div",{className:"flex center column mt-5 gap-4",children:[u("svg",{id:"aa03ddf9-f8f2-4819-a4ce-be9b0a220741","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",width:"40%",viewBox:"0 0 1119.60911 699",children:[d("title",{children:"No Access"}),d("circle",{cx:"292.60911",cy:"213",r:"213",fill:"#f2f2f2"}),d("path",{d:"M31.39089,151.64237c0,77.49789,48.6181,140.20819,108.70073,140.20819",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M140.09162,291.85056c0-78.36865,54.255-141.78356,121.30372-141.78356",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("path",{d:"M70.77521,158.66768c0,73.61476,31.00285,133.18288,69.31641,133.18288",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("path",{d:"M140.09162,291.85056c0-100.13772,62.7103-181.16788,140.20819-181.16788",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M117.22379,292.83905s15.41555-.47479,20.06141-3.783,23.713-7.2585,24.86553-1.95278,23.16671,26.38821,5.76263,26.5286-40.43935-2.711-45.07627-5.53549S117.22379,292.83905,117.22379,292.83905Z",transform:"translate(-31.39089 -100.5)",fill:"#a8a8a8"}),d("path",{d:"M168.224,311.78489c-17.40408.14042-40.43933-2.71094-45.07626-5.53548-3.53126-2.151-4.93843-9.86945-5.40926-13.43043-.32607.014-.51463.02-.51463.02s.97638,12.43276,5.61331,15.2573,27.67217,5.67589,45.07626,5.53547c5.02386-.04052,6.7592-1.82793,6.66391-4.47526C173.87935,310.756,171.96329,311.75474,168.224,311.78489Z",transform:"translate(-31.39089 -100.5)",opacity:"0.2"}),d("ellipse",{cx:"198.60911",cy:"424.5",rx:"187",ry:"25.43993",fill:"#3f3d56"}),d("ellipse",{cx:"198.60911",cy:"424.5",rx:"157",ry:"21.35866",opacity:"0.1"}),d("ellipse",{cx:"836.60911",cy:"660.5",rx:"283",ry:"38.5",fill:"#3f3d56"}),d("ellipse",{cx:"310.60911",cy:"645.5",rx:"170",ry:"23.12721",fill:"#3f3d56"}),d("path",{d:"M494,726.5c90,23,263-30,282-90",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M341,359.5s130-36,138,80-107,149-17,172",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M215.40233,637.78332s39.0723-10.82,41.47675,24.04449-32.15951,44.78287-5.10946,51.69566",transform:"translate(-31.39089 -100.5)",fill:"none",stroke:"#2f2e41",strokeMiterlimit:"10",strokeWidth:"2"}),d("path",{d:"M810.09554,663.73988,802.218,714.03505s-38.78182,20.60284-11.51335,21.20881,155.73324,0,155.73324,0,24.84461,0-14.54318-21.81478l-7.87756-52.719Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M785.21906,734.69812c6.193-5.51039,16.9989-11.252,16.9989-11.252l7.87756-50.2952,113.9216.10717,7.87756,49.582c9.185,5.08711,14.8749,8.987,18.20362,11.97818,5.05882-1.15422,10.58716-5.44353-18.20362-21.38921l-7.87756-52.719-113.9216,3.02983L802.218,714.03506S769.62985,731.34968,785.21906,734.69812Z",transform:"translate(-31.39089 -100.5)",opacity:"0.1"}),d("rect",{x:"578.43291",y:"212.68859",width:"513.25314",height:"357.51989",rx:"18.04568",fill:"#2f2e41"}),d("rect",{x:"595.70294",y:"231.77652",width:"478.71308",height:"267.83694",fill:"#3f3d56"}),d("circle",{cx:"835.05948",cy:"223.29299",r:"3.02983",fill:"#f2f2f2"}),d("path",{d:"M1123.07694,621.32226V652.6628a18.04341,18.04341,0,0,1-18.04568,18.04568H627.86949A18.04341,18.04341,0,0,1,609.8238,652.6628V621.32226Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("polygon",{points:"968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 651.452 645.651 962.312 645.651 968.978 667.466",fill:"#2f2e41"}),d("path",{d:"M1125.828,762.03359c-.59383,2.539-2.83591,5.21743-7.90178,7.75032-18.179,9.08949-55.1429-2.42386-55.1429-2.42386s-28.4804-4.84773-28.4804-17.573a22.72457,22.72457,0,0,1,2.49658-1.48459c7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z",transform:"translate(-31.39089 -100.5)",fill:"#2f2e41"}),d("path",{d:"M1125.828,762.03359c-22.251,8.526-42.0843,9.1622-62.43871-4.975-10.26507-7.12617-19.59089-8.88955-26.58979-8.75618,7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z",transform:"translate(-31.39089 -100.5)",opacity:"0.1"}),d("ellipse",{cx:"1066.53846",cy:"654.13477",rx:"7.87756",ry:"2.42386",fill:"#f2f2f2"}),d("circle",{cx:"835.05948",cy:"545.66686",r:"11.51335",fill:"#f2f2f2"}),d("polygon",{points:"968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 968.978 667.466",opacity:"0.1"}),d("rect",{x:"108.60911",y:"159",width:"208",height:"242",fill:"#2f2e41"}),d("rect",{x:"87.60911",y:"135",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"87.60911",y:"237",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"87.60911",y:"339",width:"250",height:"86",fill:"#3f3d56"}),d("rect",{x:"271.60911",y:"150",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"150",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"150",width:"16",height:"16",fill:"#4191ff"}),d("rect",{x:"271.60911",y:"251",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"251",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"251",width:"16",height:"16",fill:"#4191ff"}),d("rect",{x:"271.60911",y:"352",width:"16",height:"16",fill:"#4191ff",opacity:"0.4"}),d("rect",{x:"294.60911",y:"352",width:"16",height:"16",fill:"#4191ff",opacity:"0.8"}),d("rect",{x:"317.60911",y:"352",width:"16",height:"16",fill:"#4191ff"}),d("circle",{cx:"316.60911",cy:"538",r:"79",fill:"#2f2e41"}),d("rect",{x:"280.60911",y:"600",width:"24",height:"43",fill:"#2f2e41"}),d("rect",{x:"328.60911",y:"600",width:"24",height:"43",fill:"#2f2e41"}),d("ellipse",{cx:"300.60911",cy:"643.5",rx:"20",ry:"7.5",fill:"#2f2e41"}),d("ellipse",{cx:"348.60911",cy:"642.5",rx:"20",ry:"7.5",fill:"#2f2e41"}),d("circle",{cx:"318.60911",cy:"518",r:"27",fill:"#fff"}),d("circle",{cx:"318.60911",cy:"518",r:"9",fill:"#3f3d56"}),d("path",{d:"M271.36733,565.03228c-6.37889-28.56758,14.01185-57.43392,45.544-64.47477s62.2651,10.41,68.644,38.9776-14.51861,39.10379-46.05075,46.14464S277.74622,593.59986,271.36733,565.03228Z",transform:"translate(-31.39089 -100.5)",fill:"#4191ff"}),d("ellipse",{cx:"417.21511",cy:"611.34365",rx:"39.5",ry:"12.40027",transform:"translate(-238.28665 112.98044) rotate(-23.17116)",fill:"#2f2e41"}),d("ellipse",{cx:"269.21511",cy:"664.34365",rx:"39.5",ry:"12.40027",transform:"translate(-271.07969 59.02084) rotate(-23.17116)",fill:"#2f2e41"}),d("path",{d:"M394,661.5c0,7.732-19.90861,23-42,23s-43-14.268-43-22,20.90861-6,43-6S394,653.768,394,661.5Z",transform:"translate(-31.39089 -100.5)",fill:"#fff"})]}),d("h1",{className:"fs-32 mt-5",children:e||t("NoAccessTitle")}),d(Link,{to:"/",children:d(U,{label:l||t("ReturnToHomepage"),solid:!0,size:"l"})})]})},pt={prefix:"fal",iconName:"arrow-left",icon:[448,512,[],"f060","M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"]},ft={prefix:"fal",iconName:"circle-question",icon:[512,512,[],"f059","M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 480c-123.5 0-224-100.5-224-224s100.5-224 224-224s224 100.5 224 224S379.5 480 256 480zM240 344c-13.25 0-24 10.75-24 24s10.75 24 24 24s24-10.75 24-24S253.3 344 240 344zM285.6 128H226.4C189.8 128 160 157.8 160 194.4V204c0 8.844 7.156 16 16 16S192 212.8 192 204V194.4C192 175.4 207.4 160 226.4 160h59.25C304.6 160 320 175.4 320 194.4c0 12.48-6.781 24-17.06 29.72L242.5 254.3C231.1 260.7 224 272.7 224 285.8V304C224 312.8 231.2 320 240 320S256 312.8 256 304V285.8c0-1.453 .7813-2.797 1.438-3.172l60.41-30.22C338.9 240.7 352 218.5 352 194.4C352 157.8 322.2 128 285.6 128z"]},bt=({isOpen:e,onClose:l,size:t,form:i,additionalButtons:a,children:n})=>{const s=p(null),{t:o}=c(),r=v((()=>{s.current?.classList.add("closing"),setTimeout(l,200)}),[s,l]);return f((()=>{if(e){setTimeout((()=>{s.current?.classList.add("open")}));const e=e=>{"Escape"===e.code&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}}),[e,r]),e?y(d("div",{ref:s,className:"pullover",onClick:r,children:d("div",{className:`container ${t}`,onClick:e=>e.stopPropagation(),children:d("div",{className:"content",children:i?d(mt,{isLoading:i.isLoading,submitButton:{onSubmit:i.onSubmit,label:i.submitLabel,disabled:i.submitDisabled},otherButtons:[{label:o("Close"),onClick:r},...a?.filter((e=>!e.hidden))||[]],children:d("div",{className:"flex column gap-2 flex-grow",children:n})}):n})})}),W):null},gt=({breadcrumbs:e,actions:l,moreActions:t,backButton:i,help:a,noAccess:n,isLoading:s,isInitiallyLoading:o,children:c})=>{const[p,f]=h(!1),[b,g]=h(!1),C=useNavigate(),v=t?.some((e=>!e.hidden));return d(Z,o?{isLoading:!0,isFullPage:!0}:{isLoading:!!s,children:u("div",{className:"page-container",children:[u("div",{className:"page-header",children:[u("div",{className:"flex align-center gap-3",children:[i?.active&&d(J,{icon:pt,className:"c-primary",onClick:()=>i.url?C(i.url):C(-1)}),d("h1",{className:"breadcrumbs",children:e.reduce(((e,l)=>l?e?`${e} / ${l}`:l:e),"")})]}),!n&&u("div",{className:"flex align-center gap-2",children:[a&&u(m,{children:[d(J,{icon:ft,onClick:()=>g(!b)}),d(bt,{isOpen:b,onClose:()=>g(!1),size:"m",children:d(B,{severity:"info",children:u("div",{children:[d("p",{className:"bold mb-3",children:a.title}),d("p",{children:a.descEl})]})})})]}),v&&d(ze,{isOpen:p,onClose:()=>f(!1),placementX:"right",renderButton:e=>d(J,{ref:e,icon:Xe,active:p,onClick:()=>f(!p)}),children:t?.map((e=>!e.hidden&&d(Ye,{label:e.label,icon:e.icon,iconRotation:e.iconRotation,disabled:e.disabled,withDevider:!0,to:e.to,onClick:e.onClick?()=>{e.onClick(),f(!1)}:void 0},e.label)))}),l?.map((e=>!e.hidden&&d(se,{condition:!!e.to,wrapper:l=>d(Link,{to:e.to,children:l}),children:d(U,{...e,className:"ml-2"},e.label)},e.label)))]})]}),u("div",{className:"page-content",children:[d("div",{className:"flex-grow",children:n?d(ht,{}):c}),d("div",{className:"footer",children:d("p",{children:d(r,{i18nKey:"FooterText"})})})]})]})})},Ct=e=>s.success(e),vt=e=>s.error(e,{autoClose:!1}),Nt=e=>{if(0===e)return"0.00 B";if(void 0===e)return"/";const l=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,l)).toFixed(2)+" "+" KMGTP".charAt(l)+"B"},wt=(e,l,t)=>{const i=e.split(","),a=i[0].match(/:(.*?);/)[1],n=window.atob(i[1]);let s=n.length;const o=new Uint8Array(s);for(;s--;)o[s]=n.charCodeAt(s);return new File([o],`${l}.${t}`,{type:a})},xt=e=>e?.split(".").pop()?.toLowerCase()??"",yt=(e,l)=>e.reduce(((e,t)=>sl(l).includes(t.uuid)?e+t.storedFile.lengthInBytes:e),0),St=(e,l,t,i,a)=>{let n=new XMLHttpRequest;const s=a&&Object.keys(a).map((e=>e+"="+a[e])).join("&");n.open("GET",`${i||api.apiUrl}${l}${s?`?${s}`:""}`,!0),n.setRequestHeader("Authorization","Bearer "+El("token")),n.responseType="blob",n.onload=function(l){if(200===n.status){var i=n.response,a=document.createElement("a");a.href=window.URL.createObjectURL(i),a.download=`${e}.${t}`,a.click()}else vt(o.t("ErrorMessage"))},n.send()},kt=(e,l)=>fetch(e).then((e=>e.blob())).then((e=>new File([e],l,{type:e.type||"image/png"}))),Mt=e=>new Promise(((l,t)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>l(i.result),i.onerror=()=>t(new Error("Failed to read file"))})),Lt=e=>kt(e,e).then((e=>{if(e)return Mt(e);throw new Error("Failed to create file from URL")})),zt=(e,l)=>{const t="img"===l?/^data:([a-z]+\/[a-z]+);base64,(.+)$/:/^data:(.+);base64,(.+)$/,i=e.match(t);if(i){return{contentType:i[1],base64Data:i[2]}}throw new Error("img"===l?"Invalid base64 image format":"Invalid file")},Dt=(e,l,t)=>{const i=document.createElement("canvas");let a=i.getContext("2d"),n=new Image;n.onload=function(){i.width=l%180==0?n.width:n.height,i.height=l%180==0?n.height:n.width,a?.translate(i.width/2,i.height/2),a?.rotate(l*Math.PI/180),a?.drawImage(n,n.width/-2,n.height/-2),t(i.toDataURL())},n.src=e};function Ot({url:e,fileName:l,onSuccess:t,setIsLoading:i}){i?.(!0);const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){const e=new Blob([a.response],{type:"application/octetstream"}),t=(window.URL||window.webkitURL).createObjectURL(e),i=document.createElement("a");i.setAttribute("download",l),i.setAttribute("href",t),document.body.appendChild(i),i.click(),document.body.removeChild(i)},a.onloadend=function(){console.log("Finished downloading file"),t?.(),i?.(!1)},a.send()}const Tt={taxId:"^\\d{9}$",businessCode:"^\\d{8}$",umcn:"^\\d{13}$",idCardNumber:"^\\d{9}$",phoneNumber:"^\\d{8,9}$",port:"^\\d{4}$",year:"^\\d{4}$",number:"^\\d*$",strongPassword:"^.*(?=.{8,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).*$"},Rt=(e,l,t)=>Number(e??0).toLocaleString("sr-RS",{minimumFractionDigits:l??2,maximumFractionDigits:t??l??2}),$t=e=>Number(e??0).toLocaleString("sr-RS"),It=e=>e?.toString().replace(".",",")??0,Pt=e=>{const l=new URLSearchParams(e);return Object.fromEntries(l.entries())},At={Actions:"Akcije",Active:"Aktivan",AddInput:"Unesi",Back:"Nazad",Cancel:"Otkaži",Change:"Promeni",Choose:"Izaberi",Close:"Zatvori",Confirm:"Potvrdi",Create:"Kreiraj",Delete:"Izbriši",Edit:"Izmeni",FreeText:"Slobodan unos",from:"od",Group:"Grupa",Groups:"Grupe",Next:"Dalje",No:"Ne",Ok:"U redu",Options:"Opcije",or:"ili",Save:"Sačuvaj",Search:"Pretraga",Selected:"Označeno",Send:"Pošalji",Sending:"Slanje",Title:"Naslov",to:"do",Yes:"Da",RefreshData:"Osveži podatke",allResults:"Svi",Columns:"Kolone",DragDropListsInfo:"Odaberite kolone za prikazivanje prevlačenjem sa jedne liste na drugu",Filter:"Filteri",HiddenColumns:"Sakrivene kolone",NoResults:"Nema rezultata",of:"od",page:"Strana",Print:"Odštampaj",PrintDate:"Datum izveštaja",PrintExport:"Štampa/Izvoz",ResetFilter:"Resetuj filtere",rowsPerPage:"Broj redova",SaveXlsx:"Sačuvaj XLSX",SelectedColumns:"Odabrane kolone",Sort:"Sortiranje",AddItem:"Dodaj stavku",Templates:"Šabloni",SelectTemplate:"Izaberi šablon",TemplateList:"Lista šablona",PublicTemplate:"Javni šablon",PublicTemplates:"Javni šabloni",DefaultTemplate:"Osnovni šabloni",RemoveFiltersAndLook:"Poništi izgled i filtere",CreateTemplateLong:"Sačuvaj trenutni izgled kao šablon",CreateDefaultTemplate:"Sačuvaj trenutni izgled kao podrazumevani",CreateTemplate:"Sačuvaj šablon",DeleteTemplateDesc:"Da li ste sigurni da želite da izbrišete šablon?",DeleteTemplateTitle:"Brisanje šablona",FastLinks:"Brzi pristup",CharMin:"Minimalan broj karaktera: {{from}}",CharRange:"Broj karaktera od {{from}} do {{-to}}",CharNumber:"Broj karaktera {{number}}",Pending:"U toku",Successfully:"Uspešno",DeletedSuccessfully:"Uspešno izbrisano",ErrorMessage:"Došlo je do greške!",TryAgain:"Pokušaj ponovo"},Ft={Actions:"Акције",Active:"Активан",AddInput:"Унеси",Back:"Назад",Cancel:"Откажи",Change:"Промени",Choose:"Изабери",Close:"Затвори",Confirm:"Потврди",Create:"Креирај",Delete:"Избриши",Edit:"Измени",FreeText:"Слободан унос",from:"од",Group:"Група",Groups:"Групе",Next:"Даље",No:"Не",Ok:"У реду",Options:"Опције",or:"или",Save:"Сачувај",Search:"Претрага",Selected:"Означено",Send:"Пошаљи",Sending:"Слање",Title:"Наслов",to:"до",Yes:"Да",RefreshData:"Освежи податке",allResults:"Сви",Columns:"Колоне",DragDropListsInfo:"Одаберите колоне за приказивање превлачењем са једне листе на другу",Filter:"Филтери",HiddenColumns:"Сакривене колоне",NoResults:"Нема резултата",of:"од",page:"Страна",Print:"Одштампај",PrintDate:"Датум извештаја",PrintExport:"Штампа/Извоз",ResetFilter:"Ресетуј филтере",rowsPerPage:"Број редова",SaveXlsx:"Сачувај XЛСX",SelectedColumns:"Одабране колоне",Sort:"Сортирање",AddItem:"Додај ставку",Templates:"Шаблони",SelectTemplate:"Изабери шаблон",TemplateList:"Листа шаблона",PublicTemplate:"Јавни шаблон",PublicTemplates:"Јавни шаблони",DefaultTemplate:"Основни шаблони",RemoveFiltersAndLook:"Поништи изглед и филтере",CreateTemplateLong:"Сачувај тренутни изглед као шаблон",CreateDefaultTemplate:"Сачувај тренутни изглед као подразумевани",CreateTemplate:"Сачувај шаблон",DeleteTemplateDesc:"Да ли сте сигурни да желите да избришете шаблон?",DeleteTemplateTitle:"Брисање шаблона",CharMin:"Минималан број карактера: {{from}}",CharRange:"Број карактера од {{from}} до {{-to}}",CharNumber:"Број карактера {{number}}",Pending:"У току",Successfully:"Успешно",DeletedSuccessfully:"Успешно избрисано",ErrorMessage:"Дошло је до грешке!",TryAgain:"Покушај поново"},Et=e=>{const[l,t]=h(null),[i,a]=h(!0);return f((()=>{e&&(e=>axiosInstance.get(`/report-templates/${e}/default`,{params:{organizationUuid:ql()},headers:{baseUrl:Wl}}).then((({data:e})=>e)))(e).then(t).catch((()=>{})).finally((()=>a(!1)))}),[e]),{defaultTemplate:l,isLoadingDefaultTemplate:!!e&&i}},Vt=(e,l)=>{f((()=>{if(!l){const l=l=>{"Escape"===l.code&&e()};return document.body.addEventListener("keyup",l),()=>document.body.removeEventListener("keyup",l)}}),[e,l])},Bt=()=>{const[e,l]=h(new Set);return{selectedRows:e,setSelectedRows:l,resetSelectedRows:()=>l(new Set)}},Ht=()=>{const[e,l]=h(!1);return{isMenuOpen:e,onMenuOpen:()=>l(!0),onMenuClose:()=>setTimeout((()=>l(!1)))}};export{I as Accordions,B as Alert,U as Button,ue as Checkbox,T as Collapse,se as ConditionalWrapper,fe as CurrencyInput,K as Dashboard,te as DashboardWidget,Te as DateInput,de as DeleteItemDialog,ce as Dialog,H as DotBadge,ne as FastLinksWidget,Qe as FilterItem,mt as FormWrapper,G as FullScreenLoader,J as IconButton,Je as ItemActionsMenu,Ge as ItemEditOptionsButtons,$e as LargeTextInput,_ as LazyLoader,Z as Loader,ze as Menu,Ye as MenuItem,j as NotificationBadge,Ie as NumberInput,gt as PageWrapper,Fe as PasswordInput,q as PillBadge,Ee as Radio,Ve as RadioLarge,He as SearchInput,qe as Select,Ue as SelectAsyncPaginate,We as SelectCreatable,ml as SetTableFilter,st as Table,_e as TableEditRow,bl as TableFooter,Dl as TablePrint,ot as Tabs,he as TextInput,Re as TimeInput,Y as Tooltip,dt as Tree,rl as areStringArraysEqual,yt as calculateFilesSize,ye as checkIfExpired,dl as compareArrayItemsIndex,ol as convertArrayToBooleanObject,sl as convertBooleanObjectToArray,Sl as convertReportTemplateFilterToSearch,yl as convertSearchToReportTemplateFilter,wt as dataURLtoFile,xe as dateAddDays,cl as deepCopy,al as deleteEmptyProps,nl as deleteEmptyPropsIncludingArray,tl as deleteProps,il as deletePropsThatEndsWith,St as downloadDocumentFile,Ot as downloadFile,Rt as formatCurrency,$t as formatCurrencyNoDecimals,Ce as formatDate,Ne as formatDateAndTime,ve as formatDateYMD,It as formatDecimalNumber,we as formatTime,Le as formatYearMonth,Nl as getActiveFilterNumber,ql as getActiveOrgUuid,Mt as getBase64FromFile,Lt as getBase64FromUrl,Se as getCurrentDateFormatted,ke as getCurrentDateFormattedYMD,Me as getDaysLeft,Hl as getDefaultOrgUuid,xt as getExtensionFromFilename,kt as getFileFromUrl,_l as getInputHelperText,Ql as getInputMinMaxPattern,xl as getPrintColumns,wl as getVisibleColumnsIds,Ft as i18nIUICyrilic,At as i18nIUILatin,Tt as inputPattern,ul as intersectArrays,El as lsGet,Bl as lsRemove,Vl as lsSet,Gl as maxChar,Pt as parseUrlSearch,W as rootDir,Dt as rotateBase64Image,Ul as setActiveOrgUuid,jl as setDefaultOrgUuid,kl as setTemplateData,Nt as sizeInBytesPretty,zt as splitBase64File,O as tableCustomLimit1000,vt as toastError,Ct as toastSuccess,Et as useDefaultTemplate,at as useDialogObserver,zl as useHideZendesk,Ht as useIsMenuOpen,Vt as useOnEsc,Bt as useTableSelect};
2
2
  //# sourceMappingURL=index.js.map