@machinemetrics/mm-react-embeddable 1.0.10 → 1.0.11-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),G=require("prop-types"),Le=require("styled-components");var ge={exports:{}},K={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ye;function hr(){if(Ye)return K;Ye=1;var d=c,g=Symbol.for("react.element"),T=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,w=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function M(S,h,C){var m,P={},x=null,A=null;C!==void 0&&(x=""+C),h.key!==void 0&&(x=""+h.key),h.ref!==void 0&&(A=h.ref);for(m in h)b.call(h,m)&&!y.hasOwnProperty(m)&&(P[m]=h[m]);if(S&&S.defaultProps)for(m in h=S.defaultProps,h)P[m]===void 0&&(P[m]=h[m]);return{$$typeof:g,type:S,key:x,ref:A,props:P,_owner:w.current}}return K.Fragment=T,K.jsx=M,K.jsxs=M,K}var N={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ue;function Rr(){return Ue||(Ue=1,process.env.NODE_ENV!=="production"&&function(){var d=c,g=Symbol.for("react.element"),T=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),S=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),a=Symbol.iterator,p="@@iterator";function s(e){if(e===null||typeof e!="object")return null;var r=a&&e[a]||e[p];return typeof r=="function"?r:null}var u=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function l(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];_("error",e,t)}}function _(e,r,t){{var n=u.ReactDebugCurrentFrame,f=n.getStackAddendum();f!==""&&(r+="%s",t=t.concat([f]));var v=t.map(function(i){return String(i)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var I=!1,Y=!1,D=!1,z=!1,H=!1,$;$=Symbol.for("react.module.reference");function oe(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===y||H||e===w||e===C||e===m||z||e===A||I||Y||D||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===P||e.$$typeof===M||e.$$typeof===S||e.$$typeof===h||e.$$typeof===$||e.getModuleId!==void 0))}function ie(e,r,t){var n=e.displayName;if(n)return n;var f=r.displayName||r.name||"";return f!==""?t+"("+f+")":t}function q(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&l("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 b:return"Fragment";case T:return"Portal";case y:return"Profiler";case w:return"StrictMode";case C:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case S:var r=e;return q(r)+".Consumer";case M:var t=e;return q(t._context)+".Provider";case h:return ie(e,e.render,"ForwardRef");case P:var n=e.displayName||null;return n!==null?n:F(e.type)||"Memo";case x:{var f=e,v=f._payload,i=f._init;try{return F(i(v))}catch{return null}}}return null}var W=Object.assign,Z=0,me,Ee,ye,he,Re,_e,we;function Ce(){}Ce.__reactDisabledLog=!0;function Ke(){{if(Z===0){me=console.log,Ee=console.info,ye=console.warn,he=console.error,Re=console.group,_e=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Z++}}function Ne(){{if(Z--,Z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:me}),info:W({},e,{value:Ee}),warn:W({},e,{value:ye}),error:W({},e,{value:he}),group:W({},e,{value:Re}),groupCollapsed:W({},e,{value:_e}),groupEnd:W({},e,{value:we})})}Z<0&&l("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var se=u.ReactCurrentDispatcher,ue;function X(e,r,t){{if(ue===void 0)try{throw Error()}catch(f){var n=f.stack.trim().match(/\n( *(at )?)/);ue=n&&n[1]||""}return`
18
- `+ue+e}}var ce=!1,Q;{var Ge=typeof WeakMap=="function"?WeakMap:Map;Q=new Ge}function Te(e,r){if(!e||ce)return"";{var t=Q.get(e);if(t!==void 0)return t}var n;ce=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=se.current,se.current=null,Ke();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(j){n=j}Reflect.construct(e,[],i)}else{try{i.call()}catch(j){n=j}e.call(i.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var o=j.stack.split(`
19
- `),O=n.stack.split(`
20
- `),E=o.length-1,R=O.length-1;E>=1&&R>=0&&o[E]!==O[R];)R--;for(;E>=1&&R>=0;E--,R--)if(o[E]!==O[R]){if(E!==1||R!==1)do if(E--,R--,R<0||o[E]!==O[R]){var k=`
21
- `+o[E].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&Q.set(e,k),k}while(E>=1&&R>=0);break}}}finally{ce=!1,se.current=v,Ne(),Error.prepareStackTrace=f}var V=e?e.displayName||e.name:"",L=V?X(V):"";return typeof e=="function"&&Q.set(e,L),L}function ze(e,r,t){return Te(e,!1)}function He(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ee(e,r,t){if(e==null)return"";if(typeof e=="function")return Te(e,He(e));if(typeof e=="string")return X(e);switch(e){case C:return X("Suspense");case m:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return ze(e.render);case P:return ee(e.type,r,t);case x:{var n=e,f=n._payload,v=n._init;try{return ee(v(f),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,Se={},Oe=u.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,t=ee(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}function Xe(e,r,t,n,f){{var v=Function.call.bind(B);for(var i in e)if(v(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var O=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}o=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){o=E}o&&!(o instanceof Error)&&(re(f),l("%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,i,typeof o),re(null)),o instanceof Error&&!(o.message in Se)&&(Se[o.message]=!0,re(f),l("Failed %s type: %s",t,o.message),re(null))}}}var Qe=Array.isArray;function le(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return Pe(e),!1}catch{return!0}}function Pe(e){return""+e}function je(e){if(rr(e))return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),Pe(e)}var J=u.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},xe,ke,fe;fe={};function nr(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&J.current&&r&&J.current.stateNode!==r){var t=F(J.current.type);fe[t]||(l('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',F(J.current.type),e.ref),fe[t]=!0)}}function ir(e,r){{var t=function(){xe||(xe=!0,l("%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 sr(e,r){{var t=function(){ke||(ke=!0,l("%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 ur=function(e,r,t,n,f,v,i){var o={$$typeof:g,type:e,key:r,ref:t,props:i,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function cr(e,r,t,n,f){{var v,i={},o=null,O=null;t!==void 0&&(je(t),o=""+t),ar(r)&&(je(r.key),o=""+r.key),nr(r)&&(O=r.ref,or(r,f));for(v in r)B.call(r,v)&&!tr.hasOwnProperty(v)&&(i[v]=r[v]);if(e&&e.defaultProps){var E=e.defaultProps;for(v in E)i[v]===void 0&&(i[v]=E[v])}if(o||O){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&ir(i,R),O&&sr(i,R)}return ur(e,o,O,f,n,J.current,i)}}var de=u.ReactCurrentOwner,Me=u.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=ee(e.type,e._source,r?r.type:null);Me.setExtraStackFrame(t)}else Me.setExtraStackFrame(null)}var ve;ve=!1;function pe(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function Fe(){{if(de.current){var e=F(de.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function lr(e){return""}var Ie={};function fr(e){{var r=Fe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
-
25
- Check the top-level render call using <`+t+">.")}return r}}function Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Ie[t])return;Ie[t]=!0;var n="";e&&e._owner&&e._owner!==de.current&&(n=" It was passed a child from "+F(e._owner.type)+"."),U(e),l('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),U(null)}}function De(e,r){{if(typeof e!="object")return;if(le(e))for(var t=0;t<e.length;t++){var n=e[t];pe(n)&&Ae(n,r)}else if(pe(e))e._store&&(e._store.validated=!0);else if(e){var f=s(e);if(typeof f=="function"&&f!==e.entries)for(var v=f.call(e),i;!(i=v.next()).done;)pe(i.value)&&Ae(i.value,r)}}}function dr(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===h||r.$$typeof===P))t=r.propTypes;else return;if(t){var n=F(r);Xe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ve){ve=!0;var f=F(r);l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){U(e),l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),U(null);break}}e.ref!==null&&(U(e),l("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}var $e={};function We(e,r,t,n,f,v){{var i=oe(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 O=lr();O?o+=O:o+=Fe();var E;e===null?E="null":le(e)?E="array":e!==void 0&&e.$$typeof===g?(E="<"+(F(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,o)}var R=cr(e,r,t,f,v);if(R==null)return R;if(i){var k=r.children;if(k!==void 0)if(n)if(le(k)){for(var V=0;V<k.length;V++)De(k[V],e);Object.freeze&&Object.freeze(k)}else l("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 De(k,e)}if(B.call(r,"key")){var L=F(e),j=Object.keys(r).filter(function(yr){return yr!=="key"}),be=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[L+be]){var Er=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";l(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,be,L,Er,L),$e[L+be]=!0}}return e===b?vr(R):dr(R),R}}function pr(e,r,t){return We(e,r,t,!0)}function br(e,r,t){return We(e,r,t,!1)}var gr=br,mr=pr;N.Fragment=b,N.jsx=gr,N.jsxs=mr}()),N}process.env.NODE_ENV==="production"?ge.exports=hr():ge.exports=Rr();var ne=ge.exports;const ae=c.createContext(null),Ve=({children:d})=>{const[g,T]=c.useState({}),b=c.useRef({}),w=c.useRef({}),y=c.useRef({}),M=c.useCallback((a,p)=>{var s;return!!((s=y.current[a])!=null&&s.has(p))},[]),S=c.useCallback((a,p,s)=>{T(u=>({...u,[a]:{origin:p,frameRef:s}}))},[]),h=c.useCallback(a=>{T(p=>{const s={...p};return delete s[a],s}),delete y.current[a]},[]);c.useEffect(()=>{const a=(s=[],u)=>{s.forEach(l=>l(u))},p=s=>{var I,Y,D,z,H;if(!((I=s==null?void 0:s.data)!=null&&I.instanceId))return;const{instanceId:u,type:l}=s.data,_=b.current;if(l==="response"){const{callbackId:$,response:oe,error:ie}=s.data,q=w.current[$];q&&(q(oe,ie),delete w.current[$]);return}if(l==="mark-registered"){const{requestType:$}=s.data;y.current[u]||(y.current[u]=new Set),y.current[u].add($);return}a((Y=_[u])==null?void 0:Y[l],s.data),a((D=_["*"])==null?void 0:D[l],s.data),a((z=_[u])==null?void 0:z["*"],s.data),a((H=_["*"])==null?void 0:H["*"],s.data)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p)}},[g]);const C=c.useCallback((a,p,s)=>{var l,_;const u=g[a];if(!u){console.warn(`Origin not set for id: ${a}. Unable to send message.`);return}(_=(l=u==null?void 0:u.frameRef)==null?void 0:l.current)!=null&&_.contentWindow&&u.frameRef.current.contentWindow.postMessage({type:p,...s,instanceId:a},u.origin)},[g]),m=c.useCallback(async(a,p,s={})=>new Promise((u,l)=>{const _=crypto.randomUUID(),I=(Y,D)=>{delete w.current[_],D?l(D):u(Y)};w.current[_]=I,C(a,"request",{callbackId:_,requestType:p,data:s})}),[C]),P=c.useCallback((a,p)=>{C(a,"load-options",p)},[C]),x=c.useCallback((a,p)=>{C(a,"validate",p)},[C]),A=c.useMemo(()=>({registerFrame:S,unregisterFrame:h,sendMessage:C,sendRequest:m,loadOptions:P,validate:x,hasHandler:M,addListener:(a,p,s)=>(b.current[a]||(b.current[a]={}),b.current[a][p]||(b.current[a][p]=[]),b.current[a][p].push(s),()=>{b.current[a][p]=b.current[a][p].filter(u=>u!==s)})}),[S,h,C,m,P,x,M]);return ne.jsx(ae.Provider,{value:A,children:d})},te={},qe=async d=>{try{const g=new URL(d).origin;if(te[g]!==void 0)return te[g];const b=await(await fetch(`${g}/mm-app-manifest.json`)).json();if(!b.version)throw new Error("Invalid manifest");return te[g]=b,b}catch{}return te[origin]=!1,!1},Ze=async d=>!!await qe(d),Be=(d,g,T)=>{const b=c.useContext(ae);if(b===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const w=c.useRef(T);c.useEffect(()=>{w.current=T},[T]),c.useEffect(()=>{if(!(!d||!g))return b.addListener(d,g,(...y)=>w.current(...y))},[b,d,g])};Ve.propTypes={children:G.node.isRequired};const _r=Le.default||Le,wr=_r.iframe`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react/jsx-runtime"),r=require("react"),w=require("prop-types"),v=require("styled-components"),F=r.createContext(null),L=({children:s})=>{const[i,l]=r.useState({}),a=r.useRef({}),d=r.useRef({}),c=r.useRef({}),E=r.useCallback((e,n)=>{var t;return!!((t=c.current[e])!=null&&t.has(n))},[]),p=r.useCallback((e,n,t)=>{l(o=>({...o,[e]:{origin:n,frameRef:t}}))},[]),y=r.useCallback(e=>{l(n=>{const t={...n};return delete t[e],t}),delete c.current[e]},[]);r.useEffect(()=>{const e=(t=[],o)=>{t.forEach(u=>u(o))},n=t=>{var C,I,h,$,j;if(!((C=t==null?void 0:t.data)!=null&&C.instanceId))return;const{instanceId:o,type:u}=t.data,f=a.current;if(u==="response"){const{callbackId:x,response:H,error:W}=t.data,P=d.current[x];P&&(P(H,W),delete d.current[x]);return}if(u==="mark-registered"){const{requestType:x}=t.data;c.current[o]||(c.current[o]=new Set),c.current[o].add(x);return}e((I=f[o])==null?void 0:I[u],t.data),e((h=f["*"])==null?void 0:h[u],t.data),e(($=f[o])==null?void 0:$["*"],t.data),e((j=f["*"])==null?void 0:j["*"],t.data)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[i]);const b=r.useCallback((e,n,t)=>{var u,f;const o=i[e];if(!o){console.warn(`Origin not set for id: ${e}. Unable to send message.`);return}(f=(u=o==null?void 0:o.frameRef)==null?void 0:u.current)!=null&&f.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:n,...t,instanceId:e},o.origin)},[i]);let g=0;const q=()=>`${Date.now()}-${++g}`,M=r.useCallback(async(e,n,t={})=>new Promise((o,u)=>{const f=q(),C=(I,h)=>{delete d.current[f],h?u(h):o(I)};d.current[f]=C,b(e,"request",{callbackId:f,requestType:n,data:t})}),[b]),R=r.useCallback((e,n)=>{b(e,"load-options",n)},[b]),m=r.useCallback((e,n)=>{b(e,"validate",n)},[b]),Z=r.useMemo(()=>({registerFrame:p,unregisterFrame:y,sendMessage:b,sendRequest:M,loadOptions:R,validate:m,hasHandler:E,addListener:(e,n,t)=>(a.current[e]||(a.current[e]={}),a.current[e][n]||(a.current[e][n]=[]),a.current[e][n].push(t),()=>{a.current[e][n]=a.current[e][n].filter(o=>o!==t)})}),[p,y,b,M,R,m,E]);return k.jsx(F.Provider,{value:Z,children:s})},S={},A=async s=>{try{const i=new URL(s).origin;if(S[i]!==void 0)return S[i];const a=await(await fetch(`${i}/mm-app-manifest.json`)).json();if(!a.version)throw new Error("Invalid manifest");return S[i]=a,a}catch{}return S[origin]=!1,!1},T=async s=>!!await A(s),U=(s,i,l)=>{const a=r.useContext(F);if(a===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const d=r.useRef(l);r.useEffect(()=>{d.current=l},[l]),r.useEffect(()=>{if(!(!s||!i))return a.addListener(s,i,(...c)=>d.current(...c))},[a,s,i])};L.propTypes={children:w.node.isRequired};const B=v.default||v,D=B.iframe`
31
2
  width: 100%;
32
3
  height: 100%;
33
4
  border: none;
34
- visibility: ${d=>d.$isReady?"visible":"hidden"};
35
- `,Je=({id:d,src:g,path:T,onInit:b=()=>{},context:w={},params:y={},...M})=>{if("isConfiguring"in M)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const S=c.useRef(),[h,C]=c.useState(),[m,P]=c.useState(0),{registerFrame:x,unregisterFrame:A,sendMessage:a}=c.useContext(ae),[p,s]=c.useState(!0),[u,l]=c.useState();return c.useEffect(()=>{m&&a(d,"set-context",{context:{...w,colorMode:y.colorMode,isFullScreen:y.isFullScreen}})},[w,y.colorMode,y.isFullScreen,d,m]),c.useEffect(()=>{m&&(a(d,"set-params",{params:y}),a(d,"set-configuring",{isConfiguring:y.isConfiguring}))},[y,d,m]),c.useEffect(()=>{T!==void 0&&l(T||"/")},[T]),c.useEffect(()=>{u===void 0||!m||a(d,"navigate",{path:u})},[u,m,d,a]),c.useEffect(()=>{if(!(!g||!d||!S))return(async()=>{const _=await Ze(g);if(s(_),_){const I=new URL(g);x(d,I.origin,S),b(),C(`${I.origin}/mm-embedded-interop?id=${d}&origin=${window.location.origin}`);return}})(),()=>{A(d)}},[g,d,x,S]),Be(d,"ready",()=>P(_=>_+1)),p?ne.jsx(wr,{$isReady:m,ref:S,src:h,...M}):ne.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:ne.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Je.propTypes={id:G.string,src:G.string.isRequired,path:G.string,onInit:G.func};exports.MMEmbeddableZone=Je;exports.MMEmbeddableZoneContext=ae;exports.MMEmbeddableZoneProvider=Ve;exports.getAppInfo=qe;exports.testIsEmbeddable=Ze;exports.useEmbeddedEffect=Be;
5
+ visibility: ${s=>s.$isReady?"visible":"hidden"};
6
+ `,O=({id:s,src:i,path:l,onInit:a=()=>{},context:d={},params:c={},...E})=>{if("isConfiguring"in E)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in d)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in d)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const p=r.useRef(),[y,b]=r.useState(),[g,q]=r.useState(0),{registerFrame:M,unregisterFrame:R,sendMessage:m}=r.useContext(F),[Z,e]=r.useState(!0),[n,t]=r.useState();return r.useEffect(()=>{g&&m(s,"set-context",{context:{...d,colorMode:c.colorMode,isFullScreen:c.isFullScreen}})},[d,c.colorMode,c.isFullScreen,s,g]),r.useEffect(()=>{g&&(m(s,"set-params",{params:c}),m(s,"set-configuring",{isConfiguring:c.isConfiguring}))},[c,s,g]),r.useEffect(()=>{l!==void 0&&t(l||"/")},[l]),r.useEffect(()=>{n===void 0||!g||m(s,"navigate",{path:n})},[n,g,s,m]),r.useEffect(()=>{if(!(!i||!s||!p))return(async()=>{const o=await T(i);if(e(o),o){const u=new URL(i);M(s,u.origin,p),a(),b(`${u.origin}/mm-embedded-interop?id=${s}&origin=${window.location.origin}`);return}})(),()=>{R(s)}},[i,s,M,p]),U(s,"ready",()=>q(o=>o+1)),Z?k.jsx(D,{$isReady:g,ref:p,src:y,...E}):k.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:k.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};O.propTypes={id:w.string,src:w.string.isRequired,path:w.string,onInit:w.func};exports.MMEmbeddableZone=O;exports.MMEmbeddableZoneContext=F;exports.MMEmbeddableZoneProvider=L;exports.getAppInfo=A;exports.testIsEmbeddable=T;exports.useEmbeddedEffect=U;
@@ -1,821 +1,194 @@
1
- import Je, { createContext as Er, useState as z, useRef as X, useCallback as Y, useEffect as A, useMemo as Rr, useContext as Ke } from "react";
2
- import H from "prop-types";
3
- import Ve from "styled-components";
4
- var ye = { exports: {} }, N = {};
5
- /**
6
- * @license React
7
- * react-jsx-runtime.production.min.js
8
- *
9
- * Copyright (c) Facebook, Inc. and its affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */
14
- var qe;
15
- function _r() {
16
- if (qe) return N;
17
- qe = 1;
18
- var f = Je, g = Symbol.for("react.element"), T = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, _ = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function k(S, h, w) {
20
- var b, O = {}, j = null, I = null;
21
- w !== void 0 && (j = "" + w), h.key !== void 0 && (j = "" + h.key), h.ref !== void 0 && (I = h.ref);
22
- for (b in h) p.call(h, b) && !y.hasOwnProperty(b) && (O[b] = h[b]);
23
- if (S && S.defaultProps) for (b in h = S.defaultProps, h) O[b] === void 0 && (O[b] = h[b]);
24
- return { $$typeof: g, type: S, key: j, ref: I, props: O, _owner: _.current };
25
- }
26
- return N.Fragment = T, N.jsx = k, N.jsxs = k, N;
27
- }
28
- var G = {};
29
- /**
30
- * @license React
31
- * react-jsx-runtime.development.js
32
- *
33
- * Copyright (c) Facebook, Inc. and its affiliates.
34
- *
35
- * This source code is licensed under the MIT license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- */
38
- var Be;
39
- function wr() {
40
- return Be || (Be = 1, process.env.NODE_ENV !== "production" && function() {
41
- var f = Je, g = Symbol.for("react.element"), T = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), S = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), a = Symbol.iterator, v = "@@iterator";
42
- function s(e) {
43
- if (e === null || typeof e != "object")
44
- return null;
45
- var r = a && e[a] || e[v];
46
- return typeof r == "function" ? r : null;
47
- }
48
- var u = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
- function c(e) {
50
- {
51
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
52
- t[n - 1] = arguments[n];
53
- R("error", e, t);
54
- }
55
- }
56
- function R(e, r, t) {
57
- {
58
- var n = u.ReactDebugCurrentFrame, l = n.getStackAddendum();
59
- l !== "" && (r += "%s", t = t.concat([l]));
60
- var d = t.map(function(i) {
61
- return String(i);
62
- });
63
- d.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, d);
64
- }
65
- }
66
- var M = !1, U = !1, D = !1, Q = !1, ee = !1, $;
67
- $ = Symbol.for("react.module.reference");
68
- function se(e) {
69
- return !!(typeof e == "string" || typeof e == "function" || e === p || e === y || ee || e === _ || e === w || e === b || Q || e === I || M || U || D || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === O || e.$$typeof === k || e.$$typeof === S || e.$$typeof === h || // This needs to include all possible module reference object
70
- // types supported by any Flight configuration anywhere since
71
- // we don't know which Flight build this will end up being used
72
- // with.
73
- e.$$typeof === $ || e.getModuleId !== void 0));
74
- }
75
- function ue(e, r, t) {
76
- var n = e.displayName;
77
- if (n)
78
- return n;
79
- var l = r.displayName || r.name || "";
80
- return l !== "" ? t + "(" + l + ")" : t;
81
- }
82
- function B(e) {
83
- return e.displayName || "Context";
84
- }
85
- function F(e) {
86
- if (e == null)
87
- return null;
88
- if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
89
- return e.displayName || e.name || null;
90
- if (typeof e == "string")
91
- return e;
92
- switch (e) {
93
- case p:
94
- return "Fragment";
95
- case T:
96
- return "Portal";
97
- case y:
98
- return "Profiler";
99
- case _:
100
- return "StrictMode";
101
- case w:
102
- return "Suspense";
103
- case b:
104
- return "SuspenseList";
105
- }
106
- if (typeof e == "object")
107
- switch (e.$$typeof) {
108
- case S:
109
- var r = e;
110
- return B(r) + ".Consumer";
111
- case k:
112
- var t = e;
113
- return B(t._context) + ".Provider";
114
- case h:
115
- return ue(e, e.render, "ForwardRef");
116
- case O:
117
- var n = e.displayName || null;
118
- return n !== null ? n : F(e.type) || "Memo";
119
- case j: {
120
- var l = e, d = l._payload, i = l._init;
121
- try {
122
- return F(i(d));
123
- } catch {
124
- return null;
125
- }
126
- }
127
- }
128
- return null;
129
- }
130
- var W = Object.assign, J = 0, Ee, Re, _e, we, Te, Se, Ce;
131
- function Oe() {
132
- }
133
- Oe.__reactDisabledLog = !0;
134
- function Ze() {
135
- {
136
- if (J === 0) {
137
- Ee = console.log, Re = console.info, _e = console.warn, we = console.error, Te = console.group, Se = console.groupCollapsed, Ce = console.groupEnd;
138
- var e = {
139
- configurable: !0,
140
- enumerable: !0,
141
- value: Oe,
142
- writable: !0
143
- };
144
- Object.defineProperties(console, {
145
- info: e,
146
- log: e,
147
- warn: e,
148
- error: e,
149
- group: e,
150
- groupCollapsed: e,
151
- groupEnd: e
152
- });
153
- }
154
- J++;
155
- }
156
- }
157
- function Ne() {
158
- {
159
- if (J--, J === 0) {
160
- var e = {
161
- configurable: !0,
162
- enumerable: !0,
163
- writable: !0
164
- };
165
- Object.defineProperties(console, {
166
- log: W({}, e, {
167
- value: Ee
168
- }),
169
- info: W({}, e, {
170
- value: Re
171
- }),
172
- warn: W({}, e, {
173
- value: _e
174
- }),
175
- error: W({}, e, {
176
- value: we
177
- }),
178
- group: W({}, e, {
179
- value: Te
180
- }),
181
- groupCollapsed: W({}, e, {
182
- value: Se
183
- }),
184
- groupEnd: W({}, e, {
185
- value: Ce
186
- })
187
- });
188
- }
189
- J < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
- }
191
- }
192
- var ce = u.ReactCurrentDispatcher, le;
193
- function re(e, r, t) {
194
- {
195
- if (le === void 0)
196
- try {
197
- throw Error();
198
- } catch (l) {
199
- var n = l.stack.trim().match(/\n( *(at )?)/);
200
- le = n && n[1] || "";
201
- }
202
- return `
203
- ` + le + e;
204
- }
205
- }
206
- var fe = !1, te;
207
- {
208
- var Ge = typeof WeakMap == "function" ? WeakMap : Map;
209
- te = new Ge();
210
- }
211
- function Pe(e, r) {
212
- if (!e || fe)
213
- return "";
214
- {
215
- var t = te.get(e);
216
- if (t !== void 0)
217
- return t;
218
- }
219
- var n;
220
- fe = !0;
221
- var l = Error.prepareStackTrace;
222
- Error.prepareStackTrace = void 0;
223
- var d;
224
- d = ce.current, ce.current = null, Ze();
225
- try {
226
- if (r) {
227
- var i = function() {
228
- throw Error();
229
- };
230
- if (Object.defineProperty(i.prototype, "props", {
231
- set: function() {
232
- throw Error();
233
- }
234
- }), typeof Reflect == "object" && Reflect.construct) {
235
- try {
236
- Reflect.construct(i, []);
237
- } catch (P) {
238
- n = P;
239
- }
240
- Reflect.construct(e, [], i);
241
- } else {
242
- try {
243
- i.call();
244
- } catch (P) {
245
- n = P;
246
- }
247
- e.call(i.prototype);
248
- }
249
- } else {
250
- try {
251
- throw Error();
252
- } catch (P) {
253
- n = P;
254
- }
255
- e();
256
- }
257
- } catch (P) {
258
- if (P && n && typeof P.stack == "string") {
259
- for (var o = P.stack.split(`
260
- `), C = n.stack.split(`
261
- `), m = o.length - 1, E = C.length - 1; m >= 1 && E >= 0 && o[m] !== C[E]; )
262
- E--;
263
- for (; m >= 1 && E >= 0; m--, E--)
264
- if (o[m] !== C[E]) {
265
- if (m !== 1 || E !== 1)
266
- do
267
- if (m--, E--, E < 0 || o[m] !== C[E]) {
268
- var x = `
269
- ` + o[m].replace(" at new ", " at ");
270
- return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, x), x;
271
- }
272
- while (m >= 1 && E >= 0);
273
- break;
274
- }
275
- }
276
- } finally {
277
- fe = !1, ce.current = d, Ne(), Error.prepareStackTrace = l;
278
- }
279
- var q = e ? e.displayName || e.name : "", L = q ? re(q) : "";
280
- return typeof e == "function" && te.set(e, L), L;
281
- }
282
- function ze(e, r, t) {
283
- return Pe(e, !1);
284
- }
285
- function He(e) {
286
- var r = e.prototype;
287
- return !!(r && r.isReactComponent);
288
- }
289
- function ne(e, r, t) {
290
- if (e == null)
291
- return "";
292
- if (typeof e == "function")
293
- return Pe(e, He(e));
294
- if (typeof e == "string")
295
- return re(e);
296
- switch (e) {
297
- case w:
298
- return re("Suspense");
299
- case b:
300
- return re("SuspenseList");
301
- }
302
- if (typeof e == "object")
303
- switch (e.$$typeof) {
304
- case h:
305
- return ze(e.render);
306
- case O:
307
- return ne(e.type, r, t);
308
- case j: {
309
- var n = e, l = n._payload, d = n._init;
310
- try {
311
- return ne(d(l), r, t);
312
- } catch {
313
- }
314
- }
315
- }
316
- return "";
317
- }
318
- var K = Object.prototype.hasOwnProperty, je = {}, xe = u.ReactDebugCurrentFrame;
319
- function ae(e) {
320
- if (e) {
321
- var r = e._owner, t = ne(e.type, e._source, r ? r.type : null);
322
- xe.setExtraStackFrame(t);
323
- } else
324
- xe.setExtraStackFrame(null);
325
- }
326
- function Xe(e, r, t, n, l) {
327
- {
328
- var d = Function.call.bind(K);
329
- for (var i in e)
330
- if (d(e, i)) {
331
- var o = void 0;
332
- try {
333
- if (typeof e[i] != "function") {
334
- var C = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
- throw C.name = "Invariant Violation", C;
336
- }
337
- o = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
- } catch (m) {
339
- o = m;
340
- }
341
- o && !(o instanceof Error) && (ae(l), c("%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, i, typeof o), ae(null)), o instanceof Error && !(o.message in je) && (je[o.message] = !0, ae(l), c("Failed %s type: %s", t, o.message), ae(null));
342
- }
343
- }
344
- }
345
- var Qe = Array.isArray;
346
- function de(e) {
347
- return Qe(e);
348
- }
349
- function er(e) {
350
- {
351
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
352
- return t;
353
- }
354
- }
355
- function rr(e) {
356
- try {
357
- return ke(e), !1;
358
- } catch {
359
- return !0;
360
- }
361
- }
362
- function ke(e) {
363
- return "" + e;
364
- }
365
- function Fe(e) {
366
- if (rr(e))
367
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), ke(e);
368
- }
369
- var Z = u.ReactCurrentOwner, tr = {
370
- key: !0,
371
- ref: !0,
372
- __self: !0,
373
- __source: !0
374
- }, Me, Ie, ve;
375
- ve = {};
376
- function nr(e) {
377
- if (K.call(e, "ref")) {
378
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
379
- if (r && r.isReactWarning)
380
- return !1;
381
- }
382
- return e.ref !== void 0;
383
- }
384
- function ar(e) {
385
- if (K.call(e, "key")) {
386
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
387
- if (r && r.isReactWarning)
388
- return !1;
389
- }
390
- return e.key !== void 0;
391
- }
392
- function or(e, r) {
393
- if (typeof e.ref == "string" && Z.current && r && Z.current.stateNode !== r) {
394
- var t = F(Z.current.type);
395
- ve[t] || (c('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', F(Z.current.type), e.ref), ve[t] = !0);
396
- }
397
- }
398
- function ir(e, r) {
399
- {
400
- var t = function() {
401
- Me || (Me = !0, c("%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));
402
- };
403
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
404
- get: t,
405
- configurable: !0
406
- });
407
- }
408
- }
409
- function sr(e, r) {
410
- {
411
- var t = function() {
412
- Ie || (Ie = !0, c("%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));
413
- };
414
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
415
- get: t,
416
- configurable: !0
417
- });
418
- }
419
- }
420
- var ur = function(e, r, t, n, l, d, i) {
421
- var o = {
422
- // This tag allows us to uniquely identify this as a React Element
423
- $$typeof: g,
424
- // Built-in properties that belong on the element
425
- type: e,
426
- key: r,
427
- ref: t,
428
- props: i,
429
- // Record the component responsible for creating this element.
430
- _owner: d
431
- };
432
- return o._store = {}, Object.defineProperty(o._store, "validated", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !0,
436
- value: !1
437
- }), Object.defineProperty(o, "_self", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: n
442
- }), Object.defineProperty(o, "_source", {
443
- configurable: !1,
444
- enumerable: !1,
445
- writable: !1,
446
- value: l
447
- }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
448
- };
449
- function cr(e, r, t, n, l) {
450
- {
451
- var d, i = {}, o = null, C = null;
452
- t !== void 0 && (Fe(t), o = "" + t), ar(r) && (Fe(r.key), o = "" + r.key), nr(r) && (C = r.ref, or(r, l));
453
- for (d in r)
454
- K.call(r, d) && !tr.hasOwnProperty(d) && (i[d] = r[d]);
455
- if (e && e.defaultProps) {
456
- var m = e.defaultProps;
457
- for (d in m)
458
- i[d] === void 0 && (i[d] = m[d]);
459
- }
460
- if (o || C) {
461
- var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
462
- o && ir(i, E), C && sr(i, E);
463
- }
464
- return ur(e, o, C, l, n, Z.current, i);
465
- }
466
- }
467
- var pe = u.ReactCurrentOwner, Ae = u.ReactDebugCurrentFrame;
468
- function V(e) {
469
- if (e) {
470
- var r = e._owner, t = ne(e.type, e._source, r ? r.type : null);
471
- Ae.setExtraStackFrame(t);
472
- } else
473
- Ae.setExtraStackFrame(null);
474
- }
475
- var ge;
476
- ge = !1;
477
- function be(e) {
478
- return typeof e == "object" && e !== null && e.$$typeof === g;
479
- }
480
- function De() {
481
- {
482
- if (pe.current) {
483
- var e = F(pe.current.type);
484
- if (e)
485
- return `
486
-
487
- Check the render method of \`` + e + "`.";
488
- }
489
- return "";
490
- }
491
- }
492
- function lr(e) {
493
- return "";
494
- }
495
- var $e = {};
496
- function fr(e) {
497
- {
498
- var r = De();
499
- if (!r) {
500
- var t = typeof e == "string" ? e : e.displayName || e.name;
501
- t && (r = `
502
-
503
- Check the top-level render call using <` + t + ">.");
504
- }
505
- return r;
506
- }
507
- }
508
- function We(e, r) {
509
- {
510
- if (!e._store || e._store.validated || e.key != null)
511
- return;
512
- e._store.validated = !0;
513
- var t = fr(r);
514
- if ($e[t])
515
- return;
516
- $e[t] = !0;
517
- var n = "";
518
- e && e._owner && e._owner !== pe.current && (n = " It was passed a child from " + F(e._owner.type) + "."), V(e), c('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), V(null);
519
- }
520
- }
521
- function Le(e, r) {
522
- {
523
- if (typeof e != "object")
524
- return;
525
- if (de(e))
526
- for (var t = 0; t < e.length; t++) {
527
- var n = e[t];
528
- be(n) && We(n, r);
529
- }
530
- else if (be(e))
531
- e._store && (e._store.validated = !0);
532
- else if (e) {
533
- var l = s(e);
534
- if (typeof l == "function" && l !== e.entries)
535
- for (var d = l.call(e), i; !(i = d.next()).done; )
536
- be(i.value) && We(i.value, r);
537
- }
538
- }
539
- }
540
- function dr(e) {
541
- {
542
- var r = e.type;
543
- if (r == null || typeof r == "string")
544
- return;
545
- var t;
546
- if (typeof r == "function")
547
- t = r.propTypes;
548
- else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
549
- // Inner props are checked in the reconciler.
550
- r.$$typeof === O))
551
- t = r.propTypes;
552
- else
553
- return;
554
- if (t) {
555
- var n = F(r);
556
- Xe(t, e.props, "prop", n, e);
557
- } else if (r.PropTypes !== void 0 && !ge) {
558
- ge = !0;
559
- var l = F(r);
560
- c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
561
- }
562
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
563
- }
564
- }
565
- function vr(e) {
566
- {
567
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
568
- var n = r[t];
569
- if (n !== "children" && n !== "key") {
570
- V(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), V(null);
571
- break;
572
- }
573
- }
574
- e.ref !== null && (V(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
575
- }
576
- }
577
- var Ye = {};
578
- function Ue(e, r, t, n, l, d) {
579
- {
580
- var i = se(e);
581
- if (!i) {
582
- var o = "";
583
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
584
- var C = lr();
585
- C ? o += C : o += De();
586
- var m;
587
- e === null ? m = "null" : de(e) ? m = "array" : e !== void 0 && e.$$typeof === g ? (m = "<" + (F(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, o);
588
- }
589
- var E = cr(e, r, t, l, d);
590
- if (E == null)
591
- return E;
592
- if (i) {
593
- var x = r.children;
594
- if (x !== void 0)
595
- if (n)
596
- if (de(x)) {
597
- for (var q = 0; q < x.length; q++)
598
- Le(x[q], e);
599
- Object.freeze && Object.freeze(x);
600
- } else
601
- c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
602
- else
603
- Le(x, e);
604
- }
605
- if (K.call(r, "key")) {
606
- var L = F(e), P = Object.keys(r).filter(function(hr) {
607
- return hr !== "key";
608
- }), me = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
609
- if (!Ye[L + me]) {
610
- var yr = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
611
- c(`A props object containing a "key" prop is being spread into JSX:
612
- let props = %s;
613
- <%s {...props} />
614
- React keys must be passed directly to JSX without using spread:
615
- let props = %s;
616
- <%s key={someKey} {...props} />`, me, L, yr, L), Ye[L + me] = !0;
617
- }
618
- }
619
- return e === p ? vr(E) : dr(E), E;
620
- }
621
- }
622
- function pr(e, r, t) {
623
- return Ue(e, r, t, !0);
624
- }
625
- function gr(e, r, t) {
626
- return Ue(e, r, t, !1);
627
- }
628
- var br = gr, mr = pr;
629
- G.Fragment = p, G.jsx = br, G.jsxs = mr;
630
- }()), G;
631
- }
632
- process.env.NODE_ENV === "production" ? ye.exports = _r() : ye.exports = wr();
633
- var ie = ye.exports;
634
- const he = Er(null), Tr = ({ children: f }) => {
635
- const [g, T] = z({}), p = X({}), _ = X({}), y = X({}), k = Y((a, v) => {
636
- var s;
637
- return !!((s = y.current[a]) != null && s.has(v));
638
- }, []), S = Y((a, v, s) => {
639
- T((u) => ({ ...u, [a]: { origin: v, frameRef: s } }));
640
- }, []), h = Y((a) => {
641
- T((v) => {
642
- const s = { ...v };
643
- return delete s[a], s;
644
- }), delete y.current[a];
1
+ import { jsx as S } from "react/jsx-runtime";
2
+ import { createContext as W, useState as E, useRef as I, useCallback as h, useEffect as b, useMemo as B, useContext as T } from "react";
3
+ import R from "prop-types";
4
+ import A from "styled-components";
5
+ const k = W(null), D = ({ children: t }) => {
6
+ const [o, u] = E({}), i = I({}), d = I({}), c = I({}), M = h((e, n) => {
7
+ var r;
8
+ return !!((r = c.current[e]) != null && r.has(n));
9
+ }, []), p = h((e, n, r) => {
10
+ u((s) => ({ ...s, [e]: { origin: n, frameRef: r } }));
11
+ }, []), F = h((e) => {
12
+ u((n) => {
13
+ const r = { ...n };
14
+ return delete r[e], r;
15
+ }), delete c.current[e];
645
16
  }, []);
646
- A(() => {
647
- const a = (s = [], u) => {
648
- s.forEach((c) => c(u));
649
- }, v = (s) => {
650
- var M, U, D, Q, ee;
651
- if (!((M = s == null ? void 0 : s.data) != null && M.instanceId))
17
+ b(() => {
18
+ const e = (r = [], s) => {
19
+ r.forEach((a) => a(s));
20
+ }, n = (r) => {
21
+ var $, x, y, v, U;
22
+ if (!(($ = r == null ? void 0 : r.data) != null && $.instanceId))
652
23
  return;
653
- const { instanceId: u, type: c } = s.data, R = p.current;
654
- if (c === "response") {
655
- const { callbackId: $, response: se, error: ue } = s.data, B = _.current[$];
656
- B && (B(se, ue), delete _.current[$]);
24
+ const { instanceId: s, type: a } = r.data, l = i.current;
25
+ if (a === "response") {
26
+ const { callbackId: L, response: O, error: H } = r.data, j = d.current[L];
27
+ j && (j(O, H), delete d.current[L]);
657
28
  return;
658
29
  }
659
- if (c === "mark-registered") {
660
- const { requestType: $ } = s.data;
661
- y.current[u] || (y.current[u] = /* @__PURE__ */ new Set()), y.current[u].add($);
30
+ if (a === "mark-registered") {
31
+ const { requestType: L } = r.data;
32
+ c.current[s] || (c.current[s] = /* @__PURE__ */ new Set()), c.current[s].add(L);
662
33
  return;
663
34
  }
664
- a((U = R[u]) == null ? void 0 : U[c], s.data), a((D = R["*"]) == null ? void 0 : D[c], s.data), a((Q = R[u]) == null ? void 0 : Q["*"], s.data), a((ee = R["*"]) == null ? void 0 : ee["*"], s.data);
35
+ e((x = l[s]) == null ? void 0 : x[a], r.data), e((y = l["*"]) == null ? void 0 : y[a], r.data), e((v = l[s]) == null ? void 0 : v["*"], r.data), e((U = l["*"]) == null ? void 0 : U["*"], r.data);
665
36
  };
666
- return window.addEventListener("message", v), () => {
667
- window.removeEventListener("message", v);
37
+ return window.addEventListener("message", n), () => {
38
+ window.removeEventListener("message", n);
668
39
  };
669
- }, [g]);
670
- const w = Y(
671
- (a, v, s) => {
672
- var c, R;
673
- const u = g[a];
674
- if (!u) {
675
- console.warn(`Origin not set for id: ${a}. Unable to send message.`);
40
+ }, [o]);
41
+ const f = h(
42
+ (e, n, r) => {
43
+ var a, l;
44
+ const s = o[e];
45
+ if (!s) {
46
+ console.warn(`Origin not set for id: ${e}. Unable to send message.`);
676
47
  return;
677
48
  }
678
- (R = (c = u == null ? void 0 : u.frameRef) == null ? void 0 : c.current) != null && R.contentWindow && u.frameRef.current.contentWindow.postMessage(
679
- { type: v, ...s, instanceId: a },
680
- u.origin
49
+ (l = (a = s == null ? void 0 : s.frameRef) == null ? void 0 : a.current) != null && l.contentWindow && s.frameRef.current.contentWindow.postMessage(
50
+ { type: n, ...r, instanceId: e },
51
+ s.origin
681
52
  );
682
53
  },
683
- [g]
684
- ), b = Y(
685
- async (a, v, s = {}) => new Promise((u, c) => {
686
- const R = crypto.randomUUID(), M = (U, D) => {
687
- delete _.current[R], D ? c(D) : u(U);
54
+ [o]
55
+ );
56
+ let g = 0;
57
+ const Z = () => `${Date.now()}-${++g}`, w = h(
58
+ async (e, n, r = {}) => new Promise((s, a) => {
59
+ const l = Z(), $ = (x, y) => {
60
+ delete d.current[l], y ? a(y) : s(x);
688
61
  };
689
- _.current[R] = M, w(a, "request", { callbackId: R, requestType: v, data: s });
62
+ d.current[l] = $, f(e, "request", { callbackId: l, requestType: n, data: r });
690
63
  }),
691
- [w]
692
- ), O = Y(
693
- (a, v) => {
694
- w(a, "load-options", v);
64
+ [f]
65
+ ), C = h(
66
+ (e, n) => {
67
+ f(e, "load-options", n);
695
68
  },
696
- [w]
697
- ), j = Y(
698
- (a, v) => {
699
- w(a, "validate", v);
69
+ [f]
70
+ ), m = h(
71
+ (e, n) => {
72
+ f(e, "validate", n);
700
73
  },
701
- [w]
702
- ), I = Rr(
74
+ [f]
75
+ ), q = B(
703
76
  () => ({
704
- registerFrame: S,
705
- unregisterFrame: h,
706
- sendMessage: w,
707
- sendRequest: b,
708
- loadOptions: O,
709
- validate: j,
710
- hasHandler: k,
711
- addListener: (a, v, s) => (p.current[a] || (p.current[a] = {}), p.current[a][v] || (p.current[a][v] = []), p.current[a][v].push(s), () => {
712
- p.current[a][v] = p.current[a][v].filter((u) => u !== s);
77
+ registerFrame: p,
78
+ unregisterFrame: F,
79
+ sendMessage: f,
80
+ sendRequest: w,
81
+ loadOptions: C,
82
+ validate: m,
83
+ hasHandler: M,
84
+ addListener: (e, n, r) => (i.current[e] || (i.current[e] = {}), i.current[e][n] || (i.current[e][n] = []), i.current[e][n].push(r), () => {
85
+ i.current[e][n] = i.current[e][n].filter((s) => s !== r);
713
86
  })
714
87
  }),
715
88
  [
716
- S,
717
- h,
89
+ p,
90
+ F,
91
+ f,
718
92
  w,
719
- b,
720
- O,
721
- j,
722
- k
93
+ C,
94
+ m,
95
+ M
723
96
  ]
724
97
  );
725
- return /* @__PURE__ */ ie.jsx(he.Provider, { value: I, children: f });
726
- }, oe = {}, Sr = async (f) => {
98
+ return /* @__PURE__ */ S(k.Provider, { value: q, children: t });
99
+ }, P = {}, _ = async (t) => {
727
100
  try {
728
- const g = new URL(f).origin;
729
- if (oe[g] !== void 0)
730
- return oe[g];
731
- const p = await (await fetch(`${g}/mm-app-manifest.json`)).json();
732
- if (!p.version)
101
+ const o = new URL(t).origin;
102
+ if (P[o] !== void 0)
103
+ return P[o];
104
+ const i = await (await fetch(`${o}/mm-app-manifest.json`)).json();
105
+ if (!i.version)
733
106
  throw new Error("Invalid manifest");
734
- return oe[g] = p, p;
107
+ return P[o] = i, i;
735
108
  } catch {
736
109
  }
737
- return oe[origin] = !1, !1;
738
- }, Cr = async (f) => !!await Sr(f), Or = (f, g, T) => {
739
- const p = Ke(he);
740
- if (p === null)
110
+ return P[origin] = !1, !1;
111
+ }, z = async (t) => !!await _(t), G = (t, o, u) => {
112
+ const i = T(k);
113
+ if (i === null)
741
114
  throw new Error(
742
115
  "useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
743
116
  );
744
- const _ = X(T);
745
- A(() => {
746
- _.current = T;
747
- }, [T]), A(() => {
748
- if (!(!f || !g))
749
- return p.addListener(
750
- f,
751
- g,
752
- (...y) => _.current(...y)
117
+ const d = I(u);
118
+ b(() => {
119
+ d.current = u;
120
+ }, [u]), b(() => {
121
+ if (!(!t || !o))
122
+ return i.addListener(
123
+ t,
124
+ o,
125
+ (...c) => d.current(...c)
753
126
  );
754
- }, [p, f, g]);
127
+ }, [i, t, o]);
755
128
  };
756
- Tr.propTypes = {
757
- children: H.node.isRequired
129
+ D.propTypes = {
130
+ children: R.node.isRequired
758
131
  };
759
- const Pr = Ve.default || Ve, jr = Pr.iframe`
132
+ const J = A.default || A, K = J.iframe`
760
133
  width: 100%;
761
134
  height: 100%;
762
135
  border: none;
763
- visibility: ${(f) => f.$isReady ? "visible" : "hidden"};
764
- `, xr = ({
765
- id: f,
766
- src: g,
767
- path: T,
768
- onInit: p = () => {
136
+ visibility: ${(t) => t.$isReady ? "visible" : "hidden"};
137
+ `, Q = ({
138
+ id: t,
139
+ src: o,
140
+ path: u,
141
+ onInit: i = () => {
769
142
  },
770
- context: _ = {},
771
- params: y = {},
772
- ...k
143
+ context: d = {},
144
+ params: c = {},
145
+ ...M
773
146
  }) => {
774
- if ("isConfiguring" in k)
147
+ if ("isConfiguring" in M)
775
148
  return console.error(
776
149
  "isConfiguring must be passed via the params prop to MMEmbeddableZone"
777
150
  ), null;
778
- if ("colorMode" in _)
151
+ if ("colorMode" in d)
779
152
  return console.error(
780
153
  "colorMode must be passed via the params prop to MMEmbeddableZone"
781
154
  ), null;
782
- if ("isFullScreen" in _)
155
+ if ("isFullScreen" in d)
783
156
  return console.error(
784
157
  "isFullScreen must be passed via the params prop to MMEmbeddableZone"
785
158
  ), null;
786
- const S = X(), [h, w] = z(), [b, O] = z(0), { registerFrame: j, unregisterFrame: I, sendMessage: a } = Ke(
787
- he
788
- ), [v, s] = z(!0), [u, c] = z();
789
- return A(() => {
790
- b && a(f, "set-context", {
159
+ const p = I(), [F, f] = E(), [g, Z] = E(0), { registerFrame: w, unregisterFrame: C, sendMessage: m } = T(
160
+ k
161
+ ), [q, e] = E(!0), [n, r] = E();
162
+ return b(() => {
163
+ g && m(t, "set-context", {
791
164
  context: {
792
- ..._,
165
+ ...d,
793
166
  // TODO: Remove this once everything is migrated to params
794
- colorMode: y.colorMode,
795
- isFullScreen: y.isFullScreen
167
+ colorMode: c.colorMode,
168
+ isFullScreen: c.isFullScreen
796
169
  }
797
170
  });
798
- }, [_, y.colorMode, y.isFullScreen, f, b]), A(() => {
799
- b && (a(f, "set-params", { params: y }), a(f, "set-configuring", { isConfiguring: y.isConfiguring }));
800
- }, [y, f, b]), A(() => {
801
- T !== void 0 && c(T || "/");
802
- }, [T]), A(() => {
803
- u === void 0 || !b || a(f, "navigate", { path: u });
804
- }, [u, b, f, a]), A(() => {
805
- if (!(!g || !f || !S))
171
+ }, [d, c.colorMode, c.isFullScreen, t, g]), b(() => {
172
+ g && (m(t, "set-params", { params: c }), m(t, "set-configuring", { isConfiguring: c.isConfiguring }));
173
+ }, [c, t, g]), b(() => {
174
+ u !== void 0 && r(u || "/");
175
+ }, [u]), b(() => {
176
+ n === void 0 || !g || m(t, "navigate", { path: n });
177
+ }, [n, g, t, m]), b(() => {
178
+ if (!(!o || !t || !p))
806
179
  return (async () => {
807
- const R = await Cr(g);
808
- if (s(R), R) {
809
- const M = new URL(g);
810
- j(f, M.origin, S), p(), w(
811
- `${M.origin}/mm-embedded-interop?id=${f}&origin=${window.location.origin}`
180
+ const s = await z(o);
181
+ if (e(s), s) {
182
+ const a = new URL(o);
183
+ w(t, a.origin, p), i(), f(
184
+ `${a.origin}/mm-embedded-interop?id=${t}&origin=${window.location.origin}`
812
185
  );
813
186
  return;
814
187
  }
815
188
  })(), () => {
816
- I(f);
189
+ C(t);
817
190
  };
818
- }, [g, f, j, S]), Or(f, "ready", () => O((R) => R + 1)), v ? /* @__PURE__ */ ie.jsx(jr, { $isReady: b, ref: S, src: h, ...k }) : /* @__PURE__ */ ie.jsx(
191
+ }, [o, t, w, p]), G(t, "ready", () => Z((s) => s + 1)), q ? /* @__PURE__ */ S(K, { $isReady: g, ref: p, src: F, ...M }) : /* @__PURE__ */ S(
819
192
  "div",
820
193
  {
821
194
  style: {
@@ -825,21 +198,21 @@ const Pr = Ve.default || Ve, jr = Pr.iframe`
825
198
  alignItems: "center",
826
199
  justifyContent: "center"
827
200
  },
828
- children: /* @__PURE__ */ ie.jsx("div", { style: { textAlign: "center" }, children: "Application must adhere to the MM App Manifest specification to be embedded." })
201
+ children: /* @__PURE__ */ S("div", { style: { textAlign: "center" }, children: "Application must adhere to the MM App Manifest specification to be embedded." })
829
202
  }
830
203
  );
831
204
  };
832
- xr.propTypes = {
833
- id: H.string,
834
- src: H.string.isRequired,
835
- path: H.string,
836
- onInit: H.func
205
+ Q.propTypes = {
206
+ id: R.string,
207
+ src: R.string.isRequired,
208
+ path: R.string,
209
+ onInit: R.func
837
210
  };
838
211
  export {
839
- xr as MMEmbeddableZone,
840
- he as MMEmbeddableZoneContext,
841
- Tr as MMEmbeddableZoneProvider,
842
- Sr as getAppInfo,
843
- Cr as testIsEmbeddable,
844
- Or as useEmbeddedEffect
212
+ Q as MMEmbeddableZone,
213
+ k as MMEmbeddableZoneContext,
214
+ D as MMEmbeddableZoneProvider,
215
+ _ as getAppInfo,
216
+ z as testIsEmbeddable,
217
+ G as useEmbeddedEffect
845
218
  };
@@ -1,35 +1,6 @@
1
- (function(P,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","styled-components"],i):(P=typeof globalThis<"u"?globalThis:P||self,i(P["mm-react-embeddable"]={},P.React,P.PropTypes,P.styled))})(this,function(P,i,J,ye){"use strict";var ie={exports:{}},K={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ee;function ze(){if(Ee)return K;Ee=1;var d=i,g=Symbol.for("react.element"),S=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,w=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function F(T,h,C){var m,j={},k=null,D=null;C!==void 0&&(k=""+C),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(D=h.ref);for(m in h)b.call(h,m)&&!E.hasOwnProperty(m)&&(j[m]=h[m]);if(T&&T.defaultProps)for(m in h=T.defaultProps,h)j[m]===void 0&&(j[m]=h[m]);return{$$typeof:g,type:T,key:k,ref:D,props:j,_owner:w.current}}return K.Fragment=S,K.jsx=F,K.jsxs=F,K}var N={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var he;function He(){return he||(he=1,process.env.NODE_ENV!=="production"&&function(){var d=i,g=Symbol.for("react.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),T=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),a=Symbol.iterator,p="@@iterator";function u(e){if(e===null||typeof e!="object")return null;var r=a&&e[a]||e[p];return typeof r=="function"?r:null}var c=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function l(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];_("error",e,t)}}function _(e,r,t){{var n=c.ReactDebugCurrentFrame,f=n.getStackAddendum();f!==""&&(r+="%s",t=t.concat([f]));var v=t.map(function(s){return String(s)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var A=!1,V=!1,W=!1,ee=!1,re=!1,L;L=Symbol.for("react.module.reference");function se(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===E||re||e===w||e===C||e===m||ee||e===D||A||V||W||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===j||e.$$typeof===F||e.$$typeof===T||e.$$typeof===h||e.$$typeof===L||e.getModuleId!==void 0))}function ue(e,r,t){var n=e.displayName;if(n)return n;var f=r.displayName||r.name||"";return f!==""?t+"("+f+")":t}function G(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&l("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 b:return"Fragment";case S:return"Portal";case E:return"Profiler";case w:return"StrictMode";case C:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return G(r)+".Consumer";case F:var t=e;return G(t._context)+".Provider";case h:return ue(e,e.render,"ForwardRef");case j:var n=e.displayName||null;return n!==null?n:I(e.type)||"Memo";case k:{var f=e,v=f._payload,s=f._init;try{return I(s(v))}catch{return null}}}return null}var Y=Object.assign,z=0,Te,Oe,Pe,je,xe,ke,Me;function Fe(){}Fe.__reactDisabledLog=!0;function Qe(){{if(z===0){Te=console.log,Oe=console.info,Pe=console.warn,je=console.error,xe=console.group,ke=console.groupCollapsed,Me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Fe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function qe(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Y({},e,{value:Te}),info:Y({},e,{value:Oe}),warn:Y({},e,{value:Pe}),error:Y({},e,{value:je}),group:Y({},e,{value:xe}),groupCollapsed:Y({},e,{value:ke}),groupEnd:Y({},e,{value:Me})})}z<0&&l("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=c.ReactCurrentDispatcher,le;function te(e,r,t){{if(le===void 0)try{throw Error()}catch(f){var n=f.stack.trim().match(/\n( *(at )?)/);le=n&&n[1]||""}return`
18
- `+le+e}}var fe=!1,ne;{var $e=typeof WeakMap=="function"?WeakMap:Map;ne=new $e}function Ie(e,r){if(!e||fe)return"";{var t=ne.get(e);if(t!==void 0)return t}var n;fe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=ce.current,ce.current=null,Qe();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(x){n=x}Reflect.construct(e,[],s)}else{try{s.call()}catch(x){n=x}e.call(s.prototype)}}else{try{throw Error()}catch(x){n=x}e()}}catch(x){if(x&&n&&typeof x.stack=="string"){for(var o=x.stack.split(`
19
- `),O=n.stack.split(`
20
- `),y=o.length-1,R=O.length-1;y>=1&&R>=0&&o[y]!==O[R];)R--;for(;y>=1&&R>=0;y--,R--)if(o[y]!==O[R]){if(y!==1||R!==1)do if(y--,R--,R<0||o[y]!==O[R]){var M=`
21
- `+o[y].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),typeof e=="function"&&ne.set(e,M),M}while(y>=1&&R>=0);break}}}finally{fe=!1,ce.current=v,qe(),Error.prepareStackTrace=f}var B=e?e.displayName||e.name:"",U=B?te(B):"";return typeof e=="function"&&ne.set(e,U),U}function er(e,r,t){return Ie(e,!1)}function rr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ae(e,r,t){if(e==null)return"";if(typeof e=="function")return Ie(e,rr(e));if(typeof e=="string")return te(e);switch(e){case C:return te("Suspense");case m:return te("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return er(e.render);case j:return ae(e.type,r,t);case k:{var n=e,f=n._payload,v=n._init;try{return ae(v(f),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Ae={},De=c.ReactDebugCurrentFrame;function oe(e){if(e){var r=e._owner,t=ae(e.type,e._source,r?r.type:null);De.setExtraStackFrame(t)}else De.setExtraStackFrame(null)}function tr(e,r,t,n,f){{var v=Function.call.bind(H);for(var s in e)if(v(e,s)){var o=void 0;try{if(typeof e[s]!="function"){var O=Error((n||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}o=e[s](r,s,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){o=y}o&&!(o instanceof Error)&&(oe(f),l("%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,s,typeof o),oe(null)),o instanceof Error&&!(o.message in Ae)&&(Ae[o.message]=!0,oe(f),l("Failed %s type: %s",t,o.message),oe(null))}}}var nr=Array.isArray;function de(e){return nr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Le(e){if(or(e))return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),We(e)}var X=c.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ue,ve;ve={};function sr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ur(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){if(typeof e.ref=="string"&&X.current&&r&&X.current.stateNode!==r){var t=I(X.current.type);ve[t]||(l('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',I(X.current.type),e.ref),ve[t]=!0)}}function lr(e,r){{var t=function(){Ye||(Ye=!0,l("%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 fr(e,r){{var t=function(){Ue||(Ue=!0,l("%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 dr=function(e,r,t,n,f,v,s){var o={$$typeof:g,type:e,key:r,ref:t,props:s,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function vr(e,r,t,n,f){{var v,s={},o=null,O=null;t!==void 0&&(Le(t),o=""+t),ur(r)&&(Le(r.key),o=""+r.key),sr(r)&&(O=r.ref,cr(r,f));for(v in r)H.call(r,v)&&!ir.hasOwnProperty(v)&&(s[v]=r[v]);if(e&&e.defaultProps){var y=e.defaultProps;for(v in y)s[v]===void 0&&(s[v]=y[v])}if(o||O){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&lr(s,R),O&&fr(s,R)}return dr(e,o,O,f,n,X.current,s)}}var pe=c.ReactCurrentOwner,Ve=c.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=ae(e.type,e._source,r?r.type:null);Ve.setExtraStackFrame(t)}else Ve.setExtraStackFrame(null)}var be;be=!1;function ge(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function Ze(){{if(pe.current){var e=I(pe.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function pr(e){return""}var Be={};function br(e){{var r=Ze();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
-
25
- Check the top-level render call using <`+t+">.")}return r}}function Je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=br(r);if(Be[t])return;Be[t]=!0;var n="";e&&e._owner&&e._owner!==pe.current&&(n=" It was passed a child from "+I(e._owner.type)+"."),Z(e),l('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),Z(null)}}function Ke(e,r){{if(typeof e!="object")return;if(de(e))for(var t=0;t<e.length;t++){var n=e[t];ge(n)&&Je(n,r)}else if(ge(e))e._store&&(e._store.validated=!0);else if(e){var f=u(e);if(typeof f=="function"&&f!==e.entries)for(var v=f.call(e),s;!(s=v.next()).done;)ge(s.value)&&Je(s.value,r)}}}function gr(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===h||r.$$typeof===j))t=r.propTypes;else return;if(t){var n=I(r);tr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!be){be=!0;var f=I(r);l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){Z(e),l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Z(null);break}}e.ref!==null&&(Z(e),l("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}var Ne={};function Ge(e,r,t,n,f,v){{var s=se(e);if(!s){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 O=pr();O?o+=O:o+=Ze();var y;e===null?y="null":de(e)?y="array":e!==void 0&&e.$$typeof===g?(y="<"+(I(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,o)}var R=vr(e,r,t,f,v);if(R==null)return R;if(s){var M=r.children;if(M!==void 0)if(n)if(de(M)){for(var B=0;B<M.length;B++)Ke(M[B],e);Object.freeze&&Object.freeze(M)}else l("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 Ke(M,e)}if(H.call(r,"key")){var U=I(e),x=Object.keys(r).filter(function(wr){return wr!=="key"}),me=x.length>0?"{key: someKey, "+x.join(": ..., ")+": ...}":"{key: someKey}";if(!Ne[U+me]){var _r=x.length>0?"{"+x.join(": ..., ")+": ...}":"{}";l(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,me,U,_r,U),Ne[U+me]=!0}}return e===b?mr(R):gr(R),R}}function yr(e,r,t){return Ge(e,r,t,!0)}function Er(e,r,t){return Ge(e,r,t,!1)}var hr=Er,Rr=yr;N.Fragment=b,N.jsx=hr,N.jsxs=Rr}()),N}process.env.NODE_ENV==="production"?ie.exports=ze():ie.exports=He();var Q=ie.exports;const q=i.createContext(null),Re=({children:d})=>{const[g,S]=i.useState({}),b=i.useRef({}),w=i.useRef({}),E=i.useRef({}),F=i.useCallback((a,p)=>{var u;return!!((u=E.current[a])!=null&&u.has(p))},[]),T=i.useCallback((a,p,u)=>{S(c=>({...c,[a]:{origin:p,frameRef:u}}))},[]),h=i.useCallback(a=>{S(p=>{const u={...p};return delete u[a],u}),delete E.current[a]},[]);i.useEffect(()=>{const a=(u=[],c)=>{u.forEach(l=>l(c))},p=u=>{var A,V,W,ee,re;if(!((A=u==null?void 0:u.data)!=null&&A.instanceId))return;const{instanceId:c,type:l}=u.data,_=b.current;if(l==="response"){const{callbackId:L,response:se,error:ue}=u.data,G=w.current[L];G&&(G(se,ue),delete w.current[L]);return}if(l==="mark-registered"){const{requestType:L}=u.data;E.current[c]||(E.current[c]=new Set),E.current[c].add(L);return}a((V=_[c])==null?void 0:V[l],u.data),a((W=_["*"])==null?void 0:W[l],u.data),a((ee=_[c])==null?void 0:ee["*"],u.data),a((re=_["*"])==null?void 0:re["*"],u.data)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p)}},[g]);const C=i.useCallback((a,p,u)=>{var l,_;const c=g[a];if(!c){console.warn(`Origin not set for id: ${a}. Unable to send message.`);return}(_=(l=c==null?void 0:c.frameRef)==null?void 0:l.current)!=null&&_.contentWindow&&c.frameRef.current.contentWindow.postMessage({type:p,...u,instanceId:a},c.origin)},[g]),m=i.useCallback(async(a,p,u={})=>new Promise((c,l)=>{const _=crypto.randomUUID(),A=(V,W)=>{delete w.current[_],W?l(W):c(V)};w.current[_]=A,C(a,"request",{callbackId:_,requestType:p,data:u})}),[C]),j=i.useCallback((a,p)=>{C(a,"load-options",p)},[C]),k=i.useCallback((a,p)=>{C(a,"validate",p)},[C]),D=i.useMemo(()=>({registerFrame:T,unregisterFrame:h,sendMessage:C,sendRequest:m,loadOptions:j,validate:k,hasHandler:F,addListener:(a,p,u)=>(b.current[a]||(b.current[a]={}),b.current[a][p]||(b.current[a][p]=[]),b.current[a][p].push(u),()=>{b.current[a][p]=b.current[a][p].filter(c=>c!==u)})}),[T,h,C,m,j,k,F]);return Q.jsx(q.Provider,{value:D,children:d})},$={},_e=async d=>{try{const g=new URL(d).origin;if($[g]!==void 0)return $[g];const b=await(await fetch(`${g}/mm-app-manifest.json`)).json();if(!b.version)throw new Error("Invalid manifest");return $[g]=b,b}catch{}return $[origin]=!1,!1},we=async d=>!!await _e(d),Ce=(d,g,S)=>{const b=i.useContext(q);if(b===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const w=i.useRef(S);i.useEffect(()=>{w.current=S},[S]),i.useEffect(()=>{if(!(!d||!g))return b.addListener(d,g,(...E)=>w.current(...E))},[b,d,g])};Re.propTypes={children:J.node.isRequired};const Xe=(ye.default||ye).iframe`
1
+ (function(d,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","prop-types","styled-components"],p):(d=typeof globalThis<"u"?globalThis:d||self,p(d["mm-react-embeddable"]={},d.React,d.React,d.PropTypes,d.styled))})(this,function(d,p,n,h,j){"use strict";const C=n.createContext(null),v=({children:s})=>{const[i,f]=n.useState({}),u=n.useRef({}),l=n.useRef({}),c=n.useRef({}),y=n.useCallback((e,r)=>{var t;return!!((t=c.current[e])!=null&&t.has(r))},[]),M=n.useCallback((e,r,t)=>{f(o=>({...o,[e]:{origin:r,frameRef:t}}))},[]),S=n.useCallback(e=>{f(r=>{const t={...r};return delete t[e],t}),delete c.current[e]},[]);n.useEffect(()=>{const e=(t=[],o)=>{t.forEach(a=>a(o))},r=t=>{var F,q,R,O,T;if(!((F=t==null?void 0:t.data)!=null&&F.instanceId))return;const{instanceId:o,type:a}=t.data,b=u.current;if(a==="response"){const{callbackId:Z,response:B,error:D}=t.data,H=l.current[Z];H&&(H(B,D),delete l.current[Z]);return}if(a==="mark-registered"){const{requestType:Z}=t.data;c.current[o]||(c.current[o]=new Set),c.current[o].add(Z);return}e((q=b[o])==null?void 0:q[a],t.data),e((R=b["*"])==null?void 0:R[a],t.data),e((O=b[o])==null?void 0:O["*"],t.data),e((T=b["*"])==null?void 0:T["*"],t.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},[i]);const m=n.useCallback((e,r,t)=>{var a,b;const o=i[e];if(!o){console.warn(`Origin not set for id: ${e}. Unable to send message.`);return}(b=(a=o==null?void 0:o.frameRef)==null?void 0:a.current)!=null&&b.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:r,...t,instanceId:e},o.origin)},[i]);let g=0;const $=()=>`${Date.now()}-${++g}`,w=n.useCallback(async(e,r,t={})=>new Promise((o,a)=>{const b=$(),F=(q,R)=>{delete l.current[b],R?a(R):o(q)};l.current[b]=F,m(e,"request",{callbackId:b,requestType:r,data:t})}),[m]),k=n.useCallback((e,r)=>{m(e,"load-options",r)},[m]),E=n.useCallback((e,r)=>{m(e,"validate",r)},[m]),x=n.useMemo(()=>({registerFrame:M,unregisterFrame:S,sendMessage:m,sendRequest:w,loadOptions:k,validate:E,hasHandler:y,addListener:(e,r,t)=>(u.current[e]||(u.current[e]={}),u.current[e][r]||(u.current[e][r]=[]),u.current[e][r].push(t),()=>{u.current[e][r]=u.current[e][r].filter(o=>o!==t)})}),[M,S,m,w,k,E,y]);return p.jsx(C.Provider,{value:x,children:s})},I={},L=async s=>{try{const i=new URL(s).origin;if(I[i]!==void 0)return I[i];const u=await(await fetch(`${i}/mm-app-manifest.json`)).json();if(!u.version)throw new Error("Invalid manifest");return I[i]=u,u}catch{}return I[origin]=!1,!1},A=async s=>!!await L(s),P=(s,i,f)=>{const u=n.useContext(C);if(u===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const l=n.useRef(f);n.useEffect(()=>{l.current=f},[f]),n.useEffect(()=>{if(!(!s||!i))return u.addListener(s,i,(...c)=>l.current(...c))},[u,s,i])};v.propTypes={children:h.node.isRequired};const W=(j.default||j).iframe`
31
2
  width: 100%;
32
3
  height: 100%;
33
4
  border: none;
34
- visibility: ${d=>d.$isReady?"visible":"hidden"};
35
- `,Se=({id:d,src:g,path:S,onInit:b=()=>{},context:w={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const T=i.useRef(),[h,C]=i.useState(),[m,j]=i.useState(0),{registerFrame:k,unregisterFrame:D,sendMessage:a}=i.useContext(q),[p,u]=i.useState(!0),[c,l]=i.useState();return i.useEffect(()=>{m&&a(d,"set-context",{context:{...w,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[w,E.colorMode,E.isFullScreen,d,m]),i.useEffect(()=>{m&&(a(d,"set-params",{params:E}),a(d,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,d,m]),i.useEffect(()=>{S!==void 0&&l(S||"/")},[S]),i.useEffect(()=>{c===void 0||!m||a(d,"navigate",{path:c})},[c,m,d,a]),i.useEffect(()=>{if(!(!g||!d||!T))return(async()=>{const _=await we(g);if(u(_),_){const A=new URL(g);k(d,A.origin,T),b(),C(`${A.origin}/mm-embedded-interop?id=${d}&origin=${window.location.origin}`);return}})(),()=>{D(d)}},[g,d,k,T]),Ce(d,"ready",()=>j(_=>_+1)),p?Q.jsx(Xe,{$isReady:m,ref:T,src:h,...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."})})};Se.propTypes={id:J.string,src:J.string.isRequired,path:J.string,onInit:J.func},P.MMEmbeddableZone=Se,P.MMEmbeddableZoneContext=q,P.MMEmbeddableZoneProvider=Re,P.getAppInfo=_e,P.testIsEmbeddable=we,P.useEmbeddedEffect=Ce,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
5
+ visibility: ${s=>s.$isReady?"visible":"hidden"};
6
+ `,U=({id:s,src:i,path:f,onInit:u=()=>{},context:l={},params:c={},...y})=>{if("isConfiguring"in y)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in l)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in l)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const M=n.useRef(),[S,m]=n.useState(),[g,$]=n.useState(0),{registerFrame:w,unregisterFrame:k,sendMessage:E}=n.useContext(C),[x,e]=n.useState(!0),[r,t]=n.useState();return n.useEffect(()=>{g&&E(s,"set-context",{context:{...l,colorMode:c.colorMode,isFullScreen:c.isFullScreen}})},[l,c.colorMode,c.isFullScreen,s,g]),n.useEffect(()=>{g&&(E(s,"set-params",{params:c}),E(s,"set-configuring",{isConfiguring:c.isConfiguring}))},[c,s,g]),n.useEffect(()=>{f!==void 0&&t(f||"/")},[f]),n.useEffect(()=>{r===void 0||!g||E(s,"navigate",{path:r})},[r,g,s,E]),n.useEffect(()=>{if(!(!i||!s||!M))return(async()=>{const o=await A(i);if(e(o),o){const a=new URL(i);w(s,a.origin,M),u(),m(`${a.origin}/mm-embedded-interop?id=${s}&origin=${window.location.origin}`);return}})(),()=>{k(s)}},[i,s,w,M]),P(s,"ready",()=>$(o=>o+1)),x?p.jsx(W,{$isReady:g,ref:M,src:S,...y}):p.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:p.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};U.propTypes={id:h.string,src:h.string.isRequired,path:h.string,onInit:h.func},d.MMEmbeddableZone=U,d.MMEmbeddableZoneContext=C,d.MMEmbeddableZoneProvider=v,d.getAppInfo=L,d.testIsEmbeddable=A,d.useEmbeddedEffect=P,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-embeddable",
3
- "version": "1.0.10",
3
+ "version": "1.0.11-0",
4
4
  "license": "MIT",
5
5
  "module": "dist/mm-react-embeddable.es.js",
6
6
  "main": "dist/mm-react-embeddable.cjs.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "scripts": {
20
20
  "build": "vite build",
21
- "start": "vite build --watch",
21
+ "start": "npm install --omit=peer && npm link && vite build --watch",
22
22
  "test": "vitest run",
23
23
  "test:watch": "vitest"
24
24
  },
@@ -26,7 +26,8 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "prop-types": "^15.8.1"
29
+ "prop-types": "^15.8.1",
30
+ "vite": "^5.4.8"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "react": ">=16.0.0",
@@ -39,7 +40,6 @@
39
40
  "@vitest/coverage-v8": "^1.6.1",
40
41
  "jsdom": "^24.1.3",
41
42
  "prettier": "^3.3.3",
42
- "vite": "^5.4.8",
43
43
  "vitest": "^1.6.1"
44
44
  }
45
45
  }