@ukpc-lib/react 0.4.13 → 0.4.14

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),j=require("react"),p=require("../index.module-08215ba2.cjs"),K=require("moment"),N=require("@mui/material");require("@r2wc/react-to-web-component");require("axios");const on=require("react-router-dom");require("react-query");function Jn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const F=Jn(j),Qn=e=>{var n,o;const{tabs:t}=e,r=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),a.jsxs(a.Fragment,{children:[a.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),j=require("react"),p=require("../index.module-14cb5e9e.cjs"),K=require("moment"),N=require("@mui/material");require("@r2wc/react-to-web-component");require("axios");const on=require("react-router-dom");require("react-query");function Jn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const F=Jn(j),Qn=e=>{var n,o;const{tabs:t}=e,r=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),a.jsxs(a.Fragment,{children:[a.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as N, Fragment as Ie, jsx as c } from "react/jsx-runtime";
2
2
  import * as L from "react";
3
3
  import ge, { useState as G, useContext as _e, useEffect as Q, useRef as xe, useCallback as xt, forwardRef as Oo, createElement as rr, PureComponent as No } from "react";
4
- import { c as Te, a as Rt, C as ke, p as To, u as ko, S as $o, b as Io, L as Ao, d as Pr, e as Mo, Q as $n, f as pt, g as Po, s as gt, _ as z, h as we, P as k, i as he, j as Ro, o as Do, k as zo, l as Fo, m as Rr, n as In, q as _t, r as Dr, I as Lo, t as jo, v as zr, D as Vo, w as An, x as Mn, y as Bo, z as Ho, A as Ne, B as Uo, E as yt } from "../index.module-b1444b6b.js";
5
- import { G as Rc, F as Dc, H as zc } from "../index.module-b1444b6b.js";
4
+ import { c as Te, a as Rt, C as ke, p as To, u as ko, S as $o, b as Io, L as Ao, d as Pr, e as Mo, Q as $n, f as pt, g as Po, s as gt, _ as z, h as we, P as k, i as he, j as Ro, o as Do, k as zo, l as Fo, m as Rr, n as In, q as _t, r as Dr, I as Lo, t as jo, v as zr, D as Vo, w as An, x as Mn, y as Bo, z as Ho, A as Ne, B as Uo, E as yt } from "../index.module-27c42962.js";
5
+ import { G as Rc, F as Dc, H as zc } from "../index.module-27c42962.js";
6
6
  import Z from "moment";
7
7
  import { Stack as te, Dialog as Wo, DialogTitle as qo, Typography as ye, DialogContent as Yo, DialogActions as Go, Button as kt, Box as Ko, ClickAwayListener as Zo, TextField as Pn, IconButton as Xo, CircularProgress as Jo, Fade as Qo, Paper as ei, Checkbox as ti } from "@mui/material";
8
8
  import "@r2wc/react-to-web-component";
@@ -26,7 +26,7 @@ object-assign
26
26
  (c) Sindre Sorhus
27
27
  @license MIT
28
28
  */var Th,uy;function dD(){if(uy)return Th;uy=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var u={},g=0;g<10;g++)u["_"+String.fromCharCode(g)]=g;var p=Object.getOwnPropertyNames(u).map(function(T){return u[T]});if(p.join("")!=="0123456789")return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(T){y[T]=T}),Object.keys(Object.assign({},y)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Th=i()?Object.assign:function(s,u){for(var g,p=r(s),y,T=1;T<arguments.length;T++){g=Object(arguments[T]);for(var x in g)e.call(g,x)&&(p[x]=g[x]);if(t){y=t(g);for(var A=0;A<y.length;A++)n.call(g,y[A])&&(p[y[A]]=g[y[A]])}}return p},Th}var Eh,cy;function Gp(){if(cy)return Eh;cy=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Eh=t,Eh}var kh,fy;function lw(){return fy||(fy=1,kh=Function.call.bind(Object.prototype.hasOwnProperty)),kh}var _h,dy;function hD(){if(dy)return _h;dy=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Gp(),n={},r=lw();t=function(s){var u="Warning: "+s;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function i(s,u,g,p,y){if(process.env.NODE_ENV!=="production"){for(var T in s)if(r(s,T)){var x;try{if(typeof s[T]!="function"){var A=Error((p||"React class")+": "+g+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}x=s[T](u,T,p,g,null,e)}catch($){x=$}if(x&&!(x instanceof Error)&&t((p||"React class")+": type specification of "+g+" `"+T+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof x+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),x instanceof Error&&!(x.message in n)){n[x.message]=!0;var j=y?y():"";t("Failed "+g+" type: "+x.message+(j??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},_h=i,_h}var Ph,hy;function pD(){if(hy)return Ph;hy=1;var t=sw(),e=dD(),n=Gp(),r=lw(),i=hD(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(g){var p="Warning: "+g;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function u(){return null}return Ph=function(g,p){var y=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function x(Pe){var _e=Pe&&(y&&Pe[y]||Pe[T]);if(typeof _e=="function")return _e}var A="<<anonymous>>",j={array:L("array"),bigint:L("bigint"),bool:L("boolean"),func:L("function"),number:L("number"),object:L("object"),string:L("string"),symbol:L("symbol"),any:ne(),arrayOf:te,element:he(),elementType:ie(),instanceOf:xe,node:Qe(),objectOf:Re,oneOf:b,oneOfType:me,shape:tt,exact:rt};function $(Pe,_e){return Pe===_e?Pe!==0||1/Pe===1/_e:Pe!==Pe&&_e!==_e}function Y(Pe,_e){this.message=Pe,this.data=_e&&typeof _e=="object"?_e:{},this.stack=""}Y.prototype=Error.prototype;function z(Pe){if(process.env.NODE_ENV!=="production")var _e={},Ve=0;function Xe(Je,Ze,ht,bt,wt,pt,Tt){if(bt=bt||A,pt=pt||ht,Tt!==n){if(p){var Ke=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Ke.name="Invariant Violation",Ke}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Bt=bt+":"+ht;!_e[Bt]&&Ve<3&&(s("You are manually calling a React.PropTypes validation function for the `"+pt+"` prop on `"+bt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_e[Bt]=!0,Ve++)}}return Ze[ht]==null?Je?Ze[ht]===null?new Y("The "+wt+" `"+pt+"` is marked as required "+("in `"+bt+"`, but its value is `null`.")):new Y("The "+wt+" `"+pt+"` is marked as required in "+("`"+bt+"`, but its value is `undefined`.")):null:Pe(Ze,ht,bt,wt,pt)}var et=Xe.bind(null,!1);return et.isRequired=Xe.bind(null,!0),et}function L(Pe){function _e(Ve,Xe,et,Je,Ze,ht){var bt=Ve[Xe],wt=Me(bt);if(wt!==Pe){var pt=ze(bt);return new Y("Invalid "+Je+" `"+Ze+"` of type "+("`"+pt+"` supplied to `"+et+"`, expected ")+("`"+Pe+"`."),{expectedType:Pe})}return null}return z(_e)}function ne(){return z(u)}function te(Pe){function _e(Ve,Xe,et,Je,Ze){if(typeof Pe!="function")return new Y("Property `"+Ze+"` of component `"+et+"` has invalid PropType notation inside arrayOf.");var ht=Ve[Xe];if(!Array.isArray(ht)){var bt=Me(ht);return new Y("Invalid "+Je+" `"+Ze+"` of type "+("`"+bt+"` supplied to `"+et+"`, expected an array."))}for(var wt=0;wt<ht.length;wt++){var pt=Pe(ht,wt,et,Je,Ze+"["+wt+"]",n);if(pt instanceof Error)return pt}return null}return z(_e)}function he(){function Pe(_e,Ve,Xe,et,Je){var Ze=_e[Ve];if(!g(Ze)){var ht=Me(Ze);return new Y("Invalid "+et+" `"+Je+"` of type "+("`"+ht+"` supplied to `"+Xe+"`, expected a single ReactElement."))}return null}return z(Pe)}function ie(){function Pe(_e,Ve,Xe,et,Je){var Ze=_e[Ve];if(!t.isValidElementType(Ze)){var ht=Me(Ze);return new Y("Invalid "+et+" `"+Je+"` of type "+("`"+ht+"` supplied to `"+Xe+"`, expected a single ReactElement type."))}return null}return z(Pe)}function xe(Pe){function _e(Ve,Xe,et,Je,Ze){if(!(Ve[Xe]instanceof Pe)){var ht=Pe.name||A,bt=ot(Ve[Xe]);return new Y("Invalid "+Je+" `"+Ze+"` of type "+("`"+bt+"` supplied to `"+et+"`, expected ")+("instance of `"+ht+"`."))}return null}return z(_e)}function b(Pe){if(!Array.isArray(Pe))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),u;function _e(Ve,Xe,et,Je,Ze){for(var ht=Ve[Xe],bt=0;bt<Pe.length;bt++)if($(ht,Pe[bt]))return null;var wt=JSON.stringify(Pe,function(Tt,Ke){var Bt=ze(Ke);return Bt==="symbol"?String(Ke):Ke});return new Y("Invalid "+Je+" `"+Ze+"` of value `"+String(ht)+"` "+("supplied to `"+et+"`, expected one of "+wt+"."))}return z(_e)}function Re(Pe){function _e(Ve,Xe,et,Je,Ze){if(typeof Pe!="function")return new Y("Property `"+Ze+"` of component `"+et+"` has invalid PropType notation inside objectOf.");var ht=Ve[Xe],bt=Me(ht);if(bt!=="object")return new Y("Invalid "+Je+" `"+Ze+"` of type "+("`"+bt+"` supplied to `"+et+"`, expected an object."));for(var wt in ht)if(r(ht,wt)){var pt=Pe(ht,wt,et,Je,Ze+"."+wt,n);if(pt instanceof Error)return pt}return null}return z(_e)}function me(Pe){if(!Array.isArray(Pe))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var _e=0;_e<Pe.length;_e++){var Ve=Pe[_e];if(typeof Ve!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+qe(Ve)+" at index "+_e+"."),u}function Xe(et,Je,Ze,ht,bt){for(var wt=[],pt=0;pt<Pe.length;pt++){var Tt=Pe[pt],Ke=Tt(et,Je,Ze,ht,bt,n);if(Ke==null)return null;Ke.data&&r(Ke.data,"expectedType")&&wt.push(Ke.data.expectedType)}var Bt=wt.length>0?", expected one of type ["+wt.join(", ")+"]":"";return new Y("Invalid "+ht+" `"+bt+"` supplied to "+("`"+Ze+"`"+Bt+"."))}return z(Xe)}function Qe(){function Pe(_e,Ve,Xe,et,Je){return ft(_e[Ve])?null:new Y("Invalid "+et+" `"+Je+"` supplied to "+("`"+Xe+"`, expected a ReactNode."))}return z(Pe)}function xt(Pe,_e,Ve,Xe,et){return new Y((Pe||"React class")+": "+_e+" type `"+Ve+"."+Xe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+et+"`.")}function tt(Pe){function _e(Ve,Xe,et,Je,Ze){var ht=Ve[Xe],bt=Me(ht);if(bt!=="object")return new Y("Invalid "+Je+" `"+Ze+"` of type `"+bt+"` "+("supplied to `"+et+"`, expected `object`."));for(var wt in Pe){var pt=Pe[wt];if(typeof pt!="function")return xt(et,Je,Ze,wt,ze(pt));var Tt=pt(ht,wt,et,Je,Ze+"."+wt,n);if(Tt)return Tt}return null}return z(_e)}function rt(Pe){function _e(Ve,Xe,et,Je,Ze){var ht=Ve[Xe],bt=Me(ht);if(bt!=="object")return new Y("Invalid "+Je+" `"+Ze+"` of type `"+bt+"` "+("supplied to `"+et+"`, expected `object`."));var wt=e({},Ve[Xe],Pe);for(var pt in wt){var Tt=Pe[pt];if(r(Pe,pt)&&typeof Tt!="function")return xt(et,Je,Ze,pt,ze(Tt));if(!Tt)return new Y("Invalid "+Je+" `"+Ze+"` key `"+pt+"` supplied to `"+et+"`.\nBad object: "+JSON.stringify(Ve[Xe],null," ")+`
29
- Valid keys: `+JSON.stringify(Object.keys(Pe),null," "));var Ke=Tt(ht,pt,et,Je,Ze+"."+pt,n);if(Ke)return Ke}return null}return z(_e)}function ft(Pe){switch(typeof Pe){case"number":case"string":case"undefined":return!0;case"boolean":return!Pe;case"object":if(Array.isArray(Pe))return Pe.every(ft);if(Pe===null||g(Pe))return!0;var _e=x(Pe);if(_e){var Ve=_e.call(Pe),Xe;if(_e!==Pe.entries){for(;!(Xe=Ve.next()).done;)if(!ft(Xe.value))return!1}else for(;!(Xe=Ve.next()).done;){var et=Xe.value;if(et&&!ft(et[1]))return!1}}else return!1;return!0;default:return!1}}function ve(Pe,_e){return Pe==="symbol"?!0:_e?_e["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_e instanceof Symbol:!1}function Me(Pe){var _e=typeof Pe;return Array.isArray(Pe)?"array":Pe instanceof RegExp?"object":ve(_e,Pe)?"symbol":_e}function ze(Pe){if(typeof Pe>"u"||Pe===null)return""+Pe;var _e=Me(Pe);if(_e==="object"){if(Pe instanceof Date)return"date";if(Pe instanceof RegExp)return"regexp"}return _e}function qe(Pe){var _e=ze(Pe);switch(_e){case"array":case"object":return"an "+_e;case"boolean":case"date":case"regexp":return"a "+_e;default:return _e}}function ot(Pe){return!Pe.constructor||!Pe.constructor.name?A:Pe.constructor.name}return j.checkPropTypes=i,j.resetWarningCache=i.resetWarningCache,j.PropTypes=j,j},Ph}var Rh,py;function gD(){if(py)return Rh;py=1;var t=Gp();function e(){}function n(){}return n.resetWarningCache=e,Rh=function(){function r(u,g,p,y,T,x){if(x!==t){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},Rh}if(process.env.NODE_ENV!=="production"){var mD=sw(),vD=!0;lp.exports=pD()(mD.isElement,vD)}else lp.exports=gD()();var xr=lp.exports;const da=cf(xr);var yD=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},bD=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},wD=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Nf="http://www.w3.org/2000/svg",gy="http://www.w3.org/1999/xlink",qp=function(t){iw(e,t);function e(){for(var r,i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];return r=t.call.apply(t,[this].concat(s))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(g){r.reactWrapper=g},r}var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof yD(this.reactWrapper).Node){var s=this.props,u=s.desc,g=s.evalScripts,p=s.httpRequestWithCredentials,y=s.renumerateIRIElements,T=s.src,x=s.title,A=s.useRequestCache,j=this.props.onError,$=this.props.beforeInjection,Y=this.props.afterInjection,z=this.props.wrapper,L,ne;z==="svg"?(L=document.createElementNS(Nf,z),L.setAttribute("xmlns",Nf),L.setAttribute("xmlns:xlink",gy),ne=document.createElementNS(Nf,z)):(L=document.createElement(z),ne=document.createElement(z)),L.appendChild(ne),ne.dataset.src=T,this.nonReactWrapper=this.reactWrapper.appendChild(L);var te=function(b){if(i.removeSVG(),!i._isMounted){j(b);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){j(b)})},he=function(b,Re){if(b){te(b);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{Y(Re)}catch(me){te(me)}})},ie=function(b){if(b.setAttribute("role","img"),u){var Re=b.querySelector(":scope > desc");Re&&b.removeChild(Re);var me=document.createElement("desc");me.innerHTML=u,b.prepend(me)}if(x){var Qe=b.querySelector(":scope > title");Qe&&b.removeChild(Qe);var xt=document.createElement("title");xt.innerHTML=x,b.prepend(xt)}try{$(b)}catch(tt){te(tt)}};uD(ne,{afterEach:he,beforeEach:ie,cacheRequests:A,evalScripts:g,httpRequestWithCredentials:p,renumerateIRIElements:y})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var s=this;bD(kc({},i),this.props)&&this.setState(function(){return s.initialState},function(){s.removeSVG(),s.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var s=i.fallback;i.httpRequestWithCredentials;var u=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var g=i.wrapper,p=Sp(i,wD),y=g;return kn.createElement(y,kc({},p,{ref:this.refCallback},g==="svg"?{xmlns:Nf,xmlnsXlink:gy}:{}),this.state.isLoading&&u&&kn.createElement(u,null),this.state.hasError&&s&&kn.createElement(s,null))},e}(kn.Component);qp.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};qp.propTypes={afterInjection:xr.func,beforeInjection:xr.func,desc:xr.string,evalScripts:xr.oneOf(["always","once","never"]),fallback:xr.oneOfType([xr.func,xr.object,xr.string]),httpRequestWithCredentials:xr.bool,loading:xr.oneOfType([xr.func,xr.object,xr.string]),onError:xr.func,renumerateIRIElements:xr.bool,src:xr.string.isRequired,title:xr.string,useRequestCache:xr.bool,wrapper:xr.oneOf(["div","span","svg"])};function xD(t){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:it.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function SD(t){const{renderChildren:e,parentRef:n,onlyChild:r}=t,[i,s]=ke.useState({top:0,left:0}),u=ke.useRef(null),[g,p]=ke.useState("auto");return ke.useLayoutEffect(()=>{if(n.current&&u.current){const y=n.current.getBoundingClientRect(),T=u.current.getBoundingClientRect();let x=y.top;const A=y.left+y.width,j=T.height+(window.innerHeight-y.top)>window.innerHeight;j&&(console.log("overtop"),p(window.innerHeight-y.top-50)),y.top+T.height>window.innerHeight&&!j&&(x=y.top-T.height+y.height),s({top:x,left:A})}},[n,u]),r?e({maxHeight:g}):Uy.createPortal(it.jsx("div",{ref:u,style:{position:"fixed",top:i.top,left:i.left,zIndex:1200},children:e({maxHeight:g})}),n.current)}function CD(t){const{children:e,title:n,hasTooltip:r}=t,i=ke.useRef(),[s,u]=ke.useState(!1),[g,p]=ke.useState({top:0,left:0});return it.jsxs("div",{className:"tooltip-item__wrapper",onMouseOver:()=>{if(u(!0),i.current){const y=i.current.getBoundingClientRect();p({top:y.top-20,left:y.left})}},onMouseLeave:()=>u(!1),ref:i,children:[it.jsx("div",{children:e}),s&&r&&it.jsx("div",{className:"tooltip-item__content",style:{position:"fixed",background:"#85858A",borderRadius:"4px",color:"#fff",padding:"4px 8px",top:g.top,left:g.left,zIndex:1400,fontSize:"10px",transition:"all 0.2s ease-in-out",animation:"fadeIn 0.2s ease-in-out",pointerEvents:"none"},children:n})]})}function uw(t,e){return e?t:void 0}function TD(t){return md({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463 192H315.9L271.2 58.6C269 52.1 262.9 48 256 48s-13 4.1-15.2 10.6L196.1 192H48c-8.8 0-16 7.2-16 16 0 .9.1 1.9.3 2.7.2 3.5 1.8 7.4 6.7 11.3l120.9 85.2-46.4 134.9c-2.3 6.5 0 13.8 5.5 18 2.9 2.1 5.6 3.9 9 3.9 3.3 0 7.2-1.7 10-3.6l118-84.1 118 84.1c2.8 2 6.7 3.6 10 3.6 3.4 0 6.1-1.7 8.9-3.9 5.6-4.2 7.8-11.4 5.5-18L352 307.2l119.9-86 2.9-2.5c2.6-2.8 5.2-6.6 5.2-10.7 0-8.8-8.2-16-17-16zm-127.2 92.5c-10 7.2-14.2 20.2-10.2 31.8l30.1 87.7c1.3 3.7-2.9 6.8-6.1 4.6l-77.4-55.2c-4.9-3.5-10.6-5.2-16.3-5.2-5.7 0-11.4 1.7-16.2 5.2l-77.4 55.1c-3.2 2.3-7.4-.9-6.1-4.6l30.1-87.7c4-11.8-.2-24.8-10.3-32l-81-57.1c-3.2-2.2-1.6-7.3 2.3-7.3H196c12 0 22.7-7.7 26.5-19.1l29.6-88.2c1.2-3.6 6.4-3.6 7.6 0l29.6 88.2c3.8 11.4 14.5 19.1 26.5 19.1h97.3c3.9 0 5.5 5 2.3 7.2l-79.6 57.5z"},child:[]}]})(t)}function ED(t){return md({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 372.686L380.83 448l-33.021-142.066L458 210.409l-145.267-12.475L256 64l-56.743 133.934L54 210.409l110.192 95.525L131.161 448z"},child:[]}]})(t)}function cw({item:t,level:e=0,...n}){var Me,ze,qe,ot,Pe;const{isActive:r,isCollapsed:i,expanded:s,toggleExpand:u}=n,g=`level-${e}`,p=i?"collapsed":"expanded",y=r(t.id)?"active":"",T=(_e,Ve=g)=>`${_e} ${Ve} ${p} ${y}`,x=!!((Me=t.children)!=null&&Me.length),[A,j]=ke.useState(!1),[$,Y]=ke.useState(t.isFavorite||!1),z=ke.useRef(),L=ke.useRef(),ne=(L==null?void 0:L.current)&&((ze=L==null?void 0:L.current)==null?void 0:ze.scrollWidth)>((qe=L==null?void 0:L.current)==null?void 0:qe.clientWidth),te=window.location.origin,he=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},ie=window.location.pathname.split("/")[1],xe=he.pathname.split("/")[1],b=n.ssr||!te.includes("local")&&te!==he.origin||xe!==ie,Re=x||e===0?"div":b?"a":Hy.Link,me=t.path||"#",Qe=e+1,xt=x&&!(i&&Qe>=2&&!A),tt=i||e===0?void 0:`${e}rem`,rt=()=>{j(!0)},ft=()=>{j(!1)},ve="/global-menu-config/api/v1/menu-items/user/set-favorite";return it.jsxs("div",{ref:z,className:T("menu-item__wrapper"),onMouseOver:rt,onMouseOut:ft,children:[it.jsx(CD,{hasTooltip:ne||i&&e===1,children:it.jsxs(Re,{to:me,href:me,className:T("menu-item__link"),style:{paddingLeft:tt,transition:"all 0.3s",color:r(t.id)?((ot=n.brandColors)==null?void 0:ot.primary400)||Zi.primary400:void 0,backgroundColor:r(t.id)&&e===1?(Pe=n.brandColors)==null?void 0:Pe.primary200:void 0},onClick:_e=>{x&&(_e.preventDefault(),i||u(t.id))},children:[(!i||e!==0)&&it.jsx(kD,{cls:T,item:t}),it.jsx("span",{className:T("menu-item__label"),ref:L,children:t.name}),it.jsx(_D,{menuLevel:e,hasChildren:x,isHovered:A,isFavorite:$,onClick:_e=>{var Xe,et;const Ve={menuConfigId:t.id,isFavorite:_e};try{const Je=n.baseUrl+ve;el.post(Je,Ve).then(Ze=>{Y(_e),Fb("Set favorite menu item successfully")})}catch(Je){bd(((et=(Xe=Je.response)==null?void 0:Xe.data)==null?void 0:et.errorMessage)||"Have error when set favorite menu item")}}}),x&&it.jsx("div",{className:T("menu-item__icon-arrow__wrapper"),children:it.jsx(xD,{className:T(`menu-item__icon-arrow__icon ${s(t.id)?"open":"close"}`)})})]}),title:t.name}),xt&&it.jsx(SD,{parentRef:z,onlyChild:!i||i&&Qe<2,renderChildren:({maxHeight:_e})=>{var Ve;return it.jsx(XO.div,{className:T(`menu-item__dropdown ${s(t.id)?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${Qe}`),initial:{height:i||s(t.id)?"auto":0},animate:{height:i||s(t.id)?"auto":0},transition:{duration:.25},style:uw({maxHeight:_e,overflowY:"auto",paddingRight:3},_e!=="auto"&&!!Qe),children:(Ve=t.children)==null?void 0:Ve.map(Xe=>ke.createElement(cw,{...n,key:Xe.id,item:Xe,level:Qe}))})}})]})}function kD({item:t,cls:e}){var u,g;const[n,r]=ke.useState(!t.icon),i=()=>{r(!0)},s=(u=t.icon)==null?void 0:u.endsWith(".svg");return it.jsx("div",{className:e("menu-item__icon"),children:n?it.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center"},children:(g=t.name.trim().at(0))==null?void 0:g.toUpperCase()}):s?it.jsx(qp,{src:t.icon,beforeInjection:p=>{p.setAttribute("style","margin: 0 auto;"),p.querySelectorAll("path").forEach(T=>{T.hasAttribute("fill")&&T.setAttribute("fill","currentColor"),T.hasAttribute("stroke")&&T.setAttribute("stroke","currentColor")})}}):it.jsx("img",{src:t.icon||"/",alt:" ",style:{height:24,maxHeight:24},onError:i})})}function _D(t){const e={marginRight:t.hasChildren?10:0,fontSize:24,fill:Zi.warning};if(t.menuLevel!==0)return it.jsxs(it.Fragment,{children:[t.isHovered&&!t.isFavorite&&it.jsx(TD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}}),t.isFavorite&&it.jsx(ED,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})]})}function PD(){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:it.jsx("path",{d:"M21 18v2H3v-2h18zM6.596 3.903L8.01 5.318 4.828 8.5 8.01 11.68l-1.414 1.415L2 8.5l4.596-4.597zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"})})}function RD(){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:it.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function AD(t){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...t,children:it.jsx("path",{fill:"#E01B00",fillRule:"evenodd",d:"M.179 2.875A2.375 2.375 0 012.554.5h3.393a1.018 1.018 0 010 2.036H2.554a.34.34 0 00-.34.339v14.25c0 .187.152.34.34.34h3.393a1.018 1.018 0 110 2.035H2.554a2.375 2.375 0 01-2.375-2.375V2.875zm14.167 6.107h-7.72a1.018 1.018 0 000 2.036h7.72l-2.673 2.673a1.018 1.018 0 101.44 1.44l4.41-4.411a1.018 1.018 0 000-1.44l-4.41-4.41a1.018 1.018 0 10-1.44 1.439l2.673 2.673z",clipRule:"evenodd"})})}const OD=`.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;background-color:initial}.side-bar__logout-btn:hover{background-color:#919eab14}.side-bar__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer;color:#85858a}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-1{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.level-0{height:37px}.menu-item__link.menu-item__link.collapsed.level-0{padding:0;height:0;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.collapsed.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1.collapsed{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label.collapsed{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.collapsed.level-0,.menu-item__label.collapsed.level-1{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;margin-left:8px}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__wrapper.level-0.collapsed{display:none}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown.collapsed{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:180px;max-width:180px;padding:4px;z-index:1200}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.collapsed .menu-item__link{height:40px}.menu-item__dropdown.collapsed .menu-item__link.level-1{height:48px}.menu-item__dropdown.collapsed.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.side-bar__menu.collapsed .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
29
+ Valid keys: `+JSON.stringify(Object.keys(Pe),null," "));var Ke=Tt(ht,pt,et,Je,Ze+"."+pt,n);if(Ke)return Ke}return null}return z(_e)}function ft(Pe){switch(typeof Pe){case"number":case"string":case"undefined":return!0;case"boolean":return!Pe;case"object":if(Array.isArray(Pe))return Pe.every(ft);if(Pe===null||g(Pe))return!0;var _e=x(Pe);if(_e){var Ve=_e.call(Pe),Xe;if(_e!==Pe.entries){for(;!(Xe=Ve.next()).done;)if(!ft(Xe.value))return!1}else for(;!(Xe=Ve.next()).done;){var et=Xe.value;if(et&&!ft(et[1]))return!1}}else return!1;return!0;default:return!1}}function ve(Pe,_e){return Pe==="symbol"?!0:_e?_e["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_e instanceof Symbol:!1}function Me(Pe){var _e=typeof Pe;return Array.isArray(Pe)?"array":Pe instanceof RegExp?"object":ve(_e,Pe)?"symbol":_e}function ze(Pe){if(typeof Pe>"u"||Pe===null)return""+Pe;var _e=Me(Pe);if(_e==="object"){if(Pe instanceof Date)return"date";if(Pe instanceof RegExp)return"regexp"}return _e}function qe(Pe){var _e=ze(Pe);switch(_e){case"array":case"object":return"an "+_e;case"boolean":case"date":case"regexp":return"a "+_e;default:return _e}}function ot(Pe){return!Pe.constructor||!Pe.constructor.name?A:Pe.constructor.name}return j.checkPropTypes=i,j.resetWarningCache=i.resetWarningCache,j.PropTypes=j,j},Ph}var Rh,py;function gD(){if(py)return Rh;py=1;var t=Gp();function e(){}function n(){}return n.resetWarningCache=e,Rh=function(){function r(u,g,p,y,T,x){if(x!==t){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},Rh}if(process.env.NODE_ENV!=="production"){var mD=sw(),vD=!0;lp.exports=pD()(mD.isElement,vD)}else lp.exports=gD()();var xr=lp.exports;const da=cf(xr);var yD=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},bD=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},wD=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Nf="http://www.w3.org/2000/svg",gy="http://www.w3.org/1999/xlink",qp=function(t){iw(e,t);function e(){for(var r,i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];return r=t.call.apply(t,[this].concat(s))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(g){r.reactWrapper=g},r}var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof yD(this.reactWrapper).Node){var s=this.props,u=s.desc,g=s.evalScripts,p=s.httpRequestWithCredentials,y=s.renumerateIRIElements,T=s.src,x=s.title,A=s.useRequestCache,j=this.props.onError,$=this.props.beforeInjection,Y=this.props.afterInjection,z=this.props.wrapper,L,ne;z==="svg"?(L=document.createElementNS(Nf,z),L.setAttribute("xmlns",Nf),L.setAttribute("xmlns:xlink",gy),ne=document.createElementNS(Nf,z)):(L=document.createElement(z),ne=document.createElement(z)),L.appendChild(ne),ne.dataset.src=T,this.nonReactWrapper=this.reactWrapper.appendChild(L);var te=function(b){if(i.removeSVG(),!i._isMounted){j(b);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){j(b)})},he=function(b,Re){if(b){te(b);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{Y(Re)}catch(me){te(me)}})},ie=function(b){if(b.setAttribute("role","img"),u){var Re=b.querySelector(":scope > desc");Re&&b.removeChild(Re);var me=document.createElement("desc");me.innerHTML=u,b.prepend(me)}if(x){var Qe=b.querySelector(":scope > title");Qe&&b.removeChild(Qe);var xt=document.createElement("title");xt.innerHTML=x,b.prepend(xt)}try{$(b)}catch(tt){te(tt)}};uD(ne,{afterEach:he,beforeEach:ie,cacheRequests:A,evalScripts:g,httpRequestWithCredentials:p,renumerateIRIElements:y})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var s=this;bD(kc({},i),this.props)&&this.setState(function(){return s.initialState},function(){s.removeSVG(),s.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var s=i.fallback;i.httpRequestWithCredentials;var u=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var g=i.wrapper,p=Sp(i,wD),y=g;return kn.createElement(y,kc({},p,{ref:this.refCallback},g==="svg"?{xmlns:Nf,xmlnsXlink:gy}:{}),this.state.isLoading&&u&&kn.createElement(u,null),this.state.hasError&&s&&kn.createElement(s,null))},e}(kn.Component);qp.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};qp.propTypes={afterInjection:xr.func,beforeInjection:xr.func,desc:xr.string,evalScripts:xr.oneOf(["always","once","never"]),fallback:xr.oneOfType([xr.func,xr.object,xr.string]),httpRequestWithCredentials:xr.bool,loading:xr.oneOfType([xr.func,xr.object,xr.string]),onError:xr.func,renumerateIRIElements:xr.bool,src:xr.string.isRequired,title:xr.string,useRequestCache:xr.bool,wrapper:xr.oneOf(["div","span","svg"])};function xD(t){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:it.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function SD(t){const{renderChildren:e,parentRef:n,onlyChild:r}=t,[i,s]=ke.useState({top:0,left:0}),u=ke.useRef(null),[g,p]=ke.useState("auto");return ke.useLayoutEffect(()=>{if(n.current&&u.current){const y=n.current.getBoundingClientRect(),T=u.current.getBoundingClientRect();let x=y.top;const A=y.left+y.width,j=T.height+(window.innerHeight-y.top)>window.innerHeight;j&&(console.log("overtop"),p(window.innerHeight-y.top-50)),y.top+T.height>window.innerHeight&&!j&&(x=y.top-T.height+y.height),s({top:x,left:A})}},[n,u]),r?e({maxHeight:g}):Uy.createPortal(it.jsx("div",{ref:u,style:{position:"fixed",top:i.top,left:i.left,zIndex:1200},children:e({maxHeight:g})}),n.current)}function CD(t){const{children:e,title:n,hasTooltip:r}=t,i=ke.useRef(),[s,u]=ke.useState(!1),[g,p]=ke.useState({top:0,left:0});return it.jsxs("div",{className:"tooltip-item__wrapper",onMouseOver:()=>{if(u(!0),i.current){const y=i.current.getBoundingClientRect();p({top:y.top-20,left:y.left})}},onMouseLeave:()=>u(!1),ref:i,children:[it.jsx("div",{children:e}),s&&r&&it.jsx("div",{className:"tooltip-item__content",style:{position:"fixed",background:"#85858A",borderRadius:"4px",color:"#fff",padding:"4px 8px",top:g.top,left:g.left,zIndex:1400,fontSize:"10px",transition:"all 0.2s ease-in-out",animation:"fadeIn 0.2s ease-in-out",pointerEvents:"none"},children:n})]})}function uw(t,e){return e?t:void 0}function TD(t){return md({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463 192H315.9L271.2 58.6C269 52.1 262.9 48 256 48s-13 4.1-15.2 10.6L196.1 192H48c-8.8 0-16 7.2-16 16 0 .9.1 1.9.3 2.7.2 3.5 1.8 7.4 6.7 11.3l120.9 85.2-46.4 134.9c-2.3 6.5 0 13.8 5.5 18 2.9 2.1 5.6 3.9 9 3.9 3.3 0 7.2-1.7 10-3.6l118-84.1 118 84.1c2.8 2 6.7 3.6 10 3.6 3.4 0 6.1-1.7 8.9-3.9 5.6-4.2 7.8-11.4 5.5-18L352 307.2l119.9-86 2.9-2.5c2.6-2.8 5.2-6.6 5.2-10.7 0-8.8-8.2-16-17-16zm-127.2 92.5c-10 7.2-14.2 20.2-10.2 31.8l30.1 87.7c1.3 3.7-2.9 6.8-6.1 4.6l-77.4-55.2c-4.9-3.5-10.6-5.2-16.3-5.2-5.7 0-11.4 1.7-16.2 5.2l-77.4 55.1c-3.2 2.3-7.4-.9-6.1-4.6l30.1-87.7c4-11.8-.2-24.8-10.3-32l-81-57.1c-3.2-2.2-1.6-7.3 2.3-7.3H196c12 0 22.7-7.7 26.5-19.1l29.6-88.2c1.2-3.6 6.4-3.6 7.6 0l29.6 88.2c3.8 11.4 14.5 19.1 26.5 19.1h97.3c3.9 0 5.5 5 2.3 7.2l-79.6 57.5z"},child:[]}]})(t)}function ED(t){return md({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 372.686L380.83 448l-33.021-142.066L458 210.409l-145.267-12.475L256 64l-56.743 133.934L54 210.409l110.192 95.525L131.161 448z"},child:[]}]})(t)}function cw({item:t,level:e=0,...n}){var Me,ze,qe,ot,Pe;const{isActive:r,isCollapsed:i,expanded:s,toggleExpand:u}=n,g=`level-${e}`,p=i?"collapsed":"expanded",y=r(t.id)?"active":"",T=(_e,Ve=g)=>`${_e} ${Ve} ${p} ${y}`,x=!!((Me=t.children)!=null&&Me.length),[A,j]=ke.useState(!1),[$,Y]=ke.useState(t.isFavorite||!1),z=ke.useRef(),L=ke.useRef(),ne=(L==null?void 0:L.current)&&((ze=L==null?void 0:L.current)==null?void 0:ze.scrollWidth)>((qe=L==null?void 0:L.current)==null?void 0:qe.clientWidth),te=window.location.origin,he=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},ie=window.location.pathname.split("/")[1],xe=he.pathname.split("/")[1],b=n.ssr||!te.includes("local")&&te!==he.origin||xe!==ie,Re=x||e===0?"div":b?"a":Hy.Link,me=t.path||"#",Qe=e+1,xt=x&&!(i&&Qe>=2&&!A),tt=i||e===0?void 0:`${e}rem`,rt=()=>{j(!0)},ft=()=>{j(!1)},ve="/global-menu-config/api/v1/menu-items/user/set-favorite";return it.jsxs("div",{ref:z,className:T("menu-item__wrapper"),onMouseOver:rt,onMouseOut:ft,children:[it.jsx(CD,{hasTooltip:ne||i&&e===1,children:it.jsxs(Re,{to:me,href:me,className:T("menu-item__link"),style:{paddingLeft:tt,transition:"all 0.3s",color:r(t.id)?((ot=n.brandColors)==null?void 0:ot.primary400)||Zi.primary400:void 0,backgroundColor:r(t.id)&&e===1?(Pe=n.brandColors)==null?void 0:Pe.primary200:void 0},onClick:_e=>{x&&(_e.preventDefault(),i||u(t.id))},children:[(!i||e!==0)&&it.jsx(kD,{cls:T,item:t}),it.jsx("span",{className:T("menu-item__label"),ref:L,children:t.name}),it.jsx(_D,{menuLevel:e,hasChildren:x,isHovered:A,isFavorite:$,onClick:_e=>{var Xe,et;const Ve={menuConfigId:t.id,isFavorite:_e};try{const Je=n.baseUrl+ve;el.post(Je,Ve).then(Ze=>{Y(_e),Fb("Set favorite menu item successfully")})}catch(Je){bd(((et=(Xe=Je.response)==null?void 0:Xe.data)==null?void 0:et.errorMessage)||"Have error when set favorite menu item")}}}),x&&it.jsx("div",{className:T("menu-item__icon-arrow__wrapper"),children:it.jsx(xD,{className:T(`menu-item__icon-arrow__icon ${s(t.id)?"open":"close"}`)})})]}),title:t.serviceKey==="mn_poms"?"Parking operative management":t.name}),xt&&it.jsx(SD,{parentRef:z,onlyChild:!i||i&&Qe<2,renderChildren:({maxHeight:_e})=>{var Ve;return it.jsx(XO.div,{className:T(`menu-item__dropdown ${s(t.id)?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${Qe}`),initial:{height:i||s(t.id)?"auto":0},animate:{height:i||s(t.id)?"auto":0},transition:{duration:.25},style:uw({maxHeight:_e,overflowY:"auto",paddingRight:3},_e!=="auto"&&!!Qe),children:(Ve=t.children)==null?void 0:Ve.map(Xe=>ke.createElement(cw,{...n,key:Xe.id,item:Xe,level:Qe}))})}})]})}function kD({item:t,cls:e}){var u,g;const[n,r]=ke.useState(!t.icon),i=()=>{r(!0)},s=(u=t.icon)==null?void 0:u.endsWith(".svg");return it.jsx("div",{className:e("menu-item__icon"),children:n?it.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center"},children:(g=t.name.trim().at(0))==null?void 0:g.toUpperCase()}):s?it.jsx(qp,{src:t.icon,beforeInjection:p=>{p.setAttribute("style","margin: 0 auto;"),p.querySelectorAll("path").forEach(T=>{T.hasAttribute("fill")&&T.setAttribute("fill","currentColor"),T.hasAttribute("stroke")&&T.setAttribute("stroke","currentColor")})}}):it.jsx("img",{src:t.icon||"/",alt:" ",style:{height:24,maxHeight:24},onError:i})})}function _D(t){const e={marginRight:t.hasChildren?10:0,fontSize:24,fill:Zi.warning};if(t.menuLevel!==0)return it.jsxs(it.Fragment,{children:[t.isHovered&&!t.isFavorite&&it.jsx(TD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}}),t.isFavorite&&it.jsx(ED,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})]})}function PD(){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:it.jsx("path",{d:"M21 18v2H3v-2h18zM6.596 3.903L8.01 5.318 4.828 8.5 8.01 11.68l-1.414 1.415L2 8.5l4.596-4.597zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"})})}function RD(){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:it.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function AD(t){return it.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...t,children:it.jsx("path",{fill:"#E01B00",fillRule:"evenodd",d:"M.179 2.875A2.375 2.375 0 012.554.5h3.393a1.018 1.018 0 010 2.036H2.554a.34.34 0 00-.34.339v14.25c0 .187.152.34.34.34h3.393a1.018 1.018 0 110 2.035H2.554a2.375 2.375 0 01-2.375-2.375V2.875zm14.167 6.107h-7.72a1.018 1.018 0 000 2.036h7.72l-2.673 2.673a1.018 1.018 0 101.44 1.44l4.41-4.411a1.018 1.018 0 000-1.44l-4.41-4.41a1.018 1.018 0 10-1.44 1.439l2.673 2.673z",clipRule:"evenodd"})})}const OD=`.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;background-color:initial}.side-bar__logout-btn:hover{background-color:#919eab14}.side-bar__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer;color:#85858a}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-1{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.level-0{height:37px}.menu-item__link.menu-item__link.collapsed.level-0{padding:0;height:0;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.collapsed.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1.collapsed{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label.collapsed{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.collapsed.level-0,.menu-item__label.collapsed.level-1{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;margin-left:8px}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__wrapper.level-0.collapsed{display:none}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown.collapsed{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:180px;max-width:180px;padding:4px;z-index:1200}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.collapsed .menu-item__link{height:40px}.menu-item__dropdown.collapsed .menu-item__link.level-1{height:48px}.menu-item__dropdown.collapsed.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.side-bar__menu.collapsed .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
30
30
  `;var Au={};/**
31
31
  * @license React
32
32
  * react-dom-server-legacy.browser.production.min.js
@@ -10781,7 +10781,7 @@ function cw({ item: t, level: e = 0, ...n }) {
10781
10781
  ]
10782
10782
  }
10783
10783
  ),
10784
- title: t.name
10784
+ title: t.serviceKey === "mn_poms" ? "Parking operative management" : t.name
10785
10785
  }
10786
10786
  ),
10787
10787
  bt && /* @__PURE__ */ wt(
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-08215ba2.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-14cb5e9e.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
@@ -1,4 +1,4 @@
1
- import { J as R, K as S, M as G, Z as y, X as H, a as I, c as M, Y as N, R as O, N as j, O as w, T as F, t as J, V as K, U, u as V, e as X, n as Y, W as Z } from "../index.module-b1444b6b.js";
1
+ import { J as R, K as S, M as G, Z as y, X as H, a as I, c as M, Y as N, R as O, N as j, O as w, T as F, t as J, V as K, U, u as V, e as X, n as Y, W as Z } from "../index.module-27c42962.js";
2
2
  import u from "axios";
3
3
  import { useState as m, useEffect as c } from "react";
4
4
  import { jsx as a, Fragment as n } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.4.13",
4
+ "version": "0.4.14",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../index-a8aaf6f3.js";
2
- import { G as e } from "../index-8a707ed5.js";
2
+ import { G as e } from "../index-a35bdd97.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-a8aaf6f3.js";
2
- import { T as a } from "../index-8a707ed5.js";
2
+ import { T as a } from "../index-a35bdd97.js";
3
3
  export {
4
4
  a as TopBar
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-a8aaf6f3.js";
2
- import { H as o, g as r } from "../index-8a707ed5.js";
2
+ import { H as o, g as r } from "../index-a35bdd97.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission
@@ -28108,7 +28108,7 @@ function yD({ item: e, level: t = 0, ...n }) {
28108
28108
  ]
28109
28109
  }
28110
28110
  ),
28111
- title: e.name
28111
+ title: e.serviceKey === "mn_poms" ? "Parking operative management" : e.name
28112
28112
  }
28113
28113
  ),
28114
28114
  Oe && /* @__PURE__ */ W.jsx(