import{S as T,i as A,s as F,j as G,b as _,e as m,k as h,d as p,a as r,R as B,f as u,g as y,h as v,m as H,t as C,n as M,o as w,q as S,u as g,v as k,w as j,z as I,x as J,y as K}from"./index.3c784113.js";import{B as O}from"./Block.1239058b.js";import{S as P}from"./StatusTracker.eec9373b.js";function N(f,l,a){const e=f.slice();return e[3]=l[a],e}function z(f){let l,a=f[0].confidences,e=[];for(let n=0;n<a.length;n+=1)e[n]=E(N(f,a,n));return{c(){for(let n=0;n<e.length;n+=1)e[n].c();l=G()},m(n,s){for(let t=0;t<e.length;t+=1)e[t].m(n,s);_(n,l,s)},p(n,s){if(s&1){a=n[0].confidences;let t;for(t=0;t<a.length;t+=1){const i=N(n,a,t);e[t]?e[t].p(i,s):(e[t]=E(i),e[t].c(),e[t].m(l.parentNode,l))}for(;t<e.length;t+=1)e[t].d(1);e.length=a.length}},d(n){H(e,n),n&&v(l)}}}function D(f){let l,a,e,n=Math.round(f[3].confidence*100)+"",s,t;return{c(){l=m("div"),a=h(),e=m("div"),s=p(n),t=p("%"),r(l,"class","flex-1 border border-dashed border-gray-100 px-4"),r(e,"class","text-right ml-auto")},m(i,o){_(i,l,o),_(i,a,o),_(i,e,o),u(e,s),u(e,t)},p(i,o){o&1&&n!==(n=Math.round(i[3].confidence*100)+"")&&y(s,n)},d(i){i&&v(l),i&&v(a),i&&v(e)}}}function E(f){let l,a,e,n,s,t,i=f[3].label+"",o,L,q,c=f[0].confidences&&D(f);return{c(){l=m("div"),a=m("div"),e=m("div"),n=h(),s=m("div"),t=m("div"),o=p(i),L=h(),c&&c.c(),q=h(),r(e,"class","h-1 mb-1 rounded bg-gradient-to-r group-hover:from-orange-500 from-orange-400 to-orange-200 dark:from-orange-400 dark:to-orange-600"),B(e,"width",f[3].confidence*100+"%"),r(t,"class","leading-snug"),r(s,"class","flex items-baseline space-x-2 group-hover:text-orange-500"),r(a,"class","flex-1"),r(l,"class","flex items-start justify-between font-mono text-sm leading-none group")},m(d,b){_(d,l,b),u(l,a),u(a,e),u(a,n),u(a,s),u(s,t),u(t,o),u(s,L),c&&c.m(s,null),u(l,q)},p(d,b){b&1&&B(e,"width",d[3].confidence*100+"%"),b&1&&i!==(i=d[3].label+"")&&y(o,i),d[0].confidences?c?c.p(d,b):(c=D(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&v(l),c&&c.d()}}}function Q(f){let l,a,e=f[0].label+"",n,s,t=f[0].confidences&&z(f);return{c(){l=m("div"),a=m("div"),n=p(e),s=h(),t&&t.c(),r(a,"class","output-class font-bold text-2xl py-6 px-4 flex-grow flex items-center justify-center"),C(a,"no-confidence",!("confidences"in f[0])),r(l,"class","output-label"),r(l,"space-y-4",""),r(l,"theme",f[1])},m(i,o){_(i,l,o),u(l,a),u(a,n),u(l,s),t&&t.m(l,null)},p(i,[o]){o&1&&e!==(e=i[0].label+"")&&y(n,e),o&1&&C(a,"no-confidence",!("confidences"in i[0])),i[0].confidences?t?t.p(i,o):(t=z(i),t.c(),t.m(l,null)):t&&(t.d(1),t=null),o&2&&r(l,"theme",i[1])},i:M,o:M,d(i){i&&v(l),t&&t.d()}}}function U(f,l,a){let{value:e}=l,{style:n=""}=l,{theme:s="default"}=l;return f.$$set=t=>{"value"in t&&a(0,e=t.value),"style"in t&&a(2,n=t.style),"theme"in t&&a(1,s=t.theme)},[e,s,n]}class V extends T{constructor(l){super(),A(this,l,U,Q,F,{value:0,style:2,theme:1})}}function R(f){let l,a;return l=new V({props:{style:f[1],value:f[0]}}),{c(){w(l.$$.fragment)},m(e,n){S(l,e,n),a=!0},p(e,n){const s={};n&2&&(s.style=e[1]),n&1&&(s.value=e[0]),l.$set(s)},i(e){a||(g(l.$$.fragment,e),a=!0)},o(e){k(l.$$.fragment,e),a=!1},d(e){j(l,e)}}}function W(f){let l,a,e,n;l=new P({props:{tracked_status:f[2]}});let s=f[0]!==void 0&&f[0]!==null&&R(f);return{c(){w(l.$$.fragment),a=h(),s&&s.c(),e=G()},m(t,i){S(l,t,i),_(t,a,i),s&&s.m(t,i),_(t,e,i),n=!0},p(t,i){const o={};i&4&&(o.tracked_status=t[2]),l.$set(o),t[0]!==void 0&&t[0]!==null?s?(s.p(t,i),i&1&&g(s,1)):(s=R(t),s.c(),g(s,1),s.m(e.parentNode,e)):s&&(J(),k(s,1,1,()=>{s=null}),K())},i(t){n||(g(l.$$.fragment,t),g(s),n=!0)},o(t){k(l.$$.fragment,t),k(s),n=!1},d(t){j(l,t),t&&v(a),s&&s.d(t),t&&v(e)}}}function X(f){let l,a;return l=new O({props:{$$slots:{default:[W]},$$scope:{ctx:f}}}),{c(){w(l.$$.fragment)},m(e,n){S(l,e,n),a=!0},p(e,[n]){const s={};n&39&&(s.$$scope={dirty:n,ctx:e}),l.$set(s)},i(e){a||(g(l.$$.fragment,e),a=!0)},o(e){k(l.$$.fragment,e),a=!1},d(e){j(l,e)}}}function Y(f,l,a){let{value:e}=l,{default_value:n}=l,{style:s=""}=l,{loading_status:t}=l;const i=I();return n&&(e=n),f.$$set=o=>{"value"in o&&a(0,e=o.value),"default_value"in o&&a(3,n=o.default_value),"style"in o&&a(1,s=o.style),"loading_status"in o&&a(2,t=o.loading_status)},f.$$.update=()=>{f.$$.dirty&1&&i("change")},[e,s,t,n]}class Z extends T{constructor(l){super(),A(this,l,Y,X,F,{value:0,default_value:3,style:1,loading_status:2})}}var te=Z;const le=["static"];export{te as Component,le as modes};
