@jsenv/plugin-toolbar 0.1.2 → 0.1.4

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.
Files changed (66) hide show
  1. package/dist/css/toolbar.css +683 -7
  2. package/dist/js/toolbar_core.js +1803 -8
  3. package/dist/js/toolbar_injector.js +4 -2
  4. package/dist/jsenv_plugin_toolbar.js +6 -3
  5. package/package.json +3 -3
  6. package/dist/css/document_execution_indicator.css +0 -87
  7. package/dist/css/globals.css +0 -75
  8. package/dist/css/server_indicator.css +0 -83
  9. package/dist/css/theme_light.css +0 -110
  10. package/dist/css/toolbar_menu_overflow.css +0 -59
  11. package/dist/css/toolbar_settings.css +0 -202
  12. package/dist/css/tooltips.css +0 -67
  13. package/dist/js/animation.js +0 -282
  14. package/dist/js/animation_actions.js +0 -7
  15. package/dist/js/animation_effects.js +0 -10
  16. package/dist/js/animation_signals.js +0 -4
  17. package/dist/js/changes_actions.js +0 -7
  18. package/dist/js/changes_indicator.js +0 -57
  19. package/dist/js/changes_signals.js +0 -2
  20. package/dist/js/document_execution_indicator.js +0 -62
  21. package/dist/js/document_index_link.js +0 -4
  22. package/dist/js/dom.js +0 -48
  23. package/dist/js/execution_actions.js +0 -46
  24. package/dist/js/execution_effects.js +0 -16
  25. package/dist/js/execution_signals.js +0 -17
  26. package/dist/js/hooks.mjs +0 -185
  27. package/dist/js/iframe_to_parent_href.js +0 -10
  28. package/dist/js/notification_actions.js +0 -60
  29. package/dist/js/notification_context.js +0 -1
  30. package/dist/js/notification_effects.js +0 -9
  31. package/dist/js/notification_signals.js +0 -5
  32. package/dist/js/parent_window_actions.js +0 -39
  33. package/dist/js/parent_window_context.js +0 -6
  34. package/dist/js/parent_window_effects.js +0 -15
  35. package/dist/js/parent_window_signals.js +0 -25
  36. package/dist/js/preact.mjs +0 -316
  37. package/dist/js/responsive.js +0 -104
  38. package/dist/js/server_actions.js +0 -7
  39. package/dist/js/server_effects.js +0 -9
  40. package/dist/js/server_indicator.js +0 -52
  41. package/dist/js/server_signals.js +0 -10
  42. package/dist/js/settings_actions.js +0 -7
  43. package/dist/js/settings_signals.js +0 -2
  44. package/dist/js/signals-core.mjs +0 -339
  45. package/dist/js/signals.mjs +0 -202
  46. package/dist/js/theme_actions.js +0 -7
  47. package/dist/js/theme_effects.js +0 -6
  48. package/dist/js/theme_signals.js +0 -4
  49. package/dist/js/toolbar_animation_setting.js +0 -21
  50. package/dist/js/toolbar_autoreload_setting.js +0 -67
  51. package/dist/js/toolbar_close_button.js +0 -14
  52. package/dist/js/toolbar_menu_overflow.js +0 -81
  53. package/dist/js/toolbar_notification_setting.js +0 -72
  54. package/dist/js/toolbar_open_actions.js +0 -7
  55. package/dist/js/toolbar_open_effects.js +0 -4
  56. package/dist/js/toolbar_open_signals.js +0 -4
  57. package/dist/js/toolbar_opening.js +0 -65
  58. package/dist/js/toolbar_overlay.js +0 -69
  59. package/dist/js/toolbar_settings.js +0 -44
  60. package/dist/js/toolbar_state_context.js +0 -1
  61. package/dist/js/toolbar_state_effects.js +0 -8
  62. package/dist/js/toolbar_state_signals.js +0 -17
  63. package/dist/js/toolbar_theme_setting.js +0 -13
  64. package/dist/js/toolbar_ui.js +0 -20
  65. package/dist/js/tooltip_actions.js +0 -6
  66. package/dist/js/variant.js +0 -53
package/dist/js/hooks.mjs DELETED
@@ -1,185 +0,0 @@
1
- import { options as n } from "./preact.mjs";
2
- var t,
3
- r,
4
- u,
5
- i,
6
- o = 0,
7
- f = [],
8
- c = [],
9
- e = n.__b,
10
- a = n.__r,
11
- v = n.diffed,
12
- l = n.__c,
13
- m = n.unmount;
14
- function d(t, u) {
15
- n.__h && n.__h(r, t, o || u), o = 0;
16
- var i = r.__H || (r.__H = {
17
- __: [],
18
- __h: []
19
- });
20
- return t >= i.__.length && i.__.push({
21
- __V: c
22
- }), i.__[t];
23
- }
24
- function p(n) {
25
- return o = 1, y(B, n);
26
- }
27
- function y(n, u, i) {
28
- var o = d(t++, 2);
29
- if (o.t = n, !o.__c && (o.__ = [i ? i(u) : B(void 0, u), function (n) {
30
- var t = o.__N ? o.__N[0] : o.__[0],
31
- r = o.t(t, n);
32
- t !== r && (o.__N = [r, o.__[1]], o.__c.setState({}));
33
- }], o.__c = r, !r.u)) {
34
- r.u = !0;
35
- var f = r.shouldComponentUpdate;
36
- r.shouldComponentUpdate = function (n, t, r) {
37
- if (!o.__c.__H) return !0;
38
- var u = o.__c.__H.__.filter(function (n) {
39
- return n.__c;
40
- });
41
- if (u.every(function (n) {
42
- return !n.__N;
43
- })) return !f || f.call(this, n, t, r);
44
- var i = !1;
45
- return u.forEach(function (n) {
46
- if (n.__N) {
47
- var t = n.__[0];
48
- n.__ = n.__N, n.__N = void 0, t !== n.__[0] && (i = !0);
49
- }
50
- }), !(!i && o.__c.props === n) && (!f || f.call(this, n, t, r));
51
- };
52
- }
53
- return o.__N || o.__;
54
- }
55
- function h(u, i) {
56
- var o = d(t++, 3);
57
- !n.__s && z(o.__H, i) && (o.__ = u, o.i = i, r.__H.__h.push(o));
58
- }
59
- function s(u, i) {
60
- var o = d(t++, 4);
61
- !n.__s && z(o.__H, i) && (o.__ = u, o.i = i, r.__h.push(o));
62
- }
63
- function _(n) {
64
- return o = 5, F(function () {
65
- return {
66
- current: n
67
- };
68
- }, []);
69
- }
70
- function A(n, t, r) {
71
- o = 6, s(function () {
72
- return "function" == typeof n ? (n(t()), function () {
73
- return n(null);
74
- }) : n ? (n.current = t(), function () {
75
- return n.current = null;
76
- }) : void 0;
77
- }, null == r ? r : r.concat(n));
78
- }
79
- function F(n, r) {
80
- var u = d(t++, 7);
81
- return z(u.__H, r) ? (u.__V = n(), u.i = r, u.__h = n, u.__V) : u.__;
82
- }
83
- function T(n, t) {
84
- return o = 8, F(function () {
85
- return n;
86
- }, t);
87
- }
88
- function q(n) {
89
- var u = r.context[n.__c],
90
- i = d(t++, 9);
91
- return i.c = n, u ? (null == i.__ && (i.__ = !0, u.sub(r)), u.props.value) : n.__;
92
- }
93
- function x(t, r) {
94
- n.useDebugValue && n.useDebugValue(r ? r(t) : t);
95
- }
96
- function P(n) {
97
- var u = d(t++, 10),
98
- i = p();
99
- return u.__ = n, r.componentDidCatch || (r.componentDidCatch = function (n, t) {
100
- u.__ && u.__(n, t), i[1](n);
101
- }), [i[0], function () {
102
- i[1](void 0);
103
- }];
104
- }
105
- function V() {
106
- var n = d(t++, 11);
107
- if (!n.__) {
108
- for (var u = r.__v; null !== u && !u.__m && null !== u.__;) u = u.__;
109
- var i = u.__m || (u.__m = [0, 0]);
110
- n.__ = "P" + i[0] + "-" + i[1]++;
111
- }
112
- return n.__;
113
- }
114
- function b() {
115
- for (var t; t = f.shift();) if (t.__P && t.__H) try {
116
- t.__H.__h.forEach(k), t.__H.__h.forEach(w), t.__H.__h = [];
117
- } catch (r) {
118
- t.__H.__h = [], n.__e(r, t.__v);
119
- }
120
- }
121
- n.__b = function (n) {
122
- r = null, e && e(n);
123
- }, n.__r = function (n) {
124
- a && a(n), t = 0;
125
- var i = (r = n.__c).__H;
126
- i && (u === r ? (i.__h = [], r.__h = [], i.__.forEach(function (n) {
127
- n.__N && (n.__ = n.__N), n.__V = c, n.__N = n.i = void 0;
128
- })) : (i.__h.forEach(k), i.__h.forEach(w), i.__h = [])), u = r;
129
- }, n.diffed = function (t) {
130
- v && v(t);
131
- var o = t.__c;
132
- o && o.__H && (o.__H.__h.length && (1 !== f.push(o) && i === n.requestAnimationFrame || ((i = n.requestAnimationFrame) || j)(b)), o.__H.__.forEach(function (n) {
133
- n.i && (n.__H = n.i), n.__V !== c && (n.__ = n.__V), n.i = void 0, n.__V = c;
134
- })), u = r = null;
135
- }, n.__c = function (t, r) {
136
- r.some(function (t) {
137
- try {
138
- t.__h.forEach(k), t.__h = t.__h.filter(function (n) {
139
- return !n.__ || w(n);
140
- });
141
- } catch (u) {
142
- r.some(function (n) {
143
- n.__h && (n.__h = []);
144
- }), r = [], n.__e(u, t.__v);
145
- }
146
- }), l && l(t, r);
147
- }, n.unmount = function (t) {
148
- m && m(t);
149
- var r,
150
- u = t.__c;
151
- u && u.__H && (u.__H.__.forEach(function (n) {
152
- try {
153
- k(n);
154
- } catch (n) {
155
- r = n;
156
- }
157
- }), u.__H = void 0, r && n.__e(r, u.__v));
158
- };
159
- var g = "function" == typeof requestAnimationFrame;
160
- function j(n) {
161
- var t,
162
- r = function () {
163
- clearTimeout(u), g && cancelAnimationFrame(t), setTimeout(n);
164
- },
165
- u = setTimeout(r, 100);
166
- g && (t = requestAnimationFrame(r));
167
- }
168
- function k(n) {
169
- var t = r,
170
- u = n.__c;
171
- "function" == typeof u && (n.__c = void 0, u()), r = t;
172
- }
173
- function w(n) {
174
- var t = r;
175
- n.__c = n.__(), r = t;
176
- }
177
- function z(n, t) {
178
- return !n || n.length !== t.length || t.some(function (t, r) {
179
- return t !== n[r];
180
- });
181
- }
182
- function B(n, t) {
183
- return "function" == typeof t ? t(n) : t;
184
- }
185
- export { T as useCallback, q as useContext, x as useDebugValue, h as useEffect, P as useErrorBoundary, V as useId, A as useImperativeHandle, s as useLayoutEffect, F as useMemo, y as useReducer, _ as useRef, p as useState };
@@ -1,10 +0,0 @@
1
- export const setLinkHrefForParentWindow = (a, href) => {
2
- a.href = href;
3
- a.onclick = e => {
4
- if (e.ctrlKey || e.metaKey) {
5
- return;
6
- }
7
- e.preventDefault();
8
- window.parent.location.href = href;
9
- };
10
- };
@@ -1,60 +0,0 @@
1
- import { notificationAPIDetected } from "./notification_context.js";
2
- import { notificationsEnabledSignal, notificationPermissionSignal } from "./notification_signals.js";
3
- export const enableNotifications = () => {
4
- notificationsEnabledSignal.value = true;
5
- };
6
- export const disableNotifications = () => {
7
- notificationsEnabledSignal.value = false;
8
- };
9
- const arrayOfOpenedNotifications = [];
10
- export const notify = notificationAPIDetected ? async (title, {
11
- clickToFocus = false,
12
- clickToClose = false,
13
- ...options
14
- } = {}) => {
15
- const notificationsEnabled = notificationsEnabledSignal.value;
16
- if (!notificationsEnabled) {
17
- return null;
18
- }
19
- if (Notification.permission !== "granted") {
20
- return null;
21
- }
22
- const notification = new Notification(title, options);
23
- arrayOfOpenedNotifications.push(notification);
24
- notification.onclick = () => {
25
- // but if the user navigated inbetween
26
- // focusing window will show something else
27
- // in that case it could be great to do something
28
- // maybe like showing a message saying this execution
29
- // is no longer visible
30
- // we could also navigauate to this file execution but
31
- // there is no guarantee re-executing the file would give same output
32
- // and it would also trigger an other notification
33
- if (clickToFocus) window.focus();
34
- if (clickToClose) notification.close();
35
- };
36
- notification.onclose = () => {
37
- const index = arrayOfOpenedNotifications.indexOf(notification);
38
- if (index > -1) {
39
- arrayOfOpenedNotifications.splice(index, 1);
40
- }
41
- };
42
- return notification;
43
- } : () => {};
44
- export const closeAllNotifications = () => {
45
- // slice because arrayOfOpenedNotifications can be mutated while looping
46
- arrayOfOpenedNotifications.slice().forEach(notification => {
47
- notification.close();
48
- });
49
- };
50
- let requestPromise;
51
- export const requestPermission = notificationAPIDetected ? async () => {
52
- if (requestPromise) {
53
- await requestPromise;
54
- return;
55
- }
56
- requestPromise = Notification.requestPermission();
57
- await requestPromise;
58
- requestPromise = undefined;
59
- notificationPermissionSignal.value = Notification.permission;
60
- } : () => Promise.resolve();
@@ -1 +0,0 @@
1
- export const notificationAPIDetected = typeof window.Notification === "function";
@@ -1,9 +0,0 @@
1
- import { effect } from "./signals.mjs";
2
- import { notificationsEnabledSignal } from "./notification_signals.js";
3
- import { closeAllNotifications } from "./notification_actions.js";
4
- effect(() => {
5
- const notificationsEnabled = notificationsEnabledSignal.value;
6
- if (!notificationsEnabled) {
7
- closeAllNotifications();
8
- }
9
- });
@@ -1,5 +0,0 @@
1
- import { signal } from "./signals.mjs";
2
- import { paramsFromParentWindow } from "./parent_window_context.js";
3
- import { stateFromLocalStorage } from "./toolbar_state_context.js";
4
- export const notificationsEnabledSignal = signal(typeof stateFromLocalStorage.notificationsEnabled === "boolean" ? stateFromLocalStorage.notificationsEnabled : typeof paramsFromParentWindow.notificationsEnabled === "boolean" ? paramsFromParentWindow.notificationsEnabled : false);
5
- export const notificationPermissionSignal = signal(Notification.permission);
@@ -1,39 +0,0 @@
1
- import { parentWindowReloader } from "./parent_window_context.js";
2
- export const sendEventToParent = (name, data) => {
3
- window.parent.postMessage({
4
- __jsenv__: {
5
- event: name,
6
- data
7
- }
8
- }, "*");
9
- };
10
- export const addExternalCommandCallback = (command, callback) => {
11
- const messageEventCallback = messageEvent => {
12
- const {
13
- data
14
- } = messageEvent;
15
- if (typeof data !== "object") {
16
- return;
17
- }
18
- const {
19
- __jsenv__
20
- } = data;
21
- if (!__jsenv__) {
22
- return;
23
- }
24
- if (__jsenv__.command !== command) {
25
- return;
26
- }
27
- callback(...__jsenv__.args);
28
- };
29
- window.addEventListener("message", messageEventCallback);
30
- return () => {
31
- window.removeEventListener("message", messageEventCallback);
32
- };
33
- };
34
- export const enableAutoreload = () => {
35
- parentWindowReloader.autoreload.enable();
36
- };
37
- export const disableAutoreload = () => {
38
- parentWindowReloader.autoreload.disable();
39
- };
@@ -1,6 +0,0 @@
1
- export const paramsFromParentWindow = {};
2
- const searchParams = new URLSearchParams(window.location.search);
3
- searchParams.forEach((value, key) => {
4
- paramsFromParentWindow[key] = value === "" ? true : value;
5
- });
6
- export const parentWindowReloader = window.parent.__reloader__;
@@ -1,15 +0,0 @@
1
- import { addExternalCommandCallback, sendEventToParent } from "./parent_window_actions.js";
2
- import { animationsEnabledSignal } from "./animation_signals.js";
3
- import { initToolbarUI } from "./toolbar_ui.js";
4
- addExternalCommandCallback("initToolbar", () => {
5
- // for the first render, force disable animations
6
- const animationsEnabled = animationsEnabledSignal.value;
7
- if (animationsEnabled) {
8
- animationsEnabledSignal.value = false;
9
- }
10
- initToolbarUI();
11
- if (animationsEnabled) {
12
- animationsEnabledSignal.value = true;
13
- }
14
- });
15
- sendEventToParent("toolbar_ready");
@@ -1,25 +0,0 @@
1
- import { signal } from "./signals.mjs";
2
- import { paramsFromParentWindow, parentWindowReloader } from "./parent_window_context.js";
3
- export const autoreloadEnabledSignal = signal(false);
4
- export const reloaderStatusSignal = signal("idle");
5
- export const changesSignal = signal(0);
6
- if (parentWindowReloader) {
7
- if (!parentWindowReloader.autoreload.enabled && paramsFromParentWindow.autoreload) {
8
- autoreloadEnabledSignal.value = true;
9
- } else {
10
- autoreloadEnabledSignal.value = parentWindowReloader.autoreload.enabled;
11
- }
12
- parentWindowReloader.autoreload.onchange = () => {
13
- autoreloadEnabledSignal.value = parentWindowReloader.autoreload.enabled;
14
- };
15
- reloaderStatusSignal.value = parentWindowReloader.status.value;
16
- const onchange = parentWindowReloader.status.onchange;
17
- parentWindowReloader.status.onchange = () => {
18
- onchange();
19
- reloaderStatusSignal.value = parentWindowReloader.status.value;
20
- };
21
- changesSignal.value = parentWindowReloader.changes.value;
22
- parentWindowReloader.changes.onchange = () => {
23
- changesSignal.value = [...parentWindowReloader.changes.value];
24
- };
25
- }
@@ -1,316 +0,0 @@
1
- var n,
2
- l,
3
- u,
4
- i,
5
- t,
6
- o,
7
- r,
8
- f = {},
9
- e = [],
10
- c = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
11
- function s(n, l) {
12
- for (var u in l) n[u] = l[u];
13
- return n;
14
- }
15
- function a(n) {
16
- var l = n.parentNode;
17
- l && l.removeChild(n);
18
- }
19
- function h(l, u, i) {
20
- var t,
21
- o,
22
- r,
23
- f = {};
24
- for (r in u) "key" == r ? t = u[r] : "ref" == r ? o = u[r] : f[r] = u[r];
25
- if (arguments.length > 2 && (f.children = arguments.length > 3 ? n.call(arguments, 2) : i), "function" == typeof l && null != l.defaultProps) for (r in l.defaultProps) void 0 === f[r] && (f[r] = l.defaultProps[r]);
26
- return v(l, f, t, o, null);
27
- }
28
- function v(n, i, t, o, r) {
29
- var f = {
30
- type: n,
31
- props: i,
32
- key: t,
33
- ref: o,
34
- __k: null,
35
- __: null,
36
- __b: 0,
37
- __e: null,
38
- __d: void 0,
39
- __c: null,
40
- __h: null,
41
- constructor: void 0,
42
- __v: null == r ? ++u : r
43
- };
44
- return null == r && null != l.vnode && l.vnode(f), f;
45
- }
46
- function y() {
47
- return {
48
- current: null
49
- };
50
- }
51
- function p(n) {
52
- return n.children;
53
- }
54
- function d(n, l) {
55
- this.props = n, this.context = l;
56
- }
57
- function _(n, l) {
58
- if (null == l) return n.__ ? _(n.__, n.__.__k.indexOf(n) + 1) : null;
59
- for (var u; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) return u.__e;
60
- return "function" == typeof n.type ? _(n) : null;
61
- }
62
- function k(n) {
63
- var l, u;
64
- if (null != (n = n.__) && null != n.__c) {
65
- for (n.__e = n.__c.base = null, l = 0; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) {
66
- n.__e = n.__c.base = u.__e;
67
- break;
68
- }
69
- return k(n);
70
- }
71
- }
72
- function b(n) {
73
- (!n.__d && (n.__d = !0) && t.push(n) && !g.__r++ || o !== l.debounceRendering) && ((o = l.debounceRendering) || setTimeout)(g);
74
- }
75
- function g() {
76
- for (var n; g.__r = t.length;) n = t.sort(function (n, l) {
77
- return n.__v.__b - l.__v.__b;
78
- }), t = [], n.some(function (n) {
79
- var l, u, i, t, o, r;
80
- n.__d && (o = (t = (l = n).__v).__e, (r = l.__P) && (u = [], (i = s({}, t)).__v = t.__v + 1, j(r, t, i, l.__n, void 0 !== r.ownerSVGElement, null != t.__h ? [o] : null, u, null == o ? _(t) : o, t.__h), z(u, t), t.__e != o && k(t)));
81
- });
82
- }
83
- function w(n, l, u, i, t, o, r, c, s, a) {
84
- var h,
85
- y,
86
- d,
87
- k,
88
- b,
89
- g,
90
- w,
91
- x = i && i.__k || e,
92
- C = x.length;
93
- for (u.__k = [], h = 0; h < l.length; h++) if (null != (k = u.__k[h] = null == (k = l[h]) || "boolean" == typeof k ? null : "string" == typeof k || "number" == typeof k || "bigint" == typeof k ? v(null, k, null, null, k) : Array.isArray(k) ? v(p, {
94
- children: k
95
- }, null, null, null) : k.__b > 0 ? v(k.type, k.props, k.key, k.ref ? k.ref : null, k.__v) : k)) {
96
- if (k.__ = u, k.__b = u.__b + 1, null === (d = x[h]) || d && k.key == d.key && k.type === d.type) x[h] = void 0;else for (y = 0; y < C; y++) {
97
- if ((d = x[y]) && k.key == d.key && k.type === d.type) {
98
- x[y] = void 0;
99
- break;
100
- }
101
- d = null;
102
- }
103
- j(n, k, d = d || f, t, o, r, c, s, a), b = k.__e, (y = k.ref) && d.ref != y && (w || (w = []), d.ref && w.push(d.ref, null, k), w.push(y, k.__c || b, k)), null != b ? (null == g && (g = b), "function" == typeof k.type && k.__k === d.__k ? k.__d = s = m(k, s, n) : s = A(n, k, d, x, b, s), "function" == typeof u.type && (u.__d = s)) : s && d.__e == s && s.parentNode != n && (s = _(d));
104
- }
105
- for (u.__e = g, h = C; h--;) null != x[h] && N(x[h], x[h]);
106
- if (w) for (h = 0; h < w.length; h++) M(w[h], w[++h], w[++h]);
107
- }
108
- function m(n, l, u) {
109
- for (var i, t = n.__k, o = 0; t && o < t.length; o++) (i = t[o]) && (i.__ = n, l = "function" == typeof i.type ? m(i, l, u) : A(u, i, i, t, i.__e, l));
110
- return l;
111
- }
112
- function x(n, l) {
113
- return l = l || [], null == n || "boolean" == typeof n || (Array.isArray(n) ? n.some(function (n) {
114
- x(n, l);
115
- }) : l.push(n)), l;
116
- }
117
- function A(n, l, u, i, t, o) {
118
- var r, f, e;
119
- if (void 0 !== l.__d) r = l.__d, l.__d = void 0;else if (null == u || t != o || null == t.parentNode) n: if (null == o || o.parentNode !== n) n.appendChild(t), r = null;else {
120
- for (f = o, e = 0; (f = f.nextSibling) && e < i.length; e += 1) if (f == t) break n;
121
- n.insertBefore(t, o), r = o;
122
- }
123
- return void 0 !== r ? r : t.nextSibling;
124
- }
125
- function C(n, l, u, i, t) {
126
- var o;
127
- for (o in u) "children" === o || "key" === o || o in l || H(n, o, null, u[o], i);
128
- for (o in l) t && "function" != typeof l[o] || "children" === o || "key" === o || "value" === o || "checked" === o || u[o] === l[o] || H(n, o, l[o], u[o], i);
129
- }
130
- function $(n, l, u) {
131
- "-" === l[0] ? n.setProperty(l, u) : n[l] = null == u ? "" : "number" != typeof u || c.test(l) ? u : u + "px";
132
- }
133
- function H(n, l, u, i, t) {
134
- var o;
135
- n: if ("style" === l) {
136
- if ("string" == typeof u) n.style.cssText = u;else {
137
- if ("string" == typeof i && (n.style.cssText = i = ""), i) for (l in i) u && l in u || $(n.style, l, "");
138
- if (u) for (l in u) i && u[l] === i[l] || $(n.style, l, u[l]);
139
- }
140
- } else if ("o" === l[0] && "n" === l[1]) o = l !== (l = l.replace(/Capture$/, "")), l = l.toLowerCase() in n ? l.toLowerCase().slice(2) : l.slice(2), n.l || (n.l = {}), n.l[l + o] = u, u ? i || n.addEventListener(l, o ? T : I, o) : n.removeEventListener(l, o ? T : I, o);else if ("dangerouslySetInnerHTML" !== l) {
141
- if (t) l = l.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");else if ("href" !== l && "list" !== l && "form" !== l && "tabIndex" !== l && "download" !== l && l in n) try {
142
- n[l] = null == u ? "" : u;
143
- break n;
144
- } catch (n) {}
145
- "function" == typeof u || (null == u || !1 === u && -1 == l.indexOf("-") ? n.removeAttribute(l) : n.setAttribute(l, u));
146
- }
147
- }
148
- function I(n) {
149
- this.l[n.type + !1](l.event ? l.event(n) : n);
150
- }
151
- function T(n) {
152
- this.l[n.type + !0](l.event ? l.event(n) : n);
153
- }
154
- function j(n, u, i, t, o, r, f, e, c) {
155
- var a,
156
- h,
157
- v,
158
- y,
159
- _,
160
- k,
161
- b,
162
- g,
163
- m,
164
- x,
165
- A,
166
- C,
167
- $,
168
- H,
169
- I,
170
- T = u.type;
171
- if (void 0 !== u.constructor) return null;
172
- null != i.__h && (c = i.__h, e = u.__e = i.__e, u.__h = null, r = [e]), (a = l.__b) && a(u);
173
- try {
174
- n: if ("function" == typeof T) {
175
- if (g = u.props, m = (a = T.contextType) && t[a.__c], x = a ? m ? m.props.value : a.__ : t, i.__c ? b = (h = u.__c = i.__c).__ = h.__E : ("prototype" in T && T.prototype.render ? u.__c = h = new T(g, x) : (u.__c = h = new d(g, x), h.constructor = T, h.render = O), m && m.sub(h), h.props = g, h.state || (h.state = {}), h.context = x, h.__n = t, v = h.__d = !0, h.__h = [], h._sb = []), null == h.__s && (h.__s = h.state), null != T.getDerivedStateFromProps && (h.__s == h.state && (h.__s = s({}, h.__s)), s(h.__s, T.getDerivedStateFromProps(g, h.__s))), y = h.props, _ = h.state, v) null == T.getDerivedStateFromProps && null != h.componentWillMount && h.componentWillMount(), null != h.componentDidMount && h.__h.push(h.componentDidMount);else {
176
- if (null == T.getDerivedStateFromProps && g !== y && null != h.componentWillReceiveProps && h.componentWillReceiveProps(g, x), !h.__e && null != h.shouldComponentUpdate && !1 === h.shouldComponentUpdate(g, h.__s, x) || u.__v === i.__v) {
177
- for (h.props = g, h.state = h.__s, u.__v !== i.__v && (h.__d = !1), h.__v = u, u.__e = i.__e, u.__k = i.__k, u.__k.forEach(function (n) {
178
- n && (n.__ = u);
179
- }), A = 0; A < h._sb.length; A++) h.__h.push(h._sb[A]);
180
- h._sb = [], h.__h.length && f.push(h);
181
- break n;
182
- }
183
- null != h.componentWillUpdate && h.componentWillUpdate(g, h.__s, x), null != h.componentDidUpdate && h.__h.push(function () {
184
- h.componentDidUpdate(y, _, k);
185
- });
186
- }
187
- if (h.context = x, h.props = g, h.__v = u, h.__P = n, C = l.__r, $ = 0, "prototype" in T && T.prototype.render) {
188
- for (h.state = h.__s, h.__d = !1, C && C(u), a = h.render(h.props, h.state, h.context), H = 0; H < h._sb.length; H++) h.__h.push(h._sb[H]);
189
- h._sb = [];
190
- } else do {
191
- h.__d = !1, C && C(u), a = h.render(h.props, h.state, h.context), h.state = h.__s;
192
- } while (h.__d && ++$ < 25);
193
- h.state = h.__s, null != h.getChildContext && (t = s(s({}, t), h.getChildContext())), v || null == h.getSnapshotBeforeUpdate || (k = h.getSnapshotBeforeUpdate(y, _)), I = null != a && a.type === p && null == a.key ? a.props.children : a, w(n, Array.isArray(I) ? I : [I], u, i, t, o, r, f, e, c), h.base = u.__e, u.__h = null, h.__h.length && f.push(h), b && (h.__E = h.__ = null), h.__e = !1;
194
- } else null == r && u.__v === i.__v ? (u.__k = i.__k, u.__e = i.__e) : u.__e = L(i.__e, u, i, t, o, r, f, c);
195
- (a = l.diffed) && a(u);
196
- } catch (n) {
197
- u.__v = null, (c || null != r) && (u.__e = e, u.__h = !!c, r[r.indexOf(e)] = null), l.__e(n, u, i);
198
- }
199
- }
200
- function z(n, u) {
201
- l.__c && l.__c(u, n), n.some(function (u) {
202
- try {
203
- n = u.__h, u.__h = [], n.some(function (n) {
204
- n.call(u);
205
- });
206
- } catch (n) {
207
- l.__e(n, u.__v);
208
- }
209
- });
210
- }
211
- function L(l, u, i, t, o, r, e, c) {
212
- var s,
213
- h,
214
- v,
215
- y = i.props,
216
- p = u.props,
217
- d = u.type,
218
- k = 0;
219
- if ("svg" === d && (o = !0), null != r) for (; k < r.length; k++) if ((s = r[k]) && "setAttribute" in s == !!d && (d ? s.localName === d : 3 === s.nodeType)) {
220
- l = s, r[k] = null;
221
- break;
222
- }
223
- if (null == l) {
224
- if (null === d) return document.createTextNode(p);
225
- l = o ? document.createElementNS("http://www.w3.org/2000/svg", d) : document.createElement(d, p.is && p), r = null, c = !1;
226
- }
227
- if (null === d) y === p || c && l.data === p || (l.data = p);else {
228
- if (r = r && n.call(l.childNodes), h = (y = i.props || f).dangerouslySetInnerHTML, v = p.dangerouslySetInnerHTML, !c) {
229
- if (null != r) for (y = {}, k = 0; k < l.attributes.length; k++) y[l.attributes[k].name] = l.attributes[k].value;
230
- (v || h) && (v && (h && v.__html == h.__html || v.__html === l.innerHTML) || (l.innerHTML = v && v.__html || ""));
231
- }
232
- if (C(l, p, y, o, c), v) u.__k = [];else if (k = u.props.children, w(l, Array.isArray(k) ? k : [k], u, i, t, o && "foreignObject" !== d, r, e, r ? r[0] : i.__k && _(i, 0), c), null != r) for (k = r.length; k--;) null != r[k] && a(r[k]);
233
- c || ("value" in p && void 0 !== (k = p.value) && (k !== l.value || "progress" === d && !k || "option" === d && k !== y.value) && H(l, "value", k, y.value, !1), "checked" in p && void 0 !== (k = p.checked) && k !== l.checked && H(l, "checked", k, y.checked, !1));
234
- }
235
- return l;
236
- }
237
- function M(n, u, i) {
238
- try {
239
- "function" == typeof n ? n(u) : n.current = u;
240
- } catch (n) {
241
- l.__e(n, i);
242
- }
243
- }
244
- function N(n, u, i) {
245
- var t, o;
246
- if (l.unmount && l.unmount(n), (t = n.ref) && (t.current && t.current !== n.__e || M(t, null, u)), null != (t = n.__c)) {
247
- if (t.componentWillUnmount) try {
248
- t.componentWillUnmount();
249
- } catch (n) {
250
- l.__e(n, u);
251
- }
252
- t.base = t.__P = null, n.__c = void 0;
253
- }
254
- if (t = n.__k) for (o = 0; o < t.length; o++) t[o] && N(t[o], u, i || "function" != typeof n.type);
255
- i || null == n.__e || a(n.__e), n.__ = n.__e = n.__d = void 0;
256
- }
257
- function O(n, l, u) {
258
- return this.constructor(n, u);
259
- }
260
- function P(u, i, t) {
261
- var o, r, e;
262
- l.__ && l.__(u, i), r = (o = "function" == typeof t) ? null : t && t.__k || i.__k, e = [], j(i, u = (!o && t || i).__k = h(p, null, [u]), r || f, f, void 0 !== i.ownerSVGElement, !o && t ? [t] : r ? null : i.firstChild ? n.call(i.childNodes) : null, e, !o && t ? t : r ? r.__e : i.firstChild, o), z(e, u);
263
- }
264
- function S(n, l) {
265
- P(n, l, S);
266
- }
267
- function q(l, u, i) {
268
- var t,
269
- o,
270
- r,
271
- f = s({}, l.props);
272
- for (r in u) "key" == r ? t = u[r] : "ref" == r ? o = u[r] : f[r] = u[r];
273
- return arguments.length > 2 && (f.children = arguments.length > 3 ? n.call(arguments, 2) : i), v(l.type, f, t || l.key, o || l.ref, null);
274
- }
275
- function B(n, l) {
276
- var u = {
277
- __c: l = "__cC" + r++,
278
- __: n,
279
- Consumer: function (n, l) {
280
- return n.children(l);
281
- },
282
- Provider: function (n) {
283
- var u, i;
284
- return this.getChildContext || (u = [], (i = {})[l] = this, this.getChildContext = function () {
285
- return i;
286
- }, this.shouldComponentUpdate = function (n) {
287
- this.props.value !== n.value && u.some(b);
288
- }, this.sub = function (n) {
289
- u.push(n);
290
- var l = n.componentWillUnmount;
291
- n.componentWillUnmount = function () {
292
- u.splice(u.indexOf(n), 1), l && l.call(n);
293
- };
294
- }), n.children;
295
- }
296
- };
297
- return u.Provider.__ = u.Consumer.contextType = u;
298
- }
299
- n = e.slice, l = {
300
- __e: function (n, l, u, i) {
301
- for (var t, o, r; l = l.__;) if ((t = l.__c) && !t.__) try {
302
- if ((o = t.constructor) && null != o.getDerivedStateFromError && (t.setState(o.getDerivedStateFromError(n)), r = t.__d), null != t.componentDidCatch && (t.componentDidCatch(n, i || {}), r = t.__d), r) return t.__E = t;
303
- } catch (l) {
304
- n = l;
305
- }
306
- throw n;
307
- }
308
- }, u = 0, i = function (n) {
309
- return null != n && void 0 === n.constructor;
310
- }, d.prototype.setState = function (n, l) {
311
- var u;
312
- u = null != this.__s && this.__s !== this.state ? this.__s : this.__s = s({}, this.state), "function" == typeof n && (n = n(s({}, u), this.props)), n && s(u, n), null != n && this.__v && (l && this._sb.push(l), b(this));
313
- }, d.prototype.forceUpdate = function (n) {
314
- this.__v && (this.__e = !0, n && this.__h.push(n), b(this));
315
- }, d.prototype.render = p, t = [], g.__r = 0, r = 0;
316
- export { d as Component, p as Fragment, q as cloneElement, B as createContext, h as createElement, y as createRef, h, S as hydrate, i as isValidElement, l as options, P as render, x as toChildArray };