import{S as C,i as k,s as w,e as v,f as m,m as g,a as f,b as d,g as h,h as b,j as _,q as y,o as H,C as q,V as E,W as S,E as T,u as U,v as j,x as z,y as B,z as D,G}from"./index.bbdd6a1e.js";function p(o,t,s){const l=o.slice();return l[6]=t[s],l}function x(o){let t,s=o[6][0]+"",l,a,e,u=o[6][1]+"",n,c;return{c(){t=v("div"),l=m(s),a=g(),e=v("div"),n=m(u),c=g(),f(t,"data-testid","bot"),f(t,"class","px-3 py-2 rounded-[22px] rounded-br-none bg-orange-500 text-white ml-7 text-sm"),f(e,"data-testid","user"),f(e,"class","px-3 py-2 rounded-[22px] rounded-bl-none place-self-start bg-gray-200 mr-7 text-gray-800 text-sm")},m(i,r){d(i,t,r),h(t,l),d(i,a,r),d(i,e,r),h(e,n),h(e,c)},p(i,r){r&1&&s!==(s=i[6][0]+"")&&b(l,s),r&1&&u!==(u=i[6][1]+"")&&b(n,u)},d(i){i&&_(t),i&&_(a),i&&_(e)}}}function V(o){let t,s,l=o[0],a=[];for(let e=0;e<l.length;e+=1)a[e]=x(p(o,l,e));return{c(){t=v("div"),s=v("div");for(let e=0;e<a.length;e+=1)a[e].c();f(s,"class","flex flex-col items-end space-y-4 p-3"),f(t,"class","overflow-y-auto h-[40vh] border rounded-lg")},m(e,u){d(e,t,u),h(t,s);for(let n=0;n<a.length;n+=1)a[n].m(s,null);o[3](t)},p(e,[u]){if(u&1){l=e[0];let n;for(n=0;n<l.length;n+=1){const c=p(e,l,n);a[n]?a[n].p(c,u):(a[n]=x(c),a[n].c(),a[n].m(s,null))}for(;n<a.length;n+=1)a[n].d(1);a.length=l.length}},i:y,o:y,d(e){e&&_(t),H(a,e),o[3](null)}}}function W(o,t,s){let{value:l}=t,{style:a=""}=t,e,u;const n=q();E(()=>{u=e&&e.offsetHeight+e.scrollTop>e.scrollHeight-20}),S(()=>{u&&e.scrollTo(0,e.scrollHeight)});function c(i){T[i?"unshift":"push"](()=>{e=i,s(1,e)})}return o.$$set=i=>{"value"in i&&s(0,l=i.value),"style"in i&&s(2,a=i.style)},o.$$.update=()=>{o.$$.dirty&1&&l&&n("change")},[l,e,a,c]}class A extends C{constructor(t){super(),k(this,t,W,V,w,{value:0,style:2})}}function F(o){let t,s;return t=new A({props:{value:o[0],style:o[1]}}),t.$on("change",o[3]),{c(){U(t.$$.fragment)},m(l,a){j(t,l,a),s=!0},p(l,[a]){const e={};a&1&&(e.value=l[0]),a&2&&(e.style=l[1]),t.$set(e)},i(l){s||(z(t.$$.fragment,l),s=!0)},o(l){B(t.$$.fragment,l),s=!1},d(l){D(t,l)}}}function I(o,t,s){let{value:l=[]}=t,{default_value:a}=t,{style:e=""}=t;a&&(l=a);function u(n){G.call(this,o,n)}return o.$$set=n=>{"value"in n&&s(0,l=n.value),"default_value"in n&&s(2,a=n.default_value),"style"in n&&s(1,e=n.style)},[l,e,a,u]}class J extends C{constructor(t){super(),k(this,t,I,F,w,{value:0,default_value:2,style:1})}}var L=J;const M=["static"];export{L as Component,M as modes};
