@aiquants/menu-bar 1.12.0 → 1.13.1

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.
@@ -57,12 +57,5 @@ interface IMenuListProps {
57
57
  menuList: IMenu[];
58
58
  onMenuSelected?(payload: MenuNavigationPayload): void;
59
59
  }
60
- /**
61
- * @function MenuList
62
- * @description A component that renders the list of menu items.
63
- * @description メニュー項目のリストを描画するコンポーネント。
64
- * @param {IMenuListProps} props - The props for the component.
65
- * @returns {React.JSX.Element} The rendered menu list.
66
- */
67
60
  export declare const MenuList: (props: IMenuListProps) => React.JSX.Element;
68
61
  export {};
package/dist/index.es.js CHANGED
@@ -1,50 +1,50 @@
1
- import ie, { useState as Y, useCallback as v, useMemo as ce, useRef as _, useEffect as A } from "react";
2
- import { Link as ue, Lock as de, Download as fe, BarChart as me, Table as he, FileText as Z, Pin as xe, PinOff as pe } from "lucide-react";
3
- import { Link as Q } from "react-router-dom";
1
+ import fe, { useMemo as Z, useState as Y, useRef as E, useEffect as A, useCallback as y, useLayoutEffect as me } from "react";
2
+ import { Link as he, Lock as pe, Download as xe, BarChart as be, Table as ge, FileText as G, Pin as ve, PinOff as ye } from "lucide-react";
3
+ import { useLocation as ke, Link as re } from "react-router-dom";
4
4
  var P = { exports: {} }, R = {};
5
- var G;
6
- function be() {
7
- if (G) return R;
8
- G = 1;
9
- var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
10
- function a(m, i, c) {
5
+ var J;
6
+ function we() {
7
+ if (J) return R;
8
+ J = 1;
9
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
10
+ function s(l, c, d) {
11
11
  var u = null;
12
- if (c !== void 0 && (u = "" + c), i.key !== void 0 && (u = "" + i.key), "key" in i) {
13
- c = {};
14
- for (var s in i)
15
- s !== "key" && (c[s] = i[s]);
16
- } else c = i;
17
- return i = c.ref, {
12
+ if (d !== void 0 && (u = "" + d), c.key !== void 0 && (u = "" + c.key), "key" in c) {
13
+ d = {};
14
+ for (var h in c)
15
+ h !== "key" && (d[h] = c[h]);
16
+ } else d = c;
17
+ return c = d.ref, {
18
18
  $$typeof: t,
19
- type: m,
19
+ type: l,
20
20
  key: u,
21
- ref: i !== void 0 ? i : null,
22
- props: c
21
+ ref: c !== void 0 ? c : null,
22
+ props: d
23
23
  };
24
24
  }
25
- return R.Fragment = o, R.jsx = a, R.jsxs = a, R;
25
+ return R.Fragment = n, R.jsx = s, R.jsxs = s, R;
26
26
  }
27
27
  var C = {};
28
- var J;
29
- function ge() {
30
- return J || (J = 1, process.env.NODE_ENV !== "production" && (function() {
28
+ var B;
29
+ function je() {
30
+ return B || (B = 1, process.env.NODE_ENV !== "production" && (function() {
31
31
  function t(e) {
32
32
  if (e == null) return null;
33
33
  if (typeof e == "function")
34
- return e.$$typeof === oe ? null : e.displayName || e.name || null;
34
+ return e.$$typeof === ce ? null : e.displayName || e.name || null;
35
35
  if (typeof e == "string") return e;
36
36
  switch (e) {
37
- case E:
37
+ case N:
38
38
  return "Fragment";
39
- case x:
39
+ case b:
40
40
  return "Profiler";
41
41
  case j:
42
42
  return "StrictMode";
43
- case re:
43
+ case se:
44
44
  return "Suspense";
45
- case te:
45
+ case ae:
46
46
  return "SuspenseList";
47
- case se:
47
+ case ie:
48
48
  return "Activity";
49
49
  }
50
50
  if (typeof e == "object")
@@ -53,98 +53,98 @@ function ge() {
53
53
  ), e.$$typeof) {
54
54
  case T:
55
55
  return "Portal";
56
- case K:
56
+ case ne:
57
57
  return e.displayName || "Context";
58
58
  case S:
59
59
  return (e._context.displayName || "Context") + ".Consumer";
60
- case ee:
61
- var n = e.render;
62
- return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
63
- case ne:
64
- return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
60
+ case oe:
61
+ var o = e.render;
62
+ return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
63
+ case le:
64
+ return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
65
65
  case M:
66
- n = e._payload, e = e._init;
66
+ o = e._payload, e = e._init;
67
67
  try {
68
- return t(e(n));
68
+ return t(e(o));
69
69
  } catch {
70
70
  }
71
71
  }
72
72
  return null;
73
73
  }
74
- function o(e) {
74
+ function n(e) {
75
75
  return "" + e;
76
76
  }
77
- function a(e) {
77
+ function s(e) {
78
78
  try {
79
- o(e);
80
- var n = !1;
79
+ n(e);
80
+ var o = !1;
81
81
  } catch {
82
- n = !0;
82
+ o = !0;
83
83
  }
84
- if (n) {
85
- n = console;
86
- var f = n.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
- return f.call(
88
- n,
84
+ if (o) {
85
+ o = console;
86
+ var m = o.error, g = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
+ return m.call(
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
- p
91
- ), o(e);
90
+ g
91
+ ), n(e);
92
92
  }
93
93
  }
94
- function m(e) {
95
- if (e === E) return "<>";
94
+ function l(e) {
95
+ if (e === N) return "<>";
96
96
  if (typeof e == "object" && e !== null && e.$$typeof === M)
97
97
  return "<...>";
98
98
  try {
99
- var n = t(e);
100
- return n ? "<" + n + ">" : "<...>";
99
+ var o = t(e);
100
+ return o ? "<" + o + ">" : "<...>";
101
101
  } catch {
102
102
  return "<...>";
103
103
  }
104
104
  }
105
- function i() {
105
+ function c() {
106
106
  var e = L.A;
107
107
  return e === null ? null : e.getOwner();
108
108
  }
109
- function c() {
109
+ function d() {
110
110
  return Error("react-stack-top-frame");
111
111
  }
112
112
  function u(e) {
113
- if (F.call(e, "key")) {
114
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
115
- if (n && n.isReactWarning) return !1;
113
+ if (z.call(e, "key")) {
114
+ var o = Object.getOwnPropertyDescriptor(e, "key").get;
115
+ if (o && o.isReactWarning) return !1;
116
116
  }
117
117
  return e.key !== void 0;
118
118
  }
119
- function s(e, n) {
120
- function f() {
121
- z || (z = !0, console.error(
119
+ function h(e, o) {
120
+ function m() {
121
+ F || (F = !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
- n
123
+ o
124
124
  ));
125
125
  }
126
- f.isReactWarning = !0, Object.defineProperty(e, "key", {
127
- get: f,
126
+ m.isReactWarning = !0, Object.defineProperty(e, "key", {
127
+ get: m,
128
128
  configurable: !0
129
129
  });
130
130
  }
131
- function l() {
131
+ function x() {
132
132
  var e = t(this.type);
133
- return U[e] || (U[e] = !0, console.error(
133
+ return W[e] || (W[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, n, f, p, O, q) {
138
- var b = f.ref;
137
+ function i(e, o, m, g, O, q) {
138
+ var v = m.ref;
139
139
  return e = {
140
140
  $$typeof: k,
141
141
  type: e,
142
- key: n,
143
- props: f,
144
- _owner: p
145
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(e, "ref", {
142
+ key: o,
143
+ props: m,
144
+ _owner: g
145
+ }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(e, "ref", {
146
146
  enumerable: !1,
147
- get: l
147
+ get: x
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,
@@ -167,61 +167,61 @@ function ge() {
167
167
  value: q
168
168
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
169
169
  }
170
- function h(e, n, f, p, O, q) {
171
- var b = n.children;
172
- if (b !== void 0)
173
- if (p)
174
- if (ae(b)) {
175
- for (p = 0; p < b.length; p++)
176
- g(b[p]);
177
- Object.freeze && Object.freeze(b);
170
+ function p(e, o, m, g, O, q) {
171
+ var v = o.children;
172
+ if (v !== void 0)
173
+ if (g)
174
+ if (ue(v)) {
175
+ for (g = 0; g < v.length; g++)
176
+ a(v[g]);
177
+ Object.freeze && Object.freeze(v);
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 g(b);
183
- if (F.call(n, "key")) {
184
- b = t(e);
185
- var N = Object.keys(n).filter(function(le) {
186
- return le !== "key";
182
+ else a(v);
183
+ if (z.call(o, "key")) {
184
+ v = t(e);
185
+ var _ = Object.keys(o).filter(function(de) {
186
+ return de !== "key";
187
187
  });
188
- p = 0 < N.length ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}", V[b + p] || (N = 0 < N.length ? "{" + N.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ g = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", V[v + g] || (_ = 0 < _.length ? "{" + _.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
- p,
196
- b,
197
- N,
198
- b
199
- ), V[b + p] = !0);
195
+ g,
196
+ v,
197
+ _,
198
+ v
199
+ ), V[v + g] = !0);
200
200
  }
201
- if (b = null, f !== void 0 && (a(f), b = "" + f), u(n) && (a(n.key), b = "" + n.key), "key" in n) {
202
- f = {};
203
- for (var D in n)
204
- D !== "key" && (f[D] = n[D]);
205
- } else f = n;
206
- return b && s(
207
- f,
201
+ if (v = null, m !== void 0 && (s(m), v = "" + m), u(o) && (s(o.key), v = "" + o.key), "key" in o) {
202
+ m = {};
203
+ for (var D in o)
204
+ D !== "key" && (m[D] = o[D]);
205
+ } else m = o;
206
+ return v && h(
207
+ m,
208
208
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
209
- ), d(
209
+ ), i(
210
210
  e,
211
- b,
212
- f,
213
- i(),
211
+ v,
212
+ m,
213
+ c(),
214
214
  O,
215
215
  q
216
216
  );
217
217
  }
218
- function g(e) {
219
- y(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === M && (e._payload.status === "fulfilled" ? y(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
+ function a(e) {
219
+ f(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === M && (e._payload.status === "fulfilled" ? f(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
220
220
  }
221
- function y(e) {
221
+ function f(e) {
222
222
  return typeof e == "object" && e !== null && e.$$typeof === k;
223
223
  }
224
- var w = ie, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), j = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), K = /* @__PURE__ */ Symbol.for("react.context"), ee = /* @__PURE__ */ Symbol.for("react.forward_ref"), re = /* @__PURE__ */ Symbol.for("react.suspense"), te = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), se = /* @__PURE__ */ Symbol.for("react.activity"), oe = /* @__PURE__ */ Symbol.for("react.client.reference"), L = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, ae = Array.isArray, I = console.createTask ? console.createTask : function() {
224
+ var w = fe, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), j = /* @__PURE__ */ Symbol.for("react.strict_mode"), b = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), ne = /* @__PURE__ */ Symbol.for("react.context"), oe = /* @__PURE__ */ Symbol.for("react.forward_ref"), se = /* @__PURE__ */ Symbol.for("react.suspense"), ae = /* @__PURE__ */ Symbol.for("react.suspense_list"), le = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), ie = /* @__PURE__ */ Symbol.for("react.activity"), ce = /* @__PURE__ */ Symbol.for("react.client.reference"), L = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, ue = Array.isArray, I = console.createTask ? console.createTask : function() {
225
225
  return null;
226
226
  };
227
227
  w = {
@@ -229,77 +229,77 @@ React keys must be passed directly to JSX without using spread:
229
229
  return e();
230
230
  }
231
231
  };
232
- var z, U = {}, W = w.react_stack_bottom_frame.bind(
232
+ var F, W = {}, U = w.react_stack_bottom_frame.bind(
233
233
  w,
234
- c
235
- )(), H = I(m(c)), V = {};
236
- C.Fragment = E, C.jsx = function(e, n, f) {
237
- var p = 1e4 > L.recentlyCreatedOwnerStacks++;
238
- return h(
234
+ d
235
+ )(), H = I(l(d)), V = {};
236
+ C.Fragment = N, C.jsx = function(e, o, m) {
237
+ var g = 1e4 > L.recentlyCreatedOwnerStacks++;
238
+ return p(
239
239
  e,
240
- n,
241
- f,
240
+ o,
241
+ m,
242
242
  !1,
243
- p ? Error("react-stack-top-frame") : W,
244
- p ? I(m(e)) : H
243
+ g ? Error("react-stack-top-frame") : U,
244
+ g ? I(l(e)) : H
245
245
  );
246
- }, C.jsxs = function(e, n, f) {
247
- var p = 1e4 > L.recentlyCreatedOwnerStacks++;
248
- return h(
246
+ }, C.jsxs = function(e, o, m) {
247
+ var g = 1e4 > L.recentlyCreatedOwnerStacks++;
248
+ return p(
249
249
  e,
250
- n,
251
- f,
250
+ o,
251
+ m,
252
252
  !0,
253
- p ? Error("react-stack-top-frame") : W,
254
- p ? I(m(e)) : H
253
+ g ? Error("react-stack-top-frame") : U,
254
+ g ? I(l(e)) : H
255
255
  );
256
256
  };
257
257
  })()), C;
258
258
  }
259
- var B;
260
- function ve() {
261
- return B || (B = 1, process.env.NODE_ENV === "production" ? P.exports = be() : P.exports = ge()), P.exports;
259
+ var Q;
260
+ function Ee() {
261
+ return Q || (Q = 1, process.env.NODE_ENV === "production" ? P.exports = we() : P.exports = je()), P.exports;
262
262
  }
263
- var r = ve();
264
- const ye = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", ke = ({ to: t, className: o, children: a }) => /* @__PURE__ */ r.jsx("a", { href: t, className: o, children: a }), Pe = (t) => {
265
- const { user: o, LinkComponent: a = ke } = t;
266
- return /* @__PURE__ */ r.jsx("div", { className: "max-h-20 max-w-52", children: /* @__PURE__ */ r.jsx("div", { className: "flex grow flex-col", children: o ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
263
+ var r = Ee();
264
+ const Ne = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==", _e = ({ to: t, className: n, children: s }) => /* @__PURE__ */ r.jsx("a", { href: t, className: n, children: s }), qe = (t) => {
265
+ const { user: n, LinkComponent: s = _e } = t;
266
+ return /* @__PURE__ */ r.jsx("div", { className: "max-h-20 max-w-52", children: /* @__PURE__ */ r.jsx("div", { className: "flex grow flex-col", children: n ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
267
267
  /* @__PURE__ */ r.jsxs("div", { className: "flex flex-row", children: [
268
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-session-photo m-1 h-14 w-14 p-0.5", children: /* @__PURE__ */ r.jsx("img", { className: "object-contain", src: o.photo || ye, "aria-label": "profile photo" }) }),
268
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-session-photo m-1 h-14 w-14 p-0.5", children: /* @__PURE__ */ r.jsx("img", { className: "object-contain", src: n.photo || Ne, "aria-label": "profile photo" }) }),
269
269
  /* @__PURE__ */ r.jsxs("div", { className: "mx-1 flex flex-col", children: [
270
- /* @__PURE__ */ r.jsx(a, { className: "aiquants-session-link my-1 rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィールを編集" }),
271
- /* @__PURE__ */ r.jsx(a, { className: "aiquants-session-link rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィール" }),
272
- /* @__PURE__ */ r.jsx(a, { className: "aiquants-session-link my-1 rounded-lg px-2 text-center text-xs", to: "https://myaccount.google.com/", children: "Google Account" })
270
+ /* @__PURE__ */ r.jsx(s, { className: "aiquants-session-link my-1 rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィールを編集" }),
271
+ /* @__PURE__ */ r.jsx(s, { className: "aiquants-session-link rounded-lg px-2 text-center text-xs", to: "/", children: "プロフィール" }),
272
+ /* @__PURE__ */ r.jsx(s, { 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__ */ r.jsx("div", { className: "aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs", children: o.displayName })
275
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs", children: n.displayName })
276
276
  ] }) : /* @__PURE__ */ r.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
- }, X = new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/), we = {
278
- report: Z,
279
- slip: Z,
280
- table: he,
281
- chart: me,
282
- download: fe,
283
- lock: de,
284
- href: ue
285
- }, je = ({ mark: t, children: o }) => {
286
- const a = t ? we[t] : void 0;
287
- return a ? /* @__PURE__ */ r.jsxs("div", { className: "flex flex-nowrap items-center", children: [
288
- /* @__PURE__ */ r.jsx(a, { className: "h-4 w-4" }),
289
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-link mx-1 hover:underline", children: o })
290
- ] }) : /* @__PURE__ */ r.jsx("span", { className: "mx-1 text-sky-600 hover:underline dark:text-sky-400", children: o });
291
- }, $ = (t, o) => o ? {
277
+ }, te = new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/), Te = {
278
+ report: G,
279
+ slip: G,
280
+ table: ge,
281
+ chart: be,
282
+ download: xe,
283
+ lock: pe,
284
+ href: he
285
+ }, Re = ({ mark: t, children: n }) => {
286
+ const s = t ? Te[t] : void 0;
287
+ return s ? /* @__PURE__ */ r.jsxs("div", { className: "flex flex-nowrap items-center", children: [
288
+ /* @__PURE__ */ r.jsx(s, { className: "h-4 w-4" }),
289
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-link mx-1 hover:underline", children: n })
290
+ ] }) : /* @__PURE__ */ r.jsx("span", { className: "mx-1 text-sky-600 hover:underline dark:text-sky-400", children: n });
291
+ }, $ = (t, n) => n ? {
292
292
  menu: {
293
293
  id: t.id,
294
294
  title: t.title,
295
295
  href: t.href
296
296
  },
297
297
  submenu: {
298
- subid: o.subid,
299
- title: o.title,
300
- href: o.href,
301
- mark: o.mark,
302
- new: o.new
298
+ subid: n.subid,
299
+ title: n.title,
300
+ href: n.href,
301
+ mark: n.mark,
302
+ new: n.new
303
303
  }
304
304
  } : {
305
305
  menu: {
@@ -307,74 +307,100 @@ const ye = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
307
307
  title: t.title,
308
308
  href: t.href
309
309
  }
310
- }, Ee = ({ item: t, parentMenu: o, onMenuSelected: a }) => {
310
+ }, Ce = ({ item: t, parentMenu: n, onMenuSelected: s }) => {
311
311
  if (t.href === "separator")
312
312
  return /* @__PURE__ */ r.jsx("hr", { className: "aiquants-menu-separator mx-2 my-1 h-px" });
313
- const m = /* @__PURE__ */ r.jsx(je, { mark: t.mark, children: t.title }), i = {
313
+ const l = /* @__PURE__ */ r.jsx(Re, { mark: t.mark, children: t.title }), c = {
314
314
  onClick: () => {
315
- a && a($(o, t));
315
+ s && s($(n, t));
316
316
  }
317
317
  };
318
- return t.new ? /* @__PURE__ */ r.jsx("a", { href: t.href, rel: "noopener noreferrer", target: "_blank", ...i, children: m }) : X.test(t.href) ? /* @__PURE__ */ r.jsx("a", { href: t.href, ...i, children: m }) : /* @__PURE__ */ r.jsx(Q, { to: t.href, ...i, children: m });
319
- }, Ne = (t) => {
320
- const { menuList: o, onMenuSelected: a } = t, [m, i] = Y(null), c = v((s) => {
321
- i((l) => l === s ? null : s);
322
- }, []), u = ce(() => /* @__PURE__ */ r.jsx(r.Fragment, { children: o.map((s) => /* @__PURE__ */ r.jsx("div", { children: s.href ? /* @__PURE__ */ r.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: X.test(s.href) ? /* @__PURE__ */ r.jsx(
318
+ return t.new ? /* @__PURE__ */ r.jsx("a", { href: t.href, rel: "noopener noreferrer", target: "_blank", ...c, children: l }) : te.test(t.href) ? /* @__PURE__ */ r.jsx("a", { href: t.href, ...c, children: l }) : /* @__PURE__ */ r.jsx(re, { to: t.href, ...c, children: l });
319
+ }, X = (t) => t ? t.split(/[?#]/)[0].replace(/(?!^\/)\/$/, "") : "", K = (t, n) => {
320
+ const s = n !== "/" && n.endsWith("/") ? n.slice(0, -1) : n;
321
+ for (const l of t) {
322
+ if (X(l.href) === s)
323
+ return l.id;
324
+ if (l.submenu) {
325
+ for (const c of l.submenu)
326
+ if (X(c.href) === s)
327
+ return l.id;
328
+ }
329
+ }
330
+ return null;
331
+ }, Se = (t) => {
332
+ const { menuList: n, onMenuSelected: s } = t;
333
+ let l = "";
334
+ try {
335
+ l = ke().pathname;
336
+ } catch {
337
+ typeof window < "u" && (l = window.location.pathname);
338
+ }
339
+ const c = Z(() => K(n, l), [n, l]), [d, u] = Y(c), h = E(l), x = E(c !== null);
340
+ A(() => {
341
+ if (h.current !== l && (h.current = l, x.current = !1), !x.current) {
342
+ const a = K(n, l);
343
+ a !== null && (u(a), x.current = !0);
344
+ }
345
+ }, [l, n]);
346
+ const i = y((a) => {
347
+ u((f) => f === a ? null : a);
348
+ }, []), p = Z(() => /* @__PURE__ */ r.jsx(r.Fragment, { children: n.map((a) => /* @__PURE__ */ r.jsx("div", { children: a.href ? /* @__PURE__ */ r.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: te.test(a.href) ? /* @__PURE__ */ r.jsx(
323
349
  "a",
324
350
  {
325
- href: s.href,
351
+ href: a.href,
326
352
  onClick: () => {
327
- a && a($(s));
353
+ s && s($(a));
328
354
  },
329
- children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: s.title })
355
+ children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: a.title })
330
356
  }
331
357
  ) : /* @__PURE__ */ r.jsx(
332
- Q,
358
+ re,
333
359
  {
334
- to: s.href,
360
+ to: a.href,
335
361
  onClick: () => {
336
- a && a($(s));
362
+ s && s($(a));
337
363
  },
338
- children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: s.title })
364
+ children: /* @__PURE__ */ r.jsx("span", { className: "aiquants-menu-link hover:underline", children: a.title })
339
365
  }
340
- ) }) : /* @__PURE__ */ r.jsxs("details", { className: "menu-accordion-details", open: s.id === m, children: [
366
+ ) }) : /* @__PURE__ */ r.jsxs("details", { className: "menu-accordion-details", open: a.id === d, children: [
341
367
  /* @__PURE__ */ r.jsx(
342
368
  "summary",
343
369
  {
344
370
  className: "aiquants-menu-list-item menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 align-middle text-sm outline-none before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",
345
- onClick: (l) => {
346
- l.preventDefault(), c(s.id);
371
+ onClick: (f) => {
372
+ f.preventDefault(), i(a.id);
347
373
  },
348
- onKeyDown: (l) => {
349
- (l.key === "Enter" || l.key === " ") && (l.preventDefault(), c(s.id));
374
+ onKeyDown: (f) => {
375
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), i(a.id));
350
376
  },
351
- children: /* @__PURE__ */ r.jsx("span", { children: s.title })
377
+ children: /* @__PURE__ */ r.jsx("span", { children: a.title })
352
378
  }
353
379
  ),
354
- /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md", children: s.submenu.map((l) => /* @__PURE__ */ r.jsx("div", { className: "menu-accordion-container block w-full whitespace-nowrap text-sm", children: /* @__PURE__ */ r.jsx(Ee, { item: l, parentMenu: s, onMenuSelected: a }) }, l.subid)) })
355
- ] }) }, s.id)) }), [o, a, m, c]);
356
- return /* @__PURE__ */ r.jsx("div", { className: "hidden-scrollbar h-0 grow overflow-y-scroll", children: u });
357
- }, _e = (t) => {
358
- const { menuList: o, menuHeader: a, open: m, onMenuSelected: i, onClickSignout: c, theme: u, toggleTheme: s, isPinned: l, onTogglePin: d } = t;
359
- return /* @__PURE__ */ r.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 ${m ? "aiquants-menu-translate-x-0" : "aiquants-menu-translate-x-250"}`, children: [
360
- /* @__PURE__ */ r.jsx("div", { className: "flex h-[100px] flex-col", children: a }),
361
- /* @__PURE__ */ r.jsx("div", { className: "flex grow flex-col", children: /* @__PURE__ */ r.jsx(Ne, { menuList: o, onMenuSelected: i }) }),
380
+ /* @__PURE__ */ r.jsx("div", { className: "aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md", children: a.submenu.map((f) => /* @__PURE__ */ r.jsx("div", { className: "menu-accordion-container block w-full whitespace-nowrap text-sm", children: /* @__PURE__ */ r.jsx(Ce, { item: f, parentMenu: a, onMenuSelected: s }) }, f.subid)) })
381
+ ] }) }, a.id)) }), [n, s, d, i]);
382
+ return /* @__PURE__ */ r.jsx("div", { className: "hidden-scrollbar h-0 grow overflow-y-scroll", children: p });
383
+ }, Oe = (t) => {
384
+ const { menuList: n, menuHeader: s, open: l, onMenuSelected: c, onClickSignout: d, theme: u, toggleTheme: h, isPinned: x, onTogglePin: i } = t;
385
+ return /* @__PURE__ */ r.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: [
386
+ /* @__PURE__ */ r.jsx("div", { className: "flex h-[100px] flex-col", children: s }),
387
+ /* @__PURE__ */ r.jsx("div", { className: "flex grow flex-col", children: /* @__PURE__ */ r.jsx(Se, { menuList: n, onMenuSelected: c }) }),
362
388
  /* @__PURE__ */ r.jsx("div", { className: "px-4 pt-2 pb-4", children: /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
363
389
  /* @__PURE__ */ r.jsx(
364
390
  "button",
365
391
  {
366
392
  type: "button",
367
- onClick: d,
368
- 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 ${l ? "bg-amber-500/90 hover:bg-amber-600" : "border border-white/15 bg-white/10 hover:bg-white/20"}`,
369
- title: l ? "ピン留め解除" : "ピン留め",
370
- children: l ? /* @__PURE__ */ r.jsx(xe, { size: 14 }) : /* @__PURE__ */ r.jsx(pe, { size: 14 })
393
+ onClick: i,
394
+ 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 ${x ? "bg-amber-500/90 hover:bg-amber-600" : "border border-white/15 bg-white/10 hover:bg-white/20"}`,
395
+ title: x ? "ピン留め解除" : "ピン留め",
396
+ children: x ? /* @__PURE__ */ r.jsx(ve, { size: 14 }) : /* @__PURE__ */ r.jsx(ye, { size: 14 })
371
397
  }
372
398
  ),
373
399
  /* @__PURE__ */ r.jsxs(
374
400
  "button",
375
401
  {
376
402
  type: "button",
377
- onClick: s,
403
+ onClick: h,
378
404
  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",
379
405
  children: [
380
406
  /* @__PURE__ */ r.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: /* @__PURE__ */ r.jsx("span", { className: "text-sm transition-transform duration-300 group-hover:scale-110", children: u === "dark" ? "🌞" : "🌙" }) }),
@@ -388,68 +414,68 @@ const ye = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
388
414
  {
389
415
  type: "button",
390
416
  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",
391
- onClick: c,
417
+ onClick: d,
392
418
  children: "サインアウト"
393
419
  }
394
420
  )
395
421
  ] }) })
396
422
  ] });
397
- }, Te = (t) => {
398
- const { isOverlay: o, onOverlayClick: a } = t;
399
- return /* @__PURE__ */ r.jsx("button", { type: "button", className: `fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${o ? "opacity-100" : "pointer-events-none opacity-0"}`, onClick: a });
400
- }, Re = (t) => {
401
- const { open: o, onMenuOpen: a, onMenuClose: m, theme: i } = t, c = _(o), u = _(null), s = _(null), l = _(null), d = _(null), h = _(null), g = v(() => {
402
- if (u.current && s.current && l.current && d.current && h.current) {
403
- const x = i === "dark" ? "#fff" : "#000";
404
- u.current.style.backgroundColor = x, u.current.style.width = "100%", u.current.style.height = "3px", u.current.style.transform = "", s.current.style.opacity = "1", s.current.style.backgroundColor = x, l.current.style.opacity = "1", l.current.style.backgroundColor = x, d.current.style.backgroundColor = x, d.current.style.width = "100%", d.current.style.height = "3px", d.current.style.transform = "", h.current.style.color = x, h.current.classList.remove("after:content-['close']"), h.current.classList.remove("after:ml-0.5"), h.current.classList.add("after:content-['menu']"), h.current.classList.add("after:-ml-0.5"), c.current = !0;
423
+ }, Pe = (t) => {
424
+ const { isOverlay: n, onOverlayClick: s } = t;
425
+ return /* @__PURE__ */ r.jsx("button", { type: "button", className: `fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${n ? "opacity-100" : "pointer-events-none opacity-0"}`, onClick: s });
426
+ }, Ae = (t) => {
427
+ const { open: n, onMenuOpen: s, onMenuClose: l, theme: c } = t, d = E(n), u = E(null), h = E(null), x = E(null), i = E(null), p = E(null), a = y(() => {
428
+ if (u.current && h.current && x.current && i.current && p.current) {
429
+ const b = c === "dark" ? "#fff" : "#000";
430
+ u.current.style.backgroundColor = b, u.current.style.width = "100%", u.current.style.height = "3px", u.current.style.transform = "", h.current.style.opacity = "1", h.current.style.backgroundColor = b, x.current.style.opacity = "1", x.current.style.backgroundColor = b, i.current.style.backgroundColor = b, i.current.style.width = "100%", i.current.style.height = "3px", i.current.style.transform = "", p.current.style.color = b, p.current.classList.remove("after:content-['close']"), p.current.classList.remove("after:ml-0.5"), p.current.classList.add("after:content-['menu']"), p.current.classList.add("after:-ml-0.5"), d.current = !0;
405
431
  }
406
- }, [i]), y = v(() => {
407
- u.current && s.current && l.current && d.current && h.current && (u.current.style.backgroundColor = "#fff", u.current.style.width = "32px", u.current.style.height = "4px", u.current.style.transform = "translateY(9px) rotate(-45deg)", s.current.style.opacity = "0", l.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)", h.current.style.color = "#fff", h.current.classList.remove("after:content-['menu']"), h.current.classList.remove("after:-ml-0.5"), h.current.classList.add("after:content-['close']"), h.current.classList.add("after:ml-0.5"), c.current = !1);
408
- }, []), w = v(() => {
409
- g(), m && m();
410
- }, [g, m]), k = v(() => {
411
- y(), a && a();
412
- }, [y, a]), T = v(() => {
413
- c.current ? k() : w();
414
- }, [w, k]), E = v((x) => {
415
- x.currentTarget.blur();
416
- }, []), j = v((x) => {
417
- x.preventDefault();
432
+ }, [c]), f = y(() => {
433
+ u.current && h.current && x.current && i.current && p.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", x.current.style.opacity = "0", i.current.style.backgroundColor = "#fff", i.current.style.width = "32px", i.current.style.height = "4px", i.current.style.transform = "translateY(-9px) rotate(45deg)", p.current.style.color = "#fff", p.current.classList.remove("after:content-['menu']"), p.current.classList.remove("after:-ml-0.5"), p.current.classList.add("after:content-['close']"), p.current.classList.add("after:ml-0.5"), d.current = !1);
434
+ }, []), w = y(() => {
435
+ a(), l && l();
436
+ }, [a, l]), k = y(() => {
437
+ f(), s && s();
438
+ }, [f, s]), T = y(() => {
439
+ d.current ? k() : w();
440
+ }, [w, k]), N = y((b) => {
441
+ b.currentTarget.blur();
442
+ }, []), j = y((b) => {
443
+ b.preventDefault();
418
444
  }, []);
419
445
  return A(() => {
420
- o ? g() : y();
421
- }, [o, g, y]), /* @__PURE__ */ r.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: E, onMouseDown: j, tabIndex: -1, children: [
446
+ n ? a() : f();
447
+ }, [n, a, f]), /* @__PURE__ */ r.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: N, onMouseDown: j, tabIndex: -1, children: [
422
448
  /* @__PURE__ */ r.jsx("span", { className: "absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none", ref: u }),
423
- /* @__PURE__ */ r.jsx("span", { className: "absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none", ref: s }),
424
- /* @__PURE__ */ r.jsx("span", { className: "absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none", ref: l }),
425
- /* @__PURE__ */ r.jsx("span", { className: "absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none", ref: d }),
426
- /* @__PURE__ */ r.jsx("div", { className: "absolute w-full text-xs after:mt-2 after:block", ref: h })
449
+ /* @__PURE__ */ r.jsx("span", { className: "absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none", ref: h }),
450
+ /* @__PURE__ */ r.jsx("span", { className: "absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none", ref: x }),
451
+ /* @__PURE__ */ r.jsx("span", { className: "absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none", ref: i }),
452
+ /* @__PURE__ */ r.jsx("div", { className: "absolute w-full text-xs after:mt-2 after:block", ref: p })
427
453
  ] });
428
- }, Ae = (t) => {
429
- const { menuList: o, menuHeader: a, onClickSignout: m, isMenuhide: i, theme: c, toggleTheme: u, onMenuNavigate: s, onPinChange: l } = t, [d, h] = Y(() => {
454
+ }, ee = typeof window < "u" ? me : A, De = (t) => {
455
+ const { menuList: n, menuHeader: s, onClickSignout: l, isMenuhide: c, theme: d, toggleTheme: u, onMenuNavigate: h, onPinChange: x } = t, [i, p] = Y(() => {
430
456
  try {
431
457
  return localStorage.getItem("aiquants-menu-pinned") === "true";
432
458
  } catch {
433
459
  return !1;
434
460
  }
435
- }), [g, y] = Y(d);
436
- A(() => {
437
- const x = d ? "250px" : "0px";
438
- document.documentElement.style.setProperty("--aiquants-menu-pinned-width", x), l?.(d);
439
- }, [d, l]), A(() => () => {
461
+ }), [a, f] = Y(i);
462
+ ee(() => {
463
+ const b = i ? "250px" : "0px";
464
+ document.documentElement.style.setProperty("--aiquants-menu-pinned-width", b), x?.(i);
465
+ }, [i, x]), ee(() => () => {
440
466
  document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px");
441
467
  }, []);
442
- const w = v(() => {
443
- y(!0);
444
- }, []), k = v(() => {
445
- y(!1), h(!1);
468
+ const w = y(() => {
469
+ f(!0);
470
+ }, []), k = y(() => {
471
+ f(!1), p(!1);
446
472
  try {
447
473
  localStorage.removeItem("aiquants-menu-pinned");
448
474
  } catch {
449
475
  }
450
- }, []), T = v(() => {
451
- h((x) => {
452
- const S = !x;
476
+ }, []), T = y(() => {
477
+ p((b) => {
478
+ const S = !b;
453
479
  if (S)
454
480
  try {
455
481
  localStorage.setItem("aiquants-menu-pinned", "true");
@@ -462,28 +488,28 @@ const ye = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
462
488
  }
463
489
  return S;
464
490
  });
465
- }, []), E = v(
466
- (x) => {
467
- s && s(x), d || y(!1);
491
+ }, []), N = y(
492
+ (b) => {
493
+ h && h(b), i || f(!1);
468
494
  },
469
- [s, d]
470
- ), j = v(
471
- (x) => {
472
- if (x.key === "Escape")
495
+ [h, i]
496
+ ), j = y(
497
+ (b) => {
498
+ if (b.key === "Escape")
473
499
  return k(), !1;
474
500
  },
475
501
  [k]
476
502
  );
477
- return A(() => (g ? window.addEventListener("keydown", j, { passive: !0 }) : window.removeEventListener("keydown", j), () => {
503
+ return A(() => (a ? window.addEventListener("keydown", j, { passive: !0 }) : window.removeEventListener("keydown", j), () => {
478
504
  window.removeEventListener("keydown", j);
479
- }), [g, j]), i ? null : /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-bar ${c}`, children: [
480
- /* @__PURE__ */ r.jsx(Re, { onMenuClose: k, onMenuOpen: w, open: !g, theme: c }),
481
- /* @__PURE__ */ r.jsx(_e, { menuList: o, menuHeader: a, onClickSignout: m, onMenuSelected: E, open: g, theme: c, toggleTheme: u, isPinned: d, onTogglePin: T }),
482
- /* @__PURE__ */ r.jsx(Te, { isOverlay: g && !d, onOverlayClick: k })
505
+ }), [a, j]), c ? null : /* @__PURE__ */ r.jsxs("div", { className: `aiquants-menu-bar ${d}`, children: [
506
+ /* @__PURE__ */ r.jsx(Ae, { onMenuClose: k, onMenuOpen: w, open: !a, theme: d }),
507
+ /* @__PURE__ */ r.jsx(Oe, { menuList: n, menuHeader: s, onClickSignout: l, onMenuSelected: N, open: a, theme: d, toggleTheme: u, isPinned: i, onTogglePin: T }),
508
+ /* @__PURE__ */ r.jsx(Pe, { isOverlay: a && !i, onOverlayClick: k })
483
509
  ] });
484
510
  };
485
511
  export {
486
- ke as DefaultLink,
487
- Ae as MenuBar,
488
- Pe as SessionInfo
512
+ _e as DefaultLink,
513
+ De as MenuBar,
514
+ qe as SessionInfo
489
515
  };
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(y,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],l):(y=typeof globalThis<"u"?globalThis:y||self,l(y["@aiquants/menu-bar"]={},y.React,y["lucide-react"],y.ReactRouterDOM))})(this,(function(y,l,j,z){"use strict";var O={exports:{}},C={};var U;function K(){if(U)return C;U=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function a(h,c,u){var d=null;if(u!==void 0&&(d=""+u),c.key!==void 0&&(d=""+c.key),"key"in c){u={};for(var s in c)s!=="key"&&(u[s]=c[s])}else u=c;return c=u.ref,{$$typeof:r,type:h,key:d,ref:c!==void 0?c:null,props:u}}return C.Fragment=o,C.jsx=a,C.jsxs=a,C}var R={};var W;function $(){return W||(W=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case p:return"Profiler";case N:return"StrictMode";case me:return"Suspense";case he:return"SuspenseList";case pe: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 de:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case fe:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xe:return n=e.displayName||null,n!==null?n:r(e.type)||"Memo";case L:n=e._payload,e=e._init;try{return r(e(n))}catch{}}return null}function o(e){return""+e}function a(e){try{o(e);var n=!1}catch{n=!0}if(n){n=console;var m=n.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return m.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),o(e)}}function h(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===L)return"<...>";try{var n=r(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function c(){var e=I.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function d(e){if(Z.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function s(e,n){function m(){G||(G=!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)",n))}m.isReactWarning=!0,Object.defineProperty(e,"key",{get:m,configurable:!0})}function i(){var e=r(this.type);return J[e]||(J[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,n,m,b,M,Y){var g=m.ref;return e={$$typeof:w,type:e,key:n,props:m,_owner:b},(g!==void 0?g:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):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:M}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function x(e,n,m,b,M,Y){var g=n.children;if(g!==void 0)if(b)if(ge(g)){for(b=0;b<g.length;b++)v(g[b]);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 v(g);if(Z.call(n,"key")){g=r(e);var _=Object.keys(n).filter(function(ve){return ve!=="key"});b=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",X[g+b]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k["@aiquants/menu-bar"]={},k.React,k["lucide-react"],k.ReactRouterDOM))})(this,(function(k,a,j,A){"use strict";var O={exports:{}},C={};var W;function te(){if(W)return C;W=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(i,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var p in u)p!=="key"&&(f[p]=u[p])}else f=u;return u=f.ref,{$$typeof:n,type:i,key:d,ref:u!==void 0?u:null,props:f}}return C.Fragment=r,C.jsx=o,C.jsxs=o,C}var R={};var U;function ne(){return U||(U=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case g:return"Profiler";case N:return"StrictMode";case xe:return"Suspense";case be:return"SuspenseList";case ve: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 he:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case pe:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ge:return s=e.displayName||null,s!==null?s:n(e.type)||"Memo";case I:s=e._payload,e=e._init;try{return n(e(s))}catch{}}return null}function r(e){return""+e}function o(e){try{r(e);var s=!1}catch{s=!0}if(s){s=console;var h=s.error,v=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",v),r(e)}}function i(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===I)return"<...>";try{var s=n(e);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function u(){var e=D.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function d(e){if(Q.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function p(e,s){function h(){X||(X=!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)",s))}h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}function b(){var e=n(this.type);return q[e]||(q[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 c(e,s,h,v,M,F){var y=h.ref;return e={$$typeof:w,type:e,key:s,props:h,_owner:v},(y!==void 0?y:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:b}):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:M}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function x(e,s,h,v,M,F){var y=s.children;if(y!==void 0)if(v)if(ke(y)){for(v=0;v<y.length;v++)l(y[v]);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 l(y);if(Q.call(s,"key")){y=n(e);var _=Object.keys(s).filter(function(we){return we!=="key"});v=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",ee[y+v]||(_=0<_.length?"{"+_.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} />`,b,g,_,g),X[g+b]=!0)}if(g=null,m!==void 0&&(a(m),g=""+m),d(n)&&(a(n.key),g=""+n.key),"key"in n){m={};for(var F in n)F!=="key"&&(m[F]=n[F])}else m=n;return g&&s(m,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,g,m,c(),M,Y)}function v(e){k(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===L&&(e._payload.status==="fulfilled"?k(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function k(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}var E=l,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),de=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),xe=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),be=Symbol.for("react.client.reference"),I=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,ge=Array.isArray,D=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var G,J={},B=E.react_stack_bottom_frame.bind(E,u)(),Q=D(h(u)),X={};R.Fragment=T,R.jsx=function(e,n,m){var b=1e4>I.recentlyCreatedOwnerStacks++;return x(e,n,m,!1,b?Error("react-stack-top-frame"):B,b?D(h(e)):Q)},R.jsxs=function(e,n,m){var b=1e4>I.recentlyCreatedOwnerStacks++;return x(e,n,m,!0,b?Error("react-stack-top-frame"):B,b?D(h(e)):Q)}})()),R}var H;function ee(){return H||(H=1,process.env.NODE_ENV==="production"?O.exports=K():O.exports=$()),O.exports}var t=ee();const te="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",q=({to:r,className:o,children:a})=>t.jsx("a",{href:r,className:o,children:a}),re=r=>{const{user:o,LinkComponent:a=q}=r;return t.jsx("div",{className:"max-h-20 max-w-52",children:t.jsx("div",{className:"flex grow flex-col",children:o?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-row",children:[t.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:t.jsx("img",{className:"object-contain",src:o.photo||te,"aria-label":"profile photo"})}),t.jsxs("div",{className:"mx-1 flex flex-col",children:[t.jsx(a,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),t.jsx(a,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),t.jsx(a,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),t.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs",children:o.displayName})]}):t.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:"ログインはこちら"})})})},V=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),ne={report:j.FileText,slip:j.FileText,table:j.Table,chart:j.BarChart,download:j.Download,lock:j.Lock,href:j.Link},se=({mark:r,children:o})=>{const a=r?ne[r]:void 0;return a?t.jsxs("div",{className:"flex flex-nowrap items-center",children:[t.jsx(a,{className:"h-4 w-4"}),t.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:o})]}):t.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:o})},A=(r,o)=>o?{menu:{id:r.id,title:r.title,href:r.href},submenu:{subid:o.subid,title:o.title,href:o.href,mark:o.mark,new:o.new}}:{menu:{id:r.id,title:r.title,href:r.href}},oe=({item:r,parentMenu:o,onMenuSelected:a})=>{if(r.href==="separator")return t.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const h=t.jsx(se,{mark:r.mark,children:r.title}),c={onClick:()=>{a&&a(A(o,r))}};return r.new?t.jsx("a",{href:r.href,rel:"noopener noreferrer",target:"_blank",...c,children:h}):V.test(r.href)?t.jsx("a",{href:r.href,...c,children:h}):t.jsx(z.Link,{to:r.href,...c,children:h})},ae=r=>{const{menuList:o,onMenuSelected:a}=r,[h,c]=l.useState(null),u=l.useCallback(s=>{c(i=>i===s?null:s)},[]),d=l.useMemo(()=>t.jsx(t.Fragment,{children:o.map(s=>t.jsx("div",{children:s.href?t.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:V.test(s.href)?t.jsx("a",{href:s.href,onClick:()=>{a&&a(A(s))},children:t.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})}):t.jsx(z.Link,{to:s.href,onClick:()=>{a&&a(A(s))},children:t.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})})}):t.jsxs("details",{className:"menu-accordion-details",open:s.id===h,children:[t.jsx("summary",{className:"aiquants-menu-list-item menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 align-middle text-sm outline-none before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",onClick:i=>{i.preventDefault(),u(s.id)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),u(s.id))},children:t.jsx("span",{children:s.title})}),t.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:s.submenu.map(i=>t.jsx("div",{className:"menu-accordion-container block w-full whitespace-nowrap text-sm",children:t.jsx(oe,{item:i,parentMenu:s,onMenuSelected:a})},i.subid))})]})},s.id))}),[o,a,h,u]);return t.jsx("div",{className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:d})},le=r=>{const{menuList:o,menuHeader:a,open:h,onMenuSelected:c,onClickSignout:u,theme:d,toggleTheme:s,isPinned:i,onTogglePin:f}=r;return t.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 ${h?"aiquants-menu-translate-x-0":"aiquants-menu-translate-x-250"}`,children:[t.jsx("div",{className:"flex h-[100px] flex-col",children:a}),t.jsx("div",{className:"flex grow flex-col",children:t.jsx(ae,{menuList:o,onMenuSelected:c})}),t.jsx("div",{className:"px-4 pt-2 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.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 ${i?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:i?"ピン留め解除":"ピン留め",children:i?t.jsx(j.Pin,{size:14}):t.jsx(j.PinOff,{size:14})}),t.jsxs("button",{type:"button",onClick:s,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:[t.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:t.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),t.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"}),t.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"})]}),t.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:u,children:"サインアウト"})]})})]})},ie=r=>{const{isOverlay:o,onOverlayClick:a}=r;return t.jsx("button",{type:"button",className:`fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${o?"opacity-100":"pointer-events-none opacity-0"}`,onClick:a})},ce=r=>{const{open:o,onMenuOpen:a,onMenuClose:h,theme:c}=r,u=l.useRef(o),d=l.useRef(null),s=l.useRef(null),i=l.useRef(null),f=l.useRef(null),x=l.useRef(null),v=l.useCallback(()=>{if(d.current&&s.current&&i.current&&f.current&&x.current){const p=c==="dark"?"#fff":"#000";d.current.style.backgroundColor=p,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",s.current.style.opacity="1",s.current.style.backgroundColor=p,i.current.style.opacity="1",i.current.style.backgroundColor=p,f.current.style.backgroundColor=p,f.current.style.width="100%",f.current.style.height="3px",f.current.style.transform="",x.current.style.color=p,x.current.classList.remove("after:content-['close']"),x.current.classList.remove("after:ml-0.5"),x.current.classList.add("after:content-['menu']"),x.current.classList.add("after:-ml-0.5"),u.current=!0}},[c]),k=l.useCallback(()=>{d.current&&s.current&&i.current&&f.current&&x.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",s.current.style.opacity="0",i.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)",x.current.style.color="#fff",x.current.classList.remove("after:content-['menu']"),x.current.classList.remove("after:-ml-0.5"),x.current.classList.add("after:content-['close']"),x.current.classList.add("after:ml-0.5"),u.current=!1)},[]),E=l.useCallback(()=>{v(),h&&h()},[v,h]),w=l.useCallback(()=>{k(),a&&a()},[k,a]),S=l.useCallback(()=>{u.current?w():E()},[E,w]),T=l.useCallback(p=>{p.currentTarget.blur()},[]),N=l.useCallback(p=>{p.preventDefault()},[]);return l.useEffect(()=>{o?v():k()},[o,v,k]),t.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:T,onMouseDown:N,tabIndex:-1,children:[t.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),t.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:s}),t.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:i}),t.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:f}),t.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:x})]})},ue=r=>{const{menuList:o,menuHeader:a,onClickSignout:h,isMenuhide:c,theme:u,toggleTheme:d,onMenuNavigate:s,onPinChange:i}=r,[f,x]=l.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[v,k]=l.useState(f);l.useEffect(()=>{const p=f?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",p),i?.(f)},[f,i]),l.useEffect(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const E=l.useCallback(()=>{k(!0)},[]),w=l.useCallback(()=>{k(!1),x(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),S=l.useCallback(()=>{x(p=>{const P=!p;if(P)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return P})},[]),T=l.useCallback(p=>{s&&s(p),f||k(!1)},[s,f]),N=l.useCallback(p=>{if(p.key==="Escape")return w(),!1},[w]);return l.useEffect(()=>(v?window.addEventListener("keydown",N,{passive:!0}):window.removeEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}),[v,N]),c?null:t.jsxs("div",{className:`aiquants-menu-bar ${u}`,children:[t.jsx(ce,{onMenuClose:w,onMenuOpen:E,open:!v,theme:u}),t.jsx(le,{menuList:o,menuHeader:a,onClickSignout:h,onMenuSelected:T,open:v,theme:u,toggleTheme:d,isPinned:f,onTogglePin:S}),t.jsx(ie,{isOverlay:v&&!f,onOverlayClick:w})]})};y.DefaultLink=q,y.MenuBar=ue,y.SessionInfo=re,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,v,y,_,y),ee[y+v]=!0)}if(y=null,h!==void 0&&(o(h),y=""+h),d(s)&&(o(s.key),y=""+s.key),"key"in s){h={};for(var z in s)z!=="key"&&(h[z]=s[z])}else h=s;return y&&p(h,typeof e=="function"?e.displayName||e.name||"Unknown":e),c(e,y,h,u(),M,F)}function l(e){m(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===I&&(e._payload.status==="fulfilled"?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}var E=a,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),he=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),ge=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ve=Symbol.for("react.activity"),ye=Symbol.for("react.client.reference"),D=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,ke=Array.isArray,Y=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var X,q={},K=E.react_stack_bottom_frame.bind(E,f)(),$=Y(i(f)),ee={};R.Fragment=T,R.jsx=function(e,s,h){var v=1e4>D.recentlyCreatedOwnerStacks++;return x(e,s,h,!1,v?Error("react-stack-top-frame"):K,v?Y(i(e)):$)},R.jsxs=function(e,s,h){var v=1e4>D.recentlyCreatedOwnerStacks++;return x(e,s,h,!0,v?Error("react-stack-top-frame"):K,v?Y(i(e)):$)}})()),R}var H;function re(){return H||(H=1,process.env.NODE_ENV==="production"?O.exports=te():O.exports=ne()),O.exports}var t=re();const se="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",V=({to:n,className:r,children:o})=>t.jsx("a",{href:n,className:r,children:o}),oe=n=>{const{user:r,LinkComponent:o=V}=n;return t.jsx("div",{className:"max-h-20 max-w-52",children:t.jsx("div",{className:"flex grow flex-col",children:r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-row",children:[t.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:t.jsx("img",{className:"object-contain",src:r.photo||se,"aria-label":"profile photo"})}),t.jsxs("div",{className:"mx-1 flex flex-col",children:[t.jsx(o,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),t.jsx(o,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),t.jsx(o,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),t.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})]}):t.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:"ログインはこちら"})})})},Z=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),ae={report:j.FileText,slip:j.FileText,table:j.Table,chart:j.BarChart,download:j.Download,lock:j.Lock,href:j.Link},le=({mark:n,children:r})=>{const o=n?ae[n]:void 0;return o?t.jsxs("div",{className:"flex flex-nowrap items-center",children:[t.jsx(o,{className:"h-4 w-4"}),t.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:r})]}):t.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:r})},L=(n,r)=>r?{menu:{id:n.id,title:n.title,href:n.href},submenu:{subid:r.subid,title:r.title,href:r.href,mark:r.mark,new:r.new}}:{menu:{id:n.id,title:n.title,href:n.href}},ie=({item:n,parentMenu:r,onMenuSelected:o})=>{if(n.href==="separator")return t.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const i=t.jsx(le,{mark:n.mark,children:n.title}),u={onClick:()=>{o&&o(L(r,n))}};return n.new?t.jsx("a",{href:n.href,rel:"noopener noreferrer",target:"_blank",...u,children:i}):Z.test(n.href)?t.jsx("a",{href:n.href,...u,children:i}):t.jsx(A.Link,{to:n.href,...u,children:i})},G=n=>n?n.split(/[?#]/)[0].replace(/(?!^\/)\/$/,""):"",J=(n,r)=>{const o=r!=="/"&&r.endsWith("/")?r.slice(0,-1):r;for(const i of n){if(G(i.href)===o)return i.id;if(i.submenu){for(const u of i.submenu)if(G(u.href)===o)return i.id}}return null},ce=n=>{const{menuList:r,onMenuSelected:o}=n;let i="";try{i=A.useLocation().pathname}catch{typeof window<"u"&&(i=window.location.pathname)}const u=a.useMemo(()=>J(r,i),[r,i]),[f,d]=a.useState(u),p=a.useRef(i),b=a.useRef(u!==null);a.useEffect(()=>{if(p.current!==i&&(p.current=i,b.current=!1),!b.current){const l=J(r,i);l!==null&&(d(l),b.current=!0)}},[i,r]);const c=a.useCallback(l=>{d(m=>m===l?null:l)},[]),x=a.useMemo(()=>t.jsx(t.Fragment,{children:r.map(l=>t.jsx("div",{children:l.href?t.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:Z.test(l.href)?t.jsx("a",{href:l.href,onClick:()=>{o&&o(L(l))},children:t.jsx("span",{className:"aiquants-menu-link hover:underline",children:l.title})}):t.jsx(A.Link,{to:l.href,onClick:()=>{o&&o(L(l))},children:t.jsx("span",{className:"aiquants-menu-link hover:underline",children:l.title})})}):t.jsxs("details",{className:"menu-accordion-details",open:l.id===f,children:[t.jsx("summary",{className:"aiquants-menu-list-item menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 align-middle text-sm outline-none before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",onClick:m=>{m.preventDefault(),c(l.id)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c(l.id))},children:t.jsx("span",{children:l.title})}),t.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:l.submenu.map(m=>t.jsx("div",{className:"menu-accordion-container block w-full whitespace-nowrap text-sm",children:t.jsx(ie,{item:m,parentMenu:l,onMenuSelected:o})},m.subid))})]})},l.id))}),[r,o,f,c]);return t.jsx("div",{className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:x})},ue=n=>{const{menuList:r,menuHeader:o,open:i,onMenuSelected:u,onClickSignout:f,theme:d,toggleTheme:p,isPinned:b,onTogglePin:c}=n;return t.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:[t.jsx("div",{className:"flex h-[100px] flex-col",children:o}),t.jsx("div",{className:"flex grow flex-col",children:t.jsx(ce,{menuList:r,onMenuSelected:u})}),t.jsx("div",{className:"px-4 pt-2 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("button",{type:"button",onClick:c,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 ${b?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:b?"ピン留め解除":"ピン留め",children:b?t.jsx(j.Pin,{size:14}):t.jsx(j.PinOff,{size:14})}),t.jsxs("button",{type:"button",onClick:p,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:[t.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:t.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),t.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"}),t.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"})]}),t.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:f,children:"サインアウト"})]})})]})},de=n=>{const{isOverlay:r,onOverlayClick:o}=n;return t.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:o})},fe=n=>{const{open:r,onMenuOpen:o,onMenuClose:i,theme:u}=n,f=a.useRef(r),d=a.useRef(null),p=a.useRef(null),b=a.useRef(null),c=a.useRef(null),x=a.useRef(null),l=a.useCallback(()=>{if(d.current&&p.current&&b.current&&c.current&&x.current){const g=u==="dark"?"#fff":"#000";d.current.style.backgroundColor=g,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",p.current.style.opacity="1",p.current.style.backgroundColor=g,b.current.style.opacity="1",b.current.style.backgroundColor=g,c.current.style.backgroundColor=g,c.current.style.width="100%",c.current.style.height="3px",c.current.style.transform="",x.current.style.color=g,x.current.classList.remove("after:content-['close']"),x.current.classList.remove("after:ml-0.5"),x.current.classList.add("after:content-['menu']"),x.current.classList.add("after:-ml-0.5"),f.current=!0}},[u]),m=a.useCallback(()=>{d.current&&p.current&&b.current&&c.current&&x.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",p.current.style.opacity="0",b.current.style.opacity="0",c.current.style.backgroundColor="#fff",c.current.style.width="32px",c.current.style.height="4px",c.current.style.transform="translateY(-9px) rotate(45deg)",x.current.style.color="#fff",x.current.classList.remove("after:content-['menu']"),x.current.classList.remove("after:-ml-0.5"),x.current.classList.add("after:content-['close']"),x.current.classList.add("after:ml-0.5"),f.current=!1)},[]),E=a.useCallback(()=>{l(),i&&i()},[l,i]),w=a.useCallback(()=>{m(),o&&o()},[m,o]),S=a.useCallback(()=>{f.current?w():E()},[E,w]),T=a.useCallback(g=>{g.currentTarget.blur()},[]),N=a.useCallback(g=>{g.preventDefault()},[]);return a.useEffect(()=>{r?l():m()},[r,l,m]),t.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:T,onMouseDown:N,tabIndex:-1,children:[t.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),t.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:p}),t.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:b}),t.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:c}),t.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:x})]})},B=typeof window<"u"?a.useLayoutEffect:a.useEffect,me=n=>{const{menuList:r,menuHeader:o,onClickSignout:i,isMenuhide:u,theme:f,toggleTheme:d,onMenuNavigate:p,onPinChange:b}=n,[c,x]=a.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[l,m]=a.useState(c);B(()=>{const g=c?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",g),b?.(c)},[c,b]),B(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const E=a.useCallback(()=>{m(!0)},[]),w=a.useCallback(()=>{m(!1),x(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),S=a.useCallback(()=>{x(g=>{const P=!g;if(P)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return P})},[]),T=a.useCallback(g=>{p&&p(g),c||m(!1)},[p,c]),N=a.useCallback(g=>{if(g.key==="Escape")return w(),!1},[w]);return a.useEffect(()=>(l?window.addEventListener("keydown",N,{passive:!0}):window.removeEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}),[l,N]),u?null:t.jsxs("div",{className:`aiquants-menu-bar ${f}`,children:[t.jsx(fe,{onMenuClose:w,onMenuOpen:E,open:!l,theme:f}),t.jsx(ue,{menuList:r,menuHeader:o,onClickSignout:i,onMenuSelected:T,open:l,theme:f,toggleTheme:d,isPinned:c,onTogglePin:S}),t.jsx(de,{isOverlay:l&&!c,onOverlayClick:w})]})};k.DefaultLink=V,k.MenuBar=me,k.SessionInfo=oe,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/menu-bar",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "private": false,
5
5
  "description": "A React menu bar component with authentication support and theming",
6
6
  "keywords": [
@@ -70,6 +70,7 @@
70
70
  "scripts": {
71
71
  "build": "vite build && pnpm build:css",
72
72
  "build:css": "tailwindcss -i src/styles/tailwind.css -o dist/styles/menu-bar.css --minify",
73
+ "build:scoped": "turbo run build --filter=@aiquants/menu-bar...",
73
74
  "dev": "vite build --watch",
74
75
  "watch": "vite build --watch",
75
76
  "watch:css": "tailwindcss -i src/styles/tailwind.css -o dist/styles/menu-bar.css --minify --watch",