UNPKG

client-chat-widget

Version:

Widget de chat embebible (React + SignalR) con theming por CSS tokens y montaje dinámico.

1,061 lines (1,059 loc) 449 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.gtc-chat-root:root,:root{--chat-primary: var(--chat-color-primary, #3b82f6);--chat-primary-hover: var(--chat-color-primary-accent, #2563eb);--chat-secondary: var(--chat-color-text-muted, #94a3b8);--chat-success: var(--chat-color-success, #16a34a);--chat-danger: var(--chat-color-danger, #f87171);--chat-warning: var(--chat-color-warning, #fbbf24);--chat-bg: var(--chat-color-bg, #ffffff);--chat-bg-light: var(--chat-color-bg-soft, #fdfefe);--chat-bg-border: var(--chat-color-border, #e5e7eb);--chat-text: var(--chat-color-text, #1e293b);--chat-text-light: var(--chat-color-text-muted, #64748b);--chat-radius: var(--chat-radius, 14px);--chat-shadow: var(--chat-shadow, 0 6px 18px rgba(0, 0, 0, .08));--chat-transition: var(--chat-transition, all .2s ease);--chat-font: var(--chat-font-family, system-ui, sans-serif)}.gtc-chat-root .chat-widget-window,.gtc-chat-root .chat-widget-window *{box-sizing:border-box;font-family:var(--chat-font);-webkit-font-smoothing:antialiased}.gtc-chat-root .chat-fab{position:fixed;bottom:24px;right:24px;width:56px;height:56px;background:var(--chat-primary);border:none;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:var(--chat-shadow);transition:var(--chat-transition);cursor:pointer;z-index:1000}.gtc-chat-root .chat-fab:hover{background:var(--chat-primary-hover);transform:translateY(-2px)}.gtc-chat-root .chat-fab .unread-badge{position:absolute;top:-6px;right:-6px;background:var(--chat-danger);color:#fff;border-radius:12px;min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:600;border:2px solid white}.gtc-chat-root .chat-widget-window{position:fixed;bottom:90px;right:20px;width:360px;height:500px;background:var(--chat-bg);-webkit-backdrop-filter:saturate(140%) blur(6px);backdrop-filter:saturate(140%) blur(6px);border-radius:var(--chat-radius);box-shadow:var(--chat-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:999;animation:slideUp .3s ease;border:1px solid var(--chat-bg-border)}.gtc-chat-root .chat-widget-window.minimized{height:60px}.gtc-chat-root .chat-widget-window.maximized{width:400px;height:600px}.gtc-chat-root .chat-header{background:linear-gradient(135deg,var(--chat-primary),var(--chat-primary-hover));color:#fff;padding:16px;display:flex;align-items:center;justify-content:space-between;border-radius:var(--chat-radius) var(--chat-radius) 0 0}.gtc-chat-root .chat-header-info{flex:1;min-width:0}.gtc-chat-root .chat-title{font-weight:600;font-size:1rem;margin:0 0 2px;line-height:1.3}.gtc-chat-root .chat-status{display:flex;align-items:center;gap:8px;font-size:.875rem;opacity:.9}.gtc-chat-root .status-indicator{width:8px;height:8px;background:var(--chat-success);border-radius:50%;animation:pulse 2s infinite}.gtc-chat-root .status-indicator.offline{background:var(--chat-secondary);animation:none}.gtc-chat-root .chat-header-actions{display:flex;gap:4px}.gtc-chat-root .header-btn,.gtc-chat-root .close-btn{background:#ffffff1a;border:none;color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .header-btn:hover,.gtc-chat-root .close-btn:hover{background:#fff3}.gtc-chat-root .close-btn:hover{background:var(--chat-danger)}.gtc-chat-root .chat-messages{flex:1;padding:16px;background:var(--chat-bg-light);overflow-y:auto;scroll-behavior:smooth}.gtc-chat-root .chat-messages::-webkit-scrollbar{width:6px}.gtc-chat-root .chat-messages::-webkit-scrollbar-thumb{background:var(--chat-secondary);border-radius:3px}.gtc-chat-root .empty-chat{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--chat-text-light);text-align:center;padding:24px}.gtc-chat-root .message-bubble{margin-bottom:16px;animation:fadeIn .3s ease}.gtc-chat-root .message-bubble.client{display:flex;flex-direction:column;align-items:flex-end}.gtc-chat-root .message-bubble.agent,.gtc-chat-root .message-bubble.system{display:flex;flex-direction:column;align-items:flex-start}.gtc-chat-root .message-content{max-width:80%;padding:12px 16px;border-radius:18px;word-wrap:break-word;line-height:1.4;box-shadow:var(--chat-shadow)}.gtc-chat-root .message-bubble.client .message-content{background:var(--chat-primary);color:#fff;border-bottom-right-radius:4px}.gtc-chat-root .message-bubble.agent .message-content{background:#fff;color:var(--chat-text);border:1px solid var(--chat-bg-border);border-bottom-left-radius:4px}.gtc-chat-root .message-bubble.system .message-content{background:var(--chat-warning);color:var(--chat-text);border-radius:8px;font-size:.875rem;max-width:100%;text-align:center;font-style:italic}.gtc-chat-root .message-time{font-size:.75rem;color:var(--chat-text-light);margin-top:4px;opacity:.8}.gtc-chat-root .chat-input{padding:16px;background:#fff;border-top:1px solid var(--chat-bg-light);border-radius:0 0 var(--chat-radius) var(--chat-radius)}.gtc-chat-root .chat-input-area{display:flex;align-items:flex-end;gap:8px;background:var(--chat-bg-light);border-radius:var(--chat-radius);padding:8px 12px;border:2px solid transparent;transition:var(--chat-transition);min-height:48px}.gtc-chat-root .chat-input-area:focus-within{border-color:var(--chat-primary);background:#fff}.gtc-chat-root .emoji-picker-wrapper{position:absolute;bottom:64px;right:8px;z-index:1200;animation:fadeIn .18s ease}.gtc-chat-root .emoji-picker-container{box-shadow:var(--chat-shadow);border:1px solid var(--chat-bg-border);border-radius:12px;overflow:hidden;-webkit-backdrop-filter:blur(6px) saturate(140%);backdrop-filter:blur(6px) saturate(140%)}.gtc-chat-root .emoji-btn:focus-visible,.gtc-chat-root .file-upload-btn:focus-visible,.gtc-chat-root .send-btn:focus-visible{box-shadow:var(--chat-focus-ring, 0 0 0 3px rgba(59,130,246,.45));outline:none}.gtc-chat-root .chat-input-area.disabled{background:var(--chat-bg-border);opacity:.7;flex-direction:column;padding:20px;text-align:center;gap:12px}.gtc-chat-root .message-input{flex:1;border:none;outline:none;background:transparent;font-size:.875rem;color:var(--chat-text);padding:8px 0;resize:none;max-height:120px;min-height:20px;line-height:1.4}.gtc-chat-root .message-input::placeholder{color:var(--chat-text-light)}.gtc-chat-root .chat-input-actions{display:flex;align-items:flex-end;gap:4px}.gtc-chat-root .input-btn,.gtc-chat-root .file-upload-btn{border:none;background:transparent;color:var(--chat-text-light);cursor:pointer;transition:var(--chat-transition);display:flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;width:36px;height:36px}.gtc-chat-root .input-btn:hover,.gtc-chat-root .file-upload-btn:hover{background:#0000000d;color:var(--chat-primary)}.gtc-chat-root .send-btn{background:var(--chat-primary);color:#fff;margin-left:4px}.gtc-chat-root .send-btn:hover:not(:disabled){background:var(--chat-primary-hover)}.gtc-chat-root .send-btn:disabled{background:var(--chat-secondary);cursor:not-allowed;opacity:.6}.gtc-chat-root input[type=file]{display:none}.gtc-chat-root .message-attachments{margin-top:8px}.gtc-chat-root .attachment{margin-bottom:8px;border-radius:8px;overflow:hidden}.gtc-chat-root .attachment-image{max-width:200px;max-height:150px;border-radius:8px;cursor:pointer;transition:var(--chat-transition);border:1px solid var(--chat-bg-border);object-fit:cover}.gtc-chat-root .attachment-image:hover{transform:scale(1.02)}.gtc-chat-root .attachment-file{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#ffffff80;border-radius:8px;border:1px solid var(--chat-bg-border);cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .attachment-file:hover{background:#fffc}.gtc-chat-root .file-name{font-size:.875rem;color:var(--chat-text);font-weight:500}.gtc-chat-root .file-size{font-size:.75rem;color:var(--chat-text-light);margin-left:auto}.gtc-chat-root .file-preview{position:relative;margin-bottom:8px;border-radius:8px;overflow:hidden;border:1px solid var(--chat-bg-light);background:#fff}.gtc-chat-root .file-preview img{width:100%;max-height:120px;object-fit:cover}.gtc-chat-root .file-info{display:flex;align-items:center;gap:8px;padding:12px;background:var(--chat-bg-light)}.gtc-chat-root .file-info-text{flex:1;min-width:0}.gtc-chat-root .file-info-name{font-size:.875rem;font-weight:500;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gtc-chat-root .file-info-size{font-size:.75rem;color:var(--chat-text-light)}.gtc-chat-root .cancel-btn{position:absolute;top:8px;right:8px;background:#0009;color:#fff;border:none;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .cancel-btn:hover{background:#000c}.gtc-chat-root .chat-closed-notice{color:var(--chat-text-light);font-size:.875rem;display:flex;align-items:center;gap:8px;margin-bottom:12px;font-style:italic}.gtc-chat-root .start-new-chat-btn{background:var(--chat-primary);color:#fff;border:none;padding:12px 24px;border-radius:20px;font-size:.875rem;font-weight:500;cursor:pointer;transition:var(--chat-transition);display:flex;align-items:center;gap:8px;box-shadow:var(--chat-shadow)}.gtc-chat-root .start-new-chat-btn:hover{background:var(--chat-primary-hover)}.gtc-chat-root .image-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:1001;animation:fadeIn .3s ease;padding:20px}.gtc-chat-root .image-modal-content{position:relative;max-width:90%;max-height:90%;display:flex;flex-direction:column;align-items:center}.gtc-chat-root .image-modal img{max-width:100%;max-height:80vh;border-radius:var(--chat-radius);box-shadow:0 20px 40px #00000080;object-fit:contain}.gtc-chat-root .image-modal-controls{position:absolute;top:20px;right:20px}.gtc-chat-root .image-modal-close{background:#000000b3;border:none;color:#fff;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .image-modal-close:hover{background:var(--chat-danger)}.gtc-chat-root .image-modal-info{margin-top:16px;padding:12px 20px;background:#000000b3;border-radius:var(--chat-radius);color:#fff;font-size:.875rem;text-align:center}.gtc-chat-root .typing-indicator{display:flex;align-items:center;gap:4px;padding:12px 16px;background:#fff;border-radius:18px 18px 18px 4px;margin-bottom:16px;border:1px solid var(--chat-bg-border)}.gtc-chat-root .typing-dot{width:6px;height:6px;background:var(--chat-secondary);border-radius:50%;animation:typing 1.4s infinite ease-in-out}.gtc-chat-root .typing-dot:nth-child(2){animation-delay:.2s}.gtc-chat-root .typing-dot:nth-child(3){animation-delay:.4s}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.05);opacity:.8}}@keyframes typing{0%,60%,to{opacity:.3}30%{opacity:1}}@media (max-width: 480px){.gtc-chat-root .chat-widget-window{width:calc(100vw - 40px);height:calc(100vh - 120px);bottom:10px;right:20px;left:20px}.gtc-chat-root .chat-fab{bottom:16px;right:16px;width:52px;height:52px}.gtc-chat-root .message-content{max-width:90%}.gtc-chat-root .image-modal{padding:16px}.gtc-chat-root .image-modal-close{width:36px;height:36px}}.gtc-chat-root .chat-fab:focus-visible,.gtc-chat-root .input-btn:focus-visible,.gtc-chat-root .file-upload-btn:focus-visible,.gtc-chat-root .send-btn:focus-visible,.gtc-chat-root .close-btn:focus-visible,.gtc-chat-root .header-btn:focus-visible,.gtc-chat-root .start-new-chat-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--chat-primary) 60%,white);outline-offset:2px}@media (prefers-color-scheme: dark){:root{--chat-bg: #1f2937;--chat-bg-light: #273548;--chat-bg-border: #334155;--chat-text: #f1f5f9;--chat-text-light: #94a3b8;--chat-shadow: 0 4px 12px rgba(0,0,0,.6)}.chat-widget-window,.chat-input{background:var(--chat-bg)}.chat-input-area{background:var(--chat-bg-light)}.message-bubble.agent .message-content{background:var(--chat-bg);border-color:var(--chat-bg-border)}.message-bubble.system .message-content{background:var(--chat-warning)}.attachment-file{background:var(--chat-bg-light)}.attachment-file:hover,.file-preview{background:var(--chat-bg)}.file-info{background:var(--chat-bg-light)}}:root{--chat-color-primary: #3b82f6;--chat-color-primary-accent: #2563eb;--chat-color-bg: #ffffff;--chat-color-bg-soft: #f5f7fa;--chat-color-border: #e2e8f0;--chat-color-text: #1e293b;--chat-color-text-muted: #64748b;--chat-color-danger: #ef4444;--chat-color-warning: #fbbf24;--chat-color-success: #16a34a;--chat-shadow-sm: 0 2px 4px -1px rgba(0,0,0,.06), 0 1px 3px -1px rgba(0,0,0,.1);--chat-shadow: 0 6px 18px rgba(0,0,0,.08);--chat-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;--chat-font-size-xs: .6875rem;--chat-font-size-sm: .75rem;--chat-font-size: .875rem;--chat-font-size-md: .9375rem;--chat-font-size-lg: 1rem;--chat-space-1: 2px;--chat-space-2: 4px;--chat-space-3: 6px;--chat-space-4: 8px;--chat-space-5: 10px;--chat-space-6: 12px;--chat-space-8: 16px;--chat-space-10: 20px;--chat-space-12: 24px;--chat-radius-sm: 4px;--chat-radius: 14px;--chat-transition: .2s cubic-bezier(.4,0,.2,1);--chat-focus-ring: 0 0 0 3px color-mix(in srgb, var(--chat-color-primary) 55%, white)}.gtc-chat-root[data-theme=dark]{--chat-color-bg: #1f2937;--chat-color-bg-soft: #273548;--chat-color-border: #334155;--chat-color-text: #f1f5f9;--chat-color-text-muted: #94a3b8;--chat-shadow: 0 4px 12px rgba(0,0,0,.6)}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); import If, { useRef as V, useEffect as B, createElement as g, memo as vn, createContext as ja, useState as R, createRef as xf, useContext as cf, Fragment as ma, useCallback as Nf, useMemo as Yf, Suspense as t1, Component as o1 } from "react"; import * as u1 from "@microsoft/signalr"; import d1 from "react-dom"; var xe = { exports: {} }, ue = {}; /** * @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 $a; function c1() { if ($a) return ue; $a = 1; var f = If, e = Symbol.for("react.element"), a = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 }; function o(u, d, s) { var c, w = {}, L = null, j = null; s !== void 0 && (L = "" + s), d.key !== void 0 && (L = "" + d.key), d.ref !== void 0 && (j = d.ref); for (c in d) n.call(d, c) && !r.hasOwnProperty(c) && (w[c] = d[c]); if (u && u.defaultProps) for (c in d = u.defaultProps, d) w[c] === void 0 && (w[c] = d[c]); return { $$typeof: e, type: u, key: L, ref: j, props: w, _owner: i.current }; } return ue.Fragment = a, ue.jsx = o, ue.jsxs = o, ue; } var de = {}; /** * @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 qa; function s1() { return qa || (qa = 1, process.env.NODE_ENV !== "production" && (function() { var f = If, e = Symbol.for("react.element"), a = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), u = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), I = Symbol.iterator, T = "@@iterator"; function Q(t) { if (t === null || typeof t != "object") return null; var M = I && t[I] || t[T]; return typeof M == "function" ? M : null; } var Y = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function C(t) { { for (var M = arguments.length, b = new Array(M > 1 ? M - 1 : 0), m = 1; m < M; m++) b[m - 1] = arguments[m]; K("error", t, b); } } function K(t, M, b) { { var m = Y.ReactDebugCurrentFrame, z = m.getStackAddendum(); z !== "" && (M += "%s", b = b.concat([z])); var P = b.map(function(S) { return String(S); }); P.unshift("Warning: " + M), Function.prototype.apply.call(console[t], console, P); } } var ff = !1, ef = !1, af = !1, Rf = !1, Zf = !1, bf; bf = Symbol.for("react.module.reference"); function Hf(t) { return !!(typeof t == "string" || typeof t == "function" || t === n || t === r || Zf || t === i || t === s || t === c || Rf || t === j || ff || ef || af || typeof t == "object" && t !== null && (t.$$typeof === L || t.$$typeof === w || t.$$typeof === o || t.$$typeof === u || t.$$typeof === d || // 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. t.$$typeof === bf || t.getModuleId !== void 0)); } function aa(t, M, b) { var m = t.displayName; if (m) return m; var z = M.displayName || M.name || ""; return z !== "" ? b + "(" + z + ")" : b; } function Tf(t) { return t.displayName || "Context"; } function kf(t) { if (t == null) return null; if (typeof t.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function") return t.displayName || t.name || null; if (typeof t == "string") return t; switch (t) { case n: return "Fragment"; case a: return "Portal"; case r: return "Profiler"; case i: return "StrictMode"; case s: return "Suspense"; case c: return "SuspenseList"; } if (typeof t == "object") switch (t.$$typeof) { case u: var M = t; return Tf(M) + ".Consumer"; case o: var b = t; return Tf(b._context) + ".Provider"; case d: return aa(t, t.render, "ForwardRef"); case w: var m = t.displayName || null; return m !== null ? m : kf(t.type) || "Memo"; case L: { var z = t, P = z._payload, S = z._init; try { return kf(S(P)); } catch { return null; } } } return null; } var jf = Object.assign, U = 0, Ne, Wf, ke, te, Se, De, Te; function E() { } E.__reactDisabledLog = !0; function N() { { if (U === 0) { Ne = console.log, Wf = console.info, ke = console.warn, te = console.error, Se = console.group, De = console.groupCollapsed, Te = console.groupEnd; var t = { configurable: !0, enumerable: !0, value: E, writable: !0 }; Object.defineProperties(console, { info: t, log: t, warn: t, error: t, group: t, groupCollapsed: t, groupEnd: t }); } U++; } } function D() { { if (U--, U === 0) { var t = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: jf({}, t, { value: Ne }), info: jf({}, t, { value: Wf }), warn: jf({}, t, { value: ke }), error: jf({}, t, { value: te }), group: jf({}, t, { value: Se }), groupCollapsed: jf({}, t, { value: De }), groupEnd: jf({}, t, { value: Te }) }); } U < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var x = Y.ReactCurrentDispatcher, k; function F(t, M, b) { { if (k === void 0) try { throw Error(); } catch (z) { var m = z.stack.trim().match(/\n( *(at )?)/); k = m && m[1] || ""; } return ` ` + k + t; } } var of = !1, X; { var mf = typeof WeakMap == "function" ? WeakMap : Map; X = new mf(); } function A(t, M) { if (!t || of) return ""; { var b = X.get(t); if (b !== void 0) return b; } var m; of = !0; var z = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var P; P = x.current, x.current = null, N(); try { if (M) { 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 (Df) { m = Df; } Reflect.construct(t, [], S); } else { try { S.call(); } catch (Df) { m = Df; } t.call(S.prototype); } } else { try { throw Error(); } catch (Df) { m = Df; } t(); } } catch (Df) { if (Df && m && typeof Df.stack == "string") { for (var p = Df.stack.split(` `), rf = m.stack.split(` `), Z = p.length - 1, H = rf.length - 1; Z >= 1 && H >= 0 && p[Z] !== rf[H]; ) H--; for (; Z >= 1 && H >= 0; Z--, H--) if (p[Z] !== rf[H]) { if (Z !== 1 || H !== 1) do if (Z--, H--, H < 0 || p[Z] !== rf[H]) { var lf = ` ` + p[Z].replace(" at new ", " at "); return t.displayName && lf.includes("<anonymous>") && (lf = lf.replace("<anonymous>", t.displayName)), typeof t == "function" && X.set(t, lf), lf; } while (Z >= 1 && H >= 0); break; } } } finally { of = !1, x.current = P, D(), Error.prepareStackTrace = z; } var Vf = t ? t.displayName || t.name : "", Xa = Vf ? F(Vf) : ""; return typeof t == "function" && X.set(t, Xa), Xa; } function hf(t, M, b) { return A(t, !1); } function pf(t) { var M = t.prototype; return !!(M && M.isReactComponent); } function _(t, M, b) { if (t == null) return ""; if (typeof t == "function") return A(t, pf(t)); if (typeof t == "string") return F(t); switch (t) { case s: return F("Suspense"); case c: return F("SuspenseList"); } if (typeof t == "object") switch (t.$$typeof) { case d: return hf(t.render); case w: return _(t.type, M, b); case L: { var m = t, z = m._payload, P = m._init; try { return _(P(z), M, b); } catch { } } } return ""; } var uf = Object.prototype.hasOwnProperty, nf = {}, $ = Y.ReactDebugCurrentFrame; function Sf(t) { if (t) { var M = t._owner, b = _(t.type, t._source, M ? M.type : null); $.setExtraStackFrame(b); } else $.setExtraStackFrame(null); } function Ff(t, M, b, m, z) { { var P = Function.call.bind(uf); for (var S in t) if (P(t, S)) { var p = void 0; try { if (typeof t[S] != "function") { var rf = Error((m || "React class") + ": " + b + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw rf.name = "Invariant Violation", rf; } p = t[S](M, S, m, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (Z) { p = Z; } p && !(p instanceof Error) && (Sf(z), 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).", m || "React class", b, S, typeof p), Sf(null)), p instanceof Error && !(p.message in nf) && (nf[p.message] = !0, Sf(z), C("Failed %s type: %s", b, p.message), Sf(null)); } } } var oe = Array.isArray; function Qf(t) { return oe(t); } function B0(t) { { var M = typeof Symbol == "function" && Symbol.toStringTag, b = M && t[Symbol.toStringTag] || t.constructor.name || "Object"; return b; } } function G0(t) { try { return Oa(t), !1; } catch { return !0; } } function Oa(t) { return "" + t; } function Ua(t) { if (G0(t)) return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", B0(t)), Oa(t); } var Ba = Y.ReactCurrentOwner, Z0 = { key: !0, ref: !0, __self: !0, __source: !0 }, Ga, Za; function H0(t) { if (uf.call(t, "ref")) { var M = Object.getOwnPropertyDescriptor(t, "ref").get; if (M && M.isReactWarning) return !1; } return t.ref !== void 0; } function W0(t) { if (uf.call(t, "key")) { var M = Object.getOwnPropertyDescriptor(t, "key").get; if (M && M.isReactWarning) return !1; } return t.key !== void 0; } function F0(t, M) { typeof t.ref == "string" && Ba.current; } function _0(t, M) { { var b = function() { Ga || (Ga = !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)", M)); }; b.isReactWarning = !0, Object.defineProperty(t, "key", { get: b, configurable: !0 }); } } function V0(t, M) { { var b = function() { Za || (Za = !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)", M)); }; b.isReactWarning = !0, Object.defineProperty(t, "ref", { get: b, configurable: !0 }); } } var K0 = function(t, M, b, m, z, P, S) { var p = { // This tag allows us to uniquely identify this as a React Element $$typeof: e, // Built-in properties that belong on the element type: t, key: M, ref: b, props: S, // Record the component responsible for creating this element. _owner: P }; return p._store = {}, Object.defineProperty(p._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(p, "_self", { configurable: !1, enumerable: !1, writable: !1, value: m }), Object.defineProperty(p, "_source", { configurable: !1, enumerable: !1, writable: !1, value: z }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p; }; function X0(t, M, b, m, z) { { var P, S = {}, p = null, rf = null; b !== void 0 && (Ua(b), p = "" + b), W0(M) && (Ua(M.key), p = "" + M.key), H0(M) && (rf = M.ref, F0(M, z)); for (P in M) uf.call(M, P) && !Z0.hasOwnProperty(P) && (S[P] = M[P]); if (t && t.defaultProps) { var Z = t.defaultProps; for (P in Z) S[P] === void 0 && (S[P] = Z[P]); } if (p || rf) { var H = typeof t == "function" ? t.displayName || t.name || "Unknown" : t; p && _0(S, H), rf && V0(S, H); } return K0(t, p, rf, z, m, Ba.current, S); } } var na = Y.ReactCurrentOwner, Ha = Y.ReactDebugCurrentFrame; function _f(t) { if (t) { var M = t._owner, b = _(t.type, t._source, M ? M.type : null); Ha.setExtraStackFrame(b); } else Ha.setExtraStackFrame(null); } var ia; ia = !1; function ra(t) { return typeof t == "object" && t !== null && t.$$typeof === e; } function Wa() { { if (na.current) { var t = kf(na.current.type); if (t) return ` Check the render method of \`` + t + "`."; } return ""; } } function $0(t) { return ""; } var Fa = {}; function q0(t) { { var M = Wa(); if (!M) { var b = typeof t == "string" ? t : t.displayName || t.name; b && (M = ` Check the top-level render call using <` + b + ">."); } return M; } } function _a(t, M) { { if (!t._store || t._store.validated || t.key != null) return; t._store.validated = !0; var b = q0(M); if (Fa[b]) return; Fa[b] = !0; var m = ""; t && t._owner && t._owner !== na.current && (m = " It was passed a child from " + kf(t._owner.type) + "."), _f(t), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, m), _f(null); } } function Va(t, M) { { if (typeof t != "object") return; if (Qf(t)) for (var b = 0; b < t.length; b++) { var m = t[b]; ra(m) && _a(m, M); } else if (ra(t)) t._store && (t._store.validated = !0); else if (t) { var z = Q(t); if (typeof z == "function" && z !== t.entries) for (var P = z.call(t), S; !(S = P.next()).done; ) ra(S.value) && _a(S.value, M); } } } function f1(t) { { var M = t.type; if (M == null || typeof M == "string") return; var b; if (typeof M == "function") b = M.propTypes; else if (typeof M == "object" && (M.$$typeof === d || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. M.$$typeof === w)) b = M.propTypes; else return; if (b) { var m = kf(M); Ff(b, t.props, "prop", m, t); } else if (M.PropTypes !== void 0 && !ia) { ia = !0; var z = kf(M); C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", z || "Unknown"); } typeof M.getDefaultProps == "function" && !M.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function e1(t) { { for (var M = Object.keys(t.props), b = 0; b < M.length; b++) { var m = M[b]; if (m !== "children" && m !== "key") { _f(t), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), _f(null); break; } } t.ref !== null && (_f(t), C("Invalid attribute `ref` supplied to `React.Fragment`."), _f(null)); } } function Ka(t, M, b, m, z, P) { { var S = Hf(t); if (!S) { var p = ""; (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (p += " 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 rf = $0(); rf ? p += rf : p += Wa(); var Z; t === null ? Z = "null" : Qf(t) ? Z = "array" : t !== void 0 && t.$$typeof === e ? (Z = "<" + (kf(t.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof t, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, p); } var H = X0(t, M, b, z, P); if (H == null) return H; if (S) { var lf = M.children; if (lf !== void 0) if (m) if (Qf(lf)) { for (var Vf = 0; Vf < lf.length; Vf++) Va(lf[Vf], t); Object.freeze && Object.freeze(lf); } else 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."); else Va(lf, t); } return t === n ? e1(H) : f1(H), H; } } function a1(t, M, b) { return Ka(t, M, b, !0); } function n1(t, M, b) { return Ka(t, M, b, !1); } var i1 = n1, r1 = a1; de.Fragment = n, de.jsx = i1, de.jsxs = r1; })()), de; } var fn; function l1() { return fn || (fn = 1, process.env.NODE_ENV === "production" ? xe.exports = c1() : xe.exports = s1()), xe.exports; } var l = l1(); const ta = {}, Pe = (f) => f ? f.replace(/\/$/, "") : typeof window < "u" && window.CHAT_API_BASE ? window.CHAT_API_BASE.replace(/\/$/, "") : typeof import.meta < "u" && (ta != null && ta.VITE_CHAT_API_BASE) ? (void 0).replace(/\/$/, "") : "https://borrador-n453.onrender.com/api", g1 = async (f, e, a, n) => { const i = Pe(n); try { const r = await fetch(`${i}/chat/start`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ clientId: f, systemCode: e, clientName: a ?? "" }) }); if (!r.ok) { const u = await r.text(); return { status: r.status, error: u || `HTTP ${r.status}` }; } const o = await r.json(); return { status: 200, id: String(o.id) }; } catch (r) { return { status: 0, error: (r == null ? void 0 : r.message) || "Network error" }; } }; let vf = null; function M1() { var f, e; return typeof window < "u" && window.CHAT_API_BASE || ((e = (f = import.meta) == null ? void 0 : f.env) == null ? void 0 : e.VITE_CHAT_API_BASE) || "https://borrador-n453.onrender.com/api"; } function w1() { var n, i; const f = typeof window < "u" && window.CHAT_SIGNALR_BASE || ((i = (n = import.meta) == null ? void 0 : n.env) == null ? void 0 : i.VITE_CHAT_SIGNALR_BASE), e = M1(); return (f || e.replace(/\/api$/, "")).replace(/\/$/, ""); } function L1(f) { return `${w1()}/hubs/chat?chatSessionId=${encodeURIComponent(f)}`; } const b1 = async (f, e, a = null) => { if (vf) return; const n = L1(f); console.log("[signalr] Conectando a", n), vf = new u1.HubConnectionBuilder().withUrl(n).withAutomaticReconnect().build(), vf.on("ReceiveMessage", (i, r, o, u, d) => { console.log("📩 Mensaje recibido:", { sessionId: i, sender: r, content: o, timestamp: u, attachments: d }), e(i, r, o, u, d); }), vf.on("ChatClosed", (i, r, o) => { console.log("🔒 Chat cerrado por soporte:", { sessionId: i, message: r, timestamp: o }), a && a(i, r, o); }); try { await vf.start(), console.log("[signalr] Conectado"); } catch (i) { console.error("[signalr] Error iniciando conexión", i); try { await vf.stop(); } catch { } throw vf = null, i; } }, j1 = async () => { if (vf) { try { await vf.stop(); } catch (f) { console.warn("[signalr] Error al detener", f); } vf = null; } }, m1 = ({ onClick: f, isOpen: e, unreadCount: a = 0, isLoading: n = !1, showTooltip: i = !0, isPulsing: r = !0 }) => e ? null : /* @__PURE__ */ l.jsxs( "button", { className: `chat-fab ${a > 0 ? "has-notification" : ""} ${r ? "pulse" : ""} ${n ? "loading" : ""}`, onClick: f, "aria-label": "Abrir chat en vivo", title: "Chat en Vivo", disabled: n, children: [ i && /* @__PURE__ */ l.jsx("span", { className: "chat-fab-tooltip" }), a > 0 && /* @__PURE__ */ l.jsx("span", { className: "unread-badge", children: a > 99 ? "99+" : a }), /* @__PURE__ */ l.jsx("div", { className: "chat-fab-icon", children: /* @__PURE__ */ l.jsxs( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /* @__PURE__ */ l.jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }), /* @__PURE__ */ l.jsx("circle", { cx: "9", cy: "10", r: "0.5", fill: "currentColor", children: /* @__PURE__ */ l.jsx("animate", { attributeName: "opacity", values: "0.5;1;0.5", dur: "1.5s", repeatCount: "indefinite", begin: "0s" }) }), /* @__PURE__ */ l.jsx("circle", { cx: "12", cy: "10", r: "0.5", fill: "currentColor", children: /* @__PURE__ */ l.jsx("animate", { attributeName: "opacity", values: "0.5;1;0.5", dur: "1.5s", repeatCount: "indefinite", begin: "0.3s" }) }), /* @__PURE__ */ l.jsx("circle", { cx: "15", cy: "10", r: "0.5", fill: "currentColor", children: /* @__PURE__ */ l.jsx("animate", { attributeName: "opacity", values: "0.5;1;0.5", dur: "1.5s", repeatCount: "indefinite", begin: "0.6s" }) }) ] } ) }) ] } ), C1 = ({ onClose: f, title: e = "Soporte Técnico", status: a = "En línea" }) => /* @__PURE__ */ l.jsxs("div", { className: "chat-header", children: [ /* @__PURE__ */ l.jsxs("div", { className: "chat-header-info", children: [ /* @__PURE__ */ l.jsx("span", { className: "chat-title", children: e }), /* @__PURE__ */ l.jsxs("span", { className: "chat-status", children: [ /* @__PURE__ */ l.jsx("span", { className: "status-indicator" }), a ] }) ] }), /* @__PURE__ */ l.jsx( "button", { className: "close-btn", onClick: f, "aria-label": "Cerrar chat", type: "button", children: /* @__PURE__ */ l.jsxs( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /* @__PURE__ */ l.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ l.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] } ) } ) ] }), y1 = ({ message: f, onImageClick: e, formatDateTime: a }) => { var r; const n = f.sender === "client", i = f.sender === "system"; return console.log("🟡 MessageBubble renderizando:", { sender: f.sender, content: f.content, attachments: f.attachments, attachmentsLength: ((r = f.attachments) == null ? void 0 : r.length) || 0 }), /* @__PURE__ */ l.jsxs("div", { className: `message-bubble ${n ? "client" : i ? "system" : "agent"}`, children: [ /* @__PURE__ */ l.jsxs("div", { className: "message-content", children: [ f.content && /* @__PURE__ */ l.jsx("p", { children: f.content }), f.attachments && f.attachments.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "message-attachments", children: f.attachments.map((o, u) => (console.log("🖼️ Procesando attachment en MessageBubble:", { fileName: o.fileName, fileType: o.fileType, filePath: o.filePath, isImage: o.fileType && o.fileType.startsWith("image/") }), /* @__PURE__ */ l.jsx("div", { className: "attachment", children: o.fileType && o.fileType.startsWith("image/") ? /* @__PURE__ */ l.jsx( "img", { src: o.filePath, alt: o.fileName, className: "attachment-image", onClick: () => e(o.filePath), onLoad: () => console.log("✅ Imagen cargada:", o.filePath), onError: () => console.log("❌ Error cargando imagen:", o.filePath) } ) : /* @__PURE__ */ l.jsxs("div", { className: "attachment-file", children: [ /* @__PURE__ */ l.jsx("span", { className: "file-icon", children: "📄" }), /* @__PURE__ */ l.jsx("span", { className: "file-name", children: o.fileName }) ] }) }, u))) }) ] }), /* @__PURE__ */ l.jsx("div", { className: "message-time", children: a(f.sentAt) }) ] }); }, h1 = ({ messages: f, onImageClick: e, formatDateTime: a }) => { const n = V(null); return B(() => { var i; (i = n.current) == null || i.scrollIntoView({ behavior: "smooth" }); }, [f]), /* @__PURE__ */ l.jsxs("div", { className: "chat-messages", "aria-live": "polite", "aria-relevant": "additions text", children: [ f.length === 0 && /* @__PURE__ */ l.jsxs("div", { className: "empty-chat", children: [ /* @__PURE__ */ l.jsx( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ l.jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) } ), /* @__PURE__ */ l.jsx("p", { children: "Envía tu primer mensaje" }) ] }), f.map((i, r) => /* @__PURE__ */ l.jsx( y1, { message: i, onImageClick: e, formatDateTime: a }, `${i.id}-${r}` )), /* @__PURE__ */ l.jsx("div", { ref: n }) ] }); }, p1 = ({ selectedFile: f, previewUrl: e, onCancel: a }) => f ? /* @__PURE__ */ l.jsxs("div", { className: "file-preview", children: [ e ? /* @__PURE__ */ l.jsx("img", { src: e, alt: "Previsualización" }) : /* @__PURE__ */ l.jsxs("div", { className: "file-info", children: [ /* @__PURE__ */ l.jsxs( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /* @__PURE__ */ l.jsx("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }), /* @__PURE__ */ l.jsx("polyline", { points: "13 2 13 9 20 9" }) ] } ), /* @__PURE__ */ l.jsx("span", { children: f.name }) ] }), /* @__PURE__ */ l.jsx( "button", { className: "cancel-btn", onClick: a, "aria-label": "Cancelar archivo", type: "button", children: /* @__PURE__ */ l.jsxs( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /* @__PURE__ */ l.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ l.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] } ) } ) ] }) : null; function la(f) { return [].concat(f); } function Ca(f) { return f.startsWith(":"); } function In(f) { return Ze(f) && (f === "*" || f.length > 1 && ":>~.+*".includes(f.slice(0, 1)) || Dn(f)); } function Nn(f, e) { return (Ze(e) || typeof e == "number") && !Sn(f) && !Ca(f) && !kn(f); } function kn(f) { return f.startsWith("@media"); } function v1(f) { return f === "."; } function Sn(f) { return f === "--"; } function Ze(f) { return f + "" === f; } function Dn(f) { return Ze(f) && (f.startsWith("&") || Ca(f)); } function Je(f, e = "") { return f.filter(Boolean).join(e); } function Tn(f, e) { let a = 0; if (e.length === 0) return a.toString(); for (let n = 0; n < e.length; n++) { const i = e.charCodeAt(n); a = (a << 5) - a + i, a = a & a; } return `${f ?? "cl"}_${a.toString(36)}`; } function I1(f, e) { return f === "content" ? `"${e}"` : e; } function N1(f) { return f.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); } function en(f, e) { return `${f}:${e}`; } function k1(f) { return f ? `.${f}` : ""; } function S1(f, e) { return f ? `${f} ${e}` : e; } var xn = class zn { constructor(e, a, n, i) { this.sheet = e, this.property = a, this.value = n, this.selector = i, this.property = a, this.value = n, this.joined = en(a, n); const r = this.selector.preconditions.concat( this.selector.postconditions ); this.hash = this.selector.hasConditions ? this.selector.scopeClassName : Tn(this.sheet.name, this.joined), this.key = Je([this.joined, r, this.hash]); } toString() { let e = ga(this.selector.preconditions, { right: this.hash }); return e = ga(this.selector.postconditions, { left: e }), `${e} {${zn.genRule(this.property, this.value)}}`; } static genRule(e, a) { const n = N1(e); return en( n, I1(e, a) ) + ";"; } }; function ga(f, { left: e = "", right: a = "" } = {}) { const n = f.reduce((i, r) => Ca(r) ? i + r : Dn(r) ? i + r.slice(1) : Je([i, r], " "), e); return Je([n, k1(a)], " "); } var D1 = class Re { constructor(e, a = null, { preconditions: n, postconditions: i } = {}) { this.sheet = e, this.preconditions = [], this.scopeClassName = null, this.scopeName = null, this.postconditions = [], this.preconditions = n ? la(n) : [], this.postconditions = i ? la(i) : [], this.setScope(a); } setScope(e) { return e ? (this.scopeClassName || (this.scopeName = e, this.scopeClassName = Tn( this.sheet.name, // adding the count guarantees uniqueness across style.create calls e + this.sheet.count )), this) : this; } get hasConditions() { return this.preconditions.length > 0 || this.postconditions.length > 0; } addScope(e) { return new Re(this.sheet, e, { preconditions: this.preconditions, postconditions: this.postconditions }); } addPrecondition(e) { return new Re(this.sheet, this.scopeClassName, { postconditions: this.postconditions, preconditions: this.preconditions.concat(e) }); } addPostcondition(e) { return new Re(this.sheet, this.scopeClassName, { preconditions: this.preconditions, postconditions: this.postconditions.concat(e) }); } createRule(e, a) { return new xn(this.sheet, e, a, this); } }, T1 = class { constructor(f, e) { this.name = f, this.rootNode = e, this.storedStyles = {}, this.storedClasses = {}, this.style = "", this.count = 0, this.id = `flairup-${f}`, this.styleTag = this.createStyleTag(); } getStyle() { return this.style; } append(f) { this.style = S1(this.style, f); } apply() { this.count++, this.styleTag && (this.styleTag.innerHTML = this.style); } isApplied() { return !!this.styleTag; } createStyleTag() { if (typeof document > "u" || this.isApplied() || // Explicitly disallow mounting to the DOM this.rootNode === null) return this.styleTag; const f = document.createElement("style"); return f.type = "text/css", f.id = this.id, (this.rootNode ?? document.head).appendChild(f), f; } addRule(f) { const e = this.storedClasses[f.key]; return Ze(e) ? e : (this.storedClasses[f.key] = f.hash, this.storedStyles[f.hash] = [f.property, f.value], this.append(f.toString()), f.hash); } }; function ya(f, e) { for (const a in f) e(a.trim(), f[a]); } function v(...f) { const e = f.reduce((a, n) => (n instanceof Set ? a.push(...n) : typeof n == "string" ? a.push(n) : Array.isArray(n) ? a.push(v(...n)) : typeof n == "object" && Object.entries(n).forEach(([i, r]) => { r && a.push(i); }), a), []); return Je(e, " ").trim(); } function x1(f, e) { const a = new T1(f, e); return { create: n, getStyle: a.getStyle.bind(a), isApplied: a.isApplied.bind(a) }; function n(i) { const r = {}; return En(a, i, new D1(a)).forEach( ([u, d, s]) => { He(a, d, s).forEach( (c) => { o(u, c); } )