muryshev's picture
rebuild
18240e8
raw
history blame
95.6 kB
import{n as se,H as $n,D as it,s as Be,w as $e,e as T,a as J,c as P,b as F,g as Q,f as b,p as h,T as Ge,i as O,h as z,y as et,z as tt,A as nt,U as At,k as rt,V as ae,W as bt,o as Dt,X as Ot,m as el,v as tl,r as Ae,l as Se,Y as fe,Z as G,_ as Ze,$ as xe,t as Oe,d as Me,q as Ye,j as ht,x as Re,a0 as dt,a1 as nl,a2 as Nt,a3 as Ue,a4 as Je,a5 as Ln,F as Vn,a6 as ll,a7 as we,a8 as mt,a9 as gt,E as ul,aa as il,ab as zt,ac as Tt,ad as wt,ae as qe,af as sl}from"../chunks/scheduler.Ze4Bbz0A.js";import{n as al,l as rl,f as ol,h as cl,a as I,t as N,S as Le,i as Ve,g as ze,c as Te,j as Nn,k as jn,o as He,b as ve,d as ke,m as pe,e as Ee}from"../chunks/index.76WsQp4a.js";import{w as ft,r as fl}from"../chunks/entry.Jq0Hfimk.js";const Un=!0;function dl(l,e,t,n){if(!e)return se;const u=l.getBoundingClientRect();if(e.left===u.left&&e.right===u.right&&e.top===u.top&&e.bottom===u.bottom)return se;const{delay:i=0,duration:s=300,easing:a=$n,start:r=al()+i,end:o=r+s,tick:f=se,css:d}=t(l,{from:e,to:u},n);let m=!0,c=!1,_;function g(){d&&(_=ol(l,0,1,s,i,a,d)),i||(c=!0)}function v(){d&&cl(l,_),m=!1}return rl(y=>{if(!c&&y>=r&&(c=!0),c&&y>=o&&(f(1,0),v()),!m)return!1;if(c){const S=y-r,k=0+1*a(S/s);f(k,1-k)}return!0}),g(),f(0,1),v}function hl(l){const e=getComputedStyle(l);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:n}=e,u=l.getBoundingClientRect();l.style.position="absolute",l.style.width=t,l.style.height=n,Wn(l,u)}}function Wn(l,e){const t=l.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const n=getComputedStyle(l),u=n.transform==="none"?"":n.transform;l.style.transform=`${u} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}function ut(l){return l?.length!==void 0?l:Array.from(l)}function ml(l,e){N(l,1,1,()=>{e.delete(l.key)})}function gl(l,e){l.f(),ml(l,e)}function _l(l,e,t,n,u,i,s,a,r,o,f,d){let m=l.length,c=i.length,_=m;const g={};for(;_--;)g[l[_].key]=_;const v=[],y=new Map,S=new Map,k=[];for(_=c;_--;){const C=d(u,i,_),w=t(C);let D=s.get(w);D?n&&k.push(()=>D.p(C,e)):(D=o(w,C),D.c()),y.set(w,v[_]=D),w in g&&S.set(w,Math.abs(_-g[w]))}const M=new Set,j=new Set;function p(C){I(C,1),C.m(a,f),s.set(C.key,C),f=C.first,c--}for(;m&&c;){const C=v[c-1],w=l[m-1],D=C.key,$=w.key;C===w?(f=C.first,m--,c--):y.has($)?!s.has(D)||M.has(D)?p(C):j.has($)?m--:S.get(D)>S.get($)?(j.add(D),p(C)):(M.add($),m--):(r(w,s),m--)}for(;m--;){const C=l[m];y.has(C.key)||r(C,s)}for(;c;)p(v[c-1]);return it(k),v}function qn(l,e){const t={},n={},u={$$scope:1};let i=l.length;for(;i--;){const s=l[i],a=e[i];if(a){for(const r in s)r in a||(n[r]=1);for(const r in a)u[r]||(t[r]=a[r],u[r]=1);l[i]=a}else for(const r in s)u[r]=1}for(const s in n)s in t||(t[s]=void 0);return t}const bl=!0,Ei=Object.freeze(Object.defineProperty({__proto__:null,prerender:bl},Symbol.toStringTag,{value:"Module"}));function Ct(l){if(!l.endsWith("px"))return;const e=parseFloat(l.slice(0,l.length-2));return isNaN(e)?void 0:e}const Hn=l=>l?"height":"width",Bt=l=>window.getComputedStyle(l),It=l=>l.getBoundingClientRect(),vl=(l,e=!0)=>{if(l.getPropertyValue("box-sizing")==="border-box")return;const t=Ct(l.getPropertyValue("border-left-width"));if(t===void 0){console.error("Splitpanes Error: Fail to parse container `border-left-width`.");return}const n=Ct(l.getPropertyValue("border-top-width"));if(n===void 0){console.error("Splitpanes Error: Fail to parse container `border-top-width`.");return}const u={left:t,top:n};if(e){const i=Ct(l.getPropertyValue("border-right-width"));if(i===void 0){console.error("Splitpanes Error: Fail to parse container `border-right-width`.");return}const s=Ct(l.getPropertyValue("border-bottom-width"));if(s===void 0){console.error("Splitpanes Error: Fail to parse container `border-bottom-width`.");return}const a=u;a.right=i,a.bottom=s}return u};function kl(l,e){e||(e=Bt(l));const t=It(l),n=vl(e,!0)||{left:0,top:0,right:0,bottom:0};return{width:t.width-n.left-n.right,height:t.height-n.top-n.bottom,left:t.left+n.left,top:t.top+n.top}}const jt=(l,e)=>({left:l.left-e.left,top:l.top-e.top});function Ut(l){const e=l,t=l,{clientX:n,clientY:u}="ontouchstart"in window&&t.touches?t.touches[0]:e;return{left:n,top:u}}function Wt(l,e,t,n){let u=0;for(let i=e;i<t;i++)u+=n(l[i],i);return u}function yt(l,e,t,n){for(let u=e;u<t;u++)n(l[u],u)}function pl(l){let e,t,n,u,i=!Un;const s=l[16].default,a=$e(s,l,l[18],null);return{c(){e=T("div"),t=J(),a&&a.c(),this.h()},l(r){e=P(r,"DIV",{id:!0,class:!0,style:!0});var o=F(e);t=Q(o),a&&a.l(o),o.forEach(b),this.h()},h(){h(e,"id",l[0]),h(e,"class",n=`splitpanes ${l[3]||""} ${l[4]||""}`),h(e,"style",l[2]),Ge(e,"splitpanes--horizontal",l[1]),Ge(e,"splitpanes--vertical",!l[1]),Ge(e,"splitpanes--dragging",l[7]||l[8]),Ge(e,"splitpanes--freeze",!l[6])},m(r,o){O(r,e,o),z(e,t),a&&a.m(e,null),l[17](e),u=!0},p(r,o){a&&a.p&&(!u||o[0]&262144)&&et(a,s,r,r[18],u?nt(s,r[18],o,null):tt(r[18]),null),(!u||o[0]&1)&&h(e,"id",r[0]),(!u||o[0]&24&&n!==(n=`splitpanes ${r[3]||""} ${r[4]||""}`))&&h(e,"class",n),(!u||o[0]&4)&&h(e,"style",r[2]),(!u||o[0]&26)&&Ge(e,"splitpanes--horizontal",r[1]),(!u||o[0]&26)&&Ge(e,"splitpanes--vertical",!r[1]),(!u||o[0]&408)&&Ge(e,"splitpanes--dragging",r[7]||r[8]),(!u||o[0]&88)&&Ge(e,"splitpanes--freeze",!r[6])},i(r){u||(I(i),I(a,r),u=!0)},o(r){N(i),N(a,r),u=!1},d(r){r&&b(e),a&&a.d(r),l[17](null)}}}const Kn={};function El(l,e,t){let n,u,i,{$$slots:s={},$$scope:a}=e,{id:r=void 0}=e,{horizontal:o=!1}=e,{pushOtherPanes:f=!0}=e,{dblClickSplitter:d=!0}=e,{rtl:m="auto"}=e,{firstSplitter:c=!1}=e,{style:_=null}=e,{theme:g="default-theme"}=e,{class:v=""}=e;const y=At();let S,k=!1,M=!1,j=!1,p=!1,C=!1,w=-1,D=-1,$,B=new Array,ue=ft(o);rt(l,ue,E=>t(31,i=E));const le=ft(c);rt(l,le,E=>t(30,u=E));const ee=ft(void 0);rt(l,ee,E=>t(29,n=E));let Z=null,ge=null;ae(Kn,{showFirstSplitter:le,veryFirstPaneKey:ee,isHorizontal:ue,ssrRegisterPaneSize:void 0,onPaneInit:E=>(n===void 0&&bt(ee,n=E,n),{undefinedPaneInitSize:0}),clientOnly:{onPaneAdd:Pe,onPaneRemove:W}});function Pe(E){let U=-1;Array.from(E.element.parentNode.children).some(L=>(L.className.includes("splitpanes__pane")&&U++,L===E.element)),U===0&&bt(ee,n=E.key,n),B.splice(U,0,E);for(let L=0;L<B.length;L++)B[L].index=L;k&&Ne().then(()=>{E.isReady=!0,y("pane-add",{index:U,panes:ie()})});const Y=(L,x=!0)=>K=>{(x||E.index>0)&&L(K,E)};return{onSplitterDown:Y(vt,!1),onSplitterClick:Y(_t,!1),onSplitterDblClick:Y(re),onPaneClick:Y(Ie),reportGivenSizeChange:Y(X)}}async function W(E){const U=B.findIndex(Y=>Y.key===E);if(U>=0){const Y=B.splice(U,1)[0];for(let L=0;L<B.length;L++)B[L].index=L;U===0&&bt(ee,n=B.length>0?B[0].key:void 0,n),k&&(await Ne(),y("pane-remove",{removed:Y,panes:ie()}))}}function Ie(E,U){y("pane-click",U)}function X(E,U){U.setSz(E),Ne()}Dt(()=>{kt(),Qe();for(let E=0;E<B.length;E++)B[E].isReady=!0;k=!0,y("ready"),setTimeout(()=>{t(6,j=!0)},0)}),Ot(()=>{k&&Ce(),k=!1}),el(()=>{kt()});function V(E){if(m==="auto")try{return(E??Bt(S)).direction==="rtl"}catch{}return m===!0}function st(){document.body.style.cursor=ue?"col-resize":"row-resize",document.addEventListener("mousemove",at,{passive:!1}),document.addEventListener("mouseup",ot),"ontouchstart"in window&&(document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",ot))}function Ce(){document.body.style.cursor="",document.removeEventListener("mousemove",at),document.removeEventListener("mouseup",ot),"ontouchstart"in window&&(document.removeEventListener("touchmove",at),document.removeEventListener("touchend",ot))}const be=E=>E.nodeType===Node.ELEMENT_NODE&&E.classList.contains("splitpanes__splitter");function A(E,U,Y){let L=E[o?"top":"left"];return Y&&!o&&(L=U-L),L}const he=()=>Hn(o);function vt(E,U){t(7,p=!0),w=U.index,U.setSplitterActive(!0);let L=U.element;for(;L!=null&&(L=L.previousSibling,!be(L)););if(L==null){console.error("Splitpane Error: Active splitter wasn't found!");return}Z=L;const x=Ut(E),K=It(Z);ge=A(jt(x,K),K[he()],V()),st()}function at(E){if(p){E.preventDefault(),t(8,C=!0);const U=Ut(E),Y=Bt(S),L=kl(S,Y),x=L[he()],K=V(Y),H=jt(U,L),te=A(H,x,K);me(te,x),y("resize",ie())}}function ot(){C&&y("resized",ie()),t(7,p=!1),B[w].setSplitterActive(!1),setTimeout(()=>{t(8,C=!1),Ce()},100)}function _t(E,U){if("ontouchstart"in window){E.preventDefault();const Y=U.index;d&&(D===Y?($&&clearTimeout($),$=null,re(E,U),D=-1):(D=Y,$=setTimeout(()=>{D=-1},500)))}C||y("splitter-click",U)}function re(E,U){if(d){const Y=U.index;let L=0;for(let H=0;H<B.length;H++){const te=B[H];H!==Y&&(L+=te.min())}const x=Math.min(Math.max(0,100-L),U.max()),K=L+x;if(K>=100)for(let H=0;H<B.length;H++){const te=B[H];te!==U?te.setSz(te.min()):te.setSz(100-L)}else{let H=100-K;U.setSz(x);const te=oe=>{const _e=oe.min(),je=oe.max(),Ke=Math.min(Math.max(0,H),je-_e);oe.setSz(_e+Ke),H-=Ke};for(let oe=Y-1;oe>=0;oe--)te(B[oe]);for(let oe=Y+1;oe<B.length;oe++)te(B[oe]);H!=0&&console.warn("Splitpanes: there is a left spare size after computation of splitter double click, which means there are issues on the size constains of the panes.")}y("pane-maximize",U),y("resized",ie())}t(7,p=!1)}const ie=()=>B.map(E=>({min:E.min(),max:E.max(),size:E.sz(),snap:E.snap()}));function ye(E,U){const Y=je=>It(je)[he()],L=Y(Z);let x=0,K=Z.previousSibling;for(;K!=null;)be(K)&&(x+=Y(K)),K=K.previousSibling;let H=0,te=Z.nextSibling;for(;te!=null;)be(te)&&(H+=Y(te)),te=te.nextSibling;const oe=x+ge,_e=x+L+H;return(E-oe)/(U-_e)*100}function me(E,U){let Y=w-1,L=B[Y],x=w,K=B[x],H={prevPanesSize:ne(Y),nextPanesSize:De(x),prevReachedMinPanes:0,nextReachedMinPanes:0};const te=0+(f?0:H.prevPanesSize),oe=100-(f?0:H.nextPanesSize),_e=Math.max(Math.min(ye(E,U),oe),te),je=H.prevPanesSize+L.min()+L.snap(),Ke=100-(H.nextPanesSize+K.min()+K.snap());let ce=_e,lt=!1;_e<=je?_e>H.prevPanesSize+L.min()&&(ce=Math.max(L.min()+H.prevPanesSize,100-(K.max()+H.nextPanesSize)),lt=!0):_e>=Ke&&_e<100-H.nextPanesSize-K.min()&&(ce=Math.min(100-(K.min()+H.nextPanesSize),L.max()+H.prevPanesSize),lt=!0);const St=L.max()<100&&ce>=L.max()+H.prevPanesSize,xn=K.max()<100&&ce<=100-(K.max()+H.nextPanesSize);if(St||xn)St?(L.setSz(L.max()),K.setSz(Math.max(100-L.max()-H.prevPanesSize-H.nextPanesSize,0))):(L.setSz(Math.max(100-K.max()-H.prevPanesSize-H.nextPanesSize,0)),K.setSz(K.max()));else{if(f&&!lt){const Vt=q(H,ce);if(!Vt)return;({sums:H,paneBeforeIndex:Y,paneAfterIndex:x}=Vt),L=B[Y],K=B[x]}Y!=null&&L.setSz(Math.min(Math.max(ce-H.prevPanesSize-H.prevReachedMinPanes,L.min()),L.max())),x!=null&&K.setSz(Math.min(Math.max(100-ce-H.nextPanesSize-H.nextReachedMinPanes,K.min()),K.max()))}}function q(E,U){const Y=w-1;let L=Y,x=Y+1;if(U<E.prevPanesSize+B[L].min()&&(L=We(Y)?.index,E.prevReachedMinPanes=0,L<Y&&yt(B,L+1,Y+1,K=>{K.setSz(K.min()),E.prevReachedMinPanes+=K.min()}),E.prevPanesSize=ne(L),L==null))return E.prevReachedMinPanes=0,B[0].setSz(B[0].min()),yt(B,1,Y+1,K=>{K.setSz(K.min()),E.prevReachedMinPanes+=K.min()}),B[x].setSz(100-E.prevReachedMinPanes-B[0].min()-E.prevPanesSize-E.nextPanesSize),null;if(U>100-E.nextPanesSize-B[x].min()){x=Fe(Y)?.index,E.nextReachedMinPanes=0,x>Y+1&&yt(B,Y+1,x,H=>{H.setSz(H.min()),E.nextReachedMinPanes+=H.min()}),E.nextPanesSize=De(x);const K=B.length;if(x==null)return E.nextReachedMinPanes=0,B[K-1].setSz(B[K-1].min()),yt(B,Y+1,K-1,H=>{H.setSz(H.min()),E.nextReachedMinPanes+=H.min()}),B[L].setSz(100-E.prevPanesSize-E.nextReachedMinPanes-B[K-1].min()-E.nextPanesSize),null}return{sums:E,paneBeforeIndex:L,paneAfterIndex:x}}const R=E=>E.sz(),ne=E=>Wt(B,0,E,R),De=E=>Wt(B,E+1,B.length,R),We=E=>[...B].reverse().find(U=>U.index<E&&U.sz()>U.min()),Fe=E=>B.find(U=>U.index>E+1&&U.sz()>U.min());async function Ne(){M=!0,await tl(),M&&(Qe(),M=!1)}function Qe(){ct(),k&&y("resized",ie())}function ct(){if(B.length===0)return;const E=B.length;let U=100,Y=0,L=0,x=0,K=[],H=[];for(let Ke=0;Ke<E;Ke++){const ce=B[Ke],lt=ce.sz();ce.givenSize==null?ce.isReady?(x+=lt,lt>=ce.max()&&K.push(ce),lt<=ce.min()&&H.push(ce)):L+=1:(U-=lt,Y++,K.push(ce),H.push(ce))}const te=E-Y,oe=te-L;let _e,je;if(oe>0?(_e=x/oe,_e>.1&&U>.1?(x+=L*_e,je=U/x):(_e=0,je=1)):(_e=U/te,je=1),U+x>.1){U=100;for(let Ke=0;Ke<E;Ke++){const ce=B[Ke];if(ce.givenSize==null){const lt=ce.isReady?ce.sz():_e,St=Math.max(Math.min(lt*je,ce.max()),ce.min());ce.setSz(St)}U-=ce.sz()}Math.abs(U)>.1&&(U=pt(U,K,H))}isFinite(U)?Math.abs(U)>.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 pt(E,U,Y){const x=B.length-(E>0?U.length:Y.length);if(x<=0)return E;const K=E/x;if(B.length===1)B[0].setSz(100),E=0;else for(let H=0;H<B.length;H++){const te=B[H],oe=te.sz();if(E>0&&!U.includes(te)){const _e=Math.max(Math.min(oe+K,te.max()),te.min()),je=_e-oe;E-=je,te.setSz(_e)}else if(!Y.includes(te)){const _e=Math.max(Math.min(oe+K,te.max()),te.min()),je=_e-oe;E-=je,te.setSz(_e)}}return E}function kt(){const{children:E}=S;let U=0,Y=!1;for(let L=0;L<E.length;L++){const x=E.item(L),K=x.classList.contains("splitpanes__pane"),H=x.classList.contains("splitpanes__splitter");if(!K&&!H){x.parentNode?.removeChild(x),console.warn("Splitpanes: Only <Pane> elements are allowed at the root of <Splitpanes>. One of your DOM nodes was removed.");return}else K&&(!Y&&B[U].element!==x&&(Y=!0),U++)}if(Y){const L=[];for(let x=0;x<E.length;x++){const K=E.item(x);if(K.classList.contains("splitpanes__pane")){const te=B.find(oe=>oe.element===K);te!=null?(te.index=L.length,L.push(te)):console.warn("Splitpanes: Internal error - found a <Pane> elements which isn't tracked.")}}B=L,bt(ee,n=B.length>0?B[0].key:void 0,n)}}function Et(E){Ae[E?"unshift":"push"](()=>{S=E,t(5,S)})}return l.$$set=E=>{"id"in E&&t(0,r=E.id),"horizontal"in E&&t(1,o=E.horizontal),"pushOtherPanes"in E&&t(12,f=E.pushOtherPanes),"dblClickSplitter"in E&&t(13,d=E.dblClickSplitter),"rtl"in E&&t(14,m=E.rtl),"firstSplitter"in E&&t(15,c=E.firstSplitter),"style"in E&&t(2,_=E.style),"theme"in E&&t(3,g=E.theme),"class"in E&&t(4,v=E.class),"$$scope"in E&&t(18,a=E.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&2&&bt(ue,i=o,i),l.$$.dirty[0]&32768&&bt(le,u=c,u)},[r,o,_,g,v,S,j,p,C,ue,le,ee,f,d,m,c,s,Et,a]}class Sl extends Le{constructor(e){super(),Ve(this,e,El,pl,Be,{id:0,horizontal:1,pushOtherPanes:12,dblClickSplitter:13,rtl:14,firstSplitter:15,style:2,theme:3,class:4},null,[-1,-1,-1])}}const Cl=(l,e)=>t=>{const n=l();n?.[e](t)},yl=l=>Cl.bind(null,l);function Dl(l){let e,t,n,u,i,s,a=(l[4]!==l[9]||l[5])&&qt(l);const r=l[20].default,o=$e(r,l,l[19],null);return{c(){a&&a.c(),e=J(),t=T("div"),o&&o.c(),this.h()},l(f){a&&a.l(f),e=Q(f),t=P(f,"DIV",{class:!0,style:!0});var d=F(t);o&&o.l(d),d.forEach(b),this.h()},h(){h(t,"class",n=`splitpanes__pane ${l[0]||""}`),h(t,"style",l[3])},m(f,d){a&&a.m(f,d),O(f,e,d),O(f,t,d),o&&o.m(t,null),l[21](t),u=!0,i||(s=G(t,"click",l[11]("onPaneClick")),i=!0)},p(f,d){f[4]!==f[9]||f[5]?a?a.p(f,d):(a=qt(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),o&&o.p&&(!u||d&524288)&&et(o,r,f,f[19],u?nt(r,f[19],d,null):tt(f[19]),null),(!u||d&1&&n!==(n=`splitpanes__pane ${f[0]||""}`))&&h(t,"class",n),(!u||d&8)&&h(t,"style",f[3])},i(f){u||(I(o,f),u=!0)},o(f){N(o,f),u=!1},d(f){f&&(b(e),b(t)),a&&a.d(f),o&&o.d(f),l[21](null),i=!1,s()}}}function qt(l){let e,t,n,u;return{c(){e=T("div"),this.h()},l(i){e=P(i,"DIV",{class:!0}),F(e).forEach(b),this.h()},h(){h(e,"class",t="splitpanes__splitter "+(l[2]?"splitpanes__splitter__active":""))},m(i,s){O(i,e,s),n||(u=[G(e,"mousedown",l[11]("onSplitterDown")),G(e,"touchstart",l[11]("onSplitterDown")),G(e,"click",l[11]("onSplitterClick")),G(e,"dblclick",l[11]("onSplitterDblClick"))],n=!0)},p(i,s){s&4&&t!==(t="splitpanes__splitter "+(i[2]?"splitpanes__splitter__active":""))&&h(e,"class",t)},d(i){i&&b(e),n=!1,it(u)}}}function zl(l){let e,t,n=!l[10]&&Dl(l);return{c(){n&&n.c(),e=Se()},l(u){n&&n.l(u),e=Se()},m(u,i){n&&n.m(u,i),O(u,e,i),t=!0},p(u,[i]){u[10]||n.p(u,i)},i(u){t||(I(n),t=!0)},o(u){N(n),t=!1},d(u){u&&b(e),n&&n.d(u)}}}function Tl(l,e,t){let n,u,i,s,a,{$$slots:r={},$$scope:o}=e;const{ssrRegisterPaneSize:f,onPaneInit:d,clientOnly:m,isHorizontal:c,showFirstSplitter:_,veryFirstPaneKey:g}=fe(Kn);rt(l,c,Z=>t(18,i=Z)),rt(l,_,Z=>t(5,a=Z)),rt(l,g,Z=>t(4,s=Z));let{size:v=null}=e,{minSize:y=0}=e,{maxSize:S=100}=e,{snapSize:k=0}=e,{class:M=""}=e;const j={},p=!Un,{undefinedPaneInitSize:C}=d(j);let w,D=v??C,$=!1,B;const ue=yl(()=>B),le=Z=>{Z!=D&&ue("reportGivenSizeChange")(Z)};Dt(()=>{const Z={key:j,element:w,givenSize:v,sz:()=>D,setSz:ge=>{t(16,D=ge),v!=null&&v!=D&&t(12,v=D)},min:()=>y,max:()=>S,snap:()=>k,setSplitterActive:ge=>{t(2,$=ge)},isReady:!1};B=m.onPaneAdd(Z)}),Ot(()=>{m.onPaneRemove(j)});function ee(Z){Ae[Z?"unshift":"push"](()=>{w=Z,t(1,w)})}return l.$$set=Z=>{"size"in Z&&t(12,v=Z.size),"minSize"in Z&&t(13,y=Z.minSize),"maxSize"in Z&&t(14,S=Z.maxSize),"snapSize"in Z&&t(15,k=Z.snapSize),"class"in Z&&t(0,M=Z.class),"$$scope"in Z&&t(19,o=Z.$$scope)},l.$$.update=()=>{l.$$.dirty&4096&&v!=null&&le(v),l.$$.dirty&262144&&t(17,n=Hn(i)),l.$$.dirty&196608&&t(3,u=`${n}: ${D}%;`)},[M,w,$,u,s,a,c,_,g,j,p,ue,v,y,S,k,D,n,i,o,r,ee]}class Ht extends Le{constructor(e){super(),Ve(this,e,Tl,zl,Be,{size:12,minSize:13,maxSize:14,snapSize:15,class:0})}}function Pl(l){let e,t,n,u,i,s,a;return{c(){e=Ze("svg"),t=Ze("circle"),n=Ze("animate"),u=Ze("circle"),i=Ze("animate"),s=Ze("circle"),a=Ze("animate"),this.h()},l(r){e=xe(r,"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=xe(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var f=F(t);n=xe(f,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(n).forEach(b),f.forEach(b),u=xe(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var d=F(u);i=xe(d,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(i).forEach(b),d.forEach(b),s=xe(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var m=F(s);a=xe(m,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),F(a).forEach(b),m.forEach(b),o.forEach(b),this.h()},h(){h(n,"attributeName","opacity"),h(n,"dur","1s"),h(n,"values","0;1;0"),h(n,"repeatCount","indefinite"),h(n,"begin","0.1"),h(t,"fill","#1976d2"),h(t,"stroke","none"),h(t,"cx","6"),h(t,"cy","50"),h(t,"r","6"),h(i,"attributeName","opacity"),h(i,"dur","1s"),h(i,"values","0;1;0"),h(i,"repeatCount","indefinite"),h(i,"begin","0.2"),h(u,"fill","#1976d2"),h(u,"stroke","none"),h(u,"cx","26"),h(u,"cy","50"),h(u,"r","6"),h(a,"attributeName","opacity"),h(a,"dur","1s"),h(a,"values","0;1;0"),h(a,"repeatCount","indefinite"),h(a,"begin","0.3"),h(s,"fill","#1976d2"),h(s,"stroke","none"),h(s,"cx","46"),h(s,"cy","50"),h(s,"r","6"),h(e,"version","1.1"),h(e,"id","L4"),h(e,"xmlns","http://www.w3.org/2000/svg"),h(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),h(e,"x","0px"),h(e,"y","0px"),h(e,"viewBox","0 0 100 100"),h(e,"enable-background","new 0 0 0 0"),h(e,"xml:space","preserve")},m(r,o){O(r,e,o),z(e,t),z(t,n),z(e,u),z(u,i),z(e,s),z(s,a)},p:se,i:se,o:se,d(r){r&&b(e)}}}function wl(l,e,t){let{size:n=20}=e;return l.$$set=u=>{"size"in u&&t(0,n=u.size)},[n]}class Rl extends Le{constructor(e){super(),Ve(this,e,wl,Pl,Be,{size:0})}}function Bl(l){let e,t,n,u,i;return{c(){e=T("div"),t=Ze("svg"),n=Ze("circle"),u=J(),i=Oe(l[2]),this.h()},l(s){e=P(s,"DIV",{class:!0});var a=F(e);t=xe(a,"svg",{class:!0,viewBox:!0,xmlns:!0});var r=F(t);n=xe(r,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),F(n).forEach(b),r.forEach(b),u=Q(a),i=Me(a,l[2]),a.forEach(b),this.h()},h(){h(n,"cx","10"),h(n,"cy","10"),h(n,"r","5"),h(n,"fill",l[0]),Ye(n,"filter","drop-shadow(0 0 1px "+l[1]+")"),h(t,"class","dot svelte-a20mi8"),h(t,"viewBox","0 0 20 20"),h(t,"xmlns","http://www.w3.org/2000/svg"),h(e,"class","llm-health-status svelte-a20mi8")},m(s,a){O(s,e,a),z(e,t),z(t,n),z(e,u),z(e,i)},p(s,[a]){a&1&&h(n,"fill",s[0]),a&2&&Ye(n,"filter","drop-shadow(0 0 1px "+s[1]+")"),a&4&&ht(i,s[2])},i:se,o:se,d(s){s&&b(e)}}}function Il(l,e,t){let{status:n="unknown"}=e,u="",i="",s="";switch(n){case"ok":u="#4CAF50",i="rgba(0, 128, 0, 0.7)",s="Сервис LLM работает";break;case"error":s="Сервис LLM не работает";break;case"loading model":u="yellow",i="rgba(255, 255, 0, 0.7)",s="Сервис LLM запускается...";break;case"unavailable":u="#af4f4c",i="#af4f4c",s="Сервис LLM не запущен";break;case"unknown":u="#af4f4c",i="#af4f4c",s="Сервис LLM недоступен";break}return l.$$set=a=>{"status"in a&&t(3,n=a.status)},[u,i,s,n]}class Fl extends Le{constructor(e){super(),Ve(this,e,Il,Bl,Be,{status:3})}}function Al(l){let e,t,n,u,i;return{c(){e=T("div"),t=Ze("svg"),n=Ze("circle"),u=J(),i=Oe(l[2]),this.h()},l(s){e=P(s,"DIV",{class:!0});var a=F(e);t=xe(a,"svg",{class:!0,viewBox:!0,xmlns:!0});var r=F(t);n=xe(r,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),F(n).forEach(b),r.forEach(b),u=Q(a),i=Me(a,l[2]),a.forEach(b),this.h()},h(){h(n,"cx","10"),h(n,"cy","10"),h(n,"r","5"),h(n,"fill",l[0]),Ye(n,"filter","drop-shadow(0 0 1px "+l[1]+")"),h(t,"class","dot svelte-1wcf73j"),h(t,"viewBox","0 0 20 20"),h(t,"xmlns","http://www.w3.org/2000/svg"),h(e,"class","llm-health-status svelte-1wcf73j")},m(s,a){O(s,e,a),z(e,t),z(t,n),z(e,u),z(e,i)},p(s,[a]){a&1&&h(n,"fill",s[0]),a&2&&Ye(n,"filter","drop-shadow(0 0 1px "+s[1]+")"),a&4&&ht(i,s[2])},i:se,o:se,d(s){s&&b(e)}}}function Ol(l,e,t){let{status:n="unavailable"}=e,u="",i="",s="";switch(n){case"ok":u="#4CAF50",i="rgba(0, 128, 0, 0.7)",s="Поиск работает";break;case"unavailable":u="#af4f4c",i="#af4f4c",s="Поиск не запущен";break;case"unknown":u="#af4f4c",i="#af4f4c",s="Поиск недоступен";break}return l.$$set=a=>{"status"in a&&t(3,n=a.status)},[u,i,s,n]}class Ml extends Le{constructor(e){super(),Ve(this,e,Ol,Al,Be,{status:3})}}function Ll(l){let e,t,n,u,i,s="Сохранить",a,r,o="Сбросить",f,d;return{c(){e=T("div"),t=T("div"),n=T("textarea"),u=J(),i=T("button"),i.textContent=s,a=J(),r=T("button"),r.textContent=o,this.h()},l(m){e=P(m,"DIV",{class:!0});var c=F(e);t=P(c,"DIV",{class:!0});var _=F(t);n=P(_,"TEXTAREA",{class:!0}),F(n).forEach(b),u=Q(_),i=P(_,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(i)!=="svelte-g0hhac"&&(i.textContent=s),a=Q(_),r=P(_,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(r)!=="svelte-16kemh0"&&(r.textContent=o),_.forEach(b),c.forEach(b),this.h()},h(){h(n,"class","svelte-sfudwy"),h(i,"class","svelte-sfudwy"),h(r,"class","svelte-sfudwy"),h(t,"class","popup svelte-sfudwy"),h(e,"class","modal svelte-sfudwy")},m(m,c){O(m,e,c),z(e,t),z(t,n),dt(n,l[0]),z(t,u),z(t,i),z(t,a),z(t,r),f||(d=[G(n,"input",l[6]),G(i,"click",l[1]),G(r,"click",l[2])],f=!0)},p(m,[c]){c&1&&dt(n,m[0])},i:se,o:se,d(m){m&&b(e),f=!1,it(d)}}}let Vl='Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям. Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы. При ответе на вопрос ты используешь только такой формат ответа: 1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя. 2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя). 3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)." 4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту." Вопрос: {{ВОПРОС}} Источники: {{ИСТОЧНИКИ}}';function Nl(l,e,t){let{onSave:n}=e,{onClose:u}=e,{text:i=""}=e,s=i;function a(){n(s),u()}function r(){t(0,s=Vl)}function o(){s=this.value,t(0,s)}return l.$$set=f=>{"onSave"in f&&t(3,n=f.onSave),"onClose"in f&&t(4,u=f.onClose),"text"in f&&t(5,i=f.text)},[s,a,r,n,u,i,o]}class jl extends Le{constructor(e){super(),Ve(this,e,Nl,Ll,Be,{onSave:3,onClose:4,text:5})}}const Ul="drawerStore";function Wl(){const l=ql();return ae(Ul,l)}function ql(){const{subscribe:l,set:e,update:t}=ft({});return{subscribe:l,set:e,update:t,open:n=>t(()=>({open:!0,...n})),close:()=>t(n=>(n.open=!1,n))}}const Hl="modalStore";function Kl(){const l=Gl();return ae(Hl,l)}function Gl(){const{subscribe:l,set:e,update:t}=ft([]);return{subscribe:l,set:e,update:t,trigger:n=>t(u=>(u.push(n),u)),close:()=>t(n=>(n.length>0&&n.shift(),n)),clear:()=>e([])}}const Xl={message:"Missing Toast Message",autohide:!0,timeout:5e3},Gn="toastStore";function Xn(){const l=fe(Gn);if(!l)throw new Error("toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!");return l}function Yl(){const l=Ql();return ae(Gn,l)}function Jl(){const l=Math.random();return Number(l).toString(32)}function Ql(){const{subscribe:l,set:e,update:t}=ft([]),n=i=>t(s=>{if(s.length>0){const a=s.findIndex(o=>o.id===i),r=s[a];r&&(r.callback&&r.callback({id:i,status:"closed"}),r.timeoutId&&clearTimeout(r.timeoutId),s.splice(a,1))}return s});function u(i){if(i.autohide===!0)return setTimeout(()=>{n(i.id)},i.timeout)}return{subscribe:l,close:n,trigger:i=>{const s=Jl();return t(a=>{i&&i.callback&&i.callback({id:s,status:"queued"}),i.hideDismiss&&(i.autohide=!0);const r={...Xl,...i,id:s};return r.timeoutId=u(r),a.push(r),a}),s},freeze:i=>t(s=>(s.length>0&&clearTimeout(s[i].timeoutId),s)),unfreeze:i=>t(s=>(s.length>0&&(s[i].timeoutId=u(s[i])),s)),clear:()=>e([])}}function Zl(){Kl(),Yl(),Wl()}const Rt={};function Kt(l){return l==="local"?localStorage:sessionStorage}function Mt(l,e,t){const n=t?.serializer??JSON,u=t?.storage??"local";function i(s,a){Kt(u).setItem(s,n.stringify(a))}if(!Rt[l]){const s=ft(e,o=>{const f=Kt(u).getItem(l);f&&o(n.parse(f));{const d=m=>{m.key===l&&o(m.newValue?n.parse(m.newValue):null)};return window.addEventListener("storage",d),()=>window.removeEventListener("storage",d)}}),{subscribe:a,set:r}=s;Rt[l]={set(o){i(l,o),r(o)},update(o){const f=o(nl(s));i(l,f),r(f)},subscribe:a}}return Rt[l]}Mt("modeOsPrefers",!1);Mt("modeUserPrefers",void 0);Mt("modeCurrent",!1);const Yn="(prefers-reduced-motion: reduce)";function xl(){return window.matchMedia(Yn).matches}const Jn=fl(xl(),l=>{{const e=n=>{l(n.matches)},t=window.matchMedia(Yn);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}});function Lt(l){const e=l-1;return e*e*e+1}function Gt(l,{delay:e=0,duration:t=400,easing:n=Lt,x:u=0,y:i=0,opacity:s=0}={}){const a=getComputedStyle(l),r=+a.opacity,o=a.transform==="none"?"":a.transform,f=r*(1-s),[d,m]=Nt(u),[c,_]=Nt(i);return{delay:e,duration:t,easing:n,css:(g,v)=>`
transform: ${o} translate(${(1-g)*d}${m}, ${(1-g)*c}${_});
opacity: ${r-f*v}`}}function Xt(l,{delay:e=0,duration:t=400,easing:n=Lt,axis:u="y"}={}){const i=getComputedStyle(l),s=+i.opacity,a=u==="y"?"height":"width",r=parseFloat(i[a]),o=u==="y"?["top","bottom"]:["left","right"],f=o.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),d=parseFloat(i[`padding${f[0]}`]),m=parseFloat(i[`padding${f[1]}`]),c=parseFloat(i[`margin${f[0]}`]),_=parseFloat(i[`margin${f[1]}`]),g=parseFloat(i[`border${f[0]}Width`]),v=parseFloat(i[`border${f[1]}Width`]);return{delay:e,duration:t,easing:n,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*s};${a}: ${y*r}px;padding-${o[0]}: ${y*d}px;padding-${o[1]}: ${y*m}px;margin-${o[0]}: ${y*c}px;margin-${o[1]}: ${y*_}px;border-${o[0]}-width: ${y*g}px;border-${o[1]}-width: ${y*v}px;`}}function $l(l){let e,t,n;const u=l[19].default,i=$e(u,l,l[18],null);return{c(){e=T("div"),i&&i.c(),this.h()},l(s){e=P(s,"DIV",{class:!0,"data-testid":!0});var a=F(e);i&&i.l(a),a.forEach(b),this.h()},h(){h(e,"class",t="accordion "+l[0]),h(e,"data-testid","accordion")},m(s,a){O(s,e,a),i&&i.m(e,null),n=!0},p(s,[a]){i&&i.p&&(!n||a&262144)&&et(i,u,s,s[18],n?nt(u,s[18],a,null):tt(s[18]),null),(!n||a&1&&t!==(t="accordion "+s[0]))&&h(e,"class",t)},i(s){n||(I(i,s),n=!0)},o(s){N(i,s),n=!1},d(s){s&&b(e),i&&i.d(s)}}}function eu(l,e,t){let n,u;rt(l,Jn,D=>t(20,u=D));let{$$slots:i={},$$scope:s}=e,{autocollapse:a=!1}=e,{width:r="w-full"}=e,{spacing:o="space-y-1"}=e,{disabled:f=!1}=e,{padding:d="py-2 px-4"}=e,{hover:m="hover:bg-primary-hover-token"}=e,{rounded:c="rounded-container-token"}=e,{caretOpen:_="rotate-180"}=e,{caretClosed:g=""}=e,{regionControl:v=""}=e,{regionPanel:y="space-y-4"}=e,{regionCaret:S=""}=e,{transitions:k=!u}=e,{transitionIn:M=Xt}=e,{transitionInParams:j={duration:200}}=e,{transitionOut:p=Xt}=e,{transitionOutParams:C={duration:200}}=e;const w=ft(null);return ae("active",w),ae("autocollapse",a),ae("disabled",f),ae("padding",d),ae("hover",m),ae("rounded",c),ae("caretOpen",_),ae("caretClosed",g),ae("regionControl",v),ae("regionPanel",y),ae("regionCaret",S),ae("transitions",k),ae("transitionIn",M),ae("transitionInParams",j),ae("transitionOut",p),ae("transitionOutParams",C),l.$$set=D=>{t(22,e=Ue(Ue({},e),Je(D))),"autocollapse"in D&&t(1,a=D.autocollapse),"width"in D&&t(2,r=D.width),"spacing"in D&&t(3,o=D.spacing),"disabled"in D&&t(4,f=D.disabled),"padding"in D&&t(5,d=D.padding),"hover"in D&&t(6,m=D.hover),"rounded"in D&&t(7,c=D.rounded),"caretOpen"in D&&t(8,_=D.caretOpen),"caretClosed"in D&&t(9,g=D.caretClosed),"regionControl"in D&&t(10,v=D.regionControl),"regionPanel"in D&&t(11,y=D.regionPanel),"regionCaret"in D&&t(12,S=D.regionCaret),"transitions"in D&&t(13,k=D.transitions),"transitionIn"in D&&t(14,M=D.transitionIn),"transitionInParams"in D&&t(15,j=D.transitionInParams),"transitionOut"in D&&t(16,p=D.transitionOut),"transitionOutParams"in D&&t(17,C=D.transitionOutParams),"$$scope"in D&&t(18,s=D.$$scope)},l.$$.update=()=>{t(0,n=`${r} ${o} ${e.class??""}`)},e=Je(e),[n,a,r,o,f,d,m,c,_,g,v,y,S,k,M,j,p,C,s,i]}class tu extends Le{constructor(e){super(),Ve(this,e,eu,$l,Be,{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 Pt(l,e){const{transition:t,params:n,enabled:u}=e;return u?t(l,n):"duration"in n?t(l,{duration:0}):{duration:0}}const nu=l=>({}),Yt=l=>({}),lu=l=>({}),Jt=l=>({}),uu=l=>({}),Qt=l=>({}),iu=l=>({}),Zt=l=>({}),su=l=>({}),xt=l=>({});function $t(l){let e,t;const n=l[30].lead,u=$e(n,l,l[29],xt);return{c(){e=T("div"),u&&u.c(),this.h()},l(i){e=P(i,"DIV",{class:!0});var s=F(e);u&&u.l(s),s.forEach(b),this.h()},h(){h(e,"class","accordion-lead")},m(i,s){O(i,e,s),u&&u.m(e,null),t=!0},p(i,s){u&&u.p&&(!t||s[0]&536870912)&&et(u,n,i,i[29],t?nt(n,i[29],s,su):tt(i[29]),xt)},i(i){t||(I(u,i),t=!0)},o(i){N(u,i),t=!1},d(i){i&&b(e),u&&u.d(i)}}}function au(l){let e;return{c(){e=Oe("(summary)")},l(t){e=Me(t,"(summary)")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function ru(l){let e,t,n;return{c(){e=T("div"),t=new mt(!1),this.h()},l(u){e=P(u,"DIV",{class:!0});var i=F(e);t=gt(i,!1),i.forEach(b),this.h()},h(){t.a=null,h(e,"class",n="accordion-summary-caret "+l[11])},m(u,i){O(u,e,i),t.m(l[14],e)},p(u,i){i[0]&2048&&n!==(n="accordion-summary-caret "+u[11])&&h(e,"class",n)},i:se,o:se,d(u){u&&b(e)}}}function ou(l){let e,t,n,u,i;const s=[fu,cu],a=[];function r(o,f){return o[8]?0:1}return t=r(l),n=a[t]=s[t](l),{c(){e=T("div"),n.c(),this.h()},l(o){e=P(o,"DIV",{class:!0});var f=F(e);n.l(f),f.forEach(b),this.h()},h(){h(e,"class",u="accordion-summary-icons "+l[10])},m(o,f){O(o,e,f),a[t].m(e,null),i=!0},p(o,f){let d=t;t=r(o),t===d?a[t].p(o,f):(ze(),N(a[d],1,1,()=>{a[d]=null}),Te(),n=a[t],n?n.p(o,f):(n=a[t]=s[t](o),n.c()),I(n,1),n.m(e,null)),(!i||f[0]&1024&&u!==(u="accordion-summary-icons "+o[10]))&&h(e,"class",u)},i(o){i||(I(n),i=!0)},o(o){N(n),i=!1},d(o){o&&b(e),a[t].d()}}}function cu(l){let e;const t=l[30].iconOpen,n=$e(t,l,l[29],Jt),u=n||du(l);return{c(){u&&u.c()},l(i){u&&u.l(i)},m(i,s){u&&u.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s[0]&536870912)&&et(n,t,i,i[29],e?nt(t,i[29],s,lu):tt(i[29]),Jt)},i(i){e||(I(u,i),e=!0)},o(i){N(u,i),e=!1},d(i){u&&u.d(i)}}}function fu(l){let e;const t=l[30].iconClosed,n=$e(t,l,l[29],Qt),u=n||hu(l);return{c(){u&&u.c()},l(i){u&&u.l(i)},m(i,s){u&&u.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s[0]&536870912)&&et(n,t,i,i[29],e?nt(t,i[29],s,uu):tt(i[29]),Qt)},i(i){e||(I(u,i),e=!0)},o(i){N(u,i),e=!1},d(i){u&&u.d(i)}}}function du(l){let e,t;return{c(){e=new mt(!1),t=Se(),this.h()},l(n){e=gt(n,!1),t=Se(),this.h()},h(){e.a=t},m(n,u){e.m(l[14],n,u),O(n,t,u)},p:se,d(n){n&&(b(t),e.d())}}}function hu(l){let e,t;return{c(){e=new mt(!1),t=Se(),this.h()},l(n){e=gt(n,!1),t=Se(),this.h()},h(){e.a=t},m(n,u){e.m(l[14],n,u),O(n,t,u)},p:se,d(n){n&&(b(t),e.d())}}}function en(l){let e,t,n,u,i,s,a;const r=l[30].content,o=$e(r,l,l[29],Yt),f=o||mu();return{c(){e=T("div"),f&&f.c(),this.h()},l(d){e=P(d,"DIV",{class:!0,id:!0,role:!0,"aria-hidden":!0,"aria-labelledby":!0});var m=F(e);f&&f.l(m),m.forEach(b),this.h()},h(){h(e,"class",t="accordion-panel "+l[9]),h(e,"id",n="accordion-panel-"+l[0]),h(e,"role","region"),h(e,"aria-hidden",u=!l[8]),h(e,"aria-labelledby",l[0])},m(d,m){O(d,e,m),f&&f.m(e,null),a=!0},p(d,m){l=d,o&&o.p&&(!a||m[0]&536870912)&&et(o,r,l,l[29],a?nt(r,l[29],m,nu):tt(l[29]),Yt),(!a||m[0]&512&&t!==(t="accordion-panel "+l[9]))&&h(e,"class",t),(!a||m[0]&1&&n!==(n="accordion-panel-"+l[0]))&&h(e,"id",n),(!a||m[0]&256&&u!==(u=!l[8]))&&h(e,"aria-hidden",u),(!a||m[0]&1)&&h(e,"aria-labelledby",l[0])},i(d){a||(I(f,d),d&&Vn(()=>{a&&(s&&s.end(1),i=Nn(e,Pt,{transition:l[4],params:l[5],enabled:l[3]}),i.start())}),a=!0)},o(d){N(f,d),i&&i.invalidate(),d&&(s=jn(e,Pt,{transition:l[6],params:l[7],enabled:l[3]})),a=!1},d(d){d&&b(e),f&&f.d(d),d&&s&&s.end()}}}function mu(l){let e;return{c(){e=Oe("(content)")},l(t){e=Me(t,"(content)")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function gu(l){let e,t,n,u,i,s,a,r,o,f,d,m,c,_,g=l[16].lead&&$t(l);const v=l[30].summary,y=$e(v,l,l[29],Zt),S=y||au(),k=[ou,ru],M=[];function j(C,w){return C[16].iconClosed||C[16].iconOpen?0:1}s=j(l),a=M[s]=k[s](l);let p=l[8]&&en(l);return{c(){e=T("div"),t=T("button"),g&&g.c(),n=J(),u=T("div"),S&&S.c(),i=J(),a.c(),f=J(),p&&p.c(),this.h()},l(C){e=P(C,"DIV",{class:!0,"data-testid":!0});var w=F(e);t=P(w,"BUTTON",{type:!0,class:!0,id:!0,"aria-expanded":!0,"aria-controls":!0});var D=F(t);g&&g.l(D),n=Q(D),u=P(D,"DIV",{class:!0});var $=F(u);S&&S.l($),$.forEach(b),i=Q(D),a.l(D),D.forEach(b),f=Q(w),p&&p.l(w),w.forEach(b),this.h()},h(){h(u,"class","accordion-summary flex-1"),h(t,"type","button"),h(t,"class",r="accordion-control "+l[12]),h(t,"id",l[0]),h(t,"aria-expanded",l[8]),h(t,"aria-controls",o="accordion-panel-"+l[0]),t.disabled=l[2],h(e,"class",d="accordion-item "+l[13]),h(e,"data-testid","accordion-item")},m(C,w){O(C,e,w),z(e,t),g&&g.m(t,null),z(t,n),z(t,u),S&&S.m(u,null),z(t,i),M[s].m(t,null),z(e,f),p&&p.m(e,null),m=!0,c||(_=[G(t,"click",l[15]),G(t,"click",l[31]),G(t,"keydown",l[32]),G(t,"keyup",l[33]),G(t,"keypress",l[34])],c=!0)},p(C,w){C[16].lead?g?(g.p(C,w),w[0]&65536&&I(g,1)):(g=$t(C),g.c(),I(g,1),g.m(t,n)):g&&(ze(),N(g,1,1,()=>{g=null}),Te()),y&&y.p&&(!m||w[0]&536870912)&&et(y,v,C,C[29],m?nt(v,C[29],w,iu):tt(C[29]),Zt);let D=s;s=j(C),s===D?M[s].p(C,w):(ze(),N(M[D],1,1,()=>{M[D]=null}),Te(),a=M[s],a?a.p(C,w):(a=M[s]=k[s](C),a.c()),I(a,1),a.m(t,null)),(!m||w[0]&4096&&r!==(r="accordion-control "+C[12]))&&h(t,"class",r),(!m||w[0]&1)&&h(t,"id",C[0]),(!m||w[0]&256)&&h(t,"aria-expanded",C[8]),(!m||w[0]&1&&o!==(o="accordion-panel-"+C[0]))&&h(t,"aria-controls",o),(!m||w[0]&4)&&(t.disabled=C[2]),C[8]?p?(p.p(C,w),w[0]&256&&I(p,1)):(p=en(C),p.c(),I(p,1),p.m(e,null)):p&&(ze(),N(p,1,1,()=>{p=null}),Te()),(!m||w[0]&8192&&d!==(d="accordion-item "+C[13]))&&h(e,"class",d)},i(C){m||(I(g),I(S,C),I(a),I(p),m=!0)},o(C){N(g),N(S,C),N(a),N(p),m=!1},d(C){C&&b(e),g&&g.d(),S&&S.d(C),M[s].d(),p&&p.d(),c=!1,it(_)}}}const _u="",bu="text-start w-full flex items-center space-x-4",tn="fill-current w-3 transition-transform duration-[200ms]",vu="";function ku(l,e,t){let n,u,i,s,a,r,o,f,d=se,m=()=>(d(),d=ll(M,A=>t(28,f=A)),M);l.$$.on_destroy.push(()=>d());let{$$slots:c={},$$scope:_}=e;const g=Ln(c),v=At();let{open:y=!1}=e,{id:S=String(Math.random())}=e,{autocollapse:k=fe("autocollapse")}=e,{active:M=fe("active")}=e;m();let{disabled:j=fe("disabled")}=e,{padding:p=fe("padding")}=e,{hover:C=fe("hover")}=e,{rounded:w=fe("rounded")}=e,{caretOpen:D=fe("caretOpen")}=e,{caretClosed:$=fe("caretClosed")}=e,{regionControl:B=fe("regionControl")}=e,{regionPanel:ue=fe("regionPanel")}=e,{regionCaret:le=fe("regionCaret")}=e,{transitions:ee=fe("transitions")}=e,{transitionIn:Z=fe("transitionIn")}=e,{transitionInParams:ge=fe("transitionInParams")}=e,{transitionOut:de=fe("transitionOut")}=e,{transitionOutParams:Pe=fe("transitionOutParams")}=e;const W=`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={classesControlCaret}>
<path d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" />
</svg>`;function Ie(A){k===!0?M.set(S):t(17,y=!y),X(A)}function X(A){const he=k?f===S:y;v("toggle",{event:A,id:S,panelId:`accordion-panel-${S}`,open:he,autocollapse:k})}k&&y&&Ie();function V(A){we.call(this,l,A)}function st(A){we.call(this,l,A)}function Ce(A){we.call(this,l,A)}function be(A){we.call(this,l,A)}return l.$$set=A=>{t(37,e=Ue(Ue({},e),Je(A))),"open"in A&&t(17,y=A.open),"id"in A&&t(0,S=A.id),"autocollapse"in A&&t(18,k=A.autocollapse),"active"in A&&m(t(1,M=A.active)),"disabled"in A&&t(2,j=A.disabled),"padding"in A&&t(19,p=A.padding),"hover"in A&&t(20,C=A.hover),"rounded"in A&&t(21,w=A.rounded),"caretOpen"in A&&t(22,D=A.caretOpen),"caretClosed"in A&&t(23,$=A.caretClosed),"regionControl"in A&&t(24,B=A.regionControl),"regionPanel"in A&&t(25,ue=A.regionPanel),"regionCaret"in A&&t(26,le=A.regionCaret),"transitions"in A&&t(3,ee=A.transitions),"transitionIn"in A&&t(4,Z=A.transitionIn),"transitionInParams"in A&&t(5,ge=A.transitionInParams),"transitionOut"in A&&t(6,de=A.transitionOut),"transitionOutParams"in A&&t(7,Pe=A.transitionOutParams),"$$scope"in A&&t(29,_=A.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&393216&&y&&k&&Ie(),l.$$.dirty[0]&268828673&&t(8,n=k?f===S:y),t(13,u=`${_u} ${e.class??""}`),l.$$.dirty[0]&20447232&&t(12,i=`${bu} ${p} ${C} ${w} ${B}`),l.$$.dirty[0]&12583168&&t(27,s=n?D:$),l.$$.dirty[0]&201326592&&t(11,a=`${tn} ${le} ${s}`),l.$$.dirty[0]&67108864&&t(10,r=`${tn} ${le}`),l.$$.dirty[0]&36175872&&t(9,o=`${vu} ${p} ${w} ${ue}`)},e=Je(e),[S,M,j,ee,Z,ge,de,Pe,n,o,r,a,i,u,W,Ie,g,y,k,p,C,w,D,$,B,ue,le,s,f,_,c,V,st,Ce,be]}class pu extends Le{constructor(e){super(),Ve(this,e,ku,gu,Be,{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 Eu(l,{from:e,to:t},n={}){const u=getComputedStyle(l),i=u.transform==="none"?"":u.transform,[s,a]=u.transformOrigin.split(" ").map(parseFloat),r=e.left+e.width*s/t.width-(t.left+s),o=e.top+e.height*a/t.height-(t.top+a),{delay:f=0,duration:d=c=>Math.sqrt(c)*120,easing:m=Lt}=n;return{delay:f,duration:ul(d)?d(Math.sqrt(r*r+o*o)):d,easing:m,css:(c,_)=>{const g=_*r,v=_*o,y=c+_*e.width/t.width,S=c+_*e.height/t.height;return`transform: ${i} translate(${g}px, ${v}px) scale(${y}, ${S});`}}}function Su(l){let e,t,n;const u=l[15].default,i=$e(u,l,l[14],null);return{c(){e=T("div"),i&&i.c(),this.h()},l(s){e=P(s,"DIV",{class:!0,"data-testid":!0,role:!0,"aria-labelledby":!0});var a=F(e);i&&i.l(a),a.forEach(b),this.h()},h(){h(e,"class",t="radio-group "+l[1]),h(e,"data-testid","radio-group"),h(e,"role","radiogroup"),h(e,"aria-labelledby",l[0])},m(s,a){O(s,e,a),i&&i.m(e,null),n=!0},p(s,[a]){i&&i.p&&(!n||a&16384)&&et(i,u,s,s[14],n?nt(u,s[14],a,null):tt(s[14]),null),(!n||a&2&&t!==(t="radio-group "+s[1]))&&h(e,"class",t),(!n||a&1)&&h(e,"aria-labelledby",s[0])},i(s){n||(I(i,s),n=!0)},o(s){N(i,s),n=!1},d(s){s&&b(e),i&&i.d(s)}}}const Cu="p-1";function yu(l,e,t){let n,{$$slots:u={},$$scope:i}=e,{display:s="inline-flex"}=e,{flexDirection:a="flex-row"}=e,{gap:r="gap-1"}=e,{background:o="bg-surface-200-700-token"}=e,{border:f="border-token border-surface-400-500-token"}=e,{rounded:d="rounded-token"}=e,{padding:m="px-4 py-1"}=e,{active:c="variant-filled"}=e,{hover:_="hover:variant-soft"}=e,{color:g=""}=e,{fill:v=""}=e,{regionLabel:y=""}=e,{labelledby:S=""}=e;return ae("rounded",d),ae("padding",m),ae("active",c),ae("hover",_),ae("color",g),ae("fill",v),ae("regionLabel",y),l.$$set=k=>{t(16,e=Ue(Ue({},e),Je(k))),"display"in k&&t(2,s=k.display),"flexDirection"in k&&t(3,a=k.flexDirection),"gap"in k&&t(4,r=k.gap),"background"in k&&t(5,o=k.background),"border"in k&&t(6,f=k.border),"rounded"in k&&t(7,d=k.rounded),"padding"in k&&t(8,m=k.padding),"active"in k&&t(9,c=k.active),"hover"in k&&t(10,_=k.hover),"color"in k&&t(11,g=k.color),"fill"in k&&t(12,v=k.fill),"regionLabel"in k&&t(13,y=k.regionLabel),"labelledby"in k&&t(0,S=k.labelledby),"$$scope"in k&&t(14,i=k.$$scope)},l.$$.update=()=>{t(1,n=`${Cu} ${s} ${a} ${r} ${o} ${f} ${d} ${e.class??""}`)},e=Je(e),[S,n,s,a,r,o,f,d,m,c,_,g,v,y,i,u]}class Du extends Le{constructor(e){super(),Ve(this,e,yu,Su,Be,{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 zu(l){let e,t,n,u,i,s,a,r,o,f,d,m=[{type:"radio"},{name:l[1]},{__value:l[2]},l[11](),{tabindex:"-1"}],c={};for(let v=0;v<m.length;v+=1)c=Ue(c,m[v]);const _=l[21].default,g=$e(_,l,l[20],null);return o=il(l[29][0]),{c(){e=T("label"),t=T("div"),n=T("div"),u=T("input"),i=J(),g&&g.c(),this.h()},l(v){e=P(v,"LABEL",{class:!0});var y=F(e);t=P(y,"DIV",{class:!0,"data-testid":!0,role:!0,"aria-checked":!0,"aria-label":!0,tabindex:!0,title:!0});var S=F(t);n=P(S,"DIV",{class:!0});var k=F(n);u=P(k,"INPUT",{type:!0,name:!0,tabindex:!0}),k.forEach(b),i=Q(S),g&&g.l(S),S.forEach(b),y.forEach(b),this.h()},h(){zt(u,c),h(n,"class","h-0 w-0 overflow-hidden"),h(t,"class",s="radio-item "+l[8]),h(t,"data-testid","radio-item"),h(t,"role","radio"),h(t,"aria-checked",l[6]),h(t,"aria-label",l[4]),h(t,"tabindex","0"),h(t,"title",l[3]),h(e,"class",a="radio-label "+l[9]+" "+l[5]),o.p(u)},m(v,y){O(v,e,y),z(e,t),z(t,n),z(n,u),u.autofocus&&u.focus(),l[27](u),u.checked=u.__value===l[0],z(t,i),g&&g.m(t,null),r=!0,f||(d=[G(u,"change",l[28]),G(u,"click",l[25]),G(u,"change",l[26]),G(t,"keydown",l[10]),G(t,"keydown",l[22]),G(t,"keyup",l[23]),G(t,"keypress",l[24])],f=!0)},p(v,y){zt(u,c=qn(m,[{type:"radio"},(!r||y[0]&2)&&{name:v[1]},(!r||y[0]&4)&&{__value:v[2]},v[11](),{tabindex:"-1"}])),y[0]&1&&(u.checked=u.__value===v[0]),g&&g.p&&(!r||y[0]&1048576)&&et(g,_,v,v[20],r?nt(_,v[20],y,null):tt(v[20]),null),(!r||y[0]&256&&s!==(s="radio-item "+v[8]))&&h(t,"class",s),(!r||y[0]&64)&&h(t,"aria-checked",v[6]),(!r||y[0]&16)&&h(t,"aria-label",v[4]),(!r||y[0]&8)&&h(t,"title",v[3]),(!r||y[0]&544&&a!==(a="radio-label "+v[9]+" "+v[5]))&&h(e,"class",a)},i(v){r||(I(g,v),r=!0)},o(v){N(g,v),r=!1},d(v){v&&b(e),l[27](null),g&&g.d(v),o.r(),f=!1,it(d)}}}const Tu="flex-auto",Pu="text-base text-center cursor-pointer",wu="opacity-50 cursor-not-allowed";function Ru(l,e,t){let n,u,i,s,a;const r=["group","name","value","title","label","rounded","padding","active","hover","color","fill","regionLabel"];let o=Tt(e,r),{$$slots:f={},$$scope:d}=e,{group:m}=e,{name:c}=e,{value:_}=e,{title:g=""}=e,{label:v=""}=e,{rounded:y=fe("rounded")}=e,{padding:S=fe("padding")}=e,{active:k=fe("active")}=e,{hover:M=fe("hover")}=e,{color:j=fe("color")}=e,{fill:p=fe("fill")}=e,{regionLabel:C=fe("regionLabel")}=e,w;function D(W){["Enter","Space"].includes(W.code)&&(W.preventDefault(),w.click())}function $(){return delete o.class,o}const B=[[]];function ue(W){we.call(this,l,W)}function le(W){we.call(this,l,W)}function ee(W){we.call(this,l,W)}function Z(W){we.call(this,l,W)}function ge(W){we.call(this,l,W)}function de(W){Ae[W?"unshift":"push"](()=>{w=W,t(7,w)})}function Pe(){m=this.__value,t(0,m)}return l.$$set=W=>{t(31,e=Ue(Ue({},e),Je(W))),t(30,o=Tt(e,r)),"group"in W&&t(0,m=W.group),"name"in W&&t(1,c=W.name),"value"in W&&t(2,_=W.value),"title"in W&&t(3,g=W.title),"label"in W&&t(4,v=W.label),"rounded"in W&&t(12,y=W.rounded),"padding"in W&&t(13,S=W.padding),"active"in W&&t(14,k=W.active),"hover"in W&&t(15,M=W.hover),"color"in W&&t(16,j=W.color),"fill"in W&&t(17,p=W.fill),"regionLabel"in W&&t(5,C=W.regionLabel),"$$scope"in W&&t(20,d=W.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&5&&t(6,n=_===m),l.$$.dirty[0]&245824&&t(19,u=n?`${k} ${j} ${p}`:M),t(18,i=e.disabled?wu:""),t(8,a=`${Pu} ${S} ${y} ${u} ${i} ${e.class??""}`)},t(9,s=`${Tu}`),e=Je(e),[m,c,_,g,v,C,n,w,a,s,D,$,y,S,k,M,j,p,i,u,d,f,ue,le,ee,Z,ge,de,Pe,B]}class nn extends Le{constructor(e){super(),Ve(this,e,Ru,zu,Be,{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 ln(l){let e,t;const n=l[22].default,u=$e(n,l,l[21],null);return{c(){e=T("div"),u&&u.c(),this.h()},l(i){e=P(i,"DIV",{class:!0});var s=F(e);u&&u.l(s),s.forEach(b),this.h()},h(){h(e,"class","slide-toggle-text ml-3")},m(i,s){O(i,e,s),u&&u.m(e,null),t=!0},p(i,s){u&&u.p&&(!t||s[0]&2097152)&&et(u,n,i,i[21],t?nt(n,i[21],s,null):tt(i[21]),null)},i(i){t||(I(u,i),t=!0)},o(i){N(u,i),t=!1},d(i){i&&b(e),u&&u.d(i)}}}function Bu(l){let e,t,n,u,i,s,a,r,o,f,d,m,c,_,g,v=[{type:"checkbox"},{class:"slide-toggle-input hidden"},{name:l[1]},l[8](),{disabled:u=l[9].disabled}],y={};for(let k=0;k<v.length;k+=1)y=Ue(y,v[k]);let S=l[10].default&&ln(l);return{c(){e=T("div"),t=T("label"),n=T("input"),i=J(),s=T("div"),a=T("div"),f=J(),S&&S.c(),this.h()},l(k){e=P(k,"DIV",{id:!0,class:!0,"data-testid":!0,role:!0,"aria-label":!0,"aria-checked":!0,tabindex:!0});var M=F(e);t=P(M,"LABEL",{class:!0});var j=F(t);n=P(j,"INPUT",{type:!0,class:!0,name:!0}),i=Q(j),s=P(j,"DIV",{class:!0});var p=F(s);a=P(p,"DIV",{class:!0}),F(a).forEach(b),p.forEach(b),f=Q(j),S&&S.l(j),j.forEach(b),M.forEach(b),this.h()},h(){zt(n,y),h(a,"class",r="slide-toggle-thumb "+l[3]),Ge(a,"cursor-not-allowed",l[9].disabled),h(s,"class",o="slide-toggle-track "+l[4]),Ge(s,"cursor-not-allowed",l[9].disabled),h(t,"class",d="slide-toggle-label "+l[5]),h(e,"id",l[2]),h(e,"class",m="slide-toggle "+l[6]),h(e,"data-testid","slide-toggle"),h(e,"role","switch"),h(e,"aria-label",l[2]),h(e,"aria-checked",l[0]),h(e,"tabindex","0")},m(k,M){O(k,e,M),z(e,t),z(t,n),n.autofocus&&n.focus(),n.checked=l[0],z(t,i),z(t,s),z(s,a),z(t,f),S&&S.m(t,null),c=!0,_||(g=[G(n,"change",l[31]),G(n,"click",l[23]),G(n,"keydown",l[24]),G(n,"keyup",l[25]),G(n,"keypress",l[26]),G(n,"mouseover",l[27]),G(n,"change",l[28]),G(n,"focus",l[29]),G(n,"blur",l[30]),G(e,"keydown",l[7])],_=!0)},p(k,M){zt(n,y=qn(v,[{type:"checkbox"},{class:"slide-toggle-input hidden"},(!c||M[0]&2)&&{name:k[1]},k[8](),(!c||M[0]&512&&u!==(u=k[9].disabled))&&{disabled:u}])),M[0]&1&&(n.checked=k[0]),(!c||M[0]&8&&r!==(r="slide-toggle-thumb "+k[3]))&&h(a,"class",r),(!c||M[0]&520)&&Ge(a,"cursor-not-allowed",k[9].disabled),(!c||M[0]&16&&o!==(o="slide-toggle-track "+k[4]))&&h(s,"class",o),(!c||M[0]&528)&&Ge(s,"cursor-not-allowed",k[9].disabled),k[10].default?S?(S.p(k,M),M[0]&1024&&I(S,1)):(S=ln(k),S.c(),I(S,1),S.m(t,null)):S&&(ze(),N(S,1,1,()=>{S=null}),Te()),(!c||M[0]&32&&d!==(d="slide-toggle-label "+k[5]))&&h(t,"class",d),(!c||M[0]&4)&&h(e,"id",k[2]),(!c||M[0]&64&&m!==(m="slide-toggle "+k[6]))&&h(e,"class",m),(!c||M[0]&4)&&h(e,"aria-label",k[2]),(!c||M[0]&1)&&h(e,"aria-checked",k[0])},i(k){c||(I(S),c=!0)},o(k){N(S),c=!1},d(k){k&&b(e),S&&S.d(),_=!1,it(g)}}}const Iu="inline-block",Fu="unstyled flex items-center",Au="flex transition-all duration-[200ms] cursor-pointer",Ou="w-[50%] h-full scale-[0.8] transition-all duration-[200ms] shadow";function Mu(l,e,t){let n,u,i,s,a,r,o,f;const d=["name","checked","size","background","active","border","rounded","label"];let m=Tt(e,d),{$$slots:c={},$$scope:_}=e;const g=Ln(c),v=At();let{name:y}=e,{checked:S=!1}=e,{size:k="md"}=e,{background:M="bg-surface-400 dark:bg-surface-700"}=e,{active:j="bg-surface-900 dark:bg-surface-300"}=e,{border:p=""}=e,{rounded:C="rounded-full"}=e,{label:w=""}=e,D;switch(k){case"sm":D="w-12 h-6";break;case"lg":D="w-20 h-10";break;default:D="w-16 h-8"}function $(X){["Enter","Space"].includes(X.code)&&(X.preventDefault(),v("keyup",X),X.currentTarget.firstChild.click())}function B(){return delete m.class,m}function ue(X){we.call(this,l,X)}function le(X){we.call(this,l,X)}function ee(X){we.call(this,l,X)}function Z(X){we.call(this,l,X)}function ge(X){we.call(this,l,X)}function de(X){we.call(this,l,X)}function Pe(X){we.call(this,l,X)}function W(X){we.call(this,l,X)}function Ie(){S=this.checked,t(0,S)}return l.$$set=X=>{t(9,e=Ue(Ue({},e),Je(X))),t(33,m=Tt(e,d)),"name"in X&&t(1,y=X.name),"checked"in X&&t(0,S=X.checked),"size"in X&&t(11,k=X.size),"background"in X&&t(12,M=X.background),"active"in X&&t(13,j=X.active),"border"in X&&t(14,p=X.border),"rounded"in X&&t(15,C=X.rounded),"label"in X&&t(2,w=X.label),"$$scope"in X&&t(21,_=X.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&12289&&t(19,n=S?j:`${M} cursor-pointer`),l.$$.dirty[0]&1&&t(18,u=S?"bg-white/75":"bg-white"),l.$$.dirty[0]&1&&t(17,i=S?"translate-x-full":""),t(20,s=e.disabled===!0?"opacity-50":"hover:brightness-[105%] dark:hover:brightness-110 cursor-pointer"),t(6,a=`${Iu} ${C} ${s} ${e.class??""}`),l.$$.dirty[0]&638976&&t(4,o=`${Au} ${p} ${C} ${D} ${n}`),l.$$.dirty[0]&425984&&t(3,f=`${Ou} ${C} ${u} ${i}`)},t(5,r=`${Fu}`),e=Je(e),[S,y,w,f,o,r,a,$,B,e,g,k,M,j,p,C,D,i,u,n,s,_,c,ue,le,ee,Z,ge,de,Pe,W,Ie]}class Ft extends Le{constructor(e){super(),Ve(this,e,Mu,Bu,Be,{name:1,checked:0,size:11,background:12,active:13,border:14,rounded:15,label:2},null,[-1,-1])}}function un(l,e,t){const n=l.slice();return n[36]=e[t],n[38]=t,n}function sn(l){let e,t,n=[],u=new Map,i,s,a,r=ut(l[11]);const o=f=>f[36];for(let f=0;f<r.length;f+=1){let d=un(l,r,f),m=o(d);u.set(m,n[f]=cn(m,d))}return{c(){e=T("div"),t=T("div");for(let f=0;f<n.length;f+=1)n[f].c();this.h()},l(f){e=P(f,"DIV",{class:!0,"data-testid":!0});var d=F(e);t=P(d,"DIV",{class:!0});var m=F(t);for(let c=0;c<n.length;c+=1)n[c].l(m);m.forEach(b),d.forEach(b),this.h()},h(){h(t,"class",i="snackbar "+l[13]),h(e,"class",s="snackbar-wrapper "+l[14]),h(e,"data-testid","snackbar-wrapper")},m(f,d){O(f,e,d),z(e,t);for(let m=0;m<n.length;m+=1)n[m]&&n[m].m(t,null);a=!0},p(f,d){if(d[0]&499103){r=ut(f[11]),ze();for(let m=0;m<n.length;m+=1)n[m].r();n=_l(n,d,o,1,f,r,u,t,gl,cn,null,un);for(let m=0;m<n.length;m+=1)n[m].a();Te()}(!a||d[0]&8192&&i!==(i="snackbar "+f[13]))&&h(t,"class",i),(!a||d[0]&16384&&s!==(s="snackbar-wrapper "+f[14]))&&h(e,"class",s)},i(f){if(!a){for(let d=0;d<r.length;d+=1)I(n[d]);a=!0}},o(f){for(let d=0;d<n.length;d+=1)N(n[d]);a=!1},d(f){f&&b(e);for(let d=0;d<n.length;d+=1)n[d].d()}}}function an(l){let e,t,n=l[36].action&&rn(l),u=!l[36].hideDismiss&&on(l);return{c(){e=T("div"),n&&n.c(),t=J(),u&&u.c(),this.h()},l(i){e=P(i,"DIV",{class:!0});var s=F(e);n&&n.l(s),t=Q(s),u&&u.l(s),s.forEach(b),this.h()},h(){h(e,"class","toast-actions "+Uu)},m(i,s){O(i,e,s),n&&n.m(e,null),z(e,t),u&&u.m(e,null)},p(i,s){i[36].action?n?n.p(i,s):(n=rn(i),n.c(),n.m(e,t)):n&&(n.d(1),n=null),i[36].hideDismiss?u&&(u.d(1),u=null):u?u.p(i,s):(u=on(i),u.c(),u.m(e,null))},d(i){i&&b(e),n&&n.d(),u&&u.d()}}}function rn(l){let e,t,n=l[36].action.label+"",u,i;function s(){return l[30](l[38])}return{c(){e=T("button"),t=new mt(!1),this.h()},l(a){e=P(a,"BUTTON",{class:!0});var r=F(e);t=gt(r,!1),r.forEach(b),this.h()},h(){t.a=null,h(e,"class",l[1])},m(a,r){O(a,e,r),t.m(n,e),u||(i=G(e,"click",s),u=!0)},p(a,r){l=a,r[0]&2048&&n!==(n=l[36].action.label+"")&&t.p(n),r[0]&2&&h(e,"class",l[1])},d(a){a&&b(e),u=!1,i()}}}function on(l){let e,t,n,u;function i(){return l[31](l[36])}return{c(){e=T("button"),t=Oe(l[3]),this.h()},l(s){e=P(s,"BUTTON",{class:!0,"aria-label":!0});var a=F(e);t=Me(a,l[3]),a.forEach(b),this.h()},h(){h(e,"class",l[2]),h(e,"aria-label","Dismiss toast")},m(s,a){O(s,e,a),z(e,t),n||(u=G(e,"click",i),n=!0)},p(s,a){l=s,a[0]&8&&ht(t,l[3]),a[0]&4&&h(e,"class",l[2])},d(s){s&&b(e),n=!1,u()}}}function cn(l,e){let t,n,u,i,s=e[36].message+"",a,r,o,f,d,m,c,_=se,g,v,y,S=(e[36].action||!e[36].hideDismiss)&&an(e);function k(){return e[32](e[38])}function M(){return e[33](e[38])}return{key:l,first:null,c(){t=T("div"),n=T("div"),u=T("div"),i=new mt(!1),a=J(),S&&S.c(),o=J(),this.h()},l(j){t=P(j,"DIV",{role:!0,"aria-live":!0});var p=F(t);n=P(p,"DIV",{class:!0,"data-testid":!0});var C=F(n);u=P(C,"DIV",{class:!0});var w=F(u);i=gt(w,!1),w.forEach(b),a=Q(C),S&&S.l(C),C.forEach(b),o=Q(p),p.forEach(b),this.h()},h(){i.a=null,h(u,"class","text-base"),h(n,"class",r="toast "+e[12]+" "+(e[36].background??e[0])+" "+(e[36].classes??"")),h(n,"data-testid","toast"),h(t,"role",f=e[36].hideDismiss?"alert":"alertdialog"),h(t,"aria-live","polite"),this.first=t},m(j,p){O(j,t,p),z(t,n),z(n,u),i.m(s,u),z(n,a),S&&S.m(n,null),z(t,o),g=!0,v||(y=[G(t,"mouseenter",k),G(t,"mouseleave",M)],v=!0)},p(j,p){e=j,(!g||p[0]&2048)&&s!==(s=e[36].message+"")&&i.p(s),e[36].action||!e[36].hideDismiss?S?S.p(e,p):(S=an(e),S.c(),S.m(n,null)):S&&(S.d(1),S=null),(!g||p[0]&6145&&r!==(r="toast "+e[12]+" "+(e[36].background??e[0])+" "+(e[36].classes??"")))&&h(n,"class",r),(!g||p[0]&2048&&f!==(f=e[36].hideDismiss?"alert":"alertdialog"))&&h(t,"role",f)},r(){c=t.getBoundingClientRect()},f(){hl(t),_(),Wn(t,c)},a(){_(),_=dl(t,c,Eu,{duration:e[4]?250:0})},i(j){g||(Vn(()=>{g&&(m&&m.end(1),d=Nn(t,Pt,{transition:e[5],params:{x:e[10].x,y:e[10].y,...e[6]},enabled:e[4]}),d.start())}),g=!0)},o(j){d&&d.invalidate(),m=jn(t,Pt,{transition:e[7],params:{x:e[10].x,y:e[10].y,...e[8]},enabled:e[4]}),g=!1},d(j){j&&b(t),S&&S.d(),j&&m&&m.end(),v=!1,it(y)}}}function Lu(l){let e,t,n=l[9].length&&sn(l);return{c(){n&&n.c(),e=Se()},l(u){n&&n.l(u),e=Se()},m(u,i){n&&n.m(u,i),O(u,e,i),t=!0},p(u,i){u[9].length?n?(n.p(u,i),i[0]&512&&I(n,1)):(n=sn(u),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ze(),N(n,1,1,()=>{n=null}),Te())},i(u){t||(I(n),t=!0)},o(u){N(n),t=!1},d(u){u&&b(e),n&&n.d(u)}}}const Vu="flex fixed top-0 left-0 right-0 bottom-0 pointer-events-none",Nu="flex flex-col gap-y-2",ju="flex justify-between items-center pointer-events-auto",Uu="flex items-center space-x-2";function Wu(l,e,t){let n,u,i,s,a,r;rt(l,Jn,V=>t(34,r=V));const o=Xn();rt(l,o,V=>t(9,a=V));let{position:f="b"}=e,{max:d=3}=e,{background:m="variant-filled-secondary"}=e,{width:c="max-w-[640px]"}=e,{color:_=""}=e,{padding:g="p-4"}=e,{spacing:v="space-x-4"}=e,{rounded:y="rounded-container-token"}=e,{shadow:S="shadow-lg"}=e,{zIndex:k="z-[888]"}=e,{buttonAction:M="btn variant-filled"}=e,{buttonDismiss:j="btn-icon btn-icon-sm variant-filled"}=e,{buttonDismissLabel:p="✕"}=e,{transitions:C=!r}=e,{transitionIn:w=Gt}=e,{transitionInParams:D={duration:250}}=e,{transitionOut:$=Gt}=e,{transitionOutParams:B={duration:250}}=e,ue,le,ee={x:0,y:0};switch(f){case"t":ue="justify-center items-start",le="items-center",ee={x:0,y:-100};break;case"b":ue="justify-center items-end",le="items-center",ee={x:0,y:100};break;case"l":ue="justify-start items-center",le="items-start",ee={x:-100,y:0};break;case"r":ue="justify-end items-center",le="items-end",ee={x:100,y:0};break;case"tl":ue="justify-start items-start",le="items-start",ee={x:-100,y:0};break;case"tr":ue="justify-end items-start",le="items-end",ee={x:100,y:0};break;case"bl":ue="justify-start items-end",le="items-start",ee={x:-100,y:0};break;case"br":ue="justify-end items-end",le="items-end",ee={x:100,y:0};break}function Z(V){a[V]?.action?.response(),o.close(a[V].id)}function ge(V){a[V]?.hoverable&&(o.freeze(V),t(13,u+=" scale-[105%]"))}function de(V){a[V]?.hoverable&&(o.unfreeze(V),t(13,u=u.replace(" scale-[105%]","")))}const Pe=V=>Z(V),W=V=>o.close(V.id),Ie=V=>ge(V),X=V=>de(V);return l.$$set=V=>{t(35,e=Ue(Ue({},e),Je(V))),"position"in V&&t(19,f=V.position),"max"in V&&t(20,d=V.max),"background"in V&&t(0,m=V.background),"width"in V&&t(21,c=V.width),"color"in V&&t(22,_=V.color),"padding"in V&&t(23,g=V.padding),"spacing"in V&&t(24,v=V.spacing),"rounded"in V&&t(25,y=V.rounded),"shadow"in V&&t(26,S=V.shadow),"zIndex"in V&&t(27,k=V.zIndex),"buttonAction"in V&&t(1,M=V.buttonAction),"buttonDismiss"in V&&t(2,j=V.buttonDismiss),"buttonDismissLabel"in V&&t(3,p=V.buttonDismissLabel),"transitions"in V&&t(4,C=V.transitions),"transitionIn"in V&&t(5,w=V.transitionIn),"transitionInParams"in V&&t(6,D=V.transitionInParams),"transitionOut"in V&&t(7,$=V.transitionOut),"transitionOutParams"in V&&t(8,B=V.transitionOutParams)},l.$$.update=()=>{t(14,n=`${Vu} ${ue} ${k} ${e.class||""}`),l.$$.dirty[0]&545259520&&t(13,u=`${Nu} ${le} ${g}`),l.$$.dirty[0]&132120576&&t(12,i=`${ju} ${c} ${_} ${g} ${v} ${y} ${S}`),l.$$.dirty[0]&1049088&&t(11,s=Array.from(a).slice(0,d))},e=Je(e),[m,M,j,p,C,w,D,$,B,a,ee,s,i,u,n,o,Z,ge,de,f,d,c,_,g,v,y,S,k,ue,le,Pe,W,Ie,X]}class qu extends Le{constructor(e){super(),Ve(this,e,Wu,Lu,Be,{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 Xe{static findDateInText(e){const t=/\b\d{1,2}\.\d{1,2}\.\d{4}\b/g,n=e.match(t);if(n&&n.length>0){const u=n[0],[i,s,a]=u.split(".").map(Number);return new Date(a,s-1,i)}return null}static sortByRelevanceAndDate(e){return e.sort((t,n)=>{const u=n.relevance-t.relevance;if(u!==0)return u;const i=Xe.findDateInText(t.title),s=Xe.findDateInText(n.title);return i&&s?s.getTime()-i.getTime():i?-1:s?1:0})}static sortByDate(e){const t=e.filter(a=>Xe.findDateInText(a.title)),n=e.filter(a=>!Xe.findDateInText(a.title)),u=t.sort((a,r)=>{const o=Xe.findDateInText(a.title),f=Xe.findDateInText(r.title);return o&&f?f.getTime()-o.getTime():o?-1:f?1:0}),i=[];let s=0;for(const a of e)if(Xe.findDateInText(a.title)){let r=u.shift();r&&i.push(r)}else i.push(n[s]),s++;return i}static sortByRelevance(e){return e.sort((t,n)=>t.relevance&&n.relevance?n.relevance-t.relevance:t.relevance?-1:n.relevance?1:0)}static identifyDocumentType(e){const t=[{regexp:/(ФАС |АС |КС |ВС |[Сс]удебн|[Сс]уд)/,docType:"Решение суда"},{regexp:/[Пп]исьмо [Мм]инфина/,docType:"Письмо Минфина"},{regexp:/[Пп]исьмо (ФНС|фнс)/,docType:"Письмо ФНС"},{regexp:/ст.(\d+\.\d+|\d+) НКРФ/,docType:"НК РФ"},{regexp:/ст.(\d+\.\d+|\d+) ТКРФ/,docType:"ТК РФ"},{regexp:/Приказ ФНС РФ/,docType:"Приказ ФНС РФ"},{regexp:/Постановление Правительства РФ/,docType:"Постановление Правительства РФ"},{regexp:/Решение Коллегии Евразийской экономической комиссии/,docType:"Решение Коллегии ЕЭК"},{regexp:/^Федеральный закон/,docType:"Федеральные законы"}];return e.map(n=>{for(const{regexp:u,docType:i}of t)if(u.test(n.title))return n.docType=i,n;return n.docType="Другие документы",n})}}function fn(l,e,t){const n=l.slice();return n[10]=e[t],n}function dn(l){let e,t,n;return{c(){e=T("input"),this.h()},l(u){e=P(u,"INPUT",{type:!0}),this.h()},h(){h(e,"type","checkbox")},m(u,i){O(u,e,i),e.checked=l[1][l[3]],t||(n=G(e,"change",l[7]),t=!0)},p(u,i){i&10&&(e.checked=u[1][u[3]])},d(u){u&&b(e),t=!1,n()}}}function Hu(l){let e,t;return{c(){e=T("div"),t=Oe(l[4]),this.h()},l(n){e=P(n,"DIV",{class:!0});var u=F(e);t=Me(u,l[4]),u.forEach(b),this.h()},h(){h(e,"class","annotation svelte-dwjxto")},m(n,u){O(n,e,u),z(e,t)},p(n,u){u&16&&ht(t,n[4])},d(n){n&&b(e)}}}function Ku(l){let e,t=ut(l[4].split(`
`)),n=[];for(let u=0;u<t.length;u+=1)n[u]=hn(fn(l,t,u));return{c(){e=T("div");for(let u=0;u<n.length;u+=1)n[u].c();this.h()},l(u){e=P(u,"DIV",{class:!0});var i=F(e);for(let s=0;s<n.length;s+=1)n[s].l(i);i.forEach(b),this.h()},h(){h(e,"class","annotation full-text svelte-dwjxto")},m(u,i){O(u,e,i);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(e,null)},p(u,i){if(i&16){t=ut(u[4].split(`
`));let s;for(s=0;s<t.length;s+=1){const a=fn(u,t,s);n[s]?n[s].p(a,i):(n[s]=hn(a),n[s].c(),n[s].m(e,null))}for(;s<n.length;s+=1)n[s].d(1);n.length=t.length}},d(u){u&&b(e),wt(n,u)}}}function hn(l){let e,t=l[10]+"",n;return{c(){e=T("p"),n=Oe(t)},l(u){e=P(u,"P",{});var i=F(e);n=Me(i,t),i.forEach(b)},m(u,i){O(u,e,i),z(e,n)},p(u,i){i&16&&t!==(t=u[10]+"")&&ht(n,t)},d(u){u&&b(e)}}}function mn(l){let e;function t(i,s){return i[0][i[2]]?Xu:Gu}let n=t(l),u=n(l);return{c(){u.c(),e=Se()},l(i){u.l(i),e=Se()},m(i,s){u.m(i,s),O(i,e,s)},p(i,s){n===(n=t(i))&&u?u.p(i,s):(u.d(1),u=n(i),u&&(u.c(),u.m(e.parentNode,e)))},d(i){i&&b(e),u.d(i)}}}function Gu(l){let e,t="читать далее...",n,u;return{c(){e=T("a"),e.textContent=t,this.h()},l(i){e=P(i,"A",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-1pu88dh"&&(e.textContent=t),this.h()},h(){h(e,"class","svelte-dwjxto")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[9]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function Xu(l){let e,t="свернуть",n,u;return{c(){e=T("a"),e.textContent=t,this.h()},l(i){e=P(i,"A",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-18vtpy5"&&(e.textContent=t),this.h()},h(){h(e,"class","svelte-dwjxto")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[8]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function Yu(l){let e,t,n,u,i,s,a,r=l[5]&&dn(l);function o(c,_){return c[0][c[2]]?Ku:Hu}let f=o(l),d=f(l),m=l[4].length>100&&mn(l);return{c(){e=T("div"),t=T("div"),n=T("label"),r&&r.c(),u=J(),i=Oe(l[3]),s=J(),d.c(),a=J(),m&&m.c(),this.h()},l(c){e=P(c,"DIV",{class:!0});var _=F(e);t=P(_,"DIV",{class:!0});var g=F(t);n=P(g,"LABEL",{style:!0});var v=F(n);r&&r.l(v),u=Q(v),i=Me(v,l[3]),v.forEach(b),g.forEach(b),s=Q(_),d.l(_),a=Q(_),m&&m.l(_),_.forEach(b),this.h()},h(){Ye(n,"cursor","pointer"),h(t,"class","title svelte-dwjxto"),h(e,"class","search-result svelte-dwjxto")},m(c,_){O(c,e,_),z(e,t),z(t,n),r&&r.m(n,null),z(n,u),z(n,i),z(e,s),d.m(e,null),z(e,a),m&&m.m(e,null)},p(c,[_]){c[5]?r?r.p(c,_):(r=dn(c),r.c(),r.m(n,u)):r&&(r.d(1),r=null),_&8&&ht(i,c[3]),f===(f=o(c))&&d?d.p(c,_):(d.d(1),d=f(c),d&&(d.c(),d.m(e,a))),c[4].length>100?m?m.p(c,_):(m=mn(c),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i:se,o:se,d(c){c&&b(e),r&&r.d(),d.d(),m&&m.d()}}}function Ju(l,e,t){let{showFullText:n=Array(10).fill(!1)}=e,{useSearchResult:u}=e,{index:i}=e,{title:s}=e,{text:a}=e,{enableSearchResultSelection:r=!1}=e;function o(c){t(0,n[c]=!n[c],n)}function f(){u[s]=this.checked,t(1,u)}const d=()=>o(i),m=()=>o(i);return l.$$set=c=>{"showFullText"in c&&t(0,n=c.showFullText),"useSearchResult"in c&&t(1,u=c.useSearchResult),"index"in c&&t(2,i=c.index),"title"in c&&t(3,s=c.title),"text"in c&&t(4,a=c.text),"enableSearchResultSelection"in c&&t(5,r=c.enableSearchResultSelection)},[n,u,i,s,a,r,o,f,d,m]}class Qn extends Le{constructor(e){super(),Ve(this,e,Ju,Yu,Be,{showFullText:0,useSearchResult:1,index:2,title:3,text:4,enableSearchResultSelection:5})}}function gn(l,e,t){const n=l.slice();return n[20]=e[t].title,n[21]=e[t].text,n[23]=t,n}function _n(l,e,t){const n=l.slice();return n[16]=e[t][0],n[17]=e[t][1],n}function bn(l,e,t){const n=l.slice();return n[20]=e[t].title,n[21]=e[t].text,n[23]=t,n}function vn(l){let e,t,n,u="Сортировать по:",i,s,a,r,o,f;s=new Du({props:{background:"",border:"",$$slots:{default:[xu]},$$scope:{ctx:l}}});function d(c){l[10](c)}let m={name:"groupByChecked",size:"sm",label:"Группировать по типу",$$slots:{default:[$u]},$$scope:{ctx:l}};return l[4]!==void 0&&(m.checked=l[4]),r=new Ft({props:m}),Ae.push(()=>He(r,"checked",d)),{c(){e=T("div"),t=T("div"),n=T("label"),n.textContent=u,i=J(),ve(s.$$.fragment),a=J(),ve(r.$$.fragment),this.h()},l(c){e=P(c,"DIV",{class:!0});var _=F(e);t=P(_,"DIV",{class:!0,style:!0});var g=F(t);n=P(g,"LABEL",{style:!0,class:!0,"data-svelte-h":!0}),Re(n)!=="svelte-12wnwfn"&&(n.textContent=u),i=Q(g),ke(s.$$.fragment,g),a=Q(g),ke(r.$$.fragment,g),g.forEach(b),_.forEach(b),this.h()},h(){Ye(n,"display","inline-block"),Ye(n,"flex-wrap","wrap"),h(n,"class","svelte-1ptibtq"),h(t,"class","card w-full flex p-2 space-y-2"),Ye(t,"align-items","center"),Ye(t,"flex-wrap","wrap"),h(e,"class","settings-bar svelte-1ptibtq")},m(c,_){O(c,e,_),z(e,t),z(t,n),z(t,i),pe(s,t,null),z(t,a),pe(r,t,null),f=!0},p(c,_){const g={};_&33554464&&(g.$$scope={dirty:_,ctx:c}),s.$set(g);const v={};_&33554432&&(v.$$scope={dirty:_,ctx:c}),!o&&_&16&&(o=!0,v.checked=c[4],qe(()=>o=!1)),r.$set(v)},i(c){f||(I(s.$$.fragment,c),I(r.$$.fragment,c),f=!0)},o(c){N(s.$$.fragment,c),N(r.$$.fragment,c),f=!1},d(c){c&&b(e),Ee(s),Ee(r)}}}function Qu(l){let e;return{c(){e=Oe("релевантности")},l(t){e=Me(t,"релевантности")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function Zu(l){let e;return{c(){e=Oe("дате")},l(t){e=Me(t,"дате")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function xu(l){let e,t,n,u,i,s;function a(d){l[8](d)}let r={name:"sortBy",value:"rel",$$slots:{default:[Qu]},$$scope:{ctx:l}};l[5]!==void 0&&(r.group=l[5]),e=new nn({props:r}),Ae.push(()=>He(e,"group",a));function o(d){l[9](d)}let f={name:"sortBy",value:"date",$$slots:{default:[Zu]},$$scope:{ctx:l}};return l[5]!==void 0&&(f.group=l[5]),u=new nn({props:f}),Ae.push(()=>He(u,"group",o)),{c(){ve(e.$$.fragment),n=J(),ve(u.$$.fragment)},l(d){ke(e.$$.fragment,d),n=Q(d),ke(u.$$.fragment,d)},m(d,m){pe(e,d,m),O(d,n,m),pe(u,d,m),s=!0},p(d,m){const c={};m&33554432&&(c.$$scope={dirty:m,ctx:d}),!t&&m&32&&(t=!0,c.group=d[5],qe(()=>t=!1)),e.$set(c);const _={};m&33554432&&(_.$$scope={dirty:m,ctx:d}),!i&&m&32&&(i=!0,_.group=d[5],qe(()=>i=!1)),u.$set(_)},i(d){s||(I(e.$$.fragment,d),I(u.$$.fragment,d),s=!0)},o(d){N(e.$$.fragment,d),N(u.$$.fragment,d),s=!1},d(d){d&&b(n),Ee(e,d),Ee(u,d)}}}function $u(l){let e;return{c(){e=Oe("Группировать по типу")},l(t){e=Me(t,"Группировать по типу")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function ei(l){let e,t,n=ut(l[0]),u=[];for(let s=0;s<n.length;s+=1)u[s]=kn(gn(l,n,s));const i=s=>N(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=Se()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=Se()},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);O(s,e,a),t=!0},p(s,a){if(a&15){n=ut(s[0]);let r;for(r=0;r<n.length;r+=1){const o=gn(s,n,r);u[r]?(u[r].p(o,a),I(u[r],1)):(u[r]=kn(o),u[r].c(),I(u[r],1),u[r].m(e.parentNode,e))}for(ze(),r=n.length;r<u.length;r+=1)i(r);Te()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)I(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)N(u[a]);t=!1},d(s){s&&b(e),wt(u,s)}}}function ti(l){let e,t;return e=new tu({props:{$$slots:{default:[ii]},$$scope:{ctx:l}}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u&33554510&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function kn(l){let e,t;return e=new Qn({props:{title:l[20],text:l[21],index:l[23],enableSearchResultSelection:l[3],useSearchResult:l[2],showFullText:l[1]}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u&1&&(i.title=n[20]),u&1&&(i.text=n[21]),u&8&&(i.enableSearchResultSelection=n[3]),u&4&&(i.useSearchResult=n[2]),u&2&&(i.showFullText=n[1]),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function pn(l){let e,t,n,u;return{c(){e=T("input"),this.h()},l(i){e=P(i,"INPUT",{type:!0,"data-doctype":!0}),this.h()},h(){h(e,"type","checkbox"),h(e,"data-doctype",t=l[16])},m(i,s){O(i,e,s),n||(u=G(e,"click",l[7]),n=!0)},p(i,s){s&64&&t!==(t=i[16])&&h(e,"data-doctype",t)},d(i){i&&b(e),n=!1,u()}}}function ni(l){let e,t=l[3]&&pn(l);return{c(){t&&t.c(),e=J()},l(n){t&&t.l(n),e=Q(n)},m(n,u){t&&t.m(n,u),O(n,e,u)},p(n,u){n[3]?t?t.p(n,u):(t=pn(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&b(e),t&&t.d(n)}}}function li(l){let e=l[16]+"",t;return{c(){t=Oe(e)},l(n){t=Me(n,e)},m(n,u){O(n,t,u)},p(n,u){u&64&&e!==(e=n[16]+"")&&ht(t,e)},d(n){n&&b(t)}}}function En(l){let e,t;return e=new Qn({props:{title:l[20],text:l[21],index:l[23],enableSearchResultSelection:l[3],useSearchResult:l[2],showFullText:l[1]}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u&64&&(i.title=n[20]),u&64&&(i.text=n[21]),u&8&&(i.enableSearchResultSelection=n[3]),u&4&&(i.useSearchResult=n[2]),u&2&&(i.showFullText=n[1]),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function ui(l){let e,t,n=ut(l[17]),u=[];for(let s=0;s<n.length;s+=1)u[s]=En(bn(l,n,s));const i=s=>N(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=J()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=Q(s)},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);O(s,e,a),t=!0},p(s,a){if(a&78){n=ut(s[17]);let r;for(r=0;r<n.length;r+=1){const o=bn(s,n,r);u[r]?(u[r].p(o,a),I(u[r],1)):(u[r]=En(o),u[r].c(),I(u[r],1),u[r].m(e.parentNode,e))}for(ze(),r=n.length;r<u.length;r+=1)i(r);Te()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)I(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)N(u[a]);t=!1},d(s){s&&b(e),wt(u,s)}}}function Sn(l){let e,t;return e=new pu({props:{$$slots:{content:[ui],summary:[li],lead:[ni]},$$scope:{ctx:l}}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u&33554510&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function ii(l){let e,t,n=ut(Object.entries(l[6])),u=[];for(let s=0;s<n.length;s+=1)u[s]=Sn(_n(l,n,s));const i=s=>N(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=Se()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=Se()},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);O(s,e,a),t=!0},p(s,a){if(a&206){n=ut(Object.entries(s[6]));let r;for(r=0;r<n.length;r+=1){const o=_n(s,n,r);u[r]?(u[r].p(o,a),I(u[r],1)):(u[r]=Sn(o),u[r].c(),I(u[r],1),u[r].m(e.parentNode,e))}for(ze(),r=n.length;r<u.length;r+=1)i(r);Te()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)I(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)N(u[a]);t=!1},d(s){s&&b(e),wt(u,s)}}}function si(l){let e,t,n,u,i,s,a,r=l[0]&&l[0].length>0&&vn(l);const o=[ti,ei],f=[];function d(c,_){return c[4]&&c[6]?0:1}n=d(l),u=f[n]=o[n](l);let m=ai;return{c(){e=T("div"),r&&r.c(),t=J(),u.c(),i=J(),s=Se(),this.h()},l(c){e=P(c,"DIV",{class:!0});var _=F(e);r&&r.l(_),t=Q(_),u.l(_),_.forEach(b),i=Q(c),s=Se(),this.h()},h(){h(e,"class","search-results svelte-1ptibtq")},m(c,_){O(c,e,_),r&&r.m(e,null),z(e,t),f[n].m(e,null),O(c,i,_),O(c,s,_),a=!0},p(c,[_]){c[0]&&c[0].length>0?r?(r.p(c,_),_&1&&I(r,1)):(r=vn(c),r.c(),I(r,1),r.m(e,t)):r&&(ze(),N(r,1,1,()=>{r=null}),Te());let g=n;n=d(c),n===g?f[n].p(c,_):(ze(),N(f[g],1,1,()=>{f[g]=null}),Te(),u=f[n],u?u.p(c,_):(u=f[n]=o[n](c),u.c()),I(u,1),u.m(e,null))},i(c){a||(I(r),I(u),I(m),a=!0)},o(c){N(r),N(u),N(m),a=!1},d(c){c&&(b(e),b(i),b(s)),r&&r.d(),f[n].d()}}}let ai=!1;function ri(l,e,t){let{showFullText:n=Array(10).fill(!1)}=e,{useSearchResult:u}=e,i=!1,s="rel",{searchResults:a=[]}=e,r,{enableSearchResultSelection:o=!1}=e;const f=g=>g.reduce((v,y)=>{const S=y.docType||"Другие документы";return v[S]||(v[S]=[]),v[S].push(y),v},{}),d=g=>{g.stopPropagation();const v=g.target.dataset.doctype;Object.keys(r[v]).forEach(y=>{t(2,u[r[v][y].title]=g.target.checked,u)})};function m(g){s=g,t(5,s)}function c(g){s=g,t(5,s)}function _(g){i=g,t(4,i)}return l.$$set=g=>{"showFullText"in g&&t(1,n=g.showFullText),"useSearchResult"in g&&t(2,u=g.useSearchResult),"searchResults"in g&&t(0,a=g.searchResults),"enableSearchResultSelection"in g&&t(3,o=g.enableSearchResultSelection)},l.$$.update=()=>{l.$$.dirty&49&&(i&&t(6,r=f(a)),s=="date"?t(0,a=Xe.sortByDate(a)):s=="rel"&&t(0,a=Xe.sortByRelevance(a)))},[a,n,u,o,i,s,r,d,m,c,_]}class Zn extends Le{constructor(e){super(),Ve(this,e,ri,si,Be,{showFullText:1,useSearchResult:2,searchResults:0,enableSearchResultSelection:3})}}function Cn(l){let e,t;return e=new Fl({props:{status:l[1]}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u[0]&2&&(i.status=n[1]),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function yn(l){let e,t;return e=new Ml({props:{status:l[2]}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u[0]&4&&(i.status=n[2]),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function Dn(l){let e,t="Очистить",n,u;return{c(){e=T("button"),e.textContent=t,this.h()},l(i){e=P(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-1rjqwcg"&&(e.textContent=t),this.h()},h(){h(e,"class","btn variant-filled")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[22]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function zn(l){let e,t="Остановить",n,u;return{c(){e=T("button"),e.textContent=t,this.h()},l(i){e=P(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-a5kyut"&&(e.textContent=t),this.h()},h(){h(e,"class","btn variant-filled")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[27]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function oi(l){let e;return{c(){e=Oe("Выбрать источники для LLM")},l(t){e=Me(t,"Выбрать источники для LLM")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function ci(l){let e;return{c(){e=Oe("Выводить ответ в реальном времени")},l(t){e=Me(t,"Выводить ответ в реальном времени")},m(t,n){O(t,e,n)},d(t){t&&b(e)}}}function Tn(l){let e,t,n,u,i,s;return i=new Rl({}),{c(){e=T("div"),t=Oe(l[12]),n=J(),u=T("div"),ve(i.$$.fragment),this.h()},l(a){e=P(a,"DIV",{class:!0});var r=F(e);t=Me(r,l[12]),r.forEach(b),n=Q(a),u=P(a,"DIV",{class:!0});var o=F(u);ke(i.$$.fragment,o),o.forEach(b),this.h()},h(){h(e,"class","loading-status svelte-1cldj37"),h(u,"class","loading-container svelte-1cldj37")},m(a,r){O(a,e,r),z(e,t),O(a,n,r),O(a,u,r),pe(i,u,null),s=!0},p(a,r){(!s||r[0]&4096)&&ht(t,a[12])},i(a){s||(I(i.$$.fragment,a),s=!0)},o(a){N(i.$$.fragment,a),s=!1},d(a){a&&(b(e),b(n),b(u)),Ee(i)}}}function Pn(l){let e,t;return e=new jl({props:{onSave:l[20],onClose:l[21],text:l[4]}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u[0]&16&&(i.text=n[4]),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function wn(l){let e,t='<div class="alert-message"><p>Не могу предоставить консультацию по вашему вопросу, т.к. поиск ничего не нашел.</p> <p>Пожалуйста, попробуйте переформулировать запрос.</p></div>';return{c(){e=T("aside"),e.innerHTML=t,this.h()},l(n){e=P(n,"ASIDE",{class:!0,style:!0,"data-svelte-h":!0}),Re(e)!=="svelte-1cj3t4e"&&(e.innerHTML=t),this.h()},h(){h(e,"class","alert variant-filled"),Ye(e,"margin","0 1rem")},m(n,u){O(n,e,u)},d(n){n&&b(e)}}}function Rn(l){let e,t,n,u;const i=[di,fi],s=[];function a(r,o){return r[0]?0:1}return e=a(l),t=s[e]=i[e](l),{c(){t.c(),n=Se()},l(r){t.l(r),n=Se()},m(r,o){s[e].m(r,o),O(r,n,o),u=!0},p(r,o){let f=e;e=a(r),e===f?s[e].p(r,o):(ze(),N(s[f],1,1,()=>{s[f]=null}),Te(),t=s[e],t?t.p(r,o):(t=s[e]=i[e](r),t.c()),I(t,1),t.m(n.parentNode,n))},i(r){u||(I(t),u=!0)},o(r){N(t),u=!1},d(r){r&&b(n),s[e].d(r)}}}function fi(l){let e,t;return e=new Sl({props:{theme:"modern-theme",$$slots:{default:[gi]},$$scope:{ctx:l}}}),{c(){ve(e.$$.fragment)},l(n){ke(e.$$.fragment,n)},m(n,u){pe(e,n,u),t=!0},p(n,u){const i={};u[0]&517792|u[1]&4194304&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){Ee(e,n)}}}function di(l){let e,t,n,u,i,s,a,r,o,f,d,m,c,_,g=l[15]&&l[5].length>0&&An(l),v=l[18]&&On(l);function y(p){l[35](p)}function S(p){l[36](p)}function k(p){l[37](p)}function M(p){l[38](p)}let j={};return l[5]!==void 0&&(j.searchResults=l[5]),l[13]!==void 0&&(j.showFullText=l[13]),l[14]!==void 0&&(j.useSearchResult=l[14]),l[15]!==void 0&&(j.enableSearchResultSelection=l[15]),o=new Zn({props:j}),Ae.push(()=>He(o,"searchResults",y)),Ae.push(()=>He(o,"showFullText",S)),Ae.push(()=>He(o,"useSearchResult",k)),Ae.push(()=>He(o,"enableSearchResultSelection",M)),{c(){e=T("div"),t=T("div"),g&&g.c(),n=J(),u=T("div"),i=new mt(!1),s=J(),v&&v.c(),a=J(),r=T("div"),ve(o.$$.fragment),this.h()},l(p){e=P(p,"DIV",{class:!0});var C=F(e);t=P(C,"DIV",{class:!0});var w=F(t);g&&g.l(w),n=Q(w),u=P(w,"DIV",{class:!0});var D=F(u);i=gt(D,!1),D.forEach(b),s=Q(w),v&&v.l(w),w.forEach(b),C.forEach(b),a=Q(p),r=P(p,"DIV",{class:!0});var $=F(r);ke(o.$$.fragment,$),$.forEach(b),this.h()},h(){i.a=null,h(u,"class","textarea svelte-1cldj37"),h(t,"class","textarea svelte-1cldj37"),h(e,"class","textarea-column svelte-1cldj37"),h(r,"class","search-column svelte-1cldj37")},m(p,C){O(p,e,C),z(e,t),g&&g.m(t,null),z(t,n),z(t,u),i.m(l[9],u),z(t,s),v&&v.m(t,null),O(p,a,C),O(p,r,C),pe(o,r,null),_=!0},p(p,C){p[15]&&p[5].length>0?g?g.p(p,C):(g=An(p),g.c(),g.m(t,n)):g&&(g.d(1),g=null),(!_||C[0]&512)&&i.p(p[9]),p[18]?v?v.p(p,C):(v=On(p),v.c(),v.m(t,null)):v&&(v.d(1),v=null);const w={};!f&&C[0]&32&&(f=!0,w.searchResults=p[5],qe(()=>f=!1)),!d&&C[0]&8192&&(d=!0,w.showFullText=p[13],qe(()=>d=!1)),!m&&C[0]&16384&&(m=!0,w.useSearchResult=p[14],qe(()=>m=!1)),!c&&C[0]&32768&&(c=!0,w.enableSearchResultSelection=p[15],qe(()=>c=!1)),o.$set(w)},i(p){_||(I(o.$$.fragment,p),_=!0)},o(p){N(o.$$.fragment,p),_=!1},d(p){p&&(b(e),b(a),b(r)),g&&g.d(),v&&v.d(),Ee(o)}}}function hi(l){let e,t,n,u,i,s,a;function r(c){l[39](c)}function o(c){l[40](c)}function f(c){l[41](c)}function d(c){l[42](c)}let m={};return l[5]!==void 0&&(m.searchResults=l[5]),l[13]!==void 0&&(m.showFullText=l[13]),l[14]!==void 0&&(m.useSearchResult=l[14]),l[15]!==void 0&&(m.enableSearchResultSelection=l[15]),t=new Zn({props:m}),Ae.push(()=>He(t,"searchResults",r)),Ae.push(()=>He(t,"showFullText",o)),Ae.push(()=>He(t,"useSearchResult",f)),Ae.push(()=>He(t,"enableSearchResultSelection",d)),{c(){e=T("div"),ve(t.$$.fragment),this.h()},l(c){e=P(c,"DIV",{class:!0});var _=F(e);ke(t.$$.fragment,_),_.forEach(b),this.h()},h(){h(e,"class","search-column svelte-1cldj37")},m(c,_){O(c,e,_),pe(t,e,null),a=!0},p(c,_){const g={};!n&&_[0]&32&&(n=!0,g.searchResults=c[5],qe(()=>n=!1)),!u&&_[0]&8192&&(u=!0,g.showFullText=c[13],qe(()=>u=!1)),!i&&_[0]&16384&&(i=!0,g.useSearchResult=c[14],qe(()=>i=!1)),!s&&_[0]&32768&&(s=!0,g.enableSearchResultSelection=c[15],qe(()=>s=!1)),t.$set(g)},i(c){a||(I(t.$$.fragment,c),a=!0)},o(c){N(t.$$.fragment,c),a=!1},d(c){c&&b(e),Ee(t)}}}function Bn(l){let e,t="Получить ответ",n,u;return{c(){e=T("button"),e.textContent=t,this.h()},l(i){e=P(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-117yy5h"&&(e.textContent=t),this.h()},h(){h(e,"class","btn variant-filled")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[28]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function In(l){let e,t;return{c(){e=new mt(!1),t=Se(),this.h()},l(n){e=gt(n,!1),t=Se(),this.h()},h(){e.a=t},m(n,u){e.m(l[9],n,u),O(n,t,u)},p(n,u){u[0]&512&&e.p(n[9])},d(n){n&&(b(t),e.d())}}}function Fn(l){let e,t,n="Оцените ответ:",u,i,s="👍",a,r,o="👎",f,d,m,c;return{c(){e=T("div"),t=T("span"),t.textContent=n,u=J(),i=T("button"),i.textContent=s,a=J(),r=T("button"),r.textContent=o,f=J(),d=T("textarea"),this.h()},l(_){e=P(_,"DIV",{});var g=F(e);t=P(g,"SPAN",{"data-svelte-h":!0}),Re(t)!=="svelte-9pssby"&&(t.textContent=n),u=Q(g),i=P(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(i)!=="svelte-1hnmipt"&&(i.textContent=s),a=Q(g),r=P(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(r)!=="svelte-12wf95"&&(r.textContent=o),f=Q(g),d=P(g,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(d).forEach(b),g.forEach(b),this.h()},h(){h(i,"class","btn-icon"),h(r,"class","btn-icon"),h(d,"rows","3"),h(d,"placeholder","Комментарий"),h(d,"class","svelte-1cldj37")},m(_,g){O(_,e,g),z(e,t),z(e,u),z(e,i),z(e,a),z(e,r),z(e,f),z(e,d),dt(d,l[17]),m||(c=[G(i,"click",l[29]),G(r,"click",l[30]),G(d,"input",l[43]),G(d,"input",l[24])],m=!0)},p(_,g){g[0]&131072&&dt(d,_[17])},d(_){_&&b(e),m=!1,it(c)}}}function mi(l){let e,t,n,u,i,s=l[15]&&l[5].length>0&&Bn(l),a=(!l[16]&&!l[7]||l[16]&&l[9])&&In(l),r=l[18]&&Fn(l);return{c(){e=T("div"),t=T("div"),s&&s.c(),n=J(),u=T("div"),a&&a.c(),i=J(),r&&r.c(),this.h()},l(o){e=P(o,"DIV",{class:!0});var f=F(e);t=P(f,"DIV",{class:!0});var d=F(t);s&&s.l(d),n=Q(d),u=P(d,"DIV",{class:!0});var m=F(u);a&&a.l(m),m.forEach(b),i=Q(d),r&&r.l(d),d.forEach(b),f.forEach(b),this.h()},h(){h(u,"class","textarea svelte-1cldj37"),h(t,"class","textarea svelte-1cldj37"),h(e,"class","textarea-column svelte-1cldj37")},m(o,f){O(o,e,f),z(e,t),s&&s.m(t,null),z(t,n),z(t,u),a&&a.m(u,null),z(t,i),r&&r.m(t,null)},p(o,f){o[15]&&o[5].length>0?s?s.p(o,f):(s=Bn(o),s.c(),s.m(t,n)):s&&(s.d(1),s=null),!o[16]&&!o[7]||o[16]&&o[9]?a?a.p(o,f):(a=In(o),a.c(),a.m(u,null)):a&&(a.d(1),a=null),o[18]?r?r.p(o,f):(r=Fn(o),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(o){o&&b(e),s&&s.d(),a&&a.d(),r&&r.d()}}}function gi(l){let e,t,n,u;return e=new Ht({props:{minSize:20,class:"search-column",size:49,$$slots:{default:[hi]},$$scope:{ctx:l}}}),n=new Ht({props:{size:l[10],$$slots:{default:[mi]},$$scope:{ctx:l}}}),{c(){ve(e.$$.fragment),t=J(),ve(n.$$.fragment)},l(i){ke(e.$$.fragment,i),t=Q(i),ke(n.$$.fragment,i)},m(i,s){pe(e,i,s),O(i,t,s),pe(n,i,s),u=!0},p(i,s){const a={};s[0]&57376|s[1]&4194304&&(a.$$scope={dirty:s,ctx:i}),e.$set(a);const r={};s[0]&1024&&(r.size=i[10]),s[0]&492192|s[1]&4194304&&(r.$$scope={dirty:s,ctx:i}),n.$set(r)},i(i){u||(I(e.$$.fragment,i),I(n.$$.fragment,i),u=!0)},o(i){N(e.$$.fragment,i),N(n.$$.fragment,i),u=!1},d(i){i&&b(t),Ee(e,i),Ee(n,i)}}}function An(l){let e,t="Получить ответ",n,u;return{c(){e=T("button"),e.textContent=t,this.h()},l(i){e=P(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(e)!=="svelte-3pb36x"&&(e.textContent=t),this.h()},h(){h(e,"class","btn variant-filled")},m(i,s){O(i,e,s),n||(u=G(e,"click",l[28]),n=!0)},p:se,d(i){i&&b(e),n=!1,u()}}}function On(l){let e,t,n="Оцените ответ:",u,i,s="👍",a,r,o="👎",f,d,m,c;return{c(){e=T("div"),t=T("span"),t.textContent=n,u=J(),i=T("button"),i.textContent=s,a=J(),r=T("button"),r.textContent=o,f=J(),d=T("textarea"),this.h()},l(_){e=P(_,"DIV",{});var g=F(e);t=P(g,"SPAN",{"data-svelte-h":!0}),Re(t)!=="svelte-9pssby"&&(t.textContent=n),u=Q(g),i=P(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(i)!=="svelte-1hnmipt"&&(i.textContent=s),a=Q(g),r=P(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Re(r)!=="svelte-12wf95"&&(r.textContent=o),f=Q(g),d=P(g,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),F(d).forEach(b),g.forEach(b),this.h()},h(){h(i,"class","btn-icon"),h(r,"class","btn-icon"),h(d,"rows","3"),h(d,"placeholder","Комментарий"),h(d,"class","svelte-1cldj37")},m(_,g){O(_,e,g),z(e,t),z(e,u),z(e,i),z(e,a),z(e,r),z(e,f),z(e,d),dt(d,l[17]),m||(c=[G(i,"click",l[29]),G(r,"click",l[30]),G(d,"input",l[34]),G(d,"input",l[24])],m=!0)},p(_,g){g[0]&131072&&dt(d,_[17])},d(_){_&&b(e),m=!1,it(c)}}}function _i(l){let e,t,n,u,i,s,a,r,o,f,d,m=l[1],c,_=l[2],g,v,y,S,k,M="Отправить",j,p,C,w,D,$,B,ue,le,ee,Z,ge,de,Pe,W,Ie,X,V,st;n=new qu({});let Ce=Cn(l),be=yn(l),A=l[11]&&Dn(l),he=l[7]&&zn(l);function vt(q){l[32](q)}let at={name:"slider-label",size:"sm",$$slots:{default:[oi]},$$scope:{ctx:l}};l[15]!==void 0&&(at.checked=l[15]),$=new Ft({props:at}),Ae.push(()=>He($,"checked",vt));function ot(q){l[33](q)}let _t={name:"slider-label",size:"sm",$$slots:{default:[ci]},$$scope:{ctx:l}};l[16]!==void 0&&(_t.checked=l[16]),ee=new Ft({props:_t}),Ae.push(()=>He(ee,"checked",ot));let re=(l[6]||l[7])&&Tn(l),ie=l[3]&&Pn(l),ye=l[19]&&wn(),me=l[8]&&l[5].length>0&&Rn(l);return{c(){e=T("meta"),t=J(),ve(n.$$.fragment),u=J(),i=T("section"),s=T("div"),a=T("div"),r=T("textarea"),o=J(),f=T("div"),d=T("div"),Ce.c(),c=J(),be.c(),g=J(),v=T("div"),A&&A.c(),y=J(),he&&he.c(),S=J(),k=T("button"),k.textContent=M,j=J(),p=T("div"),C=T("div"),w=J(),D=T("div"),ve($.$$.fragment),ue=J(),le=T("div"),ve(ee.$$.fragment),ge=J(),de=T("div"),re&&re.c(),Pe=J(),ie&&ie.c(),W=J(),ye&&ye.c(),Ie=J(),me&&me.c(),this.h()},l(q){const R=sl("svelte-1wpbm1r",document.head);e=P(R,"META",{name:!0,content:!0}),R.forEach(b),t=Q(q),ke(n.$$.fragment,q),u=Q(q),i=P(q,"SECTION",{});var ne=F(i);s=P(ne,"DIV",{class:!0});var De=F(s);a=P(De,"DIV",{class:!0});var We=F(a);r=P(We,"TEXTAREA",{class:!0,rows:!0,placeholder:!0}),F(r).forEach(b),We.forEach(b),o=Q(De),f=P(De,"DIV",{class:!0});var Fe=F(f);d=P(Fe,"DIV",{class:!0});var Ne=F(d);Ce.l(Ne),c=Q(Ne),be.l(Ne),Ne.forEach(b),g=Q(Fe),v=P(Fe,"DIV",{class:!0});var Qe=F(v);A&&A.l(Qe),y=Q(Qe),he&&he.l(Qe),S=Q(Qe),k=P(Qe,"BUTTON",{title:!0,class:!0,"data-svelte-h":!0}),Re(k)!=="svelte-w5ppob"&&(k.textContent=M),Qe.forEach(b),j=Q(Fe),p=P(Fe,"DIV",{class:!0,style:!0});var ct=F(p);C=P(ct,"DIV",{}),F(C).forEach(b),w=Q(ct),D=P(ct,"DIV",{});var pt=F(D);ke($.$$.fragment,pt),pt.forEach(b),ue=Q(ct),le=P(ct,"DIV",{});var kt=F(le);ke(ee.$$.fragment,kt),kt.forEach(b),ct.forEach(b),ge=Q(Fe),de=P(Fe,"DIV",{class:!0});var Et=F(de);re&&re.l(Et),Et.forEach(b),Fe.forEach(b),Pe=Q(De),ie&&ie.l(De),De.forEach(b),W=Q(ne),ye&&ye.l(ne),Ie=Q(ne),me&&me.l(ne),ne.forEach(b),this.h()},h(){document.title="LLM demo app",h(e,"name","description"),h(e,"content","LLM demo app"),h(r,"class","auto-expand-textarea svelte-1cldj37"),h(r,"rows","1"),h(r,"placeholder","Введите ваш запрос..."),h(a,"class","grow-wrap w-full svelte-1cldj37"),h(d,"class","status-components svelte-1cldj37"),h(k,"title","Ctrl+Enter"),h(k,"class","btn variant-filled"),h(v,"class","flex space-x-2 items-center"),h(p,"class","card w-full flex p-2 space-x-2 my-2"),Ye(p,"align-items","center"),Ye(p,"flex-wrap","wrap"),h(de,"class","flex space-x-2 items-center w-full"),h(f,"class","search-second-bar w-full flex svelte-1cldj37"),h(s,"class","search-bar flex flex-wrap svelte-1cldj37")},m(q,R){z(document.head,e),O(q,t,R),pe(n,q,R),O(q,u,R),O(q,i,R),z(i,s),z(s,a),z(a,r),dt(r,l[11]),z(s,o),z(s,f),z(f,d),Ce.m(d,null),z(d,c),be.m(d,null),z(f,g),z(f,v),A&&A.m(v,null),z(v,y),he&&he.m(v,null),z(v,S),z(v,k),z(f,j),z(f,p),z(p,C),z(p,w),z(p,D),pe($,D,null),z(p,ue),z(p,le),pe(ee,le,null),z(f,ge),z(f,de),re&&re.m(de,null),z(s,Pe),ie&&ie.m(s,null),z(i,W),ye&&ye.m(i,null),z(i,Ie),me&&me.m(i,null),X=!0,V||(st=[G(r,"input",l[31]),G(r,"input",l[23]),G(r,"keydown",l[25]),G(k,"click",l[26])],V=!0)},p(q,R){R[0]&2048&&dt(r,q[11]),R[0]&2&&Be(m,m=q[1])?(ze(),N(Ce,1,1,se),Te(),Ce=Cn(q),Ce.c(),I(Ce,1),Ce.m(d,c)):Ce.p(q,R),R[0]&4&&Be(_,_=q[2])?(ze(),N(be,1,1,se),Te(),be=yn(q),be.c(),I(be,1),be.m(d,null)):be.p(q,R),q[11]?A?A.p(q,R):(A=Dn(q),A.c(),A.m(v,y)):A&&(A.d(1),A=null),q[7]?he?he.p(q,R):(he=zn(q),he.c(),he.m(v,S)):he&&(he.d(1),he=null);const ne={};R[1]&4194304&&(ne.$$scope={dirty:R,ctx:q}),!B&&R[0]&32768&&(B=!0,ne.checked=q[15],qe(()=>B=!1)),$.$set(ne);const De={};R[1]&4194304&&(De.$$scope={dirty:R,ctx:q}),!Z&&R[0]&65536&&(Z=!0,De.checked=q[16],qe(()=>Z=!1)),ee.$set(De),q[6]||q[7]?re?(re.p(q,R),R[0]&192&&I(re,1)):(re=Tn(q),re.c(),I(re,1),re.m(de,null)):re&&(ze(),N(re,1,1,()=>{re=null}),Te()),q[3]?ie?(ie.p(q,R),R[0]&8&&I(ie,1)):(ie=Pn(q),ie.c(),I(ie,1),ie.m(s,null)):ie&&(ze(),N(ie,1,1,()=>{ie=null}),Te()),q[19]?ye||(ye=wn(),ye.c(),ye.m(i,Ie)):ye&&(ye.d(1),ye=null),q[8]&&q[5].length>0?me?(me.p(q,R),R[0]&288&&I(me,1)):(me=Rn(q),me.c(),I(me,1),me.m(i,null)):me&&(ze(),N(me,1,1,()=>{me=null}),Te())},i(q){X||(I(n.$$.fragment,q),I(Ce),I(be),I($.$$.fragment,q),I(ee.$$.fragment,q),I(re),I(ie),I(me),X=!0)},o(q){N(n.$$.fragment,q),N(Ce),N(be),N($.$$.fragment,q),N(ee.$$.fragment,q),N(re),N(ie),N(me),X=!1},d(q){q&&(b(t),b(u),b(i)),b(e),Ee(n,q),Ce.d(q),be.d(q),A&&A.d(),he&&he.d(),Ee($),Ee(ee),re&&re.d(),ie&&ie.d(),ye&&ye.d(),me&&me.d(),V=!1,it(st)}}}function Mn(l){return l.map(({title:e,text:t})=>`${e}
${t}`).join(`
`)}function bi(l,e,t){Zl();let n=!1;const u={message:"Спасибо за оценку!",timeout:5e3},i=Xn();Dt(()=>{t(0,n=window.innerWidth<=768)});let s="unknown",a="unknown",r=!1,o=`Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям.
Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы.
При ответе на вопрос ты используешь только такой формат ответа:
1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя.
2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя).
3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)."
4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту."
Вопрос: {{ВОПРОС}}
Источники: {{ИСТОЧНИКИ}}`;function f(R){t(4,o=R)}function d(){t(3,r=!1)}async function m(){try{const R=await fetch(`${window.location.origin}/llm/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!R.ok)throw new Error(`Failed to fetch Llama health status: ${R.statusText}`);const ne=await R.json();t(1,s=ne.status)}catch(R){console.error("Error fetching Llama health status:",R.message)}try{const R=await fetch(`${window.location.origin}/search/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!R.ok)throw new Error(`Failed to fetch search health status: ${R.statusText}`);const ne=await R.json();t(2,a=ne.status)}catch(R){console.error("Error fetching search health status:",R.message)}}Dt(async()=>{m()}),Ot(()=>{W()});let c=[],_=!1,g=!1,v=!1,y="",S=0,k="",M="",j=Array(c.length).fill(!1),p,C=!1,w=!1,D="",$=!1,B=!1;const ue=async R=>{t(9,y=""),t(6,_=!1),t(7,g=!1),t(8,v=!1),t(5,c=[]),t(11,k=""),t(18,$=!1),t(19,B=!1),W()},le=R=>{t(11,k=R.target.value);const ne=R.target.parentNode;ne&&(ne.dataset.replicatedValue=k)},ee=R=>{t(17,D=R.target.value);const ne=R.target.parentNode;ne&&(ne.dataset.replicatedValue=k)},Z=R=>{R.ctrlKey&&R.key==="Enter"&&(R.preventDefault(),Pe())},ge=async()=>{let R="";if(C){if(R=Mn(c.filter((We,Fe)=>p[We.title])),!R){t(9,y="Выберите хотя бы один документ из результатов поиска.");return}}else{const We=c.slice(0,10);R=Mn(We)}let ne=o.replace("{{ВОПРОС}}",k).replace("{{ИСТОЧНИКИ}}",R);t(7,g=!0),t(12,M="Генерируем ответ на основе результатов поиска");const De=await fetch("/llm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userprompt:ne}),signal:de.signal});try{if(de.signal.aborted){console.log("Request was cancelled.");return}if(!De.body){console.log("Response has no body");return}const We=De.body.pipeThrough(new TextDecoderStream).getReader();let Fe=!0;for(;Fe;)try{if(de.signal.aborted){console.log("Request was cancelled during reading.");break}const{value:Ne,done:Qe}=await We.read();if(Qe){Fe=!1;break}Ne&&t(9,y+=Ne.replaceAll(`
`,"<br>"))}catch(Ne){if(t(12,M="Ошибка генерации ответа"),Ne.name==="AbortError"){Fe=!1,console.log("Fetch was aborted during reading.");break}else{Fe=!1,console.error("Error during reading:",Ne);break}}t(12,M=""),t(7,g=!1),t(18,$=!0)}catch(We){We.name==="AbortError"?console.log("Fetch was aborted."):console.error("Error during fetch:",We)}};let de=new AbortController;const Pe=async R=>{t(13,j=Array(10).fill(!1)),t(14,p={}),t(9,y=""),t(18,$=!1),t(6,_=!0),t(7,g=!1),t(8,v=!0),t(19,B=!1),t(12,M="Ищем релевантные документы");try{const ne=await fetch("/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:k})});if(!ne.ok)throw new Error(`Failed to fetch search results: ${ne.statusText}`);const De=await ne.json();t(5,c=Xe.sortByRelevance(De.results)),t(5,c=Xe.identifyDocumentType(c)),console.log(c)}catch{}t(12,M=""),t(6,_=!1),t(10,S=49),console.log(c),c&&c.length>0?(console.log("1"),C||await ge()):(console.log("2"),t(19,B=!0))},W=()=>{de.abort("user canceled"),de=new AbortController};async function Ie(){t(9,y=""),await W(),setTimeout(async()=>{await ge()},1e3)}async function X(){await st({userScore:"positive"}),i.trigger(u),t(17,D="")}async function V(){await st({userScore:"negative"}),i.trigger(u),t(17,D="")}async function st(R){try{const ne=await fetch("/log/response",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_query:k,prompt_template:o,search_results:c,llm_response:y.replaceAll("<br>",`
`),user_score:R.userScore,user_comment:D})});if(!ne.ok)throw new Error(`Failed to fetch search results: ${ne.statusText}`);if((await ne.json()).success)return!0}catch{}return!1}function Ce(){k=this.value,t(11,k)}function be(R){C=R,t(15,C)}function A(R){w=R,t(16,w)}function he(){D=this.value,t(17,D)}function vt(R){c=R,t(5,c)}function at(R){j=R,t(13,j)}function ot(R){p=R,t(14,p)}function _t(R){C=R,t(15,C)}function re(R){c=R,t(5,c)}function ie(R){j=R,t(13,j)}function ye(R){p=R,t(14,p)}function me(R){C=R,t(15,C)}function q(){D=this.value,t(17,D)}return[n,s,a,r,o,c,_,g,v,y,S,k,M,j,p,C,w,D,$,B,f,d,ue,le,ee,Z,Pe,W,Ie,X,V,Ce,be,A,he,vt,at,ot,_t,re,ie,ye,me,q]}class Si extends Le{constructor(e){super(),Ve(this,e,bi,_i,Be,{},null,[-1,-1])}}export{Si as component,Ei as universal};