@ukpc-lib/react 0.3.38 → 0.3.40

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../index.module-880ac584.cjs"),c=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("moment");require("@mui/material");const l=require("react-router-dom"),m=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{c.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>n(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[r]),t},a=r=>(t,n)=>{const e=m(r);return n?t.every(o=>e==null?void 0:e.includes(o)):t.some(o=>e==null?void 0:e.includes(o))},P=({baseUrl:r,accessWith:t,requireAll:n,children:e})=>a(r)(t,n)?i.jsx(i.Fragment,{children:e}):null,h=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:e,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:e,replace:!0});exports.AuthProvider=s.AuthProvider;exports.SaasThemeProvider=s.SaasThemeProvider;exports.TranslationProvider=s.TranslationProvider;exports.color=s.color;exports.createCustomTheme=s.createCustomTheme;exports.getAxiosInstance=s.getAxiosInstance;exports.search=s.search;exports.translate=s.translate;exports.translationConfig=s.translationConfig;exports.useAuth=s.useAuth;exports.useCustomTranslation=s.useCustomTranslation;exports.useTheme=s.useTheme;exports.useTranslation=s.useTranslation$1;exports.HasPermission=P;exports.PermissionRoute=h;exports.getUseHasPermission=a;exports.useGetPermission=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../index.module-542d8ee5.cjs"),c=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("moment");require("@mui/material");const l=require("react-router-dom"),m=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{c.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>n(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[r]),t},a=r=>(t,n)=>{const e=m(r);return n?t.every(o=>e==null?void 0:e.includes(o)):t.some(o=>e==null?void 0:e.includes(o))},P=({baseUrl:r,accessWith:t,requireAll:n,children:e})=>a(r)(t,n)?i.jsx(i.Fragment,{children:e}):null,h=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:e,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:e,replace:!0});exports.AuthProvider=s.AuthProvider;exports.SaasThemeProvider=s.SaasThemeProvider;exports.TranslationProvider=s.TranslationProvider;exports.color=s.color;exports.createCustomTheme=s.createCustomTheme;exports.getAxiosInstance=s.getAxiosInstance;exports.search=s.search;exports.translate=s.translate;exports.translationConfig=s.translationConfig;exports.useAuth=s.useAuth;exports.useCustomTranslation=s.useCustomTranslation;exports.useTheme=s.useTheme;exports.useTranslation=s.useTranslation$1;exports.HasPermission=P;exports.PermissionRoute=h;exports.getUseHasPermission=a;exports.useGetPermission=m;
@@ -1,4 +1,4 @@
1
- import { H as G, U as N, T as R, c as S, R as j, K as w, r as E, N as F, M as I, J, d as K, m as M, O } from "../index.module-f5d39f55.js";
1
+ import { H as G, U as N, T as R, c as S, R as j, K as w, r as E, N as F, M as I, J, d as K, m as M, O } from "../index.module-0fdf0c6d.js";
2
2
  import m from "axios";
3
3
  import { useState as u, useEffect as c } from "react";
4
4
  import { jsx as n, Fragment as a } 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.3.38",
4
+ "version": "0.3.40",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-e820d563.cjs");exports.GlobalMenu=e.GlobalMenu;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-6c2bc04a.cjs");exports.GlobalMenu=e.GlobalMenu;
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import { G as e } from "../index-cd31e4a8.js";
2
+ import { G as e } from "../index-f9a0dd02.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-e820d563.cjs");const e=require("../index-e1e6639e.cjs");require("../index-4327002b.cjs");exports.TopBar=e.TopBar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");require("../index-6c2bc04a.cjs");const e=require("../index-f36127fe.cjs");require("../index-4327002b.cjs");exports.TopBar=e.TopBar;
@@ -1,6 +1,6 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import "../index-cd31e4a8.js";
3
- import { T as i } from "../index-b2dc9480.js";
2
+ import "../index-f9a0dd02.js";
3
+ import { T as i } from "../index-31298961.js";
4
4
  import "../index-b3659f2e.js";
5
5
  export {
6
6
  i as TopBar
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-e1e6639e.cjs");require("../index-e820d563.cjs");require("../index-4327002b.cjs");exports.HasPermission=e.HasPermission;exports.getUseHasPermission=e.getUseHasPermission;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../react-to-web-component-3847ebf5.cjs");const e=require("../index-f36127fe.cjs");require("../index-6c2bc04a.cjs");require("../index-4327002b.cjs");exports.HasPermission=e.HasPermission;exports.getUseHasPermission=e.getUseHasPermission;
@@ -1,6 +1,6 @@
1
1
  import "../react-to-web-component-469d91d4.js";
2
- import { H as e, g as t } from "../index-b2dc9480.js";
3
- import "../index-cd31e4a8.js";
2
+ import { H as e, g as t } from "../index-31298961.js";
3
+ import "../index-f9a0dd02.js";
4
4
  import "../index-b3659f2e.js";
5
5
  export {
6
6
  e as HasPermission,
@@ -1,5 +1,5 @@
1
1
  import { j as z, r as Q, R as Qp, g as _r, a as Js, c as pa, b as Ox, d as Ix, s as tm } from "./react-to-web-component-469d91d4.js";
2
- import { c as Bi, _ as $e, a as nr, b as Rx, o as Px, d as Nx, e as ho, p as po, n as Lx, l as eg, E as $x, S as Fx, L as Yx } from "./index-cd31e4a8.js";
2
+ import { c as Bi, _ as $e, a as nr, b as Rx, o as Px, d as Nx, e as ho, p as po, n as Lx, l as eg, E as $x, S as Fx, L as Yx } from "./index-f9a0dd02.js";
3
3
  import { _ as Bx, t as Wx, I as jx, i as Hx, L as Lf } from "./index-b3659f2e.js";
4
4
  function nm(e) {
5
5
  var t, r, a = "";
@@ -64,4 +64,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  * Copyright(c) 2015 Douglas Christopher Wilson
65
65
  * MIT Licensed
66
66
  */var wl=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Rb=/\\([\u000b\u0020-\u00ff])/g,Ab=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Ob=_b;function _b(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Mb(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=n!==-1?t.slice(0,n).trim():t.trim();if(!Ab.test(r))throw new TypeError("invalid media type");var i=new jb(r.toLowerCase());if(n!==-1){var o,s,a;for(wl.lastIndex=n;s=wl.exec(t);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,o=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(Rb,"$1"))),i.parameters[o]=a}if(n!==t.length)throw new TypeError("invalid parameter format")}return i}function Mb(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function jb(e){this.parameters=Object.create(null),this.type=e}var Rt=new Map,Gf=function(t){return t.cloneNode(!0)},Sl=function(){return window.location.protocol==="file:"},Xf=function(t,n,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&i.readyState===2){var o=i.getResponseHeader("Content-Type");if(!o)throw new Error("Content type not found");var s=Ob(o).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(i.readyState===4){if(i.status===404||i.responseXML===null)throw new Error(Sl()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(i.status===200||Sl()&&i.status===0)r(null,i);else throw new Error("There was a problem injecting the SVG: "+i.status+" "+i.statusText)}}catch(a){if(i.abort(),a instanceof Error)r(a,i);else throw a}},i.open("GET",t),i.withCredentials=n,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()},et={},El=function(t,n){et[t]=et[t]||[],et[t].push(n)},Vb=function(t){for(var n=function(s,a){setTimeout(function(){if(Array.isArray(et[t])){var l=Rt.get(t),u=et[t][s];l instanceof SVGSVGElement&&u(null,Gf(l)),l instanceof Error&&u(l),s===et[t].length-1&&delete et[t]}},0)},r=0,i=et[t].length;r<i;r++)n(r)},Fb=function(t,n,r){if(Rt.has(t)){var i=Rt.get(t);if(i===void 0){El(t,r);return}if(i instanceof SVGSVGElement){r(null,Gf(i));return}}Rt.set(t,void 0),El(t,r),Xf(t,n,function(o,s){var a;o?Rt.set(t,o):((a=s.responseXML)===null||a===void 0?void 0:a.documentElement)instanceof SVGSVGElement&&Rt.set(t,s.responseXML.documentElement),Vb(t)})},Lb=function(t,n,r){Xf(t,n,function(i,o){var s;i?r(i):((s=o.responseXML)===null||s===void 0?void 0:s.documentElement)instanceof SVGSVGElement&&r(null,o.responseXML.documentElement)})},Db=0,Ib=function(){return++Db},Re=[],Cl={},Nb="http://www.w3.org/2000/svg",wi="http://www.w3.org/1999/xlink",kl=function(t,n,r,i,o,s,a){var l=t.getAttribute("data-src")||t.getAttribute("src");if(!l){a(new Error("Invalid data-src or src attribute"));return}if(Re.indexOf(t)!==-1){Re.splice(Re.indexOf(t),1),t=null;return}Re.push(t),t.setAttribute("src","");var u=i?Fb:Lb;u(l,o,function(f,c){if(!c){Re.splice(Re.indexOf(t),1),t=null,a(f);return}var d=t.getAttribute("id");d&&c.setAttribute("id",d);var h=t.getAttribute("title");h&&c.setAttribute("title",h);var p=t.getAttribute("width");p&&c.setAttribute("width",p);var g=t.getAttribute("height");g&&c.setAttribute("height",g);var y=Array.from(new Set(bi(bi(bi([],(c.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(t.getAttribute("class")||"").split(" "),!0))).join(" ").trim();c.setAttribute("class",y);var v=t.getAttribute("style");v&&c.setAttribute("style",v),c.setAttribute("data-src",l);var b=[].filter.call(t.attributes,function($){return/^data-\w[\w-]*$/.test($.name)});if(Array.prototype.forEach.call(b,function($){$.name&&$.value&&c.setAttribute($.name,$.value)}),r){var x={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,E,k,P,T;Object.keys(x).forEach(function($){S=$,k=x[$],E=c.querySelectorAll(S+"[id]");for(var he=function(Et,Wr){P=E[Et].id,T=P+"-"+Ib();var lt;Array.prototype.forEach.call(k,function(Ur){lt=c.querySelectorAll("["+Ur+'*="'+P+'"]');for(var En=0,ed=lt.length;En<ed;En++){var Qo=lt[En].getAttribute(Ur);Qo&&!Qo.match(new RegExp('url\\("?#'+P+'"?\\)'))||lt[En].setAttribute(Ur,"url(#"+T+")")}});for(var De=c.querySelectorAll("[*|href]"),Ct=[],kt=0,Wt=De.length;kt<Wt;kt++){var ut=De[kt].getAttributeNS(wi,"href");ut&&ut.toString()==="#"+E[Et].id&&Ct.push(De[kt])}for(var ke=0,Zo=Ct.length;ke<Zo;ke++)Ct[ke].setAttributeNS(wi,"href","#"+T);E[Et].id=T},Le=0,D=E.length;Le<D;Le++)he(Le)})}c.removeAttribute("xmlns:a");for(var _=c.querySelectorAll("script"),G=[],U,z,X=0,K=_.length;X<K;X++)z=_[X].getAttribute("type"),(!z||z==="application/ecmascript"||z==="application/javascript"||z==="text/javascript")&&(U=_[X].innerText||_[X].textContent,U&&G.push(U),c.removeChild(_[X]));if(G.length>0&&(n==="always"||n==="once"&&!Cl[l])){for(var fe=0,H=G.length;fe<H;fe++)new Function(G[fe])(window);Cl[l]=!0}var de=c.querySelectorAll("style");if(Array.prototype.forEach.call(de,function($){$.textContent+=""}),c.setAttribute("xmlns",Nb),c.setAttribute("xmlns:xlink",wi),s(c),!t.parentNode){Re.splice(Re.indexOf(t),1),t=null,a(new Error("Parent node is null"));return}t.parentNode.replaceChild(c,t),Re.splice(Re.indexOf(t),1),t=null,a(null,c)})},Bb=function(t,n){var r=n===void 0?{}:n,i=r.afterAll,o=i===void 0?function(){}:i,s=r.afterEach,a=s===void 0?function(){}:s,l=r.beforeEach,u=l===void 0?function(){}:l,f=r.cacheRequests,c=f===void 0?!0:f,d=r.evalScripts,h=d===void 0?"never":d,p=r.httpRequestWithCredentials,g=p===void 0?!1:p,y=r.renumerateIRIElements,v=y===void 0?!0:y;if(t&&"length"in t)for(var b=0,x=0,S=t.length;x<S;x++)kl(t[x],h,v,c,g,u,function(E,k){a(E,k),t&&"length"in t&&t.length===++b&&o(b)});else t?kl(t,h,v,c,g,u,function(E,k){a(E,k),o(1),t=null}):o(0)},$b=function(t){var n=(t==null?void 0:t.ownerDocument)||document;return n.defaultView||window},zb=function(t,n){for(var r in t)if(!(r in n))return!0;for(var i in n)if(t[i]!==n[i])return!0;return!1},Wb=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Vn="http://www.w3.org/2000/svg",Tl="http://www.w3.org/1999/xlink",Yo=function(e){qf(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||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(a){r.reactWrapper=a},r}var n=t.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof $b(this.reactWrapper).Node){var o=this.props,s=o.desc,a=o.evalScripts,l=o.httpRequestWithCredentials,u=o.renumerateIRIElements,f=o.src,c=o.title,d=o.useRequestCache,h=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,y=this.props.wrapper,v,b;y==="svg"?(v=document.createElementNS(Vn,y),v.setAttribute("xmlns",Vn),v.setAttribute("xmlns:xlink",Tl),b=document.createElementNS(Vn,y)):(v=document.createElement(y),b=document.createElement(y)),v.appendChild(b),b.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(v);var x=function(P){if(i.removeSVG(),!i._isMounted){h(P);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(P)})},S=function(P,T){if(P){x(P);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{g(T)}catch(_){x(_)}})},E=function(P){if(P.setAttribute("role","img"),s){var T=P.querySelector(":scope > desc");T&&P.removeChild(T);var _=document.createElement("desc");_.innerHTML=s,P.prepend(_)}if(c){var G=P.querySelector(":scope > title");G&&P.removeChild(G);var U=document.createElement("title");U.innerHTML=c,P.prepend(U)}try{p(P)}catch(z){x(z)}};Bb(b,{afterEach:S,beforeEach:E,cacheRequests:d,evalScripts:a,httpRequestWithCredentials:l,renumerateIRIElements:u})}},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 o=this;zb(It({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.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 o=i.fallback;i.httpRequestWithCredentials;var s=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var a=i.wrapper,l=Ko(i,Wb),u=a;return m.reactExports.createElement(u,It({},l,{ref:this.refCallback},a==="svg"?{xmlns:Vn,xmlnsXlink:Tl}:{}),this.state.isLoading&&s&&m.reactExports.createElement(s,null),this.state.hasError&&o&&m.reactExports.createElement(o,null))},t}(m.reactExports.Component);Yo.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Yo.propTypes={afterInjection:Y.func,beforeInjection:Y.func,desc:Y.string,evalScripts:Y.oneOf(["always","once","never"]),fallback:Y.oneOfType([Y.func,Y.object,Y.string]),httpRequestWithCredentials:Y.bool,loading:Y.oneOfType([Y.func,Y.object,Y.string]),onError:Y.func,renumerateIRIElements:Y.bool,src:Y.string.isRequired,title:Y.string,useRequestCache:Y.bool,wrapper:Y.oneOf(["div","span","svg"])};function Ub(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,children:m.jsxRuntimeExports.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 Hb(e){const{renderChildren:t,parentRef:n,onlyChild:r}=e,[i,o]=m.reactExports.useState({top:0,left:0}),s=m.reactExports.useRef(null),[a,l]=m.reactExports.useState("auto");return m.reactExports.useLayoutEffect(()=>{if(n.current&&s.current){const u=n.current.getBoundingClientRect(),f=s.current.getBoundingClientRect();let c=u.top;const d=u.left+u.width,h=f.height+(window.innerHeight-u.top)>window.innerHeight;h&&(console.log("overtop"),l(window.innerHeight-u.top-50)),u.top+f.height>window.innerHeight&&!h&&(c=u.top-f.height+u.height),o({top:c,left:d})}},[n,s]),r?t({maxHeight:a}):m.reactDomExports.createPortal(m.jsxRuntimeExports.jsx("div",{ref:s,style:{position:"fixed",top:i.top,left:i.left,zIndex:1200},children:t({maxHeight:a})}),n.current)}function qb(e){const{children:t,title:n,hasTooltip:r}=e,i=m.reactExports.useRef(),[o,s]=m.reactExports.useState(!1),[a,l]=m.reactExports.useState({top:0,left:0});return m.jsxRuntimeExports.jsxs("div",{className:"tooltip-item__wrapper",onMouseOver:()=>{if(s(!0),i.current){const u=i.current.getBoundingClientRect();l({top:u.top-20,left:u.left})}},onMouseLeave:()=>s(!1),ref:i,children:[m.jsxRuntimeExports.jsx("div",{children:t}),o&&r&&m.jsxRuntimeExports.jsx("div",{className:"tooltip-item__content",style:{position:"fixed",background:"#85858A",borderRadius:"4px",color:"#fff",padding:"4px 8px",top:a.top,left:a.left,zIndex:1400,fontSize:"10px",transition:"all 0.2s ease-in-out",animation:"fadeIn 0.2s ease-in-out",pointerEvents:"none"},children:n})]})}function Gb(e,t){return t?e:void 0}function Kf({item:e,level:t=0,...n}){var X,K,fe,H,de;const{isActive:r,isCollapsed:i,expanded:o,toggleExpand:s}=n,a=`level-${t}`,l=i?"collapsed":"expanded",u=r(e.id)?"active":"",f=($,he=a)=>`${$} ${he} ${l} ${u}`,c=!!((X=e.children)!=null&&X.length),[d,h]=m.reactExports.useState(!1),p=m.reactExports.useRef(),g=m.reactExports.useRef(),y=(g==null?void 0:g.current)&&((K=g==null?void 0:g.current)==null?void 0:K.scrollWidth)>((fe=g==null?void 0:g.current)==null?void 0:fe.clientWidth),v=window.location.origin,b=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},x=window.location.pathname.split("/")[1],S=b.pathname.split("/")[1],E=n.ssr||!v.includes("local")&&v!==b.origin||S!==x,k=c||t===0?"div":E?"a":Cb,P=e.path||"#",T=t+1,_=c&&!(i&&T>=2&&!d),G=i||t===0?void 0:`${t}rem`,U=()=>{h(!0)},z=()=>{h(!1)};return m.jsxRuntimeExports.jsxs("div",{ref:p,className:f("menu-item__wrapper"),onMouseOver:U,onMouseOut:z,children:[m.jsxRuntimeExports.jsx(qb,{hasTooltip:y||i&&t===1,children:m.jsxRuntimeExports.jsxs(k,{to:P,href:P,className:f("menu-item__link"),style:{paddingLeft:G,transition:"all 0.3s",color:r(e.id)?((H=n.brandColors)==null?void 0:H.primary400)||Vt.primary400:void 0,backgroundColor:r(e.id)&&t===1?(de=n.brandColors)==null?void 0:de.primary200:void 0},onClick:$=>{c&&($.preventDefault(),i||s(e.id))},children:[t!==0&&m.jsxRuntimeExports.jsx(Xb,{cls:f,item:e}),m.jsxRuntimeExports.jsx("span",{className:f("menu-item__label"),ref:g,children:e.name}),c&&m.jsxRuntimeExports.jsx("div",{className:f("menu-item__icon-arrow__wrapper"),children:m.jsxRuntimeExports.jsx(Ub,{className:f(`menu-item__icon-arrow__icon ${o(e.id)?"open":"close"}`)})})]}),title:e.name}),_&&m.jsxRuntimeExports.jsx(Hb,{parentRef:p,onlyChild:!i||i&&T<2,renderChildren:({maxHeight:$})=>{var he;return m.jsxRuntimeExports.jsx(Jx.div,{className:f(`menu-item__dropdown ${o(e.id)?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${T}`),initial:{height:i||o(e.id)?"auto":0},animate:{height:i||o(e.id)?"auto":0},transition:{duration:.25},style:Gb({maxHeight:$,overflowY:"auto",paddingRight:3},$!=="auto"&&!!T),children:(he=e.children)==null?void 0:he.map(Le=>m.reactExports.createElement(Kf,{...n,key:Le.id,item:Le,level:T}))})}})]})}function Xb({item:e,cls:t}){var s,a;const[n,r]=m.reactExports.useState(!e.icon),i=()=>{r(!0)},o=(s=e.icon)==null?void 0:s.endsWith(".svg");return m.jsxRuntimeExports.jsx("div",{className:t("menu-item__icon"),children:n?m.jsxRuntimeExports.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center"},children:(a=e.name.trim().at(0))==null?void 0:a.toUpperCase()}):o?m.jsxRuntimeExports.jsx(Yo,{src:e.icon,beforeInjection:l=>{l.setAttribute("style","margin: 0 auto;"),l.querySelectorAll("path").forEach(f=>{f.hasAttribute("fill")&&f.setAttribute("fill","currentColor"),f.hasAttribute("stroke")&&f.setAttribute("stroke","currentColor")})}}):m.jsxRuntimeExports.jsx("img",{src:e.icon||"/",alt:" ",style:{height:24,maxHeight:24},onError:i})})}function Kb(){return m.jsxRuntimeExports.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:m.jsxRuntimeExports.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 Yb(){return m.jsxRuntimeExports.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:m.jsxRuntimeExports.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function Jb(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:m.jsxRuntimeExports.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 Zb=`.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}.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:0}.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}}
67
- `,Pl=localStorage.getItem("isCollapsed");function Qb(e){const{baseUrl:t,menuPath:n}=e,r=zr(),[i,o]=m.reactExports.useState([]),[s,a]=m.reactExports.useState(Pl===null?!0:Pl==="true"),[l,u]=m.reactExports.useState({}),f=Jo(i),[c,d]=m.reactExports.useState(window.location.href);m.reactExports.useEffect(()=>{d(window.location.href)},[r]);const h=Yf(f,c).filter(E=>E.parentKey!==0);console.log("matchPaths:",c,r,h);const p=E=>{u({...l,[E]:!l[E]})},g=()=>{a(!s),localStorage.setItem("isCollapsed",JSON.stringify(!s))};m.reactExports.useLayoutEffect(()=>{(async()=>{var k,P;try{const _=t+(n||"/global-menu-config/api/v1/menu-items/user"),{data:G}=await Kl.get(_,{withCredentials:!0});let U=G.map(X=>({...X,parentKey:0}));U=Zf(U),e.replacePath&&(U=Jf(U,e.replacePath));const z=tw(U);u(z),o(U)}catch(T){console.log(T),hc(((P=(k=T.response)==null?void 0:k.data)==null?void 0:P.errorMessage)||"Have error when get menu items")}})()},[t,n,e.replacePath]);const[y,v]=m.reactExports.useState(!1),b=s?"collapsed":"expanded",x=E=>`${E} ${b}`,S=m.reactExports.useRef(null);return m.jsxRuntimeExports.jsxs("div",{className:x("side-bar"),children:[m.jsxRuntimeExports.jsx("div",{className:x("wrap-section side-bar__wrapper-toggle-btn"),children:m.jsxRuntimeExports.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:g,children:s?m.jsxRuntimeExports.jsx(Yb,{}):m.jsxRuntimeExports.jsx(Kb,{})})}),m.jsxRuntimeExports.jsx(ou,{ref:S,className:x("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:i.map(E=>{const k=P=>h.some(T=>T.id===P);return m.jsxRuntimeExports.jsx(Kf,{item:E,isActive:k,isCollapsed:s,expanded:P=>l[P],toggleExpand:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors},E.id)})}),m.jsxRuntimeExports.jsxs("div",{className:x("wrap-section side-bar__wrap-btn-logout"),children:[m.jsxRuntimeExports.jsxs("button",{className:x("side-bar__logout-btn"),onClick:()=>v(!0),children:[m.jsxRuntimeExports.jsx(Jb,{className:x("side-bar__icon-logout")}),m.jsxRuntimeExports.jsx("span",{className:x("side-bar__logout-btn__text"),children:"Logout"})]}),m.jsxRuntimeExports.jsx(su,{isOpen:y,onClose:()=>v(!1),onConfirm:()=>e.logout?e.logout():rp(e.baseUrl)})]})]})}function Jo(e){let t=[];for(const n of e)t.push(n),n.children&&(t=t.concat(Jo(n.children)));return t}function ew(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function Yf(e,t){const n=new URL(t),r=e.filter(s=>s.path&&s.path.includes("http")).map(s=>({item:s,itemUrl:new URL(s.path),matchingParamsCount:ew(t,s.path)})).sort((s,a)=>{const l=new URL(s.itemUrl).searchParams,u=new URL(a.itemUrl).searchParams;return Array.from(l).length-Array.from(u).length}).filter(({itemUrl:s})=>n.origin===s.origin).filter(({itemUrl:s})=>n.pathname===s.pathname||n.pathname.includes(s.pathname)).sort((s,a)=>a.matchingParamsCount-s.matchingParamsCount);let i=r.length>0?r[0].item:null;console.log("matchingItems:",r);let o=[];for(;i;)o=[i,...o],i=e.find(s=>s.id===(i==null?void 0:i.parentKey))||null;return o}function Jf(e,t){return e.map(n=>(n.path&&(n.path=t(n.path)),n.children&&n.children.length>0&&(n.children=Jf(n.children,t)),n))}function Zf(e){return e.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=Zf(n.children)),n))}function tw(e){const t=Jo(e),n=Yf(t,window.location.href),r={};return n.forEach(i=>r[i.id]=!0),t.forEach(i=>{i.parentKey||(r[i.id]=!0)}),r}function Qf(e){return m.jsxRuntimeExports.jsx(uc,{styles:[ep,Zb],style:{position:"sticky",zIndex:20},children:m.jsxRuntimeExports.jsx(Qb,{...e})})}function nw(e){return m.jsxRuntimeExports.jsx(wb,{children:m.jsxRuntimeExports.jsx(Qf,{...e,ssr:!0})})}{const e=m.s(nw,{props:{baseUrl:"string",menuPath:"string",logout:"function",replacePath:"function",ssr:"boolean",brandColors:"json"}});customElements.define("global-menu",e)}exports.ERROR_MESSAGE=tp;exports.GlobalMenu=Qf;exports.LogoutConfirmModal=su;exports.ShadowDomWrapper=uc;exports._extends=It;exports._extends$1=Pb;exports._inheritsLoose=qf;exports._objectWithoutPropertiesLoose=Ko;exports.axios=Kl;exports.color=Vt;exports.login=np;exports.notify=Ng;exports.objectWithoutPropertiesLoose=Tb;exports.pushError=hc;
67
+ `,Pl=localStorage.getItem("isCollapsed");function Qb(e){const{baseUrl:t,menuPath:n}=e,r=zr(),[i,o]=m.reactExports.useState([]),[s,a]=m.reactExports.useState(Pl===null?!0:Pl==="true"),[l,u]=m.reactExports.useState({}),f=Jo(i),[c,d]=m.reactExports.useState(window.location.href);m.reactExports.useEffect(()=>{d(window.location.href)},[r]);const h=Yf(f,c).filter(E=>E.parentKey!==0);console.log("matchPaths:",c,r,h);const p=E=>{u({...l,[E]:!l[E]})},g=()=>{a(!s),localStorage.setItem("isCollapsed",JSON.stringify(!s))};m.reactExports.useLayoutEffect(()=>{(async()=>{var k,P;try{const _=t+(n||"/global-menu-config/api/v1/menu-items/user"),{data:G}=await Kl.get(_,{withCredentials:!0});let U=G.map(X=>({...X,parentKey:0}));U=Zf(U),e.replacePath&&(U=Jf(U,e.replacePath));const z=tw(U);u(z),o(U)}catch(T){console.log(T),hc(((P=(k=T.response)==null?void 0:k.data)==null?void 0:P.errorMessage)||"Have error when get menu items")}})()},[t,n,e.replacePath]);const[y,v]=m.reactExports.useState(!1),b=s?"collapsed":"expanded",x=E=>`${E} ${b}`,S=m.reactExports.useRef(null);return m.jsxRuntimeExports.jsxs("div",{className:x("side-bar"),children:[m.jsxRuntimeExports.jsx("div",{className:x("wrap-section side-bar__wrapper-toggle-btn"),children:m.jsxRuntimeExports.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:g,children:s?m.jsxRuntimeExports.jsx(Yb,{}):m.jsxRuntimeExports.jsx(Kb,{})})}),m.jsxRuntimeExports.jsx(ou,{ref:S,className:x("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:i.map(E=>{const k=P=>h.some(T=>T.id===P);return m.jsxRuntimeExports.jsx(Kf,{item:E,isActive:k,isCollapsed:s,expanded:P=>l[P],toggleExpand:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors},E.id)})}),m.jsxRuntimeExports.jsxs("div",{className:x("wrap-section side-bar__wrap-btn-logout"),children:[m.jsxRuntimeExports.jsxs("button",{className:x("side-bar__logout-btn"),onClick:()=>v(!0),children:[m.jsxRuntimeExports.jsx(Jb,{className:x("side-bar__icon-logout")}),m.jsxRuntimeExports.jsx("span",{className:x("side-bar__logout-btn__text"),children:"Logout"})]}),m.jsxRuntimeExports.jsx(su,{isOpen:y,onClose:()=>v(!1),onConfirm:()=>e.logout?e.logout():rp(e.baseUrl)})]})]})}function Jo(e){let t=[];for(const n of e)t.push(n),n.children&&(t=t.concat(Jo(n.children)));return t}function ew(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function Yf(e,t){var l;const n=new URL(t);let r=e.filter(u=>u.path&&u.path.includes("http")).map(u=>({item:u,itemUrl:new URL(u.path),matchingParamsCount:ew(t,u.path)})).sort((u,f)=>{const c=new URL(u.itemUrl).searchParams,d=new URL(f.itemUrl).searchParams;return Array.from(c).length-Array.from(d).length}).filter(({itemUrl:u})=>n.origin===u.origin);const i=r.filter(({itemUrl:u})=>n.pathname===u.pathname),o=r.filter(({itemUrl:u})=>n.pathname.includes(u.pathname));r=i.length>0?i:o,r=r.sort((u,f)=>f.matchingParamsCount-u.matchingParamsCount);let s=r.length>0?(l=r.find(u=>u.item.parentKey))==null?void 0:l.item:null;console.log("matchingItems:",r);let a=[];for(;s;)a=[s,...a],s=e.find(u=>u.id===(s==null?void 0:s.parentKey))||null;return console.log("parents:",a),a}function Jf(e,t){return e.map(n=>(n.path&&(n.path=t(n.path)),n.children&&n.children.length>0&&(n.children=Jf(n.children,t)),n))}function Zf(e){return e.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=Zf(n.children)),n))}function tw(e){const t=Jo(e),n=Yf(t,window.location.href),r={};return n.forEach(i=>r[i.id]=!0),t.forEach(i=>{i.parentKey||(r[i.id]=!0)}),r}function Qf(e){return m.jsxRuntimeExports.jsx(uc,{styles:[ep,Zb],style:{position:"sticky",zIndex:20},children:m.jsxRuntimeExports.jsx(Qb,{...e})})}function nw(e){return m.jsxRuntimeExports.jsx(wb,{children:m.jsxRuntimeExports.jsx(Qf,{...e,ssr:!0})})}{const e=m.s(nw,{props:{baseUrl:"string",menuPath:"string",logout:"function",replacePath:"function",ssr:"boolean",brandColors:"json"}});customElements.define("global-menu",e)}exports.ERROR_MESSAGE=tp;exports.GlobalMenu=Qf;exports.LogoutConfirmModal=su;exports.ShadowDomWrapper=uc;exports._extends=It;exports._extends$1=Pb;exports._inheritsLoose=qf;exports._objectWithoutPropertiesLoose=Ko;exports.axios=Kl;exports.color=Vt;exports.login=np;exports.notify=Ng;exports.objectWithoutPropertiesLoose=Tb;exports.pushError=hc;
@@ -1,4 +1,4 @@
1
- "use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),se=require("./index-e820d563.cjs"),ps=require("./index-4327002b.cjs");function qg(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=qg(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Zn(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=qg(e))&&(s&&(s+=" "),s+=t);return s}const Sw=e=>{var s,o;const{tabs:t}=e,r=c=>{e.setCurrentTab(c.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),D.jsxRuntimeExports.jsxs(D.jsxRuntimeExports.Fragment,{children:[D.jsxRuntimeExports.jsx("style",{children:`
1
+ "use strict";const D=require("./react-to-web-component-3847ebf5.cjs"),se=require("./index-6c2bc04a.cjs"),ps=require("./index-4327002b.cjs");function qg(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=qg(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Zn(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=qg(e))&&(s&&(s+=" "),s+=t);return s}const Sw=e=>{var s,o;const{tabs:t}=e,r=c=>{e.setCurrentTab(c.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),D.jsxRuntimeExports.jsxs(D.jsxRuntimeExports.Fragment,{children:[D.jsxRuntimeExports.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -10714,20 +10714,24 @@ function tw(e, t) {
10714
10714
  ).length;
10715
10715
  }
10716
10716
  function Kf(e, t) {
10717
- const n = new URL(t), r = e.filter((s) => s.path && s.path.includes("http")).map((s) => ({
10718
- item: s,
10719
- itemUrl: new URL(s.path),
10720
- matchingParamsCount: tw(t, s.path)
10721
- })).sort((s, a) => {
10722
- const l = new URL(s.itemUrl).searchParams, u = new URL(a.itemUrl).searchParams;
10723
- return Array.from(l).length - Array.from(u).length;
10724
- }).filter(({ itemUrl: s }) => n.origin === s.origin).filter(({ itemUrl: s }) => n.pathname === s.pathname || n.pathname.includes(s.pathname)).sort((s, a) => a.matchingParamsCount - s.matchingParamsCount);
10725
- let i = r.length > 0 ? r[0].item : null;
10717
+ var l;
10718
+ const n = new URL(t);
10719
+ let r = e.filter((u) => u.path && u.path.includes("http")).map((u) => ({
10720
+ item: u,
10721
+ itemUrl: new URL(u.path),
10722
+ matchingParamsCount: tw(t, u.path)
10723
+ })).sort((u, f) => {
10724
+ const c = new URL(u.itemUrl).searchParams, d = new URL(f.itemUrl).searchParams;
10725
+ return Array.from(c).length - Array.from(d).length;
10726
+ }).filter(({ itemUrl: u }) => n.origin === u.origin);
10727
+ const i = r.filter(({ itemUrl: u }) => n.pathname === u.pathname), o = r.filter(({ itemUrl: u }) => n.pathname.includes(u.pathname));
10728
+ r = i.length > 0 ? i : o, r = r.sort((u, f) => f.matchingParamsCount - u.matchingParamsCount);
10729
+ let s = r.length > 0 ? (l = r.find((u) => u.item.parentKey)) == null ? void 0 : l.item : null;
10726
10730
  console.log("matchingItems:", r);
10727
- let o = [];
10728
- for (; i; )
10729
- o = [i, ...o], i = e.find((s) => s.id === (i == null ? void 0 : i.parentKey)) || null;
10730
- return o;
10731
+ let a = [];
10732
+ for (; s; )
10733
+ a = [s, ...a], s = e.find((u) => u.id === (s == null ? void 0 : s.parentKey)) || null;
10734
+ return console.log("parents:", a), a;
10731
10735
  }
10732
10736
  function Yf(e, t) {
10733
10737
  return e.map((n) => (n.path && (n.path = t(n.path)), n.children && n.children.length > 0 && (n.children = Yf(n.children, t)), n));