@aiquants/menu-bar 1.15.1 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -104,6 +104,7 @@ function App() {
104
104
  | `pinnedSubmenuIds` | `number[]` | No | Pinned submenu IDs (controlled) |
105
105
  | `initialPinnedSubmenuIds` | `number[]` | No | Initial pinned submenu IDs |
106
106
  | `onSubmenuPinChange` | `(pinnedIds: number[]) => void` | No | Callback function triggered when submenu pin states change |
107
+ | `closeOnEscape` | `boolean \| "auto"` | No | Controls whether the Escape key closes the menu. `"auto"` (default) closes only when not pinned; `true` always closes; `false` never closes |
107
108
 
108
109
  ### IMenu Type
109
110
 
@@ -152,8 +153,7 @@ interface UserProfile {
152
153
  ```tsx
153
154
  interface SessionInfoProps {
154
155
  user: UserProfile | null;
155
- onLogout?: () => void;
156
- LinkComponent: React.ComponentType<LinkProps>;
156
+ LinkComponent?: React.ComponentType<LinkProps>;
157
157
  }
158
158
 
159
159
  interface LinkProps {
@@ -287,7 +287,6 @@ import { SessionInfo } from '@aiquants/menu-bar';
287
287
  displayName: "John Doe",
288
288
  photo: "https://example.com/avatar.jpg"
289
289
  }}
290
- onLogout={() => console.log('Logout')}
291
290
  LinkComponent={({ to, children, ...props }) => (
292
291
  <a href={to} {...props}>{children}</a>
293
292
  )}
package/dist/MenuBar.d.ts CHANGED
@@ -12,6 +12,10 @@ import { Theme } from './types';
12
12
  * @property {Theme} theme - The current theme.
13
13
  * @property {() => void} toggleTheme - Function to toggle the theme.
14
14
  * @property {(payload: MenuNavigationPayload) => void} [onMenuNavigate] - Function to receive menu navigation events. メニュー遷移イベントを受け取る関数。
15
+ * @property {boolean | "auto"} [closeOnEscape] - Controls whether the Escape key closes the menu.
16
+ * - "auto" (default): closes when NOT pinned, stays open when pinned. ピン留めなしでは閉じ、ピン留め中は閉じない。
17
+ * - true: always closes on Escape (resets pin if pinned). 常に閉じる。
18
+ * - false: never closes on Escape. 常に閉じない。
15
19
  */
16
20
  interface IMenuBarProps {
17
21
  menuList: IMenu[];
@@ -25,6 +29,7 @@ interface IMenuBarProps {
25
29
  pinnedSubmenuIds?: number[];
26
30
  initialPinnedSubmenuIds?: number[];
27
31
  onSubmenuPinChange?(pinnedIds: number[]): void;
32
+ closeOnEscape?: boolean | "auto";
28
33
  }
29
34
  /**
30
35
  * @function MenuBar
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import pe, { useMemo as ee, useState as D, useRef as T, useEffect as Y, useCallback as w, useLayoutEffect as he } from "react";
2
- import { Pin as ie, PinOff as ce, Link as xe, Lock as be, Download as ge, BarChart as ve, Table as ye, FileText as ne } from "lucide-react";
3
- import { useLocation as ke, Link as ue } from "react-router-dom";
4
- var q = { exports: {} }, I = {};
1
+ import xe, { useMemo as ne, useState as Y, useRef as _, useEffect as M, useCallback as w, useLayoutEffect as ue } from "react";
2
+ import { Pin as de, PinOff as fe, Link as be, Lock as ge, Download as ve, BarChart as ye, Table as ke, FileText as te } from "lucide-react";
3
+ import { useLocation as we, Link as me } from "react-router-dom";
4
+ var D = { exports: {} }, I = {};
5
5
  var re;
6
- function we() {
6
+ function je() {
7
7
  if (re) return I;
8
8
  re = 1;
9
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
9
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
10
10
  function a(l, c, i) {
11
11
  var u = null;
12
12
  if (i !== void 0 && (u = "" + i), c.key !== void 0 && (u = "" + c.key), "key" in c) {
@@ -15,102 +15,102 @@ function we() {
15
15
  h !== "key" && (i[h] = c[h]);
16
16
  } else i = c;
17
17
  return c = i.ref, {
18
- $$typeof: r,
18
+ $$typeof: t,
19
19
  type: l,
20
20
  key: u,
21
21
  ref: c !== void 0 ? c : null,
22
22
  props: i
23
23
  };
24
24
  }
25
- return I.Fragment = t, I.jsx = a, I.jsxs = a, I;
25
+ return I.Fragment = r, I.jsx = a, I.jsxs = a, I;
26
26
  }
27
- var M = {};
28
- var te;
29
- function je() {
30
- return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
31
- function r(e) {
27
+ var A = {};
28
+ var se;
29
+ function Ee() {
30
+ return se || (se = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ function t(e) {
32
32
  if (e == null) return null;
33
33
  if (typeof e == "function")
34
- return e.$$typeof === _ ? null : e.displayName || e.name || null;
34
+ return e.$$typeof === k ? null : e.displayName || e.name || null;
35
35
  if (typeof e == "string") return e;
36
36
  switch (e) {
37
- case S:
37
+ case m:
38
38
  return "Fragment";
39
- case j:
39
+ case E:
40
40
  return "Profiler";
41
- case O:
41
+ case S:
42
42
  return "StrictMode";
43
- case F:
43
+ case P:
44
44
  return "Suspense";
45
45
  case W:
46
46
  return "SuspenseList";
47
- case E:
47
+ case L:
48
48
  return "Activity";
49
49
  }
50
50
  if (typeof e == "object")
51
51
  switch (typeof e.tag == "number" && console.error(
52
52
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
53
53
  ), e.$$typeof) {
54
- case N:
54
+ case s:
55
55
  return "Portal";
56
56
  case z:
57
57
  return e.displayName || "Context";
58
58
  case $:
59
59
  return (e._context.displayName || "Context") + ".Consumer";
60
- case R:
60
+ case F:
61
61
  var o = e.render;
62
62
  return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
63
- case P:
64
- return o = e.displayName || null, o !== null ? o : r(e.type) || "Memo";
65
- case y:
63
+ case U:
64
+ return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
65
+ case R:
66
66
  o = e._payload, e = e._init;
67
67
  try {
68
- return r(e(o));
68
+ return t(e(o));
69
69
  } catch {
70
70
  }
71
71
  }
72
72
  return null;
73
73
  }
74
- function t(e) {
74
+ function r(e) {
75
75
  return "" + e;
76
76
  }
77
77
  function a(e) {
78
78
  try {
79
- t(e);
79
+ r(e);
80
80
  var o = !1;
81
81
  } catch {
82
82
  o = !0;
83
83
  }
84
84
  if (o) {
85
85
  o = console;
86
- var p = o.error, x = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
+ var p = o.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
87
  return p.call(
88
88
  o,
89
89
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
90
- x
91
- ), t(e);
90
+ b
91
+ ), r(e);
92
92
  }
93
93
  }
94
94
  function l(e) {
95
- if (e === S) return "<>";
96
- if (typeof e == "object" && e !== null && e.$$typeof === y)
95
+ if (e === m) return "<>";
96
+ if (typeof e == "object" && e !== null && e.$$typeof === R)
97
97
  return "<...>";
98
98
  try {
99
- var o = r(e);
99
+ var o = t(e);
100
100
  return o ? "<" + o + ">" : "<...>";
101
101
  } catch {
102
102
  return "<...>";
103
103
  }
104
104
  }
105
105
  function c() {
106
- var e = A.A;
106
+ var e = N.A;
107
107
  return e === null ? null : e.getOwner();
108
108
  }
109
109
  function i() {
110
110
  return Error("react-stack-top-frame");
111
111
  }
112
112
  function u(e) {
113
- if (Z.call(e, "key")) {
113
+ if (C.call(e, "key")) {
114
114
  var o = Object.getOwnPropertyDescriptor(e, "key").get;
115
115
  if (o && o.isReactWarning) return !1;
116
116
  }
@@ -118,7 +118,7 @@ function je() {
118
118
  }
119
119
  function h(e, o) {
120
120
  function p() {
121
- G || (G = !0, console.error(
121
+ B || (B = !0, console.error(
122
122
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
123
123
  o
124
124
  ));
@@ -128,23 +128,23 @@ function je() {
128
128
  configurable: !0
129
129
  });
130
130
  }
131
- function g() {
132
- var e = r(this.type);
133
- return B[e] || (B[e] = !0, console.error(
131
+ function v() {
132
+ var e = t(this.type);
133
+ return Q[e] || (Q[e] = !0, console.error(
134
134
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
135
135
  )), e = this.props.ref, e !== void 0 ? e : null;
136
136
  }
137
- function d(e, o, p, x, L, H) {
138
- var b = p.ref;
137
+ function d(e, o, p, b, q, G) {
138
+ var g = p.ref;
139
139
  return e = {
140
- $$typeof: m,
140
+ $$typeof: T,
141
141
  type: e,
142
142
  key: o,
143
143
  props: p,
144
- _owner: x
145
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(e, "ref", {
144
+ _owner: b
145
+ }, (g !== void 0 ? g : null) !== null ? Object.defineProperty(e, "ref", {
146
146
  enumerable: !1,
147
- get: g
147
+ get: v
148
148
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
149
149
  configurable: !1,
150
150
  enumerable: !1,
@@ -159,210 +159,230 @@ function je() {
159
159
  configurable: !1,
160
160
  enumerable: !1,
161
161
  writable: !0,
162
- value: L
162
+ value: q
163
163
  }), Object.defineProperty(e, "_debugTask", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
166
166
  writable: !0,
167
- value: H
167
+ value: G
168
168
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
169
169
  }
170
- function f(e, o, p, x, L, H) {
171
- var b = o.children;
172
- if (b !== void 0)
173
- if (x)
174
- if (fe(b)) {
175
- for (x = 0; x < b.length; x++)
176
- k(b[x]);
177
- Object.freeze && Object.freeze(b);
170
+ function f(e, o, p, b, q, G) {
171
+ var g = o.children;
172
+ if (g !== void 0)
173
+ if (b)
174
+ if (H(g)) {
175
+ for (b = 0; b < g.length; b++)
176
+ y(g[b]);
177
+ Object.freeze && Object.freeze(g);
178
178
  } else
179
179
  console.error(
180
180
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
181
181
  );
182
- else k(b);
183
- if (Z.call(o, "key")) {
184
- b = r(e);
185
- var C = Object.keys(o).filter(function(me) {
186
- return me !== "key";
182
+ else y(g);
183
+ if (C.call(o, "key")) {
184
+ g = t(e);
185
+ var O = Object.keys(o).filter(function(he) {
186
+ return he !== "key";
187
187
  });
188
- x = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", K[b + x] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ b = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", ee[g + b] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
189
189
  `A props object containing a "key" prop is being spread into JSX:
190
190
  let props = %s;
191
191
  <%s {...props} />
192
192
  React keys must be passed directly to JSX without using spread:
193
193
  let props = %s;
194
194
  <%s key={someKey} {...props} />`,
195
- x,
196
195
  b,
197
- C,
198
- b
199
- ), K[b + x] = !0);
196
+ g,
197
+ O,
198
+ g
199
+ ), ee[g + b] = !0);
200
200
  }
201
- if (b = null, p !== void 0 && (a(p), b = "" + p), u(o) && (a(o.key), b = "" + o.key), "key" in o) {
201
+ if (g = null, p !== void 0 && (a(p), g = "" + p), u(o) && (a(o.key), g = "" + o.key), "key" in o) {
202
202
  p = {};
203
- for (var J in o)
204
- J !== "key" && (p[J] = o[J]);
203
+ for (var V in o)
204
+ V !== "key" && (p[V] = o[V]);
205
205
  } else p = o;
206
- return b && h(
206
+ return g && h(
207
207
  p,
208
208
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
209
209
  ), d(
210
210
  e,
211
- b,
211
+ g,
212
212
  p,
213
213
  c(),
214
- L,
215
- H
214
+ q,
215
+ G
216
216
  );
217
217
  }
218
- function k(e) {
219
- v(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === y && (e._payload.status === "fulfilled" ? v(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
+ function y(e) {
219
+ j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === R && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
220
220
  }
221
- function v(e) {
222
- return typeof e == "object" && e !== null && e.$$typeof === m;
221
+ function j(e) {
222
+ return typeof e == "object" && e !== null && e.$$typeof === T;
223
223
  }
224
- var s = pe, m = /* @__PURE__ */ Symbol.for("react.transitional.element"), N = /* @__PURE__ */ Symbol.for("react.portal"), S = /* @__PURE__ */ Symbol.for("react.fragment"), O = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), $ = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), R = /* @__PURE__ */ Symbol.for("react.forward_ref"), F = /* @__PURE__ */ Symbol.for("react.suspense"), W = /* @__PURE__ */ Symbol.for("react.suspense_list"), P = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), E = /* @__PURE__ */ Symbol.for("react.activity"), _ = /* @__PURE__ */ Symbol.for("react.client.reference"), A = s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, fe = Array.isArray, U = console.createTask ? console.createTask : function() {
224
+ var x = xe, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), E = /* @__PURE__ */ Symbol.for("react.profiler"), $ = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), F = /* @__PURE__ */ Symbol.for("react.forward_ref"), P = /* @__PURE__ */ Symbol.for("react.suspense"), W = /* @__PURE__ */ Symbol.for("react.suspense_list"), U = /* @__PURE__ */ Symbol.for("react.memo"), R = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), k = /* @__PURE__ */ Symbol.for("react.client.reference"), N = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, H = Array.isArray, J = console.createTask ? console.createTask : function() {
225
225
  return null;
226
226
  };
227
- s = {
227
+ x = {
228
228
  react_stack_bottom_frame: function(e) {
229
229
  return e();
230
230
  }
231
231
  };
232
- var G, B = {}, Q = s.react_stack_bottom_frame.bind(
233
- s,
232
+ var B, Q = {}, X = x.react_stack_bottom_frame.bind(
233
+ x,
234
234
  i
235
- )(), X = U(l(i)), K = {};
236
- M.Fragment = S, M.jsx = function(e, o, p) {
237
- var x = 1e4 > A.recentlyCreatedOwnerStacks++;
235
+ )(), K = J(l(i)), ee = {};
236
+ A.Fragment = m, A.jsx = function(e, o, p) {
237
+ var b = 1e4 > N.recentlyCreatedOwnerStacks++;
238
238
  return f(
239
239
  e,
240
240
  o,
241
241
  p,
242
242
  !1,
243
- x ? Error("react-stack-top-frame") : Q,
244
- x ? U(l(e)) : X
243
+ b ? Error("react-stack-top-frame") : X,
244
+ b ? J(l(e)) : K
245
245
  );
246
- }, M.jsxs = function(e, o, p) {
247
- var x = 1e4 > A.recentlyCreatedOwnerStacks++;
246
+ }, A.jsxs = function(e, o, p) {
247
+ var b = 1e4 > N.recentlyCreatedOwnerStacks++;
248
248
  return f(
249
249
  e,
250
250
  o,
251
251
  p,
252
252
  !0,
253
- x ? Error("react-stack-top-frame") : Q,
254
- x ? U(l(e)) : X
253
+ b ? Error("react-stack-top-frame") : X,
254
+ b ? J(l(e)) : K
255
255
  );
256
256
  };
257
- })()), M;
257
+ })()), A;
258
258
  }
259
- var se;
260
- function Ee() {
261
- return se || (se = 1, process.env.NODE_ENV === "production" ? q.exports = we() : q.exports = je()), q.exports;
259
+ var oe;
260
+ function Ne() {
261
+ return oe || (oe = 1, process.env.NODE_ENV === "production" ? D.exports = je() : D.exports = Ee()), D.exports;
262
262
  }
263
- var n = Ee();
264
- const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", Se = ({ to: r, className: t, children: a }) => /* @__PURE__ */ n.jsx("a", { href: r, className: t, children: a }), qe = (r) => {
265
- const { user: t, LinkComponent: a = Se } = r;
266
- return /* @__PURE__ */ n.jsx("div", { className: "max-h-20 max-w-52", children: /* @__PURE__ */ n.jsx("div", { className: "flex grow flex-col", children: t ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
263
+ var n = Ne();
264
+ const Se = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", Te = ({ to: t, className: r, children: a }) => /* @__PURE__ */ n.jsx("a", { href: t, className: r, children: a }), Ye = (t) => {
265
+ const { user: r, LinkComponent: a = Te } = t;
266
+ return /* @__PURE__ */ n.jsx("div", { className: "max-h-20 max-w-52", children: /* @__PURE__ */ n.jsx("div", { className: "flex grow flex-col", children: r ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
267
267
  /* @__PURE__ */ n.jsxs("div", { className: "flex flex-row", children: [
268
- /* @__PURE__ */ n.jsx("div", { className: "aiquants-session-photo m-1 h-14 w-14 p-0.5", children: /* @__PURE__ */ n.jsx("img", { className: "object-contain", src: t.photo || Ne, "aria-label": "profile photo" }) }),
268
+ /* @__PURE__ */ n.jsx("div", { className: "aiquants-session-photo m-1 h-14 w-14 p-0.5", children: /* @__PURE__ */ n.jsx("img", { className: "object-contain", src: r.photo || Se, "aria-label": "profile photo" }) }),
269
269
  /* @__PURE__ */ n.jsxs("div", { className: "mx-1 flex flex-col", children: [
270
270
  /* @__PURE__ */ n.jsx(a, { className: "aiquants-session-link my-1 rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィールを編集" }),
271
271
  /* @__PURE__ */ n.jsx(a, { className: "aiquants-session-link rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィール" }),
272
272
  /* @__PURE__ */ n.jsx(a, { className: "aiquants-session-link my-1 rounded-lg px-2 text-center text-xs", to: "https://myaccount.google.com/", children: "Google Account" })
273
273
  ] })
274
274
  ] }),
275
- /* @__PURE__ */ n.jsx("div", { className: "aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs", children: t.displayName })
275
+ /* @__PURE__ */ n.jsx("div", { className: "aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs", children: r.displayName })
276
276
  ] }) : /* @__PURE__ */ n.jsx("div", { className: "aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs", children: "ログインはこちら" }) }) });
277
- }, de = new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/), Te = {
278
- report: ne,
279
- slip: ne,
280
- table: ye,
281
- chart: ve,
282
- download: ge,
283
- lock: be,
284
- href: xe
285
- }, _e = ({ mark: r, children: t }) => {
286
- const a = r ? Te[r] : void 0;
277
+ }, _e = typeof window < "u" ? ue : M, ae = "aiquants-menu-scroll", pe = new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/), Re = {
278
+ report: te,
279
+ slip: te,
280
+ table: ke,
281
+ chart: ye,
282
+ download: ve,
283
+ lock: ge,
284
+ href: be
285
+ }, Ce = ({ mark: t, children: r }) => {
286
+ const a = t ? Re[t] : void 0;
287
287
  return a ? /* @__PURE__ */ n.jsxs("div", { className: "flex flex-nowrap items-center", children: [
288
288
  /* @__PURE__ */ n.jsx(a, { className: "h-4 w-4" }),
289
- /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-link mx-1 hover:underline", children: t })
290
- ] }) : /* @__PURE__ */ n.jsx("span", { className: "mx-1 text-sky-600 hover:underline dark:text-sky-400", children: t });
291
- }, V = (r, t) => t ? {
289
+ /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-link mx-1 hover:underline", children: r })
290
+ ] }) : /* @__PURE__ */ n.jsx("span", { className: "mx-1 text-sky-600 hover:underline dark:text-sky-400", children: r });
291
+ }, Z = (t, r) => r ? {
292
292
  menu: {
293
- id: r.id,
294
- title: r.title,
295
- href: r.href
293
+ id: t.id,
294
+ title: t.title,
295
+ href: t.href
296
296
  },
297
297
  submenu: {
298
- subid: t.subid,
299
- title: t.title,
300
- href: t.href,
301
- mark: t.mark,
302
- new: t.new
298
+ subid: r.subid,
299
+ title: r.title,
300
+ href: r.href,
301
+ mark: r.mark,
302
+ new: r.new
303
303
  }
304
304
  } : {
305
305
  menu: {
306
- id: r.id,
307
- title: r.title,
308
- href: r.href
306
+ id: t.id,
307
+ title: t.title,
308
+ href: t.href
309
309
  }
310
- }, Re = ({ item: r, parentMenu: t, onMenuSelected: a }) => {
311
- if (r.href === "separator")
310
+ }, Pe = ({ item: t, parentMenu: r, onMenuSelected: a }) => {
311
+ if (t.href === "separator")
312
312
  return /* @__PURE__ */ n.jsx("hr", { className: "aiquants-menu-separator mx-2 my-1 h-px" });
313
- const l = /* @__PURE__ */ n.jsx(_e, { mark: r.mark, children: r.title }), c = {
313
+ const l = /* @__PURE__ */ n.jsx(Ce, { mark: t.mark, children: t.title }), c = {
314
314
  onClick: () => {
315
- a && a(V(t, r));
315
+ a && a(Z(r, t));
316
316
  }
317
317
  };
318
- return r.new ? /* @__PURE__ */ n.jsx("a", { href: r.href, rel: "noopener noreferrer", target: "_blank", ...c, children: l }) : de.test(r.href) ? /* @__PURE__ */ n.jsx("a", { href: r.href, ...c, children: l }) : /* @__PURE__ */ n.jsx(ue, { to: r.href, ...c, children: l });
319
- }, oe = (r) => r ? r.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", ae = (r, t) => {
320
- const a = t !== "/" && t.endsWith("/") ? t.slice(0, -1) : t;
321
- for (const l of r) {
322
- if (oe(l.href) === a)
318
+ return t.new ? /* @__PURE__ */ n.jsx("a", { href: t.href, rel: "noopener noreferrer", target: "_blank", ...c, children: l }) : pe.test(t.href) ? /* @__PURE__ */ n.jsx("a", { href: t.href, ...c, children: l }) : /* @__PURE__ */ n.jsx(me, { to: t.href, ...c, children: l });
319
+ }, le = (t) => t ? t.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", ie = (t, r) => {
320
+ const a = r !== "/" && r.endsWith("/") ? r.slice(0, -1) : r;
321
+ for (const l of t) {
322
+ if (le(l.href) === a)
323
323
  return l.id;
324
324
  if (l.submenu) {
325
325
  for (const c of l.submenu)
326
- if (oe(c.href) === a)
326
+ if (le(c.href) === a)
327
327
  return l.id;
328
328
  }
329
329
  }
330
330
  return null;
331
- }, Pe = (r) => {
332
- const { menuList: t, onMenuSelected: a, pinnedSubmenuIds: l = [], onToggleSubmenuPin: c } = r;
331
+ }, Oe = (t) => {
332
+ const { menuList: r, onMenuSelected: a, pinnedSubmenuIds: l = [], onToggleSubmenuPin: c } = t;
333
333
  let i = "";
334
334
  try {
335
- i = ke().pathname;
335
+ i = we().pathname;
336
336
  } catch {
337
337
  typeof window < "u" && (i = window.location.pathname);
338
338
  }
339
- const u = ee(() => ae(t, i), [t, i]), [h, g] = D(u), d = T(i), f = T(u !== null);
340
- Y(() => {
339
+ const u = ne(() => ie(r, i), [r, i]), [h, v] = Y(u), d = _(i), f = _(u !== null);
340
+ M(() => {
341
341
  if (d.current !== i && (d.current = i, f.current = !1), !f.current) {
342
- const s = ae(t, i);
343
- s !== null && (g(s), f.current = !0);
342
+ const s = ie(r, i);
343
+ s !== null && (v(s), f.current = !0);
344
344
  }
345
- }, [i, t]);
346
- const k = w(
345
+ }, [i, r]);
346
+ const y = w(
347
347
  (s) => {
348
- l.includes(s) || g((N) => N === s ? null : s);
348
+ l.includes(s) || v((S) => S === s ? null : s);
349
349
  },
350
350
  [l]
351
- ), v = ee(() => /* @__PURE__ */ n.jsx(n.Fragment, { children: t.map((s) => /* @__PURE__ */ n.jsx("div", { children: s.href ? /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']", children: de.test(s.href) ? /* @__PURE__ */ n.jsx(
351
+ ), j = _(null);
352
+ _e(() => {
353
+ const s = j.current;
354
+ if (s)
355
+ try {
356
+ const m = sessionStorage.getItem(ae);
357
+ if (m !== null) {
358
+ const S = Number.parseFloat(m);
359
+ Number.isNaN(S) || (s.scrollTop = S);
360
+ }
361
+ } catch {
362
+ }
363
+ }, []);
364
+ const x = w(() => {
365
+ const s = j.current;
366
+ if (s)
367
+ try {
368
+ sessionStorage.setItem(ae, String(s.scrollTop));
369
+ } catch {
370
+ }
371
+ }, []), T = ne(() => /* @__PURE__ */ n.jsx(n.Fragment, { children: r.map((s) => /* @__PURE__ */ n.jsx("div", { children: s.href ? /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']", children: pe.test(s.href) ? /* @__PURE__ */ n.jsx(
352
372
  "a",
353
373
  {
354
374
  href: s.href,
355
375
  onClick: () => {
356
- a && a(V(s));
376
+ a && a(Z(s));
357
377
  },
358
378
  children: /* @__PURE__ */ n.jsx("span", { className: "aiquants-menu-link hover:underline", children: s.title })
359
379
  }
360
380
  ) : /* @__PURE__ */ n.jsx(
361
- ue,
381
+ me,
362
382
  {
363
383
  to: s.href,
364
384
  onClick: () => {
365
- a && a(V(s));
385
+ a && a(Z(s));
366
386
  },
367
387
  children: /* @__PURE__ */ n.jsx("span", { className: "aiquants-menu-link hover:underline", children: s.title })
368
388
  }
@@ -372,10 +392,10 @@ const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
372
392
  {
373
393
  className: "aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 text-sm outline-none before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:content-['']",
374
394
  onClick: (m) => {
375
- m.preventDefault(), k(s.id);
395
+ m.preventDefault(), y(s.id);
376
396
  },
377
397
  onKeyDown: (m) => {
378
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), k(s.id));
398
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), y(s.id));
379
399
  },
380
400
  children: [
381
401
  /* @__PURE__ */ n.jsx("span", { children: s.title }),
@@ -388,29 +408,29 @@ const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
388
408
  },
389
409
  className: `aiquants-submenu-pin-button ${l.includes(s.id) ? "pinned" : ""}`,
390
410
  title: l.includes(s.id) ? "ピン留め解除" : "ピン留め",
391
- children: l.includes(s.id) ? /* @__PURE__ */ n.jsx(ie, { size: 14 }) : /* @__PURE__ */ n.jsx(ce, { size: 14 })
411
+ children: l.includes(s.id) ? /* @__PURE__ */ n.jsx(de, { size: 14 }) : /* @__PURE__ */ n.jsx(fe, { size: 14 })
392
412
  }
393
413
  )
394
414
  ]
395
415
  }
396
416
  ),
397
- /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md", children: s.submenu.map((m) => /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm", children: /* @__PURE__ */ n.jsx(Re, { item: m, parentMenu: s, onMenuSelected: a }) }, m.subid)) })
398
- ] }) }, s.id)) }), [t, a, h, k, l]);
399
- return /* @__PURE__ */ n.jsx("div", { className: "hidden-scrollbar h-0 grow overflow-y-scroll", children: v });
400
- }, Ce = (r) => {
401
- const { menuList: t, menuHeader: a, open: l, onMenuSelected: c, onClickSignout: i, theme: u, toggleTheme: h, isPinned: g, onTogglePin: d, pinnedSubmenuIds: f, onToggleSubmenuPin: k } = r;
417
+ /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md", children: s.submenu.map((m) => /* @__PURE__ */ n.jsx("div", { className: "aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm", children: /* @__PURE__ */ n.jsx(Pe, { item: m, parentMenu: s, onMenuSelected: a }) }, m.subid)) })
418
+ ] }) }, s.id)) }), [r, a, h, y, l]);
419
+ return /* @__PURE__ */ n.jsx("div", { ref: j, onScroll: x, className: "hidden-scrollbar h-0 grow overflow-y-scroll", children: T });
420
+ }, Ie = (t) => {
421
+ const { menuList: r, menuHeader: a, open: l, onMenuSelected: c, onClickSignout: i, theme: u, toggleTheme: h, isPinned: v, onTogglePin: d, pinnedSubmenuIds: f, onToggleSubmenuPin: y } = t;
402
422
  return /* @__PURE__ */ n.jsxs("div", { className: `aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[250px] select-none flex-col transition-transform duration-500 ${l ? "aiquants-menu-translate-x-0" : "aiquants-menu-translate-x-250"}`, children: [
403
423
  /* @__PURE__ */ n.jsx("div", { className: "flex h-[100px] flex-col", children: a }),
404
- /* @__PURE__ */ n.jsx("div", { className: "flex grow flex-col", children: /* @__PURE__ */ n.jsx(Pe, { menuList: t, onMenuSelected: c, pinnedSubmenuIds: f, onToggleSubmenuPin: k }) }),
424
+ /* @__PURE__ */ n.jsx("div", { className: "flex grow flex-col", children: /* @__PURE__ */ n.jsx(Oe, { menuList: r, onMenuSelected: c, pinnedSubmenuIds: f, onToggleSubmenuPin: y }) }),
405
425
  /* @__PURE__ */ n.jsx("div", { className: "px-4 pt-2 pb-4", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
406
426
  /* @__PURE__ */ n.jsx(
407
427
  "button",
408
428
  {
409
429
  type: "button",
410
430
  onClick: d,
411
- className: `flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${g ? "bg-amber-500/90 hover:bg-amber-600" : "border border-white/15 bg-white/10 hover:bg-white/20"}`,
412
- title: g ? "ピン留め解除" : "ピン留め",
413
- children: g ? /* @__PURE__ */ n.jsx(ie, { size: 14 }) : /* @__PURE__ */ n.jsx(ce, { size: 14 })
431
+ className: `flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${v ? "bg-amber-500/90 hover:bg-amber-600" : "border border-white/15 bg-white/10 hover:bg-white/20"}`,
432
+ title: v ? "ピン留め解除" : "ピン留め",
433
+ children: v ? /* @__PURE__ */ n.jsx(de, { size: 14 }) : /* @__PURE__ */ n.jsx(fe, { size: 14 })
414
434
  }
415
435
  ),
416
436
  /* @__PURE__ */ n.jsxs(
@@ -437,89 +457,89 @@ const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
437
457
  )
438
458
  ] }) })
439
459
  ] });
440
- }, Oe = (r) => {
441
- const { isOverlay: t, onOverlayClick: a } = r;
442
- return /* @__PURE__ */ n.jsx("button", { type: "button", className: `fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${t ? "opacity-100" : "pointer-events-none opacity-0"}`, onClick: a });
443
- }, Ae = (r) => {
444
- const { open: t, onMenuOpen: a, onMenuClose: l, theme: c } = r, i = T(t), u = T(null), h = T(null), g = T(null), d = T(null), f = T(null), k = w(() => {
445
- if (u.current && h.current && g.current && d.current && f.current) {
446
- const j = c === "dark" ? "#fff" : "#000";
447
- u.current.style.backgroundColor = j, u.current.style.width = "100%", u.current.style.height = "3px", u.current.style.transform = "", h.current.style.opacity = "1", h.current.style.backgroundColor = j, g.current.style.opacity = "1", g.current.style.backgroundColor = j, d.current.style.backgroundColor = j, d.current.style.width = "100%", d.current.style.height = "3px", d.current.style.transform = "", f.current.style.color = j, f.current.classList.remove("after:content-['close']"), f.current.classList.remove("after:ml-0.5"), f.current.classList.add("after:content-['menu']"), f.current.classList.add("after:-ml-0.5"), i.current = !0;
460
+ }, Ae = (t) => {
461
+ const { isOverlay: r, onOverlayClick: a } = t;
462
+ return /* @__PURE__ */ n.jsx("button", { type: "button", className: `fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${r ? "opacity-100" : "pointer-events-none opacity-0"}`, onClick: a });
463
+ }, Me = (t) => {
464
+ const { open: r, onMenuOpen: a, onMenuClose: l, theme: c } = t, i = _(r), u = _(null), h = _(null), v = _(null), d = _(null), f = _(null), y = w(() => {
465
+ if (u.current && h.current && v.current && d.current && f.current) {
466
+ const E = c === "dark" ? "#fff" : "#000";
467
+ u.current.style.backgroundColor = E, u.current.style.width = "100%", u.current.style.height = "3px", u.current.style.transform = "", h.current.style.opacity = "1", h.current.style.backgroundColor = E, v.current.style.opacity = "1", v.current.style.backgroundColor = E, d.current.style.backgroundColor = E, d.current.style.width = "100%", d.current.style.height = "3px", d.current.style.transform = "", f.current.style.color = E, f.current.classList.remove("after:content-['close']"), f.current.classList.remove("after:ml-0.5"), f.current.classList.add("after:content-['menu']"), f.current.classList.add("after:-ml-0.5"), i.current = !0;
448
468
  }
449
- }, [c]), v = w(() => {
450
- u.current && h.current && g.current && d.current && f.current && (u.current.style.backgroundColor = "#fff", u.current.style.width = "32px", u.current.style.height = "4px", u.current.style.transform = "translateY(9px) rotate(-45deg)", h.current.style.opacity = "0", g.current.style.opacity = "0", d.current.style.backgroundColor = "#fff", d.current.style.width = "32px", d.current.style.height = "4px", d.current.style.transform = "translateY(-9px) rotate(45deg)", f.current.style.color = "#fff", f.current.classList.remove("after:content-['menu']"), f.current.classList.remove("after:-ml-0.5"), f.current.classList.add("after:content-['close']"), f.current.classList.add("after:ml-0.5"), i.current = !1);
451
- }, []), s = w(() => {
452
- k(), l && l();
453
- }, [k, l]), m = w(() => {
454
- v(), a && a();
455
- }, [v, a]), N = w(() => {
456
- i.current ? m() : s();
457
- }, [s, m]), S = w((j) => {
458
- j.currentTarget.blur();
459
- }, []), O = w((j) => {
460
- j.preventDefault();
469
+ }, [c]), j = w(() => {
470
+ u.current && h.current && v.current && d.current && f.current && (u.current.style.backgroundColor = "#fff", u.current.style.width = "32px", u.current.style.height = "4px", u.current.style.transform = "translateY(9px) rotate(-45deg)", h.current.style.opacity = "0", v.current.style.opacity = "0", d.current.style.backgroundColor = "#fff", d.current.style.width = "32px", d.current.style.height = "4px", d.current.style.transform = "translateY(-9px) rotate(45deg)", f.current.style.color = "#fff", f.current.classList.remove("after:content-['menu']"), f.current.classList.remove("after:-ml-0.5"), f.current.classList.add("after:content-['close']"), f.current.classList.add("after:ml-0.5"), i.current = !1);
471
+ }, []), x = w(() => {
472
+ y(), l && l();
473
+ }, [y, l]), T = w(() => {
474
+ j(), a && a();
475
+ }, [j, a]), s = w(() => {
476
+ i.current ? T() : x();
477
+ }, [x, T]), m = w((E) => {
478
+ E.currentTarget.blur();
479
+ }, []), S = w((E) => {
480
+ E.preventDefault();
461
481
  }, []);
462
- return Y(() => {
463
- t ? k() : v();
464
- }, [t, k, v]), /* @__PURE__ */ n.jsxs("button", { type: "button", className: "aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden", onClick: N, onFocus: S, onMouseDown: O, tabIndex: -1, children: [
482
+ return M(() => {
483
+ r ? y() : j();
484
+ }, [r, y, j]), /* @__PURE__ */ n.jsxs("button", { type: "button", className: "aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden", onClick: s, onFocus: m, onMouseDown: S, tabIndex: -1, children: [
465
485
  /* @__PURE__ */ n.jsx("span", { className: "absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none", ref: u }),
466
486
  /* @__PURE__ */ n.jsx("span", { className: "absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none", ref: h }),
467
- /* @__PURE__ */ n.jsx("span", { className: "absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none", ref: g }),
487
+ /* @__PURE__ */ n.jsx("span", { className: "absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none", ref: v }),
468
488
  /* @__PURE__ */ n.jsx("span", { className: "absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none", ref: d }),
469
489
  /* @__PURE__ */ n.jsx("div", { className: "absolute w-full text-xs after:mt-2 after:block", ref: f })
470
490
  ] });
471
- }, le = typeof window < "u" ? he : Y, De = (r) => {
472
- const { menuList: t, menuHeader: a, onClickSignout: l, isMenuhide: c, theme: i, toggleTheme: u, onMenuNavigate: h, onPinChange: g, pinnedSubmenuIds: d, initialPinnedSubmenuIds: f, onSubmenuPinChange: k } = r, [v, s] = D(() => {
491
+ }, ce = typeof window < "u" ? ue : M, $e = (t) => {
492
+ const { menuList: r, menuHeader: a, onClickSignout: l, isMenuhide: c, theme: i, toggleTheme: u, onMenuNavigate: h, onPinChange: v, pinnedSubmenuIds: d, initialPinnedSubmenuIds: f, onSubmenuPinChange: y, closeOnEscape: j = "auto" } = t, [x, T] = Y(() => {
473
493
  try {
474
494
  return localStorage.getItem("aiquants-menu-pinned") === "true";
475
495
  } catch {
476
496
  return !1;
477
497
  }
478
- }), [m, N] = D(v), [S, O] = D(() => {
498
+ }), [s, m] = Y(x), [S, E] = Y(() => {
479
499
  if (f)
480
500
  return f;
481
501
  try {
482
- const y = localStorage.getItem("aiquants-submenu-pinned");
483
- if (y) {
484
- const E = JSON.parse(y);
485
- if (Array.isArray(E))
486
- return E.filter((_) => typeof _ == "number");
502
+ const k = localStorage.getItem("aiquants-submenu-pinned");
503
+ if (k) {
504
+ const N = JSON.parse(k);
505
+ if (Array.isArray(N))
506
+ return N.filter((C) => typeof C == "number");
487
507
  }
488
508
  } catch {
489
509
  }
490
510
  return [];
491
- }), j = d !== void 0 ? d : S, $ = w(
492
- (y) => {
493
- const E = d !== void 0 ? d : S, _ = E.includes(y) ? E.filter((A) => A !== y) : [...E, y];
511
+ }), $ = d !== void 0 ? d : S, z = w(
512
+ (k) => {
513
+ const N = d !== void 0 ? d : S, C = N.includes(k) ? N.filter((H) => H !== k) : [...N, k];
494
514
  if (d === void 0) {
495
- O(_);
515
+ E(C);
496
516
  try {
497
- localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(_));
517
+ localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(C));
498
518
  } catch {
499
519
  }
500
520
  }
501
- k && k(_);
521
+ y && y(C);
502
522
  },
503
- [d, S, k]
523
+ [d, S, y]
504
524
  );
505
- le(() => {
506
- const y = v ? "250px" : "0px";
507
- document.documentElement.style.setProperty("--aiquants-menu-pinned-width", y), g?.(v);
508
- }, [v, g]), le(() => () => {
525
+ ce(() => {
526
+ const k = x ? "250px" : "0px";
527
+ document.documentElement.style.setProperty("--aiquants-menu-pinned-width", k), v?.(x);
528
+ }, [x, v]), ce(() => () => {
509
529
  document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px");
510
530
  }, []);
511
- const z = w(() => {
512
- N(!0);
513
- }, []), R = w(() => {
514
- N(!1), s(!1);
531
+ const F = w(() => {
532
+ m(!0);
533
+ }, []), P = w(() => {
534
+ m(!1), T(!1);
515
535
  try {
516
536
  localStorage.removeItem("aiquants-menu-pinned");
517
537
  } catch {
518
538
  }
519
- }, []), F = w(() => {
520
- s((y) => {
521
- const E = !y;
522
- if (E)
539
+ }, []), W = w(() => {
540
+ T((k) => {
541
+ const N = !k;
542
+ if (N)
523
543
  try {
524
544
  localStorage.setItem("aiquants-menu-pinned", "true");
525
545
  } catch {
@@ -529,45 +549,44 @@ const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
529
549
  localStorage.removeItem("aiquants-menu-pinned");
530
550
  } catch {
531
551
  }
532
- return E;
552
+ return N;
533
553
  });
534
- }, []), W = w(
535
- (y) => {
536
- h && h(y), v || N(!1);
554
+ }, []), U = w(
555
+ (k) => {
556
+ h && h(k), x || m(!1);
537
557
  },
538
- [h, v]
539
- ), P = w(
540
- (y) => {
541
- if (y.key === "Escape")
542
- return R(), !1;
558
+ [h, x]
559
+ ), R = w(
560
+ (k) => {
561
+ k.key === "Escape" && P();
543
562
  },
544
- [R]
545
- );
546
- return Y(() => (m ? window.addEventListener("keydown", P, { passive: !0 }) : window.removeEventListener("keydown", P), () => {
547
- window.removeEventListener("keydown", P);
548
- }), [m, P]), c ? null : /* @__PURE__ */ n.jsxs("div", { className: `aiquants-menu-bar ${i}`, children: [
549
- /* @__PURE__ */ n.jsx(Ae, { onMenuClose: R, onMenuOpen: z, open: !m, theme: i }),
563
+ [P]
564
+ ), L = j === !0 || j === "auto" && !x;
565
+ return M(() => (s && L ? window.addEventListener("keydown", R, { passive: !0 }) : window.removeEventListener("keydown", R), () => {
566
+ window.removeEventListener("keydown", R);
567
+ }), [s, L, R]), c ? null : /* @__PURE__ */ n.jsxs("div", { className: `aiquants-menu-bar ${i}`, children: [
568
+ /* @__PURE__ */ n.jsx(Me, { onMenuClose: P, onMenuOpen: F, open: !s, theme: i }),
550
569
  /* @__PURE__ */ n.jsx(
551
- Ce,
570
+ Ie,
552
571
  {
553
- menuList: t,
572
+ menuList: r,
554
573
  menuHeader: a,
555
574
  onClickSignout: l,
556
- onMenuSelected: W,
557
- open: m,
575
+ onMenuSelected: U,
576
+ open: s,
558
577
  theme: i,
559
578
  toggleTheme: u,
560
- isPinned: v,
561
- onTogglePin: F,
562
- pinnedSubmenuIds: j,
563
- onToggleSubmenuPin: $
579
+ isPinned: x,
580
+ onTogglePin: W,
581
+ pinnedSubmenuIds: $,
582
+ onToggleSubmenuPin: z
564
583
  }
565
584
  ),
566
- /* @__PURE__ */ n.jsx(Oe, { isOverlay: m && !v, onOverlayClick: R })
585
+ /* @__PURE__ */ n.jsx(Ae, { isOverlay: s && !x, onOverlayClick: P })
567
586
  ] });
568
587
  };
569
588
  export {
570
- Se as DefaultLink,
571
- De as MenuBar,
572
- qe as SessionInfo
589
+ Te as DefaultLink,
590
+ $e as MenuBar,
591
+ Ye as SessionInfo
573
592
  };
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(E,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],o):(E=typeof globalThis<"u"?globalThis:E||self,o(E["@aiquants/menu-bar"]={},E.React,E["lucide-react"],E.ReactRouterDOM))})(this,(function(E,o,S,z){"use strict";var D={exports:{}},I={};var G;function ie(){if(G)return I;G=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(i,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var b in u)b!=="key"&&(c[b]=u[b])}else c=u;return u=c.ref,{$$typeof:t,type:i,key:d,ref:u!==void 0?u:null,props:c}}return I.Fragment=r,I.jsx=l,I.jsxs=l,I}var M={};var B;function ce(){return B||(B=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case j:return"Profiler";case A:return"StrictMode";case H:return"Suspense";case J:return"SuspenseList";case N:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case T:return"Portal";case U:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case P:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return a=e.displayName||null,a!==null?a:t(e.type)||"Memo";case k:a=e._payload,e=e._init;try{return t(e(a))}catch{}}return null}function r(e){return""+e}function l(e){try{r(e);var a=!1}catch{a=!0}if(a){a=console;var h=a.error,x=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",x),r(e)}}function i(e){if(e===C)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===k)return"<...>";try{var a=t(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function u(){var e=L.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function d(e){if(te.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function b(e,a){function h(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}function v(){var e=t(this.type);return se[e]||(se[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,a,h,x,Y,V){var g=h.ref;return e={$$typeof:p,type:e,key:a,props:h,_owner:x},(g!==void 0?g:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e,a,h,x,Y,V){var g=a.children;if(g!==void 0)if(x)if(ke(g)){for(x=0;x<g.length;x++)w(g[x]);Object.freeze&&Object.freeze(g)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(g);if(te.call(a,"key")){g=t(e);var O=Object.keys(a).filter(function(we){return we!=="key"});x=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",le[g+x]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(T,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],o):(T=typeof globalThis<"u"?globalThis:T||self,o(T["@aiquants/menu-bar"]={},T.React,T["lucide-react"],T.ReactRouterDOM))})(this,(function(T,o,C,z){"use strict";var L={exports:{}},A={};var Q;function ue(){if(Q)return A;Q=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(i,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var b in u)b!=="key"&&(c[b]=u[b])}else c=u;return u=c.ref,{$$typeof:t,type:i,key:d,ref:u!==void 0?u:null,props:c}}return A.Fragment=r,A.jsx=l,A.jsxs=l,A}var M={};var X;function de(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===w?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case O:return"Suspense";case J:return"SuspenseList";case D:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case s:return"Portal";case U:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case H:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return a=e.displayName||null,a!==null?a:t(e.type)||"Memo";case R:a=e._payload,e=e._init;try{return t(e(a))}catch{}}return null}function r(e){return""+e}function l(e){try{r(e);var a=!1}catch{a=!0}if(a){a=console;var h=a.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),r(e)}}function i(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===R)return"<...>";try{var a=t(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function d(e){if(P.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function b(e,a){function h(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}function v(){var e=t(this.type);return ae[e]||(ae[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,a,h,g,Y,B){var y=h.ref;return e={$$typeof:_,type:e,key:a,props:h,_owner:g},(y!==void 0?y:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e,a,h,g,Y,B){var y=a.children;if(y!==void 0)if(g)if(V(y)){for(g=0;g<y.length;g++)k(y[g]);Object.freeze&&Object.freeze(y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(y);if(P.call(a,"key")){y=t(e);var I=Object.keys(a).filter(function(Ee){return Ee!=="key"});g=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",ce[y+g]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,x,g,O,g),le[g+x]=!0)}if(g=null,h!==void 0&&(l(h),g=""+h),d(a)&&(l(a.key),g=""+a.key),"key"in a){h={};for(var Z in a)Z!=="key"&&(h[Z]=a[Z])}else h=a;return g&&b(h,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,g,h,u(),Y,V)}function w(e){y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===k&&(e._payload.status==="fulfilled"?y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function y(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}var s=o,p=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),U=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),L=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,ke=Array.isArray,q=console.createTask?console.createTask:function(){return null};s={react_stack_bottom_frame:function(e){return e()}};var re,se={},oe=s.react_stack_bottom_frame.bind(s,c)(),ae=q(i(c)),le={};M.Fragment=C,M.jsx=function(e,a,h){var x=1e4>L.recentlyCreatedOwnerStacks++;return m(e,a,h,!1,x?Error("react-stack-top-frame"):oe,x?q(i(e)):ae)},M.jsxs=function(e,a,h){var x=1e4>L.recentlyCreatedOwnerStacks++;return m(e,a,h,!0,x?Error("react-stack-top-frame"):oe,x?q(i(e)):ae)}})()),M}var Q;function ue(){return Q||(Q=1,process.env.NODE_ENV==="production"?D.exports=ie():D.exports=ce()),D.exports}var n=ue();const de="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",X=({to:t,className:r,children:l})=>n.jsx("a",{href:t,className:r,children:l}),fe=t=>{const{user:r,LinkComponent:l=X}=t;return n.jsx("div",{className:"max-h-20 max-w-52",children:n.jsx("div",{className:"flex grow flex-col",children:r?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-row",children:[n.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:n.jsx("img",{className:"object-contain",src:r.photo||de,"aria-label":"profile photo"})}),n.jsxs("div",{className:"mx-1 flex flex-col",children:[n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),n.jsx(l,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs",children:r.displayName})]}):n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs",children:"ログインはこちら"})})})},K=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),me={report:S.FileText,slip:S.FileText,table:S.Table,chart:S.BarChart,download:S.Download,lock:S.Lock,href:S.Link},pe=({mark:t,children:r})=>{const l=t?me[t]:void 0;return l?n.jsxs("div",{className:"flex flex-nowrap items-center",children:[n.jsx(l,{className:"h-4 w-4"}),n.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:r})]}):n.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:r})},F=(t,r)=>r?{menu:{id:t.id,title:t.title,href:t.href},submenu:{subid:r.subid,title:r.title,href:r.href,mark:r.mark,new:r.new}}:{menu:{id:t.id,title:t.title,href:t.href}},he=({item:t,parentMenu:r,onMenuSelected:l})=>{if(t.href==="separator")return n.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const i=n.jsx(pe,{mark:t.mark,children:t.title}),u={onClick:()=>{l&&l(F(r,t))}};return t.new?n.jsx("a",{href:t.href,rel:"noopener noreferrer",target:"_blank",...u,children:i}):K.test(t.href)?n.jsx("a",{href:t.href,...u,children:i}):n.jsx(z.Link,{to:t.href,...u,children:i})},$=t=>t?t.split(/[?#]/)[0].replace(/(?!^\/)\/$/,""):"",ee=(t,r)=>{const l=r!=="/"&&r.endsWith("/")?r.slice(0,-1):r;for(const i of t){if($(i.href)===l)return i.id;if(i.submenu){for(const u of i.submenu)if($(u.href)===l)return i.id}}return null},be=t=>{const{menuList:r,onMenuSelected:l,pinnedSubmenuIds:i=[],onToggleSubmenuPin:u}=t;let c="";try{c=z.useLocation().pathname}catch{typeof window<"u"&&(c=window.location.pathname)}const d=o.useMemo(()=>ee(r,c),[r,c]),[b,v]=o.useState(d),f=o.useRef(c),m=o.useRef(d!==null);o.useEffect(()=>{if(f.current!==c&&(f.current=c,m.current=!1),!m.current){const s=ee(r,c);s!==null&&(v(s),m.current=!0)}},[c,r]);const w=o.useCallback(s=>{i.includes(s)||v(T=>T===s?null:s)},[i]),y=o.useMemo(()=>n.jsx(n.Fragment,{children:r.map(s=>n.jsx("div",{children:s.href?n.jsx("div",{className:"aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",children:K.test(s.href)?n.jsx("a",{href:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})}):n.jsx(z.Link,{to:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})})}):n.jsxs("details",{className:"aiquants-menu-accordion-details",open:s.id===b||i.includes(s.id),children:[n.jsxs("summary",{className:"aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 text-sm outline-none before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:content-['']",onClick:p=>{p.preventDefault(),w(s.id)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),w(s.id))},children:[n.jsx("span",{children:s.title}),n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),p.preventDefault(),u&&u(s.id)},className:`aiquants-submenu-pin-button ${i.includes(s.id)?"pinned":""}`,title:i.includes(s.id)?"ピン留め解除":"ピン留め",children:i.includes(s.id)?n.jsx(S.Pin,{size:14}):n.jsx(S.PinOff,{size:14})})]}),n.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:s.submenu.map(p=>n.jsx("div",{className:"aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm",children:n.jsx(he,{item:p,parentMenu:s,onMenuSelected:l})},p.subid))})]})},s.id))}),[r,l,b,w,i]);return n.jsx("div",{className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:y})},xe=t=>{const{menuList:r,menuHeader:l,open:i,onMenuSelected:u,onClickSignout:c,theme:d,toggleTheme:b,isPinned:v,onTogglePin:f,pinnedSubmenuIds:m,onToggleSubmenuPin:w}=t;return n.jsxs("div",{className:`aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[250px] select-none flex-col transition-transform duration-500 ${i?"aiquants-menu-translate-x-0":"aiquants-menu-translate-x-250"}`,children:[n.jsx("div",{className:"flex h-[100px] flex-col",children:l}),n.jsx("div",{className:"flex grow flex-col",children:n.jsx(be,{menuList:r,onMenuSelected:u,pinnedSubmenuIds:m,onToggleSubmenuPin:w})}),n.jsx("div",{className:"px-4 pt-2 pb-4",children:n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("button",{type:"button",onClick:f,className:`flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${v?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:v?"ピン留め解除":"ピン留め",children:v?n.jsx(S.Pin,{size:14}):n.jsx(S.PinOff,{size:14})}),n.jsxs("button",{type:"button",onClick:b,className:"group relative flex flex-1 items-center gap-2 rounded-lg border border-white/15 bg-white/10 px-3 py-2 font-medium text-white text-xs shadow-sm backdrop-blur-sm transition-all duration-300 hover:border-white/25 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-offset-0 dark:border-gray-600/40 dark:bg-gray-800/80 dark:hover:border-gray-500/60 dark:hover:bg-gray-700",children:[n.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white/20 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-white/30 dark:bg-gray-600/60 dark:group-hover:bg-gray-500/70",children:n.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),n.jsx("span",{className:"text-white transition-colors duration-300 group-hover:text-white/90 dark:text-gray-200 dark:group-hover:text-white",children:d==="dark"?"Light":"Dark"}),n.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 dark:via-gray-400/10"})]}),n.jsx("button",{type:"button",className:"aiquants-signout-button flex items-center justify-center rounded-md bg-red-500/90 px-3 py-2 font-medium text-white text-xs shadow-sm transition-colors duration-300 hover:bg-red-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300/60",onClick:c,children:"サインアウト"})]})})]})},ge=t=>{const{isOverlay:r,onOverlayClick:l}=t;return n.jsx("button",{type:"button",className:`fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${r?"opacity-100":"pointer-events-none opacity-0"}`,onClick:l})},ve=t=>{const{open:r,onMenuOpen:l,onMenuClose:i,theme:u}=t,c=o.useRef(r),d=o.useRef(null),b=o.useRef(null),v=o.useRef(null),f=o.useRef(null),m=o.useRef(null),w=o.useCallback(()=>{if(d.current&&b.current&&v.current&&f.current&&m.current){const j=u==="dark"?"#fff":"#000";d.current.style.backgroundColor=j,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",b.current.style.opacity="1",b.current.style.backgroundColor=j,v.current.style.opacity="1",v.current.style.backgroundColor=j,f.current.style.backgroundColor=j,f.current.style.width="100%",f.current.style.height="3px",f.current.style.transform="",m.current.style.color=j,m.current.classList.remove("after:content-['close']"),m.current.classList.remove("after:ml-0.5"),m.current.classList.add("after:content-['menu']"),m.current.classList.add("after:-ml-0.5"),c.current=!0}},[u]),y=o.useCallback(()=>{d.current&&b.current&&v.current&&f.current&&m.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",b.current.style.opacity="0",v.current.style.opacity="0",f.current.style.backgroundColor="#fff",f.current.style.width="32px",f.current.style.height="4px",f.current.style.transform="translateY(-9px) rotate(45deg)",m.current.style.color="#fff",m.current.classList.remove("after:content-['menu']"),m.current.classList.remove("after:-ml-0.5"),m.current.classList.add("after:content-['close']"),m.current.classList.add("after:ml-0.5"),c.current=!1)},[]),s=o.useCallback(()=>{w(),i&&i()},[w,i]),p=o.useCallback(()=>{y(),l&&l()},[y,l]),T=o.useCallback(()=>{c.current?p():s()},[s,p]),C=o.useCallback(j=>{j.currentTarget.blur()},[]),A=o.useCallback(j=>{j.preventDefault()},[]);return o.useEffect(()=>{r?w():y()},[r,w,y]),n.jsxs("button",{type:"button",className:"aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden",onClick:T,onFocus:C,onMouseDown:A,tabIndex:-1,children:[n.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),n.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:b}),n.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:v}),n.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:f}),n.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:m})]})},ne=typeof window<"u"?o.useLayoutEffect:o.useEffect,ye=t=>{const{menuList:r,menuHeader:l,onClickSignout:i,isMenuhide:u,theme:c,toggleTheme:d,onMenuNavigate:b,onPinChange:v,pinnedSubmenuIds:f,initialPinnedSubmenuIds:m,onSubmenuPinChange:w}=t,[y,s]=o.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[p,T]=o.useState(y),[C,A]=o.useState(()=>{if(m)return m;try{const k=localStorage.getItem("aiquants-submenu-pinned");if(k){const N=JSON.parse(k);if(Array.isArray(N))return N.filter(_=>typeof _=="number")}}catch{}return[]}),j=f!==void 0?f:C,W=o.useCallback(k=>{const N=f!==void 0?f:C,_=N.includes(k)?N.filter(L=>L!==k):[...N,k];if(f===void 0){A(_);try{localStorage.setItem("aiquants-submenu-pinned",JSON.stringify(_))}catch{}}w&&w(_)},[f,C,w]);ne(()=>{const k=y?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",k),v?.(y)},[y,v]),ne(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const U=o.useCallback(()=>{T(!0)},[]),P=o.useCallback(()=>{T(!1),s(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),H=o.useCallback(()=>{s(k=>{const N=!k;if(N)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return N})},[]),J=o.useCallback(k=>{b&&b(k),y||T(!1)},[b,y]),R=o.useCallback(k=>{if(k.key==="Escape")return P(),!1},[P]);return o.useEffect(()=>(p?window.addEventListener("keydown",R,{passive:!0}):window.removeEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}),[p,R]),u?null:n.jsxs("div",{className:`aiquants-menu-bar ${c}`,children:[n.jsx(ve,{onMenuClose:P,onMenuOpen:U,open:!p,theme:c}),n.jsx(xe,{menuList:r,menuHeader:l,onClickSignout:i,onMenuSelected:J,open:p,theme:c,toggleTheme:d,isPinned:y,onTogglePin:H,pinnedSubmenuIds:j,onToggleSubmenuPin:W}),n.jsx(ge,{isOverlay:p&&!y,onOverlayClick:P})]})};E.DefaultLink=X,E.MenuBar=ye,E.SessionInfo=fe,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,g,y,I,y),ce[y+g]=!0)}if(y=null,h!==void 0&&(l(h),y=""+h),d(a)&&(l(a.key),y=""+a.key),"key"in a){h={};for(var q in a)q!=="key"&&(h[q]=a[q])}else h=a;return y&&b(h,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,y,h,u(),Y,B)}function k(e){j(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===R&&(e._payload.status==="fulfilled"?j(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function j(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}var x=o,_=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),S=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,Z=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(e){return e()}};var oe,ae={},le=x.react_stack_bottom_frame.bind(x,c)(),ie=Z(i(c)),ce={};M.Fragment=p,M.jsx=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!1,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)},M.jsxs=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!0,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)}})()),M}var K;function fe(){return K||(K=1,process.env.NODE_ENV==="production"?L.exports=ue():L.exports=de()),L.exports}var n=fe();const me="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",$=({to:t,className:r,children:l})=>n.jsx("a",{href:t,className:r,children:l}),pe=t=>{const{user:r,LinkComponent:l=$}=t;return n.jsx("div",{className:"max-h-20 max-w-52",children:n.jsx("div",{className:"flex grow flex-col",children:r?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-row",children:[n.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:n.jsx("img",{className:"object-contain",src:r.photo||me,"aria-label":"profile photo"})}),n.jsxs("div",{className:"mx-1 flex flex-col",children:[n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),n.jsx(l,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs",children:r.displayName})]}):n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs",children:"ログインはこちら"})})})},he=typeof window<"u"?o.useLayoutEffect:o.useEffect,ee="aiquants-menu-scroll",ne=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),be={report:C.FileText,slip:C.FileText,table:C.Table,chart:C.BarChart,download:C.Download,lock:C.Lock,href:C.Link},xe=({mark:t,children:r})=>{const l=t?be[t]:void 0;return l?n.jsxs("div",{className:"flex flex-nowrap items-center",children:[n.jsx(l,{className:"h-4 w-4"}),n.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:r})]}):n.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:r})},F=(t,r)=>r?{menu:{id:t.id,title:t.title,href:t.href},submenu:{subid:r.subid,title:r.title,href:r.href,mark:r.mark,new:r.new}}:{menu:{id:t.id,title:t.title,href:t.href}},ge=({item:t,parentMenu:r,onMenuSelected:l})=>{if(t.href==="separator")return n.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const i=n.jsx(xe,{mark:t.mark,children:t.title}),u={onClick:()=>{l&&l(F(r,t))}};return t.new?n.jsx("a",{href:t.href,rel:"noopener noreferrer",target:"_blank",...u,children:i}):ne.test(t.href)?n.jsx("a",{href:t.href,...u,children:i}):n.jsx(z.Link,{to:t.href,...u,children:i})},te=t=>t?t.split(/[?#]/)[0].replace(/(?!^\/)\/$/,""):"",re=(t,r)=>{const l=r!=="/"&&r.endsWith("/")?r.slice(0,-1):r;for(const i of t){if(te(i.href)===l)return i.id;if(i.submenu){for(const u of i.submenu)if(te(u.href)===l)return i.id}}return null},ye=t=>{const{menuList:r,onMenuSelected:l,pinnedSubmenuIds:i=[],onToggleSubmenuPin:u}=t;let c="";try{c=z.useLocation().pathname}catch{typeof window<"u"&&(c=window.location.pathname)}const d=o.useMemo(()=>re(r,c),[r,c]),[b,v]=o.useState(d),f=o.useRef(c),m=o.useRef(d!==null);o.useEffect(()=>{if(f.current!==c&&(f.current=c,m.current=!1),!m.current){const s=re(r,c);s!==null&&(v(s),m.current=!0)}},[c,r]);const k=o.useCallback(s=>{i.includes(s)||v(N=>N===s?null:s)},[i]),j=o.useRef(null);he(()=>{const s=j.current;if(s)try{const p=sessionStorage.getItem(ee);if(p!==null){const N=Number.parseFloat(p);Number.isNaN(N)||(s.scrollTop=N)}}catch{}},[]);const x=o.useCallback(()=>{const s=j.current;if(s)try{sessionStorage.setItem(ee,String(s.scrollTop))}catch{}},[]),_=o.useMemo(()=>n.jsx(n.Fragment,{children:r.map(s=>n.jsx("div",{children:s.href?n.jsx("div",{className:"aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",children:ne.test(s.href)?n.jsx("a",{href:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})}):n.jsx(z.Link,{to:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})})}):n.jsxs("details",{className:"aiquants-menu-accordion-details",open:s.id===b||i.includes(s.id),children:[n.jsxs("summary",{className:"aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 text-sm outline-none before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:content-['']",onClick:p=>{p.preventDefault(),k(s.id)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),k(s.id))},children:[n.jsx("span",{children:s.title}),n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),p.preventDefault(),u&&u(s.id)},className:`aiquants-submenu-pin-button ${i.includes(s.id)?"pinned":""}`,title:i.includes(s.id)?"ピン留め解除":"ピン留め",children:i.includes(s.id)?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})})]}),n.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:s.submenu.map(p=>n.jsx("div",{className:"aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm",children:n.jsx(ge,{item:p,parentMenu:s,onMenuSelected:l})},p.subid))})]})},s.id))}),[r,l,b,k,i]);return n.jsx("div",{ref:j,onScroll:x,className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:_})},ve=t=>{const{menuList:r,menuHeader:l,open:i,onMenuSelected:u,onClickSignout:c,theme:d,toggleTheme:b,isPinned:v,onTogglePin:f,pinnedSubmenuIds:m,onToggleSubmenuPin:k}=t;return n.jsxs("div",{className:`aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[250px] select-none flex-col transition-transform duration-500 ${i?"aiquants-menu-translate-x-0":"aiquants-menu-translate-x-250"}`,children:[n.jsx("div",{className:"flex h-[100px] flex-col",children:l}),n.jsx("div",{className:"flex grow flex-col",children:n.jsx(ye,{menuList:r,onMenuSelected:u,pinnedSubmenuIds:m,onToggleSubmenuPin:k})}),n.jsx("div",{className:"px-4 pt-2 pb-4",children:n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("button",{type:"button",onClick:f,className:`flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${v?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:v?"ピン留め解除":"ピン留め",children:v?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})}),n.jsxs("button",{type:"button",onClick:b,className:"group relative flex flex-1 items-center gap-2 rounded-lg border border-white/15 bg-white/10 px-3 py-2 font-medium text-white text-xs shadow-sm backdrop-blur-sm transition-all duration-300 hover:border-white/25 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-offset-0 dark:border-gray-600/40 dark:bg-gray-800/80 dark:hover:border-gray-500/60 dark:hover:bg-gray-700",children:[n.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white/20 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-white/30 dark:bg-gray-600/60 dark:group-hover:bg-gray-500/70",children:n.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),n.jsx("span",{className:"text-white transition-colors duration-300 group-hover:text-white/90 dark:text-gray-200 dark:group-hover:text-white",children:d==="dark"?"Light":"Dark"}),n.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 dark:via-gray-400/10"})]}),n.jsx("button",{type:"button",className:"aiquants-signout-button flex items-center justify-center rounded-md bg-red-500/90 px-3 py-2 font-medium text-white text-xs shadow-sm transition-colors duration-300 hover:bg-red-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300/60",onClick:c,children:"サインアウト"})]})})]})},ke=t=>{const{isOverlay:r,onOverlayClick:l}=t;return n.jsx("button",{type:"button",className:`fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${r?"opacity-100":"pointer-events-none opacity-0"}`,onClick:l})},we=t=>{const{open:r,onMenuOpen:l,onMenuClose:i,theme:u}=t,c=o.useRef(r),d=o.useRef(null),b=o.useRef(null),v=o.useRef(null),f=o.useRef(null),m=o.useRef(null),k=o.useCallback(()=>{if(d.current&&b.current&&v.current&&f.current&&m.current){const E=u==="dark"?"#fff":"#000";d.current.style.backgroundColor=E,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",b.current.style.opacity="1",b.current.style.backgroundColor=E,v.current.style.opacity="1",v.current.style.backgroundColor=E,f.current.style.backgroundColor=E,f.current.style.width="100%",f.current.style.height="3px",f.current.style.transform="",m.current.style.color=E,m.current.classList.remove("after:content-['close']"),m.current.classList.remove("after:ml-0.5"),m.current.classList.add("after:content-['menu']"),m.current.classList.add("after:-ml-0.5"),c.current=!0}},[u]),j=o.useCallback(()=>{d.current&&b.current&&v.current&&f.current&&m.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",b.current.style.opacity="0",v.current.style.opacity="0",f.current.style.backgroundColor="#fff",f.current.style.width="32px",f.current.style.height="4px",f.current.style.transform="translateY(-9px) rotate(45deg)",m.current.style.color="#fff",m.current.classList.remove("after:content-['menu']"),m.current.classList.remove("after:-ml-0.5"),m.current.classList.add("after:content-['close']"),m.current.classList.add("after:ml-0.5"),c.current=!1)},[]),x=o.useCallback(()=>{k(),i&&i()},[k,i]),_=o.useCallback(()=>{j(),l&&l()},[j,l]),s=o.useCallback(()=>{c.current?_():x()},[x,_]),p=o.useCallback(E=>{E.currentTarget.blur()},[]),N=o.useCallback(E=>{E.preventDefault()},[]);return o.useEffect(()=>{r?k():j()},[r,k,j]),n.jsxs("button",{type:"button",className:"aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden",onClick:s,onFocus:p,onMouseDown:N,tabIndex:-1,children:[n.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),n.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:b}),n.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:v}),n.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:f}),n.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:m})]})},se=typeof window<"u"?o.useLayoutEffect:o.useEffect,je=t=>{const{menuList:r,menuHeader:l,onClickSignout:i,isMenuhide:u,theme:c,toggleTheme:d,onMenuNavigate:b,onPinChange:v,pinnedSubmenuIds:f,initialPinnedSubmenuIds:m,onSubmenuPinChange:k,closeOnEscape:j="auto"}=t,[x,_]=o.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[s,p]=o.useState(x),[N,E]=o.useState(()=>{if(m)return m;try{const w=localStorage.getItem("aiquants-submenu-pinned");if(w){const S=JSON.parse(w);if(Array.isArray(S))return S.filter(P=>typeof P=="number")}}catch{}return[]}),W=f!==void 0?f:N,U=o.useCallback(w=>{const S=f!==void 0?f:N,P=S.includes(w)?S.filter(V=>V!==w):[...S,w];if(f===void 0){E(P);try{localStorage.setItem("aiquants-submenu-pinned",JSON.stringify(P))}catch{}}k&&k(P)},[f,N,k]);se(()=>{const w=x?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",w),v?.(x)},[x,v]),se(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const H=o.useCallback(()=>{p(!0)},[]),O=o.useCallback(()=>{p(!1),_(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),J=o.useCallback(()=>{_(w=>{const S=!w;if(S)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return S})},[]),G=o.useCallback(w=>{b&&b(w),x||p(!1)},[b,x]),R=o.useCallback(w=>{w.key==="Escape"&&O()},[O]),D=j===!0||j==="auto"&&!x;return o.useEffect(()=>(s&&D?window.addEventListener("keydown",R,{passive:!0}):window.removeEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}),[s,D,R]),u?null:n.jsxs("div",{className:`aiquants-menu-bar ${c}`,children:[n.jsx(we,{onMenuClose:O,onMenuOpen:H,open:!s,theme:c}),n.jsx(ve,{menuList:r,menuHeader:l,onClickSignout:i,onMenuSelected:G,open:s,theme:c,toggleTheme:d,isPinned:x,onTogglePin:J,pinnedSubmenuIds:W,onToggleSubmenuPin:U}),n.jsx(ke,{isOverlay:s&&!x,onOverlayClick:O})]})};T.DefaultLink=$,T.MenuBar=je,T.SessionInfo=pe,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/menu-bar",
3
- "version": "1.15.1",
3
+ "version": "1.16.0",
4
4
  "private": false,
5
5
  "description": "A React menu bar component with authentication support and theming",
6
6
  "keywords": [