@kodaris/krubble-app-components 1.0.76 → 1.0.77
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/chatbot.d.ts +134 -0
- package/dist/chatbot.d.ts.map +1 -1
- package/dist/chatbot.js +619 -17
- package/dist/chatbot.js.map +1 -1
- package/dist/krubble-app.bundled.js +679 -72
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +510 -110
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +679 -72
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +466 -66
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/krubble-app.umd.js
CHANGED
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
* Copyright 2019 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/
|
|
12
|
-
const t$4=globalThis,e$7=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$
|
|
12
|
+
const t$4=globalThis,e$7=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$6=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)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$7&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$6.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$6.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$4("string"==typeof t?t:t+"",void 0,s$3),i$6=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===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$4(o,t,s$3)},S$1=(s,o)=>{if(e$7)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$4.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$3=e$7?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
17
17
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
-
*/const{is:i$
|
|
18
|
+
*/const{is:i$5,defineProperty:e$6,getOwnPropertyDescriptor:h$2,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$5,getPrototypeOf:n$3}=Object,a$1=globalThis,c$2=a$1.trustedTypes,l$1=c$2?c$2.emptyScript:"",p$2=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$3={toAttribute(t,s){switch(s){case Boolean:t=t?l$1: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}},f$1=(t,s)=>!i$5(t,s),b$1={attribute:true,type:String,converter:u$3,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$6(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$5(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(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$3(s));}else void 0!==s&&i.push(c$3(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,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 S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),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&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$3).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:u$3;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=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===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]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;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];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;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=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$2?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright 2017 Google LLC
|
|
23
23
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
24
|
*/
|
|
25
|
-
const t$3=globalThis,i$
|
|
25
|
+
const t$3=globalThis,i$4=t=>t,s$2=t$3.trustedTypes,e$5=s$2?s$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,h$1="$lit$",o$4=`lit$${Math.random().toFixed(9).slice(2)}$`,n$2="?"+o$4,r$2=`<${n$2}>`,l=document,c$1=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$2=Array.isArray,d=t=>u$2(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v$1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m$1=/>/g,p$1=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}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u$2(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$5?e$5.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v$1;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$1?"!--"===u[1]?c=_:void 0!==u[1]?c=m$1:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v$1,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$:g):c===$||c===g?c=p$1:c===_||c===m$1?c=v$1:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v$1?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h$1+s.slice(d)+o$4+x):s+o$4+(-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$1)){const i=v[a++],s=r.getAttribute(t).split(o$4),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$4)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$4),i=t.length-1;if(i>0){r.textContent=s$2?s$2.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c$1()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c$1());}}}else if(8===r.nodeType)if(r.data===n$2)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$4,t+1));)d.push({type:7,index:l}),t+=o$4.length-1;}l++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function M$1(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?.(false),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$1(t,h._$AS(t,i.values),h,e)),i}class R{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,true);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 k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(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 k{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??true;}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$1(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 R(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$2(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 k(this.O(c$1()),this.O(c$1()),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?.(false,true,s);t!==this._$AB;){const s=i$4(t).nextSibling;i$4(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=false;if(void 0===h)t=M$1(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$1(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$1(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 Z{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$1(this,t);}}const j={I:k},B=t$3.litHtmlPolyfillSupport;B?.(S,k),(t$3.litHtmlVersions??=[]).push("3.3.2");const D=(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 k(i.insertBefore(c$1(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/const s$1=globalThis;let i$
|
|
31
|
+
*/const s$1=globalThis;let i$3 = class i extends y$1{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=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$3._$litElement$=true,i$3["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$3});const o$3=s$1.litElementPolyfillSupport;o$3?.({LitElement:i$3});(s$1.litElementVersions??=[]).push("4.2.2");
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const o$
|
|
44
|
+
*/const o$2={attribute:true,type:String,converter:u$3,reflect:false,hasChanged:f$1},r$1=(t=o$2,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,true,r);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,true,r);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/function r(r){return n({...r,state:true,attribute:false})}
|
|
50
|
+
*/function r(r){return n$1({...r,state:true,attribute:false})}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* @license
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
* Copyright 2017 Google LLC
|
|
68
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
69
|
*/
|
|
70
|
-
const t$1={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});let i$
|
|
70
|
+
const t$1={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});let i$2 = 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)}};
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2017 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
76
|
-
*/let e$1 = class e extends i$
|
|
76
|
+
*/let e$1 = class e extends i$2{constructor(i){if(super(i),this.it=A,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;const o$1=e$2(e$1);
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2018 Google LLC
|
|
81
81
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*/const e=e$2(class extends i$
|
|
82
|
+
*/const e=e$2(class extends i$2{constructor(t){if(super(t),t.type!==t$1.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 E}});
|
|
83
83
|
|
|
84
84
|
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
85
85
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
88
88
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
89
89
|
};
|
|
90
|
-
let KRNavItemEdit = class KRNavItemEdit extends i$
|
|
90
|
+
let KRNavItemEdit = class KRNavItemEdit extends i$3 {
|
|
91
91
|
constructor() {
|
|
92
92
|
super(...arguments);
|
|
93
93
|
this.label = '';
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
`;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
KRNavItemEdit.styles = i$
|
|
194
|
+
KRNavItemEdit.styles = i$6 `
|
|
195
195
|
:host {
|
|
196
196
|
display: block;
|
|
197
197
|
width: 360px;
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
* - Don't hardcode breadcrumbs
|
|
353
353
|
* - Look at renderNormalFooter and renderEditFooter and see if that is what we want to do
|
|
354
354
|
*/
|
|
355
|
-
exports.Scaffold = class KRScaffold extends i$
|
|
355
|
+
exports.Scaffold = class KRScaffold extends i$3 {
|
|
356
356
|
constructor() {
|
|
357
357
|
super();
|
|
358
358
|
/**
|
|
@@ -1372,7 +1372,7 @@
|
|
|
1372
1372
|
@click=${(e) => this.handleNavItemClick(e, item)}
|
|
1373
1373
|
@contextmenu=${(e) => this.handleNavItemContextMenu(e, item)}
|
|
1374
1374
|
>
|
|
1375
|
-
${this.navIconsDisplayed ? b `<span class="nav-item__icon">${o(item.icon || this.defaultNavItemIcon)}</span>` : A}
|
|
1375
|
+
${this.navIconsDisplayed ? b `<span class="nav-item__icon">${o$1(item.icon || this.defaultNavItemIcon)}</span>` : A}
|
|
1376
1376
|
<span class="nav-item__label">${item.label}</span>
|
|
1377
1377
|
<svg
|
|
1378
1378
|
class="nav-item__chevron"
|
|
@@ -1412,7 +1412,7 @@
|
|
|
1412
1412
|
@click=${(e) => this.handleNavItemClick(e, item)}
|
|
1413
1413
|
@contextmenu=${(e) => this.handleNavItemContextMenu(e, item)}
|
|
1414
1414
|
>
|
|
1415
|
-
${this.navIconsDisplayed && !isChild ? b `<span class="nav-item__icon">${o(item.icon || this.defaultNavItemIcon)}</span>` : A}
|
|
1415
|
+
${this.navIconsDisplayed && !isChild ? b `<span class="nav-item__icon">${o$1(item.icon || this.defaultNavItemIcon)}</span>` : A}
|
|
1416
1416
|
<span class="nav-item__label">${item.label}</span>
|
|
1417
1417
|
</a>
|
|
1418
1418
|
`;
|
|
@@ -1516,7 +1516,7 @@
|
|
|
1516
1516
|
`;
|
|
1517
1517
|
}
|
|
1518
1518
|
};
|
|
1519
|
-
exports.Scaffold.styles = i$
|
|
1519
|
+
exports.Scaffold.styles = i$6 `
|
|
1520
1520
|
:host {
|
|
1521
1521
|
display: flex;
|
|
1522
1522
|
flex-direction: column;
|
|
@@ -2243,59 +2243,59 @@
|
|
|
2243
2243
|
}
|
|
2244
2244
|
`;
|
|
2245
2245
|
__decorate$5([
|
|
2246
|
-
n({ type: String })
|
|
2246
|
+
n$1({ type: String })
|
|
2247
2247
|
], exports.Scaffold.prototype, "logo", void 0);
|
|
2248
2248
|
__decorate$5([
|
|
2249
|
-
n({ type: String })
|
|
2249
|
+
n$1({ type: String })
|
|
2250
2250
|
], exports.Scaffold.prototype, "label", void 0);
|
|
2251
2251
|
__decorate$5([
|
|
2252
|
-
n({
|
|
2252
|
+
n$1({
|
|
2253
2253
|
type: String,
|
|
2254
2254
|
attribute: 'home-url'
|
|
2255
2255
|
})
|
|
2256
2256
|
], exports.Scaffold.prototype, "homeUrl", void 0);
|
|
2257
2257
|
__decorate$5([
|
|
2258
|
-
n({
|
|
2258
|
+
n$1({
|
|
2259
2259
|
type: String,
|
|
2260
2260
|
reflect: true
|
|
2261
2261
|
})
|
|
2262
2262
|
], exports.Scaffold.prototype, "scheme", void 0);
|
|
2263
2263
|
__decorate$5([
|
|
2264
|
-
n({ type: Array })
|
|
2264
|
+
n$1({ type: Array })
|
|
2265
2265
|
], exports.Scaffold.prototype, "nav", void 0);
|
|
2266
2266
|
__decorate$5([
|
|
2267
|
-
n({
|
|
2267
|
+
n$1({
|
|
2268
2268
|
type: Boolean,
|
|
2269
2269
|
attribute: 'nav-icons-displayed',
|
|
2270
2270
|
reflect: true
|
|
2271
2271
|
})
|
|
2272
2272
|
], exports.Scaffold.prototype, "navIconsDisplayed", void 0);
|
|
2273
2273
|
__decorate$5([
|
|
2274
|
-
n({
|
|
2274
|
+
n$1({
|
|
2275
2275
|
type: Boolean,
|
|
2276
2276
|
attribute: 'nav-expanded'
|
|
2277
2277
|
})
|
|
2278
2278
|
], exports.Scaffold.prototype, "navExpanded", void 0);
|
|
2279
2279
|
__decorate$5([
|
|
2280
|
-
n({ type: Object })
|
|
2280
|
+
n$1({ type: Object })
|
|
2281
2281
|
], exports.Scaffold.prototype, "user", void 0);
|
|
2282
2282
|
__decorate$5([
|
|
2283
|
-
n({ type: Boolean })
|
|
2283
|
+
n$1({ type: Boolean })
|
|
2284
2284
|
], exports.Scaffold.prototype, "subbar", void 0);
|
|
2285
2285
|
__decorate$5([
|
|
2286
|
-
n({
|
|
2286
|
+
n$1({
|
|
2287
2287
|
type: Boolean,
|
|
2288
2288
|
attribute: 'nav-enabled'
|
|
2289
2289
|
})
|
|
2290
2290
|
], exports.Scaffold.prototype, "navEnabled", void 0);
|
|
2291
2291
|
__decorate$5([
|
|
2292
|
-
n({
|
|
2292
|
+
n$1({
|
|
2293
2293
|
type: String,
|
|
2294
2294
|
attribute: 'user-type'
|
|
2295
2295
|
})
|
|
2296
2296
|
], exports.Scaffold.prototype, "userType", void 0);
|
|
2297
2297
|
__decorate$5([
|
|
2298
|
-
n({ type: Array })
|
|
2298
|
+
n$1({ type: Array })
|
|
2299
2299
|
], exports.Scaffold.prototype, "breadcrumbs", void 0);
|
|
2300
2300
|
__decorate$5([
|
|
2301
2301
|
r()
|
|
@@ -2371,7 +2371,7 @@
|
|
|
2371
2371
|
* @property {KRScreenNavItem[]} items - Navigation items as JSON array
|
|
2372
2372
|
* @property {string} activeId - Currently active item ID
|
|
2373
2373
|
*/
|
|
2374
|
-
exports.ScreenNav = class KRScreenNav extends i$
|
|
2374
|
+
exports.ScreenNav = class KRScreenNav extends i$3 {
|
|
2375
2375
|
constructor() {
|
|
2376
2376
|
super(...arguments);
|
|
2377
2377
|
/**
|
|
@@ -2487,7 +2487,7 @@
|
|
|
2487
2487
|
`;
|
|
2488
2488
|
}
|
|
2489
2489
|
};
|
|
2490
|
-
exports.ScreenNav.styles = i$
|
|
2490
|
+
exports.ScreenNav.styles = i$6 `
|
|
2491
2491
|
:host {
|
|
2492
2492
|
display: flex;
|
|
2493
2493
|
height: 100%;
|
|
@@ -2580,16 +2580,16 @@
|
|
|
2580
2580
|
}
|
|
2581
2581
|
`;
|
|
2582
2582
|
__decorate$4([
|
|
2583
|
-
n({ type: String })
|
|
2583
|
+
n$1({ type: String })
|
|
2584
2584
|
], exports.ScreenNav.prototype, "label", void 0);
|
|
2585
2585
|
__decorate$4([
|
|
2586
|
-
n({ type: String })
|
|
2586
|
+
n$1({ type: String })
|
|
2587
2587
|
], exports.ScreenNav.prototype, "subLabel", void 0);
|
|
2588
2588
|
__decorate$4([
|
|
2589
|
-
n({ type: Array })
|
|
2589
|
+
n$1({ type: Array })
|
|
2590
2590
|
], exports.ScreenNav.prototype, "items", void 0);
|
|
2591
2591
|
__decorate$4([
|
|
2592
|
-
n({ type: String })
|
|
2592
|
+
n$1({ type: String })
|
|
2593
2593
|
], exports.ScreenNav.prototype, "activeId", void 0);
|
|
2594
2594
|
exports.ScreenNav = __decorate$4([
|
|
2595
2595
|
t$2('kr-screen-nav')
|
|
@@ -2620,7 +2620,7 @@
|
|
|
2620
2620
|
*
|
|
2621
2621
|
* @property {string} title - Section title (e.g., "Company Details")
|
|
2622
2622
|
*/
|
|
2623
|
-
exports.ScreenDetail = class KRScreenDetail extends i$
|
|
2623
|
+
exports.ScreenDetail = class KRScreenDetail extends i$3 {
|
|
2624
2624
|
constructor() {
|
|
2625
2625
|
super(...arguments);
|
|
2626
2626
|
/**
|
|
@@ -2644,7 +2644,7 @@
|
|
|
2644
2644
|
`;
|
|
2645
2645
|
}
|
|
2646
2646
|
};
|
|
2647
|
-
exports.ScreenDetail.styles = i$
|
|
2647
|
+
exports.ScreenDetail.styles = i$6 `
|
|
2648
2648
|
:host {
|
|
2649
2649
|
display: flex;
|
|
2650
2650
|
flex-direction: column;
|
|
@@ -2690,7 +2690,7 @@
|
|
|
2690
2690
|
}
|
|
2691
2691
|
`;
|
|
2692
2692
|
__decorate$3([
|
|
2693
|
-
n({ type: String })
|
|
2693
|
+
n$1({ type: String })
|
|
2694
2694
|
], exports.ScreenDetail.prototype, "title", void 0);
|
|
2695
2695
|
exports.ScreenDetail = __decorate$3([
|
|
2696
2696
|
t$2('kr-screen-detail')
|
|
@@ -2707,7 +2707,7 @@
|
|
|
2707
2707
|
*
|
|
2708
2708
|
* @slot - Content to display in the subbar (right side)
|
|
2709
2709
|
*/
|
|
2710
|
-
exports.Subbar = class KRSubbar extends i$
|
|
2710
|
+
exports.Subbar = class KRSubbar extends i$3 {
|
|
2711
2711
|
constructor() {
|
|
2712
2712
|
super(...arguments);
|
|
2713
2713
|
/**
|
|
@@ -2835,7 +2835,7 @@
|
|
|
2835
2835
|
`;
|
|
2836
2836
|
}
|
|
2837
2837
|
};
|
|
2838
|
-
exports.Subbar.styles = i$
|
|
2838
|
+
exports.Subbar.styles = i$6 `
|
|
2839
2839
|
:host {
|
|
2840
2840
|
display: flex;
|
|
2841
2841
|
flex-direction: row;
|
|
@@ -2903,10 +2903,10 @@
|
|
|
2903
2903
|
}
|
|
2904
2904
|
`;
|
|
2905
2905
|
__decorate$2([
|
|
2906
|
-
n({ type: Array })
|
|
2906
|
+
n$1({ type: Array })
|
|
2907
2907
|
], exports.Subbar.prototype, "breadcrumbs", void 0);
|
|
2908
2908
|
__decorate$2([
|
|
2909
|
-
n({ type: Boolean })
|
|
2909
|
+
n$1({ type: Boolean })
|
|
2910
2910
|
], exports.Subbar.prototype, "menu", void 0);
|
|
2911
2911
|
exports.Subbar = __decorate$2([
|
|
2912
2912
|
t$2('kr-subbar')
|
|
@@ -3048,7 +3048,7 @@
|
|
|
3048
3048
|
KRRouter.base = '';
|
|
3049
3049
|
KRRouter.routes = [];
|
|
3050
3050
|
KRRouter.elementCache = new Map();
|
|
3051
|
-
exports.RouterOutlet = class KRRouterOutlet extends i$
|
|
3051
|
+
exports.RouterOutlet = class KRRouterOutlet extends i$3 {
|
|
3052
3052
|
constructor() {
|
|
3053
3053
|
super(...arguments);
|
|
3054
3054
|
this.level = -1;
|
|
@@ -3093,7 +3093,7 @@
|
|
|
3093
3093
|
return b `${el}`;
|
|
3094
3094
|
}
|
|
3095
3095
|
};
|
|
3096
|
-
exports.RouterOutlet.styles = i$
|
|
3096
|
+
exports.RouterOutlet.styles = i$6 `
|
|
3097
3097
|
:host {
|
|
3098
3098
|
display: block;
|
|
3099
3099
|
height: 100%;
|
|
@@ -3103,6 +3103,12 @@
|
|
|
3103
3103
|
t$2('kr-router-outlet')
|
|
3104
3104
|
], exports.RouterOutlet);
|
|
3105
3105
|
|
|
3106
|
+
/**
|
|
3107
|
+
* @license
|
|
3108
|
+
* Copyright 2018 Google LLC
|
|
3109
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3110
|
+
*/const n="important",i$1=" !"+n,o=e$2(class extends i$2{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i$1);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e;}}return E}});
|
|
3111
|
+
|
|
3106
3112
|
/**
|
|
3107
3113
|
* @license
|
|
3108
3114
|
* Copyright 2020 Google LLC
|
|
@@ -3114,7 +3120,7 @@
|
|
|
3114
3120
|
* Copyright 2017 Google LLC
|
|
3115
3121
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3116
3122
|
*/
|
|
3117
|
-
const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=e$2(class extends i$
|
|
3123
|
+
const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=e$2(class extends i$2{constructor(e){if(super(e),e.type!==t$1.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=M(s),{values:p$1,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p$1;const h$1=this.ut??=[],v$1=[];let m,y,x=0,j=d.length-1,k=0,w=p$1.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h$1[x]===a[k])v$1[k]=u$1(d[x],p$1[k]),x++,k++;else if(h$1[j]===a[w])v$1[w]=u$1(d[j],p$1[w]),j--,w--;else if(h$1[x]===a[w])v$1[w]=u$1(d[x],p$1[w]),v(s,v$1[w+1],d[x]),x++,w--;else if(h$1[j]===a[k])v$1[k]=u$1(d[j],p$1[k]),v(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h$1,x,j)),m.has(h$1[x]))if(m.has(h$1[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=v(s,d[x]);u$1(e,p$1[k]),v$1[k]=e;}else v$1[k]=u$1(t,p$1[k]),v(s,d[x],t),d[e]=null;k++;}else h(d[j]),j--;else h(d[x]),x++;for(;k<=w;){const e=v(s,v$1[w+1]);u$1(e,p$1[k]),v$1[k++]=e;}for(;x<=j;){const e=d[x++];null!==e&&h(e);}return this.ut=a,p(s,v$1),E}});
|
|
3118
3124
|
|
|
3119
3125
|
/**
|
|
3120
3126
|
* marked v12.0.2 - a markdown parser
|
|
@@ -5587,7 +5593,7 @@
|
|
|
5587
5593
|
* @fires message-submit - When the user sends a message. Cancelable. Detail: `{ message: string }`
|
|
5588
5594
|
* @fires stream-event - Dispatched for every SSE message received. Detail contains the parsed event data.
|
|
5589
5595
|
*/
|
|
5590
|
-
exports.Chatbot = class KRChatbot extends i$
|
|
5596
|
+
exports.Chatbot = class KRChatbot extends i$3 {
|
|
5591
5597
|
constructor() {
|
|
5592
5598
|
super(...arguments);
|
|
5593
5599
|
// --- Private properties ---
|
|
@@ -5605,6 +5611,10 @@
|
|
|
5605
5611
|
this._dragStartTop = 0;
|
|
5606
5612
|
this._resizeStartW = 0;
|
|
5607
5613
|
this._resizeStartH = 0;
|
|
5614
|
+
/** Cursor X at debug-drawer resize start. */
|
|
5615
|
+
this._debugResizeStartX = 0;
|
|
5616
|
+
/** Debug-drawer width at resize start. */
|
|
5617
|
+
this._debugResizeStartW = 0;
|
|
5608
5618
|
/** Counter for depth-aware dragenter/dragleave tracking. */
|
|
5609
5619
|
this._dragDepth = 0;
|
|
5610
5620
|
/** Monotonic id source for pending attachments. */
|
|
@@ -5677,6 +5687,39 @@
|
|
|
5677
5687
|
this._inputValue = '';
|
|
5678
5688
|
this._isStreaming = false;
|
|
5679
5689
|
this._error = '';
|
|
5690
|
+
/**
|
|
5691
|
+
* User-facing context warning text (`CONVERSATION_TOKEN_WARNING`). Shown as a
|
|
5692
|
+
* dismissible banner in all variants. Carries only friendly guidance, no numbers.
|
|
5693
|
+
*/
|
|
5694
|
+
this._contextWarning = '';
|
|
5695
|
+
/**
|
|
5696
|
+
* True once the conversation hit the context-window limit
|
|
5697
|
+
* (`CONVERSATION_LIMIT_REACHED`, or `contextExceeded` on load). Drives a
|
|
5698
|
+
* blocking "start a new conversation" notice. User-facing, all variants.
|
|
5699
|
+
*/
|
|
5700
|
+
this._contextLimitReached = false;
|
|
5701
|
+
/** Server-provided limit text (`CONVERSATION_LIMIT_REACHED`), if any. */
|
|
5702
|
+
this._contextLimitMessage = '';
|
|
5703
|
+
/**
|
|
5704
|
+
* INTERNAL-ONLY latest telemetry snapshot (last-value-wins). Populated from
|
|
5705
|
+
* `TOKEN_USAGE` events during streaming and hydrated from the conversation
|
|
5706
|
+
* DTO on load. Only surfaced in the `inline` variant's debug panel.
|
|
5707
|
+
*/
|
|
5708
|
+
this._telemetry = null;
|
|
5709
|
+
/**
|
|
5710
|
+
* INTERNAL-ONLY per-iteration telemetry log for the debug panel's verbose
|
|
5711
|
+
* table. Append-only within a turn; reset at the start of each send. Each row
|
|
5712
|
+
* may be augmented with its `CACHE_CHECKPOINT` info.
|
|
5713
|
+
*/
|
|
5714
|
+
this._iterationLog = [];
|
|
5715
|
+
/** Latest cache-checkpoint info keyed by iteration, for the verbose table. */
|
|
5716
|
+
this._cacheCheckpoints = {};
|
|
5717
|
+
/** Whether the internal debug panel is expanded (off by default). */
|
|
5718
|
+
this._debugPanelOpen = false;
|
|
5719
|
+
/** Current width of the debug drawer in px (user-resizable, persisted). */
|
|
5720
|
+
this._debugDrawerWidth = 430;
|
|
5721
|
+
/** True while the user is dragging the debug drawer's resize handle. */
|
|
5722
|
+
this._isDebugResizing = false;
|
|
5680
5723
|
/** Images staged in the composer, before the message is sent. */
|
|
5681
5724
|
this._pendingInternalFiles = [];
|
|
5682
5725
|
/** True while a file is being dragged over the panel (shows the drop overlay). */
|
|
@@ -5760,6 +5803,25 @@
|
|
|
5760
5803
|
document.removeEventListener('mouseup', this._handleMouseUp);
|
|
5761
5804
|
this._saveState();
|
|
5762
5805
|
};
|
|
5806
|
+
this._handleDebugResizeMouseMove = (e) => {
|
|
5807
|
+
if (!this._isDebugResizing) {
|
|
5808
|
+
return;
|
|
5809
|
+
}
|
|
5810
|
+
// Handle is on the drawer's left edge; dragging left (negative dx) widens it.
|
|
5811
|
+
const dx = e.clientX - this._debugResizeStartX;
|
|
5812
|
+
const minW = 300;
|
|
5813
|
+
// Never let the chat column shrink below 300px — cap the drawer at the
|
|
5814
|
+
// container width minus that reserved chat width.
|
|
5815
|
+
const minChatWidth = 300;
|
|
5816
|
+
const maxW = Math.max(minW, this.offsetWidth - minChatWidth);
|
|
5817
|
+
this._debugDrawerWidth = Math.max(minW, Math.min(this._debugResizeStartW - dx, maxW));
|
|
5818
|
+
};
|
|
5819
|
+
this._handleDebugResizeMouseUp = () => {
|
|
5820
|
+
this._isDebugResizing = false;
|
|
5821
|
+
document.removeEventListener('mousemove', this._handleDebugResizeMouseMove);
|
|
5822
|
+
document.removeEventListener('mouseup', this._handleDebugResizeMouseUp);
|
|
5823
|
+
this._saveState();
|
|
5824
|
+
};
|
|
5763
5825
|
}
|
|
5764
5826
|
// --- Lifecycle ---
|
|
5765
5827
|
connectedCallback() {
|
|
@@ -5781,10 +5843,10 @@
|
|
|
5781
5843
|
}
|
|
5782
5844
|
}).catch(() => { });
|
|
5783
5845
|
// Inline mode fills its container and is always open — the floating widget's
|
|
5784
|
-
// toggle/drag/resize state
|
|
5846
|
+
// toggle/drag/resize state doesn't apply, but the composer message and debug
|
|
5847
|
+
// drawer state (restored inside _restoreState) do.
|
|
5785
5848
|
if (this.variant === 'inline') {
|
|
5786
5849
|
this.opened = true;
|
|
5787
|
-
return;
|
|
5788
5850
|
}
|
|
5789
5851
|
this._restoreState();
|
|
5790
5852
|
}
|
|
@@ -5974,7 +6036,12 @@
|
|
|
5974
6036
|
}
|
|
5975
6037
|
_saveState() {
|
|
5976
6038
|
try {
|
|
5977
|
-
const state = {
|
|
6039
|
+
const state = {
|
|
6040
|
+
opened: String(this.opened),
|
|
6041
|
+
message: this._inputValue,
|
|
6042
|
+
debugPanelOpen: String(this._debugPanelOpen),
|
|
6043
|
+
debugDrawerWidth: String(this._debugDrawerWidth),
|
|
6044
|
+
};
|
|
5978
6045
|
if (this._panelEl) {
|
|
5979
6046
|
const s = this._panelEl.style;
|
|
5980
6047
|
if (s.left) {
|
|
@@ -6004,7 +6071,17 @@
|
|
|
6004
6071
|
return;
|
|
6005
6072
|
}
|
|
6006
6073
|
const state = JSON.parse(raw);
|
|
6007
|
-
|
|
6074
|
+
// Draft text and the debug drawer are persisted for all variants.
|
|
6075
|
+
if (typeof state.message === 'string') {
|
|
6076
|
+
this._inputValue = state.message;
|
|
6077
|
+
}
|
|
6078
|
+
this._debugPanelOpen = state.debugPanelOpen === 'true';
|
|
6079
|
+
const w = Number(state.debugDrawerWidth);
|
|
6080
|
+
if (w >= 300) {
|
|
6081
|
+
this._debugDrawerWidth = w;
|
|
6082
|
+
}
|
|
6083
|
+
// The floating widget's open/layout state doesn't apply to inline mode.
|
|
6084
|
+
if (this.variant !== 'inline' && state.opened === 'true') {
|
|
6008
6085
|
this.opened = true;
|
|
6009
6086
|
// Apply layout after first render
|
|
6010
6087
|
this.updateComplete.then(() => this._applyStoredLayout());
|
|
@@ -6039,6 +6116,7 @@
|
|
|
6039
6116
|
}
|
|
6040
6117
|
_handleInputChange(e) {
|
|
6041
6118
|
this._inputValue = e.target.value;
|
|
6119
|
+
this._saveState();
|
|
6042
6120
|
// Auto-resize textarea
|
|
6043
6121
|
const textarea = e.target;
|
|
6044
6122
|
textarea.style.height = 'auto';
|
|
@@ -6183,6 +6261,7 @@
|
|
|
6183
6261
|
/** Insert `/code ` into the composer and focus it, ready for the message. */
|
|
6184
6262
|
_handleSkillSelect(skill) {
|
|
6185
6263
|
this._inputValue = `/${skill.code} `;
|
|
6264
|
+
this._saveState();
|
|
6186
6265
|
this._skillMenuOpened = false;
|
|
6187
6266
|
this._skillBrowseOpened = false;
|
|
6188
6267
|
this._inputEl?.focus();
|
|
@@ -6355,6 +6434,7 @@
|
|
|
6355
6434
|
};
|
|
6356
6435
|
this.messages = [...this.messages, userMessage];
|
|
6357
6436
|
this._inputValue = '';
|
|
6437
|
+
this._saveState();
|
|
6358
6438
|
this._error = '';
|
|
6359
6439
|
this._userHasScrolledUp = false;
|
|
6360
6440
|
// Clear the composer and release its preview object URLs.
|
|
@@ -6464,6 +6544,14 @@
|
|
|
6464
6544
|
this._error = '';
|
|
6465
6545
|
this._inputValue = '';
|
|
6466
6546
|
this._userHasScrolledUp = false;
|
|
6547
|
+
// Reset conversation-scoped context + telemetry state for the new convo.
|
|
6548
|
+
this._contextWarning = '';
|
|
6549
|
+
this._contextLimitReached = false;
|
|
6550
|
+
this._contextLimitMessage = '';
|
|
6551
|
+
this._telemetry = null;
|
|
6552
|
+
this._iterationLog = [];
|
|
6553
|
+
this._cacheCheckpoints = {};
|
|
6554
|
+
this._saveState();
|
|
6467
6555
|
});
|
|
6468
6556
|
}
|
|
6469
6557
|
_handleMessagesScroll(e) {
|
|
@@ -6479,6 +6567,22 @@
|
|
|
6479
6567
|
_handleErrorDismiss() {
|
|
6480
6568
|
this._error = '';
|
|
6481
6569
|
}
|
|
6570
|
+
_handleContextWarningDismiss() {
|
|
6571
|
+
this._contextWarning = '';
|
|
6572
|
+
}
|
|
6573
|
+
_handleToggleDebugPanel() {
|
|
6574
|
+
this._debugPanelOpen = !this._debugPanelOpen;
|
|
6575
|
+
this._saveState();
|
|
6576
|
+
}
|
|
6577
|
+
_handleDebugResizeMouseDown(e) {
|
|
6578
|
+
this._isDebugResizing = true;
|
|
6579
|
+
this._debugResizeStartX = e.clientX;
|
|
6580
|
+
this._debugResizeStartW = this._debugDrawerWidth;
|
|
6581
|
+
e.preventDefault();
|
|
6582
|
+
e.stopPropagation();
|
|
6583
|
+
document.addEventListener('mousemove', this._handleDebugResizeMouseMove);
|
|
6584
|
+
document.addEventListener('mouseup', this._handleDebugResizeMouseUp);
|
|
6585
|
+
}
|
|
6482
6586
|
_readStreamChunk() {
|
|
6483
6587
|
if (!this._reader) {
|
|
6484
6588
|
return;
|
|
@@ -6542,6 +6646,47 @@
|
|
|
6542
6646
|
else if (data.type === 'ERROR') {
|
|
6543
6647
|
this._handleStreamError(String(data.message || 'Unknown error'));
|
|
6544
6648
|
}
|
|
6649
|
+
else if (data.type === 'CONVERSATION_TOKEN_WARNING') {
|
|
6650
|
+
// User-facing: friendly "conversation is getting long" guidance.
|
|
6651
|
+
// Text only, never sent to the model — render verbatim as a banner.
|
|
6652
|
+
this._contextWarning = String(data.message || '');
|
|
6653
|
+
}
|
|
6654
|
+
else if (data.type === 'CONVERSATION_LIMIT_REACHED') {
|
|
6655
|
+
// User-facing hard stop. Carries finished:true (handled below).
|
|
6656
|
+
// Clear any soft warning so we don't double-message the user.
|
|
6657
|
+
this._contextLimitReached = true;
|
|
6658
|
+
this._contextLimitMessage = String(data.message || '');
|
|
6659
|
+
this._contextWarning = '';
|
|
6660
|
+
}
|
|
6661
|
+
else if (data.type === 'TOKEN_USAGE') {
|
|
6662
|
+
// INTERNAL-ONLY debug telemetry. Update the panel snapshot and the
|
|
6663
|
+
// per-iteration log; never render as a chat bubble.
|
|
6664
|
+
if (data.data) {
|
|
6665
|
+
const usage = data.data;
|
|
6666
|
+
this._telemetry = usage;
|
|
6667
|
+
// A new turn starts at iteration 1 — clear the prior turn's log
|
|
6668
|
+
// only now (not at send), so it stays visible until fresh data
|
|
6669
|
+
// actually arrives rather than blanking out on submit.
|
|
6670
|
+
if (usage.iteration === 1) {
|
|
6671
|
+
this._iterationLog = [usage];
|
|
6672
|
+
this._cacheCheckpoints = {};
|
|
6673
|
+
}
|
|
6674
|
+
else {
|
|
6675
|
+
this._iterationLog = [...this._iterationLog, usage];
|
|
6676
|
+
}
|
|
6677
|
+
}
|
|
6678
|
+
}
|
|
6679
|
+
else if (data.type === 'CACHE_CHECKPOINT') {
|
|
6680
|
+
// INTERNAL-ONLY debug telemetry. Records when/under which mode the
|
|
6681
|
+
// history checkpoint was placed, keyed by iteration for the table.
|
|
6682
|
+
if (data.data) {
|
|
6683
|
+
const checkpoint = data.data;
|
|
6684
|
+
this._cacheCheckpoints = {
|
|
6685
|
+
...this._cacheCheckpoints,
|
|
6686
|
+
[checkpoint.iteration]: checkpoint,
|
|
6687
|
+
};
|
|
6688
|
+
}
|
|
6689
|
+
}
|
|
6545
6690
|
if (data.finished) {
|
|
6546
6691
|
this._isStreaming = false;
|
|
6547
6692
|
this._reader = null;
|
|
@@ -6685,6 +6830,158 @@
|
|
|
6685
6830
|
}
|
|
6686
6831
|
return content;
|
|
6687
6832
|
}
|
|
6833
|
+
/** Compact integer formatting for the debug panel (e.g. 88928 → "88,928"). */
|
|
6834
|
+
_fmtTokens(n) {
|
|
6835
|
+
if (n == null || isNaN(n)) {
|
|
6836
|
+
return '—';
|
|
6837
|
+
}
|
|
6838
|
+
return n.toLocaleString('en-US');
|
|
6839
|
+
}
|
|
6840
|
+
/** Approximate USD formatting for the debug panel (e.g. 0.1434 → "~$0.1434"). */
|
|
6841
|
+
_fmtCost(n) {
|
|
6842
|
+
if (n == null || isNaN(n)) {
|
|
6843
|
+
return '—';
|
|
6844
|
+
}
|
|
6845
|
+
return '~$' + n.toFixed(4);
|
|
6846
|
+
}
|
|
6847
|
+
/**
|
|
6848
|
+
* INTERNAL-ONLY debug telemetry panel. Rendered only in the inline variant
|
|
6849
|
+
* (guarded by the caller) and only when the user has toggled it open. Shows
|
|
6850
|
+
* three scopes from the latest TOKEN_USAGE event — context gauge, this turn,
|
|
6851
|
+
* lifetime — plus a verbose per-iteration table. Never customer-facing.
|
|
6852
|
+
*/
|
|
6853
|
+
_renderDebugPanel() {
|
|
6854
|
+
return b `
|
|
6855
|
+
<div
|
|
6856
|
+
class=${e({
|
|
6857
|
+
'debug-drawer': true,
|
|
6858
|
+
'debug-drawer--open': this._debugPanelOpen,
|
|
6859
|
+
'debug-drawer--resizing': this._isDebugResizing,
|
|
6860
|
+
})}
|
|
6861
|
+
style=${o({ width: `${this._debugDrawerWidth}px` })}
|
|
6862
|
+
>
|
|
6863
|
+
<div
|
|
6864
|
+
class="debug-drawer__resize"
|
|
6865
|
+
@mousedown=${this._handleDebugResizeMouseDown}
|
|
6866
|
+
></div>
|
|
6867
|
+
<div class="debug-drawer__header">
|
|
6868
|
+
<span class="debug-drawer__title">Debug</span>
|
|
6869
|
+
<button
|
|
6870
|
+
class="header-action"
|
|
6871
|
+
@click=${this._handleToggleDebugPanel}
|
|
6872
|
+
title="Close debug panel"
|
|
6873
|
+
>
|
|
6874
|
+
<svg
|
|
6875
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6876
|
+
fill="none"
|
|
6877
|
+
viewBox="0 0 24 24"
|
|
6878
|
+
stroke-width="2"
|
|
6879
|
+
stroke="currentColor"
|
|
6880
|
+
class="header-action-icon"
|
|
6881
|
+
>
|
|
6882
|
+
<path
|
|
6883
|
+
stroke-linecap="round"
|
|
6884
|
+
stroke-linejoin="round"
|
|
6885
|
+
d="M6 18 18 6M6 6l12 12"
|
|
6886
|
+
/>
|
|
6887
|
+
</svg>
|
|
6888
|
+
</button>
|
|
6889
|
+
</div>
|
|
6890
|
+
<div class="debug-drawer__body">
|
|
6891
|
+
${this._telemetry ? b `
|
|
6892
|
+
<div class="debug-section">
|
|
6893
|
+
<div class="debug-section__label">Context</div>
|
|
6894
|
+
<div class="debug-gauge">
|
|
6895
|
+
<div class="debug-gauge__bar">
|
|
6896
|
+
<div
|
|
6897
|
+
class="debug-gauge__fill"
|
|
6898
|
+
style=${o({ width: `${Math.min(100, Math.max(0, this._telemetry.contextUsedPercent || 0))}%` })}
|
|
6899
|
+
></div>
|
|
6900
|
+
</div>
|
|
6901
|
+
<span class="debug-gauge__text">
|
|
6902
|
+
${this._fmtTokens(this._telemetry.currentContextTokens)} / ${this._fmtTokens(this._telemetry.contextWindowTokens)}
|
|
6903
|
+
· ${this._telemetry.contextUsedPercent ?? 0}%
|
|
6904
|
+
</span>
|
|
6905
|
+
</div>
|
|
6906
|
+
</div>
|
|
6907
|
+
|
|
6908
|
+
<div class="debug-section">
|
|
6909
|
+
<div class="debug-section__label">This turn</div>
|
|
6910
|
+
<div class="debug-metrics">
|
|
6911
|
+
<span class="debug-metrics__key">Input</span>
|
|
6912
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnInputTokens)}</span>
|
|
6913
|
+
<span class="debug-metrics__key">Output</span>
|
|
6914
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnOutputTokens)}</span>
|
|
6915
|
+
<span class="debug-metrics__key">Cache read</span>
|
|
6916
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnCacheReadTokens)}</span>
|
|
6917
|
+
<span class="debug-metrics__key">Hit rate</span>
|
|
6918
|
+
<span class="debug-metrics__val">${this._telemetry.turnHitRate ?? '—'}%</span>
|
|
6919
|
+
<span class="debug-metrics__key">Cost</span>
|
|
6920
|
+
<span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.turnCostUsd)}</span>
|
|
6921
|
+
</div>
|
|
6922
|
+
</div>
|
|
6923
|
+
|
|
6924
|
+
<div class="debug-section">
|
|
6925
|
+
<div class="debug-section__label">Lifetime</div>
|
|
6926
|
+
<div class="debug-metrics">
|
|
6927
|
+
<span class="debug-metrics__key">Input</span>
|
|
6928
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationInputTokens)}</span>
|
|
6929
|
+
<span class="debug-metrics__key">Output</span>
|
|
6930
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationOutputTokens)}</span>
|
|
6931
|
+
<span class="debug-metrics__key">Cache read</span>
|
|
6932
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationCacheReadTokens)}</span>
|
|
6933
|
+
<span class="debug-metrics__key">Cache write</span>
|
|
6934
|
+
<span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationCacheWriteTokens)}</span>
|
|
6935
|
+
<span class="debug-metrics__key">Cost so far</span>
|
|
6936
|
+
<span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.conversationCostUsd)}</span>
|
|
6937
|
+
</div>
|
|
6938
|
+
</div>
|
|
6939
|
+
` : b `
|
|
6940
|
+
<div class="debug-empty">No telemetry yet — send a message to populate.</div>
|
|
6941
|
+
`}
|
|
6942
|
+
|
|
6943
|
+
${this._iterationLog.length ? b `
|
|
6944
|
+
<div class="debug-section">
|
|
6945
|
+
<div class="debug-section__label">Iterations (this turn)</div>
|
|
6946
|
+
<div class="debug-iterations-scroll">
|
|
6947
|
+
<table class="debug-iterations">
|
|
6948
|
+
<thead>
|
|
6949
|
+
<tr>
|
|
6950
|
+
<th>#</th>
|
|
6951
|
+
<th>In</th>
|
|
6952
|
+
<th>Out</th>
|
|
6953
|
+
<th>Cache R</th>
|
|
6954
|
+
<th>Cache W</th>
|
|
6955
|
+
<th>Hit</th>
|
|
6956
|
+
<th>Cost</th>
|
|
6957
|
+
<th>Ckpt</th>
|
|
6958
|
+
</tr>
|
|
6959
|
+
</thead>
|
|
6960
|
+
<tbody>
|
|
6961
|
+
${this._iterationLog.map((it) => {
|
|
6962
|
+
const ckpt = this._cacheCheckpoints[it.iteration];
|
|
6963
|
+
return b `
|
|
6964
|
+
<tr>
|
|
6965
|
+
<td>${it.iteration}</td>
|
|
6966
|
+
<td>${this._fmtTokens(it.iterationInput)}</td>
|
|
6967
|
+
<td>${this._fmtTokens(it.iterationOutput)}</td>
|
|
6968
|
+
<td>${this._fmtTokens(it.iterationCacheRead)}</td>
|
|
6969
|
+
<td>${this._fmtTokens(it.iterationCacheWrite)}</td>
|
|
6970
|
+
<td>${it.iterationHitRate ?? '—'}%</td>
|
|
6971
|
+
<td class="debug-cost">${this._fmtCost(it.iterationCostUsd)}</td>
|
|
6972
|
+
<td>${ckpt ? ckpt.mode : '—'}</td>
|
|
6973
|
+
</tr>
|
|
6974
|
+
`;
|
|
6975
|
+
})}
|
|
6976
|
+
</tbody>
|
|
6977
|
+
</table>
|
|
6978
|
+
</div>
|
|
6979
|
+
</div>
|
|
6980
|
+
` : A}
|
|
6981
|
+
</div>
|
|
6982
|
+
</div>
|
|
6983
|
+
`;
|
|
6984
|
+
}
|
|
6688
6985
|
render() {
|
|
6689
6986
|
return b `
|
|
6690
6987
|
${(this.hideToggle || this.variant === 'inline') ? A : b `
|
|
@@ -6714,7 +7011,9 @@
|
|
|
6714
7011
|
class=${e({
|
|
6715
7012
|
'panel': true,
|
|
6716
7013
|
'panel--opened': this.opened,
|
|
7014
|
+
'panel--resizing-debug': this._isDebugResizing,
|
|
6717
7015
|
})}
|
|
7016
|
+
style=${o(this.variant === 'inline' && this._debugPanelOpen ? { paddingRight: `${this._debugDrawerWidth}px` } : {})}
|
|
6718
7017
|
@dragenter=${this._handleDragEnter}
|
|
6719
7018
|
@dragover=${this._handleDragOver}
|
|
6720
7019
|
@dragleave=${this._handleDragLeave}
|
|
@@ -6787,6 +7086,31 @@
|
|
|
6787
7086
|
</div>
|
|
6788
7087
|
</div>
|
|
6789
7088
|
<div class="header-actions">
|
|
7089
|
+
${this.variant === 'inline' ? b `
|
|
7090
|
+
<button
|
|
7091
|
+
class=${e({
|
|
7092
|
+
'header-action': true,
|
|
7093
|
+
'header-action--active': this._debugPanelOpen,
|
|
7094
|
+
})}
|
|
7095
|
+
@click=${this._handleToggleDebugPanel}
|
|
7096
|
+
title="Debug telemetry"
|
|
7097
|
+
>
|
|
7098
|
+
<svg
|
|
7099
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7100
|
+
fill="none"
|
|
7101
|
+
viewBox="0 0 24 24"
|
|
7102
|
+
stroke-width="1.5"
|
|
7103
|
+
stroke="currentColor"
|
|
7104
|
+
class="header-action-icon"
|
|
7105
|
+
>
|
|
7106
|
+
<path
|
|
7107
|
+
stroke-linecap="round"
|
|
7108
|
+
stroke-linejoin="round"
|
|
7109
|
+
d="M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"
|
|
7110
|
+
/>
|
|
7111
|
+
</svg>
|
|
7112
|
+
</button>
|
|
7113
|
+
` : A}
|
|
6790
7114
|
${this.messages.length > 0 ? b `
|
|
6791
7115
|
<button
|
|
6792
7116
|
class="header-action"
|
|
@@ -6874,7 +7198,7 @@
|
|
|
6874
7198
|
<div class="message-content">
|
|
6875
7199
|
${msg.type === 'user'
|
|
6876
7200
|
? this._renderUserContent(msg.content)
|
|
6877
|
-
: o(marked.parse(msg.content, { breaks: true }))}
|
|
7201
|
+
: o$1(marked.parse(msg.content, { breaks: true }))}
|
|
6878
7202
|
</div>
|
|
6879
7203
|
` : A}
|
|
6880
7204
|
${msg.type === 'assistant' && this._isStreaming && msg === this.messages[this.messages.length - 1] ? b `
|
|
@@ -6951,6 +7275,37 @@
|
|
|
6951
7275
|
</div>
|
|
6952
7276
|
` : A}
|
|
6953
7277
|
|
|
7278
|
+
${this._contextLimitReached ? b `
|
|
7279
|
+
<div class="context-limit" role="alert">
|
|
7280
|
+
${this._contextLimitMessage
|
|
7281
|
+
|| 'This conversation has reached its limit. Please start a new one to continue.'}
|
|
7282
|
+
</div>
|
|
7283
|
+
` : this._contextWarning ? b `
|
|
7284
|
+
<div class="context-warning" role="status">
|
|
7285
|
+
<span>${this._contextWarning}</span>
|
|
7286
|
+
<button
|
|
7287
|
+
class="context-warning-dismiss"
|
|
7288
|
+
title="Dismiss"
|
|
7289
|
+
@click=${this._handleContextWarningDismiss}
|
|
7290
|
+
>
|
|
7291
|
+
<svg
|
|
7292
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7293
|
+
fill="none"
|
|
7294
|
+
viewBox="0 0 24 24"
|
|
7295
|
+
stroke-width="2"
|
|
7296
|
+
stroke="currentColor"
|
|
7297
|
+
class="context-warning-dismiss-icon"
|
|
7298
|
+
>
|
|
7299
|
+
<path
|
|
7300
|
+
stroke-linecap="round"
|
|
7301
|
+
stroke-linejoin="round"
|
|
7302
|
+
d="M6 18 18 6M6 6l12 12"
|
|
7303
|
+
/>
|
|
7304
|
+
</svg>
|
|
7305
|
+
</button>
|
|
7306
|
+
</div>
|
|
7307
|
+
` : A}
|
|
7308
|
+
|
|
6954
7309
|
<div class="footer">
|
|
6955
7310
|
${this._pendingInternalFiles.length ? b `
|
|
6956
7311
|
<div class="composer-attachments">
|
|
@@ -7050,11 +7405,12 @@
|
|
|
7050
7405
|
</div>
|
|
7051
7406
|
</div>
|
|
7052
7407
|
${this._skillBrowseOpened ? this._renderSkillBrowse() : A}
|
|
7408
|
+
${this.variant === 'inline' ? this._renderDebugPanel() : A}
|
|
7053
7409
|
</div>
|
|
7054
7410
|
`;
|
|
7055
7411
|
}
|
|
7056
7412
|
};
|
|
7057
|
-
exports.Chatbot.styles = i$
|
|
7413
|
+
exports.Chatbot.styles = i$6 `
|
|
7058
7414
|
*,
|
|
7059
7415
|
*::before,
|
|
7060
7416
|
*::after {
|
|
@@ -7231,6 +7587,11 @@
|
|
|
7231
7587
|
color: #000000;
|
|
7232
7588
|
}
|
|
7233
7589
|
|
|
7590
|
+
.header-action--active {
|
|
7591
|
+
background: rgba(0, 0, 0, 0.08);
|
|
7592
|
+
color: #000000;
|
|
7593
|
+
}
|
|
7594
|
+
|
|
7234
7595
|
.header-action-icon {
|
|
7235
7596
|
width: 20px;
|
|
7236
7597
|
height: 20px;
|
|
@@ -7260,19 +7621,6 @@
|
|
|
7260
7621
|
margin-right: auto;
|
|
7261
7622
|
}
|
|
7262
7623
|
|
|
7263
|
-
.messages::-webkit-scrollbar {
|
|
7264
|
-
width: 4px;
|
|
7265
|
-
}
|
|
7266
|
-
|
|
7267
|
-
.messages::-webkit-scrollbar-track {
|
|
7268
|
-
background: transparent;
|
|
7269
|
-
}
|
|
7270
|
-
|
|
7271
|
-
.messages::-webkit-scrollbar-thumb {
|
|
7272
|
-
background: rgba(0, 0, 0, 0.08);
|
|
7273
|
-
border-radius: 2px;
|
|
7274
|
-
}
|
|
7275
|
-
|
|
7276
7624
|
.empty {
|
|
7277
7625
|
flex: 1;
|
|
7278
7626
|
display: flex;
|
|
@@ -7511,6 +7859,238 @@
|
|
|
7511
7859
|
height: 14px;
|
|
7512
7860
|
}
|
|
7513
7861
|
|
|
7862
|
+
/* Context warning banner (user-facing, dismissible, non-blocking) */
|
|
7863
|
+
.context-warning {
|
|
7864
|
+
padding: 8px 16px;
|
|
7865
|
+
background: #fffbeb;
|
|
7866
|
+
color: #92400e;
|
|
7867
|
+
font-size: 13px;
|
|
7868
|
+
display: flex;
|
|
7869
|
+
align-items: center;
|
|
7870
|
+
justify-content: space-between;
|
|
7871
|
+
gap: 8px;
|
|
7872
|
+
flex-shrink: 0;
|
|
7873
|
+
}
|
|
7874
|
+
|
|
7875
|
+
.context-warning-dismiss {
|
|
7876
|
+
background: none;
|
|
7877
|
+
border: none;
|
|
7878
|
+
color: #92400e;
|
|
7879
|
+
cursor: pointer;
|
|
7880
|
+
padding: 2px;
|
|
7881
|
+
display: flex;
|
|
7882
|
+
align-items: center;
|
|
7883
|
+
flex-shrink: 0;
|
|
7884
|
+
}
|
|
7885
|
+
|
|
7886
|
+
.context-warning-dismiss-icon {
|
|
7887
|
+
width: 14px;
|
|
7888
|
+
height: 14px;
|
|
7889
|
+
}
|
|
7890
|
+
|
|
7891
|
+
/* Context-limit notice (user-facing, blocking — steers to a new conversation) */
|
|
7892
|
+
.context-limit {
|
|
7893
|
+
padding: 10px 16px;
|
|
7894
|
+
background: var(--kr-chatbot-error-bg);
|
|
7895
|
+
color: var(--kr-chatbot-error-text);
|
|
7896
|
+
font-size: 13px;
|
|
7897
|
+
line-height: 1.5;
|
|
7898
|
+
flex-shrink: 0;
|
|
7899
|
+
}
|
|
7900
|
+
|
|
7901
|
+
/*
|
|
7902
|
+
* INTERNAL-ONLY debug telemetry drawer. A layout drawer docked to the right
|
|
7903
|
+
* of the inline chat — the chat column shrinks to make room; it does not
|
|
7904
|
+
* overlay. Closed by default (width 0), animates open. Not customer-facing —
|
|
7905
|
+
* token counts, cache internals, and approximate cost estimates for internal
|
|
7906
|
+
* debugging. Styled to match the chatbot's light theme (Inter, design tokens).
|
|
7907
|
+
*/
|
|
7908
|
+
/*
|
|
7909
|
+
* The chat column reserves space for the drawer by animating padding-right,
|
|
7910
|
+
* so opening the drawer shrinks the chat (header/messages/composer) rather
|
|
7911
|
+
* than overlaying it. Only applies in inline mode.
|
|
7912
|
+
*/
|
|
7913
|
+
:host([variant='inline']) .panel {
|
|
7914
|
+
transition: padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
7915
|
+
}
|
|
7916
|
+
|
|
7917
|
+
/* Track the cursor 1:1 while dragging the drawer's resize handle. */
|
|
7918
|
+
:host([variant='inline']) .panel--resizing-debug {
|
|
7919
|
+
transition: none;
|
|
7920
|
+
}
|
|
7921
|
+
|
|
7922
|
+
.debug-drawer {
|
|
7923
|
+
position: absolute;
|
|
7924
|
+
top: 0;
|
|
7925
|
+
right: 0;
|
|
7926
|
+
bottom: 0;
|
|
7927
|
+
background: var(--kr-chatbot-bg);
|
|
7928
|
+
display: flex;
|
|
7929
|
+
flex-direction: column;
|
|
7930
|
+
transform: translateX(100%);
|
|
7931
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
7932
|
+
color: #000000;
|
|
7933
|
+
z-index: 5;
|
|
7934
|
+
}
|
|
7935
|
+
|
|
7936
|
+
/* While dragging the resize handle, suppress the slide transition so the
|
|
7937
|
+
drawer tracks the cursor 1:1. */
|
|
7938
|
+
.debug-drawer--resizing {
|
|
7939
|
+
transition: none;
|
|
7940
|
+
}
|
|
7941
|
+
|
|
7942
|
+
.debug-drawer--open {
|
|
7943
|
+
transform: translateX(0);
|
|
7944
|
+
box-shadow: -4px 0 20px rgba(10, 26, 46, 0.07);
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7947
|
+
/* Left-edge grab handle for resizing the drawer. */
|
|
7948
|
+
.debug-drawer__resize {
|
|
7949
|
+
position: absolute;
|
|
7950
|
+
top: 0;
|
|
7951
|
+
left: 0;
|
|
7952
|
+
bottom: 0;
|
|
7953
|
+
width: 10px;
|
|
7954
|
+
cursor: ew-resize;
|
|
7955
|
+
z-index: 10;
|
|
7956
|
+
}
|
|
7957
|
+
|
|
7958
|
+
.debug-drawer__header {
|
|
7959
|
+
display: flex;
|
|
7960
|
+
align-items: center;
|
|
7961
|
+
justify-content: space-between;
|
|
7962
|
+
padding: 0 12px 0 20px;
|
|
7963
|
+
height: 64px;
|
|
7964
|
+
flex-shrink: 0;
|
|
7965
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
7966
|
+
}
|
|
7967
|
+
|
|
7968
|
+
.debug-drawer__title {
|
|
7969
|
+
font-size: 14px;
|
|
7970
|
+
font-weight: 600;
|
|
7971
|
+
color: #000000;
|
|
7972
|
+
}
|
|
7973
|
+
|
|
7974
|
+
.debug-drawer__body {
|
|
7975
|
+
flex: 1;
|
|
7976
|
+
overflow-y: auto;
|
|
7977
|
+
overflow-x: hidden;
|
|
7978
|
+
padding: 4px 0;
|
|
7979
|
+
}
|
|
7980
|
+
|
|
7981
|
+
.debug-section {
|
|
7982
|
+
padding: 14px 20px;
|
|
7983
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
7984
|
+
}
|
|
7985
|
+
|
|
7986
|
+
.debug-section:last-child {
|
|
7987
|
+
border-bottom: none;
|
|
7988
|
+
}
|
|
7989
|
+
|
|
7990
|
+
.debug-section__label {
|
|
7991
|
+
text-transform: uppercase;
|
|
7992
|
+
letter-spacing: 0.06em;
|
|
7993
|
+
color: #000000;
|
|
7994
|
+
font-size: 11px;
|
|
7995
|
+
font-weight: 600;
|
|
7996
|
+
margin-bottom: 10px;
|
|
7997
|
+
}
|
|
7998
|
+
|
|
7999
|
+
/* Context-fullness gauge */
|
|
8000
|
+
.debug-gauge {
|
|
8001
|
+
display: flex;
|
|
8002
|
+
align-items: center;
|
|
8003
|
+
gap: 10px;
|
|
8004
|
+
}
|
|
8005
|
+
|
|
8006
|
+
.debug-gauge__bar {
|
|
8007
|
+
flex: 1;
|
|
8008
|
+
height: 8px;
|
|
8009
|
+
border-radius: 4px;
|
|
8010
|
+
background: rgb(244 244 244 / 100%);
|
|
8011
|
+
overflow: hidden;
|
|
8012
|
+
}
|
|
8013
|
+
|
|
8014
|
+
.debug-gauge__fill {
|
|
8015
|
+
height: 100%;
|
|
8016
|
+
border-radius: 4px;
|
|
8017
|
+
background: var(--kr-chatbot-primary);
|
|
8018
|
+
transition: width 0.3s ease;
|
|
8019
|
+
}
|
|
8020
|
+
|
|
8021
|
+
.debug-gauge__text {
|
|
8022
|
+
color: #000000;
|
|
8023
|
+
font-size: 12px;
|
|
8024
|
+
white-space: nowrap;
|
|
8025
|
+
font-variant-numeric: tabular-nums;
|
|
8026
|
+
}
|
|
8027
|
+
|
|
8028
|
+
/* Metric rows */
|
|
8029
|
+
.debug-metrics {
|
|
8030
|
+
display: grid;
|
|
8031
|
+
grid-template-columns: auto 1fr;
|
|
8032
|
+
column-gap: 12px;
|
|
8033
|
+
row-gap: 7px;
|
|
8034
|
+
font-size: 13px;
|
|
8035
|
+
}
|
|
8036
|
+
|
|
8037
|
+
.debug-metrics__key {
|
|
8038
|
+
color: #000000;
|
|
8039
|
+
}
|
|
8040
|
+
|
|
8041
|
+
.debug-metrics__val {
|
|
8042
|
+
color: #000000;
|
|
8043
|
+
text-align: right;
|
|
8044
|
+
font-variant-numeric: tabular-nums;
|
|
8045
|
+
}
|
|
8046
|
+
|
|
8047
|
+
.debug-cost {
|
|
8048
|
+
font-weight: 600;
|
|
8049
|
+
}
|
|
8050
|
+
|
|
8051
|
+
/* Per-iteration table (verbose). The wrapper scrolls horizontally on its own
|
|
8052
|
+
so a wide table never forces the whole drawer to scroll sideways. */
|
|
8053
|
+
.debug-iterations-scroll {
|
|
8054
|
+
overflow-x: auto;
|
|
8055
|
+
max-width: 100%;
|
|
8056
|
+
}
|
|
8057
|
+
|
|
8058
|
+
.debug-iterations {
|
|
8059
|
+
width: 100%;
|
|
8060
|
+
border-collapse: collapse;
|
|
8061
|
+
font-size: 12px;
|
|
8062
|
+
font-variant-numeric: tabular-nums;
|
|
8063
|
+
}
|
|
8064
|
+
|
|
8065
|
+
.debug-iterations th,
|
|
8066
|
+
.debug-iterations td {
|
|
8067
|
+
padding: 5px 6px;
|
|
8068
|
+
text-align: right;
|
|
8069
|
+
white-space: nowrap;
|
|
8070
|
+
}
|
|
8071
|
+
|
|
8072
|
+
.debug-iterations th {
|
|
8073
|
+
color: #000000;
|
|
8074
|
+
font-weight: 600;
|
|
8075
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.10);
|
|
8076
|
+
}
|
|
8077
|
+
|
|
8078
|
+
.debug-iterations tbody tr:not(:last-child) td {
|
|
8079
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
8080
|
+
}
|
|
8081
|
+
|
|
8082
|
+
.debug-iterations td:first-child,
|
|
8083
|
+
.debug-iterations th:first-child {
|
|
8084
|
+
text-align: left;
|
|
8085
|
+
}
|
|
8086
|
+
|
|
8087
|
+
.debug-empty {
|
|
8088
|
+
color: #000000;
|
|
8089
|
+
padding: 20px;
|
|
8090
|
+
font-size: 13px;
|
|
8091
|
+
text-align: center;
|
|
8092
|
+
}
|
|
8093
|
+
|
|
7514
8094
|
/* Footer / Input */
|
|
7515
8095
|
.footer {
|
|
7516
8096
|
padding: 16px 16px 16px;
|
|
@@ -7973,38 +8553,38 @@
|
|
|
7973
8553
|
|
|
7974
8554
|
`;
|
|
7975
8555
|
__decorate([
|
|
7976
|
-
n({ attribute: false })
|
|
8556
|
+
n$1({ attribute: false })
|
|
7977
8557
|
], exports.Chatbot.prototype, "send", void 0);
|
|
7978
8558
|
__decorate([
|
|
7979
|
-
n({ attribute: false })
|
|
8559
|
+
n$1({ attribute: false })
|
|
7980
8560
|
], exports.Chatbot.prototype, "clear", void 0);
|
|
7981
8561
|
__decorate([
|
|
7982
|
-
n({ attribute: false })
|
|
8562
|
+
n$1({ attribute: false })
|
|
7983
8563
|
], exports.Chatbot.prototype, "load", void 0);
|
|
7984
8564
|
__decorate([
|
|
7985
|
-
n({ attribute: false })
|
|
8565
|
+
n$1({ attribute: false })
|
|
7986
8566
|
], exports.Chatbot.prototype, "messages", void 0);
|
|
7987
8567
|
__decorate([
|
|
7988
|
-
n({ type: String })
|
|
8568
|
+
n$1({ type: String })
|
|
7989
8569
|
], exports.Chatbot.prototype, "label", void 0);
|
|
7990
8570
|
__decorate([
|
|
7991
|
-
n({ type: String })
|
|
8571
|
+
n$1({ type: String })
|
|
7992
8572
|
], exports.Chatbot.prototype, "placeholder", void 0);
|
|
7993
8573
|
__decorate([
|
|
7994
|
-
n({
|
|
8574
|
+
n$1({
|
|
7995
8575
|
type: Boolean,
|
|
7996
8576
|
reflect: true
|
|
7997
8577
|
})
|
|
7998
8578
|
], exports.Chatbot.prototype, "opened", void 0);
|
|
7999
8579
|
__decorate([
|
|
8000
|
-
n({
|
|
8580
|
+
n$1({
|
|
8001
8581
|
type: Boolean,
|
|
8002
8582
|
attribute: 'hide-toggle',
|
|
8003
8583
|
reflect: true
|
|
8004
8584
|
})
|
|
8005
8585
|
], exports.Chatbot.prototype, "hideToggle", void 0);
|
|
8006
8586
|
__decorate([
|
|
8007
|
-
n({
|
|
8587
|
+
n$1({
|
|
8008
8588
|
type: String,
|
|
8009
8589
|
reflect: true
|
|
8010
8590
|
})
|
|
@@ -8018,6 +8598,33 @@
|
|
|
8018
8598
|
__decorate([
|
|
8019
8599
|
r()
|
|
8020
8600
|
], exports.Chatbot.prototype, "_error", void 0);
|
|
8601
|
+
__decorate([
|
|
8602
|
+
r()
|
|
8603
|
+
], exports.Chatbot.prototype, "_contextWarning", void 0);
|
|
8604
|
+
__decorate([
|
|
8605
|
+
r()
|
|
8606
|
+
], exports.Chatbot.prototype, "_contextLimitReached", void 0);
|
|
8607
|
+
__decorate([
|
|
8608
|
+
r()
|
|
8609
|
+
], exports.Chatbot.prototype, "_contextLimitMessage", void 0);
|
|
8610
|
+
__decorate([
|
|
8611
|
+
r()
|
|
8612
|
+
], exports.Chatbot.prototype, "_telemetry", void 0);
|
|
8613
|
+
__decorate([
|
|
8614
|
+
r()
|
|
8615
|
+
], exports.Chatbot.prototype, "_iterationLog", void 0);
|
|
8616
|
+
__decorate([
|
|
8617
|
+
r()
|
|
8618
|
+
], exports.Chatbot.prototype, "_cacheCheckpoints", void 0);
|
|
8619
|
+
__decorate([
|
|
8620
|
+
r()
|
|
8621
|
+
], exports.Chatbot.prototype, "_debugPanelOpen", void 0);
|
|
8622
|
+
__decorate([
|
|
8623
|
+
r()
|
|
8624
|
+
], exports.Chatbot.prototype, "_debugDrawerWidth", void 0);
|
|
8625
|
+
__decorate([
|
|
8626
|
+
r()
|
|
8627
|
+
], exports.Chatbot.prototype, "_isDebugResizing", void 0);
|
|
8021
8628
|
__decorate([
|
|
8022
8629
|
r()
|
|
8023
8630
|
], exports.Chatbot.prototype, "_pendingInternalFiles", void 0);
|