@helpai/elements 1.1.6 → 1.1.8
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/elements-web-component.esm.js +1 -1
- package/elements.cjs.js +1 -1
- package/elements.esm.js +1 -1
- package/elements.js +1 -1
- package/index.d.ts +10 -10
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/schema.d.ts +17 -17
- package/web-component.mjs +1 -1
|
@@ -4,7 +4,7 @@ var Pu=Object.defineProperty;var xu=(e,t,n)=>t in e?Pu(e,t,{enumerable:!0,config
|
|
|
4
4
|
`;var as=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
5
|
`;var is=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
|
|
6
6
|
`;var v_="helpai",h_="#5B5BD6",b_="#FFFFFF",y_="12px",P_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",ea=[ns,os,rs,as,is].join(`
|
|
7
|
-
`).replace(/__P__/g,v_).replaceAll("__BRAND_ACCENT_TEXT__",b_).replaceAll("__BRAND_ACCENT__",h_).replaceAll("__BRAND_RADIUS__",y_).replaceAll("__BRAND_FONT__",P_);var x_=ee.scope("mount"),ss=new WeakMap,ls={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function cs(e,t){e.style.cssText=ls[t]}function Po(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ds(e={}){let t=e.position??"flow";x_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${C.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",C.id),o.style.cssText=ls[t];let r=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!S_(r,i)){let l=i.createElement("style");l.textContent=ea,r.appendChild(l)}let s=document.createElement("div");return s.className=`${C.cssPrefix}-app`,r.appendChild(s),{appRoot:s,destroy:()=>o.remove(),hostElement:o,shadowRoot:r}}function S_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=ss.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(ea),ss.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function k_(e,t){let n=C.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function w_(e,t){e.dataset.theme=t}function C_(e,t){let n=C.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function R_(e,t){e.dataset.position=t}function xo(e,t){e.dataset.mode=t}function us(e,t){w_(e,t.themeMode),k_(e,t.themeOverrides),R_(e,t.position),C_(e,t.size)}var _n,Oe,ta,_s,Nn=0,ys=[],Fe=Y,ps=Fe.__b,fs=Fe.__r,ms=Fe.diffed,gs=Fe.__c,vs=Fe.unmount,hs=Fe.__;function ko(e,t){Fe.__h&&Fe.__h(Oe,e,Nn||t),Nn=0;var n=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function D(e){return Nn=1,Ps(xs,e)}function Ps(e,t,n){var o=ko(_n++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):xs(void 0,t),function(l){var c=o.__N?o.__N[0]:o.__[0],u=o.t(c,l);c!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=Oe,!Oe.__f)){var r=function(l,c,u){if(!o.__c.__H)return!0;var _=!1,p=o.__c.props!==l;if(o.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var d=i.call(this,l,c,u);return _?d||p:d}return!_||p};Oe.__f=!0;var i=Oe.shouldComponentUpdate,s=Oe.componentWillUpdate;Oe.componentWillUpdate=function(l,c,u){if(this.__e){var _=i;i=void 0,r(l,c,u),i=_}s&&s.call(this,l,c,u)},Oe.shouldComponentUpdate=r}return o.__N||o.__}function E(e,t){var n=ko(_n++,3);!Fe.__s&&oa(n.__H,t)&&(n.__=e,n.u=t,Oe.__H.__h.push(n))}function pt(e,t){var n=ko(_n++,4);!Fe.__s&&oa(n.__H,t)&&(n.__=e,n.u=t,Oe.__h.push(n))}function M(e){return Nn=5,Z(function(){return{current:e}},[])}function Z(e,t){var n=ko(_n++,7);return oa(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return Nn=8,Z(function(){return e},t)}function T_(){for(var e;e=ys.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(So),t.__h.some(na),t.__h=[]}catch(n){t.__h=[],Fe.__e(n,e.__v)}}}Fe.__b=function(e){Oe=null,ps&&ps(e)},Fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),hs&&hs(e,t)},Fe.__r=function(e){fs&&fs(e),_n=0;var t=(Oe=e.__c).__H;t&&(ta===Oe?(t.__h=[],Oe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(So),t.__h.some(na),t.__h=[],_n=0)),ta=Oe},Fe.diffed=function(e){ms&&ms(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ys.push(t)!==1&&_s===Fe.requestAnimationFrame||((_s=Fe.requestAnimationFrame)||I_)(T_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ta=Oe=null},Fe.__c=function(e,t){t.some(function(n){try{n.__h.some(So),n.__h=n.__h.filter(function(o){return!o.__||na(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],Fe.__e(o,n.__v)}}),gs&&gs(e,t)},Fe.unmount=function(e){vs&&vs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{So(o)}catch(r){t=r}}),n.__H=void 0,t&&Fe.__e(t,n.__v))};var bs=typeof requestAnimationFrame=="function";function I_(e){var t,n=function(){clearTimeout(o),bs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);bs&&(t=requestAnimationFrame(n))}function So(e){var t=Oe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Oe=t}function na(e){var t=Oe;e.__c=e.__(),Oe=t}function oa(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function xs(e,t){return typeof t=="function"?t(e):t}var E_=Symbol.for("preact-signals");function To(){if(kt>1)kt--;else{var e,t=!1;for((function(){var r=Co;for(Co=void 0;r!==void 0;){var i=r.S;if(i.v===r.v)for(var s=i.t;s!==void 0;s=s.x)s.i===r.i&&(s.i=i.i);r=r.o}})();$n!==void 0;){var n=$n;for($n=void 0,wo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ks(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(wo=0,kt--,t)throw e}}function it(e){if(kt>0)return e();ra=++A_,kt++;try{return e()}finally{To()}}var Dn,Re=void 0;function Fn(e){var t=Re,n=Dn;Re=void 0,Dn=void 0;try{return e()}finally{Re=t,Dn=n}}var $n=void 0,kt=0,wo=0,A_=0,ra=0,Co=void 0,Ro=0;function Ss(e){if(Re!==void 0){var t=e.n;if(t===void 0||t.t!==Re)return t={i:0,S:e,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:t},Re.s!==void 0&&(Re.s.n=t),Re.s=t,e.n=t,32&Re.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Re.s,t.n=void 0,Re.s.n=t,Re.s=t),t}}function Ve(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Ve.prototype.brand=E_;Ve.prototype.h=function(){return!0};Ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Fn(function(){var o;(o=t.W)==null||o.call(t)}))};Ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Fn(function(){var r;(r=t.Z)==null||r.call(t)}))}};Ve.prototype.subscribe=function(e){var t=this;return wt(function(){var n=t.value;Fn(function(){return e(n)})},{name:"sub"})};Ve.prototype.valueOf=function(){return this.value};Ve.prototype.toString=function(){return this.value+""};Ve.prototype.toJSON=function(){return this.value};Ve.prototype.peek=function(){var e=this;return Fn(function(){return e.value})};Object.defineProperty(Ve.prototype,"value",{get:function(){var e=Ss(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(wo>100)throw new Error("Cycle detected");(function(n){kt!==0&&wo===0&&n.l!==ra&&(n.l=ra,Co={S:n,v:n.v,i:n.i,o:Co})})(this),this.v=e,this.i++,Ro++,kt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{To()}}}});function J(e,t){return new Ve(e,t)}function ks(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ws(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Cs(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Vt(e,t){Ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ro-1,this.f=4}Vt.prototype=new Ve;Vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ro))return!0;if(this.g=Ro,this.f|=1,this.i>0&&!ks(this))return this.f&=-2,!0;var e=Re;try{ws(this),Re=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Re=e,Cs(this),this.f&=-2,!0};Vt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ve.prototype.S.call(this,e)};Vt.prototype.U=function(e){if(this.t!==void 0&&(Ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Vt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ss(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function fe(e,t){return new Vt(e,t)}function Rs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){kt++;var n=Re;Re=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,aa(e),o}finally{Re=n,To()}}}function aa(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Rs(e)}function M_(e){if(Re!==this)throw new Error("Out-of-order effect");Cs(this),Re=e,this.f&=-2,8&this.f&&aa(this),To()}function pn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Dn&&Dn.push(this)}pn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};pn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Rs(this),ws(this),kt++;var e=Re;return Re=this,M_.bind(this,e)};pn.prototype.N=function(){2&this.f||(this.f|=2,this.u=$n,$n=this)};pn.prototype.d=function(){this.f|=8,1&this.f||aa(this)};pn.prototype.dispose=function(){this.d()};function wt(e,t){var n=new pn(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ts,Ao,Io,L_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Is=[];wt(function(){Ts=this.N})();function fn(e,t){Y[e]=t.bind(null,Y[e]||function(){})}function Eo(e){if(Io){var t=Io;Io=void 0,t()}Io=e&&e.S()}function Es(e){var t=this,n=e.data,o=dt(n);o.value=n;var r=Z(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=fe(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),_=fe(function(){return!Array.isArray(u.value)&&!Fr(u.value)}),p=wt(function(){if(this.N=As,_.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){p(),d.call(this)},[_,u]},[]),i=r[0],s=r[1];return i.value?s.peek():s.value}Es.displayName="ReactiveTextNode";Object.defineProperties(Ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Es},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});fn("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var r in o)if(r!=="children"){var i=o[r];i instanceof Ve&&(n||(t.__np=n={}),n[r]=i,o[r]=i.peek())}}e(t)});fn("__r",function(e,t){if(e(t),t.type!==ce){Eo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(r,i){var s;return wt(function(){s=this},{name:i}),s.c=r,s})(function(){var r;L_&&((r=n.y)==null||r.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ao=o,Eo(n)}});fn("__e",function(e,t,n,o){Eo(),Ao=void 0,e(t,n,o)});fn("diffed",function(e,t){Eo(),Ao=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,r=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||o&&s in o||(l.d(),i[s]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var u=i[c],_=o[c];u===void 0?(u=O_(n,c,_,r),i[c]=u):u.o(_,r)}}}e(t)});function O_(e,t,n,o){var r=t in e&&e.ownerSVGElement===void 0,i=J(n);return{o:function(s,l){i.value=s,o=l},d:wt(function(){this.N=As;var s=i.value.value;o[t]!==s&&(o[t]=s,r?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}fn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var r in o){var i=o[r];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var _=u.__$u;_&&(u.__$u=void 0,_.d())}}e(t)});fn("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});et.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function dt(e,t){return Z(function(){return J(e,t)},[])}function ut(e,t){var n=M(e);return n.current=e,Ao.__$f|=4,Z(function(){return fe(function(){return n.current()},t)},[])}var N_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function D_(){it(function(){for(var e;e=Is.shift();)Ts.call(e)})}function As(){Is.push(this)===1&&(Y.requestAnimationFrame||N_)(D_)}function Ms(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ls(e){return Ms(e)}function Os(e){return!(!Ms(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function $_(e){return`${C.cssPrefix}:${e}`}function Ns(e,t){let o=Object.entries(t).map(([r,i])=>{let s=$_(r),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[r,i]of o)e.removeEventListener(r,i)}}function Mo(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var F_=900,B_=640;function ia(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<B_?"fullscreen":n>=(t.autoSizeBreakpoint??F_)?"expanded":"normal"}function Bn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:ia(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function mn(){return typeof window>"u"?0:window.innerWidth}var H_="x-public-key",U_="x-ai-agent-deployment-id";function Ds(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[U_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??H_]=e.publicKey),t}}}function Hn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),r=()=>i();t?.addEventListener("abort",r,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",r),n()}})}var Lo="1.1.6";var We=class extends Error{constructor(n,o,r,i){super(n);te(this,"code",o);te(this,"status",r);te(this,"cause",i);this.name="StreamError"}};var $s=ee.scope("parser");async function*Fs(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of z_(e,t)){let o=q_(n);if(o==="done")return;o&&(yield o)}}async function*z_(e,t){if(!e.body)throw new We("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:r,value:i}=await n.read();if(r){let l=o.trim();l&&(yield l);return}o+=i;let s;for(;(s=o.indexOf(`
|
|
7
|
+
`).replace(/__P__/g,v_).replaceAll("__BRAND_ACCENT_TEXT__",b_).replaceAll("__BRAND_ACCENT__",h_).replaceAll("__BRAND_RADIUS__",y_).replaceAll("__BRAND_FONT__",P_);var x_=ee.scope("mount"),ss=new WeakMap,ls={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function cs(e,t){e.style.cssText=ls[t]}function Po(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ds(e={}){let t=e.position??"flow";x_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${C.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",C.id),o.style.cssText=ls[t];let r=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!S_(r,i)){let l=i.createElement("style");l.textContent=ea,r.appendChild(l)}let s=document.createElement("div");return s.className=`${C.cssPrefix}-app`,r.appendChild(s),{appRoot:s,destroy:()=>o.remove(),hostElement:o,shadowRoot:r}}function S_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=ss.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(ea),ss.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function k_(e,t){let n=C.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function w_(e,t){e.dataset.theme=t}function C_(e,t){let n=C.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function R_(e,t){e.dataset.position=t}function xo(e,t){e.dataset.mode=t}function us(e,t){w_(e,t.themeMode),k_(e,t.themeOverrides),R_(e,t.position),C_(e,t.size)}var _n,Oe,ta,_s,Nn=0,ys=[],Fe=Y,ps=Fe.__b,fs=Fe.__r,ms=Fe.diffed,gs=Fe.__c,vs=Fe.unmount,hs=Fe.__;function ko(e,t){Fe.__h&&Fe.__h(Oe,e,Nn||t),Nn=0;var n=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function D(e){return Nn=1,Ps(xs,e)}function Ps(e,t,n){var o=ko(_n++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):xs(void 0,t),function(l){var c=o.__N?o.__N[0]:o.__[0],u=o.t(c,l);c!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=Oe,!Oe.__f)){var r=function(l,c,u){if(!o.__c.__H)return!0;var _=!1,p=o.__c.props!==l;if(o.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var d=i.call(this,l,c,u);return _?d||p:d}return!_||p};Oe.__f=!0;var i=Oe.shouldComponentUpdate,s=Oe.componentWillUpdate;Oe.componentWillUpdate=function(l,c,u){if(this.__e){var _=i;i=void 0,r(l,c,u),i=_}s&&s.call(this,l,c,u)},Oe.shouldComponentUpdate=r}return o.__N||o.__}function E(e,t){var n=ko(_n++,3);!Fe.__s&&oa(n.__H,t)&&(n.__=e,n.u=t,Oe.__H.__h.push(n))}function pt(e,t){var n=ko(_n++,4);!Fe.__s&&oa(n.__H,t)&&(n.__=e,n.u=t,Oe.__h.push(n))}function M(e){return Nn=5,Z(function(){return{current:e}},[])}function Z(e,t){var n=ko(_n++,7);return oa(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return Nn=8,Z(function(){return e},t)}function T_(){for(var e;e=ys.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(So),t.__h.some(na),t.__h=[]}catch(n){t.__h=[],Fe.__e(n,e.__v)}}}Fe.__b=function(e){Oe=null,ps&&ps(e)},Fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),hs&&hs(e,t)},Fe.__r=function(e){fs&&fs(e),_n=0;var t=(Oe=e.__c).__H;t&&(ta===Oe?(t.__h=[],Oe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(So),t.__h.some(na),t.__h=[],_n=0)),ta=Oe},Fe.diffed=function(e){ms&&ms(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ys.push(t)!==1&&_s===Fe.requestAnimationFrame||((_s=Fe.requestAnimationFrame)||I_)(T_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ta=Oe=null},Fe.__c=function(e,t){t.some(function(n){try{n.__h.some(So),n.__h=n.__h.filter(function(o){return!o.__||na(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],Fe.__e(o,n.__v)}}),gs&&gs(e,t)},Fe.unmount=function(e){vs&&vs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{So(o)}catch(r){t=r}}),n.__H=void 0,t&&Fe.__e(t,n.__v))};var bs=typeof requestAnimationFrame=="function";function I_(e){var t,n=function(){clearTimeout(o),bs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);bs&&(t=requestAnimationFrame(n))}function So(e){var t=Oe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Oe=t}function na(e){var t=Oe;e.__c=e.__(),Oe=t}function oa(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function xs(e,t){return typeof t=="function"?t(e):t}var E_=Symbol.for("preact-signals");function To(){if(kt>1)kt--;else{var e,t=!1;for((function(){var r=Co;for(Co=void 0;r!==void 0;){var i=r.S;if(i.v===r.v)for(var s=i.t;s!==void 0;s=s.x)s.i===r.i&&(s.i=i.i);r=r.o}})();$n!==void 0;){var n=$n;for($n=void 0,wo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ks(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(wo=0,kt--,t)throw e}}function it(e){if(kt>0)return e();ra=++A_,kt++;try{return e()}finally{To()}}var Dn,Re=void 0;function Fn(e){var t=Re,n=Dn;Re=void 0,Dn=void 0;try{return e()}finally{Re=t,Dn=n}}var $n=void 0,kt=0,wo=0,A_=0,ra=0,Co=void 0,Ro=0;function Ss(e){if(Re!==void 0){var t=e.n;if(t===void 0||t.t!==Re)return t={i:0,S:e,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:t},Re.s!==void 0&&(Re.s.n=t),Re.s=t,e.n=t,32&Re.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Re.s,t.n=void 0,Re.s.n=t,Re.s=t),t}}function Ve(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Ve.prototype.brand=E_;Ve.prototype.h=function(){return!0};Ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Fn(function(){var o;(o=t.W)==null||o.call(t)}))};Ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Fn(function(){var r;(r=t.Z)==null||r.call(t)}))}};Ve.prototype.subscribe=function(e){var t=this;return wt(function(){var n=t.value;Fn(function(){return e(n)})},{name:"sub"})};Ve.prototype.valueOf=function(){return this.value};Ve.prototype.toString=function(){return this.value+""};Ve.prototype.toJSON=function(){return this.value};Ve.prototype.peek=function(){var e=this;return Fn(function(){return e.value})};Object.defineProperty(Ve.prototype,"value",{get:function(){var e=Ss(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(wo>100)throw new Error("Cycle detected");(function(n){kt!==0&&wo===0&&n.l!==ra&&(n.l=ra,Co={S:n,v:n.v,i:n.i,o:Co})})(this),this.v=e,this.i++,Ro++,kt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{To()}}}});function J(e,t){return new Ve(e,t)}function ks(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ws(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Cs(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Vt(e,t){Ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ro-1,this.f=4}Vt.prototype=new Ve;Vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ro))return!0;if(this.g=Ro,this.f|=1,this.i>0&&!ks(this))return this.f&=-2,!0;var e=Re;try{ws(this),Re=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Re=e,Cs(this),this.f&=-2,!0};Vt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ve.prototype.S.call(this,e)};Vt.prototype.U=function(e){if(this.t!==void 0&&(Ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Vt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ss(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function fe(e,t){return new Vt(e,t)}function Rs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){kt++;var n=Re;Re=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,aa(e),o}finally{Re=n,To()}}}function aa(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Rs(e)}function M_(e){if(Re!==this)throw new Error("Out-of-order effect");Cs(this),Re=e,this.f&=-2,8&this.f&&aa(this),To()}function pn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Dn&&Dn.push(this)}pn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};pn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Rs(this),ws(this),kt++;var e=Re;return Re=this,M_.bind(this,e)};pn.prototype.N=function(){2&this.f||(this.f|=2,this.u=$n,$n=this)};pn.prototype.d=function(){this.f|=8,1&this.f||aa(this)};pn.prototype.dispose=function(){this.d()};function wt(e,t){var n=new pn(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ts,Ao,Io,L_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Is=[];wt(function(){Ts=this.N})();function fn(e,t){Y[e]=t.bind(null,Y[e]||function(){})}function Eo(e){if(Io){var t=Io;Io=void 0,t()}Io=e&&e.S()}function Es(e){var t=this,n=e.data,o=dt(n);o.value=n;var r=Z(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=fe(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),_=fe(function(){return!Array.isArray(u.value)&&!Fr(u.value)}),p=wt(function(){if(this.N=As,_.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){p(),d.call(this)},[_,u]},[]),i=r[0],s=r[1];return i.value?s.peek():s.value}Es.displayName="ReactiveTextNode";Object.defineProperties(Ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Es},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});fn("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var r in o)if(r!=="children"){var i=o[r];i instanceof Ve&&(n||(t.__np=n={}),n[r]=i,o[r]=i.peek())}}e(t)});fn("__r",function(e,t){if(e(t),t.type!==ce){Eo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(r,i){var s;return wt(function(){s=this},{name:i}),s.c=r,s})(function(){var r;L_&&((r=n.y)==null||r.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Ao=o,Eo(n)}});fn("__e",function(e,t,n,o){Eo(),Ao=void 0,e(t,n,o)});fn("diffed",function(e,t){Eo(),Ao=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,r=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||o&&s in o||(l.d(),i[s]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var u=i[c],_=o[c];u===void 0?(u=O_(n,c,_,r),i[c]=u):u.o(_,r)}}}e(t)});function O_(e,t,n,o){var r=t in e&&e.ownerSVGElement===void 0,i=J(n);return{o:function(s,l){i.value=s,o=l},d:wt(function(){this.N=As;var s=i.value.value;o[t]!==s&&(o[t]=s,r?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}fn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var r in o){var i=o[r];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var _=u.__$u;_&&(u.__$u=void 0,_.d())}}e(t)});fn("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});et.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function dt(e,t){return Z(function(){return J(e,t)},[])}function ut(e,t){var n=M(e);return n.current=e,Ao.__$f|=4,Z(function(){return fe(function(){return n.current()},t)},[])}var N_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function D_(){it(function(){for(var e;e=Is.shift();)Ts.call(e)})}function As(){Is.push(this)===1&&(Y.requestAnimationFrame||N_)(D_)}function Ms(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ls(e){return Ms(e)}function Os(e){return!(!Ms(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function $_(e){return`${C.cssPrefix}:${e}`}function Ns(e,t){let o=Object.entries(t).map(([r,i])=>{let s=$_(r),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[r,i]of o)e.removeEventListener(r,i)}}function Mo(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var F_=900,B_=640;function ia(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<B_?"fullscreen":n>=(t.autoSizeBreakpoint??F_)?"expanded":"normal"}function Bn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:ia(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function mn(){return typeof window>"u"?0:window.innerWidth}var H_="x-public-key",U_="x-ai-agent-deployment-id";function Ds(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[U_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??H_]=e.publicKey),t}}}function Hn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),r=()=>i();t?.addEventListener("abort",r,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",r),n()}})}var Lo="1.1.8";var We=class extends Error{constructor(n,o,r,i){super(n);te(this,"code",o);te(this,"status",r);te(this,"cause",i);this.name="StreamError"}};var $s=ee.scope("parser");async function*Fs(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of z_(e,t)){let o=q_(n);if(o==="done")return;o&&(yield o)}}async function*z_(e,t){if(!e.body)throw new We("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:r,value:i}=await n.read();if(r){let l=o.trim();l&&(yield l);return}o+=i;let s;for(;(s=o.indexOf(`
|
|
8
8
|
|
|
9
9
|
`))!==-1;){let l=o.slice(0,s);o=o.slice(s+2),yield l}}}finally{n.releaseLock()}}function q_(e){let t="",n;for(let o of e.split(`
|
|
10
10
|
`))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let r=o.slice(5).replace(/^ /,"");t=t?`${t}
|