@ukpc-lib/react 0.3.28 → 0.3.29

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.
@@ -106,4 +106,4 @@ const theme2 = createTheme({ palette: {
106
106
  primary: { main: green[500] },
107
107
  } });`:Ue(12,u?` (${u})`:"",JSON.stringify(c.main)));return qr(c,"light",_,n),qr(c,"dark",S,n),c.contrastText||(c.contrastText=m(c.main)),c},b={dark:zt,light:Ur};return process.env.NODE_ENV!=="production"&&(b[t]||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),ce(p._extends({common:p._extends({},Ke),mode:t,primary:y({color:i,name:"primary"}),secondary:y({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:y({color:l,name:"error"}),warning:y({color:h,name:"warning"}),info:y({color:d,name:"info"}),success:y({color:f,name:"success"}),grey:Os,contrastThreshold:r,getContrastText:m,augmentColor:y,tonalOffset:n},b[t]),o)}const Hs=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Ws(e){return Math.round(e*1e5)/1e5}const Yr={textTransform:"uppercase"},Gr='"Roboto", "Helvetica", "Arial", sans-serif';function Us(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=Gr,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:l=500,fontWeightBold:d=700,htmlFontSize:f=16,allVariants:h,pxToRem:m}=r,y=p._objectWithoutPropertiesLoose(r,Hs);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof f!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const b=o/14,v=m||(x=>`${x/f*b}rem`),c=(x,_,S,C,g)=>p._extends({fontFamily:n,fontWeight:x,fontSize:v(_),lineHeight:S},n===Gr?{letterSpacing:`${Ws(C/_)}em`}:{},g,h),u={h1:c(i,96,1.167,-1.5),h2:c(i,60,1.2,-.5),h3:c(a,48,1.167,0),h4:c(a,34,1.235,.25),h5:c(a,24,1.334,0),h6:c(l,20,1.6,.15),subtitle1:c(a,16,1.75,.15),subtitle2:c(l,14,1.57,.1),body1:c(a,16,1.5,.15),body2:c(a,14,1.43,.15),button:c(l,14,1.75,.4,Yr),caption:c(a,12,1.66,.4),overline:c(a,12,2.66,1,Yr),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ce(p._extends({htmlFontSize:f,pxToRem:v,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:l,fontWeightBold:d},u),y,{clone:!1})}const qs=.2,Ys=.14,Gs=.12;function F(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${qs})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Ys})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Gs})`].join(",")}const Ks=["none",F(0,2,1,-1,0,1,1,0,0,1,3,0),F(0,3,1,-2,0,2,2,0,0,1,5,0),F(0,3,3,-2,0,3,4,0,0,1,8,0),F(0,2,4,-1,0,4,5,0,0,1,10,0),F(0,3,5,-1,0,5,8,0,0,1,14,0),F(0,3,5,-1,0,6,10,0,0,1,18,0),F(0,4,5,-2,0,7,10,1,0,2,16,1),F(0,5,5,-3,0,8,10,1,0,3,14,2),F(0,5,6,-3,0,9,12,1,0,3,16,2),F(0,6,6,-3,0,10,14,1,0,4,18,3),F(0,6,7,-4,0,11,15,1,0,4,20,3),F(0,7,8,-4,0,12,17,2,0,5,22,4),F(0,7,8,-4,0,13,19,2,0,5,24,4),F(0,7,9,-4,0,14,21,2,0,5,26,4),F(0,8,9,-5,0,15,22,2,0,6,28,5),F(0,8,10,-5,0,16,24,2,0,6,30,5),F(0,8,11,-5,0,17,26,2,0,6,32,5),F(0,9,11,-5,0,18,28,2,0,7,34,6),F(0,9,12,-6,0,19,29,2,0,7,36,6),F(0,10,13,-6,0,20,31,3,0,8,38,7),F(0,10,13,-6,0,21,33,3,0,8,40,7),F(0,10,14,-6,0,22,35,3,0,8,42,7),F(0,11,14,-7,0,23,36,3,0,9,44,8),F(0,11,15,-7,0,24,38,3,0,9,46,8)],Zs=Ks,Xs=["duration","easing","delay"],Js={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Qs={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Kr(e){return`${Math.round(e)}ms`}function e0(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function t0(e){const t=p._extends({},Js,e.easing),r=p._extends({},Qs,e.duration),n=(o=["all"],i={})=>{const{duration:a=r.standard,easing:l=t.easeInOut,delay:d=0}=i,f=p._objectWithoutPropertiesLoose(i,Xs);if(process.env.NODE_ENV!=="production"){const h=y=>typeof y=="string",m=y=>!isNaN(parseFloat(y));!h(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!m(a)&&!h(a)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${a}.`),h(l)||console.error('MUI: Argument "easing" must be a string.'),!m(d)&&!h(d)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
108
108
  `)),Object.keys(f).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(f).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(h=>`${h} ${typeof a=="string"?a:Kr(a)} ${l} ${typeof d=="string"?d:Kr(d)}`).join(",")};return p._extends({getAutoHeightDuration:e0,create:n},e,{easing:t,duration:r})}const r0={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},n0=r0,o0=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function i0(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,a=p._objectWithoutPropertiesLoose(e,o0);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":Ue(18));const l=Bs(n),d=tr(e);let f=ce(d,{mixins:ds(d.breakpoints,r),palette:l,shadows:Zs.slice(),typography:Us(l,i),transitions:t0(o),zIndex:p._extends({},n0)});if(f=ce(f,a),f=t.reduce((h,m)=>ce(h,m),f),process.env.NODE_ENV!=="production"){const h=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],m=(y,b)=>{let v;for(v in y){const c=y[v];if(h.indexOf(v)!==-1&&Object.keys(c).length>0){if(process.env.NODE_ENV!=="production"){const u=Xt("",v);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${v}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${u}' syntax:`,JSON.stringify({root:{[`&.${u}`]:c}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
109
- `))}y[v]={}}}};Object.keys(f.components).forEach(y=>{const b=f.components[y].styleOverrides;b&&y.indexOf("Mui")===0&&m(b,y)})}return f.unstable_sxConfig=p._extends({},Je,a==null?void 0:a.unstable_sxConfig),f.unstable_sx=function(m){return er({sx:m,theme:this})},f}const a0=i0(),Hn=a0,Wn="$$material";function s0({props:e,name:t}){return as({props:e,name:t,defaultTheme:Hn,themeId:Wn})}var et={};const c0=p.getAugmentedNamespace(p._extends$1),l0=p.getAugmentedNamespace(p.objectWithoutPropertiesLoose),u0=p.getAugmentedNamespace(ts),d0=p.getAugmentedNamespace(Eo),f0=p.getAugmentedNamespace($o),h0=p.getAugmentedNamespace(ko),m0=p.getAugmentedNamespace(Di),p0=p.getAugmentedNamespace(us);var ze=Rn;Object.defineProperty(et,"__esModule",{value:!0});var g0=et.default=$0,y0=et.shouldForwardProp=st;et.systemDefaultTheme=void 0;var te=ze(c0),Yt=ze(l0),Zr=j0(u0),v0=d0,x0=ze(f0),b0=ze(h0),_0=ze(m0),S0=ze(p0);const w0=["ownerState"],E0=["variants"],C0=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Un(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Un=function(n){return n?r:t})(e)}function j0(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Un(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}function T0(e){return Object.keys(e).length===0}function O0(e){return typeof e=="string"&&e.charCodeAt(0)>96}function st(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const N0=et.systemDefaultTheme=(0,_0.default)(),Xr=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function nt({defaultTheme:e,theme:t,themeId:r}){return T0(t)?e:t[r]||t}function k0(e){return e?(t,r)=>r[e]:null}function ct(e,t){let{ownerState:r}=t,n=(0,Yt.default)(t,w0);const o=typeof e=="function"?e((0,te.default)({ownerState:r},n)):e;if(Array.isArray(o))return o.flatMap(i=>ct(i,(0,te.default)({ownerState:r},n)));if(o&&typeof o=="object"&&Array.isArray(o.variants)){const{variants:i=[]}=o;let l=(0,Yt.default)(o,E0);return i.forEach(d=>{let f=!0;typeof d.props=="function"?f=d.props((0,te.default)({ownerState:r},n,r)):Object.keys(d.props).forEach(h=>{(r==null?void 0:r[h])!==d.props[h]&&n[h]!==d.props[h]&&(f=!1)}),f&&(Array.isArray(l)||(l=[l]),l.push(typeof d.style=="function"?d.style((0,te.default)({ownerState:r},n,r)):d.style))}),l}return o}function $0(e={}){const{themeId:t,defaultTheme:r=N0,rootShouldForwardProp:n=st,slotShouldForwardProp:o=st}=e,i=a=>(0,S0.default)((0,te.default)({},a,{theme:nt((0,te.default)({},a,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(a,l={})=>{(0,Zr.internal_processStyles)(a,g=>g.filter(w=>!(w!=null&&w.__mui_systemSx)));const{name:d,slot:f,skipVariantsResolver:h,skipSx:m,overridesResolver:y=k0(Xr(f))}=l,b=(0,Yt.default)(l,C0),v=h!==void 0?h:f&&f!=="Root"&&f!=="root"||!1,c=m||!1;let u;process.env.NODE_ENV!=="production"&&d&&(u=`${d}-${Xr(f||"Root")}`);let x=st;f==="Root"||f==="root"?x=n:f?x=o:O0(a)&&(x=void 0);const _=(0,Zr.default)(a,(0,te.default)({shouldForwardProp:x,label:u},b)),S=g=>typeof g=="function"&&g.__emotion_real!==g||(0,v0.isPlainObject)(g)?w=>ct(g,(0,te.default)({},w,{theme:nt({theme:w.theme,defaultTheme:r,themeId:t})})):g,C=(g,...w)=>{let E=S(g);const A=w?w.map(S):[];d&&y&&A.push(z=>{const W=nt((0,te.default)({},z,{defaultTheme:r,themeId:t}));if(!W.components||!W.components[d]||!W.components[d].styleOverrides)return null;const G=W.components[d].styleOverrides,ae={};return Object.entries(G).forEach(([pe,ge])=>{ae[pe]=ct(ge,(0,te.default)({},z,{theme:W}))}),y(z,ae)}),d&&!v&&A.push(z=>{var W;const G=nt((0,te.default)({},z,{defaultTheme:r,themeId:t})),ae=G==null||(W=G.components)==null||(W=W[d])==null?void 0:W.variants;return ct({variants:ae},(0,te.default)({},z,{theme:G}))}),c||A.push(i);const P=A.length-w.length;if(Array.isArray(g)&&P>0){const z=new Array(P).fill("");E=[...g,...z],E.raw=[...g.raw,...z]}const H=_(E,...A);if(process.env.NODE_ENV!=="production"){let z;d&&(z=`${d}${(0,x0.default)(f||"")}`),z===void 0&&(z=`Styled(${(0,b0.default)(a)})`),H.displayName=z}return a.muiName&&(H.muiName=a.muiName),H};return _.withConfig&&(C.withConfig=_.withConfig),C}}const A0=e=>y0(e)&&e!=="classes",P0=g0({themeId:Wn,defaultTheme:Hn,rootShouldForwardProp:A0}),I0=P0;function M0(e){return Xt("MuiSvgIcon",e)}Do("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const R0=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],D0=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${ve(t)}`,`fontSize${ve(r)}`]};return Ao(o,M0,n)},z0=I0("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${ve(r.color)}`],t[`fontSize${ve(r.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var r,n,o,i,a,l,d,f,h,m,y,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=e.transitions)==null||(n=r.create)==null?void 0:n.call(r,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((l=e.typography)==null||(d=l.pxToRem)==null?void 0:d.call(l,24))||"1.5rem",large:((f=e.typography)==null||(h=f.pxToRem)==null?void 0:h.call(f,35))||"2.1875rem"}[t.fontSize],color:(m=(y=(e.vars||e).palette)==null||(y=y[t.color])==null?void 0:y.main)!=null?m:{action:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.active,disabled:(v=(e.vars||e).palette)==null||(v=v.action)==null?void 0:v.disabled,inherit:void 0}[t.color]}}),hr=L.forwardRef(function(t,r){const n=s0({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:l="svg",fontSize:d="medium",htmlColor:f,inheritViewBox:h=!1,titleAccess:m,viewBox:y="0 0 24 24"}=n,b=p._objectWithoutPropertiesLoose(n,R0),v=L.isValidElement(o)&&o.type==="svg",c=p._extends({},n,{color:a,component:l,fontSize:d,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:y,hasSvgAsChild:v}),u={};h||(u.viewBox=y);const x=D0(c);return s.jsxs(z0,p._extends({as:l,className:p.clsx(x.root,i),focusable:"false",color:f,"aria-hidden":m?void 0:!0,role:m?"img":void 0,ref:r},u,b,v&&o.props,{ownerState:c,children:[v?o.props.children:o,m?s.jsx("title",{children:m}):null]}))});process.env.NODE_ENV!=="production"&&(hr.propTypes={children:p.PropTypes.node,classes:p.PropTypes.object,className:p.PropTypes.string,color:p.PropTypes.oneOfType([p.PropTypes.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),p.PropTypes.string]),component:p.PropTypes.elementType,fontSize:p.PropTypes.oneOfType([p.PropTypes.oneOf(["inherit","large","medium","small"]),p.PropTypes.string]),htmlColor:p.PropTypes.string,inheritViewBox:p.PropTypes.bool,shapeRendering:p.PropTypes.string,sx:p.PropTypes.oneOfType([p.PropTypes.arrayOf(p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.object,p.PropTypes.bool])),p.PropTypes.func,p.PropTypes.object]),titleAccess:p.PropTypes.string,viewBox:p.PropTypes.string});hr.muiName="SvgIcon";const Jr=hr;function L0(e,t){function r(n,o){return s.jsx(Jr,p._extends({"data-testid":`${t}Icon`,ref:o},n,{children:e}))}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=Jr.muiName,L.memo(L.forwardRef(r))}const F0=L0(s.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var Qr=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function V0(e,t){return!!(e===t||Qr(e)&&Qr(t))}function B0(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!V0(e[r],t[r]))return!1;return!0}function Lt(e,t){t===void 0&&(t=B0);var r,n=[],o,i=!1;function a(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return i&&r===this&&t(l,n)||(o=e.apply(this,l),i=!0,r=this,n=l),o}return a}var H0=typeof performance=="object"&&typeof performance.now=="function",en=H0?function(){return performance.now()}:function(){return Date.now()};function tn(e){cancelAnimationFrame(e.id)}function W0(e,t){var r=en();function n(){en()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Ft=-1;function rn(e){if(e===void 0&&(e=!1),Ft===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ft=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ft}var ke=null;function nn(e){if(e===void 0&&(e=!1),ke===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?ke="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?ke="negative":ke="positive-ascending"),document.body.removeChild(t),ke}return ke}process.env.NODE_ENV;var U0=150,q0=function(t,r){return t},lt=null,ut=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(lt=new WeakSet,ut=new WeakSet);function Y0(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,h=e.validateProps;return t=function(m){p._inheritsLoose(y,m);function y(v){var c;return c=m.call(this,v)||this,c._instanceProps=d(c.props,p._assertThisInitialized(c)),c._outerRef=void 0,c._resetIsScrollingTimeoutId=null,c.state={instance:p._assertThisInitialized(c),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof c.props.initialScrollOffset=="number"?c.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},c._callOnItemsRendered=void 0,c._callOnItemsRendered=Lt(function(u,x,_,S){return c.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:x,visibleStartIndex:_,visibleStopIndex:S})}),c._callOnScroll=void 0,c._callOnScroll=Lt(function(u,x,_){return c.props.onScroll({scrollDirection:u,scrollOffset:x,scrollUpdateWasRequested:_})}),c._getItemStyle=void 0,c._getItemStyle=function(u){var x=c.props,_=x.direction,S=x.itemSize,C=x.layout,g=c._getItemStyleCache(f&&S,f&&C,f&&_),w;if(g.hasOwnProperty(u))w=g[u];else{var E=r(c.props,u,c._instanceProps),A=o(c.props,u,c._instanceProps),P=_==="horizontal"||C==="horizontal",H=_==="rtl",z=P?E:0;g[u]=w={position:"absolute",left:H?void 0:z,right:H?z:void 0,top:P?0:E,height:P?"100%":A,width:P?A:"100%"}}return w},c._getItemStyleCache=void 0,c._getItemStyleCache=Lt(function(u,x,_){return{}}),c._onScrollHorizontal=function(u){var x=u.currentTarget,_=x.clientWidth,S=x.scrollLeft,C=x.scrollWidth;c.setState(function(g){if(g.scrollOffset===S)return null;var w=c.props.direction,E=S;if(w==="rtl")switch(nn()){case"negative":E=-S;break;case"positive-descending":E=C-_-S;break}return E=Math.max(0,Math.min(E,C-_)),{isScrolling:!0,scrollDirection:g.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._onScrollVertical=function(u){var x=u.currentTarget,_=x.clientHeight,S=x.scrollHeight,C=x.scrollTop;c.setState(function(g){if(g.scrollOffset===C)return null;var w=Math.max(0,Math.min(C,S-_));return{isScrolling:!0,scrollDirection:g.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(u){var x=c.props.outerRef;c._outerRef=u,typeof x=="function"?x(u):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=u)},c._resetIsScrollingDebounced=function(){c._resetIsScrollingTimeoutId!==null&&tn(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=W0(c._resetIsScrolling,U0)},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1,null)})},c}y.getDerivedStateFromProps=function(c,u){return G0(c,u),h(c),null};var b=y.prototype;return b.scrollTo=function(c){c=Math.max(0,c),this.setState(function(u){return u.scrollOffset===c?null:{scrollDirection:u.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},b.scrollToItem=function(c,u){u===void 0&&(u="auto");var x=this.props,_=x.itemCount,S=x.layout,C=this.state.scrollOffset;c=Math.max(0,Math.min(c,_-1));var g=0;if(this._outerRef){var w=this._outerRef;S==="vertical"?g=w.scrollWidth>w.clientWidth?rn():0:g=w.scrollHeight>w.clientHeight?rn():0}this.scrollTo(i(this.props,c,u,C,this._instanceProps,g))},b.componentDidMount=function(){var c=this.props,u=c.direction,x=c.initialScrollOffset,_=c.layout;if(typeof x=="number"&&this._outerRef!=null){var S=this._outerRef;u==="horizontal"||_==="horizontal"?S.scrollLeft=x:S.scrollTop=x}this._callPropsCallbacks()},b.componentDidUpdate=function(){var c=this.props,u=c.direction,x=c.layout,_=this.state,S=_.scrollOffset,C=_.scrollUpdateWasRequested;if(C&&this._outerRef!=null){var g=this._outerRef;if(u==="horizontal"||x==="horizontal")if(u==="rtl")switch(nn()){case"negative":g.scrollLeft=-S;break;case"positive-ascending":g.scrollLeft=S;break;default:var w=g.clientWidth,E=g.scrollWidth;g.scrollLeft=E-w-S;break}else g.scrollLeft=S;else g.scrollTop=S}this._callPropsCallbacks()},b.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&tn(this._resetIsScrollingTimeoutId)},b.render=function(){var c=this.props,u=c.children,x=c.className,_=c.direction,S=c.height,C=c.innerRef,g=c.innerElementType,w=c.innerTagName,E=c.itemCount,A=c.itemData,P=c.itemKey,H=P===void 0?q0:P,z=c.layout,W=c.outerElementType,G=c.outerTagName,ae=c.style,pe=c.useIsScrolling,ge=c.width,be=this.state.isScrolling,ue=_==="horizontal"||z==="horizontal",_e=ue?this._onScrollHorizontal:this._onScrollVertical,ye=this._getRangeToRender(),Le=ye[0],Fe=ye[1],Se=[];if(E>0)for(var de=Le;de<=Fe;de++)Se.push(j.createElement(u,{data:A,key:H(de,A),index:de,isScrolling:pe?be:void 0,style:this._getItemStyle(de)}));var we=n(this.props,this._instanceProps);return j.createElement(W||G||"div",{className:x,onScroll:_e,ref:this._outerRefSetter,style:p._extends({position:"relative",height:S,width:ge,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:_},ae)},j.createElement(g||w||"div",{children:Se,ref:C,style:{height:ue?"100%":we,pointerEvents:be?"none":void 0,width:ue?we:"100%"}}))},b._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var c=this.props.itemCount;if(c>0){var u=this._getRangeToRender(),x=u[0],_=u[1],S=u[2],C=u[3];this._callOnItemsRendered(x,_,S,C)}}if(typeof this.props.onScroll=="function"){var g=this.state,w=g.scrollDirection,E=g.scrollOffset,A=g.scrollUpdateWasRequested;this._callOnScroll(w,E,A)}},b._getRangeToRender=function(){var c=this.props,u=c.itemCount,x=c.overscanCount,_=this.state,S=_.isScrolling,C=_.scrollDirection,g=_.scrollOffset;if(u===0)return[0,0,0,0];var w=a(this.props,g,this._instanceProps),E=l(this.props,w,g,this._instanceProps),A=!S||C==="backward"?Math.max(1,x):1,P=!S||C==="forward"?Math.max(1,x):1;return[Math.max(0,w-A),Math.max(0,Math.min(u-1,E+P)),w,E]},y}(j.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var G0=function(t,r){var n=t.children,o=t.direction,i=t.height,a=t.layout,l=t.innerTagName,d=t.outerTagName,f=t.width,h=r.instance;if(process.env.NODE_ENV!=="production"){(l!=null||d!=null)&&ut&&!ut.has(h)&&(ut.add(h),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var m=o==="horizontal"||a==="horizontal";switch(o){case"horizontal":case"vertical":lt&&!lt.has(h)&&(lt.add(h),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(m&&typeof f!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(f===null?"null":typeof f)+'" was specified.'));if(!m&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},K0=50,$e=function(t,r,n){var o=t,i=o.itemSize,a=n.itemMetadataMap,l=n.lastMeasuredIndex;if(r>l){var d=0;if(l>=0){var f=a[l];d=f.offset+f.size}for(var h=l+1;h<=r;h++){var m=i(h);a[h]={offset:d,size:m},d+=m}n.lastMeasuredIndex=r}return a[r]},Z0=function(t,r,n){var o=r.itemMetadataMap,i=r.lastMeasuredIndex,a=i>0?o[i].offset:0;return a>=n?qn(t,r,i,0,n):X0(t,r,Math.max(0,i),n)},qn=function(t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),l=$e(t,a,r).offset;if(l===i)return a;l<i?o=a+1:l>i&&(n=a-1)}return o>0?o-1:0},X0=function(t,r,n,o){for(var i=t.itemCount,a=1;n<i&&$e(t,n,r).offset<o;)n+=a,a*=2;return qn(t,r,Math.min(n,i-1),Math.floor(n/2),o)},on=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,i=r.estimatedItemSize,a=r.lastMeasuredIndex,l=0;if(a>=n&&(a=n-1),a>=0){var d=o[a];l=d.offset+d.size}var f=n-a-1,h=f*i;return l+h},J0=Y0({getItemOffset:function(t,r,n){return $e(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:on,getOffsetForIndexAndAlignment:function(t,r,n,o,i,a){var l=t.direction,d=t.height,f=t.layout,h=t.width,m=l==="horizontal"||f==="horizontal",y=m?h:d,b=$e(t,r,i),v=on(t,i),c=Math.max(0,Math.min(v-y,b.offset)),u=Math.max(0,b.offset-y+b.size+a);switch(n==="smart"&&(o>=u-y&&o<=c+y?n="auto":n="center"),n){case"start":return c;case"end":return u;case"center":return Math.round(u+(c-u)/2);case"auto":default:return o>=u&&o<=c?o:o<u?u:c}},getStartIndexForOffset:function(t,r,n){return Z0(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var i=t.direction,a=t.height,l=t.itemCount,d=t.layout,f=t.width,h=i==="horizontal"||d==="horizontal",m=h?f:a,y=$e(t,r,o),b=n+m,v=y.offset+y.size,c=r;c<l-1&&v<b;)c++,v+=$e(t,c,o).size;return c},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:o||K0,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,l){l===void 0&&(l=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),l&&r.forceUpdate()},i},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function dt(e,t){return t?e:void 0}function Gt(e){const{colors:t}=p.useTheme();return s.jsx(N.Stack,{sx:{cursor:"pointer"},onClick:r=>{var n;r.preventDefault(),r.stopPropagation(),(n=e.onClick)==null||n.call(e,e.option)},...e.stackProps,children:s.jsx(N.Stack,{sx:{p:1,transition:"0.2s",borderRadius:"5px",cursor:"pointer",...dt({backgroundColor:t.primary200},e.select),":hover":{backgroundColor:"#eeeeee80",borderColor:"transparent"}},children:e.renderOption(e.option)})})}const gt=37,Q0=(e,t)=>{const a=document.createElement("p");a.innerText=t,a.style.width=`${e-16-16-4}px`,document.body.appendChild(a);const l=a.offsetHeight;return document.body.removeChild(a),l>21?gt+21:gt};function ec(e){const[t,r]=j.useState(!1),[n,o]=j.useState(""),[i,a]=j.useState(""),[l,d]=j.useState(!1),{isRequired:f=!1}=e,h=j.useCallback(p._.debounce(w=>{var E;(E=e.handleChangeSearch)==null||E.call(e,w)},300),[e.handleChangeSearch]),m=()=>{r(!t)},y=()=>{r(!1),a(""),h("")};j.useEffect(()=>{o(e.value?e.getOptionLabel(e.value):"")},[e.value]),j.useEffect(()=>{t||o(e.value?e.getOptionLabel(e.value):"")},[t]),j.useEffect(()=>{d(e.searchLoading)},[e.paging.rows,e.searchLoading]);const b=e.paging.rows,{hasNextPage:v}=e,c=v?b.length+1:b.length,u=()=>e.isNextPageLoading?void 0:e.loadNextPage(i),x=w=>!v||w<b.length,_=w=>{o(w.target.value),t&&(a(w.target.value),h(w.target.value),d(!0))},S=j.useRef(null),C=j.useRef(null),g=j.useRef(null);return j.useEffect(()=>{var w,E,A,P;t?((w=C.current)==null||w.classList.add("Mui-focused"),(E=g.current)==null||E.classList.add("Mui-focused")):((A=C.current)==null||A.classList.remove("Mui-focused"),(P=g.current)==null||P.classList.remove("Mui-focused"))},[t]),s.jsx(N.ClickAwayListener,{onClickAway:y,mouseEvent:"onMouseDown",touchEvent:"onTouchEnd",children:s.jsx("div",{ref:S,style:{width:e.wrapperWidth??"auto"},children:s.jsxs(N.Stack,{sx:{position:"relative"},children:[s.jsx(N.TextField,{required:f,label:e.label,value:n,disabled:e.loading||e.disabled||e.readOnly,fullWidth:!0,error:e.error,helperText:e.helperText,onFocus:w=>{e.loading||e.disabled||e.readOnly||(w.preventDefault(),w.stopPropagation(),r(!0))},autoComplete:"off",onChange:_,placeholder:e.placeholder||"All options",sx:{"& input:not(:focus)":{"&::placeholder":{color:e.placeHolderColor||"#C5C5C5",opacity:1}}},InputLabelProps:{ref:C,shrink:!0},InputProps:{readOnly:e.readOnly,ref:g,endAdornment:s.jsx(N.IconButton,{size:"small",sx:{padding:"1px"},onClick:w=>{var E;w.preventDefault(),w.stopPropagation(),m(),(E=S.current)==null||E.focus()},disabled:e.loading||e.disabled||e.readOnly,children:e.loading?s.jsx(N.CircularProgress,{size:"16px"}):s.jsx(F0,{fontSize:"small",style:{transition:"0.3s"},className:t?"rotate":""})})}}),s.jsx(N.Fade,{in:t,timeout:0,unmountOnExit:!1,children:s.jsxs(N.Paper,{sx:{position:"absolute",top:"calc(100% + 2px)",zIndex:2,left:0,right:0,p:1},children:[!e.disabledAllOption&&s.jsx(N.Stack,{sx:{...dt({display:"none"},!!l)},children:s.jsx(N.Stack,{children:s.jsx(Gt,{option:void 0,select:!e.value,renderOption:()=>s.jsx(N.Typography,{children:e.placeholder||"All options"}),onClick:()=>{var w,E;y(),(w=e.onChange)==null||w.call(e,void 0),(E=e.handleChangeSearch)==null||E.call(e,"")}})})}),!l&&s.jsx(p.InfiniteLoader,{isItemLoaded:x,itemCount:c,loadMoreItems:u,threshold:5,children:({onItemsRendered:w,ref:E})=>s.jsx(J0,{ref:E,onItemsRendered:w,height:gt*Math.min(e.itemsNumber||6,c),itemCount:c,itemSize:A=>{var P;return Q0((P=S.current)==null?void 0:P.offsetWidth,b[A]?e.getOptionLabel(b[A]):"")},width:"100%",className:"styled-scroll",children:({index:A,style:P})=>{var z;const H=b[A];return x(A)?s.jsx(Gt,{stackProps:{style:P},option:H,renderOption:W=>{var G;return s.jsxs(N.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(N.Typography,{children:e.getOptionLabel(W)}),(G=e.renderOptionTooltip)==null?void 0:G.call(e,W)]})},onClick:W=>{var G;y(),(G=e.onChange)==null||G.call(e,W)},select:((z=e.isEqual)==null?void 0:z.call(e,H,e.value))??p._.isEqual(H,e.value)}):s.jsx(N.Stack,{style:P,sx:{height:gt,pl:1},justifyContent:"center",children:s.jsx(N.Typography,{children:"Loading..."})})}})}),s.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...dt({display:"none"},!l)},children:s.jsx(N.Typography,{color:"grayText",children:"Searching..."})}),s.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...dt({display:"none"},!!(b.length||e.loading||l))},children:s.jsx(N.Typography,{color:"grayText",children:"No options"})})]})})]})})})}function tc(e){var h;const{listProps:t}=e,[r,n]=j.useState({initLoading:!e.disabled,searchLoading:!1,hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:((h=e.listProps)==null?void 0:h.pageSize)||20,rows:[],total:0,totalPages:1}}),o=async(m,y)=>{var b,v;if(e.list)n(()=>{var x;const c=((x=m==null?void 0:m.search)==null?void 0:x.content)||"";return{hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:1e5,rows:e.list.options.filter(_=>e.list.searchOption?e.list.searchOption(_,c):p.search(_,c,e.list.searchFields)),total:e.list.options.length,totalPages:1},searchLoading:!1,initLoading:!1}});else{n(c=>({...c,isNextPageLoading:!0}));try{const c={page:1,pageSize:20,filter:{...t==null?void 0:t.filter,...m==null?void 0:m.filter},...p.lodashExports.omit(t,"filter"),...p.lodashExports.omit(m,"filter"),search:{fields:((b=t==null?void 0:t.search)==null?void 0:b.fields)??[],content:((v=m==null?void 0:m.search)==null?void 0:v.content)??""}};y&&(c.filter={},c.search&&(c.search.content=""),c.page=1);const u=await e.getList(c);n(x=>({initLoading:!1,searchLoading:!1,isNextPageLoading:!1,paging:{...u,rows:(m==null?void 0:m.page)===1?u.rows:x.paging.rows.concat(u.rows)},hasNextPage:u.page<u.totalPages}))}catch{}}},i=()=>(n(m=>({...m,initLoading:!0})),o(void 0,!0)),a=m=>(n(y=>({...y,initLoading:!0})),o(m)),l=m=>{o({page:r.paging.page+1,search:{content:m}})},d=m=>{n(y=>({...y,searchLoading:!0})),o({page:1,search:{content:m}})};j.useEffect(()=>{e.disabled||(n(m=>({...m,initLoading:!0})),o({page:1}))},[...e.dependencyList||[]]);const f=()=>{n(m=>({...m,initLoading:!m.initLoading}))};return{...e,loadNextPage:l,handleChangeSearch:d,paging:r.paging,hasNextPage:r.hasNextPage,isNextPageLoading:r.isNextPageLoading,searchLoading:r.searchLoading,loading:e.loading||r.initLoading,getList:a,reset:i,toggleLoading:f}}function rc(e){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M12 3.16663H3.99998C2.80336 3.16663 1.83331 4.13668 1.83331 5.33329V12C1.83331 13.1966 2.80336 14.1666 3.99998 14.1666H12C13.1966 14.1666 14.1666 13.1966 14.1666 12V5.33329C14.1666 4.13668 13.1966 3.16663 12 3.16663Z",stroke:"#85858A"}),s.jsx("path",{d:"M4.5 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M2.5 6.16663H13.5",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M11.8333 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M5.5 9.33337C5.77614 9.33337 6 9.10952 6 8.83337C6 8.55723 5.77614 8.33337 5.5 8.33337C5.22386 8.33337 5 8.55723 5 8.83337C5 9.10952 5.22386 9.33337 5.5 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M8.16669 9.33337C8.44283 9.33337 8.66669 9.10952 8.66669 8.83337C8.66669 8.55723 8.44283 8.33337 8.16669 8.33337C7.89054 8.33337 7.66669 8.55723 7.66669 8.83337C7.66669 9.10952 7.89054 9.33337 8.16669 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M10.8333 9.33337C11.1095 9.33337 11.3333 9.10952 11.3333 8.83337C11.3333 8.55723 11.1095 8.33337 10.8333 8.33337C10.5572 8.33337 10.3333 8.55723 10.3333 8.83337C10.3333 9.10952 10.5572 9.33337 10.8333 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12Z",fill:"#85858A"}),s.jsx("path",{d:"M8.16669 12C8.44283 12 8.66669 11.7761 8.66669 11.5C8.66669 11.2239 8.44283 11 8.16669 11C7.89054 11 7.66669 11.2239 7.66669 11.5C7.66669 11.7761 7.89054 12 8.16669 12Z",fill:"#85858A"}),s.jsx("path",{d:"M10.8333 12C11.1095 12 11.3333 11.7761 11.3333 11.5C11.3333 11.2239 11.1095 11 10.8333 11C10.5572 11 10.3333 11.2239 10.3333 11.5C10.3333 11.7761 10.5572 12 10.8333 12Z",fill:"#85858A"})]})}const nc="Reset date";function oc(e){var l,d;const[t,r]=j.useState(e.value),n=!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":K(t==null?void 0:t.startDate).format("DD/MM/YYYY")+" ~ "+K(t==null?void 0:t.endDate).format("DD/MM/YYYY");j.useEffect(()=>{r(e.value)},[e.value]);const o=j.useRef(null),i=j.useRef(null),a=j.useRef(null);return console.log("inputRef",o),console.log("labelRef",i),s.jsx(p.DateRangePicker,{initialSettings:{autoApply:!0,ranges:{Today:[K(),K()],Yesterday:[K().subtract(1,"days"),K().subtract(1,"days")],"Last 7 days":[K().subtract(6,"days"),K()],"Last 30 days":[K().subtract(29,"days"),K()],"This month":[K().startOf("month"),K().endOf("month")],"Last month":[K().subtract(1,"month").startOf("month"),K().subtract(1,"month").endOf("month")],"Reset date":[((l=e.dateReset)==null?void 0:l.startDate)??void 0,((d=e.dateReset)==null?void 0:d.endDate)??void 0]},alwaysShowCalendars:!0,startDate:(t==null?void 0:t.startDate)??void 0,endDate:(t==null?void 0:t.endDate)??void 0,opens:"left",maxDate:K(),...e.initialSettings},onApply:(f,h)=>{var u,x,_;const m=h.chosenLabel===nc,{startDate:y,endDate:b}=h,v=m?((u=e.dateReset)==null?void 0:u.startDate)??void 0:y.toDate(),c=m?((x=e.dateReset)==null?void 0:x.endDate)??void 0:b.toDate();r({startDate:v,endDate:c}),(_=e.onChange)==null||_.call(e,{startDate:v,endDate:c})},children:s.jsx(N.TextField,{inputRef:o,label:e.label??"Permit date",placeholder:"Select date range",value:n,InputLabelProps:{ref:i,shrink:!0},InputProps:{readOnly:!0,ref:a,endAdornment:s.jsx(rc,{onClick:()=>{var f;return(f=o.current)==null?void 0:f.focus()},width:24,height:24,color:"gray"})},fullWidth:!0,sx:{"& *":{cursor:"pointer"},display:"flex",justifyContent:"center",minWidth:"250px"}})})}function Yn(e){return s.jsx("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"#85858A",strokeWidth:"1.5"})})}function Gn(e){return s.jsxs("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M9 12L11 14L15 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ic(e){return s.jsx(N.Checkbox,{sx:{"& input:disabled ~ svg":{fill:"#ddd"}},color:"primary",icon:s.jsx(Yn,{fontSize:"small"}),checkedIcon:s.jsx(Gn,{fontSize:"small"}),style:{padding:0},...e})}const Kn=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const r=p.getMessagingInWindow(p.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));p.getToken(r,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async n=>{var o,i;if(n){console.log("current token for client: ",n);try{const a="/notification-management/api/v1/notifications/registrations",l=e.baseUrl+a;await Kt.post(l,{deviceToken:n},{withCredentials:!0})}catch(a){console.log(a),p.pushError(((i=(o=a.response)==null?void 0:o.data)==null?void 0:i.errorMessage)||"Have error when get notification list")}}else console.log("No registration token available. Request permission to generate one.")}).catch(n=>{console.log("An error occurred while retrieving token. ",n)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},ac=e=>{const t=new BroadcastChannel("my-channel");t.onmessage=r=>{console.log("Broadcast chanel message",r),r&&e(n=>({...n,unread:{...n.unread,total:n.unread.total+1}}))}},sc=e=>new Promise(t=>{const r=p.getMessagingInWindow(p.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));p.onMessage(r,n=>{console.log("payload",n),t(n)})}),cc=["granted","denied"],lc=e=>{const[t,r]=j.useState(!1),n=()=>{Notification.requestPermission(function(i){i==="granted"&&Kn(e),cc.includes(i)&&r(!0)})},o=()=>{r(!0)};return s.jsx(s.Fragment,{children:t?"":s.jsx("div",{className:p.styles$1["subscription-diaglog"],children:s.jsxs("div",{className:p.styles$1["subscription-container"],children:[s.jsx("h4",{className:p.styles$1["subscription-title"],children:"Notification"}),s.jsx("p",{className:p.styles$1["subscription-text"],children:"Choice to receive notifications for the most recent updates. You have the flexibility to disable them whenever you prefer."}),s.jsxs("div",{className:p.styles$1["subscription-btn__container"],children:[s.jsx("button",{className:p.styles$1["btn-cancel"],onClick:o,children:"Not now"}),s.jsx("button",{className:p.styles$1["btn-success"],onClick:n,children:"Turn on"})]})]})})})},Zn=e=>{const[t,r]=j.useState({userName:"",message:"",context:""});console.log(t);const{setNotiData:n}=j.useContext(p.CustomOpenList);function o(){return s.jsx("div",{className:p.styles$2["notification-massage_container"],children:s.jsxs("div",{className:p.styles$2["notification-massage_content"],children:[s.jsx("h6",{className:p.styles$2["notification-name"],children:t==null?void 0:t.userName}),s.jsxs("div",{className:p.styles$2["notification-message_service"],children:[s.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),s.jsx("span",{children:t==null?void 0:t.context})]})]})})}return j.useEffect(()=>{t&&Notification.permission==="granted"&&(t.userName||t.message||t.context)&&p.notify(s.jsx(o,{}))},[t]),j.useEffect(()=>{Notification.permission==="granted"&&Kn(e)},[Notification.permission]),j.useEffect(()=>{ac(n)},[]),sc(e).then(i=>{var a,l,d;console.log("aaa",i),r({userName:(a=i==null?void 0:i.data)==null?void 0:a.userName,message:(l=i==null?void 0:i.data)==null?void 0:l.message,context:(d=i==null?void 0:i.data)==null?void 0:d.context}),n(f=>{var h;return{...f,unread:{...f.unread,total:((h=f.unread)==null?void 0:h.total)+1}}})}).catch(i=>console.log("failed: ",i)),s.jsx("div",{children:"Notification"in window&&Notification.permission==="default"?s.jsx(lc,{...e}):""})},uc=(e,t)=>j.cloneElement(t,{},e),dc=({children:e,providers:t})=>s.jsx(s.Fragment,{children:t.reduceRight(uc,e)}),fc=({rootPath:e})=>{const{colors:t}=p.useTheme();return s.jsxs(N.Stack,{py:2,gap:2,style:{alignItems:"center"},children:[s.jsx("img",{width:120,height:120,src:"https://ukpcsaprod.blob.core.windows.net/lib/images/page-not-found.png",alt:""}),s.jsxs(N.Stack,{gap:1,children:[s.jsx(N.Typography,{variant:"h4",textAlign:"center",children:"Page Not Found"}),s.jsxs(N.Typography,{textAlign:"center",color:t.grey600,children:["We’re sorry. The page you requested could no be found. ",s.jsx("br",{}),"Please go back to the home page"]}),s.jsx(Xn.Link,{to:e,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},children:s.jsx(N.Button,{variant:"contained",color:"primary",children:"Go to homepage"})})]})]})};exports.GlobalMenu=p.GlobalMenu;exports.notify=p.notify;exports.pushError=p.pushError;exports.pushSuccess=p.pushSuccess;exports.pushWarning=p.pushWarning;exports.AutocompleteOption=Gt;exports.BaseCheckbox=ic;exports.CheckedIcon=Gn;exports.MultiProvider=dc;exports.NoData=po;exports.NotificationBase=Zn;exports.PageNotFound=fc;exports.PopUpBase=bo;exports.StyledAutocomplete=ec;exports.StyledDateRangePicker=oc;exports.ToastConfig=eo;exports.ToastConfigNotification=to;exports.TopBar=fo;exports.UnauthorizedPage=So;exports.UncheckedIcon=Yn;exports.usePopUp=_o;exports.useStyledAutocomplete=tc;
109
+ `))}y[v]={}}}};Object.keys(f.components).forEach(y=>{const b=f.components[y].styleOverrides;b&&y.indexOf("Mui")===0&&m(b,y)})}return f.unstable_sxConfig=p._extends({},Je,a==null?void 0:a.unstable_sxConfig),f.unstable_sx=function(m){return er({sx:m,theme:this})},f}const a0=i0(),Hn=a0,Wn="$$material";function s0({props:e,name:t}){return as({props:e,name:t,defaultTheme:Hn,themeId:Wn})}var et={};const c0=p.getAugmentedNamespace(p._extends$1),l0=p.getAugmentedNamespace(p.objectWithoutPropertiesLoose),u0=p.getAugmentedNamespace(ts),d0=p.getAugmentedNamespace(Eo),f0=p.getAugmentedNamespace($o),h0=p.getAugmentedNamespace(ko),m0=p.getAugmentedNamespace(Di),p0=p.getAugmentedNamespace(us);var ze=Rn;Object.defineProperty(et,"__esModule",{value:!0});var g0=et.default=$0,y0=et.shouldForwardProp=st;et.systemDefaultTheme=void 0;var te=ze(c0),Yt=ze(l0),Zr=j0(u0),v0=d0,x0=ze(f0),b0=ze(h0),_0=ze(m0),S0=ze(p0);const w0=["ownerState"],E0=["variants"],C0=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Un(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Un=function(n){return n?r:t})(e)}function j0(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Un(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}function T0(e){return Object.keys(e).length===0}function O0(e){return typeof e=="string"&&e.charCodeAt(0)>96}function st(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const N0=et.systemDefaultTheme=(0,_0.default)(),Xr=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function nt({defaultTheme:e,theme:t,themeId:r}){return T0(t)?e:t[r]||t}function k0(e){return e?(t,r)=>r[e]:null}function ct(e,t){let{ownerState:r}=t,n=(0,Yt.default)(t,w0);const o=typeof e=="function"?e((0,te.default)({ownerState:r},n)):e;if(Array.isArray(o))return o.flatMap(i=>ct(i,(0,te.default)({ownerState:r},n)));if(o&&typeof o=="object"&&Array.isArray(o.variants)){const{variants:i=[]}=o;let l=(0,Yt.default)(o,E0);return i.forEach(d=>{let f=!0;typeof d.props=="function"?f=d.props((0,te.default)({ownerState:r},n,r)):Object.keys(d.props).forEach(h=>{(r==null?void 0:r[h])!==d.props[h]&&n[h]!==d.props[h]&&(f=!1)}),f&&(Array.isArray(l)||(l=[l]),l.push(typeof d.style=="function"?d.style((0,te.default)({ownerState:r},n,r)):d.style))}),l}return o}function $0(e={}){const{themeId:t,defaultTheme:r=N0,rootShouldForwardProp:n=st,slotShouldForwardProp:o=st}=e,i=a=>(0,S0.default)((0,te.default)({},a,{theme:nt((0,te.default)({},a,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(a,l={})=>{(0,Zr.internal_processStyles)(a,g=>g.filter(w=>!(w!=null&&w.__mui_systemSx)));const{name:d,slot:f,skipVariantsResolver:h,skipSx:m,overridesResolver:y=k0(Xr(f))}=l,b=(0,Yt.default)(l,C0),v=h!==void 0?h:f&&f!=="Root"&&f!=="root"||!1,c=m||!1;let u;process.env.NODE_ENV!=="production"&&d&&(u=`${d}-${Xr(f||"Root")}`);let x=st;f==="Root"||f==="root"?x=n:f?x=o:O0(a)&&(x=void 0);const _=(0,Zr.default)(a,(0,te.default)({shouldForwardProp:x,label:u},b)),S=g=>typeof g=="function"&&g.__emotion_real!==g||(0,v0.isPlainObject)(g)?w=>ct(g,(0,te.default)({},w,{theme:nt({theme:w.theme,defaultTheme:r,themeId:t})})):g,C=(g,...w)=>{let E=S(g);const A=w?w.map(S):[];d&&y&&A.push(z=>{const W=nt((0,te.default)({},z,{defaultTheme:r,themeId:t}));if(!W.components||!W.components[d]||!W.components[d].styleOverrides)return null;const G=W.components[d].styleOverrides,ae={};return Object.entries(G).forEach(([pe,ge])=>{ae[pe]=ct(ge,(0,te.default)({},z,{theme:W}))}),y(z,ae)}),d&&!v&&A.push(z=>{var W;const G=nt((0,te.default)({},z,{defaultTheme:r,themeId:t})),ae=G==null||(W=G.components)==null||(W=W[d])==null?void 0:W.variants;return ct({variants:ae},(0,te.default)({},z,{theme:G}))}),c||A.push(i);const P=A.length-w.length;if(Array.isArray(g)&&P>0){const z=new Array(P).fill("");E=[...g,...z],E.raw=[...g.raw,...z]}const H=_(E,...A);if(process.env.NODE_ENV!=="production"){let z;d&&(z=`${d}${(0,x0.default)(f||"")}`),z===void 0&&(z=`Styled(${(0,b0.default)(a)})`),H.displayName=z}return a.muiName&&(H.muiName=a.muiName),H};return _.withConfig&&(C.withConfig=_.withConfig),C}}const A0=e=>y0(e)&&e!=="classes",P0=g0({themeId:Wn,defaultTheme:Hn,rootShouldForwardProp:A0}),I0=P0;function M0(e){return Xt("MuiSvgIcon",e)}Do("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const R0=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],D0=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${ve(t)}`,`fontSize${ve(r)}`]};return Ao(o,M0,n)},z0=I0("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${ve(r.color)}`],t[`fontSize${ve(r.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var r,n,o,i,a,l,d,f,h,m,y,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=e.transitions)==null||(n=r.create)==null?void 0:n.call(r,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((l=e.typography)==null||(d=l.pxToRem)==null?void 0:d.call(l,24))||"1.5rem",large:((f=e.typography)==null||(h=f.pxToRem)==null?void 0:h.call(f,35))||"2.1875rem"}[t.fontSize],color:(m=(y=(e.vars||e).palette)==null||(y=y[t.color])==null?void 0:y.main)!=null?m:{action:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.active,disabled:(v=(e.vars||e).palette)==null||(v=v.action)==null?void 0:v.disabled,inherit:void 0}[t.color]}}),hr=L.forwardRef(function(t,r){const n=s0({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:l="svg",fontSize:d="medium",htmlColor:f,inheritViewBox:h=!1,titleAccess:m,viewBox:y="0 0 24 24"}=n,b=p._objectWithoutPropertiesLoose(n,R0),v=L.isValidElement(o)&&o.type==="svg",c=p._extends({},n,{color:a,component:l,fontSize:d,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:y,hasSvgAsChild:v}),u={};h||(u.viewBox=y);const x=D0(c);return s.jsxs(z0,p._extends({as:l,className:p.clsx(x.root,i),focusable:"false",color:f,"aria-hidden":m?void 0:!0,role:m?"img":void 0,ref:r},u,b,v&&o.props,{ownerState:c,children:[v?o.props.children:o,m?s.jsx("title",{children:m}):null]}))});process.env.NODE_ENV!=="production"&&(hr.propTypes={children:p.PropTypes.node,classes:p.PropTypes.object,className:p.PropTypes.string,color:p.PropTypes.oneOfType([p.PropTypes.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),p.PropTypes.string]),component:p.PropTypes.elementType,fontSize:p.PropTypes.oneOfType([p.PropTypes.oneOf(["inherit","large","medium","small"]),p.PropTypes.string]),htmlColor:p.PropTypes.string,inheritViewBox:p.PropTypes.bool,shapeRendering:p.PropTypes.string,sx:p.PropTypes.oneOfType([p.PropTypes.arrayOf(p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.object,p.PropTypes.bool])),p.PropTypes.func,p.PropTypes.object]),titleAccess:p.PropTypes.string,viewBox:p.PropTypes.string});hr.muiName="SvgIcon";const Jr=hr;function L0(e,t){function r(n,o){return s.jsx(Jr,p._extends({"data-testid":`${t}Icon`,ref:o},n,{children:e}))}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=Jr.muiName,L.memo(L.forwardRef(r))}const F0=L0(s.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var Qr=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function V0(e,t){return!!(e===t||Qr(e)&&Qr(t))}function B0(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!V0(e[r],t[r]))return!1;return!0}function Lt(e,t){t===void 0&&(t=B0);var r,n=[],o,i=!1;function a(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return i&&r===this&&t(l,n)||(o=e.apply(this,l),i=!0,r=this,n=l),o}return a}var H0=typeof performance=="object"&&typeof performance.now=="function",en=H0?function(){return performance.now()}:function(){return Date.now()};function tn(e){cancelAnimationFrame(e.id)}function W0(e,t){var r=en();function n(){en()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Ft=-1;function rn(e){if(e===void 0&&(e=!1),Ft===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ft=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ft}var ke=null;function nn(e){if(e===void 0&&(e=!1),ke===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?ke="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?ke="negative":ke="positive-ascending"),document.body.removeChild(t),ke}return ke}process.env.NODE_ENV;var U0=150,q0=function(t,r){return t},lt=null,ut=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(lt=new WeakSet,ut=new WeakSet);function Y0(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,h=e.validateProps;return t=function(m){p._inheritsLoose(y,m);function y(v){var c;return c=m.call(this,v)||this,c._instanceProps=d(c.props,p._assertThisInitialized(c)),c._outerRef=void 0,c._resetIsScrollingTimeoutId=null,c.state={instance:p._assertThisInitialized(c),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof c.props.initialScrollOffset=="number"?c.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},c._callOnItemsRendered=void 0,c._callOnItemsRendered=Lt(function(u,x,_,S){return c.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:x,visibleStartIndex:_,visibleStopIndex:S})}),c._callOnScroll=void 0,c._callOnScroll=Lt(function(u,x,_){return c.props.onScroll({scrollDirection:u,scrollOffset:x,scrollUpdateWasRequested:_})}),c._getItemStyle=void 0,c._getItemStyle=function(u){var x=c.props,_=x.direction,S=x.itemSize,C=x.layout,g=c._getItemStyleCache(f&&S,f&&C,f&&_),w;if(g.hasOwnProperty(u))w=g[u];else{var E=r(c.props,u,c._instanceProps),A=o(c.props,u,c._instanceProps),P=_==="horizontal"||C==="horizontal",H=_==="rtl",z=P?E:0;g[u]=w={position:"absolute",left:H?void 0:z,right:H?z:void 0,top:P?0:E,height:P?"100%":A,width:P?A:"100%"}}return w},c._getItemStyleCache=void 0,c._getItemStyleCache=Lt(function(u,x,_){return{}}),c._onScrollHorizontal=function(u){var x=u.currentTarget,_=x.clientWidth,S=x.scrollLeft,C=x.scrollWidth;c.setState(function(g){if(g.scrollOffset===S)return null;var w=c.props.direction,E=S;if(w==="rtl")switch(nn()){case"negative":E=-S;break;case"positive-descending":E=C-_-S;break}return E=Math.max(0,Math.min(E,C-_)),{isScrolling:!0,scrollDirection:g.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._onScrollVertical=function(u){var x=u.currentTarget,_=x.clientHeight,S=x.scrollHeight,C=x.scrollTop;c.setState(function(g){if(g.scrollOffset===C)return null;var w=Math.max(0,Math.min(C,S-_));return{isScrolling:!0,scrollDirection:g.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(u){var x=c.props.outerRef;c._outerRef=u,typeof x=="function"?x(u):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=u)},c._resetIsScrollingDebounced=function(){c._resetIsScrollingTimeoutId!==null&&tn(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=W0(c._resetIsScrolling,U0)},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1,null)})},c}y.getDerivedStateFromProps=function(c,u){return G0(c,u),h(c),null};var b=y.prototype;return b.scrollTo=function(c){c=Math.max(0,c),this.setState(function(u){return u.scrollOffset===c?null:{scrollDirection:u.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},b.scrollToItem=function(c,u){u===void 0&&(u="auto");var x=this.props,_=x.itemCount,S=x.layout,C=this.state.scrollOffset;c=Math.max(0,Math.min(c,_-1));var g=0;if(this._outerRef){var w=this._outerRef;S==="vertical"?g=w.scrollWidth>w.clientWidth?rn():0:g=w.scrollHeight>w.clientHeight?rn():0}this.scrollTo(i(this.props,c,u,C,this._instanceProps,g))},b.componentDidMount=function(){var c=this.props,u=c.direction,x=c.initialScrollOffset,_=c.layout;if(typeof x=="number"&&this._outerRef!=null){var S=this._outerRef;u==="horizontal"||_==="horizontal"?S.scrollLeft=x:S.scrollTop=x}this._callPropsCallbacks()},b.componentDidUpdate=function(){var c=this.props,u=c.direction,x=c.layout,_=this.state,S=_.scrollOffset,C=_.scrollUpdateWasRequested;if(C&&this._outerRef!=null){var g=this._outerRef;if(u==="horizontal"||x==="horizontal")if(u==="rtl")switch(nn()){case"negative":g.scrollLeft=-S;break;case"positive-ascending":g.scrollLeft=S;break;default:var w=g.clientWidth,E=g.scrollWidth;g.scrollLeft=E-w-S;break}else g.scrollLeft=S;else g.scrollTop=S}this._callPropsCallbacks()},b.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&tn(this._resetIsScrollingTimeoutId)},b.render=function(){var c=this.props,u=c.children,x=c.className,_=c.direction,S=c.height,C=c.innerRef,g=c.innerElementType,w=c.innerTagName,E=c.itemCount,A=c.itemData,P=c.itemKey,H=P===void 0?q0:P,z=c.layout,W=c.outerElementType,G=c.outerTagName,ae=c.style,pe=c.useIsScrolling,ge=c.width,be=this.state.isScrolling,ue=_==="horizontal"||z==="horizontal",_e=ue?this._onScrollHorizontal:this._onScrollVertical,ye=this._getRangeToRender(),Le=ye[0],Fe=ye[1],Se=[];if(E>0)for(var de=Le;de<=Fe;de++)Se.push(j.createElement(u,{data:A,key:H(de,A),index:de,isScrolling:pe?be:void 0,style:this._getItemStyle(de)}));var we=n(this.props,this._instanceProps);return j.createElement(W||G||"div",{className:x,onScroll:_e,ref:this._outerRefSetter,style:p._extends({position:"relative",height:S,width:ge,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:_},ae)},j.createElement(g||w||"div",{children:Se,ref:C,style:{height:ue?"100%":we,pointerEvents:be?"none":void 0,width:ue?we:"100%"}}))},b._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var c=this.props.itemCount;if(c>0){var u=this._getRangeToRender(),x=u[0],_=u[1],S=u[2],C=u[3];this._callOnItemsRendered(x,_,S,C)}}if(typeof this.props.onScroll=="function"){var g=this.state,w=g.scrollDirection,E=g.scrollOffset,A=g.scrollUpdateWasRequested;this._callOnScroll(w,E,A)}},b._getRangeToRender=function(){var c=this.props,u=c.itemCount,x=c.overscanCount,_=this.state,S=_.isScrolling,C=_.scrollDirection,g=_.scrollOffset;if(u===0)return[0,0,0,0];var w=a(this.props,g,this._instanceProps),E=l(this.props,w,g,this._instanceProps),A=!S||C==="backward"?Math.max(1,x):1,P=!S||C==="forward"?Math.max(1,x):1;return[Math.max(0,w-A),Math.max(0,Math.min(u-1,E+P)),w,E]},y}(j.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var G0=function(t,r){var n=t.children,o=t.direction,i=t.height,a=t.layout,l=t.innerTagName,d=t.outerTagName,f=t.width,h=r.instance;if(process.env.NODE_ENV!=="production"){(l!=null||d!=null)&&ut&&!ut.has(h)&&(ut.add(h),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var m=o==="horizontal"||a==="horizontal";switch(o){case"horizontal":case"vertical":lt&&!lt.has(h)&&(lt.add(h),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(m&&typeof f!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(f===null?"null":typeof f)+'" was specified.'));if(!m&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},K0=50,$e=function(t,r,n){var o=t,i=o.itemSize,a=n.itemMetadataMap,l=n.lastMeasuredIndex;if(r>l){var d=0;if(l>=0){var f=a[l];d=f.offset+f.size}for(var h=l+1;h<=r;h++){var m=i(h);a[h]={offset:d,size:m},d+=m}n.lastMeasuredIndex=r}return a[r]},Z0=function(t,r,n){var o=r.itemMetadataMap,i=r.lastMeasuredIndex,a=i>0?o[i].offset:0;return a>=n?qn(t,r,i,0,n):X0(t,r,Math.max(0,i),n)},qn=function(t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),l=$e(t,a,r).offset;if(l===i)return a;l<i?o=a+1:l>i&&(n=a-1)}return o>0?o-1:0},X0=function(t,r,n,o){for(var i=t.itemCount,a=1;n<i&&$e(t,n,r).offset<o;)n+=a,a*=2;return qn(t,r,Math.min(n,i-1),Math.floor(n/2),o)},on=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,i=r.estimatedItemSize,a=r.lastMeasuredIndex,l=0;if(a>=n&&(a=n-1),a>=0){var d=o[a];l=d.offset+d.size}var f=n-a-1,h=f*i;return l+h},J0=Y0({getItemOffset:function(t,r,n){return $e(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:on,getOffsetForIndexAndAlignment:function(t,r,n,o,i,a){var l=t.direction,d=t.height,f=t.layout,h=t.width,m=l==="horizontal"||f==="horizontal",y=m?h:d,b=$e(t,r,i),v=on(t,i),c=Math.max(0,Math.min(v-y,b.offset)),u=Math.max(0,b.offset-y+b.size+a);switch(n==="smart"&&(o>=u-y&&o<=c+y?n="auto":n="center"),n){case"start":return c;case"end":return u;case"center":return Math.round(u+(c-u)/2);case"auto":default:return o>=u&&o<=c?o:o<u?u:c}},getStartIndexForOffset:function(t,r,n){return Z0(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var i=t.direction,a=t.height,l=t.itemCount,d=t.layout,f=t.width,h=i==="horizontal"||d==="horizontal",m=h?f:a,y=$e(t,r,o),b=n+m,v=y.offset+y.size,c=r;c<l-1&&v<b;)c++,v+=$e(t,c,o).size;return c},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:o||K0,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,l){l===void 0&&(l=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),l&&r.forceUpdate()},i},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function dt(e,t){return t?e:void 0}function Gt(e){const{colors:t}=p.useTheme();return s.jsx(N.Stack,{sx:{cursor:"pointer"},onClick:r=>{var n;r.preventDefault(),r.stopPropagation(),(n=e.onClick)==null||n.call(e,e.option)},...e.stackProps,children:s.jsx(N.Stack,{sx:{p:1,transition:"0.2s",borderRadius:"5px",cursor:"pointer",...dt({backgroundColor:t.primary200},e.select),":hover":{backgroundColor:"#eeeeee80",borderColor:"transparent"}},children:e.renderOption(e.option)})})}const gt=37,Q0=(e,t)=>{const a=document.createElement("p");a.innerText=t,a.style.width=`${e-16-16-4}px`,document.body.appendChild(a);const l=a.offsetHeight;return document.body.removeChild(a),l>21?gt+21:gt};function ec(e){const[t,r]=j.useState(!1),[n,o]=j.useState(""),[i,a]=j.useState(""),[l,d]=j.useState(!1),{isRequired:f=!1}=e,h=j.useCallback(p._.debounce(w=>{var E;(E=e.handleChangeSearch)==null||E.call(e,w)},300),[e.handleChangeSearch]),m=()=>{r(!t)},y=()=>{r(!1),a(""),h("")};j.useEffect(()=>{o(e.value?e.getOptionLabel(e.value):"")},[e.value]),j.useEffect(()=>{t||o(e.value?e.getOptionLabel(e.value):"")},[t]),j.useEffect(()=>{d(e.searchLoading)},[e.paging.rows,e.searchLoading]);const b=e.paging.rows,{hasNextPage:v}=e,c=v?b.length+1:b.length,u=()=>e.isNextPageLoading?void 0:e.loadNextPage(i),x=w=>!v||w<b.length,_=w=>{o(w.target.value),t&&(a(w.target.value),h(w.target.value),d(!0))},S=j.useRef(null),C=j.useRef(null),g=j.useRef(null);return j.useEffect(()=>{var w,E,A,P;t?((w=C.current)==null||w.classList.add("Mui-focused"),(E=g.current)==null||E.classList.add("Mui-focused")):((A=C.current)==null||A.classList.remove("Mui-focused"),(P=g.current)==null||P.classList.remove("Mui-focused"))},[t]),s.jsx(N.ClickAwayListener,{onClickAway:y,mouseEvent:"onMouseDown",touchEvent:"onTouchEnd",children:s.jsx("div",{ref:S,style:{width:e.wrapperWidth??"auto"},children:s.jsxs(N.Stack,{sx:{position:"relative"},children:[s.jsx(N.TextField,{required:f,label:e.label,value:n,disabled:e.loading||e.disabled||e.readOnly,fullWidth:!0,error:e.error,helperText:e.helperText,onFocus:w=>{e.loading||e.disabled||e.readOnly||(w.preventDefault(),w.stopPropagation(),r(!0))},autoComplete:"off",onChange:_,placeholder:e.placeholder||"All options",sx:{"& input:not(:focus)":{"&::placeholder":{color:e.placeHolderColor||"#C5C5C5",opacity:1}}},InputLabelProps:{ref:C,shrink:!0},InputProps:{readOnly:e.readOnly,ref:g,endAdornment:s.jsx(N.IconButton,{size:"small",sx:{padding:"1px"},onClick:w=>{var E;w.preventDefault(),w.stopPropagation(),m(),(E=S.current)==null||E.focus()},disabled:e.loading||e.disabled||e.readOnly,children:e.loading?s.jsx(N.CircularProgress,{size:"16px"}):s.jsx(F0,{fontSize:"small",style:{transition:"0.3s"},className:t?"rotate":""})})}}),s.jsx(N.Fade,{in:t,timeout:0,unmountOnExit:!1,children:s.jsxs(N.Paper,{sx:{position:"absolute",top:"calc(100% + 2px)",zIndex:2,left:0,right:0,p:1},children:[!e.disabledAllOption&&s.jsx(N.Stack,{sx:{...dt({display:"none"},!!l)},children:s.jsx(N.Stack,{children:s.jsx(Gt,{option:void 0,select:!e.value,renderOption:()=>s.jsx(N.Typography,{children:e.placeholder||"All options"}),onClick:()=>{var w,E;y(),(w=e.onChange)==null||w.call(e,void 0),(E=e.handleChangeSearch)==null||E.call(e,"")}})})}),!l&&s.jsx(p.InfiniteLoader,{isItemLoaded:x,itemCount:c,loadMoreItems:u,threshold:5,children:({onItemsRendered:w,ref:E})=>s.jsx(J0,{ref:E,onItemsRendered:w,height:gt*Math.min(e.itemsNumber||6,c),itemCount:c,itemSize:A=>{var P;return Q0((P=S.current)==null?void 0:P.offsetWidth,b[A]?e.getOptionLabel(b[A]):"")},width:"100%",className:"styled-scroll",children:({index:A,style:P})=>{var z;const H=b[A];return x(A)?s.jsx(Gt,{stackProps:{style:P},option:H,renderOption:W=>{var G;return s.jsxs(N.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(N.Typography,{children:e.getOptionLabel(W)}),(G=e.renderOptionTooltip)==null?void 0:G.call(e,W)]})},onClick:W=>{var G;y(),(G=e.onChange)==null||G.call(e,W)},select:((z=e.isEqual)==null?void 0:z.call(e,H,e.value))??p._.isEqual(H,e.value)}):s.jsx(N.Stack,{style:P,sx:{height:gt,pl:1},justifyContent:"center",children:s.jsx(N.Typography,{children:"Loading..."})})}})}),s.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...dt({display:"none"},!l)},children:s.jsx(N.Typography,{color:"grayText",children:"Searching..."})}),s.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...dt({display:"none"},!!(b.length||e.loading||l))},children:s.jsx(N.Typography,{color:"grayText",children:"No options"})})]})})]})})})}function tc(e){var h;const{listProps:t}=e,[r,n]=j.useState({initLoading:!e.disabled,searchLoading:!1,hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:((h=e.listProps)==null?void 0:h.pageSize)||20,rows:[],total:0,totalPages:1}}),o=async(m,y)=>{var b,v;if(e.list)n(()=>{var x;const c=((x=m==null?void 0:m.search)==null?void 0:x.content)||"";return{hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:1e5,rows:e.list.options.filter(_=>e.list.searchOption?e.list.searchOption(_,c):p.search(_,c,e.list.searchFields)),total:e.list.options.length,totalPages:1},searchLoading:!1,initLoading:!1}});else{n(c=>({...c,isNextPageLoading:!0}));try{const c={page:1,pageSize:20,filter:{...t==null?void 0:t.filter,...m==null?void 0:m.filter},...p.lodashExports.omit(t,"filter"),...p.lodashExports.omit(m,"filter"),search:{fields:((b=t==null?void 0:t.search)==null?void 0:b.fields)??[],content:((v=m==null?void 0:m.search)==null?void 0:v.content)??""}};y&&(c.filter={},c.search&&(c.search.content=""),c.page=1);const u=await e.getList(c);n(x=>({initLoading:!1,searchLoading:!1,isNextPageLoading:!1,paging:{...u,rows:(m==null?void 0:m.page)===1?u.rows:x.paging.rows.concat(u.rows)},hasNextPage:u.page<u.totalPages}))}catch{}}},i=()=>(n(m=>({...m,initLoading:!0})),o(void 0,!0)),a=m=>(n(y=>({...y,initLoading:!0})),o(m)),l=m=>{o({page:r.paging.page+1,search:{content:m}})},d=m=>{n(y=>({...y,searchLoading:!0})),o({page:1,search:{content:m}})};j.useEffect(()=>{e.disabled||(n(m=>({...m,initLoading:!0})),o({page:1}))},[...e.dependencyList||[]]);const f=()=>{n(m=>({...m,initLoading:!m.initLoading}))};return{...e,loadNextPage:l,handleChangeSearch:d,paging:r.paging,hasNextPage:r.hasNextPage,isNextPageLoading:r.isNextPageLoading,searchLoading:r.searchLoading,loading:e.loading||r.initLoading,getList:a,reset:i,toggleLoading:f}}function rc(e){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[s.jsx("path",{d:"M12 3.16663H3.99998C2.80336 3.16663 1.83331 4.13668 1.83331 5.33329V12C1.83331 13.1966 2.80336 14.1666 3.99998 14.1666H12C13.1966 14.1666 14.1666 13.1966 14.1666 12V5.33329C14.1666 4.13668 13.1966 3.16663 12 3.16663Z",stroke:"#85858A"}),s.jsx("path",{d:"M4.5 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M2.5 6.16663H13.5",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M11.8333 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),s.jsx("path",{d:"M5.5 9.33337C5.77614 9.33337 6 9.10952 6 8.83337C6 8.55723 5.77614 8.33337 5.5 8.33337C5.22386 8.33337 5 8.55723 5 8.83337C5 9.10952 5.22386 9.33337 5.5 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M8.16669 9.33337C8.44283 9.33337 8.66669 9.10952 8.66669 8.83337C8.66669 8.55723 8.44283 8.33337 8.16669 8.33337C7.89054 8.33337 7.66669 8.55723 7.66669 8.83337C7.66669 9.10952 7.89054 9.33337 8.16669 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M10.8333 9.33337C11.1095 9.33337 11.3333 9.10952 11.3333 8.83337C11.3333 8.55723 11.1095 8.33337 10.8333 8.33337C10.5572 8.33337 10.3333 8.55723 10.3333 8.83337C10.3333 9.10952 10.5572 9.33337 10.8333 9.33337Z",fill:"#85858A"}),s.jsx("path",{d:"M5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12Z",fill:"#85858A"}),s.jsx("path",{d:"M8.16669 12C8.44283 12 8.66669 11.7761 8.66669 11.5C8.66669 11.2239 8.44283 11 8.16669 11C7.89054 11 7.66669 11.2239 7.66669 11.5C7.66669 11.7761 7.89054 12 8.16669 12Z",fill:"#85858A"}),s.jsx("path",{d:"M10.8333 12C11.1095 12 11.3333 11.7761 11.3333 11.5C11.3333 11.2239 11.1095 11 10.8333 11C10.5572 11 10.3333 11.2239 10.3333 11.5C10.3333 11.7761 10.5572 12 10.8333 12Z",fill:"#85858A"})]})}const nc="Reset date";function oc(e){var l,d;const[t,r]=j.useState(e.value),n=!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":K(t==null?void 0:t.startDate).format("DD/MM/YYYY")+" ~ "+K(t==null?void 0:t.endDate).format("DD/MM/YYYY");j.useEffect(()=>{r(e.value)},[e.value]);const o=j.useRef(null),i=j.useRef(null),a=j.useRef(null);return console.log("inputRef",o),console.log("labelRef",i),s.jsx(p.DateRangePicker,{initialSettings:{autoApply:!0,ranges:{Today:[K(),K()],Yesterday:[K().subtract(1,"days"),K().subtract(1,"days")],"Last 7 days":[K().subtract(6,"days"),K()],"Last 30 days":[K().subtract(29,"days"),K()],"This month":[K().startOf("month"),K().endOf("month")],"Last month":[K().subtract(1,"month").startOf("month"),K().subtract(1,"month").endOf("month")],"Reset date":[((l=e.dateReset)==null?void 0:l.startDate)??void 0,((d=e.dateReset)==null?void 0:d.endDate)??void 0]},alwaysShowCalendars:!0,startDate:(t==null?void 0:t.startDate)??void 0,endDate:(t==null?void 0:t.endDate)??void 0,opens:"left",maxDate:K(),...e.initialSettings},onApply:(f,h)=>{var u,x,_;const m=h.chosenLabel===nc,{startDate:y,endDate:b}=h,v=m?((u=e.dateReset)==null?void 0:u.startDate)??void 0:y.toDate(),c=m?((x=e.dateReset)==null?void 0:x.endDate)??void 0:b.toDate();r({startDate:v,endDate:c}),(_=e.onChange)==null||_.call(e,{startDate:v,endDate:c})},children:s.jsx(N.TextField,{inputRef:o,label:e.label??"Permit date",placeholder:"Select date range",value:n,InputLabelProps:{ref:i,shrink:!0},InputProps:{readOnly:!0,ref:a,endAdornment:s.jsx(rc,{onClick:()=>{var f;return(f=o.current)==null?void 0:f.focus()},width:24,height:24,color:"gray"})},fullWidth:!0,sx:{"& *":{cursor:"pointer"},display:"flex",justifyContent:"center",minWidth:"250px"}})})}function Yn(e){return s.jsx("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"#85858A",strokeWidth:"1.5"})})}function Gn(e){return s.jsxs("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M9 12L11 14L15 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ic(e){return s.jsx(N.Checkbox,{sx:{"& input:disabled ~ svg":{fill:"#ddd"}},color:"primary",icon:s.jsx(Yn,{fontSize:"small"}),checkedIcon:s.jsx(Gn,{fontSize:"small"}),style:{padding:0},...e})}const Kn=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const r=p.getMessagingInWindow(p.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));p.getToken(r,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async n=>{var o,i;if(n){console.log("current token for client: ",n);try{const a="/notification-management/api/v1/notifications/registrations",l=e.baseUrl+a;await Kt.post(l,{deviceToken:n},{withCredentials:!0})}catch(a){console.log(a),p.pushError(((i=(o=a.response)==null?void 0:o.data)==null?void 0:i.errorMessage)||"Have error when get notification list")}}else console.log("No registration token available. Request permission to generate one.")}).catch(n=>{console.log("An error occurred while retrieving token. ",n)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},ac=e=>{const t=new BroadcastChannel("my-channel");t.onmessage=r=>{console.log("Broadcast chanel message",r),r&&e(n=>({...n,unread:{...n.unread,total:n.unread.total+1}}))}},sc=e=>new Promise(t=>{const r=p.getMessagingInWindow(p.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));p.onMessage(r,n=>{console.log("payload",n),t(n)})}),cc=["granted","denied"],lc=e=>{const[t,r]=j.useState(!1),n=()=>{Notification.requestPermission(function(i){i==="granted"&&Kn(e),cc.includes(i)&&r(!0)})},o=()=>{r(!0)};return s.jsx(s.Fragment,{children:t?"":s.jsx("div",{className:p.styles$1["subscription-diaglog"],children:s.jsxs("div",{className:p.styles$1["subscription-container"],children:[s.jsx("h4",{className:p.styles$1["subscription-title"],children:"Notification"}),s.jsx("p",{className:p.styles$1["subscription-text"],children:"Choice to receive notifications for the most recent updates. You have the flexibility to disable them whenever you prefer."}),s.jsxs("div",{className:p.styles$1["subscription-btn__container"],children:[s.jsx("button",{className:p.styles$1["btn-cancel"],onClick:o,children:"Not now"}),s.jsx("button",{className:p.styles$1["btn-success"],onClick:n,children:"Turn on"})]})]})})})},Zn=e=>{const[t,r]=j.useState({userName:"",message:"",context:""});console.log(t);const{setNotiData:n}=j.useContext(p.CustomOpenList);function o(){return s.jsx("div",{className:p.styles$2["notification-massage_container"],children:s.jsxs("div",{className:p.styles$2["notification-massage_content"],children:[s.jsx("h6",{className:p.styles$2["notification-name"],children:t==null?void 0:t.userName}),s.jsxs("div",{className:p.styles$2["notification-message_service"],children:[s.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),s.jsx("span",{children:t==null?void 0:t.context})]})]})})}return j.useEffect(()=>{t&&Notification.permission==="granted"&&(t.userName||t.message||t.context)&&p.notify(s.jsx(o,{}))},[t]),j.useEffect(()=>{Notification.permission==="granted"&&Kn(e)},[Notification.permission]),j.useEffect(()=>{ac(n)},[]),sc(e).then(i=>{var a,l,d;console.log("aaa",i),r({userName:(a=i==null?void 0:i.data)==null?void 0:a.userName,message:(l=i==null?void 0:i.data)==null?void 0:l.message,context:(d=i==null?void 0:i.data)==null?void 0:d.context}),n(f=>{var h;return{...f,unread:{...f.unread,total:((h=f.unread)==null?void 0:h.total)+1}}})}).catch(i=>console.log("failed: ",i)),s.jsx("div",{children:"Notification"in window&&Notification.permission==="default"?s.jsx(lc,{...e}):""})},uc=(e,t)=>j.cloneElement(t,{},e),dc=({children:e,providers:t})=>s.jsx(s.Fragment,{children:t.reduceRight(uc,e)}),fc=({rootPath:e})=>{const{colors:t}=p.useTheme();return s.jsxs(N.Stack,{py:2,gap:2,style:{alignItems:"center"},children:[s.jsx("img",{width:120,height:120,src:"https://ukpcsaprod.blob.core.windows.net/lib/images/page-not-found.png",alt:""}),s.jsxs(N.Stack,{gap:1,children:[s.jsx(N.Typography,{variant:"h4",textAlign:"center",children:"Page Not Found"}),s.jsxs(N.Typography,{textAlign:"center",color:t.grey600,children:["We’re sorry. The page you requested could no be found. ",s.jsx("br",{}),"Please go back to the home page"]}),s.jsx(Xn.Link,{to:e,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},children:s.jsx(N.Button,{variant:"primary",style:{maxWidth:"200px",width:"100%"},children:"Go to homepage"})})]})]})};exports.GlobalMenu=p.GlobalMenu;exports.notify=p.notify;exports.pushError=p.pushError;exports.pushSuccess=p.pushSuccess;exports.pushWarning=p.pushWarning;exports.AutocompleteOption=Gt;exports.BaseCheckbox=ic;exports.CheckedIcon=Gn;exports.MultiProvider=dc;exports.NoData=po;exports.NotificationBase=Zn;exports.PageNotFound=fc;exports.PopUpBase=bo;exports.StyledAutocomplete=ec;exports.StyledDateRangePicker=oc;exports.ToastConfig=eo;exports.ToastConfigNotification=to;exports.TopBar=fo;exports.UnauthorizedPage=So;exports.UncheckedIcon=Yn;exports.usePopUp=_o;exports.useStyledAutocomplete=tc;
@@ -6330,7 +6330,14 @@ const So = (e) => {
6330
6330
  alignItems: "center",
6331
6331
  justifyContent: "center"
6332
6332
  },
6333
- children: /* @__PURE__ */ c(ir, { variant: "contained", color: "primary", children: "Go to homepage" })
6333
+ children: /* @__PURE__ */ c(
6334
+ ir,
6335
+ {
6336
+ variant: "primary",
6337
+ style: { maxWidth: "200px", width: "100%" },
6338
+ children: "Go to homepage"
6339
+ }
6340
+ )
6334
6341
  }
6335
6342
  )
6336
6343
  ] })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.3.28",
4
+ "version": "0.3.29",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",