import{S as D,i as E,s as N,e as _,m as k,a as r,R as p,b as m,g as d,f as y,h as j,j as b,o as L,t as M,q as x,u as R,v as W,x as g,y as w,z as F,k as G,A as H,B as I,C as J}from"./index.65fb5956.js";function C(s,e,n){const t=s.slice();return t[3]=e[n],t[5]=n,t}function q(s,e,n){const t=s.slice();return t[3]=e[n],t}function S(s){let e,n,t,i,a=s[0].confidences,l=[];for(let o=0;o<a.length;o+=1)l[o]=z(q(s,a,o));let f=s[0].confidences,u=[];for(let o=0;o<f.length;o+=1)u[o]=A(C(s,f,o));return{c(){e=_("div"),n=_("div");for(let o=0;o<l.length;o+=1)l[o].c();t=k(),i=_("div");for(let o=0;o<u.length;o+=1)u[o].c();r(n,"class","labels mr-2 svelte-1be4tjy"),p(n,"maxWidth","120px"),r(i,"class","confidences flex flex-grow flex-col items-baseline svelte-1be4tjy"),r(e,"class","confidence-intervals flex text-xl svelte-1be4tjy")},m(o,h){m(o,e,h),d(e,n);for(let c=0;c<l.length;c+=1)l[c].m(n,null);d(e,t),d(e,i);for(let c=0;c<u.length;c+=1)u[c].m(i,null)},p(o,h){if(h&1){a=o[0].confidences;let c;for(c=0;c<a.length;c+=1){const v=q(o,a,c);l[c]?l[c].p(v,h):(l[c]=z(v),l[c].c(),l[c].m(n,null))}for(;c<l.length;c+=1)l[c].d(1);l.length=a.length}if(h&1){f=o[0].confidences;let c;for(c=0;c<f.length;c+=1){const v=C(o,f,c);u[c]?u[c].p(v,h):(u[c]=A(v),u[c].c(),u[c].m(i,null))}for(;c<u.length;c+=1)u[c].d(1);u.length=f.length}},d(o){o&&b(e),L(l,o),L(u,o)}}}function z(s){let e,n=s[3].label+"",t,i,a;return{c(){e=_("div"),t=y(n),i=k(),r(e,"class","label overflow-hidden whitespace-nowrap h-7 mb-2 overflow-ellipsis text-right svelte-1be4tjy"),r(e,"title",a=s[3].label)},m(l,f){m(l,e,f),d(e,t),d(e,i)},p(l,f){f&1&&n!==(n=l[3].label+"")&&j(t,n),f&1&&a!==(a=l[3].label)&&r(e,"title",a)},d(l){l&&b(e)}}}function A(s){let e,n=Math.round(s[3].confidence*100)+"",t,i;return{c(){e=_("div"),t=y(n),i=y(`%
					`),r(e,"class","confidence flex justify-end items-center overflow-hidden whitespace-nowrap h-7 mb-2 px-1 svelte-1be4tjy"),p(e,"min-width","calc( "+Math.round(s[3].confidence*100)+"% - 12px)")},m(a,l){m(a,e,l),d(e,t),d(e,i)},p(a,l){l&1&&n!==(n=Math.round(a[3].confidence*100)+"")&&j(t,n),l&1&&p(e,"min-width","calc( "+Math.round(a[3].confidence*100)+"% - 12px)")},d(a){a&&b(e)}}}function K(s){let e,n,t=s[0].label+"",i,a,l=s[0].confidences&&S(s);return{c(){e=_("div"),n=_("div"),i=y(t),a=k(),l&&l.c(),r(n,"class","output-class font-bold text-2xl py-6 px-4 flex-grow flex items-center justify-center svelte-1be4tjy"),M(n,"no-confidence",!("confidences"in s[0])),r(e,"class","output-label svelte-1be4tjy"),r(e,"theme",s[1])},m(f,u){m(f,e,u),d(e,n),d(n,i),d(e,a),l&&l.m(e,null)},p(f,[u]){u&1&&t!==(t=f[0].label+"")&&j(i,t),u&1&&M(n,"no-confidence",!("confidences"in f[0])),f[0].confidences?l?l.p(f,u):(l=S(f),l.c(),l.m(e,null)):l&&(l.d(1),l=null),u&2&&r(e,"theme",f[1])},i:x,o:x,d(f){f&&b(e),l&&l.d()}}}function O(s,e,n){let{value:t}=e,{style:i=""}=e,{theme:a="default"}=e;return s.$$set=l=>{"value"in l&&n(0,t=l.value),"style"in l&&n(2,i=l.style),"theme"in l&&n(1,a=l.theme)},[t,a,i]}class P extends D{constructor(e){super(),E(this,e,O,K,N,{value:0,style:2,theme:1})}}function B(s){let e,n;return e=new P({props:{style:s[1],value:s[0]}}),{c(){R(e.$$.fragment)},m(t,i){W(e,t,i),n=!0},p(t,i){const a={};i&2&&(a.style=t[1]),i&1&&(a.value=t[0]),e.$set(a)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){w(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function Q(s){let e,n,t=s[0]!==void 0&&s[0]!==null&&B(s);return{c(){t&&t.c(),e=G()},m(i,a){t&&t.m(i,a),m(i,e,a),n=!0},p(i,[a]){i[0]!==void 0&&i[0]!==null?t?(t.p(i,a),a&1&&g(t,1)):(t=B(i),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(H(),w(t,1,1,()=>{t=null}),I())},i(i){n||(g(t),n=!0)},o(i){w(t),n=!1},d(i){t&&t.d(i),i&&b(e)}}}function T(s,e,n){let{value:t}=e,{default_value:i}=e,{style:a=""}=e;const l=J();return i&&(t=i),s.$$set=f=>{"value"in f&&n(0,t=f.value),"default_value"in f&&n(2,i=f.default_value),"style"in f&&n(1,a=f.style)},s.$$.update=()=>{s.$$.dirty&1&&l("change")},[t,a,i]}class U extends D{constructor(e){super(),E(this,e,T,Q,N,{value:0,default_value:2,style:1})}}var X=U;const Y=["static"];export{X as Component,Y as modes};
