@machinemetrics/mm-react-embeddable 1.0.6 → 1.0.7
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.
|
@@ -32,4 +32,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
32
32
|
height: 100%;
|
|
33
33
|
border: none;
|
|
34
34
|
visibility: ${n=>n.$isReady?"visible":"hidden"};
|
|
35
|
-
`,Ge=({id:n,src:o,path:T,onInit:c=()=>{},context:h={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in h)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in h)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const O=d.useRef(),[R,S]=d.useState(),[m,x]=d.useState(0),{registerFrame:k,unregisterFrame:A,sendMessage:i}=d.useContext(oe),[g,l]=d.useState(!0),[f,v]=d.useState();return d.useEffect(()=>{m&&i(n,"set-context",{context:{...h,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[h,E.colorMode,E.isFullScreen,n,m]),d.useEffect(()=>{m&&(i(n,"set-params",{params:E}),i(n,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,n,m]),d.useEffect(()=>{T!==void 0&&v(T)},[T]),d.useEffect(()=>{f===void 0||!m||i(n,"navigate",{path:f})},[f,m,n,i]),d.useEffect(()=>{if(!(!o||!n||!O))return(async()=>{const w=await Ke(o);if(l(w),w){const D=new URL(o);k(n,D.origin,O),c(),S(`${D.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{A(n)}},[o,n,k,O]),Ne(n,"ready",()=>x(w=>w+1)),g?ae.jsx(kr,{$isReady:m,ref:O,src:R,...F}):ae.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:ae.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ge.propTypes={id:H.string,src:H.string.isRequired,path:H.string,onInit:H.func};exports.MMEmbeddableZone=Ge;exports.MMEmbeddableZoneContext=oe;exports.MMEmbeddableZoneProvider=Be;exports.getAppInfo=Je;exports.testIsEmbeddable=Ke;exports.useEmbeddedEffect=Ne;
|
|
35
|
+
`,Ge=({id:n,src:o,path:T,onInit:c=()=>{},context:h={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in h)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in h)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const O=d.useRef(),[R,S]=d.useState(),[m,x]=d.useState(0),{registerFrame:k,unregisterFrame:A,sendMessage:i}=d.useContext(oe),[g,l]=d.useState(!0),[f,v]=d.useState();return d.useEffect(()=>{m&&i(n,"set-context",{context:{...h,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[h,E.colorMode,E.isFullScreen,n,m]),d.useEffect(()=>{m&&(i(n,"set-params",{params:E}),i(n,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,n,m]),d.useEffect(()=>{T!==void 0&&v(T)},[T]),d.useEffect(()=>{f===void 0||!m||i(n,"navigate",{path:f})},[f,m,n,i]),d.useEffect(()=>{if(!(!o||!n||!O))return(async()=>{const w=await Ke(o);if(l(w),w){const D=new URL(o);k(n,D.origin,O),c(),S(`${D.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{A(n)}},[o,n,k,O]),Ne(n,"ready",()=>x(w=>w+1)),g?ae.jsx(kr,{$isReady:m,ref:O,src:R,...F}):ae.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:ae.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ge.propTypes={id:H.string,src:H.string.isRequired,path:H.string,onInit:H.func};exports.MMEmbeddableZone=Ge;exports.MMEmbeddableZoneContext=oe;exports.MMEmbeddableZoneProvider=Be;exports.getAppInfo=Je;exports.testIsEmbeddable=Ke;exports.useEmbeddedEffect=Ne;
|
|
@@ -17,11 +17,11 @@ function Sr() {
|
|
|
17
17
|
Je = 1;
|
|
18
18
|
var n = Ne, o = Symbol.for("react.element"), S = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
19
|
function F(C, E, w) {
|
|
20
|
-
var b,
|
|
20
|
+
var b, x = {}, j = null, M = null;
|
|
21
21
|
w !== void 0 && (j = "" + w), E.key !== void 0 && (j = "" + E.key), E.ref !== void 0 && (M = E.ref);
|
|
22
|
-
for (b in E) c.call(E, b) && !h.hasOwnProperty(b) && (
|
|
23
|
-
if (C && C.defaultProps) for (b in E = C.defaultProps, E)
|
|
24
|
-
return { $$typeof: o, type: C, key: j, ref: M, props:
|
|
22
|
+
for (b in E) c.call(E, b) && !h.hasOwnProperty(b) && (x[b] = E[b]);
|
|
23
|
+
if (C && C.defaultProps) for (b in E = C.defaultProps, E) x[b] === void 0 && (x[b] = E[b]);
|
|
24
|
+
return { $$typeof: o, type: C, key: j, ref: M, props: x, _owner: y.current };
|
|
25
25
|
}
|
|
26
26
|
return G.Fragment = S, G.jsx = F, G.jsxs = F, G;
|
|
27
27
|
}
|
|
@@ -38,7 +38,7 @@ var H = {};
|
|
|
38
38
|
var Ke;
|
|
39
39
|
function Cr() {
|
|
40
40
|
return Ke || (Ke = 1, process.env.NODE_ENV !== "production" && function() {
|
|
41
|
-
var n = Ne, o = Symbol.for("react.element"), S = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), C = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"),
|
|
41
|
+
var n = Ne, o = Symbol.for("react.element"), S = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), C = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), i = Symbol.iterator, g = "@@iterator";
|
|
42
42
|
function l(e) {
|
|
43
43
|
if (e === null || typeof e != "object")
|
|
44
44
|
return null;
|
|
@@ -66,7 +66,7 @@ function Cr() {
|
|
|
66
66
|
var D = !1, V = !1, $ = !1, ee = !1, re = !1, U;
|
|
67
67
|
U = Symbol.for("react.module.reference");
|
|
68
68
|
function ue(e) {
|
|
69
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e === h || re || e === y || e === w || e === b || ee || e === M || D || V || $ || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof ===
|
|
69
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === h || re || e === y || e === w || e === b || ee || e === M || D || V || $ || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === x || e.$$typeof === F || e.$$typeof === C || e.$$typeof === E || // This needs to include all possible module reference object
|
|
70
70
|
// types supported by any Flight configuration anywhere since
|
|
71
71
|
// we don't know which Flight build this will end up being used
|
|
72
72
|
// with.
|
|
@@ -113,7 +113,7 @@ function Cr() {
|
|
|
113
113
|
return J(t._context) + ".Provider";
|
|
114
114
|
case E:
|
|
115
115
|
return ce(e, e.render, "ForwardRef");
|
|
116
|
-
case
|
|
116
|
+
case x:
|
|
117
117
|
var a = e.displayName || null;
|
|
118
118
|
return a !== null ? a : I(e.type) || "Memo";
|
|
119
119
|
case j: {
|
|
@@ -127,18 +127,18 @@ function Cr() {
|
|
|
127
127
|
}
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
|
-
var W = Object.assign, K = 0, _e, we, Te, Se, Ce, Oe,
|
|
131
|
-
function
|
|
130
|
+
var W = Object.assign, K = 0, _e, we, Te, Se, Ce, Oe, xe;
|
|
131
|
+
function Pe() {
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
Pe.__reactDisabledLog = !0;
|
|
134
134
|
function He() {
|
|
135
135
|
{
|
|
136
136
|
if (K === 0) {
|
|
137
|
-
_e = console.log, we = console.info, Te = console.warn, Se = console.error, Ce = console.group, Oe = console.groupCollapsed,
|
|
137
|
+
_e = console.log, we = console.info, Te = console.warn, Se = console.error, Ce = console.group, Oe = console.groupCollapsed, xe = console.groupEnd;
|
|
138
138
|
var e = {
|
|
139
139
|
configurable: !0,
|
|
140
140
|
enumerable: !0,
|
|
141
|
-
value:
|
|
141
|
+
value: Pe,
|
|
142
142
|
writable: !0
|
|
143
143
|
};
|
|
144
144
|
Object.defineProperties(console, {
|
|
@@ -182,7 +182,7 @@ function Cr() {
|
|
|
182
182
|
value: Oe
|
|
183
183
|
}),
|
|
184
184
|
groupEnd: W({}, e, {
|
|
185
|
-
value:
|
|
185
|
+
value: xe
|
|
186
186
|
})
|
|
187
187
|
});
|
|
188
188
|
}
|
|
@@ -234,29 +234,29 @@ function Cr() {
|
|
|
234
234
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
235
235
|
try {
|
|
236
236
|
Reflect.construct(u, []);
|
|
237
|
-
} catch (
|
|
238
|
-
a =
|
|
237
|
+
} catch (P) {
|
|
238
|
+
a = P;
|
|
239
239
|
}
|
|
240
240
|
Reflect.construct(e, [], u);
|
|
241
241
|
} else {
|
|
242
242
|
try {
|
|
243
243
|
u.call();
|
|
244
|
-
} catch (
|
|
245
|
-
a =
|
|
244
|
+
} catch (P) {
|
|
245
|
+
a = P;
|
|
246
246
|
}
|
|
247
247
|
e.call(u.prototype);
|
|
248
248
|
}
|
|
249
249
|
} else {
|
|
250
250
|
try {
|
|
251
251
|
throw Error();
|
|
252
|
-
} catch (
|
|
253
|
-
a =
|
|
252
|
+
} catch (P) {
|
|
253
|
+
a = P;
|
|
254
254
|
}
|
|
255
255
|
e();
|
|
256
256
|
}
|
|
257
|
-
} catch (
|
|
258
|
-
if (
|
|
259
|
-
for (var s =
|
|
257
|
+
} catch (P) {
|
|
258
|
+
if (P && a && typeof P.stack == "string") {
|
|
259
|
+
for (var s = P.stack.split(`
|
|
260
260
|
`), O = a.stack.split(`
|
|
261
261
|
`), m = s.length - 1, R = O.length - 1; m >= 1 && R >= 0 && s[m] !== O[R]; )
|
|
262
262
|
R--;
|
|
@@ -303,7 +303,7 @@ function Cr() {
|
|
|
303
303
|
switch (e.$$typeof) {
|
|
304
304
|
case E:
|
|
305
305
|
return Qe(e.render);
|
|
306
|
-
case
|
|
306
|
+
case x:
|
|
307
307
|
return ae(e.type, r, t);
|
|
308
308
|
case j: {
|
|
309
309
|
var a = e, v = a._payload, p = a._init;
|
|
@@ -547,7 +547,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
547
547
|
t = r.propTypes;
|
|
548
548
|
else if (typeof r == "object" && (r.$$typeof === E || // Note: Memo only checks outer props here.
|
|
549
549
|
// Inner props are checked in the reconciler.
|
|
550
|
-
r.$$typeof ===
|
|
550
|
+
r.$$typeof === x))
|
|
551
551
|
t = r.propTypes;
|
|
552
552
|
else
|
|
553
553
|
return;
|
|
@@ -603,11 +603,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
603
603
|
Ye(k, e);
|
|
604
604
|
}
|
|
605
605
|
if (Z.call(r, "key")) {
|
|
606
|
-
var L = I(e),
|
|
606
|
+
var L = I(e), P = Object.keys(r).filter(function(_r) {
|
|
607
607
|
return _r !== "key";
|
|
608
|
-
}), ye =
|
|
608
|
+
}), ye = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
609
609
|
if (!Ve[L + ye]) {
|
|
610
|
-
var Rr =
|
|
610
|
+
var Rr = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
|
|
611
611
|
d(`A props object containing a "key" prop is being spread into JSX:
|
|
612
612
|
let props = %s;
|
|
613
613
|
<%s {...props} />
|
|
@@ -638,14 +638,14 @@ function Or(n, o = 0) {
|
|
|
638
638
|
return (T[n[o + 0]] + T[n[o + 1]] + T[n[o + 2]] + T[n[o + 3]] + "-" + T[n[o + 4]] + T[n[o + 5]] + "-" + T[n[o + 6]] + T[n[o + 7]] + "-" + T[n[o + 8]] + T[n[o + 9]] + "-" + T[n[o + 10]] + T[n[o + 11]] + T[n[o + 12]] + T[n[o + 13]] + T[n[o + 14]] + T[n[o + 15]]).toLowerCase();
|
|
639
639
|
}
|
|
640
640
|
let he;
|
|
641
|
-
const
|
|
642
|
-
function
|
|
641
|
+
const xr = new Uint8Array(16);
|
|
642
|
+
function Pr() {
|
|
643
643
|
if (!he) {
|
|
644
644
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
645
645
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
646
646
|
he = crypto.getRandomValues.bind(crypto);
|
|
647
647
|
}
|
|
648
|
-
return he(
|
|
648
|
+
return he(xr);
|
|
649
649
|
}
|
|
650
650
|
const jr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ze = { randomUUID: jr };
|
|
651
651
|
function kr(n, o, S) {
|
|
@@ -653,7 +653,7 @@ function kr(n, o, S) {
|
|
|
653
653
|
if (Ze.randomUUID && !o && !n)
|
|
654
654
|
return Ze.randomUUID();
|
|
655
655
|
n = n || {};
|
|
656
|
-
const c = n.random ?? ((y = n.rng) == null ? void 0 : y.call(n)) ??
|
|
656
|
+
const c = n.random ?? ((y = n.rng) == null ? void 0 : y.call(n)) ?? Pr();
|
|
657
657
|
if (c.length < 16)
|
|
658
658
|
throw new Error("Random bytes length must be >= 16");
|
|
659
659
|
return c[6] = c[6] & 15 | 64, c[8] = c[8] & 63 | 128, Or(c);
|
|
@@ -716,7 +716,7 @@ const Re = wr(null), Fr = ({ children: n }) => {
|
|
|
716
716
|
y.current[_] = D, w(i, "request", { callbackId: _, requestType: g, data: l });
|
|
717
717
|
}),
|
|
718
718
|
[w]
|
|
719
|
-
),
|
|
719
|
+
), x = Y(
|
|
720
720
|
(i, g) => {
|
|
721
721
|
w(i, "load-options", g);
|
|
722
722
|
},
|
|
@@ -732,7 +732,7 @@ const Re = wr(null), Fr = ({ children: n }) => {
|
|
|
732
732
|
unregisterFrame: E,
|
|
733
733
|
sendMessage: w,
|
|
734
734
|
sendRequest: b,
|
|
735
|
-
loadOptions:
|
|
735
|
+
loadOptions: x,
|
|
736
736
|
validate: j,
|
|
737
737
|
hasHandler: F,
|
|
738
738
|
addListener: (i, g, l) => (c.current[i] || (c.current[i] = {}), c.current[i][g] || (c.current[i][g] = []), c.current[i][g].push(l), () => {
|
|
@@ -744,7 +744,7 @@ const Re = wr(null), Fr = ({ children: n }) => {
|
|
|
744
744
|
E,
|
|
745
745
|
w,
|
|
746
746
|
b,
|
|
747
|
-
|
|
747
|
+
x,
|
|
748
748
|
j,
|
|
749
749
|
F
|
|
750
750
|
]
|
|
@@ -810,7 +810,7 @@ const Ar = Be.default || Be, $r = Ar.iframe`
|
|
|
810
810
|
return console.error(
|
|
811
811
|
"isFullScreen must be passed via the params prop to MMEmbeddableZone"
|
|
812
812
|
), null;
|
|
813
|
-
const C = Q(), [E, w] = z(), [b,
|
|
813
|
+
const C = Q(), [E, w] = z(), [b, x] = z(0), { registerFrame: j, unregisterFrame: M, sendMessage: i } = Ge(
|
|
814
814
|
Re
|
|
815
815
|
), [g, l] = z(!0), [f, d] = z();
|
|
816
816
|
return A(() => {
|
|
@@ -842,12 +842,13 @@ const Ar = Be.default || Be, $r = Ar.iframe`
|
|
|
842
842
|
})(), () => {
|
|
843
843
|
M(n);
|
|
844
844
|
};
|
|
845
|
-
}, [o, n, j, C]), Mr(n, "ready", () =>
|
|
845
|
+
}, [o, n, j, C]), Mr(n, "ready", () => x((_) => _ + 1)), g ? /* @__PURE__ */ se.jsx($r, { $isReady: b, ref: C, src: E, ...F }) : /* @__PURE__ */ se.jsx(
|
|
846
846
|
"div",
|
|
847
847
|
{
|
|
848
848
|
style: {
|
|
849
849
|
height: "100%",
|
|
850
850
|
display: "flex",
|
|
851
|
+
flex: 1,
|
|
851
852
|
alignItems: "center",
|
|
852
853
|
justifyContent: "center"
|
|
853
854
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(P,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","styled-components"],u):(P=typeof globalThis<"u"?globalThis:P||self,u(P["mm-react-embeddable"]={},P.React,P.PropTypes,P.styled))})(this,function(P,u,K,Ee){"use strict";var se={exports:{}},N={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Re;function Qe(){if(Re)return N;Re=1;var n=u,o=Symbol.for("react.element"),T=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,h=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function F(O,R,C){var m,
|
|
9
|
+
*/var Re;function Qe(){if(Re)return N;Re=1;var n=u,o=Symbol.for("react.element"),T=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,h=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function F(O,R,C){var m,j={},M=null,U=null;C!==void 0&&(M=""+C),R.key!==void 0&&(M=""+R.key),R.ref!==void 0&&(U=R.ref);for(m in R)l.call(R,m)&&!E.hasOwnProperty(m)&&(j[m]=R[m]);if(O&&O.defaultProps)for(m in R=O.defaultProps,R)j[m]===void 0&&(j[m]=R[m]);return{$$typeof:o,type:O,key:M,ref:U,props:j,_owner:h.current}}return N.Fragment=T,N.jsx=F,N.jsxs=F,N}var G={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var _e;function qe(){return _e||(_e=1,process.env.NODE_ENV!=="production"&&function(){var n=u,o=Symbol.for("react.element"),T=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),O=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),
|
|
17
|
+
*/var _e;function qe(){return _e||(_e=1,process.env.NODE_ENV!=="production"&&function(){var n=u,o=Symbol.for("react.element"),T=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),O=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),i=Symbol.iterator,g="@@iterator";function f(e){if(e===null||typeof e!="object")return null;var r=i&&e[i]||e[g];return typeof r=="function"?r:null}var d=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];w("error",e,t)}}function w(e,r,t){{var a=d.ReactDebugCurrentFrame,p=a.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var b=t.map(function(c){return String(c)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var A=!1,Z=!1,W=!1,re=!1,te=!1,L;L=Symbol.for("react.module.reference");function ce(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===E||te||e===h||e===C||e===m||re||e===U||A||Z||W||typeof e=="object"&&e!==null&&(e.$$typeof===M||e.$$typeof===j||e.$$typeof===F||e.$$typeof===O||e.$$typeof===R||e.$$typeof===L||e.getModuleId!==void 0))}function le(e,r,t){var a=e.displayName;if(a)return a;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function H(e){return e.displayName||"Context"}function D(e){if(e==null)return null;if(typeof e.tag=="number"&&v("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;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case T:return"Portal";case E:return"Profiler";case h:return"StrictMode";case C:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return H(r)+".Consumer";case F:var t=e;return H(t._context)+".Provider";case R:return le(e,e.render,"ForwardRef");case j:var a=e.displayName||null;return a!==null?a:D(e.type)||"Memo";case M:{var p=e,b=p._payload,c=p._init;try{return D(c(b))}catch{return null}}}return null}var Y=Object.assign,z=0,Pe,je,ke,Me,Ie,Fe,De;function Ae(){}Ae.__reactDisabledLog=!0;function ar(){{if(z===0){Pe=console.log,je=console.info,ke=console.warn,Me=console.error,Ie=console.group,Fe=console.groupCollapsed,De=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ae,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function or(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Y({},e,{value:Pe}),info:Y({},e,{value:je}),warn:Y({},e,{value:ke}),error:Y({},e,{value:Me}),group:Y({},e,{value:Ie}),groupCollapsed:Y({},e,{value:Fe}),groupEnd:Y({},e,{value:De})})}z<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=d.ReactCurrentDispatcher,de;function ne(e,r,t){{if(de===void 0)try{throw Error()}catch(p){var a=p.stack.trim().match(/\n( *(at )?)/);de=a&&a[1]||""}return`
|
|
18
18
|
`+de+e}}var ve=!1,ae;{var ir=typeof WeakMap=="function"?WeakMap:Map;ae=new ir}function Ue(e,r){if(!e||ve)return"";{var t=ae.get(e);if(t!==void 0)return t}var a;ve=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=fe.current,fe.current=null,ar();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(k){a=k}Reflect.construct(e,[],c)}else{try{c.call()}catch(k){a=k}e.call(c.prototype)}}else{try{throw Error()}catch(k){a=k}e()}}catch(k){if(k&&a&&typeof k.stack=="string"){for(var s=k.stack.split(`
|
|
19
|
-
`),
|
|
20
|
-
`),y=s.length-1,_=
|
|
21
|
-
`+s[y].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&ae.set(e,I),I}while(y>=1&&_>=0);break}}}finally{ve=!1,fe.current=b,or(),Error.prepareStackTrace=p}var J=e?e.displayName||e.name:"",V=J?ne(J):"";return typeof e=="function"&&ae.set(e,V),V}function sr(e,r,t){return Ue(e,!1)}function ur(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function oe(e,r,t){if(e==null)return"";if(typeof e=="function")return Ue(e,ur(e));if(typeof e=="string")return ne(e);switch(e){case C:return ne("Suspense");case m:return ne("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case R:return sr(e.render);case
|
|
19
|
+
`),x=a.stack.split(`
|
|
20
|
+
`),y=s.length-1,_=x.length-1;y>=1&&_>=0&&s[y]!==x[_];)_--;for(;y>=1&&_>=0;y--,_--)if(s[y]!==x[_]){if(y!==1||_!==1)do if(y--,_--,_<0||s[y]!==x[_]){var I=`
|
|
21
|
+
`+s[y].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&ae.set(e,I),I}while(y>=1&&_>=0);break}}}finally{ve=!1,fe.current=b,or(),Error.prepareStackTrace=p}var J=e?e.displayName||e.name:"",V=J?ne(J):"";return typeof e=="function"&&ae.set(e,V),V}function sr(e,r,t){return Ue(e,!1)}function ur(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function oe(e,r,t){if(e==null)return"";if(typeof e=="function")return Ue(e,ur(e));if(typeof e=="string")return ne(e);switch(e){case C:return ne("Suspense");case m:return ne("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case R:return sr(e.render);case j:return oe(e.type,r,t);case M:{var a=e,p=a._payload,b=a._init;try{return oe(b(p),r,t)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,We={},Le=d.ReactDebugCurrentFrame;function ie(e){if(e){var r=e._owner,t=oe(e.type,e._source,r?r.type:null);Le.setExtraStackFrame(t)}else Le.setExtraStackFrame(null)}function cr(e,r,t,a,p){{var b=Function.call.bind(X);for(var c in e)if(b(e,c)){var s=void 0;try{if(typeof e[c]!="function"){var x=Error((a||"React class")+": "+t+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}s=e[c](r,c,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){s=y}s&&!(s instanceof Error)&&(ie(p),v("%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).",a||"React class",t,c,typeof s),ie(null)),s instanceof Error&&!(s.message in We)&&(We[s.message]=!0,ie(p),v("Failed %s type: %s",t,s.message),ie(null))}}}var lr=Array.isArray;function pe(e){return lr(e)}function fr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function dr(e){try{return Ye(e),!1}catch{return!0}}function Ye(e){return""+e}function Ve(e){if(dr(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fr(e)),Ye(e)}var Q=d.ReactCurrentOwner,vr={key:!0,ref:!0,__self:!0,__source:!0},Ze,Be,be;be={};function pr(e){if(X.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function br(e){if(X.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function gr(e,r){if(typeof e.ref=="string"&&Q.current&&r&&Q.current.stateNode!==r){var t=D(Q.current.type);be[t]||(v('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(Q.current.type),e.ref),be[t]=!0)}}function mr(e,r){{var t=function(){Ze||(Ze=!0,v("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function yr(e,r){{var t=function(){Be||(Be=!0,v("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var hr=function(e,r,t,a,p,b,c){var s={$$typeof:o,type:e,key:r,ref:t,props:c,_owner:b};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function Er(e,r,t,a,p){{var b,c={},s=null,x=null;t!==void 0&&(Ve(t),s=""+t),br(r)&&(Ve(r.key),s=""+r.key),pr(r)&&(x=r.ref,gr(r,p));for(b in r)X.call(r,b)&&!vr.hasOwnProperty(b)&&(c[b]=r[b]);if(e&&e.defaultProps){var y=e.defaultProps;for(b in y)c[b]===void 0&&(c[b]=y[b])}if(s||x){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&mr(c,_),x&&yr(c,_)}return hr(e,s,x,p,a,Q.current,c)}}var ge=d.ReactCurrentOwner,Je=d.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=oe(e.type,e._source,r?r.type:null);Je.setExtraStackFrame(t)}else Je.setExtraStackFrame(null)}var me;me=!1;function ye(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Ke(){{if(ge.current){var e=D(ge.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function Rr(e){return""}var Ne={};function _r(e){{var r=Ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=_r(r);if(Ne[t])return;Ne[t]=!0;var a="";e&&e._owner&&e._owner!==ge.current&&(a=" It was passed a child from "+D(e._owner.type)+"."),B(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),B(null)}}function He(e,r){{if(typeof e!="object")return;if(pe(e))for(var t=0;t<e.length;t++){var a=e[t];ye(a)&&Ge(a,r)}else if(ye(e))e._store&&(e._store.validated=!0);else if(e){var p=f(e);if(typeof p=="function"&&p!==e.entries)for(var b=p.call(e),c;!(c=b.next()).done;)ye(c.value)&&Ge(c.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===R||r.$$typeof===
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=_r(r);if(Ne[t])return;Ne[t]=!0;var a="";e&&e._owner&&e._owner!==ge.current&&(a=" It was passed a child from "+D(e._owner.type)+"."),B(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),B(null)}}function He(e,r){{if(typeof e!="object")return;if(pe(e))for(var t=0;t<e.length;t++){var a=e[t];ye(a)&&Ge(a,r)}else if(ye(e))e._store&&(e._store.validated=!0);else if(e){var p=f(e);if(typeof p=="function"&&p!==e.entries)for(var b=p.call(e),c;!(c=b.next()).done;)ye(c.value)&&Ge(c.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===R||r.$$typeof===j))t=r.propTypes;else return;if(t){var a=D(r);cr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!me){me=!0;var p=D(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){B(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),B(null);break}}e.ref!==null&&(B(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}var ze={};function Xe(e,r,t,a,p,b){{var c=ce(e);if(!c){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=Rr();x?s+=x:s+=Ke();var y;e===null?y="null":pe(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(D(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,s)}var _=Er(e,r,t,p,b);if(_==null)return _;if(c){var I=r.children;if(I!==void 0)if(a)if(pe(I)){for(var J=0;J<I.length;J++)He(I[J],e);Object.freeze&&Object.freeze(I)}else v("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 He(I,e)}if(X.call(r,"key")){var V=D(e),k=Object.keys(r).filter(function(jr){return jr!=="key"}),he=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!ze[V+he]){var Pr=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,he,V,
|
|
30
|
+
<%s key={someKey} {...props} />`,he,V,Pr,V),ze[V+he]=!0}}return e===l?Sr(_):wr(_),_}}function Cr(e,r,t){return Xe(e,r,t,!0)}function Tr(e,r,t){return Xe(e,r,t,!1)}var Or=Tr,xr=Cr;G.Fragment=l,G.jsx=Or,G.jsxs=xr}()),G}process.env.NODE_ENV==="production"?se.exports=Qe():se.exports=qe();var q=se.exports;const S=[];for(let n=0;n<256;++n)S.push((n+256).toString(16).slice(1));function $e(n,o=0){return(S[n[o+0]]+S[n[o+1]]+S[n[o+2]]+S[n[o+3]]+"-"+S[n[o+4]]+S[n[o+5]]+"-"+S[n[o+6]]+S[n[o+7]]+"-"+S[n[o+8]]+S[n[o+9]]+"-"+S[n[o+10]]+S[n[o+11]]+S[n[o+12]]+S[n[o+13]]+S[n[o+14]]+S[n[o+15]]).toLowerCase()}let ue;const er=new Uint8Array(16);function rr(){if(!ue){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ue=crypto.getRandomValues.bind(crypto)}return ue(er)}const we={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function tr(n,o,T){var h;if(we.randomUUID&&!o&&!n)return we.randomUUID();n=n||{};const l=n.random??((h=n.rng)==null?void 0:h.call(n))??rr();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,$e(l)}const $=u.createContext(null),Se=({children:n})=>{const[o,T]=u.useState({}),l=u.useRef({}),h=u.useRef({}),E=u.useRef({}),F=u.useCallback((i,g)=>{var f;return!!((f=E.current[i])!=null&&f.has(g))},[]),O=u.useCallback((i,g,f)=>{T(d=>({...d,[i]:{origin:g,frameRef:f}}))},[]),R=u.useCallback(i=>{T(g=>{const f={...g};return delete f[i],f}),delete E.current[i]},[]);u.useEffect(()=>{const i=(f=[],d)=>{f.forEach(v=>v(d))},g=f=>{var A,Z,W,re,te;if(!((A=f==null?void 0:f.data)!=null&&A.instanceId))return;const{instanceId:d,type:v}=f.data,w=l.current;if(v==="response"){const{callbackId:L,response:ce,error:le}=f.data,H=h.current[L];H&&(H(ce,le),delete h.current[L]);return}if(v==="mark-registered"){const{requestType:L}=f.data;E.current[d]||(E.current[d]=new Set),E.current[d].add(L);return}i((Z=w[d])==null?void 0:Z[v],f.data),i((W=w["*"])==null?void 0:W[v],f.data),i((re=w[d])==null?void 0:re["*"],f.data),i((te=w["*"])==null?void 0:te["*"],f.data)};return window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}},[o]);const C=u.useCallback((i,g,f)=>{var v,w;const d=o[i];if(!d){console.warn(`Origin not set for id: ${i}. Unable to send message.`);return}(w=(v=d==null?void 0:d.frameRef)==null?void 0:v.current)!=null&&w.contentWindow&&d.frameRef.current.contentWindow.postMessage({type:g,...f,instanceId:i},d.origin)},[o]),m=u.useCallback(async(i,g,f={})=>new Promise((d,v)=>{const w=tr(),A=(Z,W)=>{delete h.current[w],W?v(W):d(Z)};h.current[w]=A,C(i,"request",{callbackId:w,requestType:g,data:f})}),[C]),j=u.useCallback((i,g)=>{C(i,"load-options",g)},[C]),M=u.useCallback((i,g)=>{C(i,"validate",g)},[C]),U=u.useMemo(()=>({registerFrame:O,unregisterFrame:R,sendMessage:C,sendRequest:m,loadOptions:j,validate:M,hasHandler:F,addListener:(i,g,f)=>(l.current[i]||(l.current[i]={}),l.current[i][g]||(l.current[i][g]=[]),l.current[i][g].push(f),()=>{l.current[i][g]=l.current[i][g].filter(d=>d!==f)})}),[O,R,C,m,j,M,F]);return q.jsx($.Provider,{value:U,children:n})},ee={},Ce=async n=>{try{const o=new URL(n).origin;if(ee[o]!==void 0)return ee[o];const l=await(await fetch(`${o}/mm-app-manifest.json`)).json();if(!l.version)throw new Error("Invalid manifest");return ee[o]=l,l}catch{}return ee[origin]=!1,!1},Te=async n=>!!await Ce(n),Oe=(n,o,T)=>{const l=u.useContext($);if(l===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const h=u.useRef(T);u.useEffect(()=>{h.current=T},[T]),u.useEffect(()=>{if(!(!n||!o))return l.addListener(n,o,(...E)=>h.current(...E))},[l,n,o])};Se.propTypes={children:K.node.isRequired};const nr=(Ee.default||Ee).iframe`
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
33
33
|
border: none;
|
|
34
34
|
visibility: ${n=>n.$isReady?"visible":"hidden"};
|
|
35
|
-
`,
|
|
35
|
+
`,xe=({id:n,src:o,path:T,onInit:l=()=>{},context:h={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in h)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in h)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const O=u.useRef(),[R,C]=u.useState(),[m,j]=u.useState(0),{registerFrame:M,unregisterFrame:U,sendMessage:i}=u.useContext($),[g,f]=u.useState(!0),[d,v]=u.useState();return u.useEffect(()=>{m&&i(n,"set-context",{context:{...h,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[h,E.colorMode,E.isFullScreen,n,m]),u.useEffect(()=>{m&&(i(n,"set-params",{params:E}),i(n,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,n,m]),u.useEffect(()=>{T!==void 0&&v(T)},[T]),u.useEffect(()=>{d===void 0||!m||i(n,"navigate",{path:d})},[d,m,n,i]),u.useEffect(()=>{if(!(!o||!n||!O))return(async()=>{const w=await Te(o);if(f(w),w){const A=new URL(o);M(n,A.origin,O),l(),C(`${A.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{U(n)}},[o,n,M,O]),Oe(n,"ready",()=>j(w=>w+1)),g?q.jsx(nr,{$isReady:m,ref:O,src:R,...F}):q.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:q.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};xe.propTypes={id:K.string,src:K.string.isRequired,path:K.string,onInit:K.func},P.MMEmbeddableZone=xe,P.MMEmbeddableZoneContext=$,P.MMEmbeddableZoneProvider=Se,P.getAppInfo=Ce,P.testIsEmbeddable=Te,P.useEmbeddedEffect=Oe,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|