diff --git "a/src/backend/gradio_image_annotation/templates/component/index.js" "b/src/backend/gradio_image_annotation/templates/component/index.js" --- "a/src/backend/gradio_image_annotation/templates/component/index.js" +++ "b/src/backend/gradio_image_annotation/templates/component/index.js" @@ -1,28 +1,28 @@ const { - SvelteComponent: _r, - assign: dr, - create_slot: hr, - detach: mr, - element: gr, - get_all_dirty_from_scope: br, - get_slot_changes: wr, - get_spread_update: pr, - init: vr, - insert: kr, - safe_not_equal: yr, - set_dynamic_element_data: _o, - set_style: De, - toggle_class: Qe, - transition_in: na, - transition_out: la, - update_slot_base: Cr + SvelteComponent: mr, + assign: gr, + create_slot: br, + detach: wr, + element: pr, + get_all_dirty_from_scope: vr, + get_slot_changes: kr, + get_spread_update: yr, + init: Cr, + insert: Sr, + safe_not_equal: zr, + set_dynamic_element_data: go, + set_style: Ae, + toggle_class: xe, + transition_in: oa, + transition_out: sa, + update_slot_base: Br } = window.__gradio__svelte__internal; -function Sr(l) { +function qr(l) { let e, t, n; const i = ( /*#slots*/ l[18].default - ), o = hr( + ), o = br( i, l, /*$$scope*/ @@ -44,38 +44,38 @@ function Sr(l) { } ], r = {}; for (let a = 0; a < s.length; a += 1) - r = dr(r, s[a]); + r = gr(r, s[a]); return { c() { - e = gr( + e = pr( /*tag*/ l[14] - ), o && o.c(), _o( + ), o && o.c(), go( /*tag*/ l[14] - )(e, r), Qe( + )(e, r), xe( e, "hidden", /*visible*/ l[10] === !1 - ), Qe( + ), xe( e, "padded", /*padding*/ l[6] - ), Qe( + ), xe( e, "border_focus", /*border_mode*/ l[5] === "focus" - ), Qe( + ), xe( e, "border_contrast", /*border_mode*/ l[5] === "contrast" - ), Qe(e, "hide-container", !/*explicit_call*/ + ), xe(e, "hide-container", !/*explicit_call*/ l[8] && !/*container*/ - l[9]), De( + l[9]), Ae( e, "height", /*get_dimension*/ @@ -83,7 +83,7 @@ function Sr(l) { /*height*/ l[0] ) - ), De(e, "width", typeof /*width*/ + ), Ae(e, "width", typeof /*width*/ l[1] == "number" ? `calc(min(${/*width*/ l[1]}px, 100%))` : ( /*get_dimension*/ @@ -91,50 +91,50 @@ function Sr(l) { /*width*/ l[1] ) - )), De( + )), Ae( e, "border-style", /*variant*/ l[4] - ), De( + ), Ae( e, "overflow", /*allow_overflow*/ l[11] ? "visible" : "hidden" - ), De( + ), Ae( e, "flex-grow", /*scale*/ l[12] - ), De(e, "min-width", `calc(min(${/*min_width*/ - l[13]}px, 100%))`), De(e, "border-width", "var(--block-border-width)"); + ), Ae(e, "min-width", `calc(min(${/*min_width*/ + l[13]}px, 100%))`), Ae(e, "border-width", "var(--block-border-width)"); }, m(a, f) { - kr(a, e, f), o && o.m(e, null), n = !0; + Sr(a, e, f), o && o.m(e, null), n = !0; }, p(a, f) { o && o.p && (!n || f & /*$$scope*/ - 131072) && Cr( + 131072) && Br( o, i, a, /*$$scope*/ a[17], - n ? wr( + n ? kr( i, /*$$scope*/ a[17], f, null - ) : br( + ) : vr( /*$$scope*/ a[17] ), null - ), _o( + ), go( /*tag*/ a[14] - )(e, r = pr(s, [ + )(e, r = yr(s, [ (!n || f & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -148,30 +148,30 @@ function Sr(l) { (!n || f & /*elem_classes*/ 8 && t !== (t = "block " + /*elem_classes*/ a[3].join(" ") + " svelte-nl1om8")) && { class: t } - ])), Qe( + ])), xe( e, "hidden", /*visible*/ a[10] === !1 - ), Qe( + ), xe( e, "padded", /*padding*/ a[6] - ), Qe( + ), xe( e, "border_focus", /*border_mode*/ a[5] === "focus" - ), Qe( + ), xe( e, "border_contrast", /*border_mode*/ a[5] === "contrast" - ), Qe(e, "hide-container", !/*explicit_call*/ + ), xe(e, "hide-container", !/*explicit_call*/ a[8] && !/*container*/ a[9]), f & /*height*/ - 1 && De( + 1 && Ae( e, "height", /*get_dimension*/ @@ -180,7 +180,7 @@ function Sr(l) { a[0] ) ), f & /*width*/ - 2 && De(e, "width", typeof /*width*/ + 2 && Ae(e, "width", typeof /*width*/ a[1] == "number" ? `calc(min(${/*width*/ a[1]}px, 100%))` : ( /*get_dimension*/ @@ -189,42 +189,42 @@ function Sr(l) { a[1] ) )), f & /*variant*/ - 16 && De( + 16 && Ae( e, "border-style", /*variant*/ a[4] ), f & /*allow_overflow*/ - 2048 && De( + 2048 && Ae( e, "overflow", /*allow_overflow*/ a[11] ? "visible" : "hidden" ), f & /*scale*/ - 4096 && De( + 4096 && Ae( e, "flex-grow", /*scale*/ a[12] ), f & /*min_width*/ - 8192 && De(e, "min-width", `calc(min(${/*min_width*/ + 8192 && Ae(e, "min-width", `calc(min(${/*min_width*/ a[13]}px, 100%))`); }, i(a) { - n || (na(o, a), n = !0); + n || (oa(o, a), n = !0); }, o(a) { - la(o, a), n = !1; + sa(o, a), n = !1; }, d(a) { - a && mr(e), o && o.d(a); + a && wr(e), o && o.d(a); } }; } -function zr(l) { +function Er(l) { let e, t = ( /*tag*/ - l[14] && Sr(l) + l[14] && qr(l) ); return { c() { @@ -238,28 +238,28 @@ function zr(l) { n[14] && t.p(n, i); }, i(n) { - e || (na(t, n), e = !0); + e || (oa(t, n), e = !0); }, o(n) { - la(t, n), e = !1; + sa(t, n), e = !1; }, d(n) { t && t.d(n); } }; } -function qr(l, e, t) { - let { $$slots: n = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: s = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: a = [] } = e, { variant: f = "solid" } = e, { border_mode: u = "base" } = e, { padding: c = !0 } = e, { type: _ = "normal" } = e, { test_id: d = void 0 } = e, { explicit_call: m = !1 } = e, { container: h = !0 } = e, { visible: p = !0 } = e, { allow_overflow: w = !0 } = e, { scale: b = null } = e, { min_width: g = 0 } = e, k = _ === "fieldset" ? "fieldset" : "div"; - const C = (v) => { - if (v !== void 0) { - if (typeof v == "number") - return v + "px"; - if (typeof v == "string") - return v; +function Mr(l, e, t) { + let { $$slots: n = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: s = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: a = [] } = e, { variant: f = "solid" } = e, { border_mode: u = "base" } = e, { padding: c = !0 } = e, { type: _ = "normal" } = e, { test_id: d = void 0 } = e, { explicit_call: h = !1 } = e, { container: m = !0 } = e, { visible: w = !0 } = e, { allow_overflow: b = !0 } = e, { scale: p = null } = e, { min_width: g = 0 } = e, v = _ === "fieldset" ? "fieldset" : "div"; + const E = (y) => { + if (y !== void 0) { + if (typeof y == "number") + return y + "px"; + if (typeof y == "string") + return y; } }; - return l.$$set = (v) => { - "height" in v && t(0, o = v.height), "width" in v && t(1, s = v.width), "elem_id" in v && t(2, r = v.elem_id), "elem_classes" in v && t(3, a = v.elem_classes), "variant" in v && t(4, f = v.variant), "border_mode" in v && t(5, u = v.border_mode), "padding" in v && t(6, c = v.padding), "type" in v && t(16, _ = v.type), "test_id" in v && t(7, d = v.test_id), "explicit_call" in v && t(8, m = v.explicit_call), "container" in v && t(9, h = v.container), "visible" in v && t(10, p = v.visible), "allow_overflow" in v && t(11, w = v.allow_overflow), "scale" in v && t(12, b = v.scale), "min_width" in v && t(13, g = v.min_width), "$$scope" in v && t(17, i = v.$$scope); + return l.$$set = (y) => { + "height" in y && t(0, o = y.height), "width" in y && t(1, s = y.width), "elem_id" in y && t(2, r = y.elem_id), "elem_classes" in y && t(3, a = y.elem_classes), "variant" in y && t(4, f = y.variant), "border_mode" in y && t(5, u = y.border_mode), "padding" in y && t(6, c = y.padding), "type" in y && t(16, _ = y.type), "test_id" in y && t(7, d = y.test_id), "explicit_call" in y && t(8, h = y.explicit_call), "container" in y && t(9, m = y.container), "visible" in y && t(10, w = y.visible), "allow_overflow" in y && t(11, b = y.allow_overflow), "scale" in y && t(12, p = y.scale), "min_width" in y && t(13, g = y.min_width), "$$scope" in y && t(17, i = y.$$scope); }, [ o, s, @@ -269,22 +269,22 @@ function qr(l, e, t) { u, c, d, - m, h, - p, + m, w, b, + p, g, - k, - C, + v, + E, _, i, n ]; } -class Br extends _r { +class Ar extends mr { constructor(e) { - super(), vr(this, e, qr, zr, yr, { + super(), Cr(this, e, Mr, Er, zr, { height: 0, width: 1, elem_id: 2, @@ -304,26 +304,26 @@ class Br extends _r { } } const { - SvelteComponent: Er, - attr: Mr, - create_slot: Ar, - detach: Lr, - element: Dr, - get_all_dirty_from_scope: Rr, - get_slot_changes: Tr, - init: Ir, - insert: jr, - safe_not_equal: Hr, - transition_in: Fr, - transition_out: Xr, - update_slot_base: Yr + SvelteComponent: Lr, + attr: Dr, + create_slot: Rr, + detach: Tr, + element: Ir, + get_all_dirty_from_scope: jr, + get_slot_changes: Hr, + init: Fr, + insert: Xr, + safe_not_equal: Yr, + transition_in: Nr, + transition_out: Ur, + update_slot_base: Or } = window.__gradio__svelte__internal; -function Nr(l) { +function Wr(l) { let e, t; const n = ( /*#slots*/ l[1].default - ), i = Ar( + ), i = Rr( n, l, /*$$scope*/ @@ -332,26 +332,26 @@ function Nr(l) { ); return { c() { - e = Dr("div"), i && i.c(), Mr(e, "class", "svelte-1hnfib2"); + e = Ir("div"), i && i.c(), Dr(e, "class", "svelte-1hnfib2"); }, m(o, s) { - jr(o, e, s), i && i.m(e, null), t = !0; + Xr(o, e, s), i && i.m(e, null), t = !0; }, p(o, [s]) { i && i.p && (!t || s & /*$$scope*/ - 1) && Yr( + 1) && Or( i, n, o, /*$$scope*/ o[0], - t ? Tr( + t ? Hr( n, /*$$scope*/ o[0], s, null - ) : Rr( + ) : jr( /*$$scope*/ o[0] ), @@ -359,65 +359,65 @@ function Nr(l) { ); }, i(o) { - t || (Fr(i, o), t = !0); + t || (Nr(i, o), t = !0); }, o(o) { - Xr(i, o), t = !1; + Ur(i, o), t = !1; }, d(o) { - o && Lr(e), i && i.d(o); + o && Tr(e), i && i.d(o); } }; } -function Ur(l, e, t) { +function Vr(l, e, t) { let { $$slots: n = {}, $$scope: i } = e; return l.$$set = (o) => { "$$scope" in o && t(0, i = o.$$scope); }, [i, n]; } -class Or extends Er { +class Pr extends Lr { constructor(e) { - super(), Ir(this, e, Ur, Nr, Hr, {}); + super(), Fr(this, e, Vr, Wr, Yr, {}); } } const { - SvelteComponent: Wr, - attr: ho, - check_outros: Vr, - create_component: Pr, - create_slot: Zr, - destroy_component: Kr, - detach: kl, - element: Gr, - empty: Jr, - get_all_dirty_from_scope: Qr, - get_slot_changes: xr, - group_outros: $r, - init: ef, - insert: yl, - mount_component: tf, - safe_not_equal: nf, - set_data: lf, - space: of, - text: sf, + SvelteComponent: Zr, + attr: bo, + check_outros: Kr, + create_component: Gr, + create_slot: Jr, + destroy_component: Qr, + detach: yl, + element: xr, + empty: $r, + get_all_dirty_from_scope: ef, + get_slot_changes: tf, + group_outros: nf, + init: lf, + insert: Cl, + mount_component: of, + safe_not_equal: sf, + set_data: af, + space: rf, + text: ff, toggle_class: nn, transition_in: An, - transition_out: Cl, - update_slot_base: af + transition_out: Sl, + update_slot_base: uf } = window.__gradio__svelte__internal; -function mo(l) { +function wo(l) { let e, t; - return e = new Or({ + return e = new Pr({ props: { - $$slots: { default: [rf] }, + $$slots: { default: [cf] }, $$scope: { ctx: l } } }), { c() { - Pr(e.$$.fragment); + Gr(e.$$.fragment); }, m(n, i) { - tf(e, n, i), t = !0; + of(e, n, i), t = !0; }, p(n, i) { const o = {}; @@ -428,44 +428,44 @@ function mo(l) { t || (An(e.$$.fragment, n), t = !0); }, o(n) { - Cl(e.$$.fragment, n), t = !1; + Sl(e.$$.fragment, n), t = !1; }, d(n) { - Kr(e, n); + Qr(e, n); } }; } -function rf(l) { +function cf(l) { let e; return { c() { - e = sf( + e = ff( /*info*/ l[1] ); }, m(t, n) { - yl(t, e, n); + Cl(t, e, n); }, p(t, n) { n & /*info*/ - 2 && lf( + 2 && af( e, /*info*/ t[1] ); }, d(t) { - t && kl(e); + t && yl(e); } }; } -function ff(l) { +function _f(l) { let e, t, n, i; const o = ( /*#slots*/ l[2].default - ), s = Zr( + ), s = Jr( o, l, /*$$scope*/ @@ -474,11 +474,11 @@ function ff(l) { ); let r = ( /*info*/ - l[1] && mo(l) + l[1] && wo(l) ); return { c() { - e = Gr("span"), s && s.c(), t = of(), r && r.c(), n = Jr(), ho(e, "data-testid", "block-info"), ho(e, "class", "svelte-22c38v"), nn(e, "sr-only", !/*show_label*/ + e = xr("span"), s && s.c(), t = rf(), r && r.c(), n = $r(), bo(e, "data-testid", "block-info"), bo(e, "class", "svelte-22c38v"), nn(e, "sr-only", !/*show_label*/ l[0]), nn(e, "hide", !/*show_label*/ l[0]), nn( e, @@ -488,23 +488,23 @@ function ff(l) { ); }, m(a, f) { - yl(a, e, f), s && s.m(e, null), yl(a, t, f), r && r.m(a, f), yl(a, n, f), i = !0; + Cl(a, e, f), s && s.m(e, null), Cl(a, t, f), r && r.m(a, f), Cl(a, n, f), i = !0; }, p(a, [f]) { s && s.p && (!i || f & /*$$scope*/ - 8) && af( + 8) && uf( s, o, a, /*$$scope*/ a[3], - i ? xr( + i ? tf( o, /*$$scope*/ a[3], f, null - ) : Qr( + ) : ef( /*$$scope*/ a[3] ), @@ -521,67 +521,67 @@ function ff(l) { a[1] != null ), /*info*/ a[1] ? r ? (r.p(a, f), f & /*info*/ - 2 && An(r, 1)) : (r = mo(a), r.c(), An(r, 1), r.m(n.parentNode, n)) : r && ($r(), Cl(r, 1, 1, () => { + 2 && An(r, 1)) : (r = wo(a), r.c(), An(r, 1), r.m(n.parentNode, n)) : r && (nf(), Sl(r, 1, 1, () => { r = null; - }), Vr()); + }), Kr()); }, i(a) { i || (An(s, a), An(r), i = !0); }, o(a) { - Cl(s, a), Cl(r), i = !1; + Sl(s, a), Sl(r), i = !1; }, d(a) { - a && (kl(e), kl(t), kl(n)), s && s.d(a), r && r.d(a); + a && (yl(e), yl(t), yl(n)), s && s.d(a), r && r.d(a); } }; } -function uf(l, e, t) { +function df(l, e, t) { let { $$slots: n = {}, $$scope: i } = e, { show_label: o = !0 } = e, { info: s = void 0 } = e; return l.$$set = (r) => { "show_label" in r && t(0, o = r.show_label), "info" in r && t(1, s = r.info), "$$scope" in r && t(3, i = r.$$scope); }, [o, s, n, i]; } -class ia extends Wr { +class aa extends Zr { constructor(e) { - super(), ef(this, e, uf, ff, nf, { show_label: 0, info: 1 }); + super(), lf(this, e, df, _f, sf, { show_label: 0, info: 1 }); } } const { - SvelteComponent: cf, - append: ti, + SvelteComponent: hf, + append: ii, attr: ol, - create_component: _f, - destroy_component: df, - detach: hf, - element: go, - init: mf, - insert: gf, - mount_component: bf, - safe_not_equal: wf, - set_data: pf, - space: vf, - text: kf, - toggle_class: wt, - transition_in: yf, - transition_out: Cf + create_component: mf, + destroy_component: gf, + detach: bf, + element: po, + init: wf, + insert: pf, + mount_component: vf, + safe_not_equal: kf, + set_data: yf, + space: Cf, + text: Sf, + toggle_class: pt, + transition_in: zf, + transition_out: Bf } = window.__gradio__svelte__internal; -function Sf(l) { +function qf(l) { let e, t, n, i, o, s; return n = new /*Icon*/ l[1]({}), { c() { - e = go("label"), t = go("span"), _f(n.$$.fragment), i = vf(), o = kf( + e = po("label"), t = po("span"), mf(n.$$.fragment), i = Cf(), o = Sf( /*label*/ l[0] - ), ol(t, "class", "svelte-9gxdi0"), ol(e, "for", ""), ol(e, "data-testid", "block-label"), ol(e, "class", "svelte-9gxdi0"), wt(e, "hide", !/*show_label*/ - l[2]), wt(e, "sr-only", !/*show_label*/ - l[2]), wt( + ), ol(t, "class", "svelte-9gxdi0"), ol(e, "for", ""), ol(e, "data-testid", "block-label"), ol(e, "class", "svelte-9gxdi0"), pt(e, "hide", !/*show_label*/ + l[2]), pt(e, "sr-only", !/*show_label*/ + l[2]), pt( e, "float", /*float*/ l[4] - ), wt( + ), pt( e, "hide-label", /*disable*/ @@ -589,26 +589,26 @@ function Sf(l) { ); }, m(r, a) { - gf(r, e, a), ti(e, t), bf(n, t, null), ti(e, i), ti(e, o), s = !0; + pf(r, e, a), ii(e, t), vf(n, t, null), ii(e, i), ii(e, o), s = !0; }, p(r, [a]) { (!s || a & /*label*/ - 1) && pf( + 1) && yf( o, /*label*/ r[0] ), (!s || a & /*show_label*/ - 4) && wt(e, "hide", !/*show_label*/ + 4) && pt(e, "hide", !/*show_label*/ r[2]), (!s || a & /*show_label*/ - 4) && wt(e, "sr-only", !/*show_label*/ + 4) && pt(e, "sr-only", !/*show_label*/ r[2]), (!s || a & /*float*/ - 16) && wt( + 16) && pt( e, "float", /*float*/ r[4] ), (!s || a & /*disable*/ - 8) && wt( + 8) && pt( e, "hide-label", /*disable*/ @@ -616,25 +616,25 @@ function Sf(l) { ); }, i(r) { - s || (yf(n.$$.fragment, r), s = !0); + s || (zf(n.$$.fragment, r), s = !0); }, o(r) { - Cf(n.$$.fragment, r), s = !1; + Bf(n.$$.fragment, r), s = !1; }, d(r) { - r && hf(e), df(n); + r && bf(e), gf(n); } }; } -function zf(l, e, t) { +function Ef(l, e, t) { let { label: n = null } = e, { Icon: i } = e, { show_label: o = !0 } = e, { disable: s = !1 } = e, { float: r = !0 } = e; return l.$$set = (a) => { "label" in a && t(0, n = a.label), "Icon" in a && t(1, i = a.Icon), "show_label" in a && t(2, o = a.show_label), "disable" in a && t(3, s = a.disable), "float" in a && t(4, r = a.float); }, [n, i, o, s, r]; } -class qf extends cf { +class Mf extends hf { constructor(e) { - super(), mf(this, e, zf, Sf, wf, { + super(), wf(this, e, Ef, qf, kf, { label: 0, Icon: 1, show_label: 2, @@ -644,71 +644,71 @@ class qf extends cf { } } const { - SvelteComponent: Bf, - append: ji, + SvelteComponent: Af, + append: Xi, attr: ft, - bubble: Ef, - create_component: Mf, - destroy_component: Af, - detach: oa, - element: Hi, - init: Lf, - insert: sa, - listen: Df, - mount_component: Rf, - safe_not_equal: Tf, - set_data: If, + bubble: Lf, + create_component: Df, + destroy_component: Rf, + detach: ra, + element: Yi, + init: Tf, + insert: fa, + listen: If, + mount_component: jf, + safe_not_equal: Hf, + set_data: Ff, set_style: ln, - space: jf, - text: Hf, - toggle_class: ke, - transition_in: Ff, - transition_out: Xf + space: Xf, + text: Yf, + toggle_class: ye, + transition_in: Nf, + transition_out: Uf } = window.__gradio__svelte__internal; -function bo(l) { +function vo(l) { let e, t; return { c() { - e = Hi("span"), t = Hf( + e = Yi("span"), t = Yf( /*label*/ l[1] ), ft(e, "class", "svelte-1lrphxw"); }, m(n, i) { - sa(n, e, i), ji(e, t); + fa(n, e, i), Xi(e, t); }, p(n, i) { i & /*label*/ - 2 && If( + 2 && Ff( t, /*label*/ n[1] ); }, d(n) { - n && oa(e); + n && ra(e); } }; } -function Yf(l) { +function Of(l) { let e, t, n, i, o, s, r, a = ( /*show_label*/ - l[2] && bo(l) + l[2] && vo(l) ); return i = new /*Icon*/ l[0]({}), { c() { - e = Hi("button"), a && a.c(), t = jf(), n = Hi("div"), Mf(i.$$.fragment), ft(n, "class", "svelte-1lrphxw"), ke( + e = Yi("button"), a && a.c(), t = Xf(), n = Yi("div"), Df(i.$$.fragment), ft(n, "class", "svelte-1lrphxw"), ye( n, "small", /*size*/ l[4] === "small" - ), ke( + ), ye( n, "large", /*size*/ l[4] === "large" - ), ke( + ), ye( n, "medium", /*size*/ @@ -729,22 +729,22 @@ function Yf(l) { "title", /*label*/ l[1] - ), ft(e, "class", "svelte-1lrphxw"), ke( + ), ft(e, "class", "svelte-1lrphxw"), ye( e, "pending", /*pending*/ l[3] - ), ke( + ), ye( e, "padded", /*padded*/ l[5] - ), ke( + ), ye( e, "highlight", /*highlight*/ l[6] - ), ke( + ), ye( e, "transparent", /*transparent*/ @@ -766,7 +766,7 @@ function Yf(l) { ); }, m(f, u) { - sa(f, e, u), a && a.m(e, null), ji(e, t), ji(e, n), Rf(i, n, null), o = !0, s || (r = Df( + fa(f, e, u), a && a.m(e, null), Xi(e, t), Xi(e, n), jf(i, n, null), o = !0, s || (r = If( e, "click", /*click_handler*/ @@ -775,20 +775,20 @@ function Yf(l) { }, p(f, [u]) { /*show_label*/ - f[2] ? a ? a.p(f, u) : (a = bo(f), a.c(), a.m(e, t)) : a && (a.d(1), a = null), (!o || u & /*size*/ - 16) && ke( + f[2] ? a ? a.p(f, u) : (a = vo(f), a.c(), a.m(e, t)) : a && (a.d(1), a = null), (!o || u & /*size*/ + 16) && ye( n, "small", /*size*/ f[4] === "small" ), (!o || u & /*size*/ - 16) && ke( + 16) && ye( n, "large", /*size*/ f[4] === "large" ), (!o || u & /*size*/ - 16) && ke( + 16) && ye( n, "medium", /*size*/ @@ -814,25 +814,25 @@ function Yf(l) { /*label*/ f[1] ), (!o || u & /*pending*/ - 8) && ke( + 8) && ye( e, "pending", /*pending*/ f[3] ), (!o || u & /*padded*/ - 32) && ke( + 32) && ye( e, "padded", /*padded*/ f[5] ), (!o || u & /*highlight*/ - 64) && ke( + 64) && ye( e, "highlight", /*highlight*/ f[6] ), (!o || u & /*transparent*/ - 512) && ke( + 512) && ye( e, "transparent", /*transparent*/ @@ -857,23 +857,23 @@ function Yf(l) { ); }, i(f) { - o || (Ff(i.$$.fragment, f), o = !0); + o || (Nf(i.$$.fragment, f), o = !0); }, o(f) { - Xf(i.$$.fragment, f), o = !1; + Uf(i.$$.fragment, f), o = !1; }, d(f) { - f && oa(e), a && a.d(), Af(i), s = !1, r(); + f && ra(e), a && a.d(), Rf(i), s = !1, r(); } }; } -function Nf(l, e, t) { - let n, { Icon: i } = e, { label: o = "" } = e, { show_label: s = !1 } = e, { pending: r = !1 } = e, { size: a = "small" } = e, { padded: f = !0 } = e, { highlight: u = !1 } = e, { disabled: c = !1 } = e, { hasPopup: _ = !1 } = e, { color: d = "var(--block-label-text-color)" } = e, { transparent: m = !1 } = e, { background: h = "var(--background-fill-primary)" } = e, { offset: p = 0 } = e; - function w(b) { - Ef.call(this, l, b); +function Wf(l, e, t) { + let n, { Icon: i } = e, { label: o = "" } = e, { show_label: s = !1 } = e, { pending: r = !1 } = e, { size: a = "small" } = e, { padded: f = !0 } = e, { highlight: u = !1 } = e, { disabled: c = !1 } = e, { hasPopup: _ = !1 } = e, { color: d = "var(--block-label-text-color)" } = e, { transparent: h = !1 } = e, { background: m = "var(--background-fill-primary)" } = e, { offset: w = 0 } = e; + function b(p) { + Lf.call(this, l, p); } - return l.$$set = (b) => { - "Icon" in b && t(0, i = b.Icon), "label" in b && t(1, o = b.label), "show_label" in b && t(2, s = b.show_label), "pending" in b && t(3, r = b.pending), "size" in b && t(4, a = b.size), "padded" in b && t(5, f = b.padded), "highlight" in b && t(6, u = b.highlight), "disabled" in b && t(7, c = b.disabled), "hasPopup" in b && t(8, _ = b.hasPopup), "color" in b && t(13, d = b.color), "transparent" in b && t(9, m = b.transparent), "background" in b && t(10, h = b.background), "offset" in b && t(11, p = b.offset); + return l.$$set = (p) => { + "Icon" in p && t(0, i = p.Icon), "label" in p && t(1, o = p.label), "show_label" in p && t(2, s = p.show_label), "pending" in p && t(3, r = p.pending), "size" in p && t(4, a = p.size), "padded" in p && t(5, f = p.padded), "highlight" in p && t(6, u = p.highlight), "disabled" in p && t(7, c = p.disabled), "hasPopup" in p && t(8, _ = p.hasPopup), "color" in p && t(13, d = p.color), "transparent" in p && t(9, h = p.transparent), "background" in p && t(10, m = p.background), "offset" in p && t(11, w = p.offset); }, l.$$.update = () => { l.$$.dirty & /*highlight, color*/ 8256 && t(12, n = u ? "var(--color-accent)" : d); @@ -887,17 +887,17 @@ function Nf(l, e, t) { u, c, _, - m, h, - p, + m, + w, n, d, - w + b ]; } -class Wl extends Bf { +class Vl extends Af { constructor(e) { - super(), Lf(this, e, Nf, Yf, Tf, { + super(), Tf(this, e, Wf, Of, Hf, { Icon: 0, label: 1, show_label: 2, @@ -915,29 +915,29 @@ class Wl extends Bf { } } const { - SvelteComponent: Uf, - append: Of, - attr: ni, - binding_callbacks: Wf, - create_slot: Vf, - detach: Pf, - element: wo, - get_all_dirty_from_scope: Zf, - get_slot_changes: Kf, - init: Gf, - insert: Jf, - safe_not_equal: Qf, - toggle_class: pt, - transition_in: xf, - transition_out: $f, - update_slot_base: eu + SvelteComponent: Vf, + append: Pf, + attr: oi, + binding_callbacks: Zf, + create_slot: Kf, + detach: Gf, + element: ko, + get_all_dirty_from_scope: Jf, + get_slot_changes: Qf, + init: xf, + insert: $f, + safe_not_equal: eu, + toggle_class: vt, + transition_in: tu, + transition_out: nu, + update_slot_base: lu } = window.__gradio__svelte__internal; -function tu(l) { +function iu(l) { let e, t, n; const i = ( /*#slots*/ l[5].default - ), o = Vf( + ), o = Kf( i, l, /*$$scope*/ @@ -946,22 +946,22 @@ function tu(l) { ); return { c() { - e = wo("div"), t = wo("div"), o && o.c(), ni(t, "class", "icon svelte-3w3rth"), ni(e, "class", "empty svelte-3w3rth"), ni(e, "aria-label", "Empty value"), pt( + e = ko("div"), t = ko("div"), o && o.c(), oi(t, "class", "icon svelte-3w3rth"), oi(e, "class", "empty svelte-3w3rth"), oi(e, "aria-label", "Empty value"), vt( e, "small", /*size*/ l[0] === "small" - ), pt( + ), vt( e, "large", /*size*/ l[0] === "large" - ), pt( + ), vt( e, "unpadded_box", /*unpadded_box*/ l[1] - ), pt( + ), vt( e, "small_parent", /*parent_height*/ @@ -969,47 +969,47 @@ function tu(l) { ); }, m(s, r) { - Jf(s, e, r), Of(e, t), o && o.m(t, null), l[6](e), n = !0; + $f(s, e, r), Pf(e, t), o && o.m(t, null), l[6](e), n = !0; }, p(s, [r]) { o && o.p && (!n || r & /*$$scope*/ - 16) && eu( + 16) && lu( o, i, s, /*$$scope*/ s[4], - n ? Kf( + n ? Qf( i, /*$$scope*/ s[4], r, null - ) : Zf( + ) : Jf( /*$$scope*/ s[4] ), null ), (!n || r & /*size*/ - 1) && pt( + 1) && vt( e, "small", /*size*/ s[0] === "small" ), (!n || r & /*size*/ - 1) && pt( + 1) && vt( e, "large", /*size*/ s[0] === "large" ), (!n || r & /*unpadded_box*/ - 2) && pt( + 2) && vt( e, "unpadded_box", /*unpadded_box*/ s[1] ), (!n || r & /*parent_height*/ - 8) && pt( + 8) && vt( e, "small_parent", /*parent_height*/ @@ -1017,26 +1017,26 @@ function tu(l) { ); }, i(s) { - n || (xf(o, s), n = !0); + n || (tu(o, s), n = !0); }, o(s) { - $f(o, s), n = !1; + nu(o, s), n = !1; }, d(s) { - s && Pf(e), o && o.d(s), l[6](null); + s && Gf(e), o && o.d(s), l[6](null); } }; } -function nu(l, e, t) { +function ou(l, e, t) { let n, { $$slots: i = {}, $$scope: o } = e, { size: s = "small" } = e, { unpadded_box: r = !1 } = e, a; function f(c) { var _; if (!c) return !1; - const { height: d } = c.getBoundingClientRect(), { height: m } = ((_ = c.parentElement) === null || _ === void 0 ? void 0 : _.getBoundingClientRect()) || { height: d }; - return d > m + 2; + const { height: d } = c.getBoundingClientRect(), { height: h } = ((_ = c.parentElement) === null || _ === void 0 ? void 0 : _.getBoundingClientRect()) || { height: d }; + return d > h + 2; } function u(c) { - Wf[c ? "unshift" : "push"](() => { + Zf[c ? "unshift" : "push"](() => { a = c, t(2, a); }); } @@ -1047,409 +1047,409 @@ function nu(l, e, t) { 4 && t(3, n = f(a)); }, [s, r, a, n, o, i, u]; } -class lu extends Uf { +class su extends Vf { constructor(e) { - super(), Gf(this, e, nu, tu, Qf, { size: 0, unpadded_box: 1 }); + super(), xf(this, e, ou, iu, eu, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: iu, - append: po, - attr: ye, - detach: ou, - init: su, - insert: au, - noop: li, - safe_not_equal: ru, - svg_element: ii + SvelteComponent: au, + append: yo, + attr: Ce, + detach: ru, + init: fu, + insert: uu, + noop: si, + safe_not_equal: cu, + svg_element: ai } = window.__gradio__svelte__internal; -function fu(l) { +function _u(l) { let e, t, n; return { c() { - e = ii("svg"), t = ii("path"), n = ii("circle"), ye(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), ye(n, "cx", "12"), ye(n, "cy", "13"), ye(n, "r", "4"), ye(e, "xmlns", "http://www.w3.org/2000/svg"), ye(e, "width", "100%"), ye(e, "height", "100%"), ye(e, "viewBox", "0 0 24 24"), ye(e, "fill", "none"), ye(e, "stroke", "currentColor"), ye(e, "stroke-width", "1.5"), ye(e, "stroke-linecap", "round"), ye(e, "stroke-linejoin", "round"), ye(e, "class", "feather feather-camera"); + e = ai("svg"), t = ai("path"), n = ai("circle"), Ce(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), Ce(n, "cx", "12"), Ce(n, "cy", "13"), Ce(n, "r", "4"), Ce(e, "xmlns", "http://www.w3.org/2000/svg"), Ce(e, "width", "100%"), Ce(e, "height", "100%"), Ce(e, "viewBox", "0 0 24 24"), Ce(e, "fill", "none"), Ce(e, "stroke", "currentColor"), Ce(e, "stroke-width", "1.5"), Ce(e, "stroke-linecap", "round"), Ce(e, "stroke-linejoin", "round"), Ce(e, "class", "feather feather-camera"); }, m(i, o) { - au(i, e, o), po(e, t), po(e, n); + uu(i, e, o), yo(e, t), yo(e, n); }, - p: li, - i: li, - o: li, + p: si, + i: si, + o: si, d(i) { - i && ou(e); + i && ru(e); } }; } -class uu extends iu { +class du extends au { constructor(e) { - super(), su(this, e, null, fu, ru, {}); + super(), fu(this, e, null, _u, cu, {}); } } const { - SvelteComponent: cu, - append: _u, + SvelteComponent: hu, + append: mu, attr: Oe, - detach: du, - init: hu, - insert: mu, - noop: oi, - safe_not_equal: gu, - svg_element: vo + detach: gu, + init: bu, + insert: wu, + noop: ri, + safe_not_equal: pu, + svg_element: Co } = window.__gradio__svelte__internal; -function bu(l) { +function vu(l) { let e, t; return { c() { - e = vo("svg"), t = vo("circle"), Oe(t, "cx", "12"), Oe(t, "cy", "12"), Oe(t, "r", "10"), Oe(e, "xmlns", "http://www.w3.org/2000/svg"), Oe(e, "width", "100%"), Oe(e, "height", "100%"), Oe(e, "viewBox", "0 0 24 24"), Oe(e, "stroke-width", "1.5"), Oe(e, "stroke-linecap", "round"), Oe(e, "stroke-linejoin", "round"), Oe(e, "class", "feather feather-circle"); + e = Co("svg"), t = Co("circle"), Oe(t, "cx", "12"), Oe(t, "cy", "12"), Oe(t, "r", "10"), Oe(e, "xmlns", "http://www.w3.org/2000/svg"), Oe(e, "width", "100%"), Oe(e, "height", "100%"), Oe(e, "viewBox", "0 0 24 24"), Oe(e, "stroke-width", "1.5"), Oe(e, "stroke-linecap", "round"), Oe(e, "stroke-linejoin", "round"), Oe(e, "class", "feather feather-circle"); }, m(n, i) { - mu(n, e, i), _u(e, t); + wu(n, e, i), mu(e, t); }, - p: oi, - i: oi, - o: oi, + p: ri, + i: ri, + o: ri, d(n) { - n && du(e); + n && gu(e); } }; } -class wu extends cu { +class ku extends hu { constructor(e) { - super(), hu(this, e, null, bu, gu, {}); + super(), bu(this, e, null, vu, pu, {}); } } const { - SvelteComponent: pu, - append: si, + SvelteComponent: yu, + append: fi, attr: We, - detach: vu, - init: ku, - insert: yu, - noop: ai, - safe_not_equal: Cu, - set_style: xe, + detach: Cu, + init: Su, + insert: zu, + noop: ui, + safe_not_equal: Bu, + set_style: $e, svg_element: sl } = window.__gradio__svelte__internal; -function Su(l) { +function qu(l) { let e, t, n, i; return { c() { - e = sl("svg"), t = sl("g"), n = sl("path"), i = sl("path"), We(n, "d", "M18,6L6.087,17.913"), xe(n, "fill", "none"), xe(n, "fill-rule", "nonzero"), xe(n, "stroke-width", "2px"), We(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), We(i, "d", "M4.364,4.364L19.636,19.636"), xe(i, "fill", "none"), xe(i, "fill-rule", "nonzero"), xe(i, "stroke-width", "2px"), We(e, "width", "100%"), We(e, "height", "100%"), We(e, "viewBox", "0 0 24 24"), We(e, "version", "1.1"), We(e, "xmlns", "http://www.w3.org/2000/svg"), We(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), We(e, "xml:space", "preserve"), We(e, "stroke", "currentColor"), xe(e, "fill-rule", "evenodd"), xe(e, "clip-rule", "evenodd"), xe(e, "stroke-linecap", "round"), xe(e, "stroke-linejoin", "round"); + e = sl("svg"), t = sl("g"), n = sl("path"), i = sl("path"), We(n, "d", "M18,6L6.087,17.913"), $e(n, "fill", "none"), $e(n, "fill-rule", "nonzero"), $e(n, "stroke-width", "2px"), We(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), We(i, "d", "M4.364,4.364L19.636,19.636"), $e(i, "fill", "none"), $e(i, "fill-rule", "nonzero"), $e(i, "stroke-width", "2px"), We(e, "width", "100%"), We(e, "height", "100%"), We(e, "viewBox", "0 0 24 24"), We(e, "version", "1.1"), We(e, "xmlns", "http://www.w3.org/2000/svg"), We(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), We(e, "xml:space", "preserve"), We(e, "stroke", "currentColor"), $e(e, "fill-rule", "evenodd"), $e(e, "clip-rule", "evenodd"), $e(e, "stroke-linecap", "round"), $e(e, "stroke-linejoin", "round"); }, m(o, s) { - yu(o, e, s), si(e, t), si(t, n), si(e, i); + zu(o, e, s), fi(e, t), fi(t, n), fi(e, i); }, - p: ai, - i: ai, - o: ai, + p: ui, + i: ui, + o: ui, d(o) { - o && vu(e); + o && Cu(e); } }; } -class aa extends pu { +class ua extends yu { constructor(e) { - super(), ku(this, e, null, Su, Cu, {}); + super(), Su(this, e, null, qu, Bu, {}); } } const { - SvelteComponent: zu, - append: qu, + SvelteComponent: Eu, + append: Mu, attr: zn, - detach: Bu, - init: Eu, - insert: Mu, - noop: ri, - safe_not_equal: Au, - svg_element: ko + detach: Au, + init: Lu, + insert: Du, + noop: ci, + safe_not_equal: Ru, + svg_element: So } = window.__gradio__svelte__internal; -function Lu(l) { +function Tu(l) { let e, t; return { c() { - e = ko("svg"), t = ko("path"), zn(t, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), zn(t, "fill", "currentColor"), zn(e, "id", "icon"), zn(e, "xmlns", "http://www.w3.org/2000/svg"), zn(e, "viewBox", "0 0 32 32"); + e = So("svg"), t = So("path"), zn(t, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), zn(t, "fill", "currentColor"), zn(e, "id", "icon"), zn(e, "xmlns", "http://www.w3.org/2000/svg"), zn(e, "viewBox", "0 0 32 32"); }, m(n, i) { - Mu(n, e, i), qu(e, t); + Du(n, e, i), Mu(e, t); }, - p: ri, - i: ri, - o: ri, + p: ci, + i: ci, + o: ci, d(n) { - n && Bu(e); + n && Au(e); } }; } -class Du extends zu { +class Iu extends Eu { constructor(e) { - super(), Eu(this, e, null, Lu, Au, {}); + super(), Lu(this, e, null, Tu, Ru, {}); } } const { - SvelteComponent: Ru, - append: Tu, + SvelteComponent: ju, + append: Hu, attr: on, - detach: Iu, - init: ju, - insert: Hu, - noop: fi, - safe_not_equal: Fu, - svg_element: yo + detach: Fu, + init: Xu, + insert: Yu, + noop: _i, + safe_not_equal: Nu, + svg_element: zo } = window.__gradio__svelte__internal; -function Xu(l) { +function Uu(l) { let e, t; return { c() { - e = yo("svg"), t = yo("path"), on(t, "fill", "currentColor"), on(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), on(e, "xmlns", "http://www.w3.org/2000/svg"), on(e, "width", "100%"), on(e, "height", "100%"), on(e, "viewBox", "0 0 32 32"); + e = zo("svg"), t = zo("path"), on(t, "fill", "currentColor"), on(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), on(e, "xmlns", "http://www.w3.org/2000/svg"), on(e, "width", "100%"), on(e, "height", "100%"), on(e, "viewBox", "0 0 32 32"); }, m(n, i) { - Hu(n, e, i), Tu(e, t); + Yu(n, e, i), Hu(e, t); }, - p: fi, - i: fi, - o: fi, + p: _i, + i: _i, + o: _i, d(n) { - n && Iu(e); + n && Fu(e); } }; } -class Yu extends Ru { +class Ou extends ju { constructor(e) { - super(), ju(this, e, null, Xu, Fu, {}); + super(), Xu(this, e, null, Uu, Nu, {}); } } const { - SvelteComponent: Nu, - append: Uu, + SvelteComponent: Wu, + append: Vu, attr: sn, - detach: Ou, - init: Wu, - insert: Vu, - noop: ui, - safe_not_equal: Pu, - svg_element: Co + detach: Pu, + init: Zu, + insert: Ku, + noop: di, + safe_not_equal: Gu, + svg_element: Bo } = window.__gradio__svelte__internal; -function Zu(l) { +function Ju(l) { let e, t; return { c() { - e = Co("svg"), t = Co("path"), sn(t, "d", "M5 8l4 4 4-4z"), sn(e, "class", "dropdown-arrow svelte-145leq6"), sn(e, "xmlns", "http://www.w3.org/2000/svg"), sn(e, "width", "100%"), sn(e, "height", "100%"), sn(e, "viewBox", "0 0 18 18"); + e = Bo("svg"), t = Bo("path"), sn(t, "d", "M5 8l4 4 4-4z"), sn(e, "class", "dropdown-arrow svelte-145leq6"), sn(e, "xmlns", "http://www.w3.org/2000/svg"), sn(e, "width", "100%"), sn(e, "height", "100%"), sn(e, "viewBox", "0 0 18 18"); }, m(n, i) { - Vu(n, e, i), Uu(e, t); + Ku(n, e, i), Vu(e, t); }, - p: ui, - i: ui, - o: ui, + p: di, + i: di, + o: di, d(n) { - n && Ou(e); + n && Pu(e); } }; } -class to extends Nu { +class io extends Wu { constructor(e) { - super(), Wu(this, e, null, Zu, Pu, {}); + super(), Zu(this, e, null, Ju, Gu, {}); } } const { - SvelteComponent: Ku, - append: ci, - attr: oe, - detach: Gu, - init: Ju, - insert: Qu, - noop: _i, - safe_not_equal: xu, + SvelteComponent: Qu, + append: hi, + attr: se, + detach: xu, + init: $u, + insert: ec, + noop: mi, + safe_not_equal: tc, svg_element: al } = window.__gradio__svelte__internal; -function $u(l) { +function nc(l) { let e, t, n, i; return { c() { - e = al("svg"), t = al("rect"), n = al("circle"), i = al("polyline"), oe(t, "x", "3"), oe(t, "y", "3"), oe(t, "width", "18"), oe(t, "height", "18"), oe(t, "rx", "2"), oe(t, "ry", "2"), oe(n, "cx", "8.5"), oe(n, "cy", "8.5"), oe(n, "r", "1.5"), oe(i, "points", "21 15 16 10 5 21"), oe(e, "xmlns", "http://www.w3.org/2000/svg"), oe(e, "width", "100%"), oe(e, "height", "100%"), oe(e, "viewBox", "0 0 24 24"), oe(e, "fill", "none"), oe(e, "stroke", "currentColor"), oe(e, "stroke-width", "1.5"), oe(e, "stroke-linecap", "round"), oe(e, "stroke-linejoin", "round"), oe(e, "class", "feather feather-image"); + e = al("svg"), t = al("rect"), n = al("circle"), i = al("polyline"), se(t, "x", "3"), se(t, "y", "3"), se(t, "width", "18"), se(t, "height", "18"), se(t, "rx", "2"), se(t, "ry", "2"), se(n, "cx", "8.5"), se(n, "cy", "8.5"), se(n, "r", "1.5"), se(i, "points", "21 15 16 10 5 21"), se(e, "xmlns", "http://www.w3.org/2000/svg"), se(e, "width", "100%"), se(e, "height", "100%"), se(e, "viewBox", "0 0 24 24"), se(e, "fill", "none"), se(e, "stroke", "currentColor"), se(e, "stroke-width", "1.5"), se(e, "stroke-linecap", "round"), se(e, "stroke-linejoin", "round"), se(e, "class", "feather feather-image"); }, m(o, s) { - Qu(o, e, s), ci(e, t), ci(e, n), ci(e, i); + ec(o, e, s), hi(e, t), hi(e, n), hi(e, i); }, - p: _i, - i: _i, - o: _i, + p: mi, + i: mi, + o: mi, d(o) { - o && Gu(e); + o && xu(e); } }; } -let ra = class extends Ku { +let ca = class extends Qu { constructor(e) { - super(), Ju(this, e, null, $u, xu, {}); + super(), $u(this, e, null, nc, tc, {}); } }; const { - SvelteComponent: ec, - append: tc, + SvelteComponent: lc, + append: ic, attr: rl, - detach: nc, - init: lc, - insert: ic, - noop: di, - safe_not_equal: oc, - svg_element: So + detach: oc, + init: sc, + insert: ac, + noop: gi, + safe_not_equal: rc, + svg_element: qo } = window.__gradio__svelte__internal; -function sc(l) { +function fc(l) { let e, t; return { c() { - e = So("svg"), t = So("path"), rl(t, "fill", "currentColor"), rl(t, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), rl(e, "xmlns", "http://www.w3.org/2000/svg"), rl(e, "viewBox", "0 0 24 24"); + e = qo("svg"), t = qo("path"), rl(t, "fill", "currentColor"), rl(t, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), rl(e, "xmlns", "http://www.w3.org/2000/svg"), rl(e, "viewBox", "0 0 24 24"); }, m(n, i) { - ic(n, e, i), tc(e, t); + ac(n, e, i), ic(e, t); }, - p: di, - i: di, - o: di, + p: gi, + i: gi, + o: gi, d(n) { - n && nc(e); + n && oc(e); } }; } -class fa extends ec { +class _a extends lc { constructor(e) { - super(), lc(this, e, null, sc, oc, {}); + super(), sc(this, e, null, fc, rc, {}); } } const { - SvelteComponent: ac, + SvelteComponent: uc, append: fl, - attr: se, - detach: rc, - init: fc, - insert: uc, - noop: hi, - safe_not_equal: cc, - svg_element: qn + attr: ae, + detach: cc, + init: _c, + insert: dc, + noop: bi, + safe_not_equal: hc, + svg_element: Bn } = window.__gradio__svelte__internal; -function _c(l) { +function mc(l) { let e, t, n, i, o; return { c() { - e = qn("svg"), t = qn("path"), n = qn("path"), i = qn("line"), o = qn("line"), se(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), se(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), se(i, "x1", "12"), se(i, "y1", "19"), se(i, "x2", "12"), se(i, "y2", "23"), se(o, "x1", "8"), se(o, "y1", "23"), se(o, "x2", "16"), se(o, "y2", "23"), se(e, "xmlns", "http://www.w3.org/2000/svg"), se(e, "width", "100%"), se(e, "height", "100%"), se(e, "viewBox", "0 0 24 24"), se(e, "fill", "none"), se(e, "stroke", "currentColor"), se(e, "stroke-width", "2"), se(e, "stroke-linecap", "round"), se(e, "stroke-linejoin", "round"), se(e, "class", "feather feather-mic"); + e = Bn("svg"), t = Bn("path"), n = Bn("path"), i = Bn("line"), o = Bn("line"), ae(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), ae(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), ae(i, "x1", "12"), ae(i, "y1", "19"), ae(i, "x2", "12"), ae(i, "y2", "23"), ae(o, "x1", "8"), ae(o, "y1", "23"), ae(o, "x2", "16"), ae(o, "y2", "23"), ae(e, "xmlns", "http://www.w3.org/2000/svg"), ae(e, "width", "100%"), ae(e, "height", "100%"), ae(e, "viewBox", "0 0 24 24"), ae(e, "fill", "none"), ae(e, "stroke", "currentColor"), ae(e, "stroke-width", "2"), ae(e, "stroke-linecap", "round"), ae(e, "stroke-linejoin", "round"), ae(e, "class", "feather feather-mic"); }, m(s, r) { - uc(s, e, r), fl(e, t), fl(e, n), fl(e, i), fl(e, o); + dc(s, e, r), fl(e, t), fl(e, n), fl(e, i), fl(e, o); }, - p: hi, - i: hi, - o: hi, + p: bi, + i: bi, + o: bi, d(s) { - s && rc(e); + s && cc(e); } }; } -class dc extends ac { +class gc extends uc { constructor(e) { - super(), fc(this, e, null, _c, cc, {}); + super(), _c(this, e, null, mc, hc, {}); } } const { - SvelteComponent: hc, - append: mc, - attr: Ce, - detach: gc, - init: bc, - insert: wc, - noop: mi, - safe_not_equal: pc, - svg_element: zo + SvelteComponent: bc, + append: wc, + attr: Se, + detach: pc, + init: vc, + insert: kc, + noop: wi, + safe_not_equal: yc, + svg_element: Eo } = window.__gradio__svelte__internal; -function vc(l) { +function Cc(l) { let e, t; return { c() { - e = zo("svg"), t = zo("rect"), Ce(t, "x", "3"), Ce(t, "y", "3"), Ce(t, "width", "18"), Ce(t, "height", "18"), Ce(t, "rx", "2"), Ce(t, "ry", "2"), Ce(e, "xmlns", "http://www.w3.org/2000/svg"), Ce(e, "width", "100%"), Ce(e, "height", "100%"), Ce(e, "viewBox", "0 0 24 24"), Ce(e, "stroke-width", "1.5"), Ce(e, "stroke-linecap", "round"), Ce(e, "stroke-linejoin", "round"), Ce(e, "class", "feather feather-square"); + e = Eo("svg"), t = Eo("rect"), Se(t, "x", "3"), Se(t, "y", "3"), Se(t, "width", "18"), Se(t, "height", "18"), Se(t, "rx", "2"), Se(t, "ry", "2"), Se(e, "xmlns", "http://www.w3.org/2000/svg"), Se(e, "width", "100%"), Se(e, "height", "100%"), Se(e, "viewBox", "0 0 24 24"), Se(e, "stroke-width", "1.5"), Se(e, "stroke-linecap", "round"), Se(e, "stroke-linejoin", "round"), Se(e, "class", "feather feather-square"); }, m(n, i) { - wc(n, e, i), mc(e, t); + kc(n, e, i), wc(e, t); }, - p: mi, - i: mi, - o: mi, + p: wi, + i: wi, + o: wi, d(n) { - n && gc(e); + n && pc(e); } }; } -class kc extends hc { +class Sc extends bc { constructor(e) { - super(), bc(this, e, null, vc, pc, {}); + super(), vc(this, e, null, Cc, yc, {}); } } const { - SvelteComponent: yc, - append: gi, + SvelteComponent: zc, + append: pi, attr: we, - detach: Cc, - init: Sc, - insert: zc, - noop: bi, - safe_not_equal: qc, + detach: Bc, + init: qc, + insert: Ec, + noop: vi, + safe_not_equal: Mc, svg_element: ul } = window.__gradio__svelte__internal; -function Bc(l) { +function Ac(l) { let e, t, n, i; return { c() { e = ul("svg"), t = ul("path"), n = ul("polyline"), i = ul("line"), we(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), we(n, "points", "17 8 12 3 7 8"), we(i, "x1", "12"), we(i, "y1", "3"), we(i, "x2", "12"), we(i, "y2", "15"), we(e, "xmlns", "http://www.w3.org/2000/svg"), we(e, "width", "90%"), we(e, "height", "90%"), we(e, "viewBox", "0 0 24 24"), we(e, "fill", "none"), we(e, "stroke", "currentColor"), we(e, "stroke-width", "2"), we(e, "stroke-linecap", "round"), we(e, "stroke-linejoin", "round"), we(e, "class", "feather feather-upload"); }, m(o, s) { - zc(o, e, s), gi(e, t), gi(e, n), gi(e, i); + Ec(o, e, s), pi(e, t), pi(e, n), pi(e, i); }, - p: bi, - i: bi, - o: bi, + p: vi, + i: vi, + o: vi, d(o) { - o && Cc(e); + o && Bc(e); } }; } -let ua = class extends yc { +let da = class extends zc { constructor(e) { - super(), Sc(this, e, null, Bc, qc, {}); + super(), qc(this, e, null, Ac, Mc, {}); } }; const { - SvelteComponent: Ec, - append: qo, - attr: vt, - detach: Mc, - init: Ac, - insert: Lc, - noop: wi, - safe_not_equal: Dc, - svg_element: pi + SvelteComponent: Lc, + append: Mo, + attr: kt, + detach: Dc, + init: Rc, + insert: Tc, + noop: ki, + safe_not_equal: Ic, + svg_element: yi } = window.__gradio__svelte__internal; -function Rc(l) { +function jc(l) { let e, t, n; return { c() { - e = pi("svg"), t = pi("path"), n = pi("path"), vt(t, "fill", "currentColor"), vt(t, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), vt(n, "fill", "currentColor"), vt(n, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), vt(e, "xmlns", "http://www.w3.org/2000/svg"), vt(e, "width", "100%"), vt(e, "height", "100%"), vt(e, "viewBox", "0 0 24 24"); + e = yi("svg"), t = yi("path"), n = yi("path"), kt(t, "fill", "currentColor"), kt(t, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), kt(n, "fill", "currentColor"), kt(n, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), kt(e, "xmlns", "http://www.w3.org/2000/svg"), kt(e, "width", "100%"), kt(e, "height", "100%"), kt(e, "viewBox", "0 0 24 24"); }, m(i, o) { - Lc(i, e, o), qo(e, t), qo(e, n); + Tc(i, e, o), Mo(e, t), Mo(e, n); }, - p: wi, - i: wi, - o: wi, + p: ki, + i: ki, + o: ki, d(i) { - i && Mc(e); + i && Dc(e); } }; } -let ca = class extends Ec { +let ha = class extends Lc { constructor(e) { - super(), Ac(this, e, null, Rc, Dc, {}); + super(), Rc(this, e, null, jc, Ic, {}); } }; -const Tc = [ +const Hc = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -1460,7 +1460,7 @@ const Tc = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], Bo = { +], Ao = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -1753,27 +1753,27 @@ const Tc = [ 950: "#4c0519" } }; -Tc.reduce( +Hc.reduce( (l, { color: e, primary: t, secondary: n }) => ({ ...l, [e]: { - primary: Bo[e][t], - secondary: Bo[e][n] + primary: Ao[e][t], + secondary: Ao[e][n] } }), {} ); -class Sl extends Error { +class zl extends Error { constructor(e) { super(e), this.name = "ShareError"; } } -async function Ic(l, e) { +async function Fc(l, e) { var a; if (window.__gradio_space__ == null) - throw new Sl("Must be on Spaces to share."); + throw new zl("Must be on Spaces to share."); let t, n, i; - t = jc(l), n = l.split(";")[0].split(":")[1], i = "file" + n.split("/")[1]; + t = Xc(l), n = l.split(";")[0].split(":")[1], i = "file" + n.split("/")[1]; const o = new File([t], i, { type: n }), s = await fetch("https://huggingface.co/uploads", { method: "POST", body: o, @@ -1785,32 +1785,32 @@ async function Ic(l, e) { if (!s.ok) { if ((a = s.headers.get("content-type")) != null && a.includes("application/json")) { const f = await s.json(); - throw new Sl(`Upload failed: ${f.error}`); + throw new zl(`Upload failed: ${f.error}`); } - throw new Sl("Upload failed."); + throw new zl("Upload failed."); } return await s.text(); } -function jc(l) { +function Xc(l) { for (var e = l.split(","), t = e[0].match(/:(.*?);/)[1], n = atob(e[1]), i = n.length, o = new Uint8Array(i); i--; ) o[i] = n.charCodeAt(i); return new Blob([o], { type: t }); } const { - SvelteComponent: Hc, - create_component: Fc, - destroy_component: Xc, - init: Yc, - mount_component: Nc, - safe_not_equal: Uc, - transition_in: Oc, - transition_out: Wc -} = window.__gradio__svelte__internal, { createEventDispatcher: Vc } = window.__gradio__svelte__internal; -function Pc(l) { + SvelteComponent: Yc, + create_component: Nc, + destroy_component: Uc, + init: Oc, + mount_component: Wc, + safe_not_equal: Vc, + transition_in: Pc, + transition_out: Zc +} = window.__gradio__svelte__internal, { createEventDispatcher: Kc } = window.__gradio__svelte__internal; +function Gc(l) { let e, t; - return e = new Wl({ + return e = new Vl({ props: { - Icon: Du, + Icon: Iu, label: ( /*i18n*/ l[2]("common.share") @@ -1826,10 +1826,10 @@ function Pc(l) { l[5] ), { c() { - Fc(e.$$.fragment); + Nc(e.$$.fragment); }, m(n, i) { - Nc(e, n, i), t = !0; + Wc(e, n, i), t = !0; }, p(n, [i]) { const o = {}; @@ -1840,18 +1840,18 @@ function Pc(l) { n[3]), e.$set(o); }, i(n) { - t || (Oc(e.$$.fragment, n), t = !0); + t || (Pc(e.$$.fragment, n), t = !0); }, o(n) { - Wc(e.$$.fragment, n), t = !1; + Zc(e.$$.fragment, n), t = !1; }, d(n) { - Xc(e, n); + Uc(e, n); } }; } -function Zc(l, e, t) { - const n = Vc(); +function Jc(l, e, t) { + const n = Kc(); let { formatter: i } = e, { value: o } = e, { i18n: s } = e, r = !1; const a = async () => { try { @@ -1860,7 +1860,7 @@ function Zc(l, e, t) { n("share", { description: f }); } catch (f) { console.error(f); - let u = f instanceof Sl ? f.message : "Share failed."; + let u = f instanceof zl ? f.message : "Share failed."; n("error", u); } finally { t(3, r = !1); @@ -1870,73 +1870,73 @@ function Zc(l, e, t) { "formatter" in f && t(0, i = f.formatter), "value" in f && t(1, o = f.value), "i18n" in f && t(2, s = f.i18n); }, [i, o, s, r, n, a]; } -class Kc extends Hc { +class Qc extends Yc { constructor(e) { - super(), Yc(this, e, Zc, Pc, Uc, { formatter: 0, value: 1, i18n: 2 }); + super(), Oc(this, e, Jc, Gc, Vc, { formatter: 0, value: 1, i18n: 2 }); } } const { - SvelteComponent: Gc, + SvelteComponent: xc, append: Vt, - attr: Fi, - check_outros: Jc, - create_component: _a, - destroy_component: da, - detach: zl, - element: Xi, - group_outros: Qc, - init: xc, + attr: Ni, + check_outros: $c, + create_component: ma, + destroy_component: ga, + detach: Bl, + element: Ui, + group_outros: e_, + init: t_, insert: ql, - mount_component: ha, - safe_not_equal: $c, - set_data: Yi, - space: Ni, + mount_component: ba, + safe_not_equal: n_, + set_data: Oi, + space: Wi, text: Ln, - toggle_class: Eo, - transition_in: Ll, - transition_out: Dl + toggle_class: Lo, + transition_in: Dl, + transition_out: Rl } = window.__gradio__svelte__internal; -function e_(l) { +function l_(l) { let e, t; - return e = new ua({}), { + return e = new da({}), { c() { - _a(e.$$.fragment); + ma(e.$$.fragment); }, m(n, i) { - ha(e, n, i), t = !0; + ba(e, n, i), t = !0; }, i(n) { - t || (Ll(e.$$.fragment, n), t = !0); + t || (Dl(e.$$.fragment, n), t = !0); }, o(n) { - Dl(e.$$.fragment, n), t = !1; + Rl(e.$$.fragment, n), t = !1; }, d(n) { - da(e, n); + ga(e, n); } }; } -function t_(l) { +function i_(l) { let e, t; - return e = new fa({}), { + return e = new _a({}), { c() { - _a(e.$$.fragment); + ma(e.$$.fragment); }, m(n, i) { - ha(e, n, i), t = !0; + ba(e, n, i), t = !0; }, i(n) { - t || (Ll(e.$$.fragment, n), t = !0); + t || (Dl(e.$$.fragment, n), t = !0); }, o(n) { - Dl(e.$$.fragment, n), t = !1; + Rl(e.$$.fragment, n), t = !1; }, d(n) { - da(e, n); + ga(e, n); } }; } -function Mo(l) { +function Do(l) { let e, t, n = ( /*i18n*/ l[1]("common.or") + "" @@ -1947,7 +1947,7 @@ function Mo(l) { ), a; return { c() { - e = Xi("span"), t = Ln("- "), i = Ln(n), o = Ln(" -"), s = Ni(), a = Ln(r), Fi(e, "class", "or svelte-kzcjhc"); + e = Ui("span"), t = Ln("- "), i = Ln(n), o = Ln(" -"), s = Wi(), a = Ln(r), Ni(e, "class", "or svelte-kzcjhc"); }, m(f, u) { ql(f, e, u), Vt(e, t), Vt(e, i), Vt(e, o), ql(f, s, u), ql(f, a, u); @@ -1955,17 +1955,17 @@ function Mo(l) { p(f, u) { u & /*i18n*/ 2 && n !== (n = /*i18n*/ - f[1]("common.or") + "") && Yi(i, n), u & /*message, i18n*/ + f[1]("common.or") + "") && Oi(i, n), u & /*message, i18n*/ 6 && r !== (r = /*message*/ (f[2] || /*i18n*/ - f[1]("upload_text.click_to_upload")) + "") && Yi(a, r); + f[1]("upload_text.click_to_upload")) + "") && Oi(a, r); }, d(f) { - f && (zl(e), zl(s), zl(a)); + f && (Bl(e), Bl(s), Bl(a)); } }; } -function n_(l) { +function o_(l) { let e, t, n, i, o, s = ( /*i18n*/ l[1]( @@ -1977,64 +1977,64 @@ function n_(l) { l[5].file ) + "" ), r, a, f; - const u = [t_, e_], c = []; - function _(m, h) { + const u = [i_, l_], c = []; + function _(h, m) { return ( /*type*/ - m[0] === "clipboard" ? 0 : 1 + h[0] === "clipboard" ? 0 : 1 ); } n = _(l), i = c[n] = u[n](l); let d = ( /*mode*/ - l[3] !== "short" && Mo(l) + l[3] !== "short" && Do(l) ); return { c() { - e = Xi("div"), t = Xi("span"), i.c(), o = Ni(), r = Ln(s), a = Ni(), d && d.c(), Fi(t, "class", "icon-wrap svelte-kzcjhc"), Eo( + e = Ui("div"), t = Ui("span"), i.c(), o = Wi(), r = Ln(s), a = Wi(), d && d.c(), Ni(t, "class", "icon-wrap svelte-kzcjhc"), Lo( t, "hovered", /*hovered*/ l[4] - ), Fi(e, "class", "wrap svelte-kzcjhc"); + ), Ni(e, "class", "wrap svelte-kzcjhc"); }, - m(m, h) { - ql(m, e, h), Vt(e, t), c[n].m(t, null), Vt(e, o), Vt(e, r), Vt(e, a), d && d.m(e, null), f = !0; + m(h, m) { + ql(h, e, m), Vt(e, t), c[n].m(t, null), Vt(e, o), Vt(e, r), Vt(e, a), d && d.m(e, null), f = !0; }, - p(m, [h]) { - let p = n; - n = _(m), n !== p && (Qc(), Dl(c[p], 1, 1, () => { - c[p] = null; - }), Jc(), i = c[n], i || (i = c[n] = u[n](m), i.c()), Ll(i, 1), i.m(t, null)), (!f || h & /*hovered*/ - 16) && Eo( + p(h, [m]) { + let w = n; + n = _(h), n !== w && (e_(), Rl(c[w], 1, 1, () => { + c[w] = null; + }), $c(), i = c[n], i || (i = c[n] = u[n](h), i.c()), Dl(i, 1), i.m(t, null)), (!f || m & /*hovered*/ + 16) && Lo( t, "hovered", /*hovered*/ - m[4] - ), (!f || h & /*i18n, type*/ + h[4] + ), (!f || m & /*i18n, type*/ 3) && s !== (s = /*i18n*/ - m[1]( + h[1]( /*defs*/ - m[5][ + h[5][ /*type*/ - m[0] + h[0] ] || /*defs*/ - m[5].file - ) + "") && Yi(r, s), /*mode*/ - m[3] !== "short" ? d ? d.p(m, h) : (d = Mo(m), d.c(), d.m(e, null)) : d && (d.d(1), d = null); + h[5].file + ) + "") && Oi(r, s), /*mode*/ + h[3] !== "short" ? d ? d.p(h, m) : (d = Do(h), d.c(), d.m(e, null)) : d && (d.d(1), d = null); }, - i(m) { - f || (Ll(i), f = !0); + i(h) { + f || (Dl(i), f = !0); }, - o(m) { - Dl(i), f = !1; + o(h) { + Rl(i), f = !1; }, - d(m) { - m && zl(e), c[n].d(), d && d.d(); + d(h) { + h && Bl(e), c[n].d(), d && d.d(); } }; } -function l_(l, e, t) { +function s_(l, e, t) { let { type: n = "file" } = e, { i18n: i } = e, { message: o = void 0 } = e, { mode: s = "full" } = e, { hovered: r = !1 } = e; const a = { image: "upload_text.drop_image", @@ -2049,9 +2049,9 @@ function l_(l, e, t) { "type" in f && t(0, n = f.type), "i18n" in f && t(1, i = f.i18n), "message" in f && t(2, o = f.message), "mode" in f && t(3, s = f.mode), "hovered" in f && t(4, r = f.hovered); }, [n, i, o, s, r, a]; } -class ma extends Gc { +class wa extends xc { constructor(e) { - super(), xc(this, e, l_, n_, $c, { + super(), t_(this, e, s_, o_, n_, { type: 0, i18n: 1, message: 2, @@ -2061,27 +2061,27 @@ class ma extends Gc { } } const { - SvelteComponent: i_, - append: vi, - attr: it, + SvelteComponent: a_, + append: Ci, + attr: ot, check_outros: Dn, - create_component: Vl, - destroy_component: Pl, + create_component: Pl, + destroy_component: Zl, detach: wn, element: el, - empty: o_, + empty: r_, group_outros: Rn, - init: s_, + init: f_, insert: pn, - listen: Zl, - mount_component: Kl, - safe_not_equal: a_, - space: ki, - toggle_class: Mt, - transition_in: re, - transition_out: Se + listen: Kl, + mount_component: Gl, + safe_not_equal: u_, + space: Si, + toggle_class: At, + transition_in: fe, + transition_out: ze } = window.__gradio__svelte__internal; -function Ao(l) { +function Ro(l) { let e, t = ( /*sources*/ l[1].includes("upload") @@ -2094,53 +2094,53 @@ function Ao(l) { ), r, a = ( /*sources*/ l[1].includes("clipboard") - ), f, u = t && Lo(l), c = i && Do(l), _ = s && Ro(l), d = a && To(l); + ), f, u = t && To(l), c = i && Io(l), _ = s && jo(l), d = a && Ho(l); return { c() { - e = el("span"), u && u.c(), n = ki(), c && c.c(), o = ki(), _ && _.c(), r = ki(), d && d.c(), it(e, "class", "source-selection svelte-1jp3vgd"), it(e, "data-testid", "source-select"); + e = el("span"), u && u.c(), n = Si(), c && c.c(), o = Si(), _ && _.c(), r = Si(), d && d.c(), ot(e, "class", "source-selection svelte-1jp3vgd"), ot(e, "data-testid", "source-select"); }, - m(m, h) { - pn(m, e, h), u && u.m(e, null), vi(e, n), c && c.m(e, null), vi(e, o), _ && _.m(e, null), vi(e, r), d && d.m(e, null), f = !0; + m(h, m) { + pn(h, e, m), u && u.m(e, null), Ci(e, n), c && c.m(e, null), Ci(e, o), _ && _.m(e, null), Ci(e, r), d && d.m(e, null), f = !0; }, - p(m, h) { - h & /*sources*/ + p(h, m) { + m & /*sources*/ 2 && (t = /*sources*/ - m[1].includes("upload")), t ? u ? (u.p(m, h), h & /*sources*/ - 2 && re(u, 1)) : (u = Lo(m), u.c(), re(u, 1), u.m(e, n)) : u && (Rn(), Se(u, 1, 1, () => { + h[1].includes("upload")), t ? u ? (u.p(h, m), m & /*sources*/ + 2 && fe(u, 1)) : (u = To(h), u.c(), fe(u, 1), u.m(e, n)) : u && (Rn(), ze(u, 1, 1, () => { u = null; - }), Dn()), h & /*sources*/ + }), Dn()), m & /*sources*/ 2 && (i = /*sources*/ - m[1].includes("microphone")), i ? c ? (c.p(m, h), h & /*sources*/ - 2 && re(c, 1)) : (c = Do(m), c.c(), re(c, 1), c.m(e, o)) : c && (Rn(), Se(c, 1, 1, () => { + h[1].includes("microphone")), i ? c ? (c.p(h, m), m & /*sources*/ + 2 && fe(c, 1)) : (c = Io(h), c.c(), fe(c, 1), c.m(e, o)) : c && (Rn(), ze(c, 1, 1, () => { c = null; - }), Dn()), h & /*sources*/ + }), Dn()), m & /*sources*/ 2 && (s = /*sources*/ - m[1].includes("webcam")), s ? _ ? (_.p(m, h), h & /*sources*/ - 2 && re(_, 1)) : (_ = Ro(m), _.c(), re(_, 1), _.m(e, r)) : _ && (Rn(), Se(_, 1, 1, () => { + h[1].includes("webcam")), s ? _ ? (_.p(h, m), m & /*sources*/ + 2 && fe(_, 1)) : (_ = jo(h), _.c(), fe(_, 1), _.m(e, r)) : _ && (Rn(), ze(_, 1, 1, () => { _ = null; - }), Dn()), h & /*sources*/ + }), Dn()), m & /*sources*/ 2 && (a = /*sources*/ - m[1].includes("clipboard")), a ? d ? (d.p(m, h), h & /*sources*/ - 2 && re(d, 1)) : (d = To(m), d.c(), re(d, 1), d.m(e, null)) : d && (Rn(), Se(d, 1, 1, () => { + h[1].includes("clipboard")), a ? d ? (d.p(h, m), m & /*sources*/ + 2 && fe(d, 1)) : (d = Ho(h), d.c(), fe(d, 1), d.m(e, null)) : d && (Rn(), ze(d, 1, 1, () => { d = null; }), Dn()); }, - i(m) { - f || (re(u), re(c), re(_), re(d), f = !0); + i(h) { + f || (fe(u), fe(c), fe(_), fe(d), f = !0); }, - o(m) { - Se(u), Se(c), Se(_), Se(d), f = !1; + o(h) { + ze(u), ze(c), ze(_), ze(d), f = !1; }, - d(m) { - m && wn(e), u && u.d(), c && c.d(), _ && _.d(), d && d.d(); + d(h) { + h && wn(e), u && u.d(), c && c.d(), _ && _.d(), d && d.d(); } }; } -function Lo(l) { +function To(l) { let e, t, n, i, o; - return t = new ua({}), { + return t = new da({}), { c() { - e = el("button"), Vl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Upload file"), Mt( + e = el("button"), Pl(t.$$.fragment), ot(e, "class", "icon svelte-1jp3vgd"), ot(e, "aria-label", "Upload file"), At( e, "selected", /*active_source*/ @@ -2149,7 +2149,7 @@ function Lo(l) { ); }, m(s, r) { - pn(s, e, r), Kl(t, e, null), n = !0, i || (o = Zl( + pn(s, e, r), Gl(t, e, null), n = !0, i || (o = Kl( e, "click", /*click_handler*/ @@ -2158,7 +2158,7 @@ function Lo(l) { }, p(s, r) { (!n || r & /*active_source*/ - 1) && Mt( + 1) && At( e, "selected", /*active_source*/ @@ -2167,21 +2167,21 @@ function Lo(l) { ); }, i(s) { - n || (re(t.$$.fragment, s), n = !0); + n || (fe(t.$$.fragment, s), n = !0); }, o(s) { - Se(t.$$.fragment, s), n = !1; + ze(t.$$.fragment, s), n = !1; }, d(s) { - s && wn(e), Pl(t), i = !1, o(); + s && wn(e), Zl(t), i = !1, o(); } }; } -function Do(l) { +function Io(l) { let e, t, n, i, o; - return t = new dc({}), { + return t = new gc({}), { c() { - e = el("button"), Vl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Record audio"), Mt( + e = el("button"), Pl(t.$$.fragment), ot(e, "class", "icon svelte-1jp3vgd"), ot(e, "aria-label", "Record audio"), At( e, "selected", /*active_source*/ @@ -2189,7 +2189,7 @@ function Do(l) { ); }, m(s, r) { - pn(s, e, r), Kl(t, e, null), n = !0, i || (o = Zl( + pn(s, e, r), Gl(t, e, null), n = !0, i || (o = Kl( e, "click", /*click_handler_1*/ @@ -2198,7 +2198,7 @@ function Do(l) { }, p(s, r) { (!n || r & /*active_source*/ - 1) && Mt( + 1) && At( e, "selected", /*active_source*/ @@ -2206,21 +2206,21 @@ function Do(l) { ); }, i(s) { - n || (re(t.$$.fragment, s), n = !0); + n || (fe(t.$$.fragment, s), n = !0); }, o(s) { - Se(t.$$.fragment, s), n = !1; + ze(t.$$.fragment, s), n = !1; }, d(s) { - s && wn(e), Pl(t), i = !1, o(); + s && wn(e), Zl(t), i = !1, o(); } }; } -function Ro(l) { +function jo(l) { let e, t, n, i, o; - return t = new ca({}), { + return t = new ha({}), { c() { - e = el("button"), Vl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Capture from camera"), Mt( + e = el("button"), Pl(t.$$.fragment), ot(e, "class", "icon svelte-1jp3vgd"), ot(e, "aria-label", "Capture from camera"), At( e, "selected", /*active_source*/ @@ -2228,7 +2228,7 @@ function Ro(l) { ); }, m(s, r) { - pn(s, e, r), Kl(t, e, null), n = !0, i || (o = Zl( + pn(s, e, r), Gl(t, e, null), n = !0, i || (o = Kl( e, "click", /*click_handler_2*/ @@ -2237,7 +2237,7 @@ function Ro(l) { }, p(s, r) { (!n || r & /*active_source*/ - 1) && Mt( + 1) && At( e, "selected", /*active_source*/ @@ -2245,21 +2245,21 @@ function Ro(l) { ); }, i(s) { - n || (re(t.$$.fragment, s), n = !0); + n || (fe(t.$$.fragment, s), n = !0); }, o(s) { - Se(t.$$.fragment, s), n = !1; + ze(t.$$.fragment, s), n = !1; }, d(s) { - s && wn(e), Pl(t), i = !1, o(); + s && wn(e), Zl(t), i = !1, o(); } }; } -function To(l) { +function Ho(l) { let e, t, n, i, o; - return t = new fa({}), { + return t = new _a({}), { c() { - e = el("button"), Vl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Paste from clipboard"), Mt( + e = el("button"), Pl(t.$$.fragment), ot(e, "class", "icon svelte-1jp3vgd"), ot(e, "aria-label", "Paste from clipboard"), At( e, "selected", /*active_source*/ @@ -2267,7 +2267,7 @@ function To(l) { ); }, m(s, r) { - pn(s, e, r), Kl(t, e, null), n = !0, i || (o = Zl( + pn(s, e, r), Gl(t, e, null), n = !0, i || (o = Kl( e, "click", /*click_handler_3*/ @@ -2276,7 +2276,7 @@ function To(l) { }, p(s, r) { (!n || r & /*active_source*/ - 1) && Mt( + 1) && At( e, "selected", /*active_source*/ @@ -2284,24 +2284,24 @@ function To(l) { ); }, i(s) { - n || (re(t.$$.fragment, s), n = !0); + n || (fe(t.$$.fragment, s), n = !0); }, o(s) { - Se(t.$$.fragment, s), n = !1; + ze(t.$$.fragment, s), n = !1; }, d(s) { - s && wn(e), Pl(t), i = !1, o(); + s && wn(e), Zl(t), i = !1, o(); } }; } -function r_(l) { +function c_(l) { let e, t, n = ( /*unique_sources*/ - l[2].length > 1 && Ao(l) + l[2].length > 1 && Ro(l) ); return { c() { - n && n.c(), e = o_(); + n && n.c(), e = r_(); }, m(i, o) { n && n.m(i, o), pn(i, e, o), t = !0; @@ -2309,61 +2309,61 @@ function r_(l) { p(i, [o]) { /*unique_sources*/ i[2].length > 1 ? n ? (n.p(i, o), o & /*unique_sources*/ - 4 && re(n, 1)) : (n = Ao(i), n.c(), re(n, 1), n.m(e.parentNode, e)) : n && (Rn(), Se(n, 1, 1, () => { + 4 && fe(n, 1)) : (n = Ro(i), n.c(), fe(n, 1), n.m(e.parentNode, e)) : n && (Rn(), ze(n, 1, 1, () => { n = null; }), Dn()); }, i(i) { - t || (re(n), t = !0); + t || (fe(n), t = !0); }, o(i) { - Se(n), t = !1; + ze(n), t = !1; }, d(i) { i && wn(e), n && n.d(i); } }; } -function f_(l, e, t) { +function __(l, e, t) { let n; - var i = this && this.__awaiter || function(m, h, p, w) { - function b(g) { - return g instanceof p ? g : new p(function(k) { - k(g); + var i = this && this.__awaiter || function(h, m, w, b) { + function p(g) { + return g instanceof w ? g : new w(function(v) { + v(g); }); } - return new (p || (p = Promise))(function(g, k) { - function C(y) { + return new (w || (w = Promise))(function(g, v) { + function E(k) { try { - z(w.next(y)); + C(b.next(k)); } catch (A) { - k(A); + v(A); } } - function v(y) { + function y(k) { try { - z(w.throw(y)); + C(b.throw(k)); } catch (A) { - k(A); + v(A); } } - function z(y) { - y.done ? g(y.value) : b(y.value).then(C, v); + function C(k) { + k.done ? g(k.value) : p(k.value).then(E, y); } - z((w = w.apply(m, h || [])).next()); + C((b = b.apply(h, m || [])).next()); }); }; let { sources: o } = e, { active_source: s } = e, { handle_clear: r = () => { } } = e, { handle_select: a = () => { } } = e; - function f(m) { + function f(h) { return i(this, void 0, void 0, function* () { - r(), t(0, s = m), a(m); + r(), t(0, s = h), a(h); }); } const u = () => f("upload"), c = () => f("microphone"), _ = () => f("webcam"), d = () => f("clipboard"); - return l.$$set = (m) => { - "sources" in m && t(1, o = m.sources), "active_source" in m && t(0, s = m.active_source), "handle_clear" in m && t(4, r = m.handle_clear), "handle_select" in m && t(5, a = m.handle_select); + return l.$$set = (h) => { + "sources" in h && t(1, o = h.sources), "active_source" in h && t(0, s = h.active_source), "handle_clear" in h && t(4, r = h.handle_clear), "handle_select" in h && t(5, a = h.handle_select); }, l.$$.update = () => { l.$$.dirty & /*sources*/ 2 && t(2, n = [...new Set(o)]); @@ -2380,9 +2380,9 @@ function f_(l, e, t) { d ]; } -class u_ extends i_ { +class d_ extends a_ { constructor(e) { - super(), s_(this, e, f_, r_, a_, { + super(), f_(this, e, __, c_, u_, { sources: 1, active_source: 0, handle_clear: 4, @@ -2397,13 +2397,13 @@ function dn(l) { let n = e[t]; return (Number.isInteger(l) ? l : l.toFixed(1)) + n; } -function Bl() { +function El() { } -const c_ = (l) => l; -function __(l, e) { +const h_ = (l) => l; +function m_(l, e) { return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function"; } -function Io(l) { +function Fo(l) { const e = typeof l == "string" && l.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); return e ? [parseFloat(e[1]), e[2] || "px"] : [ /** @type {number} */ @@ -2411,17 +2411,17 @@ function Io(l) { "px" ]; } -const ga = typeof window < "u"; -let jo = ga ? () => window.performance.now() : () => Date.now(), ba = ga ? (l) => requestAnimationFrame(l) : Bl; +const pa = typeof window < "u"; +let Xo = pa ? () => window.performance.now() : () => Date.now(), va = pa ? (l) => requestAnimationFrame(l) : El; const gn = /* @__PURE__ */ new Set(); -function wa(l) { +function ka(l) { gn.forEach((e) => { e.c(l) || (gn.delete(e), e.f()); - }), gn.size !== 0 && ba(wa); + }), gn.size !== 0 && va(ka); } -function d_(l) { +function g_(l) { let e; - return gn.size === 0 && ba(wa), { + return gn.size === 0 && va(ka), { promise: new Promise((t) => { gn.add(e = { c: l, f: t }); }), @@ -2430,11 +2430,11 @@ function d_(l) { } }; } -function h_(l) { +function b_(l) { const e = l - 1; return e * e * e + 1; } -function m_(l, { delay: e = 0, duration: t = 400, easing: n = c_ } = {}) { +function w_(l, { delay: e = 0, duration: t = 400, easing: n = h_ } = {}) { const i = +getComputedStyle(l).opacity; return { delay: e, @@ -2443,23 +2443,23 @@ function m_(l, { delay: e = 0, duration: t = 400, easing: n = c_ } = {}) { css: (o) => `opacity: ${o * i}` }; } -function Ho(l, { delay: e = 0, duration: t = 400, easing: n = h_, x: i = 0, y: o = 0, opacity: s = 0 } = {}) { - const r = getComputedStyle(l), a = +r.opacity, f = r.transform === "none" ? "" : r.transform, u = a * (1 - s), [c, _] = Io(i), [d, m] = Io(o); +function Yo(l, { delay: e = 0, duration: t = 400, easing: n = b_, x: i = 0, y: o = 0, opacity: s = 0 } = {}) { + const r = getComputedStyle(l), a = +r.opacity, f = r.transform === "none" ? "" : r.transform, u = a * (1 - s), [c, _] = Fo(i), [d, h] = Fo(o); return { delay: e, duration: t, easing: n, - css: (h, p) => ` - transform: ${f} translate(${(1 - h) * c}${_}, ${(1 - h) * d}${m}); - opacity: ${a - u * p}` + css: (m, w) => ` + transform: ${f} translate(${(1 - m) * c}${_}, ${(1 - m) * d}${h}); + opacity: ${a - u * w}` }; } const an = []; -function g_(l, e = Bl) { +function p_(l, e = El) { let t; const n = /* @__PURE__ */ new Set(); function i(r) { - if (__(l, r) && (l = r, t)) { + if (m_(l, r) && (l = r, t)) { const a = !an.length; for (const f of n) f[1](), an.push(f, l); @@ -2473,157 +2473,157 @@ function g_(l, e = Bl) { function o(r) { i(r(l)); } - function s(r, a = Bl) { + function s(r, a = El) { const f = [r, a]; - return n.add(f), n.size === 1 && (t = e(i, o) || Bl), r(l), () => { + return n.add(f), n.size === 1 && (t = e(i, o) || El), r(l), () => { n.delete(f), n.size === 0 && t && (t(), t = null); }; } return { set: i, update: o, subscribe: s }; } -function Fo(l) { +function No(l) { return Object.prototype.toString.call(l) === "[object Date]"; } -function Ui(l, e, t, n) { - if (typeof t == "number" || Fo(t)) { +function Vi(l, e, t, n) { + if (typeof t == "number" || No(t)) { const i = n - t, o = (t - e) / (l.dt || 1 / 60), s = l.opts.stiffness * i, r = l.opts.damping * o, a = (s - r) * l.inv_mass, f = (o + a) * l.dt; - return Math.abs(f) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, Fo(t) ? new Date(t.getTime() + f) : t + f); + return Math.abs(f) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, No(t) ? new Date(t.getTime() + f) : t + f); } else { if (Array.isArray(t)) return t.map( - (i, o) => Ui(l, e[o], t[o], n[o]) + (i, o) => Vi(l, e[o], t[o], n[o]) ); if (typeof t == "object") { const i = {}; for (const o in t) - i[o] = Ui(l, e[o], t[o], n[o]); + i[o] = Vi(l, e[o], t[o], n[o]); return i; } else throw new Error(`Cannot spring ${typeof t} values`); } } -function Xo(l, e = {}) { - const t = g_(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e; +function Uo(l, e = {}) { + const t = p_(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e; let s, r, a, f = l, u = l, c = 1, _ = 0, d = !1; - function m(p, w = {}) { - u = p; - const b = a = {}; - return l == null || w.hard || h.stiffness >= 1 && h.damping >= 1 ? (d = !0, s = jo(), f = p, t.set(l = u), Promise.resolve()) : (w.soft && (_ = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), c = 0), r || (s = jo(), d = !1, r = d_((g) => { + function h(w, b = {}) { + u = w; + const p = a = {}; + return l == null || b.hard || m.stiffness >= 1 && m.damping >= 1 ? (d = !0, s = Xo(), f = w, t.set(l = u), Promise.resolve()) : (b.soft && (_ = 1 / ((b.soft === !0 ? 0.5 : +b.soft) * 60), c = 0), r || (s = Xo(), d = !1, r = g_((g) => { if (d) return d = !1, r = null, !1; c = Math.min(c + _, 1); - const k = { + const v = { inv_mass: c, - opts: h, + opts: m, settled: !0, dt: (g - s) * 60 / 1e3 - }, C = Ui(k, f, l, u); - return s = g, f = l, t.set(l = C), k.settled && (r = null), !k.settled; + }, E = Vi(v, f, l, u); + return s = g, f = l, t.set(l = E), v.settled && (r = null), !v.settled; })), new Promise((g) => { r.promise.then(() => { - b === a && g(); + p === a && g(); }); })); } - const h = { - set: m, - update: (p, w) => m(p(u, l), w), + const m = { + set: h, + update: (w, b) => h(w(u, l), b), subscribe: t.subscribe, stiffness: n, damping: i, precision: o }; - return h; + return m; } const { - SvelteComponent: b_, + SvelteComponent: v_, append: Ve, - attr: W, - component_subscribe: Yo, - detach: w_, - element: p_, - init: v_, - insert: k_, - noop: No, - safe_not_equal: y_, + attr: O, + component_subscribe: Oo, + detach: k_, + element: y_, + init: C_, + insert: S_, + noop: Wo, + safe_not_equal: z_, set_style: cl, svg_element: Pe, - toggle_class: Uo -} = window.__gradio__svelte__internal, { onMount: C_ } = window.__gradio__svelte__internal; -function S_(l) { + toggle_class: Vo +} = window.__gradio__svelte__internal, { onMount: B_ } = window.__gradio__svelte__internal; +function q_(l) { let e, t, n, i, o, s, r, a, f, u, c, _; return { c() { - e = p_("div"), t = Pe("svg"), n = Pe("g"), i = Pe("path"), o = Pe("path"), s = Pe("path"), r = Pe("path"), a = Pe("g"), f = Pe("path"), u = Pe("path"), c = Pe("path"), _ = Pe("path"), W(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), W(i, "fill", "#FF7C00"), W(i, "fill-opacity", "0.4"), W(i, "class", "svelte-43sxxs"), W(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), W(o, "fill", "#FF7C00"), W(o, "class", "svelte-43sxxs"), W(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), W(s, "fill", "#FF7C00"), W(s, "fill-opacity", "0.4"), W(s, "class", "svelte-43sxxs"), W(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), W(r, "fill", "#FF7C00"), W(r, "class", "svelte-43sxxs"), cl(n, "transform", "translate(" + /*$top*/ + e = y_("div"), t = Pe("svg"), n = Pe("g"), i = Pe("path"), o = Pe("path"), s = Pe("path"), r = Pe("path"), a = Pe("g"), f = Pe("path"), u = Pe("path"), c = Pe("path"), _ = Pe("path"), O(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), O(i, "fill", "#FF7C00"), O(i, "fill-opacity", "0.4"), O(i, "class", "svelte-43sxxs"), O(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), O(o, "fill", "#FF7C00"), O(o, "class", "svelte-43sxxs"), O(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), O(s, "fill", "#FF7C00"), O(s, "fill-opacity", "0.4"), O(s, "class", "svelte-43sxxs"), O(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), O(r, "fill", "#FF7C00"), O(r, "class", "svelte-43sxxs"), cl(n, "transform", "translate(" + /*$top*/ l[1][0] + "px, " + /*$top*/ - l[1][1] + "px)"), W(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), W(f, "fill", "#FF7C00"), W(f, "fill-opacity", "0.4"), W(f, "class", "svelte-43sxxs"), W(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), W(u, "fill", "#FF7C00"), W(u, "class", "svelte-43sxxs"), W(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), W(c, "fill", "#FF7C00"), W(c, "fill-opacity", "0.4"), W(c, "class", "svelte-43sxxs"), W(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), W(_, "fill", "#FF7C00"), W(_, "class", "svelte-43sxxs"), cl(a, "transform", "translate(" + /*$bottom*/ + l[1][1] + "px)"), O(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), O(f, "fill", "#FF7C00"), O(f, "fill-opacity", "0.4"), O(f, "class", "svelte-43sxxs"), O(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), O(u, "fill", "#FF7C00"), O(u, "class", "svelte-43sxxs"), O(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), O(c, "fill", "#FF7C00"), O(c, "fill-opacity", "0.4"), O(c, "class", "svelte-43sxxs"), O(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), O(_, "fill", "#FF7C00"), O(_, "class", "svelte-43sxxs"), cl(a, "transform", "translate(" + /*$bottom*/ l[2][0] + "px, " + /*$bottom*/ - l[2][1] + "px)"), W(t, "viewBox", "-1200 -1200 3000 3000"), W(t, "fill", "none"), W(t, "xmlns", "http://www.w3.org/2000/svg"), W(t, "class", "svelte-43sxxs"), W(e, "class", "svelte-43sxxs"), Uo( + l[2][1] + "px)"), O(t, "viewBox", "-1200 -1200 3000 3000"), O(t, "fill", "none"), O(t, "xmlns", "http://www.w3.org/2000/svg"), O(t, "class", "svelte-43sxxs"), O(e, "class", "svelte-43sxxs"), Vo( e, "margin", /*margin*/ l[0] ); }, - m(d, m) { - k_(d, e, m), Ve(e, t), Ve(t, n), Ve(n, i), Ve(n, o), Ve(n, s), Ve(n, r), Ve(t, a), Ve(a, f), Ve(a, u), Ve(a, c), Ve(a, _); + m(d, h) { + S_(d, e, h), Ve(e, t), Ve(t, n), Ve(n, i), Ve(n, o), Ve(n, s), Ve(n, r), Ve(t, a), Ve(a, f), Ve(a, u), Ve(a, c), Ve(a, _); }, - p(d, [m]) { - m & /*$top*/ + p(d, [h]) { + h & /*$top*/ 2 && cl(n, "transform", "translate(" + /*$top*/ d[1][0] + "px, " + /*$top*/ - d[1][1] + "px)"), m & /*$bottom*/ + d[1][1] + "px)"), h & /*$bottom*/ 4 && cl(a, "transform", "translate(" + /*$bottom*/ d[2][0] + "px, " + /*$bottom*/ - d[2][1] + "px)"), m & /*margin*/ - 1 && Uo( + d[2][1] + "px)"), h & /*margin*/ + 1 && Vo( e, "margin", /*margin*/ d[0] ); }, - i: No, - o: No, + i: Wo, + o: Wo, d(d) { - d && w_(e); + d && k_(e); } }; } -function z_(l, e, t) { +function E_(l, e, t) { let n, i; - var o = this && this.__awaiter || function(d, m, h, p) { - function w(b) { - return b instanceof h ? b : new h(function(g) { - g(b); + var o = this && this.__awaiter || function(d, h, m, w) { + function b(p) { + return p instanceof m ? p : new m(function(g) { + g(p); }); } - return new (h || (h = Promise))(function(b, g) { - function k(z) { + return new (m || (m = Promise))(function(p, g) { + function v(C) { try { - v(p.next(z)); - } catch (y) { - g(y); + y(w.next(C)); + } catch (k) { + g(k); } } - function C(z) { + function E(C) { try { - v(p.throw(z)); - } catch (y) { - g(y); + y(w.throw(C)); + } catch (k) { + g(k); } } - function v(z) { - z.done ? b(z.value) : w(z.value).then(k, C); + function y(C) { + C.done ? p(C.value) : b(C.value).then(v, E); } - v((p = p.apply(d, m || [])).next()); + y((w = w.apply(d, h || [])).next()); }); }; let { margin: s = !0 } = e; - const r = Xo([0, 0]); - Yo(l, r, (d) => t(1, n = d)); - const a = Xo([0, 0]); - Yo(l, a, (d) => t(2, i = d)); + const r = Uo([0, 0]); + Oo(l, r, (d) => t(1, n = d)); + const a = Uo([0, 0]); + Oo(l, a, (d) => t(2, i = d)); let f; function u() { return o(this, void 0, void 0, function* () { @@ -2640,62 +2640,62 @@ function z_(l, e, t) { yield Promise.all([r.set([125, 0]), a.set([-125, 0])]), c(); }); } - return C_(() => (_(), () => f = !0)), l.$$set = (d) => { + return B_(() => (_(), () => f = !0)), l.$$set = (d) => { "margin" in d && t(0, s = d.margin); }, [s, n, i, r, a]; } -class q_ extends b_ { +class M_ extends v_ { constructor(e) { - super(), v_(this, e, z_, S_, y_, { margin: 0 }); + super(), C_(this, e, E_, q_, z_, { margin: 0 }); } } const { - SvelteComponent: B_, + SvelteComponent: A_, append: Pt, attr: Je, - binding_callbacks: Oo, - check_outros: Oi, - create_component: pa, - create_slot: va, - destroy_component: ka, - destroy_each: ya, - detach: F, - element: nt, + binding_callbacks: Po, + check_outros: Pi, + create_component: ya, + create_slot: Ca, + destroy_component: Sa, + destroy_each: za, + detach: X, + element: lt, empty: vn, - ensure_array_like: Rl, - get_all_dirty_from_scope: Ca, - get_slot_changes: Sa, - group_outros: Wi, - init: E_, - insert: X, - mount_component: za, - noop: Vi, - safe_not_equal: M_, - set_data: Ne, - set_style: Bt, - space: Ye, - text: ne, - toggle_class: Xe, + ensure_array_like: Tl, + get_all_dirty_from_scope: Ba, + get_slot_changes: qa, + group_outros: Zi, + init: L_, + insert: Y, + mount_component: Ea, + noop: Ki, + safe_not_equal: D_, + set_data: Fe, + set_style: Et, + space: He, + text: le, + toggle_class: je, transition_in: Ge, - transition_out: lt, - update_slot_base: qa -} = window.__gradio__svelte__internal, { tick: A_ } = window.__gradio__svelte__internal, { onDestroy: L_ } = window.__gradio__svelte__internal, { createEventDispatcher: D_ } = window.__gradio__svelte__internal, R_ = (l) => ({}), Wo = (l) => ({}), T_ = (l) => ({}), Vo = (l) => ({}); -function Po(l, e, t) { + transition_out: it, + update_slot_base: Ma +} = window.__gradio__svelte__internal, { tick: R_ } = window.__gradio__svelte__internal, { onDestroy: T_ } = window.__gradio__svelte__internal, { createEventDispatcher: I_ } = window.__gradio__svelte__internal, j_ = (l) => ({}), Zo = (l) => ({}), H_ = (l) => ({}), Ko = (l) => ({}); +function Go(l, e, t) { const n = l.slice(); return n[41] = e[t], n[43] = t, n; } -function Zo(l, e, t) { +function Jo(l, e, t) { const n = l.slice(); return n[41] = e[t], n; } -function I_(l) { +function F_(l) { let e, t, n, i, o = ( /*i18n*/ l[1]("common.error") + "" ), s, r, a; - t = new Wl({ + t = new Vl({ props: { - Icon: aa, + Icon: ua, label: ( /*i18n*/ l[1]("common.clear") @@ -2710,19 +2710,19 @@ function I_(l) { const f = ( /*#slots*/ l[30].error - ), u = va( + ), u = Ca( f, l, /*$$scope*/ l[29], - Wo + Zo ); return { c() { - e = nt("div"), pa(t.$$.fragment), n = Ye(), i = nt("span"), s = ne(o), r = Ye(), u && u.c(), Je(e, "class", "clear-status svelte-16nch4a"), Je(i, "class", "error svelte-16nch4a"); + e = lt("div"), ya(t.$$.fragment), n = He(), i = lt("span"), s = le(o), r = He(), u && u.c(), Je(e, "class", "clear-status svelte-16nch4a"), Je(i, "class", "error svelte-16nch4a"); }, m(c, _) { - X(c, e, _), za(t, e, null), X(c, n, _), X(c, i, _), Pt(i, s), X(c, r, _), u && u.m(c, _), a = !0; + Y(c, e, _), Ea(t, e, null), Y(c, n, _), Y(c, i, _), Pt(i, s), Y(c, r, _), u && u.m(c, _), a = !0; }, p(c, _) { const d = {}; @@ -2730,66 +2730,66 @@ function I_(l) { 2 && (d.label = /*i18n*/ c[1]("common.clear")), t.$set(d), (!a || _[0] & /*i18n*/ 2) && o !== (o = /*i18n*/ - c[1]("common.error") + "") && Ne(s, o), u && u.p && (!a || _[0] & /*$$scope*/ - 536870912) && qa( + c[1]("common.error") + "") && Fe(s, o), u && u.p && (!a || _[0] & /*$$scope*/ + 536870912) && Ma( u, f, c, /*$$scope*/ c[29], - a ? Sa( + a ? qa( f, /*$$scope*/ c[29], _, - R_ - ) : Ca( + j_ + ) : Ba( /*$$scope*/ c[29] ), - Wo + Zo ); }, i(c) { a || (Ge(t.$$.fragment, c), Ge(u, c), a = !0); }, o(c) { - lt(t.$$.fragment, c), lt(u, c), a = !1; + it(t.$$.fragment, c), it(u, c), a = !1; }, d(c) { - c && (F(e), F(n), F(i), F(r)), ka(t), u && u.d(c); + c && (X(e), X(n), X(i), X(r)), Sa(t), u && u.d(c); } }; } -function j_(l) { +function X_(l) { let e, t, n, i, o, s, r, a, f, u = ( /*variant*/ l[8] === "default" && /*show_eta_bar*/ l[18] && /*show_progress*/ - l[6] === "full" && Ko(l) + l[6] === "full" && Qo(l) ); - function c(g, k) { + function c(g, v) { if ( /*progress*/ g[7] - ) return X_; + ) return U_; if ( /*queue_position*/ g[2] !== null && /*queue_size*/ g[3] !== void 0 && /*queue_position*/ g[2] >= 0 - ) return F_; + ) return N_; if ( /*queue_position*/ g[2] === 0 - ) return H_; + ) return Y_; } - let _ = c(l), d = _ && _(l), m = ( + let _ = c(l), d = _ && _(l), h = ( /*timer*/ - l[5] && Qo(l) + l[5] && es(l) ); - const h = [O_, U_], p = []; - function w(g, k) { + const m = [P_, V_], w = []; + function b(g, v) { return ( /*last_progress_level*/ g[15] != null ? 0 : ( @@ -2798,136 +2798,136 @@ function j_(l) { ) ); } - ~(o = w(l)) && (s = p[o] = h[o](l)); - let b = !/*timer*/ - l[5] && is(l); + ~(o = b(l)) && (s = w[o] = m[o](l)); + let p = !/*timer*/ + l[5] && as(l); return { c() { - u && u.c(), e = Ye(), t = nt("div"), d && d.c(), n = Ye(), m && m.c(), i = Ye(), s && s.c(), r = Ye(), b && b.c(), a = vn(), Je(t, "class", "progress-text svelte-16nch4a"), Xe( + u && u.c(), e = He(), t = lt("div"), d && d.c(), n = He(), h && h.c(), i = He(), s && s.c(), r = He(), p && p.c(), a = vn(), Je(t, "class", "progress-text svelte-16nch4a"), je( t, "meta-text-center", /*variant*/ l[8] === "center" - ), Xe( + ), je( t, "meta-text", /*variant*/ l[8] === "default" ); }, - m(g, k) { - u && u.m(g, k), X(g, e, k), X(g, t, k), d && d.m(t, null), Pt(t, n), m && m.m(t, null), X(g, i, k), ~o && p[o].m(g, k), X(g, r, k), b && b.m(g, k), X(g, a, k), f = !0; + m(g, v) { + u && u.m(g, v), Y(g, e, v), Y(g, t, v), d && d.m(t, null), Pt(t, n), h && h.m(t, null), Y(g, i, v), ~o && w[o].m(g, v), Y(g, r, v), p && p.m(g, v), Y(g, a, v), f = !0; }, - p(g, k) { + p(g, v) { /*variant*/ g[8] === "default" && /*show_eta_bar*/ g[18] && /*show_progress*/ - g[6] === "full" ? u ? u.p(g, k) : (u = Ko(g), u.c(), u.m(e.parentNode, e)) : u && (u.d(1), u = null), _ === (_ = c(g)) && d ? d.p(g, k) : (d && d.d(1), d = _ && _(g), d && (d.c(), d.m(t, n))), /*timer*/ - g[5] ? m ? m.p(g, k) : (m = Qo(g), m.c(), m.m(t, null)) : m && (m.d(1), m = null), (!f || k[0] & /*variant*/ - 256) && Xe( + g[6] === "full" ? u ? u.p(g, v) : (u = Qo(g), u.c(), u.m(e.parentNode, e)) : u && (u.d(1), u = null), _ === (_ = c(g)) && d ? d.p(g, v) : (d && d.d(1), d = _ && _(g), d && (d.c(), d.m(t, n))), /*timer*/ + g[5] ? h ? h.p(g, v) : (h = es(g), h.c(), h.m(t, null)) : h && (h.d(1), h = null), (!f || v[0] & /*variant*/ + 256) && je( t, "meta-text-center", /*variant*/ g[8] === "center" - ), (!f || k[0] & /*variant*/ - 256) && Xe( + ), (!f || v[0] & /*variant*/ + 256) && je( t, "meta-text", /*variant*/ g[8] === "default" ); - let C = o; - o = w(g), o === C ? ~o && p[o].p(g, k) : (s && (Wi(), lt(p[C], 1, 1, () => { - p[C] = null; - }), Oi()), ~o ? (s = p[o], s ? s.p(g, k) : (s = p[o] = h[o](g), s.c()), Ge(s, 1), s.m(r.parentNode, r)) : s = null), /*timer*/ - g[5] ? b && (Wi(), lt(b, 1, 1, () => { - b = null; - }), Oi()) : b ? (b.p(g, k), k[0] & /*timer*/ - 32 && Ge(b, 1)) : (b = is(g), b.c(), Ge(b, 1), b.m(a.parentNode, a)); + let E = o; + o = b(g), o === E ? ~o && w[o].p(g, v) : (s && (Zi(), it(w[E], 1, 1, () => { + w[E] = null; + }), Pi()), ~o ? (s = w[o], s ? s.p(g, v) : (s = w[o] = m[o](g), s.c()), Ge(s, 1), s.m(r.parentNode, r)) : s = null), /*timer*/ + g[5] ? p && (Zi(), it(p, 1, 1, () => { + p = null; + }), Pi()) : p ? (p.p(g, v), v[0] & /*timer*/ + 32 && Ge(p, 1)) : (p = as(g), p.c(), Ge(p, 1), p.m(a.parentNode, a)); }, i(g) { - f || (Ge(s), Ge(b), f = !0); + f || (Ge(s), Ge(p), f = !0); }, o(g) { - lt(s), lt(b), f = !1; + it(s), it(p), f = !1; }, d(g) { - g && (F(e), F(t), F(i), F(r), F(a)), u && u.d(g), d && d.d(), m && m.d(), ~o && p[o].d(g), b && b.d(g); + g && (X(e), X(t), X(i), X(r), X(a)), u && u.d(g), d && d.d(), h && h.d(), ~o && w[o].d(g), p && p.d(g); } }; } -function Ko(l) { +function Qo(l) { let e, t = `translateX(${/*eta_level*/ (l[17] || 0) * 100 - 100}%)`; return { c() { - e = nt("div"), Je(e, "class", "eta-bar svelte-16nch4a"), Bt(e, "transform", t); + e = lt("div"), Je(e, "class", "eta-bar svelte-16nch4a"), Et(e, "transform", t); }, m(n, i) { - X(n, e, i); + Y(n, e, i); }, p(n, i) { i[0] & /*eta_level*/ 131072 && t !== (t = `translateX(${/*eta_level*/ - (n[17] || 0) * 100 - 100}%)`) && Bt(e, "transform", t); + (n[17] || 0) * 100 - 100}%)`) && Et(e, "transform", t); }, d(n) { - n && F(e); + n && X(e); } }; } -function H_(l) { +function Y_(l) { let e; return { c() { - e = ne("processing |"); + e = le("processing |"); }, m(t, n) { - X(t, e, n); + Y(t, e, n); }, - p: Vi, + p: Ki, d(t) { - t && F(e); + t && X(e); } }; } -function F_(l) { +function N_(l) { let e, t = ( /*queue_position*/ l[2] + 1 + "" ), n, i, o, s; return { c() { - e = ne("queue: "), n = ne(t), i = ne("/"), o = ne( + e = le("queue: "), n = le(t), i = le("/"), o = le( /*queue_size*/ l[3] - ), s = ne(" |"); + ), s = le(" |"); }, m(r, a) { - X(r, e, a), X(r, n, a), X(r, i, a), X(r, o, a), X(r, s, a); + Y(r, e, a), Y(r, n, a), Y(r, i, a), Y(r, o, a), Y(r, s, a); }, p(r, a) { a[0] & /*queue_position*/ 4 && t !== (t = /*queue_position*/ - r[2] + 1 + "") && Ne(n, t), a[0] & /*queue_size*/ - 8 && Ne( + r[2] + 1 + "") && Fe(n, t), a[0] & /*queue_size*/ + 8 && Fe( o, /*queue_size*/ r[3] ); }, d(r) { - r && (F(e), F(n), F(i), F(o), F(s)); + r && (X(e), X(n), X(i), X(o), X(s)); } }; } -function X_(l) { - let e, t = Rl( +function U_(l) { + let e, t = Tl( /*progress*/ l[7] ), n = []; for (let i = 0; i < t.length; i += 1) - n[i] = Jo(Zo(l, t, i)); + n[i] = $o(Jo(l, t, i)); return { c() { for (let i = 0; i < n.length; i += 1) @@ -2937,19 +2937,19 @@ function X_(l) { m(i, o) { for (let s = 0; s < n.length; s += 1) n[s] && n[s].m(i, o); - X(i, e, o); + Y(i, e, o); }, p(i, o) { if (o[0] & /*progress*/ 128) { - t = Rl( + t = Tl( /*progress*/ i[7] ); let s; for (s = 0; s < t.length; s += 1) { - const r = Zo(i, t, s); - n[s] ? n[s].p(r, o) : (n[s] = Jo(r), n[s].c(), n[s].m(e.parentNode, e)); + const r = Jo(i, t, s); + n[s] ? n[s].p(r, o) : (n[s] = $o(r), n[s].c(), n[s].m(e.parentNode, e)); } for (; s < n.length; s += 1) n[s].d(1); @@ -2957,11 +2957,11 @@ function X_(l) { } }, d(i) { - i && F(e), ya(n, i); + i && X(e), za(n, i); } }; } -function Go(l) { +function xo(l) { let e, t = ( /*p*/ l[41].unit + "" @@ -2969,52 +2969,52 @@ function Go(l) { function r(u, c) { return ( /*p*/ - u[41].length != null ? N_ : Y_ + u[41].length != null ? W_ : O_ ); } let a = r(l), f = a(l); return { c() { - f.c(), e = Ye(), n = ne(t), i = ne(" | "), s = ne(o); + f.c(), e = He(), n = le(t), i = le(" | "), s = le(o); }, m(u, c) { - f.m(u, c), X(u, e, c), X(u, n, c), X(u, i, c), X(u, s, c); + f.m(u, c), Y(u, e, c), Y(u, n, c), Y(u, i, c), Y(u, s, c); }, p(u, c) { a === (a = r(u)) && f ? f.p(u, c) : (f.d(1), f = a(u), f && (f.c(), f.m(e.parentNode, e))), c[0] & /*progress*/ 128 && t !== (t = /*p*/ - u[41].unit + "") && Ne(n, t); + u[41].unit + "") && Fe(n, t); }, d(u) { - u && (F(e), F(n), F(i), F(s)), f.d(u); + u && (X(e), X(n), X(i), X(s)), f.d(u); } }; } -function Y_(l) { +function O_(l) { let e = dn( /*p*/ l[41].index || 0 ) + "", t; return { c() { - t = ne(e); + t = le(e); }, m(n, i) { - X(n, t, i); + Y(n, t, i); }, p(n, i) { i[0] & /*progress*/ 128 && e !== (e = dn( /*p*/ n[41].index || 0 - ) + "") && Ne(t, e); + ) + "") && Fe(t, e); }, d(n) { - n && F(t); + n && X(t); } }; } -function N_(l) { +function W_(l) { let e = dn( /*p*/ l[41].index || 0 @@ -3024,49 +3024,49 @@ function N_(l) { ) + "", o; return { c() { - t = ne(e), n = ne("/"), o = ne(i); + t = le(e), n = le("/"), o = le(i); }, m(s, r) { - X(s, t, r), X(s, n, r), X(s, o, r); + Y(s, t, r), Y(s, n, r), Y(s, o, r); }, p(s, r) { r[0] & /*progress*/ 128 && e !== (e = dn( /*p*/ s[41].index || 0 - ) + "") && Ne(t, e), r[0] & /*progress*/ + ) + "") && Fe(t, e), r[0] & /*progress*/ 128 && i !== (i = dn( /*p*/ s[41].length - ) + "") && Ne(o, i); + ) + "") && Fe(o, i); }, d(s) { - s && (F(t), F(n), F(o)); + s && (X(t), X(n), X(o)); } }; } -function Jo(l) { +function $o(l) { let e, t = ( /*p*/ - l[41].index != null && Go(l) + l[41].index != null && xo(l) ); return { c() { t && t.c(), e = vn(); }, m(n, i) { - t && t.m(n, i), X(n, e, i); + t && t.m(n, i), Y(n, e, i); }, p(n, i) { /*p*/ - n[41].index != null ? t ? t.p(n, i) : (t = Go(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[41].index != null ? t ? t.p(n, i) : (t = xo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(n) { - n && F(e), t && t.d(n); + n && X(e), t && t.d(n); } }; } -function Qo(l) { +function es(l) { let e, t = ( /*eta*/ l[0] ? `/${/*formatted_eta*/ @@ -3074,43 +3074,43 @@ function Qo(l) { ), n, i; return { c() { - e = ne( + e = le( /*formatted_timer*/ l[20] - ), n = ne(t), i = ne("s"); + ), n = le(t), i = le("s"); }, m(o, s) { - X(o, e, s), X(o, n, s), X(o, i, s); + Y(o, e, s), Y(o, n, s), Y(o, i, s); }, p(o, s) { s[0] & /*formatted_timer*/ - 1048576 && Ne( + 1048576 && Fe( e, /*formatted_timer*/ o[20] ), s[0] & /*eta, formatted_eta*/ 524289 && t !== (t = /*eta*/ o[0] ? `/${/*formatted_eta*/ - o[19]}` : "") && Ne(n, t); + o[19]}` : "") && Fe(n, t); }, d(o) { - o && (F(e), F(n), F(i)); + o && (X(e), X(n), X(i)); } }; } -function U_(l) { +function V_(l) { let e, t; - return e = new q_({ + return e = new M_({ props: { margin: ( /*variant*/ l[8] === "default" ) } }), { c() { - pa(e.$$.fragment); + ya(e.$$.fragment); }, m(n, i) { - za(e, n, i), t = !0; + Ea(e, n, i), t = !0; }, p(n, i) { const o = {}; @@ -3122,46 +3122,46 @@ function U_(l) { t || (Ge(e.$$.fragment, n), t = !0); }, o(n) { - lt(e.$$.fragment, n), t = !1; + it(e.$$.fragment, n), t = !1; }, d(n) { - ka(e, n); + Sa(e, n); } }; } -function O_(l) { +function P_(l) { let e, t, n, i, o, s = `${/*last_progress_level*/ l[15] * 100}%`, r = ( /*progress*/ - l[7] != null && xo(l) + l[7] != null && ts(l) ); return { c() { - e = nt("div"), t = nt("div"), r && r.c(), n = Ye(), i = nt("div"), o = nt("div"), Je(t, "class", "progress-level-inner svelte-16nch4a"), Je(o, "class", "progress-bar svelte-16nch4a"), Bt(o, "width", s), Je(i, "class", "progress-bar-wrap svelte-16nch4a"), Je(e, "class", "progress-level svelte-16nch4a"); + e = lt("div"), t = lt("div"), r && r.c(), n = He(), i = lt("div"), o = lt("div"), Je(t, "class", "progress-level-inner svelte-16nch4a"), Je(o, "class", "progress-bar svelte-16nch4a"), Et(o, "width", s), Je(i, "class", "progress-bar-wrap svelte-16nch4a"), Je(e, "class", "progress-level svelte-16nch4a"); }, m(a, f) { - X(a, e, f), Pt(e, t), r && r.m(t, null), Pt(e, n), Pt(e, i), Pt(i, o), l[31](o); + Y(a, e, f), Pt(e, t), r && r.m(t, null), Pt(e, n), Pt(e, i), Pt(i, o), l[31](o); }, p(a, f) { /*progress*/ - a[7] != null ? r ? r.p(a, f) : (r = xo(a), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/ + a[7] != null ? r ? r.p(a, f) : (r = ts(a), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/ 32768 && s !== (s = `${/*last_progress_level*/ - a[15] * 100}%`) && Bt(o, "width", s); + a[15] * 100}%`) && Et(o, "width", s); }, - i: Vi, - o: Vi, + i: Ki, + o: Ki, d(a) { - a && F(e), r && r.d(), l[31](null); + a && X(e), r && r.d(), l[31](null); } }; } -function xo(l) { - let e, t = Rl( +function ts(l) { + let e, t = Tl( /*progress*/ l[7] ), n = []; for (let i = 0; i < t.length; i += 1) - n[i] = ls(Po(l, t, i)); + n[i] = ss(Go(l, t, i)); return { c() { for (let i = 0; i < n.length; i += 1) @@ -3171,19 +3171,19 @@ function xo(l) { m(i, o) { for (let s = 0; s < n.length; s += 1) n[s] && n[s].m(i, o); - X(i, e, o); + Y(i, e, o); }, p(i, o) { if (o[0] & /*progress_level, progress*/ 16512) { - t = Rl( + t = Tl( /*progress*/ i[7] ); let s; for (s = 0; s < t.length; s += 1) { - const r = Po(i, t, s); - n[s] ? n[s].p(r, o) : (n[s] = ls(r), n[s].c(), n[s].m(e.parentNode, e)); + const r = Go(i, t, s); + n[s] ? n[s].p(r, o) : (n[s] = ss(r), n[s].c(), n[s].m(e.parentNode, e)); } for (; s < n.length; s += 1) n[s].d(1); @@ -3191,17 +3191,17 @@ function xo(l) { } }, d(i) { - i && F(e), ya(n, i); + i && X(e), za(n, i); } }; } -function $o(l) { +function ns(l) { let e, t, n, i, o = ( /*i*/ - l[43] !== 0 && W_() + l[43] !== 0 && Z_() ), s = ( /*p*/ - l[41].desc != null && es(l) + l[41].desc != null && ls(l) ), r = ( /*p*/ l[41].desc != null && /*progress_level*/ @@ -3209,85 +3209,85 @@ function $o(l) { l[14][ /*i*/ l[43] - ] != null && ts() + ] != null && is() ), a = ( /*progress_level*/ - l[14] != null && ns(l) + l[14] != null && os(l) ); return { c() { - o && o.c(), e = Ye(), s && s.c(), t = Ye(), r && r.c(), n = Ye(), a && a.c(), i = vn(); + o && o.c(), e = He(), s && s.c(), t = He(), r && r.c(), n = He(), a && a.c(), i = vn(); }, m(f, u) { - o && o.m(f, u), X(f, e, u), s && s.m(f, u), X(f, t, u), r && r.m(f, u), X(f, n, u), a && a.m(f, u), X(f, i, u); + o && o.m(f, u), Y(f, e, u), s && s.m(f, u), Y(f, t, u), r && r.m(f, u), Y(f, n, u), a && a.m(f, u), Y(f, i, u); }, p(f, u) { /*p*/ - f[41].desc != null ? s ? s.p(f, u) : (s = es(f), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/ + f[41].desc != null ? s ? s.p(f, u) : (s = ls(f), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/ f[41].desc != null && /*progress_level*/ f[14] && /*progress_level*/ f[14][ /*i*/ f[43] - ] != null ? r || (r = ts(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/ - f[14] != null ? a ? a.p(f, u) : (a = ns(f), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null); + ] != null ? r || (r = is(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/ + f[14] != null ? a ? a.p(f, u) : (a = os(f), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null); }, d(f) { - f && (F(e), F(t), F(n), F(i)), o && o.d(f), s && s.d(f), r && r.d(f), a && a.d(f); + f && (X(e), X(t), X(n), X(i)), o && o.d(f), s && s.d(f), r && r.d(f), a && a.d(f); } }; } -function W_(l) { +function Z_(l) { let e; return { c() { - e = ne(" /"); + e = le(" /"); }, m(t, n) { - X(t, e, n); + Y(t, e, n); }, d(t) { - t && F(e); + t && X(e); } }; } -function es(l) { +function ls(l) { let e = ( /*p*/ l[41].desc + "" ), t; return { c() { - t = ne(e); + t = le(e); }, m(n, i) { - X(n, t, i); + Y(n, t, i); }, p(n, i) { i[0] & /*progress*/ 128 && e !== (e = /*p*/ - n[41].desc + "") && Ne(t, e); + n[41].desc + "") && Fe(t, e); }, d(n) { - n && F(t); + n && X(t); } }; } -function ts(l) { +function is(l) { let e; return { c() { - e = ne("-"); + e = le("-"); }, m(t, n) { - X(t, e, n); + Y(t, e, n); }, d(t) { - t && F(e); + t && X(e); } }; } -function ns(l) { +function os(l) { let e = (100 * /*progress_level*/ (l[14][ /*i*/ @@ -3295,10 +3295,10 @@ function ns(l) { ] || 0)).toFixed(1) + "", t, n; return { c() { - t = ne(e), n = ne("%"); + t = le(e), n = le("%"); }, m(i, o) { - X(i, t, o), X(i, n, o); + Y(i, t, o), Y(i, n, o); }, p(i, o) { o[0] & /*progress_level*/ @@ -3306,14 +3306,14 @@ function ns(l) { (i[14][ /*i*/ i[43] - ] || 0)).toFixed(1) + "") && Ne(t, e); + ] || 0)).toFixed(1) + "") && Fe(t, e); }, d(i) { - i && (F(t), F(n)); + i && (X(t), X(n)); } }; } -function ls(l) { +function ss(l) { let e, t = ( /*p*/ (l[41].desc != null || /*progress_level*/ @@ -3321,14 +3321,14 @@ function ls(l) { l[14][ /*i*/ l[43] - ] != null) && $o(l) + ] != null) && ns(l) ); return { c() { t && t.c(), e = vn(); }, m(n, i) { - t && t.m(n, i), X(n, e, i); + t && t.m(n, i), Y(n, e, i); }, p(n, i) { /*p*/ @@ -3337,75 +3337,75 @@ function ls(l) { n[14][ /*i*/ n[43] - ] != null ? t ? t.p(n, i) : (t = $o(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + ] != null ? t ? t.p(n, i) : (t = ns(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(n) { - n && F(e), t && t.d(n); + n && X(e), t && t.d(n); } }; } -function is(l) { +function as(l) { let e, t, n, i; const o = ( /*#slots*/ l[30]["additional-loading-text"] - ), s = va( + ), s = Ca( o, l, /*$$scope*/ l[29], - Vo + Ko ); return { c() { - e = nt("p"), t = ne( + e = lt("p"), t = le( /*loading_text*/ l[9] - ), n = Ye(), s && s.c(), Je(e, "class", "loading svelte-16nch4a"); + ), n = He(), s && s.c(), Je(e, "class", "loading svelte-16nch4a"); }, m(r, a) { - X(r, e, a), Pt(e, t), X(r, n, a), s && s.m(r, a), i = !0; + Y(r, e, a), Pt(e, t), Y(r, n, a), s && s.m(r, a), i = !0; }, p(r, a) { (!i || a[0] & /*loading_text*/ - 512) && Ne( + 512) && Fe( t, /*loading_text*/ r[9] ), s && s.p && (!i || a[0] & /*$$scope*/ - 536870912) && qa( + 536870912) && Ma( s, o, r, /*$$scope*/ r[29], - i ? Sa( + i ? qa( o, /*$$scope*/ r[29], a, - T_ - ) : Ca( + H_ + ) : Ba( /*$$scope*/ r[29] ), - Vo + Ko ); }, i(r) { i || (Ge(s, r), i = !0); }, o(r) { - lt(s, r), i = !1; + it(s, r), i = !1; }, d(r) { - r && (F(e), F(n)), s && s.d(r); + r && (X(e), X(n)), s && s.d(r); } }; } -function V_(l) { +function K_(l) { let e, t, n, i, o; - const s = [j_, I_], r = []; + const s = [X_, F_], r = []; function a(f, u) { return ( /*status*/ @@ -3417,12 +3417,12 @@ function V_(l) { } return ~(t = a(l)) && (n = r[t] = s[t](l)), { c() { - e = nt("div"), n && n.c(), Je(e, "class", i = "wrap " + /*variant*/ + e = lt("div"), n && n.c(), Je(e, "class", i = "wrap " + /*variant*/ l[8] + " " + /*show_progress*/ - l[6] + " svelte-16nch4a"), Xe(e, "hide", !/*status*/ + l[6] + " svelte-16nch4a"), je(e, "hide", !/*status*/ l[4] || /*status*/ l[4] === "complete" || /*show_progress*/ - l[6] === "hidden"), Xe( + l[6] === "hidden"), je( e, "translucent", /*variant*/ @@ -3431,22 +3431,22 @@ function V_(l) { l[4] === "error") || /*translucent*/ l[11] || /*show_progress*/ l[6] === "minimal" - ), Xe( + ), je( e, "generating", /*status*/ l[4] === "generating" - ), Xe( + ), je( e, "border", /*border*/ l[12] - ), Bt( + ), Et( e, "position", /*absolute*/ l[10] ? "absolute" : "static" - ), Bt( + ), Et( e, "padding", /*absolute*/ @@ -3454,21 +3454,21 @@ function V_(l) { ); }, m(f, u) { - X(f, e, u), ~t && r[t].m(e, null), l[33](e), o = !0; + Y(f, e, u), ~t && r[t].m(e, null), l[33](e), o = !0; }, p(f, u) { let c = t; - t = a(f), t === c ? ~t && r[t].p(f, u) : (n && (Wi(), lt(r[c], 1, 1, () => { + t = a(f), t === c ? ~t && r[t].p(f, u) : (n && (Zi(), it(r[c], 1, 1, () => { r[c] = null; - }), Oi()), ~t ? (n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Ge(n, 1), n.m(e, null)) : n = null), (!o || u[0] & /*variant, show_progress*/ + }), Pi()), ~t ? (n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Ge(n, 1), n.m(e, null)) : n = null), (!o || u[0] & /*variant, show_progress*/ 320 && i !== (i = "wrap " + /*variant*/ f[8] + " " + /*show_progress*/ f[6] + " svelte-16nch4a")) && Je(e, "class", i), (!o || u[0] & /*variant, show_progress, status, show_progress*/ - 336) && Xe(e, "hide", !/*status*/ + 336) && je(e, "hide", !/*status*/ f[4] || /*status*/ f[4] === "complete" || /*show_progress*/ f[6] === "hidden"), (!o || u[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ - 2384) && Xe( + 2384) && je( e, "translucent", /*variant*/ @@ -3478,25 +3478,25 @@ function V_(l) { f[11] || /*show_progress*/ f[6] === "minimal" ), (!o || u[0] & /*variant, show_progress, status*/ - 336) && Xe( + 336) && je( e, "generating", /*status*/ f[4] === "generating" ), (!o || u[0] & /*variant, show_progress, border*/ - 4416) && Xe( + 4416) && je( e, "border", /*border*/ f[12] ), u[0] & /*absolute*/ - 1024 && Bt( + 1024 && Et( e, "position", /*absolute*/ f[10] ? "absolute" : "static" ), u[0] & /*absolute*/ - 1024 && Bt( + 1024 && Et( e, "padding", /*absolute*/ @@ -3507,14 +3507,14 @@ function V_(l) { o || (Ge(n), o = !0); }, o(f) { - lt(n), o = !1; + it(n), o = !1; }, d(f) { - f && F(e), ~t && r[t].d(), l[33](null); + f && X(e), ~t && r[t].d(), l[33](null); } }; } -var P_ = function(l, e, t, n) { +var G_ = function(l, e, t, n) { function i(o) { return o instanceof t ? o : new t(function(s) { s(o); @@ -3541,71 +3541,71 @@ var P_ = function(l, e, t, n) { f((n = n.apply(l, e || [])).next()); }); }; -let _l = [], yi = !1; -function Z_(l) { - return P_(this, arguments, void 0, function* (e, t = !0) { +let _l = [], zi = !1; +function J_(l) { + return G_(this, arguments, void 0, function* (e, t = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) { - if (_l.push(e), !yi) yi = !0; + if (_l.push(e), !zi) zi = !0; else return; - yield A_(), requestAnimationFrame(() => { + yield R_(), requestAnimationFrame(() => { let n = [0, 0]; for (let i = 0; i < _l.length; i++) { const s = _l[i].getBoundingClientRect(); (i === 0 || s.top + window.scrollY <= n[0]) && (n[0] = s.top + window.scrollY, n[1] = i); } - window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), yi = !1, _l = []; + window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), zi = !1, _l = []; }); } }); } -function K_(l, e, t) { +function Q_(l, e, t) { let n, { $$slots: i = {}, $$scope: o } = e; this && this.__awaiter; - const s = D_(); - let { i18n: r } = e, { eta: a = null } = e, { queue_position: f } = e, { queue_size: u } = e, { status: c } = e, { scroll_to_output: _ = !1 } = e, { timer: d = !0 } = e, { show_progress: m = "full" } = e, { message: h = null } = e, { progress: p = null } = e, { variant: w = "default" } = e, { loading_text: b = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: k = !1 } = e, { border: C = !1 } = e, { autoscroll: v } = e, z, y = !1, A = 0, S = 0, R = null, D = null, N = 0, J = null, Q, V = null, U = !0; - const T = () => { - t(0, a = t(27, R = t(19, P = null))), t(25, A = performance.now()), t(26, S = 0), y = !0, O(); + const s = I_(); + let { i18n: r } = e, { eta: a = null } = e, { queue_position: f } = e, { queue_size: u } = e, { status: c } = e, { scroll_to_output: _ = !1 } = e, { timer: d = !0 } = e, { show_progress: h = "full" } = e, { message: m = null } = e, { progress: w = null } = e, { variant: b = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: v = !1 } = e, { border: E = !1 } = e, { autoscroll: y } = e, C, k = !1, A = 0, S = 0, T = null, R = null, U = 0, Z = null, Q, J = null, K = !0; + const L = () => { + t(0, a = t(27, T = t(19, W = null))), t(25, A = performance.now()), t(26, S = 0), k = !0, F(); }; - function O() { + function F() { requestAnimationFrame(() => { - t(26, S = (performance.now() - A) / 1e3), y && O(); + t(26, S = (performance.now() - A) / 1e3), k && F(); }); } - function L() { - t(26, S = 0), t(0, a = t(27, R = t(19, P = null))), y && (y = !1); + function D() { + t(26, S = 0), t(0, a = t(27, T = t(19, W = null))), k && (k = !1); } - L_(() => { - y && L(); + T_(() => { + k && D(); }); - let P = null; - function he(I) { - Oo[I ? "unshift" : "push"](() => { - V = I, t(16, V), t(7, p), t(14, J), t(15, Q); + let W = null; + function $(I) { + Po[I ? "unshift" : "push"](() => { + J = I, t(16, J), t(7, w), t(14, Z), t(15, Q); }); } - const ie = () => { + const oe = () => { s("clear_status"); }; function ge(I) { - Oo[I ? "unshift" : "push"](() => { - z = I, t(13, z); + Po[I ? "unshift" : "push"](() => { + C = I, t(13, C); }); } return l.$$set = (I) => { - "i18n" in I && t(1, r = I.i18n), "eta" in I && t(0, a = I.eta), "queue_position" in I && t(2, f = I.queue_position), "queue_size" in I && t(3, u = I.queue_size), "status" in I && t(4, c = I.status), "scroll_to_output" in I && t(22, _ = I.scroll_to_output), "timer" in I && t(5, d = I.timer), "show_progress" in I && t(6, m = I.show_progress), "message" in I && t(23, h = I.message), "progress" in I && t(7, p = I.progress), "variant" in I && t(8, w = I.variant), "loading_text" in I && t(9, b = I.loading_text), "absolute" in I && t(10, g = I.absolute), "translucent" in I && t(11, k = I.translucent), "border" in I && t(12, C = I.border), "autoscroll" in I && t(24, v = I.autoscroll), "$$scope" in I && t(29, o = I.$$scope); + "i18n" in I && t(1, r = I.i18n), "eta" in I && t(0, a = I.eta), "queue_position" in I && t(2, f = I.queue_position), "queue_size" in I && t(3, u = I.queue_size), "status" in I && t(4, c = I.status), "scroll_to_output" in I && t(22, _ = I.scroll_to_output), "timer" in I && t(5, d = I.timer), "show_progress" in I && t(6, h = I.show_progress), "message" in I && t(23, m = I.message), "progress" in I && t(7, w = I.progress), "variant" in I && t(8, b = I.variant), "loading_text" in I && t(9, p = I.loading_text), "absolute" in I && t(10, g = I.absolute), "translucent" in I && t(11, v = I.translucent), "border" in I && t(12, E = I.border), "autoscroll" in I && t(24, y = I.autoscroll), "$$scope" in I && t(29, o = I.$$scope); }, l.$$.update = () => { l.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 436207617 && (a === null && t(0, a = R), a != null && R !== a && (t(28, D = (performance.now() - A) / 1e3 + a), t(19, P = D.toFixed(1)), t(27, R = a))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 335544320 && t(17, N = D === null || D <= 0 || !S ? null : Math.min(S / D, 1)), l.$$.dirty[0] & /*progress*/ - 128 && p != null && t(18, U = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (p != null ? t(14, J = p.map((I) => { + 436207617 && (a === null && t(0, a = T), a != null && T !== a && (t(28, R = (performance.now() - A) / 1e3 + a), t(19, W = R.toFixed(1)), t(27, T = a))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 335544320 && t(17, U = R === null || R <= 0 || !S ? null : Math.min(S / R, 1)), l.$$.dirty[0] & /*progress*/ + 128 && w != null && t(18, K = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (w != null ? t(14, Z = w.map((I) => { if (I.index != null && I.length != null) return I.index / I.length; if (I.progress != null) return I.progress; - })) : t(14, J = null), J ? (t(15, Q = J[J.length - 1]), V && (Q === 0 ? t(16, V.style.transition = "0", V) : t(16, V.style.transition = "150ms", V))) : t(15, Q = void 0)), l.$$.dirty[0] & /*status*/ - 16 && (c === "pending" ? T() : L()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && z && _ && (c === "pending" || c === "complete") && Z_(z, v), l.$$.dirty[0] & /*status, message*/ + })) : t(14, Z = null), Z ? (t(15, Q = Z[Z.length - 1]), J && (Q === 0 ? t(16, J.style.transition = "0", J) : t(16, J.style.transition = "150ms", J))) : t(15, Q = void 0)), l.$$.dirty[0] & /*status*/ + 16 && (c === "pending" ? L() : D()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && C && _ && (c === "pending" || c === "complete") && J_(C, y), l.$$.dirty[0] & /*status, message*/ 8388624, l.$$.dirty[0] & /*timer_diff*/ 67108864 && t(20, n = S.toFixed(1)); }, [ @@ -3615,44 +3615,44 @@ function K_(l, e, t) { u, c, d, - m, - p, + h, w, b, + p, g, - k, + v, + E, C, - z, - J, + Z, Q, - V, - N, + J, U, - P, + K, + W, n, s, _, - h, - v, + m, + y, A, S, + T, R, - D, o, i, - he, - ie, + $, + oe, ge ]; } -class G_ extends B_ { +class x_ extends A_ { constructor(e) { - super(), E_( + super(), L_( this, e, + Q_, K_, - V_, - M_, + D_, { i18n: 1, eta: 0, @@ -3676,30 +3676,30 @@ class G_ extends B_ { ); } } -const { setContext: Vm, getContext: J_ } = window.__gradio__svelte__internal, Q_ = "WORKER_PROXY_CONTEXT_KEY"; -function Ba() { - return J_(Q_); +const { setContext: Km, getContext: $_ } = window.__gradio__svelte__internal, ed = "WORKER_PROXY_CONTEXT_KEY"; +function Aa() { + return $_(ed); } -function x_(l) { +function td(l) { return l.host === window.location.host || l.host === "localhost:7860" || l.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 l.host === "lite.local"; } -function Ea(l, e) { +function La(l, e) { const t = e.toLowerCase(); for (const [n, i] of Object.entries(l)) if (n.toLowerCase() === t) return i; } -function Ma(l) { +function Da(l) { if (l == null) return !1; const e = new URL(l, window.location.href); - return !(!x_(e) || e.protocol !== "http:" && e.protocol !== "https:"); + return !(!td(e) || e.protocol !== "http:" && e.protocol !== "https:"); } -async function $_(l) { - if (l == null || !Ma(l)) +async function nd(l) { + if (l == null || !Da(l)) return l; - const e = Ba(); + const e = Aa(); if (e == null) return l; const n = new URL(l, window.location.href).pathname; @@ -3712,41 +3712,41 @@ async function $_(l) { if (i.status !== 200) throw new Error(`Failed to get file ${n} from the Wasm worker.`); const o = new Blob([i.body], { - type: Ea(i.headers, "content-type") + type: La(i.headers, "content-type") }); return URL.createObjectURL(o); }); } const { - SvelteComponent: ed, - assign: Tl, - check_outros: Aa, - compute_rest_props: os, - create_slot: no, - detach: Gl, - element: La, - empty: Da, - exclude_internal_props: td, - get_all_dirty_from_scope: lo, - get_slot_changes: io, - get_spread_update: Ra, - group_outros: Ta, - init: nd, - insert: Jl, - listen: Ia, - prevent_default: ld, - safe_not_equal: id, - set_attributes: Il, + SvelteComponent: ld, + assign: Il, + check_outros: Ra, + compute_rest_props: rs, + create_slot: oo, + detach: Jl, + element: Ta, + empty: Ia, + exclude_internal_props: id, + get_all_dirty_from_scope: so, + get_slot_changes: ao, + get_spread_update: ja, + group_outros: Ha, + init: od, + insert: Ql, + listen: Fa, + prevent_default: sd, + safe_not_equal: ad, + set_attributes: jl, transition_in: Gt, transition_out: Jt, - update_slot_base: oo -} = window.__gradio__svelte__internal, { createEventDispatcher: od } = window.__gradio__svelte__internal; -function sd(l) { + update_slot_base: ro +} = window.__gradio__svelte__internal, { createEventDispatcher: rd } = window.__gradio__svelte__internal; +function fd(l) { let e, t, n, i, o; const s = ( /*#slots*/ l[8].default - ), r = no( + ), r = oo( s, l, /*$$scope*/ @@ -3770,13 +3770,13 @@ function sd(l) { l[6] ], f = {}; for (let u = 0; u < a.length; u += 1) - f = Tl(f, a[u]); + f = Il(f, a[u]); return { c() { - e = La("a"), r && r.c(), Il(e, f); + e = Ta("a"), r && r.c(), jl(e, f); }, m(u, c) { - Jl(u, e, c), r && r.m(e, null), n = !0, i || (o = Ia( + Ql(u, e, c), r && r.m(e, null), n = !0, i || (o = Fa( e, "click", /*dispatch*/ @@ -3785,24 +3785,24 @@ function sd(l) { }, p(u, c) { r && r.p && (!n || c & /*$$scope*/ - 128) && oo( + 128) && ro( r, s, u, /*$$scope*/ u[7], - n ? io( + n ? ao( s, /*$$scope*/ u[7], c, null - ) : lo( + ) : so( /*$$scope*/ u[7] ), null - ), Il(e, f = Ra(a, [ + ), jl(e, f = ja(a, [ (!n || c & /*href*/ 1) && { href: ( /*href*/ @@ -3827,13 +3827,13 @@ function sd(l) { Jt(r, u), n = !1; }, d(u) { - u && Gl(e), r && r.d(u), i = !1, o(); + u && Jl(e), r && r.d(u), i = !1, o(); } }; } -function ad(l) { +function ud(l) { let e, t, n, i; - const o = [fd, rd], s = []; + const o = [_d, cd], s = []; function r(a, f) { return ( /*is_downloading*/ @@ -3842,16 +3842,16 @@ function ad(l) { } return e = r(l), t = s[e] = o[e](l), { c() { - t.c(), n = Da(); + t.c(), n = Ia(); }, m(a, f) { - s[e].m(a, f), Jl(a, n, f), i = !0; + s[e].m(a, f), Ql(a, n, f), i = !0; }, p(a, f) { let u = e; - e = r(a), e === u ? s[e].p(a, f) : (Ta(), Jt(s[u], 1, 1, () => { + e = r(a), e === u ? s[e].p(a, f) : (Ha(), Jt(s[u], 1, 1, () => { s[u] = null; - }), Aa(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Gt(t, 1), t.m(n.parentNode, n)); + }), Ra(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Gt(t, 1), t.m(n.parentNode, n)); }, i(a) { i || (Gt(t), i = !0); @@ -3860,16 +3860,16 @@ function ad(l) { Jt(t), i = !1; }, d(a) { - a && Gl(n), s[e].d(a); + a && Jl(n), s[e].d(a); } }; } -function rd(l) { +function cd(l) { let e, t, n, i; const o = ( /*#slots*/ l[8].default - ), s = no( + ), s = oo( o, l, /*$$scope*/ @@ -3885,37 +3885,37 @@ function rd(l) { ) } ], a = {}; for (let f = 0; f < r.length; f += 1) - a = Tl(a, r[f]); + a = Il(a, r[f]); return { c() { - e = La("a"), s && s.c(), Il(e, a); + e = Ta("a"), s && s.c(), jl(e, a); }, m(f, u) { - Jl(f, e, u), s && s.m(e, null), t = !0, n || (i = Ia(e, "click", ld( + Ql(f, e, u), s && s.m(e, null), t = !0, n || (i = Fa(e, "click", sd( /*wasm_click_handler*/ l[5] )), n = !0); }, p(f, u) { s && s.p && (!t || u & /*$$scope*/ - 128) && oo( + 128) && ro( s, o, f, /*$$scope*/ f[7], - t ? io( + t ? ao( o, /*$$scope*/ f[7], u, null - ) : lo( + ) : so( /*$$scope*/ f[7] ), null - ), Il(e, a = Ra(r, [ + ), jl(e, a = ja(r, [ u & /*$$restProps*/ 64 && /*$$restProps*/ f[6], @@ -3933,16 +3933,16 @@ function rd(l) { Jt(s, f), t = !1; }, d(f) { - f && Gl(e), s && s.d(f), n = !1, i(); + f && Jl(e), s && s.d(f), n = !1, i(); } }; } -function fd(l) { +function _d(l) { let e; const t = ( /*#slots*/ l[8].default - ), n = no( + ), n = oo( t, l, /*$$scope*/ @@ -3958,19 +3958,19 @@ function fd(l) { }, p(i, o) { n && n.p && (!e || o & /*$$scope*/ - 128) && oo( + 128) && ro( n, t, i, /*$$scope*/ i[7], - e ? io( + e ? ao( t, /*$$scope*/ i[7], o, null - ) : lo( + ) : so( /*$$scope*/ i[7] ), @@ -3988,29 +3988,29 @@ function fd(l) { } }; } -function ud(l) { +function dd(l) { let e, t, n, i, o; - const s = [ad, sd], r = []; + const s = [ud, fd], r = []; function a(f, u) { return u & /*href*/ 1 && (e = null), e == null && (e = !!/*worker_proxy*/ - (f[4] && Ma( + (f[4] && Da( /*href*/ f[0] ))), e ? 0 : 1; } return t = a(l, -1), n = r[t] = s[t](l), { c() { - n.c(), i = Da(); + n.c(), i = Ia(); }, m(f, u) { - r[t].m(f, u), Jl(f, i, u), o = !0; + r[t].m(f, u), Ql(f, i, u), o = !0; }, p(f, [u]) { let c = t; - t = a(f, u), t === c ? r[t].p(f, u) : (Ta(), Jt(r[c], 1, 1, () => { + t = a(f, u), t === c ? r[t].p(f, u) : (Ha(), Jt(r[c], 1, 1, () => { r[c] = null; - }), Aa(), n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Gt(n, 1), n.m(i.parentNode, i)); + }), Ra(), n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Gt(n, 1), n.m(i.parentNode, i)); }, i(f) { o || (Gt(n), o = !0); @@ -4019,44 +4019,44 @@ function ud(l) { Jt(n), o = !1; }, d(f) { - f && Gl(i), r[t].d(f); + f && Jl(i), r[t].d(f); } }; } -function cd(l, e, t) { +function hd(l, e, t) { const n = ["href", "download"]; - let i = os(e, n), { $$slots: o = {}, $$scope: s } = e; - var r = this && this.__awaiter || function(m, h, p, w) { - function b(g) { - return g instanceof p ? g : new p(function(k) { - k(g); + let i = rs(e, n), { $$slots: o = {}, $$scope: s } = e; + var r = this && this.__awaiter || function(h, m, w, b) { + function p(g) { + return g instanceof w ? g : new w(function(v) { + v(g); }); } - return new (p || (p = Promise))(function(g, k) { - function C(y) { + return new (w || (w = Promise))(function(g, v) { + function E(k) { try { - z(w.next(y)); + C(b.next(k)); } catch (A) { - k(A); + v(A); } } - function v(y) { + function y(k) { try { - z(w.throw(y)); + C(b.throw(k)); } catch (A) { - k(A); + v(A); } } - function z(y) { - y.done ? g(y.value) : b(y.value).then(C, v); + function C(k) { + k.done ? g(k.value) : p(k.value).then(E, y); } - z((w = w.apply(m, h || [])).next()); + C((b = b.apply(h, m || [])).next()); }); }; let { href: a = void 0 } = e, { download: f } = e; - const u = od(); + const u = rd(); let c = !1; - const _ = Ba(); + const _ = Aa(); function d() { return r(this, void 0, void 0, function* () { if (c) @@ -4065,29 +4065,29 @@ function cd(l, e, t) { throw new Error("href is not defined."); if (_ == null) throw new Error("Wasm worker proxy is not available."); - const h = new URL(a, window.location.href).pathname; + const m = new URL(a, window.location.href).pathname; t(2, c = !0), _.httpRequest({ method: "GET", - path: h, + path: m, headers: {}, query_string: "" - }).then((p) => { - if (p.status !== 200) - throw new Error(`Failed to get file ${h} from the Wasm worker.`); - const w = new Blob( - [p.body], + }).then((w) => { + if (w.status !== 200) + throw new Error(`Failed to get file ${m} from the Wasm worker.`); + const b = new Blob( + [w.body], { - type: Ea(p.headers, "content-type") + type: La(w.headers, "content-type") } - ), b = URL.createObjectURL(w), g = document.createElement("a"); - g.href = b, g.download = f, g.click(), URL.revokeObjectURL(b); + ), p = URL.createObjectURL(b), g = document.createElement("a"); + g.href = p, g.download = f, g.click(), URL.revokeObjectURL(p); }).finally(() => { t(2, c = !1); }); }); } - return l.$$set = (m) => { - e = Tl(Tl({}, e), td(m)), t(6, i = os(e, n)), "href" in m && t(0, a = m.href), "download" in m && t(1, f = m.download), "$$scope" in m && t(7, s = m.$$scope); + return l.$$set = (h) => { + e = Il(Il({}, e), id(h)), t(6, i = rs(e, n)), "href" in h && t(0, a = h.href), "download" in h && t(1, f = h.download), "$$scope" in h && t(7, s = h.$$scope); }, [ a, f, @@ -4100,23 +4100,23 @@ function cd(l, e, t) { o ]; } -class _d extends ed { +class md extends ld { constructor(e) { - super(), nd(this, e, cd, ud, id, { href: 0, download: 1 }); + super(), od(this, e, hd, dd, ad, { href: 0, download: 1 }); } } -var dd = Object.defineProperty, hd = (l, e, t) => e in l ? dd(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, at = (l, e, t) => (hd(l, typeof e != "symbol" ? e + "" : e, t), t), ja = (l, e, t) => { +var gd = Object.defineProperty, bd = (l, e, t) => e in l ? gd(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, at = (l, e, t) => (bd(l, typeof e != "symbol" ? e + "" : e, t), t), Xa = (l, e, t) => { if (!e.has(l)) throw TypeError("Cannot " + t); -}, Bn = (l, e, t) => (ja(l, e, "read from private field"), t ? t.call(l) : e.get(l)), md = (l, e, t) => { +}, qn = (l, e, t) => (Xa(l, e, "read from private field"), t ? t.call(l) : e.get(l)), wd = (l, e, t) => { if (e.has(l)) throw TypeError("Cannot add the same private member more than once"); e instanceof WeakSet ? e.add(l) : e.set(l, t); -}, gd = (l, e, t, n) => (ja(l, e, "write to private field"), e.set(l, t), t), St; +}, pd = (l, e, t, n) => (Xa(l, e, "write to private field"), e.set(l, t), t), zt; new Intl.Collator(0, { numeric: 1 }).compare; -async function Ha(l, e) { +async function Ya(l, e) { return l.map( - (t) => new bd({ + (t) => new vd({ path: t.name, orig_name: t.name, blob: t, @@ -4126,7 +4126,7 @@ async function Ha(l, e) { }) ); } -class bd { +class vd { constructor({ path: e, url: t, @@ -4141,12 +4141,12 @@ class bd { } } typeof process < "u" && process.versions && process.versions.node; -class Pm extends TransformStream { +class Gm extends TransformStream { /** Constructs a new instance. */ constructor(e = { allowCR: !1 }) { super({ transform: (t, n) => { - for (t = Bn(this, St) + t; ; ) { + for (t = qn(this, zt) + t; ; ) { const i = t.indexOf(` `), o = e.allowCR ? t.indexOf("\r") : -1; if (o !== -1 && o !== t.length - 1 && (i === -1 || i - 1 > o)) { @@ -4158,35 +4158,35 @@ class Pm extends TransformStream { const s = t[i - 1] === "\r" ? i - 1 : i; n.enqueue(t.slice(0, s)), t = t.slice(i + 1); } - gd(this, St, t); + pd(this, zt, t); }, flush: (t) => { - if (Bn(this, St) === "") + if (qn(this, zt) === "") return; - const n = e.allowCR && Bn(this, St).endsWith("\r") ? Bn(this, St).slice(0, -1) : Bn(this, St); + const n = e.allowCR && qn(this, zt).endsWith("\r") ? qn(this, zt).slice(0, -1) : qn(this, zt); t.enqueue(n); } - }), md(this, St, ""); + }), wd(this, zt, ""); } } -St = /* @__PURE__ */ new WeakMap(); +zt = /* @__PURE__ */ new WeakMap(); const { - SvelteComponent: wd, + SvelteComponent: kd, append: qe, attr: Nt, - detach: Fa, + detach: Na, element: Ut, - init: pd, - insert: Xa, - noop: ss, - safe_not_equal: vd, - set_data: jl, - set_style: Ci, - space: Pi, + init: yd, + insert: Ua, + noop: fs, + safe_not_equal: Cd, + set_data: Hl, + set_style: Bi, + space: Gi, text: hn, - toggle_class: as -} = window.__gradio__svelte__internal, { onMount: kd, createEventDispatcher: yd, onDestroy: Cd } = window.__gradio__svelte__internal; -function rs(l) { + toggle_class: us +} = window.__gradio__svelte__internal, { onMount: Sd, createEventDispatcher: zd, onDestroy: Bd } = window.__gradio__svelte__internal; +function cs(l) { let e, t, n, i, o = Tn( /*file_to_display*/ l[2] @@ -4196,33 +4196,33 @@ function rs(l) { ), c; return { c() { - e = Ut("div"), t = Ut("span"), n = Ut("div"), i = Ut("progress"), s = hn(o), a = Pi(), f = Ut("span"), c = hn(u), Ci(i, "visibility", "hidden"), Ci(i, "height", "0"), Ci(i, "width", "0"), i.value = r = Tn( + e = Ut("div"), t = Ut("span"), n = Ut("div"), i = Ut("progress"), s = hn(o), a = Gi(), f = Ut("span"), c = hn(u), Bi(i, "visibility", "hidden"), Bi(i, "height", "0"), Bi(i, "width", "0"), i.value = r = Tn( /*file_to_display*/ l[2] ), Nt(i, "max", "100"), Nt(i, "class", "svelte-cr2edf"), Nt(n, "class", "progress-bar svelte-cr2edf"), Nt(f, "class", "file-name svelte-cr2edf"), Nt(e, "class", "file svelte-cr2edf"); }, m(_, d) { - Xa(_, e, d), qe(e, t), qe(t, n), qe(n, i), qe(i, s), qe(e, a), qe(e, f), qe(f, c); + Ua(_, e, d), qe(e, t), qe(t, n), qe(n, i), qe(i, s), qe(e, a), qe(e, f), qe(f, c); }, p(_, d) { d & /*file_to_display*/ 4 && o !== (o = Tn( /*file_to_display*/ _[2] - ) + "") && jl(s, o), d & /*file_to_display*/ + ) + "") && Hl(s, o), d & /*file_to_display*/ 4 && r !== (r = Tn( /*file_to_display*/ _[2] )) && (i.value = r), d & /*file_to_display*/ 4 && u !== (u = /*file_to_display*/ - _[2].orig_name + "") && jl(c, u); + _[2].orig_name + "") && Hl(c, u); }, d(_) { - _ && Fa(e); + _ && Na(e); } }; } -function Sd(l) { +function qd(l) { let e, t, n, i = ( /*files_with_progress*/ l[0].length + "" @@ -4231,11 +4231,11 @@ function Sd(l) { l[0].length > 1 ? "files" : "file" ), a, f, u, c = ( /*file_to_display*/ - l[2] && rs(l) + l[2] && cs(l) ); return { c() { - e = Ut("div"), t = Ut("span"), n = hn("Uploading "), o = hn(i), s = Pi(), a = hn(r), f = hn("..."), u = Pi(), c && c.c(), Nt(t, "class", "uploading svelte-cr2edf"), Nt(e, "class", "wrap svelte-cr2edf"), as( + e = Ut("div"), t = Ut("span"), n = hn("Uploading "), o = hn(i), s = Gi(), a = hn(r), f = hn("..."), u = Gi(), c && c.c(), Nt(t, "class", "uploading svelte-cr2edf"), Nt(e, "class", "wrap svelte-cr2edf"), us( e, "progress", /*progress*/ @@ -4243,87 +4243,87 @@ function Sd(l) { ); }, m(_, d) { - Xa(_, e, d), qe(e, t), qe(t, n), qe(t, o), qe(t, s), qe(t, a), qe(t, f), qe(e, u), c && c.m(e, null); + Ua(_, e, d), qe(e, t), qe(t, n), qe(t, o), qe(t, s), qe(t, a), qe(t, f), qe(e, u), c && c.m(e, null); }, p(_, [d]) { d & /*files_with_progress*/ 1 && i !== (i = /*files_with_progress*/ - _[0].length + "") && jl(o, i), d & /*files_with_progress*/ + _[0].length + "") && Hl(o, i), d & /*files_with_progress*/ 1 && r !== (r = /*files_with_progress*/ - _[0].length > 1 ? "files" : "file") && jl(a, r), /*file_to_display*/ - _[2] ? c ? c.p(_, d) : (c = rs(_), c.c(), c.m(e, null)) : c && (c.d(1), c = null), d & /*progress*/ - 2 && as( + _[0].length > 1 ? "files" : "file") && Hl(a, r), /*file_to_display*/ + _[2] ? c ? c.p(_, d) : (c = cs(_), c.c(), c.m(e, null)) : c && (c.d(1), c = null), d & /*progress*/ + 2 && us( e, "progress", /*progress*/ _[1] ); }, - i: ss, - o: ss, + i: fs, + o: fs, d(_) { - _ && Fa(e), c && c.d(); + _ && Na(e), c && c.d(); } }; } function Tn(l) { return l.progress * 100 / (l.size || 0) || 0; } -function zd(l) { +function Ed(l) { let e = 0; return l.forEach((t) => { e += Tn(t); }), document.documentElement.style.setProperty("--upload-progress-width", (e / l.length).toFixed(2) + "%"), e / l.length; } -function qd(l, e, t) { - var n = this && this.__awaiter || function(h, p, w, b) { - function g(k) { - return k instanceof w ? k : new w(function(C) { - C(k); +function Md(l, e, t) { + var n = this && this.__awaiter || function(m, w, b, p) { + function g(v) { + return v instanceof b ? v : new b(function(E) { + E(v); }); } - return new (w || (w = Promise))(function(k, C) { - function v(A) { + return new (b || (b = Promise))(function(v, E) { + function y(A) { try { - y(b.next(A)); + k(p.next(A)); } catch (S) { - C(S); + E(S); } } - function z(A) { + function C(A) { try { - y(b.throw(A)); + k(p.throw(A)); } catch (S) { - C(S); + E(S); } } - function y(A) { - A.done ? k(A.value) : g(A.value).then(v, z); + function k(A) { + A.done ? v(A.value) : g(A.value).then(y, C); } - y((b = b.apply(h, p || [])).next()); + k((p = p.apply(m, w || [])).next()); }); }; - let { upload_id: i } = e, { root: o } = e, { files: s } = e, { stream_handler: r } = e, a, f = !1, u, c, _ = s.map((h) => Object.assign(Object.assign({}, h), { progress: 0 })); - const d = yd(); - function m(h, p) { - t(0, _ = _.map((w) => (w.orig_name === h && (w.progress += p), w))); + let { upload_id: i } = e, { root: o } = e, { files: s } = e, { stream_handler: r } = e, a, f = !1, u, c, _ = s.map((m) => Object.assign(Object.assign({}, m), { progress: 0 })); + const d = zd(); + function h(m, w) { + t(0, _ = _.map((b) => (b.orig_name === m && (b.progress += w), b))); } - return kd(() => n(void 0, void 0, void 0, function* () { + return Sd(() => n(void 0, void 0, void 0, function* () { if (a = yield r(new URL(`${o}/upload_progress?upload_id=${i}`)), a == null) throw new Error("Event source is not defined"); - a.onmessage = function(h) { + a.onmessage = function(m) { return n(this, void 0, void 0, function* () { - const p = JSON.parse(h.data); - f || t(1, f = !0), p.msg === "done" ? (a == null || a.close(), d("done")) : (t(7, u = p), m(p.orig_name, p.chunk_size)); + const w = JSON.parse(m.data); + f || t(1, f = !0), w.msg === "done" ? (a == null || a.close(), d("done")) : (t(7, u = w), h(w.orig_name, w.chunk_size)); }); }; - })), Cd(() => { + })), Bd(() => { (a != null || a != null) && a.close(); - }), l.$$set = (h) => { - "upload_id" in h && t(3, i = h.upload_id), "root" in h && t(4, o = h.root), "files" in h && t(5, s = h.files), "stream_handler" in h && t(6, r = h.stream_handler); + }), l.$$set = (m) => { + "upload_id" in m && t(3, i = m.upload_id), "root" in m && t(4, o = m.root), "files" in m && t(5, s = m.files), "stream_handler" in m && t(6, r = m.stream_handler); }, l.$$.update = () => { l.$$.dirty & /*files_with_progress*/ - 1 && zd(_), l.$$.dirty & /*current_file_upload, files_with_progress*/ + 1 && Ed(_), l.$$.dirty & /*current_file_upload, files_with_progress*/ 129 && t(2, c = u || _[0]); }, [ _, @@ -4336,9 +4336,9 @@ function qd(l, e, t) { u ]; } -class Bd extends wd { +class Ad extends kd { constructor(e) { - super(), pd(this, e, qd, Sd, vd, { + super(), yd(this, e, Md, qd, Cd, { upload_id: 3, root: 4, files: 5, @@ -4347,42 +4347,42 @@ class Bd extends wd { } } const { - SvelteComponent: Ed, - append: fs, + SvelteComponent: Ld, + append: _s, attr: pe, - binding_callbacks: Md, + binding_callbacks: Dd, bubble: Dt, - check_outros: Ya, - create_component: Ad, - create_slot: Na, - destroy_component: Ld, - detach: Ql, - element: Zi, - empty: Ua, - get_all_dirty_from_scope: Oa, - get_slot_changes: Wa, - group_outros: Va, - init: Dd, - insert: xl, - listen: Re, - mount_component: Rd, + check_outros: Oa, + create_component: Rd, + create_slot: Wa, + destroy_component: Td, + detach: xl, + element: Ji, + empty: Va, + get_all_dirty_from_scope: Pa, + get_slot_changes: Za, + group_outros: Ka, + init: Id, + insert: $l, + listen: Le, + mount_component: jd, prevent_default: Rt, - run_all: Td, - safe_not_equal: Id, - set_style: Pa, - space: jd, + run_all: Hd, + safe_not_equal: Fd, + set_style: Ga, + space: Xd, stop_propagation: Tt, - toggle_class: _e, - transition_in: Et, + toggle_class: de, + transition_in: Mt, transition_out: Qt, - update_slot_base: Za -} = window.__gradio__svelte__internal, { createEventDispatcher: Hd, tick: Fd } = window.__gradio__svelte__internal; -function Xd(l) { + update_slot_base: Ja +} = window.__gradio__svelte__internal, { createEventDispatcher: Yd, tick: Nd } = window.__gradio__svelte__internal; +function Ud(l) { let e, t, n, i, o, s, r, a, f, u, c; const _ = ( /*#slots*/ l[26].default - ), d = Na( + ), d = Wa( _, l, /*$$scope*/ @@ -4391,93 +4391,93 @@ function Xd(l) { ); return { c() { - e = Zi("button"), d && d.c(), t = jd(), n = Zi("input"), pe(n, "aria-label", "file upload"), pe(n, "data-testid", "file-upload"), pe(n, "type", "file"), pe(n, "accept", i = /*accept_file_types*/ + e = Ji("button"), d && d.c(), t = Xd(), n = Ji("input"), pe(n, "aria-label", "file upload"), pe(n, "data-testid", "file-upload"), pe(n, "type", "file"), pe(n, "accept", i = /*accept_file_types*/ l[16] || void 0), n.multiple = o = /*file_count*/ l[6] === "multiple" || void 0, pe(n, "webkitdirectory", s = /*file_count*/ l[6] === "directory" || void 0), pe(n, "mozdirectory", r = /*file_count*/ l[6] === "directory" || void 0), pe(n, "class", "svelte-1s26xmt"), pe(e, "tabindex", a = /*hidden*/ - l[9] ? -1 : 0), pe(e, "class", "svelte-1s26xmt"), _e( + l[9] ? -1 : 0), pe(e, "class", "svelte-1s26xmt"), de( e, "hidden", /*hidden*/ l[9] - ), _e( + ), de( e, "center", /*center*/ l[4] - ), _e( + ), de( e, "boundedheight", /*boundedheight*/ l[3] - ), _e( + ), de( e, "flex", /*flex*/ l[5] - ), _e( + ), de( e, "disable_click", /*disable_click*/ l[7] - ), Pa(e, "height", "100%"); + ), Ga(e, "height", "100%"); }, - m(m, h) { - xl(m, e, h), d && d.m(e, null), fs(e, t), fs(e, n), l[34](n), f = !0, u || (c = [ - Re( + m(h, m) { + $l(h, e, m), d && d.m(e, null), _s(e, t), _s(e, n), l[34](n), f = !0, u || (c = [ + Le( n, "change", /*load_files_from_upload*/ l[18] ), - Re(e, "drag", Tt(Rt( + Le(e, "drag", Tt(Rt( /*drag_handler*/ l[27] ))), - Re(e, "dragstart", Tt(Rt( + Le(e, "dragstart", Tt(Rt( /*dragstart_handler*/ l[28] ))), - Re(e, "dragend", Tt(Rt( + Le(e, "dragend", Tt(Rt( /*dragend_handler*/ l[29] ))), - Re(e, "dragover", Tt(Rt( + Le(e, "dragover", Tt(Rt( /*dragover_handler*/ l[30] ))), - Re(e, "dragenter", Tt(Rt( + Le(e, "dragenter", Tt(Rt( /*dragenter_handler*/ l[31] ))), - Re(e, "dragleave", Tt(Rt( + Le(e, "dragleave", Tt(Rt( /*dragleave_handler*/ l[32] ))), - Re(e, "drop", Tt(Rt( + Le(e, "drop", Tt(Rt( /*drop_handler*/ l[33] ))), - Re( + Le( e, "click", /*open_file_upload*/ l[13] ), - Re( + Le( e, "drop", /*loadFilesFromDrop*/ l[19] ), - Re( + Le( e, "dragenter", /*updateDragging*/ l[17] ), - Re( + Le( e, "dragleave", /*updateDragging*/ @@ -4485,112 +4485,112 @@ function Xd(l) { ) ], u = !0); }, - p(m, h) { - d && d.p && (!f || h[0] & /*$$scope*/ - 33554432) && Za( + p(h, m) { + d && d.p && (!f || m[0] & /*$$scope*/ + 33554432) && Ja( d, _, - m, + h, /*$$scope*/ - m[25], - f ? Wa( + h[25], + f ? Za( _, /*$$scope*/ - m[25], - h, + h[25], + m, null - ) : Oa( + ) : Pa( /*$$scope*/ - m[25] + h[25] ), null - ), (!f || h[0] & /*accept_file_types*/ + ), (!f || m[0] & /*accept_file_types*/ 65536 && i !== (i = /*accept_file_types*/ - m[16] || void 0)) && pe(n, "accept", i), (!f || h[0] & /*file_count*/ + h[16] || void 0)) && pe(n, "accept", i), (!f || m[0] & /*file_count*/ 64 && o !== (o = /*file_count*/ - m[6] === "multiple" || void 0)) && (n.multiple = o), (!f || h[0] & /*file_count*/ + h[6] === "multiple" || void 0)) && (n.multiple = o), (!f || m[0] & /*file_count*/ 64 && s !== (s = /*file_count*/ - m[6] === "directory" || void 0)) && pe(n, "webkitdirectory", s), (!f || h[0] & /*file_count*/ + h[6] === "directory" || void 0)) && pe(n, "webkitdirectory", s), (!f || m[0] & /*file_count*/ 64 && r !== (r = /*file_count*/ - m[6] === "directory" || void 0)) && pe(n, "mozdirectory", r), (!f || h[0] & /*hidden*/ + h[6] === "directory" || void 0)) && pe(n, "mozdirectory", r), (!f || m[0] & /*hidden*/ 512 && a !== (a = /*hidden*/ - m[9] ? -1 : 0)) && pe(e, "tabindex", a), (!f || h[0] & /*hidden*/ - 512) && _e( + h[9] ? -1 : 0)) && pe(e, "tabindex", a), (!f || m[0] & /*hidden*/ + 512) && de( e, "hidden", /*hidden*/ - m[9] - ), (!f || h[0] & /*center*/ - 16) && _e( + h[9] + ), (!f || m[0] & /*center*/ + 16) && de( e, "center", /*center*/ - m[4] - ), (!f || h[0] & /*boundedheight*/ - 8) && _e( + h[4] + ), (!f || m[0] & /*boundedheight*/ + 8) && de( e, "boundedheight", /*boundedheight*/ - m[3] - ), (!f || h[0] & /*flex*/ - 32) && _e( + h[3] + ), (!f || m[0] & /*flex*/ + 32) && de( e, "flex", /*flex*/ - m[5] - ), (!f || h[0] & /*disable_click*/ - 128) && _e( + h[5] + ), (!f || m[0] & /*disable_click*/ + 128) && de( e, "disable_click", /*disable_click*/ - m[7] + h[7] ); }, - i(m) { - f || (Et(d, m), f = !0); + i(h) { + f || (Mt(d, h), f = !0); }, - o(m) { - Qt(d, m), f = !1; + o(h) { + Qt(d, h), f = !1; }, - d(m) { - m && Ql(e), d && d.d(m), l[34](null), u = !1, Td(c); + d(h) { + h && xl(e), d && d.d(h), l[34](null), u = !1, Hd(c); } }; } -function Yd(l) { +function Od(l) { let e, t, n = !/*hidden*/ - l[9] && us(l); + l[9] && ds(l); return { c() { - n && n.c(), e = Ua(); + n && n.c(), e = Va(); }, m(i, o) { - n && n.m(i, o), xl(i, e, o), t = !0; + n && n.m(i, o), $l(i, e, o), t = !0; }, p(i, o) { /*hidden*/ - i[9] ? n && (Va(), Qt(n, 1, 1, () => { + i[9] ? n && (Ka(), Qt(n, 1, 1, () => { n = null; - }), Ya()) : n ? (n.p(i, o), o[0] & /*hidden*/ - 512 && Et(n, 1)) : (n = us(i), n.c(), Et(n, 1), n.m(e.parentNode, e)); + }), Oa()) : n ? (n.p(i, o), o[0] & /*hidden*/ + 512 && Mt(n, 1)) : (n = ds(i), n.c(), Mt(n, 1), n.m(e.parentNode, e)); }, i(i) { - t || (Et(n), t = !0); + t || (Mt(n), t = !0); }, o(i) { Qt(n), t = !1; }, d(i) { - i && Ql(e), n && n.d(i); + i && xl(e), n && n.d(i); } }; } -function Nd(l) { +function Wd(l) { let e, t, n, i, o; const s = ( /*#slots*/ l[26].default - ), r = Na( + ), r = Wa( s, l, /*$$scope*/ @@ -4599,31 +4599,31 @@ function Nd(l) { ); return { c() { - e = Zi("button"), r && r.c(), pe(e, "tabindex", t = /*hidden*/ - l[9] ? -1 : 0), pe(e, "class", "svelte-1s26xmt"), _e( + e = Ji("button"), r && r.c(), pe(e, "tabindex", t = /*hidden*/ + l[9] ? -1 : 0), pe(e, "class", "svelte-1s26xmt"), de( e, "hidden", /*hidden*/ l[9] - ), _e( + ), de( e, "center", /*center*/ l[4] - ), _e( + ), de( e, "boundedheight", /*boundedheight*/ l[3] - ), _e( + ), de( e, "flex", /*flex*/ l[5] - ), Pa(e, "height", "100%"); + ), Ga(e, "height", "100%"); }, m(a, f) { - xl(a, e, f), r && r.m(e, null), n = !0, i || (o = Re( + $l(a, e, f), r && r.m(e, null), n = !0, i || (o = Le( e, "click", /*paste_clipboard*/ @@ -4632,19 +4632,19 @@ function Nd(l) { }, p(a, f) { r && r.p && (!n || f[0] & /*$$scope*/ - 33554432) && Za( + 33554432) && Ja( r, s, a, /*$$scope*/ a[25], - n ? Wa( + n ? Za( s, /*$$scope*/ a[25], f, null - ) : Oa( + ) : Pa( /*$$scope*/ a[25] ), @@ -4652,25 +4652,25 @@ function Nd(l) { ), (!n || f[0] & /*hidden*/ 512 && t !== (t = /*hidden*/ a[9] ? -1 : 0)) && pe(e, "tabindex", t), (!n || f[0] & /*hidden*/ - 512) && _e( + 512) && de( e, "hidden", /*hidden*/ a[9] ), (!n || f[0] & /*center*/ - 16) && _e( + 16) && de( e, "center", /*center*/ a[4] ), (!n || f[0] & /*boundedheight*/ - 8) && _e( + 8) && de( e, "boundedheight", /*boundedheight*/ a[3] ), (!n || f[0] & /*flex*/ - 32) && _e( + 32) && de( e, "flex", /*flex*/ @@ -4678,19 +4678,19 @@ function Nd(l) { ); }, i(a) { - n || (Et(r, a), n = !0); + n || (Mt(r, a), n = !0); }, o(a) { Qt(r, a), n = !1; }, d(a) { - a && Ql(e), r && r.d(a), i = !1, o(); + a && xl(e), r && r.d(a), i = !1, o(); } }; } -function us(l) { +function ds(l) { let e, t; - return e = new Bd({ + return e = new Ad({ props: { root: ( /*root*/ @@ -4711,10 +4711,10 @@ function us(l) { } }), { c() { - Ad(e.$$.fragment); + Rd(e.$$.fragment); }, m(n, i) { - Rd(e, n, i), t = !0; + jd(e, n, i), t = !0; }, p(n, i) { const o = {}; @@ -4729,19 +4729,19 @@ function us(l) { n[11]), e.$set(o); }, i(n) { - t || (Et(e.$$.fragment, n), t = !0); + t || (Mt(e.$$.fragment, n), t = !0); }, o(n) { Qt(e.$$.fragment, n), t = !1; }, d(n) { - Ld(e, n); + Td(e, n); } }; } -function Ud(l) { +function Vd(l) { let e, t, n, i; - const o = [Nd, Yd, Xd], s = []; + const o = [Wd, Od, Ud], s = []; function r(a, f) { return ( /*filetype*/ @@ -4754,29 +4754,29 @@ function Ud(l) { } return e = r(l), t = s[e] = o[e](l), { c() { - t.c(), n = Ua(); + t.c(), n = Va(); }, m(a, f) { - s[e].m(a, f), xl(a, n, f), i = !0; + s[e].m(a, f), $l(a, n, f), i = !0; }, p(a, f) { let u = e; - e = r(a), e === u ? s[e].p(a, f) : (Va(), Qt(s[u], 1, 1, () => { + e = r(a), e === u ? s[e].p(a, f) : (Ka(), Qt(s[u], 1, 1, () => { s[u] = null; - }), Ya(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Et(t, 1), t.m(n.parentNode, n)); + }), Oa(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Mt(t, 1), t.m(n.parentNode, n)); }, i(a) { - i || (Et(t), i = !0); + i || (Mt(t), i = !0); }, o(a) { Qt(t), i = !1; }, d(a) { - a && Ql(n), s[e].d(a); + a && xl(n), s[e].d(a); } }; } -function Od(l, e, t) { +function Pd(l, e, t) { if (!l || l === "*" || l === "file/*" || Array.isArray(l) && l.some((i) => i === "*" || i === "file/*")) return !0; let n; @@ -4791,82 +4791,82 @@ function Od(l, e, t) { return i.endsWith("/*") && t.startsWith(o + "/"); }); } -function Wd(l, e, t) { +function Zd(l, e, t) { let { $$slots: n = {}, $$scope: i } = e; var o = this && this.__awaiter || function(M, H, G, q) { - function fe(be) { - return be instanceof G ? be : new G(function(Ae) { - Ae(be); + function ue(Ye) { + return Ye instanceof G ? Ye : new G(function(Qe) { + Qe(Ye); }); } - return new (G || (G = Promise))(function(be, Ae) { - function ot(Ue) { + return new (G || (G = Promise))(function(Ye, Qe) { + function ke(Ue) { try { - Fe(q.next(Ue)); - } catch (At) { - Ae(At); + Ne(q.next(Ue)); + } catch (bt) { + Qe(bt); } } - function Le(Ue) { + function be(Ue) { try { - Fe(q.throw(Ue)); - } catch (At) { - Ae(At); + Ne(q.throw(Ue)); + } catch (bt) { + Qe(bt); } } - function Fe(Ue) { - Ue.done ? be(Ue.value) : fe(Ue.value).then(ot, Le); + function Ne(Ue) { + Ue.done ? Ye(Ue.value) : ue(Ue.value).then(ke, be); } - Fe((q = q.apply(M, H || [])).next()); + Ne((q = q.apply(M, H || [])).next()); }); }; - let { filetype: s = null } = e, { dragging: r = !1 } = e, { boundedheight: a = !0 } = e, { center: f = !0 } = e, { flex: u = !0 } = e, { file_count: c = "single" } = e, { disable_click: _ = !1 } = e, { root: d } = e, { hidden: m = !1 } = e, { format: h = "file" } = e, { uploading: p = !1 } = e, { hidden_upload: w = null } = e, { show_progress: b = !0 } = e, { max_file_size: g = null } = e, { upload: k } = e, { stream_handler: C } = e, v, z, y; - const A = Hd(), S = ["image", "video", "audio", "text", "file"], R = (M) => M.startsWith(".") || M.endsWith("/*") ? M : S.includes(M) ? M + "/*" : "." + M; - function D() { + let { filetype: s = null } = e, { dragging: r = !1 } = e, { boundedheight: a = !0 } = e, { center: f = !0 } = e, { flex: u = !0 } = e, { file_count: c = "single" } = e, { disable_click: _ = !1 } = e, { root: d } = e, { hidden: h = !1 } = e, { format: m = "file" } = e, { uploading: w = !1 } = e, { hidden_upload: b = null } = e, { show_progress: p = !0 } = e, { max_file_size: g = null } = e, { upload: v } = e, { stream_handler: E } = e, y, C, k; + const A = Yd(), S = ["image", "video", "audio", "text", "file"], T = (M) => M.startsWith(".") || M.endsWith("/*") ? M : S.includes(M) ? M + "/*" : "." + M; + function R() { t(20, r = !r); } - function N() { + function U() { navigator.clipboard.read().then((M) => o(this, void 0, void 0, function* () { for (let H = 0; H < M.length; H++) { const G = M[H].types.find((q) => q.startsWith("image/")); if (G) { M[H].getType(G).then((q) => o(this, void 0, void 0, function* () { - const fe = new File([q], `clipboard.${G.replace("image/", "")}`); - yield V([fe]); + const ue = new File([q], `clipboard.${G.replace("image/", "")}`); + yield J([ue]); })); break; } } })); } - function J() { - _ || w && (t(2, w.value = "", w), w.click()); + function Z() { + _ || b && (t(2, b.value = "", b), b.click()); } function Q(M) { return o(this, void 0, void 0, function* () { - yield Fd(), t(14, v = Math.random().toString(36).substring(2, 15)), t(1, p = !0); + yield Nd(), t(14, y = Math.random().toString(36).substring(2, 15)), t(1, w = !0); try { - const H = yield k(M, d, v, g ?? 1 / 0); - return A("load", c === "single" ? H == null ? void 0 : H[0] : H), t(1, p = !1), H || []; + const H = yield v(M, d, y, g ?? 1 / 0); + return A("load", c === "single" ? H == null ? void 0 : H[0] : H), t(1, w = !1), H || []; } catch (H) { - return A("error", H.message), t(1, p = !1), []; + return A("error", H.message), t(1, w = !1), []; } }); } - function V(M) { + function J(M) { return o(this, void 0, void 0, function* () { if (!M.length) return; let H = M.map((G) => new File([G], G instanceof File ? G.name : "file", { type: G.type })); - return t(15, z = yield Ha(H)), yield Q(z); + return t(15, C = yield Ya(H)), yield Q(C); }); } - function U(M) { + function K(M) { return o(this, void 0, void 0, function* () { const H = M.target; if (H.files) - if (h != "blob") - yield V(Array.from(H.files)); + if (m != "blob") + yield J(Array.from(H.files)); else { if (c === "single") { A("load", H.files[0]); @@ -4876,30 +4876,30 @@ function Wd(l, e, t) { } }); } - function T(M) { + function L(M) { return o(this, void 0, void 0, function* () { var H; if (t(20, r = !1), !(!((H = M.dataTransfer) === null || H === void 0) && H.files)) return; const G = Array.from(M.dataTransfer.files).filter((q) => { - const fe = "." + q.name.split(".").pop(); - return fe && Od(y, fe, q.type) || (fe && Array.isArray(s) ? s.includes(fe) : fe === s) ? !0 : (A("error", `Invalid file type only ${s} allowed.`), !1); + const ue = "." + q.name.split(".").pop(); + return ue && Pd(k, ue, q.type) || (ue && Array.isArray(s) ? s.includes(ue) : ue === s) ? !0 : (A("error", `Invalid file type only ${s} allowed.`), !1); }); - yield V(G); + yield J(G); }); } - function O(M) { + function F(M) { Dt.call(this, l, M); } - function L(M) { + function D(M) { Dt.call(this, l, M); } - function P(M) { + function W(M) { Dt.call(this, l, M); } - function he(M) { + function $(M) { Dt.call(this, l, M); } - function ie(M) { + function oe(M) { Dt.call(this, l, M); } function ge(M) { @@ -4908,62 +4908,62 @@ function Wd(l, e, t) { function I(M) { Dt.call(this, l, M); } - function Me(M) { - Md[M ? "unshift" : "push"](() => { - w = M, t(2, w); + function Xe(M) { + Dd[M ? "unshift" : "push"](() => { + b = M, t(2, b); }); } return l.$$set = (M) => { - "filetype" in M && t(0, s = M.filetype), "dragging" in M && t(20, r = M.dragging), "boundedheight" in M && t(3, a = M.boundedheight), "center" in M && t(4, f = M.center), "flex" in M && t(5, u = M.flex), "file_count" in M && t(6, c = M.file_count), "disable_click" in M && t(7, _ = M.disable_click), "root" in M && t(8, d = M.root), "hidden" in M && t(9, m = M.hidden), "format" in M && t(21, h = M.format), "uploading" in M && t(1, p = M.uploading), "hidden_upload" in M && t(2, w = M.hidden_upload), "show_progress" in M && t(10, b = M.show_progress), "max_file_size" in M && t(22, g = M.max_file_size), "upload" in M && t(23, k = M.upload), "stream_handler" in M && t(11, C = M.stream_handler), "$$scope" in M && t(25, i = M.$$scope); + "filetype" in M && t(0, s = M.filetype), "dragging" in M && t(20, r = M.dragging), "boundedheight" in M && t(3, a = M.boundedheight), "center" in M && t(4, f = M.center), "flex" in M && t(5, u = M.flex), "file_count" in M && t(6, c = M.file_count), "disable_click" in M && t(7, _ = M.disable_click), "root" in M && t(8, d = M.root), "hidden" in M && t(9, h = M.hidden), "format" in M && t(21, m = M.format), "uploading" in M && t(1, w = M.uploading), "hidden_upload" in M && t(2, b = M.hidden_upload), "show_progress" in M && t(10, p = M.show_progress), "max_file_size" in M && t(22, g = M.max_file_size), "upload" in M && t(23, v = M.upload), "stream_handler" in M && t(11, E = M.stream_handler), "$$scope" in M && t(25, i = M.$$scope); }, l.$$.update = () => { l.$$.dirty[0] & /*filetype*/ - 1 && (s == null ? t(16, y = null) : typeof s == "string" ? t(16, y = R(s)) : (t(0, s = s.map(R)), t(16, y = s.join(", ")))); + 1 && (s == null ? t(16, k = null) : typeof s == "string" ? t(16, k = T(s)) : (t(0, s = s.map(T)), t(16, k = s.join(", ")))); }, [ s, - p, w, + b, a, f, u, c, _, d, - m, - b, - C, - N, - J, - v, - z, - y, - D, + h, + p, + E, U, - T, + Z, + y, + C, + k, + R, + K, + L, r, - h, + m, g, - k, - V, + v, + J, i, n, - O, - L, - P, - he, - ie, + F, + D, + W, + $, + oe, ge, I, - Me + Xe ]; } -class Vd extends Ed { +class Kd extends Ld { constructor(e) { - super(), Dd( + super(), Id( this, e, - Wd, - Ud, - Id, + Zd, + Vd, + Fd, { filetype: 0, dragging: 20, @@ -5000,67 +5000,67 @@ class Vd extends Ed { } } const { - SvelteComponent: Pd, + SvelteComponent: Gd, append: dl, - attr: Si, - create_component: Zd, - destroy_component: Kd, - detach: Gd, - element: zi, - init: Jd, - insert: Qd, - listen: xd, - mount_component: $d, - noop: e1, - safe_not_equal: t1, - set_style: n1, - space: l1, - text: i1, - transition_in: o1, - transition_out: s1 -} = window.__gradio__svelte__internal, { createEventDispatcher: a1 } = window.__gradio__svelte__internal; -function r1(l) { + attr: qi, + create_component: Jd, + destroy_component: Qd, + detach: xd, + element: Ei, + init: $d, + insert: e1, + listen: t1, + mount_component: n1, + noop: l1, + safe_not_equal: i1, + set_style: o1, + space: s1, + text: a1, + transition_in: r1, + transition_out: f1 +} = window.__gradio__svelte__internal, { createEventDispatcher: u1 } = window.__gradio__svelte__internal; +function c1(l) { let e, t, n, i, o, s = "Click to Access Webcam", r, a, f, u; - return i = new ca({}), { + return i = new ha({}), { c() { - e = zi("button"), t = zi("div"), n = zi("span"), Zd(i.$$.fragment), o = l1(), r = i1(s), Si(n, "class", "icon-wrap svelte-fjcd9c"), Si(t, "class", "wrap svelte-fjcd9c"), Si(e, "class", "svelte-fjcd9c"), n1(e, "height", "100%"); + e = Ei("button"), t = Ei("div"), n = Ei("span"), Jd(i.$$.fragment), o = s1(), r = a1(s), qi(n, "class", "icon-wrap svelte-fjcd9c"), qi(t, "class", "wrap svelte-fjcd9c"), qi(e, "class", "svelte-fjcd9c"), o1(e, "height", "100%"); }, m(c, _) { - Qd(c, e, _), dl(e, t), dl(t, n), $d(i, n, null), dl(t, o), dl(t, r), a = !0, f || (u = xd( + e1(c, e, _), dl(e, t), dl(t, n), n1(i, n, null), dl(t, o), dl(t, r), a = !0, f || (u = t1( e, "click", /*click_handler*/ l[1] ), f = !0); }, - p: e1, + p: l1, i(c) { - a || (o1(i.$$.fragment, c), a = !0); + a || (r1(i.$$.fragment, c), a = !0); }, o(c) { - s1(i.$$.fragment, c), a = !1; + f1(i.$$.fragment, c), a = !1; }, d(c) { - c && Gd(e), Kd(i), f = !1, u(); + c && xd(e), Qd(i), f = !1, u(); } }; } -function f1(l) { - const e = a1(); +function _1(l) { + const e = u1(); return [e, () => e("click")]; } -class u1 extends Pd { +class d1 extends Gd { constructor(e) { - super(), Jd(this, e, f1, r1, t1, {}); + super(), $d(this, e, _1, c1, i1, {}); } } -function c1() { +function h1() { return navigator.mediaDevices.enumerateDevices(); } -function _1(l, e) { +function m1(l, e) { e.srcObject = l, e.muted = !0, e.play(); } -async function cs(l, e, t) { +async function hs(l, e, t) { const n = { width: { ideal: 1920 }, height: { ideal: 1440 } @@ -5068,159 +5068,159 @@ async function cs(l, e, t) { video: t ? { deviceId: { exact: t }, ...n } : n, audio: l }; - return navigator.mediaDevices.getUserMedia(i).then((o) => (_1(o, e), o)); + return navigator.mediaDevices.getUserMedia(i).then((o) => (m1(o, e), o)); } -function d1(l) { +function g1(l) { return l.filter( (t) => t.kind === "videoinput" ); } const { - SvelteComponent: h1, - action_destroyer: m1, - add_render_callback: g1, + SvelteComponent: b1, + action_destroyer: w1, + add_render_callback: p1, append: ct, - attr: ae, - binding_callbacks: b1, + attr: re, + binding_callbacks: v1, check_outros: Un, create_component: kn, - create_in_transition: w1, + create_in_transition: k1, destroy_component: yn, - destroy_each: p1, - detach: Be, - element: He, - empty: so, - ensure_array_like: _s, + destroy_each: y1, + detach: Ee, + element: Ie, + empty: fo, + ensure_array_like: ms, group_outros: On, - init: v1, - insert: Ee, - listen: Hl, + init: C1, + insert: Me, + listen: Fl, mount_component: Cn, - noop: ao, - run_all: k1, - safe_not_equal: y1, - set_data: Ka, - set_input_value: Ki, + noop: uo, + run_all: S1, + safe_not_equal: z1, + set_data: Qa, + set_input_value: Qi, space: Kn, - stop_propagation: C1, - text: Ga, + stop_propagation: B1, + text: xa, toggle_class: hl, - transition_in: de, + transition_in: he, transition_out: ve -} = window.__gradio__svelte__internal, { createEventDispatcher: S1, onMount: z1 } = window.__gradio__svelte__internal; -function ds(l, e, t) { +} = window.__gradio__svelte__internal, { createEventDispatcher: q1, onMount: E1 } = window.__gradio__svelte__internal; +function gs(l, e, t) { const n = l.slice(); return n[32] = e[t], n; } -function q1(l) { +function M1(l) { let e, t, n, i, o, s, r, a, f, u, c; - const _ = [M1, E1], d = []; - function m(w, b) { + const _ = [D1, L1], d = []; + function h(b, p) { return ( /*mode*/ - w[1] === "video" || /*streaming*/ - w[0] ? 0 : 1 + b[1] === "video" || /*streaming*/ + b[0] ? 0 : 1 ); } - n = m(l), i = d[n] = _[n](l); - let h = !/*recording*/ - l[8] && hs(l), p = ( + n = h(l), i = d[n] = _[n](l); + let m = !/*recording*/ + l[8] && bs(l), w = ( /*options_open*/ l[10] && /*selected_device*/ - l[7] && ms(l) + l[7] && ws(l) ); return { c() { - e = He("div"), t = He("button"), i.c(), s = Kn(), h && h.c(), r = Kn(), p && p.c(), a = so(), ae(t, "aria-label", o = /*mode*/ - l[1] === "image" ? "capture photo" : "start recording"), ae(t, "class", "svelte-8hqvb6"), ae(e, "class", "button-wrap svelte-8hqvb6"); + e = Ie("div"), t = Ie("button"), i.c(), s = Kn(), m && m.c(), r = Kn(), w && w.c(), a = fo(), re(t, "aria-label", o = /*mode*/ + l[1] === "image" ? "capture photo" : "start recording"), re(t, "class", "svelte-8hqvb6"), re(e, "class", "button-wrap svelte-8hqvb6"); }, - m(w, b) { - Ee(w, e, b), ct(e, t), d[n].m(t, null), ct(e, s), h && h.m(e, null), Ee(w, r, b), p && p.m(w, b), Ee(w, a, b), f = !0, u || (c = Hl( + m(b, p) { + Me(b, e, p), ct(e, t), d[n].m(t, null), ct(e, s), m && m.m(e, null), Me(b, r, p), w && w.m(b, p), Me(b, a, p), f = !0, u || (c = Fl( t, "click", /*record_video_or_photo*/ l[13] ), u = !0); }, - p(w, b) { + p(b, p) { let g = n; - n = m(w), n === g ? d[n].p(w, b) : (On(), ve(d[g], 1, 1, () => { + n = h(b), n === g ? d[n].p(b, p) : (On(), ve(d[g], 1, 1, () => { d[g] = null; - }), Un(), i = d[n], i ? i.p(w, b) : (i = d[n] = _[n](w), i.c()), de(i, 1), i.m(t, null)), (!f || b[0] & /*mode*/ + }), Un(), i = d[n], i ? i.p(b, p) : (i = d[n] = _[n](b), i.c()), he(i, 1), i.m(t, null)), (!f || p[0] & /*mode*/ 2 && o !== (o = /*mode*/ - w[1] === "image" ? "capture photo" : "start recording")) && ae(t, "aria-label", o), /*recording*/ - w[8] ? h && (On(), ve(h, 1, 1, () => { - h = null; - }), Un()) : h ? (h.p(w, b), b[0] & /*recording*/ - 256 && de(h, 1)) : (h = hs(w), h.c(), de(h, 1), h.m(e, null)), /*options_open*/ - w[10] && /*selected_device*/ - w[7] ? p ? (p.p(w, b), b[0] & /*options_open, selected_device*/ - 1152 && de(p, 1)) : (p = ms(w), p.c(), de(p, 1), p.m(a.parentNode, a)) : p && (On(), ve(p, 1, 1, () => { - p = null; + b[1] === "image" ? "capture photo" : "start recording")) && re(t, "aria-label", o), /*recording*/ + b[8] ? m && (On(), ve(m, 1, 1, () => { + m = null; + }), Un()) : m ? (m.p(b, p), p[0] & /*recording*/ + 256 && he(m, 1)) : (m = bs(b), m.c(), he(m, 1), m.m(e, null)), /*options_open*/ + b[10] && /*selected_device*/ + b[7] ? w ? (w.p(b, p), p[0] & /*options_open, selected_device*/ + 1152 && he(w, 1)) : (w = ws(b), w.c(), he(w, 1), w.m(a.parentNode, a)) : w && (On(), ve(w, 1, 1, () => { + w = null; }), Un()); }, - i(w) { - f || (de(i), de(h), de(p), f = !0); + i(b) { + f || (he(i), he(m), he(w), f = !0); }, - o(w) { - ve(i), ve(h), ve(p), f = !1; + o(b) { + ve(i), ve(m), ve(w), f = !1; }, - d(w) { - w && (Be(e), Be(r), Be(a)), d[n].d(), h && h.d(), p && p.d(w), u = !1, c(); + d(b) { + b && (Ee(e), Ee(r), Ee(a)), d[n].d(), m && m.d(), w && w.d(b), u = !1, c(); } }; } -function B1(l) { +function A1(l) { let e, t, n, i; - return t = new u1({}), t.$on( + return t = new d1({}), t.$on( "click", /*click_handler*/ l[20] ), { c() { - e = He("div"), kn(t.$$.fragment), ae(e, "title", "grant webcam access"); + e = Ie("div"), kn(t.$$.fragment), re(e, "title", "grant webcam access"); }, m(o, s) { - Ee(o, e, s), Cn(t, e, null), i = !0; + Me(o, e, s), Cn(t, e, null), i = !0; }, - p: ao, + p: uo, i(o) { - i || (de(t.$$.fragment, o), o && (n || g1(() => { - n = w1(e, m_, { delay: 100, duration: 200 }), n.start(); + i || (he(t.$$.fragment, o), o && (n || p1(() => { + n = k1(e, w_, { delay: 100, duration: 200 }), n.start(); })), i = !0); }, o(o) { ve(t.$$.fragment, o), i = !1; }, d(o) { - o && Be(e), yn(t); + o && Ee(e), yn(t); } }; } -function E1(l) { +function L1(l) { let e, t, n; - return t = new uu({}), { + return t = new du({}), { c() { - e = He("div"), kn(t.$$.fragment), ae(e, "class", "icon svelte-8hqvb6"), ae(e, "title", "capture photo"); + e = Ie("div"), kn(t.$$.fragment), re(e, "class", "icon svelte-8hqvb6"), re(e, "title", "capture photo"); }, m(i, o) { - Ee(i, e, o), Cn(t, e, null), n = !0; + Me(i, e, o), Cn(t, e, null), n = !0; }, - p: ao, + p: uo, i(i) { - n || (de(t.$$.fragment, i), n = !0); + n || (he(t.$$.fragment, i), n = !0); }, o(i) { ve(t.$$.fragment, i), n = !1; }, d(i) { - i && Be(e), yn(t); + i && Ee(e), yn(t); } }; } -function M1(l) { +function D1(l) { let e, t, n, i; - const o = [L1, A1], s = []; + const o = [T1, R1], s = []; function r(a, f) { return ( /*recording*/ @@ -5229,121 +5229,121 @@ function M1(l) { } return e = r(l), t = s[e] = o[e](l), { c() { - t.c(), n = so(); + t.c(), n = fo(); }, m(a, f) { - s[e].m(a, f), Ee(a, n, f), i = !0; + s[e].m(a, f), Me(a, n, f), i = !0; }, p(a, f) { let u = e; e = r(a), e !== u && (On(), ve(s[u], 1, 1, () => { s[u] = null; - }), Un(), t = s[e], t || (t = s[e] = o[e](a), t.c()), de(t, 1), t.m(n.parentNode, n)); + }), Un(), t = s[e], t || (t = s[e] = o[e](a), t.c()), he(t, 1), t.m(n.parentNode, n)); }, i(a) { - i || (de(t), i = !0); + i || (he(t), i = !0); }, o(a) { ve(t), i = !1; }, d(a) { - a && Be(n), s[e].d(a); + a && Ee(n), s[e].d(a); } }; } -function A1(l) { +function R1(l) { let e, t, n; - return t = new wu({}), { + return t = new ku({}), { c() { - e = He("div"), kn(t.$$.fragment), ae(e, "class", "icon red svelte-8hqvb6"), ae(e, "title", "start recording"); + e = Ie("div"), kn(t.$$.fragment), re(e, "class", "icon red svelte-8hqvb6"), re(e, "title", "start recording"); }, m(i, o) { - Ee(i, e, o), Cn(t, e, null), n = !0; + Me(i, e, o), Cn(t, e, null), n = !0; }, i(i) { - n || (de(t.$$.fragment, i), n = !0); + n || (he(t.$$.fragment, i), n = !0); }, o(i) { ve(t.$$.fragment, i), n = !1; }, d(i) { - i && Be(e), yn(t); + i && Ee(e), yn(t); } }; } -function L1(l) { +function T1(l) { let e, t, n; - return t = new kc({}), { + return t = new Sc({}), { c() { - e = He("div"), kn(t.$$.fragment), ae(e, "class", "icon red svelte-8hqvb6"), ae(e, "title", "stop recording"); + e = Ie("div"), kn(t.$$.fragment), re(e, "class", "icon red svelte-8hqvb6"), re(e, "title", "stop recording"); }, m(i, o) { - Ee(i, e, o), Cn(t, e, null), n = !0; + Me(i, e, o), Cn(t, e, null), n = !0; }, i(i) { - n || (de(t.$$.fragment, i), n = !0); + n || (he(t.$$.fragment, i), n = !0); }, o(i) { ve(t.$$.fragment, i), n = !1; }, d(i) { - i && Be(e), yn(t); + i && Ee(e), yn(t); } }; } -function hs(l) { +function bs(l) { let e, t, n, i, o; - return t = new to({}), { + return t = new io({}), { c() { - e = He("button"), kn(t.$$.fragment), ae(e, "class", "icon svelte-8hqvb6"), ae(e, "aria-label", "select input source"); + e = Ie("button"), kn(t.$$.fragment), re(e, "class", "icon svelte-8hqvb6"), re(e, "aria-label", "select input source"); }, m(s, r) { - Ee(s, e, r), Cn(t, e, null), n = !0, i || (o = Hl( + Me(s, e, r), Cn(t, e, null), n = !0, i || (o = Fl( e, "click", /*click_handler_1*/ l[21] ), i = !0); }, - p: ao, + p: uo, i(s) { - n || (de(t.$$.fragment, s), n = !0); + n || (he(t.$$.fragment, s), n = !0); }, o(s) { ve(t.$$.fragment, s), n = !1; }, d(s) { - s && Be(e), yn(t), i = !1, o(); + s && Ee(e), yn(t), i = !1, o(); } }; } -function ms(l) { +function ws(l) { let e, t, n, i, o, s, r; - n = new to({}); + n = new io({}); function a(c, _) { return ( /*available_video_devices*/ - c[6].length === 0 ? R1 : D1 + c[6].length === 0 ? j1 : I1 ); } let f = a(l), u = f(l); return { c() { - e = He("select"), t = He("button"), kn(n.$$.fragment), i = Kn(), u.c(), ae(t, "class", "inset-icon svelte-8hqvb6"), ae(e, "class", "select-wrap svelte-8hqvb6"), ae(e, "aria-label", "select source"); + e = Ie("select"), t = Ie("button"), kn(n.$$.fragment), i = Kn(), u.c(), re(t, "class", "inset-icon svelte-8hqvb6"), re(e, "class", "select-wrap svelte-8hqvb6"), re(e, "aria-label", "select source"); }, m(c, _) { - Ee(c, e, _), ct(e, t), Cn(n, t, null), ct(t, i), u.m(e, null), o = !0, s || (r = [ - Hl(t, "click", C1( + Me(c, e, _), ct(e, t), Cn(n, t, null), ct(t, i), u.m(e, null), o = !0, s || (r = [ + Fl(t, "click", B1( /*click_handler_2*/ l[22] )), - m1(ro.call( + w1(co.call( null, e, /*handle_click_outside*/ l[14] )), - Hl( + Fl( e, "change", /*handle_device_change*/ @@ -5355,45 +5355,45 @@ function ms(l) { f === (f = a(c)) && u ? u.p(c, _) : (u.d(1), u = f(c), u && (u.c(), u.m(e, null))); }, i(c) { - o || (de(n.$$.fragment, c), o = !0); + o || (he(n.$$.fragment, c), o = !0); }, o(c) { ve(n.$$.fragment, c), o = !1; }, d(c) { - c && Be(e), yn(n), u.d(), s = !1, k1(r); + c && Ee(e), yn(n), u.d(), s = !1, S1(r); } }; } -function D1(l) { - let e, t = _s( +function I1(l) { + let e, t = ms( /*available_video_devices*/ l[6] ), n = []; for (let i = 0; i < t.length; i += 1) - n[i] = gs(ds(l, t, i)); + n[i] = ps(gs(l, t, i)); return { c() { for (let i = 0; i < n.length; i += 1) n[i].c(); - e = so(); + e = fo(); }, m(i, o) { for (let s = 0; s < n.length; s += 1) n[s] && n[s].m(i, o); - Ee(i, e, o); + Me(i, e, o); }, p(i, o) { if (o[0] & /*available_video_devices, selected_device*/ 192) { - t = _s( + t = ms( /*available_video_devices*/ i[6] ); let s; for (s = 0; s < t.length; s += 1) { - const r = ds(i, t, s); - n[s] ? n[s].p(r, o) : (n[s] = gs(r), n[s].c(), n[s].m(e.parentNode, e)); + const r = gs(i, t, s); + n[s] ? n[s].p(r, o) : (n[s] = ps(r), n[s].c(), n[s].m(e.parentNode, e)); } for (; s < n.length; s += 1) n[s].d(1); @@ -5401,65 +5401,65 @@ function D1(l) { } }, d(i) { - i && Be(e), p1(n, i); + i && Ee(e), y1(n, i); } }; } -function R1(l) { +function j1(l) { let e, t = ( /*i18n*/ l[3]("common.no_devices") + "" ), n; return { c() { - e = He("option"), n = Ga(t), e.__value = "", Ki(e, e.__value), ae(e, "class", "svelte-8hqvb6"); + e = Ie("option"), n = xa(t), e.__value = "", Qi(e, e.__value), re(e, "class", "svelte-8hqvb6"); }, m(i, o) { - Ee(i, e, o), ct(e, n); + Me(i, e, o), ct(e, n); }, p(i, o) { o[0] & /*i18n*/ 8 && t !== (t = /*i18n*/ - i[3]("common.no_devices") + "") && Ka(n, t); + i[3]("common.no_devices") + "") && Qa(n, t); }, d(i) { - i && Be(e); + i && Ee(e); } }; } -function gs(l) { +function ps(l) { let e, t = ( /*device*/ l[32].label + "" ), n, i, o, s; return { c() { - e = He("option"), n = Ga(t), i = Kn(), e.__value = o = /*device*/ - l[32].deviceId, Ki(e, e.__value), e.selected = s = /*selected_device*/ + e = Ie("option"), n = xa(t), i = Kn(), e.__value = o = /*device*/ + l[32].deviceId, Qi(e, e.__value), e.selected = s = /*selected_device*/ l[7].deviceId === /*device*/ - l[32].deviceId, ae(e, "class", "svelte-8hqvb6"); + l[32].deviceId, re(e, "class", "svelte-8hqvb6"); }, m(r, a) { - Ee(r, e, a), ct(e, n), ct(e, i); + Me(r, e, a), ct(e, n), ct(e, i); }, p(r, a) { a[0] & /*available_video_devices*/ 64 && t !== (t = /*device*/ - r[32].label + "") && Ka(n, t), a[0] & /*available_video_devices*/ + r[32].label + "") && Qa(n, t), a[0] & /*available_video_devices*/ 64 && o !== (o = /*device*/ - r[32].deviceId) && (e.__value = o, Ki(e, e.__value)), a[0] & /*selected_device, available_video_devices*/ + r[32].deviceId) && (e.__value = o, Qi(e, e.__value)), a[0] & /*selected_device, available_video_devices*/ 192 && s !== (s = /*selected_device*/ r[7].deviceId === /*device*/ r[32].deviceId) && (e.selected = s); }, d(r) { - r && Be(e); + r && Ee(e); } }; } -function T1(l) { +function H1(l) { let e, t, n, i, o, s; - const r = [B1, q1], a = []; + const r = [A1, M1], a = []; function f(u, c) { return ( /*webcam_accessed*/ @@ -5468,16 +5468,16 @@ function T1(l) { } return i = f(l), o = a[i] = r[i](l), { c() { - e = He("div"), t = He("video"), n = Kn(), o.c(), ae(t, "class", "svelte-8hqvb6"), hl( + e = Ie("div"), t = Ie("video"), n = Kn(), o.c(), re(t, "class", "svelte-8hqvb6"), hl( t, "flip", /*mirror_webcam*/ l[2] ), hl(t, "hide", !/*webcam_accessed*/ - l[9]), ae(e, "class", "wrap svelte-8hqvb6"); + l[9]), re(e, "class", "wrap svelte-8hqvb6"); }, m(u, c) { - Ee(u, e, c), ct(e, t), l[19](t), ct(e, n), a[i].m(e, null), s = !0; + Me(u, e, c), ct(e, t), l[19](t), ct(e, n), a[i].m(e, null), s = !0; }, p(u, c) { (!s || c[0] & /*mirror_webcam*/ @@ -5492,20 +5492,20 @@ function T1(l) { let _ = i; i = f(u), i === _ ? a[i].p(u, c) : (On(), ve(a[_], 1, 1, () => { a[_] = null; - }), Un(), o = a[i], o ? o.p(u, c) : (o = a[i] = r[i](u), o.c()), de(o, 1), o.m(e, null)); + }), Un(), o = a[i], o ? o.p(u, c) : (o = a[i] = r[i](u), o.c()), he(o, 1), o.m(e, null)); }, i(u) { - s || (de(o), s = !0); + s || (he(o), s = !0); }, o(u) { ve(o), s = !1; }, d(u) { - u && Be(e), l[19](null), a[i].d(); + u && Ee(e), l[19](null), a[i].d(); } }; } -function ro(l, e) { +function co(l, e) { const t = (n) => { l && !l.contains(n.target) && !n.defaultPrevented && e(n); }; @@ -5515,111 +5515,111 @@ function ro(l, e) { } }; } -function I1(l, e, t) { - var n = this && this.__awaiter || function(T, O, L, P) { - function he(ie) { - return ie instanceof L ? ie : new L(function(ge) { - ge(ie); +function F1(l, e, t) { + var n = this && this.__awaiter || function(L, F, D, W) { + function $(oe) { + return oe instanceof D ? oe : new D(function(ge) { + ge(oe); }); } - return new (L || (L = Promise))(function(ie, ge) { + return new (D || (D = Promise))(function(oe, ge) { function I(H) { try { - M(P.next(H)); + M(W.next(H)); } catch (G) { ge(G); } } - function Me(H) { + function Xe(H) { try { - M(P.throw(H)); + M(W.throw(H)); } catch (G) { ge(G); } } function M(H) { - H.done ? ie(H.value) : he(H.value).then(I, Me); + H.done ? oe(H.value) : $(H.value).then(I, Xe); } - M((P = P.apply(T, O || [])).next()); + M((W = W.apply(L, F || [])).next()); }); }; - let i, o = [], s = null, r, { streaming: a = !1 } = e, { pending: f = !1 } = e, { root: u = "" } = e, { mode: c = "image" } = e, { mirror_webcam: _ } = e, { include_audio: d } = e, { i18n: m } = e, { upload: h } = e; - const p = S1(); - z1(() => r = document.createElement("canvas")); - const w = (T) => n(void 0, void 0, void 0, function* () { - const L = T.target.value; - yield cs(d, i, L).then((P) => n(void 0, void 0, void 0, function* () { - v = P, t(7, s = o.find((he) => he.deviceId === L) || null), t(10, D = !1); + let i, o = [], s = null, r, { streaming: a = !1 } = e, { pending: f = !1 } = e, { root: u = "" } = e, { mode: c = "image" } = e, { mirror_webcam: _ } = e, { include_audio: d } = e, { i18n: h } = e, { upload: m } = e; + const w = q1(); + E1(() => r = document.createElement("canvas")); + const b = (L) => n(void 0, void 0, void 0, function* () { + const D = L.target.value; + yield hs(d, i, D).then((W) => n(void 0, void 0, void 0, function* () { + y = W, t(7, s = o.find(($) => $.deviceId === D) || null), t(10, R = !1); })); }); - function b() { + function p() { return n(this, void 0, void 0, function* () { try { - cs(d, i).then((T) => n(this, void 0, void 0, function* () { - t(9, S = !0), t(6, o = yield c1()), v = T; - })).then(() => d1(o)).then((T) => { - t(6, o = T); - const O = v.getTracks().map((L) => { - var P; - return (P = L.getSettings()) === null || P === void 0 ? void 0 : P.deviceId; + hs(d, i).then((L) => n(this, void 0, void 0, function* () { + t(9, S = !0), t(6, o = yield h1()), y = L; + })).then(() => g1(o)).then((L) => { + t(6, o = L); + const F = y.getTracks().map((D) => { + var W; + return (W = D.getSettings()) === null || W === void 0 ? void 0 : W.deviceId; })[0]; - t(7, s = O && T.find((L) => L.deviceId === O) || o[0]); - }), (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) && p("error", m("image.no_webcam_support")); - } catch (T) { - if (T instanceof DOMException && T.name == "NotAllowedError") - p("error", m("image.allow_webcam_access")); + t(7, s = F && L.find((D) => D.deviceId === F) || o[0]); + }), (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) && w("error", h("image.no_webcam_support")); + } catch (L) { + if (L instanceof DOMException && L.name == "NotAllowedError") + w("error", h("image.allow_webcam_access")); else - throw T; + throw L; } }); } function g() { - var T = r.getContext("2d"); - (!a || a && k) && i.videoWidth && i.videoHeight && (r.width = i.videoWidth, r.height = i.videoHeight, T.drawImage(i, 0, 0, i.videoWidth, i.videoHeight), _ && (T.scale(-1, 1), T.drawImage(i, -i.videoWidth, 0)), r.toBlob( - (O) => { - p(a ? "stream" : "capture", O); + var L = r.getContext("2d"); + (!a || a && v) && i.videoWidth && i.videoHeight && (r.width = i.videoWidth, r.height = i.videoHeight, L.drawImage(i, 0, 0, i.videoWidth, i.videoHeight), _ && (L.scale(-1, 1), L.drawImage(i, -i.videoWidth, 0)), r.toBlob( + (F) => { + w(a ? "stream" : "capture", F); }, "image/png", 0.8 )); } - let k = !1, C = [], v, z, y; + let v = !1, E = [], y, C, k; function A() { - if (k) { - y.stop(); - let T = new Blob(C, { type: z }), O = new FileReader(); - O.onload = function(L) { + if (v) { + k.stop(); + let L = new Blob(E, { type: C }), F = new FileReader(); + F.onload = function(D) { return n(this, void 0, void 0, function* () { - var P; - if (L.target) { - let he = new File([T], "sample." + z.substring(6)); - const ie = yield Ha([he]); - let ge = ((P = yield h(ie, u)) === null || P === void 0 ? void 0 : P.filter(Boolean))[0]; - p("capture", ge), p("stop_recording"); + var W; + if (D.target) { + let $ = new File([L], "sample." + C.substring(6)); + const oe = yield Ya([$]); + let ge = ((W = yield m(oe, u)) === null || W === void 0 ? void 0 : W.filter(Boolean))[0]; + w("capture", ge), w("stop_recording"); } }); - }, O.readAsDataURL(T); + }, F.readAsDataURL(L); } else { - p("start_recording"), C = []; - let T = ["video/webm", "video/mp4"]; - for (let O of T) - if (MediaRecorder.isTypeSupported(O)) { - z = O; + w("start_recording"), E = []; + let L = ["video/webm", "video/mp4"]; + for (let F of L) + if (MediaRecorder.isTypeSupported(F)) { + C = F; break; } - if (z === null) { + if (C === null) { console.error("No supported MediaRecorder mimeType"); return; } - y = new MediaRecorder(v, { mimeType: z }), y.addEventListener("dataavailable", function(O) { - C.push(O.data); - }), y.start(200); + k = new MediaRecorder(y, { mimeType: C }), k.addEventListener("dataavailable", function(F) { + E.push(F.data); + }), k.start(200); } - t(8, k = !k); + t(8, v = !v); } let S = !1; - function R() { - c === "image" && a && t(8, k = !k), c === "image" ? g() : A(), !k && v && (v.getTracks().forEach((T) => T.stop()), t(5, i.srcObject = null, i), t(9, S = !1)); + function T() { + c === "image" && a && t(8, v = !v), c === "image" ? g() : A(), !v && y && (y.getTracks().forEach((L) => L.stop()), t(5, i.srcObject = null, i), t(9, S = !1)); } a && c === "image" && window.setInterval( () => { @@ -5627,52 +5627,52 @@ function I1(l, e, t) { }, 500 ); - let D = !1; - function N(T) { - T.preventDefault(), T.stopPropagation(), t(10, D = !1); + let R = !1; + function U(L) { + L.preventDefault(), L.stopPropagation(), t(10, R = !1); } - function J(T) { - b1[T ? "unshift" : "push"](() => { - i = T, t(5, i); + function Z(L) { + v1[L ? "unshift" : "push"](() => { + i = L, t(5, i); }); } - const Q = async () => b(), V = () => t(10, D = !0), U = () => t(10, D = !1); - return l.$$set = (T) => { - "streaming" in T && t(0, a = T.streaming), "pending" in T && t(15, f = T.pending), "root" in T && t(16, u = T.root), "mode" in T && t(1, c = T.mode), "mirror_webcam" in T && t(2, _ = T.mirror_webcam), "include_audio" in T && t(17, d = T.include_audio), "i18n" in T && t(3, m = T.i18n), "upload" in T && t(18, h = T.upload); + const Q = async () => p(), J = () => t(10, R = !0), K = () => t(10, R = !1); + return l.$$set = (L) => { + "streaming" in L && t(0, a = L.streaming), "pending" in L && t(15, f = L.pending), "root" in L && t(16, u = L.root), "mode" in L && t(1, c = L.mode), "mirror_webcam" in L && t(2, _ = L.mirror_webcam), "include_audio" in L && t(17, d = L.include_audio), "i18n" in L && t(3, h = L.i18n), "upload" in L && t(18, m = L.upload); }, [ a, c, _, - m, - ro, + h, + co, i, o, s, - k, + v, S, - D, - w, - b, R, - N, + b, + p, + T, + U, f, u, d, - h, - J, + m, + Z, Q, - V, - U + J, + K ]; } -class j1 extends h1 { +class X1 extends b1 { constructor(e) { - super(), v1( + super(), C1( this, e, - I1, - T1, - y1, + F1, + H1, + z1, { streaming: 0, pending: 15, @@ -5689,161 +5689,161 @@ class j1 extends h1 { ); } get click_outside() { - return ro; + return co; } } const { - SvelteComponent: H1, - append: kt, + SvelteComponent: Y1, + append: yt, attr: j, - detach: F1, - init: X1, - insert: Y1, - noop: qi, - safe_not_equal: N1, - set_style: yt, + detach: N1, + init: U1, + insert: O1, + noop: Mi, + safe_not_equal: W1, + set_style: Ct, svg_element: rt } = window.__gradio__svelte__internal; -function U1(l) { +function V1(l) { let e, t, n, i, o, s, r, a, f; return { c() { - e = rt("svg"), t = rt("rect"), n = rt("rect"), i = rt("rect"), o = rt("rect"), s = rt("line"), r = rt("line"), a = rt("line"), f = rt("line"), j(t, "x", "2"), j(t, "y", "2"), j(t, "width", "5"), j(t, "height", "5"), j(t, "rx", "1"), j(t, "ry", "1"), j(t, "stroke-width", "2"), j(t, "fill", "none"), j(n, "x", "17"), j(n, "y", "2"), j(n, "width", "5"), j(n, "height", "5"), j(n, "rx", "1"), j(n, "ry", "1"), j(n, "stroke-width", "2"), j(n, "fill", "none"), j(i, "x", "2"), j(i, "y", "17"), j(i, "width", "5"), j(i, "height", "5"), j(i, "rx", "1"), j(i, "ry", "1"), j(i, "stroke-width", "2"), j(i, "fill", "none"), j(o, "x", "17"), j(o, "y", "17"), j(o, "width", "5"), j(o, "height", "5"), j(o, "rx", "1"), j(o, "ry", "1"), j(o, "stroke-width", "2"), j(o, "fill", "none"), j(s, "x1", "7.5"), j(s, "y1", "4.5"), j(s, "x2", "16"), j(s, "y2", "4.5"), yt(s, "stroke-width", "2px"), j(r, "x1", "7.5"), j(r, "y1", "19.5"), j(r, "x2", "16"), j(r, "y2", "19.5"), yt(r, "stroke-width", "2px"), j(a, "x1", "4.5"), j(a, "y1", "8"), j(a, "x2", "4.5"), j(a, "y2", "16"), yt(a, "stroke-width", "2px"), j(f, "x1", "19.5"), j(f, "y1", "8"), j(f, "x2", "19.5"), j(f, "y2", "16"), yt(f, "stroke-width", "2px"), j(e, "width", "100%"), j(e, "height", "100%"), j(e, "viewBox", "0 0 24 24"), j(e, "version", "1.1"), j(e, "xmlns", "http://www.w3.org/2000/svg"), j(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), j(e, "xml:space", "preserve"), j(e, "stroke", "currentColor"), yt(e, "fill-rule", "evenodd"), yt(e, "clip-rule", "evenodd"), yt(e, "stroke-linecap", "round"), yt(e, "stroke-linejoin", "round"); + e = rt("svg"), t = rt("rect"), n = rt("rect"), i = rt("rect"), o = rt("rect"), s = rt("line"), r = rt("line"), a = rt("line"), f = rt("line"), j(t, "x", "2"), j(t, "y", "2"), j(t, "width", "5"), j(t, "height", "5"), j(t, "rx", "1"), j(t, "ry", "1"), j(t, "stroke-width", "2"), j(t, "fill", "none"), j(n, "x", "17"), j(n, "y", "2"), j(n, "width", "5"), j(n, "height", "5"), j(n, "rx", "1"), j(n, "ry", "1"), j(n, "stroke-width", "2"), j(n, "fill", "none"), j(i, "x", "2"), j(i, "y", "17"), j(i, "width", "5"), j(i, "height", "5"), j(i, "rx", "1"), j(i, "ry", "1"), j(i, "stroke-width", "2"), j(i, "fill", "none"), j(o, "x", "17"), j(o, "y", "17"), j(o, "width", "5"), j(o, "height", "5"), j(o, "rx", "1"), j(o, "ry", "1"), j(o, "stroke-width", "2"), j(o, "fill", "none"), j(s, "x1", "7.5"), j(s, "y1", "4.5"), j(s, "x2", "16"), j(s, "y2", "4.5"), Ct(s, "stroke-width", "2px"), j(r, "x1", "7.5"), j(r, "y1", "19.5"), j(r, "x2", "16"), j(r, "y2", "19.5"), Ct(r, "stroke-width", "2px"), j(a, "x1", "4.5"), j(a, "y1", "8"), j(a, "x2", "4.5"), j(a, "y2", "16"), Ct(a, "stroke-width", "2px"), j(f, "x1", "19.5"), j(f, "y1", "8"), j(f, "x2", "19.5"), j(f, "y2", "16"), Ct(f, "stroke-width", "2px"), j(e, "width", "100%"), j(e, "height", "100%"), j(e, "viewBox", "0 0 24 24"), j(e, "version", "1.1"), j(e, "xmlns", "http://www.w3.org/2000/svg"), j(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), j(e, "xml:space", "preserve"), j(e, "stroke", "currentColor"), Ct(e, "fill-rule", "evenodd"), Ct(e, "clip-rule", "evenodd"), Ct(e, "stroke-linecap", "round"), Ct(e, "stroke-linejoin", "round"); }, m(u, c) { - Y1(u, e, c), kt(e, t), kt(e, n), kt(e, i), kt(e, o), kt(e, s), kt(e, r), kt(e, a), kt(e, f); + O1(u, e, c), yt(e, t), yt(e, n), yt(e, i), yt(e, o), yt(e, s), yt(e, r), yt(e, a), yt(e, f); }, - p: qi, - i: qi, - o: qi, + p: Mi, + i: Mi, + o: Mi, d(u) { - u && F1(e); + u && N1(e); } }; } -class O1 extends H1 { +class P1 extends Y1 { constructor(e) { - super(), X1(this, e, null, U1, N1, {}); + super(), U1(this, e, null, V1, W1, {}); } } const { - SvelteComponent: W1, - append: V1, + SvelteComponent: Z1, + append: K1, attr: Ze, - detach: P1, - init: Z1, - insert: K1, - noop: Bi, - safe_not_equal: G1, + detach: G1, + init: J1, + insert: Q1, + noop: Ai, + safe_not_equal: x1, set_style: ml, - svg_element: bs + svg_element: vs } = window.__gradio__svelte__internal; -function J1(l) { +function $1(l) { let e, t; return { c() { - e = bs("svg"), t = bs("path"), Ze(t, "d", "M 14.4 2.85 V 11.1 V 3.95 C 14.4 3.0387 15.1388 2.3 16.05 2.3 C 16.9612 2.3 17.7 3.0387 17.7 3.95 V 11.1 V 7.25 C 17.7 6.3387 18.4388 5.6 19.35 5.6 C 20.2612 5.6 21 6.3387 21 7.25 V 16.6 C 21 20.2451 18.0451 23.2 14.4 23.2 H 13.16 C 11.4831 23.2 9.8692 22.5618 8.6459 21.4149 L 3.1915 16.3014 C 2.403 15.5622 2.3829 14.3171 3.1472 13.5528 C 3.8943 12.8057 5.1057 12.8057 5.8528 13.5528 L 7.8 15.5 V 6.15 C 7.8 5.2387 8.5387 4.5 9.45 4.5 C 10.3612 4.5 11.1 5.2387 11.1 6.15 V 11.1 V 2.85 C 11.1 1.9387 11.8388 1.2 12.75 1.2 C 13.6612 1.2 14.4 1.9387 14.4 2.85 Z"), Ze(t, "fill", "none"), Ze(t, "stroke-width", "2"), Ze(e, "width", "100%"), Ze(e, "height", "100%"), Ze(e, "viewBox", "0 0 24 24"), Ze(e, "version", "1.1"), Ze(e, "xmlns", "http://www.w3.org/2000/svg"), Ze(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ze(e, "xml:space", "preserve"), Ze(e, "stroke", "currentColor"), ml(e, "fill-rule", "evenodd"), ml(e, "clip-rule", "evenodd"), ml(e, "stroke-linecap", "round"), ml(e, "stroke-linejoin", "round"); + e = vs("svg"), t = vs("path"), Ze(t, "d", "M 14.4 2.85 V 11.1 V 3.95 C 14.4 3.0387 15.1388 2.3 16.05 2.3 C 16.9612 2.3 17.7 3.0387 17.7 3.95 V 11.1 V 7.25 C 17.7 6.3387 18.4388 5.6 19.35 5.6 C 20.2612 5.6 21 6.3387 21 7.25 V 16.6 C 21 20.2451 18.0451 23.2 14.4 23.2 H 13.16 C 11.4831 23.2 9.8692 22.5618 8.6459 21.4149 L 3.1915 16.3014 C 2.403 15.5622 2.3829 14.3171 3.1472 13.5528 C 3.8943 12.8057 5.1057 12.8057 5.8528 13.5528 L 7.8 15.5 V 6.15 C 7.8 5.2387 8.5387 4.5 9.45 4.5 C 10.3612 4.5 11.1 5.2387 11.1 6.15 V 11.1 V 2.85 C 11.1 1.9387 11.8388 1.2 12.75 1.2 C 13.6612 1.2 14.4 1.9387 14.4 2.85 Z"), Ze(t, "fill", "none"), Ze(t, "stroke-width", "2"), Ze(e, "width", "100%"), Ze(e, "height", "100%"), Ze(e, "viewBox", "0 0 24 24"), Ze(e, "version", "1.1"), Ze(e, "xmlns", "http://www.w3.org/2000/svg"), Ze(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ze(e, "xml:space", "preserve"), Ze(e, "stroke", "currentColor"), ml(e, "fill-rule", "evenodd"), ml(e, "clip-rule", "evenodd"), ml(e, "stroke-linecap", "round"), ml(e, "stroke-linejoin", "round"); }, m(n, i) { - K1(n, e, i), V1(e, t); + Q1(n, e, i), K1(e, t); }, - p: Bi, - i: Bi, - o: Bi, + p: Ai, + i: Ai, + o: Ai, d(n) { - n && P1(e); + n && G1(e); } }; } -class Q1 extends W1 { +class e0 extends Z1 { constructor(e) { - super(), Z1(this, e, null, J1, G1, {}); + super(), J1(this, e, null, $1, x1, {}); } } const { - SvelteComponent: x1, - append: $1, + SvelteComponent: t0, + append: n0, attr: Ke, - detach: e0, - init: t0, - insert: n0, - noop: Ei, - safe_not_equal: l0, + detach: l0, + init: i0, + insert: o0, + noop: Li, + safe_not_equal: s0, set_style: gl, - svg_element: ws + svg_element: ks } = window.__gradio__svelte__internal; -function i0(l) { +function a0(l) { let e, t; return { c() { - e = ws("svg"), t = ws("path"), Ke(t, "d", "M10 12L14 16M14 12L10 16M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6"), Ke(t, "fill", "none"), Ke(t, "stroke-width", "2"), Ke(e, "width", "100%"), Ke(e, "height", "100%"), Ke(e, "viewBox", "0 0 24 24"), Ke(e, "version", "1.1"), Ke(e, "xmlns", "http://www.w3.org/2000/svg"), Ke(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ke(e, "xml:space", "preserve"), Ke(e, "stroke", "currentColor"), gl(e, "fill-rule", "evenodd"), gl(e, "clip-rule", "evenodd"), gl(e, "stroke-linecap", "round"), gl(e, "stroke-linejoin", "round"); + e = ks("svg"), t = ks("path"), Ke(t, "d", "M10 12L14 16M14 12L10 16M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6"), Ke(t, "fill", "none"), Ke(t, "stroke-width", "2"), Ke(e, "width", "100%"), Ke(e, "height", "100%"), Ke(e, "viewBox", "0 0 24 24"), Ke(e, "version", "1.1"), Ke(e, "xmlns", "http://www.w3.org/2000/svg"), Ke(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ke(e, "xml:space", "preserve"), Ke(e, "stroke", "currentColor"), gl(e, "fill-rule", "evenodd"), gl(e, "clip-rule", "evenodd"), gl(e, "stroke-linecap", "round"), gl(e, "stroke-linejoin", "round"); }, m(n, i) { - n0(n, e, i), $1(e, t); + o0(n, e, i), n0(e, t); }, - p: Ei, - i: Ei, - o: Ei, + p: Li, + i: Li, + o: Li, d(n) { - n && e0(e); + n && l0(e); } }; } -class o0 extends x1 { +class r0 extends t0 { constructor(e) { - super(), t0(this, e, null, i0, l0, {}); + super(), i0(this, e, null, a0, s0, {}); } } const { - SvelteComponent: s0, - append: ps, - attr: Mi, - bubble: vs, - create_component: a0, - destroy_component: r0, - detach: Ja, - element: ks, - init: f0, - insert: Qa, - listen: Ai, - mount_component: u0, - run_all: c0, - safe_not_equal: _0, - set_data: d0, - set_input_value: ys, - space: h0, - text: m0, - transition_in: g0, - transition_out: b0 -} = window.__gradio__svelte__internal, { createEventDispatcher: w0, afterUpdate: p0 } = window.__gradio__svelte__internal; -function v0(l) { + SvelteComponent: f0, + append: ys, + attr: Di, + bubble: Cs, + create_component: u0, + destroy_component: c0, + detach: $a, + element: Ss, + init: _0, + insert: er, + listen: Ri, + mount_component: d0, + run_all: h0, + safe_not_equal: m0, + set_data: g0, + set_input_value: zs, + space: b0, + text: w0, + transition_in: p0, + transition_out: v0 +} = window.__gradio__svelte__internal, { createEventDispatcher: k0, afterUpdate: y0 } = window.__gradio__svelte__internal; +function C0(l) { let e; return { c() { - e = m0( + e = w0( /*label*/ l[1] ); }, m(t, n) { - Qa(t, e, n); + er(t, e, n); }, p(t, n) { n & /*label*/ - 2 && d0( + 2 && g0( e, /*label*/ t[1] ); }, d(t) { - t && Ja(e); + t && $a(e); } }; } -function k0(l) { +function S0(l) { let e, t, n, i, o, s, r; - return t = new ia({ + return t = new aa({ props: { show_label: ( /*show_label*/ @@ -5853,33 +5853,33 @@ function k0(l) { /*info*/ l[2] ), - $$slots: { default: [v0] }, + $$slots: { default: [C0] }, $$scope: { ctx: l } } }), { c() { - e = ks("label"), a0(t.$$.fragment), n = h0(), i = ks("input"), Mi(i, "type", "color"), i.disabled = /*disabled*/ - l[3], Mi(i, "class", "svelte-16l8u73"), Mi(e, "class", "block"); + e = Ss("label"), u0(t.$$.fragment), n = b0(), i = Ss("input"), Di(i, "type", "color"), i.disabled = /*disabled*/ + l[3], Di(i, "class", "svelte-16l8u73"), Di(e, "class", "block"); }, m(a, f) { - Qa(a, e, f), u0(t, e, null), ps(e, n), ps(e, i), ys( + er(a, e, f), d0(t, e, null), ys(e, n), ys(e, i), zs( i, /*value*/ l[0] ), o = !0, s || (r = [ - Ai( + Ri( i, "input", /*input_input_handler*/ l[8] ), - Ai( + Ri( i, "focus", /*focus_handler*/ l[6] ), - Ai( + Ri( i, "blur", /*blur_handler*/ @@ -5897,43 +5897,43 @@ function k0(l) { 2050 && (u.$$scope = { dirty: f, ctx: a }), t.$set(u), (!o || f & /*disabled*/ 8) && (i.disabled = /*disabled*/ a[3]), f & /*value*/ - 1 && ys( + 1 && zs( i, /*value*/ a[0] ); }, i(a) { - o || (g0(t.$$.fragment, a), o = !0); + o || (p0(t.$$.fragment, a), o = !0); }, o(a) { - b0(t.$$.fragment, a), o = !1; + v0(t.$$.fragment, a), o = !1; }, d(a) { - a && Ja(e), r0(t), s = !1, c0(r); + a && $a(e), c0(t), s = !1, h0(r); } }; } -function y0(l, e, t) { +function z0(l, e, t) { let { value: n = "#000000" } = e, { value_is_output: i = !1 } = e, { label: o } = e, { info: s = void 0 } = e, { disabled: r = !1 } = e, { show_label: a = !0 } = e; - const f = w0(); + const f = k0(); function u() { f("change", n), i || f("input"); } - p0(() => { + y0(() => { t(5, i = !1); }); - function c(m) { - vs.call(this, l, m); + function c(h) { + Cs.call(this, l, h); } - function _(m) { - vs.call(this, l, m); + function _(h) { + Cs.call(this, l, h); } function d() { n = this.value, t(0, n); } - return l.$$set = (m) => { - "value" in m && t(0, n = m.value), "value_is_output" in m && t(5, i = m.value_is_output), "label" in m && t(1, o = m.label), "info" in m && t(2, s = m.info), "disabled" in m && t(3, r = m.disabled), "show_label" in m && t(4, a = m.show_label); + return l.$$set = (h) => { + "value" in h && t(0, n = h.value), "value_is_output" in h && t(5, i = h.value_is_output), "label" in h && t(1, o = h.label), "info" in h && t(2, s = h.info), "disabled" in h && t(3, r = h.disabled), "show_label" in h && t(4, a = h.show_label); }, l.$$.update = () => { l.$$.dirty & /*value*/ 1 && u(); @@ -5949,9 +5949,9 @@ function y0(l, e, t) { d ]; } -class C0 extends s0 { +class B0 extends f0 { constructor(e) { - super(), f0(this, e, y0, k0, _0, { + super(), _0(this, e, z0, S0, m0, { value: 0, value_is_output: 5, label: 1, @@ -5962,39 +5962,39 @@ class C0 extends s0 { } } const { - SvelteComponent: S0, - append: xa, - attr: te, - bubble: z0, - check_outros: q0, - create_slot: $a, + SvelteComponent: q0, + append: tr, + attr: ne, + bubble: E0, + check_outros: M0, + create_slot: nr, detach: tl, - element: $l, - empty: B0, - get_all_dirty_from_scope: er, - get_slot_changes: tr, - group_outros: E0, - init: M0, + element: ei, + empty: A0, + get_all_dirty_from_scope: lr, + get_slot_changes: ir, + group_outros: L0, + init: D0, insert: nl, - listen: A0, - safe_not_equal: L0, - set_style: ze, - space: nr, - src_url_equal: Fl, + listen: R0, + safe_not_equal: T0, + set_style: Be, + space: or, + src_url_equal: Xl, toggle_class: mn, - transition_in: Xl, - transition_out: Yl, - update_slot_base: lr + transition_in: Yl, + transition_out: Nl, + update_slot_base: sr } = window.__gradio__svelte__internal; -function D0(l) { +function I0(l) { let e, t, n, i, o, s, r = ( /*icon*/ - l[7] && Cs(l) + l[7] && Bs(l) ); const a = ( /*#slots*/ l[12].default - ), f = $a( + ), f = nr( a, l, /*$$scope*/ @@ -6003,32 +6003,32 @@ function D0(l) { ); return { c() { - e = $l("button"), r && r.c(), t = nr(), f && f.c(), te(e, "class", n = /*size*/ + e = ei("button"), r && r.c(), t = or(), f && f.c(), ne(e, "class", n = /*size*/ l[4] + " " + /*variant*/ l[3] + " " + /*elem_classes*/ - l[1].join(" ") + " svelte-8huxfn"), te( + l[1].join(" ") + " svelte-8huxfn"), ne( e, "id", /*elem_id*/ l[0] ), e.disabled = /*disabled*/ l[8], mn(e, "hidden", !/*visible*/ - l[2]), ze( + l[2]), Be( e, "flex-grow", /*scale*/ l[9] - ), ze( + ), Be( e, "width", /*scale*/ l[9] === 0 ? "fit-content" : null - ), ze(e, "min-width", typeof /*min_width*/ + ), Be(e, "min-width", typeof /*min_width*/ l[10] == "number" ? `calc(min(${/*min_width*/ l[10]}px, 100%))` : null); }, m(u, c) { - nl(u, e, c), r && r.m(e, null), xa(e, t), f && f.m(e, null), i = !0, o || (s = A0( + nl(u, e, c), r && r.m(e, null), tr(e, t), f && f.m(e, null), i = !0, o || (s = R0( e, "click", /*click_handler*/ @@ -6037,20 +6037,20 @@ function D0(l) { }, p(u, c) { /*icon*/ - u[7] ? r ? r.p(u, c) : (r = Cs(u), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!i || c & /*$$scope*/ - 2048) && lr( + u[7] ? r ? r.p(u, c) : (r = Bs(u), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!i || c & /*$$scope*/ + 2048) && sr( f, a, u, /*$$scope*/ u[11], - i ? tr( + i ? ir( a, /*$$scope*/ u[11], c, null - ) : er( + ) : lr( /*$$scope*/ u[11] ), @@ -6059,8 +6059,8 @@ function D0(l) { 26 && n !== (n = /*size*/ u[4] + " " + /*variant*/ u[3] + " " + /*elem_classes*/ - u[1].join(" ") + " svelte-8huxfn")) && te(e, "class", n), (!i || c & /*elem_id*/ - 1) && te( + u[1].join(" ") + " svelte-8huxfn")) && ne(e, "class", n), (!i || c & /*elem_id*/ + 1) && ne( e, "id", /*elem_id*/ @@ -6070,42 +6070,42 @@ function D0(l) { u[8]), (!i || c & /*size, variant, elem_classes, visible*/ 30) && mn(e, "hidden", !/*visible*/ u[2]), c & /*scale*/ - 512 && ze( + 512 && Be( e, "flex-grow", /*scale*/ u[9] ), c & /*scale*/ - 512 && ze( + 512 && Be( e, "width", /*scale*/ u[9] === 0 ? "fit-content" : null ), c & /*min_width*/ - 1024 && ze(e, "min-width", typeof /*min_width*/ + 1024 && Be(e, "min-width", typeof /*min_width*/ u[10] == "number" ? `calc(min(${/*min_width*/ u[10]}px, 100%))` : null); }, i(u) { - i || (Xl(f, u), i = !0); + i || (Yl(f, u), i = !0); }, o(u) { - Yl(f, u), i = !1; + Nl(f, u), i = !1; }, d(u) { u && tl(e), r && r.d(), f && f.d(u), o = !1, s(); } }; } -function R0(l) { +function j0(l) { let e, t, n, i, o = ( /*icon*/ - l[7] && Ss(l) + l[7] && qs(l) ); const s = ( /*#slots*/ l[12].default - ), r = $a( + ), r = nr( s, l, /*$$scope*/ @@ -6114,20 +6114,20 @@ function R0(l) { ); return { c() { - e = $l("a"), o && o.c(), t = nr(), r && r.c(), te( + e = ei("a"), o && o.c(), t = or(), r && r.c(), ne( e, "href", /*link*/ l[6] - ), te(e, "rel", "noopener noreferrer"), te( + ), ne(e, "rel", "noopener noreferrer"), ne( e, "aria-disabled", /*disabled*/ l[8] - ), te(e, "class", n = /*size*/ + ), ne(e, "class", n = /*size*/ l[4] + " " + /*variant*/ l[3] + " " + /*elem_classes*/ - l[1].join(" ") + " svelte-8huxfn"), te( + l[1].join(" ") + " svelte-8huxfn"), ne( e, "id", /*elem_id*/ @@ -6138,56 +6138,56 @@ function R0(l) { "disabled", /*disabled*/ l[8] - ), ze( + ), Be( e, "flex-grow", /*scale*/ l[9] - ), ze( + ), Be( e, "pointer-events", /*disabled*/ l[8] ? "none" : null - ), ze( + ), Be( e, "width", /*scale*/ l[9] === 0 ? "fit-content" : null - ), ze(e, "min-width", typeof /*min_width*/ + ), Be(e, "min-width", typeof /*min_width*/ l[10] == "number" ? `calc(min(${/*min_width*/ l[10]}px, 100%))` : null); }, m(a, f) { - nl(a, e, f), o && o.m(e, null), xa(e, t), r && r.m(e, null), i = !0; + nl(a, e, f), o && o.m(e, null), tr(e, t), r && r.m(e, null), i = !0; }, p(a, f) { /*icon*/ - a[7] ? o ? o.p(a, f) : (o = Ss(a), o.c(), o.m(e, t)) : o && (o.d(1), o = null), r && r.p && (!i || f & /*$$scope*/ - 2048) && lr( + a[7] ? o ? o.p(a, f) : (o = qs(a), o.c(), o.m(e, t)) : o && (o.d(1), o = null), r && r.p && (!i || f & /*$$scope*/ + 2048) && sr( r, s, a, /*$$scope*/ a[11], - i ? tr( + i ? ir( s, /*$$scope*/ a[11], f, null - ) : er( + ) : lr( /*$$scope*/ a[11] ), null ), (!i || f & /*link*/ - 64) && te( + 64) && ne( e, "href", /*link*/ a[6] ), (!i || f & /*disabled*/ - 256) && te( + 256) && ne( e, "aria-disabled", /*disabled*/ @@ -6196,8 +6196,8 @@ function R0(l) { 26 && n !== (n = /*size*/ a[4] + " " + /*variant*/ a[3] + " " + /*elem_classes*/ - a[1].join(" ") + " svelte-8huxfn")) && te(e, "class", n), (!i || f & /*elem_id*/ - 1) && te( + a[1].join(" ") + " svelte-8huxfn")) && ne(e, "class", n), (!i || f & /*elem_id*/ + 1) && ne( e, "id", /*elem_id*/ @@ -6211,45 +6211,45 @@ function R0(l) { /*disabled*/ a[8] ), f & /*scale*/ - 512 && ze( + 512 && Be( e, "flex-grow", /*scale*/ a[9] ), f & /*disabled*/ - 256 && ze( + 256 && Be( e, "pointer-events", /*disabled*/ a[8] ? "none" : null ), f & /*scale*/ - 512 && ze( + 512 && Be( e, "width", /*scale*/ a[9] === 0 ? "fit-content" : null ), f & /*min_width*/ - 1024 && ze(e, "min-width", typeof /*min_width*/ + 1024 && Be(e, "min-width", typeof /*min_width*/ a[10] == "number" ? `calc(min(${/*min_width*/ a[10]}px, 100%))` : null); }, i(a) { - i || (Xl(r, a), i = !0); + i || (Yl(r, a), i = !0); }, o(a) { - Yl(r, a), i = !1; + Nl(r, a), i = !1; }, d(a) { a && tl(e), o && o.d(), r && r.d(a); } }; } -function Cs(l) { +function Bs(l) { let e, t, n; return { c() { - e = $l("img"), te(e, "class", "button-icon svelte-8huxfn"), Fl(e.src, t = /*icon*/ - l[7].url) || te(e, "src", t), te(e, "alt", n = `${/*value*/ + e = ei("img"), ne(e, "class", "button-icon svelte-8huxfn"), Xl(e.src, t = /*icon*/ + l[7].url) || ne(e, "src", t), ne(e, "alt", n = `${/*value*/ l[5]} icon`); }, m(i, o) { @@ -6257,22 +6257,22 @@ function Cs(l) { }, p(i, o) { o & /*icon*/ - 128 && !Fl(e.src, t = /*icon*/ - i[7].url) && te(e, "src", t), o & /*value*/ + 128 && !Xl(e.src, t = /*icon*/ + i[7].url) && ne(e, "src", t), o & /*value*/ 32 && n !== (n = `${/*value*/ - i[5]} icon`) && te(e, "alt", n); + i[5]} icon`) && ne(e, "alt", n); }, d(i) { i && tl(e); } }; } -function Ss(l) { +function qs(l) { let e, t, n; return { c() { - e = $l("img"), te(e, "class", "button-icon svelte-8huxfn"), Fl(e.src, t = /*icon*/ - l[7].url) || te(e, "src", t), te(e, "alt", n = `${/*value*/ + e = ei("img"), ne(e, "class", "button-icon svelte-8huxfn"), Xl(e.src, t = /*icon*/ + l[7].url) || ne(e, "src", t), ne(e, "alt", n = `${/*value*/ l[5]} icon`); }, m(i, o) { @@ -6280,19 +6280,19 @@ function Ss(l) { }, p(i, o) { o & /*icon*/ - 128 && !Fl(e.src, t = /*icon*/ - i[7].url) && te(e, "src", t), o & /*value*/ + 128 && !Xl(e.src, t = /*icon*/ + i[7].url) && ne(e, "src", t), o & /*value*/ 32 && n !== (n = `${/*value*/ - i[5]} icon`) && te(e, "alt", n); + i[5]} icon`) && ne(e, "alt", n); }, d(i) { i && tl(e); } }; } -function T0(l) { +function H0(l) { let e, t, n, i; - const o = [R0, D0], s = []; + const o = [j0, I0], s = []; function r(a, f) { return ( /*link*/ @@ -6302,35 +6302,35 @@ function T0(l) { } return e = r(l), t = s[e] = o[e](l), { c() { - t.c(), n = B0(); + t.c(), n = A0(); }, m(a, f) { s[e].m(a, f), nl(a, n, f), i = !0; }, p(a, [f]) { let u = e; - e = r(a), e === u ? s[e].p(a, f) : (E0(), Yl(s[u], 1, 1, () => { + e = r(a), e === u ? s[e].p(a, f) : (L0(), Nl(s[u], 1, 1, () => { s[u] = null; - }), q0(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Xl(t, 1), t.m(n.parentNode, n)); + }), M0(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Yl(t, 1), t.m(n.parentNode, n)); }, i(a) { - i || (Xl(t), i = !0); + i || (Yl(t), i = !0); }, o(a) { - Yl(t), i = !1; + Nl(t), i = !1; }, d(a) { a && tl(n), s[e].d(a); } }; } -function I0(l, e, t) { - let { $$slots: n = {}, $$scope: i } = e, { elem_id: o = "" } = e, { elem_classes: s = [] } = e, { visible: r = !0 } = e, { variant: a = "secondary" } = e, { size: f = "lg" } = e, { value: u = null } = e, { link: c = null } = e, { icon: _ = null } = e, { disabled: d = !1 } = e, { scale: m = null } = e, { min_width: h = void 0 } = e; - function p(w) { - z0.call(this, l, w); +function F0(l, e, t) { + let { $$slots: n = {}, $$scope: i } = e, { elem_id: o = "" } = e, { elem_classes: s = [] } = e, { visible: r = !0 } = e, { variant: a = "secondary" } = e, { size: f = "lg" } = e, { value: u = null } = e, { link: c = null } = e, { icon: _ = null } = e, { disabled: d = !1 } = e, { scale: h = null } = e, { min_width: m = void 0 } = e; + function w(b) { + E0.call(this, l, b); } - return l.$$set = (w) => { - "elem_id" in w && t(0, o = w.elem_id), "elem_classes" in w && t(1, s = w.elem_classes), "visible" in w && t(2, r = w.visible), "variant" in w && t(3, a = w.variant), "size" in w && t(4, f = w.size), "value" in w && t(5, u = w.value), "link" in w && t(6, c = w.link), "icon" in w && t(7, _ = w.icon), "disabled" in w && t(8, d = w.disabled), "scale" in w && t(9, m = w.scale), "min_width" in w && t(10, h = w.min_width), "$$scope" in w && t(11, i = w.$$scope); + return l.$$set = (b) => { + "elem_id" in b && t(0, o = b.elem_id), "elem_classes" in b && t(1, s = b.elem_classes), "visible" in b && t(2, r = b.visible), "variant" in b && t(3, a = b.variant), "size" in b && t(4, f = b.size), "value" in b && t(5, u = b.value), "link" in b && t(6, c = b.link), "icon" in b && t(7, _ = b.icon), "disabled" in b && t(8, d = b.disabled), "scale" in b && t(9, h = b.scale), "min_width" in b && t(10, m = b.min_width), "$$scope" in b && t(11, i = b.$$scope); }, [ o, s, @@ -6341,16 +6341,16 @@ function I0(l, e, t) { c, _, d, - m, h, + m, i, n, - p + w ]; } -class Gi extends S0 { +class xi extends q0 { constructor(e) { - super(), M0(this, e, I0, T0, L0, { + super(), D0(this, e, F0, H0, T0, { elem_id: 0, elem_classes: 1, visible: 2, @@ -6366,50 +6366,50 @@ class Gi extends S0 { } } const { - SvelteComponent: j0, - add_render_callback: ir, + SvelteComponent: X0, + add_render_callback: ar, append: bl, - attr: Ie, - binding_callbacks: zs, - check_outros: H0, - create_bidirectional_transition: qs, - destroy_each: F0, + attr: Re, + binding_callbacks: Es, + check_outros: Y0, + create_bidirectional_transition: Ms, + destroy_each: N0, detach: Wn, - element: Nl, - empty: X0, - ensure_array_like: Bs, - group_outros: Y0, - init: N0, + element: Ul, + empty: U0, + ensure_array_like: As, + group_outros: O0, + init: W0, insert: Vn, - listen: Ji, - prevent_default: U0, - run_all: O0, - safe_not_equal: W0, - set_data: V0, + listen: $i, + prevent_default: V0, + run_all: P0, + safe_not_equal: Z0, + set_data: K0, set_style: rn, - space: Qi, - text: P0, - toggle_class: $e, - transition_in: Li, - transition_out: Es -} = window.__gradio__svelte__internal, { createEventDispatcher: Z0 } = window.__gradio__svelte__internal; -function Ms(l, e, t) { + space: eo, + text: G0, + toggle_class: et, + transition_in: Ti, + transition_out: Ls +} = window.__gradio__svelte__internal, { createEventDispatcher: J0 } = window.__gradio__svelte__internal; +function Ds(l, e, t) { const n = l.slice(); return n[26] = e[t], n; } -function As(l) { - let e, t, n, i, o, s = Bs( +function Rs(l) { + let e, t, n, i, o, s = As( /*filtered_indices*/ l[1] ), r = []; for (let a = 0; a < s.length; a += 1) - r[a] = Ls(Ms(l, s, a)); + r[a] = Ts(Ds(l, s, a)); return { c() { - e = Nl("ul"); + e = Ul("ul"); for (let a = 0; a < r.length; a += 1) r[a].c(); - Ie(e, "class", "options svelte-yuohum"), Ie(e, "role", "listbox"), rn( + Re(e, "class", "options svelte-yuohum"), Re(e, "role", "listbox"), rn( e, "bottom", /*bottom*/ @@ -6426,7 +6426,7 @@ function As(l) { Vn(a, e, f); for (let u = 0; u < r.length; u += 1) r[u] && r[u].m(e, null); - l[22](e), n = !0, i || (o = Ji(e, "mousedown", U0( + l[22](e), n = !0, i || (o = $i(e, "mousedown", V0( /*mousedown_handler*/ l[21] )), i = !0); @@ -6434,14 +6434,14 @@ function As(l) { p(a, f) { if (f & /*filtered_indices, choices, selected_indices, active_index*/ 51) { - s = Bs( + s = As( /*filtered_indices*/ a[1] ); let u; for (u = 0; u < s.length; u += 1) { - const c = Ms(a, s, u); - r[u] ? r[u].p(c, f) : (r[u] = Ls(c), r[u].c(), r[u].m(e, null)); + const c = Ds(a, s, u); + r[u] ? r[u].p(c, f) : (r[u] = Ts(c), r[u].c(), r[u].m(e, null)); } for (; u < r.length; u += 1) r[u].d(1); @@ -6464,19 +6464,19 @@ function As(l) { ); }, i(a) { - n || (a && ir(() => { - n && (t || (t = qs(e, Ho, { duration: 200, y: 5 }, !0)), t.run(1)); + n || (a && ar(() => { + n && (t || (t = Ms(e, Yo, { duration: 200, y: 5 }, !0)), t.run(1)); }), n = !0); }, o(a) { - a && (t || (t = qs(e, Ho, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1; + a && (t || (t = Ms(e, Yo, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1; }, d(a) { - a && Wn(e), F0(r, a), l[22](null), a && t && t.end(), i = !1, o(); + a && Wn(e), N0(r, a), l[22](null), a && t && t.end(), i = !1, o(); } }; } -function Ls(l) { +function Ts(l) { let e, t, n, i = ( /*choices*/ l[0][ @@ -6486,20 +6486,20 @@ function Ls(l) { ), o, s, r, a, f; return { c() { - e = Nl("li"), t = Nl("span"), t.textContent = "✓", n = Qi(), o = P0(i), s = Qi(), Ie(t, "class", "inner-item svelte-yuohum"), $e(t, "hide", !/*selected_indices*/ + e = Ul("li"), t = Ul("span"), t.textContent = "✓", n = eo(), o = G0(i), s = eo(), Re(t, "class", "inner-item svelte-yuohum"), et(t, "hide", !/*selected_indices*/ l[4].includes( /*index*/ l[26] - )), Ie(e, "class", "item svelte-yuohum"), Ie(e, "data-index", r = /*index*/ - l[26]), Ie(e, "aria-label", a = /*choices*/ + )), Re(e, "class", "item svelte-yuohum"), Re(e, "data-index", r = /*index*/ + l[26]), Re(e, "aria-label", a = /*choices*/ l[0][ /*index*/ l[26] - ][0]), Ie(e, "data-testid", "dropdown-option"), Ie(e, "role", "option"), Ie(e, "aria-selected", f = /*selected_indices*/ + ][0]), Re(e, "data-testid", "dropdown-option"), Re(e, "role", "option"), Re(e, "aria-selected", f = /*selected_indices*/ l[4].includes( /*index*/ l[26] - )), $e( + )), et( e, "selected", /*selected_indices*/ @@ -6507,19 +6507,19 @@ function Ls(l) { /*index*/ l[26] ) - ), $e( + ), et( e, "active", /*index*/ l[26] === /*active_index*/ l[5] - ), $e( + ), et( e, "bg-gray-100", /*index*/ l[26] === /*active_index*/ l[5] - ), $e( + ), et( e, "dark:bg-gray-600", /*index*/ @@ -6532,7 +6532,7 @@ function Ls(l) { }, p(u, c) { c & /*selected_indices, filtered_indices*/ - 18 && $e(t, "hide", !/*selected_indices*/ + 18 && et(t, "hide", !/*selected_indices*/ u[4].includes( /*index*/ u[26] @@ -6541,20 +6541,20 @@ function Ls(l) { u[0][ /*index*/ u[26] - ][0] + "") && V0(o, i), c & /*filtered_indices*/ + ][0] + "") && K0(o, i), c & /*filtered_indices*/ 2 && r !== (r = /*index*/ - u[26]) && Ie(e, "data-index", r), c & /*choices, filtered_indices*/ + u[26]) && Re(e, "data-index", r), c & /*choices, filtered_indices*/ 3 && a !== (a = /*choices*/ u[0][ /*index*/ u[26] - ][0]) && Ie(e, "aria-label", a), c & /*selected_indices, filtered_indices*/ + ][0]) && Re(e, "aria-label", a), c & /*selected_indices, filtered_indices*/ 18 && f !== (f = /*selected_indices*/ u[4].includes( /*index*/ u[26] - )) && Ie(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/ - 18 && $e( + )) && Re(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/ + 18 && et( e, "selected", /*selected_indices*/ @@ -6563,21 +6563,21 @@ function Ls(l) { u[26] ) ), c & /*filtered_indices, active_index*/ - 34 && $e( + 34 && et( e, "active", /*index*/ u[26] === /*active_index*/ u[5] ), c & /*filtered_indices, active_index*/ - 34 && $e( + 34 && et( e, "bg-gray-100", /*index*/ u[26] === /*active_index*/ u[5] ), c & /*filtered_indices, active_index*/ - 34 && $e( + 34 && et( e, "dark:bg-gray-600", /*index*/ @@ -6590,30 +6590,30 @@ function Ls(l) { } }; } -function K0(l) { +function Q0(l) { let e, t, n, i, o; - ir( + ar( /*onwindowresize*/ l[19] ); let s = ( /*show_options*/ l[2] && !/*disabled*/ - l[3] && As(l) + l[3] && Rs(l) ); return { c() { - e = Nl("div"), t = Qi(), s && s.c(), n = X0(), Ie(e, "class", "reference"); + e = Ul("div"), t = eo(), s && s.c(), n = U0(), Re(e, "class", "reference"); }, m(r, a) { Vn(r, e, a), l[20](e), Vn(r, t, a), s && s.m(r, a), Vn(r, n, a), i || (o = [ - Ji( + $i( window, "scroll", /*scroll_listener*/ l[12] ), - Ji( + $i( window, "resize", /*onwindowresize*/ @@ -6625,71 +6625,71 @@ function K0(l) { /*show_options*/ r[2] && !/*disabled*/ r[3] ? s ? (s.p(r, a), a & /*show_options, disabled*/ - 12 && Li(s, 1)) : (s = As(r), s.c(), Li(s, 1), s.m(n.parentNode, n)) : s && (Y0(), Es(s, 1, 1, () => { + 12 && Ti(s, 1)) : (s = Rs(r), s.c(), Ti(s, 1), s.m(n.parentNode, n)) : s && (O0(), Ls(s, 1, 1, () => { s = null; - }), H0()); + }), Y0()); }, i(r) { - Li(s); + Ti(s); }, o(r) { - Es(s); + Ls(s); }, d(r) { - r && (Wn(e), Wn(t), Wn(n)), l[20](null), s && s.d(r), i = !1, O0(o); + r && (Wn(e), Wn(t), Wn(n)), l[20](null), s && s.d(r), i = !1, P0(o); } }; } -function G0(l, e, t) { +function x0(l, e, t) { var n, i; - let { choices: o } = e, { filtered_indices: s } = e, { show_options: r = !1 } = e, { disabled: a = !1 } = e, { selected_indices: f = [] } = e, { active_index: u = null } = e, c, _, d, m, h, p, w, b, g; - function k() { - const { top: D, bottom: N } = h.getBoundingClientRect(); - t(16, c = D), t(17, _ = g - N); - } - let C = null; + let { choices: o } = e, { filtered_indices: s } = e, { show_options: r = !1 } = e, { disabled: a = !1 } = e, { selected_indices: f = [] } = e, { active_index: u = null } = e, c, _, d, h, m, w, b, p, g; function v() { - r && (C !== null && clearTimeout(C), C = setTimeout( + const { top: R, bottom: U } = m.getBoundingClientRect(); + t(16, c = R), t(17, _ = g - U); + } + let E = null; + function y() { + r && (E !== null && clearTimeout(E), E = setTimeout( () => { - k(), C = null; + v(), E = null; }, 10 )); } - const z = Z0(); - function y() { + const C = J0(); + function k() { t(11, g = window.innerHeight); } - function A(D) { - zs[D ? "unshift" : "push"](() => { - h = D, t(6, h); + function A(R) { + Es[R ? "unshift" : "push"](() => { + m = R, t(6, m); }); } - const S = (D) => z("change", D); - function R(D) { - zs[D ? "unshift" : "push"](() => { - p = D, t(7, p); + const S = (R) => C("change", R); + function T(R) { + Es[R ? "unshift" : "push"](() => { + w = R, t(7, w); }); } - return l.$$set = (D) => { - "choices" in D && t(0, o = D.choices), "filtered_indices" in D && t(1, s = D.filtered_indices), "show_options" in D && t(2, r = D.show_options), "disabled" in D && t(3, a = D.disabled), "selected_indices" in D && t(4, f = D.selected_indices), "active_index" in D && t(5, u = D.active_index); + return l.$$set = (R) => { + "choices" in R && t(0, o = R.choices), "filtered_indices" in R && t(1, s = R.filtered_indices), "show_options" in R && t(2, r = R.show_options), "disabled" in R && t(3, a = R.disabled), "selected_indices" in R && t(4, f = R.selected_indices), "active_index" in R && t(5, u = R.active_index); }, l.$$.update = () => { if (l.$$.dirty & /*show_options, refElement, listElement, selected_indices, _a, _b, distance_from_bottom, distance_from_top, input_height*/ 508116) { - if (r && h) { - if (p && f.length > 0) { - let N = p.querySelectorAll("li"); - for (const J of Array.from(N)) - if (J.getAttribute("data-index") === f[0].toString()) { - t(14, n = p == null ? void 0 : p.scrollTo) === null || n === void 0 || n.call(p, 0, J.offsetTop); + if (r && m) { + if (w && f.length > 0) { + let U = w.querySelectorAll("li"); + for (const Z of Array.from(U)) + if (Z.getAttribute("data-index") === f[0].toString()) { + t(14, n = w == null ? void 0 : w.scrollTo) === null || n === void 0 || n.call(w, 0, Z.offsetTop); break; } } - k(); - const D = t(15, i = h.parentElement) === null || i === void 0 ? void 0 : i.getBoundingClientRect(); - t(18, d = (D == null ? void 0 : D.height) || 0), t(8, m = (D == null ? void 0 : D.width) || 0); + v(); + const R = t(15, i = m.parentElement) === null || i === void 0 ? void 0 : i.getBoundingClientRect(); + t(18, d = (R == null ? void 0 : R.height) || 0), t(8, h = (R == null ? void 0 : R.width) || 0); } - _ > c ? (t(10, b = _), t(9, w = null)) : (t(9, w = `${_ + d}px`), t(10, b = c - d)); + _ > c ? (t(10, p = _), t(9, b = null)) : (t(9, b = `${_ + d}px`), t(10, p = c - d)); } }, [ o, @@ -6698,28 +6698,28 @@ function G0(l, e, t) { a, f, u, - h, - p, m, w, + h, b, + p, g, - v, - z, - n, + y, + C, + n, i, c, _, d, - y, + k, A, S, - R + T ]; } -class J0 extends j0 { +class $0 extends X0 { constructor(e) { - super(), N0(this, e, G0, K0, W0, { + super(), W0(this, e, x0, Q0, Z0, { choices: 0, filtered_indices: 1, show_options: 2, @@ -6729,16 +6729,16 @@ class J0 extends j0 { }); } } -function Q0(l, e) { +function eh(l, e) { return (l % e + e) % e; } -function Ds(l, e) { +function Is(l, e) { return l.reduce((t, n, i) => ((!e || n[0].toLowerCase().includes(e.toLowerCase())) && t.push(i), t), []); } -function x0(l, e, t) { +function th(l, e, t) { l("change", e), t || l("input"); } -function $0(l, e, t) { +function nh(l, e, t) { if (l.key === "Escape") return [!1, e]; if ((l.key === "ArrowDown" || l.key === "ArrowUp") && t.length >= 0) @@ -6746,68 +6746,68 @@ function $0(l, e, t) { e = l.key === "ArrowDown" ? t[0] : t[t.length - 1]; else { const n = t.indexOf(e), i = l.key === "ArrowUp" ? -1 : 1; - e = t[Q0(n + i, t.length)]; + e = t[eh(n + i, t.length)]; } return [!0, e]; } const { - SvelteComponent: eh, + SvelteComponent: lh, append: It, - attr: Te, - binding_callbacks: th, - check_outros: nh, - create_component: xi, - destroy_component: $i, - detach: fo, + attr: De, + binding_callbacks: ih, + check_outros: oh, + create_component: to, + destroy_component: no, + detach: _o, element: cn, - group_outros: lh, - init: ih, - insert: uo, + group_outros: sh, + init: ah, + insert: ho, listen: En, - mount_component: eo, - run_all: oh, - safe_not_equal: sh, - set_data: ah, - set_input_value: Rs, - space: Di, - text: rh, + mount_component: lo, + run_all: rh, + safe_not_equal: fh, + set_data: uh, + set_input_value: js, + space: Ii, + text: ch, toggle_class: fn, transition_in: _n, transition_out: In -} = window.__gradio__svelte__internal, { onMount: fh } = window.__gradio__svelte__internal, { createEventDispatcher: uh, afterUpdate: ch } = window.__gradio__svelte__internal; -function _h(l) { +} = window.__gradio__svelte__internal, { onMount: _h } = window.__gradio__svelte__internal, { createEventDispatcher: dh, afterUpdate: hh } = window.__gradio__svelte__internal; +function mh(l) { let e; return { c() { - e = rh( + e = ch( /*label*/ l[0] ); }, m(t, n) { - uo(t, e, n); + ho(t, e, n); }, p(t, n) { n[0] & /*label*/ - 1 && ah( + 1 && uh( e, /*label*/ t[0] ); }, d(t) { - t && fo(e); + t && _o(e); } }; } -function Ts(l) { +function Hs(l) { let e, t, n; - return t = new to({}), { + return t = new io({}), { c() { - e = cn("div"), xi(t.$$.fragment), Te(e, "class", "icon-wrap svelte-1m1zvyj"); + e = cn("div"), to(t.$$.fragment), De(e, "class", "icon-wrap svelte-1m1zvyj"); }, m(i, o) { - uo(i, e, o), eo(t, e, null), n = !0; + ho(i, e, o), lo(t, e, null), n = !0; }, i(i) { n || (_n(t.$$.fragment, i), n = !0); @@ -6816,13 +6816,13 @@ function Ts(l) { In(t.$$.fragment, i), n = !1; }, d(i) { - i && fo(e), $i(t); + i && _o(e), no(t); } }; } -function dh(l) { - let e, t, n, i, o, s, r, a, f, u, c, _, d, m; - t = new ia({ +function gh(l) { + let e, t, n, i, o, s, r, a, f, u, c, _, d, h; + t = new aa({ props: { show_label: ( /*show_label*/ @@ -6832,13 +6832,13 @@ function dh(l) { /*info*/ l[1] ), - $$slots: { default: [_h] }, + $$slots: { default: [mh] }, $$scope: { ctx: l } } }); - let h = !/*disabled*/ - l[3] && Ts(); - return c = new J0({ + let m = !/*disabled*/ + l[3] && Hs(); + return c = new $0({ props: { show_options: ( /*show_options*/ @@ -6874,41 +6874,41 @@ function dh(l) { l[16] ), { c() { - e = cn("div"), xi(t.$$.fragment), n = Di(), i = cn("div"), o = cn("div"), s = cn("div"), r = cn("input"), f = Di(), h && h.c(), u = Di(), xi(c.$$.fragment), Te(r, "role", "listbox"), Te(r, "aria-controls", "dropdown-options"), Te( + e = cn("div"), to(t.$$.fragment), n = Ii(), i = cn("div"), o = cn("div"), s = cn("div"), r = cn("input"), f = Ii(), m && m.c(), u = Ii(), to(c.$$.fragment), De(r, "role", "listbox"), De(r, "aria-controls", "dropdown-options"), De( r, "aria-expanded", /*show_options*/ l[12] - ), Te( + ), De( r, "aria-label", /*label*/ l[0] - ), Te(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/ - l[3], Te(r, "autocomplete", "off"), r.readOnly = a = !/*filterable*/ + ), De(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/ + l[3], De(r, "autocomplete", "off"), r.readOnly = a = !/*filterable*/ l[7], fn(r, "subdued", !/*choices_names*/ l[13].includes( /*input_text*/ l[9] ) && !/*allow_custom_value*/ - l[6]), Te(s, "class", "secondary-wrap svelte-1m1zvyj"), Te(o, "class", "wrap-inner svelte-1m1zvyj"), fn( + l[6]), De(s, "class", "secondary-wrap svelte-1m1zvyj"), De(o, "class", "wrap-inner svelte-1m1zvyj"), fn( o, "show_options", /*show_options*/ l[12] - ), Te(i, "class", "wrap svelte-1m1zvyj"), Te(e, "class", "svelte-1m1zvyj"), fn( + ), De(i, "class", "wrap svelte-1m1zvyj"), De(e, "class", "svelte-1m1zvyj"), fn( e, "container", /*container*/ l[5] ); }, - m(p, w) { - uo(p, e, w), eo(t, e, null), It(e, n), It(e, i), It(i, o), It(o, s), It(s, r), Rs( + m(w, b) { + ho(w, e, b), lo(t, e, null), It(e, n), It(e, i), It(i, o), It(o, s), It(s, r), js( r, /*input_text*/ l[9] - ), l[29](r), It(s, f), h && h.m(s, null), It(i, u), eo(c, i, null), _ = !0, d || (m = [ + ), l[29](r), It(s, f), m && m.m(s, null), It(i, u), lo(c, i, null), _ = !0, d || (h = [ En( r, "input", @@ -6941,141 +6941,141 @@ function dh(l) { ) ], d = !0); }, - p(p, w) { - const b = {}; - w[0] & /*show_label*/ - 16 && (b.show_label = /*show_label*/ - p[4]), w[0] & /*info*/ - 2 && (b.info = /*info*/ - p[1]), w[0] & /*label*/ - 1 | w[1] & /*$$scope*/ - 4 && (b.$$scope = { dirty: w, ctx: p }), t.$set(b), (!_ || w[0] & /*show_options*/ - 4096) && Te( + p(w, b) { + const p = {}; + b[0] & /*show_label*/ + 16 && (p.show_label = /*show_label*/ + w[4]), b[0] & /*info*/ + 2 && (p.info = /*info*/ + w[1]), b[0] & /*label*/ + 1 | b[1] & /*$$scope*/ + 4 && (p.$$scope = { dirty: b, ctx: w }), t.$set(p), (!_ || b[0] & /*show_options*/ + 4096) && De( r, "aria-expanded", /*show_options*/ - p[12] - ), (!_ || w[0] & /*label*/ - 1) && Te( + w[12] + ), (!_ || b[0] & /*label*/ + 1) && De( r, "aria-label", /*label*/ - p[0] - ), (!_ || w[0] & /*disabled*/ + w[0] + ), (!_ || b[0] & /*disabled*/ 8) && (r.disabled = /*disabled*/ - p[3]), (!_ || w[0] & /*filterable*/ + w[3]), (!_ || b[0] & /*filterable*/ 128 && a !== (a = !/*filterable*/ - p[7])) && (r.readOnly = a), w[0] & /*input_text*/ + w[7])) && (r.readOnly = a), b[0] & /*input_text*/ 512 && r.value !== /*input_text*/ - p[9] && Rs( + w[9] && js( r, /*input_text*/ - p[9] - ), (!_ || w[0] & /*choices_names, input_text, allow_custom_value*/ + w[9] + ), (!_ || b[0] & /*choices_names, input_text, allow_custom_value*/ 8768) && fn(r, "subdued", !/*choices_names*/ - p[13].includes( + w[13].includes( /*input_text*/ - p[9] + w[9] ) && !/*allow_custom_value*/ - p[6]), /*disabled*/ - p[3] ? h && (lh(), In(h, 1, 1, () => { - h = null; - }), nh()) : h ? w[0] & /*disabled*/ - 8 && _n(h, 1) : (h = Ts(), h.c(), _n(h, 1), h.m(s, null)), (!_ || w[0] & /*show_options*/ + w[6]), /*disabled*/ + w[3] ? m && (sh(), In(m, 1, 1, () => { + m = null; + }), oh()) : m ? b[0] & /*disabled*/ + 8 && _n(m, 1) : (m = Hs(), m.c(), _n(m, 1), m.m(s, null)), (!_ || b[0] & /*show_options*/ 4096) && fn( o, "show_options", /*show_options*/ - p[12] + w[12] ); const g = {}; - w[0] & /*show_options*/ + b[0] & /*show_options*/ 4096 && (g.show_options = /*show_options*/ - p[12]), w[0] & /*choices*/ + w[12]), b[0] & /*choices*/ 4 && (g.choices = /*choices*/ - p[2]), w[0] & /*filtered_indices*/ + w[2]), b[0] & /*filtered_indices*/ 1024 && (g.filtered_indices = /*filtered_indices*/ - p[10]), w[0] & /*disabled*/ + w[10]), b[0] & /*disabled*/ 8 && (g.disabled = /*disabled*/ - p[3]), w[0] & /*selected_index*/ + w[3]), b[0] & /*selected_index*/ 2048 && (g.selected_indices = /*selected_index*/ - p[11] === null ? [] : [ + w[11] === null ? [] : [ /*selected_index*/ - p[11] - ]), w[0] & /*active_index*/ + w[11] + ]), b[0] & /*active_index*/ 16384 && (g.active_index = /*active_index*/ - p[14]), c.$set(g), (!_ || w[0] & /*container*/ + w[14]), c.$set(g), (!_ || b[0] & /*container*/ 32) && fn( e, "container", /*container*/ - p[5] + w[5] ); }, - i(p) { - _ || (_n(t.$$.fragment, p), _n(h), _n(c.$$.fragment, p), _ = !0); + i(w) { + _ || (_n(t.$$.fragment, w), _n(m), _n(c.$$.fragment, w), _ = !0); }, - o(p) { - In(t.$$.fragment, p), In(h), In(c.$$.fragment, p), _ = !1; + o(w) { + In(t.$$.fragment, w), In(m), In(c.$$.fragment, w), _ = !1; }, - d(p) { - p && fo(e), $i(t), l[29](null), h && h.d(), $i(c), d = !1, oh(m); + d(w) { + w && _o(e), no(t), l[29](null), m && m.d(), no(c), d = !1, rh(h); } }; } -function hh(l, e, t) { - let { label: n } = e, { info: i = void 0 } = e, { value: o = [] } = e, s = [], { value_is_output: r = !1 } = e, { choices: a } = e, f, { disabled: u = !1 } = e, { show_label: c } = e, { container: _ = !0 } = e, { allow_custom_value: d = !1 } = e, { filterable: m = !0 } = e, h, p = !1, w, b, g = "", k = "", C = !1, v = [], z = null, y = null, A; - const S = uh(); - o ? (A = a.map((L) => L[1]).indexOf(o), y = A, y === -1 ? (s = o, y = null) : ([g, s] = a[y], k = g), D()) : a.length > 0 && (A = 0, y = 0, [g, o] = a[y], s = o, k = g); - function R() { - t(13, w = a.map((L) => L[0])), t(24, b = a.map((L) => L[1])); +function bh(l, e, t) { + let { label: n } = e, { info: i = void 0 } = e, { value: o = [] } = e, s = [], { value_is_output: r = !1 } = e, { choices: a } = e, f, { disabled: u = !1 } = e, { show_label: c } = e, { container: _ = !0 } = e, { allow_custom_value: d = !1 } = e, { filterable: h = !0 } = e, m, w = !1, b, p, g = "", v = "", E = !1, y = [], C = null, k = null, A; + const S = dh(); + o ? (A = a.map((D) => D[1]).indexOf(o), k = A, k === -1 ? (s = o, k = null) : ([g, s] = a[k], v = g), R()) : a.length > 0 && (A = 0, k = 0, [g, o] = a[k], s = o, v = g); + function T() { + t(13, b = a.map((D) => D[0])), t(24, p = a.map((D) => D[1])); } - function D() { - R(), o === void 0 || Array.isArray(o) && o.length === 0 ? (t(9, g = ""), t(11, y = null)) : b.includes(o) ? (t(9, g = w[b.indexOf(o)]), t(11, y = b.indexOf(o))) : d ? (t(9, g = o), t(11, y = null)) : (t(9, g = ""), t(11, y = null)), t(27, A = y); + function R() { + T(), o === void 0 || Array.isArray(o) && o.length === 0 ? (t(9, g = ""), t(11, k = null)) : p.includes(o) ? (t(9, g = b[p.indexOf(o)]), t(11, k = p.indexOf(o))) : d ? (t(9, g = o), t(11, k = null)) : (t(9, g = ""), t(11, k = null)), t(27, A = k); } - function N(L) { - if (t(11, y = parseInt(L.detail.target.dataset.index)), isNaN(y)) { - t(11, y = null); + function U(D) { + if (t(11, k = parseInt(D.detail.target.dataset.index)), isNaN(k)) { + t(11, k = null); return; } - t(12, p = !1), t(14, z = null), h.blur(); + t(12, w = !1), t(14, C = null), m.blur(); } - function J(L) { - t(10, v = a.map((P, he) => he)), t(12, p = !0), S("focus"); + function Z(D) { + t(10, y = a.map((W, $) => $)), t(12, w = !0), S("focus"); } function Q() { - d ? t(20, o = g) : t(9, g = w[b.indexOf(o)]), t(12, p = !1), t(14, z = null), S("blur"); + d ? t(20, o = g) : t(9, g = b[p.indexOf(o)]), t(12, w = !1), t(14, C = null), S("blur"); } - function V(L) { - t(12, [p, z] = $0(L, z, v), p, (t(14, z), t(2, a), t(23, f), t(6, d), t(9, g), t(10, v), t(8, h), t(25, k), t(11, y), t(27, A), t(26, C), t(24, b))), L.key === "Enter" && (z !== null ? (t(11, y = z), t(12, p = !1), h.blur(), t(14, z = null)) : w.includes(g) ? (t(11, y = w.indexOf(g)), t(12, p = !1), t(14, z = null), h.blur()) : d && (t(20, o = g), t(11, y = null), t(12, p = !1), t(14, z = null), h.blur()), S("enter", o)); + function J(D) { + t(12, [w, C] = nh(D, C, y), w, (t(14, C), t(2, a), t(23, f), t(6, d), t(9, g), t(10, y), t(8, m), t(25, v), t(11, k), t(27, A), t(26, E), t(24, p))), D.key === "Enter" && (C !== null ? (t(11, k = C), t(12, w = !1), m.blur(), t(14, C = null)) : b.includes(g) ? (t(11, k = b.indexOf(g)), t(12, w = !1), t(14, C = null), m.blur()) : d && (t(20, o = g), t(11, k = null), t(12, w = !1), t(14, C = null), m.blur()), S("enter", o)); } - ch(() => { - t(21, r = !1), t(26, C = !0); - }), fh(() => { - h.focus(); + hh(() => { + t(21, r = !1), t(26, E = !0); + }), _h(() => { + m.focus(); }); - function U() { - g = this.value, t(9, g), t(11, y), t(27, A), t(26, C), t(2, a), t(24, b); + function K() { + g = this.value, t(9, g), t(11, k), t(27, A), t(26, E), t(2, a), t(24, p); } - function T(L) { - th[L ? "unshift" : "push"](() => { - h = L, t(8, h); + function L(D) { + ih[D ? "unshift" : "push"](() => { + m = D, t(8, m); }); } - const O = (L) => S("key_up", { key: L.key, input_value: g }); - return l.$$set = (L) => { - "label" in L && t(0, n = L.label), "info" in L && t(1, i = L.info), "value" in L && t(20, o = L.value), "value_is_output" in L && t(21, r = L.value_is_output), "choices" in L && t(2, a = L.choices), "disabled" in L && t(3, u = L.disabled), "show_label" in L && t(4, c = L.show_label), "container" in L && t(5, _ = L.container), "allow_custom_value" in L && t(6, d = L.allow_custom_value), "filterable" in L && t(7, m = L.filterable); + const F = (D) => S("key_up", { key: D.key, input_value: g }); + return l.$$set = (D) => { + "label" in D && t(0, n = D.label), "info" in D && t(1, i = D.info), "value" in D && t(20, o = D.value), "value_is_output" in D && t(21, r = D.value_is_output), "choices" in D && t(2, a = D.choices), "disabled" in D && t(3, u = D.disabled), "show_label" in D && t(4, c = D.show_label), "container" in D && t(5, _ = D.container), "allow_custom_value" in D && t(6, d = D.allow_custom_value), "filterable" in D && t(7, h = D.filterable); }, l.$$.update = () => { l.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/ - 218105860 && y !== A && y !== null && C && (t(9, [g, o] = a[y], g, (t(20, o), t(11, y), t(27, A), t(26, C), t(2, a), t(24, b))), t(27, A = y), S("select", { - index: y, - value: b[y], + 218105860 && k !== A && k !== null && E && (t(9, [g, o] = a[k], g, (t(20, o), t(11, k), t(27, A), t(26, E), t(2, a), t(24, p))), t(27, A = k), S("select", { + index: k, + value: p[k], selected: !0 })), l.$$.dirty[0] & /*value, old_value, value_is_output*/ - 7340032 && o != s && (D(), x0(S, o, r), t(22, s = o)), l.$$.dirty[0] & /*choices*/ - 4 && R(), l.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ - 8390468 && a !== f && (d || D(), t(23, f = a), t(10, v = Ds(a, g)), !d && v.length > 0 && t(14, z = v[0]), h == document.activeElement && t(12, p = !0)), l.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ - 33556036 && g !== k && (t(10, v = Ds(a, g)), t(25, k = g), !d && v.length > 0 && t(14, z = v[0])); + 7340032 && o != s && (R(), th(S, o, r), t(22, s = o)), l.$$.dirty[0] & /*choices*/ + 4 && T(), l.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ + 8390468 && a !== f && (d || R(), t(23, f = a), t(10, y = Is(a, g)), !d && y.length > 0 && t(14, C = y[0]), m == document.activeElement && t(12, w = !0)), l.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ + 33556036 && g !== v && (t(10, y = Is(a, g)), t(25, v = g), !d && y.length > 0 && t(14, C = y[0])); }, [ n, i, @@ -7084,40 +7084,40 @@ function hh(l, e, t) { c, _, d, - m, h, + m, g, - v, y, - p, + k, w, - z, + b, + C, S, - N, - J, + U, + Z, Q, - V, + J, o, r, s, f, - b, - k, - C, + p, + v, + E, A, - U, - T, - O + K, + L, + F ]; } -class mh extends eh { +class wh extends lh { constructor(e) { - super(), ih( + super(), ah( this, e, - hh, - dh, - sh, + bh, + gh, + fh, { label: 0, info: 1, @@ -7136,30 +7136,30 @@ class mh extends eh { } } const { - SvelteComponent: gh, - append: et, + SvelteComponent: ph, + append: tt, attr: wl, - check_outros: bh, + check_outros: vh, create_component: jn, destroy_component: Hn, detach: ll, - element: zt, - group_outros: wh, - init: ph, + element: Bt, + group_outros: kh, + init: yh, insert: il, mount_component: Fn, - safe_not_equal: vh, + safe_not_equal: Ch, set_style: Xn, space: pl, - text: co, + text: mo, transition_in: qt, transition_out: Ft -} = window.__gradio__svelte__internal, { createEventDispatcher: kh } = window.__gradio__svelte__internal, { onMount: yh, onDestroy: Ch } = window.__gradio__svelte__internal; -function Sh(l) { +} = window.__gradio__svelte__internal, { createEventDispatcher: Sh } = window.__gradio__svelte__internal, { onMount: zh, onDestroy: Bh } = window.__gradio__svelte__internal; +function qh(l) { let e; return { c() { - e = co("Cancel"); + e = mo("Cancel"); }, m(t, n) { il(t, e, n); @@ -7169,12 +7169,12 @@ function Sh(l) { } }; } -function Is(l) { +function Fs(l) { let e, t, n; - return t = new Gi({ + return t = new xi({ props: { variant: "stop", - $$slots: { default: [zh] }, + $$slots: { default: [Eh] }, $$scope: { ctx: l } } }), t.$on( @@ -7183,7 +7183,7 @@ function Is(l) { l[12] ), { c() { - e = zt("div"), jn(t.$$.fragment), Xn(e, "margin-right", "8px"); + e = Bt("div"), jn(t.$$.fragment), Xn(e, "margin-right", "8px"); }, m(i, o) { il(i, e, o), Fn(t, e, null), n = !0; @@ -7204,11 +7204,11 @@ function Is(l) { } }; } -function zh(l) { +function Eh(l) { let e; return { c() { - e = co("Remove"); + e = mo("Remove"); }, m(t, n) { il(t, e, n); @@ -7218,11 +7218,11 @@ function zh(l) { } }; } -function qh(l) { +function Mh(l) { let e; return { c() { - e = co("OK"); + e = mo("OK"); }, m(t, n) { il(t, e, n); @@ -7232,9 +7232,9 @@ function qh(l) { } }; } -function Bh(l) { - let e, t, n, i, o, s, r, a, f, u, c, _, d, m, h, p; - o = new mh({ +function Ah(l) { + let e, t, n, i, o, s, r, a, f, u, c, _, d, h, m, w; + o = new wh({ props: { value: ( /*currentLabel*/ @@ -7256,7 +7256,7 @@ function Bh(l) { "enter", /*onDropDownEnter*/ l[7] - ), a = new C0({ + ), a = new B0({ props: { value: ( /*currentColor*/ @@ -7269,9 +7269,9 @@ function Bh(l) { "change", /*onColorChange*/ l[6] - ), c = new Gi({ + ), c = new xi({ props: { - $$slots: { default: [Sh] }, + $$slots: { default: [qh] }, $$scope: { ctx: l } } }), c.$on( @@ -7279,63 +7279,63 @@ function Bh(l) { /*click_handler*/ l[11] ); - let w = ( + let b = ( /*showRemove*/ - l[3] && Is(l) + l[3] && Fs(l) ); - return h = new Gi({ + return m = new xi({ props: { variant: "primary", - $$slots: { default: [qh] }, + $$slots: { default: [Mh] }, $$scope: { ctx: l } } - }), h.$on( + }), m.$on( "click", /*click_handler_2*/ l[13] ), { c() { - e = zt("div"), t = zt("div"), n = zt("span"), i = zt("div"), jn(o.$$.fragment), s = pl(), r = zt("div"), jn(a.$$.fragment), f = pl(), u = zt("div"), jn(c.$$.fragment), _ = pl(), w && w.c(), d = pl(), m = zt("div"), jn(h.$$.fragment), Xn(i, "margin-right", "10px"), Xn(r, "margin-right", "40px"), Xn(r, "margin-bottom", "8px"), Xn(u, "margin-right", "8px"), wl(n, "class", "model-content svelte-hkn2q1"), wl(t, "class", "modal-container svelte-hkn2q1"), wl(e, "class", "modal svelte-hkn2q1"), wl(e, "id", "model-box-edit"); + e = Bt("div"), t = Bt("div"), n = Bt("span"), i = Bt("div"), jn(o.$$.fragment), s = pl(), r = Bt("div"), jn(a.$$.fragment), f = pl(), u = Bt("div"), jn(c.$$.fragment), _ = pl(), b && b.c(), d = pl(), h = Bt("div"), jn(m.$$.fragment), Xn(i, "margin-right", "10px"), Xn(r, "margin-right", "40px"), Xn(r, "margin-bottom", "8px"), Xn(u, "margin-right", "8px"), wl(n, "class", "model-content svelte-hkn2q1"), wl(t, "class", "modal-container svelte-hkn2q1"), wl(e, "class", "modal svelte-hkn2q1"), wl(e, "id", "model-box-edit"); }, - m(b, g) { - il(b, e, g), et(e, t), et(t, n), et(n, i), Fn(o, i, null), et(n, s), et(n, r), Fn(a, r, null), et(n, f), et(n, u), Fn(c, u, null), et(n, _), w && w.m(n, null), et(n, d), et(n, m), Fn(h, m, null), p = !0; + m(p, g) { + il(p, e, g), tt(e, t), tt(t, n), tt(n, i), Fn(o, i, null), tt(n, s), tt(n, r), Fn(a, r, null), tt(n, f), tt(n, u), Fn(c, u, null), tt(n, _), b && b.m(n, null), tt(n, d), tt(n, h), Fn(m, h, null), w = !0; }, - p(b, [g]) { - const k = {}; + p(p, [g]) { + const v = {}; g & /*currentLabel*/ - 1 && (k.value = /*currentLabel*/ - b[0]), g & /*choices*/ - 4 && (k.choices = /*choices*/ - b[2]), o.$set(k); - const C = {}; + 1 && (v.value = /*currentLabel*/ + p[0]), g & /*choices*/ + 4 && (v.choices = /*choices*/ + p[2]), o.$set(v); + const E = {}; g & /*currentColor*/ - 2 && (C.value = /*currentColor*/ - b[1]), a.$set(C); - const v = {}; + 2 && (E.value = /*currentColor*/ + p[1]), a.$set(E); + const y = {}; g & /*$$scope*/ - 65536 && (v.$$scope = { dirty: g, ctx: b }), c.$set(v), /*showRemove*/ - b[3] ? w ? (w.p(b, g), g & /*showRemove*/ - 8 && qt(w, 1)) : (w = Is(b), w.c(), qt(w, 1), w.m(n, d)) : w && (wh(), Ft(w, 1, 1, () => { - w = null; - }), bh()); - const z = {}; + 65536 && (y.$$scope = { dirty: g, ctx: p }), c.$set(y), /*showRemove*/ + p[3] ? b ? (b.p(p, g), g & /*showRemove*/ + 8 && qt(b, 1)) : (b = Fs(p), b.c(), qt(b, 1), b.m(n, d)) : b && (kh(), Ft(b, 1, 1, () => { + b = null; + }), vh()); + const C = {}; g & /*$$scope*/ - 65536 && (z.$$scope = { dirty: g, ctx: b }), h.$set(z); + 65536 && (C.$$scope = { dirty: g, ctx: p }), m.$set(C); }, - i(b) { - p || (qt(o.$$.fragment, b), qt(a.$$.fragment, b), qt(c.$$.fragment, b), qt(w), qt(h.$$.fragment, b), p = !0); + i(p) { + w || (qt(o.$$.fragment, p), qt(a.$$.fragment, p), qt(c.$$.fragment, p), qt(b), qt(m.$$.fragment, p), w = !0); }, - o(b) { - Ft(o.$$.fragment, b), Ft(a.$$.fragment, b), Ft(c.$$.fragment, b), Ft(w), Ft(h.$$.fragment, b), p = !1; + o(p) { + Ft(o.$$.fragment, p), Ft(a.$$.fragment, p), Ft(c.$$.fragment, p), Ft(b), Ft(m.$$.fragment, p), w = !1; }, - d(b) { - b && ll(e), Hn(o), Hn(a), Hn(c), w && w.d(), Hn(h); + d(p) { + p && ll(e), Hn(o), Hn(a), Hn(c), b && b.d(), Hn(m); } }; } -function Eh(l, e, t) { +function Lh(l, e, t) { let { label: n = "" } = e, { currentLabel: i = "" } = e, { choices: o = [] } = e, { choicesColors: s = [] } = e, { color: r = "" } = e, { currentColor: a = "" } = e, { showRemove: f = !0 } = e; - const u = kh(); + const u = Sh(); function c(g) { u("change", { label: i, @@ -7345,30 +7345,30 @@ function Eh(l, e, t) { }); } function _(g) { - const { detail: k } = g; - let C = k; - Number.isInteger(C) ? (Array.isArray(s) && C < s.length && t(1, a = s[C]), Array.isArray(o) && C < o.length && t(0, i = o[C][0])) : t(0, i = C); + const { detail: v } = g; + let E = v; + Number.isInteger(E) ? (Array.isArray(s) && E < s.length && t(1, a = s[E]), Array.isArray(o) && E < o.length && t(0, i = o[E][0])) : t(0, i = E); } function d(g) { - const { detail: k } = g; - t(1, a = k); + const { detail: v } = g; + t(1, a = v); } - function m(g) { + function h(g) { _(g), c(1); } - function h(g) { + function m(g) { switch (g.key) { case "Enter": c(1); break; } } - yh(() => { - document.addEventListener("keydown", h), t(0, i = n), t(1, a = r); - }), Ch(() => { - document.removeEventListener("keydown", h); + zh(() => { + document.addEventListener("keydown", m), t(0, i = n), t(1, a = r); + }), Bh(() => { + document.removeEventListener("keydown", m); }); - const p = () => c(0), w = () => c(-1), b = () => c(1); + const w = () => c(0), b = () => c(-1), p = () => c(1); return l.$$set = (g) => { "label" in g && t(8, n = g.label), "currentLabel" in g && t(0, i = g.currentLabel), "choices" in g && t(2, o = g.choices), "choicesColors" in g && t(9, s = g.choicesColors), "color" in g && t(10, r = g.color), "currentColor" in g && t(1, a = g.currentColor), "showRemove" in g && t(3, f = g.showRemove); }, [ @@ -7379,18 +7379,18 @@ function Eh(l, e, t) { c, _, d, - m, + h, n, s, r, - p, w, - b + b, + p ]; } -class or extends gh { +class rr extends ph { constructor(e) { - super(), ph(this, e, Eh, Bh, vh, { + super(), yh(this, e, Lh, Ah, Ch, { label: 8, currentLabel: 0, choices: 2, @@ -7401,8 +7401,8 @@ class or extends gh { }); } } -const ce = (l, e, t) => Math.min(Math.max(l, e), t); -function Ri(l, e) { +const _e = (l, e, t) => Math.min(Math.max(l, e), t); +function ji(l, e) { if (l.startsWith("rgba")) return l.replace(/[\d.]+$/, e.toString()); const t = l.match(/\d+/g); @@ -7411,61 +7411,61 @@ function Ri(l, e) { const [n, i, o] = t; return `rgba(${n}, ${i}, ${o}, ${e})`; } -class Ti { - constructor(e, t, n, i, o, s, r, a, f, u, c, _ = "rgb(255, 255, 255)", d = 0.5, m = 25, h = 8, p = 2, w = 4, b = 1) { +class Hi { + constructor(e, t, n, i, o, s, r, a, f, u, c, _ = "rgb(255, 255, 255)", d = 0.5, h = 25, m = 8, w = 2, b = 4, p = 1) { this.stopDrag = () => { this.isDragging = !1, document.removeEventListener("pointermove", this.handleDrag), document.removeEventListener("pointerup", this.stopDrag); }, this.handleDrag = (g) => { if (this.isDragging) { - let k = g.clientX - this.offsetMouseX - this.xmin, C = g.clientY - this.offsetMouseY - this.ymin; - const v = this.canvasXmax - this.canvasXmin, z = this.canvasYmax - this.canvasYmin; - k = ce(k, -this.xmin, v - this.xmax), C = ce(C, -this.ymin, z - this.ymax), this.xmin += k, this.ymin += C, this.xmax += k, this.ymax += C, this.updateHandles(), this.renderCallBack(); + let v = g.clientX - this.offsetMouseX - this.xmin, E = g.clientY - this.offsetMouseY - this.ymin; + const y = this.canvasXmax - this.canvasXmin, C = this.canvasYmax - this.canvasYmin; + v = _e(v, -this.xmin, y - this.xmax), E = _e(E, -this.ymin, C - this.ymax), this.xmin += v, this.ymin += E, this.xmax += v, this.ymax += E, this.updateHandles(), this.renderCallBack(); } }, this.handleCreating = (g) => { if (this.isCreating) { - let [k, C] = this.toBoxCoordinates(g.clientX, g.clientY); - k -= this.offsetMouseX, C -= this.offsetMouseY, k > this.xmax ? (this.creatingAnchorX == "xmax" && (this.xmin = this.xmax), this.xmax = k, this.creatingAnchorX = "xmin") : k > this.xmin && k < this.xmax && this.creatingAnchorX == "xmin" ? this.xmax = k : k > this.xmin && k < this.xmax && this.creatingAnchorX == "xmax" ? this.xmin = k : k < this.xmin && (this.creatingAnchorX == "xmin" && (this.xmax = this.xmin), this.xmin = k, this.creatingAnchorX = "xmax"), C > this.ymax ? (this.creatingAnchorY == "ymax" && (this.ymin = this.ymax), this.ymax = C, this.creatingAnchorY = "ymin") : C > this.ymin && C < this.ymax && this.creatingAnchorY == "ymin" ? this.ymax = C : C > this.ymin && C < this.ymax && this.creatingAnchorY == "ymax" ? this.ymin = C : C < this.ymin && (this.creatingAnchorY == "ymin" && (this.ymax = this.ymin), this.ymin = C, this.creatingAnchorY = "ymax"), this.updateHandles(), this.renderCallBack(); + let [v, E] = this.toBoxCoordinates(g.clientX, g.clientY); + v -= this.offsetMouseX, E -= this.offsetMouseY, v > this.xmax ? (this.creatingAnchorX == "xmax" && (this.xmin = this.xmax), this.xmax = v, this.creatingAnchorX = "xmin") : v > this.xmin && v < this.xmax && this.creatingAnchorX == "xmin" ? this.xmax = v : v > this.xmin && v < this.xmax && this.creatingAnchorX == "xmax" ? this.xmin = v : v < this.xmin && (this.creatingAnchorX == "xmin" && (this.xmax = this.xmin), this.xmin = v, this.creatingAnchorX = "xmax"), E > this.ymax ? (this.creatingAnchorY == "ymax" && (this.ymin = this.ymax), this.ymax = E, this.creatingAnchorY = "ymin") : E > this.ymin && E < this.ymax && this.creatingAnchorY == "ymin" ? this.ymax = E : E > this.ymin && E < this.ymax && this.creatingAnchorY == "ymax" ? this.ymin = E : E < this.ymin && (this.creatingAnchorY == "ymin" && (this.ymax = this.ymin), this.ymin = E, this.creatingAnchorY = "ymax"), this.updateHandles(), this.renderCallBack(); } }, this.stopCreating = (g) => { if (this.isCreating = !1, document.removeEventListener("pointermove", this.handleCreating), document.removeEventListener("pointerup", this.stopCreating), this.getArea() > 0) { - const k = this.canvasXmax - this.canvasXmin, C = this.canvasYmax - this.canvasYmin; - this.xmin = ce(this.xmin, 0, k - this.minSize), this.ymin = ce(this.ymin, 0, C - this.minSize), this.xmax = ce(this.xmax, this.minSize, k), this.ymax = ce(this.ymax, this.minSize, C), this.minSize > 0 && (this.getWidth() < this.minSize && (this.creatingAnchorX == "xmin" ? this.xmax = this.xmin + this.minSize : this.xmin = this.xmax - this.minSize), this.getHeight() < this.minSize && (this.creatingAnchorY == "ymin" ? this.ymax = this.ymin + this.minSize : this.ymin = this.ymax - this.minSize), this.xmax > k ? (this.xmin -= this.xmax - k, this.xmax = k) : this.xmin < 0 && (this.xmax -= this.xmin, this.xmin = 0), this.ymax > C ? (this.ymin -= this.ymax - C, this.ymax = C) : this.ymin < 0 && (this.ymax -= this.ymin, this.ymin = 0)), this.updateHandles(), this.renderCallBack(); + const v = this.canvasXmax - this.canvasXmin, E = this.canvasYmax - this.canvasYmin; + this.xmin = _e(this.xmin, 0, v - this.minSize), this.ymin = _e(this.ymin, 0, E - this.minSize), this.xmax = _e(this.xmax, this.minSize, v), this.ymax = _e(this.ymax, this.minSize, E), this.minSize > 0 && (this.getWidth() < this.minSize && (this.creatingAnchorX == "xmin" ? this.xmax = this.xmin + this.minSize : this.xmin = this.xmax - this.minSize), this.getHeight() < this.minSize && (this.creatingAnchorY == "ymin" ? this.ymax = this.ymin + this.minSize : this.ymin = this.ymax - this.minSize), this.xmax > v ? (this.xmin -= this.xmax - v, this.xmax = v) : this.xmin < 0 && (this.xmax -= this.xmin, this.xmin = 0), this.ymax > E ? (this.ymin -= this.ymax - E, this.ymax = E) : this.ymin < 0 && (this.ymax -= this.ymin, this.ymin = 0)), this.updateHandles(), this.renderCallBack(); } this.onFinishCreation(); }, this.handleResize = (g) => { if (this.isResizing) { - const k = g.clientX, C = g.clientY, v = k - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, z = C - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, y = this.canvasXmax - this.canvasXmin, A = this.canvasYmax - this.canvasYmin; + const v = g.clientX, E = g.clientY, y = v - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, C = E - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, k = this.canvasXmax - this.canvasXmin, A = this.canvasYmax - this.canvasYmin; switch (this.resizingHandleIndex) { case 0: - this.xmin += v, this.ymin += z, this.xmin = ce(this.xmin, 0, this.xmax - this.minSize), this.ymin = ce(this.ymin, 0, this.ymax - this.minSize); + this.xmin += y, this.ymin += C, this.xmin = _e(this.xmin, 0, this.xmax - this.minSize), this.ymin = _e(this.ymin, 0, this.ymax - this.minSize); break; case 1: - this.xmax += v, this.ymin += z, this.xmax = ce(this.xmax, this.xmin + this.minSize, y), this.ymin = ce(this.ymin, 0, this.ymax - this.minSize); + this.xmax += y, this.ymin += C, this.xmax = _e(this.xmax, this.xmin + this.minSize, k), this.ymin = _e(this.ymin, 0, this.ymax - this.minSize); break; case 2: - this.xmax += v, this.ymax += z, this.xmax = ce(this.xmax, this.xmin + this.minSize, y), this.ymax = ce(this.ymax, this.ymin + this.minSize, A); + this.xmax += y, this.ymax += C, this.xmax = _e(this.xmax, this.xmin + this.minSize, k), this.ymax = _e(this.ymax, this.ymin + this.minSize, A); break; case 3: - this.xmin += v, this.ymax += z, this.xmin = ce(this.xmin, 0, this.xmax - this.minSize), this.ymax = ce(this.ymax, this.ymin + this.minSize, A); + this.xmin += y, this.ymax += C, this.xmin = _e(this.xmin, 0, this.xmax - this.minSize), this.ymax = _e(this.ymax, this.ymin + this.minSize, A); break; case 4: - this.ymin += z, this.ymin = ce(this.ymin, 0, this.ymax - this.minSize); + this.ymin += C, this.ymin = _e(this.ymin, 0, this.ymax - this.minSize); break; case 5: - this.xmax += v, this.xmax = ce(this.xmax, this.xmin + this.minSize, y); + this.xmax += y, this.xmax = _e(this.xmax, this.xmin + this.minSize, k); break; case 6: - this.ymax += z, this.ymax = ce(this.ymax, this.ymin + this.minSize, A); + this.ymax += C, this.ymax = _e(this.ymax, this.ymin + this.minSize, A); break; case 7: - this.xmin += v, this.xmin = ce(this.xmin, 0, this.xmax - this.minSize); + this.xmin += y, this.xmin = _e(this.xmin, 0, this.xmax - this.minSize); break; } this.updateHandles(), this.renderCallBack(); } }, this.stopResize = () => { this.isResizing = !1, document.removeEventListener("pointermove", this.handleResize), document.removeEventListener("pointerup", this.stopResize); - }, this.renderCallBack = e, this.onFinishCreation = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = o, this.canvasYmax = s, this.scaleFactor = b, this.label = r, this.isDragging = !1, this.isCreating = !1, this.xmin = a, this.ymin = f, this.xmax = u, this.ymax = c, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = h, this.thickness = p, this.selectedThickness = w, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = m, this.color = _, this.alpha = d, this.creatingAnchorX = "xmin", this.creatingAnchorY = "ymin"; + }, this.renderCallBack = e, this.onFinishCreation = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = o, this.canvasYmax = s, this.scaleFactor = p, this.label = r, this.isDragging = !1, this.isCreating = !1, this.xmin = a, this.ymin = f, this.xmax = u, this.ymax = c, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = m, this.thickness = w, this.selectedThickness = b, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = h, this.color = _, this.alpha = d, this.creatingAnchorX = "xmin", this.creatingAnchorY = "ymin"; } toJSON() { return { @@ -7571,13 +7571,13 @@ class Ti { } render(e) { let t, n; - if (e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = Ri(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = Ri(this.color, 1), e.stroke(), e.closePath(), this.label !== null && this.label.trim() !== "") { + if (e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = ji(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = ji(this.color, 1), e.stroke(), e.closePath(), this.label !== null && this.label.trim() !== "") { this.isSelected ? e.font = "bold 14px Arial" : e.font = "12px Arial"; const i = e.measureText(this.label).width + 10, o = 20; let s = this.xmin, r = this.ymin - o; e.fillStyle = "white", [s, r] = this.toCanvasCoordinates(s, r), e.fillRect(s, r, i, o), e.lineWidth = 1, e.strokeStyle = "black", e.strokeRect(s, r, i, o), e.fillStyle = "black", e.fillText(this.label, s + 5, r + 15); } - e.fillStyle = Ri(this.color, 1); + e.fillStyle = ji(this.color, 1); for (const i of this.resizeHandles) [t, n] = this.toCanvasCoordinates(i.xmin, i.ymin), e.fillRect( t, @@ -7623,53 +7623,54 @@ const jt = [ "rgb(255, 193, 7)", "rgb(255, 250, 138)" ], { - SvelteComponent: Mh, + SvelteComponent: Dh, append: Yn, - attr: tt, - binding_callbacks: Ah, - bubble: js, - check_outros: El, + attr: nt, + binding_callbacks: Rh, + bubble: Xs, + check_outros: Ml, create_component: Gn, destroy_component: Jn, detach: Ot, element: bn, - empty: Lh, - group_outros: Ml, - init: Dh, + empty: Th, + group_outros: Al, + init: Ih, insert: Wt, - is_function: Rh, + is_function: jh, listen: ut, mount_component: Qn, - noop: Th, - run_all: sr, - safe_not_equal: Ih, + noop: Hh, + run_all: fr, + safe_not_equal: Fh, + set_style: vl, space: Pn, - toggle_class: vl, + toggle_class: kl, transition_in: me, - transition_out: je -} = window.__gradio__svelte__internal, { onMount: jh, onDestroy: Hh, createEventDispatcher: Fh } = window.__gradio__svelte__internal; -function Hs(l) { + transition_out: Te +} = window.__gradio__svelte__internal, { onMount: Xh, onDestroy: Yh, createEventDispatcher: Nh } = window.__gradio__svelte__internal; +function Ys(l) { let e, t, n, i, o, s, r, a, f, u; - n = new O1({}), s = new Q1({}); + n = new P1({}), s = new e0({}); let c = ( /*showRemoveButton*/ - l[1] && Fs(l) + l[1] && Ns(l) ); return { c() { - e = bn("span"), t = bn("button"), Gn(n.$$.fragment), i = Pn(), o = bn("button"), Gn(s.$$.fragment), r = Pn(), c && c.c(), tt(t, "class", "icon svelte-3rql59"), tt(t, "aria-label", "Create box"), vl( + e = bn("span"), t = bn("button"), Gn(n.$$.fragment), i = Pn(), o = bn("button"), Gn(s.$$.fragment), r = Pn(), c && c.c(), nt(t, "class", "icon svelte-1m8vz1h"), nt(t, "aria-label", "Create box"), kl( t, "selected", /*mode*/ - l[9] === /*Mode*/ - l[6].creation - ), tt(o, "class", "icon svelte-3rql59"), tt(o, "aria-label", "Edit boxes"), vl( + l[11] === /*Mode*/ + l[8].creation + ), nt(o, "class", "icon svelte-1m8vz1h"), nt(o, "aria-label", "Edit boxes"), kl( o, "selected", /*mode*/ - l[9] === /*Mode*/ - l[6].drag - ), tt(e, "class", "canvas-control svelte-3rql59"); + l[11] === /*Mode*/ + l[8].drag + ), nt(e, "class", "canvas-control svelte-1m8vz1h"); }, m(_, d) { Wt(_, e, d), Yn(e, t), Qn(n, t, null), Yn(e, i), Yn(e, o), Qn(s, o, null), Yn(e, r), c && c.m(e, null), a = !0, f || (u = [ @@ -7677,77 +7678,77 @@ function Hs(l) { t, "click", /*click_handler*/ - l[32] + l[34] ), ut( o, "click", /*click_handler_1*/ - l[33] + l[35] ) ], f = !0); }, p(_, d) { (!a || d[0] & /*mode, Mode*/ - 576) && vl( + 2304) && kl( t, "selected", /*mode*/ - _[9] === /*Mode*/ - _[6].creation + _[11] === /*Mode*/ + _[8].creation ), (!a || d[0] & /*mode, Mode*/ - 576) && vl( + 2304) && kl( o, "selected", /*mode*/ - _[9] === /*Mode*/ - _[6].drag + _[11] === /*Mode*/ + _[8].drag ), /*showRemoveButton*/ _[1] ? c ? (c.p(_, d), d[0] & /*showRemoveButton*/ - 2 && me(c, 1)) : (c = Fs(_), c.c(), me(c, 1), c.m(e, null)) : c && (Ml(), je(c, 1, 1, () => { + 2 && me(c, 1)) : (c = Ns(_), c.c(), me(c, 1), c.m(e, null)) : c && (Al(), Te(c, 1, 1, () => { c = null; - }), El()); + }), Ml()); }, i(_) { a || (me(n.$$.fragment, _), me(s.$$.fragment, _), me(c), a = !0); }, o(_) { - je(n.$$.fragment, _), je(s.$$.fragment, _), je(c), a = !1; + Te(n.$$.fragment, _), Te(s.$$.fragment, _), Te(c), a = !1; }, d(_) { - _ && Ot(e), Jn(n), Jn(s), c && c.d(), f = !1, sr(u); + _ && Ot(e), Jn(n), Jn(s), c && c.d(), f = !1, fr(u); } }; } -function Fs(l) { +function Ns(l) { let e, t, n, i, o; - return t = new o0({}), { + return t = new r0({}), { c() { - e = bn("button"), Gn(t.$$.fragment), tt(e, "class", "icon svelte-3rql59"), tt(e, "aria-label", "Remove boxes"); + e = bn("button"), Gn(t.$$.fragment), nt(e, "class", "icon svelte-1m8vz1h"), nt(e, "aria-label", "Remove boxes"); }, m(s, r) { Wt(s, e, r), Qn(t, e, null), n = !0, i || (o = ut( e, "click", /*click_handler_2*/ - l[34] + l[36] ), i = !0); }, - p: Th, + p: Hh, i(s) { n || (me(t.$$.fragment, s), n = !0); }, o(s) { - je(t.$$.fragment, s), n = !1; + Te(t.$$.fragment, s), n = !1; }, d(s) { s && Ot(e), Jn(t), i = !1, o(); } }; } -function Xs(l) { +function Us(l) { let e, t; - return e = new or({ + return e = new rr({ props: { choices: ( /*choices*/ @@ -7759,25 +7760,25 @@ function Xs(l) { ), label: ( /*selectedBox*/ - l[8] >= 0 && /*selectedBox*/ - l[8] < /*value*/ + l[10] >= 0 && /*selectedBox*/ + l[10] < /*value*/ l[0].boxes.length ? ( /*value*/ l[0].boxes[ /*selectedBox*/ - l[8] + l[10] ].label ) : "" ), color: ( /*selectedBox*/ - l[8] >= 0 && /*selectedBox*/ - l[8] < /*value*/ + l[10] >= 0 && /*selectedBox*/ + l[10] < /*value*/ l[0].boxes.length ? xn( /*value*/ l[0].boxes[ /*selectedBox*/ - l[8] + l[10] ].color ) : "" ) @@ -7785,11 +7786,11 @@ function Xs(l) { }), e.$on( "change", /*onModalEditChange*/ - l[18] + l[20] ), e.$on( "enter{onModalEditChange}", /*enter_onModalEditChange_handler*/ - l[35] + l[37] ), { c() { Gn(e.$$.fragment); @@ -7804,24 +7805,24 @@ function Xs(l) { n[3]), i[0] & /*choicesColors*/ 16 && (o.choicesColors = /*choicesColors*/ n[4]), i[0] & /*selectedBox, value*/ - 257 && (o.label = /*selectedBox*/ - n[8] >= 0 && /*selectedBox*/ - n[8] < /*value*/ + 1025 && (o.label = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? ( /*value*/ n[0].boxes[ /*selectedBox*/ - n[8] + n[10] ].label ) : ""), i[0] & /*selectedBox, value*/ - 257 && (o.color = /*selectedBox*/ - n[8] >= 0 && /*selectedBox*/ - n[8] < /*value*/ + 1025 && (o.color = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? xn( /*value*/ n[0].boxes[ /*selectedBox*/ - n[8] + n[10] ].color ) : ""), e.$set(o); }, @@ -7829,16 +7830,16 @@ function Xs(l) { t || (me(e.$$.fragment, n), t = !0); }, o(n) { - je(e.$$.fragment, n), t = !1; + Te(e.$$.fragment, n), t = !1; }, d(n) { Jn(e, n); } }; } -function Ys(l) { +function Os(l) { let e, t; - return e = new or({ + return e = new rr({ props: { choices: ( /*choices*/ @@ -7851,25 +7852,25 @@ function Ys(l) { ), label: ( /*selectedBox*/ - l[8] >= 0 && /*selectedBox*/ - l[8] < /*value*/ + l[10] >= 0 && /*selectedBox*/ + l[10] < /*value*/ l[0].boxes.length ? ( /*value*/ l[0].boxes[ /*selectedBox*/ - l[8] + l[10] ].label ) : "" ), color: ( /*selectedBox*/ - l[8] >= 0 && /*selectedBox*/ - l[8] < /*value*/ + l[10] >= 0 && /*selectedBox*/ + l[10] < /*value*/ l[0].boxes.length ? xn( /*value*/ l[0].boxes[ /*selectedBox*/ - l[8] + l[10] ].color ) : "" ) @@ -7877,11 +7878,11 @@ function Ys(l) { }), e.$on( "change", /*onModalNewChange*/ - l[19] + l[21] ), e.$on( "enter{onModalNewChange}", /*enter_onModalNewChange_handler*/ - l[36] + l[38] ), { c() { Gn(e.$$.fragment); @@ -7896,24 +7897,24 @@ function Ys(l) { n[3]), i[0] & /*choicesColors*/ 16 && (o.choicesColors = /*choicesColors*/ n[4]), i[0] & /*selectedBox, value*/ - 257 && (o.label = /*selectedBox*/ - n[8] >= 0 && /*selectedBox*/ - n[8] < /*value*/ + 1025 && (o.label = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? ( /*value*/ n[0].boxes[ /*selectedBox*/ - n[8] + n[10] ].label ) : ""), i[0] & /*selectedBox, value*/ - 257 && (o.color = /*selectedBox*/ - n[8] >= 0 && /*selectedBox*/ - n[8] < /*value*/ + 1025 && (o.color = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? xn( /*value*/ n[0].boxes[ /*selectedBox*/ - n[8] + n[10] ].color ) : ""), e.$set(o); }, @@ -7921,102 +7922,124 @@ function Ys(l) { t || (me(e.$$.fragment, n), t = !0); }, o(n) { - je(e.$$.fragment, n), t = !1; + Te(e.$$.fragment, n), t = !1; }, d(n) { Jn(e, n); } }; } -function Xh(l) { +function Uh(l) { let e, t, n, i, o, s, r, a, f, u = ( /*interactive*/ - l[2] && Hs(l) + l[2] && Ys(l) ), c = ( /*editModalVisible*/ - l[10] && Xs(l) + l[12] && Us(l) ), _ = ( /*newModalVisible*/ - l[11] && Ys(l) + l[13] && Os(l) ); return { c() { - e = bn("div"), t = bn("canvas"), n = Pn(), u && u.c(), i = Pn(), c && c.c(), o = Pn(), _ && _.c(), s = Lh(), tt(t, "class", "canvas-annotator svelte-3rql59"), tt(e, "class", "canvas-container svelte-3rql59"), tt(e, "tabindex", "-1"); + e = bn("div"), t = bn("canvas"), n = Pn(), u && u.c(), i = Pn(), c && c.c(), o = Pn(), _ && _.c(), s = Th(), vl( + t, + "height", + /*height*/ + l[5] + ), vl( + t, + "width", + /*width*/ + l[6] + ), nt(t, "class", "canvas-annotator svelte-1m8vz1h"), nt(e, "class", "canvas-container svelte-1m8vz1h"), nt(e, "tabindex", "-1"); }, - m(d, m) { - Wt(d, e, m), Yn(e, t), l[31](t), Wt(d, n, m), u && u.m(d, m), Wt(d, i, m), c && c.m(d, m), Wt(d, o, m), _ && _.m(d, m), Wt(d, s, m), r = !0, a || (f = [ + m(d, h) { + Wt(d, e, h), Yn(e, t), l[33](t), Wt(d, n, h), u && u.m(d, h), Wt(d, i, h), c && c.m(d, h), Wt(d, o, h), _ && _.m(d, h), Wt(d, s, h), r = !0, a || (f = [ ut( t, "pointerdown", /*handlePointerDown*/ - l[12] + l[14] ), ut( t, "pointerup", /*handlePointerUp*/ - l[13] + l[15] ), ut(t, "pointermove", function() { - Rh( + jh( /*handlesCursor*/ - l[5] ? ( + l[7] ? ( /*handlePointerMove*/ - l[14] + l[16] ) : null ) && /*handlesCursor*/ - (l[5] ? ( + (l[7] ? ( /*handlePointerMove*/ - l[14] + l[16] ) : null).apply(this, arguments); }), ut( t, "dblclick", /*handleDoubleClick*/ - l[17] + l[19] ), ut( e, "focusin", /*handleCanvasFocus*/ - l[21] + l[23] ), ut( e, "focusout", /*handleCanvasBlur*/ - l[22] + l[24] ) ], a = !0); }, - p(d, m) { - l = d, /*interactive*/ - l[2] ? u ? (u.p(l, m), m[0] & /*interactive*/ - 4 && me(u, 1)) : (u = Hs(l), u.c(), me(u, 1), u.m(i.parentNode, i)) : u && (Ml(), je(u, 1, 1, () => { + p(d, h) { + l = d, (!r || h[0] & /*height*/ + 32) && vl( + t, + "height", + /*height*/ + l[5] + ), (!r || h[0] & /*width*/ + 64) && vl( + t, + "width", + /*width*/ + l[6] + ), /*interactive*/ + l[2] ? u ? (u.p(l, h), h[0] & /*interactive*/ + 4 && me(u, 1)) : (u = Ys(l), u.c(), me(u, 1), u.m(i.parentNode, i)) : u && (Al(), Te(u, 1, 1, () => { u = null; - }), El()), /*editModalVisible*/ - l[10] ? c ? (c.p(l, m), m[0] & /*editModalVisible*/ - 1024 && me(c, 1)) : (c = Xs(l), c.c(), me(c, 1), c.m(o.parentNode, o)) : c && (Ml(), je(c, 1, 1, () => { + }), Ml()), /*editModalVisible*/ + l[12] ? c ? (c.p(l, h), h[0] & /*editModalVisible*/ + 4096 && me(c, 1)) : (c = Us(l), c.c(), me(c, 1), c.m(o.parentNode, o)) : c && (Al(), Te(c, 1, 1, () => { c = null; - }), El()), /*newModalVisible*/ - l[11] ? _ ? (_.p(l, m), m[0] & /*newModalVisible*/ - 2048 && me(_, 1)) : (_ = Ys(l), _.c(), me(_, 1), _.m(s.parentNode, s)) : _ && (Ml(), je(_, 1, 1, () => { + }), Ml()), /*newModalVisible*/ + l[13] ? _ ? (_.p(l, h), h[0] & /*newModalVisible*/ + 8192 && me(_, 1)) : (_ = Os(l), _.c(), me(_, 1), _.m(s.parentNode, s)) : _ && (Al(), Te(_, 1, 1, () => { _ = null; - }), El()); + }), Ml()); }, i(d) { r || (me(u), me(c), me(_), r = !0); }, o(d) { - je(u), je(c), je(_), r = !1; + Te(u), Te(c), Te(_), r = !1; }, d(d) { - d && (Ot(e), Ot(n), Ot(i), Ot(o), Ot(s)), l[31](null), u && u.d(d), c && c.d(d), _ && _.d(d), a = !1, sr(f); + d && (Ot(e), Ot(n), Ot(i), Ot(o), Ot(s)), l[33](null), u && u.d(d), c && c.d(d), _ && _.d(d), a = !1, fr(f); } }; } -function Ii(l) { +function Fi(l) { var e = parseInt(l.slice(1, 3), 16), t = parseInt(l.slice(3, 5), 16), n = parseInt(l.slice(5, 7), 16); return "rgb(" + e + ", " + t + ", " + n + ")"; } @@ -8024,245 +8047,249 @@ function xn(l) { const e = l.match(/(\d+(\.\d+)?)/g), t = parseInt(e[0]), n = parseInt(e[1]), i = parseInt(e[2]); return "#" + (1 << 24 | t << 16 | n << 8 | i).toString(16).slice(1); } -function Yh(l, e, t) { +function Oh(l, e, t) { var n; - (function(E) { - E[E.creation = 0] = "creation", E[E.drag = 1] = "drag"; + (function(B) { + B[B.creation = 0] = "creation", B[B.drag = 1] = "drag"; })(n || (n = {})); - let { imageUrl: i = null } = e, { interactive: o } = e, { boxAlpha: s = 0.5 } = e, { boxMinSize: r = 25 } = e, { handleSize: a } = e, { boxThickness: f } = e, { boxSelectedThickness: u } = e, { value: c } = e, { choices: _ = [] } = e, { choicesColors: d = [] } = e, { disableEditBoxes: m = !1 } = e, { singleBox: h = !1 } = e, { showRemoveButton: p = null } = e, { handlesCursor: w = !0 } = e; - p === null && (p = m); - let b, g, k = null, C = -1, v = n.drag; - c !== null && c.boxes.length == 0 && (v = n.creation); - let z = 0, y = 0, A = 0, S = 0, R = 1, D = 0, N = 0, J = !1, Q = !1; - const V = Fh(); - function U() { - if (g) { - g.clearRect(0, 0, b.width, b.height), k !== null && g.drawImage(k, z, y, D, N); - for (const E of c.boxes.slice().reverse()) - E.render(g); - } - } - function T(E) { - t(8, C = E), c.boxes.forEach((Y) => { - Y.setSelected(!1); - }), E >= 0 && E < c.boxes.length && c.boxes[E].setSelected(!0), U(); - } - function O(E) { - o && (E.target instanceof Element && E.target.hasPointerCapture(E.pointerId) && E.target.releasePointerCapture(E.pointerId), v === n.creation ? ge(E) : v === n.drag && L(E)); - } - function L(E) { - const Y = b.getBoundingClientRect(), $ = E.clientX - Y.left, ue = E.clientY - Y.top; - for (const [ee, le] of c.boxes.entries()) { - const Sn = le.indexOfPointInsideHandle($, ue); + let { imageUrl: i = null } = e, { interactive: o } = e, { boxAlpha: s = 0.5 } = e, { boxMinSize: r = 25 } = e, { handleSize: a } = e, { boxThickness: f } = e, { boxSelectedThickness: u } = e, { value: c } = e, { choices: _ = [] } = e, { choicesColors: d = [] } = e, { disableEditBoxes: h = !1 } = e, { height: m = "100%" } = e, { width: w = "100%" } = e, { singleBox: b = !1 } = e, { showRemoveButton: p = null } = e, { handlesCursor: g = !0 } = e; + p === null && (p = h); + let v, E, y = null, C = -1, k = n.drag; + c !== null && c.boxes.length == 0 && (k = n.creation); + let A = 0, S = 0, T = 0, R = 0, U = 1, Z = 0, Q = 0, J = !1, K = !1; + const L = Nh(); + function F() { + if (E) { + E.clearRect(0, 0, v.width, v.height), y !== null && E.drawImage(y, A, S, Z, Q); + for (const B of c.boxes.slice().reverse()) + B.render(E); + } + } + function D(B) { + t(10, C = B), c.boxes.forEach((N) => { + N.setSelected(!1); + }), B >= 0 && B < c.boxes.length && c.boxes[B].setSelected(!0), F(); + } + function W(B) { + o && (B.target instanceof Element && B.target.hasPointerCapture(B.pointerId) && B.target.releasePointerCapture(B.pointerId), k === n.creation ? Xe(B) : k === n.drag && $(B)); + } + function $(B) { + const N = v.getBoundingClientRect(), ee = B.clientX - N.left, ce = B.clientY - N.top; + for (const [te, ie] of c.boxes.entries()) { + const Sn = ie.indexOfPointInsideHandle(ee, ce); if (Sn >= 0) { - T(ee), le.startResize(Sn, E); + D(te), ie.startResize(Sn, B); return; } } - for (const [ee, le] of c.boxes.entries()) - if (le.isPointInsideBox($, ue)) { - T(ee), le.startDrag(E); + for (const [te, ie] of c.boxes.entries()) + if (ie.isPointInsideBox(ee, ce)) { + D(te), ie.startDrag(B); return; } - h || T(-1); + b || D(-1); } - function P(E) { - V("change"); + function oe(B) { + L("change"); } - function he(E) { - if (c === null || v !== n.drag) + function ge(B) { + if (c === null || k !== n.drag) return; - const Y = b.getBoundingClientRect(), $ = E.clientX - Y.left, ue = E.clientY - Y.top; - for (const [ee, le] of c.boxes.entries()) { - const Sn = le.indexOfPointInsideHandle($, ue); + const N = v.getBoundingClientRect(), ee = B.clientX - N.left, ce = B.clientY - N.top; + for (const [te, ie] of c.boxes.entries()) { + const Sn = ie.indexOfPointInsideHandle(ee, ce); if (Sn >= 0) { - t(7, b.style.cursor = le.resizeHandles[Sn].cursor, b); + t(9, v.style.cursor = ie.resizeHandles[Sn].cursor, v); return; } } - t(7, b.style.cursor = "default", b); + t(9, v.style.cursor = "default", v); } - function ie(E) { + function I(B) { if (o) - switch (E.key) { + switch (B.key) { case "Delete": - be(); + ke(); break; } } - function ge(E) { - const Y = b.getBoundingClientRect(), $ = (E.clientX - Y.left - z) / R, ue = (E.clientY - Y.top - y) / R; - let ee; - d.length > 0 ? ee = Ii(d[0]) : h ? c.boxes.length > 0 ? ee = c.boxes[0].color : ee = jt[0] : ee = jt[c.boxes.length % jt.length]; - let le = new Ti(U, M, z, y, A, S, "", $, ue, $, ue, ee, s, r, a, f, u); - le.startCreating(E, Y.left, Y.top), h ? t(0, c.boxes = [le], c) : t(0, c.boxes = [le, ...c.boxes], c), T(0), U(), V("change"); - } - function I() { - t(9, v = n.creation), t(7, b.style.cursor = "crosshair", b); - } - function Me() { - t(9, v = n.drag), t(7, b.style.cursor = "default", b); + function Xe(B) { + const N = v.getBoundingClientRect(), ee = (B.clientX - N.left - A) / U, ce = (B.clientY - N.top - S) / U; + let te; + d.length > 0 ? te = Fi(d[0]) : b ? c.boxes.length > 0 ? te = c.boxes[0].color : te = jt[0] : te = jt[c.boxes.length % jt.length]; + let ie = new Hi(F, G, A, S, T, R, "", ee, ce, ee, ce, te, s, r, a, f, u); + ie.startCreating(B, N.left, N.top), b ? t(0, c.boxes = [ie], c) : t(0, c.boxes = [ie, ...c.boxes], c), D(0), F(), L("change"); } function M() { - C >= 0 && C < c.boxes.length && (c.boxes[C].getArea() < 1 ? be() : (m || t(11, Q = !0), h && Me())); + t(11, k = n.creation), t(9, v.style.cursor = "crosshair", v); } function H() { - C >= 0 && C < c.boxes.length && !m && t(10, J = !0); + t(11, k = n.drag), t(9, v.style.cursor = "default", v); + } + function G() { + C >= 0 && C < c.boxes.length && (c.boxes[C].getArea() < 1 ? ke() : (h || t(13, K = !0), b && H())); } - function G(E) { - o && H(); + function q() { + C >= 0 && C < c.boxes.length && !h && t(12, J = !0); } - function q(E) { - t(10, J = !1); - const { detail: Y } = E; - let $ = Y.label, ue = Y.color, ee = Y.ret; + function ue(B) { + o && q(); + } + function Ye(B) { + t(12, J = !1); + const { detail: N } = B; + let ee = N.label, ce = N.color, te = N.ret; if (C >= 0 && C < c.boxes.length) { - let le = c.boxes[C]; - ee == 1 ? (le.label = $, le.color = Ii(ue), U(), V("change")) : ee == -1 && be(); + let ie = c.boxes[C]; + te == 1 ? (ie.label = ee, ie.color = Fi(ce), F(), L("change")) : te == -1 && ke(); } } - function fe(E) { - t(11, Q = !1); - const { detail: Y } = E; - let $ = Y.label, ue = Y.color, ee = Y.ret; + function Qe(B) { + t(13, K = !1); + const { detail: N } = B; + let ee = N.label, ce = N.color, te = N.ret; if (C >= 0 && C < c.boxes.length) { - let le = c.boxes[C]; - ee == 1 ? (le.label = $, le.color = Ii(ue), U(), V("change")) : be(); + let ie = c.boxes[C]; + te == 1 ? (ie.label = ee, ie.color = Fi(ce), F(), L("change")) : ke(); } } - function be() { - C >= 0 && C < c.boxes.length && (c.boxes.splice(C, 1), T(-1), h && I(), V("change")); + function ke() { + C >= 0 && C < c.boxes.length && (c.boxes.splice(C, 1), D(-1), b && M(), L("change")); } - function Ae() { - if (b) { - if (R = 1, t(7, b.width = b.clientWidth, b), k !== null) - if (k.width > b.width) - R = b.width / k.width, D = k.width * R, N = k.height * R, z = 0, y = 0, A = D, S = N, t(7, b.height = N, b); + function be() { + if (v) { + if (U = 1, t(9, v.width = v.clientWidth, v), y !== null) + if (y.width > v.width) + U = v.width / y.width, Z = y.width * U, Q = y.height * U, A = 0, S = 0, T = Z, R = Q, t(9, v.height = Q, v); else { - D = k.width, N = k.height; - var E = (b.width - D) / 2; - z = E, y = 0, A = E + D, S = k.height, t(7, b.height = N, b); + Z = y.width, Q = y.height; + var B = (v.width - Z) / 2; + A = B, S = 0, T = B + Z, R = y.height, t(9, v.height = Q, v); } else - z = 0, y = 0, A = b.width, S = b.height, t(7, b.height = b.clientHeight, b); - if (A > 0 && S > 0) - for (const Y of c.boxes) - Y.canvasXmin = z, Y.canvasYmin = y, Y.canvasXmax = A, Y.canvasYmax = S, Y.setScaleFactor(R); - U(), V("change"); - } - } - const ot = new ResizeObserver(Ae); - function Le() { - for (let E = 0; E < c.boxes.length; E++) { - let Y = c.boxes[E]; - if (!(Y instanceof Ti)) { - let $ = "", ue = ""; - Y.hasOwnProperty("color") ? ($ = Y.color, Array.isArray($) && $.length === 3 && ($ = `rgb(${$[0]}, ${$[1]}, ${$[2]})`)) : $ = jt[E % jt.length], Y.hasOwnProperty("label") && (ue = Y.label), Y = new Ti(U, M, z, y, A, S, ue, Y.xmin, Y.ymin, Y.xmax, Y.ymax, $, s, r, a, f, u), t(0, c.boxes[E] = Y, c); + A = 0, S = 0, T = v.width, R = v.height, t(9, v.height = v.clientHeight, v); + if (T > 0 && R > 0) + for (const N of c.boxes) + N.canvasXmin = A, N.canvasYmin = S, N.canvasXmax = T, N.canvasYmax = R, N.setScaleFactor(U); + F(), L("change"); + } + } + const Ne = new ResizeObserver(be); + function Ue() { + for (let B = 0; B < c.boxes.length; B++) { + let N = c.boxes[B]; + if (!(N instanceof Hi)) { + let ee = "", ce = ""; + N.hasOwnProperty("color") ? (ee = N.color, Array.isArray(ee) && ee.length === 3 && (ee = `rgb(${ee[0]}, ${ee[1]}, ${ee[2]})`)) : ee = jt[B % jt.length], N.hasOwnProperty("label") && (ce = N.label), N = new Hi(F, G, A, S, T, R, ce, N.xmin, N.ymin, N.xmax, N.ymax, ee, s, r, a, f, u), t(0, c.boxes[B] = N, c); } } } - function Fe() { - i !== null && (k === null || k.src != i) && (k = new Image(), k.src = i, k.onload = function() { - Ae(), U(); + function bt() { + i !== null && (y === null || y.src != i) && (y = new Image(), y.src = i, y.onload = function() { + be(), F(); }); } - jh(() => { + Xh(() => { if (Array.isArray(_) && _.length > 0 && (!Array.isArray(d) || d.length == 0)) - for (let E = 0; E < _.length; E++) { - let Y = jt[E % jt.length]; - d.push(xn(Y)); + for (let B = 0; B < _.length; B++) { + let N = jt[B % jt.length]; + d.push(xn(N)); } - g = b.getContext("2d"), ot.observe(b), C < 0 && c !== null && c.boxes.length > 0 && T(0), Fe(), Ae(), U(); + E = v.getContext("2d"), Ne.observe(v), C < 0 && c !== null && c.boxes.length > 0 && D(0), bt(), be(), F(); }); - function Ue() { - document.addEventListener("keydown", ie); + function ti() { + document.addEventListener("keydown", I); } - function At() { - document.removeEventListener("keydown", ie); + function ni() { + document.removeEventListener("keydown", I); } - Hh(() => { - document.removeEventListener("keydown", ie); + Yh(() => { + document.removeEventListener("keydown", I); }); - function B(E) { - Ah[E ? "unshift" : "push"](() => { - b = E, t(7, b); + function z(B) { + Rh[B ? "unshift" : "push"](() => { + v = B, t(9, v); }); } - const bt = () => I(), st = () => Me(), tn = () => be(); - function ei(E) { - js.call(this, l, E); + const wt = () => M(), st = () => H(), tn = () => ke(); + function li(B) { + Xs.call(this, l, B); } - function Lt(E) { - js.call(this, l, E); + function Lt(B) { + Xs.call(this, l, B); } - return l.$$set = (E) => { - "imageUrl" in E && t(23, i = E.imageUrl), "interactive" in E && t(2, o = E.interactive), "boxAlpha" in E && t(24, s = E.boxAlpha), "boxMinSize" in E && t(25, r = E.boxMinSize), "handleSize" in E && t(26, a = E.handleSize), "boxThickness" in E && t(27, f = E.boxThickness), "boxSelectedThickness" in E && t(28, u = E.boxSelectedThickness), "value" in E && t(0, c = E.value), "choices" in E && t(3, _ = E.choices), "choicesColors" in E && t(4, d = E.choicesColors), "disableEditBoxes" in E && t(29, m = E.disableEditBoxes), "singleBox" in E && t(30, h = E.singleBox), "showRemoveButton" in E && t(1, p = E.showRemoveButton), "handlesCursor" in E && t(5, w = E.handlesCursor); + return l.$$set = (B) => { + "imageUrl" in B && t(25, i = B.imageUrl), "interactive" in B && t(2, o = B.interactive), "boxAlpha" in B && t(26, s = B.boxAlpha), "boxMinSize" in B && t(27, r = B.boxMinSize), "handleSize" in B && t(28, a = B.handleSize), "boxThickness" in B && t(29, f = B.boxThickness), "boxSelectedThickness" in B && t(30, u = B.boxSelectedThickness), "value" in B && t(0, c = B.value), "choices" in B && t(3, _ = B.choices), "choicesColors" in B && t(4, d = B.choicesColors), "disableEditBoxes" in B && t(31, h = B.disableEditBoxes), "height" in B && t(5, m = B.height), "width" in B && t(6, w = B.width), "singleBox" in B && t(32, b = B.singleBox), "showRemoveButton" in B && t(1, p = B.showRemoveButton), "handlesCursor" in B && t(7, g = B.handlesCursor); }, l.$$.update = () => { l.$$.dirty[0] & /*value*/ - 1 && (Fe(), Le(), Ae(), U()); + 1 && (bt(), Ue(), be(), F()); }, [ c, p, o, _, d, + m, w, + g, n, - b, - C, v, + C, + k, J, - Q, - O, - P, - he, - I, - Me, - G, - q, - fe, - be, - Ue, - At, + K, + W, + oe, + ge, + M, + H, + ue, + Ye, + Qe, + ke, + ti, + ni, i, s, r, a, f, u, - m, h, - B, - bt, + b, + z, + wt, st, tn, - ei, + li, Lt ]; } -class Nh extends Mh { +class Wh extends Dh { constructor(e) { - super(), Dh( + super(), Ih( this, e, - Yh, - Xh, - Ih, + Oh, + Uh, + Fh, { - imageUrl: 23, + imageUrl: 25, interactive: 2, - boxAlpha: 24, - boxMinSize: 25, - handleSize: 26, - boxThickness: 27, - boxSelectedThickness: 28, + boxAlpha: 26, + boxMinSize: 27, + handleSize: 28, + boxThickness: 29, + boxSelectedThickness: 30, value: 0, choices: 3, choicesColors: 4, - disableEditBoxes: 29, - singleBox: 30, + disableEditBoxes: 31, + height: 5, + width: 6, + singleBox: 32, showRemoveButton: 1, - handlesCursor: 5 + handlesCursor: 7 }, null, [-1, -1] @@ -8270,22 +8297,22 @@ class Nh extends Mh { } } const { - SvelteComponent: Uh, - add_flush_callback: Oh, - bind: Wh, - binding_callbacks: Vh, - create_component: Ph, - destroy_component: Zh, - init: Kh, - mount_component: Gh, - safe_not_equal: Jh, - transition_in: Qh, - transition_out: xh -} = window.__gradio__svelte__internal, { createEventDispatcher: $h } = window.__gradio__svelte__internal; -function em(l) { + SvelteComponent: Vh, + add_flush_callback: Ph, + bind: Zh, + binding_callbacks: Kh, + create_component: Gh, + destroy_component: Jh, + init: Qh, + mount_component: xh, + safe_not_equal: $h, + transition_in: em, + transition_out: tm +} = window.__gradio__svelte__internal, { createEventDispatcher: nm } = window.__gradio__svelte__internal; +function lm(l) { let e, t, n; function i(s) { - l[17](s); + l[19](s); } let o = { interactive: ( @@ -8304,6 +8331,14 @@ function em(l) { /*labelColors*/ l[4] ), + height: ( + /*height*/ + l[8] + ), + width: ( + /*width*/ + l[9] + ), boxMinSize: ( /*boxMinSize*/ l[5] @@ -8318,42 +8353,42 @@ function em(l) { ), boxSelectedThickness: ( /*boxSelectedThickness*/ - l[8] + l[10] ), disableEditBoxes: ( /*disableEditBoxes*/ - l[9] + l[11] ), singleBox: ( /*singleBox*/ - l[10] + l[12] ), showRemoveButton: ( /*showRemoveButton*/ - l[11] + l[13] ), handlesCursor: ( /*handlesCursor*/ - l[12] + l[14] ), imageUrl: ( /*resolved_src*/ - l[13] + l[15] ) }; return ( /*value*/ l[0] !== void 0 && (o.value = /*value*/ - l[0]), e = new Nh({ props: o }), Vh.push(() => Wh(e, "value", i)), e.$on( + l[0]), e = new Wh({ props: o }), Kh.push(() => Zh(e, "value", i)), e.$on( "change", /*change_handler*/ - l[18] + l[20] ), { c() { - Ph(e.$$.fragment); + Gh(e.$$.fragment); }, m(s, r) { - Gh(e, s, r), n = !0; + xh(e, s, r), n = !0; }, p(s, [r]) { const a = {}; @@ -8365,60 +8400,64 @@ function em(l) { 8 && (a.choices = /*labelList*/ s[3]), r & /*labelColors*/ 16 && (a.choicesColors = /*labelColors*/ - s[4]), r & /*boxMinSize*/ + s[4]), r & /*height*/ + 256 && (a.height = /*height*/ + s[8]), r & /*width*/ + 512 && (a.width = /*width*/ + s[9]), r & /*boxMinSize*/ 32 && (a.boxMinSize = /*boxMinSize*/ s[5]), r & /*handleSize*/ 64 && (a.handleSize = /*handleSize*/ s[6]), r & /*boxThickness*/ 128 && (a.boxThickness = /*boxThickness*/ s[7]), r & /*boxSelectedThickness*/ - 256 && (a.boxSelectedThickness = /*boxSelectedThickness*/ - s[8]), r & /*disableEditBoxes*/ - 512 && (a.disableEditBoxes = /*disableEditBoxes*/ - s[9]), r & /*singleBox*/ - 1024 && (a.singleBox = /*singleBox*/ - s[10]), r & /*showRemoveButton*/ - 2048 && (a.showRemoveButton = /*showRemoveButton*/ - s[11]), r & /*handlesCursor*/ - 4096 && (a.handlesCursor = /*handlesCursor*/ - s[12]), r & /*resolved_src*/ - 8192 && (a.imageUrl = /*resolved_src*/ - s[13]), !t && r & /*value*/ + 1024 && (a.boxSelectedThickness = /*boxSelectedThickness*/ + s[10]), r & /*disableEditBoxes*/ + 2048 && (a.disableEditBoxes = /*disableEditBoxes*/ + s[11]), r & /*singleBox*/ + 4096 && (a.singleBox = /*singleBox*/ + s[12]), r & /*showRemoveButton*/ + 8192 && (a.showRemoveButton = /*showRemoveButton*/ + s[13]), r & /*handlesCursor*/ + 16384 && (a.handlesCursor = /*handlesCursor*/ + s[14]), r & /*resolved_src*/ + 32768 && (a.imageUrl = /*resolved_src*/ + s[15]), !t && r & /*value*/ 1 && (t = !0, a.value = /*value*/ - s[0], Oh(() => t = !1)), e.$set(a); + s[0], Ph(() => t = !1)), e.$set(a); }, i(s) { - n || (Qh(e.$$.fragment, s), n = !0); + n || (em(e.$$.fragment, s), n = !0); }, o(s) { - xh(e.$$.fragment, s), n = !1; + tm(e.$$.fragment, s), n = !1; }, d(s) { - Zh(e, s); + Jh(e, s); } } ); } -function tm(l, e, t) { - let { src: n = void 0 } = e, { interactive: i } = e, { boxesAlpha: o } = e, { labelList: s } = e, { labelColors: r } = e, { boxMinSize: a } = e, { handleSize: f } = e, { boxThickness: u } = e, { boxSelectedThickness: c } = e, { value: _ } = e, { disableEditBoxes: d } = e, { singleBox: m } = e, { showRemoveButton: h } = e, { handlesCursor: p } = e, w, b; - const g = $h(); - function k(v) { - _ = v, t(0, _); +function im(l, e, t) { + let { src: n = void 0 } = e, { interactive: i } = e, { boxesAlpha: o } = e, { labelList: s } = e, { labelColors: r } = e, { boxMinSize: a } = e, { handleSize: f } = e, { boxThickness: u } = e, { height: c } = e, { width: _ } = e, { boxSelectedThickness: d } = e, { value: h } = e, { disableEditBoxes: m } = e, { singleBox: w } = e, { showRemoveButton: b } = e, { handlesCursor: p } = e, g, v; + const E = nm(); + function y(k) { + h = k, t(0, h); } - const C = () => g("change"); - return l.$$set = (v) => { - "src" in v && t(15, n = v.src), "interactive" in v && t(1, i = v.interactive), "boxesAlpha" in v && t(2, o = v.boxesAlpha), "labelList" in v && t(3, s = v.labelList), "labelColors" in v && t(4, r = v.labelColors), "boxMinSize" in v && t(5, a = v.boxMinSize), "handleSize" in v && t(6, f = v.handleSize), "boxThickness" in v && t(7, u = v.boxThickness), "boxSelectedThickness" in v && t(8, c = v.boxSelectedThickness), "value" in v && t(0, _ = v.value), "disableEditBoxes" in v && t(9, d = v.disableEditBoxes), "singleBox" in v && t(10, m = v.singleBox), "showRemoveButton" in v && t(11, h = v.showRemoveButton), "handlesCursor" in v && t(12, p = v.handlesCursor); + const C = () => E("change"); + return l.$$set = (k) => { + "src" in k && t(17, n = k.src), "interactive" in k && t(1, i = k.interactive), "boxesAlpha" in k && t(2, o = k.boxesAlpha), "labelList" in k && t(3, s = k.labelList), "labelColors" in k && t(4, r = k.labelColors), "boxMinSize" in k && t(5, a = k.boxMinSize), "handleSize" in k && t(6, f = k.handleSize), "boxThickness" in k && t(7, u = k.boxThickness), "height" in k && t(8, c = k.height), "width" in k && t(9, _ = k.width), "boxSelectedThickness" in k && t(10, d = k.boxSelectedThickness), "value" in k && t(0, h = k.value), "disableEditBoxes" in k && t(11, m = k.disableEditBoxes), "singleBox" in k && t(12, w = k.singleBox), "showRemoveButton" in k && t(13, b = k.showRemoveButton), "handlesCursor" in k && t(14, p = k.handlesCursor); }, l.$$.update = () => { if (l.$$.dirty & /*src, latest_src*/ - 98304) { - t(13, w = n), t(16, b = n); - const v = n; - $_(v).then((z) => { - b === v && t(13, w = z); + 393216) { + t(15, g = n), t(18, v = n); + const k = n; + nd(k).then((A) => { + v === k && t(15, g = A); }); } }, [ - _, + h, i, o, s, @@ -8427,22 +8466,24 @@ function tm(l, e, t) { f, u, c, + _, d, m, - h, - p, w, + b, + p, g, + E, n, - b, - k, + v, + y, C ]; } -class nm extends Uh { +class om extends Vh { constructor(e) { - super(), Kh(this, e, tm, em, Jh, { - src: 15, + super(), Qh(this, e, im, lm, $h, { + src: 17, interactive: 1, boxesAlpha: 2, labelList: 3, @@ -8450,52 +8491,54 @@ class nm extends Uh { boxMinSize: 5, handleSize: 6, boxThickness: 7, - boxSelectedThickness: 8, + height: 8, + width: 9, + boxSelectedThickness: 10, value: 0, - disableEditBoxes: 9, - singleBox: 10, - showRemoveButton: 11, - handlesCursor: 12 + disableEditBoxes: 11, + singleBox: 12, + showRemoveButton: 13, + handlesCursor: 14 }); } } -class Ns { +class Ws { constructor() { this.boxes = []; } } const { - SvelteComponent: lm, - add_flush_callback: Ul, + SvelteComponent: sm, + add_flush_callback: Ol, append: un, attr: Nn, - bind: Ol, + bind: Wl, binding_callbacks: $n, bubble: Mn, check_outros: Xt, create_component: _t, - create_slot: im, + create_slot: am, destroy_component: dt, detach: Zt, element: Zn, - empty: om, - get_all_dirty_from_scope: sm, - get_slot_changes: am, + empty: rm, + get_all_dirty_from_scope: fm, + get_slot_changes: um, group_outros: Yt, - init: rm, + init: cm, insert: Kt, mount_component: ht, - noop: fm, - safe_not_equal: um, + noop: _m, + safe_not_equal: dm, space: Ht, - toggle_class: Us, - transition_in: K, + toggle_class: Vs, + transition_in: P, transition_out: x, - update_slot_base: cm -} = window.__gradio__svelte__internal, { createEventDispatcher: _m, tick: dm } = window.__gradio__svelte__internal; -function Os(l) { + update_slot_base: hm +} = window.__gradio__svelte__internal, { createEventDispatcher: mm, tick: gm } = window.__gradio__svelte__internal; +function Ps(l) { let e, t; - return e = new _d({ + return e = new md({ props: { href: ( /*value*/ @@ -8505,7 +8548,7 @@ function Os(l) { /*value*/ l[1].image.orig_name || "image" ), - $$slots: { default: [hm] }, + $$slots: { default: [bm] }, $$scope: { ctx: l } } }), { @@ -8523,10 +8566,10 @@ function Os(l) { 2 && (o.download = /*value*/ n[1].image.orig_name || "image"), i[0] & /*i18n*/ 256 | i[1] & /*$$scope*/ - 524288 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o); + 2097152 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o); }, i(n) { - t || (K(e.$$.fragment, n), t = !0); + t || (P(e.$$.fragment, n), t = !0); }, o(n) { x(e.$$.fragment, n), t = !1; @@ -8536,11 +8579,11 @@ function Os(l) { } }; } -function hm(l) { +function bm(l) { let e, t; - return e = new Wl({ + return e = new Vl({ props: { - Icon: Yu, + Icon: Ou, label: ( /*i18n*/ l[8]("common.download") @@ -8560,7 +8603,7 @@ function hm(l) { n[8]("common.download")), e.$set(o); }, i(n) { - t || (K(e.$$.fragment, n), t = !0); + t || (P(e.$$.fragment, n), t = !0); }, o(n) { x(e.$$.fragment, n), t = !1; @@ -8570,9 +8613,9 @@ function hm(l) { } }; } -function Ws(l) { +function Zs(l) { let e, t; - return e = new Kc({ + return e = new Qc({ props: { i18n: ( /*i18n*/ @@ -8580,7 +8623,7 @@ function Ws(l) { ), formatter: ( /*func*/ - l[35] + l[37] ), value: ( /*value*/ @@ -8590,11 +8633,11 @@ function Ws(l) { }), e.$on( "share", /*share_handler*/ - l[36] + l[38] ), e.$on( "error", /*error_handler*/ - l[37] + l[39] ), { c() { _t(e.$$.fragment); @@ -8611,7 +8654,7 @@ function Ws(l) { n[1]), e.$set(o); }, i(n) { - t || (K(e.$$.fragment, n), t = !0); + t || (P(e.$$.fragment, n), t = !0); }, o(n) { x(e.$$.fragment, n), t = !1; @@ -8621,14 +8664,14 @@ function Ws(l) { } }; } -function Vs(l) { +function Ks(l) { let e, t, n; - return t = new Wl({ - props: { Icon: aa, label: "Remove Image" } + return t = new Vl({ + props: { Icon: ua, label: "Remove Image" } }), t.$on( "click", /*clear*/ - l[33] + l[35] ), { c() { e = Zn("div"), _t(t.$$.fragment); @@ -8636,9 +8679,9 @@ function Vs(l) { m(i, o) { Kt(i, e, o), ht(t, e, null), n = !0; }, - p: fm, + p: _m, i(i) { - n || (K(t.$$.fragment, i), n = !0); + n || (P(t.$$.fragment, i), n = !0); }, o(i) { x(t.$$.fragment, i), n = !1; @@ -8648,16 +8691,16 @@ function Vs(l) { } }; } -function Ps(l) { +function Gs(l) { let e; const t = ( /*#slots*/ - l[34].default - ), n = im( + l[36].default + ), n = am( t, l, /*$$scope*/ - l[50], + l[52], null ); return { @@ -8669,27 +8712,27 @@ function Ps(l) { }, p(i, o) { n && n.p && (!e || o[1] & /*$$scope*/ - 524288) && cm( + 2097152) && hm( n, t, i, /*$$scope*/ - i[50], - e ? am( + i[52], + e ? um( t, /*$$scope*/ - i[50], + i[52], o, null - ) : sm( + ) : fm( /*$$scope*/ - i[50] + i[52] ), null ); }, i(i) { - e || (K(n, i), e = !0); + e || (P(n, i), e = !0); }, o(i) { x(n, i), e = !1; @@ -8699,14 +8742,14 @@ function Ps(l) { } }; } -function mm(l) { +function wm(l) { let e, t, n = ( /*value*/ - l[1] === null && Ps(l) + l[1] === null && Gs(l) ); return { c() { - n && n.c(), e = om(); + n && n.c(), e = rm(); }, m(i, o) { n && n.m(i, o), Kt(i, e, o), t = !0; @@ -8714,12 +8757,12 @@ function mm(l) { p(i, o) { /*value*/ i[1] === null ? n ? (n.p(i, o), o[0] & /*value*/ - 2 && K(n, 1)) : (n = Ps(i), n.c(), K(n, 1), n.m(e.parentNode, e)) : n && (Yt(), x(n, 1, 1, () => { + 2 && P(n, 1)) : (n = Gs(i), n.c(), P(n, 1), n.m(e.parentNode, e)) : n && (Yt(), x(n, 1, 1, () => { n = null; }), Xt()); }, i(i) { - t || (K(n), t = !0); + t || (P(n), t = !0); }, o(i) { x(n), t = !1; @@ -8729,9 +8772,9 @@ function mm(l) { } }; } -function Zs(l) { +function Js(l) { let e, t; - return e = new j1({ + return e = new X1({ props: { root: ( /*root*/ @@ -8745,29 +8788,29 @@ function Zs(l) { ), upload: ( /*upload*/ - l[28] + l[30] ) } }), e.$on( "capture", /*capture_handler*/ - l[42] + l[44] ), e.$on( "stream", /*stream_handler_1*/ - l[43] + l[45] ), e.$on( "error", /*error_handler_2*/ - l[44] + l[46] ), e.$on( "drag", /*drag_handler*/ - l[45] + l[47] ), e.$on( "upload", /*upload_handler*/ - l[46] + l[48] ), { c() { _t(e.$$.fragment); @@ -8782,11 +8825,11 @@ function Zs(l) { n[6]), i[0] & /*i18n*/ 256 && (o.i18n = /*i18n*/ n[8]), i[0] & /*upload*/ - 268435456 && (o.upload = /*upload*/ - n[28]), e.$set(o); + 1073741824 && (o.upload = /*upload*/ + n[30]), e.$set(o); }, i(n) { - t || (K(e.$$.fragment, n), t = !0); + t || (P(e.$$.fragment, n), t = !0); }, o(n) { x(e.$$.fragment, n), t = !1; @@ -8796,12 +8839,20 @@ function Zs(l) { } }; } -function Ks(l) { +function Qs(l) { let e, t, n, i; function o(r) { - l[47](r); + l[49](r); } let s = { + height: ( + /*height*/ + l[17] + ), + width: ( + /*width*/ + l[18] + ), boxesAlpha: ( /*boxesAlpha*/ l[12] @@ -8828,27 +8879,27 @@ function Ks(l) { ), boxThickness: ( /*boxThickness*/ - l[17] + l[19] ), singleBox: ( /*singleBox*/ - l[19] + l[21] ), disableEditBoxes: ( /*disableEditBoxes*/ - l[18] + l[20] ), showRemoveButton: ( /*showRemoveButton*/ - l[20] + l[22] ), handlesCursor: ( /*handlesCursor*/ - l[21] + l[23] ), boxSelectedThickness: ( /*boxSelectedThickness*/ - l[22] + l[24] ), src: ( /*value*/ @@ -8858,13 +8909,13 @@ function Ks(l) { return ( /*value*/ l[1] !== void 0 && (s.value = /*value*/ - l[1]), t = new nm({ props: s }), $n.push(() => Ol(t, "value", o)), t.$on( + l[1]), t = new om({ props: s }), $n.push(() => Wl(t, "value", o)), t.$on( "change", /*change_handler*/ - l[48] + l[50] ), { c() { - e = Zn("div"), _t(t.$$.fragment), Nn(e, "class", "image-frame svelte-1gjdske"), Us( + e = Zn("div"), _t(t.$$.fragment), Nn(e, "class", "image-frame svelte-1gjdske"), Vs( e, "selectable", /*selectable*/ @@ -8876,7 +8927,11 @@ function Ks(l) { }, p(r, a) { const f = {}; - a[0] & /*boxesAlpha*/ + a[0] & /*height*/ + 131072 && (f.height = /*height*/ + r[17]), a[0] & /*width*/ + 262144 && (f.width = /*width*/ + r[18]), a[0] & /*boxesAlpha*/ 4096 && (f.boxesAlpha = /*boxesAlpha*/ r[12]), a[0] & /*labelList*/ 8192 && (f.labelList = /*labelList*/ @@ -8889,23 +8944,23 @@ function Ks(l) { r[7]), a[0] & /*handleSize*/ 65536 && (f.handleSize = /*handleSize*/ r[16]), a[0] & /*boxThickness*/ - 131072 && (f.boxThickness = /*boxThickness*/ - r[17]), a[0] & /*singleBox*/ - 524288 && (f.singleBox = /*singleBox*/ - r[19]), a[0] & /*disableEditBoxes*/ - 262144 && (f.disableEditBoxes = /*disableEditBoxes*/ - r[18]), a[0] & /*showRemoveButton*/ - 1048576 && (f.showRemoveButton = /*showRemoveButton*/ - r[20]), a[0] & /*handlesCursor*/ - 2097152 && (f.handlesCursor = /*handlesCursor*/ - r[21]), a[0] & /*boxSelectedThickness*/ - 4194304 && (f.boxSelectedThickness = /*boxSelectedThickness*/ - r[22]), a[0] & /*value*/ + 524288 && (f.boxThickness = /*boxThickness*/ + r[19]), a[0] & /*singleBox*/ + 2097152 && (f.singleBox = /*singleBox*/ + r[21]), a[0] & /*disableEditBoxes*/ + 1048576 && (f.disableEditBoxes = /*disableEditBoxes*/ + r[20]), a[0] & /*showRemoveButton*/ + 4194304 && (f.showRemoveButton = /*showRemoveButton*/ + r[22]), a[0] & /*handlesCursor*/ + 8388608 && (f.handlesCursor = /*handlesCursor*/ + r[23]), a[0] & /*boxSelectedThickness*/ + 16777216 && (f.boxSelectedThickness = /*boxSelectedThickness*/ + r[24]), a[0] & /*value*/ 2 && (f.src = /*value*/ r[1].image.url), !n && a[0] & /*value*/ 2 && (n = !0, f.value = /*value*/ - r[1], Ul(() => n = !1)), t.$set(f), (!i || a[0] & /*selectable*/ - 32) && Us( + r[1], Ol(() => n = !1)), t.$set(f), (!i || a[0] & /*selectable*/ + 32) && Vs( e, "selectable", /*selectable*/ @@ -8913,7 +8968,7 @@ function Ks(l) { ); }, i(r) { - i || (K(t.$$.fragment, r), i = !0); + i || (P(t.$$.fragment, r), i = !0); }, o(r) { x(t.$$.fragment, r), i = !1; @@ -8924,10 +8979,10 @@ function Ks(l) { } ); } -function Gs(l) { +function xs(l) { let e, t, n; function i(s) { - l[49](s); + l[51](s); } let o = { sources: ( @@ -8936,17 +8991,17 @@ function Gs(l) { ), handle_clear: ( /*clear*/ - l[33] + l[35] ), handle_select: ( /*handle_select_source*/ - l[32] + l[34] ) }; return ( /*active_source*/ l[0] !== void 0 && (o.active_source = /*active_source*/ - l[0]), e = new u_({ props: o }), $n.push(() => Ol(e, "active_source", i)), { + l[0]), e = new d_({ props: o }), $n.push(() => Wl(e, "active_source", i)), { c() { _t(e.$$.fragment); }, @@ -8959,10 +9014,10 @@ function Gs(l) { 16 && (a.sources = /*sources*/ s[4]), !t && r[0] & /*active_source*/ 1 && (t = !0, a.active_source = /*active_source*/ - s[0], Ul(() => t = !1)), e.$set(a); + s[0], Ol(() => t = !1)), e.$set(a); }, i(s) { - n || (K(e.$$.fragment, s), n = !0); + n || (P(e.$$.fragment, s), n = !0); }, o(s) { x(e.$$.fragment, s), n = !1; @@ -8973,48 +9028,48 @@ function Gs(l) { } ); } -function gm(l) { - let e, t, n, i, o, s, r, a, f, u, c, _, d, m, h = ( +function pm(l) { + let e, t, n, i, o, s, r, a, f, u, c, _, d, h, m = ( /*sources*/ (l[4].length > 1 || /*sources*/ l[4].includes("clipboard")) && /*value*/ l[1] === null && /*interactive*/ l[7] - ), p; - e = new qf({ + ), w; + e = new Mf({ props: { show_label: ( /*show_label*/ l[3] ), - Icon: ra, + Icon: ca, label: ( /*label*/ l[2] || "Image Annotator" ) } }); - let w = ( + let b = ( /*showDownloadButton*/ l[10] && /*value*/ - l[1] !== null && Os(l) - ), b = ( + l[1] !== null && Ps(l) + ), p = ( /*showShareButton*/ l[9] && /*value*/ - l[1] !== null && Ws(l) + l[1] !== null && Zs(l) ), g = ( /*showClearButton*/ l[11] && /*value*/ l[1] !== null && /*interactive*/ - l[7] && Vs(l) + l[7] && Ks(l) ); - function k(S) { - l[39](S); + function v(S) { + l[41](S); } - function C(S) { - l[40](S); + function E(S) { + l[42](S); } - let v = { + let y = { hidden: ( /*value*/ l[1] !== null || /*active_source*/ @@ -9030,222 +9085,222 @@ function gm(l) { ), max_file_size: ( /*max_file_size*/ - l[23] + l[25] ), disable_click: !/*sources*/ l[4].includes("upload"), upload: ( /*cli_upload*/ - l[24] + l[26] ), stream_handler: ( /*stream_handler*/ - l[25] + l[27] ), - $$slots: { default: [mm] }, + $$slots: { default: [wm] }, $$scope: { ctx: l } }; /*uploading*/ - l[26] !== void 0 && (v.uploading = /*uploading*/ - l[26]), /*dragging*/ - l[27] !== void 0 && (v.dragging = /*dragging*/ - l[27]), f = new Vd({ props: v }), l[38](f), $n.push(() => Ol(f, "uploading", k)), $n.push(() => Ol(f, "dragging", C)), f.$on( + l[28] !== void 0 && (y.uploading = /*uploading*/ + l[28]), /*dragging*/ + l[29] !== void 0 && (y.dragging = /*dragging*/ + l[29]), f = new Kd({ props: y }), l[40](f), $n.push(() => Wl(f, "uploading", v)), $n.push(() => Wl(f, "dragging", E)), f.$on( "load", /*handle_upload*/ - l[29] + l[31] ), f.$on( "error", /*error_handler_1*/ - l[41] + l[43] ); - let z = ( + let C = ( /*value*/ l[1] === null && /*active_source*/ - l[0] === "webcam" && Zs(l) - ), y = ( + l[0] === "webcam" && Js(l) + ), k = ( /*value*/ - l[1] !== null && Ks(l) - ), A = h && Gs(l); + l[1] !== null && Qs(l) + ), A = m && xs(l); return { c() { - _t(e.$$.fragment), t = Ht(), n = Zn("div"), w && w.c(), i = Ht(), b && b.c(), o = Ht(), g && g.c(), s = Ht(), r = Zn("div"), a = Zn("div"), _t(f.$$.fragment), _ = Ht(), z && z.c(), d = Ht(), y && y.c(), m = Ht(), A && A.c(), Nn(n, "class", "icon-buttons svelte-1gjdske"), Nn(a, "class", "upload-container svelte-1gjdske"), Nn(r, "data-testid", "image"), Nn(r, "class", "image-container svelte-1gjdske"); - }, - m(S, R) { - ht(e, S, R), Kt(S, t, R), Kt(S, n, R), w && w.m(n, null), un(n, i), b && b.m(n, null), un(n, o), g && g.m(n, null), Kt(S, s, R), Kt(S, r, R), un(r, a), ht(f, a, null), un(a, _), z && z.m(a, null), un(a, d), y && y.m(a, null), un(r, m), A && A.m(r, null), p = !0; - }, - p(S, R) { - const D = {}; - R[0] & /*show_label*/ - 8 && (D.show_label = /*show_label*/ - S[3]), R[0] & /*label*/ - 4 && (D.label = /*label*/ - S[2] || "Image Annotator"), e.$set(D), /*showDownloadButton*/ + _t(e.$$.fragment), t = Ht(), n = Zn("div"), b && b.c(), i = Ht(), p && p.c(), o = Ht(), g && g.c(), s = Ht(), r = Zn("div"), a = Zn("div"), _t(f.$$.fragment), _ = Ht(), C && C.c(), d = Ht(), k && k.c(), h = Ht(), A && A.c(), Nn(n, "class", "icon-buttons svelte-1gjdske"), Nn(a, "class", "upload-container svelte-1gjdske"), Nn(r, "data-testid", "image"), Nn(r, "class", "image-container svelte-1gjdske"); + }, + m(S, T) { + ht(e, S, T), Kt(S, t, T), Kt(S, n, T), b && b.m(n, null), un(n, i), p && p.m(n, null), un(n, o), g && g.m(n, null), Kt(S, s, T), Kt(S, r, T), un(r, a), ht(f, a, null), un(a, _), C && C.m(a, null), un(a, d), k && k.m(a, null), un(r, h), A && A.m(r, null), w = !0; + }, + p(S, T) { + const R = {}; + T[0] & /*show_label*/ + 8 && (R.show_label = /*show_label*/ + S[3]), T[0] & /*label*/ + 4 && (R.label = /*label*/ + S[2] || "Image Annotator"), e.$set(R), /*showDownloadButton*/ S[10] && /*value*/ - S[1] !== null ? w ? (w.p(S, R), R[0] & /*showDownloadButton, value*/ - 1026 && K(w, 1)) : (w = Os(S), w.c(), K(w, 1), w.m(n, i)) : w && (Yt(), x(w, 1, 1, () => { - w = null; + S[1] !== null ? b ? (b.p(S, T), T[0] & /*showDownloadButton, value*/ + 1026 && P(b, 1)) : (b = Ps(S), b.c(), P(b, 1), b.m(n, i)) : b && (Yt(), x(b, 1, 1, () => { + b = null; }), Xt()), /*showShareButton*/ S[9] && /*value*/ - S[1] !== null ? b ? (b.p(S, R), R[0] & /*showShareButton, value*/ - 514 && K(b, 1)) : (b = Ws(S), b.c(), K(b, 1), b.m(n, o)) : b && (Yt(), x(b, 1, 1, () => { - b = null; + S[1] !== null ? p ? (p.p(S, T), T[0] & /*showShareButton, value*/ + 514 && P(p, 1)) : (p = Zs(S), p.c(), P(p, 1), p.m(n, o)) : p && (Yt(), x(p, 1, 1, () => { + p = null; }), Xt()), /*showClearButton*/ S[11] && /*value*/ S[1] !== null && /*interactive*/ - S[7] ? g ? (g.p(S, R), R[0] & /*showClearButton, value, interactive*/ - 2178 && K(g, 1)) : (g = Vs(S), g.c(), K(g, 1), g.m(n, null)) : g && (Yt(), x(g, 1, 1, () => { + S[7] ? g ? (g.p(S, T), T[0] & /*showClearButton, value, interactive*/ + 2178 && P(g, 1)) : (g = Ks(S), g.c(), P(g, 1), g.m(n, null)) : g && (Yt(), x(g, 1, 1, () => { g = null; }), Xt()); - const N = {}; - R[0] & /*value, active_source*/ - 3 && (N.hidden = /*value*/ + const U = {}; + T[0] & /*value, active_source*/ + 3 && (U.hidden = /*value*/ S[1] !== null || /*active_source*/ - S[0] === "webcam"), R[0] & /*active_source*/ - 1 && (N.filetype = /*active_source*/ - S[0] === "clipboard" ? "clipboard" : "image/*"), R[0] & /*root*/ - 64 && (N.root = /*root*/ - S[6]), R[0] & /*max_file_size*/ - 8388608 && (N.max_file_size = /*max_file_size*/ - S[23]), R[0] & /*sources*/ - 16 && (N.disable_click = !/*sources*/ - S[4].includes("upload")), R[0] & /*cli_upload*/ - 16777216 && (N.upload = /*cli_upload*/ - S[24]), R[0] & /*stream_handler*/ - 33554432 && (N.stream_handler = /*stream_handler*/ - S[25]), R[0] & /*value*/ - 2 | R[1] & /*$$scope*/ - 524288 && (N.$$scope = { dirty: R, ctx: S }), !u && R[0] & /*uploading*/ - 67108864 && (u = !0, N.uploading = /*uploading*/ - S[26], Ul(() => u = !1)), !c && R[0] & /*dragging*/ - 134217728 && (c = !0, N.dragging = /*dragging*/ - S[27], Ul(() => c = !1)), f.$set(N), /*value*/ + S[0] === "webcam"), T[0] & /*active_source*/ + 1 && (U.filetype = /*active_source*/ + S[0] === "clipboard" ? "clipboard" : "image/*"), T[0] & /*root*/ + 64 && (U.root = /*root*/ + S[6]), T[0] & /*max_file_size*/ + 33554432 && (U.max_file_size = /*max_file_size*/ + S[25]), T[0] & /*sources*/ + 16 && (U.disable_click = !/*sources*/ + S[4].includes("upload")), T[0] & /*cli_upload*/ + 67108864 && (U.upload = /*cli_upload*/ + S[26]), T[0] & /*stream_handler*/ + 134217728 && (U.stream_handler = /*stream_handler*/ + S[27]), T[0] & /*value*/ + 2 | T[1] & /*$$scope*/ + 2097152 && (U.$$scope = { dirty: T, ctx: S }), !u && T[0] & /*uploading*/ + 268435456 && (u = !0, U.uploading = /*uploading*/ + S[28], Ol(() => u = !1)), !c && T[0] & /*dragging*/ + 536870912 && (c = !0, U.dragging = /*dragging*/ + S[29], Ol(() => c = !1)), f.$set(U), /*value*/ S[1] === null && /*active_source*/ - S[0] === "webcam" ? z ? (z.p(S, R), R[0] & /*value, active_source*/ - 3 && K(z, 1)) : (z = Zs(S), z.c(), K(z, 1), z.m(a, d)) : z && (Yt(), x(z, 1, 1, () => { - z = null; + S[0] === "webcam" ? C ? (C.p(S, T), T[0] & /*value, active_source*/ + 3 && P(C, 1)) : (C = Js(S), C.c(), P(C, 1), C.m(a, d)) : C && (Yt(), x(C, 1, 1, () => { + C = null; }), Xt()), /*value*/ - S[1] !== null ? y ? (y.p(S, R), R[0] & /*value*/ - 2 && K(y, 1)) : (y = Ks(S), y.c(), K(y, 1), y.m(a, null)) : y && (Yt(), x(y, 1, 1, () => { - y = null; - }), Xt()), R[0] & /*sources, value, interactive*/ - 146 && (h = /*sources*/ + S[1] !== null ? k ? (k.p(S, T), T[0] & /*value*/ + 2 && P(k, 1)) : (k = Qs(S), k.c(), P(k, 1), k.m(a, null)) : k && (Yt(), x(k, 1, 1, () => { + k = null; + }), Xt()), T[0] & /*sources, value, interactive*/ + 146 && (m = /*sources*/ (S[4].length > 1 || /*sources*/ S[4].includes("clipboard")) && /*value*/ S[1] === null && /*interactive*/ - S[7]), h ? A ? (A.p(S, R), R[0] & /*sources, value, interactive*/ - 146 && K(A, 1)) : (A = Gs(S), A.c(), K(A, 1), A.m(r, null)) : A && (Yt(), x(A, 1, 1, () => { + S[7]), m ? A ? (A.p(S, T), T[0] & /*sources, value, interactive*/ + 146 && P(A, 1)) : (A = xs(S), A.c(), P(A, 1), A.m(r, null)) : A && (Yt(), x(A, 1, 1, () => { A = null; }), Xt()); }, i(S) { - p || (K(e.$$.fragment, S), K(w), K(b), K(g), K(f.$$.fragment, S), K(z), K(y), K(A), p = !0); + w || (P(e.$$.fragment, S), P(b), P(p), P(g), P(f.$$.fragment, S), P(C), P(k), P(A), w = !0); }, o(S) { - x(e.$$.fragment, S), x(w), x(b), x(g), x(f.$$.fragment, S), x(z), x(y), x(A), p = !1; + x(e.$$.fragment, S), x(b), x(p), x(g), x(f.$$.fragment, S), x(C), x(k), x(A), w = !1; }, d(S) { - S && (Zt(t), Zt(n), Zt(s), Zt(r)), dt(e, S), w && w.d(), b && b.d(), g && g.d(), l[38](null), dt(f), z && z.d(), y && y.d(), A && A.d(); + S && (Zt(t), Zt(n), Zt(s), Zt(r)), dt(e, S), b && b.d(), p && p.d(), g && g.d(), l[40](null), dt(f), C && C.d(), k && k.d(), A && A.d(); } }; } -function bm(l, e, t) { +function vm(l, e, t) { let { $$slots: n = {}, $$scope: i } = e; - var o = this && this.__awaiter || function(B, bt, st, tn) { - function ei(Lt) { - return Lt instanceof st ? Lt : new st(function(E) { - E(Lt); + var o = this && this.__awaiter || function(z, wt, st, tn) { + function li(Lt) { + return Lt instanceof st ? Lt : new st(function(B) { + B(Lt); }); } - return new (st || (st = Promise))(function(Lt, E) { - function Y(ee) { + return new (st || (st = Promise))(function(Lt, B) { + function N(te) { try { - ue(tn.next(ee)); - } catch (le) { - E(le); + ce(tn.next(te)); + } catch (ie) { + B(ie); } } - function $(ee) { + function ee(te) { try { - ue(tn.throw(ee)); - } catch (le) { - E(le); + ce(tn.throw(te)); + } catch (ie) { + B(ie); } } - function ue(ee) { - ee.done ? Lt(ee.value) : ei(ee.value).then(Y, $); + function ce(te) { + te.done ? Lt(te.value) : li(te.value).then(N, ee); } - ue((tn = tn.apply(B, bt || [])).next()); + ce((tn = tn.apply(z, wt || [])).next()); }); }; - let { value: s } = e, { label: r = void 0 } = e, { show_label: a } = e, { sources: f = ["upload", "webcam", "clipboard"] } = e, { selectable: u = !1 } = e, { root: c } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: m } = e, { showDownloadButton: h } = e, { showClearButton: p } = e, { boxesAlpha: w } = e, { labelList: b } = e, { labelColors: g } = e, { boxMinSize: k } = e, { handleSize: C } = e, { boxThickness: v } = e, { disableEditBoxes: z } = e, { singleBox: y } = e, { showRemoveButton: A } = e, { handlesCursor: S } = e, { boxSelectedThickness: R } = e, { max_file_size: D = null } = e, { cli_upload: N } = e, { stream_handler: J } = e, Q, V = !1, { active_source: U = null } = e; - function T({ detail: B }) { - t(1, s = new Ns()), t(1, s.image = B, s), L("upload"); + let { value: s } = e, { label: r = void 0 } = e, { show_label: a } = e, { sources: f = ["upload", "webcam", "clipboard"] } = e, { selectable: u = !1 } = e, { root: c } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: h } = e, { showDownloadButton: m } = e, { showClearButton: w } = e, { boxesAlpha: b } = e, { labelList: p } = e, { labelColors: g } = e, { boxMinSize: v } = e, { handleSize: E } = e, { height: y } = e, { width: C } = e, { boxThickness: k } = e, { disableEditBoxes: A } = e, { singleBox: S } = e, { showRemoveButton: T } = e, { handlesCursor: R } = e, { boxSelectedThickness: U } = e, { max_file_size: Z = null } = e, { cli_upload: Q } = e, { stream_handler: J } = e, K, L = !1, { active_source: F = null } = e; + function D({ detail: z }) { + t(1, s = new Ws()), t(1, s.image = z, s), $("upload"); } - function O(B) { + function W(z) { return o(this, void 0, void 0, function* () { - const bt = yield Q.load_files([new File([B], "webcam.png")]), st = (bt == null ? void 0 : bt[0]) || null; - st ? (t(1, s = new Ns()), t(1, s.image = st, s)) : t(1, s = null), yield dm(), L("change"); + const wt = yield K.load_files([new File([z], "webcam.png")]), st = (wt == null ? void 0 : wt[0]) || null; + st ? (t(1, s = new Ws()), t(1, s.image = st, s)) : t(1, s = null), yield gm(), $("change"); }); } - const L = _m(); - let P = !1; - function he(B) { + const $ = mm(); + let oe = !1; + function ge(z) { return o(this, void 0, void 0, function* () { - switch (B) { + switch (z) { case "clipboard": - Q.paste_clipboard(); + K.paste_clipboard(); break; } }); } - function ie() { - t(1, s = null), L("clear"), L("change"); + function I() { + t(1, s = null), $("clear"), $("change"); } - const ge = async (B) => B === null ? "" : ``; - function I(B) { - Mn.call(this, l, B); + const Xe = async (z) => z === null ? "" : ``; + function M(z) { + Mn.call(this, l, z); } - function Me(B) { - Mn.call(this, l, B); + function H(z) { + Mn.call(this, l, z); } - function M(B) { - $n[B ? "unshift" : "push"](() => { - Q = B, t(28, Q); + function G(z) { + $n[z ? "unshift" : "push"](() => { + K = z, t(30, K); }); } - function H(B) { - V = B, t(26, V); + function q(z) { + L = z, t(28, L); } - function G(B) { - P = B, t(27, P); + function ue(z) { + oe = z, t(29, oe); } - function q(B) { - Mn.call(this, l, B); + function Ye(z) { + Mn.call(this, l, z); } - const fe = (B) => O(B.detail), be = (B) => O(B.detail); - function Ae(B) { - Mn.call(this, l, B); + const Qe = (z) => W(z.detail), ke = (z) => W(z.detail); + function be(z) { + Mn.call(this, l, z); } - function ot(B) { - Mn.call(this, l, B); + function Ne(z) { + Mn.call(this, l, z); } - const Le = (B) => O(B.detail); - function Fe(B) { - s = B, t(1, s); + const Ue = (z) => W(z.detail); + function bt(z) { + s = z, t(1, s); } - const Ue = () => L("change"); - function At(B) { - U = B, t(0, U), t(4, f); + const ti = () => $("change"); + function ni(z) { + F = z, t(0, F), t(4, f); } - return l.$$set = (B) => { - "value" in B && t(1, s = B.value), "label" in B && t(2, r = B.label), "show_label" in B && t(3, a = B.show_label), "sources" in B && t(4, f = B.sources), "selectable" in B && t(5, u = B.selectable), "root" in B && t(6, c = B.root), "interactive" in B && t(7, _ = B.interactive), "i18n" in B && t(8, d = B.i18n), "showShareButton" in B && t(9, m = B.showShareButton), "showDownloadButton" in B && t(10, h = B.showDownloadButton), "showClearButton" in B && t(11, p = B.showClearButton), "boxesAlpha" in B && t(12, w = B.boxesAlpha), "labelList" in B && t(13, b = B.labelList), "labelColors" in B && t(14, g = B.labelColors), "boxMinSize" in B && t(15, k = B.boxMinSize), "handleSize" in B && t(16, C = B.handleSize), "boxThickness" in B && t(17, v = B.boxThickness), "disableEditBoxes" in B && t(18, z = B.disableEditBoxes), "singleBox" in B && t(19, y = B.singleBox), "showRemoveButton" in B && t(20, A = B.showRemoveButton), "handlesCursor" in B && t(21, S = B.handlesCursor), "boxSelectedThickness" in B && t(22, R = B.boxSelectedThickness), "max_file_size" in B && t(23, D = B.max_file_size), "cli_upload" in B && t(24, N = B.cli_upload), "stream_handler" in B && t(25, J = B.stream_handler), "active_source" in B && t(0, U = B.active_source), "$$scope" in B && t(50, i = B.$$scope); + return l.$$set = (z) => { + "value" in z && t(1, s = z.value), "label" in z && t(2, r = z.label), "show_label" in z && t(3, a = z.show_label), "sources" in z && t(4, f = z.sources), "selectable" in z && t(5, u = z.selectable), "root" in z && t(6, c = z.root), "interactive" in z && t(7, _ = z.interactive), "i18n" in z && t(8, d = z.i18n), "showShareButton" in z && t(9, h = z.showShareButton), "showDownloadButton" in z && t(10, m = z.showDownloadButton), "showClearButton" in z && t(11, w = z.showClearButton), "boxesAlpha" in z && t(12, b = z.boxesAlpha), "labelList" in z && t(13, p = z.labelList), "labelColors" in z && t(14, g = z.labelColors), "boxMinSize" in z && t(15, v = z.boxMinSize), "handleSize" in z && t(16, E = z.handleSize), "height" in z && t(17, y = z.height), "width" in z && t(18, C = z.width), "boxThickness" in z && t(19, k = z.boxThickness), "disableEditBoxes" in z && t(20, A = z.disableEditBoxes), "singleBox" in z && t(21, S = z.singleBox), "showRemoveButton" in z && t(22, T = z.showRemoveButton), "handlesCursor" in z && t(23, R = z.handlesCursor), "boxSelectedThickness" in z && t(24, U = z.boxSelectedThickness), "max_file_size" in z && t(25, Z = z.max_file_size), "cli_upload" in z && t(26, Q = z.cli_upload), "stream_handler" in z && t(27, J = z.stream_handler), "active_source" in z && t(0, F = z.active_source), "$$scope" in z && t(52, i = z.$$scope); }, l.$$.update = () => { l.$$.dirty[0] & /*uploading*/ - 67108864 && V && ie(), l.$$.dirty[0] & /*dragging*/ - 134217728 && L("drag", P), l.$$.dirty[0] & /*active_source, sources*/ - 17 && !U && f && t(0, U = f[0]); + 268435456 && L && I(), l.$$.dirty[0] & /*dragging*/ + 536870912 && $("drag", oe), l.$$.dirty[0] & /*active_source, sources*/ + 17 && !F && f && t(0, F = f[0]); }, [ - U, + F, s, r, a, @@ -9254,58 +9309,60 @@ function bm(l, e, t) { c, _, d, - m, h, - p, + m, w, b, + p, g, - k, - C, v, - z, + E, y, + C, + k, A, S, + T, R, - D, - N, - J, - V, - P, + U, + Z, Q, - T, - O, + J, L, - he, - ie, - n, + oe, + K, + D, + W, + $, ge, I, - Me, + n, + Xe, M, H, G, q, - fe, + ue, + Ye, + Qe, + ke, be, - Ae, - ot, - Le, - Fe, + Ne, Ue, - At, + bt, + ti, + ni, i ]; } -class wm extends lm { +class km extends sm { constructor(e) { - super(), rm( + super(), cm( this, e, - bm, - gm, - um, + vm, + pm, + dm, { value: 1, label: 2, @@ -9323,15 +9380,17 @@ class wm extends lm { labelColors: 14, boxMinSize: 15, handleSize: 16, - boxThickness: 17, - disableEditBoxes: 18, - singleBox: 19, - showRemoveButton: 20, - handlesCursor: 21, - boxSelectedThickness: 22, - max_file_size: 23, - cli_upload: 24, - stream_handler: 25, + height: 17, + width: 18, + boxThickness: 19, + disableEditBoxes: 20, + singleBox: 21, + showRemoveButton: 22, + handlesCursor: 23, + boxSelectedThickness: 24, + max_file_size: 25, + cli_upload: 26, + stream_handler: 27, active_source: 0 }, null, @@ -9340,60 +9399,60 @@ class wm extends lm { } } const { - SvelteComponent: pm, - attr: Al, - detach: ar, - element: rr, - init: vm, - insert: fr, - noop: Js, - safe_not_equal: km, - src_url_equal: Qs, - toggle_class: Ct + SvelteComponent: ym, + attr: Ll, + detach: ur, + element: cr, + init: Cm, + insert: _r, + noop: $s, + safe_not_equal: Sm, + src_url_equal: ea, + toggle_class: St } = window.__gradio__svelte__internal; -function xs(l) { +function ta(l) { let e, t; return { c() { - e = rr("img"), Qs(e.src, t = /*value*/ - l[0].url) || Al(e, "src", t), Al(e, "alt", ""); + e = cr("img"), ea(e.src, t = /*value*/ + l[0].url) || Ll(e, "src", t), Ll(e, "alt", ""); }, m(n, i) { - fr(n, e, i); + _r(n, e, i); }, p(n, i) { i & /*value*/ - 1 && !Qs(e.src, t = /*value*/ - n[0].url) && Al(e, "src", t); + 1 && !ea(e.src, t = /*value*/ + n[0].url) && Ll(e, "src", t); }, d(n) { - n && ar(e); + n && ur(e); } }; } -function ym(l) { +function zm(l) { let e, t = ( /*value*/ - l[0] && xs(l) + l[0] && ta(l) ); return { c() { - e = rr("div"), t && t.c(), Al(e, "class", "container svelte-1sgcyba"), Ct( + e = cr("div"), t && t.c(), Ll(e, "class", "container svelte-1sgcyba"), St( e, "table", /*type*/ l[1] === "table" - ), Ct( + ), St( e, "gallery", /*type*/ l[1] === "gallery" - ), Ct( + ), St( e, "selected", /*selected*/ l[2] - ), Ct( + ), St( e, "border", /*value*/ @@ -9401,84 +9460,84 @@ function ym(l) { ); }, m(n, i) { - fr(n, e, i), t && t.m(e, null); + _r(n, e, i), t && t.m(e, null); }, p(n, [i]) { /*value*/ - n[0] ? t ? t.p(n, i) : (t = xs(n), t.c(), t.m(e, null)) : t && (t.d(1), t = null), i & /*type*/ - 2 && Ct( + n[0] ? t ? t.p(n, i) : (t = ta(n), t.c(), t.m(e, null)) : t && (t.d(1), t = null), i & /*type*/ + 2 && St( e, "table", /*type*/ n[1] === "table" ), i & /*type*/ - 2 && Ct( + 2 && St( e, "gallery", /*type*/ n[1] === "gallery" ), i & /*selected*/ - 4 && Ct( + 4 && St( e, "selected", /*selected*/ n[2] ), i & /*value*/ - 1 && Ct( + 1 && St( e, "border", /*value*/ n[0] ); }, - i: Js, - o: Js, + i: $s, + o: $s, d(n) { - n && ar(e), t && t.d(); + n && ur(e), t && t.d(); } }; } -function Cm(l, e, t) { +function Bm(l, e, t) { let { value: n } = e, { type: i } = e, { selected: o = !1 } = e; return l.$$set = (s) => { "value" in s && t(0, n = s.value), "type" in s && t(1, i = s.type), "selected" in s && t(2, o = s.selected); }, [n, i, o]; } -class Zm extends pm { +class Jm extends ym { constructor(e) { - super(), vm(this, e, Cm, ym, km, { value: 0, type: 1, selected: 2 }); + super(), Cm(this, e, Bm, zm, Sm, { value: 0, type: 1, selected: 2 }); } } const { - SvelteComponent: Sm, - add_flush_callback: $s, - assign: zm, - bind: ea, - binding_callbacks: ta, - check_outros: qm, + SvelteComponent: qm, + add_flush_callback: na, + assign: Em, + bind: la, + binding_callbacks: ia, + check_outros: Mm, create_component: xt, destroy_component: $t, - detach: ur, - empty: Bm, - flush: Z, - get_spread_object: Em, - get_spread_update: Mm, - group_outros: Am, - init: Lm, - insert: cr, + detach: dr, + empty: Am, + flush: V, + get_spread_object: Lm, + get_spread_update: Dm, + group_outros: Rm, + init: Tm, + insert: hr, mount_component: en, - safe_not_equal: Dm, - space: Rm, + safe_not_equal: Im, + space: jm, transition_in: mt, transition_out: gt } = window.__gradio__svelte__internal; -function Tm(l) { +function Hm(l) { let e, t; - return e = new lu({ + return e = new su({ props: { unpadded_box: !0, size: "large", - $$slots: { default: [Hm] }, + $$slots: { default: [Ym] }, $$scope: { ctx: l } } }), { @@ -9504,9 +9563,9 @@ function Tm(l) { } }; } -function Im(l) { +function Fm(l) { let e, t; - return e = new ma({ + return e = new wa({ props: { i18n: ( /*gradio*/ @@ -9539,9 +9598,9 @@ function Im(l) { } }; } -function jm(l) { +function Xm(l) { let e, t; - return e = new ma({ + return e = new wa({ props: { i18n: ( /*gradio*/ @@ -9573,9 +9632,9 @@ function jm(l) { } }; } -function Hm(l) { +function Ym(l) { let e, t; - return e = new ra({}), { + return e = new ca({}), { c() { xt(e.$$.fragment); }, @@ -9593,9 +9652,9 @@ function Hm(l) { } }; } -function Fm(l) { +function Nm(l) { let e, t, n, i; - const o = [jm, Im, Tm], s = []; + const o = [Xm, Fm, Hm], s = []; function r(a, f) { return ( /*active_source*/ @@ -9607,16 +9666,16 @@ function Fm(l) { } return e = r(l), t = s[e] = o[e](l), { c() { - t.c(), n = Bm(); + t.c(), n = Am(); }, m(a, f) { - s[e].m(a, f), cr(a, n, f), i = !0; + s[e].m(a, f), hr(a, n, f), i = !0; }, p(a, f) { let u = e; - e = r(a), e === u ? s[e].p(a, f) : (Am(), gt(s[u], 1, 1, () => { + e = r(a), e === u ? s[e].p(a, f) : (Rm(), gt(s[u], 1, 1, () => { s[u] = null; - }), qm(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), mt(t, 1), t.m(n.parentNode, n)); + }), Mm(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), mt(t, 1), t.m(n.parentNode, n)); }, i(a) { i || (mt(t), i = !0); @@ -9625,11 +9684,11 @@ function Fm(l) { gt(t), i = !1; }, d(a) { - a && ur(n), s[e].d(a); + a && dr(n), s[e].d(a); } }; } -function Xm(l) { +function Um(l) { let e, t, n, i, o, s; const r = [ { @@ -9647,8 +9706,8 @@ function Xm(l) { ]; let a = {}; for (let _ = 0; _ < r.length; _ += 1) - a = zm(a, r[_]); - e = new G_({ props: a }); + a = Em(a, r[_]); + e = new x_({ props: a }); function f(_) { l[33](_); } @@ -9692,6 +9751,14 @@ function Xm(l) { /*boxes_alpha*/ l[19] ), + height: ( + /*height*/ + l[8] + ), + width: ( + /*width*/ + l[9] + ), labelList: ( /*label_list*/ l[20] @@ -9752,7 +9819,7 @@ function Xm(l) { /*handles_cursor*/ l[29] ), - $$slots: { default: [Fm] }, + $$slots: { default: [Nm] }, $$scope: { ctx: l } }; return ( @@ -9760,7 +9827,7 @@ function Xm(l) { l[32] !== void 0 && (c.active_source = /*active_source*/ l[32]), /*value*/ l[0] !== void 0 && (c.value = /*value*/ - l[0]), n = new wm({ props: c }), ta.push(() => ea(n, "active_source", f)), ta.push(() => ea(n, "value", u)), n.$on( + l[0]), n = new km({ props: c }), ia.push(() => la(n, "active_source", f)), ia.push(() => la(n, "value", u)), n.$on( "change", /*change_handler*/ l[35] @@ -9794,14 +9861,14 @@ function Xm(l) { l[42] ), { c() { - xt(e.$$.fragment), t = Rm(), xt(n.$$.fragment); + xt(e.$$.fragment), t = jm(), xt(n.$$.fragment); }, m(_, d) { - en(e, _, d), cr(_, t, d), en(n, _, d), s = !0; + en(e, _, d), hr(_, t, d), en(n, _, d), s = !0; }, p(_, d) { - const m = d[0] & /*gradio, loading_status*/ - 1073741826 ? Mm(r, [ + const h = d[0] & /*gradio, loading_status*/ + 1073741826 ? Dm(r, [ d[0] & /*gradio*/ 1073741824 && { autoscroll: ( @@ -9815,68 +9882,72 @@ function Xm(l) { _[30].i18n ) }, d[0] & /*loading_status*/ - 2 && Em( + 2 && Lm( /*loading_status*/ _[1] ) ]) : {}; - e.$set(m); - const h = {}; + e.$set(h); + const m = {}; d[0] & /*_selectable*/ - 1024 && (h.selectable = /*_selectable*/ + 1024 && (m.selectable = /*_selectable*/ _[10]), d[0] & /*root*/ - 128 && (h.root = /*root*/ + 128 && (m.root = /*root*/ _[7]), d[0] & /*sources*/ - 16384 && (h.sources = /*sources*/ + 16384 && (m.sources = /*sources*/ _[14]), d[0] & /*interactive*/ - 262144 && (h.interactive = /*interactive*/ + 262144 && (m.interactive = /*interactive*/ _[18]), d[0] & /*show_download_button*/ - 32768 && (h.showDownloadButton = /*show_download_button*/ + 32768 && (m.showDownloadButton = /*show_download_button*/ _[15]), d[0] & /*show_share_button*/ - 65536 && (h.showShareButton = /*show_share_button*/ + 65536 && (m.showShareButton = /*show_share_button*/ _[16]), d[0] & /*show_clear_button*/ - 131072 && (h.showClearButton = /*show_clear_button*/ + 131072 && (m.showClearButton = /*show_clear_button*/ _[17]), d[0] & /*gradio*/ - 1073741824 && (h.i18n = /*gradio*/ + 1073741824 && (m.i18n = /*gradio*/ _[30].i18n), d[0] & /*boxes_alpha*/ - 524288 && (h.boxesAlpha = /*boxes_alpha*/ - _[19]), d[0] & /*label_list*/ - 1048576 && (h.labelList = /*label_list*/ + 524288 && (m.boxesAlpha = /*boxes_alpha*/ + _[19]), d[0] & /*height*/ + 256 && (m.height = /*height*/ + _[8]), d[0] & /*width*/ + 512 && (m.width = /*width*/ + _[9]), d[0] & /*label_list*/ + 1048576 && (m.labelList = /*label_list*/ _[20]), d[0] & /*label_colors*/ - 2097152 && (h.labelColors = /*label_colors*/ + 2097152 && (m.labelColors = /*label_colors*/ _[21]), d[0] & /*box_min_size*/ - 4194304 && (h.boxMinSize = /*box_min_size*/ + 4194304 && (m.boxMinSize = /*box_min_size*/ _[22]), d[0] & /*label*/ - 32 && (h.label = /*label*/ + 32 && (m.label = /*label*/ _[5]), d[0] & /*show_label*/ - 64 && (h.show_label = /*show_label*/ + 64 && (m.show_label = /*show_label*/ _[6]), d[0] & /*gradio*/ - 1073741824 && (h.max_file_size = /*gradio*/ + 1073741824 && (m.max_file_size = /*gradio*/ _[30].max_file_size), d[0] & /*gradio*/ - 1073741824 && (h.cli_upload = /*gradio*/ + 1073741824 && (m.cli_upload = /*gradio*/ _[30].client.upload), d[0] & /*gradio*/ - 1073741824 && (h.stream_handler = /*gradio*/ + 1073741824 && (m.stream_handler = /*gradio*/ _[30].client.stream), d[0] & /*handle_size*/ - 8388608 && (h.handleSize = /*handle_size*/ + 8388608 && (m.handleSize = /*handle_size*/ _[23]), d[0] & /*box_thickness*/ - 16777216 && (h.boxThickness = /*box_thickness*/ + 16777216 && (m.boxThickness = /*box_thickness*/ _[24]), d[0] & /*box_selected_thickness*/ - 33554432 && (h.boxSelectedThickness = /*box_selected_thickness*/ + 33554432 && (m.boxSelectedThickness = /*box_selected_thickness*/ _[25]), d[0] & /*disable_edit_boxes*/ - 67108864 && (h.disableEditBoxes = /*disable_edit_boxes*/ + 67108864 && (m.disableEditBoxes = /*disable_edit_boxes*/ _[26]), d[0] & /*single_box*/ - 134217728 && (h.singleBox = /*single_box*/ + 134217728 && (m.singleBox = /*single_box*/ _[27]), d[0] & /*show_remove_button*/ - 268435456 && (h.showRemoveButton = /*show_remove_button*/ + 268435456 && (m.showRemoveButton = /*show_remove_button*/ _[28]), d[0] & /*handles_cursor*/ - 536870912 && (h.handlesCursor = /*handles_cursor*/ + 536870912 && (m.handlesCursor = /*handles_cursor*/ _[29]), d[0] & /*gradio*/ 1073741824 | d[1] & /*$$scope, active_source*/ - 4098 && (h.$$scope = { dirty: d, ctx: _ }), !i && d[1] & /*active_source*/ - 2 && (i = !0, h.active_source = /*active_source*/ - _[32], $s(() => i = !1)), !o && d[0] & /*value*/ - 1 && (o = !0, h.value = /*value*/ - _[0], $s(() => o = !1)), n.$set(h); + 4098 && (m.$$scope = { dirty: d, ctx: _ }), !i && d[1] & /*active_source*/ + 2 && (i = !0, m.active_source = /*active_source*/ + _[32], na(() => i = !1)), !o && d[0] & /*value*/ + 1 && (o = !0, m.value = /*value*/ + _[0], na(() => o = !1)), n.$set(m); }, i(_) { s || (mt(e.$$.fragment, _), mt(n.$$.fragment, _), s = !0); @@ -9885,14 +9956,14 @@ function Xm(l) { gt(e.$$.fragment, _), gt(n.$$.fragment, _), s = !1; }, d(_) { - _ && ur(t), $t(e, _), $t(n, _); + _ && dr(t), $t(e, _), $t(n, _); } } ); } -function Ym(l) { +function Om(l) { let e, t; - return e = new Br({ + return e = new Ar({ props: { visible: ( /*visible*/ @@ -9912,10 +9983,6 @@ function Ym(l) { /*elem_classes*/ l[3] ), - height: ( - /*height*/ - l[8] || void 0 - ), width: ( /*width*/ l[9] @@ -9933,7 +10000,7 @@ function Ym(l) { /*min_width*/ l[13] ), - $$slots: { default: [Xm] }, + $$slots: { default: [Um] }, $$scope: { ctx: l } } }), { @@ -9953,9 +10020,7 @@ function Ym(l) { 4 && (o.elem_id = /*elem_id*/ n[2]), i[0] & /*elem_classes*/ 8 && (o.elem_classes = /*elem_classes*/ - n[3]), i[0] & /*height*/ - 256 && (o.height = /*height*/ - n[8] || void 0), i[0] & /*width*/ + n[3]), i[0] & /*width*/ 512 && (o.width = /*width*/ n[9]), i[0] & /*container*/ 2048 && (o.container = /*container*/ @@ -9963,8 +10028,8 @@ function Ym(l) { 4096 && (o.scale = /*scale*/ n[12]), i[0] & /*min_width*/ 8192 && (o.min_width = /*min_width*/ - n[13]), i[0] & /*_selectable, root, sources, interactive, show_download_button, show_share_button, show_clear_button, gradio, boxes_alpha, label_list, label_colors, box_min_size, label, show_label, handle_size, box_thickness, box_selected_thickness, disable_edit_boxes, single_box, show_remove_button, handles_cursor, value, loading_status*/ - 2147468515 | i[1] & /*$$scope, active_source, dragging*/ + n[13]), i[0] & /*_selectable, root, sources, interactive, show_download_button, show_share_button, show_clear_button, gradio, boxes_alpha, height, width, label_list, label_colors, box_min_size, label, show_label, handle_size, box_thickness, box_selected_thickness, disable_edit_boxes, single_box, show_remove_button, handles_cursor, value, loading_status*/ + 2147469283 | i[1] & /*$$scope, active_source, dragging*/ 4099 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o); }, i(n) { @@ -9978,24 +10043,24 @@ function Ym(l) { } }; } -function Nm(l, e, t) { - let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: o = !0 } = e, { value: s = null } = e, { label: r } = e, { show_label: a } = e, { root: f } = e, { height: u } = e, { width: c } = e, { _selectable: _ = !1 } = e, { container: d = !0 } = e, { scale: m = null } = e, { min_width: h = void 0 } = e, { loading_status: p } = e, { sources: w = ["upload", "webcam", "clipboard"] } = e, { show_download_button: b } = e, { show_share_button: g } = e, { show_clear_button: k } = e, { interactive: C } = e, { boxes_alpha: v } = e, { label_list: z } = e, { label_colors: y } = e, { box_min_size: A } = e, { handle_size: S } = e, { box_thickness: R } = e, { box_selected_thickness: D } = e, { disable_edit_boxes: N } = e, { single_box: J } = e, { show_remove_button: Q } = e, { handles_cursor: V } = e, { gradio: U } = e, T, O = null; - function L(q) { - O = q, t(32, O); +function Wm(l, e, t) { + let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: o = !0 } = e, { value: s = null } = e, { label: r } = e, { show_label: a } = e, { root: f } = e, { height: u } = e, { width: c } = e, { _selectable: _ = !1 } = e, { container: d = !0 } = e, { scale: h = null } = e, { min_width: m = void 0 } = e, { loading_status: w } = e, { sources: b = ["upload", "webcam", "clipboard"] } = e, { show_download_button: p } = e, { show_share_button: g } = e, { show_clear_button: v } = e, { interactive: E } = e, { boxes_alpha: y } = e, { label_list: C } = e, { label_colors: k } = e, { box_min_size: A } = e, { handle_size: S } = e, { box_thickness: T } = e, { box_selected_thickness: R } = e, { disable_edit_boxes: U } = e, { single_box: Z } = e, { show_remove_button: Q } = e, { handles_cursor: J } = e, { gradio: K } = e, L, F = null; + function D(q) { + F = q, t(32, F); } - function P(q) { + function W(q) { s = q, t(0, s); } - const he = () => U.dispatch("change"), ie = () => U.dispatch("edit"), ge = () => { - U.dispatch("clear"); - }, I = ({ detail: q }) => t(31, T = q), Me = () => U.dispatch("upload"), M = ({ detail: q }) => U.dispatch("select", q), H = ({ detail: q }) => U.dispatch("share", q), G = ({ detail: q }) => { - t(1, p = p || {}), t(1, p.status = "error", p), U.dispatch("error", q); + const $ = () => K.dispatch("change"), oe = () => K.dispatch("edit"), ge = () => { + K.dispatch("clear"); + }, I = ({ detail: q }) => t(31, L = q), Xe = () => K.dispatch("upload"), M = ({ detail: q }) => K.dispatch("select", q), H = ({ detail: q }) => K.dispatch("share", q), G = ({ detail: q }) => { + t(1, w = w || {}), t(1, w.status = "error", w), K.dispatch("error", q); }; return l.$$set = (q) => { - "elem_id" in q && t(2, n = q.elem_id), "elem_classes" in q && t(3, i = q.elem_classes), "visible" in q && t(4, o = q.visible), "value" in q && t(0, s = q.value), "label" in q && t(5, r = q.label), "show_label" in q && t(6, a = q.show_label), "root" in q && t(7, f = q.root), "height" in q && t(8, u = q.height), "width" in q && t(9, c = q.width), "_selectable" in q && t(10, _ = q._selectable), "container" in q && t(11, d = q.container), "scale" in q && t(12, m = q.scale), "min_width" in q && t(13, h = q.min_width), "loading_status" in q && t(1, p = q.loading_status), "sources" in q && t(14, w = q.sources), "show_download_button" in q && t(15, b = q.show_download_button), "show_share_button" in q && t(16, g = q.show_share_button), "show_clear_button" in q && t(17, k = q.show_clear_button), "interactive" in q && t(18, C = q.interactive), "boxes_alpha" in q && t(19, v = q.boxes_alpha), "label_list" in q && t(20, z = q.label_list), "label_colors" in q && t(21, y = q.label_colors), "box_min_size" in q && t(22, A = q.box_min_size), "handle_size" in q && t(23, S = q.handle_size), "box_thickness" in q && t(24, R = q.box_thickness), "box_selected_thickness" in q && t(25, D = q.box_selected_thickness), "disable_edit_boxes" in q && t(26, N = q.disable_edit_boxes), "single_box" in q && t(27, J = q.single_box), "show_remove_button" in q && t(28, Q = q.show_remove_button), "handles_cursor" in q && t(29, V = q.handles_cursor), "gradio" in q && t(30, U = q.gradio); + "elem_id" in q && t(2, n = q.elem_id), "elem_classes" in q && t(3, i = q.elem_classes), "visible" in q && t(4, o = q.visible), "value" in q && t(0, s = q.value), "label" in q && t(5, r = q.label), "show_label" in q && t(6, a = q.show_label), "root" in q && t(7, f = q.root), "height" in q && t(8, u = q.height), "width" in q && t(9, c = q.width), "_selectable" in q && t(10, _ = q._selectable), "container" in q && t(11, d = q.container), "scale" in q && t(12, h = q.scale), "min_width" in q && t(13, m = q.min_width), "loading_status" in q && t(1, w = q.loading_status), "sources" in q && t(14, b = q.sources), "show_download_button" in q && t(15, p = q.show_download_button), "show_share_button" in q && t(16, g = q.show_share_button), "show_clear_button" in q && t(17, v = q.show_clear_button), "interactive" in q && t(18, E = q.interactive), "boxes_alpha" in q && t(19, y = q.boxes_alpha), "label_list" in q && t(20, C = q.label_list), "label_colors" in q && t(21, k = q.label_colors), "box_min_size" in q && t(22, A = q.box_min_size), "handle_size" in q && t(23, S = q.handle_size), "box_thickness" in q && t(24, T = q.box_thickness), "box_selected_thickness" in q && t(25, R = q.box_selected_thickness), "disable_edit_boxes" in q && t(26, U = q.disable_edit_boxes), "single_box" in q && t(27, Z = q.single_box), "show_remove_button" in q && t(28, Q = q.show_remove_button), "handles_cursor" in q && t(29, J = q.handles_cursor), "gradio" in q && t(30, K = q.gradio); }, [ s, - p, + w, n, i, o, @@ -10006,47 +10071,47 @@ function Nm(l, e, t) { c, _, d, - m, h, - w, + m, b, + p, g, - k, - C, v, - z, + E, y, + C, + k, A, S, + T, R, - D, - N, - J, - Q, - V, U, - T, - O, + Z, + Q, + J, + K, L, - P, - he, - ie, + F, + D, + W, + $, + oe, ge, I, - Me, + Xe, M, H, G ]; } -class Km extends Sm { +class Qm extends qm { constructor(e) { - super(), Lm( + super(), Tm( this, e, - Nm, - Ym, - Dm, + Wm, + Om, + Im, { elem_id: 2, elem_classes: 3, @@ -10088,190 +10153,190 @@ class Km extends Sm { return this.$$.ctx[2]; } set elem_id(e) { - this.$$set({ elem_id: e }), Z(); + this.$$set({ elem_id: e }), V(); } get elem_classes() { return this.$$.ctx[3]; } set elem_classes(e) { - this.$$set({ elem_classes: e }), Z(); + this.$$set({ elem_classes: e }), V(); } get visible() { return this.$$.ctx[4]; } set visible(e) { - this.$$set({ visible: e }), Z(); + this.$$set({ visible: e }), V(); } get value() { return this.$$.ctx[0]; } set value(e) { - this.$$set({ value: e }), Z(); + this.$$set({ value: e }), V(); } get label() { return this.$$.ctx[5]; } set label(e) { - this.$$set({ label: e }), Z(); + this.$$set({ label: e }), V(); } get show_label() { return this.$$.ctx[6]; } set show_label(e) { - this.$$set({ show_label: e }), Z(); + this.$$set({ show_label: e }), V(); } get root() { return this.$$.ctx[7]; } set root(e) { - this.$$set({ root: e }), Z(); + this.$$set({ root: e }), V(); } get height() { return this.$$.ctx[8]; } set height(e) { - this.$$set({ height: e }), Z(); + this.$$set({ height: e }), V(); } get width() { return this.$$.ctx[9]; } set width(e) { - this.$$set({ width: e }), Z(); + this.$$set({ width: e }), V(); } get _selectable() { return this.$$.ctx[10]; } set _selectable(e) { - this.$$set({ _selectable: e }), Z(); + this.$$set({ _selectable: e }), V(); } get container() { return this.$$.ctx[11]; } set container(e) { - this.$$set({ container: e }), Z(); + this.$$set({ container: e }), V(); } get scale() { return this.$$.ctx[12]; } set scale(e) { - this.$$set({ scale: e }), Z(); + this.$$set({ scale: e }), V(); } get min_width() { return this.$$.ctx[13]; } set min_width(e) { - this.$$set({ min_width: e }), Z(); + this.$$set({ min_width: e }), V(); } get loading_status() { return this.$$.ctx[1]; } set loading_status(e) { - this.$$set({ loading_status: e }), Z(); + this.$$set({ loading_status: e }), V(); } get sources() { return this.$$.ctx[14]; } set sources(e) { - this.$$set({ sources: e }), Z(); + this.$$set({ sources: e }), V(); } get show_download_button() { return this.$$.ctx[15]; } set show_download_button(e) { - this.$$set({ show_download_button: e }), Z(); + this.$$set({ show_download_button: e }), V(); } get show_share_button() { return this.$$.ctx[16]; } set show_share_button(e) { - this.$$set({ show_share_button: e }), Z(); + this.$$set({ show_share_button: e }), V(); } get show_clear_button() { return this.$$.ctx[17]; } set show_clear_button(e) { - this.$$set({ show_clear_button: e }), Z(); + this.$$set({ show_clear_button: e }), V(); } get interactive() { return this.$$.ctx[18]; } set interactive(e) { - this.$$set({ interactive: e }), Z(); + this.$$set({ interactive: e }), V(); } get boxes_alpha() { return this.$$.ctx[19]; } set boxes_alpha(e) { - this.$$set({ boxes_alpha: e }), Z(); + this.$$set({ boxes_alpha: e }), V(); } get label_list() { return this.$$.ctx[20]; } set label_list(e) { - this.$$set({ label_list: e }), Z(); + this.$$set({ label_list: e }), V(); } get label_colors() { return this.$$.ctx[21]; } set label_colors(e) { - this.$$set({ label_colors: e }), Z(); + this.$$set({ label_colors: e }), V(); } get box_min_size() { return this.$$.ctx[22]; } set box_min_size(e) { - this.$$set({ box_min_size: e }), Z(); + this.$$set({ box_min_size: e }), V(); } get handle_size() { return this.$$.ctx[23]; } set handle_size(e) { - this.$$set({ handle_size: e }), Z(); + this.$$set({ handle_size: e }), V(); } get box_thickness() { return this.$$.ctx[24]; } set box_thickness(e) { - this.$$set({ box_thickness: e }), Z(); + this.$$set({ box_thickness: e }), V(); } get box_selected_thickness() { return this.$$.ctx[25]; } set box_selected_thickness(e) { - this.$$set({ box_selected_thickness: e }), Z(); + this.$$set({ box_selected_thickness: e }), V(); } get disable_edit_boxes() { return this.$$.ctx[26]; } set disable_edit_boxes(e) { - this.$$set({ disable_edit_boxes: e }), Z(); + this.$$set({ disable_edit_boxes: e }), V(); } get single_box() { return this.$$.ctx[27]; } set single_box(e) { - this.$$set({ single_box: e }), Z(); + this.$$set({ single_box: e }), V(); } get show_remove_button() { return this.$$.ctx[28]; } set show_remove_button(e) { - this.$$set({ show_remove_button: e }), Z(); + this.$$set({ show_remove_button: e }), V(); } get handles_cursor() { return this.$$.ctx[29]; } set handles_cursor(e) { - this.$$set({ handles_cursor: e }), Z(); + this.$$set({ handles_cursor: e }), V(); } get gradio() { return this.$$.ctx[30]; } set gradio(e) { - this.$$set({ gradio: e }), Z(); + this.$$set({ gradio: e }), V(); } } export { - Zm as BaseExample, - Km as default + Jm as BaseExample, + Qm as default };