UNPKG

bettercx-widget

Version:

Professional AI-powered chat widget for BetterCX platform. Seamlessly integrate intelligent customer support into any website.

1,274 lines (1,251 loc) 58.6 kB
const globalStyles = ":root{--bcx-primary:#007bff;--bcx-secondary:#6c757d;--bcx-background:#ffffff;--bcx-text:#212529;--bcx-border:#dee2e6;--bcx-shadow:rgba(0, 0, 0, 0.1);--bcx-success:#28a745;--bcx-warning:#ffc107;--bcx-error:#dc3545;--bcx-info:#17a2b8;--bcx-spacing-xs:0.25rem;--bcx-spacing-sm:0.5rem;--bcx-spacing-md:1rem;--bcx-spacing-lg:1.5rem;--bcx-spacing-xl:2rem;--bcx-radius-sm:0.25rem;--bcx-radius-md:0.5rem;--bcx-radius-lg:0.75rem;--bcx-radius-xl:1rem;--bcx-font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;--bcx-font-size-xs:0.75rem;--bcx-font-size-sm:0.875rem;--bcx-font-size-md:1rem;--bcx-font-size-lg:1.125rem;--bcx-font-size-xl:1.25rem;--bcx-transition-fast:0.15s ease-in-out;--bcx-transition-normal:0.3s ease-in-out;--bcx-transition-slow:0.5s ease-in-out;--bcx-z-dropdown:1000;--bcx-z-sticky:1020;--bcx-z-fixed:1030;--bcx-z-modal-backdrop:1040;--bcx-z-modal:1050;--bcx-z-popover:1060;--bcx-z-tooltip:1070}@media (prefers-color-scheme: dark){:root{--bcx-background:#1a1a1a;--bcx-text:#ffffff;--bcx-border:#404040;--bcx-shadow:rgba(0, 0, 0, 0.3)}}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}.bcx-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.bcx-focus-visible{outline:2px solid var(--bcx-primary);outline-offset:2px}@-webkit-keyframes bcx-fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes bcx-fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bcx-slide-up{from{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes bcx-slide-up{from{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bcx-pulse{0%,100%{opacity:1}50%{opacity:0.5}}@keyframes bcx-pulse{0%,100%{opacity:1}50%{opacity:0.5}}@-webkit-keyframes bcx-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes bcx-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.bcx-animate-fade-in{-webkit-animation:bcx-fade-in var(--bcx-transition-normal);animation:bcx-fade-in var(--bcx-transition-normal)}.bcx-animate-slide-up{-webkit-animation:bcx-slide-up var(--bcx-transition-normal);animation:bcx-slide-up var(--bcx-transition-normal)}.bcx-animate-pulse{-webkit-animation:bcx-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;animation:bcx-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.bcx-animate-spin{-webkit-animation:bcx-spin 1s linear infinite;animation:bcx-spin 1s linear infinite}"; const NAMESPACE = 'bettercx-widget'; const BUILD = /* bettercx-widget */ { hydratedSelectorName: "hydrated", lazyLoad: false, updatable: true}; /* Stencil Client Platform v4.36.3 | MIT Licensed | https://stenciljs.com */ var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; // src/utils/constants.ts var SVG_NS = "http://www.w3.org/2000/svg"; var HTML_NS = "http://www.w3.org/1999/xhtml"; // src/utils/es2022-rewire-class-members.ts var reWireGetterSetter = (instance, hostRef) => { var _a; const cmpMeta = hostRef.$cmpMeta$; const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {}); members.map(([memberName, [memberFlags]]) => { if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) { const ogValue = instance[memberName]; const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName); Object.defineProperty(instance, memberName, { get() { return ogDescriptor.get.call(this); }, set(newValue) { ogDescriptor.set.call(this, newValue); }, configurable: true, enumerable: true }); instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue; } }); }; // src/client/client-host-ref.ts var getHostRef = (ref) => { if (ref.__stencil__getHostRef) { return ref.__stencil__getHostRef(); } return void 0; }; var registerHost = (hostElement, cmpMeta) => { const hostRef = { $flags$: 0, $hostElement$: hostElement, $cmpMeta$: cmpMeta, $instanceValues$: /* @__PURE__ */ new Map() }; { hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r); hostElement["s-p"] = []; hostElement["s-rc"] = []; } const ref = hostRef; hostElement.__stencil__getHostRef = () => ref; { reWireGetterSetter(hostElement, hostRef); } return ref; }; var isMemberInElement = (elm, memberName) => memberName in elm; var consoleError = (e, el) => (0, console.error)(e, el); // src/client/client-style.ts var styles = /* @__PURE__ */ new Map(); var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}"; var win = typeof window !== "undefined" ? window : {}; var H = win.HTMLElement || class { }; var plt = { $flags$: 0, $resourcesUrl$: "", jmp: (h2) => h2(), raf: (h2) => requestAnimationFrame(h2), ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), ce: (eventName, opts) => new CustomEvent(eventName, opts) }; var promiseResolve = (v) => Promise.resolve(v); var supportsConstructableStylesheets = /* @__PURE__ */ (() => { try { new CSSStyleSheet(); return typeof new CSSStyleSheet().replaceSync === "function"; } catch (e) { } return false; })() ; var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false; var queuePending = false; var queueDomReads = []; var queueDomWrites = []; var queueTask = (queue, write) => (cb) => { queue.push(cb); if (!queuePending) { queuePending = true; if (write && plt.$flags$ & 4 /* queueSync */) { nextTick(flush); } else { plt.raf(flush); } } }; var consume = (queue) => { for (let i2 = 0; i2 < queue.length; i2++) { try { queue[i2](performance.now()); } catch (e) { consoleError(e); } } queue.length = 0; }; var flush = () => { consume(queueDomReads); { consume(queueDomWrites); if (queuePending = queueDomReads.length > 0) { plt.raf(flush); } } }; var nextTick = (cb) => promiseResolve().then(cb); var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true); // src/runtime/asset-path.ts var getAssetPath = (path) => { const assetUrl = new URL(path, plt.$resourcesUrl$); return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname; }; var setAssetPath = (path) => plt.$resourcesUrl$ = path; var isComplexType = (o) => { o = typeof o; return o === "object" || o === "function"; }; // src/utils/query-nonce-meta-tag-content.ts function queryNonceMetaTagContent(doc) { var _a, _b, _c; return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0; } // src/utils/regular-expression.ts var escapeRegExpSpecialCharacters = (text) => { return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }; // src/utils/result.ts var result_exports = {}; __export(result_exports, { err: () => err, map: () => map, ok: () => ok, unwrap: () => unwrap, unwrapErr: () => unwrapErr }); var ok = (value) => ({ isOk: true, isErr: false, value }); var err = (value) => ({ isOk: false, isErr: true, value }); function map(result, fn) { if (result.isOk) { const val = fn(result.value); if (val instanceof Promise) { return val.then((newVal) => ok(newVal)); } else { return ok(val); } } if (result.isErr) { const value = result.value; return err(value); } throw "should never get here"; } var unwrap = (result) => { if (result.isOk) { return result.value; } else { throw result.value; } }; var unwrapErr = (result) => { if (result.isErr) { return result.value; } else { throw result.value; } }; // src/utils/style.ts function createStyleSheetIfNeededAndSupported(styles2) { if (!supportsConstructableStylesheets) return void 0; const sheet = new CSSStyleSheet(); sheet.replaceSync(styles2); return sheet; } // src/utils/shadow-root.ts var globalStyleSheet; function createShadowRoot(cmpMeta) { var _a; const shadowRoot = this.attachShadow({ mode: "open" }); if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null; if (globalStyleSheet) { if (supportsMutableAdoptedStyleSheets) { shadowRoot.adoptedStyleSheets.push(globalStyleSheet); } else { shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet]; } } } var createTime = (fnName, tagName = "") => { { return () => { return; }; } }; var rootAppliedStyles = /* @__PURE__ */ new WeakMap(); var registerStyle = (scopeId2, cssText, allowCS) => { let style = styles.get(scopeId2); if (supportsConstructableStylesheets && allowCS) { style = style || new CSSStyleSheet(); if (typeof style === "string") { style = cssText; } else { style.replaceSync(cssText); } } else { style = cssText; } styles.set(scopeId2, style); }; var addStyle = (styleContainerNode, cmpMeta, mode) => { var _a; const scopeId2 = getScopeId(cmpMeta); const style = styles.get(scopeId2); if (!win.document) { return scopeId2; } styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document; if (style) { if (typeof style === "string") { styleContainerNode = styleContainerNode.head || styleContainerNode; let appliedStyles = rootAppliedStyles.get(styleContainerNode); let styleElm; if (!appliedStyles) { rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set()); } if (!appliedStyles.has(scopeId2)) { { styleElm = win.document.createElement("style"); styleElm.innerHTML = style; const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document); if (nonce != null) { styleElm.setAttribute("nonce", nonce); } if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) { if (styleContainerNode.nodeName === "HEAD") { const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]"); const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style"); styleContainerNode.insertBefore( styleElm, (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null ); } else if ("host" in styleContainerNode) { if (supportsConstructableStylesheets) { const stylesheet = new CSSStyleSheet(); stylesheet.replaceSync(style); if (supportsMutableAdoptedStyleSheets) { styleContainerNode.adoptedStyleSheets.unshift(stylesheet); } else { styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets]; } } else { const existingStyleContainer = styleContainerNode.querySelector("style"); if (existingStyleContainer) { existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML; } else { styleContainerNode.prepend(styleElm); } } } else { styleContainerNode.append(styleElm); } } if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { styleContainerNode.insertBefore(styleElm, null); } } if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) { styleElm.innerHTML += SLOT_FB_CSS; } if (appliedStyles) { appliedStyles.add(scopeId2); } } } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) { if (supportsMutableAdoptedStyleSheets) { styleContainerNode.adoptedStyleSheets.push(style); } else { styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style]; } } } return scopeId2; }; var attachStyles = (hostRef) => { const cmpMeta = hostRef.$cmpMeta$; const elm = hostRef.$hostElement$; const flags = cmpMeta.$flags$; const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$); const scopeId2 = addStyle( elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta); if (flags & 10 /* needsScopedEncapsulation */) { elm["s-sc"] = scopeId2; elm.classList.add(scopeId2 + "-h"); } endAttachStyles(); }; var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$); var h = (nodeName, vnodeData, ...children) => { let child = null; let key = null; let simple = false; let lastSimple = false; const vNodeChildren = []; const walk = (c) => { for (let i2 = 0; i2 < c.length; i2++) { child = c[i2]; if (Array.isArray(child)) { walk(child); } else if (child != null && typeof child !== "boolean") { if (simple = typeof nodeName !== "function" && !isComplexType(child)) { child = String(child); } if (simple && lastSimple) { vNodeChildren[vNodeChildren.length - 1].$text$ += child; } else { vNodeChildren.push(simple ? newVNode(null, child) : child); } lastSimple = simple; } } }; walk(children); if (vnodeData) { if (vnodeData.key) { key = vnodeData.key; } { const classData = vnodeData.className || vnodeData.class; if (classData) { vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" "); } } } const vnode = newVNode(nodeName, null); vnode.$attrs$ = vnodeData; if (vNodeChildren.length > 0) { vnode.$children$ = vNodeChildren; } { vnode.$key$ = key; } return vnode; }; var newVNode = (tag, text) => { const vnode = { $flags$: 0, $tag$: tag, $text$: text, $elm$: null, $children$: null }; { vnode.$attrs$ = null; } { vnode.$key$ = null; } return vnode; }; var Host = {}; var isHost = (node) => node && node.$tag$ === Host; var createSupportsRuleRe = (selector) => { const safeSelector2 = escapeRegExpSpecialCharacters(selector); return new RegExp( // First capture group: match any context before the selector that's not inside @supports selector() // Using negative lookahead to avoid matching inside @supports selector(...) condition `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`, "g" ); }; createSupportsRuleRe("::slotted"); createSupportsRuleRe(":host"); createSupportsRuleRe(":host-context"); var parsePropertyValue = (propValue, propType, isFormAssociated) => { if (typeof propValue === "string" && (propType & 16 /* Unknown */ || propType & 8 /* Any */) && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) { try { return JSON.parse(propValue); } catch (e) { } } if (propValue != null && !isComplexType(propValue)) { if (propType & 4 /* Boolean */) { { return propValue === "false" ? false : propValue === "" || !!propValue; } } if (propType & 2 /* Number */) { return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN; } if (propType & 1 /* String */) { return String(propValue); } return propValue; } return propValue; }; var getElement = (ref) => { return ref; }; // src/runtime/event-emitter.ts var createEvent = (ref, name, flags) => { const elm = getElement(ref); return { emit: (detail) => { return emitEvent(elm, name, { bubbles: true, composed: true, cancelable: true, detail }); } }; }; var emitEvent = (elm, name, opts) => { const ev = plt.ce(name, opts); elm.dispatchEvent(ev); return ev; }; var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => { if (oldValue === newValue) { return; } let isProp = isMemberInElement(elm, memberName); let ln = memberName.toLowerCase(); if (memberName === "class") { const classList = elm.classList; const oldClasses = parseClassList(oldValue); let newClasses = parseClassList(newValue); { classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c))); classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c))); } } else if (memberName === "key") ; else if (memberName === "ref") { if (newValue) { newValue(elm); } } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") { if (memberName[2] === "-") { memberName = memberName.slice(3); } else if (isMemberInElement(win, ln)) { memberName = ln.slice(2); } else { memberName = ln[2] + memberName.slice(3); } if (oldValue || newValue) { const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX); memberName = memberName.replace(CAPTURE_EVENT_REGEX, ""); if (oldValue) { plt.rel(elm, memberName, oldValue, capture); } if (newValue) { plt.ael(elm, memberName, newValue, capture); } } } else { const isComplex = isComplexType(newValue); if ((isProp || isComplex && newValue !== null) && !isSvg) { try { if (!elm.tagName.includes("-")) { const n = newValue == null ? "" : newValue; if (memberName === "list") { isProp = false; } else if (oldValue == null || elm[memberName] != n) { if (typeof elm.__lookupSetter__(memberName) === "function") { elm[memberName] = n; } else { elm.setAttribute(memberName, n); } } } else if (elm[memberName] !== newValue) { elm[memberName] = newValue; } } catch (e) { } } if (newValue == null || newValue === false) { if (newValue !== false || elm.getAttribute(memberName) === "") { { elm.removeAttribute(memberName); } } } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) { newValue = newValue === true ? "" : newValue; { elm.setAttribute(memberName, newValue); } } } }; var parseClassListRegex = /\s/; var parseClassList = (value) => { if (typeof value === "object" && value && "baseVal" in value) { value = value.baseVal; } if (!value || typeof value !== "string") { return []; } return value.split(parseClassListRegex); }; var CAPTURE_EVENT_SUFFIX = "Capture"; var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$"); // src/runtime/vdom/update-element.ts var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => { const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {}; const newVnodeAttrs = newVnode.$attrs$ || {}; { for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) { if (!(memberName in newVnodeAttrs)) { setAccessor( elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$); } } } for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) { setAccessor( elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$); } }; function sortedAttrNames(attrNames) { return attrNames.includes("ref") ? ( // we need to sort these to ensure that `'ref'` is the last attr [...attrNames.filter((attr) => attr !== "ref"), "ref"] ) : ( // no need to sort, return the original array attrNames ); } var hostTagName; var isSvgMode = false; var createElm = (oldParentVNode, newParentVNode, childIndex) => { const newVNode2 = newParentVNode.$children$[childIndex]; let i2 = 0; let elm; let childNode; if (newVNode2.$text$ !== null) { elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$); } else { if (!isSvgMode) { isSvgMode = newVNode2.$tag$ === "svg"; } if (!win.document) { throw new Error( "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component." ); } elm = newVNode2.$elm$ = win.document.createElementNS( isSvgMode ? SVG_NS : HTML_NS, newVNode2.$tag$ ) ; if (isSvgMode && newVNode2.$tag$ === "foreignObject") { isSvgMode = false; } { updateElement(null, newVNode2, isSvgMode); } if (newVNode2.$children$) { for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) { childNode = createElm(oldParentVNode, newVNode2, i2); if (childNode) { elm.appendChild(childNode); } } } { if (newVNode2.$tag$ === "svg") { isSvgMode = false; } else if (elm.tagName === "foreignObject") { isSvgMode = true; } } } elm["s-hn"] = hostTagName; return elm; }; var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { let containerElm = parentElm; let childNode; if (containerElm.shadowRoot && containerElm.tagName === hostTagName) { containerElm = containerElm.shadowRoot; } for (; startIdx <= endIdx; ++startIdx) { if (vnodes[startIdx]) { childNode = createElm(null, parentVNode, startIdx); if (childNode) { vnodes[startIdx].$elm$ = childNode; insertBefore(containerElm, childNode, before); } } } }; var removeVnodes = (vnodes, startIdx, endIdx) => { for (let index = startIdx; index <= endIdx; ++index) { const vnode = vnodes[index]; if (vnode) { const elm = vnode.$elm$; nullifyVNodeRefs(vnode); if (elm) { elm.remove(); } } } }; var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => { let oldStartIdx = 0; let newStartIdx = 0; let idxInOld = 0; let i2 = 0; let oldEndIdx = oldCh.length - 1; let oldStartVnode = oldCh[0]; let oldEndVnode = oldCh[oldEndIdx]; let newEndIdx = newCh.length - 1; let newStartVnode = newCh[0]; let newEndVnode = newCh[newEndIdx]; let node; let elmToMove; while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { if (oldStartVnode == null) { oldStartVnode = oldCh[++oldStartIdx]; } else if (oldEndVnode == null) { oldEndVnode = oldCh[--oldEndIdx]; } else if (newStartVnode == null) { newStartVnode = newCh[++newStartIdx]; } else if (newEndVnode == null) { newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) { patch(oldStartVnode, newStartVnode, isInitialRender); oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) { patch(oldEndVnode, newEndVnode, isInitialRender); oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) { patch(oldStartVnode, newEndVnode, isInitialRender); insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) { patch(oldEndVnode, newStartVnode, isInitialRender); insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { idxInOld = -1; { for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) { if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) { idxInOld = i2; break; } } } if (idxInOld >= 0) { elmToMove = oldCh[idxInOld]; if (elmToMove.$tag$ !== newStartVnode.$tag$) { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld); } else { patch(elmToMove, newStartVnode, isInitialRender); oldCh[idxInOld] = void 0; node = elmToMove.$elm$; } newStartVnode = newCh[++newStartIdx]; } else { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx); newStartVnode = newCh[++newStartIdx]; } if (node) { { insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$); } } } } if (oldStartIdx > oldEndIdx) { addVnodes( parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode2, newCh, newStartIdx, newEndIdx ); } else if (newStartIdx > newEndIdx) { removeVnodes(oldCh, oldStartIdx, oldEndIdx); } }; var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => { if (leftVNode.$tag$ === rightVNode.$tag$) { if (!isInitialRender) { return leftVNode.$key$ === rightVNode.$key$; } if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) { leftVNode.$key$ = rightVNode.$key$; } return true; } return false; }; var patch = (oldVNode, newVNode2, isInitialRender = false) => { const elm = newVNode2.$elm$ = oldVNode.$elm$; const oldChildren = oldVNode.$children$; const newChildren = newVNode2.$children$; const tag = newVNode2.$tag$; const text = newVNode2.$text$; if (text === null) { { isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode; } { updateElement(oldVNode, newVNode2, isSvgMode); } if (oldChildren !== null && newChildren !== null) { updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender); } else if (newChildren !== null) { if (oldVNode.$text$ !== null) { elm.textContent = ""; } addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1); } else if ( // don't do this on initial render as it can cause non-hydrated content to be removed !isInitialRender && BUILD.updatable && oldChildren !== null ) { removeVnodes(oldChildren, 0, oldChildren.length - 1); } else ; if (isSvgMode && tag === "svg") { isSvgMode = false; } } else if (oldVNode.$text$ !== text) { elm.data = text; } }; var nullifyVNodeRefs = (vNode) => { { vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null); vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs); } }; var insertBefore = (parent, newNode, reference) => { { return parent == null ? void 0 : parent.insertBefore(newNode, reference); } }; var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => { const hostElm = hostRef.$hostElement$; const oldVNode = hostRef.$vnode$ || newVNode(null, null); const isHostElement = isHost(renderFnResults); const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults); hostTagName = hostElm.tagName; if (isInitialLoad && rootVnode.$attrs$) { for (const key of Object.keys(rootVnode.$attrs$)) { if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) { rootVnode.$attrs$[key] = hostElm[key]; } } } rootVnode.$tag$ = null; rootVnode.$flags$ |= 4 /* isHost */; hostRef.$vnode$ = rootVnode; rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ; patch(oldVNode, rootVnode, isInitialLoad); }; // src/runtime/update-component.ts var attachToAncestor = (hostRef, ancestorComponent) => { if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) { const index = ancestorComponent["s-p"].push( new Promise( (r) => hostRef.$onRenderResolve$ = () => { ancestorComponent["s-p"].splice(index - 1, 1); r(); } ) ); } }; var scheduleUpdate = (hostRef, isInitialLoad) => { { hostRef.$flags$ |= 16 /* isQueuedForUpdate */; } if (hostRef.$flags$ & 4 /* isWaitingForChildren */) { hostRef.$flags$ |= 512 /* needsRerender */; return; } attachToAncestor(hostRef, hostRef.$ancestorComponent$); const dispatch = () => dispatchHooks(hostRef, isInitialLoad); if (isInitialLoad) { queueMicrotask(() => { dispatch(); }); return; } return writeTask(dispatch) ; }; var dispatchHooks = (hostRef, isInitialLoad) => { const elm = hostRef.$hostElement$; const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$); const instance = elm; if (!instance) { throw new Error( `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime` ); } let maybePromise; if (isInitialLoad) { maybePromise = safeCall(instance, "componentWillLoad", void 0, elm); } else { maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm); } maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm)); endSchedule(); return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad)); }; var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => { console.error(err2); fn(); }) : fn(); var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function"; var updateComponent = async (hostRef, instance, isInitialLoad) => { var _a; const elm = hostRef.$hostElement$; const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$); const rc = elm["s-rc"]; if (isInitialLoad) { attachStyles(hostRef); } const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$); { callRender(hostRef, instance, elm, isInitialLoad); } if (rc) { rc.map((cb) => cb()); elm["s-rc"] = void 0; } endRender(); endUpdate(); { const childrenPromises = (_a = elm["s-p"]) != null ? _a : []; const postUpdate = () => postUpdateComponent(hostRef); if (childrenPromises.length === 0) { postUpdate(); } else { Promise.all(childrenPromises).then(postUpdate); hostRef.$flags$ |= 4 /* isWaitingForChildren */; childrenPromises.length = 0; } } }; var callRender = (hostRef, instance, elm, isInitialLoad) => { try { instance = instance.render() ; { hostRef.$flags$ &= -17 /* isQueuedForUpdate */; } { hostRef.$flags$ |= 2 /* hasRendered */; } { { { renderVdom(hostRef, instance, isInitialLoad); } } } } catch (e) { consoleError(e, hostRef.$hostElement$); } return null; }; var postUpdateComponent = (hostRef) => { const tagName = hostRef.$cmpMeta$.$tagName$; const elm = hostRef.$hostElement$; const endPostUpdate = createTime("postUpdate", tagName); const instance = elm; const ancestorComponent = hostRef.$ancestorComponent$; safeCall(instance, "componentDidRender", void 0, elm); if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { hostRef.$flags$ |= 64 /* hasLoadedComponent */; { addHydratedFlag(elm); } safeCall(instance, "componentDidLoad", void 0, elm); endPostUpdate(); { hostRef.$onReadyResolve$(elm); if (!ancestorComponent) { appDidLoad(); } } } else { safeCall(instance, "componentDidUpdate", void 0, elm); endPostUpdate(); } { if (hostRef.$onRenderResolve$) { hostRef.$onRenderResolve$(); hostRef.$onRenderResolve$ = void 0; } if (hostRef.$flags$ & 512 /* needsRerender */) { nextTick(() => scheduleUpdate(hostRef, false)); } hostRef.$flags$ &= -517; } }; var appDidLoad = (who) => { nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } })); }; var safeCall = (instance, method, arg, elm) => { if (instance && instance[method]) { try { return instance[method](arg); } catch (e) { consoleError(e, elm); } } return void 0; }; var addHydratedFlag = (elm) => { var _a; return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ; }; // src/runtime/set-value.ts var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); var setValue = (ref, propName, newVal, cmpMeta) => { const hostRef = getHostRef(ref); if (!hostRef) { return; } const elm = ref; const oldVal = hostRef.$instanceValues$.get(propName); const flags = hostRef.$flags$; const instance = elm; newVal = parsePropertyValue( newVal, cmpMeta.$members$[propName][0]); const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal); const didValueChange = newVal !== oldVal && !areBothNaN; if (didValueChange) { hostRef.$instanceValues$.set(propName, newVal); { if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) { const watchMethods = cmpMeta.$watchers$[propName]; if (watchMethods) { watchMethods.map((watchMethodName) => { try { instance[watchMethodName](newVal, oldVal, propName); } catch (e) { consoleError(e, elm); } }); } } if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { if (instance.componentShouldUpdate) { if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) { return; } } scheduleUpdate(hostRef, false); } } } }; // src/runtime/proxy-component.ts var proxyComponent = (Cstr, cmpMeta, flags) => { var _a, _b; const prototype = Cstr.prototype; if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) { if (Cstr.watchers && !cmpMeta.$watchers$) { cmpMeta.$watchers$ = Cstr.watchers; } const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {}); members.map(([memberName, [memberFlags]]) => { if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) { const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {}; if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */; if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */; { Object.defineProperty(prototype, memberName, { get() { { return origGetter ? origGetter.apply(this) : getValue(this, memberName); } }, configurable: true, enumerable: true }); } Object.defineProperty(prototype, memberName, { set(newValue) { const ref = getHostRef(this); if (!ref) { return; } if (origSetter) { const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName]; if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) { newValue = ref.$instanceValues$.get(memberName); } else if (!ref.$instanceValues$.get(memberName) && currentValue) { ref.$instanceValues$.set(memberName, currentValue); } origSetter.apply(this, [ parsePropertyValue( newValue, memberFlags) ]); newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName]; setValue(this, memberName, newValue, cmpMeta); return; } { setValue(this, memberName, newValue, cmpMeta); return; } } }); } }); { const attrNameToPropName = /* @__PURE__ */ new Map(); prototype.attributeChangedCallback = function(attrName, oldValue, newValue) { plt.jmp(() => { var _a2; const propName = attrNameToPropName.get(attrName); if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ; else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues this[propName] == newValue) { return; } else if (propName == null) { const hostRef = getHostRef(this); const flags2 = hostRef == null ? void 0 : hostRef.$flags$; if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) { const elm = this; const instance = elm; const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName]; entry == null ? void 0 : entry.forEach((callbackName) => { if (instance[callbackName] != null) { instance[callbackName].call(instance, newValue, oldValue, attrName); } }); } return; } const propDesc = Object.getOwnPropertyDescriptor(prototype, propName); newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue; if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) { this[propName] = newValue; } }); }; Cstr.observedAttributes = Array.from( /* @__PURE__ */ new Set([ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}), ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => { const attrName = m[1] || propName; attrNameToPropName.set(attrName, propName); return attrName; }) ]) ); } } return Cstr; }; // src/runtime/initialize-component.ts var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => { let Cstr; if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { hostRef.$flags$ |= 32 /* hasInitializedComponent */; { Cstr = elm.constructor; const cmpTag = elm.localName; customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */); } if (Cstr && Cstr.style) { let style; if (typeof Cstr.style === "string") { style = Cstr.style; } const scopeId2 = getScopeId(cmpMeta); if (!styles.has(scopeId2)) { const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$); registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); endRegisterStyles(); } } } const ancestorComponent = hostRef.$ancestorComponent$; const schedule = () => scheduleUpdate(hostRef, true); if (ancestorComponent && ancestorComponent["s-rc"]) { ancestorComponent["s-rc"].push(schedule); } else { schedule(); } }; var fireConnectedCallback = (instance, elm) => { }; // src/runtime/connected-callback.ts var connectedCallback = (elm) => { if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { const hostRef = getHostRef(elm); if (!hostRef) { return; } const cmpMeta = hostRef.$cmpMeta$; const endConnected = createTime("connectedCallback", cmpMeta.$tagName$); if (!(hostRef.$flags$ & 1 /* hasConnected */)) { hostRef.$flags$ |= 1 /* hasConnected */; { let ancestorComponent = elm; while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) { if (ancestorComponent["s-p"]) { attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent); break; } } } if (cmpMeta.$members$) { Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => { if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { const value = elm[memberName]; delete elm[memberName]; elm[memberName] = value; } }); } if (BUILD.initializeNextTick) { nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); } else { initializeComponent(elm, hostRef, cmpMeta); } } else { if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) { hostRef.$onReadyPromise$.then(() => fireConnectedCallback()); } } endConnected(); } }; var disconnectedCallback = async (elm) => { if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { getHostRef(elm); } if (rootAppliedStyles.has(elm)) { rootAppliedStyles.delete(elm); } if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) { rootAppliedStyles.delete(elm.shadowRoot); } }; var proxyCustomElement = (Cstr, compactMeta) => { const cmpMeta = { $flags$: compactMeta[0], $tagName$: compactMeta[1] }; { cmpMeta.$members$ = compactMeta[2]; } { cmpMeta.$watchers$ = Cstr.$watchers$; } const originalConnectedCallback = Cstr.prototype.connectedCallback; const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback; Object.assign(Cstr.prototype, { __hasHostListenerAttached: false, __registerHost() { registerHost(this, cmpMeta); }, connectedCallback() { if (!this.__hasHostListenerAttached) { const hostRef = getHostRef(this); if (!hostRef) { return; } this.__hasHostListenerAttached = true; } connectedCallback(this); if (originalConnectedCallback) { originalConnectedCallback.call(this); } }, disconnectedCallback() { disconnectedCallback(this); if (originalDisconnectedCallback) { originalDisconnectedCallback.call(this); } }, __attachShadow() { { if (!this.shadowRoot) { createShadowRoot.call(this, cmpMeta); } else { if (this.shadowRoot.mode !== "open") { throw new Error( `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.` ); } } } } }); Cstr.is = cmpMeta.$tagName$; return proxyComponent(Cstr, cmpMeta); }; // src/runtime/nonce.ts var setNonce = (nonce) => plt.$nonce$ = nonce; // src/runtime/platform-options.ts var setPlatformOptions = (opts) => Object.assign(plt, opts); // src/runtime/render.ts function render(vnode, container) { const ref = { $hostElement$: container }; renderVdom(ref, vnode); } const bcxMessageComposerCss = ":host{display:block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.bcx-composer{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:var(--bcx-space-3, 12px);width:100%;min-height:48px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;position:relative}.bcx-composer__input-container{-ms-flex:1 1 auto;flex:1 1 auto;position:relative;min-width:0;width:0;}.bcx-composer__input{width:100%;min-height:48px;max-height:120px;padding:var(--bcx-space-3, 12px) var(--bcx-space-4, 16px);border:1px solid var(--bcx-border-subtle, rgba(0, 0, 0, 0.1));border-radius:var(--bcx-radius-2xl, 24px);background:var(--bcx-bg-secondary, #f8f9fa);color:var(--bcx-text-primary, #1a1a1a);font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;font-size:var(--bcx-text-base, 14px);line-height:1.5;resize:none;outline:none;-webkit-transition:all var(--bcx-transition-normal, 0.25s ease);transition:all var(--bcx-transition-normal, 0.25s ease);-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:top;font-weight:400;position:relative;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.bcx-composer__input::before{content:\"\";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(135deg, color-mix(in srgb, var(--bcx-primary-500, #007bff) 3%, transparent) 0%, transparent 50%, color-mix(in srgb, var(--bcx-primary-500, #007bff) 2%, transparent) 100%);opacity:0;-webkit-transition:opacity var(--bcx-transition-fast, 0.15s ease);transition:opacity var(--bcx-transition-fast, 0.15s ease);pointer-events:none}.bcx-composer__input:focus{border-color:var(--bcx-primary-400, #667eea);-webkit-box-shadow:0 0 0 3px var(--bcx-primary-100, rgba(102, 126, 234, 0.1)), 0 2px 8px color-mix(in srgb, var(--bcx-primary-500, #007bff) 8%, transparent);box-shadow:0 0 0 3px var(--bcx-primary-100, rgba(102, 126, 234, 0.1)), 0 2px 8px color-mix(in srgb, var(--bcx-primary-500, #007bff) 8%, transparent);background:var(--bcx-bg-primary, #ffffff)}.bcx-composer__input:focus::before{opacity:1}.bcx-composer__input:hover:not(:focus){border-color:var(--bcx-border-soft, rgba(0, 0, 0, 0.15));background:var(--bcx-bg-tertiary, #f5f5f5)}.bcx-composer__input:disabled{opacity:0.6;cursor:not-allowed;background:var(--bcx-bg-secondary, #f8f9fa)}.bcx-composer__input::-webkit-input-placeholder{color:var(--bcx-text-tertiary, color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 50%, transparent));font-weight:400}.bcx-composer__input::-moz-placeholder{color:var(--bcx-text-tertiary, color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 50%, transparent));font-weight:400}.bcx-composer__input:-ms-input-placeholder{color:var(--bcx-text-tertiary, color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 50%, transparent));font-weight:400}.bcx-composer__input::-ms-input-placeholder{color:var(--bcx-text-tertiary, color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 50%, transparent));font-weight:400}.bcx-composer__input::placeholder{color:var(--bcx-text-tertiary, color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 50%, transparent));font-weight:400}.bcx-composer__char-count{position:absolute;bottom:var(--bcx-space-1, 4px);right:var(--bcx-space-2, 8px);font-size:var(--bcx-text-xs, 11px);color:var(--bcx-primary-600, #f59e0b);background:var(--bcx-bg-elevated, #ffffff);padding:var(--bcx-space-1, 2px) var(--bcx-space-1, 6px);border-radius:var(--bcx-radius-sm, 4px);pointer-events:none;font-weight:600;-webkit-box-shadow:0 1px 3px color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 8%, transparent);box-shadow:0 1px 3px color-mix(in srgb, var(--bcx-text-primary, #1a1a1a) 8%, transparent);border:1px solid var(--bcx-border-subtle, rgba(0, 0, 0, 0.1));backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.bcx-composer__submit{width:48px;height:48px;border:none;border-radius:var(--bcx-radius-full, 50%);background:var(--bcx-primary-500, #007bff);color:var(--bcx-bg-primary, white);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:18px;font-weight:500;-webkit-transition:all var(--bcx-transition-normal, 0.25s ease);transition:all var(--bcx-transition-normal, 0.25s ease);-ms-flex-negative:0;flex-shrink:0;-webkit-box-shadow:0 4px 12px color-mix(in srgb, var(--bcx-primary-500, #007bff) 25%, transparent), 0 1px 3px color-mix(in srgb, var(--bcx-primary-500, #007bff) 15%, transparent);box-shadow:0 4px 12px color-mix(in srgb, var(--bcx-primary-500, #007bff) 25%, transparent), 0 1px 3px color-mix(in srgb, var(--bcx-primary-500, #007bff) 15%, transparent);margin-bottom:0;position:relative;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.bcx-composer__submit::before{content:\"\";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(135deg, color-mix(in srgb, var(--bcx-primary-500, #007bff) 20%, transparent) 0%, transparent 50%, color-mix(in srgb, var(--bcx-primary-500, #007bff) 10%, transparent) 100%);opacity:0;-webkit-transition:opacity var(--bcx-transition-fast, 0.15s ease);transition:opacity var(--bcx-transition-fast, 0.15s ease);pointer-events:none}.bcx-composer__submit:hover:not(:disabled){background:var(--bcx-primary-600, #0056b3);-webkit-transform:translateY(-2px) scale(1.05);transform:translateY(-2px) scale(1.05);-webkit-box-shadow:0 6px 20px color-mix(in srgb, var(--bcx-primary-500, #007bff) 35%, transparent), 0 2px 6px color-mix(in srgb, v