@copilotkit/web-components 2.0.0-rc.3 → 2.0.0-rc.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +17 -18
- package/dist/index.umd.js.map +1 -1
- package/dist/threads-drawer/copilotkit-threads-drawer.cjs +16 -17
- package/dist/threads-drawer/copilotkit-threads-drawer.cjs.map +1 -1
- package/dist/threads-drawer/copilotkit-threads-drawer.d.cts.map +1 -1
- package/dist/threads-drawer/copilotkit-threads-drawer.d.mts.map +1 -1
- package/dist/threads-drawer/copilotkit-threads-drawer.mjs +16 -17
- package/dist/threads-drawer/copilotkit-threads-drawer.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","names":["_a","EventShim","CustomEventShim","EventTargetShim","customElements","t","e","s","o","n","r","i","S","c","h","r","o","n","a","c","l","t","p","d","u","f","b","m","y","g","s","i","e","t","i","s","e","h","o","n","r","l","c","u","d","f","v","m","p","T","M","j","s","i","t","e","r","t","e","i","o","e","c","u","s","t","r","l","p","h","v","o","i","n","f","e","s","i","r","t","unsafeCSS","LitElement","nothing","classMap","repeat"],"sources":["../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/events.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/css.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/index.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/lit-html.js","../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directive.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/class-map.js","../src/threads-drawer/generated-tokens.ts","../src/threads-drawer/styles.ts","../src/threads-drawer/copilotkit-threads-drawer.ts","../src/threads-drawer/define.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * Map of ARIAMixin properties to attributes\n */\nexport const ariaMixinAttributes = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBrailleLabel: 'aria-braillelabel',\n ariaBrailleRoleDescription: 'aria-brailleroledescription',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColIndexText: 'aria-colindextext',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDescription: 'aria-description',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaInvalid: 'aria-invalid',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRelevant: 'aria-relevant',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowIndexText: 'aria-rowindextext',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role',\n};\n// Shim the global element internals object\n// Methods should be fine as noops and properties can generally\n// be while on the server.\nexport const ElementInternalsShim = class ElementInternals {\n get shadowRoot() {\n // Grab the shadow root instance from the Element shim\n // to ensure that the shadow root is always available\n // to the internals instance even if the mode is 'closed'\n return this.__host\n .__shadowRoot;\n }\n constructor(_host) {\n this.ariaActiveDescendantElement = null;\n this.ariaAtomic = '';\n this.ariaAutoComplete = '';\n this.ariaBrailleLabel = '';\n this.ariaBrailleRoleDescription = '';\n this.ariaBusy = '';\n this.ariaChecked = '';\n this.ariaColCount = '';\n this.ariaColIndex = '';\n this.ariaColIndexText = '';\n this.ariaColSpan = '';\n this.ariaControlsElements = null;\n this.ariaCurrent = '';\n this.ariaDescribedByElements = null;\n this.ariaDescription = '';\n this.ariaDetailsElements = null;\n this.ariaDisabled = '';\n this.ariaErrorMessageElements = null;\n this.ariaExpanded = '';\n this.ariaFlowToElements = null;\n this.ariaHasPopup = '';\n this.ariaHidden = '';\n this.ariaInvalid = '';\n this.ariaKeyShortcuts = '';\n this.ariaLabel = '';\n this.ariaLabelledByElements = null;\n this.ariaLevel = '';\n this.ariaLive = '';\n this.ariaModal = '';\n this.ariaMultiLine = '';\n this.ariaMultiSelectable = '';\n this.ariaOrientation = '';\n this.ariaOwnsElements = null;\n this.ariaPlaceholder = '';\n this.ariaPosInSet = '';\n this.ariaPressed = '';\n this.ariaReadOnly = '';\n this.ariaRelevant = '';\n this.ariaRequired = '';\n this.ariaRoleDescription = '';\n this.ariaRowCount = '';\n this.ariaRowIndex = '';\n this.ariaRowIndexText = '';\n this.ariaRowSpan = '';\n this.ariaSelected = '';\n this.ariaSetSize = '';\n this.ariaSort = '';\n this.ariaValueMax = '';\n this.ariaValueMin = '';\n this.ariaValueNow = '';\n this.ariaValueText = '';\n this.role = '';\n this.form = null;\n this.labels = [];\n this.states = new Set();\n this.validationMessage = '';\n this.validity = {};\n this.willValidate = true;\n this.__host = _host;\n }\n checkValidity() {\n // TODO(augustjk) Consider actually implementing logic.\n // See https://github.com/lit/lit/issues/3740\n console.warn('`ElementInternals.checkValidity()` was called on the server.' +\n 'This method always returns true.');\n return true;\n }\n reportValidity() {\n return true;\n }\n setFormValue() { }\n setValidity() { }\n};\nconst ElementInternalsShimWithRealType = ElementInternalsShim;\nexport { ElementInternalsShimWithRealType as ElementInternals };\nexport const HYDRATE_INTERNALS_ATTR_PREFIX = 'hydrate-internals-';\n//# sourceMappingURL=element-internals.js.map","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Event_cancelable, _Event_bubbles, _Event_composed, _Event_defaultPrevented, _Event_timestamp, _Event_propagationStopped, _Event_type, _Event_target, _Event_isBeingDispatched, _a, _CustomEvent_detail, _b;\nconst isCaptureEventListener = (options) => (typeof options === 'boolean' ? options : (options?.capture ?? false));\n// Event phases\nconst NONE = 0;\nconst CAPTURING_PHASE = 1;\nconst AT_TARGET = 2;\nconst BUBBLING_PHASE = 3;\n// Shim the global EventTarget object\nclass EventTarget {\n constructor() {\n this.__eventListeners = new Map();\n this.__captureEventListeners = new Map();\n }\n addEventListener(type, callback, options) {\n if (callback === undefined || callback === null) {\n return;\n }\n const eventListenersMap = isCaptureEventListener(options)\n ? this.__captureEventListeners\n : this.__eventListeners;\n let eventListeners = eventListenersMap.get(type);\n if (eventListeners === undefined) {\n eventListeners = new Map();\n eventListenersMap.set(type, eventListeners);\n }\n else if (eventListeners.has(callback)) {\n return;\n }\n const normalizedOptions = typeof options === 'object' && options ? options : {};\n normalizedOptions.signal?.addEventListener('abort', () => this.removeEventListener(type, callback, options));\n eventListeners.set(callback, normalizedOptions ?? {});\n }\n removeEventListener(type, callback, options) {\n if (callback === undefined || callback === null) {\n return;\n }\n const eventListenersMap = isCaptureEventListener(options)\n ? this.__captureEventListeners\n : this.__eventListeners;\n const eventListeners = eventListenersMap.get(type);\n if (eventListeners !== undefined) {\n eventListeners.delete(callback);\n if (!eventListeners.size) {\n eventListenersMap.delete(type);\n }\n }\n }\n dispatchEvent(event) {\n const composedPath = [this];\n let parent = this.__eventTargetParent;\n if (event.composed) {\n while (parent) {\n composedPath.push(parent);\n parent = parent.__eventTargetParent;\n }\n }\n else {\n // If the event is not composed and the event was dispatched inside\n // shadow DOM, we need to stop before the host of the shadow DOM.\n while (parent && parent !== this.__host) {\n composedPath.push(parent);\n parent = parent.__eventTargetParent;\n }\n }\n // We need to patch various properties that would either be empty or wrong\n // in this scenario.\n let stopPropagation = false;\n let stopImmediatePropagation = false;\n let eventPhase = NONE;\n let target = null;\n let tmpTarget = null;\n let currentTarget = null;\n const originalStopPropagation = event.stopPropagation;\n const originalStopImmediatePropagation = event.stopImmediatePropagation;\n Object.defineProperties(event, {\n target: {\n get() {\n return target ?? tmpTarget;\n },\n ...enumerableProperty,\n },\n srcElement: {\n get() {\n return event.target;\n },\n ...enumerableProperty,\n },\n currentTarget: {\n get() {\n return currentTarget;\n },\n ...enumerableProperty,\n },\n eventPhase: {\n get() {\n return eventPhase;\n },\n ...enumerableProperty,\n },\n composedPath: {\n value: () => composedPath,\n ...enumerableProperty,\n },\n stopPropagation: {\n value: () => {\n stopPropagation = true;\n originalStopPropagation.call(event);\n },\n ...enumerableProperty,\n },\n stopImmediatePropagation: {\n value: () => {\n stopImmediatePropagation = true;\n originalStopImmediatePropagation.call(event);\n },\n ...enumerableProperty,\n },\n });\n // An event handler can either be a function, an object with a handleEvent\n // method or null. This function takes care to call the event handler\n // correctly.\n const invokeEventListener = (listener, options, eventListenerMap) => {\n if (typeof listener === 'function') {\n listener(event);\n }\n else if (typeof listener?.handleEvent === 'function') {\n listener.handleEvent(event);\n }\n if (options.once) {\n eventListenerMap.delete(listener);\n }\n };\n // When an event is finished being dispatched, which can be after the event\n // tree has been traversed or stopPropagation/stopImmediatePropagation has\n // been called. Once that is the case, the currentTarget and eventPhase\n // need to be reset and a value, representing whether the event has not\n // been prevented, needs to be returned.\n const finishDispatch = () => {\n currentTarget = null;\n eventPhase = NONE;\n return !event.defaultPrevented;\n };\n // An event starts with the capture order, where it starts from the top.\n // This is done even if bubbles is set to false, which is the default.\n const captureEventPath = composedPath.slice().reverse();\n // If the event target, which dispatches the event, is either in the light DOM\n // or the event is not composed, the target is always itself. If that is not\n // the case, the target needs to be retargeted: https://dom.spec.whatwg.org/#retarget\n target = !this.__host || !event.composed ? this : null;\n const retarget = (eventTargets) => {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n tmpTarget = this;\n while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) {\n tmpTarget = tmpTarget.__host;\n }\n };\n for (const eventTarget of captureEventPath) {\n if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) {\n retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));\n }\n currentTarget = eventTarget;\n eventPhase = eventTarget === event.target ? AT_TARGET : CAPTURING_PHASE;\n const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);\n if (captureEventListeners) {\n for (const [listener, options] of captureEventListeners) {\n invokeEventListener(listener, options, captureEventListeners);\n if (stopImmediatePropagation) {\n // Event.stopImmediatePropagation() stops any following invocation\n // of an event handler even on the same event target.\n return finishDispatch();\n }\n }\n }\n if (stopPropagation) {\n // Event.stopPropagation() stops any following invocation\n // of an event handler for any following event targets.\n return finishDispatch();\n }\n }\n const bubbleEventPath = event.bubbles ? composedPath : [this];\n tmpTarget = null;\n for (const eventTarget of bubbleEventPath) {\n if (!target &&\n (!tmpTarget || eventTarget === tmpTarget.__host)) {\n retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));\n }\n currentTarget = eventTarget;\n eventPhase = eventTarget === event.target ? AT_TARGET : BUBBLING_PHASE;\n const captureEventListeners = eventTarget.__eventListeners.get(event.type);\n if (captureEventListeners) {\n for (const [listener, options] of captureEventListeners) {\n invokeEventListener(listener, options, captureEventListeners);\n if (stopImmediatePropagation) {\n // Event.stopImmediatePropagation() stops any following invocation\n // of an event handler even on the same event target.\n return finishDispatch();\n }\n }\n }\n if (stopPropagation) {\n // Event.stopPropagation() stops any following invocation\n // of an event handler for any following event targets.\n return finishDispatch();\n }\n }\n return finishDispatch();\n }\n}\nconst EventTargetShimWithRealType = EventTarget;\nexport { EventTargetShimWithRealType as EventTarget, EventTargetShimWithRealType as EventTargetShim, };\nconst enumerableProperty = { __proto__: null };\nenumerableProperty.enumerable = true;\nObject.freeze(enumerableProperty);\n// TODO: Remove this when we remove support for vm modules (--experimental-vm-modules).\nconst EventShim = (_a = class Event {\n constructor(type, options = {}) {\n _Event_cancelable.set(this, false);\n _Event_bubbles.set(this, false);\n _Event_composed.set(this, false);\n _Event_defaultPrevented.set(this, false);\n _Event_timestamp.set(this, Date.now());\n _Event_propagationStopped.set(this, false);\n _Event_type.set(this, void 0);\n _Event_target.set(this, void 0);\n _Event_isBeingDispatched.set(this, void 0);\n this.NONE = NONE;\n this.CAPTURING_PHASE = CAPTURING_PHASE;\n this.AT_TARGET = AT_TARGET;\n this.BUBBLING_PHASE = BUBBLING_PHASE;\n if (arguments.length === 0)\n throw new Error(`The type argument must be specified`);\n if (typeof options !== 'object' || !options) {\n throw new Error(`The \"options\" argument must be an object`);\n }\n const { bubbles, cancelable, composed } = options;\n __classPrivateFieldSet(this, _Event_cancelable, !!cancelable, \"f\");\n __classPrivateFieldSet(this, _Event_bubbles, !!bubbles, \"f\");\n __classPrivateFieldSet(this, _Event_composed, !!composed, \"f\");\n __classPrivateFieldSet(this, _Event_type, `${type}`, \"f\");\n __classPrivateFieldSet(this, _Event_target, null, \"f\");\n __classPrivateFieldSet(this, _Event_isBeingDispatched, false, \"f\");\n }\n initEvent(_type, _bubbles, _cancelable) {\n throw new Error('Method not implemented.');\n }\n stopImmediatePropagation() {\n this.stopPropagation();\n }\n preventDefault() {\n __classPrivateFieldSet(this, _Event_defaultPrevented, true, \"f\");\n }\n get target() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get currentTarget() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get srcElement() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get type() {\n return __classPrivateFieldGet(this, _Event_type, \"f\");\n }\n get cancelable() {\n return __classPrivateFieldGet(this, _Event_cancelable, \"f\");\n }\n get defaultPrevented() {\n return __classPrivateFieldGet(this, _Event_cancelable, \"f\") && __classPrivateFieldGet(this, _Event_defaultPrevented, \"f\");\n }\n get timeStamp() {\n return __classPrivateFieldGet(this, _Event_timestamp, \"f\");\n }\n composedPath() {\n return __classPrivateFieldGet(this, _Event_isBeingDispatched, \"f\") ? [__classPrivateFieldGet(this, _Event_target, \"f\")] : [];\n }\n get returnValue() {\n return !__classPrivateFieldGet(this, _Event_cancelable, \"f\") || !__classPrivateFieldGet(this, _Event_defaultPrevented, \"f\");\n }\n get bubbles() {\n return __classPrivateFieldGet(this, _Event_bubbles, \"f\");\n }\n get composed() {\n return __classPrivateFieldGet(this, _Event_composed, \"f\");\n }\n get eventPhase() {\n return __classPrivateFieldGet(this, _Event_isBeingDispatched, \"f\") ? _a.AT_TARGET : _a.NONE;\n }\n get cancelBubble() {\n return __classPrivateFieldGet(this, _Event_propagationStopped, \"f\");\n }\n set cancelBubble(value) {\n if (value) {\n __classPrivateFieldSet(this, _Event_propagationStopped, true, \"f\");\n }\n }\n stopPropagation() {\n __classPrivateFieldSet(this, _Event_propagationStopped, true, \"f\");\n }\n get isTrusted() {\n return false;\n }\n },\n _Event_cancelable = new WeakMap(),\n _Event_bubbles = new WeakMap(),\n _Event_composed = new WeakMap(),\n _Event_defaultPrevented = new WeakMap(),\n _Event_timestamp = new WeakMap(),\n _Event_propagationStopped = new WeakMap(),\n _Event_type = new WeakMap(),\n _Event_target = new WeakMap(),\n _Event_isBeingDispatched = new WeakMap(),\n _a.NONE = NONE,\n _a.CAPTURING_PHASE = CAPTURING_PHASE,\n _a.AT_TARGET = AT_TARGET,\n _a.BUBBLING_PHASE = BUBBLING_PHASE,\n _a);\nObject.defineProperties(EventShim.prototype, {\n initEvent: enumerableProperty,\n stopImmediatePropagation: enumerableProperty,\n preventDefault: enumerableProperty,\n target: enumerableProperty,\n currentTarget: enumerableProperty,\n srcElement: enumerableProperty,\n type: enumerableProperty,\n cancelable: enumerableProperty,\n defaultPrevented: enumerableProperty,\n timeStamp: enumerableProperty,\n composedPath: enumerableProperty,\n returnValue: enumerableProperty,\n bubbles: enumerableProperty,\n composed: enumerableProperty,\n eventPhase: enumerableProperty,\n cancelBubble: enumerableProperty,\n stopPropagation: enumerableProperty,\n isTrusted: enumerableProperty,\n});\n// TODO: Remove this when we remove support for vm modules (--experimental-vm-modules).\nconst CustomEventShim = (_b = class CustomEvent extends EventShim {\n constructor(type, options = {}) {\n super(type, options);\n _CustomEvent_detail.set(this, void 0);\n __classPrivateFieldSet(this, _CustomEvent_detail, options?.detail ?? null, \"f\");\n }\n initCustomEvent(_type, _bubbles, _cancelable, _detail) {\n throw new Error('Method not implemented.');\n }\n get detail() {\n return __classPrivateFieldGet(this, _CustomEvent_detail, \"f\");\n }\n },\n _CustomEvent_detail = new WeakMap(),\n _b);\nObject.defineProperties(CustomEventShim.prototype, {\n detail: enumerableProperty,\n});\nconst EventShimWithRealType = EventShim;\nconst CustomEventShimWithRealType = CustomEventShim;\nexport { EventShimWithRealType as Event, EventShimWithRealType as EventShim, CustomEventShimWithRealType as CustomEvent, CustomEventShimWithRealType as CustomEventShim, };\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar _a;\nconst MediaListShim = class MediaList extends Array {\n get mediaText() {\n return this.join(', ');\n }\n toString() {\n return this.mediaText;\n }\n appendMedium(medium) {\n if (!this.includes(medium)) {\n this.push(medium);\n }\n }\n deleteMedium(medium) {\n const index = this.indexOf(medium);\n if (index !== -1) {\n this.splice(index, 1);\n }\n }\n item(index) {\n return this[index] ?? null;\n }\n};\nconst MediaListShimWithRealType = MediaListShim;\nexport { MediaListShimWithRealType as MediaList };\nconst StyleSheetShim = class StyleSheet {\n constructor() {\n this.__media = new MediaListShim();\n this.disabled = false;\n }\n get href() {\n return null;\n }\n get media() {\n return this.__media;\n }\n get ownerNode() {\n return null;\n }\n get parentStyleSheet() {\n return null;\n }\n get title() {\n return null;\n }\n get type() {\n return 'text/css';\n }\n};\nconst StyleSheetShimWithRealType = StyleSheetShim;\nexport { StyleSheetShimWithRealType as StyleSheet };\nconst CSSRuleShim = (_a = class CSSRule {\n constructor() {\n this.STYLE_RULE = 1;\n this.CHARSET_RULE = 2;\n this.IMPORT_RULE = 3;\n this.MEDIA_RULE = 4;\n this.FONT_FACE_RULE = 5;\n this.PAGE_RULE = 6;\n this.NAMESPACE_RULE = 10;\n this.KEYFRAMES_RULE = 7;\n this.KEYFRAME_RULE = 8;\n this.SUPPORTS_RULE = 12;\n this.COUNTER_STYLE_RULE = 11;\n this.FONT_FEATURE_VALUES_RULE = 14;\n this.__parentStyleSheet = null;\n this.cssText = '';\n }\n get parentRule() {\n return null;\n }\n get parentStyleSheet() {\n return this.__parentStyleSheet;\n }\n get type() {\n return 0;\n }\n },\n _a.STYLE_RULE = 1,\n _a.CHARSET_RULE = 2,\n _a.IMPORT_RULE = 3,\n _a.MEDIA_RULE = 4,\n _a.FONT_FACE_RULE = 5,\n _a.PAGE_RULE = 6,\n _a.NAMESPACE_RULE = 10,\n _a.KEYFRAMES_RULE = 7,\n _a.KEYFRAME_RULE = 8,\n _a.SUPPORTS_RULE = 12,\n _a.COUNTER_STYLE_RULE = 11,\n _a.FONT_FEATURE_VALUES_RULE = 14,\n _a);\nconst CSSRuleShimWithRealType = CSSRuleShim;\nexport { CSSRuleShimWithRealType as CSSRule };\nconst CSSRuleListShim = class CSSRuleList extends Array {\n item(index) {\n return this[index] ?? null;\n }\n};\nconst CSSRuleListShimWithRealType = CSSRuleListShim;\nexport { CSSRuleListShimWithRealType as CSSRuleList };\nconst CSSStyleSheetShim = class CSSStyleSheet extends StyleSheetShim {\n constructor() {\n super(...arguments);\n this.__rules = new CSSRuleListShim();\n }\n get cssRules() {\n return this.__rules;\n }\n get ownerRule() {\n return null;\n }\n get rules() {\n return this.cssRules;\n }\n addRule(_selector, _style, _index) {\n throw new Error('Method not implemented.');\n }\n deleteRule(_index) {\n throw new Error('Method not implemented.');\n }\n insertRule(_rule, _index) {\n throw new Error('Method not implemented.');\n }\n removeRule(_index) {\n throw new Error('Method not implemented.');\n }\n replace(text) {\n this.replaceSync(text);\n return Promise.resolve(this);\n }\n replaceSync(text) {\n this.__rules.length = 0;\n const rule = new CSSRuleShim();\n rule.cssText = text;\n this.__rules.push(rule);\n }\n};\nconst CSSStyleSheetShimWithRealType = CSSStyleSheetShim;\nexport { CSSStyleSheetShimWithRealType as CSSStyleSheet, CSSStyleSheetShimWithRealType as CSSStyleSheetShim, };\n//# sourceMappingURL=css.js.map","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { ElementInternalsShim } from './lib/element-internals.js';\nimport { EventTargetShim, EventShim, CustomEventShim, } from './lib/events.js';\nexport { ariaMixinAttributes, ElementInternals, HYDRATE_INTERNALS_ATTR_PREFIX, } from './lib/element-internals.js';\nexport { CSSRule, CSSRuleList, CSSStyleSheet, MediaList, StyleSheet, } from './lib/css.js';\nexport { CustomEvent, Event, EventTarget } from './lib/events.js';\n// In an empty Node.js vm, we need to patch the global context.\n// TODO: Remove these globalThis assignments when we remove support\n// for vm modules (--experimental-vm-modules).\nglobalThis.Event ??= EventShim;\nglobalThis.CustomEvent ??= CustomEventShim;\nconst attributes = new WeakMap();\nconst attributesForElement = (element) => {\n let attrs = attributes.get(element);\n if (attrs === undefined) {\n attributes.set(element, (attrs = new Map()));\n }\n return attrs;\n};\n// The typings around the exports below are a little funky:\n//\n// 1. We want the `name` of the shim classes to match the real ones at runtime,\n// hence e.g. `class Element`.\n// 2. We can't shadow the global types with a simple class declaration, because\n// then we can't reference the global types for casting, hence e.g.\n// `const ElementShim = class Element`.\n// 3. We want to export the classes typed as the real ones, hence e.g.\n// `const ElementShimWithRealType = ElementShim as object as typeof Element;`.\n// 4. We want the exported names to match the real ones, hence e.g.\n// `export {ElementShimWithRealType as Element}`.\nconst ElementShim = class Element extends EventTargetShim {\n constructor() {\n super(...arguments);\n this.__shadowRootMode = null;\n this.__shadowRoot = null;\n this.__internals = null;\n }\n get attributes() {\n return Array.from(attributesForElement(this)).map(([name, value]) => ({\n name,\n value,\n }));\n }\n get shadowRoot() {\n if (this.__shadowRootMode === 'closed') {\n return null;\n }\n return this.__shadowRoot;\n }\n get localName() {\n return this.constructor.__localName;\n }\n get tagName() {\n return this.localName?.toUpperCase();\n }\n setAttribute(name, value) {\n // Emulate browser behavior that silently casts all values to string. E.g.\n // `42` becomes `\"42\"` and `{}` becomes `\"[object Object]\"\"`.\n attributesForElement(this).set(name, String(value));\n }\n removeAttribute(name) {\n attributesForElement(this).delete(name);\n }\n toggleAttribute(name, force) {\n // Steps reference https://dom.spec.whatwg.org/#dom-element-toggleattribute\n if (this.hasAttribute(name)) {\n // Step 5\n if (force === undefined || !force) {\n this.removeAttribute(name);\n return false;\n }\n }\n else {\n // Step 4\n if (force === undefined || force) {\n // Step 4.1\n this.setAttribute(name, '');\n return true;\n }\n else {\n // Step 4.2\n return false;\n }\n }\n // Step 6\n return true;\n }\n hasAttribute(name) {\n return attributesForElement(this).has(name);\n }\n attachShadow(init) {\n const shadowRoot = { host: this };\n this.__shadowRootMode = init.mode;\n if (init && init.mode === 'open') {\n this.__shadowRoot = shadowRoot;\n }\n return shadowRoot;\n }\n attachInternals() {\n if (this.__internals !== null) {\n throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': ` +\n `ElementInternals for the specified element was already attached.`);\n }\n const internals = new ElementInternalsShim(this);\n this.__internals = internals;\n return internals;\n }\n getAttribute(name) {\n const value = attributesForElement(this).get(name);\n return value ?? null;\n }\n};\nconst ElementShimWithRealType = ElementShim;\nexport { ElementShimWithRealType as Element };\nconst HTMLElementShim = class HTMLElement extends ElementShim {\n};\nconst HTMLElementShimWithRealType = HTMLElementShim;\nexport { HTMLElementShimWithRealType as HTMLElement };\n// For convenience, we provide a global instance of a HTMLElement as an event\n// target. This facilitates registering global event handlers\n// (e.g. for @lit/context ContextProvider).\n// We use this in in the SSR render function.\n// Note, this is a bespoke element and not simply `document` or `window` since\n// user code relies on these being undefined in the server environment.\nglobalThis.litServerRoot ??= Object.defineProperty(new HTMLElementShimWithRealType(), 'localName', {\n // Patch localName (and tagName) to return a unique name.\n get() {\n return 'lit-server-root';\n },\n});\nfunction promiseWithResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n}\nclass CustomElementRegistry {\n constructor() {\n this.__definitions = new Map();\n this.__reverseDefinitions = new Map();\n this.__pendingWhenDefineds = new Map();\n }\n define(name, ctor) {\n if (this.__definitions.has(name)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`'CustomElementRegistry' already has \"${name}\" defined. ` +\n `This may have been caused by live reload or hot module ` +\n `replacement in which case it can be safely ignored.\\n` +\n `Make sure to test your application with a production build as ` +\n `repeat registrations will throw in production.`);\n }\n else {\n throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': ` +\n `the name \"${name}\" has already been used with this registry`);\n }\n }\n if (this.__reverseDefinitions.has(ctor)) {\n throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': ` +\n `the constructor has already been used with this registry for the ` +\n `tag name ${this.__reverseDefinitions.get(ctor)}`);\n }\n // Provide tagName and localName for the component.\n ctor.__localName = name;\n this.__definitions.set(name, {\n ctor,\n // Note it's important we read `observedAttributes` in case it is a getter\n // with side-effects, as is the case in Lit, where it triggers class\n // finalization.\n //\n // TODO(aomarks) To be spec compliant, we should also capture the\n // registration-time lifecycle methods like `connectedCallback`. For them\n // to be actually accessible to e.g. the Lit SSR element renderer, though,\n // we'd need to introduce a new API for accessing them (since `get` only\n // returns the constructor).\n observedAttributes: ctor.observedAttributes ?? [],\n });\n this.__reverseDefinitions.set(ctor, name);\n this.__pendingWhenDefineds.get(name)?.resolve(ctor);\n this.__pendingWhenDefineds.delete(name);\n }\n get(name) {\n const definition = this.__definitions.get(name);\n return definition?.ctor;\n }\n getName(ctor) {\n return this.__reverseDefinitions.get(ctor) ?? null;\n }\n upgrade(_element) {\n // In SSR this doesn't make a lot of sense, so we do nothing.\n throw new Error(`customElements.upgrade is not currently supported in SSR. ` +\n `Please file a bug if you need it.`);\n }\n async whenDefined(name) {\n const definition = this.__definitions.get(name);\n if (definition) {\n return definition.ctor;\n }\n let withResolvers = this.__pendingWhenDefineds.get(name);\n if (!withResolvers) {\n withResolvers = promiseWithResolvers();\n this.__pendingWhenDefineds.set(name, withResolvers);\n }\n return withResolvers.promise;\n }\n}\nconst CustomElementRegistryShimWithRealType = CustomElementRegistry;\nexport { CustomElementRegistryShimWithRealType as CustomElementRegistry };\nexport const customElements = new CustomElementRegistryShimWithRealType();\n//# sourceMappingURL=index.js.map","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1],t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e||void 0===t.CSSStyleSheet?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{customElements as t,HTMLElement as s}from\"@lit-labs/ssr-dom-shim\";import{getCompatibleStyle as i,adoptStyles as e}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";const{is:h,defineProperty:r,getOwnPropertyDescriptor:o,getOwnPropertyNames:n,getOwnPropertySymbols:a,getPrototypeOf:c}=Object,l=globalThis;l.customElements??=t;const p=l.trustedTypes,d=p?p.emptyScript:\"\",u=l.reactiveElementPolyfillSupport,f=(t,s)=>t,b={toAttribute(t,s){switch(s){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,s)=>!h(t,s),y={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:m};Symbol.metadata??=Symbol(\"metadata\"),l.litPropertyMetadata??=new WeakMap;class g extends(globalThis.HTMLElement??s){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),e=this.getPropertyDescriptor(t,i,s);void 0!==e&&r(this.prototype,t,e)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=o(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const r=e?.call(this);h?.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(f(\"elementProperties\")))return;const t=c(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(f(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f(\"properties\"))){const t=this.properties,s=[...n(t),...a(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)s.unshift(i(t))}else void 0!==t&&s.push(i(t));return s}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return e(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:b).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null}}requestUpdate(t,s,i,e=!1,h){if(void 0!==t){const r=this.constructor;if(!1===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??m)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}g.elementStyles=[],g.shadowRootOptions={mode:\"open\"},g[f(\"elementProperties\")]=new Map,g[f(\"finalized\")]=new Map,u?.({ReactiveElement:g}),(l.reactiveElementVersions??=[]).push(\"2.1.2\");export{g as ReactiveElement,e as adoptStyles,b as defaultConverter,i as getCompatibleStyle,m as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t=>t,s=t.trustedTypes,e=s?s.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,h=\"$lit$\",o=`lit$${Math.random().toFixed(9).slice(2)}$`,n=\"?\"+o,r=`<${n}>`,l=void 0===t.document?{createTreeWalker:()=>({})}:document,c=()=>l.createComment(\"\"),a=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,u=Array.isArray,d=t=>u(t)||\"function\"==typeof t?.[Symbol.iterator],f=\"[ \\t\\n\\f\\r]\",v=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\\\s\"'>=/]+)(${f}*=${f}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),g=/'/g,$=/\"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),T=x(1),b=x(2),w=x(3),E=Symbol.for(\"lit-noChange\"),A=Symbol.for(\"lit-nothing\"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==e?e.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?\"!--\"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp(\"</\"+u[2],\"g\")),c=p):void 0!==u[3]&&(c=p):c===p?\">\"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'\"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===v?s+r:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o+x):s+o+(-2===d?i:x)}return[V(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:\".\"===e[1]?I:\"?\"===e[1]?L:\"@\"===e[1]?z:H}),r.removeAttribute(t)}else t.startsWith(o)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o),i=t.length-1;if(i>0){r.textContent=s?s.emptyScript:\"\";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c())}}}else if(8===r.nodeType)if(r.data===n)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(o,t+1));)d.push({type:7,index:l}),t+=o.length-1}l++}}static createElement(t,i){const s=l.createElement(\"template\");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class k{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,!0);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new R(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new W(h,this,t)),this._$AV.push(i),r=s[++n]}o!==r?.index&&(h=P.nextNode(),o++)}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a(t)?t===A||null==t||\"\"===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new k(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){const s=i(t).nextSibling;i(t).remove(),t=s}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=M(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class I extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}class L extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const Z={M:h,P:o,A:n,C:1,L:N,R:k,D:d,V:M,I:R,H,N:L,U:z,B:I,F:W},j=t.litHtmlPolyfillSupport;j?.(S,R),(t.litHtmlVersions??=[]).push(\"3.3.2\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(c(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,T as html,w as mathml,E as noChange,A as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.2\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter(s=>t[s]).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter(t=>\"\"!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","/**\n * GENERATED FILE — DO NOT EDIT BY HAND.\n *\n * Bundled default values for the drawer's design tokens, derived at build time\n * from the canonical theme (`packages/core/src/styles/css/theme.css`)\n * by `scripts/generate-tokens.ts`. Run `pnpm run gen:tokens` to regenerate.\n *\n * The drawer's shadow-DOM CSS references these as fallbacks, e.g.\n * `var(--cpk-drawer-bg, <built default>)`, so consumers can override every\n * token while the built-in skin stays in sync with the shared theme.\n */\nexport const GENERATED_DRAWER_TOKEN_DEFAULTS = {\n bg: \"oklch(1 0 0)\",\n fg: \"oklch(0.145 0 0)\",\n surface: \"oklch(1 0 0)\",\n \"surface-fg\": \"oklch(0.145 0 0)\",\n muted: \"oklch(0.97 0 0)\",\n \"muted-fg\": \"oklch(0.556 0 0)\",\n accent: \"oklch(0.97 0 0)\",\n \"accent-fg\": \"oklch(0.205 0 0)\",\n primary: \"oklch(0.205 0 0)\",\n \"primary-fg\": \"oklch(0.985 0 0)\",\n danger: \"oklch(0.577 0.245 27.325)\",\n border: \"oklch(0.922 0 0)\",\n ring: \"oklch(0.708 0 0)\",\n radius: \"0.625rem\",\n} as const satisfies Record<string, string>;\n\nexport type GeneratedDrawerTokenKey =\n keyof typeof GENERATED_DRAWER_TOKEN_DEFAULTS;\n","import { css, unsafeCSS } from \"lit\";\nimport { GENERATED_DRAWER_TOKEN_DEFAULTS } from \"./generated-tokens\";\n\n/**\n * Wraps a generated token default value so it can be safely interpolated into a\n * lit `css` template. Values come from the checked-in generated tokens file\n * (derived from react-core), never from user input, so `unsafeCSS` is safe\n * here.\n */\nconst tok = (value: string) => unsafeCSS(value);\nconst T = GENERATED_DRAWER_TOKEN_DEFAULTS;\n\n/**\n * Self-contained shadow-DOM styles for `<copilotkit-threads-drawer>`.\n *\n * Authoring rules baked in here:\n * - Every visual value is a `var(--cpk-drawer-<token>, <built default>)`. The\n * built defaults come from {@link GENERATED_DRAWER_TOKEN_DEFAULTS}, derived\n * from react-core's canonical theme at build time (anti-drift). Consumers\n * override by setting `--cpk-drawer-*` from the light DOM — CSS custom\n * properties pierce the shadow boundary by design.\n * - Inherited properties (font, color, line-height) are RE-PINNED on `:host`\n * so a hostile host stylesheet (`all: unset`, `* { ... !important }`,\n * Tailwind preflight) cannot leak into or strip styling from the element.\n * - Structural nodes expose `::part(...)` hooks for fine-grained theming.\n *\n * Token fallbacks are interpolated as literals (not runtime-read) so the CSS is\n * static and ships compiled.\n */\nexport const drawerStyles = css`\n :host {\n /* Re-pin inheritable properties to close inheritance leaks from hostile\n host CSS. These are the only properties that cross the shadow boundary\n via inheritance, so we hard-set them at the root. */\n all: initial;\n display: block;\n height: 100%;\n box-sizing: border-box;\n font-family: var(\n --cpk-drawer-font-family,\n ui-sans-serif,\n system-ui,\n sans-serif\n );\n font-size: var(--cpk-drawer-font-size, 14px);\n line-height: var(--cpk-drawer-line-height, 1.4);\n color: var(--cpk-drawer-fg, var(--foreground, ${tok(T.fg)}));\n\n /* Three-level token resolution, highest priority first:\n 1. explicit per-token override (--cpk-drawer-*),\n 2. the host app's theme variable (--background/--card/… — the standard\n react-core/shadcn names), so the drawer follows the host's light/dark\n theme by inheritance (custom properties are NOT reset by all:initial),\n 3. the built-in light default derived from react-core at build time, so a\n host with no theme still renders correctly (self-contained). */\n --_bg: var(--cpk-drawer-bg, var(--background, ${tok(T.bg)}));\n --_surface: var(--cpk-drawer-surface, var(--card, ${tok(T.surface)}));\n --_surface-fg: var(\n --cpk-drawer-surface-fg,\n var(--card-foreground, ${tok(T[\"surface-fg\"])})\n );\n --_muted: var(--cpk-drawer-muted, var(--muted, ${tok(T.muted)}));\n --_muted-fg: var(\n --cpk-drawer-muted-fg,\n var(--muted-foreground, ${tok(T[\"muted-fg\"])})\n );\n --_accent: var(--cpk-drawer-accent, var(--accent, ${tok(T.accent)}));\n --_accent-fg: var(\n --cpk-drawer-accent-fg,\n var(--accent-foreground, ${tok(T[\"accent-fg\"])})\n );\n --_primary: var(--cpk-drawer-primary, var(--primary, ${tok(T.primary)}));\n --_primary-fg: var(\n --cpk-drawer-primary-fg,\n var(--primary-foreground, ${tok(T[\"primary-fg\"])})\n );\n --_danger: var(--cpk-drawer-danger, var(--destructive, ${tok(T.danger)}));\n --_border: var(--cpk-drawer-border, var(--border, ${tok(T.border)}));\n --_ring: var(--cpk-drawer-ring, var(--ring, ${tok(T.ring)}));\n --_indicator: var(--cpk-drawer-indicator, #5b94e4);\n /* Cap the corner radius at 4px (per designer) — themeable but never larger. */\n --_radius: min(\n var(--cpk-drawer-radius, var(--radius, ${tok(T.radius)})),\n 4px\n );\n --_width: var(--cpk-drawer-width, 320px);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n .root {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: var(--_width);\n background: var(--_bg);\n border-right: 1px solid var(--_border);\n overflow: hidden;\n transition: width 0.2s ease;\n /* The confirm-delete dialog no longer needs a positioning context here: it\n is a native <dialog> opened with showModal(), which renders in the\n browser top layer independent of any stacking context (ENT-1051). No\n other direct child of .root is absolutely positioned (the filter and\n row-action popovers anchor to their own positioned ancestors), so .root\n stays static. The mobile path establishes its own context via\n position:fixed. */\n }\n\n /* Mobile: off-canvas overlay (modal pattern). */\n .root.mobile {\n position: fixed;\n inset: 0 auto 0 0;\n z-index: 1000;\n width: min(var(--_width), 85vw);\n transform: translateX(-100%);\n transition: transform 0.2s ease;\n box-shadow: 0 0 0 100vmax transparent;\n }\n\n .root.mobile.open {\n transform: translateX(0);\n }\n\n /* Desktop collapsed: the panel is replaced by the floating cluster, so remove\n it from the layout entirely. The host reclaims the reserved column via the\n --cpk-drawer-reserved-width:0px override the element sets on collapse. */\n .root.collapsed {\n display: none;\n }\n\n .backdrop {\n position: fixed;\n inset: 0;\n z-index: 999;\n background: rgba(0, 0, 0, 0.4);\n border: 0;\n padding: 0;\n margin: 0;\n cursor: pointer;\n }\n\n /* Floating launcher cluster (Figma \"closed\" mockup): a rounded surface card\n holding the sidebar toggle + a \"New Conversation\" (+) icon button. Rendered\n by the element itself in the mobile-closed AND desktop-collapsed states so\n there is always a way to reopen/expand — and to start a new conversation —\n with no host wiring. */\n .launcher-cluster {\n position: fixed;\n z-index: 998;\n /* Position is themeable so a host can line the cluster up with its own\n header controls (e.g. vertically centering it on a toggle group). */\n top: var(--cpk-drawer-launcher-top, 24px);\n left: var(--cpk-drawer-launcher-left, 24px);\n display: inline-flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: var(--_radius);\n border: 1px solid var(--_border);\n background: var(--_surface);\n color: var(--_surface-fg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);\n }\n\n .launcher {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 6px;\n border: 0;\n border-radius: calc(var(--_radius) - 3px);\n background: transparent;\n color: var(--_surface-fg);\n cursor: pointer;\n font: inherit;\n }\n\n .launcher:hover,\n .launcher:focus-visible {\n background: var(--_muted);\n }\n\n .launcher .icon {\n width: 18px;\n height: 18px;\n display: block;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n }\n\n /* The header is hidden until a consumer projects slot=\"header\" content\n (the redesign has no built-in header controls). Mirrors the memories/footer\n gating so an empty padded header bar never renders above the list. */\n .header[hidden] {\n display: none;\n }\n\n /* Optional consumer projection surface. When a consumer projects into\n slot=\"header\" it fills the header row. */\n .header slot[name=\"header\"] {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n }\n\n .icon-btn {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 6px;\n border: 0;\n border-radius: var(--_radius);\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n }\n\n /* \"Filter applied\" indicator dot at the funnel's bottom-right (Figma archived\n view). Shown only when a non-default filter is active. */\n .filter-dot {\n position: absolute;\n right: 3px;\n bottom: 4px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--_indicator);\n pointer-events: none;\n }\n\n .icon-btn:hover,\n .icon-btn:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .icon-btn[aria-pressed=\"true\"] {\n background: var(--_muted);\n color: inherit;\n }\n\n .icon {\n width: 20px;\n height: 20px;\n display: block;\n }\n\n .new-conversation {\n display: flex;\n align-items: center;\n gap: 12px;\n /* No top margin by default: the header bar (the collapse toggle on desktop,\n the close button on mobile-open) sits above this row and supplies the top\n spacing — the header-hidden case re-adds it below. Horizontal geometry\n matches the list rows: the hover background insets 12px (like a row's\n highlight) and, with 10px inner padding, the icon's left edge lands at\n 22px — the same x as the thread names below (list padding 12 + row\n padding 10). */\n margin: 0 12px;\n padding: 8px 10px;\n border: 0;\n border-radius: var(--_radius);\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n }\n\n /* Only when the header bar is fully hidden (collapsible=false AND no projected\n header content) is this row the first element — give it the top spacing the\n header would otherwise supply. */\n .header[hidden] + .new-conversation {\n margin-top: 12px;\n }\n\n .new-conversation:hover,\n .new-conversation:focus-visible {\n background: var(--_muted);\n }\n\n .new-conversation .icon {\n width: 16px;\n height: 16px;\n }\n\n .section-heading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n /* Match the list rows' content edge: \"Recent Conversations\" lands at 22px\n (margin 12 + padding 10), aligned with the thread names and the New\n Conversation icon; the funnel sits 22px from the right, over the kebabs. */\n padding: 8px 10px;\n margin: 0 12px;\n }\n\n .section-title {\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n color: var(--_muted-fg);\n text-transform: none;\n }\n\n .icon-btn.small {\n width: 24px;\n height: 24px;\n padding: 4px;\n }\n\n .icon-btn.small .icon {\n width: 16px;\n height: 16px;\n }\n\n .filter-popover {\n position: absolute;\n right: 0;\n top: calc(100% + 4px);\n z-index: 15;\n display: flex;\n flex-direction: column;\n min-width: 120px;\n padding: 4px;\n background: var(--_surface);\n color: var(--_surface-fg);\n border: 1px solid var(--_border);\n border-radius: var(--_radius);\n box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);\n }\n\n .filter-opt {\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n padding: 6px 8px;\n border-radius: 4px;\n }\n\n .filter-opt:hover,\n .filter-opt:focus-visible {\n background: var(--_muted);\n }\n\n .filter-opt[aria-pressed=\"true\"] {\n font-weight: 600;\n }\n\n .list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 8px 12px;\n margin: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border-radius: var(--_radius);\n cursor: pointer;\n background: transparent;\n color: inherit;\n border: 1px solid transparent;\n opacity: 0;\n transform: translateY(4px);\n animation: cpk-drawer-row-in 0.18s ease forwards;\n /* Positioned so the hovered row can be lifted above later rows (below). */\n position: relative;\n }\n\n /* Lift the interacted row above later rows so its kebab popover (which paints\n inside the row's own transform stacking context) is not clipped by / drawn\n under the rows below it. */\n .row:hover,\n .row:focus-within,\n .row.menu-open {\n z-index: 3;\n }\n\n /* While a kebab menu is open, the popover only covers part of the rows it\n overlaps, so the rest of the list would still respond to hover — revealing\n other rows' kebabs and (under a host \\`::part(row):hover\\` theme) painting a\n hover background \"through\"/around the open menu. Freeze pointer events on\n every OTHER row so the menu reads as a single focused surface. The owner\n row (\\`.menu-open\\`) and its popover stay interactive, and a pointerdown that\n lands on a frozen row still reaches the document handler that closes the\n menu, so click-away dismissal is preserved. */\n .list.menu-open .row:not(.menu-open) {\n pointer-events: none;\n }\n\n @keyframes cpk-drawer-row-in {\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .row.active {\n background: var(--_accent);\n color: var(--_accent-fg);\n /* No border on the selected row — the background change alone marks it\n (per designer). The base row keeps its 1px transparent border so the\n layout stays stable. */\n }\n\n .row.archived .row-name {\n color: var(--_muted-fg);\n font-style: italic;\n }\n\n .row-name {\n flex: 1;\n min-width: 0;\n }\n\n .row-name-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .row-name.placeholder {\n color: var(--_muted-fg);\n font-style: italic;\n }\n\n .row-name.revealed {\n animation: cpk-drawer-name-reveal 0.3s ease;\n }\n\n @keyframes cpk-drawer-name-reveal {\n from {\n opacity: 0.4;\n }\n to {\n opacity: 1;\n }\n }\n\n .row-action {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n border: 0;\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n padding: 5px;\n border-radius: 4px;\n }\n\n .row-action:hover,\n .row-action:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .row-action-icon {\n width: 15px;\n height: 15px;\n display: block;\n }\n\n /* Per-row kebab trigger: hidden at rest, revealed when the row is hovered,\n focused (keyboard), active (selected), or its menu is open. */\n .row-menu {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 4px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n opacity: 0;\n }\n\n .row:hover .row-menu,\n .row:focus-within .row-menu,\n .row.active .row-menu,\n .row-menu[aria-expanded=\"true\"] {\n opacity: 1;\n }\n\n .row-menu:hover,\n .row-menu:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .row-menu .icon {\n width: 16px;\n height: 16px;\n }\n\n .row-menu-popover {\n position: absolute;\n right: 8px;\n top: calc(100% - 4px);\n z-index: 16;\n display: flex;\n flex-direction: column;\n min-width: 140px;\n padding: 4px;\n background: var(--_surface);\n color: var(--_surface-fg);\n border: 1px solid var(--_border);\n border-radius: var(--_radius);\n box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);\n }\n\n /* Rows in the lower portion of the list open their kebab menu UPWARD so it is\n not clipped by the list's overflow scroll box (.list is overflow-y:auto,\n which also clips the x-axis). Anchoring to the button's top edge via\n \\`bottom\\` keeps the popover inside the list's visible area for bottom rows. */\n .row.menu-up .row-menu-popover {\n top: auto;\n bottom: calc(100% - 4px);\n }\n\n .row-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n padding: 6px 8px;\n border-radius: 4px;\n }\n\n .row-menu-item:hover,\n .row-menu-item:focus-visible {\n background: var(--_muted);\n }\n\n .row-menu-item.danger:hover,\n .row-menu-item.danger:focus-visible {\n color: var(--_danger);\n }\n\n .row-menu-item .row-action-icon,\n .row-menu-item .icon {\n width: 15px;\n height: 15px;\n }\n\n button.primary {\n background: var(--_primary);\n color: var(--_primary-fg);\n border: 0;\n border-radius: var(--_radius);\n padding: 8px 12px;\n cursor: pointer;\n font: inherit;\n }\n\n .state {\n padding: 24px 16px;\n text-align: center;\n color: var(--_muted-fg);\n }\n\n .state.error {\n color: var(--_danger);\n }\n\n .fetch-more-error {\n padding: 8px 12px;\n text-align: center;\n color: var(--_danger);\n font-size: 0.9em;\n }\n\n .load-more {\n display: block;\n width: 100%;\n padding: 8px 12px;\n background: none;\n border: none;\n color: var(--_muted-fg);\n font: inherit;\n font-size: 0.9em;\n cursor: pointer;\n }\n\n .load-more:hover,\n .load-more:focus-visible {\n color: var(--_surface-fg);\n background: var(--_muted);\n }\n\n .licensed {\n padding: 24px 16px;\n text-align: center;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .memories {\n border-top: 1px solid var(--_border);\n padding: 8px 12px;\n }\n\n .memories[hidden] {\n display: none;\n }\n\n /* Confirm-delete dialog — a native <dialog> opened with showModal(). It lives\n in the browser TOP LAYER, so it can never be painted under other UI (the\n old CSS-positioned overlay was trapped in the drawer host's stacking\n context and appeared under the chat's welcome view — ENT-1051). The UA\n centers it in the viewport via margin:auto; we reset the UA chrome and\n apply the drawer's surface-card look. */\n .dialog {\n /* Top-layer (showModal) so it is never clipped, but centered over the DRAWER\n PANEL rather than the viewport: JS sets --confirm-cx/cy from the visible\n .root rect (falls back to viewport-center when unmeasured, e.g. jsdom).\n Width is capped to the drawer band so it reads as \"inside the drawer\". */\n margin: 0;\n position: fixed;\n left: var(--confirm-cx, 50%);\n top: var(--confirm-cy, 50%);\n transform: translate(-50%, -50%);\n border: 0;\n padding: 16px;\n width: max-content;\n max-width: min(80vw, calc(var(--_width) - 24px));\n background: var(--_surface);\n color: var(--_surface-fg);\n border-radius: var(--_radius);\n }\n\n /* Only lay out the card contents when open. A closed <dialog> is display:none\n via the UA stylesheet, and author display rules must not override that (or\n an empty box would leak), so the flex layout is scoped to [open]. */\n .dialog[open] {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .dialog::backdrop {\n background: rgba(0, 0, 0, 0.3);\n }\n\n .dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n }\n\n .footer {\n border-top: 1px solid var(--_border);\n padding: 12px;\n }\n\n .footer[hidden] {\n display: none;\n }\n`;\n","import { LitElement, html, nothing } from \"lit\";\nimport type { PropertyValues } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { drawerStyles } from \"./styles\";\nimport type { DrawerFilter, DrawerThread, LicensedDetail } from \"./types\";\n\n/** Tag name the element registers under. */\nexport const COPILOTKIT_THREADS_DRAWER_TAG =\n \"copilotkit-threads-drawer\" as const;\n\n/** Mobile breakpoint (px). At or below this width the drawer is a modal overlay. */\nconst MOBILE_BREAKPOINT = 768;\n\n/**\n * Whether an inbound error message should surface an error state. Only a\n * non-empty, non-whitespace string counts — `null`, `\"\"`, and whitespace-only\n * strings are treated as \"no error\" so an empty error never conflates with a\n * real one (and never blanks the list behind an empty error panel).\n */\nfunction hasErrorMessage(value: string | null): value is string {\n return value !== null && value.trim().length > 0;\n}\n\n/**\n * Builds the per-row slot name (`row:<id>`) used for consumer projection, but\n * only when the thread id is safe to embed in a slot `name` / `slot` attribute\n * token. A slot name is matched character-for-character against the consumer's\n * `slot=\"...\"` attribute; whitespace splits attribute tokens and quotes/angle\n * brackets can break attribute serialization, so an id containing any of those\n * would silently fail projection. For such an id we return `null` and the row\n * renders its default name span (no per-row slot), which is the safe fallback.\n */\nfunction rowSlotName(id: string): string | null {\n // Reject whitespace and characters that are unsafe in an HTML attribute token.\n if (id.length === 0 || /[\\s\"'<>=]/.test(id)) return null;\n return `row:${id}`;\n}\n\n/**\n * Inline row-action icons. The element is framework-agnostic Lit, so it cannot\n * depend on a React icon library — these are the lucide `archive`,\n * `archive-restore`, and `trash-2` glyphs inlined as SVG, drawn with\n * `currentColor` so they inherit the button's themed color.\n */\nconst iconArchive = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n`;\nconst iconUnarchive = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n`;\nconst iconDelete = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M3 6h18\" />\n <path\n d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"\n />\n <line x1=\"10\" x2=\"10\" y1=\"11\" y2=\"17\" />\n <line x1=\"14\" x2=\"14\" y1=\"11\" y2=\"17\" />\n </svg>\n`;\n// Sidebar/panel glyph (the Figma toggle icon). Used for the desktop collapse\n// toggle, the desktop collapsed cluster's expand toggle, the mobile launcher\n// (open), and the mobile header dismiss (close) — the toggle glyph is identical\n// in every state, matching the Figma.\nconst iconSidebar = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n`;\n\n/**\n * Header / control icons for the redesigned drawer chrome (ENT-1051). Inlined\n * lucide glyphs (`square-plus`, `filter`, `ellipsis-vertical`) drawn with\n * `currentColor` so they inherit the button's themed color — the element cannot\n * depend on a React icon library.\n */\nconst iconPlusSquare = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M8 12h8\" />\n <path d=\"M12 8v8\" />\n </svg>\n`;\nconst iconFunnel = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"3\" y1=\"5\" x2=\"21\" y2=\"5\" />\n <line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\" />\n <line x1=\"10\" y1=\"19\" x2=\"14\" y2=\"19\" />\n </svg>\n`;\nconst iconKebab = html`\n <svg class=\"icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"5\" r=\"1.6\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.6\" />\n <circle cx=\"12\" cy=\"19\" r=\"1.6\" />\n </svg>\n`;\n\n/**\n * `<copilotkit-threads-drawer>` — a public, self-contained, controlled, framework-agnostic\n * threads drawer rendered into a shadow root.\n *\n * Pure VIEW: domain data (threads/loading/error/etc.) comes IN as properties and\n * user intent goes OUT as bubbling+composed DOM `CustomEvent`s. The element owns\n * VIEW state (open, Active/All filter, confirm-delete dialog, per-row\n * animations) while the consumer owns DOMAIN state. `open` is additionally\n * externally controllable via the `open` property + `open-change` event so a\n * host can coordinate mobile open/close.\n *\n * The element is AUTHORITATIVE over row order and the Active/All filter.\n */\nexport class CopilotKitThreadsDrawer extends LitElement {\n static styles = drawerStyles;\n\n static properties = {\n // Inbound domain properties.\n threads: { attribute: false },\n loading: { type: Boolean },\n error: { type: String },\n activeThreadId: { attribute: \"active-thread-id\", type: String },\n licensed: { type: Boolean },\n licenseUrl: { attribute: \"license-url\", type: String },\n hasMore: { attribute: \"has-more\", type: Boolean },\n fetchingMore: { attribute: \"fetching-more\", type: Boolean },\n fetchMoreError: { attribute: \"fetch-more-error\", type: String },\n // Inbound: configurable label for the drawer region and default header.\n label: { type: String },\n // Inbound: configurable \"Recent Conversations\" section heading text.\n recentLabel: { attribute: \"recent-label\", type: String },\n collapsible: { type: Boolean },\n // Externally-controllable VIEW state.\n open: { type: Boolean, reflect: true },\n collapsed: { type: Boolean, reflect: true },\n // Internal VIEW state.\n _filter: { state: true },\n _confirmingDeleteId: { state: true },\n _viewportIsMobile: { state: true },\n _hasHeader: { state: true },\n _hasMemories: { state: true },\n _hasFooter: { state: true },\n _filterOpen: { state: true },\n _openMenuId: { state: true },\n };\n\n /**\n * Inbound: accessible label for the drawer region — drives the screen-reader\n * region name (on `.root`) and the listbox name (on `.list`) ONLY. The\n * redesign has no visible title; project visible header chrome via the\n * optional `header` slot instead. Defaults to `\"Threads\"`.\n */\n label = \"Threads\";\n\n /**\n * Inbound: text for the \"Recent Conversations\" section heading above the list.\n * Attribute: `recent-label`. Defaults to `\"Recent Conversations\"`.\n */\n recentLabel = \"Recent Conversations\";\n\n /** Inbound: thread records to render. The element re-orders/filters them. */\n threads: DrawerThread[] = [];\n /** Inbound: initial-fetch loading flag. */\n loading = false;\n /** Inbound: initial-fetch error message (actionable Retry shown when set). */\n error: string | null = null;\n /** Inbound: currently-open thread id (drives row selection highlight). */\n activeThreadId: string | null = null;\n /** Inbound: whether the org is licensed for threads; `false` shows the locked view. */\n licensed = true;\n /**\n * Inbound: destination the Upgrade CTA opens (new tab) when the locked view's\n * default button is clicked. Defaults to the CopilotKit Intelligence docs.\n * Set to an empty string to suppress the default navigation and rely solely\n * on the `licensed` event.\n */\n licenseUrl = \"https://docs.copilotkit.ai/intelligence\";\n /** Inbound: whether more pages are available. */\n hasMore = false;\n /** Inbound: whether a fetch-more is in flight. */\n fetchingMore = false;\n /** Inbound: fetch-more error message (inline, list preserved). */\n fetchMoreError: string | null = null;\n\n /**\n * Externally-controllable: whether the drawer is open (mobile coordination).\n * Defaults to `false` so a mobile-width first render does NOT paint the open\n * modal (backdrop + body scroll-lock + focus steal) for one frame before a\n * wrapper's post-mount effect can close it. Desktop is unaffected — only\n * `.root.mobile.open` / `_isMobileModalOpen()` consume `open`.\n */\n open = false;\n /**\n * Externally-controllable: whether the drawer is collapsed to the floating\n * cluster on desktop. Defaults to `false` (expanded). Reflected so hosts can\n * theme on `[collapsed]`. Ignored on mobile, where open/closed governs the\n * off-canvas modal instead.\n */\n collapsed = false;\n /**\n * Inbound: whether the user may collapse the drawer on desktop. Defaults to\n * `true`. When `false` the header omits the collapse toggle and the drawer\n * NEVER renders the collapsed cluster on desktop (it stays expanded even if\n * `collapsed` is set) — mobile off-canvas open/close is independent.\n */\n collapsible = true;\n\n private _filter: DrawerFilter = \"active\";\n private _confirmingDeleteId: string | null = null;\n private _viewportIsMobile = false;\n private _hasHeader = false;\n private _hasMemories = false;\n private _hasFooter = false;\n /** Whether the funnel filter popover (Active/All) is open. */\n private _filterOpen = false;\n /** Id of the row whose kebab actions menu is open (only one at a time). */\n private _openMenuId: string | null = null;\n\n private _mediaQuery: MediaQueryList | null = null;\n private readonly _onMediaChange = (event: MediaQueryListEvent) => {\n this._viewportIsMobile = event.matches;\n };\n private readonly _onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n if (this._openMenuId !== null) {\n this._openMenuId = null;\n event.stopPropagation();\n return;\n }\n if (this._filterOpen) {\n this._filterOpen = false;\n event.stopPropagation();\n return;\n }\n // The confirm-delete <dialog> is opened with showModal(): the browser\n // dismisses it natively via the dialog's `cancel` event. But that Escape\n // keydown still bubbles from the modal to this host handler, so we must\n // stop here — otherwise it falls through to the mobile branch below and\n // closes the whole drawer along with the confirmation.\n if (this._confirmingDeleteId !== null) {\n event.stopPropagation();\n return;\n }\n if (this._viewportIsMobile && this.open) {\n this._setOpen(false);\n event.stopPropagation();\n }\n return;\n }\n // Tab focus-trap for the mobile modal. Handled at the HOST (not on `.root`)\n // so it fires wherever focus sits in the shadow root — including the\n // backdrop button, which renders as a sibling OUTSIDE `.root`. A trap bound\n // only to `.root` lets Tab from the backdrop (or any out-of-root node)\n // escape the modal to the page behind it.\n if (event.key === \"Tab\") {\n this._trapTab(event);\n }\n };\n\n /**\n * Dismisses the funnel filter popover and/or an open row-actions menu when a\n * pointerdown lands outside them. Bound to `document` (composed events bubble\n * out of the shadow root), so we discriminate inside vs. outside via\n * `composedPath()` rather than target identity. A click on a popover's own\n * trigger is treated as \"inside\" so its own `@click` toggle handles the close\n * (avoids a double-toggle that would immediately reopen it).\n */\n private readonly _onDocumentPointerDown = (event: Event) => {\n if (!this._filterOpen && this._openMenuId === null) return;\n const path = event.composedPath();\n if (this._filterOpen) {\n const popover = this.renderRoot.querySelector('[part=\"filters\"]');\n const trigger = this.renderRoot.querySelector('[part=\"filter-toggle\"]');\n const inside =\n (popover && path.includes(popover)) ||\n (trigger && path.includes(trigger));\n if (!inside) this._filterOpen = false;\n }\n if (this._openMenuId !== null) {\n const popover = this.renderRoot.querySelector(\n '[part=\"row-menu-popover\"]',\n );\n const trigger = this.renderRoot.querySelector(\n '.row.menu-open [part=\"row-menu\"]',\n );\n const inside =\n (popover && path.includes(popover)) ||\n (trigger && path.includes(trigger));\n if (!inside) this._openMenuId = null;\n }\n };\n\n /** Thread ids previously seen as named, so we can animate the null→named reveal. */\n private readonly _seenNamed = new Set<string>();\n /** Thread ids whose name just transitioned null→named in this update cycle. */\n private _justRevealed = new Set<string>();\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (typeof window !== \"undefined\" && window.matchMedia) {\n this._mediaQuery = window.matchMedia(\n `(max-width: ${MOBILE_BREAKPOINT}px)`,\n );\n this._viewportIsMobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n }\n this.addEventListener(\"keydown\", this._onKeyDown);\n if (typeof document !== \"undefined\") {\n document.addEventListener(\"pointerdown\", this._onDocumentPointerDown);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this.removeEventListener(\"keydown\", this._onKeyDown);\n if (typeof document !== \"undefined\") {\n document.removeEventListener(\"pointerdown\", this._onDocumentPointerDown);\n }\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"scroll\", this._repositionConfirm, true);\n window.removeEventListener(\"resize\", this._repositionConfirm);\n }\n // Release the reserved-width override we may have set on the document root.\n if (typeof document !== \"undefined\") {\n document.documentElement.style.removeProperty(\n \"--cpk-drawer-reserved-width\",\n );\n }\n this._releaseScrollLock();\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n // Compute the null→named reveal set BEFORE render, so render stays pure.\n if (changed.has(\"threads\")) {\n const presentIds = new Set<string>();\n const revealed = new Set<string>();\n for (const thread of this.threads) {\n presentIds.add(thread.id);\n const hasName = thread.name !== null && thread.name !== \"\";\n if (hasName && !this._seenNamed.has(thread.id)) {\n revealed.add(thread.id);\n }\n if (hasName) this._seenNamed.add(thread.id);\n }\n // Prune ids no longer present so `_seenNamed` cannot grow without bound\n // across a long-lived, high-churn session.\n for (const id of this._seenNamed) {\n if (!presentIds.has(id)) this._seenNamed.delete(id);\n }\n this._justRevealed = revealed;\n\n // Auto-dismiss a pending confirm-delete whose target is no longer in the\n // visible threads (the consumer removed/archived/filtered it away while\n // the dialog was open). Without this the dialog could emit `delete` with a\n // stale id. Reconciled against the SAME visible set the user is acting on.\n if (this._confirmingDeleteId !== null) {\n const stillVisible = this._visibleThreads().some(\n (t) => t.id === this._confirmingDeleteId,\n );\n if (!stillVisible) this._confirmingDeleteId = null;\n }\n\n // Same reconciliation for an open row-actions menu: if the row whose\n // kebab menu is open is no longer visible (removed/archived/filtered\n // away), close the menu so it cannot linger detached from any row.\n if (this._openMenuId !== null) {\n const stillVisible = this._visibleThreads().some(\n (t) => t.id === this._openMenuId,\n );\n if (!stillVisible) this._openMenuId = null;\n }\n }\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n // Scroll-lock is a mobile-modal concern only.\n if (\n changed.has(\"open\") ||\n changed.has(\"_viewportIsMobile\" as keyof CopilotKitThreadsDrawer)\n ) {\n if (this._isMobileModalOpen()) {\n this._applyScrollLock();\n this._focusFirstFocusable();\n } else {\n this._releaseScrollLock();\n }\n }\n\n // Reclaim the reserved layout column when the desktop collapse state (or the\n // viewport) changes.\n if (\n changed.has(\"collapsed\") ||\n changed.has(\"collapsible\") ||\n changed.has(\"_viewportIsMobile\" as keyof CopilotKitThreadsDrawer)\n ) {\n this._syncReservedWidth();\n }\n\n // Drive the native top-layer <dialog> from the confirm state. Opening with\n // showModal() places it in the browser top layer (above every stacking\n // context) so it is never clipped; we then re-center it over the drawer\n // panel via _positionConfirmDialog(). Feature-detect showModal/close because\n // jsdom implements neither — fall back to toggling the `open` attribute so\n // unit tests still observe the open/closed state.\n const dialog = this.renderRoot.querySelector(\"dialog\");\n if (dialog) {\n const id = this._confirmingDeleteId;\n if (id !== null && !dialog.open) {\n typeof dialog.showModal === \"function\"\n ? dialog.showModal()\n : dialog.setAttribute(\"open\", \"\");\n this._positionConfirmDialog();\n window.addEventListener(\"scroll\", this._repositionConfirm, true);\n window.addEventListener(\"resize\", this._repositionConfirm);\n } else if (id === null && dialog.open) {\n typeof dialog.close === \"function\"\n ? dialog.close()\n : dialog.removeAttribute(\"open\");\n window.removeEventListener(\"scroll\", this._repositionConfirm, true);\n window.removeEventListener(\"resize\", this._repositionConfirm);\n }\n }\n\n // The reveal animation fires exactly once per real name-arrival. Clearing\n // the set after the render that applied the `revealed` class prevents any\n // later, unrelated re-render from re-adding the class and re-firing the\n // animation. `_justRevealed` is a plain field (not reactive), so resetting\n // it here does not schedule another update.\n if (this._justRevealed.size > 0) {\n this._justRevealed = new Set<string>();\n }\n }\n\n // --- View-state helpers ----------------------------------------------------\n\n private _isMobileModalOpen(): boolean {\n return this._viewportIsMobile && this.open;\n }\n\n private _setOpen(next: boolean): void {\n if (this.open === next) return;\n this.open = next;\n this._emit(\"open-change\", { open: next });\n }\n\n private _setCollapsed(next: boolean): void {\n if (this.collapsed === next) return;\n this.collapsed = next;\n this._emit(\"collapse-change\", { collapsed: next });\n }\n\n /**\n * Signal the drawer's reserved layout width to the host so a desktop collapse\n * reclaims the column instead of leaving an empty gap. On desktop-collapse we\n * set `--cpk-drawer-reserved-width: 0px` on the document root; a host whose\n * grid reads `grid-template-columns: var(--cpk-drawer-reserved-width, 320px) …`\n * inherits it and collapses the track (with its own transition). Expanded/mobile\n * clears the override so the host's fallback width applies — which also means\n * the default (expanded) render never sets it, so there is no hydration flicker.\n *\n * It is set on `document.documentElement` (not `parentElement`) BECAUSE the\n * element is nested inside a framework wrapper host, so its parent is the\n * wrapper — not the grid container, which is an ancestor a child's custom\n * property can't reach. `:root` inheritance reaches the grid regardless of\n * wrapper nesting. Best-effort + namespaced, single-drawer-per-document; a host\n * with multiple drawers or a custom layout should instead react to the\n * `collapse-change` event.\n */\n private _syncReservedWidth(): void {\n if (typeof document === \"undefined\") return;\n const desktopCollapsed =\n this.collapsible && this.collapsed && !this._viewportIsMobile;\n const root = document.documentElement;\n if (desktopCollapsed) {\n root.style.setProperty(\"--cpk-drawer-reserved-width\", \"0px\");\n } else {\n root.style.removeProperty(\"--cpk-drawer-reserved-width\");\n }\n }\n\n /**\n * Center the confirm-delete <dialog> over the drawer PANEL's on-screen box\n * (not the viewport). The dialog stays a top-layer `showModal()` element so it\n * is never clipped, but we drive its center via `--confirm-cx/cy` measured\n * from the visible `.root` rect — so it reads as \"inside the drawer\" per the\n * ENT-1051 design while keeping the top-layer robustness. Falls back to\n * viewport-center (the CSS default) when the panel isn't measurable\n * (SSR/jsdom).\n */\n private _positionConfirmDialog(): void {\n const dialog = this.renderRoot.querySelector<HTMLDialogElement>(\"dialog\");\n const root = this.renderRoot.querySelector<HTMLElement>(\".root\");\n if (!dialog) return;\n const rect = root?.getBoundingClientRect();\n if (!rect || (rect.width === 0 && rect.height === 0)) {\n dialog.style.removeProperty(\"--confirm-cx\");\n dialog.style.removeProperty(\"--confirm-cy\");\n return;\n }\n // Center over the drawer's VISIBLE box (its rect intersected with the\n // viewport), not the raw rect: a host grid that doesn't bound the drawer's\n // row lets `.root` grow to content height, so a raw-rect center would land\n // far down the page. Intersecting with the viewport keeps the modal centered\n // in the on-screen drawer band regardless of how the host sizes the panel.\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const visLeft = Math.max(rect.left, 0);\n const visRight = Math.min(rect.right, vw);\n const visTop = Math.max(rect.top, 0);\n const visBottom = Math.min(rect.bottom, vh);\n dialog.style.setProperty(\"--confirm-cx\", `${(visLeft + visRight) / 2}px`);\n dialog.style.setProperty(\"--confirm-cy\", `${(visTop + visBottom) / 2}px`);\n }\n\n /** Bound reposition handler for scroll/resize while the confirm dialog is open. */\n private _repositionConfirm = () => this._positionConfirmDialog();\n\n private _setFilter(next: DrawerFilter): void {\n if (this._filter === next) return;\n this._filter = next;\n this._emit(\"filter-change\", { filter: next });\n }\n\n /**\n * Element-authoritative ordering + filtering. Active filter hides archived\n * threads; ordering is most-recent-first by `lastRunAt`/`updatedAt`.\n */\n private _visibleThreads(): DrawerThread[] {\n const filtered =\n this._filter === \"active\"\n ? this.threads.filter((t) => !t.archived)\n : this.threads;\n // Parse to a timestamp; a malformed/absent value yields `null` (NOT epoch 0)\n // so bad data is never silently treated as 1970. Threads with a valid\n // timestamp sort most-recent-first; threads with no parseable timestamp\n // keep their incoming relative order and sort after the dated ones.\n const ts = (t: DrawerThread): number | null => {\n const raw = t.lastRunAt ?? t.updatedAt ?? t.createdAt;\n const parsed = Date.parse(raw);\n return Number.isNaN(parsed) ? null : parsed;\n };\n return [...filtered]\n .map((thread, index) => ({ thread, index, ts: ts(thread) }))\n .sort((a, b) => {\n if (a.ts === null && b.ts === null) return a.index - b.index;\n if (a.ts === null) return 1;\n if (b.ts === null) return -1;\n if (a.ts !== b.ts) return b.ts - a.ts;\n return a.index - b.index;\n })\n .map((entry) => entry.thread);\n }\n\n private _emit<T>(type: string, detail: T): void {\n this.dispatchEvent(\n new CustomEvent(type, { detail, bubbles: true, composed: true }),\n );\n }\n\n // --- Scroll lock + focus (mobile modal only) -------------------------------\n\n private _scrollLocked = false;\n private _prevBodyOverflow = \"\";\n\n private _applyScrollLock(): void {\n if (this._scrollLocked || typeof document === \"undefined\") return;\n this._prevBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n this._scrollLocked = true;\n }\n\n private _releaseScrollLock(): void {\n if (!this._scrollLocked || typeof document === \"undefined\") return;\n document.body.style.overflow = this._prevBodyOverflow;\n this._scrollLocked = false;\n }\n\n /**\n * Returns the focusable elements in the composed/flattened tree of the drawer\n * root, INCLUDING slotted light-DOM content (so a focus trap covers slotted\n * rows). Walks assigned nodes of each `<slot>`.\n */\n private _composedFocusable(): HTMLElement[] {\n const selector =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n const out: HTMLElement[] = [];\n // The backdrop button is a modal-owned focusable rendered as a sibling of\n // `.root`. Include it first (it precedes `.root` in DOM order) so the focus\n // trap treats it as part of the modal's cycle rather than an escape hatch.\n const backdrop = this.renderRoot.querySelector<HTMLElement>(\".backdrop\");\n if (backdrop) out.push(backdrop);\n const root = this.renderRoot.querySelector(\".root\");\n if (!root) return out;\n const collect = (node: ParentNode) => {\n node\n .querySelectorAll<HTMLElement>(selector)\n .forEach((el) => out.push(el));\n };\n collect(root);\n root.querySelectorAll(\"slot\").forEach((slot) => {\n (slot as HTMLSlotElement)\n .assignedElements({ flatten: true })\n .forEach((assigned) => {\n if (assigned.matches(selector)) out.push(assigned as HTMLElement);\n collect(assigned);\n });\n });\n return out;\n }\n\n private _focusFirstFocusable(): void {\n // Defer so the rendered tree exists.\n queueMicrotask(() => {\n const focusable = this._composedFocusable();\n // Prefer the first real control over the backdrop scrim so opening the\n // modal lands focus on actionable content, not the close-on-click overlay\n // (the backdrop is still part of the trap cycle below).\n const backdrop = this.renderRoot.querySelector(\".backdrop\");\n const target = focusable.find((el) => el !== backdrop) ?? focusable[0];\n target?.focus();\n });\n }\n\n private readonly _trapTab = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\" || !this._isMobileModalOpen()) return;\n const focusable = this._composedFocusable();\n if (focusable.length === 0) return;\n const first = focusable[0]!;\n const last = focusable[focusable.length - 1]!;\n const active =\n (this.renderRoot as ShadowRoot).activeElement ?? document.activeElement;\n if (event.shiftKey && active === first) {\n last.focus();\n event.preventDefault();\n } else if (!event.shiftKey && active === last) {\n first.focus();\n event.preventDefault();\n }\n };\n\n // --- Render ----------------------------------------------------------------\n\n override render() {\n // Collapsed to the floating cluster on desktop (gated on `collapsible`), OR\n // closed on mobile — both show the same launcher cluster and hide the panel\n // body. Mobile keeps the body rendered (off-canvas, ready to slide in);\n // desktop-collapsed omits it entirely so the reserved column can reclaim.\n const desktopCollapsed =\n this.collapsible && this.collapsed && !this._viewportIsMobile;\n const mobileClosed = this._viewportIsMobile && !this.open;\n const showCluster = desktopCollapsed || mobileClosed;\n const rootClasses = {\n root: true,\n mobile: this._viewportIsMobile,\n open: this.open,\n collapsed: desktopCollapsed,\n };\n\n return html`\n ${showCluster ? this._renderCluster() : nothing}\n ${\n this._isMobileModalOpen()\n ? html`<button\n class=\"backdrop\"\n part=\"backdrop\"\n aria-label=\"Close threads drawer\"\n @click=${() => this._setOpen(false)}\n ></button>`\n : nothing\n }\n <div\n class=${classMap(rootClasses)}\n part=\"root\"\n role=${this._isMobileModalOpen() ? \"dialog\" : \"region\"}\n aria-modal=${this._isMobileModalOpen() ? \"true\" : nothing}\n aria-hidden=${desktopCollapsed ? \"true\" : nothing}\n aria-label=${this.label}\n >\n ${\n desktopCollapsed\n ? nothing\n : html`${this._renderHeader()} ${this._renderBody()}\n ${this._renderMemories()} ${this._renderFooter()}\n ${this._renderConfirmDialog()}`\n }\n </div>\n `;\n }\n\n /**\n * Floating launcher cluster from the Figma \"closed\" mockup: a sidebar-glyph\n * toggle + a \"New Conversation\" (+) icon button. Shown in TWO states — the\n * mobile closed state (toggle opens the off-canvas modal) and the desktop\n * collapsed state (toggle expands the sidebar). The primary toggle keeps\n * `part=\"launcher\"` for mobile-launcher theme compat; the new-thread button is\n * suppressed in the locked/unlicensed view, mirroring the New Conversation row.\n */\n private _renderCluster() {\n const onToggle = this._viewportIsMobile\n ? () => this._setOpen(true)\n : () => this._setCollapsed(false);\n const toggleLabel = this._viewportIsMobile\n ? \"Open threads\"\n : \"Expand threads\";\n return html`\n <div class=\"launcher-cluster\" part=\"launcher-cluster\">\n <button\n class=\"launcher\"\n part=\"launcher\"\n aria-label=${toggleLabel}\n @click=${onToggle}\n >\n <slot name=\"launcher-icon\">${iconSidebar}</slot>\n </button>\n ${\n this.licensed\n ? html`<button\n class=\"launcher launcher-new-thread\"\n part=\"launcher-new-thread\"\n aria-label=\"New Conversation\"\n @click=${() => this._emit(\"new-thread\", {})}\n >\n ${iconPlusSquare}\n </button>`\n : nothing\n }\n </div>\n `;\n }\n\n private _renderHeader() {\n // The header is a reserved consumer-projection surface with no built-in\n // controls (search and the desktop collapse toggle were both removed), so\n // it stays hidden until a consumer projects `slot=\"header\"` content — a\n // `slotchange` listener drives `_hasHeader`, mirroring the memories/footer\n // gating. Without this gate the empty padded header bar would render above\n // the \"New Conversation\" row. The \"New Conversation\" row is suppressed in\n // the locked/unlicensed view (only the Upgrade panel shows), mirroring the\n // section-heading gating.\n // On mobile the drawer is an off-canvas modal, so it needs an in-header\n // close affordance (desktop is a persistent sidebar — nothing to close).\n // The header therefore also renders when the mobile modal is open, even\n // with no projected `slot=\"header\"` content.\n const showMobileClose = this._viewportIsMobile && this.open;\n // Desktop collapse toggle: always available on desktop when collapsing is\n // permitted, so the header renders on desktop even with no projected\n // `slot=\"header\"` content. Mobile uses the launcher/close affordances.\n const showCollapseToggle = this.collapsible && !this._viewportIsMobile;\n return html`\n <div\n class=\"header\"\n part=\"header\"\n ?hidden=${!this._hasHeader && !showMobileClose && !showCollapseToggle}\n >\n <slot\n name=\"header\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasHeader = slot.assignedElements().length > 0;\n }}\n ></slot>\n ${\n // Toggle sits at the END so it right-aligns (the projected header slot\n // has flex:1 and pushes it over) — matching the mobile close button.\n showCollapseToggle\n ? html`<button\n class=\"icon-btn\"\n part=\"collapse-toggle\"\n aria-label=\"Collapse threads\"\n @click=${() => this._setCollapsed(true)}\n >\n ${iconSidebar}\n </button>`\n : nothing\n }\n ${\n showMobileClose\n ? html`<button\n class=\"icon-btn\"\n part=\"close-toggle\"\n aria-label=\"Close threads\"\n @click=${() => this._setOpen(false)}\n >\n ${iconSidebar}\n </button>`\n : nothing\n }\n </div>\n ${this.licensed ? this._renderNewConversation() : nothing}\n ${this._renderSectionHeading()}\n `;\n }\n\n /**\n * Dedicated full-width \"New Conversation\" row. Keeps `part=\"new-thread-button\"`\n * and fires the existing `new-thread` event, so wrappers/themes that hook the\n * old header pill are unaffected.\n */\n private _renderNewConversation() {\n return html`\n <button\n class=\"new-conversation\"\n part=\"new-thread-button\"\n @click=${() => this._emit(\"new-thread\", {})}\n >\n ${iconPlusSquare}\n <span>New Conversation</span>\n </button>\n `;\n }\n\n /**\n * \"Recent Conversations\" section heading with a funnel button that opens the\n * Active/All filter popover. Only shown when the list region is shown\n * (licensed, and not the full-panel error/empty-before-load) — mirrors the\n * old filters gate. The popover options keep `part=\"filter-active\"` /\n * `part=\"filter-all\"` and still emit `filter-change` via `_setFilter`.\n */\n private _renderSectionHeading() {\n if (\n !this.licensed ||\n (hasErrorMessage(this.error) && this.threads.length === 0)\n ) {\n return nothing;\n }\n return html`\n <div class=\"section-heading\" part=\"section-heading\">\n <span class=\"section-title\">${this.recentLabel}</span>\n <button\n class=\"icon-btn small\"\n part=\"filter-toggle\"\n aria-label=\"Filter threads\"\n aria-expanded=${this._filterOpen}\n @click=${() => (this._filterOpen = !this._filterOpen)}\n >\n ${iconFunnel}\n ${\n // \"Filter applied\" indicator dot — shown whenever the active filter\n // is not the default (\"active\"), matching the Figma's archived view.\n this._filter !== \"active\"\n ? html`\n <span class=\"filter-dot\" part=\"filter-indicator\"></span>\n `\n : nothing\n }\n </button>\n ${\n this._filterOpen\n ? html`<div\n class=\"filter-popover\"\n part=\"filters\"\n role=\"group\"\n aria-label=\"Filter threads\"\n >\n <button\n class=\"filter-opt\"\n part=\"filter-active\"\n aria-pressed=${this._filter === \"active\"}\n @click=${() => {\n this._setFilter(\"active\");\n this._filterOpen = false;\n }}\n >\n Active\n </button>\n <button\n class=\"filter-opt\"\n part=\"filter-all\"\n aria-pressed=${this._filter === \"all\"}\n @click=${() => {\n this._setFilter(\"all\");\n this._filterOpen = false;\n }}\n >\n All\n </button>\n </div>`\n : nothing\n }\n </div>\n `;\n }\n\n private _renderBody() {\n // The locked view beats error: an unlicensed org always sees it, never the\n // initial-fetch error.\n if (!this.licensed) return this._renderLicensed();\n // The full-panel error replaces the list ONLY when there is nothing to show\n // (a failed initial fetch). The bound `error` reflects the core store error,\n // which a failed mutation (delete/rename/archive) also sets — a delete\n // rollback restores its row, so when threads are still present we keep the\n // list visible rather than blanking it behind a \"couldn't load\" panel.\n if (hasErrorMessage(this.error) && this.threads.length === 0) {\n return this._renderError();\n }\n // Full-panel loading only when there is nothing to show yet (initial fetch).\n // A refetch (e.g. filter toggle Active<->All) keeps `loading` true while the\n // list is already populated — keep showing the known threads rather than\n // flashing the loading state over them.\n if (this.loading && this.threads.length === 0) return this._renderLoading();\n return this._renderList();\n }\n\n /**\n * Handles the Upgrade CTA click in the locked view. Dispatches a cancelable\n * `licensed` event carrying the resolved `licenseUrl`; unless a host calls\n * `preventDefault()`, opens that URL in a new tab. A blank `licenseUrl`\n * suppresses navigation so the event alone drives host behavior.\n */\n private _onLicensedCta(): void {\n const proceed = this.dispatchEvent(\n new CustomEvent(\"licensed\", {\n detail: { licenseUrl: this.licenseUrl } satisfies LicensedDetail,\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (proceed && this.licenseUrl && typeof window !== \"undefined\") {\n window.open(this.licenseUrl, \"_blank\", \"noopener,noreferrer\");\n }\n }\n\n private _renderLicensed() {\n return html`\n <div class=\"licensed\" part=\"licensed\" data-testid=\"drawer-licensed\">\n <slot name=\"licensed\">\n <p>Threads are a CopilotKit Intelligence feature.</p>\n <button\n class=\"primary\"\n part=\"licensed-cta\"\n @click=${() => this._onLicensedCta()}\n >\n Upgrade\n </button>\n </slot>\n </div>\n `;\n }\n\n private _renderError() {\n return html`\n <div\n class=\"state error\"\n part=\"error\"\n role=\"alert\"\n data-testid=\"drawer-error\"\n >\n <p>${this.error}</p>\n <button\n class=\"primary\"\n part=\"retry-button\"\n @click=${() => this._emit(\"retry\", { scope: \"initial\" })}\n >\n Retry\n </button>\n </div>\n `;\n }\n\n private _renderLoading() {\n return html`\n <div class=\"state\" part=\"loading\" data-testid=\"drawer-loading\" aria-busy=\"true\">\n Loading threads…\n </div>\n `;\n }\n\n private _renderList() {\n const visible = this._visibleThreads();\n if (visible.length === 0) {\n return html`\n <div class=\"state\" part=\"empty\" data-testid=\"drawer-empty\">\n <slot name=\"empty\">No threads yet.</slot>\n </div>\n `;\n }\n return html`\n <ul\n class=${this._openMenuId !== null ? \"list menu-open\" : \"list\"}\n part=\"list\"\n role=\"listbox\"\n aria-label=${this.label}\n >\n ${repeat(\n visible,\n (thread) => thread.id,\n (thread, index) => this._renderRow(thread, index, visible.length),\n )}\n </ul>\n ${this._renderFetchMore()}\n `;\n }\n\n private _renderRow(thread: DrawerThread, index = 0, total = 1) {\n const isActive = thread.id === this.activeThreadId;\n const hasName = thread.name !== null && thread.name !== \"\";\n // Shared display-name fallback: an empty-string (or null) name reads as\n // \"New thread\" for BOTH the visible label and every row-action aria-label,\n // so a screen reader never announces \"Actions for \" / \"Archive thread \".\n const displayName = hasName ? (thread.name as string) : \"New thread\";\n const justRevealed = this._justRevealed.has(thread.id);\n\n const menuOpen = this._openMenuId === thread.id;\n // The kebab popover opens downward by default (`top: 100%`). For rows in the\n // lower portion of the list, a downward menu would be clipped by the list's\n // `overflow-y: auto` scroll box (which also clips the x-axis). Flip those\n // rows' menu to open UPWARD (toward the list interior) via `menu-up`, so the\n // popover for bottom rows is never lost behind the list's bottom edge.\n const menuUp = menuOpen && total > 1 && index >= total / 2;\n\n const rowClasses = {\n row: true,\n active: isActive,\n archived: thread.archived,\n \"menu-open\": menuOpen,\n \"menu-up\": menuUp,\n };\n const nameClasses = {\n \"row-name\": true,\n placeholder: !hasName,\n revealed: justRevealed,\n };\n const slotName = rowSlotName(thread.id);\n // A long thread name is clipped with an ellipsis (no hover tooltip — the\n // designer opted against name bubbles). The name text lives in an inner span\n // that owns the ellipsis truncation.\n const nameSpan = html`<span class=${classMap(nameClasses)} part=\"row-name\">\n <span class=\"row-name-text\">${displayName}</span>\n </span>`;\n\n return html`\n <li\n class=${classMap(rowClasses)}\n part=${isActive ? \"row row-active\" : \"row\"}\n role=\"option\"\n aria-selected=${isActive ? \"true\" : \"false\"}\n tabindex=\"0\"\n data-thread-id=${thread.id}\n @click=${() => {\n // Selecting a row dismisses any open kebab menu (it belongs to a row,\n // not the selection) before emitting the selection intent.\n this._openMenuId = null;\n this._emit(\"thread-selected\", { threadId: thread.id });\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this._openMenuId = null;\n this._emit(\"thread-selected\", { threadId: thread.id });\n }\n }}\n >\n ${\n slotName !== null\n ? html`<slot name=${slotName}>${nameSpan}</slot>`\n : nameSpan\n }\n <button\n class=\"row-menu\"\n part=\"row-menu\"\n aria-label=${`Actions for ${displayName}`}\n aria-haspopup=\"menu\"\n aria-expanded=${menuOpen}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = menuOpen ? null : thread.id;\n }}\n >\n ${iconKebab}\n </button>\n ${\n menuOpen\n ? html`<div\n class=\"row-menu-popover\"\n part=\"row-menu-popover\"\n role=\"menu\"\n >\n ${\n thread.archived\n ? html`<button\n class=\"row-menu-item\"\n part=\"row-unarchive\"\n role=\"menuitem\"\n aria-label=${`Unarchive thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._emit(\"unarchive\", { threadId: thread.id });\n }}\n >\n ${iconUnarchive}<span>Unarchive</span>\n </button>`\n : html`<button\n class=\"row-menu-item\"\n part=\"row-archive\"\n role=\"menuitem\"\n aria-label=${`Archive thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._emit(\"archive\", { threadId: thread.id });\n }}\n >\n ${iconArchive}<span>Archive</span>\n </button>`\n }\n <button\n class=\"row-menu-item danger\"\n part=\"row-delete\"\n role=\"menuitem\"\n aria-label=${`Delete thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._confirmingDeleteId = thread.id;\n }}\n >\n ${iconDelete}<span>Delete</span>\n </button>\n </div>`\n : nothing\n }\n </li>\n `;\n }\n\n private _renderFetchMore() {\n if (hasErrorMessage(this.fetchMoreError)) {\n return html`\n <div class=\"fetch-more-error\" part=\"fetch-more-error\" role=\"alert\">\n Couldn't load more —\n <button\n class=\"row-action\"\n part=\"fetch-more-retry\"\n @click=${() => this._emit(\"retry\", { scope: \"fetch-more\" })}\n >\n retry\n </button>\n </div>\n `;\n }\n if (this.fetchingMore) {\n return html`\n <div class=\"state\" part=\"fetching-more\" aria-busy=\"true\">Loading more…</div>\n `;\n }\n if (this.hasMore) {\n return html`\n <button\n class=\"load-more\"\n part=\"load-more\"\n @click=${() => this._emit(\"load-more\", {})}\n >\n Load more\n </button>\n `;\n }\n return nothing;\n }\n\n private _renderMemories() {\n // Reserved region — hidden until a consumer projects content into the slot.\n // A `slotchange` listener drives `_hasMemories` so light-DOM mutations after\n // first render reactively reveal/hide the region.\n return html`\n <div class=\"memories\" part=\"memories\" ?hidden=${!this._hasMemories}>\n <slot\n name=\"memories\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasMemories = slot.assignedElements().length > 0;\n }}\n ></slot>\n </div>\n `;\n }\n\n private _renderFooter() {\n // Reserved region — hidden until a consumer projects content into the\n // `footer` slot. Without this gate the footer's top border + padding render\n // as an empty box at the bottom of the drawer. Mirrors `_renderMemories`.\n return html`\n <div class=\"footer\" part=\"footer\" ?hidden=${!this._hasFooter}>\n <slot\n name=\"footer\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasFooter = slot.assignedElements().length > 0;\n }}\n ></slot>\n </div>\n `;\n }\n\n /**\n * Confirm-delete dialog, rendered as a native `<dialog>` that is ALWAYS\n * present in the shadow DOM so `updated()` can drive `showModal()`/`close()`\n * against it. Opening with `showModal()` puts it in the browser TOP LAYER, so\n * it can never be painted under other UI — the previous CSS-positioned overlay\n * was trapped in the drawer host's stacking context and appeared under the\n * chat's welcome view (ENT-1051). The `::backdrop` pseudo-element (styled in\n * styles.ts) provides the scrim natively.\n *\n * The actionable content (message + Cancel/Delete, bound to the captured id)\n * renders only while confirming, so a closed dialog holds nothing stale.\n * Native dismissal is wired via `@cancel` (Escape) and a backdrop-click check.\n */\n private _renderConfirmDialog() {\n const id = this._confirmingDeleteId;\n return html`\n <dialog\n class=\"dialog\"\n part=\"confirm-dialog\"\n role=\"alertdialog\"\n aria-label=\"Confirm delete\"\n data-testid=\"drawer-confirm-delete\"\n @cancel=${(event: Event) => {\n // Native Escape dismissal: prevent the default close (we drive open\n // state from `_confirmingDeleteId` in `updated()`) and reset it.\n event.preventDefault();\n this._confirmingDeleteId = null;\n }}\n @click=${(event: MouseEvent) => {\n // A click whose target is the <dialog> itself (not the inner card)\n // landed on the ::backdrop — dismiss, mirroring a scrim click.\n if (event.target === event.currentTarget) {\n this._confirmingDeleteId = null;\n }\n }}\n >\n ${\n id !== null\n ? html`\n <p>Delete this thread? This cannot be undone.</p>\n <div class=\"dialog-actions\">\n <button\n class=\"row-action\"\n part=\"confirm-cancel\"\n @click=${() => (this._confirmingDeleteId = null)}\n >\n Cancel\n </button>\n <button\n class=\"primary\"\n part=\"confirm-delete\"\n @click=${() => {\n this._confirmingDeleteId = null;\n this._emit(\"delete\", { threadId: id });\n }}\n >\n Delete\n </button>\n </div>\n `\n : nothing\n }\n </dialog>\n `;\n }\n}\n","import {\n COPILOTKIT_THREADS_DRAWER_TAG,\n CopilotKitThreadsDrawer,\n} from \"./copilotkit-threads-drawer\";\n\n/**\n * Registers the `<copilotkit-threads-drawer>` custom element. Idempotent — safe to call\n * multiple times (e.g. from several framework wrappers in the same page); a\n * second registration of the same tag is a no-op.\n */\nexport function defineCopilotKitThreadsDrawer(): void {\n if (\n typeof customElements !== \"undefined\" &&\n !customElements.get(COPILOTKIT_THREADS_DRAWER_TAG)\n ) {\n customElements.define(\n COPILOTKIT_THREADS_DRAWER_TAG,\n CopilotKitThreadsDrawer,\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"copilotkit-threads-drawer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SAAS;GAAE,WAAW;GAAY,MAAM;GAAS;EACjD,cAAc;GAAE,WAAW;GAAiB,MAAM;GAAS;EAC3D,gBAAgB;GAAE,WAAW;GAAoB,MAAM;GAAQ;EAE/D,OAAO,EAAE,MAAM,QAAQ;EAEvB,aAAa;GAAE,WAAW;GAAgB,MAAM;GAAQ;EACxD,aAAa,EAAE,MAAM,SAAS;EAE9B,MAAM;GAAE,MAAM;GAAS,SAAS;GAAM;EACtC,WAAW;GAAE,MAAM;GAAS,SAAS;GAAM;EAE3C,SAAS,EAAE,OAAO,MAAM;EACxB,qBAAqB,EAAE,OAAO,MAAM;EACpC,mBAAmB,EAAE,OAAO,MAAM;EAClC,YAAY,EAAE,OAAO,MAAM;EAC3B,cAAc,EAAE,OAAO,MAAM;EAC7B,YAAY,EAAE,OAAO,MAAM;EAC3B,aAAa,EAAE,OAAO,MAAM;EAC5B,aAAa,EAAE,OAAO,MAAM;EAC7B;;;;;;;;;CCtMH,SAAgB,gCAAsC;AACpD,MACE,OAAO,mBAAmB,eAC1B,CAAC,eAAe,IAAI,8BAA8B,CAElD,gBAAe,OACb,+BACA,wBACD"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":["_a","EventShim","CustomEventShim","EventTargetShim","customElements","t","e","s","o","n","r","i","S","c","h","r","o","n","a","c","l","t","p","d","u","f","b","m","y","g","s","i","e","t","i","s","e","h","o","n","r","l","c","u","d","f","v","m","p","T","M","j","s","i","t","e","r","t","e","i","o","e","c","u","s","t","r","l","p","h","v","o","i","n","f","e","s","i","r","t","unsafeCSS","LitElement","nothing","classMap","repeat"],"sources":["../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/events.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/css.js","../../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/index.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/lit-html.js","../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directive.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/class-map.js","../src/threads-drawer/generated-tokens.ts","../src/threads-drawer/styles.ts","../src/threads-drawer/copilotkit-threads-drawer.ts","../src/threads-drawer/define.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n/**\n * Map of ARIAMixin properties to attributes\n */\nexport const ariaMixinAttributes = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBrailleLabel: 'aria-braillelabel',\n ariaBrailleRoleDescription: 'aria-brailleroledescription',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColIndexText: 'aria-colindextext',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDescription: 'aria-description',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaInvalid: 'aria-invalid',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRelevant: 'aria-relevant',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowIndexText: 'aria-rowindextext',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role',\n};\n// Shim the global element internals object\n// Methods should be fine as noops and properties can generally\n// be while on the server.\nexport const ElementInternalsShim = class ElementInternals {\n get shadowRoot() {\n // Grab the shadow root instance from the Element shim\n // to ensure that the shadow root is always available\n // to the internals instance even if the mode is 'closed'\n return this.__host\n .__shadowRoot;\n }\n constructor(_host) {\n this.ariaActiveDescendantElement = null;\n this.ariaAtomic = '';\n this.ariaAutoComplete = '';\n this.ariaBrailleLabel = '';\n this.ariaBrailleRoleDescription = '';\n this.ariaBusy = '';\n this.ariaChecked = '';\n this.ariaColCount = '';\n this.ariaColIndex = '';\n this.ariaColIndexText = '';\n this.ariaColSpan = '';\n this.ariaControlsElements = null;\n this.ariaCurrent = '';\n this.ariaDescribedByElements = null;\n this.ariaDescription = '';\n this.ariaDetailsElements = null;\n this.ariaDisabled = '';\n this.ariaErrorMessageElements = null;\n this.ariaExpanded = '';\n this.ariaFlowToElements = null;\n this.ariaHasPopup = '';\n this.ariaHidden = '';\n this.ariaInvalid = '';\n this.ariaKeyShortcuts = '';\n this.ariaLabel = '';\n this.ariaLabelledByElements = null;\n this.ariaLevel = '';\n this.ariaLive = '';\n this.ariaModal = '';\n this.ariaMultiLine = '';\n this.ariaMultiSelectable = '';\n this.ariaOrientation = '';\n this.ariaOwnsElements = null;\n this.ariaPlaceholder = '';\n this.ariaPosInSet = '';\n this.ariaPressed = '';\n this.ariaReadOnly = '';\n this.ariaRelevant = '';\n this.ariaRequired = '';\n this.ariaRoleDescription = '';\n this.ariaRowCount = '';\n this.ariaRowIndex = '';\n this.ariaRowIndexText = '';\n this.ariaRowSpan = '';\n this.ariaSelected = '';\n this.ariaSetSize = '';\n this.ariaSort = '';\n this.ariaValueMax = '';\n this.ariaValueMin = '';\n this.ariaValueNow = '';\n this.ariaValueText = '';\n this.role = '';\n this.form = null;\n this.labels = [];\n this.states = new Set();\n this.validationMessage = '';\n this.validity = {};\n this.willValidate = true;\n this.__host = _host;\n }\n checkValidity() {\n // TODO(augustjk) Consider actually implementing logic.\n // See https://github.com/lit/lit/issues/3740\n console.warn('`ElementInternals.checkValidity()` was called on the server.' +\n 'This method always returns true.');\n return true;\n }\n reportValidity() {\n return true;\n }\n setFormValue() { }\n setValidity() { }\n};\nconst ElementInternalsShimWithRealType = ElementInternalsShim;\nexport { ElementInternalsShimWithRealType as ElementInternals };\nexport const HYDRATE_INTERNALS_ATTR_PREFIX = 'hydrate-internals-';\n//# sourceMappingURL=element-internals.js.map","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Event_cancelable, _Event_bubbles, _Event_composed, _Event_defaultPrevented, _Event_timestamp, _Event_propagationStopped, _Event_type, _Event_target, _Event_isBeingDispatched, _a, _CustomEvent_detail, _b;\nconst isCaptureEventListener = (options) => (typeof options === 'boolean' ? options : (options?.capture ?? false));\n// Event phases\nconst NONE = 0;\nconst CAPTURING_PHASE = 1;\nconst AT_TARGET = 2;\nconst BUBBLING_PHASE = 3;\n// Shim the global EventTarget object\nclass EventTarget {\n constructor() {\n this.__eventListeners = new Map();\n this.__captureEventListeners = new Map();\n }\n addEventListener(type, callback, options) {\n if (callback === undefined || callback === null) {\n return;\n }\n const eventListenersMap = isCaptureEventListener(options)\n ? this.__captureEventListeners\n : this.__eventListeners;\n let eventListeners = eventListenersMap.get(type);\n if (eventListeners === undefined) {\n eventListeners = new Map();\n eventListenersMap.set(type, eventListeners);\n }\n else if (eventListeners.has(callback)) {\n return;\n }\n const normalizedOptions = typeof options === 'object' && options ? options : {};\n normalizedOptions.signal?.addEventListener('abort', () => this.removeEventListener(type, callback, options));\n eventListeners.set(callback, normalizedOptions ?? {});\n }\n removeEventListener(type, callback, options) {\n if (callback === undefined || callback === null) {\n return;\n }\n const eventListenersMap = isCaptureEventListener(options)\n ? this.__captureEventListeners\n : this.__eventListeners;\n const eventListeners = eventListenersMap.get(type);\n if (eventListeners !== undefined) {\n eventListeners.delete(callback);\n if (!eventListeners.size) {\n eventListenersMap.delete(type);\n }\n }\n }\n dispatchEvent(event) {\n const composedPath = [this];\n let parent = this.__eventTargetParent;\n if (event.composed) {\n while (parent) {\n composedPath.push(parent);\n parent = parent.__eventTargetParent;\n }\n }\n else {\n // If the event is not composed and the event was dispatched inside\n // shadow DOM, we need to stop before the host of the shadow DOM.\n while (parent && parent !== this.__host) {\n composedPath.push(parent);\n parent = parent.__eventTargetParent;\n }\n }\n // We need to patch various properties that would either be empty or wrong\n // in this scenario.\n let stopPropagation = false;\n let stopImmediatePropagation = false;\n let eventPhase = NONE;\n let target = null;\n let tmpTarget = null;\n let currentTarget = null;\n const originalStopPropagation = event.stopPropagation;\n const originalStopImmediatePropagation = event.stopImmediatePropagation;\n Object.defineProperties(event, {\n target: {\n get() {\n return target ?? tmpTarget;\n },\n ...enumerableProperty,\n },\n srcElement: {\n get() {\n return event.target;\n },\n ...enumerableProperty,\n },\n currentTarget: {\n get() {\n return currentTarget;\n },\n ...enumerableProperty,\n },\n eventPhase: {\n get() {\n return eventPhase;\n },\n ...enumerableProperty,\n },\n composedPath: {\n value: () => composedPath,\n ...enumerableProperty,\n },\n stopPropagation: {\n value: () => {\n stopPropagation = true;\n originalStopPropagation.call(event);\n },\n ...enumerableProperty,\n },\n stopImmediatePropagation: {\n value: () => {\n stopImmediatePropagation = true;\n originalStopImmediatePropagation.call(event);\n },\n ...enumerableProperty,\n },\n });\n // An event handler can either be a function, an object with a handleEvent\n // method or null. This function takes care to call the event handler\n // correctly.\n const invokeEventListener = (listener, options, eventListenerMap) => {\n if (typeof listener === 'function') {\n listener(event);\n }\n else if (typeof listener?.handleEvent === 'function') {\n listener.handleEvent(event);\n }\n if (options.once) {\n eventListenerMap.delete(listener);\n }\n };\n // When an event is finished being dispatched, which can be after the event\n // tree has been traversed or stopPropagation/stopImmediatePropagation has\n // been called. Once that is the case, the currentTarget and eventPhase\n // need to be reset and a value, representing whether the event has not\n // been prevented, needs to be returned.\n const finishDispatch = () => {\n currentTarget = null;\n eventPhase = NONE;\n return !event.defaultPrevented;\n };\n // An event starts with the capture order, where it starts from the top.\n // This is done even if bubbles is set to false, which is the default.\n const captureEventPath = composedPath.slice().reverse();\n // If the event target, which dispatches the event, is either in the light DOM\n // or the event is not composed, the target is always itself. If that is not\n // the case, the target needs to be retargeted: https://dom.spec.whatwg.org/#retarget\n target = !this.__host || !event.composed ? this : null;\n const retarget = (eventTargets) => {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n tmpTarget = this;\n while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) {\n tmpTarget = tmpTarget.__host;\n }\n };\n for (const eventTarget of captureEventPath) {\n if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) {\n retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));\n }\n currentTarget = eventTarget;\n eventPhase = eventTarget === event.target ? AT_TARGET : CAPTURING_PHASE;\n const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);\n if (captureEventListeners) {\n for (const [listener, options] of captureEventListeners) {\n invokeEventListener(listener, options, captureEventListeners);\n if (stopImmediatePropagation) {\n // Event.stopImmediatePropagation() stops any following invocation\n // of an event handler even on the same event target.\n return finishDispatch();\n }\n }\n }\n if (stopPropagation) {\n // Event.stopPropagation() stops any following invocation\n // of an event handler for any following event targets.\n return finishDispatch();\n }\n }\n const bubbleEventPath = event.bubbles ? composedPath : [this];\n tmpTarget = null;\n for (const eventTarget of bubbleEventPath) {\n if (!target &&\n (!tmpTarget || eventTarget === tmpTarget.__host)) {\n retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));\n }\n currentTarget = eventTarget;\n eventPhase = eventTarget === event.target ? AT_TARGET : BUBBLING_PHASE;\n const captureEventListeners = eventTarget.__eventListeners.get(event.type);\n if (captureEventListeners) {\n for (const [listener, options] of captureEventListeners) {\n invokeEventListener(listener, options, captureEventListeners);\n if (stopImmediatePropagation) {\n // Event.stopImmediatePropagation() stops any following invocation\n // of an event handler even on the same event target.\n return finishDispatch();\n }\n }\n }\n if (stopPropagation) {\n // Event.stopPropagation() stops any following invocation\n // of an event handler for any following event targets.\n return finishDispatch();\n }\n }\n return finishDispatch();\n }\n}\nconst EventTargetShimWithRealType = EventTarget;\nexport { EventTargetShimWithRealType as EventTarget, EventTargetShimWithRealType as EventTargetShim, };\nconst enumerableProperty = { __proto__: null };\nenumerableProperty.enumerable = true;\nObject.freeze(enumerableProperty);\n// TODO: Remove this when we remove support for vm modules (--experimental-vm-modules).\nconst EventShim = (_a = class Event {\n constructor(type, options = {}) {\n _Event_cancelable.set(this, false);\n _Event_bubbles.set(this, false);\n _Event_composed.set(this, false);\n _Event_defaultPrevented.set(this, false);\n _Event_timestamp.set(this, Date.now());\n _Event_propagationStopped.set(this, false);\n _Event_type.set(this, void 0);\n _Event_target.set(this, void 0);\n _Event_isBeingDispatched.set(this, void 0);\n this.NONE = NONE;\n this.CAPTURING_PHASE = CAPTURING_PHASE;\n this.AT_TARGET = AT_TARGET;\n this.BUBBLING_PHASE = BUBBLING_PHASE;\n if (arguments.length === 0)\n throw new Error(`The type argument must be specified`);\n if (typeof options !== 'object' || !options) {\n throw new Error(`The \"options\" argument must be an object`);\n }\n const { bubbles, cancelable, composed } = options;\n __classPrivateFieldSet(this, _Event_cancelable, !!cancelable, \"f\");\n __classPrivateFieldSet(this, _Event_bubbles, !!bubbles, \"f\");\n __classPrivateFieldSet(this, _Event_composed, !!composed, \"f\");\n __classPrivateFieldSet(this, _Event_type, `${type}`, \"f\");\n __classPrivateFieldSet(this, _Event_target, null, \"f\");\n __classPrivateFieldSet(this, _Event_isBeingDispatched, false, \"f\");\n }\n initEvent(_type, _bubbles, _cancelable) {\n throw new Error('Method not implemented.');\n }\n stopImmediatePropagation() {\n this.stopPropagation();\n }\n preventDefault() {\n __classPrivateFieldSet(this, _Event_defaultPrevented, true, \"f\");\n }\n get target() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get currentTarget() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get srcElement() {\n return __classPrivateFieldGet(this, _Event_target, \"f\");\n }\n get type() {\n return __classPrivateFieldGet(this, _Event_type, \"f\");\n }\n get cancelable() {\n return __classPrivateFieldGet(this, _Event_cancelable, \"f\");\n }\n get defaultPrevented() {\n return __classPrivateFieldGet(this, _Event_cancelable, \"f\") && __classPrivateFieldGet(this, _Event_defaultPrevented, \"f\");\n }\n get timeStamp() {\n return __classPrivateFieldGet(this, _Event_timestamp, \"f\");\n }\n composedPath() {\n return __classPrivateFieldGet(this, _Event_isBeingDispatched, \"f\") ? [__classPrivateFieldGet(this, _Event_target, \"f\")] : [];\n }\n get returnValue() {\n return !__classPrivateFieldGet(this, _Event_cancelable, \"f\") || !__classPrivateFieldGet(this, _Event_defaultPrevented, \"f\");\n }\n get bubbles() {\n return __classPrivateFieldGet(this, _Event_bubbles, \"f\");\n }\n get composed() {\n return __classPrivateFieldGet(this, _Event_composed, \"f\");\n }\n get eventPhase() {\n return __classPrivateFieldGet(this, _Event_isBeingDispatched, \"f\") ? _a.AT_TARGET : _a.NONE;\n }\n get cancelBubble() {\n return __classPrivateFieldGet(this, _Event_propagationStopped, \"f\");\n }\n set cancelBubble(value) {\n if (value) {\n __classPrivateFieldSet(this, _Event_propagationStopped, true, \"f\");\n }\n }\n stopPropagation() {\n __classPrivateFieldSet(this, _Event_propagationStopped, true, \"f\");\n }\n get isTrusted() {\n return false;\n }\n },\n _Event_cancelable = new WeakMap(),\n _Event_bubbles = new WeakMap(),\n _Event_composed = new WeakMap(),\n _Event_defaultPrevented = new WeakMap(),\n _Event_timestamp = new WeakMap(),\n _Event_propagationStopped = new WeakMap(),\n _Event_type = new WeakMap(),\n _Event_target = new WeakMap(),\n _Event_isBeingDispatched = new WeakMap(),\n _a.NONE = NONE,\n _a.CAPTURING_PHASE = CAPTURING_PHASE,\n _a.AT_TARGET = AT_TARGET,\n _a.BUBBLING_PHASE = BUBBLING_PHASE,\n _a);\nObject.defineProperties(EventShim.prototype, {\n initEvent: enumerableProperty,\n stopImmediatePropagation: enumerableProperty,\n preventDefault: enumerableProperty,\n target: enumerableProperty,\n currentTarget: enumerableProperty,\n srcElement: enumerableProperty,\n type: enumerableProperty,\n cancelable: enumerableProperty,\n defaultPrevented: enumerableProperty,\n timeStamp: enumerableProperty,\n composedPath: enumerableProperty,\n returnValue: enumerableProperty,\n bubbles: enumerableProperty,\n composed: enumerableProperty,\n eventPhase: enumerableProperty,\n cancelBubble: enumerableProperty,\n stopPropagation: enumerableProperty,\n isTrusted: enumerableProperty,\n});\n// TODO: Remove this when we remove support for vm modules (--experimental-vm-modules).\nconst CustomEventShim = (_b = class CustomEvent extends EventShim {\n constructor(type, options = {}) {\n super(type, options);\n _CustomEvent_detail.set(this, void 0);\n __classPrivateFieldSet(this, _CustomEvent_detail, options?.detail ?? null, \"f\");\n }\n initCustomEvent(_type, _bubbles, _cancelable, _detail) {\n throw new Error('Method not implemented.');\n }\n get detail() {\n return __classPrivateFieldGet(this, _CustomEvent_detail, \"f\");\n }\n },\n _CustomEvent_detail = new WeakMap(),\n _b);\nObject.defineProperties(CustomEventShim.prototype, {\n detail: enumerableProperty,\n});\nconst EventShimWithRealType = EventShim;\nconst CustomEventShimWithRealType = CustomEventShim;\nexport { EventShimWithRealType as Event, EventShimWithRealType as EventShim, CustomEventShimWithRealType as CustomEvent, CustomEventShimWithRealType as CustomEventShim, };\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar _a;\nconst MediaListShim = class MediaList extends Array {\n get mediaText() {\n return this.join(', ');\n }\n toString() {\n return this.mediaText;\n }\n appendMedium(medium) {\n if (!this.includes(medium)) {\n this.push(medium);\n }\n }\n deleteMedium(medium) {\n const index = this.indexOf(medium);\n if (index !== -1) {\n this.splice(index, 1);\n }\n }\n item(index) {\n return this[index] ?? null;\n }\n};\nconst MediaListShimWithRealType = MediaListShim;\nexport { MediaListShimWithRealType as MediaList };\nconst StyleSheetShim = class StyleSheet {\n constructor() {\n this.__media = new MediaListShim();\n this.disabled = false;\n }\n get href() {\n return null;\n }\n get media() {\n return this.__media;\n }\n get ownerNode() {\n return null;\n }\n get parentStyleSheet() {\n return null;\n }\n get title() {\n return null;\n }\n get type() {\n return 'text/css';\n }\n};\nconst StyleSheetShimWithRealType = StyleSheetShim;\nexport { StyleSheetShimWithRealType as StyleSheet };\nconst CSSRuleShim = (_a = class CSSRule {\n constructor() {\n this.STYLE_RULE = 1;\n this.CHARSET_RULE = 2;\n this.IMPORT_RULE = 3;\n this.MEDIA_RULE = 4;\n this.FONT_FACE_RULE = 5;\n this.PAGE_RULE = 6;\n this.NAMESPACE_RULE = 10;\n this.KEYFRAMES_RULE = 7;\n this.KEYFRAME_RULE = 8;\n this.SUPPORTS_RULE = 12;\n this.COUNTER_STYLE_RULE = 11;\n this.FONT_FEATURE_VALUES_RULE = 14;\n this.__parentStyleSheet = null;\n this.cssText = '';\n }\n get parentRule() {\n return null;\n }\n get parentStyleSheet() {\n return this.__parentStyleSheet;\n }\n get type() {\n return 0;\n }\n },\n _a.STYLE_RULE = 1,\n _a.CHARSET_RULE = 2,\n _a.IMPORT_RULE = 3,\n _a.MEDIA_RULE = 4,\n _a.FONT_FACE_RULE = 5,\n _a.PAGE_RULE = 6,\n _a.NAMESPACE_RULE = 10,\n _a.KEYFRAMES_RULE = 7,\n _a.KEYFRAME_RULE = 8,\n _a.SUPPORTS_RULE = 12,\n _a.COUNTER_STYLE_RULE = 11,\n _a.FONT_FEATURE_VALUES_RULE = 14,\n _a);\nconst CSSRuleShimWithRealType = CSSRuleShim;\nexport { CSSRuleShimWithRealType as CSSRule };\nconst CSSRuleListShim = class CSSRuleList extends Array {\n item(index) {\n return this[index] ?? null;\n }\n};\nconst CSSRuleListShimWithRealType = CSSRuleListShim;\nexport { CSSRuleListShimWithRealType as CSSRuleList };\nconst CSSStyleSheetShim = class CSSStyleSheet extends StyleSheetShim {\n constructor() {\n super(...arguments);\n this.__rules = new CSSRuleListShim();\n }\n get cssRules() {\n return this.__rules;\n }\n get ownerRule() {\n return null;\n }\n get rules() {\n return this.cssRules;\n }\n addRule(_selector, _style, _index) {\n throw new Error('Method not implemented.');\n }\n deleteRule(_index) {\n throw new Error('Method not implemented.');\n }\n insertRule(_rule, _index) {\n throw new Error('Method not implemented.');\n }\n removeRule(_index) {\n throw new Error('Method not implemented.');\n }\n replace(text) {\n this.replaceSync(text);\n return Promise.resolve(this);\n }\n replaceSync(text) {\n this.__rules.length = 0;\n const rule = new CSSRuleShim();\n rule.cssText = text;\n this.__rules.push(rule);\n }\n};\nconst CSSStyleSheetShimWithRealType = CSSStyleSheetShim;\nexport { CSSStyleSheetShimWithRealType as CSSStyleSheet, CSSStyleSheetShimWithRealType as CSSStyleSheetShim, };\n//# sourceMappingURL=css.js.map","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { ElementInternalsShim } from './lib/element-internals.js';\nimport { EventTargetShim, EventShim, CustomEventShim, } from './lib/events.js';\nexport { ariaMixinAttributes, ElementInternals, HYDRATE_INTERNALS_ATTR_PREFIX, } from './lib/element-internals.js';\nexport { CSSRule, CSSRuleList, CSSStyleSheet, MediaList, StyleSheet, } from './lib/css.js';\nexport { CustomEvent, Event, EventTarget } from './lib/events.js';\n// In an empty Node.js vm, we need to patch the global context.\n// TODO: Remove these globalThis assignments when we remove support\n// for vm modules (--experimental-vm-modules).\nglobalThis.Event ??= EventShim;\nglobalThis.CustomEvent ??= CustomEventShim;\nconst attributes = new WeakMap();\nconst attributesForElement = (element) => {\n let attrs = attributes.get(element);\n if (attrs === undefined) {\n attributes.set(element, (attrs = new Map()));\n }\n return attrs;\n};\n// The typings around the exports below are a little funky:\n//\n// 1. We want the `name` of the shim classes to match the real ones at runtime,\n// hence e.g. `class Element`.\n// 2. We can't shadow the global types with a simple class declaration, because\n// then we can't reference the global types for casting, hence e.g.\n// `const ElementShim = class Element`.\n// 3. We want to export the classes typed as the real ones, hence e.g.\n// `const ElementShimWithRealType = ElementShim as object as typeof Element;`.\n// 4. We want the exported names to match the real ones, hence e.g.\n// `export {ElementShimWithRealType as Element}`.\nconst ElementShim = class Element extends EventTargetShim {\n constructor() {\n super(...arguments);\n this.__shadowRootMode = null;\n this.__shadowRoot = null;\n this.__internals = null;\n }\n get attributes() {\n return Array.from(attributesForElement(this)).map(([name, value]) => ({\n name,\n value,\n }));\n }\n get shadowRoot() {\n if (this.__shadowRootMode === 'closed') {\n return null;\n }\n return this.__shadowRoot;\n }\n get localName() {\n return this.constructor.__localName;\n }\n get tagName() {\n return this.localName?.toUpperCase();\n }\n setAttribute(name, value) {\n // Emulate browser behavior that silently casts all values to string. E.g.\n // `42` becomes `\"42\"` and `{}` becomes `\"[object Object]\"\"`.\n attributesForElement(this).set(name, String(value));\n }\n removeAttribute(name) {\n attributesForElement(this).delete(name);\n }\n toggleAttribute(name, force) {\n // Steps reference https://dom.spec.whatwg.org/#dom-element-toggleattribute\n if (this.hasAttribute(name)) {\n // Step 5\n if (force === undefined || !force) {\n this.removeAttribute(name);\n return false;\n }\n }\n else {\n // Step 4\n if (force === undefined || force) {\n // Step 4.1\n this.setAttribute(name, '');\n return true;\n }\n else {\n // Step 4.2\n return false;\n }\n }\n // Step 6\n return true;\n }\n hasAttribute(name) {\n return attributesForElement(this).has(name);\n }\n attachShadow(init) {\n const shadowRoot = { host: this };\n this.__shadowRootMode = init.mode;\n if (init && init.mode === 'open') {\n this.__shadowRoot = shadowRoot;\n }\n return shadowRoot;\n }\n attachInternals() {\n if (this.__internals !== null) {\n throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': ` +\n `ElementInternals for the specified element was already attached.`);\n }\n const internals = new ElementInternalsShim(this);\n this.__internals = internals;\n return internals;\n }\n getAttribute(name) {\n const value = attributesForElement(this).get(name);\n return value ?? null;\n }\n};\nconst ElementShimWithRealType = ElementShim;\nexport { ElementShimWithRealType as Element };\nconst HTMLElementShim = class HTMLElement extends ElementShim {\n};\nconst HTMLElementShimWithRealType = HTMLElementShim;\nexport { HTMLElementShimWithRealType as HTMLElement };\n// For convenience, we provide a global instance of a HTMLElement as an event\n// target. This facilitates registering global event handlers\n// (e.g. for @lit/context ContextProvider).\n// We use this in in the SSR render function.\n// Note, this is a bespoke element and not simply `document` or `window` since\n// user code relies on these being undefined in the server environment.\nglobalThis.litServerRoot ??= Object.defineProperty(new HTMLElementShimWithRealType(), 'localName', {\n // Patch localName (and tagName) to return a unique name.\n get() {\n return 'lit-server-root';\n },\n});\nfunction promiseWithResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n}\nclass CustomElementRegistry {\n constructor() {\n this.__definitions = new Map();\n this.__reverseDefinitions = new Map();\n this.__pendingWhenDefineds = new Map();\n }\n define(name, ctor) {\n if (this.__definitions.has(name)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`'CustomElementRegistry' already has \"${name}\" defined. ` +\n `This may have been caused by live reload or hot module ` +\n `replacement in which case it can be safely ignored.\\n` +\n `Make sure to test your application with a production build as ` +\n `repeat registrations will throw in production.`);\n }\n else {\n throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': ` +\n `the name \"${name}\" has already been used with this registry`);\n }\n }\n if (this.__reverseDefinitions.has(ctor)) {\n throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': ` +\n `the constructor has already been used with this registry for the ` +\n `tag name ${this.__reverseDefinitions.get(ctor)}`);\n }\n // Provide tagName and localName for the component.\n ctor.__localName = name;\n this.__definitions.set(name, {\n ctor,\n // Note it's important we read `observedAttributes` in case it is a getter\n // with side-effects, as is the case in Lit, where it triggers class\n // finalization.\n //\n // TODO(aomarks) To be spec compliant, we should also capture the\n // registration-time lifecycle methods like `connectedCallback`. For them\n // to be actually accessible to e.g. the Lit SSR element renderer, though,\n // we'd need to introduce a new API for accessing them (since `get` only\n // returns the constructor).\n observedAttributes: ctor.observedAttributes ?? [],\n });\n this.__reverseDefinitions.set(ctor, name);\n this.__pendingWhenDefineds.get(name)?.resolve(ctor);\n this.__pendingWhenDefineds.delete(name);\n }\n get(name) {\n const definition = this.__definitions.get(name);\n return definition?.ctor;\n }\n getName(ctor) {\n return this.__reverseDefinitions.get(ctor) ?? null;\n }\n upgrade(_element) {\n // In SSR this doesn't make a lot of sense, so we do nothing.\n throw new Error(`customElements.upgrade is not currently supported in SSR. ` +\n `Please file a bug if you need it.`);\n }\n async whenDefined(name) {\n const definition = this.__definitions.get(name);\n if (definition) {\n return definition.ctor;\n }\n let withResolvers = this.__pendingWhenDefineds.get(name);\n if (!withResolvers) {\n withResolvers = promiseWithResolvers();\n this.__pendingWhenDefineds.set(name, withResolvers);\n }\n return withResolvers.promise;\n }\n}\nconst CustomElementRegistryShimWithRealType = CustomElementRegistry;\nexport { CustomElementRegistryShimWithRealType as CustomElementRegistry };\nexport const customElements = new CustomElementRegistryShimWithRealType();\n//# sourceMappingURL=index.js.map","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1],t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e||void 0===t.CSSStyleSheet?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{customElements as t,HTMLElement as s}from\"@lit-labs/ssr-dom-shim\";import{getCompatibleStyle as i,adoptStyles as e}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";const{is:h,defineProperty:r,getOwnPropertyDescriptor:o,getOwnPropertyNames:n,getOwnPropertySymbols:a,getPrototypeOf:c}=Object,l=globalThis;l.customElements??=t;const p=l.trustedTypes,d=p?p.emptyScript:\"\",u=l.reactiveElementPolyfillSupport,f=(t,s)=>t,b={toAttribute(t,s){switch(s){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,s)=>!h(t,s),y={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:m};Symbol.metadata??=Symbol(\"metadata\"),l.litPropertyMetadata??=new WeakMap;class g extends(globalThis.HTMLElement??s){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),e=this.getPropertyDescriptor(t,i,s);void 0!==e&&r(this.prototype,t,e)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=o(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const r=e?.call(this);h?.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(f(\"elementProperties\")))return;const t=c(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(f(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f(\"properties\"))){const t=this.properties,s=[...n(t),...a(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)s.unshift(i(t))}else void 0!==t&&s.push(i(t));return s}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return e(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:b).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null}}requestUpdate(t,s,i,e=!1,h){if(void 0!==t){const r=this.constructor;if(!1===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??m)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}g.elementStyles=[],g.shadowRootOptions={mode:\"open\"},g[f(\"elementProperties\")]=new Map,g[f(\"finalized\")]=new Map,u?.({ReactiveElement:g}),(l.reactiveElementVersions??=[]).push(\"2.1.2\");export{g as ReactiveElement,e as adoptStyles,b as defaultConverter,i as getCompatibleStyle,m as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t=>t,s=t.trustedTypes,e=s?s.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,h=\"$lit$\",o=`lit$${Math.random().toFixed(9).slice(2)}$`,n=\"?\"+o,r=`<${n}>`,l=void 0===t.document?{createTreeWalker:()=>({})}:document,c=()=>l.createComment(\"\"),a=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,u=Array.isArray,d=t=>u(t)||\"function\"==typeof t?.[Symbol.iterator],f=\"[ \\t\\n\\f\\r]\",v=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\\\s\"'>=/]+)(${f}*=${f}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),g=/'/g,$=/\"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),T=x(1),b=x(2),w=x(3),E=Symbol.for(\"lit-noChange\"),A=Symbol.for(\"lit-nothing\"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==e?e.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?\"!--\"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp(\"</\"+u[2],\"g\")),c=p):void 0!==u[3]&&(c=p):c===p?\">\"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'\"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===v?s+r:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o+x):s+o+(-2===d?i:x)}return[V(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:\".\"===e[1]?I:\"?\"===e[1]?L:\"@\"===e[1]?z:H}),r.removeAttribute(t)}else t.startsWith(o)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o),i=t.length-1;if(i>0){r.textContent=s?s.emptyScript:\"\";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c())}}}else if(8===r.nodeType)if(r.data===n)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(o,t+1));)d.push({type:7,index:l}),t+=o.length-1}l++}}static createElement(t,i){const s=l.createElement(\"template\");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class k{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,!0);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new R(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new W(h,this,t)),this._$AV.push(i),r=s[++n]}o!==r?.index&&(h=P.nextNode(),o++)}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a(t)?t===A||null==t||\"\"===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new k(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){const s=i(t).nextSibling;i(t).remove(),t=s}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=M(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class I extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}class L extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const Z={M:h,P:o,A:n,C:1,L:N,R:k,D:d,V:M,I:R,H,N:L,U:z,B:I,F:W},j=t.litHtmlPolyfillSupport;j?.(S,R),(t.litHtmlVersions??=[]).push(\"3.3.2\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(c(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,T as html,w as mathml,E as noChange,A as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.2\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter(s=>t[s]).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter(t=>\"\"!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","/**\n * GENERATED FILE — DO NOT EDIT BY HAND.\n *\n * Bundled default values for the drawer's design tokens, derived at build time\n * from the canonical theme (`packages/core/src/styles/css/theme.css`)\n * by `scripts/generate-tokens.ts`. Run `pnpm run gen:tokens` to regenerate.\n *\n * The drawer's shadow-DOM CSS references these as fallbacks, e.g.\n * `var(--cpk-drawer-bg, <built default>)`, so consumers can override every\n * token while the built-in skin stays in sync with the shared theme.\n */\nexport const GENERATED_DRAWER_TOKEN_DEFAULTS = {\n bg: \"oklch(1 0 0)\",\n fg: \"oklch(0.145 0 0)\",\n surface: \"oklch(1 0 0)\",\n \"surface-fg\": \"oklch(0.145 0 0)\",\n muted: \"oklch(0.97 0 0)\",\n \"muted-fg\": \"oklch(0.556 0 0)\",\n accent: \"oklch(0.97 0 0)\",\n \"accent-fg\": \"oklch(0.205 0 0)\",\n primary: \"oklch(0.205 0 0)\",\n \"primary-fg\": \"oklch(0.985 0 0)\",\n danger: \"oklch(0.577 0.245 27.325)\",\n border: \"oklch(0.922 0 0)\",\n ring: \"oklch(0.708 0 0)\",\n radius: \"0.625rem\",\n} as const satisfies Record<string, string>;\n\nexport type GeneratedDrawerTokenKey =\n keyof typeof GENERATED_DRAWER_TOKEN_DEFAULTS;\n","import { css, unsafeCSS } from \"lit\";\nimport { GENERATED_DRAWER_TOKEN_DEFAULTS } from \"./generated-tokens\";\n\n/**\n * Wraps a generated token default value so it can be safely interpolated into a\n * lit `css` template. Values come from the checked-in generated tokens file\n * (derived from react-core), never from user input, so `unsafeCSS` is safe\n * here.\n */\nconst tok = (value: string) => unsafeCSS(value);\nconst T = GENERATED_DRAWER_TOKEN_DEFAULTS;\n\n/**\n * Self-contained shadow-DOM styles for `<copilotkit-threads-drawer>`.\n *\n * Authoring rules baked in here:\n * - Every visual value is a `var(--cpk-drawer-<token>, <built default>)`. The\n * built defaults come from {@link GENERATED_DRAWER_TOKEN_DEFAULTS}, derived\n * from react-core's canonical theme at build time (anti-drift). Consumers\n * override by setting `--cpk-drawer-*` from the light DOM — CSS custom\n * properties pierce the shadow boundary by design.\n * - Inherited properties (font, color, line-height) are RE-PINNED on `:host`\n * so a hostile host stylesheet (`all: unset`, `* { ... !important }`,\n * Tailwind preflight) cannot leak into or strip styling from the element.\n * - Structural nodes expose `::part(...)` hooks for fine-grained theming.\n *\n * Token fallbacks are interpolated as literals (not runtime-read) so the CSS is\n * static and ships compiled.\n */\nexport const drawerStyles = css`\n :host {\n /* Re-pin inheritable properties to close inheritance leaks from hostile\n host CSS. These are the only properties that cross the shadow boundary\n via inheritance, so we hard-set them at the root. */\n all: initial;\n display: block;\n height: 100%;\n box-sizing: border-box;\n font-family: var(\n --cpk-drawer-font-family,\n ui-sans-serif,\n system-ui,\n sans-serif\n );\n font-size: var(--cpk-drawer-font-size, 14px);\n line-height: var(--cpk-drawer-line-height, 1.4);\n color: var(--cpk-drawer-fg, var(--foreground, ${tok(T.fg)}));\n\n /* Three-level token resolution, highest priority first:\n 1. explicit per-token override (--cpk-drawer-*),\n 2. the host app's theme variable (--background/--card/… — the standard\n react-core/shadcn names), so the drawer follows the host's light/dark\n theme by inheritance (custom properties are NOT reset by all:initial),\n 3. the built-in light default derived from react-core at build time, so a\n host with no theme still renders correctly (self-contained). */\n --_bg: var(--cpk-drawer-bg, var(--background, ${tok(T.bg)}));\n --_surface: var(--cpk-drawer-surface, var(--card, ${tok(T.surface)}));\n --_surface-fg: var(\n --cpk-drawer-surface-fg,\n var(--card-foreground, ${tok(T[\"surface-fg\"])})\n );\n --_muted: var(--cpk-drawer-muted, var(--muted, ${tok(T.muted)}));\n --_muted-fg: var(\n --cpk-drawer-muted-fg,\n var(--muted-foreground, ${tok(T[\"muted-fg\"])})\n );\n --_accent: var(--cpk-drawer-accent, var(--accent, ${tok(T.accent)}));\n --_accent-fg: var(\n --cpk-drawer-accent-fg,\n var(--accent-foreground, ${tok(T[\"accent-fg\"])})\n );\n --_primary: var(--cpk-drawer-primary, var(--primary, ${tok(T.primary)}));\n --_primary-fg: var(\n --cpk-drawer-primary-fg,\n var(--primary-foreground, ${tok(T[\"primary-fg\"])})\n );\n --_danger: var(--cpk-drawer-danger, var(--destructive, ${tok(T.danger)}));\n --_border: var(--cpk-drawer-border, var(--border, ${tok(T.border)}));\n --_ring: var(--cpk-drawer-ring, var(--ring, ${tok(T.ring)}));\n --_indicator: var(--cpk-drawer-indicator, #5b94e4);\n /* Cap the corner radius at 4px (per designer) — themeable but never larger. */\n --_radius: min(\n var(--cpk-drawer-radius, var(--radius, ${tok(T.radius)})),\n 4px\n );\n --_width: var(--cpk-drawer-width, 320px);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n .root {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: var(--_width);\n background: var(--_bg);\n border-right: 1px solid var(--_border);\n overflow: hidden;\n transition: width 0.2s ease;\n /* The confirm-delete dialog no longer needs a positioning context here: it\n is a native <dialog> opened with showModal(), which renders in the\n browser top layer independent of any stacking context (ENT-1051). No\n other direct child of .root is absolutely positioned (the filter and\n row-action popovers anchor to their own positioned ancestors), so .root\n stays static. The mobile path establishes its own context via\n position:fixed. */\n }\n\n /* Mobile: off-canvas overlay (modal pattern). */\n .root.mobile {\n position: fixed;\n inset: 0 auto 0 0;\n z-index: 1000;\n width: min(var(--_width), 85vw);\n transform: translateX(-100%);\n transition: transform 0.2s ease;\n box-shadow: 0 0 0 100vmax transparent;\n }\n\n .root.mobile.open {\n transform: translateX(0);\n }\n\n /* Desktop collapsed: the panel is replaced by the floating cluster, so remove\n it from the layout entirely. The host reclaims the reserved column via the\n --cpk-drawer-reserved-width:0px override the element sets on collapse. */\n .root.collapsed {\n display: none;\n }\n\n .backdrop {\n position: fixed;\n inset: 0;\n z-index: 999;\n background: rgba(0, 0, 0, 0.4);\n border: 0;\n padding: 0;\n margin: 0;\n cursor: pointer;\n }\n\n /* Floating launcher cluster (Figma \"closed\" mockup): a rounded surface card\n holding the sidebar toggle + a \"New Conversation\" (+) icon button. Rendered\n by the element itself in the mobile-closed AND desktop-collapsed states so\n there is always a way to reopen/expand — and to start a new conversation —\n with no host wiring. */\n .launcher-cluster {\n position: fixed;\n z-index: 998;\n /* Position is themeable so a host can line the cluster up with its own\n header controls (e.g. vertically centering it on a toggle group). */\n top: var(--cpk-drawer-launcher-top, 24px);\n left: var(--cpk-drawer-launcher-left, 24px);\n display: inline-flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: var(--_radius);\n border: 1px solid var(--_border);\n background: var(--_surface);\n color: var(--_surface-fg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);\n }\n\n .launcher {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 6px;\n border: 0;\n border-radius: calc(var(--_radius) - 3px);\n background: transparent;\n color: var(--_surface-fg);\n cursor: pointer;\n font: inherit;\n }\n\n .launcher:hover,\n .launcher:focus-visible {\n background: var(--_muted);\n }\n\n .launcher .icon {\n width: 18px;\n height: 18px;\n display: block;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n }\n\n /* The header is hidden until a consumer projects slot=\"header\" content\n (the redesign has no built-in header controls). Mirrors the memories/footer\n gating so an empty padded header bar never renders above the list. */\n .header[hidden] {\n display: none;\n }\n\n /* Optional consumer projection surface. When a consumer projects into\n slot=\"header\" it fills the header row. */\n .header slot[name=\"header\"] {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n }\n\n .icon-btn {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 6px;\n border: 0;\n border-radius: var(--_radius);\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n }\n\n /* \"Filter applied\" indicator dot at the funnel's bottom-right (Figma archived\n view). Shown only when a non-default filter is active. */\n .filter-dot {\n position: absolute;\n right: 3px;\n bottom: 4px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--_indicator);\n pointer-events: none;\n }\n\n .icon-btn:hover,\n .icon-btn:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .icon-btn[aria-pressed=\"true\"] {\n background: var(--_muted);\n color: inherit;\n }\n\n .icon {\n width: 20px;\n height: 20px;\n display: block;\n }\n\n .new-conversation {\n display: flex;\n align-items: center;\n gap: 12px;\n /* No top margin by default: the header bar (the collapse toggle on desktop,\n the close button on mobile-open) sits above this row and supplies the top\n spacing — the header-hidden case re-adds it below. Horizontal geometry\n matches the list rows: the hover background insets 12px (like a row's\n highlight) and, with 10px inner padding, the icon's left edge lands at\n 22px — the same x as the thread names below (list padding 12 + row\n padding 10). */\n margin: 0 12px;\n padding: 8px 10px;\n border: 0;\n border-radius: var(--_radius);\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n }\n\n /* Only when the header bar is fully hidden (collapsible=false AND no projected\n header content) is this row the first element — give it the top spacing the\n header would otherwise supply. */\n .header[hidden] + .new-conversation {\n margin-top: 12px;\n }\n\n .new-conversation:hover,\n .new-conversation:focus-visible {\n background: var(--_muted);\n }\n\n .new-conversation .icon {\n width: 16px;\n height: 16px;\n }\n\n .section-heading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n /* Match the list rows' content edge: \"Recent Conversations\" lands at 22px\n (margin 12 + padding 10), aligned with the thread names and the New\n Conversation icon; the funnel sits 22px from the right, over the kebabs. */\n padding: 8px 10px;\n margin: 0 12px;\n }\n\n .section-title {\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n color: var(--_muted-fg);\n text-transform: none;\n }\n\n .icon-btn.small {\n width: 24px;\n height: 24px;\n padding: 4px;\n }\n\n .icon-btn.small .icon {\n width: 16px;\n height: 16px;\n }\n\n .filter-popover {\n position: absolute;\n right: 0;\n top: calc(100% + 4px);\n z-index: 15;\n display: flex;\n flex-direction: column;\n min-width: 120px;\n padding: 4px;\n background: var(--_surface);\n color: var(--_surface-fg);\n border: 1px solid var(--_border);\n border-radius: var(--_radius);\n box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);\n }\n\n .filter-opt {\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n padding: 6px 8px;\n border-radius: 4px;\n }\n\n .filter-opt:hover,\n .filter-opt:focus-visible {\n background: var(--_muted);\n }\n\n .filter-opt[aria-pressed=\"true\"] {\n font-weight: 600;\n }\n\n .list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 8px 12px;\n margin: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border-radius: var(--_radius);\n cursor: pointer;\n background: transparent;\n color: inherit;\n border: 1px solid transparent;\n opacity: 0;\n transform: translateY(4px);\n animation: cpk-drawer-row-in 0.18s ease forwards;\n /* Positioned so the hovered row can be lifted above later rows (below). */\n position: relative;\n }\n\n /* Lift the interacted row above later rows so its kebab popover (which paints\n inside the row's own transform stacking context) is not clipped by / drawn\n under the rows below it. */\n .row:hover,\n .row:focus-within,\n .row.menu-open {\n z-index: 3;\n }\n\n /* While a kebab menu is open, the popover only covers part of the rows it\n overlaps, so the rest of the list would still respond to hover — revealing\n other rows' kebabs and (under a host \\`::part(row):hover\\` theme) painting a\n hover background \"through\"/around the open menu. Freeze pointer events on\n every OTHER row so the menu reads as a single focused surface. The owner\n row (\\`.menu-open\\`) and its popover stay interactive, and a pointerdown that\n lands on a frozen row still reaches the document handler that closes the\n menu, so click-away dismissal is preserved. */\n .list.menu-open .row:not(.menu-open) {\n pointer-events: none;\n }\n\n @keyframes cpk-drawer-row-in {\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .row.active {\n background: var(--_accent);\n color: var(--_accent-fg);\n /* No border on the selected row — the background change alone marks it\n (per designer). The base row keeps its 1px transparent border so the\n layout stays stable. */\n }\n\n .row.archived .row-name {\n color: var(--_muted-fg);\n font-style: italic;\n }\n\n .row-name {\n flex: 1;\n min-width: 0;\n }\n\n .row-name-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .row-name.placeholder {\n color: var(--_muted-fg);\n font-style: italic;\n }\n\n .row-name.revealed {\n animation: cpk-drawer-name-reveal 0.3s ease;\n }\n\n @keyframes cpk-drawer-name-reveal {\n from {\n opacity: 0.4;\n }\n to {\n opacity: 1;\n }\n }\n\n .row-action {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n border: 0;\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n padding: 5px;\n border-radius: 4px;\n }\n\n .row-action:hover,\n .row-action:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .row-action-icon {\n width: 15px;\n height: 15px;\n display: block;\n }\n\n /* Per-row kebab trigger: hidden at rest, revealed when the row is hovered,\n focused (keyboard), active (selected), or its menu is open. */\n .row-menu {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 4px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--_muted-fg);\n cursor: pointer;\n font: inherit;\n opacity: 0;\n }\n\n .row:hover .row-menu,\n .row:focus-within .row-menu,\n .row.active .row-menu,\n .row-menu[aria-expanded=\"true\"] {\n opacity: 1;\n }\n\n .row-menu:hover,\n .row-menu:focus-visible {\n background: var(--_muted);\n color: inherit;\n }\n\n .row-menu .icon {\n width: 16px;\n height: 16px;\n }\n\n .row-menu-popover {\n position: absolute;\n right: 8px;\n top: calc(100% - 4px);\n z-index: 16;\n display: flex;\n flex-direction: column;\n min-width: 140px;\n padding: 4px;\n background: var(--_surface);\n color: var(--_surface-fg);\n border: 1px solid var(--_border);\n border-radius: var(--_radius);\n box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);\n }\n\n /* Rows in the lower portion of the list open their kebab menu UPWARD so it is\n not clipped by the list's overflow scroll box (.list is overflow-y:auto,\n which also clips the x-axis). Anchoring to the button's top edge via\n \\`bottom\\` keeps the popover inside the list's visible area for bottom rows. */\n .row.menu-up .row-menu-popover {\n top: auto;\n bottom: calc(100% - 4px);\n }\n\n .row-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n padding: 6px 8px;\n border-radius: 4px;\n }\n\n .row-menu-item:hover,\n .row-menu-item:focus-visible {\n background: var(--_muted);\n }\n\n .row-menu-item.danger:hover,\n .row-menu-item.danger:focus-visible {\n color: var(--_danger);\n }\n\n .row-menu-item .row-action-icon,\n .row-menu-item .icon {\n width: 15px;\n height: 15px;\n }\n\n button.primary {\n background: var(--_primary);\n color: var(--_primary-fg);\n border: 0;\n border-radius: var(--_radius);\n padding: 8px 12px;\n cursor: pointer;\n font: inherit;\n }\n\n .state {\n padding: 24px 16px;\n text-align: center;\n color: var(--_muted-fg);\n }\n\n .state.error {\n color: var(--_danger);\n }\n\n .fetch-more-error {\n padding: 8px 12px;\n text-align: center;\n color: var(--_danger);\n font-size: 0.9em;\n }\n\n .load-more {\n display: block;\n width: 100%;\n padding: 8px 12px;\n background: none;\n border: none;\n color: var(--_muted-fg);\n font: inherit;\n font-size: 0.9em;\n cursor: pointer;\n }\n\n .load-more:hover,\n .load-more:focus-visible {\n color: var(--_surface-fg);\n background: var(--_muted);\n }\n\n .licensed {\n padding: 24px 16px;\n text-align: center;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .memories {\n border-top: 1px solid var(--_border);\n padding: 8px 12px;\n }\n\n .memories[hidden] {\n display: none;\n }\n\n /* Confirm-delete dialog — a native <dialog> opened with showModal(). It lives\n in the browser TOP LAYER, so it can never be painted under other UI (the\n old CSS-positioned overlay was trapped in the drawer host's stacking\n context and appeared under the chat's welcome view — ENT-1051). The UA\n centers it in the viewport via margin:auto; we reset the UA chrome and\n apply the drawer's surface-card look. */\n .dialog {\n /* Top-layer (showModal) so it is never clipped, but centered over the DRAWER\n PANEL rather than the viewport: JS sets --confirm-cx/cy from the visible\n .root rect (falls back to viewport-center when unmeasured, e.g. jsdom).\n Width is capped to the drawer band so it reads as \"inside the drawer\". */\n margin: 0;\n position: fixed;\n left: var(--confirm-cx, 50%);\n top: var(--confirm-cy, 50%);\n transform: translate(-50%, -50%);\n border: 0;\n padding: 16px;\n width: max-content;\n max-width: min(80vw, calc(var(--_width) - 24px));\n background: var(--_surface);\n color: var(--_surface-fg);\n border-radius: var(--_radius);\n }\n\n /* Only lay out the card contents when open. A closed <dialog> is display:none\n via the UA stylesheet, and author display rules must not override that (or\n an empty box would leak), so the flex layout is scoped to [open]. */\n .dialog[open] {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .dialog::backdrop {\n background: rgba(0, 0, 0, 0.3);\n }\n\n .dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n }\n\n .footer {\n border-top: 1px solid var(--_border);\n padding: 12px;\n }\n\n .footer[hidden] {\n display: none;\n }\n`;\n","import { LitElement, html, nothing } from \"lit\";\nimport type { PropertyValues } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { drawerStyles } from \"./styles\";\nimport type { DrawerFilter, DrawerThread, LicensedDetail } from \"./types\";\n\n/** Tag name the element registers under. */\nexport const COPILOTKIT_THREADS_DRAWER_TAG =\n \"copilotkit-threads-drawer\" as const;\n\n/** Mobile breakpoint (px). At or below this width the drawer is a modal overlay. */\nconst MOBILE_BREAKPOINT = 768;\n\n/**\n * Whether an inbound error message should surface an error state. Only a\n * non-empty, non-whitespace string counts — `null`, `\"\"`, and whitespace-only\n * strings are treated as \"no error\" so an empty error never conflates with a\n * real one (and never blanks the list behind an empty error panel).\n */\nfunction hasErrorMessage(value: string | null): value is string {\n return value !== null && value.trim().length > 0;\n}\n\n/**\n * Builds the per-row slot name (`row:<id>`) used for consumer projection, but\n * only when the thread id is safe to embed in a slot `name` / `slot` attribute\n * token. A slot name is matched character-for-character against the consumer's\n * `slot=\"...\"` attribute; whitespace splits attribute tokens and quotes/angle\n * brackets can break attribute serialization, so an id containing any of those\n * would silently fail projection. For such an id we return `null` and the row\n * renders its default name span (no per-row slot), which is the safe fallback.\n */\nfunction rowSlotName(id: string): string | null {\n // Reject whitespace and characters that are unsafe in an HTML attribute token.\n if (id.length === 0 || /[\\s\"'<>=]/.test(id)) return null;\n return `row:${id}`;\n}\n\n/**\n * Inline row-action icons. The element is framework-agnostic Lit, so it cannot\n * depend on a React icon library — these are the lucide `archive`,\n * `archive-restore`, and `trash-2` glyphs inlined as SVG, drawn with\n * `currentColor` so they inherit the button's themed color.\n */\nconst iconArchive = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n`;\nconst iconUnarchive = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n`;\nconst iconDelete = html`\n <svg\n class=\"row-action-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M3 6h18\" />\n <path\n d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"\n />\n <line x1=\"10\" x2=\"10\" y1=\"11\" y2=\"17\" />\n <line x1=\"14\" x2=\"14\" y1=\"11\" y2=\"17\" />\n </svg>\n`;\n// Sidebar/panel glyph (the Figma toggle icon). Used for the desktop collapse\n// toggle, the desktop collapsed cluster's expand toggle, the mobile launcher\n// (open), and the mobile header dismiss (close) — the toggle glyph is identical\n// in every state, matching the Figma.\nconst iconSidebar = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n`;\n\n/**\n * Header / control icons for the redesigned drawer chrome (ENT-1051). Inlined\n * lucide glyphs (`square-plus`, `filter`, `ellipsis-vertical`) drawn with\n * `currentColor` so they inherit the button's themed color — the element cannot\n * depend on a React icon library.\n */\nconst iconPlusSquare = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M8 12h8\" />\n <path d=\"M12 8v8\" />\n </svg>\n`;\nconst iconFunnel = html`\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"3\" y1=\"5\" x2=\"21\" y2=\"5\" />\n <line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\" />\n <line x1=\"10\" y1=\"19\" x2=\"14\" y2=\"19\" />\n </svg>\n`;\nconst iconKebab = html`\n <svg class=\"icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"5\" r=\"1.6\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.6\" />\n <circle cx=\"12\" cy=\"19\" r=\"1.6\" />\n </svg>\n`;\n\n/**\n * Most recent first, by `lastRunAt`, then `updatedAt`, then `createdAt`,\n * compared as parsed instants. A timestamp that does not parse sorts last, and\n * ties keep their input order. This is the order of `sortThreadsByRecency` in\n * `@copilotkit/core` (`packages/core/src/threads.ts`), which sorts the\n * threads the framework drawers pass in, so the element keeps their order.\n * Keep the two in step: this package does not depend on core.\n */\nfunction sortThreadsByRecency(threads: readonly DrawerThread[]) {\n return [...threads].sort((left, right) => recencyOf(right) - recencyOf(left));\n}\n\nfunction recencyOf(thread: DrawerThread): number {\n const time = Date.parse(\n thread.lastRunAt ?? thread.updatedAt ?? thread.createdAt,\n );\n return Number.isNaN(time) ? Number.NEGATIVE_INFINITY : time;\n}\n\n/**\n * `<copilotkit-threads-drawer>` — a public, self-contained, controlled, framework-agnostic\n * threads drawer rendered into a shadow root.\n *\n * Pure VIEW: domain data (threads/loading/error/etc.) comes IN as properties and\n * user intent goes OUT as bubbling+composed DOM `CustomEvent`s. The element owns\n * VIEW state (open, Active/All filter, confirm-delete dialog, per-row\n * animations) while the consumer owns DOMAIN state. `open` is additionally\n * externally controllable via the `open` property + `open-change` event so a\n * host can coordinate mobile open/close.\n *\n * The element is AUTHORITATIVE over row order and the Active/All filter.\n */\nexport class CopilotKitThreadsDrawer extends LitElement {\n static styles = drawerStyles;\n\n static properties = {\n // Inbound domain properties.\n threads: { attribute: false },\n loading: { type: Boolean },\n error: { type: String },\n activeThreadId: { attribute: \"active-thread-id\", type: String },\n licensed: { type: Boolean },\n licenseUrl: { attribute: \"license-url\", type: String },\n hasMore: { attribute: \"has-more\", type: Boolean },\n fetchingMore: { attribute: \"fetching-more\", type: Boolean },\n fetchMoreError: { attribute: \"fetch-more-error\", type: String },\n // Inbound: configurable label for the drawer region and default header.\n label: { type: String },\n // Inbound: configurable \"Recent Conversations\" section heading text.\n recentLabel: { attribute: \"recent-label\", type: String },\n collapsible: { type: Boolean },\n // Externally-controllable VIEW state.\n open: { type: Boolean, reflect: true },\n collapsed: { type: Boolean, reflect: true },\n // Internal VIEW state.\n _filter: { state: true },\n _confirmingDeleteId: { state: true },\n _viewportIsMobile: { state: true },\n _hasHeader: { state: true },\n _hasMemories: { state: true },\n _hasFooter: { state: true },\n _filterOpen: { state: true },\n _openMenuId: { state: true },\n };\n\n /**\n * Inbound: accessible label for the drawer region — drives the screen-reader\n * region name (on `.root`) and the listbox name (on `.list`) ONLY. The\n * redesign has no visible title; project visible header chrome via the\n * optional `header` slot instead. Defaults to `\"Threads\"`.\n */\n label = \"Threads\";\n\n /**\n * Inbound: text for the \"Recent Conversations\" section heading above the list.\n * Attribute: `recent-label`. Defaults to `\"Recent Conversations\"`.\n */\n recentLabel = \"Recent Conversations\";\n\n /** Inbound: thread records to render. The element re-orders/filters them. */\n threads: DrawerThread[] = [];\n /** Inbound: initial-fetch loading flag. */\n loading = false;\n /** Inbound: initial-fetch error message (actionable Retry shown when set). */\n error: string | null = null;\n /** Inbound: currently-open thread id (drives row selection highlight). */\n activeThreadId: string | null = null;\n /** Inbound: whether the org is licensed for threads; `false` shows the locked view. */\n licensed = true;\n /**\n * Inbound: destination the Upgrade CTA opens (new tab) when the locked view's\n * default button is clicked. Defaults to the CopilotKit Intelligence docs.\n * Set to an empty string to suppress the default navigation and rely solely\n * on the `licensed` event.\n */\n licenseUrl = \"https://docs.copilotkit.ai/intelligence\";\n /** Inbound: whether more pages are available. */\n hasMore = false;\n /** Inbound: whether a fetch-more is in flight. */\n fetchingMore = false;\n /** Inbound: fetch-more error message (inline, list preserved). */\n fetchMoreError: string | null = null;\n\n /**\n * Externally-controllable: whether the drawer is open (mobile coordination).\n * Defaults to `false` so a mobile-width first render does NOT paint the open\n * modal (backdrop + body scroll-lock + focus steal) for one frame before a\n * wrapper's post-mount effect can close it. Desktop is unaffected — only\n * `.root.mobile.open` / `_isMobileModalOpen()` consume `open`.\n */\n open = false;\n /**\n * Externally-controllable: whether the drawer is collapsed to the floating\n * cluster on desktop. Defaults to `false` (expanded). Reflected so hosts can\n * theme on `[collapsed]`. Ignored on mobile, where open/closed governs the\n * off-canvas modal instead.\n */\n collapsed = false;\n /**\n * Inbound: whether the user may collapse the drawer on desktop. Defaults to\n * `true`. When `false` the header omits the collapse toggle and the drawer\n * NEVER renders the collapsed cluster on desktop (it stays expanded even if\n * `collapsed` is set) — mobile off-canvas open/close is independent.\n */\n collapsible = true;\n\n private _filter: DrawerFilter = \"active\";\n private _confirmingDeleteId: string | null = null;\n private _viewportIsMobile = false;\n private _hasHeader = false;\n private _hasMemories = false;\n private _hasFooter = false;\n /** Whether the funnel filter popover (Active/All) is open. */\n private _filterOpen = false;\n /** Id of the row whose kebab actions menu is open (only one at a time). */\n private _openMenuId: string | null = null;\n\n private _mediaQuery: MediaQueryList | null = null;\n private readonly _onMediaChange = (event: MediaQueryListEvent) => {\n this._viewportIsMobile = event.matches;\n };\n private readonly _onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n if (this._openMenuId !== null) {\n this._openMenuId = null;\n event.stopPropagation();\n return;\n }\n if (this._filterOpen) {\n this._filterOpen = false;\n event.stopPropagation();\n return;\n }\n // The confirm-delete <dialog> is opened with showModal(): the browser\n // dismisses it natively via the dialog's `cancel` event. But that Escape\n // keydown still bubbles from the modal to this host handler, so we must\n // stop here — otherwise it falls through to the mobile branch below and\n // closes the whole drawer along with the confirmation.\n if (this._confirmingDeleteId !== null) {\n event.stopPropagation();\n return;\n }\n if (this._viewportIsMobile && this.open) {\n this._setOpen(false);\n event.stopPropagation();\n }\n return;\n }\n // Tab focus-trap for the mobile modal. Handled at the HOST (not on `.root`)\n // so it fires wherever focus sits in the shadow root — including the\n // backdrop button, which renders as a sibling OUTSIDE `.root`. A trap bound\n // only to `.root` lets Tab from the backdrop (or any out-of-root node)\n // escape the modal to the page behind it.\n if (event.key === \"Tab\") {\n this._trapTab(event);\n }\n };\n\n /**\n * Dismisses the funnel filter popover and/or an open row-actions menu when a\n * pointerdown lands outside them. Bound to `document` (composed events bubble\n * out of the shadow root), so we discriminate inside vs. outside via\n * `composedPath()` rather than target identity. A click on a popover's own\n * trigger is treated as \"inside\" so its own `@click` toggle handles the close\n * (avoids a double-toggle that would immediately reopen it).\n */\n private readonly _onDocumentPointerDown = (event: Event) => {\n if (!this._filterOpen && this._openMenuId === null) return;\n const path = event.composedPath();\n if (this._filterOpen) {\n const popover = this.renderRoot.querySelector('[part=\"filters\"]');\n const trigger = this.renderRoot.querySelector('[part=\"filter-toggle\"]');\n const inside =\n (popover && path.includes(popover)) ||\n (trigger && path.includes(trigger));\n if (!inside) this._filterOpen = false;\n }\n if (this._openMenuId !== null) {\n const popover = this.renderRoot.querySelector(\n '[part=\"row-menu-popover\"]',\n );\n const trigger = this.renderRoot.querySelector(\n '.row.menu-open [part=\"row-menu\"]',\n );\n const inside =\n (popover && path.includes(popover)) ||\n (trigger && path.includes(trigger));\n if (!inside) this._openMenuId = null;\n }\n };\n\n /** Thread ids previously seen as named, so we can animate the null→named reveal. */\n private readonly _seenNamed = new Set<string>();\n /** Thread ids whose name just transitioned null→named in this update cycle. */\n private _justRevealed = new Set<string>();\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (typeof window !== \"undefined\" && window.matchMedia) {\n this._mediaQuery = window.matchMedia(\n `(max-width: ${MOBILE_BREAKPOINT}px)`,\n );\n this._viewportIsMobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n }\n this.addEventListener(\"keydown\", this._onKeyDown);\n if (typeof document !== \"undefined\") {\n document.addEventListener(\"pointerdown\", this._onDocumentPointerDown);\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this.removeEventListener(\"keydown\", this._onKeyDown);\n if (typeof document !== \"undefined\") {\n document.removeEventListener(\"pointerdown\", this._onDocumentPointerDown);\n }\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"scroll\", this._repositionConfirm, true);\n window.removeEventListener(\"resize\", this._repositionConfirm);\n }\n // Release the reserved-width override we may have set on the document root.\n if (typeof document !== \"undefined\") {\n document.documentElement.style.removeProperty(\n \"--cpk-drawer-reserved-width\",\n );\n }\n this._releaseScrollLock();\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n // Compute the null→named reveal set BEFORE render, so render stays pure.\n if (changed.has(\"threads\")) {\n const presentIds = new Set<string>();\n const revealed = new Set<string>();\n for (const thread of this.threads) {\n presentIds.add(thread.id);\n const hasName = thread.name !== null && thread.name !== \"\";\n if (hasName && !this._seenNamed.has(thread.id)) {\n revealed.add(thread.id);\n }\n if (hasName) this._seenNamed.add(thread.id);\n }\n // Prune ids no longer present so `_seenNamed` cannot grow without bound\n // across a long-lived, high-churn session.\n for (const id of this._seenNamed) {\n if (!presentIds.has(id)) this._seenNamed.delete(id);\n }\n this._justRevealed = revealed;\n\n // Auto-dismiss a pending confirm-delete whose target is no longer in the\n // visible threads (the consumer removed/archived/filtered it away while\n // the dialog was open). Without this the dialog could emit `delete` with a\n // stale id. Reconciled against the SAME visible set the user is acting on.\n if (this._confirmingDeleteId !== null) {\n const stillVisible = this._visibleThreads().some(\n (t) => t.id === this._confirmingDeleteId,\n );\n if (!stillVisible) this._confirmingDeleteId = null;\n }\n\n // Same reconciliation for an open row-actions menu: if the row whose\n // kebab menu is open is no longer visible (removed/archived/filtered\n // away), close the menu so it cannot linger detached from any row.\n if (this._openMenuId !== null) {\n const stillVisible = this._visibleThreads().some(\n (t) => t.id === this._openMenuId,\n );\n if (!stillVisible) this._openMenuId = null;\n }\n }\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n // Scroll-lock is a mobile-modal concern only.\n if (\n changed.has(\"open\") ||\n changed.has(\"_viewportIsMobile\" as keyof CopilotKitThreadsDrawer)\n ) {\n if (this._isMobileModalOpen()) {\n this._applyScrollLock();\n this._focusFirstFocusable();\n } else {\n this._releaseScrollLock();\n }\n }\n\n // Reclaim the reserved layout column when the desktop collapse state (or the\n // viewport) changes.\n if (\n changed.has(\"collapsed\") ||\n changed.has(\"collapsible\") ||\n changed.has(\"_viewportIsMobile\" as keyof CopilotKitThreadsDrawer)\n ) {\n this._syncReservedWidth();\n }\n\n // Drive the native top-layer <dialog> from the confirm state. Opening with\n // showModal() places it in the browser top layer (above every stacking\n // context) so it is never clipped; we then re-center it over the drawer\n // panel via _positionConfirmDialog(). Feature-detect showModal/close because\n // jsdom implements neither — fall back to toggling the `open` attribute so\n // unit tests still observe the open/closed state.\n const dialog = this.renderRoot.querySelector(\"dialog\");\n if (dialog) {\n const id = this._confirmingDeleteId;\n if (id !== null && !dialog.open) {\n typeof dialog.showModal === \"function\"\n ? dialog.showModal()\n : dialog.setAttribute(\"open\", \"\");\n this._positionConfirmDialog();\n window.addEventListener(\"scroll\", this._repositionConfirm, true);\n window.addEventListener(\"resize\", this._repositionConfirm);\n } else if (id === null && dialog.open) {\n typeof dialog.close === \"function\"\n ? dialog.close()\n : dialog.removeAttribute(\"open\");\n window.removeEventListener(\"scroll\", this._repositionConfirm, true);\n window.removeEventListener(\"resize\", this._repositionConfirm);\n }\n }\n\n // The reveal animation fires exactly once per real name-arrival. Clearing\n // the set after the render that applied the `revealed` class prevents any\n // later, unrelated re-render from re-adding the class and re-firing the\n // animation. `_justRevealed` is a plain field (not reactive), so resetting\n // it here does not schedule another update.\n if (this._justRevealed.size > 0) {\n this._justRevealed = new Set<string>();\n }\n }\n\n // --- View-state helpers ----------------------------------------------------\n\n private _isMobileModalOpen(): boolean {\n return this._viewportIsMobile && this.open;\n }\n\n private _setOpen(next: boolean): void {\n if (this.open === next) return;\n this.open = next;\n this._emit(\"open-change\", { open: next });\n }\n\n private _setCollapsed(next: boolean): void {\n if (this.collapsed === next) return;\n this.collapsed = next;\n this._emit(\"collapse-change\", { collapsed: next });\n }\n\n /**\n * Signal the drawer's reserved layout width to the host so a desktop collapse\n * reclaims the column instead of leaving an empty gap. On desktop-collapse we\n * set `--cpk-drawer-reserved-width: 0px` on the document root; a host whose\n * grid reads `grid-template-columns: var(--cpk-drawer-reserved-width, 320px) …`\n * inherits it and collapses the track (with its own transition). Expanded/mobile\n * clears the override so the host's fallback width applies — which also means\n * the default (expanded) render never sets it, so there is no hydration flicker.\n *\n * It is set on `document.documentElement` (not `parentElement`) BECAUSE the\n * element is nested inside a framework wrapper host, so its parent is the\n * wrapper — not the grid container, which is an ancestor a child's custom\n * property can't reach. `:root` inheritance reaches the grid regardless of\n * wrapper nesting. Best-effort + namespaced, single-drawer-per-document; a host\n * with multiple drawers or a custom layout should instead react to the\n * `collapse-change` event.\n */\n private _syncReservedWidth(): void {\n if (typeof document === \"undefined\") return;\n const desktopCollapsed =\n this.collapsible && this.collapsed && !this._viewportIsMobile;\n const root = document.documentElement;\n if (desktopCollapsed) {\n root.style.setProperty(\"--cpk-drawer-reserved-width\", \"0px\");\n } else {\n root.style.removeProperty(\"--cpk-drawer-reserved-width\");\n }\n }\n\n /**\n * Center the confirm-delete <dialog> over the drawer PANEL's on-screen box\n * (not the viewport). The dialog stays a top-layer `showModal()` element so it\n * is never clipped, but we drive its center via `--confirm-cx/cy` measured\n * from the visible `.root` rect — so it reads as \"inside the drawer\" per the\n * ENT-1051 design while keeping the top-layer robustness. Falls back to\n * viewport-center (the CSS default) when the panel isn't measurable\n * (SSR/jsdom).\n */\n private _positionConfirmDialog(): void {\n const dialog = this.renderRoot.querySelector<HTMLDialogElement>(\"dialog\");\n const root = this.renderRoot.querySelector<HTMLElement>(\".root\");\n if (!dialog) return;\n const rect = root?.getBoundingClientRect();\n if (!rect || (rect.width === 0 && rect.height === 0)) {\n dialog.style.removeProperty(\"--confirm-cx\");\n dialog.style.removeProperty(\"--confirm-cy\");\n return;\n }\n // Center over the drawer's VISIBLE box (its rect intersected with the\n // viewport), not the raw rect: a host grid that doesn't bound the drawer's\n // row lets `.root` grow to content height, so a raw-rect center would land\n // far down the page. Intersecting with the viewport keeps the modal centered\n // in the on-screen drawer band regardless of how the host sizes the panel.\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const visLeft = Math.max(rect.left, 0);\n const visRight = Math.min(rect.right, vw);\n const visTop = Math.max(rect.top, 0);\n const visBottom = Math.min(rect.bottom, vh);\n dialog.style.setProperty(\"--confirm-cx\", `${(visLeft + visRight) / 2}px`);\n dialog.style.setProperty(\"--confirm-cy\", `${(visTop + visBottom) / 2}px`);\n }\n\n /** Bound reposition handler for scroll/resize while the confirm dialog is open. */\n private _repositionConfirm = () => this._positionConfirmDialog();\n\n private _setFilter(next: DrawerFilter): void {\n if (this._filter === next) return;\n this._filter = next;\n this._emit(\"filter-change\", { filter: next });\n }\n\n /**\n * Element-authoritative ordering + filtering. Active filter hides archived\n * threads; ordering is most-recent-first by `lastRunAt`/`updatedAt`.\n */\n private _visibleThreads(): DrawerThread[] {\n const filtered =\n this._filter === \"active\"\n ? this.threads.filter((t) => !t.archived)\n : this.threads;\n return sortThreadsByRecency(filtered);\n }\n\n private _emit<T>(type: string, detail: T): void {\n this.dispatchEvent(\n new CustomEvent(type, { detail, bubbles: true, composed: true }),\n );\n }\n\n // --- Scroll lock + focus (mobile modal only) -------------------------------\n\n private _scrollLocked = false;\n private _prevBodyOverflow = \"\";\n\n private _applyScrollLock(): void {\n if (this._scrollLocked || typeof document === \"undefined\") return;\n this._prevBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n this._scrollLocked = true;\n }\n\n private _releaseScrollLock(): void {\n if (!this._scrollLocked || typeof document === \"undefined\") return;\n document.body.style.overflow = this._prevBodyOverflow;\n this._scrollLocked = false;\n }\n\n /**\n * Returns the focusable elements in the composed/flattened tree of the drawer\n * root, INCLUDING slotted light-DOM content (so a focus trap covers slotted\n * rows). Walks assigned nodes of each `<slot>`.\n */\n private _composedFocusable(): HTMLElement[] {\n const selector =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n const out: HTMLElement[] = [];\n // The backdrop button is a modal-owned focusable rendered as a sibling of\n // `.root`. Include it first (it precedes `.root` in DOM order) so the focus\n // trap treats it as part of the modal's cycle rather than an escape hatch.\n const backdrop = this.renderRoot.querySelector<HTMLElement>(\".backdrop\");\n if (backdrop) out.push(backdrop);\n const root = this.renderRoot.querySelector(\".root\");\n if (!root) return out;\n const collect = (node: ParentNode) => {\n node\n .querySelectorAll<HTMLElement>(selector)\n .forEach((el) => out.push(el));\n };\n collect(root);\n root.querySelectorAll(\"slot\").forEach((slot) => {\n (slot as HTMLSlotElement)\n .assignedElements({ flatten: true })\n .forEach((assigned) => {\n if (assigned.matches(selector)) out.push(assigned as HTMLElement);\n collect(assigned);\n });\n });\n return out;\n }\n\n private _focusFirstFocusable(): void {\n // Defer so the rendered tree exists.\n queueMicrotask(() => {\n const focusable = this._composedFocusable();\n // Prefer the first real control over the backdrop scrim so opening the\n // modal lands focus on actionable content, not the close-on-click overlay\n // (the backdrop is still part of the trap cycle below).\n const backdrop = this.renderRoot.querySelector(\".backdrop\");\n const target = focusable.find((el) => el !== backdrop) ?? focusable[0];\n target?.focus();\n });\n }\n\n private readonly _trapTab = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\" || !this._isMobileModalOpen()) return;\n const focusable = this._composedFocusable();\n if (focusable.length === 0) return;\n const first = focusable[0]!;\n const last = focusable[focusable.length - 1]!;\n const active =\n (this.renderRoot as ShadowRoot).activeElement ?? document.activeElement;\n if (event.shiftKey && active === first) {\n last.focus();\n event.preventDefault();\n } else if (!event.shiftKey && active === last) {\n first.focus();\n event.preventDefault();\n }\n };\n\n // --- Render ----------------------------------------------------------------\n\n override render() {\n // Collapsed to the floating cluster on desktop (gated on `collapsible`), OR\n // closed on mobile — both show the same launcher cluster and hide the panel\n // body. Mobile keeps the body rendered (off-canvas, ready to slide in);\n // desktop-collapsed omits it entirely so the reserved column can reclaim.\n const desktopCollapsed =\n this.collapsible && this.collapsed && !this._viewportIsMobile;\n const mobileClosed = this._viewportIsMobile && !this.open;\n const showCluster = desktopCollapsed || mobileClosed;\n const rootClasses = {\n root: true,\n mobile: this._viewportIsMobile,\n open: this.open,\n collapsed: desktopCollapsed,\n };\n\n return html`\n ${showCluster ? this._renderCluster() : nothing}\n ${\n this._isMobileModalOpen()\n ? html`<button\n class=\"backdrop\"\n part=\"backdrop\"\n aria-label=\"Close threads drawer\"\n @click=${() => this._setOpen(false)}\n ></button>`\n : nothing\n }\n <div\n class=${classMap(rootClasses)}\n part=\"root\"\n role=${this._isMobileModalOpen() ? \"dialog\" : \"region\"}\n aria-modal=${this._isMobileModalOpen() ? \"true\" : nothing}\n aria-hidden=${desktopCollapsed ? \"true\" : nothing}\n aria-label=${this.label}\n >\n ${\n desktopCollapsed\n ? nothing\n : html`${this._renderHeader()} ${this._renderBody()}\n ${this._renderMemories()} ${this._renderFooter()}\n ${this._renderConfirmDialog()}`\n }\n </div>\n `;\n }\n\n /**\n * Floating launcher cluster from the Figma \"closed\" mockup: a sidebar-glyph\n * toggle + a \"New Conversation\" (+) icon button. Shown in TWO states — the\n * mobile closed state (toggle opens the off-canvas modal) and the desktop\n * collapsed state (toggle expands the sidebar). The primary toggle keeps\n * `part=\"launcher\"` for mobile-launcher theme compat; the new-thread button is\n * suppressed in the locked/unlicensed view, mirroring the New Conversation row.\n */\n private _renderCluster() {\n const onToggle = this._viewportIsMobile\n ? () => this._setOpen(true)\n : () => this._setCollapsed(false);\n const toggleLabel = this._viewportIsMobile\n ? \"Open threads\"\n : \"Expand threads\";\n return html`\n <div class=\"launcher-cluster\" part=\"launcher-cluster\">\n <button\n class=\"launcher\"\n part=\"launcher\"\n aria-label=${toggleLabel}\n @click=${onToggle}\n >\n <slot name=\"launcher-icon\">${iconSidebar}</slot>\n </button>\n ${\n this.licensed\n ? html`<button\n class=\"launcher launcher-new-thread\"\n part=\"launcher-new-thread\"\n aria-label=\"New Conversation\"\n @click=${() => this._emit(\"new-thread\", {})}\n >\n ${iconPlusSquare}\n </button>`\n : nothing\n }\n </div>\n `;\n }\n\n private _renderHeader() {\n // The header is a reserved consumer-projection surface with no built-in\n // controls (search and the desktop collapse toggle were both removed), so\n // it stays hidden until a consumer projects `slot=\"header\"` content — a\n // `slotchange` listener drives `_hasHeader`, mirroring the memories/footer\n // gating. Without this gate the empty padded header bar would render above\n // the \"New Conversation\" row. The \"New Conversation\" row is suppressed in\n // the locked/unlicensed view (only the Upgrade panel shows), mirroring the\n // section-heading gating.\n // On mobile the drawer is an off-canvas modal, so it needs an in-header\n // close affordance (desktop is a persistent sidebar — nothing to close).\n // The header therefore also renders when the mobile modal is open, even\n // with no projected `slot=\"header\"` content.\n const showMobileClose = this._viewportIsMobile && this.open;\n // Desktop collapse toggle: always available on desktop when collapsing is\n // permitted, so the header renders on desktop even with no projected\n // `slot=\"header\"` content. Mobile uses the launcher/close affordances.\n const showCollapseToggle = this.collapsible && !this._viewportIsMobile;\n return html`\n <div\n class=\"header\"\n part=\"header\"\n ?hidden=${!this._hasHeader && !showMobileClose && !showCollapseToggle}\n >\n <slot\n name=\"header\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasHeader = slot.assignedElements().length > 0;\n }}\n ></slot>\n ${\n // Toggle sits at the END so it right-aligns (the projected header slot\n // has flex:1 and pushes it over) — matching the mobile close button.\n showCollapseToggle\n ? html`<button\n class=\"icon-btn\"\n part=\"collapse-toggle\"\n aria-label=\"Collapse threads\"\n @click=${() => this._setCollapsed(true)}\n >\n ${iconSidebar}\n </button>`\n : nothing\n }\n ${\n showMobileClose\n ? html`<button\n class=\"icon-btn\"\n part=\"close-toggle\"\n aria-label=\"Close threads\"\n @click=${() => this._setOpen(false)}\n >\n ${iconSidebar}\n </button>`\n : nothing\n }\n </div>\n ${this.licensed ? this._renderNewConversation() : nothing}\n ${this._renderSectionHeading()}\n `;\n }\n\n /**\n * Dedicated full-width \"New Conversation\" row. Keeps `part=\"new-thread-button\"`\n * and fires the existing `new-thread` event, so wrappers/themes that hook the\n * old header pill are unaffected.\n */\n private _renderNewConversation() {\n return html`\n <button\n class=\"new-conversation\"\n part=\"new-thread-button\"\n @click=${() => this._emit(\"new-thread\", {})}\n >\n ${iconPlusSquare}\n <span>New Conversation</span>\n </button>\n `;\n }\n\n /**\n * \"Recent Conversations\" section heading with a funnel button that opens the\n * Active/All filter popover. Only shown when the list region is shown\n * (licensed, and not the full-panel error/empty-before-load) — mirrors the\n * old filters gate. The popover options keep `part=\"filter-active\"` /\n * `part=\"filter-all\"` and still emit `filter-change` via `_setFilter`.\n */\n private _renderSectionHeading() {\n if (\n !this.licensed ||\n (hasErrorMessage(this.error) && this.threads.length === 0)\n ) {\n return nothing;\n }\n return html`\n <div class=\"section-heading\" part=\"section-heading\">\n <span class=\"section-title\">${this.recentLabel}</span>\n <button\n class=\"icon-btn small\"\n part=\"filter-toggle\"\n aria-label=\"Filter threads\"\n aria-expanded=${this._filterOpen}\n @click=${() => (this._filterOpen = !this._filterOpen)}\n >\n ${iconFunnel}\n ${\n // \"Filter applied\" indicator dot — shown whenever the active filter\n // is not the default (\"active\"), matching the Figma's archived view.\n this._filter !== \"active\"\n ? html`\n <span class=\"filter-dot\" part=\"filter-indicator\"></span>\n `\n : nothing\n }\n </button>\n ${\n this._filterOpen\n ? html`<div\n class=\"filter-popover\"\n part=\"filters\"\n role=\"group\"\n aria-label=\"Filter threads\"\n >\n <button\n class=\"filter-opt\"\n part=\"filter-active\"\n aria-pressed=${this._filter === \"active\"}\n @click=${() => {\n this._setFilter(\"active\");\n this._filterOpen = false;\n }}\n >\n Active\n </button>\n <button\n class=\"filter-opt\"\n part=\"filter-all\"\n aria-pressed=${this._filter === \"all\"}\n @click=${() => {\n this._setFilter(\"all\");\n this._filterOpen = false;\n }}\n >\n All\n </button>\n </div>`\n : nothing\n }\n </div>\n `;\n }\n\n private _renderBody() {\n // The locked view beats error: an unlicensed org always sees it, never the\n // initial-fetch error.\n if (!this.licensed) return this._renderLicensed();\n // The full-panel error replaces the list ONLY when there is nothing to show\n // (a failed initial fetch). The bound `error` reflects the core store error,\n // which a failed mutation (delete/rename/archive) also sets — a delete\n // rollback restores its row, so when threads are still present we keep the\n // list visible rather than blanking it behind a \"couldn't load\" panel.\n if (hasErrorMessage(this.error) && this.threads.length === 0) {\n return this._renderError();\n }\n // Full-panel loading only when there is nothing to show yet (initial fetch).\n // A refetch (e.g. filter toggle Active<->All) keeps `loading` true while the\n // list is already populated — keep showing the known threads rather than\n // flashing the loading state over them.\n if (this.loading && this.threads.length === 0) return this._renderLoading();\n return this._renderList();\n }\n\n /**\n * Handles the Upgrade CTA click in the locked view. Dispatches a cancelable\n * `licensed` event carrying the resolved `licenseUrl`; unless a host calls\n * `preventDefault()`, opens that URL in a new tab. A blank `licenseUrl`\n * suppresses navigation so the event alone drives host behavior.\n */\n private _onLicensedCta(): void {\n const proceed = this.dispatchEvent(\n new CustomEvent(\"licensed\", {\n detail: { licenseUrl: this.licenseUrl } satisfies LicensedDetail,\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (proceed && this.licenseUrl && typeof window !== \"undefined\") {\n window.open(this.licenseUrl, \"_blank\", \"noopener,noreferrer\");\n }\n }\n\n private _renderLicensed() {\n return html`\n <div class=\"licensed\" part=\"licensed\" data-testid=\"drawer-licensed\">\n <slot name=\"licensed\">\n <p>Threads are a CopilotKit Intelligence feature.</p>\n <button\n class=\"primary\"\n part=\"licensed-cta\"\n @click=${() => this._onLicensedCta()}\n >\n Upgrade\n </button>\n </slot>\n </div>\n `;\n }\n\n private _renderError() {\n return html`\n <div\n class=\"state error\"\n part=\"error\"\n role=\"alert\"\n data-testid=\"drawer-error\"\n >\n <p>${this.error}</p>\n <button\n class=\"primary\"\n part=\"retry-button\"\n @click=${() => this._emit(\"retry\", { scope: \"initial\" })}\n >\n Retry\n </button>\n </div>\n `;\n }\n\n private _renderLoading() {\n return html`\n <div class=\"state\" part=\"loading\" data-testid=\"drawer-loading\" aria-busy=\"true\">\n Loading threads…\n </div>\n `;\n }\n\n private _renderList() {\n const visible = this._visibleThreads();\n if (visible.length === 0) {\n return html`\n <div class=\"state\" part=\"empty\" data-testid=\"drawer-empty\">\n <slot name=\"empty\">No threads yet.</slot>\n </div>\n `;\n }\n return html`\n <ul\n class=${this._openMenuId !== null ? \"list menu-open\" : \"list\"}\n part=\"list\"\n role=\"listbox\"\n aria-label=${this.label}\n >\n ${repeat(\n visible,\n (thread) => thread.id,\n (thread, index) => this._renderRow(thread, index, visible.length),\n )}\n </ul>\n ${this._renderFetchMore()}\n `;\n }\n\n private _renderRow(thread: DrawerThread, index = 0, total = 1) {\n const isActive = thread.id === this.activeThreadId;\n const hasName = thread.name !== null && thread.name !== \"\";\n // Shared display-name fallback: an empty-string (or null) name reads as\n // \"New thread\" for BOTH the visible label and every row-action aria-label,\n // so a screen reader never announces \"Actions for \" / \"Archive thread \".\n const displayName = hasName ? (thread.name as string) : \"New thread\";\n const justRevealed = this._justRevealed.has(thread.id);\n\n const menuOpen = this._openMenuId === thread.id;\n // The kebab popover opens downward by default (`top: 100%`). For rows in the\n // lower portion of the list, a downward menu would be clipped by the list's\n // `overflow-y: auto` scroll box (which also clips the x-axis). Flip those\n // rows' menu to open UPWARD (toward the list interior) via `menu-up`, so the\n // popover for bottom rows is never lost behind the list's bottom edge.\n const menuUp = menuOpen && total > 1 && index >= total / 2;\n\n const rowClasses = {\n row: true,\n active: isActive,\n archived: thread.archived,\n \"menu-open\": menuOpen,\n \"menu-up\": menuUp,\n };\n const nameClasses = {\n \"row-name\": true,\n placeholder: !hasName,\n revealed: justRevealed,\n };\n const slotName = rowSlotName(thread.id);\n // A long thread name is clipped with an ellipsis (no hover tooltip — the\n // designer opted against name bubbles). The name text lives in an inner span\n // that owns the ellipsis truncation.\n const nameSpan = html`<span class=${classMap(nameClasses)} part=\"row-name\">\n <span class=\"row-name-text\">${displayName}</span>\n </span>`;\n\n return html`\n <li\n class=${classMap(rowClasses)}\n part=${isActive ? \"row row-active\" : \"row\"}\n role=\"option\"\n aria-selected=${isActive ? \"true\" : \"false\"}\n tabindex=\"0\"\n data-thread-id=${thread.id}\n @click=${() => {\n // Selecting a row dismisses any open kebab menu (it belongs to a row,\n // not the selection) before emitting the selection intent.\n this._openMenuId = null;\n this._emit(\"thread-selected\", { threadId: thread.id });\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this._openMenuId = null;\n this._emit(\"thread-selected\", { threadId: thread.id });\n }\n }}\n >\n ${\n slotName !== null\n ? html`<slot name=${slotName}>${nameSpan}</slot>`\n : nameSpan\n }\n <button\n class=\"row-menu\"\n part=\"row-menu\"\n aria-label=${`Actions for ${displayName}`}\n aria-haspopup=\"menu\"\n aria-expanded=${menuOpen}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = menuOpen ? null : thread.id;\n }}\n >\n ${iconKebab}\n </button>\n ${\n menuOpen\n ? html`<div\n class=\"row-menu-popover\"\n part=\"row-menu-popover\"\n role=\"menu\"\n >\n ${\n thread.archived\n ? html`<button\n class=\"row-menu-item\"\n part=\"row-unarchive\"\n role=\"menuitem\"\n aria-label=${`Unarchive thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._emit(\"unarchive\", { threadId: thread.id });\n }}\n >\n ${iconUnarchive}<span>Unarchive</span>\n </button>`\n : html`<button\n class=\"row-menu-item\"\n part=\"row-archive\"\n role=\"menuitem\"\n aria-label=${`Archive thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._emit(\"archive\", { threadId: thread.id });\n }}\n >\n ${iconArchive}<span>Archive</span>\n </button>`\n }\n <button\n class=\"row-menu-item danger\"\n part=\"row-delete\"\n role=\"menuitem\"\n aria-label=${`Delete thread ${displayName}`}\n @click=${(e: Event) => {\n e.stopPropagation();\n this._openMenuId = null;\n this._confirmingDeleteId = thread.id;\n }}\n >\n ${iconDelete}<span>Delete</span>\n </button>\n </div>`\n : nothing\n }\n </li>\n `;\n }\n\n private _renderFetchMore() {\n if (hasErrorMessage(this.fetchMoreError)) {\n return html`\n <div class=\"fetch-more-error\" part=\"fetch-more-error\" role=\"alert\">\n Couldn't load more —\n <button\n class=\"row-action\"\n part=\"fetch-more-retry\"\n @click=${() => this._emit(\"retry\", { scope: \"fetch-more\" })}\n >\n retry\n </button>\n </div>\n `;\n }\n if (this.fetchingMore) {\n return html`\n <div class=\"state\" part=\"fetching-more\" aria-busy=\"true\">Loading more…</div>\n `;\n }\n if (this.hasMore) {\n return html`\n <button\n class=\"load-more\"\n part=\"load-more\"\n @click=${() => this._emit(\"load-more\", {})}\n >\n Load more\n </button>\n `;\n }\n return nothing;\n }\n\n private _renderMemories() {\n // Reserved region — hidden until a consumer projects content into the slot.\n // A `slotchange` listener drives `_hasMemories` so light-DOM mutations after\n // first render reactively reveal/hide the region.\n return html`\n <div class=\"memories\" part=\"memories\" ?hidden=${!this._hasMemories}>\n <slot\n name=\"memories\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasMemories = slot.assignedElements().length > 0;\n }}\n ></slot>\n </div>\n `;\n }\n\n private _renderFooter() {\n // Reserved region — hidden until a consumer projects content into the\n // `footer` slot. Without this gate the footer's top border + padding render\n // as an empty box at the bottom of the drawer. Mirrors `_renderMemories`.\n return html`\n <div class=\"footer\" part=\"footer\" ?hidden=${!this._hasFooter}>\n <slot\n name=\"footer\"\n @slotchange=${(e: Event) => {\n const slot = e.target as HTMLSlotElement;\n this._hasFooter = slot.assignedElements().length > 0;\n }}\n ></slot>\n </div>\n `;\n }\n\n /**\n * Confirm-delete dialog, rendered as a native `<dialog>` that is ALWAYS\n * present in the shadow DOM so `updated()` can drive `showModal()`/`close()`\n * against it. Opening with `showModal()` puts it in the browser TOP LAYER, so\n * it can never be painted under other UI — the previous CSS-positioned overlay\n * was trapped in the drawer host's stacking context and appeared under the\n * chat's welcome view (ENT-1051). The `::backdrop` pseudo-element (styled in\n * styles.ts) provides the scrim natively.\n *\n * The actionable content (message + Cancel/Delete, bound to the captured id)\n * renders only while confirming, so a closed dialog holds nothing stale.\n * Native dismissal is wired via `@cancel` (Escape) and a backdrop-click check.\n */\n private _renderConfirmDialog() {\n const id = this._confirmingDeleteId;\n return html`\n <dialog\n class=\"dialog\"\n part=\"confirm-dialog\"\n role=\"alertdialog\"\n aria-label=\"Confirm delete\"\n data-testid=\"drawer-confirm-delete\"\n @cancel=${(event: Event) => {\n // Native Escape dismissal: prevent the default close (we drive open\n // state from `_confirmingDeleteId` in `updated()`) and reset it.\n event.preventDefault();\n this._confirmingDeleteId = null;\n }}\n @click=${(event: MouseEvent) => {\n // A click whose target is the <dialog> itself (not the inner card)\n // landed on the ::backdrop — dismiss, mirroring a scrim click.\n if (event.target === event.currentTarget) {\n this._confirmingDeleteId = null;\n }\n }}\n >\n ${\n id !== null\n ? html`\n <p>Delete this thread? This cannot be undone.</p>\n <div class=\"dialog-actions\">\n <button\n class=\"row-action\"\n part=\"confirm-cancel\"\n @click=${() => (this._confirmingDeleteId = null)}\n >\n Cancel\n </button>\n <button\n class=\"primary\"\n part=\"confirm-delete\"\n @click=${() => {\n this._confirmingDeleteId = null;\n this._emit(\"delete\", { threadId: id });\n }}\n >\n Delete\n </button>\n </div>\n `\n : nothing\n }\n </dialog>\n `;\n }\n}\n","import {\n COPILOTKIT_THREADS_DRAWER_TAG,\n CopilotKitThreadsDrawer,\n} from \"./copilotkit-threads-drawer\";\n\n/**\n * Registers the `<copilotkit-threads-drawer>` custom element. Idempotent — safe to call\n * multiple times (e.g. from several framework wrappers in the same page); a\n * second registration of the same tag is a no-op.\n */\nexport function defineCopilotKitThreadsDrawer(): void {\n if (\n typeof customElements !== \"undefined\" &&\n !customElements.get(COPILOTKIT_THREADS_DRAWER_TAG)\n ) {\n customElements.define(\n COPILOTKIT_THREADS_DRAWER_TAG,\n CopilotKitThreadsDrawer,\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"copilotkit-threads-drawer\": CopilotKitThreadsDrawer;\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11],"mappings":";;;;;;;;CAyDA,MAAa,uBAAuB,MAAM,iBAAiB;EACvD,IAAI,aAAa;AAIb,UAAO,KAAK,OACP;;EAET,YAAY,OAAO;AACf,QAAK,8BAA8B;AACnC,QAAK,aAAa;AAClB,QAAK,mBAAmB;AACxB,QAAK,mBAAmB;AACxB,QAAK,6BAA6B;AAClC,QAAK,WAAW;AAChB,QAAK,cAAc;AACnB,QAAK,eAAe;AACpB,QAAK,eAAe;AACpB,QAAK,mBAAmB;AACxB,QAAK,cAAc;AACnB,QAAK,uBAAuB;AAC5B,QAAK,cAAc;AACnB,QAAK,0BAA0B;AAC/B,QAAK,kBAAkB;AACvB,QAAK,sBAAsB;AAC3B,QAAK,eAAe;AACpB,QAAK,2BAA2B;AAChC,QAAK,eAAe;AACpB,QAAK,qBAAqB;AAC1B,QAAK,eAAe;AACpB,QAAK,aAAa;AAClB,QAAK,cAAc;AACnB,QAAK,mBAAmB;AACxB,QAAK,YAAY;AACjB,QAAK,yBAAyB;AAC9B,QAAK,YAAY;AACjB,QAAK,WAAW;AAChB,QAAK,YAAY;AACjB,QAAK,gBAAgB;AACrB,QAAK,sBAAsB;AAC3B,QAAK,kBAAkB;AACvB,QAAK,mBAAmB;AACxB,QAAK,kBAAkB;AACvB,QAAK,eAAe;AACpB,QAAK,cAAc;AACnB,QAAK,eAAe;AACpB,QAAK,eAAe;AACpB,QAAK,eAAe;AACpB,QAAK,sBAAsB;AAC3B,QAAK,eAAe;AACpB,QAAK,eAAe;AACpB,QAAK,mBAAm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