react-luminus-components 1.3.231 → 1.3.233
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/.vite/manifest.json +34 -34
- package/dist/{Loading-Dt9084Dj.cjs → Loading-Bq47YAVD.cjs} +1 -1
- package/dist/{Loading-Bs-HZYGf.js → Loading-Khc1YD1r.js} +1 -1
- package/dist/{ShortcutLinksContext-D-e92Egb.js → ShortcutLinksContext-DApcNgFs.js} +744 -744
- package/dist/{ShortcutLinksContext-DUPcMKu4.cjs → ShortcutLinksContext-DGRQ13Df.cjs} +1 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +3 -3
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +4 -4
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +4 -4
- package/dist/{useGetApiData-BWtAl5Vk.cjs → useGetApiData-CruzvYco.cjs} +1 -1
- package/dist/{useGetApiData-B6mNMoSN.js → useGetApiData-xQ3tB0Jt.js} +1 -1
- package/dist/{usePermissions-DjNn52I3.cjs → usePermissions-C3odwqCN.cjs} +1 -1
- package/dist/{usePermissions-BEpcTtV5.js → usePermissions-WNAKnyu2.js} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +2 -2
- package/package.json +1 -1
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ae=Object.defineProperty;var ie=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ie(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-DUPcMKu4.cjs"),c=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-Dt9084Dj.cjs"),ce=require("./useGetApiData-BWtAl5Vk.cjs"),fe=require("./useLocalStorageState-BFc8Gc8H.cjs");function de(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function me(){return de(Date.now())}function pe(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,u)=>a-u);return r>=n&&r<=s}function he(){return o.startOfDay(Date.now())}const xe=({children:e})=>{const[t,r]=c.useState(!1),[n,s]=c.useState(""),a=c.useCallback(f=>{r(!0),s(f)},[]),u=c.useCallback(()=>{r(!1)},[]),i=c.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:u}),[t,n,a,u]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Qe,{}),e]})},ge=()=>{const{texts:{confirm:e}}=c.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=c.useContext(o.PromptContext),[a,u]=c.useState(s.defaultValue??""),i=c.useCallback(()=>{n(null)},[n]),f=c.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);c.useEffect(()=>{t===!0&&u(s.defaultValue??"")},[t,s.defaultValue]);const l=c.useMemo(()=>({value:a,onChange:d=>u(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ye=({children:e})=>{const[t,r]=c.useState(!1),[n,s]=c.useState(""),[a,u]=c.useState({input:"textarea",type:"text"}),i=c.useRef(()=>{}),f=c.useCallback(m=>{s(m),r(!0)},[]),l=c.useCallback(()=>{r(!1)},[]),d=c.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:u}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(ge,{})]})},ve=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:u,children:i})=>{const f=c.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:u}),[t,e,r,s,a,n,u]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(xe,{children:o.jsxRuntimeExports.jsxs(ye,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},Te=({children:e})=>{const[t,r]=c.useState(!1),[n]=c.useState(new Set),s=c.useCallback(i=>{n.add(i),r(!0)},[n]),a=c.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),u=c.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:u,children:[t&&o.jsxRuntimeExports.jsx(ue.Loading,{}),e]})},Ce=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=c.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:u}=c.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=c.useState(null),d=c.useCallback(async()=>{const x=await i();x&&l(x.token)},[i]);c.useEffect(()=>{d()},[d]);const h=c.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=c.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=c.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=c.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=c.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await u(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,u]),b=c.useCallback(()=>{S()},[S]);c.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const B=c.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);c.useEffect(()=>{B(f)},[f,n==null?void 0:n.id,B]);const oe=c.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:oe,children:e})},Ee=({...e})=>{const{cookieDomain:t}=c.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=c.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return c.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const u=a.payload,i=u.account;e.msalInstance.setActiveAccount(i);const f=u.accessToken,l=u.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(le.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Se=({children:e,relativeEndpoint:t})=>{const[r,n,s]=fe.useLocalStorageState("user-delegation",null),a=c.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):he(),h=r.to?o.parseISO(r.to):me();return pe(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:u,setData:i,reloadData:f}=ce.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=c.useRef(null);c.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),c.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=c.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:u,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,u,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var be=typeof Element<"u",Ae=typeof Map=="function",je=typeof Set=="function",Oe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function I(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!I(e[n],t[n]))return!1;return!0}var a;if(Ae&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!I(n.value[1],t.get(n.value[0])))return!1;return!0}if(je&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Oe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(be&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!I(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=function(t,r){try{return I(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Pe=o.getDefaultExportFromCjs(we);var ke=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var u=Object.keys(t),i=Object.keys(r);if(u.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<u.length;l++){var d=u[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const Re=o.getDefaultExportFromCjs(ke);var Q=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Q||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Q),K={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},De=Object.entries(K).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ie=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},Le=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Me=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),He=e=>console&&typeof console.warn=="function"&&console.warn(e),k=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&He(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const u={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),u[l]||(u[l]={}),n[l][m]?!1:(u[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(u);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...u[l]};n[l]=d}return s},[]).reverse()},$e=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Me(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:k("link",["rel","href"],e),metaTags:k("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:k("noscript",["innerHTML"],e),onChangeClientState:Le(e),scriptTags:k("script",["src","innerHTML"],e),styleTags:k("style",["cssText"],e),title:Ie(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:$e(e,O.PRIORITIZE_SEO_TAGS)}),X=e=>Array.isArray(e)?e.join(""):e,Ue=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(Ue(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ne=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ee=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),qe=(e,t,r,n)=>{const s=ee(r),a=X(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},Fe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,u=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ne.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${u}${f?"/>":`>${i}</${e}>`}`},""),te=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=K[n];return r[s||n]=e[n],r},t),Ge=(e,t,r)=>{const n={key:t,[T]:!0},s=te(r,n);return[c.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=K[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),c.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ge(e,t.title,t.titleAttributes),toString:()=>qe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>te(t),toString:()=>ee(t)};default:return{toComponent:()=>L(e,t),toString:()=>Fe(e,t,r)}}},ze=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),u=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",u.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",u.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:u.default}},Ke=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:u,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=ze(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",u,n),title:y("title",{title:i,titleAttributes:f},n)}},F=Ke,D=[],re=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",re);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Be={},ne=c.createContext(Be),A,se=(A=class extends c.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return c.createElement(ne.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",re),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let u;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(u=d,f.isEqualNode(l)))?s.splice(u,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],u=Object.keys(t);for(const i of u){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==u.join(",")&&r.setAttribute(T,u.join(","))},Ve=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=X(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:u,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ve(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",u),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},R=null,Ye=e=>{R&&cancelAnimationFrame(R),e.defer?R=requestAnimationFrame(()=>{J(e,()=>{R=null})}):(J(e),R=null)},Je=Ye,W=class extends c.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const u={...a.props};return delete u.context,u}));se.canUseDOM?Je(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,We=(U=class extends c.Component{shouldComponentUpdate(e){return!Pe(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return c.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,u=Object.keys(a).reduce((f,l)=>(f[De[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,u,s);break;default:t=this.mapObjectTypeChildren(n,t,u,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?c.createElement(W,{...r,context:n.value}):c.createElement(ne.Consumer,null,s=>c.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Z=(e,t)=>e?`${e} | ${t}`:t,Ze=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=c.useState([Z(r??"",e)]),a=c.useCallback(l=>{s(d=>[...d,Z(r??"",l)])},[r]),u=c.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=c.useMemo(()=>n.at(-1)??"",[n]),f=c.useMemo(()=>({addHelmet:a,removeHelmet:u}),[a,u]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(se,{children:[o.jsxRuntimeExports.jsx(We,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Qe=()=>{const{texts:{confirm:e}}=c.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm(),a=c.useCallback(u=>{switch(u.key){case"Enter":u.stopPropagation(),t();break;case"Escape":u.stopPropagation(),r();break}},[t,r]);return o.useKeyPress(a),o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ee;exports.DelegationProvider=Se;exports.HelmetProvider=Ze;exports.LoadingProvider=Te;exports.LuminusComponentsProvider=ve;exports.UserProvider=Ce;
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var ie=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ie(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-DGRQ13Df.cjs"),c=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-Bq47YAVD.cjs"),ce=require("./useGetApiData-CruzvYco.cjs"),fe=require("./useLocalStorageState-BFc8Gc8H.cjs");function de(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function me(){return de(Date.now())}function pe(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,u)=>a-u);return r>=n&&r<=s}function he(){return o.startOfDay(Date.now())}const xe=({children:e})=>{const[t,r]=c.useState(!1),[n,s]=c.useState(""),a=c.useCallback(f=>{r(!0),s(f)},[]),u=c.useCallback(()=>{r(!1)},[]),i=c.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:u}),[t,n,a,u]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Qe,{}),e]})},ge=()=>{const{texts:{confirm:e}}=c.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=c.useContext(o.PromptContext),[a,u]=c.useState(s.defaultValue??""),i=c.useCallback(()=>{n(null)},[n]),f=c.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);c.useEffect(()=>{t===!0&&u(s.defaultValue??"")},[t,s.defaultValue]);const l=c.useMemo(()=>({value:a,onChange:d=>u(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ye=({children:e})=>{const[t,r]=c.useState(!1),[n,s]=c.useState(""),[a,u]=c.useState({input:"textarea",type:"text"}),i=c.useRef(()=>{}),f=c.useCallback(m=>{s(m),r(!0)},[]),l=c.useCallback(()=>{r(!1)},[]),d=c.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:u}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(ge,{})]})},ve=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:u,children:i})=>{const f=c.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:u}),[t,e,r,s,a,n,u]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(xe,{children:o.jsxRuntimeExports.jsxs(ye,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},Te=({children:e})=>{const[t,r]=c.useState(!1),[n]=c.useState(new Set),s=c.useCallback(i=>{n.add(i),r(!0)},[n]),a=c.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),u=c.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:u,children:[t&&o.jsxRuntimeExports.jsx(ue.Loading,{}),e]})},Ce=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=c.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:u}=c.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=c.useState(null),d=c.useCallback(async()=>{const x=await i();x&&l(x.token)},[i]);c.useEffect(()=>{d()},[d]);const h=c.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=c.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=c.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=c.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=c.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await u(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,u]),b=c.useCallback(()=>{S()},[S]);c.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const B=c.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);c.useEffect(()=>{B(f)},[f,n==null?void 0:n.id,B]);const oe=c.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:oe,children:e})},Ee=({...e})=>{const{cookieDomain:t}=c.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=c.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return c.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const u=a.payload,i=u.account;e.msalInstance.setActiveAccount(i);const f=u.accessToken,l=u.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(le.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Se=({children:e,relativeEndpoint:t})=>{const[r,n,s]=fe.useLocalStorageState("user-delegation",null),a=c.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):he(),h=r.to?o.parseISO(r.to):me();return pe(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:u,setData:i,reloadData:f}=ce.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=c.useRef(null);c.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),c.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=c.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:u,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,u,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var be=typeof Element<"u",Ae=typeof Map=="function",je=typeof Set=="function",Oe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function I(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!I(e[n],t[n]))return!1;return!0}var a;if(Ae&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!I(n.value[1],t.get(n.value[0])))return!1;return!0}if(je&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Oe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(be&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!I(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=function(t,r){try{return I(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Pe=o.getDefaultExportFromCjs(we);var ke=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var u=Object.keys(t),i=Object.keys(r);if(u.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<u.length;l++){var d=u[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const Re=o.getDefaultExportFromCjs(ke);var Q=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Q||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Q),K={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},De=Object.entries(K).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ie=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},Le=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Me=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),He=e=>console&&typeof console.warn=="function"&&console.warn(e),k=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&He(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const u={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),u[l]||(u[l]={}),n[l][m]?!1:(u[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(u);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...u[l]};n[l]=d}return s},[]).reverse()},$e=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Me(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:k("link",["rel","href"],e),metaTags:k("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:k("noscript",["innerHTML"],e),onChangeClientState:Le(e),scriptTags:k("script",["src","innerHTML"],e),styleTags:k("style",["cssText"],e),title:Ie(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:$e(e,O.PRIORITIZE_SEO_TAGS)}),X=e=>Array.isArray(e)?e.join(""):e,Ue=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(Ue(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ne=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ee=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),qe=(e,t,r,n)=>{const s=ee(r),a=X(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},Fe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,u=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ne.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${u}${f?"/>":`>${i}</${e}>`}`},""),te=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=K[n];return r[s||n]=e[n],r},t),Ge=(e,t,r)=>{const n={key:t,[T]:!0},s=te(r,n);return[c.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=K[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),c.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ge(e,t.title,t.titleAttributes),toString:()=>qe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>te(t),toString:()=>ee(t)};default:return{toComponent:()=>L(e,t),toString:()=>Fe(e,t,r)}}},ze=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),u=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",u.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",u.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:u.default}},Ke=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:u,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=ze(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",u,n),title:y("title",{title:i,titleAttributes:f},n)}},F=Ke,D=[],re=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",re);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Be={},ne=c.createContext(Be),A,se=(A=class extends c.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return c.createElement(ne.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",re),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let u;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(u=d,f.isEqualNode(l)))?s.splice(u,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],u=Object.keys(t);for(const i of u){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==u.join(",")&&r.setAttribute(T,u.join(","))},Ve=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=X(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:u,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ve(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",u),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},R=null,Ye=e=>{R&&cancelAnimationFrame(R),e.defer?R=requestAnimationFrame(()=>{J(e,()=>{R=null})}):(J(e),R=null)},Je=Ye,W=class extends c.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const u={...a.props};return delete u.context,u}));se.canUseDOM?Je(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,We=(U=class extends c.Component{shouldComponentUpdate(e){return!Pe(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return c.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,u=Object.keys(a).reduce((f,l)=>(f[De[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,u,s);break;default:t=this.mapObjectTypeChildren(n,t,u,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?c.createElement(W,{...r,context:n.value}):c.createElement(ne.Consumer,null,s=>c.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Z=(e,t)=>e?`${e} | ${t}`:t,Ze=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=c.useState([Z(r??"",e)]),a=c.useCallback(l=>{s(d=>[...d,Z(r??"",l)])},[r]),u=c.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=c.useMemo(()=>n.at(-1)??"",[n]),f=c.useMemo(()=>({addHelmet:a,removeHelmet:u}),[a,u]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(se,{children:[o.jsxRuntimeExports.jsx(We,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Qe=()=>{const{texts:{confirm:e}}=c.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm(),a=c.useCallback(u=>{switch(u.key){case"Enter":u.stopPropagation(),t();break;case"Escape":u.stopPropagation(),r();break}},[t,r]);return o.useKeyPress(a),o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ee;exports.DelegationProvider=Se;exports.HelmetProvider=Ze;exports.LoadingProvider=Te;exports.LuminusComponentsProvider=ve;exports.UserProvider=Ce;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Se = Object.defineProperty;
|
|
2
2
|
var Ee = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var A = (e, t, r) => Ee(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { t as N, bq as Oe, j as f, br as we, P as z, bb as Ie, bs as fe, a3 as S, ba as Pe, Q as G, bt as je, aW as De, aj as ke, az as de, bu as me, aA as Le, aC as D, aB as He, bv as _e, aT as se, bw as $e, ao as pe, bx as oe, by as Me, aY as Re, as as Ue } from "./ShortcutLinksContext-
|
|
4
|
+
import { t as N, bq as Oe, j as f, br as we, P as z, bb as Ie, bs as fe, a3 as S, ba as Pe, Q as G, bt as je, aW as De, aj as ke, az as de, bu as me, aA as Le, aC as D, aB as He, bv as _e, aT as se, bw as $e, ao as pe, bx as oe, by as Me, aY as Re, as as Ue } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
5
5
|
import O, { useState as C, useCallback as m, useMemo as b, useContext as _, useEffect as j, useRef as he, Component as te } from "react";
|
|
6
6
|
import { EventType as J } from "@azure/msal-browser";
|
|
7
7
|
import { MsalProvider as Ne } from "@azure/msal-react";
|
|
@@ -9,8 +9,8 @@ import "react-router-dom";
|
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "react-hook-form";
|
|
11
11
|
import "react-flexmonster";
|
|
12
|
-
import { L as Fe } from "./Loading-
|
|
13
|
-
import { u as qe } from "./useGetApiData-
|
|
12
|
+
import { L as Fe } from "./Loading-Khc1YD1r.js";
|
|
13
|
+
import { u as qe } from "./useGetApiData-xQ3tB0Jt.js";
|
|
14
14
|
import { u as Ge } from "./useLocalStorageState-Bt99kkCr.js";
|
|
15
15
|
function ze(e) {
|
|
16
16
|
const t = N(e);
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-DGRQ13Df.cjs"),k=require("./usePermissions-C3odwqCN.cjs"),x=require("./useGetApiData-CruzvYco.cjs"),c=require("react"),T=require("./useLocalStorageState-BFc8Gc8H.cjs"),f=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const L=r=>{let t="pending",u;const s=r.then(a=>{t="success",u=a},a=>{t="error",u=a});return()=>{switch(t){case"pending":throw s;case"success":return u;case"error":throw u;default:throw new Error("Unknown status")}}};function G(r,t){const u=e.useAxios({silent:!0,differentBaseUrl:t==null?void 0:t.customBaseUrl,customToken:t==null?void 0:t.customToken}),[s,a]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=u.get(r).then(o=>o.data);a(L(n))})()},[u,r]),s}const B=(r,t,u)=>{let s="pending",a;const i=r.then(n=>{s="success",a=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&u?(s="error-404",a=n):(s="error",a=n)});return()=>{switch(s){case"pending":throw i;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},l={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},E=(r,{loadOnInit:t=l.loadOnInit,enabled:u=l.enabled,silent:s=l.silent,nullStateBeforeLoad:a=l.nullStateBeforeLoad,nullStateOnFail:i=l.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=l)=>{const p=e.useAxios({silent:s,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:w}=c.useContext(e.LoadingContext),C=c.useRef(0),{isAuthenticated:P}=e.useAuth(),[b,g]=c.useState(null),m=c.useCallback(async(d,y)=>{if(!P()||u===!1)return;!s&&D(`loadData-${r}-${y}`),a&&g(null);const q=p.get(r,{signal:d}).then(A=>h?h(A.data):A.data).finally(()=>!s&&w(`loadData-${r}-${y}`));g(B(q,i??!1,S??!1))},[P,u,s,D,r,a,p,h,w,i,S]);return c.useEffect(()=>{if(t===!1)return;const d=new AbortController;return m(d.signal,++C.current),()=>{d.abort()}},[m,t]),{data:b,setData:g,reloadData:m}};exports.cancelToken=e.cancelToken;exports.useAuth=e.useAuth;exports.useAxios=e.useAxios;exports.useClickOutside=e.useClickOutside;exports.useClipboard=e.useClipboard;exports.useConfirm=e.useConfirm;exports.useFormControlType=e.useFormControlType;exports.useKeyPress=e.useKeyPress;exports.useNotifications=e.useNotifications;exports.usePrompt=e.usePrompt;exports.useWindowSize=e.useWindowSize;exports.useZodSchemaTypes=e.useZodSchemaTypes;exports.usePermissions=k.usePermissions;exports.useGetApiData=x.useGetApiData;exports.useLocalStorageState=T.useLocalStorageState;exports.useEmployeePhotoPath=f.useEmployeePhotoPath;exports.useRenderDraggableInPortal=f.useRenderDraggableInPortal;exports.useSearchQuery=f.useSearchQuery;exports.useSearchQueryState=f.useSearchQueryState;exports.useGetApiDataBound=E;exports.useGetDataBound=G;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { aj as S, aW as P, aA as B } from "./ShortcutLinksContext-
|
|
2
|
-
import { bz as Y, ag as Z, bC as q, aY as H, bB as J, as as M, aX as V, bb as _, a6 as ee, bA as te } from "./ShortcutLinksContext-
|
|
3
|
-
import { u as ae } from "./usePermissions-
|
|
4
|
-
import { u as re } from "./useGetApiData-
|
|
1
|
+
import { aj as S, aW as P, aA as B } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
2
|
+
import { bz as Y, ag as Z, bC as q, aY as H, bB as J, as as M, aX as V, bb as _, a6 as ee, bA as te } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
3
|
+
import { u as ae } from "./usePermissions-WNAKnyu2.js";
|
|
4
|
+
import { u as re } from "./useGetApiData-xQ3tB0Jt.js";
|
|
5
5
|
import { useState as x, useEffect as C, useContext as L, useRef as T, useCallback as U } from "react";
|
|
6
6
|
import { u as ue } from "./useLocalStorageState-Bt99kkCr.js";
|
|
7
7
|
import { c as le, u as ie, a as fe, b as de } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-DGRQ13Df.cjs"),x=require("react"),y=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const k=require("./usePermissions-C3odwqCN.cjs"),B="_side-menu-item_1o1uo_1",P="_disabled_1o1uo_6",f="_nav-button_1o1uo_10",w="_child_1o1uo_18",S="_text_1o1uo_23",I="_icon_1o1uo_30",L="_collapse-icon_1o1uo_36",T="_collapsed_1o1uo_46",O="_collapse-icon-mini_1o1uo_49",$="_expanded_1o1uo_80",A="_children-container_1o1uo_86",K="_visible_1o1uo_94",D="_children_1o1uo_86",F="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:B,disabled:P,"nav-button":"_nav-button_1o1uo_10",navButton:f,child:w,text:S,icon:I,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:L,collapsed:T,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:O,expanded:$,"children-container":"_children-container_1o1uo_86",childrenContainer:A,visible:K,children:D,mobile:F},z=({item:s,menuExpanded:t,useTooltips:l,children:r})=>s.tooltip&&!t&&l?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:r})}):r,g=({item:s,menuExpanded:t,collapsed:l,onCollapse:r,currentPath:_,useHover:a,useTooltips:p,isMobile:E})=>{var M,q,v,N;const[d,h]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((M=s.children)==null?void 0:M.some(n=>n.linkTo===j)),u=x.useRef(null);return e.useClickOutside([u],()=>l&&r()),e.jsxRuntimeExports.jsxs("li",{ref:u,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:E},{[o.expanded]:t},{active:d||R},{open:l&&s.children},{[o.disabled]:s.disabled||s.notPermitted||((q=s.children)==null?void 0:q.every(n=>n.notPermitted||n.disabled))},{disabled:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(n=>n.notPermitted||n.disabled))}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[e.jsxRuntimeExports.jsx(z,{item:s,menuExpanded:t,useTooltips:p,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{r()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),!a&&!t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(y.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:l}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(N=s.children)==null?void 0:N.map(n=>e.jsxRuntimeExports.jsx(y.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),onClick:r,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},U="_side-menu_1q9oh_1",W="_sidebar-header_1q9oh_15",G="_side-menu-content_1q9oh_22",J="_expand_1q9oh_27",Q="_only-logo_1q9oh_31",V="_mobile_1q9oh_34",X="_divider_1q9oh_49",m={"side-menu":"_side-menu_1q9oh_1",sideMenu:U,"sidebar-header":"_sidebar-header_1q9oh_15",sidebarHeader:W,"side-menu-content":"_side-menu-content_1q9oh_22",sideMenuContent:G,expand:J,"only-logo":"_only-logo_1q9oh_31",onlyLogo:Q,mobile:V,divider:X},Y=({headerItem:s,searchItem:t,shortcutsItem:l,mainItems:r,secondaryItems:_,expanded:a,setExpanded:p,currentPath:E,useHover:d,useTooltips:h})=>{const[j,R]=x.useState(-1),{checkUserHasPermissions:u}=k.usePermissions(),M=x.useMemo(()=>r.map(i=>{var c;return{...i,notPermitted:!u(i.permissions??[],"any"),children:(c=i.children)==null?void 0:c.map(b=>({...b,notPermitted:!u(b.permissions??[],"any"),disabled:i.disabled||b.disabled}))}}),[r,u]),q=x.useMemo(()=>_.map(i=>{var c;return{...i,notPermitted:!u(i.permissions??[],"any"),children:(c=i.children)==null?void 0:c.map(b=>({...b,notPermitted:!u(b.permissions??[],"any")}))}}),[_,u]),v=i=>{R(i===j?-1:i)};x.useEffect(()=>{a||R(-1)},[a]);const N=x.useRef(null);e.useClickOutside([N],()=>p(!1));const{isMobile:n}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",m.sideMenu,{[m.mobile]:n},{[m.expand]:a},{expand:a}),onMouseEnter:()=>d&&p(!0),onMouseLeave:()=>d&&p(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",m.sidebarHeader,{[m.onlyLogo]:d}),role:d?void 0:"button",onClick:d?void 0:()=>p(!a),children:d?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(t||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&a?l:null,t&&a?t:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:m.sideMenuContent,children:[M.map((i,c)=>e.jsxRuntimeExports.jsx(g,{item:i,menuExpanded:a,collapsed:c===j,onCollapse:()=>v(c),currentPath:E,useHover:d,useTooltips:h,isMobile:n},i.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",m.divider)}),q.map((i,c)=>e.jsxRuntimeExports.jsx(g,{item:i,menuExpanded:a,collapsed:c===j,onCollapse:()=>v(c),currentPath:E,useHover:d,useTooltips:h,isMobile:n},i.title))]})]})},Z="_top-bar_lnmq0_1",H="_top-bar-brand_lnmq0_12",C={"top-bar":"_top-bar_lnmq0_1",topBar:Z,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:H},ee=({appName:s,leftOffset:t,leftContent:l,centerContent:r,rightContent:_})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",C.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(y.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:r??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:_??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Y;exports.TopBar=ee;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ag as w, j as e, c as i, $ as q, ax as T, a6 as $, bn as R, bo as S } from "./ShortcutLinksContext-
|
|
2
|
-
import { b7 as fe, bp as ye } from "./ShortcutLinksContext-
|
|
1
|
+
import { ag as w, j as e, c as i, $ as q, ax as T, a6 as $, bn as R, bo as S } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
2
|
+
import { b7 as fe, bp as ye } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
3
3
|
import { useState as I, useRef as L, useMemo as C, useEffect as A } from "react";
|
|
4
4
|
import { Link as B } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|
|
@@ -7,7 +7,7 @@ import "react-flexmonster";
|
|
|
7
7
|
import "@azure/msal-browser";
|
|
8
8
|
import "@azure/msal-react";
|
|
9
9
|
import "react-dom";
|
|
10
|
-
import { u as F } from "./usePermissions-
|
|
10
|
+
import { u as F } from "./usePermissions-WNAKnyu2.js";
|
|
11
11
|
const K = "_side-menu-item_1o1uo_1", O = "_disabled_1o1uo_6", z = "_nav-button_1o1uo_10", D = "_child_1o1uo_18", U = "_text_1o1uo_23", W = "_icon_1o1uo_30", E = "_collapse-icon_1o1uo_36", G = "_collapsed_1o1uo_46", J = "_collapse-icon-mini_1o1uo_49", Q = "_expanded_1o1uo_80", V = "_children-container_1o1uo_86", X = "_visible_1o1uo_94", Y = "_children_1o1uo_86", Z = "_mobile_1o1uo_106", s = {
|
|
12
12
|
"side-menu-item": "_side-menu-item_1o1uo_1",
|
|
13
13
|
sideMenuItem: K,
|
package/dist/main.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ShortcutLinksContext-DUPcMKu4.cjs"),g=require("react"),Ae=require("./Loading-Dt9084Dj.cjs"),Vs=require("@azure/msal-browser"),$s=require("@azure/msal-react"),pe=require("react-router-dom"),gt=require("react-dom"),Ve=require("react-hook-form"),Gs=require("react-flexmonster"),qt=require("./useRenderDraggableInPortal-QPCaw-E_.cjs"),kt=require("./useGetApiData-BWtAl5Vk.cjs"),_t=require("./numberUtils-BY7ziQF8.cjs");function Ws(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const fe=Ws(g),Us=({fileLoader:e,fileName:t,children:r})=>{const o=g.useCallback(async()=>{var l,c;const a=await e();if(!a)return;const i=window.URL.createObjectURL(new Blob([a])),s=document.createElement("a");s.href=i,s.setAttribute("download",t),(l=document.body)==null||l.appendChild(s),s.click(),(c=document.body)==null||c.removeChild(s)},[e,t]);return n.jsxRuntimeExports.jsx("div",{role:"button",onClick:o,children:r})},Aa=({className:e,size:t,...r})=>n.jsxRuntimeExports.jsxs("div",{className:n.classNames("luminus-loading",Ae.classes.loading,Ae.classes.loadingBlock,t==="line"?Ae.classes.sizeLine:void 0,t==="fill"?Ae.classes.sizeFill:void 0,e),...r,children:[n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary"),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary",Ae.classes.second),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary",Ae.classes.third),role:"status"})]});function Hs(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getTime()-o.getTime();return a<0?-1:a>0?1:a}function ro(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return a*12+i}function no(e){const t=n.toDate(e);return Math.trunc(t.getMonth()/3)+1}function Dr(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getFullYear()-o.getFullYear(),i=no(r)-no(o);return a*4+i}function oo(e,t,r){const o=n.startOfWeek(e,r),a=n.startOfWeek(t,r),i=+o-n.getTimezoneOffsetInMilliseconds(o),s=+a-n.getTimezoneOffsetInMilliseconds(a);return Math.round((i-s)/n.millisecondsInWeek)}function Sr(e,t){const r=n.toDate(e),o=n.toDate(t);return r.getFullYear()-o.getFullYear()}function zs(e,t){const r=n.toDate(e),o=n.toDate(t),a=ao(r,o),i=Math.abs(n.differenceInCalendarDays(r,o));r.setDate(r.getDate()-a*i);const s=+(ao(r,o)===-a),l=a*(i-s);return l===0?0:l}function ao(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function xn(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function vn(e,t){return+n.toDate(e)-+n.toDate(t)}function io(e,t,r){const o=vn(e,t)/n.millisecondsInHour;return xn(r==null?void 0:r.roundingMethod)(o)}function so(e,t,r){const o=vn(e,t)/n.millisecondsInMinute;return xn(r==null?void 0:r.roundingMethod)(o)}function Ir(e,t,r){const o=vn(e,t)/1e3;return xn(r==null?void 0:r.roundingMethod)(o)}function en(e,t){const r=n.toDate(e);if(isNaN(r.getTime()))throw new RangeError("Invalid time value");const o=(t==null?void 0:t.format)??"extended",a=(t==null?void 0:t.representation)??"complete";let i="",s="";const l=o==="extended"?"-":"",c=o==="extended"?":":"";if(a!=="time"){const p=n.addLeadingZeros(r.getDate(),2),d=n.addLeadingZeros(r.getMonth()+1,2);i=`${n.addLeadingZeros(r.getFullYear(),4)}${l}${d}${l}${p}`}if(a!=="date"){const p=r.getTimezoneOffset();if(p!==0){const h=Math.abs(p),b=n.addLeadingZeros(Math.trunc(h/60),2),v=n.addLeadingZeros(h%60,2);s=`${p<0?"+":"-"}${b}:${v}`}else s="Z";const d=n.addLeadingZeros(r.getHours(),2),u=n.addLeadingZeros(r.getMinutes(),2),m=n.addLeadingZeros(r.getSeconds(),2),f=i===""?"":"T",x=[d,u,m].join(c);i=`${i}${f}${x}${s}`}return i}function qs(e){const t=n.toDate(e),r=t.getFullYear(),o=t.getMonth(),a=n.constructFrom(e,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Ys(e,t,r){let o=0,a;const i=n.toDate(e),s=n.toDate(t);if(r!=null&&r.unit)a=r==null?void 0:r.unit,a==="second"?o=Ir(i,s):a==="minute"?o=so(i,s):a==="hour"?o=io(i,s):a==="day"?o=n.differenceInCalendarDays(i,s):a==="week"?o=oo(i,s):a==="month"?o=ro(i,s):a==="quarter"?o=Dr(i,s):a==="year"&&(o=Sr(i,s));else{const c=Ir(i,s);Math.abs(c)<n.secondsInMinute?(o=Ir(i,s),a="second"):Math.abs(c)<n.secondsInHour?(o=so(i,s),a="minute"):Math.abs(c)<n.secondsInDay&&Math.abs(n.differenceInCalendarDays(i,s))<1?(o=io(i,s),a="hour"):Math.abs(c)<n.secondsInWeek&&(o=n.differenceInCalendarDays(i,s))&&Math.abs(o)<7?a="day":Math.abs(c)<n.secondsInMonth?(o=oo(i,s),a="week"):Math.abs(c)<n.secondsInQuarter?(o=ro(i,s),a="month"):Math.abs(c)<n.secondsInYear&&Dr(i,s)<4?(o=Dr(i,s),a="quarter"):(o=Sr(i,s),a="year")}return new Intl.RelativeTimeFormat(r==null?void 0:r.locale,{localeMatcher:r==null?void 0:r.localeMatcher,numeric:(r==null?void 0:r.numeric)||"auto",style:r==null?void 0:r.style}).format(o,a)}function Ks(e,t){const r=n.toDate(e),o=r.getFullYear(),a=r.getDate(),i=n.constructFrom(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=qs(i);return r.setMonth(t,Math.min(a,s)),r}function tn(e,t){const r=n.toDate(e);return isNaN(+r)?n.constructFrom(e,NaN):(r.setFullYear(t),r)}function Dt(...e){return e.filter(t=>t!=null).reduce((t,r)=>{if(typeof r!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?r:function(...a){t.apply(this,a),r.apply(this,a)}},null)}const Xs={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Js(e,t){const r=`offset${e[0].toUpperCase()}${e.slice(1)}`,o=t[r],a=Xs[e];return o+parseInt(n.style(t,a[0]),10)+parseInt(n.style(t,a[1]),10)}const Qs={[n.EXITED]:"collapse",[n.EXITING]:"collapsing",[n.ENTERING]:"collapsing",[n.ENTERED]:"collapse show"},ka=g.forwardRef(({onEnter:e,onEntering:t,onEntered:r,onExit:o,onExiting:a,className:i,children:s,dimension:l="height",in:c=!1,timeout:p=300,mountOnEnter:d=!1,unmountOnExit:u=!1,appear:m=!1,getDimensionValue:f=Js,...x},h)=>{const b=typeof l=="function"?l():l,v=g.useMemo(()=>Dt(N=>{N.style[b]="0"},e),[b,e]),E=g.useMemo(()=>Dt(N=>{const I=`scroll${b[0].toUpperCase()}${b.slice(1)}`;N.style[b]=`${N[I]}px`},t),[b,t]),C=g.useMemo(()=>Dt(N=>{N.style[b]=null},r),[b,r]),R=g.useMemo(()=>Dt(N=>{N.style[b]=`${f(b,N)}px`,n.triggerBrowserReflow(N)},o),[o,f,b]),y=g.useMemo(()=>Dt(N=>{N.style[b]=null},a),[b,a]);return n.jsxRuntimeExports.jsx(n.TransitionWrapper,{ref:h,addEndListener:n.transitionEndListener,...x,"aria-expanded":x.role?c:null,onEnter:v,onEntering:E,onEntered:C,onExit:R,onExiting:y,childRef:s.ref,in:c,timeout:p,mountOnEnter:d,unmountOnExit:u,appear:m,children:(N,I)=>g.cloneElement(s,{...I,className:n.classNames(i,s.props.className,Qs[N],b==="width"&&"collapse-horizontal")})})}),hn=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-body"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));hn.displayName="CardBody";const Ba=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-footer"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ba.displayName="CardFooter";const Ma=fe.createContext(null);Ma.displayName="CardHeaderContext";const La=fe.forwardRef(({bsPrefix:e,className:t,as:r="div",...o},a)=>{const i=n.useBootstrapPrefix(e,"card-header"),s=g.useMemo(()=>({cardHeaderBsPrefix:i}),[i]);return n.jsxRuntimeExports.jsx(Ma.Provider,{value:s,children:n.jsxRuntimeExports.jsx(r,{ref:a,...o,className:n.classNames(t,i)})})});La.displayName="CardHeader";const Fa=fe.forwardRef(({bsPrefix:e,className:t,variant:r,as:o="img",...a},i)=>{const s=n.useBootstrapPrefix(e,"card-img");return n.jsxRuntimeExports.jsx(o,{ref:i,className:n.classNames(r?`${s}-${r}`:s,t),...a})});Fa.displayName="CardImg";const Va=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-img-overlay"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Va.displayName="CardImgOverlay";const $a=fe.forwardRef(({className:e,bsPrefix:t,as:r="a",...o},a)=>(t=n.useBootstrapPrefix(t,"card-link"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));$a.displayName="CardLink";const Zs=n.divWithClassName("h6"),Ga=fe.forwardRef(({className:e,bsPrefix:t,as:r=Zs,...o},a)=>(t=n.useBootstrapPrefix(t,"card-subtitle"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ga.displayName="CardSubtitle";const Wa=fe.forwardRef(({className:e,bsPrefix:t,as:r="p",...o},a)=>(t=n.useBootstrapPrefix(t,"card-text"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Wa.displayName="CardText";const el=n.divWithClassName("h5"),Ua=fe.forwardRef(({className:e,bsPrefix:t,as:r=el,...o},a)=>(t=n.useBootstrapPrefix(t,"card-title"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ua.displayName="CardTitle";const Ha=fe.forwardRef(({bsPrefix:e,className:t,bg:r,text:o,border:a,body:i=!1,children:s,as:l="div",...c},p)=>{const d=n.useBootstrapPrefix(e,"card");return n.jsxRuntimeExports.jsx(l,{ref:p,...c,className:n.classNames(t,d,r&&`bg-${r}`,o&&`text-${o}`,a&&`border-${a}`),children:i?n.jsxRuntimeExports.jsx(hn,{children:s}):s})});Ha.displayName="Card";const lo=Object.assign(Ha,{Img:Fa,Title:Ua,Subtitle:Ga,Body:hn,Link:$a,Text:Wa,Header:La,Footer:Ba,ImgOverlay:Va}),hr=fe.forwardRef(({className:e,bsPrefix:t,as:r="span",...o},a)=>(t=n.useBootstrapPrefix(t,"input-group-text"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));hr.displayName="InputGroupText";const tl=e=>n.jsxRuntimeExports.jsx(hr,{children:n.jsxRuntimeExports.jsx(n.FormCheckInput,{type:"checkbox",...e})}),rl=e=>n.jsxRuntimeExports.jsx(hr,{children:n.jsxRuntimeExports.jsx(n.FormCheckInput,{type:"radio",...e})}),za=fe.forwardRef(({bsPrefix:e,size:t,hasValidation:r,className:o,as:a="div",...i},s)=>{e=n.useBootstrapPrefix(e,"input-group");const l=g.useMemo(()=>({}),[]);return n.jsxRuntimeExports.jsx(n.context.Provider,{value:l,children:n.jsxRuntimeExports.jsx(a,{ref:s,...i,className:n.classNames(o,e,t&&`${e}-${t}`,r&&"has-validation")})})});za.displayName="InputGroup";const cr=Object.assign(za,{Text:hr,Radio:rl,Checkbox:tl}),rn=new WeakMap,co=(e,t)=>{if(!e||!t)return;const r=rn.get(t)||new Map;rn.set(t,r);let o=r.get(e);return o||(o=t.matchMedia(e),o.refCount=0,r.set(o.media,o)),o};function nl(e,t=typeof window>"u"?void 0:window){const r=co(e,t),[o,a]=g.useState(()=>r?r.matches:!1);return n.useIsomorphicEffect(()=>{let i=co(e,t);if(!i)return a(!1);let s=rn.get(t);const l=()=>{a(i.matches)};return i.refCount++,i.addListener(l),l(),()=>{i.removeListener(l),i.refCount--,i.refCount<=0&&(s==null||s.delete(i.media)),i=void 0}},[e]),o}function ol(e){const t=Object.keys(e);function r(l,c){return l===c?c:l?`${l} and ${c}`:c}function o(l){return t[Math.min(t.indexOf(l)+1,t.length-1)]}function a(l){const c=o(l);let p=e[c];return typeof p=="number"?p=`${p-.2}px`:p=`calc(${p} - 0.2px)`,`(max-width: ${p})`}function i(l){let c=e[l];return typeof c=="number"&&(c=`${c}px`),`(min-width: ${c})`}function s(l,c,p){let d;typeof l=="object"?(d=l,p=c,c=!0):(c=c||!0,d={[l]:c});let u=g.useMemo(()=>Object.entries(d).reduce((m,[f,x])=>((x==="up"||x===!0)&&(m=r(m,i(f))),(x==="down"||x===!0)&&(m=r(m,a(f))),m),""),[JSON.stringify(d)]);return nl(u,p)}return s}const al=ol({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),qa=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"offcanvas-body"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));qa.displayName="OffcanvasBody";const il={[n.ENTERING]:"show",[n.ENTERED]:"show"},Ya=fe.forwardRef(({bsPrefix:e,className:t,children:r,in:o=!1,mountOnEnter:a=!1,unmountOnExit:i=!1,appear:s=!1,...l},c)=>(e=n.useBootstrapPrefix(e,"offcanvas"),n.jsxRuntimeExports.jsx(n.TransitionWrapper,{ref:c,addEndListener:n.transitionEndListener,in:o,mountOnEnter:a,unmountOnExit:i,appear:s,...l,childRef:r.ref,children:(p,d)=>fe.cloneElement(r,{...d,className:n.classNames(t,r.props.className,(p===n.ENTERING||p===n.EXITING)&&`${e}-toggling`,il[p])})})));Ya.displayName="OffcanvasToggling";const Ka=fe.forwardRef(({bsPrefix:e,className:t,closeLabel:r="Close",closeButton:o=!1,...a},i)=>(e=n.useBootstrapPrefix(e,"offcanvas-header"),n.jsxRuntimeExports.jsx(n.AbstractModalHeader,{ref:i,...a,className:n.classNames(t,e),closeLabel:r,closeButton:o})));Ka.displayName="OffcanvasHeader";const sl=n.divWithClassName("h5"),Xa=fe.forwardRef(({className:e,bsPrefix:t,as:r=sl,...o},a)=>(t=n.useBootstrapPrefix(t,"offcanvas-title"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Xa.displayName="OffcanvasTitle";function ll(e){return n.jsxRuntimeExports.jsx(Ya,{...e})}function cl(e){return n.jsxRuntimeExports.jsx(n.Fade,{...e})}const Ja=fe.forwardRef(({bsPrefix:e,className:t,children:r,"aria-labelledby":o,placement:a="start",responsive:i,show:s=!1,backdrop:l=!0,keyboard:c=!0,scroll:p=!1,onEscapeKeyDown:d,onShow:u,onHide:m,container:f,autoFocus:x=!0,enforceFocus:h=!0,restoreFocus:b=!0,restoreFocusOptions:v,onEntered:E,onExit:C,onExiting:R,onEnter:y,onEntering:N,onExited:I,backdropClassName:D,manager:S,renderStaticNode:A=!1,...P},F)=>{const w=g.useRef();e=n.useBootstrapPrefix(e,"offcanvas");const[q,G]=g.useState(!1),O=n.useEventCallback(m),_=al(i||"xs","up");g.useEffect(()=>{G(i?s&&!_:s)},[s,i,_]);const V=g.useMemo(()=>({onHide:O}),[O]);function B(){return S||(p?(w.current||(w.current=new n.BootstrapModalManager({handleContainerOverflow:!1})),w.current):n.getSharedManager())}const z=(J,...k)=>{J&&(J.style.visibility="visible"),y==null||y(J,...k)},$=(J,...k)=>{J&&(J.style.visibility=""),I==null||I(...k)},K=g.useCallback(J=>n.jsxRuntimeExports.jsx("div",{...J,className:n.classNames(`${e}-backdrop`,D)}),[D,e]),Q=J=>n.jsxRuntimeExports.jsx("div",{...J,...P,className:n.classNames(t,i?`${e}-${i}`:e,`${e}-${a}`),"aria-labelledby":o,children:r});return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[!q&&(i||A)&&Q({}),n.jsxRuntimeExports.jsx(n.ModalContext.Provider,{value:V,children:n.jsxRuntimeExports.jsx(n.BaseModal,{show:q,ref:F,backdrop:l,container:f,keyboard:c,autoFocus:x,enforceFocus:h&&!p,restoreFocus:b,restoreFocusOptions:v,onEscapeKeyDown:d,onShow:u,onHide:O,onEnter:z,onEntering:N,onEntered:E,onExit:C,onExiting:R,onExited:$,manager:B(),transition:ll,backdropTransition:cl,renderBackdrop:K,renderDialog:Q})})]})});Ja.displayName="Offcanvas";const uo=Object.assign(Ja,{Body:qa,Header:Ka,Title:Xa});function Qa({animation:e,bg:t,bsPrefix:r,size:o,...a}){r=n.useBootstrapPrefix(r,"placeholder");const[{className:i,...s}]=n.useCol(a);return{...s,className:n.classNames(i,e?`${r}-${e}`:r,o&&`${r}-${o}`,t&&`bg-${t}`)}}const Za=fe.forwardRef((e,t)=>{const r=Qa(e);return n.jsxRuntimeExports.jsx(n.Button,{...r,ref:t,disabled:!0,tabIndex:-1})});Za.displayName="PlaceholderButton";const ei=fe.forwardRef(({as:e="span",...t},r)=>{const o=Qa(t);return n.jsxRuntimeExports.jsx(e,{...o,ref:r})});ei.displayName="Placeholder";const ze=Object.assign(ei,{Button:Za}),ti=fe.forwardRef(({bsPrefix:e,className:t,as:r="div",...o},a)=>{const i=n.useBootstrapPrefix(e,"row"),s=n.useBootstrapBreakpoints(),l=n.useBootstrapMinBreakpoint(),c=`${i}-cols`,p=[];return s.forEach(d=>{const u=o[d];delete o[d];let m;u!=null&&typeof u=="object"?{cols:m}=u:m=u;const f=d!==l?`-${d}`:"";m!=null&&p.push(`${c}${f}-${m}`)}),n.jsxRuntimeExports.jsx(r,{ref:a,...o,className:n.classNames(t,i,...p)})});ti.displayName="Row";const ul=fe.forwardRef(({bsPrefix:e,className:t,striped:r,bordered:o,borderless:a,hover:i,size:s,variant:l,responsive:c,...p},d)=>{const u=n.useBootstrapPrefix(e,"table"),m=n.classNames(t,u,l&&`${u}-${l}`,s&&`${u}-${s}`,r&&`${u}-${typeof r=="string"?`striped-${r}`:"striped"}`,o&&`${u}-bordered`,a&&`${u}-borderless`,i&&`${u}-hover`),f=n.jsxRuntimeExports.jsx("table",{...p,className:m,ref:d});if(c){let x=`${u}-responsive`;return typeof c=="string"&&(x=`${x}-${c}`),n.jsxRuntimeExports.jsx("div",{className:x,children:f})}return f}),ri=({children:e,onStorno:t,noSpacer:r,disabled:o})=>{const{texts:{formSubmit:a}}=g.useContext(n.LuminusComponentsContext);return n.jsxRuntimeExports.jsxs(Cs,{noSpacer:r,children:[n.jsxRuntimeExports.jsxs(n.PrimaryButton,{as:"button",color:"primary",size:"lg",type:"submit",disabled:o,children:[n.jsxRuntimeExports.jsx(n.MdCheck,{}),e]}),t&&n.jsxRuntimeExports.jsxs(n.PrimaryButton,{as:"button",color:"secondary",variant:"outlined",size:"lg",onClick:t,children:[n.jsxRuntimeExports.jsx(n.MdOutlineClose,{}),a.storno]})]})},bn=({color:e="primary",icon:t=n.jsxRuntimeExports.jsx(n.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:o="*",onUpload:a,className:i,children:s,multiple:l,...c})=>{const p=d=>{d.target.files&&(a(d.target.files),d.target.value="")};return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:n.classNames(`luminus-context-button btn text-${e} ${i??""}`,n.classes.button),...c,children:[t,s]}),n.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:o,onChange:p,hidden:!0,multiple:l})]})},dl=({onUpload:e,accept:t,children:r,className:o,size:a="md"})=>{const i=g.useCallback(async l=>{if(l.target.files)try{await e(l.target.files)}finally{l.target.value=""}},[e]),s=g.useId();return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("label",{htmlFor:s,className:n.classNames("btn luminus-context-button text-primary",`btn-${a}`,o),children:r}),n.jsxRuntimeExports.jsx("input",{id:s,type:"file",accept:t,onChange:i,hidden:!0})]})},pl="_select_14f33_1",fl="_sm_14f33_11",ml="_lg_14f33_23",tr={select:pl,sm:fl,lg:ml},ni=({month:e,onChangeMonth:t,locale:r,yearMin:o=2e3,yearMax:a=2050,className:i,monthClassName:s,yearClassName:l,size:c})=>{const p=g.useCallback(m=>{const f=n.addMonths(e,m);f.getFullYear()<o||f.getFullYear()>a||t(f)},[e,t,o,a]),d=g.useMemo(()=>{const m=[];for(let f=o;f<=a;f++)m.push(f);return m},[o,a]),u=g.useMemo(()=>{const x=[];for(let h=0;h<=11;h++)x.push({id:h,name:n.format(new Date(2024,h,1),"LLLL",{locale:r})});return x},[r]);return n.jsxRuntimeExports.jsxs("div",{className:n.classNames("card d-flex flex-row align-items-center justify-content-center m-0 p-1 gap-2",i,{[tr[c]]:c}),children:[n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>p(-1),disabled:e.getFullYear()<o||e.getFullYear()===o&&e.getMonth()<=0,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowLeft,{})}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getMonth(),onChange:m=>{var f;return((f=m.target)==null?void 0:f.value)&&t(Ks(e,Number(m.target.value)))},className:n.classNames(tr.select,tr.month,s),children:u.map(m=>n.jsxRuntimeExports.jsx("option",{value:m.id,children:m.name},m.id))}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getFullYear(),onChange:m=>{var f;return((f=m.target)==null?void 0:f.value)&&t(tn(e,Number(m.target.value)))},className:n.classNames(tr.select,l),children:d.map(m=>n.jsxRuntimeExports.jsx("option",{value:m,children:m},m))}),n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>p(1),disabled:e.getFullYear()>a||e.getFullYear()===a&&e.getMonth()>=11,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowRight,{})})]})},gl="_select_pywmr_1",xl={select:gl},po=2e3,fo=2050,oi=({year:e,onChangeYear:t,className:r,...o})=>{const a=g.useMemo(()=>{var c;return o.manualOptions?((c=o.options)==null?void 0:c.at(0))??po:o.optionMin??po},[o]),i=g.useMemo(()=>{var c;return o.manualOptions?((c=o.options)==null?void 0:c.at(-1))??fo:o.optionMax??fo},[o]),s=g.useMemo(()=>{if(o.manualOptions)return o.options;const c=[];for(let p=a;p<=i;p++)c.push(p);return c},[o,i,a]),l=g.useCallback(c=>{if(o.manualOptions){const p=s.findIndex(d=>d===e.getFullYear());if(p!==-1){const d=s.at(p+c)??null;d&&t(tn(e,d))}}else{const p=e.getFullYear()+c;p>=a&&p<=i&&t(n.addYears(e,c))}},[e,t,i,a,o,s]);return n.jsxRuntimeExports.jsxs("div",{className:n.classNames("card d-flex flex-row align-items-center m-0 p-1 gap-2",r??""),children:[n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>l(-1),disabled:e.getFullYear()<=a,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowLeft,{})}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getFullYear(),onChange:c=>{var p;return((p=c.target)==null?void 0:p.value)&&t(tn(e,Number(c.target.value)))},className:xl.select,children:s.map(c=>n.jsxRuntimeExports.jsx("option",{value:c,children:c},c))}),n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>l(1),disabled:e.getFullYear()>=i,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowRight,{})})]})};class vl extends g.Component{constructor(t){super(t),this.state={hasError:!1,is404Error:!1},this.reload=this.reload.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,is404Error:t.message==="404"}}componentDidUpdate(t){this.state.hasError&&t.keyForErrorState!==this.props.keyForErrorState&&this.setState({hasError:!1,is404Error:!1})}componentDidCatch(t,r){console.error("Error:",t,r)}reload(){this.setState({hasError:!1,is404Error:!1})}render(){const{fallback:t,fallbackOn404:r,children:o,texts:a,reloadButtonDisplay:i="append-after-child"}=this.props;return this.state.hasError?i==="inject-to-child"&&!this.state.is404Error&&g.isValidElement(t)?g.cloneElement(t,{...t.props},n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...t.props.children,n.jsxRuntimeExports.jsx("div",{className:"d-flex gap-2 justify-content-center",children:n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent})})]})):i==="inject-to-child"&&this.state.is404Error&&g.isValidElement(r)?g.cloneElement(r,{...r.props},n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...r.props.children,n.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]})):n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[this.state.is404Error?r:t,n.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[i==="none"?null:n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),this.state.is404Error&&n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]}):o}}const hl=e=>r=>{const{texts:{errorBoundary:o}}=g.useContext(n.LuminusComponentsContext);return n.jsxRuntimeExports.jsx(e,{texts:o,...r})},ai=hl(vl),bl="_widget-card_e9tsb_1",El={"widget-card":"_widget-card_e9tsb_1",widgetCard:bl},nn=({children:e,title:t,headerContent:r})=>n.jsxRuntimeExports.jsx(En,{className:n.classNames(El.widgetCard,"luminus-widget"),title:t,headerContent:r,contentClassName:"h-100 overflow-auto",children:e}),yl=({children:e,title:t})=>{const{texts:{widget:r}}=g.useContext(n.LuminusComponentsContext),o=pe.useNavigate();return n.jsxRuntimeExports.jsx(ai,{fallback:n.jsxRuntimeExports.jsx(nn,{title:t,children:r.fallbackError}),reloadButtonDisplay:"inject-to-child",navigateBack:()=>o(-1),children:n.jsxRuntimeExports.jsx(g.Suspense,{fallback:n.jsxRuntimeExports.jsx(nn,{title:t,children:n.jsxRuntimeExports.jsx(Aa,{})}),children:e})})},jl="_widgets-row_13gg1_1",Rl="_widget_13gg1_1",Cl="_widget-img_13gg1_5",wl="_widget-title-spacer_13gg1_14",Nl="_widget-title_13gg1_14",Dl="_title_13gg1_28",Te={"widgets-row":"_widgets-row_13gg1_1",widgetsRow:jl,widget:Rl,"widget-img":"_widget-img_13gg1_5",widgetImg:Cl,"widget-title-spacer":"_widget-title-spacer_13gg1_14",widgetTitleSpacer:wl,"widget-title":"_widget-title_13gg1_14",widgetTitle:Nl,title:Dl},Sl=({show:e,widgetGroups:t,widgets:r,handleClose:o,onWidgetPicked:a,texts:i})=>{const[s,l]=g.useState(""),c=g.useMemo(()=>r.filter(d=>d.id!==-1&&n.stringSearchWithin(d.name,s)),[r,s]),p=g.useMemo(()=>t.filter(d=>c.some(u=>u.group===d.id)),[t,c]);return n.jsxRuntimeExports.jsxs(n.Modal,{show:e,onHide:()=>o(),size:"lg",children:[n.jsxRuntimeExports.jsxs(n.Modal.Header,{closeButton:!0,children:[n.jsxRuntimeExports.jsx(n.Modal.Title,{className:"w-100",children:i.pickWidgetToAdd}),n.jsxRuntimeExports.jsx(n.Form.Control,{type:"search",size:"sm",value:s,placeholder:i.searchPlaceholder,onChange:d=>{var u;return l(((u=d.target)==null?void 0:u.value)??"")},className:"me-3",style:{maxWidth:"200px"}})]}),n.jsxRuntimeExports.jsx(n.Modal.Body,{className:"flex-column gap-3",children:c.length===0?n.jsxRuntimeExports.jsx(n.Alert,{variant:"warning",children:i.noWidgets}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[p.map(d=>n.jsxRuntimeExports.jsx(Bt,{defaultOpen:!0,title:d.name??"",children:n.jsxRuntimeExports.jsx("div",{className:"p-1",children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("row gx-3 gy-3",Te.widgetsRow),children:c.filter(u=>u.group===d.id).map(u=>n.jsxRuntimeExports.jsx("div",{className:"col col-4",children:n.jsxRuntimeExports.jsxs("div",{role:"button",className:n.classNames("p-0 pt-2 bg-white rounded shadow-sm",Te.widget),onClick:()=>a(u.id),children:[n.jsxRuntimeExports.jsx("div",{className:Te.widgetImg,style:{backgroundImage:u.img?`url(${u.img})`:void 0}}),n.jsxRuntimeExports.jsx("div",{className:Te.widgetTitleSpacer}),n.jsxRuntimeExports.jsx("div",{className:n.classNames(Te.widgetTitle,"rounded"),children:n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:n.classNames(Te.title,"text-white text-truncate"),children:u.name})})]},u.id)}))})})},d.id)),c.some(d=>d.group===void 0)&&n.jsxRuntimeExports.jsx(Bt,{defaultOpen:!0,title:i.otherWidgets,children:n.jsxRuntimeExports.jsx("div",{className:"p-1",children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("row gx-3 gy-3",Te.widgetsRow),children:c.filter(d=>d.group===void 0).map(d=>n.jsxRuntimeExports.jsx("div",{className:"col col-4",children:n.jsxRuntimeExports.jsxs("div",{role:"button",className:n.classNames("p-0 pt-2 bg-white rounded shadow-sm",Te.widget),onClick:()=>a(d.id),children:[n.jsxRuntimeExports.jsx("div",{className:Te.widgetImg,style:{backgroundImage:d.img?`url(${d.img})`:void 0}}),n.jsxRuntimeExports.jsx("div",{className:Te.widgetTitleSpacer}),n.jsxRuntimeExports.jsx("div",{className:n.classNames(Te.widgetTitle,"rounded"),children:n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:n.classNames(Te.title,"text-white text-truncate"),children:d.name})})]},d.id)}))})})})]})})]})},Il="_widget_19xgl_1",Ol="_mobile_19xgl_7",mo={widget:Il,mobile:Ol},go=({widgetGroups:e,availableWidgets:t,onAdd:r,texts:o})=>{const[a,i]=g.useState(!1),{isMobile:s}=n.useWindowSize();return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-empty-widget",mo.widget,{[mo.mobile]:s}),children:n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>i(!0),children:n.jsxRuntimeExports.jsx(n.MdOutlineAddCircleOutline,{})})}),n.jsxRuntimeExports.jsx(Sl,{show:a,widgetGroups:e,widgets:t,handleClose:()=>i(!1),onWidgetPicked:l=>{i(!1),r(l)},texts:o})]})},_l="_dashboard_1gf59_1",Tl="_widgets-grid_1gf59_1",Pl="_widget-wrapper_1gf59_8",Al="_full-width_1gf59_13",kl="_widget-edit_1gf59_16",Bl="_remove-icon_1gf59_19",Ml="_full-width-icon_1gf59_26",Ll="_widget-edit-overlay_1gf59_36",Fl="_mobile_1gf59_45",Ge={dashboard:_l,"widgets-grid":"_widgets-grid_1gf59_1",widgetsGrid:Tl,"widget-wrapper":"_widget-wrapper_1gf59_8",widgetWrapper:Pl,"full-width":"_full-width_1gf59_13",fullWidth:Al,"widget-edit":"_widget-edit_1gf59_16",widgetEdit:kl,"remove-icon":"_remove-icon_1gf59_19",removeIcon:Bl,"full-width-icon":"_full-width-icon_1gf59_26",fullWidthIcon:Ml,"widget-edit-overlay":"_widget-edit-overlay_1gf59_36",widgetEditOverlay:Ll,mobile:Fl},Vl=e=>{const[t,r]=g.useState({widgets:[]});g.useEffect(()=>{const a=localStorage.getItem("dashboardConfig");a?r(JSON.parse(a)):e&&r(e)},[e]);const o=g.useCallback(a=>{r(a),localStorage.setItem("dashboardConfig",JSON.stringify(a))},[]);return{dashboardConfig:t,onChangeDashboardConfig:o}},$l=({widgetGroups:e,availableWidgets:t,editMode:r,defaultDashboardConfig:o})=>{var m;const{texts:{homeDashboard:a}}=g.useContext(n.LuminusComponentsContext),{dashboardConfig:i,onChangeDashboardConfig:s}=Vl(o),l=g.useCallback((f,x)=>{var h,b;f===((h=i.widgets)==null?void 0:h.length)?s({...i,widgets:[...i.widgets,{widgetId:x,fullWidth:!1}]}):s({...i,widgets:((b=i.widgets)==null?void 0:b.map((v,E)=>E===f?{widgetId:x,fullWidth:!1}:v))??[]})},[i,s]),c=g.useCallback(f=>{var x,h;((x=i.widgets[f])==null?void 0:x.widgetId)===-1?s({...i,widgets:((h=i.widgets)==null?void 0:h.filter((b,v)=>v!==f))??[]}):l(f,-1)},[i,s,l]),p=g.useCallback(f=>{var x;s({...i,widgets:((x=i.widgets)==null?void 0:x.map((h,b)=>b===f?{...h,fullWidth:!h.fullWidth}:h))??[]})},[i,s]),d=g.useCallback((f,x,h)=>f?n.jsxRuntimeExports.jsxs("div",{className:n.classNames(Ge.widgetWrapper,{[Ge.widgetEdit]:r&&f.id!==-1},{[Ge.fullWidth]:h}),children:[r&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(n.IconButton,{color:"danger",onClick:()=>c(x),className:n.classNames(Ge.removeIcon),children:n.jsxRuntimeExports.jsx(n.MdOutlineDelete,{})}),n.jsxRuntimeExports.jsx(n.IconButton,{color:h?"danger":"primary",onClick:()=>p(x),className:n.classNames(Ge.fullWidthIcon),children:n.jsxRuntimeExports.jsx(n.MdOutlineExpand,{})})]}),f.id===-1?r&&n.jsxRuntimeExports.jsx("div",{className:Ge.widgetWrapper,children:n.jsxRuntimeExports.jsx(go,{widgetGroups:e,availableWidgets:t,onAdd:b=>l(x,b),texts:a})}):n.jsxRuntimeExports.jsx(yl,{title:f.title,children:n.jsxRuntimeExports.jsx(f.WidgetElement,{title:f.title})}),f.id>-1&&r&&n.jsxRuntimeExports.jsx("div",{className:Ge.widgetEditOverlay})]},x):n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{}),[r,e,l,c,p,t,a]),{isMobile:u}=n.useWindowSize();return n.jsxRuntimeExports.jsx("div",{className:n.classNames(Ge.dashboard,{[Ge.mobile]:u}),children:n.jsxRuntimeExports.jsxs("div",{className:n.classNames(Ge.widgetsGrid),children:[(m=i.widgets)==null?void 0:m.map((f,x)=>d(t.find(h=>h.id===f.widgetId),x,f.fullWidth)),r&&n.jsxRuntimeExports.jsx(go,{widgetGroups:e,availableWidgets:t,onAdd:f=>{var x;return l((x=i.widgets)==null?void 0:x.length,f)},texts:a})]})})},Gl="_badge_193ci_1",Wl="_sm_193ci_6",Ul="_md_193ci_10",Hl="_lg_193ci_14",zl="_light_193ci_18",Or={badge:Gl,sm:Wl,md:Ul,lg:Hl,light:zl},ql=({children:e,color:t="primary",size:r="md",rounded:o,className:a,variant:i="filled",...s})=>{const l=g.useMemo(()=>i==="filled"?n.classNames(`bg-${t}`):i==="outline"?n.classNames(`text-${t} border-${t} border bg-white`):"",[t,i]);return n.jsxRuntimeExports.jsx("span",{className:n.classNames("luminus-badge badge",l,a,{"rounded-pill":o},{"text-dark":t==="light"},{[Or.light]:t==="light"},Or.badge,Or[r]),...s,children:e})},Yl="_collapse-icon_1ahhn_1",Kl="_collapsed_1ahhn_6",xo={"collapse-icon":"_collapse-icon_1ahhn_1",collapseIcon:Yl,collapsed:Kl},Bt=({title:e,children:t,className:r,...o})=>{const a=o.controlled?!1:o.defaultOpen??!1,[i,s]=g.useState(a),l=o.controlled?o.isOpen:i;return g.useEffect(()=>{s(a)},[a]),n.jsxRuntimeExports.jsxs("div",{className:r??"",children:[n.jsxRuntimeExports.jsxs("div",{role:"button",className:"d-flex align-items-center justify-content-between pb-3 pt-2",onClick:()=>o.controlled?o.onToggle(!o.isOpen):s(!i),children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"h6",children:e}),n.jsxRuntimeExports.jsx(n.MdOutlineChevronRight,{className:n.classNames(xo.collapseIcon,{[xo.collapsed]:l})})]}),n.jsxRuntimeExports.jsx(ka,{in:l,children:n.jsxRuntimeExports.jsx("div",{children:t})}),n.jsxRuntimeExports.jsx("hr",{className:`my-0 ${l?"mt-3":""}`})]})},Xl=({color:e="primary",icon:t=n.jsxRuntimeExports.jsx(n.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:o="*",onUpload:a,multiple:i,className:s,children:l,...c})=>{const p=d=>{d.target.files&&(a(d.target.files),d.target.value="")};return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:n.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${s??""}`,n.classes$1.item),...c,children:[t,l]}),n.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:o,onChange:p,hidden:!0,multiple:i})]})},Jl="_input-group_1hcpm_1",Ql="_input-group-text_1hcpm_5",Zl="_left_1hcpm_9",ec="_right_1hcpm_13",tc="_input_1hcpm_1",rc="_submit-button_1hcpm_20",Ze={"input-group":"_input-group_1hcpm_1",inputGroup:Jl,"input-group-text":"_input-group-text_1hcpm_5",inputGroupText:Ql,left:Zl,right:ec,input:tc,"submit-button":"_submit-button_1hcpm_20",submitButton:rc},nc=({searchTypes:e,selectedType:t,setSelectedType:r})=>n.jsxRuntimeExports.jsx(n.Dropdown,{toggle:n.jsxRuntimeExports.jsx(n.DropdownToggle,{as:n.SimpleDropdownToggle,icon:null,text:t==null?void 0:t.text}),children:e.map(o=>n.jsxRuntimeExports.jsx(n.DropdownItem,{icon:null,onClick:()=>r(o.key),children:o.text},o.key))}),oc="_dropdown_1ddrg_1",ac="_open_1ddrg_12",ic="_loading-container_1ddrg_15",sc="_groups-container_1ddrg_22",lc="_group_1ddrg_22",cc="_header_1ddrg_26",uc="_item_1ddrg_33",et={dropdown:oc,open:ac,"loading-container":"_loading-container_1ddrg_15",loadingContainer:ic,"groups-container":"_groups-container_1ddrg_22",groupsContainer:sc,group:lc,header:cc,item:uc},dc=({show:e,query:t,onCancel:r,groups:o,isLoading:a,searchTypes:i})=>{const{texts:{appSearch:s}}=g.useContext(n.LuminusComponentsContext),l=g.useRef(null),c=g.useCallback(p=>{var u;const d=(u=i.find(m=>m.key===p.type))==null?void 0:u.toPath;return d?`${d}/${p.searchKey}`:"/not-found"},[i]);return n.useClickOutside([l],r),n.jsxRuntimeExports.jsx("div",{ref:l,className:n.classNames("luminus-app-search-dropdown shadow rounded",et.dropdown,{[et.open]:e}),children:a?n.jsxRuntimeExports.jsx("div",{className:et.loadingContainer,children:n.jsxRuntimeExports.jsx(n.Spinner,{animation:"border",variant:"primary"})}):n.jsxRuntimeExports.jsx("div",{className:et.groupsContainer,children:o==null?void 0:o.map(p=>{var d;return n.jsxRuntimeExports.jsxs("div",{className:n.classNames(et.group),children:[n.jsxRuntimeExports.jsxs(pe.Link,{to:`/search?query=${t}&type=${p.key.category}`,className:n.classNames("group-header",et.header),onClick:r,children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:"text-primary",children:p.key.categoryName}),n.jsxRuntimeExports.jsxs(n.Typography,{variant:"caption",children:[p.items.length," ",s.amountFrom," ",p.key.totalCount]})]}),(d=p.items)==null?void 0:d.map((u,m)=>n.jsxRuntimeExports.jsxs(pe.Link,{to:c(u),className:n.classNames("search-item d-flex gap-3 align-items-center justify-content-between",et.item),onClick:r,children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:u.name}),n.jsxRuntimeExports.jsx(n.Typography,{variant:"caption",className:"text-primary",children:n.jsxRuntimeExports.jsx(n.MdOutlineArrowOutward,{})})]},m))]},p.key.category)})})})},pc=(e,t)=>{const r=n.useAxios(),[o,a]=g.useState(!1),[i,s]=g.useState([]),l=!e||!e.key,c=g.useCallback(()=>{if(t.length<3){s([]);return}a(!0),r.get(`/search/${t}?count=${l?5:20}${l?"":`&type=${e.key}`}`).then(({data:p})=>{s(p),a(!1)}).catch(()=>{a(!1)})},[e,t,r,l]);return g.useEffect(()=>{c()},[c]),{isLoading:o,searchItems:i}},fc=({searchTypes:e,navigateFunction:t,currentPath:r,homePath:o="/",className:a})=>{var E;const{texts:{appSearch:i}}=g.useContext(n.LuminusComponentsContext),[s,l]=g.useState(e.length>0?((E=e.at(0))==null?void 0:E.key)??null:null),c=g.useMemo(()=>e.find(C=>C.key===s)??null,[e,s]),[p,d]=g.useState(""),[u,m]=n.a(encodeURIComponent(p),500),{isLoading:f,searchItems:x}=pc(c,u),[h,b]=g.useState(!1);g.useEffect(()=>{(x.length>0||f)&&b(!0)},[x,f]);const v=g.useRef(null);return g.useEffect(()=>{var C;d(""),r===o&&((C=v.current)==null||C.focus())},[r,o]),n.jsxRuntimeExports.jsx(n.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:C=>{C.preventDefault(),C.stopPropagation(),m.flush(),b(!1),u.length>2&&t(`/search?query=${u}${c&&c.key&&`&type=${c==null?void 0:c.key}`}`)},children:n.jsxRuntimeExports.jsxs(cr,{className:n.classNames(Ze.inputGroup,a),children:[n.jsxRuntimeExports.jsx(cr.Text,{className:n.classNames("p-1 rounded",Ze.inputGroupText,Ze.left),children:n.jsxRuntimeExports.jsx(nc,{searchTypes:e,selectedType:c,setSelectedType:l})}),n.jsxRuntimeExports.jsx(n.Form.Control,{ref:v,placeholder:i.searchPlaceholder,type:"text",size:"sm",className:n.classNames("luminus-app-search-input",Ze.input),value:p,onChange:C=>{var R;return d(((R=C.target)==null?void 0:R.value)??"")},onFocus:()=>x.length>0&&b(!0)}),n.jsxRuntimeExports.jsx(cr.Text,{className:n.classNames("p-0 rounded",Ze.inputGroupText,Ze.right),children:n.jsxRuntimeExports.jsx("button",{type:"submit",className:n.classNames("text-primary",Ze.submitButton),children:n.jsxRuntimeExports.jsx(n.FaSearch,{})})}),n.jsxRuntimeExports.jsx(dc,{query:u,searchTypes:e,show:h,onCancel:()=>b(!1),groups:x,isLoading:f})]})})},mc="_card_19733_1",gc="_header_19733_6",xc="_header-content_19733_13",vc="_title_19733_19",hc="_collapse-icon_19733_22",bc="_collapsed_19733_27",Ec="_content_19733_30",tt={card:mc,header:gc,"header-content":"_header-content_19733_13",headerContent:xc,title:vc,"collapse-icon":"_collapse-icon_19733_22",collapseIcon:hc,collapsed:bc,content:Ec},En=({title:e,headerContent:t,children:r,className:o,headerClassName:a,contentClassName:i,dontRenderIfNoChildren:s,...l})=>{const c=l.collapsible?l.controlled?!1:l.defaultOpen??!1:!0,[p,d]=g.useState(c),u=l.collapsible?l.controlled?l.isOpen:p:!0;g.useEffect(()=>{d(c)},[c]);const m=g.useMemo(()=>!r||!r.toString()||r.toString().split(",").filter(f=>f&&f!=="false").length===0,[r]);return s&&m?null:n.jsxRuntimeExports.jsxs("div",{className:n.classNames("luminus-card rounded shadow-sm",tt.card,{[o??""]:o}),children:[n.jsxRuntimeExports.jsxs("div",{role:l.collapsible?"button":void 0,className:n.classNames("header",tt.header,{[a??""]:a}),onClick:()=>{l.collapsible&&(l.controlled?l.onToggle(!l.isOpen):d(!p))},children:[n.jsxRuntimeExports.jsxs("div",{className:n.classNames("header-content",tt.headerContent),children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"h6",className:n.classNames("text-primary",tt.title),children:e}),t??null]}),l.collapsible&&n.jsxRuntimeExports.jsx(n.MdOutlineChevronRight,{className:n.classNames(tt.collapseIcon,{[tt.collapsed]:u})})]}),n.jsxRuntimeExports.jsx(ka,{in:u,children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("card-content border-top border-primary",tt.content,{[i??""]:i}),children:r})})]})};function Mt(e){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(e)}function yc(e,t){if(Mt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(Mt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jc(e){var t=yc(e,"string");return Mt(t)=="symbol"?t:t+""}function Rc(e,t,r){return(t=jc(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function ho(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vo(Object(r),!0).forEach(function(o){Rc(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vo(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function Ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var bo=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),_r=function(){return Math.random().toString(36).substring(7).split("").join(".")},Eo={INIT:"@@redux/INIT"+_r(),REPLACE:"@@redux/REPLACE"+_r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+_r()}};function Cc(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function wc(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Sc(e))return"date";if(Dc(e))return"error";var r=Nc(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Nc(e){return typeof e.constructor=="function"?e.constructor.name:null}function Dc(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Sc(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function at(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=wc(e)),t}function ii(e,t,r){var o;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+at(r)+"'");return r(ii)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+at(e)+"'");var a=e,i=t,s=[],l=s,c=!1;function p(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+at(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return p(),l.push(h),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,p();var E=l.indexOf(h);l.splice(E,1),s=null}}}function m(h){if(!Cc(h))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+at(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,h)}finally{c=!1}for(var b=s=l,v=0;v<b.length;v++){var E=b[v];E()}return h}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+at(h));a=h,m({type:Eo.REPLACE})}function x(){var h,b=u;return h={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+at(E)+"'");function C(){E.next&&E.next(d())}C();var R=b(C);return{unsubscribe:R}}},h[bo]=function(){return this},h}return m({type:Eo.INIT}),o={dispatch:m,subscribe:u,getState:d,replaceReducer:f},o[bo]=x,o}function yo(e,t){return function(){return t(e.apply(this,arguments))}}function jo(e,t){if(typeof e=="function")return yo(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?Ne(16):"bindActionCreators expected an object or a function, but instead received: '"+at(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var o in e){var a=e[o];typeof a=="function"&&(r[o]=yo(a,t))}return r}function si(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function Ic(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(o){return function(){var a=o.apply(void 0,arguments),i=function(){throw new Error(process.env.NODE_ENV==="production"?Ne(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(c){return c(s)});return i=si.apply(void 0,l)(a.dispatch),ho(ho({},a),{},{dispatch:i})}}}var yn=g.createContext(null);process.env.NODE_ENV!=="production"&&(yn.displayName="ReactRedux");function Oc(e){e()}var li=Oc,_c=function(t){return li=t},Tc=function(){return li};function Pc(){var e=Tc(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var a=t;a;)a.callback(),a=a.next})},get:function(){for(var a=[],i=t;i;)a.push(i),i=i.next;return a},subscribe:function(a){var i=!0,s=r={callback:a,next:null,prev:r};return s.prev?s.prev.next=s:t=s,function(){!i||t===null||(i=!1,s.next?s.next.prev=s.prev:r=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var Ro={notify:function(){},get:function(){return[]}};function ci(e,t){var r,o=Ro;function a(u){return c(),o.subscribe(u)}function i(){o.notify()}function s(){d.onStateChange&&d.onStateChange()}function l(){return!!r}function c(){r||(r=t?t.addNestedSub(s):e.subscribe(s),o=Pc())}function p(){r&&(r(),r=void 0,o.clear(),o=Ro)}var d={addNestedSub:a,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:l,trySubscribe:c,tryUnsubscribe:p,getListeners:function(){return o}};return d}var ui=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function di(e){var t=e.store,r=e.context,o=e.children,a=g.useMemo(function(){var l=ci(t);return{store:t,subscription:l}},[t]),i=g.useMemo(function(){return t.getState()},[t]);ui(function(){var l=a.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[a,i]);var s=r||yn;return g.createElement(s.Provider,{value:a},o)}process.env.NODE_ENV!=="production"&&(di.propTypes={store:n.PropTypes.shape({subscribe:n.PropTypes.func.isRequired,dispatch:n.PropTypes.func.isRequired,getState:n.PropTypes.func.isRequired}),context:n.PropTypes.object,children:n.PropTypes.any});var jn=n.requireReactIs(),Ac={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Bc={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pi={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Rn={};Rn[jn.ForwardRef]=Bc;Rn[jn.Memo]=pi;function Co(e){return jn.isMemo(e)?pi:Rn[e.$$typeof]||Ac}var Mc=Object.defineProperty,Lc=Object.getOwnPropertyNames,wo=Object.getOwnPropertySymbols,Fc=Object.getOwnPropertyDescriptor,Vc=Object.getPrototypeOf,No=Object.prototype;function fi(e,t,r){if(typeof t!="string"){if(No){var o=Vc(t);o&&o!==No&&fi(e,o,r)}var a=Lc(t);wo&&(a=a.concat(wo(t)));for(var i=Co(e),s=Co(t),l=0;l<a.length;++l){var c=a[l];if(!kc[c]&&!(r&&r[c])&&!(s&&s[c])&&!(i&&i[c])){var p=Fc(t,c);try{Mc(e,c,p)}catch{}}}}return e}var $c=fi;const Do=n.getDefaultExportFromCjs($c);var on={exports:{}},le={};/** @license React v17.0.2
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ShortcutLinksContext-DGRQ13Df.cjs"),g=require("react"),Ae=require("./Loading-Bq47YAVD.cjs"),Vs=require("@azure/msal-browser"),$s=require("@azure/msal-react"),pe=require("react-router-dom"),gt=require("react-dom"),Ve=require("react-hook-form"),Gs=require("react-flexmonster"),qt=require("./useRenderDraggableInPortal-QPCaw-E_.cjs"),kt=require("./useGetApiData-CruzvYco.cjs"),_t=require("./numberUtils-BY7ziQF8.cjs");function Ws(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const fe=Ws(g),Us=({fileLoader:e,fileName:t,children:r})=>{const o=g.useCallback(async()=>{var l,c;const a=await e();if(!a)return;const i=window.URL.createObjectURL(new Blob([a])),s=document.createElement("a");s.href=i,s.setAttribute("download",t),(l=document.body)==null||l.appendChild(s),s.click(),(c=document.body)==null||c.removeChild(s)},[e,t]);return n.jsxRuntimeExports.jsx("div",{role:"button",onClick:o,children:r})},Aa=({className:e,size:t,...r})=>n.jsxRuntimeExports.jsxs("div",{className:n.classNames("luminus-loading",Ae.classes.loading,Ae.classes.loadingBlock,t==="line"?Ae.classes.sizeLine:void 0,t==="fill"?Ae.classes.sizeFill:void 0,e),...r,children:[n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary"),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary",Ae.classes.second),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",Ae.classes.spinnerGrow,"text-primary",Ae.classes.third),role:"status"})]});function Hs(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getTime()-o.getTime();return a<0?-1:a>0?1:a}function ro(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return a*12+i}function no(e){const t=n.toDate(e);return Math.trunc(t.getMonth()/3)+1}function Dr(e,t){const r=n.toDate(e),o=n.toDate(t),a=r.getFullYear()-o.getFullYear(),i=no(r)-no(o);return a*4+i}function oo(e,t,r){const o=n.startOfWeek(e,r),a=n.startOfWeek(t,r),i=+o-n.getTimezoneOffsetInMilliseconds(o),s=+a-n.getTimezoneOffsetInMilliseconds(a);return Math.round((i-s)/n.millisecondsInWeek)}function Sr(e,t){const r=n.toDate(e),o=n.toDate(t);return r.getFullYear()-o.getFullYear()}function zs(e,t){const r=n.toDate(e),o=n.toDate(t),a=ao(r,o),i=Math.abs(n.differenceInCalendarDays(r,o));r.setDate(r.getDate()-a*i);const s=+(ao(r,o)===-a),l=a*(i-s);return l===0?0:l}function ao(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function xn(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function vn(e,t){return+n.toDate(e)-+n.toDate(t)}function io(e,t,r){const o=vn(e,t)/n.millisecondsInHour;return xn(r==null?void 0:r.roundingMethod)(o)}function so(e,t,r){const o=vn(e,t)/n.millisecondsInMinute;return xn(r==null?void 0:r.roundingMethod)(o)}function Ir(e,t,r){const o=vn(e,t)/1e3;return xn(r==null?void 0:r.roundingMethod)(o)}function en(e,t){const r=n.toDate(e);if(isNaN(r.getTime()))throw new RangeError("Invalid time value");const o=(t==null?void 0:t.format)??"extended",a=(t==null?void 0:t.representation)??"complete";let i="",s="";const l=o==="extended"?"-":"",c=o==="extended"?":":"";if(a!=="time"){const p=n.addLeadingZeros(r.getDate(),2),d=n.addLeadingZeros(r.getMonth()+1,2);i=`${n.addLeadingZeros(r.getFullYear(),4)}${l}${d}${l}${p}`}if(a!=="date"){const p=r.getTimezoneOffset();if(p!==0){const h=Math.abs(p),b=n.addLeadingZeros(Math.trunc(h/60),2),v=n.addLeadingZeros(h%60,2);s=`${p<0?"+":"-"}${b}:${v}`}else s="Z";const d=n.addLeadingZeros(r.getHours(),2),u=n.addLeadingZeros(r.getMinutes(),2),m=n.addLeadingZeros(r.getSeconds(),2),f=i===""?"":"T",x=[d,u,m].join(c);i=`${i}${f}${x}${s}`}return i}function qs(e){const t=n.toDate(e),r=t.getFullYear(),o=t.getMonth(),a=n.constructFrom(e,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Ys(e,t,r){let o=0,a;const i=n.toDate(e),s=n.toDate(t);if(r!=null&&r.unit)a=r==null?void 0:r.unit,a==="second"?o=Ir(i,s):a==="minute"?o=so(i,s):a==="hour"?o=io(i,s):a==="day"?o=n.differenceInCalendarDays(i,s):a==="week"?o=oo(i,s):a==="month"?o=ro(i,s):a==="quarter"?o=Dr(i,s):a==="year"&&(o=Sr(i,s));else{const c=Ir(i,s);Math.abs(c)<n.secondsInMinute?(o=Ir(i,s),a="second"):Math.abs(c)<n.secondsInHour?(o=so(i,s),a="minute"):Math.abs(c)<n.secondsInDay&&Math.abs(n.differenceInCalendarDays(i,s))<1?(o=io(i,s),a="hour"):Math.abs(c)<n.secondsInWeek&&(o=n.differenceInCalendarDays(i,s))&&Math.abs(o)<7?a="day":Math.abs(c)<n.secondsInMonth?(o=oo(i,s),a="week"):Math.abs(c)<n.secondsInQuarter?(o=ro(i,s),a="month"):Math.abs(c)<n.secondsInYear&&Dr(i,s)<4?(o=Dr(i,s),a="quarter"):(o=Sr(i,s),a="year")}return new Intl.RelativeTimeFormat(r==null?void 0:r.locale,{localeMatcher:r==null?void 0:r.localeMatcher,numeric:(r==null?void 0:r.numeric)||"auto",style:r==null?void 0:r.style}).format(o,a)}function Ks(e,t){const r=n.toDate(e),o=r.getFullYear(),a=r.getDate(),i=n.constructFrom(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=qs(i);return r.setMonth(t,Math.min(a,s)),r}function tn(e,t){const r=n.toDate(e);return isNaN(+r)?n.constructFrom(e,NaN):(r.setFullYear(t),r)}function Dt(...e){return e.filter(t=>t!=null).reduce((t,r)=>{if(typeof r!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?r:function(...a){t.apply(this,a),r.apply(this,a)}},null)}const Xs={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Js(e,t){const r=`offset${e[0].toUpperCase()}${e.slice(1)}`,o=t[r],a=Xs[e];return o+parseInt(n.style(t,a[0]),10)+parseInt(n.style(t,a[1]),10)}const Qs={[n.EXITED]:"collapse",[n.EXITING]:"collapsing",[n.ENTERING]:"collapsing",[n.ENTERED]:"collapse show"},ka=g.forwardRef(({onEnter:e,onEntering:t,onEntered:r,onExit:o,onExiting:a,className:i,children:s,dimension:l="height",in:c=!1,timeout:p=300,mountOnEnter:d=!1,unmountOnExit:u=!1,appear:m=!1,getDimensionValue:f=Js,...x},h)=>{const b=typeof l=="function"?l():l,v=g.useMemo(()=>Dt(N=>{N.style[b]="0"},e),[b,e]),E=g.useMemo(()=>Dt(N=>{const I=`scroll${b[0].toUpperCase()}${b.slice(1)}`;N.style[b]=`${N[I]}px`},t),[b,t]),C=g.useMemo(()=>Dt(N=>{N.style[b]=null},r),[b,r]),R=g.useMemo(()=>Dt(N=>{N.style[b]=`${f(b,N)}px`,n.triggerBrowserReflow(N)},o),[o,f,b]),y=g.useMemo(()=>Dt(N=>{N.style[b]=null},a),[b,a]);return n.jsxRuntimeExports.jsx(n.TransitionWrapper,{ref:h,addEndListener:n.transitionEndListener,...x,"aria-expanded":x.role?c:null,onEnter:v,onEntering:E,onEntered:C,onExit:R,onExiting:y,childRef:s.ref,in:c,timeout:p,mountOnEnter:d,unmountOnExit:u,appear:m,children:(N,I)=>g.cloneElement(s,{...I,className:n.classNames(i,s.props.className,Qs[N],b==="width"&&"collapse-horizontal")})})}),hn=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-body"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));hn.displayName="CardBody";const Ba=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-footer"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ba.displayName="CardFooter";const Ma=fe.createContext(null);Ma.displayName="CardHeaderContext";const La=fe.forwardRef(({bsPrefix:e,className:t,as:r="div",...o},a)=>{const i=n.useBootstrapPrefix(e,"card-header"),s=g.useMemo(()=>({cardHeaderBsPrefix:i}),[i]);return n.jsxRuntimeExports.jsx(Ma.Provider,{value:s,children:n.jsxRuntimeExports.jsx(r,{ref:a,...o,className:n.classNames(t,i)})})});La.displayName="CardHeader";const Fa=fe.forwardRef(({bsPrefix:e,className:t,variant:r,as:o="img",...a},i)=>{const s=n.useBootstrapPrefix(e,"card-img");return n.jsxRuntimeExports.jsx(o,{ref:i,className:n.classNames(r?`${s}-${r}`:s,t),...a})});Fa.displayName="CardImg";const Va=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"card-img-overlay"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Va.displayName="CardImgOverlay";const $a=fe.forwardRef(({className:e,bsPrefix:t,as:r="a",...o},a)=>(t=n.useBootstrapPrefix(t,"card-link"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));$a.displayName="CardLink";const Zs=n.divWithClassName("h6"),Ga=fe.forwardRef(({className:e,bsPrefix:t,as:r=Zs,...o},a)=>(t=n.useBootstrapPrefix(t,"card-subtitle"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ga.displayName="CardSubtitle";const Wa=fe.forwardRef(({className:e,bsPrefix:t,as:r="p",...o},a)=>(t=n.useBootstrapPrefix(t,"card-text"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Wa.displayName="CardText";const el=n.divWithClassName("h5"),Ua=fe.forwardRef(({className:e,bsPrefix:t,as:r=el,...o},a)=>(t=n.useBootstrapPrefix(t,"card-title"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Ua.displayName="CardTitle";const Ha=fe.forwardRef(({bsPrefix:e,className:t,bg:r,text:o,border:a,body:i=!1,children:s,as:l="div",...c},p)=>{const d=n.useBootstrapPrefix(e,"card");return n.jsxRuntimeExports.jsx(l,{ref:p,...c,className:n.classNames(t,d,r&&`bg-${r}`,o&&`text-${o}`,a&&`border-${a}`),children:i?n.jsxRuntimeExports.jsx(hn,{children:s}):s})});Ha.displayName="Card";const lo=Object.assign(Ha,{Img:Fa,Title:Ua,Subtitle:Ga,Body:hn,Link:$a,Text:Wa,Header:La,Footer:Ba,ImgOverlay:Va}),hr=fe.forwardRef(({className:e,bsPrefix:t,as:r="span",...o},a)=>(t=n.useBootstrapPrefix(t,"input-group-text"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));hr.displayName="InputGroupText";const tl=e=>n.jsxRuntimeExports.jsx(hr,{children:n.jsxRuntimeExports.jsx(n.FormCheckInput,{type:"checkbox",...e})}),rl=e=>n.jsxRuntimeExports.jsx(hr,{children:n.jsxRuntimeExports.jsx(n.FormCheckInput,{type:"radio",...e})}),za=fe.forwardRef(({bsPrefix:e,size:t,hasValidation:r,className:o,as:a="div",...i},s)=>{e=n.useBootstrapPrefix(e,"input-group");const l=g.useMemo(()=>({}),[]);return n.jsxRuntimeExports.jsx(n.context.Provider,{value:l,children:n.jsxRuntimeExports.jsx(a,{ref:s,...i,className:n.classNames(o,e,t&&`${e}-${t}`,r&&"has-validation")})})});za.displayName="InputGroup";const cr=Object.assign(za,{Text:hr,Radio:rl,Checkbox:tl}),rn=new WeakMap,co=(e,t)=>{if(!e||!t)return;const r=rn.get(t)||new Map;rn.set(t,r);let o=r.get(e);return o||(o=t.matchMedia(e),o.refCount=0,r.set(o.media,o)),o};function nl(e,t=typeof window>"u"?void 0:window){const r=co(e,t),[o,a]=g.useState(()=>r?r.matches:!1);return n.useIsomorphicEffect(()=>{let i=co(e,t);if(!i)return a(!1);let s=rn.get(t);const l=()=>{a(i.matches)};return i.refCount++,i.addListener(l),l(),()=>{i.removeListener(l),i.refCount--,i.refCount<=0&&(s==null||s.delete(i.media)),i=void 0}},[e]),o}function ol(e){const t=Object.keys(e);function r(l,c){return l===c?c:l?`${l} and ${c}`:c}function o(l){return t[Math.min(t.indexOf(l)+1,t.length-1)]}function a(l){const c=o(l);let p=e[c];return typeof p=="number"?p=`${p-.2}px`:p=`calc(${p} - 0.2px)`,`(max-width: ${p})`}function i(l){let c=e[l];return typeof c=="number"&&(c=`${c}px`),`(min-width: ${c})`}function s(l,c,p){let d;typeof l=="object"?(d=l,p=c,c=!0):(c=c||!0,d={[l]:c});let u=g.useMemo(()=>Object.entries(d).reduce((m,[f,x])=>((x==="up"||x===!0)&&(m=r(m,i(f))),(x==="down"||x===!0)&&(m=r(m,a(f))),m),""),[JSON.stringify(d)]);return nl(u,p)}return s}const al=ol({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),qa=fe.forwardRef(({className:e,bsPrefix:t,as:r="div",...o},a)=>(t=n.useBootstrapPrefix(t,"offcanvas-body"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));qa.displayName="OffcanvasBody";const il={[n.ENTERING]:"show",[n.ENTERED]:"show"},Ya=fe.forwardRef(({bsPrefix:e,className:t,children:r,in:o=!1,mountOnEnter:a=!1,unmountOnExit:i=!1,appear:s=!1,...l},c)=>(e=n.useBootstrapPrefix(e,"offcanvas"),n.jsxRuntimeExports.jsx(n.TransitionWrapper,{ref:c,addEndListener:n.transitionEndListener,in:o,mountOnEnter:a,unmountOnExit:i,appear:s,...l,childRef:r.ref,children:(p,d)=>fe.cloneElement(r,{...d,className:n.classNames(t,r.props.className,(p===n.ENTERING||p===n.EXITING)&&`${e}-toggling`,il[p])})})));Ya.displayName="OffcanvasToggling";const Ka=fe.forwardRef(({bsPrefix:e,className:t,closeLabel:r="Close",closeButton:o=!1,...a},i)=>(e=n.useBootstrapPrefix(e,"offcanvas-header"),n.jsxRuntimeExports.jsx(n.AbstractModalHeader,{ref:i,...a,className:n.classNames(t,e),closeLabel:r,closeButton:o})));Ka.displayName="OffcanvasHeader";const sl=n.divWithClassName("h5"),Xa=fe.forwardRef(({className:e,bsPrefix:t,as:r=sl,...o},a)=>(t=n.useBootstrapPrefix(t,"offcanvas-title"),n.jsxRuntimeExports.jsx(r,{ref:a,className:n.classNames(e,t),...o})));Xa.displayName="OffcanvasTitle";function ll(e){return n.jsxRuntimeExports.jsx(Ya,{...e})}function cl(e){return n.jsxRuntimeExports.jsx(n.Fade,{...e})}const Ja=fe.forwardRef(({bsPrefix:e,className:t,children:r,"aria-labelledby":o,placement:a="start",responsive:i,show:s=!1,backdrop:l=!0,keyboard:c=!0,scroll:p=!1,onEscapeKeyDown:d,onShow:u,onHide:m,container:f,autoFocus:x=!0,enforceFocus:h=!0,restoreFocus:b=!0,restoreFocusOptions:v,onEntered:E,onExit:C,onExiting:R,onEnter:y,onEntering:N,onExited:I,backdropClassName:D,manager:S,renderStaticNode:A=!1,...P},F)=>{const w=g.useRef();e=n.useBootstrapPrefix(e,"offcanvas");const[q,G]=g.useState(!1),O=n.useEventCallback(m),_=al(i||"xs","up");g.useEffect(()=>{G(i?s&&!_:s)},[s,i,_]);const V=g.useMemo(()=>({onHide:O}),[O]);function B(){return S||(p?(w.current||(w.current=new n.BootstrapModalManager({handleContainerOverflow:!1})),w.current):n.getSharedManager())}const z=(J,...k)=>{J&&(J.style.visibility="visible"),y==null||y(J,...k)},$=(J,...k)=>{J&&(J.style.visibility=""),I==null||I(...k)},K=g.useCallback(J=>n.jsxRuntimeExports.jsx("div",{...J,className:n.classNames(`${e}-backdrop`,D)}),[D,e]),Q=J=>n.jsxRuntimeExports.jsx("div",{...J,...P,className:n.classNames(t,i?`${e}-${i}`:e,`${e}-${a}`),"aria-labelledby":o,children:r});return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[!q&&(i||A)&&Q({}),n.jsxRuntimeExports.jsx(n.ModalContext.Provider,{value:V,children:n.jsxRuntimeExports.jsx(n.BaseModal,{show:q,ref:F,backdrop:l,container:f,keyboard:c,autoFocus:x,enforceFocus:h&&!p,restoreFocus:b,restoreFocusOptions:v,onEscapeKeyDown:d,onShow:u,onHide:O,onEnter:z,onEntering:N,onEntered:E,onExit:C,onExiting:R,onExited:$,manager:B(),transition:ll,backdropTransition:cl,renderBackdrop:K,renderDialog:Q})})]})});Ja.displayName="Offcanvas";const uo=Object.assign(Ja,{Body:qa,Header:Ka,Title:Xa});function Qa({animation:e,bg:t,bsPrefix:r,size:o,...a}){r=n.useBootstrapPrefix(r,"placeholder");const[{className:i,...s}]=n.useCol(a);return{...s,className:n.classNames(i,e?`${r}-${e}`:r,o&&`${r}-${o}`,t&&`bg-${t}`)}}const Za=fe.forwardRef((e,t)=>{const r=Qa(e);return n.jsxRuntimeExports.jsx(n.Button,{...r,ref:t,disabled:!0,tabIndex:-1})});Za.displayName="PlaceholderButton";const ei=fe.forwardRef(({as:e="span",...t},r)=>{const o=Qa(t);return n.jsxRuntimeExports.jsx(e,{...o,ref:r})});ei.displayName="Placeholder";const ze=Object.assign(ei,{Button:Za}),ti=fe.forwardRef(({bsPrefix:e,className:t,as:r="div",...o},a)=>{const i=n.useBootstrapPrefix(e,"row"),s=n.useBootstrapBreakpoints(),l=n.useBootstrapMinBreakpoint(),c=`${i}-cols`,p=[];return s.forEach(d=>{const u=o[d];delete o[d];let m;u!=null&&typeof u=="object"?{cols:m}=u:m=u;const f=d!==l?`-${d}`:"";m!=null&&p.push(`${c}${f}-${m}`)}),n.jsxRuntimeExports.jsx(r,{ref:a,...o,className:n.classNames(t,i,...p)})});ti.displayName="Row";const ul=fe.forwardRef(({bsPrefix:e,className:t,striped:r,bordered:o,borderless:a,hover:i,size:s,variant:l,responsive:c,...p},d)=>{const u=n.useBootstrapPrefix(e,"table"),m=n.classNames(t,u,l&&`${u}-${l}`,s&&`${u}-${s}`,r&&`${u}-${typeof r=="string"?`striped-${r}`:"striped"}`,o&&`${u}-bordered`,a&&`${u}-borderless`,i&&`${u}-hover`),f=n.jsxRuntimeExports.jsx("table",{...p,className:m,ref:d});if(c){let x=`${u}-responsive`;return typeof c=="string"&&(x=`${x}-${c}`),n.jsxRuntimeExports.jsx("div",{className:x,children:f})}return f}),ri=({children:e,onStorno:t,noSpacer:r,disabled:o})=>{const{texts:{formSubmit:a}}=g.useContext(n.LuminusComponentsContext);return n.jsxRuntimeExports.jsxs(Cs,{noSpacer:r,children:[n.jsxRuntimeExports.jsxs(n.PrimaryButton,{as:"button",color:"primary",size:"lg",type:"submit",disabled:o,children:[n.jsxRuntimeExports.jsx(n.MdCheck,{}),e]}),t&&n.jsxRuntimeExports.jsxs(n.PrimaryButton,{as:"button",color:"secondary",variant:"outlined",size:"lg",onClick:t,children:[n.jsxRuntimeExports.jsx(n.MdOutlineClose,{}),a.storno]})]})},bn=({color:e="primary",icon:t=n.jsxRuntimeExports.jsx(n.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:o="*",onUpload:a,className:i,children:s,multiple:l,...c})=>{const p=d=>{d.target.files&&(a(d.target.files),d.target.value="")};return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:n.classNames(`luminus-context-button btn text-${e} ${i??""}`,n.classes.button),...c,children:[t,s]}),n.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:o,onChange:p,hidden:!0,multiple:l})]})},dl=({onUpload:e,accept:t,children:r,className:o,size:a="md"})=>{const i=g.useCallback(async l=>{if(l.target.files)try{await e(l.target.files)}finally{l.target.value=""}},[e]),s=g.useId();return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("label",{htmlFor:s,className:n.classNames("btn luminus-context-button text-primary",`btn-${a}`,o),children:r}),n.jsxRuntimeExports.jsx("input",{id:s,type:"file",accept:t,onChange:i,hidden:!0})]})},pl="_select_14f33_1",fl="_sm_14f33_11",ml="_lg_14f33_23",tr={select:pl,sm:fl,lg:ml},ni=({month:e,onChangeMonth:t,locale:r,yearMin:o=2e3,yearMax:a=2050,className:i,monthClassName:s,yearClassName:l,size:c})=>{const p=g.useCallback(m=>{const f=n.addMonths(e,m);f.getFullYear()<o||f.getFullYear()>a||t(f)},[e,t,o,a]),d=g.useMemo(()=>{const m=[];for(let f=o;f<=a;f++)m.push(f);return m},[o,a]),u=g.useMemo(()=>{const x=[];for(let h=0;h<=11;h++)x.push({id:h,name:n.format(new Date(2024,h,1),"LLLL",{locale:r})});return x},[r]);return n.jsxRuntimeExports.jsxs("div",{className:n.classNames("card d-flex flex-row align-items-center justify-content-center m-0 p-1 gap-2",i,{[tr[c]]:c}),children:[n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>p(-1),disabled:e.getFullYear()<o||e.getFullYear()===o&&e.getMonth()<=0,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowLeft,{})}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getMonth(),onChange:m=>{var f;return((f=m.target)==null?void 0:f.value)&&t(Ks(e,Number(m.target.value)))},className:n.classNames(tr.select,tr.month,s),children:u.map(m=>n.jsxRuntimeExports.jsx("option",{value:m.id,children:m.name},m.id))}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getFullYear(),onChange:m=>{var f;return((f=m.target)==null?void 0:f.value)&&t(tn(e,Number(m.target.value)))},className:n.classNames(tr.select,l),children:d.map(m=>n.jsxRuntimeExports.jsx("option",{value:m,children:m},m))}),n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>p(1),disabled:e.getFullYear()>a||e.getFullYear()===a&&e.getMonth()>=11,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowRight,{})})]})},gl="_select_pywmr_1",xl={select:gl},po=2e3,fo=2050,oi=({year:e,onChangeYear:t,className:r,...o})=>{const a=g.useMemo(()=>{var c;return o.manualOptions?((c=o.options)==null?void 0:c.at(0))??po:o.optionMin??po},[o]),i=g.useMemo(()=>{var c;return o.manualOptions?((c=o.options)==null?void 0:c.at(-1))??fo:o.optionMax??fo},[o]),s=g.useMemo(()=>{if(o.manualOptions)return o.options;const c=[];for(let p=a;p<=i;p++)c.push(p);return c},[o,i,a]),l=g.useCallback(c=>{if(o.manualOptions){const p=s.findIndex(d=>d===e.getFullYear());if(p!==-1){const d=s.at(p+c)??null;d&&t(tn(e,d))}}else{const p=e.getFullYear()+c;p>=a&&p<=i&&t(n.addYears(e,c))}},[e,t,i,a,o,s]);return n.jsxRuntimeExports.jsxs("div",{className:n.classNames("card d-flex flex-row align-items-center m-0 p-1 gap-2",r??""),children:[n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>l(-1),disabled:e.getFullYear()<=a,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowLeft,{})}),n.jsxRuntimeExports.jsx(n.Form.Select,{value:e.getFullYear(),onChange:c=>{var p;return((p=c.target)==null?void 0:p.value)&&t(tn(e,Number(c.target.value)))},className:xl.select,children:s.map(c=>n.jsxRuntimeExports.jsx("option",{value:c,children:c},c))}),n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>l(1),disabled:e.getFullYear()>=i,children:n.jsxRuntimeExports.jsx(n.MdOutlineKeyboardArrowRight,{})})]})};class vl extends g.Component{constructor(t){super(t),this.state={hasError:!1,is404Error:!1},this.reload=this.reload.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,is404Error:t.message==="404"}}componentDidUpdate(t){this.state.hasError&&t.keyForErrorState!==this.props.keyForErrorState&&this.setState({hasError:!1,is404Error:!1})}componentDidCatch(t,r){console.error("Error:",t,r)}reload(){this.setState({hasError:!1,is404Error:!1})}render(){const{fallback:t,fallbackOn404:r,children:o,texts:a,reloadButtonDisplay:i="append-after-child"}=this.props;return this.state.hasError?i==="inject-to-child"&&!this.state.is404Error&&g.isValidElement(t)?g.cloneElement(t,{...t.props},n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...t.props.children,n.jsxRuntimeExports.jsx("div",{className:"d-flex gap-2 justify-content-center",children:n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent})})]})):i==="inject-to-child"&&this.state.is404Error&&g.isValidElement(r)?g.cloneElement(r,{...r.props},n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...r.props.children,n.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]})):n.jsxRuntimeExports.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[this.state.is404Error?r:t,n.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[i==="none"?null:n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),this.state.is404Error&&n.jsxRuntimeExports.jsx(n.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]}):o}}const hl=e=>r=>{const{texts:{errorBoundary:o}}=g.useContext(n.LuminusComponentsContext);return n.jsxRuntimeExports.jsx(e,{texts:o,...r})},ai=hl(vl),bl="_widget-card_e9tsb_1",El={"widget-card":"_widget-card_e9tsb_1",widgetCard:bl},nn=({children:e,title:t,headerContent:r})=>n.jsxRuntimeExports.jsx(En,{className:n.classNames(El.widgetCard,"luminus-widget"),title:t,headerContent:r,contentClassName:"h-100 overflow-auto",children:e}),yl=({children:e,title:t})=>{const{texts:{widget:r}}=g.useContext(n.LuminusComponentsContext),o=pe.useNavigate();return n.jsxRuntimeExports.jsx(ai,{fallback:n.jsxRuntimeExports.jsx(nn,{title:t,children:r.fallbackError}),reloadButtonDisplay:"inject-to-child",navigateBack:()=>o(-1),children:n.jsxRuntimeExports.jsx(g.Suspense,{fallback:n.jsxRuntimeExports.jsx(nn,{title:t,children:n.jsxRuntimeExports.jsx(Aa,{})}),children:e})})},jl="_widgets-row_13gg1_1",Rl="_widget_13gg1_1",Cl="_widget-img_13gg1_5",wl="_widget-title-spacer_13gg1_14",Nl="_widget-title_13gg1_14",Dl="_title_13gg1_28",Te={"widgets-row":"_widgets-row_13gg1_1",widgetsRow:jl,widget:Rl,"widget-img":"_widget-img_13gg1_5",widgetImg:Cl,"widget-title-spacer":"_widget-title-spacer_13gg1_14",widgetTitleSpacer:wl,"widget-title":"_widget-title_13gg1_14",widgetTitle:Nl,title:Dl},Sl=({show:e,widgetGroups:t,widgets:r,handleClose:o,onWidgetPicked:a,texts:i})=>{const[s,l]=g.useState(""),c=g.useMemo(()=>r.filter(d=>d.id!==-1&&n.stringSearchWithin(d.name,s)),[r,s]),p=g.useMemo(()=>t.filter(d=>c.some(u=>u.group===d.id)),[t,c]);return n.jsxRuntimeExports.jsxs(n.Modal,{show:e,onHide:()=>o(),size:"lg",children:[n.jsxRuntimeExports.jsxs(n.Modal.Header,{closeButton:!0,children:[n.jsxRuntimeExports.jsx(n.Modal.Title,{className:"w-100",children:i.pickWidgetToAdd}),n.jsxRuntimeExports.jsx(n.Form.Control,{type:"search",size:"sm",value:s,placeholder:i.searchPlaceholder,onChange:d=>{var u;return l(((u=d.target)==null?void 0:u.value)??"")},className:"me-3",style:{maxWidth:"200px"}})]}),n.jsxRuntimeExports.jsx(n.Modal.Body,{className:"flex-column gap-3",children:c.length===0?n.jsxRuntimeExports.jsx(n.Alert,{variant:"warning",children:i.noWidgets}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[p.map(d=>n.jsxRuntimeExports.jsx(Bt,{defaultOpen:!0,title:d.name??"",children:n.jsxRuntimeExports.jsx("div",{className:"p-1",children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("row gx-3 gy-3",Te.widgetsRow),children:c.filter(u=>u.group===d.id).map(u=>n.jsxRuntimeExports.jsx("div",{className:"col col-4",children:n.jsxRuntimeExports.jsxs("div",{role:"button",className:n.classNames("p-0 pt-2 bg-white rounded shadow-sm",Te.widget),onClick:()=>a(u.id),children:[n.jsxRuntimeExports.jsx("div",{className:Te.widgetImg,style:{backgroundImage:u.img?`url(${u.img})`:void 0}}),n.jsxRuntimeExports.jsx("div",{className:Te.widgetTitleSpacer}),n.jsxRuntimeExports.jsx("div",{className:n.classNames(Te.widgetTitle,"rounded"),children:n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:n.classNames(Te.title,"text-white text-truncate"),children:u.name})})]},u.id)}))})})},d.id)),c.some(d=>d.group===void 0)&&n.jsxRuntimeExports.jsx(Bt,{defaultOpen:!0,title:i.otherWidgets,children:n.jsxRuntimeExports.jsx("div",{className:"p-1",children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("row gx-3 gy-3",Te.widgetsRow),children:c.filter(d=>d.group===void 0).map(d=>n.jsxRuntimeExports.jsx("div",{className:"col col-4",children:n.jsxRuntimeExports.jsxs("div",{role:"button",className:n.classNames("p-0 pt-2 bg-white rounded shadow-sm",Te.widget),onClick:()=>a(d.id),children:[n.jsxRuntimeExports.jsx("div",{className:Te.widgetImg,style:{backgroundImage:d.img?`url(${d.img})`:void 0}}),n.jsxRuntimeExports.jsx("div",{className:Te.widgetTitleSpacer}),n.jsxRuntimeExports.jsx("div",{className:n.classNames(Te.widgetTitle,"rounded"),children:n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:n.classNames(Te.title,"text-white text-truncate"),children:d.name})})]},d.id)}))})})})]})})]})},Il="_widget_19xgl_1",Ol="_mobile_19xgl_7",mo={widget:Il,mobile:Ol},go=({widgetGroups:e,availableWidgets:t,onAdd:r,texts:o})=>{const[a,i]=g.useState(!1),{isMobile:s}=n.useWindowSize();return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-empty-widget",mo.widget,{[mo.mobile]:s}),children:n.jsxRuntimeExports.jsx(n.IconButton,{onClick:()=>i(!0),children:n.jsxRuntimeExports.jsx(n.MdOutlineAddCircleOutline,{})})}),n.jsxRuntimeExports.jsx(Sl,{show:a,widgetGroups:e,widgets:t,handleClose:()=>i(!1),onWidgetPicked:l=>{i(!1),r(l)},texts:o})]})},_l="_dashboard_1gf59_1",Tl="_widgets-grid_1gf59_1",Pl="_widget-wrapper_1gf59_8",Al="_full-width_1gf59_13",kl="_widget-edit_1gf59_16",Bl="_remove-icon_1gf59_19",Ml="_full-width-icon_1gf59_26",Ll="_widget-edit-overlay_1gf59_36",Fl="_mobile_1gf59_45",Ge={dashboard:_l,"widgets-grid":"_widgets-grid_1gf59_1",widgetsGrid:Tl,"widget-wrapper":"_widget-wrapper_1gf59_8",widgetWrapper:Pl,"full-width":"_full-width_1gf59_13",fullWidth:Al,"widget-edit":"_widget-edit_1gf59_16",widgetEdit:kl,"remove-icon":"_remove-icon_1gf59_19",removeIcon:Bl,"full-width-icon":"_full-width-icon_1gf59_26",fullWidthIcon:Ml,"widget-edit-overlay":"_widget-edit-overlay_1gf59_36",widgetEditOverlay:Ll,mobile:Fl},Vl=e=>{const[t,r]=g.useState({widgets:[]});g.useEffect(()=>{const a=localStorage.getItem("dashboardConfig");a?r(JSON.parse(a)):e&&r(e)},[e]);const o=g.useCallback(a=>{r(a),localStorage.setItem("dashboardConfig",JSON.stringify(a))},[]);return{dashboardConfig:t,onChangeDashboardConfig:o}},$l=({widgetGroups:e,availableWidgets:t,editMode:r,defaultDashboardConfig:o})=>{var m;const{texts:{homeDashboard:a}}=g.useContext(n.LuminusComponentsContext),{dashboardConfig:i,onChangeDashboardConfig:s}=Vl(o),l=g.useCallback((f,x)=>{var h,b;f===((h=i.widgets)==null?void 0:h.length)?s({...i,widgets:[...i.widgets,{widgetId:x,fullWidth:!1}]}):s({...i,widgets:((b=i.widgets)==null?void 0:b.map((v,E)=>E===f?{widgetId:x,fullWidth:!1}:v))??[]})},[i,s]),c=g.useCallback(f=>{var x,h;((x=i.widgets[f])==null?void 0:x.widgetId)===-1?s({...i,widgets:((h=i.widgets)==null?void 0:h.filter((b,v)=>v!==f))??[]}):l(f,-1)},[i,s,l]),p=g.useCallback(f=>{var x;s({...i,widgets:((x=i.widgets)==null?void 0:x.map((h,b)=>b===f?{...h,fullWidth:!h.fullWidth}:h))??[]})},[i,s]),d=g.useCallback((f,x,h)=>f?n.jsxRuntimeExports.jsxs("div",{className:n.classNames(Ge.widgetWrapper,{[Ge.widgetEdit]:r&&f.id!==-1},{[Ge.fullWidth]:h}),children:[r&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(n.IconButton,{color:"danger",onClick:()=>c(x),className:n.classNames(Ge.removeIcon),children:n.jsxRuntimeExports.jsx(n.MdOutlineDelete,{})}),n.jsxRuntimeExports.jsx(n.IconButton,{color:h?"danger":"primary",onClick:()=>p(x),className:n.classNames(Ge.fullWidthIcon),children:n.jsxRuntimeExports.jsx(n.MdOutlineExpand,{})})]}),f.id===-1?r&&n.jsxRuntimeExports.jsx("div",{className:Ge.widgetWrapper,children:n.jsxRuntimeExports.jsx(go,{widgetGroups:e,availableWidgets:t,onAdd:b=>l(x,b),texts:a})}):n.jsxRuntimeExports.jsx(yl,{title:f.title,children:n.jsxRuntimeExports.jsx(f.WidgetElement,{title:f.title})}),f.id>-1&&r&&n.jsxRuntimeExports.jsx("div",{className:Ge.widgetEditOverlay})]},x):n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{}),[r,e,l,c,p,t,a]),{isMobile:u}=n.useWindowSize();return n.jsxRuntimeExports.jsx("div",{className:n.classNames(Ge.dashboard,{[Ge.mobile]:u}),children:n.jsxRuntimeExports.jsxs("div",{className:n.classNames(Ge.widgetsGrid),children:[(m=i.widgets)==null?void 0:m.map((f,x)=>d(t.find(h=>h.id===f.widgetId),x,f.fullWidth)),r&&n.jsxRuntimeExports.jsx(go,{widgetGroups:e,availableWidgets:t,onAdd:f=>{var x;return l((x=i.widgets)==null?void 0:x.length,f)},texts:a})]})})},Gl="_badge_193ci_1",Wl="_sm_193ci_6",Ul="_md_193ci_10",Hl="_lg_193ci_14",zl="_light_193ci_18",Or={badge:Gl,sm:Wl,md:Ul,lg:Hl,light:zl},ql=({children:e,color:t="primary",size:r="md",rounded:o,className:a,variant:i="filled",...s})=>{const l=g.useMemo(()=>i==="filled"?n.classNames(`bg-${t}`):i==="outline"?n.classNames(`text-${t} border-${t} border bg-white`):"",[t,i]);return n.jsxRuntimeExports.jsx("span",{className:n.classNames("luminus-badge badge",l,a,{"rounded-pill":o},{"text-dark":t==="light"},{[Or.light]:t==="light"},Or.badge,Or[r]),...s,children:e})},Yl="_collapse-icon_1ahhn_1",Kl="_collapsed_1ahhn_6",xo={"collapse-icon":"_collapse-icon_1ahhn_1",collapseIcon:Yl,collapsed:Kl},Bt=({title:e,children:t,className:r,...o})=>{const a=o.controlled?!1:o.defaultOpen??!1,[i,s]=g.useState(a),l=o.controlled?o.isOpen:i;return g.useEffect(()=>{s(a)},[a]),n.jsxRuntimeExports.jsxs("div",{className:r??"",children:[n.jsxRuntimeExports.jsxs("div",{role:"button",className:"d-flex align-items-center justify-content-between pb-3 pt-2",onClick:()=>o.controlled?o.onToggle(!o.isOpen):s(!i),children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"h6",children:e}),n.jsxRuntimeExports.jsx(n.MdOutlineChevronRight,{className:n.classNames(xo.collapseIcon,{[xo.collapsed]:l})})]}),n.jsxRuntimeExports.jsx(ka,{in:l,children:n.jsxRuntimeExports.jsx("div",{children:t})}),n.jsxRuntimeExports.jsx("hr",{className:`my-0 ${l?"mt-3":""}`})]})},Xl=({color:e="primary",icon:t=n.jsxRuntimeExports.jsx(n.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:o="*",onUpload:a,multiple:i,className:s,children:l,...c})=>{const p=d=>{d.target.files&&(a(d.target.files),d.target.value="")};return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:n.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${s??""}`,n.classes$1.item),...c,children:[t,l]}),n.jsxRuntimeExports.jsx("input",{id:r,type:"file",accept:o,onChange:p,hidden:!0,multiple:i})]})},Jl="_input-group_1hcpm_1",Ql="_input-group-text_1hcpm_5",Zl="_left_1hcpm_9",ec="_right_1hcpm_13",tc="_input_1hcpm_1",rc="_submit-button_1hcpm_20",Ze={"input-group":"_input-group_1hcpm_1",inputGroup:Jl,"input-group-text":"_input-group-text_1hcpm_5",inputGroupText:Ql,left:Zl,right:ec,input:tc,"submit-button":"_submit-button_1hcpm_20",submitButton:rc},nc=({searchTypes:e,selectedType:t,setSelectedType:r})=>n.jsxRuntimeExports.jsx(n.Dropdown,{toggle:n.jsxRuntimeExports.jsx(n.DropdownToggle,{as:n.SimpleDropdownToggle,icon:null,text:t==null?void 0:t.text}),children:e.map(o=>n.jsxRuntimeExports.jsx(n.DropdownItem,{icon:null,onClick:()=>r(o.key),children:o.text},o.key))}),oc="_dropdown_1ddrg_1",ac="_open_1ddrg_12",ic="_loading-container_1ddrg_15",sc="_groups-container_1ddrg_22",lc="_group_1ddrg_22",cc="_header_1ddrg_26",uc="_item_1ddrg_33",et={dropdown:oc,open:ac,"loading-container":"_loading-container_1ddrg_15",loadingContainer:ic,"groups-container":"_groups-container_1ddrg_22",groupsContainer:sc,group:lc,header:cc,item:uc},dc=({show:e,query:t,onCancel:r,groups:o,isLoading:a,searchTypes:i})=>{const{texts:{appSearch:s}}=g.useContext(n.LuminusComponentsContext),l=g.useRef(null),c=g.useCallback(p=>{var u;const d=(u=i.find(m=>m.key===p.type))==null?void 0:u.toPath;return d?`${d}/${p.searchKey}`:"/not-found"},[i]);return n.useClickOutside([l],r),n.jsxRuntimeExports.jsx("div",{ref:l,className:n.classNames("luminus-app-search-dropdown shadow rounded",et.dropdown,{[et.open]:e}),children:a?n.jsxRuntimeExports.jsx("div",{className:et.loadingContainer,children:n.jsxRuntimeExports.jsx(n.Spinner,{animation:"border",variant:"primary"})}):n.jsxRuntimeExports.jsx("div",{className:et.groupsContainer,children:o==null?void 0:o.map(p=>{var d;return n.jsxRuntimeExports.jsxs("div",{className:n.classNames(et.group),children:[n.jsxRuntimeExports.jsxs(pe.Link,{to:`/search?query=${t}&type=${p.key.category}`,className:n.classNames("group-header",et.header),onClick:r,children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"body",className:"text-primary",children:p.key.categoryName}),n.jsxRuntimeExports.jsxs(n.Typography,{variant:"caption",children:[p.items.length," ",s.amountFrom," ",p.key.totalCount]})]}),(d=p.items)==null?void 0:d.map((u,m)=>n.jsxRuntimeExports.jsxs(pe.Link,{to:c(u),className:n.classNames("search-item d-flex gap-3 align-items-center justify-content-between",et.item),onClick:r,children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:u.name}),n.jsxRuntimeExports.jsx(n.Typography,{variant:"caption",className:"text-primary",children:n.jsxRuntimeExports.jsx(n.MdOutlineArrowOutward,{})})]},m))]},p.key.category)})})})},pc=(e,t)=>{const r=n.useAxios(),[o,a]=g.useState(!1),[i,s]=g.useState([]),l=!e||!e.key,c=g.useCallback(()=>{if(t.length<3){s([]);return}a(!0),r.get(`/search/${t}?count=${l?5:20}${l?"":`&type=${e.key}`}`).then(({data:p})=>{s(p),a(!1)}).catch(()=>{a(!1)})},[e,t,r,l]);return g.useEffect(()=>{c()},[c]),{isLoading:o,searchItems:i}},fc=({searchTypes:e,navigateFunction:t,currentPath:r,homePath:o="/",className:a})=>{var E;const{texts:{appSearch:i}}=g.useContext(n.LuminusComponentsContext),[s,l]=g.useState(e.length>0?((E=e.at(0))==null?void 0:E.key)??null:null),c=g.useMemo(()=>e.find(C=>C.key===s)??null,[e,s]),[p,d]=g.useState(""),[u,m]=n.a(encodeURIComponent(p),500),{isLoading:f,searchItems:x}=pc(c,u),[h,b]=g.useState(!1);g.useEffect(()=>{(x.length>0||f)&&b(!0)},[x,f]);const v=g.useRef(null);return g.useEffect(()=>{var C;d(""),r===o&&((C=v.current)==null||C.focus())},[r,o]),n.jsxRuntimeExports.jsx(n.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:C=>{C.preventDefault(),C.stopPropagation(),m.flush(),b(!1),u.length>2&&t(`/search?query=${u}${c&&c.key&&`&type=${c==null?void 0:c.key}`}`)},children:n.jsxRuntimeExports.jsxs(cr,{className:n.classNames(Ze.inputGroup,a),children:[n.jsxRuntimeExports.jsx(cr.Text,{className:n.classNames("p-1 rounded",Ze.inputGroupText,Ze.left),children:n.jsxRuntimeExports.jsx(nc,{searchTypes:e,selectedType:c,setSelectedType:l})}),n.jsxRuntimeExports.jsx(n.Form.Control,{ref:v,placeholder:i.searchPlaceholder,type:"text",size:"sm",className:n.classNames("luminus-app-search-input",Ze.input),value:p,onChange:C=>{var R;return d(((R=C.target)==null?void 0:R.value)??"")},onFocus:()=>x.length>0&&b(!0)}),n.jsxRuntimeExports.jsx(cr.Text,{className:n.classNames("p-0 rounded",Ze.inputGroupText,Ze.right),children:n.jsxRuntimeExports.jsx("button",{type:"submit",className:n.classNames("text-primary",Ze.submitButton),children:n.jsxRuntimeExports.jsx(n.FaSearch,{})})}),n.jsxRuntimeExports.jsx(dc,{query:u,searchTypes:e,show:h,onCancel:()=>b(!1),groups:x,isLoading:f})]})})},mc="_card_19733_1",gc="_header_19733_6",xc="_header-content_19733_13",vc="_title_19733_19",hc="_collapse-icon_19733_22",bc="_collapsed_19733_27",Ec="_content_19733_30",tt={card:mc,header:gc,"header-content":"_header-content_19733_13",headerContent:xc,title:vc,"collapse-icon":"_collapse-icon_19733_22",collapseIcon:hc,collapsed:bc,content:Ec},En=({title:e,headerContent:t,children:r,className:o,headerClassName:a,contentClassName:i,dontRenderIfNoChildren:s,...l})=>{const c=l.collapsible?l.controlled?!1:l.defaultOpen??!1:!0,[p,d]=g.useState(c),u=l.collapsible?l.controlled?l.isOpen:p:!0;g.useEffect(()=>{d(c)},[c]);const m=g.useMemo(()=>!r||!r.toString()||r.toString().split(",").filter(f=>f&&f!=="false").length===0,[r]);return s&&m?null:n.jsxRuntimeExports.jsxs("div",{className:n.classNames("luminus-card rounded shadow-sm",tt.card,{[o??""]:o}),children:[n.jsxRuntimeExports.jsxs("div",{role:l.collapsible?"button":void 0,className:n.classNames("header",tt.header,{[a??""]:a}),onClick:()=>{l.collapsible&&(l.controlled?l.onToggle(!l.isOpen):d(!p))},children:[n.jsxRuntimeExports.jsxs("div",{className:n.classNames("header-content",tt.headerContent),children:[n.jsxRuntimeExports.jsx(n.Typography,{variant:"h6",className:n.classNames("text-primary",tt.title),children:e}),t??null]}),l.collapsible&&n.jsxRuntimeExports.jsx(n.MdOutlineChevronRight,{className:n.classNames(tt.collapseIcon,{[tt.collapsed]:u})})]}),n.jsxRuntimeExports.jsx(ka,{in:u,children:n.jsxRuntimeExports.jsx("div",{className:n.classNames("card-content border-top border-primary",tt.content,{[i??""]:i}),children:r})})]})};function Mt(e){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(e)}function yc(e,t){if(Mt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(Mt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jc(e){var t=yc(e,"string");return Mt(t)=="symbol"?t:t+""}function Rc(e,t,r){return(t=jc(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function ho(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vo(Object(r),!0).forEach(function(o){Rc(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vo(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function Ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var bo=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),_r=function(){return Math.random().toString(36).substring(7).split("").join(".")},Eo={INIT:"@@redux/INIT"+_r(),REPLACE:"@@redux/REPLACE"+_r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+_r()}};function Cc(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function wc(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Sc(e))return"date";if(Dc(e))return"error";var r=Nc(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Nc(e){return typeof e.constructor=="function"?e.constructor.name:null}function Dc(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Sc(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function at(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=wc(e)),t}function ii(e,t,r){var o;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+at(r)+"'");return r(ii)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+at(e)+"'");var a=e,i=t,s=[],l=s,c=!1;function p(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+at(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return p(),l.push(h),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,p();var E=l.indexOf(h);l.splice(E,1),s=null}}}function m(h){if(!Cc(h))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+at(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,h)}finally{c=!1}for(var b=s=l,v=0;v<b.length;v++){var E=b[v];E()}return h}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+at(h));a=h,m({type:Eo.REPLACE})}function x(){var h,b=u;return h={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+at(E)+"'");function C(){E.next&&E.next(d())}C();var R=b(C);return{unsubscribe:R}}},h[bo]=function(){return this},h}return m({type:Eo.INIT}),o={dispatch:m,subscribe:u,getState:d,replaceReducer:f},o[bo]=x,o}function yo(e,t){return function(){return t(e.apply(this,arguments))}}function jo(e,t){if(typeof e=="function")return yo(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?Ne(16):"bindActionCreators expected an object or a function, but instead received: '"+at(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var o in e){var a=e[o];typeof a=="function"&&(r[o]=yo(a,t))}return r}function si(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function Ic(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(o){return function(){var a=o.apply(void 0,arguments),i=function(){throw new Error(process.env.NODE_ENV==="production"?Ne(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(c){return c(s)});return i=si.apply(void 0,l)(a.dispatch),ho(ho({},a),{},{dispatch:i})}}}var yn=g.createContext(null);process.env.NODE_ENV!=="production"&&(yn.displayName="ReactRedux");function Oc(e){e()}var li=Oc,_c=function(t){return li=t},Tc=function(){return li};function Pc(){var e=Tc(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var a=t;a;)a.callback(),a=a.next})},get:function(){for(var a=[],i=t;i;)a.push(i),i=i.next;return a},subscribe:function(a){var i=!0,s=r={callback:a,next:null,prev:r};return s.prev?s.prev.next=s:t=s,function(){!i||t===null||(i=!1,s.next?s.next.prev=s.prev:r=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var Ro={notify:function(){},get:function(){return[]}};function ci(e,t){var r,o=Ro;function a(u){return c(),o.subscribe(u)}function i(){o.notify()}function s(){d.onStateChange&&d.onStateChange()}function l(){return!!r}function c(){r||(r=t?t.addNestedSub(s):e.subscribe(s),o=Pc())}function p(){r&&(r(),r=void 0,o.clear(),o=Ro)}var d={addNestedSub:a,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:l,trySubscribe:c,tryUnsubscribe:p,getListeners:function(){return o}};return d}var ui=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function di(e){var t=e.store,r=e.context,o=e.children,a=g.useMemo(function(){var l=ci(t);return{store:t,subscription:l}},[t]),i=g.useMemo(function(){return t.getState()},[t]);ui(function(){var l=a.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[a,i]);var s=r||yn;return g.createElement(s.Provider,{value:a},o)}process.env.NODE_ENV!=="production"&&(di.propTypes={store:n.PropTypes.shape({subscribe:n.PropTypes.func.isRequired,dispatch:n.PropTypes.func.isRequired,getState:n.PropTypes.func.isRequired}),context:n.PropTypes.object,children:n.PropTypes.any});var jn=n.requireReactIs(),Ac={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Bc={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pi={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Rn={};Rn[jn.ForwardRef]=Bc;Rn[jn.Memo]=pi;function Co(e){return jn.isMemo(e)?pi:Rn[e.$$typeof]||Ac}var Mc=Object.defineProperty,Lc=Object.getOwnPropertyNames,wo=Object.getOwnPropertySymbols,Fc=Object.getOwnPropertyDescriptor,Vc=Object.getPrototypeOf,No=Object.prototype;function fi(e,t,r){if(typeof t!="string"){if(No){var o=Vc(t);o&&o!==No&&fi(e,o,r)}var a=Lc(t);wo&&(a=a.concat(wo(t)));for(var i=Co(e),s=Co(t),l=0;l<a.length;++l){var c=a[l];if(!kc[c]&&!(r&&r[c])&&!(s&&s[c])&&!(i&&i[c])){var p=Fc(t,c);try{Mc(e,c,p)}catch{}}}}return e}var $c=fi;const Do=n.getDefaultExportFromCjs($c);var on={exports:{}},le={};/** @license React v17.0.2
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/dist/main.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as s, c as j, t as Oe, s as to, g as ro, m as tc, d as Ur, a as rc, b as nc, e as ut, f as la, h as ac, i as oc, k as ic, l as sc, n as lc, o as cc, p as dc, T as $i, q as Gi, r as no, E as uc, u as Wi, v as ca, w as Ui, x as pc, y as Ie, z as da, F as Hi, A as fc, B as vc, C as gc, D as mc, M as hc, G as bc, H as xc, I as yc, J as wc, K as Dc, L as Yn, N as Nc, O as Ec, P as ve, Q as Yr, R as Cc, S as Sc, U as Ic, V as zi, W as jc, X as cr, Y as se, Z as ua, _ as _e, $ as pa, a0 as Oc, a1 as ct, a2 as vt, a3 as $e, a4 as on, a5 as ae, a6 as sn, a7 as _c, a8 as Pc, a9 as Tc, aa as qi, ab as Ac, ac as Nr, ad as Er, ae as ln, af as nt, ag as Rc, ah as Bc, ai as kc, aj as wt, ak as fa, al as Mc, am as rt, an as Lc, ao as Fc, ap as Kr, aq as te, ar as Yi, as as Vc, at as $c, au as Ki, av as Dt, aw as Gc, ax as Nt, ay as Wc, az as Uc, aA as Hc, aB as Cr, aC as zc, aD as Xi, aE as qc, aF as Sr, aG as va, aH as ga, aI as Ji, aJ as ma, aK as Qi, aL as Zi, aM as ot, aN as gt, aO as Yc, aP as Kc, aQ as mt, aR as Qe, aS as Xc, aT as dr, aU as Jc, aV as Xr, aW as Ir, aX as es, aY as cn, aZ as Qc, a_ as yn, a$ as Zc, b0 as Ft, b1 as ed, b2 as td, b3 as ha, b4 as dn, b5 as rd, b6 as ao, b7 as ts, b8 as nd, b9 as kt, ba as ad, bb as od, bc as id, bd as sd, be as ld, bf as rs } from "./ShortcutLinksContext-
|
|
2
|
-
import { bj as Aw, bk as Rw, bh as Bw, bg as kw, bl as Mw, bm as Lw, bi as Fw } from "./ShortcutLinksContext-
|
|
1
|
+
import { j as s, c as j, t as Oe, s as to, g as ro, m as tc, d as Ur, a as rc, b as nc, e as ut, f as la, h as ac, i as oc, k as ic, l as sc, n as lc, o as cc, p as dc, T as $i, q as Gi, r as no, E as uc, u as Wi, v as ca, w as Ui, x as pc, y as Ie, z as da, F as Hi, A as fc, B as vc, C as gc, D as mc, M as hc, G as bc, H as xc, I as yc, J as wc, K as Dc, L as Yn, N as Nc, O as Ec, P as ve, Q as Yr, R as Cc, S as Sc, U as Ic, V as zi, W as jc, X as cr, Y as se, Z as ua, _ as _e, $ as pa, a0 as Oc, a1 as ct, a2 as vt, a3 as $e, a4 as on, a5 as ae, a6 as sn, a7 as _c, a8 as Pc, a9 as Tc, aa as qi, ab as Ac, ac as Nr, ad as Er, ae as ln, af as nt, ag as Rc, ah as Bc, ai as kc, aj as wt, ak as fa, al as Mc, am as rt, an as Lc, ao as Fc, ap as Kr, aq as te, ar as Yi, as as Vc, at as $c, au as Ki, av as Dt, aw as Gc, ax as Nt, ay as Wc, az as Uc, aA as Hc, aB as Cr, aC as zc, aD as Xi, aE as qc, aF as Sr, aG as va, aH as ga, aI as Ji, aJ as ma, aK as Qi, aL as Zi, aM as ot, aN as gt, aO as Yc, aP as Kc, aQ as mt, aR as Qe, aS as Xc, aT as dr, aU as Jc, aV as Xr, aW as Ir, aX as es, aY as cn, aZ as Qc, a_ as yn, a$ as Zc, b0 as Ft, b1 as ed, b2 as td, b3 as ha, b4 as dn, b5 as rd, b6 as ao, b7 as ts, b8 as nd, b9 as kt, ba as ad, bb as od, bc as id, bd as sd, be as ld, bf as rs } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
2
|
+
import { bj as Aw, bk as Rw, bh as Bw, bg as kw, bl as Mw, bm as Lw, bi as Fw } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
3
3
|
import * as Ne from "react";
|
|
4
4
|
import oe, { useCallback as P, useMemo as Y, useState as M, useRef as Z, useEffect as $, useContext as ee, useId as cd, Component as dd, isValidElement as oo, Suspense as ud, useLayoutEffect as ba, useReducer as pd } from "react";
|
|
5
|
-
import { c as st, L as io } from "./Loading-
|
|
5
|
+
import { c as st, L as io } from "./Loading-Khc1YD1r.js";
|
|
6
6
|
import { InteractionType as fd } from "@azure/msal-browser";
|
|
7
7
|
import { MsalAuthenticationTemplate as vd } from "@azure/msal-react";
|
|
8
8
|
import { useNavigate as ns, Link as at, Navigate as Br, generatePath as Jr, useSearchParams as gd, useParams as md, useLocation as hd } from "react-router-dom";
|
|
@@ -10,7 +10,7 @@ import ur, { unstable_batchedUpdates as bd } from "react-dom";
|
|
|
10
10
|
import { useFormContext as Et, Controller as xa } from "react-hook-form";
|
|
11
11
|
import { Pivot as xd } from "react-flexmonster";
|
|
12
12
|
import { u as yd, a as wd, b as as, c as Dd } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
13
|
-
import { u as pr } from "./useGetApiData-
|
|
13
|
+
import { u as pr } from "./useGetApiData-xQ3tB0Jt.js";
|
|
14
14
|
import { l as or } from "./numberUtils-Bwf8nio8.js";
|
|
15
15
|
const Fy = ({ fileLoader: e, fileName: t, children: r }) => {
|
|
16
16
|
const n = P(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";const i=require("./ShortcutLinksContext-DGRQ13Df.cjs"),e=require("react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const t={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},$=(a,{loadOnInit:c=t.loadOnInit,enabled:f=t.enabled,silent:n=t.silent,nullStateBeforeLoad:d=t.nullStateBeforeLoad,nullStateOnFail:q=t.nullStateOnFail,customApiUrl:h,customBearerToken:x,dataTransformer:u}=t)=>{const D=i.useAxios({silent:n,customToken:x,differentBaseUrl:h}),{startLoading:A,stopLoading:C}=e.useContext(i.LoadingContext),L=e.useRef(0),{isAuthenticated:b}=i.useAuth(),[p,o]=e.useState(null),l=e.useCallback(async(r,g)=>{if(b()&&f!==!1){!n&&A(`loadData-${a}-${g}`),d&&o(null);try{const s=await D.get(a,{signal:r}),S=u?u(s.data):s.data;o(S)}catch(s){throw q&&o(null),s}finally{!n&&C(`loadData-${a}-${g}`)}}},[b,f,n,A,a,d,D,u,q,C]);return e.useEffect(()=>{if(c===!1)return;const r=new AbortController;return l(r.signal,++L.current),()=>{r.abort()}},[l,c]),{data:p,setData:o,reloadData:l}};exports.useGetApiData=$;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aj as L, aW as $, aA as w } from "./ShortcutLinksContext-
|
|
1
|
+
import { aj as L, aW as $, aA as w } from "./ShortcutLinksContext-DApcNgFs.js";
|
|
2
2
|
import { useContext as y, useRef as O, useState as S, useCallback as k, useEffect as B } from "react";
|
|
3
3
|
import "react-router-dom";
|
|
4
4
|
import "react-dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";const u=require("./ShortcutLinksContext-DGRQ13Df.cjs"),t=require("react");require("react-router-dom");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");require("react-hook-form");require("react-flexmonster");const c=()=>{const{user:e}=t.useContext(u.UserContext);return{checkUserHasPermissions:t.useCallback((s,n="all")=>s.length===0?!0:n==="any"?s.some(i=>{var r;return(r=e==null?void 0:e.permissions)==null?void 0:r.includes(i)}):s.every(i=>{var r;return(r=e==null?void 0:e.permissions)==null?void 0:r.includes(i)}),[e])}};exports.usePermissions=c;
|
package/dist/utils.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ShortcutLinksContext-DGRQ13Df.cjs");require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const f=require("./numberUtils-BY7ziQF8.cjs"),g=({cell:{value:e}})=>t.jsxRuntimeExports.jsx(t.SimpleTooltip,{text:e,placement:"bottom",children:t.jsxRuntimeExports.jsx("div",{className:"w-100 text-truncate",children:e})}),h=({cell:{value:e}})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e==null?void 0:e.toLocaleString("cs-CZ")}),S=({cell:{value:e}})=>{const i=t.format(new Date(e),"dd.MM.yyyy");return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e?i:""})},d=(e,i)=>{let n=!1,a=e;e[0]==="#"&&(a=e.slice(1),n=!0);let r=parseInt(a.substring(0,2),16),o=parseInt(a.substring(2,4),16),s=parseInt(a.substring(4,6),16);r+=i,o+=i,s+=i,r>255?r=255:r<0&&(r=0),o>255?o=255:o<0&&(o=0),s>255?s=255:s<0&&(s=0);const u=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),m=o.toString(16).length===1?"0"+o.toString(16):o.toString(16),c=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return(n?"#":"")+u+m+c},x=e=>{const i=e.slice(3),n=[];for(let r=0;r<i.length;r+=2)n.push(i.slice(r,r+2));return`#${n.reverse().join("")}`};function l(e,i){e.setValue(i,null)}function D(e,i){i.forEach(n=>{l(e,n)})}const p=["edit","delete","info","warning","check","add","cancel","danger","chevron-left","chevron-right","chevron-up","chevron-down","chevron-double-left","chevron-double-right","folder","folder-filled","file-download","file-upload","star-outline","save"];exports.atobUtf8=t.atobUtf8;exports.buildEmployeeNameString=t.buildEmployeeNameString;exports.buildOrgUnitString=t.buildOrgUnitString;exports.buildVehicleNameString=t.buildVehicleNameString;exports.capitalizeFirstLetter=t.capitalizeFirstLetter;exports.compareDate=t.compareDate;exports.compareDateTime=t.compareDateTime;exports.extractErrorsFromResponse=t.extractErrorsFromResponse;exports.extractFilename=t.extractFilename;exports.extractPermissionsFromResponse=t.extractPermissionsFromResponse;exports.fixNameIdNulls=t.fixNameIdNulls;exports.formatDate=t.formatDate;exports.formatDateTime=t.formatDateTime;exports.formatFileSize=t.formatFileSize;exports.getDateString=t.getDateString;exports.getDaysDifference=t.getDaysDifference;exports.getFirstDayOfMonth=t.getFirstDayOfMonth;exports.getFirstDayOfOffsetMonth=t.getFirstDayOfOffsetMonth;exports.getFirstDayOfYear=t.getFirstDayOfYear;exports.getLastDayOfMonth=t.getLastDayOfMonth;exports.getLastDayOfOffsetMonth=t.getLastDayOfOffsetMonth;exports.getLastDayOfYear=t.getLastDayOfYear;exports.hasOnlyNullValues=t.hasOnlyNullValues;exports.hookFormSetServerErrors=t.hookFormSetServerErrors;exports.isISODate=t.isISODate;exports.isPrimitive=t.isPrimitive;exports.isValidDate=t.isValidDate;exports.joinStrings=t.joinStrings;exports.msToStartOfNextDay=t.msToStartOfNextDay;exports.replaceNullValuesOnlyObjectsWithNulls=t.replaceNullValuesOnlyObjectsWithNulls;exports.saveFile=t.saveFile;exports.saveFileFromResponse=t.saveFileFromResponse;exports.shortenText=t.shortenText;exports.stringContains=t.stringContains;exports.stringSearchWithin=t.stringSearchWithin;exports.stringStartsWith=t.stringStartsWith;exports.trimIsoDate=t.trimIsoDate;exports.truncateText=t.truncateText;exports.urlfyArray=t.urlfyArray;exports.limitNumber=f.limitNumber;exports.CommonLuminusIconsArray=p;exports.adjustBrightness=d;exports.dateValueFormat=S;exports.hookFormSetNull=l;exports.hookFormSetNulls=D;exports.numFormat=h;exports.valueTooltip=g;exports.vclToHex=x;
|