@weavix/sdk-react 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,891 +1,753 @@
1
- import Ye, { Component as Er, useState as A, useEffect as Y, createContext as Rr, useRef as xr, useMemo as Pr, useContext as Cr, useCallback as $e } from "react";
2
- import { on as q, hostApi as m, setHandler as Tr, uiApi as le, dispatchHostEvent as V, getLocalizedString as Or } from "@weavix/sdk-core";
3
- import { METHOD_NOT_SUPPORTED as Qr, MISSING_REQUIRED_SCOPE as Zr, PLUGIN_ID_IS_NOT_CORRECT as et, PLUGIN_ID_OR_SLOT_NOT_PROVIDED as rt, PluginActionError as tt, UNKNOWN_ERROR as nt, VALIDATION_ERROR as at, dispatchHostEvent as it, getField as ot, getLocalizedString as st, hostApi as ut, on as lt, uiApi as ct } from "@weavix/sdk-core";
4
- class wr extends Er {
5
- static getDerivedStateFromError(a) {
6
- return { hasError: !0, error: a };
7
- }
8
- constructor(a) {
9
- super(a), this.state = { hasError: !1, error: null };
10
- }
11
- componentDidCatch(a, c) {
12
- console.error("ErrorBoundary caught an error:", a, c);
13
- }
14
- render() {
15
- return this.state.hasError && this.state.error ? this.props.fallback(this.state.error) : this.props.children;
16
- }
1
+ import { Component as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
2
+ import { METHOD_NOT_SUPPORTED as c, MISSING_REQUIRED_SCOPE as l, PLUGIN_ID_IS_NOT_CORRECT as u, PLUGIN_ID_OR_SLOT_NOT_PROVIDED as d, PluginActionError as f, UNKNOWN_ERROR as p, VALIDATION_ERROR as m, dispatchHostEvent as h, dispatchHostEvent as g, getField as _, getLocalizedString as v, getLocalizedString as y, hostApi as ee, hostApi as b, on as te, on as x, setHandler as ne, uiApi as re, uiApi as S } from "@weavix/sdk-core";
3
+ //#region \0rolldown/runtime.js
4
+ var C = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), w = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
5
+ if (typeof require < "u") return require.apply(this, arguments);
6
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
7
+ }), T = class extends e {
8
+ static getDerivedStateFromError(e) {
9
+ return {
10
+ hasError: !0,
11
+ error: e
12
+ };
13
+ }
14
+ constructor(e) {
15
+ super(e), this.state = {
16
+ hasError: !1,
17
+ error: null
18
+ };
19
+ }
20
+ componentDidCatch(e, t) {
21
+ console.error("ErrorBoundary caught an error:", e, t);
22
+ }
23
+ render() {
24
+ return this.state.hasError && this.state.error ? this.props.fallback(this.state.error) : this.props.children;
25
+ }
26
+ }, E = /* @__PURE__ */ C(((e) => {
27
+ var t = w("react"), n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = {
28
+ key: !0,
29
+ ref: !0,
30
+ __self: !0,
31
+ __source: !0
32
+ };
33
+ function s(e, t, r) {
34
+ var s, c = {}, l = null, u = null;
35
+ for (s in r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) i.call(t, s) && !o.hasOwnProperty(s) && (c[s] = t[s]);
36
+ if (e && e.defaultProps) for (s in t = e.defaultProps, t) c[s] === void 0 && (c[s] = t[s]);
37
+ return {
38
+ $$typeof: n,
39
+ type: e,
40
+ key: l,
41
+ ref: u,
42
+ props: c,
43
+ _owner: a.current
44
+ };
45
+ }
46
+ e.Fragment = r, e.jsx = s, e.jsxs = s;
47
+ })), D = /* @__PURE__ */ C(((e) => {
48
+ process.env.NODE_ENV !== "production" && (function() {
49
+ var t = w("react"), n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
50
+ function _(e) {
51
+ if (typeof e != "object" || !e) return null;
52
+ var t = h && e[h] || e[g];
53
+ return typeof t == "function" ? t : null;
54
+ }
55
+ var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
56
+ function y(e) {
57
+ ee("error", e, [...arguments].slice(1));
58
+ }
59
+ function ee(e, t, n) {
60
+ var r = v.ReactDebugCurrentFrame.getStackAddendum();
61
+ r !== "" && (t += "%s", n = n.concat([r]));
62
+ var i = n.map(function(e) {
63
+ return String(e);
64
+ });
65
+ i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
66
+ }
67
+ var b = !1, te = !1, x = !1, ne = !1, re = !1, S = Symbol.for("react.module.reference");
68
+ function C(e) {
69
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === o || re || e === a || e === u || e === d || ne || e === m || b || te || x || typeof e == "object" && e && (e.$$typeof === p || e.$$typeof === f || e.$$typeof === s || e.$$typeof === c || e.$$typeof === l || e.$$typeof === S || e.getModuleId !== void 0));
70
+ }
71
+ function T(e, t, n) {
72
+ var r = e.displayName;
73
+ if (r) return r;
74
+ var i = t.displayName || t.name || "";
75
+ return i === "" ? n : n + "(" + i + ")";
76
+ }
77
+ function E(e) {
78
+ return e.displayName || "Context";
79
+ }
80
+ function D(e) {
81
+ if (e == null) return null;
82
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
83
+ if (typeof e == "string") return e;
84
+ switch (e) {
85
+ case i: return "Fragment";
86
+ case r: return "Portal";
87
+ case o: return "Profiler";
88
+ case a: return "StrictMode";
89
+ case u: return "Suspense";
90
+ case d: return "SuspenseList";
91
+ }
92
+ if (typeof e == "object") switch (e.$$typeof) {
93
+ case c: return E(e) + ".Consumer";
94
+ case s: return E(e._context) + ".Provider";
95
+ case l: return T(e, e.render, "ForwardRef");
96
+ case f:
97
+ var t = e.displayName || null;
98
+ return t === null ? D(e.type) || "Memo" : t;
99
+ case p:
100
+ var n = e, m = n._payload, h = n._init;
101
+ try {
102
+ return D(h(m));
103
+ } catch {
104
+ return null;
105
+ }
106
+ }
107
+ return null;
108
+ }
109
+ var O = Object.assign, k = 0, A, j, M, N, P, F, I;
110
+ function L() {}
111
+ L.__reactDisabledLog = !0;
112
+ function R() {
113
+ if (k === 0) {
114
+ A = console.log, j = console.info, M = console.warn, N = console.error, P = console.group, F = console.groupCollapsed, I = console.groupEnd;
115
+ var e = {
116
+ configurable: !0,
117
+ enumerable: !0,
118
+ value: L,
119
+ writable: !0
120
+ };
121
+ Object.defineProperties(console, {
122
+ info: e,
123
+ log: e,
124
+ warn: e,
125
+ error: e,
126
+ group: e,
127
+ groupCollapsed: e,
128
+ groupEnd: e
129
+ });
130
+ }
131
+ k++;
132
+ }
133
+ function ie() {
134
+ if (k--, k === 0) {
135
+ var e = {
136
+ configurable: !0,
137
+ enumerable: !0,
138
+ writable: !0
139
+ };
140
+ Object.defineProperties(console, {
141
+ log: O({}, e, { value: A }),
142
+ info: O({}, e, { value: j }),
143
+ warn: O({}, e, { value: M }),
144
+ error: O({}, e, { value: N }),
145
+ group: O({}, e, { value: P }),
146
+ groupCollapsed: O({}, e, { value: F }),
147
+ groupEnd: O({}, e, { value: I })
148
+ });
149
+ }
150
+ k < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
151
+ }
152
+ var z = v.ReactCurrentDispatcher, B;
153
+ function V(e, t, n) {
154
+ if (B === void 0) try {
155
+ throw Error();
156
+ } catch (e) {
157
+ var r = e.stack.trim().match(/\n( *(at )?)/);
158
+ B = r && r[1] || "";
159
+ }
160
+ return "\n" + B + e;
161
+ }
162
+ var H = !1, U = new (typeof WeakMap == "function" ? WeakMap : Map)();
163
+ function ae(e, t) {
164
+ if (!e || H) return "";
165
+ var n = U.get(e);
166
+ if (n !== void 0) return n;
167
+ var r;
168
+ H = !0;
169
+ var i = Error.prepareStackTrace;
170
+ Error.prepareStackTrace = void 0;
171
+ var a = z.current;
172
+ z.current = null, R();
173
+ try {
174
+ if (t) {
175
+ var o = function() {
176
+ throw Error();
177
+ };
178
+ if (Object.defineProperty(o.prototype, "props", { set: function() {
179
+ throw Error();
180
+ } }), typeof Reflect == "object" && Reflect.construct) {
181
+ try {
182
+ Reflect.construct(o, []);
183
+ } catch (e) {
184
+ r = e;
185
+ }
186
+ Reflect.construct(e, [], o);
187
+ } else {
188
+ try {
189
+ o.call();
190
+ } catch (e) {
191
+ r = e;
192
+ }
193
+ e.call(o.prototype);
194
+ }
195
+ } else {
196
+ try {
197
+ throw Error();
198
+ } catch (e) {
199
+ r = e;
200
+ }
201
+ e();
202
+ }
203
+ } catch (t) {
204
+ if (t && r && typeof t.stack == "string") {
205
+ for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
206
+ for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
207
+ if (l !== 1 || u !== 1) do
208
+ if (l--, u--, u < 0 || s[l] !== c[u]) {
209
+ var d = "\n" + s[l].replace(" at new ", " at ");
210
+ return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, d), d;
211
+ }
212
+ while (l >= 1 && u >= 0);
213
+ break;
214
+ }
215
+ }
216
+ } finally {
217
+ H = !1, z.current = a, ie(), Error.prepareStackTrace = i;
218
+ }
219
+ var f = e ? e.displayName || e.name : "", p = f ? V(f) : "";
220
+ return typeof e == "function" && U.set(e, p), p;
221
+ }
222
+ function oe(e, t, n) {
223
+ return ae(e, !1);
224
+ }
225
+ function se(e) {
226
+ var t = e.prototype;
227
+ return !!(t && t.isReactComponent);
228
+ }
229
+ function W(e, t, n) {
230
+ if (e == null) return "";
231
+ if (typeof e == "function") return ae(e, se(e));
232
+ if (typeof e == "string") return V(e);
233
+ switch (e) {
234
+ case u: return V("Suspense");
235
+ case d: return V("SuspenseList");
236
+ }
237
+ if (typeof e == "object") switch (e.$$typeof) {
238
+ case l: return oe(e.render);
239
+ case f: return W(e.type, t, n);
240
+ case p:
241
+ var r = e, i = r._payload, a = r._init;
242
+ try {
243
+ return W(a(i), t, n);
244
+ } catch {}
245
+ }
246
+ return "";
247
+ }
248
+ var G = Object.prototype.hasOwnProperty, K = {}, ce = v.ReactDebugCurrentFrame;
249
+ function q(e) {
250
+ if (e) {
251
+ var t = e._owner, n = W(e.type, e._source, t ? t.type : null);
252
+ ce.setExtraStackFrame(n);
253
+ } else ce.setExtraStackFrame(null);
254
+ }
255
+ function le(e, t, n, r, i) {
256
+ var a = Function.call.bind(G);
257
+ for (var o in e) if (a(e, o)) {
258
+ var s = void 0;
259
+ try {
260
+ if (typeof e[o] != "function") {
261
+ var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
262
+ throw c.name = "Invariant Violation", c;
263
+ }
264
+ s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
265
+ } catch (e) {
266
+ s = e;
267
+ }
268
+ s && !(s instanceof Error) && (q(i), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", r || "React class", n, o, typeof s), q(null)), s instanceof Error && !(s.message in K) && (K[s.message] = !0, q(i), y("Failed %s type: %s", n, s.message), q(null));
269
+ }
270
+ }
271
+ var ue = Array.isArray;
272
+ function J(e) {
273
+ return ue(e);
274
+ }
275
+ function de(e) {
276
+ return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
277
+ }
278
+ function fe(e) {
279
+ try {
280
+ return pe(e), !1;
281
+ } catch {
282
+ return !0;
283
+ }
284
+ }
285
+ function pe(e) {
286
+ return "" + e;
287
+ }
288
+ function me(e) {
289
+ if (fe(e)) return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", de(e)), pe(e);
290
+ }
291
+ var Y = v.ReactCurrentOwner, he = {
292
+ key: !0,
293
+ ref: !0,
294
+ __self: !0,
295
+ __source: !0
296
+ }, ge, _e, ve = {};
297
+ function ye(e) {
298
+ if (G.call(e, "ref")) {
299
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
300
+ if (t && t.isReactWarning) return !1;
301
+ }
302
+ return e.ref !== void 0;
303
+ }
304
+ function be(e) {
305
+ if (G.call(e, "key")) {
306
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
307
+ if (t && t.isReactWarning) return !1;
308
+ }
309
+ return e.key !== void 0;
310
+ }
311
+ function xe(e, t) {
312
+ if (typeof e.ref == "string" && Y.current && t && Y.current.stateNode !== t) {
313
+ var n = D(Y.current.type);
314
+ ve[n] || (y("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", D(Y.current.type), e.ref), ve[n] = !0);
315
+ }
316
+ }
317
+ function Se(e, t) {
318
+ var n = function() {
319
+ ge || (ge = !0, y("%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://reactjs.org/link/special-props)", t));
320
+ };
321
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
322
+ get: n,
323
+ configurable: !0
324
+ });
325
+ }
326
+ function Ce(e, t) {
327
+ var n = function() {
328
+ _e || (_e = !0, y("%s: `ref` 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://reactjs.org/link/special-props)", t));
329
+ };
330
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
331
+ get: n,
332
+ configurable: !0
333
+ });
334
+ }
335
+ var we = function(e, t, r, i, a, o, s) {
336
+ var c = {
337
+ $$typeof: n,
338
+ type: e,
339
+ key: t,
340
+ ref: r,
341
+ props: s,
342
+ _owner: o
343
+ };
344
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
345
+ configurable: !1,
346
+ enumerable: !1,
347
+ writable: !0,
348
+ value: !1
349
+ }), Object.defineProperty(c, "_self", {
350
+ configurable: !1,
351
+ enumerable: !1,
352
+ writable: !1,
353
+ value: i
354
+ }), Object.defineProperty(c, "_source", {
355
+ configurable: !1,
356
+ enumerable: !1,
357
+ writable: !1,
358
+ value: a
359
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
360
+ };
361
+ function Te(e, t, n, r, i) {
362
+ var a, o = {}, s = null, c = null;
363
+ for (a in n !== void 0 && (me(n), s = "" + n), be(t) && (me(t.key), s = "" + t.key), ye(t) && (c = t.ref, xe(t, i)), t) G.call(t, a) && !he.hasOwnProperty(a) && (o[a] = t[a]);
364
+ if (e && e.defaultProps) {
365
+ var l = e.defaultProps;
366
+ for (a in l) o[a] === void 0 && (o[a] = l[a]);
367
+ }
368
+ if (s || c) {
369
+ var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
370
+ s && Se(o, u), c && Ce(o, u);
371
+ }
372
+ return we(e, s, c, i, r, Y.current, o);
373
+ }
374
+ var X = v.ReactCurrentOwner, Ee = v.ReactDebugCurrentFrame;
375
+ function Z(e) {
376
+ if (e) {
377
+ var t = e._owner, n = W(e.type, e._source, t ? t.type : null);
378
+ Ee.setExtraStackFrame(n);
379
+ } else Ee.setExtraStackFrame(null);
380
+ }
381
+ var De = !1;
382
+ function Q(e) {
383
+ return typeof e == "object" && !!e && e.$$typeof === n;
384
+ }
385
+ function Oe() {
386
+ if (X.current) {
387
+ var e = D(X.current.type);
388
+ if (e) return "\n\nCheck the render method of `" + e + "`.";
389
+ }
390
+ return "";
391
+ }
392
+ function ke(e) {
393
+ if (e !== void 0) {
394
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
395
+ return "\n\nCheck your code at " + t + ":" + n + ".";
396
+ }
397
+ return "";
398
+ }
399
+ var $ = {};
400
+ function Ae(e) {
401
+ var t = Oe();
402
+ if (!t) {
403
+ var n = typeof e == "string" ? e : e.displayName || e.name;
404
+ n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
405
+ }
406
+ return t;
407
+ }
408
+ function je(e, t) {
409
+ if (!(!e._store || e._store.validated || e.key != null)) {
410
+ e._store.validated = !0;
411
+ var n = Ae(t);
412
+ if (!$[n]) {
413
+ $[n] = !0;
414
+ var r = "";
415
+ e && e._owner && e._owner !== X.current && (r = " It was passed a child from " + D(e._owner.type) + "."), Z(e), y("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), Z(null);
416
+ }
417
+ }
418
+ }
419
+ function Me(e, t) {
420
+ if (typeof e == "object") {
421
+ if (J(e)) for (var n = 0; n < e.length; n++) {
422
+ var r = e[n];
423
+ Q(r) && je(r, t);
424
+ }
425
+ else if (Q(e)) e._store && (e._store.validated = !0);
426
+ else if (e) {
427
+ var i = _(e);
428
+ if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Q(o.value) && je(o.value, t);
429
+ }
430
+ }
431
+ }
432
+ function Ne(e) {
433
+ var t = e.type;
434
+ if (!(t == null || typeof t == "string")) {
435
+ var n;
436
+ if (typeof t == "function") n = t.propTypes;
437
+ else if (typeof t == "object" && (t.$$typeof === l || t.$$typeof === f)) n = t.propTypes;
438
+ else return;
439
+ if (n) {
440
+ var r = D(t);
441
+ le(n, e.props, "prop", r, e);
442
+ } else t.PropTypes !== void 0 && !De && (De = !0, y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D(t) || "Unknown"));
443
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
444
+ }
445
+ }
446
+ function Pe(e) {
447
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
448
+ var r = t[n];
449
+ if (r !== "children" && r !== "key") {
450
+ Z(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), Z(null);
451
+ break;
452
+ }
453
+ }
454
+ e.ref !== null && (Z(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null));
455
+ }
456
+ var Fe = {};
457
+ function Ie(e, t, r, a, o, s) {
458
+ var c = C(e);
459
+ if (!c) {
460
+ var l = "";
461
+ (e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
462
+ var u = ke(o);
463
+ u ? l += u : l += Oe();
464
+ var d;
465
+ e === null ? d = "null" : J(e) ? d = "array" : e !== void 0 && e.$$typeof === n ? (d = "<" + (D(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
466
+ }
467
+ var f = Te(e, t, r, o, s);
468
+ if (f == null) return f;
469
+ if (c) {
470
+ var p = t.children;
471
+ if (p !== void 0) if (a) if (J(p)) {
472
+ for (var m = 0; m < p.length; m++) Me(p[m], e);
473
+ Object.freeze && Object.freeze(p);
474
+ } else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
475
+ else Me(p, e);
476
+ }
477
+ if (G.call(t, "key")) {
478
+ var h = D(e), g = Object.keys(t).filter(function(e) {
479
+ return e !== "key";
480
+ }), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
481
+ Fe[h + _] || (y("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), Fe[h + _] = !0);
482
+ }
483
+ return e === i ? Pe(f) : Ne(f), f;
484
+ }
485
+ function Le(e, t, n) {
486
+ return Ie(e, t, n, !0);
487
+ }
488
+ function Re(e, t, n) {
489
+ return Ie(e, t, n, !1);
490
+ }
491
+ var ze = Re, Be = Le;
492
+ e.Fragment = i, e.jsx = ze, e.jsxs = Be;
493
+ })();
494
+ })), O = (/* @__PURE__ */ C(((e, t) => {
495
+ process.env.NODE_ENV === "production" ? t.exports = E() : t.exports = D();
496
+ })))(), k = ({ error: e }) => /* @__PURE__ */ (0, O.jsx)("div", {
497
+ className: "plugin-error",
498
+ children: /* @__PURE__ */ (0, O.jsxs)("div", {
499
+ className: "plugin-error__container",
500
+ children: [
501
+ /* @__PURE__ */ (0, O.jsxs)("div", {
502
+ className: "plugin-error__header",
503
+ children: [/* @__PURE__ */ (0, O.jsxs)("svg", {
504
+ className: "plugin-error__icon",
505
+ width: "24",
506
+ height: "24",
507
+ viewBox: "0 0 24 24",
508
+ fill: "none",
509
+ children: [/* @__PURE__ */ (0, O.jsx)("circle", {
510
+ cx: "12",
511
+ cy: "12",
512
+ r: "10",
513
+ fill: "#f44336"
514
+ }), /* @__PURE__ */ (0, O.jsx)("path", {
515
+ d: "M12 7v6m0 4h.01",
516
+ stroke: "white",
517
+ strokeWidth: "2",
518
+ strokeLinecap: "round"
519
+ })]
520
+ }), /* @__PURE__ */ (0, O.jsx)("h3", {
521
+ className: "plugin-error__title",
522
+ children: "Ошибка инициализации плагина"
523
+ })]
524
+ }),
525
+ /* @__PURE__ */ (0, O.jsx)("div", {
526
+ className: "plugin-error__message",
527
+ children: "Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте перезагрузить страницу."
528
+ }),
529
+ /* @__PURE__ */ (0, O.jsxs)("details", {
530
+ className: "plugin-error__details",
531
+ children: [/* @__PURE__ */ (0, O.jsx)("summary", {
532
+ className: "plugin-error__summary",
533
+ children: "Детали ошибки"
534
+ }), /* @__PURE__ */ (0, O.jsxs)("pre", {
535
+ className: "plugin-error__stack",
536
+ children: [e.message, e.stack && `\n\n${e.stack}`]
537
+ })]
538
+ })
539
+ ]
540
+ })
541
+ }), A = () => /* @__PURE__ */ (0, O.jsx)("div", {
542
+ className: "plugin-loader",
543
+ children: /* @__PURE__ */ (0, O.jsxs)("div", {
544
+ className: "plugin-loader__content",
545
+ children: [/* @__PURE__ */ (0, O.jsx)("div", { className: "plugin-loader__spinner" }), /* @__PURE__ */ (0, O.jsx)("div", {
546
+ className: "plugin-loader__text",
547
+ children: "Загрузка плагина..."
548
+ })]
549
+ })
550
+ });
551
+ //#endregion
552
+ //#region src/hooks/useContext.ts
553
+ function j() {
554
+ let [e, t] = s(() => {
555
+ let e;
556
+ return x("context.changed", (t) => {
557
+ e = t;
558
+ })(), e;
559
+ });
560
+ return i(() => x("context.changed", (e) => {
561
+ t(e);
562
+ }), []), e;
17
563
  }
18
- var ee = { exports: {} }, H = {};
19
- var Le;
20
- function Sr() {
21
- if (Le) return H;
22
- Le = 1;
23
- var u = Ye, a = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, _ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
24
- function I(P, v, k) {
25
- var b, O = {}, w = null, C = null;
26
- k !== void 0 && (w = "" + k), v.key !== void 0 && (w = "" + v.key), v.ref !== void 0 && (C = v.ref);
27
- for (b in v) f.call(v, b) && !j.hasOwnProperty(b) && (O[b] = v[b]);
28
- if (P && P.defaultProps) for (b in v = P.defaultProps, v) O[b] === void 0 && (O[b] = v[b]);
29
- return { $$typeof: a, type: P, key: w, ref: C, props: O, _owner: _.current };
30
- }
31
- return H.Fragment = c, H.jsx = I, H.jsxs = I, H;
564
+ //#endregion
565
+ //#region src/hooks/useIsYateam.ts
566
+ function M() {
567
+ let [e, t] = s(void 0);
568
+ return i(() => {
569
+ (async () => {
570
+ t(await b.getIsYateam());
571
+ })();
572
+ }, []), e;
32
573
  }
33
- var G = {};
34
- var Fe;
35
- function jr() {
36
- return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && (function() {
37
- var u = Ye, a = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), f = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.provider"), P = /* @__PURE__ */ Symbol.for("react.context"), v = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), b = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), w = /* @__PURE__ */ Symbol.for("react.lazy"), C = /* @__PURE__ */ Symbol.for("react.offscreen"), x = Symbol.iterator, $ = "@@iterator";
38
- function S(e) {
39
- if (e === null || typeof e != "object")
40
- return null;
41
- var r = x && e[x] || e[$];
42
- return typeof r == "function" ? r : null;
43
- }
44
- var y = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
45
- function h(e) {
46
- {
47
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
48
- t[n - 1] = arguments[n];
49
- L("error", e, t);
50
- }
51
- }
52
- function L(e, r, t) {
53
- {
54
- var n = y.ReactDebugCurrentFrame, s = n.getStackAddendum();
55
- s !== "" && (r += "%s", t = t.concat([s]));
56
- var l = t.map(function(o) {
57
- return String(o);
58
- });
59
- l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
60
- }
61
- }
62
- var F = !1, B = !1, Ve = !1, qe = !1, Be = !1, ce;
63
- ce = /* @__PURE__ */ Symbol.for("react.module.reference");
64
- function ze(e) {
65
- return !!(typeof e == "string" || typeof e == "function" || e === f || e === j || Be || e === _ || e === k || e === b || qe || e === C || F || B || Ve || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === O || e.$$typeof === I || e.$$typeof === P || e.$$typeof === v || // This needs to include all possible module reference object
66
- // types supported by any Flight configuration anywhere since
67
- // we don't know which Flight build this will end up being used
68
- // with.
69
- e.$$typeof === ce || e.getModuleId !== void 0));
70
- }
71
- function Je(e, r, t) {
72
- var n = e.displayName;
73
- if (n)
74
- return n;
75
- var s = r.displayName || r.name || "";
76
- return s !== "" ? t + "(" + s + ")" : t;
77
- }
78
- function fe(e) {
79
- return e.displayName || "Context";
80
- }
81
- function D(e) {
82
- if (e == null)
83
- return null;
84
- if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
85
- return e.displayName || e.name || null;
86
- if (typeof e == "string")
87
- return e;
88
- switch (e) {
89
- case f:
90
- return "Fragment";
91
- case c:
92
- return "Portal";
93
- case j:
94
- return "Profiler";
95
- case _:
96
- return "StrictMode";
97
- case k:
98
- return "Suspense";
99
- case b:
100
- return "SuspenseList";
101
- }
102
- if (typeof e == "object")
103
- switch (e.$$typeof) {
104
- case P:
105
- var r = e;
106
- return fe(r) + ".Consumer";
107
- case I:
108
- var t = e;
109
- return fe(t._context) + ".Provider";
110
- case v:
111
- return Je(e, e.render, "ForwardRef");
112
- case O:
113
- var n = e.displayName || null;
114
- return n !== null ? n : D(e.type) || "Memo";
115
- case w: {
116
- var s = e, l = s._payload, o = s._init;
117
- try {
118
- return D(o(l));
119
- } catch {
120
- return null;
121
- }
122
- }
123
- }
124
- return null;
125
- }
126
- var N = Object.assign, z = 0, de, ve, ge, he, pe, me, be;
127
- function _e() {
128
- }
129
- _e.__reactDisabledLog = !0;
130
- function He() {
131
- {
132
- if (z === 0) {
133
- de = console.log, ve = console.info, ge = console.warn, he = console.error, pe = console.group, me = console.groupCollapsed, be = console.groupEnd;
134
- var e = {
135
- configurable: !0,
136
- enumerable: !0,
137
- value: _e,
138
- writable: !0
139
- };
140
- Object.defineProperties(console, {
141
- info: e,
142
- log: e,
143
- warn: e,
144
- error: e,
145
- group: e,
146
- groupCollapsed: e,
147
- groupEnd: e
148
- });
149
- }
150
- z++;
151
- }
152
- }
153
- function Ge() {
154
- {
155
- if (z--, z === 0) {
156
- var e = {
157
- configurable: !0,
158
- enumerable: !0,
159
- writable: !0
160
- };
161
- Object.defineProperties(console, {
162
- log: N({}, e, {
163
- value: de
164
- }),
165
- info: N({}, e, {
166
- value: ve
167
- }),
168
- warn: N({}, e, {
169
- value: ge
170
- }),
171
- error: N({}, e, {
172
- value: he
173
- }),
174
- group: N({}, e, {
175
- value: pe
176
- }),
177
- groupCollapsed: N({}, e, {
178
- value: me
179
- }),
180
- groupEnd: N({}, e, {
181
- value: be
182
- })
183
- });
184
- }
185
- z < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
186
- }
187
- }
188
- var re = y.ReactCurrentDispatcher, te;
189
- function K(e, r, t) {
190
- {
191
- if (te === void 0)
192
- try {
193
- throw Error();
194
- } catch (s) {
195
- var n = s.stack.trim().match(/\n( *(at )?)/);
196
- te = n && n[1] || "";
197
- }
198
- return `
199
- ` + te + e;
200
- }
201
- }
202
- var ne = !1, X;
203
- {
204
- var Ke = typeof WeakMap == "function" ? WeakMap : Map;
205
- X = new Ke();
206
- }
207
- function ye(e, r) {
208
- if (!e || ne)
209
- return "";
210
- {
211
- var t = X.get(e);
212
- if (t !== void 0)
213
- return t;
214
- }
215
- var n;
216
- ne = !0;
217
- var s = Error.prepareStackTrace;
218
- Error.prepareStackTrace = void 0;
219
- var l;
220
- l = re.current, re.current = null, He();
221
- try {
222
- if (r) {
223
- var o = function() {
224
- throw Error();
225
- };
226
- if (Object.defineProperty(o.prototype, "props", {
227
- set: function() {
228
- throw Error();
229
- }
230
- }), typeof Reflect == "object" && Reflect.construct) {
231
- try {
232
- Reflect.construct(o, []);
233
- } catch (R) {
234
- n = R;
235
- }
236
- Reflect.construct(e, [], o);
237
- } else {
238
- try {
239
- o.call();
240
- } catch (R) {
241
- n = R;
242
- }
243
- e.call(o.prototype);
244
- }
245
- } else {
246
- try {
247
- throw Error();
248
- } catch (R) {
249
- n = R;
250
- }
251
- e();
252
- }
253
- } catch (R) {
254
- if (R && n && typeof R.stack == "string") {
255
- for (var i = R.stack.split(`
256
- `), E = n.stack.split(`
257
- `), g = i.length - 1, p = E.length - 1; g >= 1 && p >= 0 && i[g] !== E[p]; )
258
- p--;
259
- for (; g >= 1 && p >= 0; g--, p--)
260
- if (i[g] !== E[p]) {
261
- if (g !== 1 || p !== 1)
262
- do
263
- if (g--, p--, p < 0 || i[g] !== E[p]) {
264
- var T = `
265
- ` + i[g].replace(" at new ", " at ");
266
- return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, T), T;
267
- }
268
- while (g >= 1 && p >= 0);
269
- break;
270
- }
271
- }
272
- } finally {
273
- ne = !1, re.current = l, Ge(), Error.prepareStackTrace = s;
274
- }
275
- var W = e ? e.displayName || e.name : "", U = W ? K(W) : "";
276
- return typeof e == "function" && X.set(e, U), U;
277
- }
278
- function Xe(e, r, t) {
279
- return ye(e, !1);
280
- }
281
- function Qe(e) {
282
- var r = e.prototype;
283
- return !!(r && r.isReactComponent);
284
- }
285
- function Q(e, r, t) {
286
- if (e == null)
287
- return "";
288
- if (typeof e == "function")
289
- return ye(e, Qe(e));
290
- if (typeof e == "string")
291
- return K(e);
292
- switch (e) {
293
- case k:
294
- return K("Suspense");
295
- case b:
296
- return K("SuspenseList");
297
- }
298
- if (typeof e == "object")
299
- switch (e.$$typeof) {
300
- case v:
301
- return Xe(e.render);
302
- case O:
303
- return Q(e.type, r, t);
304
- case w: {
305
- var n = e, s = n._payload, l = n._init;
306
- try {
307
- return Q(l(s), r, t);
308
- } catch {
309
- }
310
- }
311
- }
312
- return "";
313
- }
314
- var J = Object.prototype.hasOwnProperty, Ee = {}, Re = y.ReactDebugCurrentFrame;
315
- function Z(e) {
316
- if (e) {
317
- var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
318
- Re.setExtraStackFrame(t);
319
- } else
320
- Re.setExtraStackFrame(null);
321
- }
322
- function Ze(e, r, t, n, s) {
323
- {
324
- var l = Function.call.bind(J);
325
- for (var o in e)
326
- if (l(e, o)) {
327
- var i = void 0;
328
- try {
329
- if (typeof e[o] != "function") {
330
- var E = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
331
- throw E.name = "Invariant Violation", E;
332
- }
333
- i = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
334
- } catch (g) {
335
- i = g;
336
- }
337
- i && !(i instanceof Error) && (Z(s), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof i), Z(null)), i instanceof Error && !(i.message in Ee) && (Ee[i.message] = !0, Z(s), h("Failed %s type: %s", t, i.message), Z(null));
338
- }
339
- }
340
- }
341
- var er = Array.isArray;
342
- function ae(e) {
343
- return er(e);
344
- }
345
- function rr(e) {
346
- {
347
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
348
- return t;
349
- }
350
- }
351
- function tr(e) {
352
- try {
353
- return xe(e), !1;
354
- } catch {
355
- return !0;
356
- }
357
- }
358
- function xe(e) {
359
- return "" + e;
360
- }
361
- function Pe(e) {
362
- if (tr(e))
363
- return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), xe(e);
364
- }
365
- var Ce = y.ReactCurrentOwner, nr = {
366
- key: !0,
367
- ref: !0,
368
- __self: !0,
369
- __source: !0
370
- }, Te, Oe;
371
- function ar(e) {
372
- if (J.call(e, "ref")) {
373
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
374
- if (r && r.isReactWarning)
375
- return !1;
376
- }
377
- return e.ref !== void 0;
378
- }
379
- function ir(e) {
380
- if (J.call(e, "key")) {
381
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
382
- if (r && r.isReactWarning)
383
- return !1;
384
- }
385
- return e.key !== void 0;
386
- }
387
- function or(e, r) {
388
- typeof e.ref == "string" && Ce.current;
389
- }
390
- function sr(e, r) {
391
- {
392
- var t = function() {
393
- Te || (Te = !0, h("%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://reactjs.org/link/special-props)", r));
394
- };
395
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
396
- get: t,
397
- configurable: !0
398
- });
399
- }
400
- }
401
- function ur(e, r) {
402
- {
403
- var t = function() {
404
- Oe || (Oe = !0, h("%s: `ref` 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://reactjs.org/link/special-props)", r));
405
- };
406
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
407
- get: t,
408
- configurable: !0
409
- });
410
- }
411
- }
412
- var lr = function(e, r, t, n, s, l, o) {
413
- var i = {
414
- // This tag allows us to uniquely identify this as a React Element
415
- $$typeof: a,
416
- // Built-in properties that belong on the element
417
- type: e,
418
- key: r,
419
- ref: t,
420
- props: o,
421
- // Record the component responsible for creating this element.
422
- _owner: l
423
- };
424
- return i._store = {}, Object.defineProperty(i._store, "validated", {
425
- configurable: !1,
426
- enumerable: !1,
427
- writable: !0,
428
- value: !1
429
- }), Object.defineProperty(i, "_self", {
430
- configurable: !1,
431
- enumerable: !1,
432
- writable: !1,
433
- value: n
434
- }), Object.defineProperty(i, "_source", {
435
- configurable: !1,
436
- enumerable: !1,
437
- writable: !1,
438
- value: s
439
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
440
- };
441
- function cr(e, r, t, n, s) {
442
- {
443
- var l, o = {}, i = null, E = null;
444
- t !== void 0 && (Pe(t), i = "" + t), ir(r) && (Pe(r.key), i = "" + r.key), ar(r) && (E = r.ref, or(r, s));
445
- for (l in r)
446
- J.call(r, l) && !nr.hasOwnProperty(l) && (o[l] = r[l]);
447
- if (e && e.defaultProps) {
448
- var g = e.defaultProps;
449
- for (l in g)
450
- o[l] === void 0 && (o[l] = g[l]);
451
- }
452
- if (i || E) {
453
- var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
454
- i && sr(o, p), E && ur(o, p);
455
- }
456
- return lr(e, i, E, s, n, Ce.current, o);
457
- }
458
- }
459
- var ie = y.ReactCurrentOwner, we = y.ReactDebugCurrentFrame;
460
- function M(e) {
461
- if (e) {
462
- var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
463
- we.setExtraStackFrame(t);
464
- } else
465
- we.setExtraStackFrame(null);
466
- }
467
- var oe;
468
- oe = !1;
469
- function se(e) {
470
- return typeof e == "object" && e !== null && e.$$typeof === a;
471
- }
472
- function Se() {
473
- {
474
- if (ie.current) {
475
- var e = D(ie.current.type);
476
- if (e)
477
- return `
478
-
479
- Check the render method of \`` + e + "`.";
480
- }
481
- return "";
482
- }
483
- }
484
- function fr(e) {
485
- return "";
486
- }
487
- var je = {};
488
- function dr(e) {
489
- {
490
- var r = Se();
491
- if (!r) {
492
- var t = typeof e == "string" ? e : e.displayName || e.name;
493
- t && (r = `
494
-
495
- Check the top-level render call using <` + t + ">.");
496
- }
497
- return r;
498
- }
499
- }
500
- function Ie(e, r) {
501
- {
502
- if (!e._store || e._store.validated || e.key != null)
503
- return;
504
- e._store.validated = !0;
505
- var t = dr(r);
506
- if (je[t])
507
- return;
508
- je[t] = !0;
509
- var n = "";
510
- e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + D(e._owner.type) + "."), M(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), M(null);
511
- }
512
- }
513
- function ke(e, r) {
514
- {
515
- if (typeof e != "object")
516
- return;
517
- if (ae(e))
518
- for (var t = 0; t < e.length; t++) {
519
- var n = e[t];
520
- se(n) && Ie(n, r);
521
- }
522
- else if (se(e))
523
- e._store && (e._store.validated = !0);
524
- else if (e) {
525
- var s = S(e);
526
- if (typeof s == "function" && s !== e.entries)
527
- for (var l = s.call(e), o; !(o = l.next()).done; )
528
- se(o.value) && Ie(o.value, r);
529
- }
530
- }
531
- }
532
- function vr(e) {
533
- {
534
- var r = e.type;
535
- if (r == null || typeof r == "string")
536
- return;
537
- var t;
538
- if (typeof r == "function")
539
- t = r.propTypes;
540
- else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
541
- // Inner props are checked in the reconciler.
542
- r.$$typeof === O))
543
- t = r.propTypes;
544
- else
545
- return;
546
- if (t) {
547
- var n = D(r);
548
- Ze(t, e.props, "prop", n, e);
549
- } else if (r.PropTypes !== void 0 && !oe) {
550
- oe = !0;
551
- var s = D(r);
552
- h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
553
- }
554
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
555
- }
556
- }
557
- function gr(e) {
558
- {
559
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
560
- var n = r[t];
561
- if (n !== "children" && n !== "key") {
562
- M(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), M(null);
563
- break;
564
- }
565
- }
566
- e.ref !== null && (M(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
567
- }
568
- }
569
- var De = {};
570
- function Ae(e, r, t, n, s, l) {
571
- {
572
- var o = ze(e);
573
- if (!o) {
574
- var i = "";
575
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
576
- var E = fr();
577
- E ? i += E : i += Se();
578
- var g;
579
- e === null ? g = "null" : ae(e) ? g = "array" : e !== void 0 && e.$$typeof === a ? (g = "<" + (D(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, i);
580
- }
581
- var p = cr(e, r, t, s, l);
582
- if (p == null)
583
- return p;
584
- if (o) {
585
- var T = r.children;
586
- if (T !== void 0)
587
- if (n)
588
- if (ae(T)) {
589
- for (var W = 0; W < T.length; W++)
590
- ke(T[W], e);
591
- Object.freeze && Object.freeze(T);
592
- } else
593
- h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
594
- else
595
- ke(T, e);
596
- }
597
- if (J.call(r, "key")) {
598
- var U = D(e), R = Object.keys(r).filter(function(yr) {
599
- return yr !== "key";
600
- }), ue = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
601
- if (!De[U + ue]) {
602
- var _r = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
603
- h(`A props object containing a "key" prop is being spread into JSX:
604
- let props = %s;
605
- <%s {...props} />
606
- React keys must be passed directly to JSX without using spread:
607
- let props = %s;
608
- <%s key={someKey} {...props} />`, ue, U, _r, U), De[U + ue] = !0;
609
- }
610
- }
611
- return e === f ? gr(p) : vr(p), p;
612
- }
613
- }
614
- function hr(e, r, t) {
615
- return Ae(e, r, t, !0);
616
- }
617
- function pr(e, r, t) {
618
- return Ae(e, r, t, !1);
619
- }
620
- var mr = pr, br = hr;
621
- G.Fragment = f, G.jsx = mr, G.jsxs = br;
622
- })()), G;
623
- }
624
- var Ne;
625
- function Ir() {
626
- return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? ee.exports = Sr() : ee.exports = jr()), ee.exports;
627
- }
628
- var d = Ir();
629
- const kr = ({ error: u }) => /* @__PURE__ */ d.jsx("div", { className: "plugin-error", children: /* @__PURE__ */ d.jsxs("div", { className: "plugin-error__container", children: [
630
- /* @__PURE__ */ d.jsxs("div", { className: "plugin-error__header", children: [
631
- /* @__PURE__ */ d.jsxs(
632
- "svg",
633
- {
634
- className: "plugin-error__icon",
635
- width: "24",
636
- height: "24",
637
- viewBox: "0 0 24 24",
638
- fill: "none",
639
- children: [
640
- /* @__PURE__ */ d.jsx("circle", { cx: "12", cy: "12", r: "10", fill: "#f44336" }),
641
- /* @__PURE__ */ d.jsx(
642
- "path",
643
- {
644
- d: "M12 7v6m0 4h.01",
645
- stroke: "white",
646
- strokeWidth: "2",
647
- strokeLinecap: "round"
648
- }
649
- )
650
- ]
651
- }
652
- ),
653
- /* @__PURE__ */ d.jsx("h3", { className: "plugin-error__title", children: "Ошибка инициализации плагина" })
654
- ] }),
655
- /* @__PURE__ */ d.jsx("div", { className: "plugin-error__message", children: "Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте перезагрузить страницу." }),
656
- /* @__PURE__ */ d.jsxs("details", { className: "plugin-error__details", children: [
657
- /* @__PURE__ */ d.jsx("summary", { className: "plugin-error__summary", children: "Детали ошибки" }),
658
- /* @__PURE__ */ d.jsxs("pre", { className: "plugin-error__stack", children: [
659
- u.message,
660
- u.stack && `
661
-
662
- ${u.stack}`
663
- ] })
664
- ] })
665
- ] }) }), Ue = kr, Dr = () => /* @__PURE__ */ d.jsx("div", { className: "plugin-loader", children: /* @__PURE__ */ d.jsxs("div", { className: "plugin-loader__content", children: [
666
- /* @__PURE__ */ d.jsx("div", { className: "plugin-loader__spinner" }),
667
- /* @__PURE__ */ d.jsx("div", { className: "plugin-loader__text", children: "Загрузка плагина..." })
668
- ] }) }), qr = Dr;
669
- function Ar() {
670
- const [u, a] = A(() => {
671
- let c;
672
- return q("context.changed", (_) => {
673
- c = _;
674
- })(), c;
675
- });
676
- return Y(() => q("context.changed", (f) => {
677
- a(f);
678
- }), []), u;
574
+ //#endregion
575
+ //#region src/hooks/useLanguage.ts
576
+ function N() {
577
+ let [e, t] = s(() => {
578
+ let e;
579
+ return x("language.changed", (t) => {
580
+ e = t;
581
+ })(), e;
582
+ });
583
+ return i(() => x("language.changed", (e) => {
584
+ t(e);
585
+ }), []), e;
679
586
  }
680
- function Lr() {
681
- const [u, a] = A(void 0);
682
- return Y(() => {
683
- (async () => {
684
- const f = await m.getIsYateam();
685
- a(f);
686
- })();
687
- }, []), u;
587
+ //#endregion
588
+ //#region src/hooks/useTheme.ts
589
+ function P() {
590
+ let [e, t] = s(() => {
591
+ let e;
592
+ return x("theme.changed", (t) => {
593
+ e = t;
594
+ })(), e;
595
+ });
596
+ return i(() => x("theme.changed", (e) => {
597
+ t(e);
598
+ }), []), e;
688
599
  }
689
- function Me() {
690
- const [u, a] = A(() => {
691
- let c;
692
- return q("language.changed", (_) => {
693
- c = _;
694
- })(), c;
695
- });
696
- return Y(() => q("language.changed", (f) => {
697
- a(f);
698
- }), []), u;
600
+ //#endregion
601
+ //#region src/hooks/useUserId.ts
602
+ function F() {
603
+ let [e, t] = s(void 0);
604
+ return i(() => {
605
+ (async () => {
606
+ t(await b.getUserId());
607
+ })();
608
+ }, []), e;
699
609
  }
700
- function Fr() {
701
- const [u, a] = A(() => {
702
- let c;
703
- return q("theme.changed", (_) => {
704
- c = _;
705
- })(), c;
706
- });
707
- return Y(() => q("theme.changed", (f) => {
708
- a(f);
709
- }), []), u;
610
+ //#endregion
611
+ //#region src/components/PluginProvider.tsx
612
+ var I = t(null);
613
+ function L(e = "basic") {
614
+ let t = r(I);
615
+ if (!t) throw Error("usePluginContext must be used within PluginProvider");
616
+ if (e === "full" && t.contextLevel !== "full") throw Error("🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. Change the contextLevel in your manifest to get full access.");
617
+ let n = P(), i = N(), a = M(), o = F(), s = j(), c = {
618
+ service: b.getService(),
619
+ origin: b.getOrigin(),
620
+ slot: t.slot,
621
+ innerUrl: t.innerUrl,
622
+ queryParams: t.queryParams,
623
+ registerHandler: t.registerHandler,
624
+ theme: n,
625
+ language: i,
626
+ isYateam: a,
627
+ userId: o
628
+ };
629
+ if (e === "basic") {
630
+ let e = t.entityId ? {
631
+ entityId: t.entityId,
632
+ ...t.entityMeta ? { entityMeta: t.entityMeta } : {}
633
+ } : void 0;
634
+ return {
635
+ ...c,
636
+ contextLevel: "basic",
637
+ slotContext: e
638
+ };
639
+ }
640
+ return {
641
+ ...c,
642
+ contextLevel: "full",
643
+ slotContext: s
644
+ };
710
645
  }
711
- function Nr() {
712
- const [u, a] = A(void 0);
713
- return Y(() => {
714
- (async () => {
715
- const f = await m.getUserId();
716
- a(f);
717
- })();
718
- }, []), u;
719
- }
720
- const We = Rr(null);
721
- function Br(u = "basic") {
722
- const a = Cr(We);
723
- if (!a)
724
- throw new Error("usePluginContext must be used within PluginProvider");
725
- if (u === "full" && a.contextLevel !== "full")
726
- throw new Error(
727
- "🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. Change the contextLevel in your manifest to get full access."
728
- );
729
- const c = Fr(), f = Me(), _ = Lr(), j = Nr(), I = Ar(), P = {
730
- service: m.getService(),
731
- origin: m.getOrigin(),
732
- slot: a.slot,
733
- innerUrl: a.innerUrl,
734
- queryParams: a.queryParams,
735
- registerHandler: a.registerHandler,
736
- theme: c,
737
- language: f,
738
- isYateam: _,
739
- userId: j
740
- };
741
- if (u === "basic") {
742
- const v = a.entityId ? { entityId: a.entityId, ...a.entityMeta ? { entityMeta: a.entityMeta } : {} } : void 0;
743
- return {
744
- ...P,
745
- contextLevel: "basic",
746
- slotContext: v
747
- };
748
- }
749
- return {
750
- ...P,
751
- contextLevel: "full",
752
- slotContext: I
753
- };
754
- }
755
- const Ur = (u) => {
756
- try {
757
- return new URL(u, window.location.href).origin === window.location.origin;
758
- } catch {
759
- return !0;
760
- }
646
+ var R = (e) => {
647
+ try {
648
+ return new URL(e, window.location.href).origin === window.location.origin;
649
+ } catch {
650
+ return !0;
651
+ }
761
652
  };
762
- function zr({
763
- children: u,
764
- autoResize: a = !0,
765
- fallback: c,
766
- errorFallback: f,
767
- autoNotifyReady: _ = !0
768
- }) {
769
- const j = xr(!1), [I, P] = A(!1), [v, k] = A(null), [b, O] = A(null), w = Pr(() => (C, x) => Tr(C, x), []);
770
- return Y(() => {
771
- const C = (x) => {
772
- const S = x.target.closest("[href], [data-href]");
773
- if (!S) return;
774
- const y = S.getAttribute("href") || S.getAttribute("data-href");
775
- if (!y || Ur(y))
776
- return;
777
- x.preventDefault();
778
- const L = S.getAttribute("target") === "_blank";
779
- le.navigate({
780
- path: y,
781
- options: {
782
- newTab: L
783
- }
784
- }).then(() => {
785
- console.info(`Navigation: ${y}`);
786
- }).catch((F) => {
787
- console.error("Navigation error:", F);
788
- });
789
- };
790
- return document.addEventListener("click", C), () => {
791
- document.removeEventListener("click", C);
792
- };
793
- }, []), Y(() => {
794
- if (j.current)
795
- return;
796
- (async () => {
797
- try {
798
- m.init({ autoResize: a }), j.current = !0;
799
- const x = m.getContextLevel(), $ = m.getEntityId(), S = m.getEntityMeta();
800
- O({
801
- slot: m.getSlot(),
802
- innerUrl: m.getInnerUrl(),
803
- queryParams: m.getQueryParams(),
804
- contextLevel: x,
805
- entityId: $,
806
- entityMeta: S,
807
- registerHandler: w
808
- }), _ && await m.notifyReady();
809
- const [y, h, L, F, B] = await Promise.allSettled([
810
- m.getTheme(),
811
- m.getLanguage(),
812
- x === "full" ? m.getContext() : Promise.resolve(null),
813
- m.getIsYateam(),
814
- m.getUserId()
815
- ]);
816
- y.status === "fulfilled" && y.value && V({
817
- messageId: "",
818
- type: "event",
819
- method: "theme.changed",
820
- result: y.value
821
- }), h.status === "fulfilled" && h.value && V({
822
- messageId: "",
823
- type: "event",
824
- method: "language.changed",
825
- result: h.value
826
- }), F.status === "fulfilled" && F.value && V({
827
- messageId: "",
828
- type: "event",
829
- method: "isYateam.changed",
830
- result: F.value
831
- }), B.status === "fulfilled" && B.value && V({
832
- messageId: "",
833
- type: "event",
834
- method: "userId.changed",
835
- result: B.value
836
- }), x === "basic" ? $ && V({
837
- messageId: "",
838
- type: "event",
839
- method: "context.changed",
840
- result: { entityId: $, ...S ? { entityMeta: S } : {} }
841
- }) : L.status === "fulfilled" && L.value && V({
842
- messageId: "",
843
- type: "event",
844
- method: "context.changed",
845
- result: L.value
846
- }), P(!0);
847
- } catch (x) {
848
- k(x);
849
- }
850
- })();
851
- }, [a, w, _]), v ? f ? /* @__PURE__ */ d.jsx(d.Fragment, { children: f(v) }) : /* @__PURE__ */ d.jsx(Ue, { error: v }) : !I || !b ? /* @__PURE__ */ d.jsx(d.Fragment, { children: c }) : /* @__PURE__ */ d.jsx(
852
- wr,
853
- {
854
- fallback: f || ((C) => /* @__PURE__ */ d.jsx(Ue, { error: C })),
855
- children: /* @__PURE__ */ d.jsx(We.Provider, { value: b, children: u })
856
- }
857
- );
653
+ function ie({ children: e, autoResize: t = !0, fallback: n, errorFallback: r, autoNotifyReady: c = !0 }) {
654
+ let l = o(!1), [u, d] = s(!1), [f, p] = s(null), [m, h] = s(null), _ = a(() => (e, t) => ne(e, t), []);
655
+ return i(() => {
656
+ let e = (e) => {
657
+ let t = e.target.closest("[href], [data-href]");
658
+ if (!t) return;
659
+ let n = t.getAttribute("href") || t.getAttribute("data-href");
660
+ if (!n || R(n)) return;
661
+ e.preventDefault();
662
+ let r = t.getAttribute("target") === "_blank";
663
+ S.navigate({
664
+ path: n,
665
+ options: { newTab: r }
666
+ }).then(() => {
667
+ console.info(`Navigation: ${n}`);
668
+ }).catch((e) => {
669
+ console.error("Navigation error:", e);
670
+ });
671
+ };
672
+ return document.addEventListener("click", e), () => {
673
+ document.removeEventListener("click", e);
674
+ };
675
+ }, []), i(() => {
676
+ l.current || (async () => {
677
+ try {
678
+ b.init({ autoResize: t }), l.current = !0;
679
+ let e = b.getContextLevel(), n = b.getEntityId(), r = b.getEntityMeta();
680
+ h({
681
+ slot: b.getSlot(),
682
+ innerUrl: b.getInnerUrl(),
683
+ queryParams: b.getQueryParams(),
684
+ contextLevel: e,
685
+ entityId: n,
686
+ entityMeta: r,
687
+ registerHandler: _
688
+ }), c && await b.notifyReady();
689
+ let [i, a, o, s, u] = await Promise.allSettled([
690
+ b.getTheme(),
691
+ b.getLanguage(),
692
+ e === "full" ? b.getContext() : Promise.resolve(null),
693
+ b.getIsYateam(),
694
+ b.getUserId()
695
+ ]);
696
+ i.status === "fulfilled" && i.value && g({
697
+ messageId: "",
698
+ type: "event",
699
+ method: "theme.changed",
700
+ result: i.value
701
+ }), a.status === "fulfilled" && a.value && g({
702
+ messageId: "",
703
+ type: "event",
704
+ method: "language.changed",
705
+ result: a.value
706
+ }), s.status === "fulfilled" && s.value && g({
707
+ messageId: "",
708
+ type: "event",
709
+ method: "isYateam.changed",
710
+ result: s.value
711
+ }), u.status === "fulfilled" && u.value && g({
712
+ messageId: "",
713
+ type: "event",
714
+ method: "userId.changed",
715
+ result: u.value
716
+ }), e === "basic" ? n && g({
717
+ messageId: "",
718
+ type: "event",
719
+ method: "context.changed",
720
+ result: {
721
+ entityId: n,
722
+ ...r ? { entityMeta: r } : {}
723
+ }
724
+ }) : o.status === "fulfilled" && o.value && g({
725
+ messageId: "",
726
+ type: "event",
727
+ method: "context.changed",
728
+ result: o.value
729
+ }), d(!0);
730
+ } catch (e) {
731
+ p(e);
732
+ }
733
+ })();
734
+ }, [
735
+ t,
736
+ _,
737
+ c
738
+ ]), f ? r ? /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: r(f) }) : /* @__PURE__ */ (0, O.jsx)(k, { error: f }) : !u || !m ? /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: n }) : /* @__PURE__ */ (0, O.jsx)(T, {
739
+ fallback: r || ((e) => /* @__PURE__ */ (0, O.jsx)(k, { error: e })),
740
+ children: /* @__PURE__ */ (0, O.jsx)(I.Provider, {
741
+ value: m,
742
+ children: e
743
+ })
744
+ });
858
745
  }
859
- const Yr = () => ({ show: $e((a) => le.confirm.show(a), []) }), Jr = Yr, $r = (u = "ru") => {
860
- const a = Me();
861
- return (c) => Or(c, a, u);
862
- }, Hr = $r, Mr = () => ({ add: $e((a) => le.toaster.add(a), []) }), Gr = Mr;
863
- export {
864
- wr as ErrorBoundary,
865
- Qr as METHOD_NOT_SUPPORTED,
866
- Zr as MISSING_REQUIRED_SCOPE,
867
- et as PLUGIN_ID_IS_NOT_CORRECT,
868
- rt as PLUGIN_ID_OR_SLOT_NOT_PROVIDED,
869
- tt as PluginActionError,
870
- Ue as PluginError,
871
- qr as PluginLoader,
872
- zr as PluginProvider,
873
- nt as UNKNOWN_ERROR,
874
- at as VALIDATION_ERROR,
875
- it as dispatchHostEvent,
876
- ot as getField,
877
- st as getLocalizedString,
878
- ut as hostApi,
879
- Ur as isInternalUrl,
880
- lt as on,
881
- ct as uiApi,
882
- Jr as useConfirm,
883
- Lr as useIsYateam,
884
- Me as useLanguage,
885
- Hr as useLocalizedString,
886
- Br as usePluginContext,
887
- Fr as useTheme,
888
- Gr as useToaster,
889
- Nr as useUserId
890
- };
891
- //# sourceMappingURL=index.mjs.map
746
+ var z = () => ({ show: n((e) => S.confirm.show(e), []) }), B = (e = "ru") => {
747
+ let t = N();
748
+ return (n) => y(n, t, e);
749
+ }, V = () => ({ add: n((e) => S.toaster.add(e), []) });
750
+ //#endregion
751
+ export { T as ErrorBoundary, c as METHOD_NOT_SUPPORTED, l as MISSING_REQUIRED_SCOPE, u as PLUGIN_ID_IS_NOT_CORRECT, d as PLUGIN_ID_OR_SLOT_NOT_PROVIDED, f as PluginActionError, k as PluginError, A as PluginLoader, ie as PluginProvider, p as UNKNOWN_ERROR, m as VALIDATION_ERROR, h as dispatchHostEvent, _ as getField, v as getLocalizedString, ee as hostApi, R as isInternalUrl, te as on, re as uiApi, z as useConfirm, M as useIsYateam, N as useLanguage, B as useLocalizedString, L as usePluginContext, P as useTheme, V as useToaster, F as useUserId };
752
+
753
+ //# sourceMappingURL=index.mjs.map