@aginies/embed 0.2.0

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.
@@ -0,0 +1,2280 @@
1
+ "use strict";var Aginies=(()=>{var fe=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var Fn=Object.prototype.hasOwnProperty;var An=(t,e,n)=>e in t?fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Sn=(t,e)=>{for(var n in e)fe(t,n,{get:e[n],enumerable:!0})},En=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Cn(e))!Fn.call(t,r)&&r!==n&&fe(t,r,{get:()=>e[r],enumerable:!(a=wn(e,r))||a.enumerable});return t};var Pn=t=>En(fe({},"__esModule",{value:!0}),t);var O=(t,e,n)=>An(t,typeof e!="symbol"?e+"":e,n);var Fa={};Sn(Fa,{approval:()=>xn,autoload:()=>kn,chat:()=>vn,init:()=>bn,version:()=>ka});var ye,b,st,Rn,G,rt,lt,ut,Me,me,ue,dt,Le,Be,Ie,ct,be={},ve=[],Nn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,de=Array.isArray;function $(t,e){for(var n in e)t[n]=e[n];return t}function He(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function j(t,e,n){var a,r,i,s={};for(i in e)i=="key"?a=e[i]:i=="ref"?r=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?ye.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return he(t,s,a,r,null)}function he(t,e,n,a,r){var i={type:t,props:e,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++st,__i:-1,__u:0};return r==null&&b.vnode!=null&&b.vnode(i),i}function P(t){return t.children}function q(t,e){this.props=t,this.context=e}function X(t,e){if(e==null)return t.__?X(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?X(t):null}function Tn(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,a=[],r=[],i=$({},e);i.__v=e.__v+1,b.vnode&&b.vnode(i),Oe(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,a,n??X(e),!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,mt(a,i,r),e.__e=e.__=null,i.__e!=n&&pt(i)}}function pt(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),pt(t)}function ze(t){(!t.__d&&(t.__d=!0)&&G.push(t)&&!xe.__r++||rt!=b.debounceRendering)&&((rt=b.debounceRendering)||lt)(xe)}function xe(){try{for(var t,e=1;G.length;)G.length>e&&G.sort(ut),t=G.shift(),e=G.length,Tn(t)}finally{G.length=xe.__r=0}}function gt(t,e,n,a,r,i,s,d,c,u,g){var f,l,p,_,v,x,y=a&&a.__k||ve,m=e.length;for(c=Mn(n,e,y,c,m),f=0;f<m;f++)(p=n.__k[f])!=null&&(l=p.__i!=-1&&y[p.__i]||be,p.__i=f,x=Oe(t,p,l,r,i,s,d,c,u,g),_=p.__e,p.ref&&l.ref!=p.ref&&(l.ref&&qe(l.ref,null,p),g.push(p.ref,p.__c||_,p)),v==null&&_!=null&&(v=_),4&p.__u?(c=ft(p,c,t),l.__e&&(l.__e=null)):typeof p.type=="function"&&x!==void 0?c=x:_&&(c=_.nextSibling),p.__u&=-7);return n.__e=v,c}function Mn(t,e,n,a,r){var i,s,d,c,u,g=n.length,f=g,l=0;for(t.__k=new Array(r),i=0;i<r;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[i]=he(null,s,null,null,null):de(s)?s=t.__k[i]=he(P,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[i]=he(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[i]=s,c=i+l,s.__=t,s.__b=t.__b+1,d=null,(u=s.__i=Bn(s,n,c,f))!=-1&&(f--,(d=n[u])&&(d.__u|=2)),d==null||d.__v==null?(u==-1&&(r>g?l--:r<g&&l++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?l--:u==c+1?l++:(u>c?l--:l++,s.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<g;i++)(d=n[i])!=null&&(2&d.__u)==0&&(d.__e==a&&(a=X(d)),bt(d,d));return a}function ft(t,e,n){var a,r;if(typeof t.type=="function"){for(a=t.__k,r=0;a&&r<a.length;r++)a[r]&&(a[r].__=t,e=ft(a[r],e,n));return e}t.__e!=e&&(e&&t.type&&!e.parentNode&&(e=X(t)),e=n.insertBefore(t.__e,e||null));do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ce(t,e){return e=e||[],t==null||typeof t=="boolean"||(de(t)?t.some(function(n){ce(n,e)}):e.push(t)),e}function Bn(t,e,n,a){var r,i,s,d=t.key,c=t.type,u=e[n],g=u!=null&&(2&u.__u)==0;if(u===null&&d==null||g&&d==u.key&&c==u.type)return n;if(a>(g?1:0)){for(r=n-1,i=n+1;r>=0||i<e.length;)if((u=e[s=r>=0?r--:i++])!=null&&(2&u.__u)==0&&d==u.key&&c==u.type)return s}return-1}function it(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Nn.test(e)?n:n+"px"}function _e(t,e,n,a,r){var i,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof a=="string"&&(t.style.cssText=a=""),a)for(e in a)n&&e in n||it(t.style,e,"");if(n)for(e in n)a&&n[e]==a[e]||it(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(dt,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?a?n[ue]=a[ue]:(n[ue]=Le,t.addEventListener(e,i?Ie:Be,i)):t.removeEventListener(e,i?Ie:Be,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ot(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[me]==null)e[me]=Le++;else if(e[me]<n[ue])return;return n(b.event?b.event(e):e)}}}function Oe(t,e,n,a,r,i,s,d,c,u){var g,f,l,p,_,v,x,y,m,F,k,S,H,ee,W,C,h=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[d=e.__e=n.__e]),(g=b.__b)&&g(e);e:if(typeof h=="function"){f=s.length;try{if(m=e.props,F=h.prototype&&h.prototype.render,k=(g=h.contextType)&&a[g.__c],S=g?k?k.props.value:g.__:a,n.__c?y=(l=e.__c=n.__c).__=l.__E:(F?e.__c=l=new h(m,S):(e.__c=l=new q(m,S),l.constructor=h,l.render=zn),k&&k.sub(l),l.state||(l.state={}),l.__n=a,p=l.__d=!0,l.__h=[],l._sb=[]),F&&l.__s==null&&(l.__s=l.state),F&&h.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=$({},l.__s)),$(l.__s,h.getDerivedStateFromProps(m,l.__s))),_=l.props,v=l.state,l.__v=e,p)F&&h.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),F&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F&&h.getDerivedStateFromProps==null&&m!==_&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(m,S),e.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(m,l.__s,S)===!1){e.__v!=n.__v&&(l.props=m,l.state=l.__s,l.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(R){R&&(R.__=e)}),ve.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&s.push(l),d=X(n);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(m,l.__s,S),F&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(_,v,x)})}if(l.context=S,l.props=m,l.__P=t,l.__e=!1,H=b.__r,ee=0,F)l.state=l.__s,l.__d=!1,H&&H(e),g=l.render(l.props,l.state,l.context),ve.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,H&&H(e),g=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++ee<25);l.state=l.__s,l.getChildContext!=null&&(a=$($({},a),l.getChildContext())),F&&!p&&l.getSnapshotBeforeUpdate!=null&&(x=l.getSnapshotBeforeUpdate(_,v)),W=g!=null&&g.type===P&&g.key==null?ht(g.props.children):g,d=gt(t,de(W)?W:[W],e,n,a,r,i,s,d,c,u),l.base=e.__e,e.__u&=-161,l.__h.length&&s.push(l),y&&(l.__E=l.__=null)}catch(R){if(s.length=f,e.__v=null,c||i!=null){if(R.then){for(e.__u|=c?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;i!=null&&(i[i.indexOf(d)]=null),e.__e=d}else if(i!=null)for(C=i.length;C--;)He(i[C])}else e.__e=n.__e;e.__k==null&&(e.__k=n.__k||[]),R.then||_t(e),b.__e(R,e,n)}}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):d=e.__e=In(n.__e,e,n,a,r,i,s,c,u);return(g=b.diffed)&&g(e),128&e.__u?void 0:d}function _t(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(_t))}function mt(t,e,n){for(var a=0;a<n.length;a++)qe(n[a],n[++a],n[++a]);b.__c&&b.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(i){i.call(r)})}catch(i){b.__e(i,r.__v)}})}function ht(t){return typeof t!="object"||t==null||t.__b>0?t:de(t)?t.map(ht):t.constructor!==void 0?null:$({},t)}function In(t,e,n,a,r,i,s,d,c){var u,g,f,l,p,_,v,x=n.props||be,y=e.props,m=e.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!m&&(m?p.localName==m:p.nodeType==3)){t=p,i[u]=null;break}}if(t==null){if(m==null)return document.createTextNode(y);t=document.createElementNS(r,m,y.is&&y),d&&(b.__m&&b.__m(e,i),d=!1),i=null}if(m==null)x===y||d&&t.data==y||(t.data=y);else{if(i=m=="textarea"&&y.defaultValue!=null?null:i&&ye.call(t.childNodes),!d&&i!=null)for(x={},u=0;u<t.attributes.length;u++)x[(p=t.attributes[u]).name]=p.value;for(u in x)p=x[u],u=="dangerouslySetInnerHTML"?f=p:u=="children"||u in y||u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y||_e(t,u,null,p,r);for(u in y)p=y[u],u=="children"?l=p:u=="dangerouslySetInnerHTML"?g=p:u=="value"?_=p:u=="checked"?v=p:d&&typeof p!="function"||x[u]===p||_e(t,u,p,x[u],r);if(g)d||f&&(g.__html==f.__html||g.__html==t.innerHTML)||(t.innerHTML=g.__html),e.__k=[];else if(f&&(t.innerHTML=""),gt(e.type=="template"?t.content:t,de(l)?l:[l],e,n,a,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,s,i?i[0]:n.__k&&X(n,0),d,c),i!=null)for(u=i.length;u--;)He(i[u]);d&&m!="textarea"||(u="value",m=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[u]||m=="progress"&&!_||m=="option"&&_!=x[u])&&_e(t,u,_,x[u],r),u="checked",v!=null&&v!=t[u]&&_e(t,u,v,x[u],r))}return t}function qe(t,e,n){try{if(typeof t=="function"){var a=typeof t.__u=="function";a&&t.__u(),a&&e==null||(t.__u=t(e))}else t.current=e}catch(r){b.__e(r,n)}}function bt(t,e,n){var a,r;if(b.unmount&&b.unmount(t),(a=t.ref)&&(a.current&&a.current!=t.__e||qe(a,null,e)),(a=t.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(i){b.__e(i,e)}a.base=a.__P=a.__n=null}if(a=t.__k)for(r=0;r<a.length;r++)a[r]&&bt(a[r],e,n||typeof t.type!="function");n||He(t.__e),t.__c=t.__=t.__e=void 0}function zn(t,e,n){return this.constructor(t,n)}function Ue(t,e,n){var a,r,i,s;e==document&&(e=document.documentElement),b.__&&b.__(t,e),r=(a=typeof n=="function")?null:n&&n.__k||e.__k,i=[],s=[],Oe(e,t=(!a&&n||e).__k=j(P,null,[t]),r||be,be,e.namespaceURI,!a&&n?[n]:r?null:e.firstChild?ye.call(e.childNodes):null,i,!a&&n?n:r?r.__e:e.firstChild,a,s),mt(i,t,s),t.props.children=null}function ke(t){function e(n){var a,r;return this.getChildContext||(a=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){a=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&a.forEach(function(s){s.__e=!0,ze(s)})},this.sub=function(i){a.add(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){a&&a.delete(i),s&&s.call(i)}}),n.children}return e.__c="__cC"+ct++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,a){return n.children(a)}).contextType=e,e}ye=ve.slice,b={__e:function(t,e,n,a){for(var r,i,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,a||{}),s=r.__d),s)return r.__E=r}catch(d){t=d}throw t}},st=0,Rn=function(t){return t!=null&&t.constructor===void 0},q.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof t=="function"&&(t=t($({},n),this.props)),t&&$(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ze(this))},q.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ze(this))},q.prototype.render=P,G=[],lt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ut=function(t,e){return t.__v.__b-e.__v.__b},xe.__r=0,Me=Math.random().toString(8),me="__d"+Me,ue="__a"+Me,dt=/(PointerCapture)$|Capture$/i,Le=0,Be=ot(!1),Ie=ot(!0),ct=0;var ne,A,De,vt,pe=0,St=[],N=b,xt=N.__b,yt=N.__r,kt=N.diffed,wt=N.__c,Ct=N.unmount,Ft=N.__;function Ce(t,e){N.__h&&N.__h(A,t,pe||e),pe=0;var n=A.__H||(A.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function w(t){return pe=1,Et(Rt,t)}function Et(t,e,n){var a=Ce(ne++,2);if(a.t=t,!a.__c&&(a.__=[n?n(e):Rt(void 0,e),function(d){var c=a.__N?a.__N[0]:a.__[0],u=a.t(c,d);c!==u&&(a.__N=[u,a.__[1]],a.__c.setState({}))}],a.__c=A,!A.__f)){var r=function(d,c,u){if(!a.__c.__H)return!0;var g=!1,f=a.__c.props!==d;if(a.__c.__H.__.some(function(p){if(p.__N){g=!0;var _=p.__[0];p.__=p.__N,p.__N=void 0,_!==p.__[0]&&(f=!0)}}),i){var l=i.call(this,d,c,u);return g?l||f:l}return!g||f};A.__f=!0;var i=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(d,c,u){if(this.__e){var g=i;i=void 0,r(d,c,u),i=g}s&&s.call(this,d,c,u)},A.shouldComponentUpdate=r}return a.__N||a.__}function U(t,e){var n=Ce(ne++,3);!N.__s&&Pt(n.__H,e)&&(n.__=t,n.u=e,A.__H.__h.push(n))}function K(t){return pe=5,Q(function(){return{current:t}},[])}function Q(t,e){var n=Ce(ne++,7);return Pt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function z(t,e){return pe=8,Q(function(){return t},e)}function $e(t){var e=A.context[t.__c],n=Ce(ne++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(A)),e.props.value):t.__}function Ln(){for(var t;t=St.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(we),e.__h.some(je),e.__h=[]}catch(n){e.__h=[],N.__e(n,t.__v)}}}N.__b=function(t){A=null,xt&&xt(t)},N.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ft&&Ft(t,e)},N.__r=function(t){yt&&yt(t),ne=0;var e=(A=t.__c).__H;e&&(De===A?(e.__h=[],A.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(we),e.__h.some(je),e.__h=[],ne=0)),De=A},N.diffed=function(t){kt&&kt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(St.push(e)!==1&&vt===N.requestAnimationFrame||((vt=N.requestAnimationFrame)||Hn)(Ln)),e.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),De=A=null},N.__c=function(t,e){e.some(function(n){try{n.__h.some(we),n.__h=n.__h.filter(function(a){return!a.__||je(a)})}catch(a){e.some(function(r){r.__h&&(r.__h=[])}),e=[],N.__e(a,n.__v)}}),wt&&wt(t,e)},N.unmount=function(t){Ct&&Ct(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(a){try{we(a)}catch(r){e=r}}),n.__H=void 0,e&&N.__e(e,n.__v))};var At=typeof requestAnimationFrame=="function";function Hn(t){var e,n=function(){clearTimeout(a),At&&cancelAnimationFrame(e),setTimeout(t)},a=setTimeout(n,35);At&&(e=requestAnimationFrame(n))}function we(t){var e=A,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),A=e}function je(t){var e=A;t.__c=t.__(),A=e}function Pt(t,e){return!t||t.length!==e.length||e.some(function(n,a){return n!==t[a]})}function Rt(t,e){return typeof e=="function"?e(t):e}function qt(t,e){for(var n in e)t[n]=e[n];return t}function Nt(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var a in e)if(a!=="__source"&&t[a]!==e[a])return!0;return!1}function Tt(t,e){this.props=t,this.context=e}(Tt.prototype=new q).isPureReactComponent=!0,Tt.prototype.shouldComponentUpdate=function(t,e){return Nt(this.props,t)||Nt(this.state,e)};var Mt=b.__b;b.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Mt&&Mt(t)};var qn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ae(t){function e(n){var a=qt({},n);return delete a.ref,t(a,n.ref||null)}return e.$$typeof=qn,e.render=t,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Un=b.__e;b.__e=function(t,e,n,a){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k||[]),r.__c(t,e)}Un(t,e,n,a)};var Bt=b.unmount;function Ut(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(a){typeof a.__c=="function"&&a.__c()}),t.__c.__H=null),(t=qt({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(a){return Ut(a,e,n)})),t}function Dt(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(a){return Dt(a,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Ve(){this.__u=0,this.o=null,this.__b=null}function jt(t){var e=t.__&&t.__.__c;return e&&e.__a&&e.__a(t)}function Fe(){this.i=null,this.l=null}b.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Bt&&Bt(t)},(Ve.prototype=new q).__c=function(t,e){var n=e.__c,a=this;a.o==null&&(a.o=[]),a.o.push(n);var r=jt(a.__v),i=!1,s=function(){i||a.__z||(i=!0,n.__R=null,r?r(c):c())};n.__R=s;var d=n.__P;n.__P=null;var c=function(){if(!--a.__u){if(a.state.__a){var u=a.state.__a;a.__v.__k[0]=Dt(u,u.__c.__P,u.__c.__O)}var g;for(a.setState({__a:a.__b=null});g=a.o.pop();)g.__P=d,g.forceUpdate()}};a.__u++||32&e.__u||a.setState({__a:a.__b=a.__v.__k[0]}),t.then(s,s)},Ve.prototype.componentWillUnmount=function(){this.o=[]},Ve.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),a=this.__v.__k[0].__c;this.__v.__k[0]=Ut(this.__b,n,a.__O=a.__P)}this.__b=null}var r=e.__a&&j(P,null,t.fallback);return r&&(r.__u&=-33),[j(P,null,e.__a?null:t.children),r]};var It=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Fe.prototype=new q).__a=function(t){var e=this,n=jt(e.__v),a=e.l.get(t);return a[0]++,function(r){var i=function(){e.props.revealOrder?(a.push(r),It(e,t,a)):r()};n?n(i):i()}},Fe.prototype.render=function(t){this.i=null,this.l=new Map;var e=ce(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Fe.prototype.componentDidUpdate=Fe.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){It(t,n,e)})};var Dn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,jn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,$n=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Vn=/[A-Z0-9]/g,Wn=typeof document<"u",Jn=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function $t(t,e,n){return e.__k==null&&(e.textContent=""),Ue(t,e),typeof n=="function"&&n(),t?t.__c:null}q.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(q.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var zt=b.event;b.event=function(t){return zt&&(t=zt(t)),t.persist=function(){},t.isPropagationStopped=function(){return this.cancelBubble},t.isDefaultPrevented=function(){return this.defaultPrevented},t.nativeEvent=t};var Vt,Gn={configurable:!0,get:function(){return this.class}},Lt=b.vnode;b.vnode=function(t){typeof t.type=="string"&&(function(e){var n=e.props,a=e.type,r={},i=a.indexOf("-")==-1;for(var s in n){var d=n[s];if(!(s==="value"&&"defaultValue"in n&&d==null||Wn&&s==="children"&&a==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&d===!0?d="":c==="translate"&&d==="no"?d=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||a!=="input"&&a!=="textarea"||Jn(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":$n.test(s)&&(s=c):c=s="oninput":i&&jn.test(s)?s=s.replace(Vn,"-$&").toLowerCase():d===null&&(d=void 0),c==="oninput"&&r[s=c]&&(s="oninputCapture"),r[s]=d}}a=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=ce(n.children).forEach(function(u){u.props.selected=r.value.indexOf(u.props.value)!=-1})),r.defaultValue!=null&&(r.value=ce(n.children).forEach(function(u){u.props.selected=r.multiple?r.defaultValue.indexOf(u.props.value)!=-1:r.defaultValue==u.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",Gn)):n.className&&(r.class=r.className=n.className),e.props=r})(t),t.$$typeof=Dn,Lt&&Lt(t)};var Ht=b.__r;b.__r=function(t){Ht&&Ht(t),Vt=t.__c};var Ot=b.diffed;b.diffed=function(t){Ot&&Ot(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Vt=null};function Wt(t){return!!t.__k&&(Ue(null,t),!0)}var M=class extends Error{constructor(n,a,r){super(n);O(this,"status");O(this,"code");this.name="AginiesError",this.status=a,this.code=r}},Kn=t=>t.replace(/\/+$/,""),Ee=class{constructor(e){O(this,"baseUrl");O(this,"token");O(this,"locale");O(this,"fetchImpl");O(this,"state",{status:"idle"});O(this,"listeners",new Set);O(this,"activation",null);O(this,"session",null);if(!e?.baseUrl)throw new M("baseUrl is required",0,"MISSING_BASE_URL");if(!e?.token)throw new M("token is required",0,"MISSING_TOKEN");this.baseUrl=Kn(e.baseUrl),this.token=e.token,this.locale=e.locale??Yn(),this.fetchImpl=e.fetch??((...n)=>fetch(...n))}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}setState(e){this.state=e;for(let n of this.listeners)n(e)}activate(){return this.activation?this.activation:(this.setState({status:"activating"}),this.activation=(async()=>{try{let e=await this.fetchImpl(`${this.baseUrl}/api/ui/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:this.token})});if(!e.ok){let a=await Se(e),r=a&&a.error||`HTTP ${e.status}`;return this.setState({status:"rejected",reason:r}),this.state}let n=await e.json();return!n.activated||!n.config?(this.setState({status:"rejected",reason:"Activation refused"}),this.state):(this.session=n.session??null,this.setState({status:"active",config:n.config}),this.state)}catch(e){return this.setState({status:"rejected",reason:e instanceof Error?e.message:"Activation failed"}),this.state}})(),this.activation)}assertActive(){if(this.state.status!=="active")throw new M("Client is not activated",0,"NOT_ACTIVATED")}getSession(){return this.session}hasModule(e){if(this.state.status!=="active")return!1;let n=this.state.config.modules??[];return n.length===0||n.includes(e)}async renewSession(){return this.activation=null,(await this.activate()).status==="active"&&this.session!==null}withSession(e){if(!this.session)return e;let n=new Headers(e.headers??{});return n.has("Authorization")||n.set("Authorization",`Bearer ${this.session.token}`),{...e,headers:n}}async request(e,n={}){let a=`${this.baseUrl}${e.startsWith("/")?e:`/${e}`}`,r=()=>this.fetchImpl(a,this.withSession({credentials:"include",...n})),i=await r();return this.session&&(i.status===401||i.status===403)&&this.session.expiresAt*1e3<=Date.now()+5e3&&await this.renewSession()&&(i=await r()),i}fetchRaw(e,n={}){return this.assertActive(),this.request(e,n)}async getChat(e){this.assertActive();let n=await this.request(`/api/chat/${encodeURIComponent(e)}`),a=await Se(n);if(n.status===401&&a&&typeof a.authRequired=="string")return a;if(!n.ok)throw new M(a?.error||`HTTP ${n.status}`,n.status);return a}async*sendMessage(e,n,a){this.assertActive();let r=await this.request(`/api/chat/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:a});if(!r.ok){let s=await Se(r);throw r.status===401&&s&&typeof s.authRequired=="string"?new M("Authentication required",401,"AUTH_REQUIRED"):new M(s?.error||`HTTP ${r.status}`,r.status)}if(!(r.headers.get("content-type")??"").includes("text/event-stream")){yield{type:"final",data:await Se(r)},yield{type:"done"};return}yield*Qn(r.body)}};async function*Qn(t){let e=t.getReader(),n=new TextDecoder,a="";try{for(;;){let{done:i,value:s}=await e.read();if(i)break;a+=n.decode(s,{stream:!0});let d=a.indexOf(`
2
+
3
+ `);for(;d!==-1;){let c=a.slice(0,d);a=a.slice(d+2);let u=Jt(c);u&&(yield u),d=a.indexOf(`
4
+
5
+ `)}}let r=Jt(a);r&&(yield r)}finally{e.releaseLock()}yield{type:"done"}}function Jt(t){let e=t.split(`
6
+ `).find(r=>r.startsWith("data:"));if(!e)return null;let n=e.slice(5).trim();if(!n||n==="[DONE]")return null;let a;try{a=JSON.parse(n)}catch{return{type:"chunk",text:n}}return a.event==="error"?{type:"error",message:a.error||"Stream error"}:a.event==="final"?{type:"final",data:a.data}:typeof a.chunk=="string"?{type:"chunk",blockId:a.blockId,text:a.chunk}:null}async function Se(t){try{return await t.json()}catch{return null}}function Yn(){return typeof document<"u"&&(document.documentElement.lang?.toLowerCase()??"").startsWith("tr")||typeof navigator<"u"&&navigator.language?.toLowerCase().startsWith("tr")?"tr":"en"}var Gt=(t,e,n)=>`/api/resume/${encodeURIComponent(t)}/${encodeURIComponent(e)}${n?`/${encodeURIComponent(n)}`:""}`;async function Kt(t){let e=null;try{e=await t.json()}catch{}if(!t.ok){let n=e?.error;throw new M(n||`HTTP ${t.status}`,t.status,t.status===404?"NOT_FOUND":t.status===403?"FORBIDDEN":void 0)}return e}function Qt(t,e,n){return t.fetchRaw(Gt(e,n)).then(a=>Kt(a))}function Yt(t,e,n,a,r){return t.fetchRaw(Gt(e,n,a),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{input:{submission:r}}:{})}).then(i=>Kt(i))}function Pe(t){let e=t?.response?.data?.inputFormat;return Array.isArray(e)?e.map((n,a)=>{if(!n||typeof n!="object")return null;let r=n,i=typeof r.name=="string"?r.name.trim():"";if(!i)return null;let s=d=>typeof d=="string"&&d.trim()?d.trim():void 0;return{id:s(r.id)??`field_${a}`,name:i,label:s(r.label)??i,type:s(r.type)??"string",description:s(r.description),placeholder:s(r.placeholder),value:r.value,required:r.required===!0,options:Array.isArray(r.options)?r.options:void 0,rows:typeof r.rows=="number"?r.rows:void 0}}).filter(n=>n!==null):[]}function Zt(t){let e=t?.response?.data;if(!e||typeof e!="object")return{};let{inputFormat:n,resumeLinks:a,...r}=e;return r}function Zn(t,e){if(e==null)return"";switch(t.type){case"boolean":return typeof e=="boolean"?e?"true":"false":typeof e=="string"&&["true","false"].includes(e.trim().toLowerCase())?e.trim().toLowerCase():"";case"number":return typeof e=="number"?Number.isFinite(e)?String(e):"":String(e);case"array":case"object":case"files":if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return""}default:return typeof e=="string"?e:JSON.stringify(e)}}function Xn(t,e){let n=e.trim();switch(t.type){case"boolean":return{value:n==="true"};case"number":{let a=Number(n);return Number.isFinite(a)?{value:a}:{error:"number"}}case"array":case"object":case"files":try{return{value:JSON.parse(n)}}catch{return{error:"json"}}default:return{value:e}}}function We(t){return Object.fromEntries(t.map(e=>[e.name,Zn(e,e.value)]))}function Xt(t,e){let n={},a={};for(let r of t){let i=e[r.name]??"";if(!(r.type==="boolean"?i==="true"||i==="false":i.trim()!=="")){r.required&&(a[r.name]="required");continue}let{value:d,error:c}=Xn(r,i);c?a[r.name]=c:d!==void 0&&(n[r.name]=d)}return{submission:n,errors:a}}var ea=0;function o(t,e,n,a,r,i){e||(e={});var s,d,c=e;if("ref"in c)for(d in c={},e)d=="ref"?s=e[d]:c[d]=e[d];var u={type:t,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ea,__i:-1,__u:0,__source:r,__self:i};if(typeof t=="function"&&(s=t.defaultProps))for(d in s)c[d]===void 0&&(c[d]=s[d]);return b.vnode&&b.vnode(u),u}function B(...t){return t.filter(Boolean).join(" ")}var I=Ae(function({variant:e="outline",size:n="md",className:a,type:r="button",...i},s){return o("button",{ref:s,type:r,className:B("agi-btn",`agi-btn--${e}`,`agi-btn--${n}`,a),...i})});function Re({tone:t="default",className:e,...n}){return o("span",{className:B("agi-tag",t!=="default"&&`agi-tag--${t}`,e),...n})}function en({level:t=1,className:e,...n}){return o("div",{className:B("agi-panel",t===2&&"agi-panel--2",e),...n})}function tn({className:t,quiet:e,...n}){return o("p",{className:B("agi-eyebrow",e&&"agi-eyebrow--quiet",t),...n})}function ae({label:t,hint:e,error:n,className:a,children:r,...i}){return o("label",{className:B("agi-field",a),...i,children:[o("span",{className:"agi-field__label",children:t}),r,n?o("span",{className:"agi-field__error",children:n}):e&&o("span",{className:"agi-field__hint",children:e})]})}var Y=Ae(function({className:e,...n},a){return o("input",{ref:a,className:B("agi-input",e),...n})}),Je=Ae(function({className:e,...n},a){return o("textarea",{ref:a,className:B("agi-input","agi-textarea",e),...n})});function re({className:t,label:e}){return o("output",{className:B("agi-spinner",t),"aria-label":e,children:[o("span",{}),o("span",{}),o("span",{})]})}var ta={chat:{open:{tr:"Sohbeti a\xE7",en:"Open chat"},close:{tr:"Kapat",en:"Close"},placeholder:{tr:"Mesaj\u0131n\u0131z\u0131 yaz\u0131n\u2026",en:"Type your message\u2026"},send:{tr:"G\xF6nder",en:"Send"},stop:{tr:"Durdur",en:"Stop"},attach:{tr:"Dosya ekle",en:"Attach file"},attachments:{tr:"Ekler",en:"Attachments"},removeFile:{tr:"Dosyay\u0131 kald\u0131r",en:"Remove file"},tooManyFiles:{tr:"En fazla 5 dosya ekleyebilirsiniz.",en:"You can attach up to 5 files."},fileTooLarge:{tr:"Dosyalar 10 MB'tan k\xFC\xE7\xFCk olmal\u0131.",en:"Files must be smaller than 10 MB."},welcome:{tr:"Merhaba! Size nas\u0131l yard\u0131mc\u0131 olabilirim?",en:"Hi there! How can I help you today?"},thinking:{tr:"Yan\u0131t haz\u0131rlan\u0131yor",en:"Working on it"},stopped:{tr:"Yan\u0131t durduruldu.",en:"Response stopped."},error:{tr:"Bir sorun olu\u015Ftu. L\xFCtfen tekrar deneyin.",en:"Something went wrong. Please try again."},unavailable:{tr:"Bu sohbet \u015Fu anda kullan\u0131lam\u0131yor.",en:"This chat is currently unavailable."},poweredBy:{tr:"Aginies ile",en:"Powered by Aginies"},you:{tr:"Siz",en:"You"},assistant:{tr:"Ajan",en:"Agent"}},auth:{passwordTitle:{tr:"Bu sohbet parola korumal\u0131",en:"This chat is password protected"},passwordHint:{tr:"Devam etmek i\xE7in parolay\u0131 girin.",en:"Enter the password to continue."},password:{tr:"Parola",en:"Password"},emailTitle:{tr:"E-posta ile do\u011Frulama",en:"Verify with your e-mail"},emailHint:{tr:"\u0130\u015F e-postan\u0131z\u0131 girin; size bir kod g\xF6nderece\u011Fiz.",en:"Enter your work e-mail; we will send you a code."},email:{tr:"E-posta",en:"E-mail"},code:{tr:"Do\u011Frulama kodu",en:"Verification code"},codeHint:{tr:"E-postan\u0131za gelen 6 haneli kodu girin.",en:"Enter the 6-digit code from your e-mail."},continue:{tr:"Devam et",en:"Continue"},sendCode:{tr:"Kod g\xF6nder",en:"Send code"},verify:{tr:"Do\u011Frula",en:"Verify"},back:{tr:"Geri",en:"Back"},invalidPassword:{tr:"Parola yanl\u0131\u015F.",en:"Wrong password."},invalidEmail:{tr:"Bu e-posta adresi yetkili de\u011Fil.",en:"This e-mail address is not allowed."},invalidCode:{tr:"Kod ge\xE7ersiz veya s\xFCresi dolmu\u015F.",en:"The code is invalid or has expired."},codeSent:{tr:"Kod g\xF6nderildi.",en:"Code sent."},codeError:{tr:"Kod g\xF6nderilemedi. L\xFCtfen tekrar deneyin.",en:"The code could not be sent. Please try again."},resend:{tr:"Kodu yeniden g\xF6nder",en:"Resend code"},ssoTitle:{tr:"Kurumsal giri\u015F gerekli",en:"Sign in with your organisation"},ssoHint:{tr:"Bu sohbet kurumsal kimlikle a\xE7\u0131l\u0131r.",en:"This chat opens with your organisation account."},ssoButton:{tr:"Kurumsal giri\u015F",en:"Sign in"}},run:{submit:{tr:"\xC7al\u0131\u015Ft\u0131r",en:"Run"},cancel:{tr:"\u0130ptal",en:"Cancel"},running:{tr:"\xC7al\u0131\u015F\u0131yor",en:"Running"},done:{tr:"Tamamland\u0131",en:"Completed"},error:{tr:"Hata",en:"Error"},failed:{tr:"\xC7al\u0131\u015Ft\u0131rma ba\u015Far\u0131s\u0131z oldu.",en:"The run failed."},unauthorized:{tr:"API anahtar\u0131 reddedildi.",en:"The API key was rejected."},steps:{tr:"Ad\u0131mlar",en:"Steps"},execution:{tr:"\xE7al\u0131\u015Ft\u0131rma",en:"execution"}},approval:{eyebrow:{tr:"\u0130nsan onay\u0131",en:"Human approval"},title:{tr:"Onay bekleyen ad\u0131m",en:"A step is waiting for approval"},execution:{tr:"\xE7al\u0131\u015Ft\u0131rma",en:"execution"},pausedAt:{tr:"duraklat\u0131ld\u0131",en:"paused"},points:{tr:"Onay noktalar\u0131",en:"Approval points"},point:{tr:"Nokta",en:"Point"},output:{tr:"Ajan\u0131n \xF6nerisi",en:"What the agent proposes"},queuePosition:{tr:"S\u0131ra",en:"Queue position"},submit:{tr:"Onayla ve devam et",en:"Approve and continue"},submitting:{tr:"G\xF6nderiliyor",en:"Submitting"},refresh:{tr:"Yenile",en:"Refresh"},required:{tr:"Bu alan zorunlu.",en:"This field is required."},notANumber:{tr:"Say\u0131 girin.",en:"Enter a number."},notJson:{tr:"Ge\xE7erli JSON girin.",en:"Enter valid JSON."},notFound:{tr:"Bu onay bulunamad\u0131; s\xFCresi dolmu\u015F veya tamamlanm\u0131\u015F olabilir.",en:"This approval could not be found; it may have expired or been completed."},loadError:{tr:"Onay y\xFCklenemedi.",en:"The approval could not be loaded."},resumeError:{tr:"Devam ettirilemedi.",en:"The run could not be resumed."},resumedMessage:{tr:"Ajan kald\u0131\u011F\u0131 yerden devam ediyor.",en:"The agent is continuing from where it paused."},queuedMessage:{tr:"Onay s\u0131raya al\u0131nd\u0131; \xF6nceki devam i\u015Flemleri bitince \xE7al\u0131\u015Facak.",en:"The approval is queued; it runs after the earlier resumes finish."},paused:{tr:"Onay bekliyor",en:"Awaiting approval"},queued:{tr:"S\u0131rada",en:"Queued"},resuming:{tr:"Devam ediyor",en:"Resuming"},resumed:{tr:"Devam etti",en:"Resumed"},failed:{tr:"Ba\u015Far\u0131s\u0131z",en:"Failed"}},common:{loading:{tr:"Y\xFCkleniyor",en:"Loading"},retry:{tr:"Tekrar dene",en:"Retry"},notActivated:{tr:"Aginies UI paketi etkinle\u015Ftirilmedi.",en:"The Aginies UI package is not activated."}}};function nn(t){return function(n,a){let r=ta[n][a];return r[t]??r.en}}var Ne=null;function Ge(t){return Ne=new Ee(t),Ne.activate(),Ne}var an=ke(null);function ge(t){let{client:e}=L(),n=e.hasModule(t);return U(()=>{!n&&typeof console<"u"&&console.warn(`[aginies] the "${t}" module is not enabled for this activation key`)},[n,t]),n}function Te({client:t,locale:e,fallback:n=null,children:a}){let r=t??Ne,[i,s]=w(r?.getState()??{status:"rejected",reason:"init() was not called"});U(()=>{if(!r)return;s(r.getState());let c=r.subscribe(s);return r.activate(),c},[r]),U(()=>{i.status==="rejected"&&typeof console<"u"&&console.warn(`[aginies] UI kit not activated: ${i.reason}`)},[i]);let d=Q(()=>{if(!r)return null;let c=e??r.locale;return{client:r,state:i,locale:c,t:nn(c)}},[r,i,e]);return d?i.status==="idle"||i.status==="activating"?o(P,{children:n}):i.status==="rejected"?null:o(an.Provider,{value:d,children:a}):null}function L(){let t=$e(an);if(!t)throw new Error("[aginies] useAginies must be used inside <AginiesProvider> after init()");return t}function on(t,e,n){let{client:a,t:r}=L(),[i,s]=w("loading"),[d,c]=w(null),[u,g]=w(n??null),[f,l]=w({}),[p,_]=w({}),[v,x]=w(null),[y,m]=w(null),F=K(n??null),k=Q(()=>d?d.pausePoints.find(h=>h.contextId===u)??d.pausePoints.find(h=>h.resumeStatus==="paused")??d.pausePoints[0]??null:null,[d,u]),S=Q(()=>Pe(k),[k]),H=z(async()=>{s("loading"),x(null);try{let h=await Qt(a,t,e);c(h);let R=n??F.current,E=h.pausePoints.find(D=>D.contextId===R)??h.pausePoints.find(D=>D.resumeStatus==="paused")??h.pausePoints[0];E&&(F.current=E.contextId,g(E.contextId),l(We(Pe(E)))),_({}),s("ready")}catch(h){h instanceof M&&h.code==="NOT_FOUND"?s("not-found"):(x(h instanceof Error?h.message:r("approval","loadError")),s("error"))}},[a,t,e,n,r]);U(()=>{H()},[H]);let ee=z(h=>{F.current=h,g(h);let R=d?.pausePoints.find(E=>E.contextId===h);l(We(Pe(R))),_({})},[d]),W=z((h,R)=>{l(E=>({...E,[h]:R})),_(E=>{if(!(h in E))return E;let{[h]:D,...oe}=E;return oe})},[]),C=z(async()=>{if(!k||i==="submitting")return;let{submission:h,errors:R}=Xt(S,f);if(Object.keys(R).length>0){_(Object.fromEntries(Object.entries(R).map(([E,D])=>[E,D==="required"?r("approval","required"):D==="number"?r("approval","notANumber"):r("approval","notJson")])));return}s("submitting"),x(null);try{let E=await Yt(a,t,e,k.contextId,S.length>0?h:null);m(E),s(E.status==="queued"?"queued":"resumed")}catch(E){x(E instanceof Error?E.message:r("approval","resumeError")),s("ready")}},[a,t,e,k,S,f,i,r]);return{status:i,execution:d,pausePoint:k,fields:S,values:f,errors:p,error:v,outcome:y,select:ee,setValue:W,submit:C,reload:H}}var rn={paused:"warn",queued:"signal",resuming:"signal",resumed:"ok",failed:"bad"};function Ke({workflowId:t,executionId:e,contextId:n,title:a,description:r,submitLabel:i,onResumed:s,hideOutput:d=!1,className:c}){let{t:u,locale:g}=L(),f=ge("approval"),l=on(t,e,n),p=K(s);if(p.current=s,U(()=>{(l.status==="resumed"||l.status==="queued")&&l.outcome&&p.current?.(l.outcome)},[l.status,l.outcome]),!f)return null;let _=l.pausePoint,v=d?{}:Zt(_),x=Object.entries(v),y=_?.resumeStatus==="paused"&&l.status==="ready",m=k=>k?new Date(k).toLocaleString(g==="tr"?"tr-TR":"en-GB"):"",F=k=>{k.preventDefault(),l.submit()};return o(en,{className:B("agi-approval",c),"aria-busy":l.status==="loading",children:[o("header",{className:"agi-approval__head",children:[o(tn,{children:u("approval","eyebrow")}),o("h3",{className:"agi-approval__title",children:a??u("approval","title")}),r&&o("p",{className:"agi-approval__desc",children:r}),l.execution&&o("p",{className:"agi-approval__meta",children:[u("approval","execution")," ",o("span",{className:"agi-approval__meta-value",children:l.execution.executionId.slice(0,8)}),l.execution.pausedAt&&o(P,{children:[" \xB7 ",u("approval","pausedAt")," ",m(l.execution.pausedAt)]})]})]}),l.status==="loading"&&o("div",{className:"agi-approval__state",children:[o(re,{label:u("common","loading")})," ",u("common","loading")]}),l.status==="not-found"&&o("div",{className:"agi-approval__state",children:o("p",{children:u("approval","notFound")})}),l.status==="error"&&o("div",{className:"agi-approval__state",children:[o("p",{className:"agi-approval__error",children:l.error}),o(I,{variant:"outline",size:"sm",onClick:()=>{l.reload()},children:u("common","retry")})]}),l.execution&&l.execution.pausePoints.length>1&&o("nav",{className:"agi-approval__points","aria-label":u("approval","points"),children:l.execution.pausePoints.map((k,S)=>o("button",{type:"button",className:B("agi-approval__point",k.contextId===_?.contextId&&"is-selected"),onClick:()=>l.select(k.contextId),children:[o("span",{children:[u("approval","point")," ",S+1]}),o(Re,{tone:rn[k.resumeStatus]??"default",children:u("approval",k.resumeStatus)})]},k.contextId))}),_&&l.status!=="loading"&&o(P,{children:[o("div",{className:"agi-approval__status",children:[o(Re,{tone:rn[_.resumeStatus]??"default",children:u("approval",_.resumeStatus)}),typeof _.queuePosition=="number"&&_.queuePosition>0&&o("span",{className:"agi-approval__queue",children:[u("approval","queuePosition")," ",_.queuePosition]})]}),x.length>0&&o("section",{className:"agi-approval__output","aria-label":u("approval","output"),children:[o("div",{className:"agi-approval__output-label",children:u("approval","output")}),o("dl",{className:"agi-approval__kv",children:x.map(([k,S])=>o("div",{className:"agi-approval__kv-row",children:[o("dt",{children:k}),o("dd",{children:typeof S=="string"?S:JSON.stringify(S,null,2)})]},k))})]}),(l.status==="resumed"||l.status==="queued")&&l.outcome?o("output",{className:"agi-approval__done",children:[o(Re,{tone:l.status==="queued"?"signal":"ok",children:u("approval",l.status==="queued"?"queued":"resumed")}),o("p",{children:l.status==="queued"?u("approval","queuedMessage"):u("approval","resumedMessage")})]}):o("form",{className:"agi-approval__form",onSubmit:F,children:[l.fields.map(k=>o(ae,{label:k.label,hint:k.description,error:l.errors[k.name],children:na(k,l.values[k.name]??"",S=>l.setValue(k.name,S),!y)},k.id)),l.error&&o("p",{className:"agi-approval__error",children:l.error}),o("div",{className:"agi-approval__actions",children:[o(I,{variant:"signal",type:"submit",disabled:!y,children:l.status==="submitting"?o(P,{children:[o(re,{label:u("approval","submitting")})," ",u("approval","submitting")]}):i??u("approval","submit")}),o(I,{variant:"outline",type:"button",onClick:()=>{l.reload()},disabled:l.status==="submitting",children:u("approval","refresh")})]})]})]})]})}function na(t,e,n,a){switch(t.type){case"boolean":return o("select",{className:"agi-input",value:e,disabled:a,onChange:r=>n(r.target.value),children:[o("option",{value:"",children:"\u2014"}),o("option",{value:"true",children:"true"}),o("option",{value:"false",children:"false"})]});case"number":return o(Y,{type:"number",value:e,placeholder:t.placeholder,required:t.required,disabled:a,onChange:r=>n(r.target.value)});case"array":case"object":case"files":return o(Je,{value:e,rows:t.rows??4,placeholder:t.placeholder??"{ }",required:t.required,disabled:a,className:"agi-approval__json",onChange:r=>n(r.target.value)});default:return Array.isArray(t.options)&&t.options.length>0?o("select",{className:"agi-input",value:e,disabled:a,onChange:r=>n(r.target.value),children:[o("option",{value:"",children:"\u2014"}),t.options.map(r=>{let i=typeof r=="object"&&r!==null?r:{value:r,label:r},s=String(i.value??"");return o("option",{value:s,children:String(i.label??s)},s)})]}):(t.rows??1)>1?o(Je,{value:e,rows:t.rows,placeholder:t.placeholder,required:t.required,disabled:a,onChange:r=>n(r.target.value)}):o(Y,{value:e,placeholder:t.placeholder,required:t.required,disabled:a,onChange:r=>n(r.target.value)})}}function un({text:t,className:e}){return o("div",{className:e,children:cn(dn(t))})}var aa=/^\s*(`{3,}|~{3,})\s*([\w+-]*)\s*$/,ra=/^(#{1,6})\s+(.*?)\s*#*\s*$/,ia=/^\s*([-*_])(?:\s*\1){2,}\s*$/,Qe=/^\s*>\s?(.*)$/,Ye=/^\s*(?:([-*+])|(\d{1,9})[.)])\s+(.*)$/,oa=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;function dn(t){let e=t.replace(/\r\n?/g,`
7
+ `).split(`
8
+ `),n=[],a=0,r=[],i=()=>{r.length>0&&(n.push({kind:"paragraph",lines:r}),r=[])};for(;a<e.length;){let s=e[a];if(s.trim()===""){i(),a+=1;continue}let d=aa.exec(s);if(d){i();let g=d[1],f=d[2]??"",l=[];for(a+=1;a<e.length&&!e[a].trim().startsWith(g);)l.push(e[a]),a+=1;a+=1,n.push({kind:"code",lang:f,code:l.join(`
9
+ `)});continue}let c=ra.exec(s);if(c){i(),n.push({kind:"heading",level:c[1].length,text:c[2]??""}),a+=1;continue}if(ia.test(s)){i(),n.push({kind:"rule"}),a+=1;continue}if(Qe.test(s)){i();let g=[];for(;a<e.length&&Qe.test(e[a]);)g.push(Qe.exec(e[a])[1]??""),a+=1;n.push({kind:"quote",blocks:dn(g.join(`
10
+ `))});continue}let u=Ye.exec(s);if(u){i();let g=u[2]!==void 0,f=g?Number.parseInt(u[2],10):1,l=[];for(;a<e.length;){let p=Ye.exec(e[a]);if(p&&p[2]!==void 0===g)l.push(p[3]??""),a+=1;else if(l.length>0&&e[a].trim()!==""&&/^\s{2,}/.test(e[a])&&!Ye.test(e[a]))l[l.length-1]=`${l[l.length-1]} ${e[a].trim()}`,a+=1;else break}n.push({kind:"list",ordered:g,start:f,items:l});continue}if(s.includes("|")&&a+1<e.length&&oa.test(e[a+1])){i();let g=Ze(s),f=Ze(e[a+1]).map(p=>{let _=p.startsWith(":"),v=p.endsWith(":");return _&&v?"center":v?"right":_?"left":null}),l=[];for(a+=2;a<e.length&&e[a].includes("|");)l.push(Ze(e[a])),a+=1;n.push({kind:"table",header:g,align:f,rows:l});continue}r.push(s),a+=1}return i(),n}function Ze(t){return t.trim().replace(/^\|/,"").replace(/\|$/,"").split(/(?<!\\)\|/).map(n=>n.replace(/\\\|/g,"|").trim())}function cn(t){return t.map((e,n)=>{switch(e.kind){case"paragraph":return o("p",{children:e.lines.map((a,r)=>o(P,{children:[r>0&&o("br",{}),V(a)]},r))},n);case"heading":{let a=`h${Math.min(e.level+2,6)}`;return o(a,{children:V(e.text)},n)}case"code":return o("pre",{"data-lang":e.lang||void 0,children:o("code",{children:e.code})},n);case"quote":return o("blockquote",{children:cn(e.blocks)},n);case"list":{let a=e.items.map((r,i)=>o("li",{children:V(r)},i));return e.ordered?o("ol",{start:e.start===1?void 0:e.start,children:a},n):o("ul",{children:a},n)}case"table":return o("div",{className:"agi-md__table",children:o("table",{children:[o("thead",{children:o("tr",{children:e.header.map((a,r)=>o("th",{style:sn(e.align[r]),children:V(a)},r))})}),o("tbody",{children:e.rows.map((a,r)=>o("tr",{children:e.header.map((i,s)=>o("td",{style:sn(e.align[s]),children:V(a[s]??"")},s))},r))})]})},n);case"rule":return o("hr",{},n)}})}function sn(t){return t?{textAlign:t}:void 0}var sa=/(`+)([\s\S]*?)\1|\*\*([\s\S]+?)\*\*|(?<![\w`])__([\s\S]+?)__(?![\w])|~~([\s\S]+?)~~|\*([^*\n]+?)\*|(?<![\w`])_([^_\n]+?)_(?![\w])|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|(https?:\/\/[^\s<]*[^\s<.,;:!?)\]'"])/g;function V(t){let e=[],n=0,a=0,r=new RegExp(sa.source,"g"),i=r.exec(t);for(;i;){i.index>n&&e.push(t.slice(n,i.index));let[,,s,d,c,u,g,f,l,p,_]=i;s!==void 0?e.push(o("code",{children:s.trim()},a++)):d!==void 0||c!==void 0?e.push(o("strong",{children:V(d??c)},a++)):u!==void 0?e.push(o("del",{children:V(u)},a++)):g!==void 0||f!==void 0?e.push(o("em",{children:V(g??f)},a++)):l!==void 0&&p!==void 0?e.push(ln(a++,p,V(l))):_!==void 0&&e.push(ln(a++,_,_)),n=i.index+i[0].length,i=r.exec(t)}return n<t.length&&e.push(t.slice(n)),e}var la=/^(https?:\/\/|mailto:)/i;function ln(t,e,n){return la.test(e)?o("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n},t):o(P,{children:n},t)}var Z=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Xe=t=>Array.isArray(t)&&t.every(e=>typeof e=="string"),ua=t=>Array.isArray(t)&&t.every(e=>typeof e=="number");function da(t){return Z(t)&&typeof t.title=="string"&&typeof t.subtitle=="string"&&typeof t.body=="string"&&typeof t.image=="string"}function ca(t){if(!Z(t))return null;let e=t.text,n=t.buttons,a=t.table,r=t.pie,i=t.image,s=Array.isArray(t.cards)?t.cards:t.card?[t.card]:[];return!Z(e)||typeof e.content!="string"||!Array.isArray(n)||!n.every(d=>Z(d)&&typeof d.label=="string"&&typeof d.action=="string")||!Z(a)||!Xe(a.headers)||!Array.isArray(a.rows)||!a.rows.every(Xe)||!s.every(da)||!Z(r)||!Xe(r.labels)||!ua(r.data)||!Z(i)||typeof i.url!="string"||typeof i.caption!="string"?null:{text:{content:e.content},buttons:n,table:a,cards:s,pie:r,image:i}}function pn(t){let e;try{e=JSON.parse(t)}catch{return null}let n=Array.isArray(e)?e:Z(e)&&Array.isArray(e.items)?e.items:null;if(!n)return null;let a=n.map(ca);return a.some(r=>r===null)?null:{items:a}}function gn({response:t,onAction:e}){return o("div",{className:"agi-sui",children:t.items.map((n,a)=>o("div",{className:"agi-sui__item",children:[n.text.content&&o("p",{className:"agi-sui__text",children:n.text.content}),n.image.url&&o("figure",{className:"agi-sui__figure",children:[o("img",{src:n.image.url,alt:n.image.caption}),n.image.caption&&o("figcaption",{children:n.image.caption})]}),n.cards.length>0&&o("div",{className:"agi-sui__cards",children:n.cards.map((r,i)=>o("div",{className:"agi-panel agi-sui__card",children:[r.image&&o("img",{src:r.image,alt:""}),o("div",{children:[o("div",{className:"agi-sui__card-title",children:r.title}),r.subtitle&&o("div",{className:"agi-sui__card-sub",children:r.subtitle}),r.body&&o("p",{children:r.body})]})]},i))}),n.table.headers.length>0&&o("div",{className:"agi-sui__scroll",children:o("table",{className:"agi-table",children:[o("thead",{children:o("tr",{children:n.table.headers.map((r,i)=>o("th",{children:r},i))})}),o("tbody",{children:n.table.rows.map((r,i)=>o("tr",{children:r.map((s,d)=>o("td",{children:s},d))},i))})]})}),n.pie.labels.length>0&&o(pa,{labels:n.pie.labels,data:n.pie.data}),n.buttons.length>0&&o("div",{className:"agi-sui__actions",children:n.buttons.map((r,i)=>o("button",{type:"button",className:"agi-chip",onClick:()=>e?.(r.action),children:r.label},i))})]},a))})}function pa({labels:t,data:e}){let n=e.reduce((s,d)=>s+Math.max(0,d),0);if(n<=0)return null;let a=0,r=t.map((s,d)=>{let c=Math.max(0,e[d]??0),u=a;return a+=c/n*360,{label:s,value:c,start:u,end:a,color:`var(--data-${d%6+1})`}}),i=(s,d)=>{let f=(s-90)*Math.PI/180,l=(d-90)*Math.PI/180,p=d-s>180?1:0,_=50+48*Math.cos(f),v=50+48*Math.sin(f),x=50+48*Math.cos(l),y=50+48*Math.sin(l);return d-s>=360?`M50 2 A48 48 0 1 1 ${50-.01} 2 Z`:`M50 50 L${_} ${v} A48 48 0 ${p} 1 ${x} ${y} Z`};return o("div",{className:"agi-sui__pie",children:[o("svg",{viewBox:"0 0 100 100",role:"img","aria-label":t.join(", "),children:[o("title",{children:t.join(", ")}),r.map(s=>o("path",{d:i(s.start,s.end),fill:s.color},s.label))]}),o("ul",{children:r.map(s=>o("li",{children:[o("span",{style:{background:s.color}}),s.label,o("b",{children:[Math.round(s.value/n*100),"%"]})]},s.label))})]})}var tt={maxFiles:5,maxBytes:10*1024*1024};function fn(t,e=!0){let{client:n,t:a}=L(),[r,i]=w(null),[s,d]=w(null),[c,u]=w(),[g,f]=w(null),[l,p]=w([]),[_,v]=w(!1),[x]=w(()=>et()),y=K(null),m=z(async()=>{f(null);try{let C=await n.getChat(t);if("authRequired"in C){d(C.authRequired==="public"?null:C.authRequired),u(C.title);return}i(C),d(null)}catch(C){f(C instanceof M&&C.status===403?a("chat","unavailable"):a("chat","error"))}},[n,t,a]);U(()=>{e&&m()},[m,e]);let F=`/api/chat/${encodeURIComponent(t)}`,k=z(async({password:C})=>(await n.fetchRaw(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:C,conversationId:x})})).ok?(await m(),!0):!1,[n,F,x,m]),S=z(async C=>{let h=await n.fetchRaw(`${F}/otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:C})});return h.ok?"sent":h.status===403?"unauthorized":"error"},[n,F]),H=z(async(C,h)=>(await n.fetchRaw(`${F}/otp`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:C,otp:h})})).ok?(await m(),!0):!1,[n,F,m]),ee=z(()=>{y.current?.abort(),y.current=null,v(!1),p(C=>{let h=C[C.length-1];return!h||h.role!=="assistant"||!h.streaming?C:[...C.slice(0,-1),{...h,streaming:!1,content:h.content||a("chat","stopped")}]})},[a]),W=z(async(C,h=[])=>{let R=C.trim();if(!R&&h.length===0||_)return;let E={id:et(),role:"user",content:R,attachments:h.map(({name:T,type:J,size:le})=>({name:T,type:J,size:le}))},D=et();p(T=>[...T,E,{id:D,role:"assistant",content:"",streaming:!0}]),v(!0);let oe=new AbortController;y.current=oe;let te="",se=T=>p(J=>J.map(le=>le.id===D?{...le,...T}:le));try{for await(let T of n.sendMessage(t,{input:R,conversationId:x,files:h},oe.signal))if(T.type==="chunk")te+=T.text,se({content:te});else if(T.type==="final"){let J=ga(T.data);J&&!te&&(te=J,se({content:te}))}else T.type==="error"&&se({content:T.message,error:!0,streaming:!1});se({streaming:!1,structured:pn(te)})}catch(T){if(oe.signal.aborted)return;let J=T instanceof M&&T.code==="AUTH_REQUIRED"?a("chat","unavailable"):a("chat","error");se({content:J,error:!0,streaming:!1}),T instanceof M&&T.code==="AUTH_REQUIRED"&&m()}finally{y.current=null,v(!1)}},[_,n,t,x,a,m]);return{config:r,authNeed:s,authTitle:c,loadError:g,messages:l,busy:_,send:W,stop:ee,authenticate:k,requestCode:S,verifyCode:H,reload:m}}function ga(t){if(!t||typeof t!="object")return null;let e=t;if(!e.output)return null;for(let n of Object.values(e.output))if(n&&typeof n=="object"){let a=n;if(typeof a.content=="string")return a.content;if(typeof a.result=="string")return a.result}return null}function et(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function nt({identifier:t,mode:e="inline",position:n="right",launcherLabel:a,defaultOpen:r=!1,theme:i="auto",className:s}){let[d,c]=w(r||e!=="bubble"),{t:u}=L(),g=ge("chat"),f=fn(t,g),l=f.config?.title??f.authTitle??a??"Aginies",p=i==="auto"?void 0:i==="dark"?"dark":"light";if(!g)return null;let _=o("section",{className:B("agi-chat",`agi-chat--${e}`,p,s),"data-theme":p,"aria-label":l,children:[o("header",{className:"agi-chat__head",children:[o("div",{className:"agi-chat__title",children:[f.config?.customizations.imageUrl&&o("img",{src:f.config.customizations.imageUrl,alt:""}),o("div",{children:[o("div",{className:"agi-chat__name",children:l}),f.config?.description&&o("div",{className:"agi-chat__desc",children:f.config.description})]})]}),e==="bubble"&&o("button",{type:"button",className:"agi-chat__close",onClick:()=>c(!1),"aria-label":u("chat","close"),children:"\xD7"})]}),f.loadError?o("div",{className:"agi-chat__state",children:[o("p",{children:f.loadError}),o(I,{variant:"outline",size:"sm",onClick:()=>{f.reload()},children:u("common","retry")})]}):f.authNeed?o(ba,{need:f.authNeed,onPassword:f.authenticate,onRequestCode:f.requestCode,onVerifyCode:f.verifyCode}):f.config?o(P,{children:[o(fa,{messages:f.messages,welcome:f.config.customizations.welcomeMessage||u("chat","welcome"),onAction:v=>{f.send(v)}}),o(_a,{busy:f.busy,onSend:f.send,onStop:f.stop})]}):o("div",{className:"agi-chat__state",children:o(re,{label:u("common","loading")})}),o("footer",{className:"agi-chat__foot",children:o("a",{href:"https://www.aginies.com",target:"_blank",rel:"noreferrer",children:u("chat","poweredBy")})})]});return e!=="bubble"?_:o("div",{className:B("agi-bubble",`agi-bubble--${n}`,p),"data-theme":p,children:[d&&_,o("button",{type:"button",className:B("agi-bubble__launcher",d&&"agi-bubble__launcher--open"),onClick:()=>c(v=>!v),"aria-expanded":d,"aria-label":d?u("chat","close"):u("chat","open"),children:[o("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("path",{d:"M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-5 4v-4H6.5A2.5 2.5 0 0 1 4 13.5v-8z"}),o("path",{d:"M8 8h8M8 11.5h5"})]}),!d&&o("span",{children:a??l})]})]})}function fa({messages:t,welcome:e,onAction:n}){let{t:a}=L(),r=K(null);return U(()=>{r.current?.scrollIntoView?.({block:"end"})},[]),o("div",{className:"agi-chat__messages",role:"log","aria-live":"polite",children:[o("div",{className:"agi-msg agi-msg--assistant",children:[o("span",{className:"agi-msg__who",children:a("chat","assistant")}),o("div",{className:"agi-msg__body",children:e})]}),t.map(i=>o("div",{className:B("agi-msg",`agi-msg--${i.role}`,i.error&&"agi-msg--error"),children:[o("span",{className:"agi-msg__who",children:i.role==="user"?a("chat","you"):a("chat","assistant")}),o("div",{className:"agi-msg__body",children:[i.structured?o(gn,{response:i.structured,onAction:n}):i.content?i.role==="assistant"&&!i.error?o(un,{className:"agi-md",text:i.content}):o("p",{children:i.content}):i.streaming?o("span",{className:"agi-msg__thinking",children:[o(re,{label:a("chat","thinking")})," ",a("chat","thinking")]}):null,i.attachments&&i.attachments.length>0&&o("ul",{className:"agi-msg__files","aria-label":a("chat","attachments"),children:i.attachments.map((s,d)=>o("li",{className:"agi-file",children:[o(_n,{}),o("span",{className:"agi-file__name",children:s.name}),o("span",{className:"agi-file__size",children:ha(s.size)})]},d))})]})]},i.id)),o("div",{ref:r})]})}function _a({busy:t,onSend:e,onStop:n}){let{t:a}=L(),[r,i]=w(""),[s,d]=w([]),[c,u]=w(null),g=K(null),f=_=>{if(_.preventDefault(),t)return;let v=r,x=s;i(""),d([]),u(null),e(v,x)},l=async _=>{let v=Array.from(_.target.files??[]);if(_.target.value="",v.length===0)return;if(s.length+v.length>tt.maxFiles){u(a("chat","tooManyFiles"));return}if(v.some(y=>y.size>tt.maxBytes)){u(a("chat","fileTooLarge"));return}u(null);let x=await Promise.all(v.map(ma));d(y=>[...y,...x])},p=r.trim().length>0||s.length>0;return o("form",{className:"agi-chat__composer",onSubmit:f,children:[(s.length>0||c)&&o("div",{className:"agi-chat__pending",children:[s.map((_,v)=>o("span",{className:"agi-file agi-file--pending",children:[o(_n,{}),o("span",{className:"agi-file__name",children:_.name}),o("button",{type:"button",className:"agi-file__remove","aria-label":`${a("chat","removeFile")}: ${_.name}`,onClick:()=>d(x=>x.filter((y,m)=>m!==v)),children:"\xD7"})]},v)),c&&o("span",{className:"agi-chat__file-error",children:c})]}),o("div",{className:"agi-chat__row",children:[o("input",{ref:g,type:"file",multiple:!0,hidden:!0,onChange:l,"data-testid":"agi-file-input"}),o(I,{variant:"ghost",type:"button","aria-label":a("chat","attach"),title:a("chat","attach"),disabled:t,onClick:()=>g.current?.click(),children:o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o("path",{d:"M21 12.5 12.8 20.7a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.5 3.5 0 0 1 5 5l-8.6 8.6a1.5 1.5 0 0 1-2.1-2.1L15.5 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),o(Y,{value:r,onChange:_=>i(_.target.value),placeholder:a("chat","placeholder"),"aria-label":a("chat","placeholder"),autoComplete:"off"}),t?o(I,{variant:"outline",onClick:n,children:a("chat","stop")}):o(I,{variant:"signal",type:"submit",disabled:!p,children:a("chat","send")})]})]})}function ma(t){return new Promise((e,n)=>{let a=new FileReader;a.onload=()=>e({name:t.name,type:t.type||"application/octet-stream",size:t.size,data:String(a.result),lastModified:t.lastModified}),a.onerror=()=>n(a.error),a.readAsDataURL(t)})}function ha(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(0)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function _n(){return o("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5z",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"}),o("path",{d:"M14 3v5h5",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"})]})}function ba({need:t,onPassword:e,onRequestCode:n,onVerifyCode:a}){let{t:r,client:i}=L();return t==="sso"?o("div",{className:"agi-chat__state",children:[o("h3",{children:r("auth","ssoTitle")}),o("p",{children:r("auth","ssoHint")}),o(I,{variant:"signal",onClick:()=>window.open(`${i.baseUrl}/chat/`,"_blank","noopener"),children:r("auth","ssoButton")})]}):t==="email"?o(xa,{onRequestCode:n,onVerifyCode:a}):o(va,{onPassword:e})}function va({onPassword:t}){let{t:e}=L(),[n,a]=w(""),[r,i]=w(null),[s,d]=w(!1);return o("form",{className:"agi-chat__state agi-chat__auth",onSubmit:async u=>{u.preventDefault(),d(!0),i(null);let g=await t({password:n});d(!1),g||i(e("auth","invalidPassword"))},children:[o("h3",{children:e("auth","passwordTitle")}),o("p",{children:e("auth","passwordHint")}),o(ae,{label:e("auth","password"),error:r??void 0,children:o(Y,{type:"password",value:n,onChange:u=>a(u.target.value),required:!0,autoComplete:"current-password"})}),o(I,{variant:"signal",type:"submit",disabled:s||!n,children:e("auth","continue")})]})}function xa({onRequestCode:t,onVerifyCode:e}){let{t:n}=L(),[a,r]=w(""),[i,s]=w(""),[d,c]=w("email"),[u,g]=w(null),[f,l]=w(null),[p,_]=w(!1),v=async()=>{_(!0),g(null),l(null);let m=await t(a.trim());_(!1),m==="sent"?(c("code"),l(n("auth","codeSent"))):g(n("auth",m==="unauthorized"?"invalidEmail":"codeError"))},x=async()=>{_(!0),g(null),l(null);let m=await e(a.trim(),i.trim());_(!1),m||g(n("auth","invalidCode"))},y=m=>{m.preventDefault(),d==="email"?v():x()};return d==="code"?o("form",{className:"agi-chat__state agi-chat__auth",onSubmit:y,children:[o("h3",{children:n("auth","emailTitle")}),o("p",{children:[n("auth","codeHint")," ",o("strong",{children:a})]}),o(ae,{label:n("auth","code"),error:u??void 0,hint:f??void 0,children:o(Y,{inputMode:"numeric",autoComplete:"one-time-code",pattern:"[0-9]{6}",maxLength:6,value:i,onChange:m=>s(m.target.value.replace(/\D/g,"")),required:!0})}),o("div",{className:"agi-chat__auth-actions",children:[o(I,{variant:"signal",type:"submit",disabled:p||i.length!==6,children:n("auth","verify")}),o(I,{variant:"ghost",type:"button",disabled:p,onClick:()=>{v()},children:n("auth","resend")}),o(I,{variant:"ghost",type:"button",disabled:p,onClick:()=>{c("email"),s(""),g(null),l(null)},children:n("auth","back")})]})]}):o("form",{className:"agi-chat__state agi-chat__auth",onSubmit:y,children:[o("h3",{children:n("auth","emailTitle")}),o("p",{children:n("auth","emailHint")}),o(ae,{label:n("auth","email"),error:u??void 0,children:o(Y,{type:"email",value:a,onChange:m=>r(m.target.value),required:!0,autoComplete:"email"})}),o(I,{variant:"signal",type:"submit",disabled:p||!a.trim(),children:n("auth","sendCode")})]})}var mn=`/* @aginies/tokens v0.1.0 \u2014 generated from src/tokens.ts. Do not edit by hand. */
11
+
12
+ /* Static tokens: type, shape, spacing, motion, layout. */
13
+ :root {
14
+ --font-display: 'Bricolage Grotesque Variable', 'Instrument Sans Variable', ui-sans-serif, system-ui, sans-serif;
15
+ --font-body: 'Instrument Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
16
+ --font-mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
17
+ --radius-sm: 4px;
18
+ --radius-md: 6px;
19
+ --radius-lg: 10px;
20
+ --radius-xl: 14px;
21
+ --radius-2xl: 20px;
22
+ --radius-full: 9999px;
23
+ --radius: var(--radius-lg);
24
+ --space-1: 4px;
25
+ --space-2: 8px;
26
+ --space-3: 12px;
27
+ --space-4: 16px;
28
+ --space-5: 24px;
29
+ --space-6: 32px;
30
+ --space-7: 48px;
31
+ --space-8: 64px;
32
+ --fs-display: clamp(40px, 6.4vw, 88px);
33
+ --lh-display: 0.96;
34
+ --ls-display: -0.04em;
35
+ --fs-h1: clamp(36px, 5.2vw, 68px);
36
+ --lh-h1: 1;
37
+ --ls-h1: -0.035em;
38
+ --fs-h2: clamp(28px, 3.8vw, 50px);
39
+ --lh-h2: 1.04;
40
+ --ls-h2: -0.03em;
41
+ --fs-h3: clamp(20px, 2vw, 26px);
42
+ --lh-h3: 1.2;
43
+ --ls-h3: -0.02em;
44
+ --fs-h4: 17px;
45
+ --lh-h4: 1.3;
46
+ --ls-h4: -0.01em;
47
+ --fs-stat: clamp(30px, 3.4vw, 44px);
48
+ --lh-stat: 1;
49
+ --ls-stat: -0.03em;
50
+ --fs-lede: clamp(17px, 1.4vw, 20px);
51
+ --lh-lede: 1.5;
52
+ --fs-body: 16px;
53
+ --lh-body: 1.55;
54
+ --fs-body-2: 15px;
55
+ --lh-body-2: 1.5;
56
+ --fs-small: 13.5px;
57
+ --lh-small: 1.45;
58
+ --fs-eyebrow: 11.5px;
59
+ --lh-eyebrow: 1;
60
+ --ls-eyebrow: 0.14em;
61
+ --fs-label: 11px;
62
+ --lh-label: 1;
63
+ --ls-label: 0.1em;
64
+ --fs-tag: 11.5px;
65
+ --lh-tag: 1;
66
+ --ls-tag: 0.04em;
67
+ --fs-ui: 13px;
68
+ --lh-ui: 1.4;
69
+ --fs-ui-sm: 12px;
70
+ --lh-ui-sm: 1.35;
71
+ --fs-ui-xs: 11px;
72
+ --lh-ui-xs: 1.3;
73
+ --duration-fast: 150ms;
74
+ --duration-base: 200ms;
75
+ --duration-slow: 300ms;
76
+ --duration-enter: 600ms;
77
+ --ease-enter: cubic-bezier(0.2, 0.7, 0.2, 1);
78
+ --max: 1200px;
79
+ --gutter: clamp(20px, 4vw, 40px);
80
+ --section-y: clamp(64px, 9vw, 128px);
81
+ --section-y-tight: clamp(40px, 6vw, 80px);
82
+ --bp-sm: 640px;
83
+ --bp-md: 768px;
84
+ --bp-lg: 1024px;
85
+ --bp-xl: 1280px;
86
+ --bp-2xl: 1536px;
87
+ --bp-nav: 1180px;
88
+ --bp-wide: 1340px;
89
+ --z-base: 0;
90
+ --z-raised: 10;
91
+ --z-sticky: 50;
92
+ --z-dropdown: 100;
93
+ --z-modal: 200;
94
+ --z-toast: 300;
95
+ --focus-ring: 2px solid var(--signal);
96
+ --focus-ring-offset: 3px;
97
+ --focus-field-ring: 0 0 0 3px var(--signal-soft);
98
+ --neutral-50: #F4F6FA;
99
+ --neutral-50-rgb: 244 246 250;
100
+ --neutral-100: #EEF1F7;
101
+ --neutral-100-rgb: 238 241 247;
102
+ --neutral-200: #DCE1EC;
103
+ --neutral-200-rgb: 220 225 236;
104
+ --neutral-300: #C5CCDB;
105
+ --neutral-300-rgb: 197 204 219;
106
+ --neutral-400: #A9B2CC;
107
+ --neutral-400-rgb: 169 178 204;
108
+ --neutral-500: #7F8AA8;
109
+ --neutral-500-rgb: 127 138 168;
110
+ --neutral-600: #6B7590;
111
+ --neutral-600-rgb: 107 117 144;
112
+ --neutral-700: #3C4560;
113
+ --neutral-700-rgb: 60 69 96;
114
+ --neutral-800: #2A3350;
115
+ --neutral-800-rgb: 42 51 80;
116
+ --neutral-900: #1B2238;
117
+ --neutral-900-rgb: 27 34 56;
118
+ --neutral-950: #0B1020;
119
+ --neutral-950-rgb: 11 16 32;
120
+ }
121
+
122
+
123
+ /* Dark is the default theme. */
124
+ :root {
125
+ --bg: #070A14;
126
+ --bg-rgb: 7 10 20;
127
+ --bg-2: #0B1020;
128
+ --bg-2-rgb: 11 16 32;
129
+ --panel: #0E1426;
130
+ --panel-rgb: 14 20 38;
131
+ --panel-2: #121A30;
132
+ --panel-2-rgb: 18 26 48;
133
+ --panel-3: #182240;
134
+ --panel-3-rgb: 24 34 64;
135
+ --line: #1B2238;
136
+ --line-rgb: 27 34 56;
137
+ --line-2: #2A3350;
138
+ --line-2-rgb: 42 51 80;
139
+ --line-3: #3C4560;
140
+ --line-3-rgb: 60 69 96;
141
+ --text: #E7ECF7;
142
+ --text-rgb: 231 236 247;
143
+ --text-2: #A9B2CC;
144
+ --text-2-rgb: 169 178 204;
145
+ --mute: #7F8AA8;
146
+ --mute-rgb: 127 138 168;
147
+ --signal: #5FC8FF;
148
+ --signal-rgb: 95 200 255;
149
+ --signal-2: #01B1F7;
150
+ --signal-2-rgb: 1 177 247;
151
+ --signal-ink: #06111F;
152
+ --signal-ink-rgb: 6 17 31;
153
+ --signal-soft: rgba(95, 200, 255, 0.12);
154
+ --ok: #4FD1A0;
155
+ --ok-rgb: 79 209 160;
156
+ --ok-ink: #06111F;
157
+ --ok-ink-rgb: 6 17 31;
158
+ --ok-soft: rgba(79, 209, 160, 0.14);
159
+ --warn: #F2B35B;
160
+ --warn-rgb: 242 179 91;
161
+ --warn-ink: #06111F;
162
+ --warn-ink-rgb: 6 17 31;
163
+ --warn-soft: rgba(242, 179, 91, 0.14);
164
+ --bad: #FF7A7A;
165
+ --bad-rgb: 255 122 122;
166
+ --bad-ink: #06111F;
167
+ --bad-ink-rgb: 6 17 31;
168
+ --bad-soft: rgba(255, 122, 122, 0.14);
169
+ --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
170
+ --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
171
+ --overlay: rgba(7, 10, 20, 0.6);
172
+ --signal-50: 235 247 255;
173
+ --signal-100: 211 238 255;
174
+ --signal-200: 173 222 251;
175
+ --signal-300: 122 199 241;
176
+ --signal-400: 75 175 226;
177
+ --signal-500: 33 150 202;
178
+ --signal-600: 8 125 172;
179
+ --signal-700: 1 100 139;
180
+ --signal-800: 2 77 107;
181
+ --signal-900: 0 54 78;
182
+ --signal-950: 0 36 53;
183
+ --ok-50: 231 251 241;
184
+ --ok-100: 208 243 226;
185
+ --ok-200: 171 229 202;
186
+ --ok-300: 118 210 171;
187
+ --ok-400: 65 188 142;
188
+ --ok-500: 16 163 118;
189
+ --ok-600: 0 136 97;
190
+ --ok-700: 5 109 78;
191
+ --ok-800: 5 84 59;
192
+ --ok-900: 1 60 41;
193
+ --ok-950: 1 40 26;
194
+ --warn-50: 255 243 229;
195
+ --warn-100: 251 230 204;
196
+ --warn-200: 241 208 166;
197
+ --warn-300: 227 178 114;
198
+ --warn-400: 208 150 67;
199
+ --warn-500: 185 125 25;
200
+ --warn-600: 156 102 1;
201
+ --warn-700: 125 82 5;
202
+ --warn-800: 97 62 0;
203
+ --warn-900: 69 43 1;
204
+ --warn-950: 47 28 0;
205
+ --bad-50: 255 242 241;
206
+ --bad-100: 255 226 224;
207
+ --bad-200: 255 197 194;
208
+ --bad-300: 254 158 155;
209
+ --bad-400: 244 119 119;
210
+ --bad-500: 220 90 93;
211
+ --bad-600: 188 69 72;
212
+ --bad-700: 155 51 55;
213
+ --bad-800: 120 38 41;
214
+ --bad-900: 86 26 28;
215
+ --bad-950: 60 14 16;
216
+ --data-1: var(--signal);
217
+ --data-2: var(--ok);
218
+ --data-3: var(--warn);
219
+ --data-4: var(--bad);
220
+ --data-5: var(--text-2);
221
+ --data-6: var(--mute);
222
+ --canvas-bg: var(--bg);
223
+ --canvas-grid: var(--line);
224
+ --canvas-node: var(--panel);
225
+ --canvas-node-line: var(--line-2);
226
+ --edge: var(--line-2);
227
+ --edge-hover: var(--text-2);
228
+ --edge-active: var(--signal);
229
+ --execution: var(--ok);
230
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%235FC8FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
231
+ color-scheme: dark;
232
+ }
233
+
234
+ .dark, [data-theme="dark"] {
235
+ --bg: #070A14;
236
+ --bg-rgb: 7 10 20;
237
+ --bg-2: #0B1020;
238
+ --bg-2-rgb: 11 16 32;
239
+ --panel: #0E1426;
240
+ --panel-rgb: 14 20 38;
241
+ --panel-2: #121A30;
242
+ --panel-2-rgb: 18 26 48;
243
+ --panel-3: #182240;
244
+ --panel-3-rgb: 24 34 64;
245
+ --line: #1B2238;
246
+ --line-rgb: 27 34 56;
247
+ --line-2: #2A3350;
248
+ --line-2-rgb: 42 51 80;
249
+ --line-3: #3C4560;
250
+ --line-3-rgb: 60 69 96;
251
+ --text: #E7ECF7;
252
+ --text-rgb: 231 236 247;
253
+ --text-2: #A9B2CC;
254
+ --text-2-rgb: 169 178 204;
255
+ --mute: #7F8AA8;
256
+ --mute-rgb: 127 138 168;
257
+ --signal: #5FC8FF;
258
+ --signal-rgb: 95 200 255;
259
+ --signal-2: #01B1F7;
260
+ --signal-2-rgb: 1 177 247;
261
+ --signal-ink: #06111F;
262
+ --signal-ink-rgb: 6 17 31;
263
+ --signal-soft: rgba(95, 200, 255, 0.12);
264
+ --ok: #4FD1A0;
265
+ --ok-rgb: 79 209 160;
266
+ --ok-ink: #06111F;
267
+ --ok-ink-rgb: 6 17 31;
268
+ --ok-soft: rgba(79, 209, 160, 0.14);
269
+ --warn: #F2B35B;
270
+ --warn-rgb: 242 179 91;
271
+ --warn-ink: #06111F;
272
+ --warn-ink-rgb: 6 17 31;
273
+ --warn-soft: rgba(242, 179, 91, 0.14);
274
+ --bad: #FF7A7A;
275
+ --bad-rgb: 255 122 122;
276
+ --bad-ink: #06111F;
277
+ --bad-ink-rgb: 6 17 31;
278
+ --bad-soft: rgba(255, 122, 122, 0.14);
279
+ --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
280
+ --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
281
+ --overlay: rgba(7, 10, 20, 0.6);
282
+ --signal-50: 235 247 255;
283
+ --signal-100: 211 238 255;
284
+ --signal-200: 173 222 251;
285
+ --signal-300: 122 199 241;
286
+ --signal-400: 75 175 226;
287
+ --signal-500: 33 150 202;
288
+ --signal-600: 8 125 172;
289
+ --signal-700: 1 100 139;
290
+ --signal-800: 2 77 107;
291
+ --signal-900: 0 54 78;
292
+ --signal-950: 0 36 53;
293
+ --ok-50: 231 251 241;
294
+ --ok-100: 208 243 226;
295
+ --ok-200: 171 229 202;
296
+ --ok-300: 118 210 171;
297
+ --ok-400: 65 188 142;
298
+ --ok-500: 16 163 118;
299
+ --ok-600: 0 136 97;
300
+ --ok-700: 5 109 78;
301
+ --ok-800: 5 84 59;
302
+ --ok-900: 1 60 41;
303
+ --ok-950: 1 40 26;
304
+ --warn-50: 255 243 229;
305
+ --warn-100: 251 230 204;
306
+ --warn-200: 241 208 166;
307
+ --warn-300: 227 178 114;
308
+ --warn-400: 208 150 67;
309
+ --warn-500: 185 125 25;
310
+ --warn-600: 156 102 1;
311
+ --warn-700: 125 82 5;
312
+ --warn-800: 97 62 0;
313
+ --warn-900: 69 43 1;
314
+ --warn-950: 47 28 0;
315
+ --bad-50: 255 242 241;
316
+ --bad-100: 255 226 224;
317
+ --bad-200: 255 197 194;
318
+ --bad-300: 254 158 155;
319
+ --bad-400: 244 119 119;
320
+ --bad-500: 220 90 93;
321
+ --bad-600: 188 69 72;
322
+ --bad-700: 155 51 55;
323
+ --bad-800: 120 38 41;
324
+ --bad-900: 86 26 28;
325
+ --bad-950: 60 14 16;
326
+ --data-1: var(--signal);
327
+ --data-2: var(--ok);
328
+ --data-3: var(--warn);
329
+ --data-4: var(--bad);
330
+ --data-5: var(--text-2);
331
+ --data-6: var(--mute);
332
+ --canvas-bg: var(--bg);
333
+ --canvas-grid: var(--line);
334
+ --canvas-node: var(--panel);
335
+ --canvas-node-line: var(--line-2);
336
+ --edge: var(--line-2);
337
+ --edge-hover: var(--text-2);
338
+ --edge-active: var(--signal);
339
+ --execution: var(--ok);
340
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%235FC8FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
341
+ color-scheme: dark;
342
+ }
343
+
344
+ .light, [data-theme="light"] {
345
+ --bg: #F4F6FA;
346
+ --bg-rgb: 244 246 250;
347
+ --bg-2: #FFFFFF;
348
+ --bg-2-rgb: 255 255 255;
349
+ --panel: #FFFFFF;
350
+ --panel-rgb: 255 255 255;
351
+ --panel-2: #EEF1F7;
352
+ --panel-2-rgb: 238 241 247;
353
+ --panel-3: #E4E9F2;
354
+ --panel-3-rgb: 228 233 242;
355
+ --line: #DCE1EC;
356
+ --line-rgb: 220 225 236;
357
+ --line-2: #C5CCDB;
358
+ --line-2-rgb: 197 204 219;
359
+ --line-3: #A9B2CC;
360
+ --line-3-rgb: 169 178 204;
361
+ --text: #0B1220;
362
+ --text-rgb: 11 18 32;
363
+ --text-2: #3C4560;
364
+ --text-2-rgb: 60 69 96;
365
+ --mute: #6B7590;
366
+ --mute-rgb: 107 117 144;
367
+ --signal: #0077C2;
368
+ --signal-rgb: 0 119 194;
369
+ --signal-2: #005E9A;
370
+ --signal-2-rgb: 0 94 154;
371
+ --signal-ink: #FFFFFF;
372
+ --signal-ink-rgb: 255 255 255;
373
+ --signal-soft: rgba(0, 119, 194, 0.10);
374
+ --ok: #0B7F57;
375
+ --ok-rgb: 11 127 87;
376
+ --ok-ink: #FFFFFF;
377
+ --ok-ink-rgb: 255 255 255;
378
+ --ok-soft: rgba(11, 127, 87, 0.12);
379
+ --warn: #9C5A12;
380
+ --warn-rgb: 156 90 18;
381
+ --warn-ink: #FFFFFF;
382
+ --warn-ink-rgb: 255 255 255;
383
+ --warn-soft: rgba(156, 90, 18, 0.12);
384
+ --bad: #B3261E;
385
+ --bad-rgb: 179 38 30;
386
+ --bad-ink: #FFFFFF;
387
+ --bad-ink-rgb: 255 255 255;
388
+ --bad-soft: rgba(179, 38, 30, 0.10);
389
+ --shadow: 0 20px 50px rgba(11, 18, 32, 0.10);
390
+ --shadow-sm: 0 8px 20px rgba(11, 18, 32, 0.08);
391
+ --overlay: rgba(11, 18, 32, 0.45);
392
+ --signal-50: 238 246 255;
393
+ --signal-100: 217 236 255;
394
+ --signal-200: 181 219 254;
395
+ --signal-300: 130 195 253;
396
+ --signal-400: 82 170 244;
397
+ --signal-500: 46 144 221;
398
+ --signal-600: 21 120 191;
399
+ --signal-700: 3 96 157;
400
+ --signal-800: 3 73 121;
401
+ --signal-900: 3 52 87;
402
+ --signal-950: 1 34 61;
403
+ --ok-50: 234 250 241;
404
+ --ok-100: 213 242 226;
405
+ --ok-200: 180 227 202;
406
+ --ok-300: 135 206 171;
407
+ --ok-400: 94 184 143;
408
+ --ok-500: 60 160 118;
409
+ --ok-600: 38 134 96;
410
+ --ok-700: 22 109 75;
411
+ --ok-800: 16 83 57;
412
+ --ok-900: 10 59 40;
413
+ --ok-950: 2 40 25;
414
+ --warn-50: 255 243 233;
415
+ --warn-100: 253 228 209;
416
+ --warn-200: 244 205 174;
417
+ --warn-300: 231 175 127;
418
+ --warn-400: 213 146 87;
419
+ --warn-500: 189 120 56;
420
+ --warn-600: 161 98 36;
421
+ --warn-700: 132 77 22;
422
+ --warn-800: 101 59 15;
423
+ --warn-900: 73 41 9;
424
+ --warn-950: 50 26 3;
425
+ --bad-50: 255 242 240;
426
+ --bad-100: 254 226 221;
427
+ --bad-200: 255 198 189;
428
+ --bad-300: 254 159 145;
429
+ --bad-400: 251 115 99;
430
+ --bad-500: 226 85 71;
431
+ --bad-600: 194 63 52;
432
+ --bad-700: 160 46 37;
433
+ --bad-800: 124 34 27;
434
+ --bad-900: 89 23 17;
435
+ --bad-950: 63 11 8;
436
+ --data-1: var(--signal);
437
+ --data-2: var(--ok);
438
+ --data-3: var(--warn);
439
+ --data-4: var(--bad);
440
+ --data-5: var(--text-2);
441
+ --data-6: var(--mute);
442
+ --canvas-bg: var(--bg);
443
+ --canvas-grid: var(--line);
444
+ --canvas-node: var(--panel);
445
+ --canvas-node-line: var(--line-2);
446
+ --edge: var(--line-2);
447
+ --edge-hover: var(--text-2);
448
+ --edge-active: var(--signal);
449
+ --execution: var(--ok);
450
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230077C2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
451
+ color-scheme: light;
452
+ }
453
+
454
+ @media (prefers-color-scheme: light) {
455
+ :root:not(.dark):not([data-theme="dark"]) {
456
+ --bg: #F4F6FA;
457
+ --bg-rgb: 244 246 250;
458
+ --bg-2: #FFFFFF;
459
+ --bg-2-rgb: 255 255 255;
460
+ --panel: #FFFFFF;
461
+ --panel-rgb: 255 255 255;
462
+ --panel-2: #EEF1F7;
463
+ --panel-2-rgb: 238 241 247;
464
+ --panel-3: #E4E9F2;
465
+ --panel-3-rgb: 228 233 242;
466
+ --line: #DCE1EC;
467
+ --line-rgb: 220 225 236;
468
+ --line-2: #C5CCDB;
469
+ --line-2-rgb: 197 204 219;
470
+ --line-3: #A9B2CC;
471
+ --line-3-rgb: 169 178 204;
472
+ --text: #0B1220;
473
+ --text-rgb: 11 18 32;
474
+ --text-2: #3C4560;
475
+ --text-2-rgb: 60 69 96;
476
+ --mute: #6B7590;
477
+ --mute-rgb: 107 117 144;
478
+ --signal: #0077C2;
479
+ --signal-rgb: 0 119 194;
480
+ --signal-2: #005E9A;
481
+ --signal-2-rgb: 0 94 154;
482
+ --signal-ink: #FFFFFF;
483
+ --signal-ink-rgb: 255 255 255;
484
+ --signal-soft: rgba(0, 119, 194, 0.10);
485
+ --ok: #0B7F57;
486
+ --ok-rgb: 11 127 87;
487
+ --ok-ink: #FFFFFF;
488
+ --ok-ink-rgb: 255 255 255;
489
+ --ok-soft: rgba(11, 127, 87, 0.12);
490
+ --warn: #9C5A12;
491
+ --warn-rgb: 156 90 18;
492
+ --warn-ink: #FFFFFF;
493
+ --warn-ink-rgb: 255 255 255;
494
+ --warn-soft: rgba(156, 90, 18, 0.12);
495
+ --bad: #B3261E;
496
+ --bad-rgb: 179 38 30;
497
+ --bad-ink: #FFFFFF;
498
+ --bad-ink-rgb: 255 255 255;
499
+ --bad-soft: rgba(179, 38, 30, 0.10);
500
+ --shadow: 0 20px 50px rgba(11, 18, 32, 0.10);
501
+ --shadow-sm: 0 8px 20px rgba(11, 18, 32, 0.08);
502
+ --overlay: rgba(11, 18, 32, 0.45);
503
+ --signal-50: 238 246 255;
504
+ --signal-100: 217 236 255;
505
+ --signal-200: 181 219 254;
506
+ --signal-300: 130 195 253;
507
+ --signal-400: 82 170 244;
508
+ --signal-500: 46 144 221;
509
+ --signal-600: 21 120 191;
510
+ --signal-700: 3 96 157;
511
+ --signal-800: 3 73 121;
512
+ --signal-900: 3 52 87;
513
+ --signal-950: 1 34 61;
514
+ --ok-50: 234 250 241;
515
+ --ok-100: 213 242 226;
516
+ --ok-200: 180 227 202;
517
+ --ok-300: 135 206 171;
518
+ --ok-400: 94 184 143;
519
+ --ok-500: 60 160 118;
520
+ --ok-600: 38 134 96;
521
+ --ok-700: 22 109 75;
522
+ --ok-800: 16 83 57;
523
+ --ok-900: 10 59 40;
524
+ --ok-950: 2 40 25;
525
+ --warn-50: 255 243 233;
526
+ --warn-100: 253 228 209;
527
+ --warn-200: 244 205 174;
528
+ --warn-300: 231 175 127;
529
+ --warn-400: 213 146 87;
530
+ --warn-500: 189 120 56;
531
+ --warn-600: 161 98 36;
532
+ --warn-700: 132 77 22;
533
+ --warn-800: 101 59 15;
534
+ --warn-900: 73 41 9;
535
+ --warn-950: 50 26 3;
536
+ --bad-50: 255 242 240;
537
+ --bad-100: 254 226 221;
538
+ --bad-200: 255 198 189;
539
+ --bad-300: 254 159 145;
540
+ --bad-400: 251 115 99;
541
+ --bad-500: 226 85 71;
542
+ --bad-600: 194 63 52;
543
+ --bad-700: 160 46 37;
544
+ --bad-800: 124 34 27;
545
+ --bad-900: 89 23 17;
546
+ --bad-950: 63 11 8;
547
+ --data-1: var(--signal);
548
+ --data-2: var(--ok);
549
+ --data-3: var(--warn);
550
+ --data-4: var(--bad);
551
+ --data-5: var(--text-2);
552
+ --data-6: var(--mute);
553
+ --canvas-bg: var(--bg);
554
+ --canvas-grid: var(--line);
555
+ --canvas-node: var(--panel);
556
+ --canvas-node-line: var(--line-2);
557
+ --edge: var(--line-2);
558
+ --edge-hover: var(--text-2);
559
+ --edge-active: var(--signal);
560
+ --execution: var(--ok);
561
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230077C2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
562
+ color-scheme: light;
563
+ }
564
+
565
+ }
566
+
567
+ /* A .room section always carries the palette opposite to its ambient theme. */
568
+ :root .room, .dark .room, [data-theme="dark"] .room {
569
+ --bg: #F4F6FA;
570
+ --bg-rgb: 244 246 250;
571
+ --bg-2: #FFFFFF;
572
+ --bg-2-rgb: 255 255 255;
573
+ --panel: #FFFFFF;
574
+ --panel-rgb: 255 255 255;
575
+ --panel-2: #EEF1F7;
576
+ --panel-2-rgb: 238 241 247;
577
+ --panel-3: #E4E9F2;
578
+ --panel-3-rgb: 228 233 242;
579
+ --line: #DCE1EC;
580
+ --line-rgb: 220 225 236;
581
+ --line-2: #C5CCDB;
582
+ --line-2-rgb: 197 204 219;
583
+ --line-3: #A9B2CC;
584
+ --line-3-rgb: 169 178 204;
585
+ --text: #0B1220;
586
+ --text-rgb: 11 18 32;
587
+ --text-2: #3C4560;
588
+ --text-2-rgb: 60 69 96;
589
+ --mute: #6B7590;
590
+ --mute-rgb: 107 117 144;
591
+ --signal: #0077C2;
592
+ --signal-rgb: 0 119 194;
593
+ --signal-2: #005E9A;
594
+ --signal-2-rgb: 0 94 154;
595
+ --signal-ink: #FFFFFF;
596
+ --signal-ink-rgb: 255 255 255;
597
+ --signal-soft: rgba(0, 119, 194, 0.10);
598
+ --ok: #0B7F57;
599
+ --ok-rgb: 11 127 87;
600
+ --ok-ink: #FFFFFF;
601
+ --ok-ink-rgb: 255 255 255;
602
+ --ok-soft: rgba(11, 127, 87, 0.12);
603
+ --warn: #9C5A12;
604
+ --warn-rgb: 156 90 18;
605
+ --warn-ink: #FFFFFF;
606
+ --warn-ink-rgb: 255 255 255;
607
+ --warn-soft: rgba(156, 90, 18, 0.12);
608
+ --bad: #B3261E;
609
+ --bad-rgb: 179 38 30;
610
+ --bad-ink: #FFFFFF;
611
+ --bad-ink-rgb: 255 255 255;
612
+ --bad-soft: rgba(179, 38, 30, 0.10);
613
+ --shadow: 0 20px 50px rgba(11, 18, 32, 0.10);
614
+ --shadow-sm: 0 8px 20px rgba(11, 18, 32, 0.08);
615
+ --overlay: rgba(11, 18, 32, 0.45);
616
+ --signal-50: 238 246 255;
617
+ --signal-100: 217 236 255;
618
+ --signal-200: 181 219 254;
619
+ --signal-300: 130 195 253;
620
+ --signal-400: 82 170 244;
621
+ --signal-500: 46 144 221;
622
+ --signal-600: 21 120 191;
623
+ --signal-700: 3 96 157;
624
+ --signal-800: 3 73 121;
625
+ --signal-900: 3 52 87;
626
+ --signal-950: 1 34 61;
627
+ --ok-50: 234 250 241;
628
+ --ok-100: 213 242 226;
629
+ --ok-200: 180 227 202;
630
+ --ok-300: 135 206 171;
631
+ --ok-400: 94 184 143;
632
+ --ok-500: 60 160 118;
633
+ --ok-600: 38 134 96;
634
+ --ok-700: 22 109 75;
635
+ --ok-800: 16 83 57;
636
+ --ok-900: 10 59 40;
637
+ --ok-950: 2 40 25;
638
+ --warn-50: 255 243 233;
639
+ --warn-100: 253 228 209;
640
+ --warn-200: 244 205 174;
641
+ --warn-300: 231 175 127;
642
+ --warn-400: 213 146 87;
643
+ --warn-500: 189 120 56;
644
+ --warn-600: 161 98 36;
645
+ --warn-700: 132 77 22;
646
+ --warn-800: 101 59 15;
647
+ --warn-900: 73 41 9;
648
+ --warn-950: 50 26 3;
649
+ --bad-50: 255 242 240;
650
+ --bad-100: 254 226 221;
651
+ --bad-200: 255 198 189;
652
+ --bad-300: 254 159 145;
653
+ --bad-400: 251 115 99;
654
+ --bad-500: 226 85 71;
655
+ --bad-600: 194 63 52;
656
+ --bad-700: 160 46 37;
657
+ --bad-800: 124 34 27;
658
+ --bad-900: 89 23 17;
659
+ --bad-950: 63 11 8;
660
+ --data-1: var(--signal);
661
+ --data-2: var(--ok);
662
+ --data-3: var(--warn);
663
+ --data-4: var(--bad);
664
+ --data-5: var(--text-2);
665
+ --data-6: var(--mute);
666
+ --canvas-bg: var(--bg);
667
+ --canvas-grid: var(--line);
668
+ --canvas-node: var(--panel);
669
+ --canvas-node-line: var(--line-2);
670
+ --edge: var(--line-2);
671
+ --edge-hover: var(--text-2);
672
+ --edge-active: var(--signal);
673
+ --execution: var(--ok);
674
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230077C2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
675
+ color-scheme: light;
676
+ }
677
+
678
+ .light .room, [data-theme="light"] .room {
679
+ --bg: #070A14;
680
+ --bg-rgb: 7 10 20;
681
+ --bg-2: #0B1020;
682
+ --bg-2-rgb: 11 16 32;
683
+ --panel: #0E1426;
684
+ --panel-rgb: 14 20 38;
685
+ --panel-2: #121A30;
686
+ --panel-2-rgb: 18 26 48;
687
+ --panel-3: #182240;
688
+ --panel-3-rgb: 24 34 64;
689
+ --line: #1B2238;
690
+ --line-rgb: 27 34 56;
691
+ --line-2: #2A3350;
692
+ --line-2-rgb: 42 51 80;
693
+ --line-3: #3C4560;
694
+ --line-3-rgb: 60 69 96;
695
+ --text: #E7ECF7;
696
+ --text-rgb: 231 236 247;
697
+ --text-2: #A9B2CC;
698
+ --text-2-rgb: 169 178 204;
699
+ --mute: #7F8AA8;
700
+ --mute-rgb: 127 138 168;
701
+ --signal: #5FC8FF;
702
+ --signal-rgb: 95 200 255;
703
+ --signal-2: #01B1F7;
704
+ --signal-2-rgb: 1 177 247;
705
+ --signal-ink: #06111F;
706
+ --signal-ink-rgb: 6 17 31;
707
+ --signal-soft: rgba(95, 200, 255, 0.12);
708
+ --ok: #4FD1A0;
709
+ --ok-rgb: 79 209 160;
710
+ --ok-ink: #06111F;
711
+ --ok-ink-rgb: 6 17 31;
712
+ --ok-soft: rgba(79, 209, 160, 0.14);
713
+ --warn: #F2B35B;
714
+ --warn-rgb: 242 179 91;
715
+ --warn-ink: #06111F;
716
+ --warn-ink-rgb: 6 17 31;
717
+ --warn-soft: rgba(242, 179, 91, 0.14);
718
+ --bad: #FF7A7A;
719
+ --bad-rgb: 255 122 122;
720
+ --bad-ink: #06111F;
721
+ --bad-ink-rgb: 6 17 31;
722
+ --bad-soft: rgba(255, 122, 122, 0.14);
723
+ --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
724
+ --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
725
+ --overlay: rgba(7, 10, 20, 0.6);
726
+ --signal-50: 235 247 255;
727
+ --signal-100: 211 238 255;
728
+ --signal-200: 173 222 251;
729
+ --signal-300: 122 199 241;
730
+ --signal-400: 75 175 226;
731
+ --signal-500: 33 150 202;
732
+ --signal-600: 8 125 172;
733
+ --signal-700: 1 100 139;
734
+ --signal-800: 2 77 107;
735
+ --signal-900: 0 54 78;
736
+ --signal-950: 0 36 53;
737
+ --ok-50: 231 251 241;
738
+ --ok-100: 208 243 226;
739
+ --ok-200: 171 229 202;
740
+ --ok-300: 118 210 171;
741
+ --ok-400: 65 188 142;
742
+ --ok-500: 16 163 118;
743
+ --ok-600: 0 136 97;
744
+ --ok-700: 5 109 78;
745
+ --ok-800: 5 84 59;
746
+ --ok-900: 1 60 41;
747
+ --ok-950: 1 40 26;
748
+ --warn-50: 255 243 229;
749
+ --warn-100: 251 230 204;
750
+ --warn-200: 241 208 166;
751
+ --warn-300: 227 178 114;
752
+ --warn-400: 208 150 67;
753
+ --warn-500: 185 125 25;
754
+ --warn-600: 156 102 1;
755
+ --warn-700: 125 82 5;
756
+ --warn-800: 97 62 0;
757
+ --warn-900: 69 43 1;
758
+ --warn-950: 47 28 0;
759
+ --bad-50: 255 242 241;
760
+ --bad-100: 255 226 224;
761
+ --bad-200: 255 197 194;
762
+ --bad-300: 254 158 155;
763
+ --bad-400: 244 119 119;
764
+ --bad-500: 220 90 93;
765
+ --bad-600: 188 69 72;
766
+ --bad-700: 155 51 55;
767
+ --bad-800: 120 38 41;
768
+ --bad-900: 86 26 28;
769
+ --bad-950: 60 14 16;
770
+ --data-1: var(--signal);
771
+ --data-2: var(--ok);
772
+ --data-3: var(--warn);
773
+ --data-4: var(--bad);
774
+ --data-5: var(--text-2);
775
+ --data-6: var(--mute);
776
+ --canvas-bg: var(--bg);
777
+ --canvas-grid: var(--line);
778
+ --canvas-node: var(--panel);
779
+ --canvas-node-line: var(--line-2);
780
+ --edge: var(--line-2);
781
+ --edge-hover: var(--text-2);
782
+ --edge-active: var(--signal);
783
+ --execution: var(--ok);
784
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%235FC8FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
785
+ color-scheme: dark;
786
+ }
787
+
788
+ @media (prefers-color-scheme: light) {
789
+ :root:not(.dark):not([data-theme="dark"]) .room {
790
+ --bg: #070A14;
791
+ --bg-rgb: 7 10 20;
792
+ --bg-2: #0B1020;
793
+ --bg-2-rgb: 11 16 32;
794
+ --panel: #0E1426;
795
+ --panel-rgb: 14 20 38;
796
+ --panel-2: #121A30;
797
+ --panel-2-rgb: 18 26 48;
798
+ --panel-3: #182240;
799
+ --panel-3-rgb: 24 34 64;
800
+ --line: #1B2238;
801
+ --line-rgb: 27 34 56;
802
+ --line-2: #2A3350;
803
+ --line-2-rgb: 42 51 80;
804
+ --line-3: #3C4560;
805
+ --line-3-rgb: 60 69 96;
806
+ --text: #E7ECF7;
807
+ --text-rgb: 231 236 247;
808
+ --text-2: #A9B2CC;
809
+ --text-2-rgb: 169 178 204;
810
+ --mute: #7F8AA8;
811
+ --mute-rgb: 127 138 168;
812
+ --signal: #5FC8FF;
813
+ --signal-rgb: 95 200 255;
814
+ --signal-2: #01B1F7;
815
+ --signal-2-rgb: 1 177 247;
816
+ --signal-ink: #06111F;
817
+ --signal-ink-rgb: 6 17 31;
818
+ --signal-soft: rgba(95, 200, 255, 0.12);
819
+ --ok: #4FD1A0;
820
+ --ok-rgb: 79 209 160;
821
+ --ok-ink: #06111F;
822
+ --ok-ink-rgb: 6 17 31;
823
+ --ok-soft: rgba(79, 209, 160, 0.14);
824
+ --warn: #F2B35B;
825
+ --warn-rgb: 242 179 91;
826
+ --warn-ink: #06111F;
827
+ --warn-ink-rgb: 6 17 31;
828
+ --warn-soft: rgba(242, 179, 91, 0.14);
829
+ --bad: #FF7A7A;
830
+ --bad-rgb: 255 122 122;
831
+ --bad-ink: #06111F;
832
+ --bad-ink-rgb: 6 17 31;
833
+ --bad-soft: rgba(255, 122, 122, 0.14);
834
+ --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
835
+ --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
836
+ --overlay: rgba(7, 10, 20, 0.6);
837
+ --signal-50: 235 247 255;
838
+ --signal-100: 211 238 255;
839
+ --signal-200: 173 222 251;
840
+ --signal-300: 122 199 241;
841
+ --signal-400: 75 175 226;
842
+ --signal-500: 33 150 202;
843
+ --signal-600: 8 125 172;
844
+ --signal-700: 1 100 139;
845
+ --signal-800: 2 77 107;
846
+ --signal-900: 0 54 78;
847
+ --signal-950: 0 36 53;
848
+ --ok-50: 231 251 241;
849
+ --ok-100: 208 243 226;
850
+ --ok-200: 171 229 202;
851
+ --ok-300: 118 210 171;
852
+ --ok-400: 65 188 142;
853
+ --ok-500: 16 163 118;
854
+ --ok-600: 0 136 97;
855
+ --ok-700: 5 109 78;
856
+ --ok-800: 5 84 59;
857
+ --ok-900: 1 60 41;
858
+ --ok-950: 1 40 26;
859
+ --warn-50: 255 243 229;
860
+ --warn-100: 251 230 204;
861
+ --warn-200: 241 208 166;
862
+ --warn-300: 227 178 114;
863
+ --warn-400: 208 150 67;
864
+ --warn-500: 185 125 25;
865
+ --warn-600: 156 102 1;
866
+ --warn-700: 125 82 5;
867
+ --warn-800: 97 62 0;
868
+ --warn-900: 69 43 1;
869
+ --warn-950: 47 28 0;
870
+ --bad-50: 255 242 241;
871
+ --bad-100: 255 226 224;
872
+ --bad-200: 255 197 194;
873
+ --bad-300: 254 158 155;
874
+ --bad-400: 244 119 119;
875
+ --bad-500: 220 90 93;
876
+ --bad-600: 188 69 72;
877
+ --bad-700: 155 51 55;
878
+ --bad-800: 120 38 41;
879
+ --bad-900: 86 26 28;
880
+ --bad-950: 60 14 16;
881
+ --data-1: var(--signal);
882
+ --data-2: var(--ok);
883
+ --data-3: var(--warn);
884
+ --data-4: var(--bad);
885
+ --data-5: var(--text-2);
886
+ --data-6: var(--mute);
887
+ --canvas-bg: var(--bg);
888
+ --canvas-grid: var(--line);
889
+ --canvas-node: var(--panel);
890
+ --canvas-node-line: var(--line-2);
891
+ --edge: var(--line-2);
892
+ --edge-hover: var(--text-2);
893
+ --edge-active: var(--signal);
894
+ --execution: var(--ok);
895
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%235FC8FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
896
+ color-scheme: dark;
897
+ }
898
+
899
+ :root:not(.dark):not([data-theme="dark"]) .light .room {
900
+ --bg: #070A14;
901
+ --bg-rgb: 7 10 20;
902
+ --bg-2: #0B1020;
903
+ --bg-2-rgb: 11 16 32;
904
+ --panel: #0E1426;
905
+ --panel-rgb: 14 20 38;
906
+ --panel-2: #121A30;
907
+ --panel-2-rgb: 18 26 48;
908
+ --panel-3: #182240;
909
+ --panel-3-rgb: 24 34 64;
910
+ --line: #1B2238;
911
+ --line-rgb: 27 34 56;
912
+ --line-2: #2A3350;
913
+ --line-2-rgb: 42 51 80;
914
+ --line-3: #3C4560;
915
+ --line-3-rgb: 60 69 96;
916
+ --text: #E7ECF7;
917
+ --text-rgb: 231 236 247;
918
+ --text-2: #A9B2CC;
919
+ --text-2-rgb: 169 178 204;
920
+ --mute: #7F8AA8;
921
+ --mute-rgb: 127 138 168;
922
+ --signal: #5FC8FF;
923
+ --signal-rgb: 95 200 255;
924
+ --signal-2: #01B1F7;
925
+ --signal-2-rgb: 1 177 247;
926
+ --signal-ink: #06111F;
927
+ --signal-ink-rgb: 6 17 31;
928
+ --signal-soft: rgba(95, 200, 255, 0.12);
929
+ --ok: #4FD1A0;
930
+ --ok-rgb: 79 209 160;
931
+ --ok-ink: #06111F;
932
+ --ok-ink-rgb: 6 17 31;
933
+ --ok-soft: rgba(79, 209, 160, 0.14);
934
+ --warn: #F2B35B;
935
+ --warn-rgb: 242 179 91;
936
+ --warn-ink: #06111F;
937
+ --warn-ink-rgb: 6 17 31;
938
+ --warn-soft: rgba(242, 179, 91, 0.14);
939
+ --bad: #FF7A7A;
940
+ --bad-rgb: 255 122 122;
941
+ --bad-ink: #06111F;
942
+ --bad-ink-rgb: 6 17 31;
943
+ --bad-soft: rgba(255, 122, 122, 0.14);
944
+ --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
945
+ --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
946
+ --overlay: rgba(7, 10, 20, 0.6);
947
+ --signal-50: 235 247 255;
948
+ --signal-100: 211 238 255;
949
+ --signal-200: 173 222 251;
950
+ --signal-300: 122 199 241;
951
+ --signal-400: 75 175 226;
952
+ --signal-500: 33 150 202;
953
+ --signal-600: 8 125 172;
954
+ --signal-700: 1 100 139;
955
+ --signal-800: 2 77 107;
956
+ --signal-900: 0 54 78;
957
+ --signal-950: 0 36 53;
958
+ --ok-50: 231 251 241;
959
+ --ok-100: 208 243 226;
960
+ --ok-200: 171 229 202;
961
+ --ok-300: 118 210 171;
962
+ --ok-400: 65 188 142;
963
+ --ok-500: 16 163 118;
964
+ --ok-600: 0 136 97;
965
+ --ok-700: 5 109 78;
966
+ --ok-800: 5 84 59;
967
+ --ok-900: 1 60 41;
968
+ --ok-950: 1 40 26;
969
+ --warn-50: 255 243 229;
970
+ --warn-100: 251 230 204;
971
+ --warn-200: 241 208 166;
972
+ --warn-300: 227 178 114;
973
+ --warn-400: 208 150 67;
974
+ --warn-500: 185 125 25;
975
+ --warn-600: 156 102 1;
976
+ --warn-700: 125 82 5;
977
+ --warn-800: 97 62 0;
978
+ --warn-900: 69 43 1;
979
+ --warn-950: 47 28 0;
980
+ --bad-50: 255 242 241;
981
+ --bad-100: 255 226 224;
982
+ --bad-200: 255 197 194;
983
+ --bad-300: 254 158 155;
984
+ --bad-400: 244 119 119;
985
+ --bad-500: 220 90 93;
986
+ --bad-600: 188 69 72;
987
+ --bad-700: 155 51 55;
988
+ --bad-800: 120 38 41;
989
+ --bad-900: 86 26 28;
990
+ --bad-950: 60 14 16;
991
+ --data-1: var(--signal);
992
+ --data-2: var(--ok);
993
+ --data-3: var(--warn);
994
+ --data-4: var(--bad);
995
+ --data-5: var(--text-2);
996
+ --data-6: var(--mute);
997
+ --canvas-bg: var(--bg);
998
+ --canvas-grid: var(--line);
999
+ --canvas-node: var(--panel);
1000
+ --canvas-node-line: var(--line-2);
1001
+ --edge: var(--line-2);
1002
+ --edge-hover: var(--text-2);
1003
+ --edge-active: var(--signal);
1004
+ --execution: var(--ok);
1005
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%235FC8FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
1006
+ color-scheme: dark;
1007
+ }
1008
+
1009
+ }
1010
+
1011
+ .room { background: var(--bg); color: var(--text); }
1012
+
1013
+ /* @aginies/webuikit \u2014 component styles. Tokens come from @aginies/tokens (prepended at build). */
1014
+
1015
+ /* \u2500\u2500\u2500 reset inside widgets \u2500\u2500\u2500 */
1016
+ .agi-chat,
1017
+ .agi-bubble,
1018
+ .agi-panel,
1019
+ .agi-btn,
1020
+ .agi-input,
1021
+ .agi-tag,
1022
+ .agi-chip {
1023
+ box-sizing: border-box;
1024
+ font-family: var(--font-body);
1025
+ color: var(--text);
1026
+ }
1027
+ .agi-chat *,
1028
+ .agi-bubble * {
1029
+ box-sizing: border-box;
1030
+ }
1031
+
1032
+ /* \u2500\u2500\u2500 buttons \u2500\u2500\u2500 */
1033
+ .agi-btn {
1034
+ display: inline-flex;
1035
+ align-items: center;
1036
+ justify-content: center;
1037
+ gap: 8px;
1038
+ height: 36px;
1039
+ padding: 0 12px;
1040
+ border-radius: var(--radius-md);
1041
+ border: 1px solid var(--line-2);
1042
+ background: transparent;
1043
+ color: var(--text);
1044
+ font: inherit;
1045
+ font-size: 13.5px;
1046
+ font-weight: 600;
1047
+ letter-spacing: -0.005em;
1048
+ white-space: nowrap;
1049
+ cursor: pointer;
1050
+ transition:
1051
+ background var(--duration-fast) ease,
1052
+ border-color var(--duration-fast) ease,
1053
+ color var(--duration-fast) ease,
1054
+ transform var(--duration-fast) ease;
1055
+ }
1056
+ .agi-btn:hover {
1057
+ border-color: var(--text-2);
1058
+ background: var(--panel);
1059
+ }
1060
+ .agi-btn:active {
1061
+ transform: translateY(1px);
1062
+ }
1063
+ .agi-btn:focus-visible {
1064
+ outline: var(--focus-ring);
1065
+ outline-offset: var(--focus-ring-offset);
1066
+ }
1067
+ .agi-btn:disabled {
1068
+ opacity: 0.5;
1069
+ cursor: not-allowed;
1070
+ transform: none;
1071
+ }
1072
+ .agi-btn--primary {
1073
+ background: var(--text);
1074
+ border-color: var(--text);
1075
+ color: var(--bg);
1076
+ }
1077
+ .agi-btn--primary:hover {
1078
+ background: var(--signal);
1079
+ border-color: var(--signal);
1080
+ color: var(--signal-ink);
1081
+ }
1082
+ .agi-btn--signal {
1083
+ background: var(--signal);
1084
+ border-color: var(--signal);
1085
+ color: var(--signal-ink);
1086
+ }
1087
+ .agi-btn--signal:hover {
1088
+ background: var(--signal);
1089
+ border-color: var(--signal);
1090
+ color: var(--signal-ink);
1091
+ filter: brightness(1.08);
1092
+ }
1093
+ .agi-btn--destructive {
1094
+ background: var(--bad);
1095
+ border-color: var(--bad);
1096
+ color: var(--bad-ink);
1097
+ }
1098
+ .agi-btn--ghost {
1099
+ border-color: transparent;
1100
+ color: var(--text-2);
1101
+ }
1102
+ .agi-btn--ghost:hover {
1103
+ background: var(--panel-2);
1104
+ color: var(--text);
1105
+ }
1106
+ .agi-btn--sm {
1107
+ height: 30px;
1108
+ padding: 0 10px;
1109
+ font-size: 12.5px;
1110
+ }
1111
+ .agi-btn--lg {
1112
+ height: 44px;
1113
+ padding: 0 18px;
1114
+ font-size: 15px;
1115
+ }
1116
+
1117
+ /* \u2500\u2500\u2500 tags / chips \u2500\u2500\u2500 */
1118
+ .agi-tag {
1119
+ display: inline-flex;
1120
+ align-items: center;
1121
+ gap: 6px;
1122
+ font-family: var(--font-mono);
1123
+ font-size: var(--fs-tag);
1124
+ letter-spacing: var(--ls-tag);
1125
+ padding: 3px 8px;
1126
+ border-radius: var(--radius-sm);
1127
+ border: 1px solid var(--line-2);
1128
+ color: var(--text-2);
1129
+ white-space: nowrap;
1130
+ }
1131
+ .agi-tag--signal {
1132
+ color: var(--signal);
1133
+ border-color: color-mix(in srgb, var(--signal) 45%, transparent);
1134
+ background: var(--signal-soft);
1135
+ }
1136
+ .agi-tag--ok {
1137
+ color: var(--ok);
1138
+ border-color: color-mix(in srgb, var(--ok) 45%, transparent);
1139
+ background: var(--ok-soft);
1140
+ }
1141
+ .agi-tag--warn {
1142
+ color: var(--warn);
1143
+ border-color: color-mix(in srgb, var(--warn) 45%, transparent);
1144
+ background: var(--warn-soft);
1145
+ }
1146
+ .agi-tag--bad {
1147
+ color: var(--bad);
1148
+ border-color: color-mix(in srgb, var(--bad) 45%, transparent);
1149
+ background: var(--bad-soft);
1150
+ }
1151
+ .agi-chip {
1152
+ display: inline-flex;
1153
+ align-items: center;
1154
+ height: 32px;
1155
+ padding: 0 12px;
1156
+ border-radius: var(--radius-full);
1157
+ border: 1px solid var(--line-2);
1158
+ background: transparent;
1159
+ font: inherit;
1160
+ font-size: 13px;
1161
+ color: var(--text-2);
1162
+ cursor: pointer;
1163
+ transition: all var(--duration-fast) ease;
1164
+ }
1165
+ .agi-chip:hover {
1166
+ border-color: var(--text-2);
1167
+ color: var(--text);
1168
+ }
1169
+ .agi-chip[aria-pressed="true"] {
1170
+ background: var(--signal);
1171
+ border-color: var(--signal);
1172
+ color: var(--signal-ink);
1173
+ font-weight: 600;
1174
+ }
1175
+
1176
+ /* \u2500\u2500\u2500 surfaces / type \u2500\u2500\u2500 */
1177
+ .agi-panel {
1178
+ background: var(--panel);
1179
+ border: 1px solid var(--line);
1180
+ border-radius: var(--radius-lg);
1181
+ }
1182
+ .agi-panel--2 {
1183
+ background: var(--panel-2);
1184
+ }
1185
+ .agi-eyebrow {
1186
+ margin: 0;
1187
+ font-family: var(--font-mono);
1188
+ font-size: var(--fs-eyebrow);
1189
+ letter-spacing: var(--ls-eyebrow);
1190
+ text-transform: uppercase;
1191
+ color: var(--signal);
1192
+ font-weight: 500;
1193
+ }
1194
+ .agi-eyebrow--quiet {
1195
+ color: var(--mute);
1196
+ }
1197
+ .agi-stat {
1198
+ display: grid;
1199
+ gap: 4px;
1200
+ }
1201
+ .agi-stat__v {
1202
+ font-family: var(--font-display);
1203
+ font-size: var(--fs-stat);
1204
+ line-height: 1;
1205
+ letter-spacing: -0.03em;
1206
+ font-weight: 600;
1207
+ font-variant-numeric: tabular-nums;
1208
+ }
1209
+ .agi-stat__k {
1210
+ font-family: var(--font-mono);
1211
+ font-size: var(--fs-eyebrow);
1212
+ letter-spacing: 0.1em;
1213
+ text-transform: uppercase;
1214
+ color: var(--mute);
1215
+ }
1216
+
1217
+ /* \u2500\u2500\u2500 fields \u2500\u2500\u2500 */
1218
+ .agi-field {
1219
+ display: grid;
1220
+ gap: 6px;
1221
+ }
1222
+ .agi-field__label {
1223
+ font-family: var(--font-mono);
1224
+ font-size: 11px;
1225
+ letter-spacing: 0.1em;
1226
+ text-transform: uppercase;
1227
+ color: var(--mute);
1228
+ }
1229
+ .agi-field__error {
1230
+ color: var(--bad);
1231
+ font-size: 13px;
1232
+ }
1233
+ .agi-field__hint {
1234
+ font-size: 12px;
1235
+ color: var(--mute);
1236
+ }
1237
+ .agi-input {
1238
+ width: 100%;
1239
+ background: var(--bg-2);
1240
+ border: 1px solid var(--line-2);
1241
+ border-radius: var(--radius-md);
1242
+ padding: 9px 12px;
1243
+ color: var(--text);
1244
+ font: inherit;
1245
+ font-size: 14px;
1246
+ transition: border-color var(--duration-fast) ease;
1247
+ }
1248
+ .agi-input::placeholder {
1249
+ color: var(--mute);
1250
+ }
1251
+ .agi-input:focus {
1252
+ outline: none;
1253
+ border-color: var(--signal);
1254
+ box-shadow: var(--focus-field-ring);
1255
+ }
1256
+ .agi-textarea {
1257
+ resize: vertical;
1258
+ min-height: 90px;
1259
+ }
1260
+
1261
+ /* \u2500\u2500\u2500 spinner \u2500\u2500\u2500 */
1262
+ .agi-spinner {
1263
+ display: inline-flex;
1264
+ gap: 4px;
1265
+ align-items: center;
1266
+ }
1267
+ .agi-spinner span {
1268
+ width: 5px;
1269
+ height: 5px;
1270
+ border-radius: 50%;
1271
+ background: var(--signal);
1272
+ animation: agi-pulse 1.2s ease-in-out infinite;
1273
+ }
1274
+ .agi-spinner span:nth-child(2) {
1275
+ animation-delay: 0.15s;
1276
+ }
1277
+ .agi-spinner span:nth-child(3) {
1278
+ animation-delay: 0.3s;
1279
+ }
1280
+ @keyframes agi-pulse {
1281
+ 0%,
1282
+ 80%,
1283
+ 100% {
1284
+ opacity: 0.25;
1285
+ transform: scale(0.8);
1286
+ }
1287
+ 40% {
1288
+ opacity: 1;
1289
+ transform: scale(1);
1290
+ }
1291
+ }
1292
+
1293
+ /* \u2500\u2500\u2500 table \u2500\u2500\u2500 */
1294
+ .agi-table {
1295
+ border-collapse: collapse;
1296
+ width: 100%;
1297
+ font-size: 13.5px;
1298
+ }
1299
+ .agi-table th,
1300
+ .agi-table td {
1301
+ text-align: left;
1302
+ padding: 8px 10px;
1303
+ border-bottom: 1px solid var(--line);
1304
+ vertical-align: top;
1305
+ }
1306
+ .agi-table th {
1307
+ font-family: var(--font-mono);
1308
+ font-size: 11px;
1309
+ letter-spacing: 0.1em;
1310
+ text-transform: uppercase;
1311
+ color: var(--mute);
1312
+ font-weight: 500;
1313
+ }
1314
+ .agi-table td {
1315
+ color: var(--text-2);
1316
+ }
1317
+
1318
+ /* \u2500\u2500\u2500 chat \u2500\u2500\u2500 */
1319
+ .agi-chat {
1320
+ display: flex;
1321
+ flex-direction: column;
1322
+ min-height: 0;
1323
+ background: var(--panel);
1324
+ border: 1px solid var(--line);
1325
+ border-radius: var(--radius-lg);
1326
+ overflow: hidden;
1327
+ font-size: 14.5px;
1328
+ line-height: 1.5;
1329
+ }
1330
+ .agi-chat--inline {
1331
+ height: 100%;
1332
+ min-height: 420px;
1333
+ }
1334
+ .agi-chat--full {
1335
+ position: fixed;
1336
+ inset: 0;
1337
+ border-radius: 0;
1338
+ border: 0;
1339
+ z-index: var(--z-modal);
1340
+ }
1341
+ .agi-chat--bubble {
1342
+ width: min(400px, calc(100vw - 32px));
1343
+ height: min(600px, calc(100vh - 110px));
1344
+ box-shadow: var(--shadow);
1345
+ }
1346
+ .agi-chat__head {
1347
+ display: flex;
1348
+ align-items: center;
1349
+ justify-content: space-between;
1350
+ gap: 12px;
1351
+ padding: 12px 14px;
1352
+ border-bottom: 1px solid var(--line);
1353
+ background: var(--panel-2);
1354
+ }
1355
+ .agi-chat__title {
1356
+ display: flex;
1357
+ align-items: center;
1358
+ gap: 10px;
1359
+ min-width: 0;
1360
+ }
1361
+ .agi-chat__title img {
1362
+ width: 28px;
1363
+ height: 28px;
1364
+ border-radius: 6px;
1365
+ object-fit: cover;
1366
+ flex: none;
1367
+ }
1368
+ .agi-chat__name {
1369
+ font-family: var(--font-display);
1370
+ font-weight: 600;
1371
+ font-size: 15px;
1372
+ letter-spacing: -0.01em;
1373
+ }
1374
+ .agi-chat__desc {
1375
+ color: var(--mute);
1376
+ font-size: 12.5px;
1377
+ white-space: nowrap;
1378
+ overflow: hidden;
1379
+ text-overflow: ellipsis;
1380
+ }
1381
+ .agi-chat__close {
1382
+ width: 30px;
1383
+ height: 30px;
1384
+ border-radius: var(--radius-md);
1385
+ border: 1px solid var(--line-2);
1386
+ background: transparent;
1387
+ color: var(--text-2);
1388
+ font-size: 18px;
1389
+ line-height: 1;
1390
+ cursor: pointer;
1391
+ }
1392
+ .agi-chat__close:hover {
1393
+ color: var(--text);
1394
+ border-color: var(--text-2);
1395
+ }
1396
+ .agi-chat__messages {
1397
+ flex: 1;
1398
+ min-height: 0;
1399
+ overflow-y: auto;
1400
+ padding: 14px;
1401
+ display: grid;
1402
+ gap: 12px;
1403
+ align-content: start;
1404
+ background-image: radial-gradient(var(--line) 1px, transparent 1px);
1405
+ background-size: 18px 18px;
1406
+ }
1407
+ .agi-msg {
1408
+ display: grid;
1409
+ gap: 4px;
1410
+ max-width: 88%;
1411
+ }
1412
+ .agi-msg--user {
1413
+ justify-self: end;
1414
+ text-align: right;
1415
+ }
1416
+ .agi-msg__who {
1417
+ font-family: var(--font-mono);
1418
+ font-size: 10.5px;
1419
+ letter-spacing: 0.08em;
1420
+ text-transform: uppercase;
1421
+ color: var(--mute);
1422
+ }
1423
+ .agi-msg__body {
1424
+ padding: 10px 12px;
1425
+ border-radius: var(--radius-lg);
1426
+ border: 1px solid var(--line);
1427
+ background: var(--bg-2);
1428
+ color: var(--text);
1429
+ text-align: left;
1430
+ }
1431
+ .agi-msg__body p {
1432
+ margin: 0;
1433
+ white-space: pre-wrap;
1434
+ word-break: break-word;
1435
+ }
1436
+ .agi-msg--user .agi-msg__body {
1437
+ background: var(--signal-soft);
1438
+ border-color: color-mix(in srgb, var(--signal) 35%, transparent);
1439
+ }
1440
+ .agi-msg--error .agi-msg__body {
1441
+ border-color: color-mix(in srgb, var(--bad) 45%, transparent);
1442
+ background: var(--bad-soft);
1443
+ color: var(--bad);
1444
+ }
1445
+ .agi-msg__thinking {
1446
+ display: inline-flex;
1447
+ align-items: center;
1448
+ gap: 8px;
1449
+ color: var(--mute);
1450
+ font-size: 13px;
1451
+ }
1452
+ .agi-chat__composer {
1453
+ display: grid;
1454
+ gap: 8px;
1455
+ padding: 10px 12px;
1456
+ border-top: 1px solid var(--line);
1457
+ background: var(--panel);
1458
+ }
1459
+ .agi-chat__row {
1460
+ display: flex;
1461
+ gap: 8px;
1462
+ align-items: center;
1463
+ }
1464
+ .agi-chat__row .agi-input {
1465
+ flex: 1;
1466
+ min-width: 0;
1467
+ }
1468
+ .agi-chat__pending {
1469
+ display: flex;
1470
+ flex-wrap: wrap;
1471
+ gap: 6px;
1472
+ align-items: center;
1473
+ }
1474
+ .agi-chat__file-error {
1475
+ font-size: 12px;
1476
+ color: var(--bad);
1477
+ }
1478
+ .agi-file {
1479
+ display: inline-flex;
1480
+ align-items: center;
1481
+ gap: 6px;
1482
+ max-width: 100%;
1483
+ padding: 3px 8px;
1484
+ border-radius: 999px;
1485
+ border: 1px solid var(--line);
1486
+ background: var(--panel-2);
1487
+ color: var(--text-2);
1488
+ font-family: var(--font-mono);
1489
+ font-size: 11px;
1490
+ }
1491
+ .agi-file__name {
1492
+ overflow: hidden;
1493
+ text-overflow: ellipsis;
1494
+ white-space: nowrap;
1495
+ color: var(--text);
1496
+ }
1497
+ .agi-file__size {
1498
+ color: var(--mute);
1499
+ }
1500
+ .agi-file__remove {
1501
+ border: 0;
1502
+ background: none;
1503
+ padding: 0 2px;
1504
+ color: var(--mute);
1505
+ cursor: pointer;
1506
+ font-size: 14px;
1507
+ line-height: 1;
1508
+ }
1509
+ .agi-file__remove:hover {
1510
+ color: var(--bad);
1511
+ }
1512
+ .agi-msg__files {
1513
+ list-style: none;
1514
+ margin: 8px 0 0;
1515
+ padding: 0;
1516
+ display: flex;
1517
+ flex-wrap: wrap;
1518
+ gap: 6px;
1519
+ }
1520
+ .agi-chat__auth-actions {
1521
+ display: flex;
1522
+ flex-wrap: wrap;
1523
+ gap: 8px;
1524
+ }
1525
+
1526
+ /* \u2500\u2500\u2500 markdown in replies \u2500\u2500\u2500 */
1527
+ .agi-md {
1528
+ display: grid;
1529
+ gap: 8px;
1530
+ word-break: break-word;
1531
+ }
1532
+ .agi-md p {
1533
+ margin: 0;
1534
+ white-space: normal;
1535
+ }
1536
+ .agi-md h3,
1537
+ .agi-md h4,
1538
+ .agi-md h5,
1539
+ .agi-md h6 {
1540
+ margin: 4px 0 0;
1541
+ font-family: var(--font-display);
1542
+ font-weight: 600;
1543
+ letter-spacing: -0.01em;
1544
+ line-height: 1.3;
1545
+ }
1546
+ .agi-md h3 {
1547
+ font-size: 15.5px;
1548
+ }
1549
+ .agi-md h4 {
1550
+ font-size: 14.5px;
1551
+ }
1552
+ .agi-md h5,
1553
+ .agi-md h6 {
1554
+ font-size: 13.5px;
1555
+ }
1556
+ .agi-md ul,
1557
+ .agi-md ol {
1558
+ margin: 0;
1559
+ padding-left: 20px;
1560
+ display: grid;
1561
+ gap: 3px;
1562
+ }
1563
+ .agi-md a {
1564
+ color: var(--signal);
1565
+ text-decoration: underline;
1566
+ text-underline-offset: 2px;
1567
+ }
1568
+ .agi-md code {
1569
+ font-family: var(--font-mono);
1570
+ font-size: 12px;
1571
+ padding: 1px 5px;
1572
+ border-radius: 4px;
1573
+ background: var(--panel-3);
1574
+ border: 1px solid var(--line);
1575
+ }
1576
+ .agi-md pre {
1577
+ margin: 0;
1578
+ padding: 10px 12px;
1579
+ overflow-x: auto;
1580
+ border-radius: var(--radius);
1581
+ background: var(--panel-3);
1582
+ border: 1px solid var(--line);
1583
+ }
1584
+ .agi-md pre code {
1585
+ padding: 0;
1586
+ border: 0;
1587
+ background: none;
1588
+ font-size: 12px;
1589
+ line-height: 1.55;
1590
+ }
1591
+ .agi-md blockquote {
1592
+ margin: 0;
1593
+ padding: 2px 0 2px 12px;
1594
+ border-left: 2px solid var(--line-2);
1595
+ color: var(--text-2);
1596
+ display: grid;
1597
+ gap: 6px;
1598
+ }
1599
+ .agi-md hr {
1600
+ border: 0;
1601
+ border-top: 1px solid var(--line);
1602
+ margin: 4px 0;
1603
+ }
1604
+ .agi-md__table {
1605
+ overflow-x: auto;
1606
+ }
1607
+ .agi-md table {
1608
+ border-collapse: collapse;
1609
+ width: 100%;
1610
+ font-size: 12.5px;
1611
+ }
1612
+ .agi-md th,
1613
+ .agi-md td {
1614
+ padding: 6px 8px;
1615
+ border: 1px solid var(--line);
1616
+ text-align: left;
1617
+ vertical-align: top;
1618
+ }
1619
+ .agi-md th {
1620
+ font-family: var(--font-mono);
1621
+ font-size: 10.5px;
1622
+ letter-spacing: 0.08em;
1623
+ text-transform: uppercase;
1624
+ color: var(--mute);
1625
+ background: var(--panel-2);
1626
+ }
1627
+ .agi-chat__foot {
1628
+ padding: 6px 12px;
1629
+ border-top: 1px solid var(--line);
1630
+ text-align: right;
1631
+ }
1632
+ .agi-chat__foot a {
1633
+ font-family: var(--font-mono);
1634
+ font-size: 10.5px;
1635
+ letter-spacing: 0.08em;
1636
+ text-transform: uppercase;
1637
+ color: var(--mute);
1638
+ text-decoration: none;
1639
+ }
1640
+ .agi-chat__foot a:hover {
1641
+ color: var(--signal);
1642
+ }
1643
+ .agi-chat__state {
1644
+ flex: 1;
1645
+ display: grid;
1646
+ align-content: center;
1647
+ justify-items: start;
1648
+ gap: 12px;
1649
+ padding: 24px;
1650
+ }
1651
+ .agi-chat__state h3 {
1652
+ margin: 0;
1653
+ font-family: var(--font-display);
1654
+ font-weight: 600;
1655
+ font-size: 17px;
1656
+ letter-spacing: -0.01em;
1657
+ }
1658
+ .agi-chat__state p {
1659
+ margin: 0;
1660
+ color: var(--text-2);
1661
+ }
1662
+ .agi-chat__auth .agi-field {
1663
+ width: 100%;
1664
+ max-width: 360px;
1665
+ }
1666
+
1667
+ /* \u2500\u2500\u2500 structured replies \u2500\u2500\u2500 */
1668
+ .agi-sui {
1669
+ display: grid;
1670
+ gap: 12px;
1671
+ }
1672
+ .agi-sui__item {
1673
+ display: grid;
1674
+ gap: 10px;
1675
+ }
1676
+ .agi-sui__text {
1677
+ margin: 0;
1678
+ white-space: pre-wrap;
1679
+ }
1680
+ .agi-sui__figure {
1681
+ margin: 0;
1682
+ }
1683
+ .agi-sui__figure img {
1684
+ max-width: 100%;
1685
+ border-radius: var(--radius-md);
1686
+ display: block;
1687
+ }
1688
+ .agi-sui__figure figcaption {
1689
+ font-size: 12.5px;
1690
+ color: var(--mute);
1691
+ margin-top: 4px;
1692
+ }
1693
+ .agi-sui__cards {
1694
+ display: grid;
1695
+ gap: 8px;
1696
+ }
1697
+ .agi-sui__card {
1698
+ display: grid;
1699
+ grid-template-columns: auto 1fr;
1700
+ gap: 10px;
1701
+ padding: 10px;
1702
+ background: var(--panel-2);
1703
+ }
1704
+ .agi-sui__card img {
1705
+ width: 56px;
1706
+ height: 56px;
1707
+ border-radius: var(--radius-md);
1708
+ object-fit: cover;
1709
+ }
1710
+ .agi-sui__card p {
1711
+ margin: 4px 0 0;
1712
+ color: var(--text-2);
1713
+ font-size: 13.5px;
1714
+ }
1715
+ .agi-sui__card-title {
1716
+ font-weight: 600;
1717
+ }
1718
+ .agi-sui__card-sub {
1719
+ font-family: var(--font-mono);
1720
+ font-size: 11px;
1721
+ color: var(--mute);
1722
+ }
1723
+ .agi-sui__scroll {
1724
+ overflow-x: auto;
1725
+ }
1726
+ .agi-sui__actions {
1727
+ display: flex;
1728
+ flex-wrap: wrap;
1729
+ gap: 6px;
1730
+ }
1731
+ .agi-sui__pie {
1732
+ display: grid;
1733
+ grid-template-columns: 96px 1fr;
1734
+ gap: 12px;
1735
+ align-items: center;
1736
+ }
1737
+ .agi-sui__pie svg {
1738
+ width: 96px;
1739
+ height: 96px;
1740
+ }
1741
+ .agi-sui__pie ul {
1742
+ list-style: none;
1743
+ margin: 0;
1744
+ padding: 0;
1745
+ display: grid;
1746
+ gap: 4px;
1747
+ font-size: 13px;
1748
+ }
1749
+ .agi-sui__pie li {
1750
+ display: flex;
1751
+ align-items: center;
1752
+ gap: 8px;
1753
+ color: var(--text-2);
1754
+ }
1755
+ .agi-sui__pie li span {
1756
+ width: 10px;
1757
+ height: 10px;
1758
+ border-radius: 2px;
1759
+ flex: none;
1760
+ }
1761
+ .agi-sui__pie li b {
1762
+ margin-left: auto;
1763
+ font-family: var(--font-mono);
1764
+ font-weight: 500;
1765
+ color: var(--text);
1766
+ }
1767
+
1768
+ /* \u2500\u2500\u2500 bubble launcher \u2500\u2500\u2500 */
1769
+ .agi-bubble {
1770
+ position: fixed;
1771
+ bottom: 20px;
1772
+ z-index: var(--z-toast);
1773
+ display: grid;
1774
+ gap: 10px;
1775
+ justify-items: end;
1776
+ }
1777
+ .agi-bubble--right {
1778
+ right: 20px;
1779
+ }
1780
+ .agi-bubble--left {
1781
+ left: 20px;
1782
+ justify-items: start;
1783
+ }
1784
+ .agi-bubble__launcher {
1785
+ display: inline-flex;
1786
+ align-items: center;
1787
+ gap: 8px;
1788
+ height: 48px;
1789
+ padding: 0 18px 0 14px;
1790
+ border-radius: var(--radius-full);
1791
+ border: 1px solid var(--signal);
1792
+ background: var(--signal);
1793
+ color: var(--signal-ink);
1794
+ font: inherit;
1795
+ font-family: var(--font-body);
1796
+ font-weight: 600;
1797
+ font-size: 14px;
1798
+ cursor: pointer;
1799
+ box-shadow: var(--shadow-sm);
1800
+ transition: transform var(--duration-fast) ease;
1801
+ }
1802
+ .agi-bubble__launcher:hover {
1803
+ transform: translateY(-1px);
1804
+ }
1805
+ .agi-bubble__launcher--open {
1806
+ width: 48px;
1807
+ padding: 0;
1808
+ justify-content: center;
1809
+ }
1810
+
1811
+ @media (prefers-reduced-motion: reduce) {
1812
+ .agi-spinner span {
1813
+ animation: none;
1814
+ opacity: 0.7;
1815
+ }
1816
+ }
1817
+
1818
+ /* \u2500\u2500\u2500 agent runner \u2500\u2500\u2500 */
1819
+ .agi-run {
1820
+ display: grid;
1821
+ gap: 14px;
1822
+ padding: 16px;
1823
+ font-size: 14.5px;
1824
+ }
1825
+ .agi-run__title {
1826
+ margin: 0;
1827
+ font-family: var(--font-display);
1828
+ font-weight: 600;
1829
+ font-size: 17px;
1830
+ letter-spacing: -0.01em;
1831
+ }
1832
+ .agi-run__desc {
1833
+ margin: 4px 0 0;
1834
+ color: var(--text-2);
1835
+ }
1836
+ .agi-run__form {
1837
+ display: grid;
1838
+ gap: 12px;
1839
+ }
1840
+ .agi-run__actions {
1841
+ display: flex;
1842
+ align-items: center;
1843
+ gap: 10px;
1844
+ }
1845
+ .agi-run__status {
1846
+ display: inline-flex;
1847
+ align-items: center;
1848
+ gap: 8px;
1849
+ color: var(--mute);
1850
+ font-size: 13px;
1851
+ }
1852
+ .agi-checkbox {
1853
+ width: 16px;
1854
+ height: 16px;
1855
+ accent-color: var(--signal);
1856
+ }
1857
+ .agi-run__steps {
1858
+ list-style: none;
1859
+ margin: 0;
1860
+ padding: 0;
1861
+ display: grid;
1862
+ gap: 4px;
1863
+ }
1864
+ .agi-run__step {
1865
+ display: grid;
1866
+ grid-template-columns: 10px 1fr auto;
1867
+ gap: 8px;
1868
+ align-items: center;
1869
+ font-size: 13px;
1870
+ color: var(--text-2);
1871
+ }
1872
+ .agi-run__step-dot {
1873
+ width: 8px;
1874
+ height: 8px;
1875
+ border-radius: 50%;
1876
+ background: var(--line-2);
1877
+ }
1878
+ .agi-run__step.is-running .agi-run__step-dot {
1879
+ background: var(--signal);
1880
+ animation: agi-pulse 1.2s ease-in-out infinite;
1881
+ }
1882
+ .agi-run__step.is-done .agi-run__step-dot {
1883
+ background: var(--ok);
1884
+ }
1885
+ .agi-run__step.is-error .agi-run__step-dot {
1886
+ background: var(--bad);
1887
+ }
1888
+ .agi-run__step-meta {
1889
+ font-family: var(--font-mono);
1890
+ font-size: 11px;
1891
+ color: var(--mute);
1892
+ }
1893
+ .agi-run__result {
1894
+ display: grid;
1895
+ gap: 8px;
1896
+ padding: 12px;
1897
+ border-radius: var(--radius-md);
1898
+ border: 1px solid var(--line);
1899
+ background: var(--bg-2);
1900
+ }
1901
+ .agi-run__text {
1902
+ margin: 0;
1903
+ white-space: pre-wrap;
1904
+ word-break: break-word;
1905
+ }
1906
+ .agi-run__output {
1907
+ margin: 0;
1908
+ font-family: var(--font-mono);
1909
+ font-size: 12.5px;
1910
+ white-space: pre-wrap;
1911
+ word-break: break-word;
1912
+ color: var(--text-2);
1913
+ }
1914
+ .agi-run__error {
1915
+ margin: 0;
1916
+ color: var(--bad);
1917
+ }
1918
+ .agi-run__meta {
1919
+ margin: 0;
1920
+ font-family: var(--font-mono);
1921
+ font-size: 11px;
1922
+ letter-spacing: 0.04em;
1923
+ color: var(--mute);
1924
+ }
1925
+ .agi-run__meta b {
1926
+ font-weight: 500;
1927
+ color: var(--text-2);
1928
+ }
1929
+
1930
+ /* \u2500\u2500\u2500 approval \u2500\u2500\u2500 */
1931
+ .agi-approval {
1932
+ display: grid;
1933
+ gap: 14px;
1934
+ padding: 16px;
1935
+ font-size: 14.5px;
1936
+ }
1937
+ .agi-approval__head {
1938
+ display: grid;
1939
+ gap: 4px;
1940
+ }
1941
+ .agi-approval__title {
1942
+ margin: 0;
1943
+ font-family: var(--font-display);
1944
+ font-weight: 600;
1945
+ font-size: 17px;
1946
+ letter-spacing: -0.01em;
1947
+ }
1948
+ .agi-approval__desc {
1949
+ margin: 0;
1950
+ color: var(--text-2);
1951
+ }
1952
+ .agi-approval__meta {
1953
+ margin: 2px 0 0;
1954
+ font-family: var(--font-mono);
1955
+ font-size: 11px;
1956
+ letter-spacing: 0.04em;
1957
+ color: var(--mute);
1958
+ }
1959
+ .agi-approval__meta-value {
1960
+ font-weight: 500;
1961
+ color: var(--text-2);
1962
+ }
1963
+ .agi-approval__state {
1964
+ display: grid;
1965
+ gap: 10px;
1966
+ justify-items: start;
1967
+ color: var(--text-2);
1968
+ }
1969
+ .agi-approval__state p {
1970
+ margin: 0;
1971
+ }
1972
+ .agi-approval__points {
1973
+ display: flex;
1974
+ flex-wrap: wrap;
1975
+ gap: 6px;
1976
+ }
1977
+ .agi-approval__point {
1978
+ display: inline-flex;
1979
+ align-items: center;
1980
+ gap: 8px;
1981
+ padding: 6px 10px;
1982
+ border-radius: var(--radius-md);
1983
+ border: 1px solid var(--line);
1984
+ background: transparent;
1985
+ color: var(--text-2);
1986
+ font: inherit;
1987
+ font-size: 13px;
1988
+ cursor: pointer;
1989
+ }
1990
+ .agi-approval__point.is-selected {
1991
+ border-color: var(--signal);
1992
+ color: var(--text);
1993
+ }
1994
+ .agi-approval__status {
1995
+ display: flex;
1996
+ align-items: center;
1997
+ gap: 10px;
1998
+ }
1999
+ .agi-approval__queue {
2000
+ font-size: 13px;
2001
+ color: var(--mute);
2002
+ }
2003
+ .agi-approval__output {
2004
+ display: grid;
2005
+ gap: 8px;
2006
+ padding: 12px;
2007
+ border-radius: var(--radius-md);
2008
+ border: 1px solid var(--line);
2009
+ background: var(--bg-2);
2010
+ }
2011
+ .agi-approval__output-label {
2012
+ font-family: var(--font-mono);
2013
+ font-size: 11px;
2014
+ letter-spacing: 0.08em;
2015
+ text-transform: uppercase;
2016
+ color: var(--mute);
2017
+ }
2018
+ .agi-approval__kv {
2019
+ margin: 0;
2020
+ display: grid;
2021
+ gap: 6px;
2022
+ }
2023
+ .agi-approval__kv-row {
2024
+ display: grid;
2025
+ grid-template-columns: minmax(80px, 160px) 1fr;
2026
+ gap: 10px;
2027
+ align-items: start;
2028
+ }
2029
+ .agi-approval__kv dt {
2030
+ font-family: var(--font-mono);
2031
+ font-size: 12px;
2032
+ color: var(--text-2);
2033
+ word-break: break-word;
2034
+ }
2035
+ .agi-approval__kv dd {
2036
+ margin: 0;
2037
+ white-space: pre-wrap;
2038
+ word-break: break-word;
2039
+ font-size: 13.5px;
2040
+ }
2041
+ .agi-approval__form {
2042
+ display: grid;
2043
+ gap: 12px;
2044
+ }
2045
+ .agi-approval__json {
2046
+ font-family: var(--font-mono);
2047
+ font-size: 12.5px;
2048
+ }
2049
+ .agi-approval__actions {
2050
+ display: flex;
2051
+ align-items: center;
2052
+ gap: 10px;
2053
+ }
2054
+ .agi-approval__error {
2055
+ margin: 0;
2056
+ color: var(--bad);
2057
+ }
2058
+ .agi-approval__done {
2059
+ display: grid;
2060
+ gap: 8px;
2061
+ justify-items: start;
2062
+ padding: 12px;
2063
+ border-radius: var(--radius-md);
2064
+ border: 1px solid var(--line);
2065
+ background: var(--bg-2);
2066
+ }
2067
+ .agi-approval__done p {
2068
+ margin: 0;
2069
+ color: var(--text-2);
2070
+ }
2071
+
2072
+ /* \u2500\u2500\u2500 observability \u2500\u2500\u2500 */
2073
+ .agi-stats {
2074
+ display: grid;
2075
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
2076
+ gap: 12px;
2077
+ }
2078
+ .agi-stats__tile {
2079
+ display: grid;
2080
+ gap: 4px;
2081
+ padding: 16px;
2082
+ }
2083
+ .agi-stat__v.is-ok {
2084
+ color: var(--ok);
2085
+ }
2086
+ .agi-stat__v.is-warn {
2087
+ color: var(--warn);
2088
+ }
2089
+ .agi-stat__v.is-bad {
2090
+ color: var(--bad);
2091
+ }
2092
+ .agi-stats__delta {
2093
+ font-family: var(--font-mono);
2094
+ font-size: 11px;
2095
+ color: var(--text-2);
2096
+ }
2097
+
2098
+ .agi-heat {
2099
+ display: grid;
2100
+ gap: 6px;
2101
+ font-size: 12.5px;
2102
+ }
2103
+ .agi-heat__table {
2104
+ border-collapse: separate;
2105
+ border-spacing: 3px;
2106
+ width: 100%;
2107
+ table-layout: fixed;
2108
+ }
2109
+ .agi-heat__label {
2110
+ width: 140px;
2111
+ color: var(--text-2);
2112
+ font-weight: 400;
2113
+ text-align: left;
2114
+ white-space: nowrap;
2115
+ overflow: hidden;
2116
+ text-overflow: ellipsis;
2117
+ padding-right: 8px;
2118
+ }
2119
+ .agi-heat__col {
2120
+ font-family: var(--font-mono);
2121
+ font-size: 9.5px;
2122
+ font-weight: 500;
2123
+ letter-spacing: 0.06em;
2124
+ color: var(--mute);
2125
+ text-align: center;
2126
+ }
2127
+ .agi-heat__td {
2128
+ padding: 0;
2129
+ }
2130
+ .agi-heat__cell {
2131
+ display: block;
2132
+ height: 18px;
2133
+ border-radius: 3px;
2134
+ background: var(--line);
2135
+ }
2136
+ .agi-heat__cell.is-ok {
2137
+ background: var(--ok);
2138
+ }
2139
+ .agi-heat__cell.is-warn {
2140
+ background: var(--warn);
2141
+ }
2142
+ .agi-heat__cell.is-bad {
2143
+ background: var(--bad);
2144
+ }
2145
+ .agi-heat__cell.is-none {
2146
+ background: var(--line);
2147
+ opacity: 0.6;
2148
+ }
2149
+ .agi-heat__legend {
2150
+ display: flex;
2151
+ gap: 6px;
2152
+ }
2153
+
2154
+ .agi-timeline {
2155
+ list-style: none;
2156
+ margin: 0;
2157
+ padding: 0;
2158
+ display: grid;
2159
+ gap: 4px;
2160
+ }
2161
+ .agi-timeline__step {
2162
+ display: grid;
2163
+ grid-template-columns: 18px minmax(120px, 1fr) minmax(120px, 2fr) auto;
2164
+ gap: 10px;
2165
+ align-items: center;
2166
+ padding: 6px 8px;
2167
+ border-radius: var(--radius-md);
2168
+ border: 1px solid transparent;
2169
+ font-size: 13px;
2170
+ }
2171
+ .agi-timeline__step.is-running {
2172
+ background: var(--signal-soft);
2173
+ border-color: color-mix(in srgb, var(--signal) 40%, transparent);
2174
+ }
2175
+ .agi-timeline__step.is-waiting {
2176
+ background: var(--warn-soft);
2177
+ border-color: color-mix(in srgb, var(--warn) 45%, transparent);
2178
+ }
2179
+ .agi-timeline__step.is-error {
2180
+ background: var(--bad-soft);
2181
+ border-color: color-mix(in srgb, var(--bad) 45%, transparent);
2182
+ }
2183
+ .agi-timeline__glyph {
2184
+ color: var(--mute);
2185
+ text-align: center;
2186
+ }
2187
+ .agi-timeline__step.is-done .agi-timeline__glyph,
2188
+ .agi-timeline__step.k-verify .agi-timeline__glyph,
2189
+ .agi-timeline__step.k-write .agi-timeline__glyph {
2190
+ color: var(--ok);
2191
+ }
2192
+ .agi-timeline__step.is-running .agi-timeline__glyph {
2193
+ color: var(--signal);
2194
+ }
2195
+ .agi-timeline__step.is-waiting .agi-timeline__glyph,
2196
+ .agi-timeline__step.k-approval .agi-timeline__glyph {
2197
+ color: var(--warn);
2198
+ }
2199
+ .agi-timeline__name {
2200
+ color: var(--text);
2201
+ white-space: nowrap;
2202
+ overflow: hidden;
2203
+ text-overflow: ellipsis;
2204
+ }
2205
+ .agi-timeline__detail {
2206
+ display: block;
2207
+ color: var(--mute);
2208
+ font-size: 11.5px;
2209
+ }
2210
+ .agi-timeline__bar {
2211
+ position: relative;
2212
+ height: 6px;
2213
+ border-radius: 3px;
2214
+ background: var(--line);
2215
+ }
2216
+ .agi-timeline__fill {
2217
+ position: absolute;
2218
+ top: 0;
2219
+ bottom: 0;
2220
+ border-radius: 3px;
2221
+ background: var(--signal);
2222
+ }
2223
+ .agi-timeline__step.is-done .agi-timeline__fill {
2224
+ background: var(--ok);
2225
+ }
2226
+ .agi-timeline__step.is-error .agi-timeline__fill {
2227
+ background: var(--bad);
2228
+ }
2229
+ .agi-timeline__step.is-waiting .agi-timeline__fill {
2230
+ background: var(--warn);
2231
+ }
2232
+ .agi-timeline__meta {
2233
+ font-family: var(--font-mono);
2234
+ font-size: 11px;
2235
+ color: var(--mute);
2236
+ white-space: nowrap;
2237
+ }
2238
+
2239
+ .agi-bars {
2240
+ display: grid;
2241
+ gap: 8px;
2242
+ font-size: 13px;
2243
+ }
2244
+ .agi-bars__row {
2245
+ display: grid;
2246
+ grid-template-columns: minmax(100px, 1fr) minmax(120px, 3fr) auto;
2247
+ gap: 10px;
2248
+ align-items: center;
2249
+ }
2250
+ .agi-bars__label {
2251
+ color: var(--text-2);
2252
+ white-space: nowrap;
2253
+ overflow: hidden;
2254
+ text-overflow: ellipsis;
2255
+ }
2256
+ .agi-bars__track {
2257
+ height: 10px;
2258
+ border-radius: 5px;
2259
+ background: var(--line);
2260
+ overflow: hidden;
2261
+ }
2262
+ .agi-bars__fill {
2263
+ display: block;
2264
+ height: 100%;
2265
+ border-radius: 5px;
2266
+ }
2267
+ .agi-bars__value {
2268
+ font-family: var(--font-mono);
2269
+ font-size: 12px;
2270
+ color: var(--text);
2271
+ white-space: nowrap;
2272
+ display: grid;
2273
+ text-align: right;
2274
+ }
2275
+ .agi-bars__note {
2276
+ font-size: 10.5px;
2277
+ color: var(--mute);
2278
+ }
2279
+ `;function at(t){return{render:function(e){$t(e,t)},unmount:function(){Wt(t)}}}var ka="0.1.0",hn="aginies-embed-styles",ie=null;function wa(){if(typeof document>"u"||document.getElementById(hn))return;let t=document.createElement("style");t.id=hn,t.textContent=mn,document.head.appendChild(t)}function bn(t){return wa(),ie=Ge(t),ie}function vn(t){if(!ie)throw new Error("[aginies] call Aginies.init({ baseUrl, token }) before Aginies.chat()");let{container:e,mode:n="bubble",...a}=t,r=yn(e,n),i=at(r);return i.render(j(Te,{client:ie,children:j(nt,{...a,mode:n})})),{element:r,unmount:()=>{i.unmount(),r.dataset.aginiesOwned==="true"&&r.remove()}}}function xn(t){if(!ie)throw new Error("[aginies] call Aginies.init({ baseUrl, token }) before Aginies.approval()");let{container:e,...n}=t,a=yn(e,"approval"),r=at(a);return r.render(j(Te,{client:ie,children:j(Ke,n)})),{element:a,unmount:()=>{r.unmount(),a.dataset.aginiesOwned==="true"&&a.remove()}}}function yn(t,e){if(t){let a=typeof t=="string"?document.querySelector(t):t;if(!a)throw new Error(`[aginies] container not found: ${String(t)}`);return a}let n=document.createElement("div");return n.dataset.aginiesOwned="true",n.dataset.aginiesMode=e,document.body.appendChild(n),n}function kn(t=Ca()){if(!t)return null;let e=t.dataset;if(!e.baseUrl||!e.token)return null;if(bn({baseUrl:e.baseUrl,token:e.token,locale:e.locale==="tr"||e.locale==="en"?e.locale:void 0}),e.approval){let[a,r,i]=e.approval.split("/");if(!a||!r)return null;let s=()=>xn({workflowId:a,executionId:r,contextId:i,container:e.container});return document.readyState==="loading"?(document.addEventListener("DOMContentLoaded",()=>s(),{once:!0}),null):s()}if(!e.chat)return null;let n=()=>vn({identifier:e.chat,mode:e.mode??"bubble",position:e.position??"right",theme:e.theme??"auto",launcherLabel:e.label,container:e.container});return document.readyState==="loading"?(document.addEventListener("DOMContentLoaded",()=>n(),{once:!0}),null):n()}function Ca(){return typeof document>"u"?null:document.currentScript??null}typeof window<"u"&&kn();return Pn(Fa);})();
2280
+ //# sourceMappingURL=aginies.js.map