@mptransformation/omisdk
Version:
An embeddable TypeScript SDK for integrating into websites
1,317 lines (1,310 loc) • 3.47 MB
JavaScript
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
var __publicField = (obj, key, value2) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2);
var CallEventType = /* @__PURE__ */ ((CallEventType2) => {
CallEventType2["CALL_INCOMING"] = "call_incoming";
CallEventType2["CALL_OUTGOING"] = "call_outgoing";
CallEventType2["CALL_HANGUP"] = "call_hangup";
CallEventType2["CALL_ANSWERED"] = "call_answered";
CallEventType2["CALL_REJECTED"] = "call_rejected";
CallEventType2["CALL_HOLD"] = "call_hold";
CallEventType2["CALL_UNHOLD"] = "call_unhold";
CallEventType2["CALL_MUTE"] = "call_mute";
CallEventType2["CALL_UNMUTE"] = "call_unmute";
CallEventType2["CALL_TRANSFER"] = "call_transfer";
CallEventType2["CALL_CONNECTED"] = "call_connected";
CallEventType2["CALL_CLOSE_CONVERSATION"] = "call_close_conversation";
CallEventType2["CALL_REFUSE_TRANSFER"] = "call_refuse_transfer";
CallEventType2["CALL_ACCEPT_TRANSFER"] = "call_accept_transfer";
CallEventType2["CALL_TRANSFER_FAILED"] = "call_transfer_failed";
CallEventType2["CALL_TRANSFER_RINGING"] = "call_transfer_ringing";
CallEventType2["CALL_TRANSFER_ANSWER"] = "call_transfer_answer";
CallEventType2["CALL_TRANSFER_ACCEPTED"] = "call_transfer_accepted";
CallEventType2["CALL_TERMINATED_OR_IVR_MISSED"] = "call_terminated_or_ivr_missed";
CallEventType2["CALL_CROSS_PLATFORM"] = "call_cross_platform";
CallEventType2["CALL_RECORDING"] = "call_recording";
CallEventType2["SNAPSHOT_SUCCESS"] = "snapshot_success";
CallEventType2["SNAPSHOT_ERROR"] = "snapshot_error";
return CallEventType2;
})(CallEventType || {});
var AppEventType$1 = /* @__PURE__ */ ((AppEventType2) => {
AppEventType2["READY"] = "ready";
AppEventType2["DISPLAY_CHANGED"] = "display_changed";
AppEventType2["BUBBLE_HIDDEN"] = "bubble_hidden";
AppEventType2["BUBBLE_SHOWN"] = "bubble_shown";
AppEventType2["LOGGED_IN"] = "logged_in";
AppEventType2["LOGGED_OUT"] = "logged_out";
AppEventType2["TOKEN_EXPIRED"] = "token_expired";
AppEventType2["ERROR"] = "error";
AppEventType2["NETWORK_ERROR"] = "network_error";
AppEventType2["DISCONNECTED"] = "disconnected";
AppEventType2["CONNECTED"] = "connected";
AppEventType2["PERMISSION_DENIED"] = "permission_denied";
AppEventType2["DISCONNECTED_WEB_SOCKET"] = "disconnected_web_socket";
AppEventType2["CONNECTED_WEB_SOCKET"] = "connected_web_socket";
AppEventType2["AUTO_CONNECT"] = "auto_connect";
AppEventType2["NOT_AUTO_CONNECT"] = "not_auto_connect";
AppEventType2["FORCE_LOGOUT"] = "force_logout";
return AppEventType2;
})(AppEventType$1 || {});
var InteractionEventType$1 = /* @__PURE__ */ ((InteractionEventType2) => {
InteractionEventType2["NEW_CONVERSATION"] = "new_conversation";
InteractionEventType2["NEW_MESSAGE"] = "new_message";
InteractionEventType2["CLOSE_CONVERSATION"] = "close_conversation";
InteractionEventType2["MESSAGE_RECEIVED"] = "message_received";
InteractionEventType2["MESSAGE_SENT"] = "message_sent";
InteractionEventType2["MESSAGE_DELIVERED"] = "message_delivered";
InteractionEventType2["MESSAGE_READ"] = "message_read";
InteractionEventType2["CONVERSATION_ENDED"] = "conversation_ended";
return InteractionEventType2;
})(InteractionEventType$1 || {});
var TransferType = /* @__PURE__ */ ((TransferType2) => {
TransferType2["BLIND_TRANSFER"] = "BLIND_TRANSFER";
TransferType2["ATTENDED_TRANSFER"] = "ATTENDED_TRANSFER";
return TransferType2;
})(TransferType || {});
var PlatformType = /* @__PURE__ */ ((PlatformType2) => {
PlatformType2["WEB"] = "WEB";
PlatformType2["MOBILE"] = "MOBILE";
PlatformType2["DESKTOP"] = "DESKTOP";
PlatformType2["TABLET"] = "TABLET";
PlatformType2["PWA"] = "PWA";
return PlatformType2;
})(PlatformType || {});
function createElement(tag, attributes = {}, children = []) {
const element = document.createElement(tag);
Object.entries(attributes).forEach(([key, value2]) => {
element.setAttribute(key, value2);
});
children.forEach((child) => {
if (typeof child === "string") {
element.appendChild(document.createTextNode(child));
} else {
element.appendChild(child);
}
});
return element;
}
function getElementById(id) {
return document.getElementById(id);
}
function createStyleElement(css, id) {
const style2 = document.createElement("style");
style2.textContent = css;
if (id) {
style2.id = id;
}
return style2;
}
function addStyleToDocument(css, id) {
const style2 = createStyleElement(css, id);
document.head.appendChild(style2);
return style2;
}
function removeElement(element) {
if (element && element.parentNode) {
element.parentNode.removeChild(element);
}
}
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
LogLevel2["DEBUG"] = "debug";
LogLevel2["INFO"] = "info";
LogLevel2["WARN"] = "warn";
LogLevel2["ERROR"] = "error";
return LogLevel2;
})(LogLevel || {});
const DEFAULT_CONFIG = {
enabled: false,
level: "info",
prefix: "[OmiSDK]"
};
let Logger$3 = class Logger {
/**
* Creates a new Logger instance
* @param config Logger configuration
*/
constructor(config = {}) {
__publicField(this, "config");
this.config = { ...DEFAULT_CONFIG, ...config };
}
/**
* Updates the logger configuration
* @param config New configuration
*/
updateConfig(config) {
this.config = { ...this.config, ...config };
}
/**
* Logs a debug message
* @param message Message to log
* @param args Additional arguments
*/
debug(message2, ...args) {
this.log("debug", message2, ...args);
}
/**
* Logs an info message
* @param message Message to log
* @param args Additional arguments
*/
info(message2, ...args) {
this.log("info", message2, ...args);
}
/**
* Logs a warning message
* @param message Message to log
* @param args Additional arguments
*/
warn(message2, ...args) {
this.log("warn", message2, ...args);
}
/**
* Logs an error message
* @param message Message to log
* @param args Additional arguments
*/
error(message2, ...args) {
this.log("error", message2, ...args);
}
/**
* Internal log method
* @param level Log level
* @param message Message to log
* @param args Additional arguments
*/
log(level, message2, ...args) {
if (!this.config.enabled) return;
const logLevels = Object.values(LogLevel);
const configLevelIndex = logLevels.indexOf(this.config.level);
const messageLevelIndex = logLevels.indexOf(level);
if (messageLevelIndex < configLevelIndex) return;
const formattedMessage = `${this.config.prefix} ${message2}`;
switch (level) {
case "debug":
console.debug(formattedMessage, ...args);
break;
case "info":
console.info(formattedMessage, ...args);
break;
case "warn":
console.warn(formattedMessage, ...args);
break;
case "error":
console.error(formattedMessage, ...args);
break;
}
}
};
const DEFAULT_THEME = {
primaryColor: "#3498db",
secondaryColor: "#2ecc71",
textColor: "#333333",
backgroundColor: "#ffffff",
fontFamily: "Arial, sans-serif",
borderRadius: "4px",
customClasses: {}
};
function generateThemeCSS(theme, namespace) {
const mergedTheme = { ...DEFAULT_THEME, ...theme };
return `
.${namespace} {
--primary-color: ${mergedTheme.primaryColor};
--secondary-color: ${mergedTheme.secondaryColor};
--text-color: ${mergedTheme.textColor};
--background-color: ${mergedTheme.backgroundColor};
--font-family: ${mergedTheme.fontFamily};
--border-radius: ${mergedTheme.borderRadius};
font-family: var(--font-family);
color: var(--text-color);
background-color: var(--background-color);
}
.${namespace} .btn {
background-color: var(--primary-color);
color: white;
border: none;
border-radius: var(--border-radius);
padding: 8px 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.${namespace} .btn:hover {
background-color: var(--secondary-color);
}
.${namespace} .container {
border-radius: var(--border-radius);
border: 1px solid #e0e0e0;
padding: 16px;
margin: 8px 0;
}
.${namespace} .header {
font-weight: bold;
margin-bottom: 8px;
}
${Object.entries(mergedTheme.customClasses || {}).map(([className, css]) => `.${namespace} .${className} { ${css} }`).join("\n")}
`;
}
function applyTheme(theme, namespace) {
const css = generateThemeCSS(theme, namespace);
const styleId = `${namespace}-theme`;
const existingStyle = document.getElementById(styleId);
if (existingStyle) {
existingStyle.remove();
}
return addStyleToDocument(css, styleId);
}
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
function getAugmentedNamespace(n2) {
if (n2.__esModule) return n2;
var f = n2.default;
if (typeof f == "function") {
var a2 = function a3() {
if (this instanceof a3) {
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
a2.prototype = f.prototype;
} else a2 = {};
Object.defineProperty(a2, "__esModule", { value: true });
Object.keys(n2).forEach(function(k) {
var d = Object.getOwnPropertyDescriptor(n2, k);
Object.defineProperty(a2, k, d.get ? d : {
enumerable: true,
get: function() {
return n2[k];
}
});
});
return a2;
}
var eventemitter3 = { exports: {} };
(function(module) {
var has2 = Object.prototype.hasOwnProperty, prefix = "~";
function Events() {
}
if (Object.create) {
Events.prototype = /* @__PURE__ */ Object.create(null);
if (!new Events().__proto__) prefix = false;
}
function EE(fn, context, once) {
this.fn = fn;
this.context = context;
this.once = once || false;
}
function addListener(emitter, event, fn, context, once) {
if (typeof fn !== "function") {
throw new TypeError("The listener must be a function");
}
var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
else emitter._events[evt] = [emitter._events[evt], listener];
return emitter;
}
function clearEvent(emitter, evt) {
if (--emitter._eventsCount === 0) emitter._events = new Events();
else delete emitter._events[evt];
}
function EventEmitter2() {
this._events = new Events();
this._eventsCount = 0;
}
EventEmitter2.prototype.eventNames = function eventNames() {
var names2 = [], events, name2;
if (this._eventsCount === 0) return names2;
for (name2 in events = this._events) {
if (has2.call(events, name2)) names2.push(prefix ? name2.slice(1) : name2);
}
if (Object.getOwnPropertySymbols) {
return names2.concat(Object.getOwnPropertySymbols(events));
}
return names2;
};
EventEmitter2.prototype.listeners = function listeners(event) {
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
if (!handlers) return [];
if (handlers.fn) return [handlers.fn];
for (var i2 = 0, l2 = handlers.length, ee = new Array(l2); i2 < l2; i2++) {
ee[i2] = handlers[i2].fn;
}
return ee;
};
EventEmitter2.prototype.listenerCount = function listenerCount(event) {
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
if (!listeners) return 0;
if (listeners.fn) return 1;
return listeners.length;
};
EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
var evt = prefix ? prefix + event : event;
if (!this._events[evt]) return false;
var listeners = this._events[evt], len = arguments.length, args, i2;
if (listeners.fn) {
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
switch (len) {
case 1:
return listeners.fn.call(listeners.context), true;
case 2:
return listeners.fn.call(listeners.context, a1), true;
case 3:
return listeners.fn.call(listeners.context, a1, a2), true;
case 4:
return listeners.fn.call(listeners.context, a1, a2, a3), true;
case 5:
return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
case 6:
return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
}
for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
args[i2 - 1] = arguments[i2];
}
listeners.fn.apply(listeners.context, args);
} else {
var length = listeners.length, j;
for (i2 = 0; i2 < length; i2++) {
if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
switch (len) {
case 1:
listeners[i2].fn.call(listeners[i2].context);
break;
case 2:
listeners[i2].fn.call(listeners[i2].context, a1);
break;
case 3:
listeners[i2].fn.call(listeners[i2].context, a1, a2);
break;
case 4:
listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
break;
default:
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
args[j - 1] = arguments[j];
}
listeners[i2].fn.apply(listeners[i2].context, args);
}
}
}
return true;
};
EventEmitter2.prototype.on = function on2(event, fn, context) {
return addListener(this, event, fn, context, false);
};
EventEmitter2.prototype.once = function once(event, fn, context) {
return addListener(this, event, fn, context, true);
};
EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
var evt = prefix ? prefix + event : event;
if (!this._events[evt]) return this;
if (!fn) {
clearEvent(this, evt);
return this;
}
var listeners = this._events[evt];
if (listeners.fn) {
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
clearEvent(this, evt);
}
} else {
for (var i2 = 0, events = [], length = listeners.length; i2 < length; i2++) {
if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
events.push(listeners[i2]);
}
}
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
else clearEvent(this, evt);
}
return this;
};
EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
var evt;
if (event) {
evt = prefix ? prefix + event : event;
if (this._events[evt]) clearEvent(this, evt);
} else {
this._events = new Events();
this._eventsCount = 0;
}
return this;
};
EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
EventEmitter2.prefixed = prefix;
EventEmitter2.EventEmitter = EventEmitter2;
{
module.exports = EventEmitter2;
}
})(eventemitter3);
var eventemitter3Exports = eventemitter3.exports;
const EventEmitter$1 = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports);
const eventEmitter = new EventEmitter$1();
const client_socket = {
on: (event, fn) => eventEmitter.on(event, fn),
once: (event, fn) => eventEmitter.once(event, fn),
off: (event, fn) => eventEmitter.off(event, fn),
emit: (event, payload) => eventEmitter.emit(event, payload)
};
Object.freeze(client_socket);
class SimpleEventEmitter {
constructor() {
__publicField(this, "events", /* @__PURE__ */ new Map());
}
/**
* Subscribe to an event
* @param eventName Event name
* @param callback Callback function
*/
on(eventName, callback) {
client_socket.on(eventName, callback);
}
/**
* Unsubscribe from an event
* @param eventName Event name
* @param callback Callback function
*/
off(eventName, callback) {
if (!this.events.has(eventName)) {
return;
}
const callbacks = this.events.get(eventName);
const index = callbacks.indexOf(callback);
if (index !== -1) {
callbacks.splice(index, 1);
}
if (callbacks.length === 0) {
this.events.delete(eventName);
}
}
/**
* Emit an event
* @param eventName Event name
* @param data Event data
*/
emit(eventName, data) {
client_socket.emit(eventName, data);
}
}
var jsxRuntime = { exports: {} };
var reactJsxRuntime_production_min = {};
var react = { exports: {} };
var react_production_min = {};
/**
* @license React
* react.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 hasRequiredReact_production_min;
function requireReact_production_min() {
if (hasRequiredReact_production_min) return react_production_min;
hasRequiredReact_production_min = 1;
var l2 = Symbol.for("react.element"), n2 = Symbol.for("react.portal"), p2 = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), r2 = Symbol.for("react.profiler"), t2 = Symbol.for("react.provider"), u2 = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z = Symbol.iterator;
function A(a2) {
if (null === a2 || "object" !== typeof a2) return null;
a2 = z && a2[z] || a2["@@iterator"];
return "function" === typeof a2 ? a2 : null;
}
var B = { isMounted: function() {
return false;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} }, C2 = Object.assign, D = {};
function E(a2, b, e2) {
this.props = a2;
this.context = b;
this.refs = D;
this.updater = e2 || B;
}
E.prototype.isReactComponent = {};
E.prototype.setState = function(a2, b) {
if ("object" !== typeof a2 && "function" !== typeof a2 && null != a2) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
this.updater.enqueueSetState(this, a2, b, "setState");
};
E.prototype.forceUpdate = function(a2) {
this.updater.enqueueForceUpdate(this, a2, "forceUpdate");
};
function F() {
}
F.prototype = E.prototype;
function G(a2, b, e2) {
this.props = a2;
this.context = b;
this.refs = D;
this.updater = e2 || B;
}
var H = G.prototype = new F();
H.constructor = G;
C2(H, E.prototype);
H.isPureReactComponent = true;
var I = Array.isArray, J = Object.prototype.hasOwnProperty, K = { current: null }, L = { key: true, ref: true, __self: true, __source: true };
function M(a2, b, e2) {
var d, c2 = {}, k = null, h = null;
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c2[d] = b[d]);
var g = arguments.length - 2;
if (1 === g) c2.children = e2;
else if (1 < g) {
for (var f = Array(g), m2 = 0; m2 < g; m2++) f[m2] = arguments[m2 + 2];
c2.children = f;
}
if (a2 && a2.defaultProps) for (d in g = a2.defaultProps, g) void 0 === c2[d] && (c2[d] = g[d]);
return { $$typeof: l2, type: a2, key: k, ref: h, props: c2, _owner: K.current };
}
function N(a2, b) {
return { $$typeof: l2, type: a2.type, key: b, ref: a2.ref, props: a2.props, _owner: a2._owner };
}
function O(a2) {
return "object" === typeof a2 && null !== a2 && a2.$$typeof === l2;
}
function escape2(a2) {
var b = { "=": "=0", ":": "=2" };
return "$" + a2.replace(/[=:]/g, function(a3) {
return b[a3];
});
}
var P = /\/+/g;
function Q(a2, b) {
return "object" === typeof a2 && null !== a2 && null != a2.key ? escape2("" + a2.key) : b.toString(36);
}
function R(a2, b, e2, d, c2) {
var k = typeof a2;
if ("undefined" === k || "boolean" === k) a2 = null;
var h = false;
if (null === a2) h = true;
else switch (k) {
case "string":
case "number":
h = true;
break;
case "object":
switch (a2.$$typeof) {
case l2:
case n2:
h = true;
}
}
if (h) return h = a2, c2 = c2(h), a2 = "" === d ? "." + Q(h, 0) : d, I(c2) ? (e2 = "", null != a2 && (e2 = a2.replace(P, "$&/") + "/"), R(c2, b, e2, "", function(a3) {
return a3;
})) : null != c2 && (O(c2) && (c2 = N(c2, e2 + (!c2.key || h && h.key === c2.key ? "" : ("" + c2.key).replace(P, "$&/") + "/") + a2)), b.push(c2)), 1;
h = 0;
d = "" === d ? "." : d + ":";
if (I(a2)) for (var g = 0; g < a2.length; g++) {
k = a2[g];
var f = d + Q(k, g);
h += R(k, b, e2, f, c2);
}
else if (f = A(a2), "function" === typeof f) for (a2 = f.call(a2), g = 0; !(k = a2.next()).done; ) k = k.value, f = d + Q(k, g++), h += R(k, b, e2, f, c2);
else if ("object" === k) throw b = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
return h;
}
function S(a2, b, e2) {
if (null == a2) return a2;
var d = [], c2 = 0;
R(a2, d, "", "", function(a3) {
return b.call(e2, a3, c2++);
});
return d;
}
function T(a2) {
if (-1 === a2._status) {
var b = a2._result;
b = b();
b.then(function(b2) {
if (0 === a2._status || -1 === a2._status) a2._status = 1, a2._result = b2;
}, function(b2) {
if (0 === a2._status || -1 === a2._status) a2._status = 2, a2._result = b2;
});
-1 === a2._status && (a2._status = 0, a2._result = b);
}
if (1 === a2._status) return a2._result.default;
throw a2._result;
}
var U = { current: null }, V = { transition: null }, W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
function X() {
throw Error("act(...) is not supported in production builds of React.");
}
react_production_min.Children = { map: S, forEach: function(a2, b, e2) {
S(a2, function() {
b.apply(this, arguments);
}, e2);
}, count: function(a2) {
var b = 0;
S(a2, function() {
b++;
});
return b;
}, toArray: function(a2) {
return S(a2, function(a3) {
return a3;
}) || [];
}, only: function(a2) {
if (!O(a2)) throw Error("React.Children.only expected to receive a single React element child.");
return a2;
} };
react_production_min.Component = E;
react_production_min.Fragment = p2;
react_production_min.Profiler = r2;
react_production_min.PureComponent = G;
react_production_min.StrictMode = q;
react_production_min.Suspense = w;
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
react_production_min.act = X;
react_production_min.cloneElement = function(a2, b, e2) {
if (null === a2 || void 0 === a2) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a2 + ".");
var d = C2({}, a2.props), c2 = a2.key, k = a2.ref, h = a2._owner;
if (null != b) {
void 0 !== b.ref && (k = b.ref, h = K.current);
void 0 !== b.key && (c2 = "" + b.key);
if (a2.type && a2.type.defaultProps) var g = a2.type.defaultProps;
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
}
var f = arguments.length - 2;
if (1 === f) d.children = e2;
else if (1 < f) {
g = Array(f);
for (var m2 = 0; m2 < f; m2++) g[m2] = arguments[m2 + 2];
d.children = g;
}
return { $$typeof: l2, type: a2.type, key: c2, ref: k, props: d, _owner: h };
};
react_production_min.createContext = function(a2) {
a2 = { $$typeof: u2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
a2.Provider = { $$typeof: t2, _context: a2 };
return a2.Consumer = a2;
};
react_production_min.createElement = M;
react_production_min.createFactory = function(a2) {
var b = M.bind(null, a2);
b.type = a2;
return b;
};
react_production_min.createRef = function() {
return { current: null };
};
react_production_min.forwardRef = function(a2) {
return { $$typeof: v, render: a2 };
};
react_production_min.isValidElement = O;
react_production_min.lazy = function(a2) {
return { $$typeof: y, _payload: { _status: -1, _result: a2 }, _init: T };
};
react_production_min.memo = function(a2, b) {
return { $$typeof: x, type: a2, compare: void 0 === b ? null : b };
};
react_production_min.startTransition = function(a2) {
var b = V.transition;
V.transition = {};
try {
a2();
} finally {
V.transition = b;
}
};
react_production_min.unstable_act = X;
react_production_min.useCallback = function(a2, b) {
return U.current.useCallback(a2, b);
};
react_production_min.useContext = function(a2) {
return U.current.useContext(a2);
};
react_production_min.useDebugValue = function() {
};
react_production_min.useDeferredValue = function(a2) {
return U.current.useDeferredValue(a2);
};
react_production_min.useEffect = function(a2, b) {
return U.current.useEffect(a2, b);
};
react_production_min.useId = function() {
return U.current.useId();
};
react_production_min.useImperativeHandle = function(a2, b, e2) {
return U.current.useImperativeHandle(a2, b, e2);
};
react_production_min.useInsertionEffect = function(a2, b) {
return U.current.useInsertionEffect(a2, b);
};
react_production_min.useLayoutEffect = function(a2, b) {
return U.current.useLayoutEffect(a2, b);
};
react_production_min.useMemo = function(a2, b) {
return U.current.useMemo(a2, b);
};
react_production_min.useReducer = function(a2, b, e2) {
return U.current.useReducer(a2, b, e2);
};
react_production_min.useRef = function(a2) {
return U.current.useRef(a2);
};
react_production_min.useState = function(a2) {
return U.current.useState(a2);
};
react_production_min.useSyncExternalStore = function(a2, b, e2) {
return U.current.useSyncExternalStore(a2, b, e2);
};
react_production_min.useTransition = function() {
return U.current.useTransition();
};
react_production_min.version = "18.3.1";
return react_production_min;
}
var react_development = { exports: {} };
react_development.exports;
var hasRequiredReact_development;
function requireReact_development() {
if (hasRequiredReact_development) return react_development.exports;
hasRequiredReact_development = 1;
(function(module, exports) {
var define_process_env_default2 = {};
/**
* @license React
* react.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.
*/
if (define_process_env_default2.NODE_ENV !== "production") {
(function() {
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.1";
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
var REACT_MEMO_TYPE = Symbol.for("react.memo");
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = "@@iterator";
function getIteratorFn(maybeIterable) {
if (maybeIterable === null || typeof maybeIterable !== "object") {
return null;
}
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
if (typeof maybeIterator === "function") {
return maybeIterator;
}
return null;
}
var ReactCurrentDispatcher = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
var ReactCurrentBatchConfig = {
transition: null
};
var ReactCurrentActQueue = {
current: null,
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
isBatchingLegacy: false,
didScheduleLegacyUpdate: false
};
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
var ReactDebugCurrentFrame = {};
var currentExtraStackFrame = null;
function setExtraStackFrame(stack) {
{
currentExtraStackFrame = stack;
}
}
{
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
{
currentExtraStackFrame = stack;
}
};
ReactDebugCurrentFrame.getCurrentStack = null;
ReactDebugCurrentFrame.getStackAddendum = function() {
var stack = "";
if (currentExtraStackFrame) {
stack += currentExtraStackFrame;
}
var impl = ReactDebugCurrentFrame.getCurrentStack;
if (impl) {
stack += impl() || "";
}
return stack;
};
}
var enableScopeAPI = false;
var enableCacheElement = false;
var enableTransitionTracing = false;
var enableLegacyHidden = false;
var enableDebugTracing = false;
var ReactSharedInternals = {
ReactCurrentDispatcher,
ReactCurrentBatchConfig,
ReactCurrentOwner
};
{
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
}
function warn(format) {
{
{
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
printWarning("warn", format, args);
}
}
}
function error(format) {
{
{
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
printWarning("error", format, args);
}
}
}
function printWarning(level, format, args) {
{
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame2.getStackAddendum();
if (stack !== "") {
format += "%s";
args = args.concat([stack]);
}
var argsWithFormat = args.map(function(item) {
return String(item);
});
argsWithFormat.unshift("Warning: " + format);
Function.prototype.apply.call(console[level], console, argsWithFormat);
}
}
var didWarnStateUpdateForUnmountedComponent = {};
function warnNoop(publicInstance, callerName) {
{
var _constructor = publicInstance.constructor;
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
var warningKey = componentName + "." + callerName;
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
return;
}
error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
}
}
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function(publicInstance) {
return false;
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueForceUpdate: function(publicInstance, callback, callerName) {
warnNoop(publicInstance, "forceUpdate");
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
warnNoop(publicInstance, "replaceState");
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @param {?function} callback Called after component is updated.
* @param {?string} Name of the calling function in the public API.
* @internal
*/
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
warnNoop(publicInstance, "setState");
}
};
var assign = Object.assign;
var emptyObject = {};
{
Object.freeze(emptyObject);
}
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Component.prototype.setState = function(partialState, callback) {
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
}
this.updater.enqueueSetState(this, partialState, callback, "setState");
};
Component.prototype.forceUpdate = function(callback) {
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
};
{
var deprecatedAPIs = {
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
};
var defineDeprecationWarning = function(methodName, info) {
Object.defineProperty(Component.prototype, methodName, {
get: function() {
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
return void 0;
}
});
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
function ComponentDummy() {
}
ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
assign(pureComponentPrototype, Component.prototype);
pureComponentPrototype.isPureReactComponent = true;
function createRef() {
var refObject = {
current: null
};
{
Object.seal(refObject);
}
return refObject;
}
var isArrayImpl = Array.isArray;
function isArray2(a2) {
return isArrayImpl(a2);
}
function typeName(value2) {
{
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
var type = hasToStringTag && value2[Symbol.toStringTag] || value2.constructor.name || "Object";
return type;
}
}
function willCoercionThrow(value2) {
{
try {
testStringCoercion(value2);
return false;
} catch (e2) {
return true;
}
}
}
function testStringCoercion(value2) {
return "" + value2;
}
function checkKeyStringCoercion(value2) {
{
if (willCoercionThrow(value2)) {
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value2));
return testStringCoercion(value2);
}
}
}
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || "";
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
}
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromType(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
}
}
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if (typeof type === "object") {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + ".Consumer";
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + ".Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
if (outerName !== null) {
return outerName;
}
return getComponentNameFromType(type.type) || "Memo";
case REACT_LAZY_TYPE: {
var lazyComponent = type;
var payload = lazyComponent._payload;
var init = lazyComponent._init;
try {
return getComponentNameFromType(init(payload));
} catch (x) {
return null;
}
}
}
}
return null;
}
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
{
didWarnAboutStringRefs = {};
}
function hasValidRef(config) {
{
if (hasOwnProperty2.call(config, "ref")) {
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== void 0;
}
function hasValidKey(config) {
{
if (hasOwnProperty2.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== void 0;
}
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function() {
{
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
error("%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)", displayName);
}
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function() {
{
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
error("%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)", displayName);
}
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, "ref", {
get: warnAboutAccessingRef,
configurable: true
});
}
function warnIfStringRefCannotBeAutoConverted(config) {
{
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
if (!didWarnAboutStringRefs[componentName]) {
error('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', componentName, config.ref);
didWarnAboutStringRefs[componentName] = true;
}
}
}
}
var ReactElement = function(type, key, ref, self2, source, owner, props) {
var element = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type,
key,
ref,
props,
// Record the component responsible for creating this element.
_owner: owner
};
{
element._store = {};
Object.defineProperty(element._store, "validated", {
configurable: false,
enumerable: false,
writable: true,
value: false
});
Object.defineProperty(element, "_self", {
configurable: false,
enumerable: false,
writable: false,
value: self2
});
Object.defineProperty(element, "_source", {
configurable: false,
enumerable: false,
writable: false,
value: source
});
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
function createElement2(type, config, children) {
var propName;
var props = {};
var key = null;
var ref = null;
var self2 = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
{
warnIfStringRefCannotBeAutoConverted(config);
}
}
if (hasValidKey(config)) {
{
checkKeyStringCoercion(config.key);
}
key = "" + config.key;
}
self2 = config.__self === void 0 ? null : config.__self;
source = config.__source === void 0 ? null : config.__source;
for (propName in config) {
if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i2 = 0; i2 < childrenLength; i2++) {
childArray[i2] = arguments[i2 + 2];
}
{
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;
}
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
}
{
if (key || ref) {
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
if (key) {
defineKeyPropWarningGetter(props, displayName);
}
if (ref) {