diff --git "a/build/client/_app/immutable/nodes/2.wFiHgCdw.js" "b/build/client/_app/immutable/nodes/2.wFiHgCdw.js" new file mode 100644--- /dev/null +++ "b/build/client/_app/immutable/nodes/2.wFiHgCdw.js" @@ -0,0 +1,30 @@ +import{n as ae,K as Ln,s as Pe,B as gt,e as R,a as G,c as z,b as F,g as X,f as _,l as d,W as Ye,i as N,h as p,C as _t,D as bt,E as vt,X as tl,k as wt,Y as ge,Z as Ut,w as Kt,_ as ll,v as Mn,A as Nn,y as ce,u as De,$ as ye,o as Q,r as pt,a0 as ht,a1 as mt,t as Se,d as Ce,x as He,j as tt,q as Ae,m as rt,a2 as Vn,a3 as gl,a4 as Je,a5 as ot,a6 as kn,I as En,a7 as qn,a8 as Ne,a9 as Vt,aa as qt,H as jn,ab as Un,ac as Yt,ad as Jt,p as Wt,ae as _e,af as Hn}from"../chunks/scheduler.PJbBD1N5.js";import{n as Wn,l as Kn,f as Gn,h as Xn,S as Le,i as Me,t as O,a as q,g as Fe,c as Be,j as Sn,k as Cn,o as be,b as ve,d as pe,m as ke,e as Ee}from"../chunks/index.T0jHVBP-.js";import{w as Ot,r as Yn}from"../chunks/entry.uT2YBcwe.js";import{e as Qe,u as Jn,f as Qn}from"../chunks/each.6jB_CAAR.js";const yn=!0;function Zn(n,e,t,l){if(!e)return ae;const u=n.getBoundingClientRect();if(e.left===u.left&&e.right===u.right&&e.top===u.top&&e.bottom===u.bottom)return ae;const{delay:s=0,duration:i=300,easing:r=Ln,start:a=Wn()+s,end:o=a+i,tick:c=ae,css:f}=t(n,{from:e,to:u},l);let h=!0,m=!1,g;function b(){f&&(g=Gn(n,0,1,i,s,r,f)),s||(m=!0)}function C(){f&&Xn(n,g),h=!1}return Kn(v=>{if(!m&&v>=a&&(m=!0),m&&v>=o&&(c(1,0),C()),!h)return!1;if(m){const E=v-a,S=0+1*r(E/i);c(S,1-S)}return!0}),b(),c(0,1),C}function xn(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:l}=e,u=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=l,Dn(n,u)}}function Dn(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const l=getComputedStyle(n),u=l.transform==="none"?"":l.transform;n.style.transform=`${u} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}function Tn(n,e){const t={},l={},u={$$scope:1};let s=n.length;for(;s--;){const i=n[s],r=e[s];if(r){for(const a in i)a in r||(l[a]=1);for(const a in r)u[a]||(t[a]=r[a],u[a]=1);n[s]=r}else for(const a in i)u[a]=1}for(const i in l)i in t||(t[i]=void 0);return t}const $n=!0,Ei=Object.freeze(Object.defineProperty({__proto__:null,prerender:$n},Symbol.toStringTag,{value:"Module"}));function Gt(n){if(!n.endsWith("px"))return;const e=parseFloat(n.slice(0,n.length-2));return isNaN(e)?void 0:e}const Rn=n=>n?"height":"width",$t=n=>window.getComputedStyle(n),el=n=>n.getBoundingClientRect(),eu=(n,e=!0)=>{if(n.getPropertyValue("box-sizing")==="border-box")return;const t=Gt(n.getPropertyValue("border-left-width"));if(t===void 0){console.error("Splitpanes Error: Fail to parse container `border-left-width`.");return}const l=Gt(n.getPropertyValue("border-top-width"));if(l===void 0){console.error("Splitpanes Error: Fail to parse container `border-top-width`.");return}const u={left:t,top:l};if(e){const s=Gt(n.getPropertyValue("border-right-width"));if(s===void 0){console.error("Splitpanes Error: Fail to parse container `border-right-width`.");return}const i=Gt(n.getPropertyValue("border-bottom-width"));if(i===void 0){console.error("Splitpanes Error: Fail to parse container `border-bottom-width`.");return}const r=u;r.right=s,r.bottom=i}return u};function tu(n,e){e||(e=$t(n));const t=el(n),l=eu(e,!0)||{left:0,top:0,right:0,bottom:0};return{width:t.width-l.left-l.right,height:t.height-l.top-l.bottom,left:t.left+l.left,top:t.top+l.top}}const _l=(n,e)=>({left:n.left-e.left,top:n.top-e.top});function bl(n){const e=n,t=n,{clientX:l,clientY:u}="ontouchstart"in window&&t.touches?t.touches[0]:e;return{left:l,top:u}}function vl(n,e,t,l){let u=0;for(let s=e;st(31,s=y));const se=Ot(m);wt(n,se,y=>t(30,u=y));const ue=Ot(void 0);wt(n,ue,y=>t(29,l=y));let B=null,le=null;ge(zn,{showFirstSplitter:se,veryFirstPaneKey:ue,isHorizontal:$,ssrRegisterPaneSize:void 0,onPaneInit:y=>(l===void 0&&Ut(ue,l=y,l),{undefinedPaneInitSize:0}),clientOnly:{onPaneAdd:oe,onPaneRemove:W}});function oe(y){let H=-1;Array.from(y.element.parentNode.children).some(M=>(M.className.includes("splitpanes__pane")&&H++,M===y.element)),H===0&&Ut(ue,l=y.key,l),D.splice(H,0,y);for(let M=0;M{y.isReady=!0,v("pane-add",{index:H,panes:lt()})});const K=(M,Y=!0)=>j=>{(Y||y.index>0)&&M(j,y)};return{onSplitterDown:K(Re,!1),onSplitterClick:K(yt,!1),onSplitterDblClick:K(Ge),onPaneClick:K(ie),reportGivenSizeChange:K(x)}}async function W(y){const H=D.findIndex(K=>K.key===y);if(H>=0){const K=D.splice(H,1)[0];for(let M=0;M0?D[0].key:void 0,l),S&&(await Tt(),v("pane-remove",{removed:K,panes:lt()}))}}function ie(y,H){v("pane-click",H)}function x(y,H){H.setSz(y),Tt()}Kt(()=>{Rt(),nt();for(let y=0;y{t(6,A=!0)},0)}),ll(()=>{S&&Ve(),S=!1}),Mn(()=>{Rt()});function U(y){if(h==="auto")try{return(y??$t(E)).direction==="rtl"}catch{}return h===!0}function ct(){document.body.style.cursor=$?"col-resize":"row-resize",document.addEventListener("mousemove",dt,{passive:!1}),document.addEventListener("mouseup",Ke),"ontouchstart"in window&&(document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ke))}function Ve(){document.body.style.cursor="",document.removeEventListener("mousemove",dt),document.removeEventListener("mouseup",Ke),"ontouchstart"in window&&(document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ke))}const ft=y=>y.nodeType===Node.ELEMENT_NODE&&y.classList.contains("splitpanes__splitter");function Z(y,H,K){let M=y[o?"top":"left"];return K&&!o&&(M=H-M),M}const We=()=>Rn(o);function Re(y,H){t(7,w=!0),V=H.index,H.setSplitterActive(!0);let M=H.element;for(;M!=null&&(M=M.previousSibling,!ft(M)););if(M==null){console.error("Splitpane Error: Active splitter wasn't found!");return}B=M;const Y=bl(y),j=el(B);le=Z(_l(Y,j),j[We()],U()),ct()}function dt(y){if(w){y.preventDefault(),t(8,k=!0);const H=bl(y),K=$t(E),M=tu(E,K),Y=M[We()],j=U(K),J=_l(H,M),ne=Z(J,Y,j);Dt(ne,Y),v("resize",lt())}}function Ke(){k&&v("resized",lt()),t(7,w=!1),D[V].setSplitterActive(!1),setTimeout(()=>{t(8,k=!1),Ve()},100)}function yt(y,H){if("ontouchstart"in window){y.preventDefault();const K=H.index;f&&(I===K?(te&&clearTimeout(te),te=null,Ge(y,H),I=-1):(I=K,te=setTimeout(()=>{I=-1},500)))}k||v("splitter-click",H)}function Ge(y,H){if(f){const K=H.index;let M=0;for(let J=0;J=100)for(let J=0;J{const me=fe.min(),Oe=fe.max(),qe=Math.min(Math.max(0,J),Oe-me);fe.setSz(me+qe),J-=qe};for(let fe=K-1;fe>=0;fe--)ne(D[fe]);for(let fe=K+1;feD.map(y=>({min:y.min(),max:y.max(),size:y.sz(),snap:y.snap()}));function It(y,H){const K=Oe=>el(Oe)[We()],M=K(B);let Y=0,j=B.previousSibling;for(;j!=null;)ft(j)&&(Y+=K(j)),j=j.previousSibling;let J=0,ne=B.nextSibling;for(;ne!=null;)ft(ne)&&(J+=K(ne)),ne=ne.nextSibling;const fe=Y+le,me=Y+M+J;return(y-fe)/(H-me)*100}function Dt(y,H){let K=V-1,M=D[K],Y=V,j=D[Y],J={prevPanesSize:Ft(K),nextPanesSize:kt(Y),prevReachedMinPanes:0,nextReachedMinPanes:0};const ne=0+(c?0:J.prevPanesSize),fe=100-(c?0:J.nextPanesSize),me=Math.max(Math.min(It(y,H),fe),ne),Oe=J.prevPanesSize+M.min()+M.snap(),qe=100-(J.nextPanesSize+j.min()+j.snap());let de=me,Te=!1;me<=Oe?me>J.prevPanesSize+M.min()&&(de=Math.max(M.min()+J.prevPanesSize,100-(j.max()+J.nextPanesSize)),Te=!0):me>=qe&&me<100-J.nextPanesSize-j.min()&&(de=Math.min(100-(j.min()+J.nextPanesSize),M.max()+J.prevPanesSize),Te=!0);const Bt=M.max()<100&&de>=M.max()+J.prevPanesSize,L=j.max()<100&&de<=100-(j.max()+J.nextPanesSize);if(Bt||L)Bt?(M.setSz(M.max()),j.setSz(Math.max(100-M.max()-J.prevPanesSize-J.nextPanesSize,0))):(M.setSz(Math.max(100-j.max()-J.prevPanesSize-J.nextPanesSize,0)),j.setSz(j.max()));else{if(c&&!Te){const he=Ze(J,de);if(!he)return;({sums:J,paneBeforeIndex:K,paneAfterIndex:Y}=he),M=D[K],j=D[Y]}K!=null&&M.setSz(Math.min(Math.max(de-J.prevPanesSize-J.prevReachedMinPanes,M.min()),M.max())),Y!=null&&j.setSz(Math.min(Math.max(100-de-J.nextPanesSize-J.nextReachedMinPanes,j.min()),j.max()))}}function Ze(y,H){const K=V-1;let M=K,Y=K+1;if(H{j.setSz(j.min()),y.prevReachedMinPanes+=j.min()}),y.prevPanesSize=Ft(M),M==null))return y.prevReachedMinPanes=0,D[0].setSz(D[0].min()),Xt(D,1,K+1,j=>{j.setSz(j.min()),y.prevReachedMinPanes+=j.min()}),D[Y].setSz(100-y.prevReachedMinPanes-D[0].min()-y.prevPanesSize-y.nextPanesSize),null;if(H>100-y.nextPanesSize-D[Y].min()){Y=Lt(K)?.index,y.nextReachedMinPanes=0,Y>K+1&&Xt(D,K+1,Y,J=>{J.setSz(J.min()),y.nextReachedMinPanes+=J.min()}),y.nextPanesSize=kt(Y);const j=D.length;if(Y==null)return y.nextReachedMinPanes=0,D[j-1].setSz(D[j-1].min()),Xt(D,K+1,j-1,J=>{J.setSz(J.min()),y.nextReachedMinPanes+=J.min()}),D[M].setSz(100-y.prevPanesSize-y.nextReachedMinPanes-D[j-1].min()-y.nextPanesSize),null}return{sums:y,paneBeforeIndex:M,paneAfterIndex:Y}}const Pt=y=>y.sz(),Ft=y=>vl(D,0,y,Pt),kt=y=>vl(D,y+1,D.length,Pt),xe=y=>[...D].reverse().find(H=>H.indexH.min()),Lt=y=>D.find(H=>H.index>y+1&&H.sz()>H.min());async function Tt(){T=!0,await Nn(),T&&(nt(),T=!1)}function nt(){Mt(),S&&v("resized",lt())}function Mt(){if(D.length===0)return;const y=D.length;let H=100,K=0,M=0,Y=0,j=[],J=[];for(let qe=0;qe=de.max()&&j.push(de),Te<=de.min()&&J.push(de)):M+=1:(H-=Te,K++,j.push(de),J.push(de))}const ne=y-K,fe=ne-M;let me,Oe;if(fe>0?(me=Y/fe,me>.1&&H>.1?(Y+=M*me,Oe=H/Y):(me=0,Oe=1)):(me=H/ne,Oe=1),H+Y>.1){H=100;for(let qe=0;qe.1&&(H=Nt(H,j,J))}isFinite(H)?Math.abs(H)>.1&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints."):console.warn("Splitpanes: Internal error, sizes might be NaN as a result.")}function Nt(y,H,K){const Y=D.length-(y>0?H.length:K.length);if(Y<=0)return y;const j=y/Y;if(D.length===1)D[0].setSz(100),y=0;else for(let J=0;J0&&!H.includes(ne)){const me=Math.max(Math.min(fe+j,ne.max()),ne.min()),Oe=me-fe;y-=Oe,ne.setSz(me)}else if(!K.includes(ne)){const me=Math.max(Math.min(fe+j,ne.max()),ne.min()),Oe=me-fe;y-=Oe,ne.setSz(me)}}return y}function Rt(){const{children:y}=E;let H=0,K=!1;for(let M=0;M elements are allowed at the root of . One of your DOM nodes was removed.");return}else j&&(!K&&D[H].element!==Y&&(K=!0),H++)}if(K){const M=[];for(let Y=0;Yfe.element===j);ne!=null?(ne.index=M.length,M.push(ne)):console.warn("Splitpanes: Internal error - found a elements which isn't tracked.")}}D=M,Ut(ue,l=D.length>0?D[0].key:void 0,l)}}function Et(y){ce[y?"unshift":"push"](()=>{E=y,t(5,E)})}return n.$$set=y=>{"id"in y&&t(0,a=y.id),"horizontal"in y&&t(1,o=y.horizontal),"pushOtherPanes"in y&&t(12,c=y.pushOtherPanes),"dblClickSplitter"in y&&t(13,f=y.dblClickSplitter),"rtl"in y&&t(14,h=y.rtl),"firstSplitter"in y&&t(15,m=y.firstSplitter),"style"in y&&t(2,g=y.style),"theme"in y&&t(3,b=y.theme),"class"in y&&t(4,C=y.class),"$$scope"in y&&t(18,r=y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&2&&Ut($,s=o,s),n.$$.dirty[0]&32768&&Ut(se,u=m,u)},[a,o,g,b,C,E,A,w,k,$,se,ue,c,f,h,m,i,Et,r]}class uu extends Le{constructor(e){super(),Me(this,e,nu,lu,Pe,{id:0,horizontal:1,pushOtherPanes:12,dblClickSplitter:13,rtl:14,firstSplitter:15,style:2,theme:3,class:4},null,[-1,-1,-1])}}const su=(n,e)=>t=>{const l=n();l?.[e](t)},iu=n=>su.bind(null,n);function au(n){let e,t,l,u,s,i,r=(n[4]!==n[9]||n[5])&&pl(n);const a=n[20].default,o=gt(a,n,n[19],null);return{c(){r&&r.c(),e=G(),t=R("div"),o&&o.c(),this.h()},l(c){r&&r.l(c),e=X(c),t=z(c,"DIV",{class:!0,style:!0});var f=F(t);o&&o.l(f),f.forEach(_),this.h()},h(){d(t,"class",l=`splitpanes__pane ${n[0]||""}`),d(t,"style",n[3])},m(c,f){r&&r.m(c,f),N(c,e,f),N(c,t,f),o&&o.m(t,null),n[21](t),u=!0,s||(i=Q(t,"click",n[11]("onPaneClick")),s=!0)},p(c,f){c[4]!==c[9]||c[5]?r?r.p(c,f):(r=pl(c),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),o&&o.p&&(!u||f&524288)&&_t(o,a,c,c[19],u?vt(a,c[19],f,null):bt(c[19]),null),(!u||f&1&&l!==(l=`splitpanes__pane ${c[0]||""}`))&&d(t,"class",l),(!u||f&8)&&d(t,"style",c[3])},i(c){u||(O(o,c),u=!0)},o(c){q(o,c),u=!1},d(c){c&&(_(e),_(t)),r&&r.d(c),o&&o.d(c),n[21](null),s=!1,i()}}}function pl(n){let e,t,l,u;return{c(){e=R("div"),this.h()},l(s){e=z(s,"DIV",{class:!0}),F(e).forEach(_),this.h()},h(){d(e,"class",t="splitpanes__splitter "+(n[2]?"splitpanes__splitter__active":""))},m(s,i){N(s,e,i),l||(u=[Q(e,"mousedown",n[11]("onSplitterDown")),Q(e,"touchstart",n[11]("onSplitterDown")),Q(e,"click",n[11]("onSplitterClick")),Q(e,"dblclick",n[11]("onSplitterDblClick"))],l=!0)},p(s,i){i&4&&t!==(t="splitpanes__splitter "+(s[2]?"splitpanes__splitter__active":""))&&d(e,"class",t)},d(s){s&&_(e),l=!1,pt(u)}}}function ru(n){let e,t,l=!n[10]&&au(n);return{c(){l&&l.c(),e=De()},l(u){l&&l.l(u),e=De()},m(u,s){l&&l.m(u,s),N(u,e,s),t=!0},p(u,[s]){u[10]||l.p(u,s)},i(u){t||(O(l),t=!0)},o(u){q(l),t=!1},d(u){u&&_(e),l&&l.d(u)}}}function ou(n,e,t){let l,u,s,i,r,{$$slots:a={},$$scope:o}=e;const{ssrRegisterPaneSize:c,onPaneInit:f,clientOnly:h,isHorizontal:m,showFirstSplitter:g,veryFirstPaneKey:b}=ye(zn);wt(n,m,B=>t(18,s=B)),wt(n,g,B=>t(5,r=B)),wt(n,b,B=>t(4,i=B));let{size:C=null}=e,{minSize:v=0}=e,{maxSize:E=100}=e,{snapSize:S=0}=e,{class:T=""}=e;const A={},w=!yn,{undefinedPaneInitSize:k}=f(A);let V,I=C??k,te=!1,D;const $=iu(()=>D),se=B=>{B!=I&&$("reportGivenSizeChange")(B)};Kt(()=>{const B={key:A,element:V,givenSize:C,sz:()=>I,setSz:le=>{t(16,I=le),C!=null&&C!=I&&t(12,C=I)},min:()=>v,max:()=>E,snap:()=>S,setSplitterActive:le=>{t(2,te=le)},isReady:!1};D=h.onPaneAdd(B)}),ll(()=>{h.onPaneRemove(A)});function ue(B){ce[B?"unshift":"push"](()=>{V=B,t(1,V)})}return n.$$set=B=>{"size"in B&&t(12,C=B.size),"minSize"in B&&t(13,v=B.minSize),"maxSize"in B&&t(14,E=B.maxSize),"snapSize"in B&&t(15,S=B.snapSize),"class"in B&&t(0,T=B.class),"$$scope"in B&&t(19,o=B.$$scope)},n.$$.update=()=>{n.$$.dirty&4096&&C!=null&&se(C),n.$$.dirty&262144&&t(17,l=Rn(s)),n.$$.dirty&196608&&t(3,u=`${l}: ${I}%;`)},[T,V,te,u,i,r,m,g,b,A,w,$,C,v,E,S,I,l,s,o,a,ue]}class kl extends Le{constructor(e){super(),Me(this,e,ou,ru,Pe,{size:12,minSize:13,maxSize:14,snapSize:15,class:0})}}function cu(n){let e,t,l,u,s,i,r;return{c(){e=ht("svg"),t=ht("circle"),l=ht("animate"),u=ht("circle"),s=ht("animate"),i=ht("circle"),r=ht("animate"),this.h()},l(a){e=mt(a,"svg",{version:!0,id:!0,xmlns:!0,"xmlns:xlink":!0,x:!0,y:!0,viewBox:!0,"enable-background":!0,"xml:space":!0});var o=F(e);t=mt(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var c=F(t);l=mt(c,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(l).forEach(_),c.forEach(_),u=mt(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var f=F(u);s=mt(f,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(s).forEach(_),f.forEach(_),i=mt(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var h=F(i);r=mt(h,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(r).forEach(_),h.forEach(_),o.forEach(_),this.h()},h(){d(l,"attributeName","opacity"),d(l,"dur","1s"),d(l,"values","0;1;0"),d(l,"repeatCount","indefinite"),d(l,"begin","0.1"),d(t,"fill","#1976d2"),d(t,"stroke","none"),d(t,"cx","6"),d(t,"cy","50"),d(t,"r","6"),d(s,"attributeName","opacity"),d(s,"dur","1s"),d(s,"values","0;1;0"),d(s,"repeatCount","indefinite"),d(s,"begin","0.2"),d(u,"fill","#1976d2"),d(u,"stroke","none"),d(u,"cx","26"),d(u,"cy","50"),d(u,"r","6"),d(r,"attributeName","opacity"),d(r,"dur","1s"),d(r,"values","0;1;0"),d(r,"repeatCount","indefinite"),d(r,"begin","0.3"),d(i,"fill","#1976d2"),d(i,"stroke","none"),d(i,"cx","46"),d(i,"cy","50"),d(i,"r","6"),d(e,"version","1.1"),d(e,"id","L4"),d(e,"xmlns","http://www.w3.org/2000/svg"),d(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),d(e,"x","0px"),d(e,"y","0px"),d(e,"viewBox","0 0 100 100"),d(e,"enable-background","new 0 0 0 0"),d(e,"xml:space","preserve")},m(a,o){N(a,e,o),p(e,t),p(t,l),p(e,u),p(u,s),p(e,i),p(i,r)},p:ae,i:ae,o:ae,d(a){a&&_(e)}}}function fu(n,e,t){let{size:l=20}=e;return n.$$set=u=>{"size"in u&&t(0,l=u.size)},[l]}class du extends Le{constructor(e){super(),Me(this,e,fu,cu,Pe,{size:0})}}function hu(n){let e,t,l,u,s;return{c(){e=R("div"),t=ht("svg"),l=ht("circle"),u=G(),s=Se(n[2]),this.h()},l(i){e=z(i,"DIV",{class:!0});var r=F(e);t=mt(r,"svg",{class:!0,viewBox:!0,xmlns:!0});var a=F(t);l=mt(a,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),F(l).forEach(_),a.forEach(_),u=X(r),s=Ce(r,n[2]),r.forEach(_),this.h()},h(){d(l,"cx","10"),d(l,"cy","10"),d(l,"r","5"),d(l,"fill",n[0]),He(l,"filter","drop-shadow(0 0 1px "+n[1]+")"),d(t,"class","dot svelte-a20mi8"),d(t,"viewBox","0 0 20 20"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(e,"class","llm-health-status svelte-a20mi8")},m(i,r){N(i,e,r),p(e,t),p(t,l),p(e,u),p(e,s)},p(i,[r]){r&1&&d(l,"fill",i[0]),r&2&&He(l,"filter","drop-shadow(0 0 1px "+i[1]+")"),r&4&&tt(s,i[2])},i:ae,o:ae,d(i){i&&_(e)}}}function mu(n,e,t){let{status:l="unknown"}=e,u="",s="",i="";switch(l){case"ok":u="#4CAF50",s="rgba(0, 128, 0, 0.7)",i="Сервис LLM работает";break;case"error":i="Сервис LLM не работает";break;case"loading model":u="yellow",s="rgba(255, 255, 0, 0.7)",i="Сервис LLM запускается...";break;case"unavailable":u="#af4f4c",s="#af4f4c",i="Сервис LLM не запущен";break;case"unknown":u="#af4f4c",s="#af4f4c",i="Сервис LLM недоступен";break}return n.$$set=r=>{"status"in r&&t(3,l=r.status)},[u,s,i,l]}class gu extends Le{constructor(e){super(),Me(this,e,mu,hu,Pe,{status:3})}}function _u(n){let e,t,l,u,s;return{c(){e=R("div"),t=ht("svg"),l=ht("circle"),u=G(),s=Se(n[2]),this.h()},l(i){e=z(i,"DIV",{class:!0});var r=F(e);t=mt(r,"svg",{class:!0,viewBox:!0,xmlns:!0});var a=F(t);l=mt(a,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),F(l).forEach(_),a.forEach(_),u=X(r),s=Ce(r,n[2]),r.forEach(_),this.h()},h(){d(l,"cx","10"),d(l,"cy","10"),d(l,"r","5"),d(l,"fill",n[0]),He(l,"filter","drop-shadow(0 0 1px "+n[1]+")"),d(t,"class","dot svelte-1wcf73j"),d(t,"viewBox","0 0 20 20"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(e,"class","llm-health-status svelte-1wcf73j")},m(i,r){N(i,e,r),p(e,t),p(t,l),p(e,u),p(e,s)},p(i,[r]){r&1&&d(l,"fill",i[0]),r&2&&He(l,"filter","drop-shadow(0 0 1px "+i[1]+")"),r&4&&tt(s,i[2])},i:ae,o:ae,d(i){i&&_(e)}}}function bu(n,e,t){let{status:l="unavailable"}=e,u="",s="",i="";switch(l){case"ok":u="#4CAF50",s="rgba(0, 128, 0, 0.7)",i="Поиск работает";break;case"unavailable":u="#af4f4c",s="#af4f4c",i="Поиск не запущен";break;case"unknown":u="#af4f4c",s="#af4f4c",i="Поиск недоступен";break}return n.$$set=r=>{"status"in r&&t(3,l=r.status)},[u,s,i,l]}class vu extends Le{constructor(e){super(),Me(this,e,bu,_u,Pe,{status:3})}}function pu(n){let e,t,l,u,s,i="Сохранить",r,a,o="Сбросить",c,f;return{c(){e=R("div"),t=R("div"),l=R("textarea"),u=G(),s=R("button"),s.textContent=i,r=G(),a=R("button"),a.textContent=o,this.h()},l(h){e=z(h,"DIV",{class:!0});var m=F(e);t=z(m,"DIV",{class:!0});var g=F(t);l=z(g,"TEXTAREA",{class:!0}),F(l).forEach(_),u=X(g),s=z(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(s)!=="svelte-g0hhac"&&(s.textContent=i),r=X(g),a=z(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(a)!=="svelte-16kemh0"&&(a.textContent=o),g.forEach(_),m.forEach(_),this.h()},h(){d(l,"class","svelte-sfudwy"),d(s,"class","svelte-sfudwy"),d(a,"class","svelte-sfudwy"),d(t,"class","popup svelte-sfudwy"),d(e,"class","modal svelte-sfudwy")},m(h,m){N(h,e,m),p(e,t),p(t,l),rt(l,n[0]),p(t,u),p(t,s),p(t,r),p(t,a),c||(f=[Q(l,"input",n[6]),Q(s,"click",n[1]),Q(a,"click",n[2])],c=!0)},p(h,[m]){m&1&&rt(l,h[0])},i:ae,o:ae,d(h){h&&_(e),c=!1,pt(f)}}}let ku='Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям. Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы. При ответе на вопрос ты используешь только такой формат ответа: 1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя. 2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя). 3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)." 4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту." Вопрос: {{ВОПРОС}} Источники: {{ИСТОЧНИКИ}}';function Eu(n,e,t){let{onSave:l}=e,{onClose:u}=e,{text:s=""}=e,i=s;function r(){l(i),u()}function a(){t(0,i=ku)}function o(){i=this.value,t(0,i)}return n.$$set=c=>{"onSave"in c&&t(3,l=c.onSave),"onClose"in c&&t(4,u=c.onClose),"text"in c&&t(5,s=c.text)},[i,r,a,l,u,s,o]}class Su extends Le{constructor(e){super(),Me(this,e,Eu,pu,Pe,{onSave:3,onClose:4,text:5})}}const Cu="drawerStore";function yu(){const n=Du();return ge(Cu,n)}function Du(){const{subscribe:n,set:e,update:t}=Ot({});return{subscribe:n,set:e,update:t,open:l=>t(()=>({open:!0,...l})),close:()=>t(l=>(l.open=!1,l))}}const Tu="modalStore";function Ru(){const n=zu();return ge(Tu,n)}function zu(){const{subscribe:n,set:e,update:t}=Ot([]);return{subscribe:n,set:e,update:t,trigger:l=>t(u=>(u.push(l),u)),close:()=>t(l=>(l.length>0&&l.shift(),l)),clear:()=>e([])}}const wu={message:"Missing Toast Message",autohide:!0,timeout:5e3},wn="toastStore";function In(){const n=ye(wn);if(!n)throw new Error("toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!");return n}function Iu(){const n=Fu();return ge(wn,n)}function Pu(){const n=Math.random();return Number(n).toString(32)}function Fu(){const{subscribe:n,set:e,update:t}=Ot([]),l=s=>t(i=>{if(i.length>0){const r=i.findIndex(o=>o.id===s),a=i[r];a&&(a.callback&&a.callback({id:s,status:"closed"}),a.timeoutId&&clearTimeout(a.timeoutId),i.splice(r,1))}return i});function u(s){if(s.autohide===!0)return setTimeout(()=>{l(s.id)},s.timeout)}return{subscribe:n,close:l,trigger:s=>{const i=Pu();return t(r=>{s&&s.callback&&s.callback({id:i,status:"queued"}),s.hideDismiss&&(s.autohide=!0);const a={...wu,...s,id:i};return a.timeoutId=u(a),r.push(a),r}),i},freeze:s=>t(i=>(i.length>0&&clearTimeout(i[s].timeoutId),i)),unfreeze:s=>t(i=>(i.length>0&&(i[s].timeoutId=u(i[s])),i)),clear:()=>e([])}}function Bu(){Ru(),Iu(),yu()}const xt={};function El(n){return n==="local"?localStorage:sessionStorage}function nl(n,e,t){const l=t?.serializer??JSON,u=t?.storage??"local";function s(i,r){El(u).setItem(i,l.stringify(r))}if(!xt[n]){const i=Ot(e,o=>{const c=El(u).getItem(n);c&&o(l.parse(c));{const f=h=>{h.key===n&&o(h.newValue?l.parse(h.newValue):null)};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)}}),{subscribe:r,set:a}=i;xt[n]={set(o){s(n,o),a(o)},update(o){const c=o(Vn(i));s(n,c),a(c)},subscribe:r}}return xt[n]}nl("modeOsPrefers",!1);nl("modeUserPrefers",void 0);nl("modeCurrent",!1);const Pn="(prefers-reduced-motion: reduce)";function Au(){return window.matchMedia(Pn).matches}const Fn=Yn(Au(),n=>{{const e=l=>{n(l.matches)},t=window.matchMedia(Pn);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}});function ul(n){const e=n-1;return e*e*e+1}function Sl(n,{delay:e=0,duration:t=400,easing:l=ul,x:u=0,y:s=0,opacity:i=0}={}){const r=getComputedStyle(n),a=+r.opacity,o=r.transform==="none"?"":r.transform,c=a*(1-i),[f,h]=gl(u),[m,g]=gl(s);return{delay:e,duration:t,easing:l,css:(b,C)=>` + transform: ${o} translate(${(1-b)*f}${h}, ${(1-b)*m}${g}); + opacity: ${a-c*C}`}}function Cl(n,{delay:e=0,duration:t=400,easing:l=ul,axis:u="y"}={}){const s=getComputedStyle(n),i=+s.opacity,r=u==="y"?"height":"width",a=parseFloat(s[r]),o=u==="y"?["top","bottom"]:["left","right"],c=o.map(v=>`${v[0].toUpperCase()}${v.slice(1)}`),f=parseFloat(s[`padding${c[0]}`]),h=parseFloat(s[`padding${c[1]}`]),m=parseFloat(s[`margin${c[0]}`]),g=parseFloat(s[`margin${c[1]}`]),b=parseFloat(s[`border${c[0]}Width`]),C=parseFloat(s[`border${c[1]}Width`]);return{delay:e,duration:t,easing:l,css:v=>`overflow: hidden;opacity: ${Math.min(v*20,1)*i};${r}: ${v*a}px;padding-${o[0]}: ${v*f}px;padding-${o[1]}: ${v*h}px;margin-${o[0]}: ${v*m}px;margin-${o[1]}: ${v*g}px;border-${o[0]}-width: ${v*b}px;border-${o[1]}-width: ${v*C}px;`}}function Ou(n){let e,t,l;const u=n[19].default,s=gt(u,n,n[18],null);return{c(){e=R("div"),s&&s.c(),this.h()},l(i){e=z(i,"DIV",{class:!0,"data-testid":!0});var r=F(e);s&&s.l(r),r.forEach(_),this.h()},h(){d(e,"class",t="accordion "+n[0]),d(e,"data-testid","accordion")},m(i,r){N(i,e,r),s&&s.m(e,null),l=!0},p(i,[r]){s&&s.p&&(!l||r&262144)&&_t(s,u,i,i[18],l?vt(u,i[18],r,null):bt(i[18]),null),(!l||r&1&&t!==(t="accordion "+i[0]))&&d(e,"class",t)},i(i){l||(O(s,i),l=!0)},o(i){q(s,i),l=!1},d(i){i&&_(e),s&&s.d(i)}}}function Lu(n,e,t){let l,u;wt(n,Fn,I=>t(20,u=I));let{$$slots:s={},$$scope:i}=e,{autocollapse:r=!1}=e,{width:a="w-full"}=e,{spacing:o="space-y-1"}=e,{disabled:c=!1}=e,{padding:f="py-2 px-4"}=e,{hover:h="hover:bg-primary-hover-token"}=e,{rounded:m="rounded-container-token"}=e,{caretOpen:g="rotate-180"}=e,{caretClosed:b=""}=e,{regionControl:C=""}=e,{regionPanel:v="space-y-4"}=e,{regionCaret:E=""}=e,{transitions:S=!u}=e,{transitionIn:T=Cl}=e,{transitionInParams:A={duration:200}}=e,{transitionOut:w=Cl}=e,{transitionOutParams:k={duration:200}}=e;const V=Ot(null);return ge("active",V),ge("autocollapse",r),ge("disabled",c),ge("padding",f),ge("hover",h),ge("rounded",m),ge("caretOpen",g),ge("caretClosed",b),ge("regionControl",C),ge("regionPanel",v),ge("regionCaret",E),ge("transitions",S),ge("transitionIn",T),ge("transitionInParams",A),ge("transitionOut",w),ge("transitionOutParams",k),n.$$set=I=>{t(22,e=Je(Je({},e),ot(I))),"autocollapse"in I&&t(1,r=I.autocollapse),"width"in I&&t(2,a=I.width),"spacing"in I&&t(3,o=I.spacing),"disabled"in I&&t(4,c=I.disabled),"padding"in I&&t(5,f=I.padding),"hover"in I&&t(6,h=I.hover),"rounded"in I&&t(7,m=I.rounded),"caretOpen"in I&&t(8,g=I.caretOpen),"caretClosed"in I&&t(9,b=I.caretClosed),"regionControl"in I&&t(10,C=I.regionControl),"regionPanel"in I&&t(11,v=I.regionPanel),"regionCaret"in I&&t(12,E=I.regionCaret),"transitions"in I&&t(13,S=I.transitions),"transitionIn"in I&&t(14,T=I.transitionIn),"transitionInParams"in I&&t(15,A=I.transitionInParams),"transitionOut"in I&&t(16,w=I.transitionOut),"transitionOutParams"in I&&t(17,k=I.transitionOutParams),"$$scope"in I&&t(18,i=I.$$scope)},n.$$.update=()=>{t(0,l=`${a} ${o} ${e.class??""}`)},e=ot(e),[l,r,a,o,c,f,h,m,g,b,C,v,E,S,T,A,w,k,i,s]}class Mu extends Le{constructor(e){super(),Me(this,e,Lu,Ou,Pe,{autocollapse:1,width:2,spacing:3,disabled:4,padding:5,hover:6,rounded:7,caretOpen:8,caretClosed:9,regionControl:10,regionPanel:11,regionCaret:12,transitions:13,transitionIn:14,transitionInParams:15,transitionOut:16,transitionOutParams:17})}}function Qt(n,e){const{transition:t,params:l,enabled:u}=e;return u?t(n,l):"duration"in l?t(n,{duration:0}):{duration:0}}const Nu=n=>({}),yl=n=>({}),Vu=n=>({}),Dl=n=>({}),qu=n=>({}),Tl=n=>({}),ju=n=>({}),Rl=n=>({}),Uu=n=>({}),zl=n=>({});function wl(n){let e,t;const l=n[30].lead,u=gt(l,n,n[29],zl);return{c(){e=R("div"),u&&u.c(),this.h()},l(s){e=z(s,"DIV",{class:!0});var i=F(e);u&&u.l(i),i.forEach(_),this.h()},h(){d(e,"class","accordion-lead")},m(s,i){N(s,e,i),u&&u.m(e,null),t=!0},p(s,i){u&&u.p&&(!t||i[0]&536870912)&&_t(u,l,s,s[29],t?vt(l,s[29],i,Uu):bt(s[29]),zl)},i(s){t||(O(u,s),t=!0)},o(s){q(u,s),t=!1},d(s){s&&_(e),u&&u.d(s)}}}function Hu(n){let e;return{c(){e=Se("(summary)")},l(t){e=Ce(t,"(summary)")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function Wu(n){let e,t,l;return{c(){e=R("div"),t=new Vt(!1),this.h()},l(u){e=z(u,"DIV",{class:!0});var s=F(e);t=qt(s,!1),s.forEach(_),this.h()},h(){t.a=null,d(e,"class",l="accordion-summary-caret "+n[11])},m(u,s){N(u,e,s),t.m(n[14],e)},p(u,s){s[0]&2048&&l!==(l="accordion-summary-caret "+u[11])&&d(e,"class",l)},i:ae,o:ae,d(u){u&&_(e)}}}function Ku(n){let e,t,l,u,s;const i=[Xu,Gu],r=[];function a(o,c){return o[8]?0:1}return t=a(n),l=r[t]=i[t](n),{c(){e=R("div"),l.c(),this.h()},l(o){e=z(o,"DIV",{class:!0});var c=F(e);l.l(c),c.forEach(_),this.h()},h(){d(e,"class",u="accordion-summary-icons "+n[10])},m(o,c){N(o,e,c),r[t].m(e,null),s=!0},p(o,c){let f=t;t=a(o),t===f?r[t].p(o,c):(Fe(),q(r[f],1,1,()=>{r[f]=null}),Be(),l=r[t],l?l.p(o,c):(l=r[t]=i[t](o),l.c()),O(l,1),l.m(e,null)),(!s||c[0]&1024&&u!==(u="accordion-summary-icons "+o[10]))&&d(e,"class",u)},i(o){s||(O(l),s=!0)},o(o){q(l),s=!1},d(o){o&&_(e),r[t].d()}}}function Gu(n){let e;const t=n[30].iconOpen,l=gt(t,n,n[29],Dl),u=l||Yu(n);return{c(){u&&u.c()},l(s){u&&u.l(s)},m(s,i){u&&u.m(s,i),e=!0},p(s,i){l&&l.p&&(!e||i[0]&536870912)&&_t(l,t,s,s[29],e?vt(t,s[29],i,Vu):bt(s[29]),Dl)},i(s){e||(O(u,s),e=!0)},o(s){q(u,s),e=!1},d(s){u&&u.d(s)}}}function Xu(n){let e;const t=n[30].iconClosed,l=gt(t,n,n[29],Tl),u=l||Ju(n);return{c(){u&&u.c()},l(s){u&&u.l(s)},m(s,i){u&&u.m(s,i),e=!0},p(s,i){l&&l.p&&(!e||i[0]&536870912)&&_t(l,t,s,s[29],e?vt(t,s[29],i,qu):bt(s[29]),Tl)},i(s){e||(O(u,s),e=!0)},o(s){q(u,s),e=!1},d(s){u&&u.d(s)}}}function Yu(n){let e,t;return{c(){e=new Vt(!1),t=De(),this.h()},l(l){e=qt(l,!1),t=De(),this.h()},h(){e.a=t},m(l,u){e.m(n[14],l,u),N(l,t,u)},p:ae,d(l){l&&(_(t),e.d())}}}function Ju(n){let e,t;return{c(){e=new Vt(!1),t=De(),this.h()},l(l){e=qt(l,!1),t=De(),this.h()},h(){e.a=t},m(l,u){e.m(n[14],l,u),N(l,t,u)},p:ae,d(l){l&&(_(t),e.d())}}}function Il(n){let e,t,l,u,s,i,r;const a=n[30].content,o=gt(a,n,n[29],yl),c=o||Qu();return{c(){e=R("div"),c&&c.c(),this.h()},l(f){e=z(f,"DIV",{class:!0,id:!0,role:!0,"aria-hidden":!0,"aria-labelledby":!0});var h=F(e);c&&c.l(h),h.forEach(_),this.h()},h(){d(e,"class",t="accordion-panel "+n[9]),d(e,"id",l="accordion-panel-"+n[0]),d(e,"role","region"),d(e,"aria-hidden",u=!n[8]),d(e,"aria-labelledby",n[0])},m(f,h){N(f,e,h),c&&c.m(e,null),r=!0},p(f,h){n=f,o&&o.p&&(!r||h[0]&536870912)&&_t(o,a,n,n[29],r?vt(a,n[29],h,Nu):bt(n[29]),yl),(!r||h[0]&512&&t!==(t="accordion-panel "+n[9]))&&d(e,"class",t),(!r||h[0]&1&&l!==(l="accordion-panel-"+n[0]))&&d(e,"id",l),(!r||h[0]&256&&u!==(u=!n[8]))&&d(e,"aria-hidden",u),(!r||h[0]&1)&&d(e,"aria-labelledby",n[0])},i(f){r||(O(c,f),f&&En(()=>{r&&(i&&i.end(1),s=Sn(e,Qt,{transition:n[4],params:n[5],enabled:n[3]}),s.start())}),r=!0)},o(f){q(c,f),s&&s.invalidate(),f&&(i=Cn(e,Qt,{transition:n[6],params:n[7],enabled:n[3]})),r=!1},d(f){f&&_(e),c&&c.d(f),f&&i&&i.end()}}}function Qu(n){let e;return{c(){e=Se("(content)")},l(t){e=Ce(t,"(content)")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function Zu(n){let e,t,l,u,s,i,r,a,o,c,f,h,m,g,b=n[16].lead&&wl(n);const C=n[30].summary,v=gt(C,n,n[29],Rl),E=v||Hu(),S=[Ku,Wu],T=[];function A(k,V){return k[16].iconClosed||k[16].iconOpen?0:1}i=A(n),r=T[i]=S[i](n);let w=n[8]&&Il(n);return{c(){e=R("div"),t=R("button"),b&&b.c(),l=G(),u=R("div"),E&&E.c(),s=G(),r.c(),c=G(),w&&w.c(),this.h()},l(k){e=z(k,"DIV",{class:!0,"data-testid":!0});var V=F(e);t=z(V,"BUTTON",{type:!0,class:!0,id:!0,"aria-expanded":!0,"aria-controls":!0});var I=F(t);b&&b.l(I),l=X(I),u=z(I,"DIV",{class:!0});var te=F(u);E&&E.l(te),te.forEach(_),s=X(I),r.l(I),I.forEach(_),c=X(V),w&&w.l(V),V.forEach(_),this.h()},h(){d(u,"class","accordion-summary flex-1"),d(t,"type","button"),d(t,"class",a="accordion-control "+n[12]),d(t,"id",n[0]),d(t,"aria-expanded",n[8]),d(t,"aria-controls",o="accordion-panel-"+n[0]),t.disabled=n[2],d(e,"class",f="accordion-item "+n[13]),d(e,"data-testid","accordion-item")},m(k,V){N(k,e,V),p(e,t),b&&b.m(t,null),p(t,l),p(t,u),E&&E.m(u,null),p(t,s),T[i].m(t,null),p(e,c),w&&w.m(e,null),h=!0,m||(g=[Q(t,"click",n[15]),Q(t,"click",n[31]),Q(t,"keydown",n[32]),Q(t,"keyup",n[33]),Q(t,"keypress",n[34])],m=!0)},p(k,V){k[16].lead?b?(b.p(k,V),V[0]&65536&&O(b,1)):(b=wl(k),b.c(),O(b,1),b.m(t,l)):b&&(Fe(),q(b,1,1,()=>{b=null}),Be()),v&&v.p&&(!h||V[0]&536870912)&&_t(v,C,k,k[29],h?vt(C,k[29],V,ju):bt(k[29]),Rl);let I=i;i=A(k),i===I?T[i].p(k,V):(Fe(),q(T[I],1,1,()=>{T[I]=null}),Be(),r=T[i],r?r.p(k,V):(r=T[i]=S[i](k),r.c()),O(r,1),r.m(t,null)),(!h||V[0]&4096&&a!==(a="accordion-control "+k[12]))&&d(t,"class",a),(!h||V[0]&1)&&d(t,"id",k[0]),(!h||V[0]&256)&&d(t,"aria-expanded",k[8]),(!h||V[0]&1&&o!==(o="accordion-panel-"+k[0]))&&d(t,"aria-controls",o),(!h||V[0]&4)&&(t.disabled=k[2]),k[8]?w?(w.p(k,V),V[0]&256&&O(w,1)):(w=Il(k),w.c(),O(w,1),w.m(e,null)):w&&(Fe(),q(w,1,1,()=>{w=null}),Be()),(!h||V[0]&8192&&f!==(f="accordion-item "+k[13]))&&d(e,"class",f)},i(k){h||(O(b),O(E,k),O(r),O(w),h=!0)},o(k){q(b),q(E,k),q(r),q(w),h=!1},d(k){k&&_(e),b&&b.d(),E&&E.d(k),T[i].d(),w&&w.d(),m=!1,pt(g)}}}const xu="",$u="text-start w-full flex items-center space-x-4",Pl="fill-current w-3 transition-transform duration-[200ms]",es="";function ts(n,e,t){let l,u,s,i,r,a,o,c,f=ae,h=()=>(f(),f=qn(T,Z=>t(28,c=Z)),T);n.$$.on_destroy.push(()=>f());let{$$slots:m={},$$scope:g}=e;const b=kn(m),C=tl();let{open:v=!1}=e,{id:E=String(Math.random())}=e,{autocollapse:S=ye("autocollapse")}=e,{active:T=ye("active")}=e;h();let{disabled:A=ye("disabled")}=e,{padding:w=ye("padding")}=e,{hover:k=ye("hover")}=e,{rounded:V=ye("rounded")}=e,{caretOpen:I=ye("caretOpen")}=e,{caretClosed:te=ye("caretClosed")}=e,{regionControl:D=ye("regionControl")}=e,{regionPanel:$=ye("regionPanel")}=e,{regionCaret:se=ye("regionCaret")}=e,{transitions:ue=ye("transitions")}=e,{transitionIn:B=ye("transitionIn")}=e,{transitionInParams:le=ye("transitionInParams")}=e,{transitionOut:re=ye("transitionOut")}=e,{transitionOutParams:oe=ye("transitionOutParams")}=e;const W=` + + + `;function ie(Z){S===!0?T.set(E):t(17,v=!v),x(Z)}function x(Z){const We=S?c===E:v;C("toggle",{event:Z,id:E,panelId:`accordion-panel-${E}`,open:We,autocollapse:S})}S&&v&&ie();function U(Z){Ne.call(this,n,Z)}function ct(Z){Ne.call(this,n,Z)}function Ve(Z){Ne.call(this,n,Z)}function ft(Z){Ne.call(this,n,Z)}return n.$$set=Z=>{t(37,e=Je(Je({},e),ot(Z))),"open"in Z&&t(17,v=Z.open),"id"in Z&&t(0,E=Z.id),"autocollapse"in Z&&t(18,S=Z.autocollapse),"active"in Z&&h(t(1,T=Z.active)),"disabled"in Z&&t(2,A=Z.disabled),"padding"in Z&&t(19,w=Z.padding),"hover"in Z&&t(20,k=Z.hover),"rounded"in Z&&t(21,V=Z.rounded),"caretOpen"in Z&&t(22,I=Z.caretOpen),"caretClosed"in Z&&t(23,te=Z.caretClosed),"regionControl"in Z&&t(24,D=Z.regionControl),"regionPanel"in Z&&t(25,$=Z.regionPanel),"regionCaret"in Z&&t(26,se=Z.regionCaret),"transitions"in Z&&t(3,ue=Z.transitions),"transitionIn"in Z&&t(4,B=Z.transitionIn),"transitionInParams"in Z&&t(5,le=Z.transitionInParams),"transitionOut"in Z&&t(6,re=Z.transitionOut),"transitionOutParams"in Z&&t(7,oe=Z.transitionOutParams),"$$scope"in Z&&t(29,g=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&393216&&v&&S&&ie(),n.$$.dirty[0]&268828673&&t(8,l=S?c===E:v),t(13,u=`${xu} ${e.class??""}`),n.$$.dirty[0]&20447232&&t(12,s=`${$u} ${w} ${k} ${V} ${D}`),n.$$.dirty[0]&12583168&&t(27,i=l?I:te),n.$$.dirty[0]&201326592&&t(11,r=`${Pl} ${se} ${i}`),n.$$.dirty[0]&67108864&&t(10,a=`${Pl} ${se}`),n.$$.dirty[0]&36175872&&t(9,o=`${es} ${w} ${V} ${$}`)},e=ot(e),[E,T,A,ue,B,le,re,oe,l,o,a,r,s,u,W,ie,b,v,S,w,k,V,I,te,D,$,se,i,c,g,m,U,ct,Ve,ft]}class ls extends Le{constructor(e){super(),Me(this,e,ts,Zu,Pe,{open:17,id:0,autocollapse:18,active:1,disabled:2,padding:19,hover:20,rounded:21,caretOpen:22,caretClosed:23,regionControl:24,regionPanel:25,regionCaret:26,transitions:3,transitionIn:4,transitionInParams:5,transitionOut:6,transitionOutParams:7},null,[-1,-1])}}function ns(n,{from:e,to:t},l={}){const u=getComputedStyle(n),s=u.transform==="none"?"":u.transform,[i,r]=u.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*i/t.width-(t.left+i),o=e.top+e.height*r/t.height-(t.top+r),{delay:c=0,duration:f=m=>Math.sqrt(m)*120,easing:h=ul}=l;return{delay:c,duration:jn(f)?f(Math.sqrt(a*a+o*o)):f,easing:h,css:(m,g)=>{const b=g*a,C=g*o,v=m+g*e.width/t.width,E=m+g*e.height/t.height;return`transform: ${s} translate(${b}px, ${C}px) scale(${v}, ${E});`}}}function us(n){let e,t,l;const u=n[15].default,s=gt(u,n,n[14],null);return{c(){e=R("div"),s&&s.c(),this.h()},l(i){e=z(i,"DIV",{class:!0,"data-testid":!0,role:!0,"aria-labelledby":!0});var r=F(e);s&&s.l(r),r.forEach(_),this.h()},h(){d(e,"class",t="radio-group "+n[1]),d(e,"data-testid","radio-group"),d(e,"role","radiogroup"),d(e,"aria-labelledby",n[0])},m(i,r){N(i,e,r),s&&s.m(e,null),l=!0},p(i,[r]){s&&s.p&&(!l||r&16384)&&_t(s,u,i,i[14],l?vt(u,i[14],r,null):bt(i[14]),null),(!l||r&2&&t!==(t="radio-group "+i[1]))&&d(e,"class",t),(!l||r&1)&&d(e,"aria-labelledby",i[0])},i(i){l||(O(s,i),l=!0)},o(i){q(s,i),l=!1},d(i){i&&_(e),s&&s.d(i)}}}const ss="p-1";function is(n,e,t){let l,{$$slots:u={},$$scope:s}=e,{display:i="inline-flex"}=e,{flexDirection:r="flex-row"}=e,{gap:a="gap-1"}=e,{background:o="bg-surface-200-700-token"}=e,{border:c="border-token border-surface-400-500-token"}=e,{rounded:f="rounded-token"}=e,{padding:h="px-4 py-1"}=e,{active:m="variant-filled"}=e,{hover:g="hover:variant-soft"}=e,{color:b=""}=e,{fill:C=""}=e,{regionLabel:v=""}=e,{labelledby:E=""}=e;return ge("rounded",f),ge("padding",h),ge("active",m),ge("hover",g),ge("color",b),ge("fill",C),ge("regionLabel",v),n.$$set=S=>{t(16,e=Je(Je({},e),ot(S))),"display"in S&&t(2,i=S.display),"flexDirection"in S&&t(3,r=S.flexDirection),"gap"in S&&t(4,a=S.gap),"background"in S&&t(5,o=S.background),"border"in S&&t(6,c=S.border),"rounded"in S&&t(7,f=S.rounded),"padding"in S&&t(8,h=S.padding),"active"in S&&t(9,m=S.active),"hover"in S&&t(10,g=S.hover),"color"in S&&t(11,b=S.color),"fill"in S&&t(12,C=S.fill),"regionLabel"in S&&t(13,v=S.regionLabel),"labelledby"in S&&t(0,E=S.labelledby),"$$scope"in S&&t(14,s=S.$$scope)},n.$$.update=()=>{t(1,l=`${ss} ${i} ${r} ${a} ${o} ${c} ${f} ${e.class??""}`)},e=ot(e),[E,l,i,r,a,o,c,f,h,m,g,b,C,v,s,u]}class as extends Le{constructor(e){super(),Me(this,e,is,us,Pe,{display:2,flexDirection:3,gap:4,background:5,border:6,rounded:7,padding:8,active:9,hover:10,color:11,fill:12,regionLabel:13,labelledby:0})}}function rs(n){let e,t,l,u,s,i,r,a,o,c,f,h=[{type:"radio"},{name:n[1]},{__value:n[2]},n[11](),{tabindex:"-1"}],m={};for(let C=0;C{V=W,t(7,V)})}function oe(){h=this.__value,t(0,h)}return n.$$set=W=>{t(31,e=Je(Je({},e),ot(W))),t(30,o=Jt(e,a)),"group"in W&&t(0,h=W.group),"name"in W&&t(1,m=W.name),"value"in W&&t(2,g=W.value),"title"in W&&t(3,b=W.title),"label"in W&&t(4,C=W.label),"rounded"in W&&t(12,v=W.rounded),"padding"in W&&t(13,E=W.padding),"active"in W&&t(14,S=W.active),"hover"in W&&t(15,T=W.hover),"color"in W&&t(16,A=W.color),"fill"in W&&t(17,w=W.fill),"regionLabel"in W&&t(5,k=W.regionLabel),"$$scope"in W&&t(20,f=W.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&5&&t(6,l=g===h),n.$$.dirty[0]&245824&&t(19,u=l?`${S} ${A} ${w}`:T),t(18,s=e.disabled?fs:""),t(8,r=`${cs} ${E} ${v} ${u} ${s} ${e.class??""}`)},t(9,i=`${os}`),e=ot(e),[h,m,g,b,C,k,l,V,r,i,I,te,v,E,S,T,A,w,s,u,f,c,$,se,ue,B,le,re,oe,D]}class Fl extends Le{constructor(e){super(),Me(this,e,ds,rs,Pe,{group:0,name:1,value:2,title:3,label:4,rounded:12,padding:13,active:14,hover:15,color:16,fill:17,regionLabel:5},null,[-1,-1])}}function Bl(n){let e,t;const l=n[22].default,u=gt(l,n,n[21],null);return{c(){e=R("div"),u&&u.c(),this.h()},l(s){e=z(s,"DIV",{class:!0});var i=F(e);u&&u.l(i),i.forEach(_),this.h()},h(){d(e,"class","slide-toggle-text ml-3")},m(s,i){N(s,e,i),u&&u.m(e,null),t=!0},p(s,i){u&&u.p&&(!t||i[0]&2097152)&&_t(u,l,s,s[21],t?vt(l,s[21],i,null):bt(s[21]),null)},i(s){t||(O(u,s),t=!0)},o(s){q(u,s),t=!1},d(s){s&&_(e),u&&u.d(s)}}}function hs(n){let e,t,l,u,s,i,r,a,o,c,f,h,m,g,b,C=[{type:"checkbox"},{class:"slide-toggle-input hidden"},{name:n[1]},n[8](),{disabled:u=n[9].disabled}],v={};for(let S=0;S{E=null}),Be()),(!m||T[0]&32&&f!==(f="slide-toggle-label "+S[5]))&&d(t,"class",f),(!m||T[0]&4)&&d(e,"id",S[2]),(!m||T[0]&64&&h!==(h="slide-toggle "+S[6]))&&d(e,"class",h),(!m||T[0]&4)&&d(e,"aria-label",S[2]),(!m||T[0]&1)&&d(e,"aria-checked",S[0])},i(S){m||(O(E),m=!0)},o(S){q(E),m=!1},d(S){S&&_(e),E&&E.d(),g=!1,pt(b)}}}const ms="inline-block",gs="unstyled flex items-center",_s="flex transition-all duration-[200ms] cursor-pointer",bs="w-[50%] h-full scale-[0.8] transition-all duration-[200ms] shadow";function vs(n,e,t){let l,u,s,i,r,a,o,c;const f=["name","checked","size","background","active","border","rounded","label"];let h=Jt(e,f),{$$slots:m={},$$scope:g}=e;const b=kn(m),C=tl();let{name:v}=e,{checked:E=!1}=e,{size:S="md"}=e,{background:T="bg-surface-400 dark:bg-surface-700"}=e,{active:A="bg-surface-900 dark:bg-surface-300"}=e,{border:w=""}=e,{rounded:k="rounded-full"}=e,{label:V=""}=e,I;switch(S){case"sm":I="w-12 h-6";break;case"lg":I="w-20 h-10";break;default:I="w-16 h-8"}function te(x){["Enter","Space"].includes(x.code)&&(x.preventDefault(),C("keyup",x),x.currentTarget.firstChild.click())}function D(){return delete h.class,h}function $(x){Ne.call(this,n,x)}function se(x){Ne.call(this,n,x)}function ue(x){Ne.call(this,n,x)}function B(x){Ne.call(this,n,x)}function le(x){Ne.call(this,n,x)}function re(x){Ne.call(this,n,x)}function oe(x){Ne.call(this,n,x)}function W(x){Ne.call(this,n,x)}function ie(){E=this.checked,t(0,E)}return n.$$set=x=>{t(9,e=Je(Je({},e),ot(x))),t(33,h=Jt(e,f)),"name"in x&&t(1,v=x.name),"checked"in x&&t(0,E=x.checked),"size"in x&&t(11,S=x.size),"background"in x&&t(12,T=x.background),"active"in x&&t(13,A=x.active),"border"in x&&t(14,w=x.border),"rounded"in x&&t(15,k=x.rounded),"label"in x&&t(2,V=x.label),"$$scope"in x&&t(21,g=x.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&12289&&t(19,l=E?A:`${T} cursor-pointer`),n.$$.dirty[0]&1&&t(18,u=E?"bg-white/75":"bg-white"),n.$$.dirty[0]&1&&t(17,s=E?"translate-x-full":""),t(20,i=e.disabled===!0?"opacity-50":"hover:brightness-[105%] dark:hover:brightness-110 cursor-pointer"),t(6,r=`${ms} ${k} ${i} ${e.class??""}`),n.$$.dirty[0]&638976&&t(4,o=`${_s} ${w} ${k} ${I} ${l}`),n.$$.dirty[0]&425984&&t(3,c=`${bs} ${k} ${u} ${s}`)},t(5,a=`${gs}`),e=ot(e),[E,v,V,c,o,a,r,te,D,e,b,S,T,A,w,k,I,s,u,l,i,g,m,$,se,ue,B,le,re,oe,W,ie]}class Ht extends Le{constructor(e){super(),Me(this,e,vs,hs,Pe,{name:1,checked:0,size:11,background:12,active:13,border:14,rounded:15,label:2},null,[-1,-1])}}function Al(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function Ol(n){let e,t,l=[],u=new Map,s,i,r,a=Qe(n[11]);const o=c=>c[36];for(let c=0;c{b&&(h&&h.end(1),f=Sn(t,Qt,{transition:e[5],params:{x:e[10].x,y:e[10].y,...e[6]},enabled:e[4]}),f.start())}),b=!0)},o(A){f&&f.invalidate(),h=Cn(t,Qt,{transition:e[7],params:{x:e[10].x,y:e[10].y,...e[8]},enabled:e[4]}),b=!1},d(A){A&&_(t),E&&E.d(),A&&h&&h.end(),C=!1,pt(v)}}}function ps(n){let e,t,l=n[9].length&&Ol(n);return{c(){l&&l.c(),e=De()},l(u){l&&l.l(u),e=De()},m(u,s){l&&l.m(u,s),N(u,e,s),t=!0},p(u,s){u[9].length?l?(l.p(u,s),s[0]&512&&O(l,1)):(l=Ol(u),l.c(),O(l,1),l.m(e.parentNode,e)):l&&(Fe(),q(l,1,1,()=>{l=null}),Be())},i(u){t||(O(l),t=!0)},o(u){q(l),t=!1},d(u){u&&_(e),l&&l.d(u)}}}const ks="flex fixed top-0 left-0 right-0 bottom-0 pointer-events-none",Es="flex flex-col gap-y-2",Ss="flex justify-between items-center pointer-events-auto",Cs="flex items-center space-x-2";function ys(n,e,t){let l,u,s,i,r,a;wt(n,Fn,U=>t(34,a=U));const o=In();wt(n,o,U=>t(9,r=U));let{position:c="b"}=e,{max:f=3}=e,{background:h="variant-filled-secondary"}=e,{width:m="max-w-[640px]"}=e,{color:g=""}=e,{padding:b="p-4"}=e,{spacing:C="space-x-4"}=e,{rounded:v="rounded-container-token"}=e,{shadow:E="shadow-lg"}=e,{zIndex:S="z-[888]"}=e,{buttonAction:T="btn variant-filled"}=e,{buttonDismiss:A="btn-icon btn-icon-sm variant-filled"}=e,{buttonDismissLabel:w="✕"}=e,{transitions:k=!a}=e,{transitionIn:V=Sl}=e,{transitionInParams:I={duration:250}}=e,{transitionOut:te=Sl}=e,{transitionOutParams:D={duration:250}}=e,$,se,ue={x:0,y:0};switch(c){case"t":$="justify-center items-start",se="items-center",ue={x:0,y:-100};break;case"b":$="justify-center items-end",se="items-center",ue={x:0,y:100};break;case"l":$="justify-start items-center",se="items-start",ue={x:-100,y:0};break;case"r":$="justify-end items-center",se="items-end",ue={x:100,y:0};break;case"tl":$="justify-start items-start",se="items-start",ue={x:-100,y:0};break;case"tr":$="justify-end items-start",se="items-end",ue={x:100,y:0};break;case"bl":$="justify-start items-end",se="items-start",ue={x:-100,y:0};break;case"br":$="justify-end items-end",se="items-end",ue={x:100,y:0};break}function B(U){r[U]?.action?.response(),o.close(r[U].id)}function le(U){r[U]?.hoverable&&(o.freeze(U),t(13,u+=" scale-[105%]"))}function re(U){r[U]?.hoverable&&(o.unfreeze(U),t(13,u=u.replace(" scale-[105%]","")))}const oe=U=>B(U),W=U=>o.close(U.id),ie=U=>le(U),x=U=>re(U);return n.$$set=U=>{t(35,e=Je(Je({},e),ot(U))),"position"in U&&t(19,c=U.position),"max"in U&&t(20,f=U.max),"background"in U&&t(0,h=U.background),"width"in U&&t(21,m=U.width),"color"in U&&t(22,g=U.color),"padding"in U&&t(23,b=U.padding),"spacing"in U&&t(24,C=U.spacing),"rounded"in U&&t(25,v=U.rounded),"shadow"in U&&t(26,E=U.shadow),"zIndex"in U&&t(27,S=U.zIndex),"buttonAction"in U&&t(1,T=U.buttonAction),"buttonDismiss"in U&&t(2,A=U.buttonDismiss),"buttonDismissLabel"in U&&t(3,w=U.buttonDismissLabel),"transitions"in U&&t(4,k=U.transitions),"transitionIn"in U&&t(5,V=U.transitionIn),"transitionInParams"in U&&t(6,I=U.transitionInParams),"transitionOut"in U&&t(7,te=U.transitionOut),"transitionOutParams"in U&&t(8,D=U.transitionOutParams)},n.$$.update=()=>{t(14,l=`${ks} ${$} ${S} ${e.class||""}`),n.$$.dirty[0]&545259520&&t(13,u=`${Es} ${se} ${b}`),n.$$.dirty[0]&132120576&&t(12,s=`${Ss} ${m} ${g} ${b} ${C} ${v} ${E}`),n.$$.dirty[0]&1049088&&t(11,i=Array.from(r).slice(0,f))},e=ot(e),[h,T,A,w,k,V,I,te,D,r,ue,i,s,u,l,o,B,le,re,c,f,m,g,b,C,v,E,S,$,se,oe,W,ie,x]}class Ds extends Le{constructor(e){super(),Me(this,e,ys,ps,Pe,{position:19,max:20,background:0,width:21,color:22,padding:23,spacing:24,rounded:25,shadow:26,zIndex:27,buttonAction:1,buttonDismiss:2,buttonDismissLabel:3,transitions:4,transitionIn:5,transitionInParams:6,transitionOut:7,transitionOutParams:8},null,[-1,-1])}}class at{static findDateInText(e){const t=/\b\d{1,2}\.\d{1,2}\.\d{4}\b/g,l=e.match(t);if(l&&l.length>0){const u=l[0],[s,i,r]=u.split(".").map(Number);return new Date(r,i-1,s)}return null}static sortByRelevanceAndDate(e){return e.sort((t,l)=>{const u=l.relevance-t.relevance;if(u!==0)return u;const s=at.findDateInText(t.title),i=at.findDateInText(l.title);return s&&i?i.getTime()-s.getTime():s?-1:i?1:0})}static sortByDate(e){const t=e.filter(r=>at.findDateInText(r.title)),l=e.filter(r=>!at.findDateInText(r.title)),u=t.sort((r,a)=>{const o=at.findDateInText(r.title),c=at.findDateInText(a.title);return o&&c?c.getTime()-o.getTime():o?-1:c?1:0}),s=[];let i=0;for(const r of e)if(at.findDateInText(r.title)){let a=u.shift();a&&s.push(a)}else s.push(l[i]),i++;return s}static sortByRelevance(e){return e.sort((t,l)=>t.relevance&&l.relevance?l.relevance-t.relevance:t.relevance?-1:l.relevance?1:0)}static identifyDocumentType(e){const t=[{regexp:/(ФАС |АС |КС |ВС |[Сс]удебн|[Сс]уд)|(\(Судебный документ\))/,docType:"Решение суда"},{regexp:/[Пп]исьмо [Мм]инфина/,docType:"Письмо Минфина"},{regexp:/[Пп]исьмо (ФНС|фнс)/,docType:"Письмо ФНС"},{regexp:/(НКРФ)|(НК РФ)/,docType:"Налоговый кодекс"},{regexp:/(ГКРФ)|(ГК РФ)/,docType:"Гражданский кодекс"},{regexp:/(ТКРФ)|(ТК РФ)/,docType:"Трудовой кодекс"},{regexp:/Приказ ФНС РФ/,docType:"Приказ ФНС РФ"},{regexp:/Постановление Правительства РФ/,docType:"Постановление Правительства РФ"},{regexp:/Решение Коллегии Евразийской экономической комиссии/,docType:"Решение Коллегии ЕЭК"},{regexp:/Федеральный закон/,docType:"Федеральные законы"},{regexp:/\(Внутренний документ\)/,docType:"Внутренние документы"}];return e.map(l=>{for(const{regexp:u,docType:s}of t)if(u.test(l.title))return l.docType=s,l;return l.docType="Другие документы",l})}}function ql(n,e,t){const l=n.slice();return l[11]=e[t],l}function jl(n){let e,t,l;return{c(){e=R("input"),this.h()},l(u){e=z(u,"INPUT",{type:!0}),this.h()},h(){d(e,"type","checkbox")},m(u,s){N(u,e,s),e.checked=n[1][n[3]],t||(l=Q(e,"change",n[8]),t=!0)},p(u,s){s&10&&(e.checked=u[1][u[3]])},d(u){u&&_(e),t=!1,l()}}}function Ts(n){let e,t;return{c(){e=R("div"),t=Se(n[4]),this.h()},l(l){e=z(l,"DIV",{class:!0});var u=F(e);t=Ce(u,n[4]),u.forEach(_),this.h()},h(){d(e,"class","annotation svelte-1srbk6k")},m(l,u){N(l,e,u),p(e,t)},p(l,u){u&16&&tt(t,l[4])},d(l){l&&_(e)}}}function Rs(n){let e,t=Qe(n[5].split(` +`)),l=[];for(let u=0;u100&&Hl(n);return{c(){e=R("div"),t=R("div"),l=R("label"),a&&a.c(),u=G(),s=Se(n[3]),i=G(),f.c(),r=G(),h&&h.c(),this.h()},l(m){e=z(m,"DIV",{class:!0});var g=F(e);t=z(g,"DIV",{class:!0});var b=F(t);l=z(b,"LABEL",{style:!0});var C=F(l);a&&a.l(C),u=X(C),s=Ce(C,n[3]),C.forEach(_),b.forEach(_),i=X(g),f.l(g),r=X(g),h&&h.l(g),g.forEach(_),this.h()},h(){He(l,"cursor","pointer"),d(t,"class","title svelte-1srbk6k"),d(e,"class","search-result svelte-1srbk6k")},m(m,g){N(m,e,g),p(e,t),p(t,l),a&&a.m(l,null),p(l,u),p(l,s),p(e,i),f.m(e,null),p(e,r),h&&h.m(e,null)},p(m,[g]){m[6]?a?a.p(m,g):(a=jl(m),a.c(),a.m(l,u)):a&&(a.d(1),a=null),g&8&&tt(s,m[3]),c===(c=o(m))&&f?f.p(m,g):(f.d(1),f=c(m),f&&(f.c(),f.m(e,r))),m[5].length>100?h?h.p(m,g):(h=Hl(m),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:ae,o:ae,d(m){m&&_(e),a&&a.d(),f.d(),h&&h.d()}}}function Ps(n,e,t){let{showFullText:l=Array(10).fill(!1)}=e,{useSearchResult:u}=e,{index:s}=e,{title:i}=e,{teaser:r}=e,{text:a}=e,{enableSearchResultSelection:o=!1}=e;function c(g){t(0,l[g]=!l[g],l)}function f(){u[i]=this.checked,t(1,u)}const h=()=>c(s),m=()=>c(s);return n.$$set=g=>{"showFullText"in g&&t(0,l=g.showFullText),"useSearchResult"in g&&t(1,u=g.useSearchResult),"index"in g&&t(2,s=g.index),"title"in g&&t(3,i=g.title),"teaser"in g&&t(4,r=g.teaser),"text"in g&&t(5,a=g.text),"enableSearchResultSelection"in g&&t(6,o=g.enableSearchResultSelection)},[l,u,s,i,r,a,o,c,f,h,m]}class Bn extends Le{constructor(e){super(),Me(this,e,Ps,Is,Pe,{showFullText:0,useSearchResult:1,index:2,title:3,teaser:4,text:5,enableSearchResultSelection:6})}}function Wl(n,e,t){const l=n.slice();return l[20]=e[t].title,l[21]=e[t].text,l[22]=e[t].teaser,l[24]=t,l}function Kl(n,e,t){const l=n.slice();return l[16]=e[t][0],l[17]=e[t][1],l}function Gl(n,e,t){const l=n.slice();return l[20]=e[t].title,l[21]=e[t].text,l[22]=e[t].teaser,l[24]=t,l}function Xl(n){let e,t,l,u="Сортировать по:",s,i,r,a,o,c;i=new as({props:{background:"",border:"",$$slots:{default:[As]},$$scope:{ctx:n}}});function f(m){n[10](m)}let h={name:"groupByChecked",size:"sm",label:"Группировать по типу",$$slots:{default:[Os]},$$scope:{ctx:n}};return n[4]!==void 0&&(h.checked=n[4]),a=new Ht({props:h}),ce.push(()=>be(a,"checked",f)),{c(){e=R("div"),t=R("div"),l=R("label"),l.textContent=u,s=G(),ve(i.$$.fragment),r=G(),ve(a.$$.fragment),this.h()},l(m){e=z(m,"DIV",{class:!0});var g=F(e);t=z(g,"DIV",{class:!0,style:!0});var b=F(t);l=z(b,"LABEL",{style:!0,class:!0,"data-svelte-h":!0}),Ae(l)!=="svelte-12wnwfn"&&(l.textContent=u),s=X(b),pe(i.$$.fragment,b),r=X(b),pe(a.$$.fragment,b),b.forEach(_),g.forEach(_),this.h()},h(){He(l,"display","inline-block"),He(l,"flex-wrap","wrap"),d(l,"class","svelte-1ptibtq"),d(t,"class","card w-full flex p-2 space-y-2"),He(t,"align-items","center"),He(t,"flex-wrap","wrap"),d(e,"class","settings-bar svelte-1ptibtq")},m(m,g){N(m,e,g),p(e,t),p(t,l),p(t,s),ke(i,t,null),p(t,r),ke(a,t,null),c=!0},p(m,g){const b={};g&67108896&&(b.$$scope={dirty:g,ctx:m}),i.$set(b);const C={};g&67108864&&(C.$$scope={dirty:g,ctx:m}),!o&&g&16&&(o=!0,C.checked=m[4],_e(()=>o=!1)),a.$set(C)},i(m){c||(O(i.$$.fragment,m),O(a.$$.fragment,m),c=!0)},o(m){q(i.$$.fragment,m),q(a.$$.fragment,m),c=!1},d(m){m&&_(e),Ee(i),Ee(a)}}}function Fs(n){let e;return{c(){e=Se("релевантности")},l(t){e=Ce(t,"релевантности")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function Bs(n){let e;return{c(){e=Se("дате")},l(t){e=Ce(t,"дате")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function As(n){let e,t,l,u,s,i;function r(f){n[8](f)}let a={name:"sortBy",value:"rel",$$slots:{default:[Fs]},$$scope:{ctx:n}};n[5]!==void 0&&(a.group=n[5]),e=new Fl({props:a}),ce.push(()=>be(e,"group",r));function o(f){n[9](f)}let c={name:"sortBy",value:"date",$$slots:{default:[Bs]},$$scope:{ctx:n}};return n[5]!==void 0&&(c.group=n[5]),u=new Fl({props:c}),ce.push(()=>be(u,"group",o)),{c(){ve(e.$$.fragment),l=G(),ve(u.$$.fragment)},l(f){pe(e.$$.fragment,f),l=X(f),pe(u.$$.fragment,f)},m(f,h){ke(e,f,h),N(f,l,h),ke(u,f,h),i=!0},p(f,h){const m={};h&67108864&&(m.$$scope={dirty:h,ctx:f}),!t&&h&32&&(t=!0,m.group=f[5],_e(()=>t=!1)),e.$set(m);const g={};h&67108864&&(g.$$scope={dirty:h,ctx:f}),!s&&h&32&&(s=!0,g.group=f[5],_e(()=>s=!1)),u.$set(g)},i(f){i||(O(e.$$.fragment,f),O(u.$$.fragment,f),i=!0)},o(f){q(e.$$.fragment,f),q(u.$$.fragment,f),i=!1},d(f){f&&_(l),Ee(e,f),Ee(u,f)}}}function Os(n){let e;return{c(){e=Se("Группировать по типу")},l(t){e=Ce(t,"Группировать по типу")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function Ls(n){let e,t,l=Qe(n[0]),u=[];for(let i=0;iq(u[i],1,1,()=>{u[i]=null});return{c(){for(let i=0;iq(u[i],1,1,()=>{u[i]=null});return{c(){for(let i=0;iq(u[i],1,1,()=>{u[i]=null});return{c(){for(let i=0;i0&&Xl(n);const o=[Ms,Ls],c=[];function f(m,g){return m[4]&&m[6]?0:1}l=f(n),u=c[l]=o[l](n);let h=Hs;return{c(){e=R("div"),a&&a.c(),t=G(),u.c(),s=G(),i=De(),this.h()},l(m){e=z(m,"DIV",{class:!0});var g=F(e);a&&a.l(g),t=X(g),u.l(g),g.forEach(_),s=X(m),i=De(),this.h()},h(){d(e,"class","search-results svelte-1ptibtq")},m(m,g){N(m,e,g),a&&a.m(e,null),p(e,t),c[l].m(e,null),N(m,s,g),N(m,i,g),r=!0},p(m,[g]){m[0]&&m[0].length>0?a?(a.p(m,g),g&1&&O(a,1)):(a=Xl(m),a.c(),O(a,1),a.m(e,t)):a&&(Fe(),q(a,1,1,()=>{a=null}),Be());let b=l;l=f(m),l===b?c[l].p(m,g):(Fe(),q(c[b],1,1,()=>{c[b]=null}),Be(),u=c[l],u?u.p(m,g):(u=c[l]=o[l](m),u.c()),O(u,1),u.m(e,null))},i(m){r||(O(a),O(u),O(h),r=!0)},o(m){q(a),q(u),q(h),r=!1},d(m){m&&(_(e),_(s),_(i)),a&&a.d(),c[l].d()}}}let Hs=!1;function Ws(n,e,t){let{showFullText:l=Array(10).fill(!1)}=e,{useSearchResult:u}=e,s=!1,i="rel",{searchResults:r=[]}=e,a,{enableSearchResultSelection:o=!1}=e;const c=b=>b.reduce((C,v)=>{const E=v.docType||"Другие документы";return C[E]||(C[E]=[]),C[E].push(v),C},{}),f=b=>{b.stopPropagation();const C=b.target.dataset.doctype;Object.keys(a[C]).forEach(v=>{t(2,u[a[C][v].title]=b.target.checked,u)})};function h(b){i=b,t(5,i)}function m(b){i=b,t(5,i)}function g(b){s=b,t(4,s)}return n.$$set=b=>{"showFullText"in b&&t(1,l=b.showFullText),"useSearchResult"in b&&t(2,u=b.useSearchResult),"searchResults"in b&&t(0,r=b.searchResults),"enableSearchResultSelection"in b&&t(3,o=b.enableSearchResultSelection)},n.$$.update=()=>{n.$$.dirty&49&&(s&&t(6,a=c(r)),i=="date"?t(0,r=at.sortByDate(r)):i=="rel"&&t(0,r=at.sortByRelevance(r)))},[r,l,u,o,s,i,a,f,h,m,g]}class An extends Le{constructor(e){super(),Me(this,e,Ws,Us,Pe,{showFullText:1,useSearchResult:2,searchResults:0,enableSearchResultSelection:3})}}function xl(n,e,t){const l=n.slice();return l[6]=e[t],l}function $l(n){let e,t=Qe(n[3].split(` +`)),l=[];for(let u=0;ur(u);return n.$$set=o=>{"showFullText"in o&&t(0,l=o.showFullText),"index"in o&&t(1,u=o.index),"title"in o&&t(2,s=o.title),"text"in o&&t(3,i=o.text)},[l,u,s,i,r,a]}class Xs extends Le{constructor(e){super(),Me(this,e,Gs,Ks,Pe,{showFullText:0,index:1,title:2,text:3})}}function tn(n,e,t){const l=n.slice();return l[2]=e[t].title,l[3]=e[t].text,l[5]=t,l}function ln(n){let e,t;return e=new Xs({props:{title:n[2],text:n[3],index:n[5],showFullText:n[0]}}),{c(){ve(e.$$.fragment)},l(l){pe(e.$$.fragment,l)},m(l,u){ke(e,l,u),t=!0},p(l,u){const s={};u&2&&(s.title=l[2]),u&2&&(s.text=l[3]),u&1&&(s.showFullText=l[0]),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){q(e.$$.fragment,l),t=!1},d(l){Ee(e,l)}}}function Ys(n){let e,t,l="Релевантные консультации",u,s,i,r,a=Qe(n[1]),o=[];for(let h=0;hq(o[h],1,1,()=>{o[h]=null});let f=Js;return{c(){e=R("div"),t=R("h2"),t.textContent=l,u=G();for(let h=0;h{"showFullText"in s&&t(0,l=s.showFullText),"consultations"in s&&t(1,u=s.consultations)},[l,u]}class On extends Le{constructor(e){super(),Me(this,e,Qs,Ys,Pe,{showFullText:0,consultations:1})}}const sl="clarificationHistory",Zs=()=>{const n=localStorage.getItem(sl);return n?JSON.parse(n):[]},nn=n=>{localStorage.setItem(sl,JSON.stringify(n))},xs=()=>{localStorage.removeItem(sl)};function un(n){let e,t,l,u="<",s,i,r,a,o=n[4]+1+"",c,f,h,m,g,b=">",C,v,E,S,T="Очистить историю",A,w;return{c(){e=R("div"),t=R("div"),l=R("button"),s=Se(u),r=G(),a=R("span"),c=Se(o),f=Se("/"),h=Se(n[5]),m=G(),g=R("button"),C=Se(b),E=G(),S=R("button"),S.textContent=T,this.h()},l(k){e=z(k,"DIV",{class:!0});var V=F(e);t=z(V,"DIV",{class:!0});var I=F(t);l=z(I,"BUTTON",{class:!0});var te=F(l);s=Ce(te,u),te.forEach(_),r=X(I),a=z(I,"SPAN",{class:!0});var D=F(a);c=Ce(D,o),f=Ce(D,"/"),h=Ce(D,n[5]),D.forEach(_),m=X(I),g=z(I,"BUTTON",{class:!0});var $=F(g);C=Ce($,b),$.forEach(_),I.forEach(_),E=X(V),S=z(V,"BUTTON",{style:!0,class:!0,"data-svelte-h":!0}),Ae(S)!=="svelte-1qhk46v"&&(S.textContent=T),V.forEach(_),this.h()},h(){l.disabled=i=n[4]<=0,d(l,"class","svelte-wjelcf"),d(a,"class","content-center"),g.disabled=v=n[4]>=n[5]-1,d(g,"class","svelte-wjelcf"),d(t,"class","flex justify-center grow"),He(S,"margin-left","auto"),d(S,"class","svelte-wjelcf"),d(e,"class","w-full flex p-2 space-x-2 justify-center gap-x-1 items-center")},m(k,V){N(k,e,V),p(e,t),p(t,l),p(l,s),p(t,r),p(t,a),p(a,c),p(a,f),p(a,h),p(t,m),p(t,g),p(g,C),p(e,E),p(e,S),A||(w=[Q(l,"click",n[2]),Q(g,"click",n[3]),Q(S,"click",n[6])],A=!0)},p(k,V){V&16&&i!==(i=k[4]<=0)&&(l.disabled=i),V&16&&o!==(o=k[4]+1+"")&&tt(c,o),V&32&&tt(h,k[5]),V&48&&v!==(v=k[4]>=k[5]-1)&&(g.disabled=v)},d(k){k&&_(e),A=!1,pt(w)}}}function $s(n){let e,t,l,u,s,i,r,a,o=n[5]>0&&un(n);return{c(){e=R("div"),t=R("textarea"),l=G(),u=R("textarea"),s=G(),o&&o.c(),i=De(),this.h()},l(c){e=z(c,"DIV",{class:!0});var f=F(e);t=z(f,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(t).forEach(_),l=X(f),u=z(f,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(u).forEach(_),f.forEach(_),s=X(c),o&&o.l(c),i=De(),this.h()},h(){d(t,"rows","3"),d(t,"placeholder","Уточнение для поиска"),d(t,"class","svelte-wjelcf"),d(u,"rows","3"),d(u,"placeholder","Уточнение для LLM"),d(u,"class","svelte-wjelcf"),d(e,"class","w-full flex p-2 space-x-2")},m(c,f){N(c,e,f),p(e,t),rt(t,n[0]),p(e,l),p(e,u),rt(u,n[1]),N(c,s,f),o&&o.m(c,f),N(c,i,f),r||(a=[Q(t,"input",n[15]),Q(t,"input",ei),Q(u,"input",n[16]),Q(u,"input",ti)],r=!0)},p(c,[f]){f&1&&rt(t,c[0]),f&2&&rt(u,c[1]),c[5]>0?o?o.p(c,f):(o=un(c),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},i:ae,o:ae,d(c){c&&(_(e),_(s),_(i)),o&&o.d(c),r=!1,pt(a)}}}function ei(){}function ti(){}function li(n,e,t){let{userRequest:l=""}=e,{searchClarification:u=""}=e,{llmClarification:s=""}=e,{searchResults:i}=e,{relevantConsultations:r}=e,{llmResponse:a=""}=e,{historyIsNotEmpty:o=!1}=e,c=0,f=[],h=0;function m(){f=Zs(),f.length>0?(t(4,c=f.length-1),t(5,h=f.length),g(),t(11,o=!0)):(t(4,c=0),t(5,h=0),t(11,o=!1))}Kt(()=>{m()});function g(){const k=f[c];k&&(t(0,u=k.searchClarification),t(1,s=k.llmClarification),t(8,i=k.searchResults),t(9,r=k.relevantConsultations),t(10,a=k.llmResponse),t(7,l=k.userRequest))}function b(){xs(),m()}function C(k){const V={userRequest:k,searchClarification:u,llmClarification:s,searchResults:[],llmResponse:"",relevantConsultations:[]};f.push(V),t(5,h=f.length),nn(f),t(4,c=f.length-1)}function v(k,V,I,te){const D=f[c];D&&(D.userRequest=k??D.userRequest,D.searchClarification=u??D.searchClarification,D.llmClarification=s??D.llmClarification,D.searchResults=V??D.searchResults,D.llmResponse=I??D.llmResponse,D.relevantConsultations=te??D.relevantConsultations),nn(f)}function E(){c>0&&(t(4,c-=1),g())}function S(){c{"userRequest"in k&&t(7,l=k.userRequest),"searchClarification"in k&&t(0,u=k.searchClarification),"llmClarification"in k&&t(1,s=k.llmClarification),"searchResults"in k&&t(8,i=k.searchResults),"relevantConsultations"in k&&t(9,r=k.relevantConsultations),"llmResponse"in k&&t(10,a=k.llmResponse),"historyIsNotEmpty"in k&&t(11,o=k.historyIsNotEmpty)},[u,s,E,S,c,h,b,l,i,r,a,o,C,v,T,A,w]}class ni extends Le{constructor(e){super(),Me(this,e,li,$s,Pe,{userRequest:7,searchClarification:0,llmClarification:1,searchResults:8,relevantConsultations:9,llmResponse:10,historyIsNotEmpty:11,addState:12,updateCurrentState:13,prevHistory:2,nextHistory:3,clear:14})}get addState(){return this.$$.ctx[12]}get updateCurrentState(){return this.$$.ctx[13]}get prevHistory(){return this.$$.ctx[2]}get nextHistory(){return this.$$.ctx[3]}get clear(){return this.$$.ctx[14]}}function sn(n){let e,t;return e=new gu({props:{status:n[5]}}),{c(){ve(e.$$.fragment)},l(l){pe(e.$$.fragment,l)},m(l,u){ke(e,l,u),t=!0},p(l,u){const s={};u[0]&32&&(s.status=l[5]),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){q(e.$$.fragment,l),t=!1},d(l){Ee(e,l)}}}function an(n){let e,t;return e=new vu({props:{status:n[6]}}),{c(){ve(e.$$.fragment)},l(l){pe(e.$$.fragment,l)},m(l,u){ke(e,l,u),t=!0},p(l,u){const s={};u[0]&64&&(s.status=l[6]),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){q(e.$$.fragment,l),t=!1},d(l){Ee(e,l)}}}function rn(n){let e,t="Очистить",l,u;return{c(){e=R("button"),e.textContent=t,this.h()},l(s){e=z(s,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(e)!=="svelte-1rjqwcg"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(s,i){N(s,e,i),l||(u=Q(e,"click",n[32]),l=!0)},p:ae,d(s){s&&_(e),l=!1,u()}}}function on(n){let e,t="Остановить",l,u;return{c(){e=R("button"),e.textContent=t,this.h()},l(s){e=z(s,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(e)!=="svelte-a5kyut"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(s,i){N(s,e,i),l||(u=Q(e,"click",n[38]),l=!0)},p:ae,d(s){s&&_(e),l=!1,u()}}}function ui(n){let e;return{c(){e=Se("Выбрать источники для LLM")},l(t){e=Ce(t,"Выбрать источники для LLM")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function si(n){let e;return{c(){e=Se("Использовать LLM для тизеров")},l(t){e=Ce(t,"Использовать LLM для тизеров")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function ii(n){let e;return{c(){e=Se("Использовать многоступенчатый поиск")},l(t){e=Ce(t,"Использовать многоступенчатый поиск")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function ai(n){let e;return{c(){e=Se("Получить более короткий ответ")},l(t){e=Ce(t,"Получить более короткий ответ")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function ri(n){let e;return{c(){e=Se("Выводить ответ в реальном времени")},l(t){e=Ce(t,"Выводить ответ в реальном времени")},m(t,l){N(t,e,l)},d(t){t&&_(e)}}}function cn(n){let e,t,l,u,s,i;return s=new du({}),{c(){e=R("div"),t=Se(n[16]),l=G(),u=R("div"),ve(s.$$.fragment),this.h()},l(r){e=z(r,"DIV",{class:!0});var a=F(e);t=Ce(a,n[16]),a.forEach(_),l=X(r),u=z(r,"DIV",{class:!0});var o=F(u);pe(s.$$.fragment,o),o.forEach(_),this.h()},h(){d(e,"class","loading-status svelte-yndybq"),d(u,"class","loading-container svelte-yndybq")},m(r,a){N(r,e,a),p(e,t),N(r,l,a),N(r,u,a),ke(s,u,null),i=!0},p(r,a){(!i||a[0]&65536)&&tt(t,r[16])},i(r){i||(O(s.$$.fragment,r),i=!0)},o(r){q(s.$$.fragment,r),i=!1},d(r){r&&(_(e),_(l),_(u)),Ee(s)}}}function fn(n){let e,t;return e=new Su({props:{onSave:n[30],onClose:n[31],text:n[8]}}),{c(){ve(e.$$.fragment)},l(l){pe(e.$$.fragment,l)},m(l,u){ke(e,l,u),t=!0},p(l,u){const s={};u[0]&256&&(s.text=l[8]),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){q(e.$$.fragment,l),t=!1},d(l){Ee(e,l)}}}function dn(n){let e,t='

Не могу предоставить консультацию по вашему вопросу, т.к. поиск ничего не нашел.

Пожалуйста, попробуйте переформулировать запрос.

';return{c(){e=R("aside"),e.innerHTML=t,this.h()},l(l){e=z(l,"ASIDE",{class:!0,style:!0,"data-svelte-h":!0}),Ae(e)!=="svelte-167am3x"&&(e.innerHTML=t),this.h()},h(){d(e,"class","alert variant-filled"),He(e,"margin","0 1rem")},m(l,u){N(l,e,u)},d(l){l&&_(e)}}}function hn(n){let e,t,l,u;const s=[ci,oi],i=[];function r(a,o){return a[1]?0:1}return e=r(n),t=i[e]=s[e](n),{c(){t.c(),l=De()},l(a){t.l(a),l=De()},m(a,o){i[e].m(a,o),N(a,l,o),u=!0},p(a,o){let c=e;e=r(a),e===c?i[e].p(a,o):(Fe(),q(i[c],1,1,()=>{i[c]=null}),Be(),t=i[e],t?t.p(a,o):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(l.parentNode,l))},i(a){u||(O(t),u=!0)},o(a){q(t),u=!1},d(a){a&&_(l),i[e].d(a)}}}function oi(n){let e,t;return e=new uu({props:{theme:"modern-theme",$$slots:{default:[hi]},$$scope:{ctx:n}}}),{c(){ve(e.$$.fragment)},l(l){pe(e.$$.fragment,l)},m(l,u){ke(e,l,u),t=!0},p(l,u){const s={};u[0]&262034944|u[2]&524288&&(s.$$scope={dirty:u,ctx:l}),e.$set(s)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){q(e.$$.fragment,l),t=!1},d(l){Ee(e,l)}}}function ci(n){let e,t,l,u,s,i,r,a,o,c,f,h,m,g,b,C,v,E,S,T,A=n[20]&&n[9].length>0&&bn(n),w=n[27]&&vn(n);function k(B){n[57](B)}function V(B){n[58](B)}function I(B){n[59](B)}function te(B){n[60](B)}let D={};n[9]!==void 0&&(D.searchResults=n[9]),n[17]!==void 0&&(D.showFullText=n[17]),n[19]!==void 0&&(D.useSearchResult=n[19]),n[20]!==void 0&&(D.enableSearchResultSelection=n[20]),o=new An({props:D}),ce.push(()=>be(o,"searchResults",k)),ce.push(()=>be(o,"showFullText",V)),ce.push(()=>be(o,"useSearchResult",I)),ce.push(()=>be(o,"enableSearchResultSelection",te));function $(B){n[61](B)}function se(B){n[62](B)}let ue={};return n[10]!==void 0&&(ue.consultations=n[10]),n[18]!==void 0&&(ue.showFullText=n[18]),v=new On({props:ue}),ce.push(()=>be(v,"consultations",$)),ce.push(()=>be(v,"showFullText",se)),{c(){e=R("div"),t=R("div"),A&&A.c(),l=G(),u=R("div"),s=new Vt(!1),i=G(),w&&w.c(),r=G(),a=R("div"),ve(o.$$.fragment),g=G(),b=R("hr"),C=G(),ve(v.$$.fragment),this.h()},l(B){e=z(B,"DIV",{class:!0});var le=F(e);t=z(le,"DIV",{class:!0});var re=F(t);A&&A.l(re),l=X(re),u=z(re,"DIV",{class:!0});var oe=F(u);s=qt(oe,!1),oe.forEach(_),i=X(re),w&&w.l(re),re.forEach(_),le.forEach(_),r=X(B),a=z(B,"DIV",{class:!0});var W=F(a);pe(o.$$.fragment,W),g=X(W),b=z(W,"HR",{}),C=X(W),pe(v.$$.fragment,W),W.forEach(_),this.h()},h(){s.a=null,d(u,"class","textarea svelte-yndybq"),d(t,"class","textarea svelte-yndybq"),d(e,"class","textarea-column svelte-yndybq"),d(a,"class","search-column svelte-yndybq")},m(B,le){N(B,e,le),p(e,t),A&&A.m(t,null),p(t,l),p(t,u),s.m(n[14],u),p(t,i),w&&w.m(t,null),N(B,r,le),N(B,a,le),ke(o,a,null),p(a,g),p(a,b),p(a,C),ke(v,a,null),T=!0},p(B,le){B[20]&&B[9].length>0?A?A.p(B,le):(A=bn(B),A.c(),A.m(t,l)):A&&(A.d(1),A=null),(!T||le[0]&16384)&&s.p(B[14]),B[27]?w?w.p(B,le):(w=vn(B),w.c(),w.m(t,null)):w&&(w.d(1),w=null);const re={};!c&&le[0]&512&&(c=!0,re.searchResults=B[9],_e(()=>c=!1)),!f&&le[0]&131072&&(f=!0,re.showFullText=B[17],_e(()=>f=!1)),!h&&le[0]&524288&&(h=!0,re.useSearchResult=B[19],_e(()=>h=!1)),!m&&le[0]&1048576&&(m=!0,re.enableSearchResultSelection=B[20],_e(()=>m=!1)),o.$set(re);const oe={};!E&&le[0]&1024&&(E=!0,oe.consultations=B[10],_e(()=>E=!1)),!S&&le[0]&262144&&(S=!0,oe.showFullText=B[18],_e(()=>S=!1)),v.$set(oe)},i(B){T||(O(o.$$.fragment,B),O(v.$$.fragment,B),T=!0)},o(B){q(o.$$.fragment,B),q(v.$$.fragment,B),T=!1},d(B){B&&(_(e),_(r),_(a)),A&&A.d(),w&&w.d(),Ee(o),Ee(v)}}}function fi(n){let e,t,l,u,s,i,r,a,o,c,f;function h(T){n[63](T)}function m(T){n[64](T)}function g(T){n[65](T)}function b(T){n[66](T)}let C={};n[9]!==void 0&&(C.searchResults=n[9]),n[17]!==void 0&&(C.showFullText=n[17]),n[19]!==void 0&&(C.useSearchResult=n[19]),n[20]!==void 0&&(C.enableSearchResultSelection=n[20]),t=new An({props:C}),ce.push(()=>be(t,"searchResults",h)),ce.push(()=>be(t,"showFullText",m)),ce.push(()=>be(t,"useSearchResult",g)),ce.push(()=>be(t,"enableSearchResultSelection",b));function v(T){n[67](T)}function E(T){n[68](T)}let S={};return n[10]!==void 0&&(S.consultations=n[10]),n[18]!==void 0&&(S.showFullText=n[18]),a=new On({props:S}),ce.push(()=>be(a,"consultations",v)),ce.push(()=>be(a,"showFullText",E)),{c(){e=R("div"),ve(t.$$.fragment),r=G(),ve(a.$$.fragment),this.h()},l(T){e=z(T,"DIV",{class:!0});var A=F(e);pe(t.$$.fragment,A),r=X(A),pe(a.$$.fragment,A),A.forEach(_),this.h()},h(){d(e,"class","search-column svelte-yndybq")},m(T,A){N(T,e,A),ke(t,e,null),p(e,r),ke(a,e,null),f=!0},p(T,A){const w={};!l&&A[0]&512&&(l=!0,w.searchResults=T[9],_e(()=>l=!1)),!u&&A[0]&131072&&(u=!0,w.showFullText=T[17],_e(()=>u=!1)),!s&&A[0]&524288&&(s=!0,w.useSearchResult=T[19],_e(()=>s=!1)),!i&&A[0]&1048576&&(i=!0,w.enableSearchResultSelection=T[20],_e(()=>i=!1)),t.$set(w);const k={};!o&&A[0]&1024&&(o=!0,k.consultations=T[10],_e(()=>o=!1)),!c&&A[0]&262144&&(c=!0,k.showFullText=T[18],_e(()=>c=!1)),a.$set(k)},i(T){f||(O(t.$$.fragment,T),O(a.$$.fragment,T),f=!0)},o(T){q(t.$$.fragment,T),q(a.$$.fragment,T),f=!1},d(T){T&&_(e),Ee(t),Ee(a)}}}function mn(n){let e,t="Получить ответ",l,u;return{c(){e=R("button"),e.textContent=t,this.h()},l(s){e=z(s,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(e)!=="svelte-117yy5h"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(s,i){N(s,e,i),l||(u=Q(e,"click",n[39]),l=!0)},p:ae,d(s){s&&_(e),l=!1,u()}}}function gn(n){let e,t;return{c(){e=new Vt(!1),t=De(),this.h()},l(l){e=qt(l,!1),t=De(),this.h()},h(){e.a=t},m(l,u){e.m(n[14],l,u),N(l,t,u)},p(l,u){u[0]&16384&&e.p(l[14])},d(l){l&&(_(t),e.d())}}}function _n(n){let e,t,l="Оцените ответ:",u,s,i="👍",r,a,o="👎",c,f,h,m;return{c(){e=R("div"),t=R("span"),t.textContent=l,u=G(),s=R("button"),s.textContent=i,r=G(),a=R("button"),a.textContent=o,c=G(),f=R("textarea"),this.h()},l(g){e=z(g,"DIV",{});var b=F(e);t=z(b,"SPAN",{"data-svelte-h":!0}),Ae(t)!=="svelte-9pssby"&&(t.textContent=l),u=X(b),s=z(b,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(s)!=="svelte-1hnmipt"&&(s.textContent=i),r=X(b),a=z(b,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(a)!=="svelte-12wf95"&&(a.textContent=o),c=X(b),f=z(b,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(f).forEach(_),b.forEach(_),this.h()},h(){d(s,"class","btn-icon"),d(a,"class","btn-icon"),d(f,"rows","3"),d(f,"placeholder","Комментарий"),d(f,"class","svelte-yndybq")},m(g,b){N(g,e,b),p(e,t),p(e,u),p(e,s),p(e,r),p(e,a),p(e,c),p(e,f),rt(f,n[26]),h||(m=[Q(s,"click",n[40]),Q(a,"click",n[41]),Q(f,"input",n[69]),Q(f,"input",n[35])],h=!0)},p(g,b){b[0]&67108864&&rt(f,g[26])},d(g){g&&_(e),h=!1,pt(m)}}}function di(n){let e,t,l,u,s,i=n[20]&&n[9].length>0&&mn(n),r=(!n[25]&&!n[12]||n[25]&&n[14]&&!n[23]||n[25]&&n[14]&&n[23]&&n[24])&&gn(n),a=n[27]&&_n(n);return{c(){e=R("div"),t=R("div"),i&&i.c(),l=G(),u=R("div"),r&&r.c(),s=G(),a&&a.c(),this.h()},l(o){e=z(o,"DIV",{class:!0});var c=F(e);t=z(c,"DIV",{class:!0});var f=F(t);i&&i.l(f),l=X(f),u=z(f,"DIV",{class:!0});var h=F(u);r&&r.l(h),h.forEach(_),s=X(f),a&&a.l(f),f.forEach(_),c.forEach(_),this.h()},h(){d(u,"class","textarea svelte-yndybq"),d(t,"class","textarea svelte-yndybq"),d(e,"class","textarea-column svelte-yndybq")},m(o,c){N(o,e,c),p(e,t),i&&i.m(t,null),p(t,l),p(t,u),r&&r.m(u,null),p(t,s),a&&a.m(t,null)},p(o,c){o[20]&&o[9].length>0?i?i.p(o,c):(i=mn(o),i.c(),i.m(t,l)):i&&(i.d(1),i=null),!o[25]&&!o[12]||o[25]&&o[14]&&!o[23]||o[25]&&o[14]&&o[23]&&o[24]?r?r.p(o,c):(r=gn(o),r.c(),r.m(u,null)):r&&(r.d(1),r=null),o[27]?a?a.p(o,c):(a=_n(o),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(o){o&&_(e),i&&i.d(),r&&r.d(),a&&a.d()}}}function hi(n){let e,t,l,u;return e=new kl({props:{minSize:20,class:"search-column",size:49,$$slots:{default:[fi]},$$scope:{ctx:n}}}),l=new kl({props:{size:49,$$slots:{default:[di]},$$scope:{ctx:n}}}),{c(){ve(e.$$.fragment),t=G(),ve(l.$$.fragment)},l(s){pe(e.$$.fragment,s),t=X(s),pe(l.$$.fragment,s)},m(s,i){ke(e,s,i),N(s,t,i),ke(l,s,i),u=!0},p(s,i){const r={};i[0]&1967616|i[2]&524288&&(r.$$scope={dirty:i,ctx:s}),e.$set(r);const a={};i[0]&261116416|i[2]&524288&&(a.$$scope={dirty:i,ctx:s}),l.$set(a)},i(s){u||(O(e.$$.fragment,s),O(l.$$.fragment,s),u=!0)},o(s){q(e.$$.fragment,s),q(l.$$.fragment,s),u=!1},d(s){s&&_(t),Ee(e,s),Ee(l,s)}}}function bn(n){let e,t="Получить ответ",l,u;return{c(){e=R("button"),e.textContent=t,this.h()},l(s){e=z(s,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(e)!=="svelte-3pb36x"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(s,i){N(s,e,i),l||(u=Q(e,"click",n[39]),l=!0)},p:ae,d(s){s&&_(e),l=!1,u()}}}function vn(n){let e,t,l="Оцените ответ:",u,s,i="👍",r,a,o="👎",c,f,h,m;return{c(){e=R("div"),t=R("span"),t.textContent=l,u=G(),s=R("button"),s.textContent=i,r=G(),a=R("button"),a.textContent=o,c=G(),f=R("textarea"),this.h()},l(g){e=z(g,"DIV",{});var b=F(e);t=z(b,"SPAN",{"data-svelte-h":!0}),Ae(t)!=="svelte-9pssby"&&(t.textContent=l),u=X(b),s=z(b,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(s)!=="svelte-1hnmipt"&&(s.textContent=i),r=X(b),a=z(b,"BUTTON",{class:!0,"data-svelte-h":!0}),Ae(a)!=="svelte-12wf95"&&(a.textContent=o),c=X(b),f=z(b,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(f).forEach(_),b.forEach(_),this.h()},h(){d(s,"class","btn-icon"),d(a,"class","btn-icon"),d(f,"rows","3"),d(f,"placeholder","Комментарий"),d(f,"class","svelte-yndybq")},m(g,b){N(g,e,b),p(e,t),p(e,u),p(e,s),p(e,r),p(e,a),p(e,c),p(e,f),rt(f,n[26]),h||(m=[Q(s,"click",n[40]),Q(a,"click",n[41]),Q(f,"input",n[56]),Q(f,"input",n[35])],h=!0)},p(g,b){b[0]&67108864&&rt(f,g[26])},d(g){g&&_(e),h=!1,pt(m)}}}function mi(n){let e,t,l,u,s,i,r,a,o,c,f,h=n[5],m,g=n[6],b,C,v,E=n[29]?"Свернуть уточнение":"Уточнить",S,T,A,w,k,V="Отправить",I,te,D,$,se,ue,B,le,re,oe,W,ie,x,U,ct,Ve,ft,Z,We,Re,dt,Ke,yt,Ge,lt,It,Dt,Ze,Pt,Ft,kt,xe,Lt,Tt,nt,Mt,Nt,Rt,Et,y,H;l=new Ds({});let K=sn(n),M=an(n),Y=n[15]&&rn(n),j=n[12]&&on(n);function J(P){n[44](P)}function ne(P){n[45](P)}function fe(P){n[46](P)}function me(P){n[47](P)}function Oe(P){n[48](P)}function qe(P){n[49](P)}function de(P){n[50](P)}let Te={};n[3]!==void 0&&(Te.llmClarification=n[3]),n[2]!==void 0&&(Te.searchClarification=n[2]),n[9]!==void 0&&(Te.searchResults=n[9]),n[10]!==void 0&&(Te.relevantConsultations=n[10]),n[14]!==void 0&&(Te.llmResponse=n[14]),n[4]!==void 0&&(Te.historyIsNotEmpty=n[4]),n[15]!==void 0&&(Te.userRequest=n[15]),D=new ni({props:Te}),n[43](D),ce.push(()=>be(D,"llmClarification",J)),ce.push(()=>be(D,"searchClarification",ne)),ce.push(()=>be(D,"searchResults",fe)),ce.push(()=>be(D,"relevantConsultations",me)),ce.push(()=>be(D,"llmResponse",Oe)),ce.push(()=>be(D,"historyIsNotEmpty",qe)),ce.push(()=>be(D,"userRequest",de));function Bt(P){n[51](P)}let L={name:"slider-label",size:"sm",$$slots:{default:[ui]},$$scope:{ctx:n}};n[20]!==void 0&&(L.checked=n[20]),Ve=new Ht({props:L}),ce.push(()=>be(Ve,"checked",Bt));function he(P){n[52](P)}let zt={name:"slider-label",size:"sm",$$slots:{default:[si]},$$scope:{ctx:n}};n[21]!==void 0&&(zt.checked=n[21]),Re=new Ht({props:zt}),ce.push(()=>be(Re,"checked",he));function $e(P){n[53](P)}let et={name:"slider-label",size:"sm",$$slots:{default:[ii]},$$scope:{ctx:n}};n[22]!==void 0&&(et.checked=n[22]),Ge=new Ht({props:et}),ce.push(()=>be(Ge,"checked",$e));function ut(P){n[54](P)}let St={name:"slider-label",size:"sm",$$slots:{default:[ai]},$$scope:{ctx:n}};n[23]!==void 0&&(St.checked=n[23]),Ze=new Ht({props:St}),ce.push(()=>be(Ze,"checked",ut));function Zt(P){n[55](P)}let il={name:"slider-label",size:"sm",$$slots:{default:[ri]},$$scope:{ctx:n}};n[25]!==void 0&&(il.checked=n[25]),xe=new Ht({props:il}),ce.push(()=>be(xe,"checked",Zt));let ze=(n[11]||n[12])&&cn(n),we=n[7]&&fn(n),je=n[28]&&dn(),Ie=(n[13]||n[4]&&n[9].length>0)&&hn(n);return{c(){e=R("meta"),t=G(),ve(l.$$.fragment),u=G(),s=R("section"),i=R("div"),r=R("div"),a=R("textarea"),o=G(),c=R("div"),f=R("div"),K.c(),m=G(),M.c(),b=G(),C=R("div"),v=R("button"),S=Se(E),T=G(),Y&&Y.c(),A=G(),j&&j.c(),w=G(),k=R("button"),k.textContent=V,I=G(),te=R("div"),ve(D.$$.fragment),W=G(),ie=R("div"),x=R("div"),U=G(),ct=R("div"),ve(Ve.$$.fragment),Z=G(),We=R("div"),ve(Re.$$.fragment),Ke=G(),yt=R("div"),ve(Ge.$$.fragment),It=G(),Dt=R("div"),ve(Ze.$$.fragment),Ft=G(),kt=R("div"),ve(xe.$$.fragment),Tt=G(),nt=R("div"),ze&&ze.c(),Mt=G(),we&&we.c(),Nt=G(),je&&je.c(),Rt=G(),Ie&&Ie.c(),this.h()},l(P){const ee=Hn("svelte-1wpbm1r",document.head);e=z(ee,"META",{name:!0,content:!0}),ee.forEach(_),t=X(P),pe(l.$$.fragment,P),u=X(P),s=z(P,"SECTION",{});var Ue=F(s);i=z(Ue,"DIV",{class:!0});var Ct=F(i);r=z(Ct,"DIV",{class:!0});var jt=F(r);a=z(jt,"TEXTAREA",{class:!0,rows:!0,placeholder:!0}),F(a).forEach(_),jt.forEach(_),o=X(Ct),c=z(Ct,"DIV",{class:!0});var Xe=F(c);f=z(Xe,"DIV",{class:!0});var At=F(f);K.l(At),m=X(At),M.l(At),At.forEach(_),b=X(Xe),C=z(Xe,"DIV",{class:!0});var st=F(C);v=z(st,"BUTTON",{class:!0});var al=F(v);S=Ce(al,E),al.forEach(_),T=X(st),Y&&Y.l(st),A=X(st),j&&j.l(st),w=X(st),k=z(st,"BUTTON",{title:!0,class:!0,"data-svelte-h":!0}),Ae(k)!=="svelte-w5ppob"&&(k.textContent=V),st.forEach(_),I=X(Xe),te=z(Xe,"DIV",{class:!0});var rl=F(te);pe(D.$$.fragment,rl),rl.forEach(_),W=X(Xe),ie=z(Xe,"DIV",{class:!0,style:!0});var it=F(ie);x=z(it,"DIV",{}),F(x).forEach(_),U=X(it),ct=z(it,"DIV",{});var ol=F(ct);pe(Ve.$$.fragment,ol),ol.forEach(_),Z=X(it),We=z(it,"DIV",{});var cl=F(We);pe(Re.$$.fragment,cl),cl.forEach(_),Ke=X(it),yt=z(it,"DIV",{});var fl=F(yt);pe(Ge.$$.fragment,fl),fl.forEach(_),It=X(it),Dt=z(it,"DIV",{});var dl=F(Dt);pe(Ze.$$.fragment,dl),dl.forEach(_),Ft=X(it),kt=z(it,"DIV",{});var hl=F(kt);pe(xe.$$.fragment,hl),hl.forEach(_),it.forEach(_),Tt=X(Xe),nt=z(Xe,"DIV",{class:!0});var ml=F(nt);ze&&ze.l(ml),ml.forEach(_),Xe.forEach(_),Mt=X(Ct),we&&we.l(Ct),Ct.forEach(_),Nt=X(Ue),je&&je.l(Ue),Rt=X(Ue),Ie&&Ie.l(Ue),Ue.forEach(_),this.h()},h(){document.title="LLM demo app",d(e,"name","description"),d(e,"content","LLM demo app"),d(a,"class","auto-expand-textarea svelte-yndybq"),d(a,"rows","1"),d(a,"placeholder","Введите ваш запрос..."),d(r,"class","grow-wrap w-full svelte-yndybq"),d(f,"class","status-components svelte-yndybq"),d(v,"class","btn variant-outline-tertiary"),d(k,"title","Ctrl+Enter"),d(k,"class","btn variant-filled"),d(C,"class","flex space-x-2 items-center"),d(te,"class","w-full"),Ye(te,"hidden",!n[29]),d(ie,"class","card w-full flex p-2 space-x-2 my-2"),He(ie,"align-items","center"),He(ie,"flex-wrap","wrap"),d(nt,"class","flex space-x-2 items-center w-full"),d(c,"class","search-second-bar w-full flex svelte-yndybq"),d(i,"class","search-bar flex flex-wrap svelte-yndybq")},m(P,ee){p(document.head,e),N(P,t,ee),ke(l,P,ee),N(P,u,ee),N(P,s,ee),p(s,i),p(i,r),p(r,a),rt(a,n[15]),p(i,o),p(i,c),p(c,f),K.m(f,null),p(f,m),M.m(f,null),p(c,b),p(c,C),p(C,v),p(v,S),p(C,T),Y&&Y.m(C,null),p(C,A),j&&j.m(C,null),p(C,w),p(C,k),p(c,I),p(c,te),ke(D,te,null),p(c,W),p(c,ie),p(ie,x),p(ie,U),p(ie,ct),ke(Ve,ct,null),p(ie,Z),p(ie,We),ke(Re,We,null),p(ie,Ke),p(ie,yt),ke(Ge,yt,null),p(ie,It),p(ie,Dt),ke(Ze,Dt,null),p(ie,Ft),p(ie,kt),ke(xe,kt,null),p(c,Tt),p(c,nt),ze&&ze.m(nt,null),p(i,Mt),we&&we.m(i,null),p(s,Nt),je&&je.m(s,null),p(s,Rt),Ie&&Ie.m(s,null),Et=!0,y||(H=[Q(a,"input",n[42]),Q(a,"input",n[34]),Q(a,"keydown",n[36]),Q(v,"click",n[33]),Q(k,"click",n[37])],y=!0)},p(P,ee){ee[0]&32768&&rt(a,P[15]),ee[0]&32&&Pe(h,h=P[5])?(Fe(),q(K,1,1,ae),Be(),K=sn(P),K.c(),O(K,1),K.m(f,m)):K.p(P,ee),ee[0]&64&&Pe(g,g=P[6])?(Fe(),q(M,1,1,ae),Be(),M=an(P),M.c(),O(M,1),M.m(f,null)):M.p(P,ee),(!Et||ee[0]&536870912)&&E!==(E=P[29]?"Свернуть уточнение":"Уточнить")&&tt(S,E),P[15]?Y?Y.p(P,ee):(Y=rn(P),Y.c(),Y.m(C,A)):Y&&(Y.d(1),Y=null),P[12]?j?j.p(P,ee):(j=on(P),j.c(),j.m(C,w)):j&&(j.d(1),j=null);const Ue={};!$&&ee[0]&8&&($=!0,Ue.llmClarification=P[3],_e(()=>$=!1)),!se&&ee[0]&4&&(se=!0,Ue.searchClarification=P[2],_e(()=>se=!1)),!ue&&ee[0]&512&&(ue=!0,Ue.searchResults=P[9],_e(()=>ue=!1)),!B&&ee[0]&1024&&(B=!0,Ue.relevantConsultations=P[10],_e(()=>B=!1)),!le&&ee[0]&16384&&(le=!0,Ue.llmResponse=P[14],_e(()=>le=!1)),!re&&ee[0]&16&&(re=!0,Ue.historyIsNotEmpty=P[4],_e(()=>re=!1)),!oe&&ee[0]&32768&&(oe=!0,Ue.userRequest=P[15],_e(()=>oe=!1)),D.$set(Ue),(!Et||ee[0]&536870912)&&Ye(te,"hidden",!P[29]);const Ct={};ee[2]&524288&&(Ct.$$scope={dirty:ee,ctx:P}),!ft&&ee[0]&1048576&&(ft=!0,Ct.checked=P[20],_e(()=>ft=!1)),Ve.$set(Ct);const jt={};ee[2]&524288&&(jt.$$scope={dirty:ee,ctx:P}),!dt&&ee[0]&2097152&&(dt=!0,jt.checked=P[21],_e(()=>dt=!1)),Re.$set(jt);const Xe={};ee[2]&524288&&(Xe.$$scope={dirty:ee,ctx:P}),!lt&&ee[0]&4194304&&(lt=!0,Xe.checked=P[22],_e(()=>lt=!1)),Ge.$set(Xe);const At={};ee[2]&524288&&(At.$$scope={dirty:ee,ctx:P}),!Pt&&ee[0]&8388608&&(Pt=!0,At.checked=P[23],_e(()=>Pt=!1)),Ze.$set(At);const st={};ee[2]&524288&&(st.$$scope={dirty:ee,ctx:P}),!Lt&&ee[0]&33554432&&(Lt=!0,st.checked=P[25],_e(()=>Lt=!1)),xe.$set(st),P[11]||P[12]?ze?(ze.p(P,ee),ee[0]&6144&&O(ze,1)):(ze=cn(P),ze.c(),O(ze,1),ze.m(nt,null)):ze&&(Fe(),q(ze,1,1,()=>{ze=null}),Be()),P[7]?we?(we.p(P,ee),ee[0]&128&&O(we,1)):(we=fn(P),we.c(),O(we,1),we.m(i,null)):we&&(Fe(),q(we,1,1,()=>{we=null}),Be()),P[28]?je||(je=dn(),je.c(),je.m(s,Rt)):je&&(je.d(1),je=null),P[13]||P[4]&&P[9].length>0?Ie?(Ie.p(P,ee),ee[0]&8720&&O(Ie,1)):(Ie=hn(P),Ie.c(),O(Ie,1),Ie.m(s,null)):Ie&&(Fe(),q(Ie,1,1,()=>{Ie=null}),Be())},i(P){Et||(O(l.$$.fragment,P),O(K),O(M),O(D.$$.fragment,P),O(Ve.$$.fragment,P),O(Re.$$.fragment,P),O(Ge.$$.fragment,P),O(Ze.$$.fragment,P),O(xe.$$.fragment,P),O(ze),O(we),O(Ie),Et=!0)},o(P){q(l.$$.fragment,P),q(K),q(M),q(D.$$.fragment,P),q(Ve.$$.fragment,P),q(Re.$$.fragment,P),q(Ge.$$.fragment,P),q(Ze.$$.fragment,P),q(xe.$$.fragment,P),q(ze),q(we),q(Ie),Et=!1},d(P){P&&(_(t),_(u),_(s)),_(e),Ee(l,P),K.d(P),M.d(P),Y&&Y.d(),j&&j.d(),n[43](null),Ee(D),Ee(Ve),Ee(Re),Ee(Ge),Ee(Ze),Ee(xe),ze&&ze.d(),we&&we.d(),je&&je.d(),Ie&&Ie.d(),y=!1,pt(H)}}}let gi=`Всегда отвечай на РУССКОМ языке. Прочитай ответ эксперта на вопрос. Используй только такой формат ответа: + 1) какие ответы даны на вопросы: "Ответ: *текст ответа*". + 2) какие юридические источники используются в обосновании: "Источники: *список документов*". + Отвечай на русском языке! + Текст:`;function pn(n){return n.map(({title:e,text:t})=>`${e} +${t}`).join(` + +`)}function _i(n,e,t){let l;Bu();let u=!1;const s={message:"Спасибо за оценку!",timeout:5e3},i=In();Kt(()=>{t(1,u=window.innerWidth<=768)});let r="",a="",o=!0,c="unknown",f="unknown",h=!1,m=`Ты юрист. Твоя задача – дать верный ответ на поставленный тебе вопрос(ы) или предоставить информацию, если пользователю нужна консультация или разъяснение. Отвечай всегда только на РУССКОМ языке! Цель твоей работы – дать качественный, имеющий подтверждение в юридических источниках ответ. Ты действуешь по такому плану: + Читаешь вопрос(ы) + Сопоставляешь информацию, описанную в вопросах, с предоставленным тебе списком юридических источников, и составляешь ответ. Закончи фразой "Конец ответа". + Далее обязательно сопоставляешь свой ответ с описанной ситуацией, которая сопровождает вопрос и корректируешь свой ответ, делая акцент именно на описанной ситуации и на деталях вопроса, а не на общей информации, которую ты взял из источников. + Выводишь ответ в таком виде «По Вашему запросу сообщаем:». Далее идет твой ответ с ссылками на источники, которые были использованы для формирования ответа. + Помни, что ты профессиональный юрист и твои ответы должны быть формальными и точными. Используй специальную терминологию, которая точно определяет правовые понятия и процессы. Используй всегда официально-деловой стиль. + Отвечай всегда только на РУССКОМ языке! + Вопрос: {{ВОПРОС}} + Источники: {{ИСТОЧНИКИ}}`;function g(L){t(8,m=L)}function b(){t(7,h=!1)}async function C(){try{const L=await fetch(`${window.location.origin}/llm/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!L.ok)throw new Error(`Failed to fetch Llama health status: ${L.statusText}`);const he=await L.json();t(5,c=he.status)}catch(L){console.error("Error fetching Llama health status:",L.message)}try{const L=await fetch(`${window.location.origin}/search/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!L.ok)throw new Error(`Failed to fetch search health status: ${L.statusText}`);const he=await L.json();t(6,f=he.status)}catch(L){console.error("Error fetching search health status:",L.message)}}Kt(async()=>{C()}),ll(()=>{Ke()});let v=[],E=[],S=!1,T=!1,A=!1,w="",k="",V="",I=Array(v.length).fill(!1),te=Array(E.length).fill(!1),D,$=!1,se=!1,ue=!1,B=!1,le=!1,re=!1,oe="",W=!1,ie=!1,x=!1;const U=async L=>{t(14,w=""),t(11,S=!1),t(12,T=!1),t(13,A=!1),t(9,v=[]),t(10,E=[]),t(15,k=""),t(27,W=!1),t(28,ie=!1),l.clear(),Ke()},ct=async L=>{t(29,x=!x)},Ve=L=>{t(15,k=L.target.value);const he=L.target.parentNode;he&&(he.dataset.replicatedValue=k)},ft=L=>{t(26,oe=L.target.value);const he=L.target.parentNode;he&&(he.dataset.replicatedValue=k)},Z=L=>{L.ctrlKey&&L.key==="Enter"&&(L.preventDefault(),dt())},We=async()=>{let L="",he="";if($){if(L=pn(v.filter(($e,et)=>D[$e.title])),!L){t(14,w="Выберите хотя бы один документ из результатов поиска.");return}}else{const $e=v.slice(0,10);L=pn($e)}he=m.replace("{{ВОПРОС}}",k+` +`+a).replace("{{ИСТОЧНИКИ}}",L),t(12,T=!0),t(16,V="Генерируем ответ на основе результатов поиска");const zt=await fetch("/llm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userprompt:he}),signal:Re.signal});try{if(Re.signal.aborted){console.log("Request was cancelled.");return}if(!zt.body){console.log("Response has no body");return}const $e=zt.body.pipeThrough(new TextDecoderStream).getReader();let et=!0;for(;et;)try{if(Re.signal.aborted){console.log("Request was cancelled during reading.");break}const{value:ut,done:St}=await $e.read();if(St){et=!1;break}ut&&t(14,w+=ut.replaceAll(` +`,"
"))}catch(ut){if(t(16,V="Ошибка генерации ответа"),ut.name==="AbortError"){et=!1,console.log("Fetch was aborted during reading.");break}else{et=!1,console.error("Error during reading:",ut);break}}B||(t(16,V=""),t(12,T=!1),t(27,W=!0))}catch($e){$e.name==="AbortError"?console.log("Fetch was aborted."):console.error("Error during fetch:",$e)}if(B){he=gi+w,t(14,w="");const $e=await fetch("/llm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userprompt:he}),signal:Re.signal});try{if(Re.signal.aborted){console.log("Request was cancelled.");return}if(!$e.body){console.log("Response has no body");return}const et=$e.body.pipeThrough(new TextDecoderStream).getReader();let ut=!0;for(;ut;)try{if(Re.signal.aborted){console.log("Request was cancelled during reading.");break}const{value:St,done:Zt}=await et.read();if(Zt){ut=!1;break}St&&t(14,w+=St.replaceAll(` +`,"
")),w&&!le&&t(24,le=!0)}catch(St){if(t(16,V="Ошибка генерации ответа"),St.name==="AbortError"){ut=!1,console.log("Fetch was aborted during reading.");break}else{ut=!1,console.error("Error during reading:",St);break}}t(16,V=""),t(12,T=!1),t(27,W=!0)}catch(et){et.name==="AbortError"?console.log("Fetch was aborted."):console.error("Error during fetch:",et)}}l.updateCurrentState(null,null,w,null)};let Re=new AbortController;const dt=async L=>{await Ke(),t(17,I=Array(10).fill(!1)),t(18,te=Array(10).fill(!1)),t(19,D={}),t(14,w=""),t(24,le=!1),t(27,W=!1),t(11,S=!0),t(12,T=!1),t(13,A=!0),t(28,ie=!1),t(16,V="Ищем релевантные документы"),l.addState(k);try{const he=await fetch("/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:k+` +`+r,use_llm_for_teasers:se,do_multistep_search:ue})});if(!he.ok)throw new Error(`Failed to fetch search results: ${he.statusText}`);const zt=await he.json();t(9,v=at.sortByRelevance(zt.results)),t(9,v=at.identifyDocumentType(v)),t(10,E=zt.consultations),l.updateCurrentState(k,v,null,E)}catch{}t(16,V=""),t(11,S=!1),v&&v.length>0?$||await We():t(28,ie=!0)},Ke=()=>{Re.abort("user canceled"),Re=new AbortController,t(12,T=!1),t(16,V="")};async function yt(){t(14,w=""),await Ke(),l.addState(k),l.updateCurrentState(null,v,null,E),setTimeout(async()=>{await We()},1e3)}async function Ge(){await It({userScore:"positive"}),i.trigger(s),t(26,oe="")}async function lt(){await It({userScore:"negative"}),i.trigger(s),t(26,oe="")}async function It(L){try{const he=await fetch("/log/response",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_query:k,prompt_template:m,search_results:v,relevant_consultations:E,llm_response:w.replaceAll("
",` +`),user_score:L.userScore,user_comment:oe})});if(!he.ok)throw new Error(`Failed to fetch search results: ${he.statusText}`);if((await he.json()).success)return!0}catch{}return!1}function Dt(){k=this.value,t(15,k)}function Ze(L){ce[L?"unshift":"push"](()=>{l=L,t(0,l)})}function Pt(L){a=L,t(3,a)}function Ft(L){r=L,t(2,r)}function kt(L){v=L,t(9,v)}function xe(L){E=L,t(10,E)}function Lt(L){w=L,t(14,w)}function Tt(L){o=L,t(4,o)}function nt(L){k=L,t(15,k)}function Mt(L){$=L,t(20,$)}function Nt(L){se=L,t(21,se)}function Rt(L){ue=L,t(22,ue)}function Et(L){B=L,t(23,B)}function y(L){re=L,t(25,re)}function H(){oe=this.value,t(26,oe)}function K(L){v=L,t(9,v)}function M(L){I=L,t(17,I)}function Y(L){D=L,t(19,D)}function j(L){$=L,t(20,$)}function J(L){E=L,t(10,E)}function ne(L){te=L,t(18,te)}function fe(L){v=L,t(9,v)}function me(L){I=L,t(17,I)}function Oe(L){D=L,t(19,D)}function qe(L){$=L,t(20,$)}function de(L){E=L,t(10,E)}function Te(L){te=L,t(18,te)}function Bt(){oe=this.value,t(26,oe)}return[l,u,r,a,o,c,f,h,m,v,E,S,T,A,w,k,V,I,te,D,$,se,ue,B,le,re,oe,W,ie,x,g,b,U,ct,Ve,ft,Z,dt,Ke,yt,Ge,lt,Dt,Ze,Pt,Ft,kt,xe,Lt,Tt,nt,Mt,Nt,Rt,Et,y,H,K,M,Y,j,J,ne,fe,me,Oe,qe,de,Te,Bt]}class Si extends Le{constructor(e){super(),Me(this,e,_i,mi,Pe,{},null,[-1,-1,-1])}}export{Si as component,Ei as universal};