New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@calcom/embed-react

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@calcom/embed-react - npm Package Compare versions

Comparing version
1.2.2
to
1.3.0
+708
dist/Cal.es.mjs
import Oe, { useState as lr, useEffect as Se, useRef as Ce } from "react";
const fr = "https://app.cal.com/embed/embed.js";
function X(C = fr) {
(function(p, E, h) {
let R = function(c, d) {
c.q.push(d);
}, T = p.document;
p.Cal = p.Cal || function() {
let c = p.Cal, d = arguments;
if (c.loaded || (c.ns = {}, c.q = c.q || [], T.head.appendChild(T.createElement("script")).src = E, c.loaded = !0), d[0] === h) {
const s = function() {
R(s, arguments);
}, g = d[1];
s.q = s.q || [], typeof g == "string" ? (
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
(c.ns[g] = s) && R(s, d)
) : R(c, d);
return;
}
R(c, d);
};
})(
window,
//! Replace it with "https://cal.com/embed.js" or the URL where you have embed.js installed
C,
"init"
);
/*! Copying ends here. */
return window.Cal;
}
X.toString();
function cr(C) {
const [p, E] = lr();
return Se(() => {
E(() => X(C));
}, []), p;
}
var H = { exports: {} }, A = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Te;
function dr() {
if (Te)
return A;
Te = 1;
var C = Oe, p = Symbol.for("react.element"), E = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, R = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
function c(d, s, g) {
var v, _ = {}, S = null, $ = null;
g !== void 0 && (S = "" + g), s.key !== void 0 && (S = "" + s.key), s.ref !== void 0 && ($ = s.ref);
for (v in s)
h.call(s, v) && !T.hasOwnProperty(v) && (_[v] = s[v]);
if (d && d.defaultProps)
for (v in s = d.defaultProps, s)
_[v] === void 0 && (_[v] = s[v]);
return { $$typeof: p, type: d, key: S, ref: $, props: _, _owner: R.current };
}
return A.Fragment = E, A.jsx = c, A.jsxs = c, A;
}
var I = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var we;
function vr() {
return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
var C = Oe, p = Symbol.for("react.element"), E = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), d = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), Z = Symbol.iterator, Pe = "@@iterator";
function xe(e) {
if (e === null || typeof e != "object")
return null;
var r = Z && e[Z] || e[Pe];
return typeof r == "function" ? r : null;
}
var x = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function m(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
t[n - 1] = arguments[n];
je("error", e, t);
}
}
function je(e, r, t) {
{
var n = x.ReactDebugCurrentFrame, o = n.getStackAddendum();
o !== "" && (r += "%s", t = t.concat([o]));
var u = t.map(function(i) {
return String(i);
});
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
}
}
var ke = !1, De = !1, Fe = !1, Ae = !1, Ie = !1, Q;
Q = Symbol.for("react.module.reference");
function $e(e) {
return !!(typeof e == "string" || typeof e == "function" || e === h || e === T || Ie || e === R || e === g || e === v || Ae || e === $ || ke || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === _ || e.$$typeof === c || e.$$typeof === d || e.$$typeof === s || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === Q || e.getModuleId !== void 0));
}
function We(e, r, t) {
var n = e.displayName;
if (n)
return n;
var o = r.displayName || r.name || "";
return o !== "" ? t + "(" + o + ")" : t;
}
function ee(e) {
return e.displayName || "Context";
}
function w(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && m("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 h:
return "Fragment";
case E:
return "Portal";
case T:
return "Profiler";
case R:
return "StrictMode";
case g:
return "Suspense";
case v:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case d:
var r = e;
return ee(r) + ".Consumer";
case c:
var t = e;
return ee(t._context) + ".Provider";
case s:
return We(e, e.render, "ForwardRef");
case _:
var n = e.displayName || null;
return n !== null ? n : w(e.type) || "Memo";
case S: {
var o = e, u = o._payload, i = o._init;
try {
return w(i(u));
} catch {
return null;
}
}
}
return null;
}
var P = Object.assign, D = 0, re, te, ne, ae, ie, oe, ue;
function se() {
}
se.__reactDisabledLog = !0;
function Ye() {
{
if (D === 0) {
re = console.log, te = console.info, ne = console.warn, ae = console.error, ie = console.group, oe = console.groupCollapsed, ue = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: se,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
D++;
}
}
function Le() {
{
if (D--, D === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: P({}, e, {
value: re
}),
info: P({}, e, {
value: te
}),
warn: P({}, e, {
value: ne
}),
error: P({}, e, {
value: ae
}),
group: P({}, e, {
value: ie
}),
groupCollapsed: P({}, e, {
value: oe
}),
groupEnd: P({}, e, {
value: ue
})
});
}
D < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var V = x.ReactCurrentDispatcher, M;
function W(e, r, t) {
{
if (M === void 0)
try {
throw Error();
} catch (o) {
var n = o.stack.trim().match(/\n( *(at )?)/);
M = n && n[1] || "";
}
return `
` + M + e;
}
}
var q = !1, Y;
{
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
Y = new Ne();
}
function le(e, r) {
if (!e || q)
return "";
{
var t = Y.get(e);
if (t !== void 0)
return t;
}
var n;
q = !0;
var o = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var u;
u = V.current, V.current = null, Ye();
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 (O) {
n = O;
}
Reflect.construct(e, [], i);
} else {
try {
i.call();
} catch (O) {
n = O;
}
e.call(i.prototype);
}
} else {
try {
throw Error();
} catch (O) {
n = O;
}
e();
}
} catch (O) {
if (O && n && typeof O.stack == "string") {
for (var a = O.stack.split(`
`), b = n.stack.split(`
`), l = a.length - 1, f = b.length - 1; l >= 1 && f >= 0 && a[l] !== b[f]; )
f--;
for (; l >= 1 && f >= 0; l--, f--)
if (a[l] !== b[f]) {
if (l !== 1 || f !== 1)
do
if (l--, f--, f < 0 || a[l] !== b[f]) {
var y = `
` + a[l].replace(" at new ", " at ");
return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, y), y;
}
while (l >= 1 && f >= 0);
break;
}
}
} finally {
q = !1, V.current = u, Le(), Error.prepareStackTrace = o;
}
var k = e ? e.displayName || e.name : "", _e = k ? W(k) : "";
return typeof e == "function" && Y.set(e, _e), _e;
}
function Ue(e, r, t) {
return le(e, !1);
}
function Ve(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function L(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return le(e, Ve(e));
if (typeof e == "string")
return W(e);
switch (e) {
case g:
return W("Suspense");
case v:
return W("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case s:
return Ue(e.render);
case _:
return L(e.type, r, t);
case S: {
var n = e, o = n._payload, u = n._init;
try {
return L(u(o), r, t);
} catch {
}
}
}
return "";
}
var N = Object.prototype.hasOwnProperty, fe = {}, ce = x.ReactDebugCurrentFrame;
function U(e) {
if (e) {
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
ce.setExtraStackFrame(t);
} else
ce.setExtraStackFrame(null);
}
function Me(e, r, t, n, o) {
{
var u = Function.call.bind(N);
for (var i in e)
if (u(e, i)) {
var a = void 0;
try {
if (typeof e[i] != "function") {
var b = 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 b.name = "Invariant Violation", b;
}
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (l) {
a = l;
}
a && !(a instanceof Error) && (U(o), m("%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 a), U(null)), a instanceof Error && !(a.message in fe) && (fe[a.message] = !0, U(o), m("Failed %s type: %s", t, a.message), U(null));
}
}
}
var qe = Array.isArray;
function B(e) {
return qe(e);
}
function Be(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function Je(e) {
try {
return de(e), !1;
} catch {
return !0;
}
}
function de(e) {
return "" + e;
}
function ve(e) {
if (Je(e))
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), de(e);
}
var F = x.ReactCurrentOwner, Ge = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, pe, ge, J;
J = {};
function ze(e) {
if (N.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function Ke(e) {
if (N.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function He(e, r) {
if (typeof e.ref == "string" && F.current && r && F.current.stateNode !== r) {
var t = w(F.current.type);
J[t] || (m('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', w(F.current.type), e.ref), J[t] = !0);
}
}
function Xe(e, r) {
{
var t = function() {
pe || (pe = !0, m("%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 Ze(e, r) {
{
var t = function() {
ge || (ge = !0, m("%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 Qe = function(e, r, t, n, o, u, i) {
var a = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: p,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: i,
// Record the component responsible for creating this element.
_owner: u
};
return a._store = {}, Object.defineProperty(a._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(a, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: n
}), Object.defineProperty(a, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: o
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
};
function er(e, r, t, n, o) {
{
var u, i = {}, a = null, b = null;
t !== void 0 && (ve(t), a = "" + t), Ke(r) && (ve(r.key), a = "" + r.key), ze(r) && (b = r.ref, He(r, o));
for (u in r)
N.call(r, u) && !Ge.hasOwnProperty(u) && (i[u] = r[u]);
if (e && e.defaultProps) {
var l = e.defaultProps;
for (u in l)
i[u] === void 0 && (i[u] = l[u]);
}
if (a || b) {
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
a && Xe(i, f), b && Ze(i, f);
}
return Qe(e, a, b, o, n, F.current, i);
}
}
var G = x.ReactCurrentOwner, me = x.ReactDebugCurrentFrame;
function j(e) {
if (e) {
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
me.setExtraStackFrame(t);
} else
me.setExtraStackFrame(null);
}
var z;
z = !1;
function K(e) {
return typeof e == "object" && e !== null && e.$$typeof === p;
}
function be() {
{
if (G.current) {
var e = w(G.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function rr(e) {
{
if (e !== void 0) {
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
return `
Check your code at ` + r + ":" + t + ".";
}
return "";
}
}
var Ee = {};
function tr(e) {
{
var r = be();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
}
}
function he(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var t = tr(r);
if (Ee[t])
return;
Ee[t] = !0;
var n = "";
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + w(e._owner.type) + "."), j(e), m('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), j(null);
}
}
function Re(e, r) {
{
if (typeof e != "object")
return;
if (B(e))
for (var t = 0; t < e.length; t++) {
var n = e[t];
K(n) && he(n, r);
}
else if (K(e))
e._store && (e._store.validated = !0);
else if (e) {
var o = xe(e);
if (typeof o == "function" && o !== e.entries)
for (var u = o.call(e), i; !(i = u.next()).done; )
K(i.value) && he(i.value, r);
}
}
}
function nr(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 === s || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === _))
t = r.propTypes;
else
return;
if (t) {
var n = w(r);
Me(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !z) {
z = !0;
var o = w(r);
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function ar(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var n = r[t];
if (n !== "children" && n !== "key") {
j(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), j(null);
break;
}
}
e.ref !== null && (j(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
}
}
function ye(e, r, t, n, o, u) {
{
var i = $e(e);
if (!i) {
var a = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " 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 b = rr(o);
b ? a += b : a += be();
var l;
e === null ? l = "null" : B(e) ? l = "array" : e !== void 0 && e.$$typeof === p ? (l = "<" + (w(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
}
var f = er(e, r, t, o, u);
if (f == null)
return f;
if (i) {
var y = r.children;
if (y !== void 0)
if (n)
if (B(y)) {
for (var k = 0; k < y.length; k++)
Re(y[k], e);
Object.freeze && Object.freeze(y);
} else
m("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
Re(y, e);
}
return e === h ? ar(f) : nr(f), f;
}
}
function ir(e, r, t) {
return ye(e, r, t, !0);
}
function or(e, r, t) {
return ye(e, r, t, !1);
}
var ur = or, sr = ir;
I.Fragment = h, I.jsx = ur, I.jsxs = sr;
}()), I;
}
process.env.NODE_ENV === "production" ? H.exports = dr() : H.exports = vr();
var pr = H.exports;
const gr = pr.jsx, mr = function(p) {
const {
calLink: E,
calOrigin: h,
config: R,
initConfig: T = {},
embedJsUrl: c,
...d
} = p;
if (!E)
throw new Error("calLink is required");
const s = Ce(!1), g = cr(c), v = Ce(null);
return Se(() => {
if (!g || s.current || !v.current)
return;
s.current = !0;
const _ = v.current;
g("init", {
...T,
origin: h
}), g("inline", {
elementOrSelector: _,
calLink: E,
config: R
});
}, [g, E, R, h, T]), g ? /* @__PURE__ */ gr("div", {
ref: v,
...d
}) : null;
}, Er = mr, hr = (C) => new Promise(function p(E) {
X(C);
const h = window.Cal;
if (!h) {
setTimeout(() => {
p(E);
}, 50);
return;
}
E(h);
});
export {
Er as default,
hr as getCalApi
};
+6
-0
# @calcom/embed-react
## 1.3.0
### Minor Changes
- Fix module import of the embed-react package
## 1.2.2

@@ -4,0 +10,0 @@

+4
-4
{
"name": "@calcom/embed-react",
"sideEffects": false,
"version": "1.2.2",
"version": "1.3.0",
"description": "Embed Cal Link as a React Component",

@@ -14,3 +14,3 @@ "license": "SEE LICENSE IN LICENSE",

"dev": "vite --port=3101 --open",
"build": "rm -rf dist && vite build && tsc --emitDeclarationOnly --declarationDir dist",
"build": "rm -rf dist && vite build && cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist",
"preview": "vite preview",

@@ -31,3 +31,3 @@ "type-check": "tsc --pretty --noEmit",

"main": "./dist/Cal.umd.js",
"module": "./dist/Cal.es.js",
"module": "./dist/Cal.es.mjs",
"types": "./dist/embed-react/src/index.d.ts",

@@ -43,3 +43,3 @@ "peerDependencies": {

".": {
"import": "./dist/Cal.es.js",
"import": "./dist/Cal.es.mjs",
"require": "./dist/Cal.umd.js"

@@ -46,0 +46,0 @@ }