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: pa,
- assign: va,
- create_slot: ka,
- detach: ya,
- element: Ca,
- get_all_dirty_from_scope: Sa,
- get_slot_changes: za,
- get_spread_update: Ba,
- init: qa,
- insert: Ea,
- safe_not_equal: Ma,
- set_dynamic_element_data: Ti,
- set_style: ve,
- toggle_class: Ve,
- transition_in: ds,
- transition_out: hs,
- update_slot_base: Aa
+ 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
} = window.__gradio__svelte__internal;
-function La(l) {
+function Sr(l) {
let e, t, n;
const i = (
/*#slots*/
l[18].default
- ), o = ka(
+ ), o = hr(
i,
l,
/*$$scope*/
@@ -44,38 +44,38 @@ function La(l) {
}
], r = {};
for (let a = 0; a < s.length; a += 1)
- r = va(r, s[a]);
+ r = dr(r, s[a]);
return {
c() {
- e = Ca(
+ e = gr(
/*tag*/
l[14]
- ), o && o.c(), Ti(
+ ), o && o.c(), _o(
/*tag*/
l[14]
- )(e, r), Ve(
+ )(e, r), Qe(
e,
"hidden",
/*visible*/
l[10] === !1
- ), Ve(
+ ), Qe(
e,
"padded",
/*padding*/
l[6]
- ), Ve(
+ ), Qe(
e,
"border_focus",
/*border_mode*/
l[5] === "focus"
- ), Ve(
+ ), Qe(
e,
"border_contrast",
/*border_mode*/
l[5] === "contrast"
- ), Ve(e, "hide-container", !/*explicit_call*/
+ ), Qe(e, "hide-container", !/*explicit_call*/
l[8] && !/*container*/
- l[9]), ve(
+ l[9]), De(
e,
"height",
/*get_dimension*/
@@ -83,7 +83,7 @@ function La(l) {
/*height*/
l[0]
)
- ), ve(e, "width", typeof /*width*/
+ ), De(e, "width", typeof /*width*/
l[1] == "number" ? `calc(min(${/*width*/
l[1]}px, 100%))` : (
/*get_dimension*/
@@ -91,50 +91,50 @@ function La(l) {
/*width*/
l[1]
)
- )), ve(
+ )), De(
e,
"border-style",
/*variant*/
l[4]
- ), ve(
+ ), De(
e,
"overflow",
/*allow_overflow*/
l[11] ? "visible" : "hidden"
- ), ve(
+ ), De(
e,
"flex-grow",
/*scale*/
l[12]
- ), ve(e, "min-width", `calc(min(${/*min_width*/
- l[13]}px, 100%))`), ve(e, "border-width", "var(--block-border-width)");
+ ), De(e, "min-width", `calc(min(${/*min_width*/
+ l[13]}px, 100%))`), De(e, "border-width", "var(--block-border-width)");
},
m(a, f) {
- Ea(a, e, f), o && o.m(e, null), n = !0;
+ kr(a, e, f), o && o.m(e, null), n = !0;
},
p(a, f) {
o && o.p && (!n || f & /*$$scope*/
- 131072) && Aa(
+ 131072) && Cr(
o,
i,
a,
/*$$scope*/
a[17],
- n ? za(
+ n ? wr(
i,
/*$$scope*/
a[17],
f,
null
- ) : Sa(
+ ) : br(
/*$$scope*/
a[17]
),
null
- ), Ti(
+ ), _o(
/*tag*/
a[14]
- )(e, r = Ba(s, [
+ )(e, r = pr(s, [
(!n || f & /*test_id*/
128) && { "data-testid": (
/*test_id*/
@@ -148,30 +148,30 @@ function La(l) {
(!n || f & /*elem_classes*/
8 && t !== (t = "block " + /*elem_classes*/
a[3].join(" ") + " svelte-nl1om8")) && { class: t }
- ])), Ve(
+ ])), Qe(
e,
"hidden",
/*visible*/
a[10] === !1
- ), Ve(
+ ), Qe(
e,
"padded",
/*padding*/
a[6]
- ), Ve(
+ ), Qe(
e,
"border_focus",
/*border_mode*/
a[5] === "focus"
- ), Ve(
+ ), Qe(
e,
"border_contrast",
/*border_mode*/
a[5] === "contrast"
- ), Ve(e, "hide-container", !/*explicit_call*/
+ ), Qe(e, "hide-container", !/*explicit_call*/
a[8] && !/*container*/
a[9]), f & /*height*/
- 1 && ve(
+ 1 && De(
e,
"height",
/*get_dimension*/
@@ -180,7 +180,7 @@ function La(l) {
a[0]
)
), f & /*width*/
- 2 && ve(e, "width", typeof /*width*/
+ 2 && De(e, "width", typeof /*width*/
a[1] == "number" ? `calc(min(${/*width*/
a[1]}px, 100%))` : (
/*get_dimension*/
@@ -189,42 +189,42 @@ function La(l) {
a[1]
)
)), f & /*variant*/
- 16 && ve(
+ 16 && De(
e,
"border-style",
/*variant*/
a[4]
), f & /*allow_overflow*/
- 2048 && ve(
+ 2048 && De(
e,
"overflow",
/*allow_overflow*/
a[11] ? "visible" : "hidden"
), f & /*scale*/
- 4096 && ve(
+ 4096 && De(
e,
"flex-grow",
/*scale*/
a[12]
), f & /*min_width*/
- 8192 && ve(e, "min-width", `calc(min(${/*min_width*/
+ 8192 && De(e, "min-width", `calc(min(${/*min_width*/
a[13]}px, 100%))`);
},
i(a) {
- n || (ds(o, a), n = !0);
+ n || (na(o, a), n = !0);
},
o(a) {
- hs(o, a), n = !1;
+ la(o, a), n = !1;
},
d(a) {
- a && ya(e), o && o.d(a);
+ a && mr(e), o && o.d(a);
}
};
}
-function Ra(l) {
+function zr(l) {
let e, t = (
/*tag*/
- l[14] && La(l)
+ l[14] && Sr(l)
);
return {
c() {
@@ -238,28 +238,28 @@ function Ra(l) {
n[14] && t.p(n, i);
},
i(n) {
- e || (ds(t, n), e = !0);
+ e || (na(t, n), e = !0);
},
o(n) {
- hs(t, n), e = !1;
+ la(t, n), e = !1;
},
d(n) {
t && t.d(n);
}
};
}
-function Da(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: b = !0 } = e, { visible: w = !0 } = e, { allow_overflow: g = !0 } = e, { scale: p = null } = e, { min_width: m = 0 } = e, k = _ === "fieldset" ? "fieldset" : "div";
- const y = (C) => {
- if (C !== void 0) {
- if (typeof C == "number")
- return C + "px";
- if (typeof C == "string")
- return C;
+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;
}
};
- return l.$$set = (C) => {
- "height" in C && t(0, o = C.height), "width" in C && t(1, s = C.width), "elem_id" in C && t(2, r = C.elem_id), "elem_classes" in C && t(3, a = C.elem_classes), "variant" in C && t(4, f = C.variant), "border_mode" in C && t(5, u = C.border_mode), "padding" in C && t(6, c = C.padding), "type" in C && t(16, _ = C.type), "test_id" in C && t(7, d = C.test_id), "explicit_call" in C && t(8, h = C.explicit_call), "container" in C && t(9, b = C.container), "visible" in C && t(10, w = C.visible), "allow_overflow" in C && t(11, g = C.allow_overflow), "scale" in C && t(12, p = C.scale), "min_width" in C && t(13, m = C.min_width), "$$scope" in C && t(17, i = C.$$scope);
+ 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);
}, [
o,
s,
@@ -269,22 +269,22 @@ function Da(l, e, t) {
u,
c,
d,
+ m,
h,
- b,
+ p,
w,
+ b,
g,
- p,
- m,
k,
- y,
+ C,
_,
i,
n
];
}
-class Ta extends pa {
+class Br extends _r {
constructor(e) {
- super(), qa(this, e, Da, Ra, Ma, {
+ super(), vr(this, e, qr, zr, yr, {
height: 0,
width: 1,
elem_id: 2,
@@ -304,26 +304,26 @@ class Ta extends pa {
}
}
const {
- SvelteComponent: Ia,
- attr: Ha,
- create_slot: ja,
- detach: Fa,
- element: Xa,
- get_all_dirty_from_scope: Ya,
- get_slot_changes: Ua,
- init: Va,
- insert: Na,
- safe_not_equal: Oa,
- transition_in: Wa,
- transition_out: Pa,
- update_slot_base: Za
+ 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
} = window.__gradio__svelte__internal;
-function Ka(l) {
+function Nr(l) {
let e, t;
const n = (
/*#slots*/
l[1].default
- ), i = ja(
+ ), i = Ar(
n,
l,
/*$$scope*/
@@ -332,26 +332,26 @@ function Ka(l) {
);
return {
c() {
- e = Xa("div"), i && i.c(), Ha(e, "class", "svelte-1hnfib2");
+ e = Dr("div"), i && i.c(), Mr(e, "class", "svelte-1hnfib2");
},
m(o, s) {
- Na(o, e, s), i && i.m(e, null), t = !0;
+ jr(o, e, s), i && i.m(e, null), t = !0;
},
p(o, [s]) {
i && i.p && (!t || s & /*$$scope*/
- 1) && Za(
+ 1) && Yr(
i,
n,
o,
/*$$scope*/
o[0],
- t ? Ua(
+ t ? Tr(
n,
/*$$scope*/
o[0],
s,
null
- ) : Ya(
+ ) : Rr(
/*$$scope*/
o[0]
),
@@ -359,65 +359,65 @@ function Ka(l) {
);
},
i(o) {
- t || (Wa(i, o), t = !0);
+ t || (Fr(i, o), t = !0);
},
o(o) {
- Pa(i, o), t = !1;
+ Xr(i, o), t = !1;
},
d(o) {
- o && Fa(e), i && i.d(o);
+ o && Lr(e), i && i.d(o);
}
};
}
-function Ga(l, e, t) {
+function Ur(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
return l.$$set = (o) => {
"$$scope" in o && t(0, i = o.$$scope);
}, [i, n];
}
-class Ja extends Ia {
+class Or extends Er {
constructor(e) {
- super(), Va(this, e, Ga, Ka, Oa, {});
+ super(), Ir(this, e, Ur, Nr, Hr, {});
}
}
const {
- SvelteComponent: Qa,
- attr: Ii,
- check_outros: xa,
- create_component: $a,
- create_slot: er,
- destroy_component: tr,
- detach: xn,
- element: nr,
- empty: lr,
- get_all_dirty_from_scope: ir,
- get_slot_changes: or,
- group_outros: sr,
- init: ar,
- insert: $n,
- mount_component: rr,
- safe_not_equal: fr,
- set_data: ur,
- space: cr,
- text: _r,
- toggle_class: Xt,
- transition_in: _n,
- transition_out: el,
- update_slot_base: dr
+ SvelteComponent: Wr,
+ attr: ho,
+ check_outros: Vr,
+ create_component: Pr,
+ create_slot: Zr,
+ destroy_component: Kr,
+ detach: vl,
+ element: Gr,
+ empty: Jr,
+ get_all_dirty_from_scope: Qr,
+ get_slot_changes: xr,
+ group_outros: $r,
+ init: ef,
+ insert: kl,
+ mount_component: tf,
+ safe_not_equal: nf,
+ set_data: lf,
+ space: of,
+ text: sf,
+ toggle_class: nn,
+ transition_in: Mn,
+ transition_out: yl,
+ update_slot_base: af
} = window.__gradio__svelte__internal;
-function Hi(l) {
+function mo(l) {
let e, t;
- return e = new Ja({
+ return e = new Or({
props: {
- $$slots: { default: [hr] },
+ $$slots: { default: [rf] },
$$scope: { ctx: l }
}
}), {
c() {
- $a(e.$$.fragment);
+ Pr(e.$$.fragment);
},
m(n, i) {
- rr(e, n, i), t = !0;
+ tf(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -425,47 +425,47 @@ function Hi(l) {
10 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
},
i(n) {
- t || (_n(e.$$.fragment, n), t = !0);
+ t || (Mn(e.$$.fragment, n), t = !0);
},
o(n) {
- el(e.$$.fragment, n), t = !1;
+ yl(e.$$.fragment, n), t = !1;
},
d(n) {
- tr(e, n);
+ Kr(e, n);
}
};
}
-function hr(l) {
+function rf(l) {
let e;
return {
c() {
- e = _r(
+ e = sf(
/*info*/
l[1]
);
},
m(t, n) {
- $n(t, e, n);
+ kl(t, e, n);
},
p(t, n) {
n & /*info*/
- 2 && ur(
+ 2 && lf(
e,
/*info*/
t[1]
);
},
d(t) {
- t && xn(e);
+ t && vl(e);
}
};
}
-function mr(l) {
+function ff(l) {
let e, t, n, i;
const o = (
/*#slots*/
l[2].default
- ), s = er(
+ ), s = Zr(
o,
l,
/*$$scope*/
@@ -474,13 +474,13 @@ function mr(l) {
);
let r = (
/*info*/
- l[1] && Hi(l)
+ l[1] && mo(l)
);
return {
c() {
- e = nr("span"), s && s.c(), t = cr(), r && r.c(), n = lr(), Ii(e, "data-testid", "block-info"), Ii(e, "class", "svelte-22c38v"), Xt(e, "sr-only", !/*show_label*/
- l[0]), Xt(e, "hide", !/*show_label*/
- l[0]), Xt(
+ 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*/
+ l[0]), nn(e, "hide", !/*show_label*/
+ l[0]), nn(
e,
"has-info",
/*info*/
@@ -488,100 +488,100 @@ function mr(l) {
);
},
m(a, f) {
- $n(a, e, f), s && s.m(e, null), $n(a, t, f), r && r.m(a, f), $n(a, n, f), i = !0;
+ kl(a, e, f), s && s.m(e, null), kl(a, t, f), r && r.m(a, f), kl(a, n, f), i = !0;
},
p(a, [f]) {
s && s.p && (!i || f & /*$$scope*/
- 8) && dr(
+ 8) && af(
s,
o,
a,
/*$$scope*/
a[3],
- i ? or(
+ i ? xr(
o,
/*$$scope*/
a[3],
f,
null
- ) : ir(
+ ) : Qr(
/*$$scope*/
a[3]
),
null
), (!i || f & /*show_label*/
- 1) && Xt(e, "sr-only", !/*show_label*/
+ 1) && nn(e, "sr-only", !/*show_label*/
a[0]), (!i || f & /*show_label*/
- 1) && Xt(e, "hide", !/*show_label*/
+ 1) && nn(e, "hide", !/*show_label*/
a[0]), (!i || f & /*info*/
- 2) && Xt(
+ 2) && nn(
e,
"has-info",
/*info*/
a[1] != null
), /*info*/
a[1] ? r ? (r.p(a, f), f & /*info*/
- 2 && _n(r, 1)) : (r = Hi(a), r.c(), _n(r, 1), r.m(n.parentNode, n)) : r && (sr(), el(r, 1, 1, () => {
+ 2 && Mn(r, 1)) : (r = mo(a), r.c(), Mn(r, 1), r.m(n.parentNode, n)) : r && ($r(), yl(r, 1, 1, () => {
r = null;
- }), xa());
+ }), Vr());
},
i(a) {
- i || (_n(s, a), _n(r), i = !0);
+ i || (Mn(s, a), Mn(r), i = !0);
},
o(a) {
- el(s, a), el(r), i = !1;
+ yl(s, a), yl(r), i = !1;
},
d(a) {
- a && (xn(e), xn(t), xn(n)), s && s.d(a), r && r.d(a);
+ a && (vl(e), vl(t), vl(n)), s && s.d(a), r && r.d(a);
}
};
}
-function gr(l, e, t) {
+function uf(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 ms extends Qa {
+class ia extends Wr {
constructor(e) {
- super(), ar(this, e, gr, mr, fr, { show_label: 0, info: 1 });
+ super(), ef(this, e, uf, ff, nf, { show_label: 0, info: 1 });
}
}
const {
- SvelteComponent: br,
- append: Rl,
- attr: Fn,
- create_component: wr,
- destroy_component: pr,
- detach: vr,
- element: ji,
- init: kr,
- insert: yr,
- mount_component: Cr,
- safe_not_equal: Sr,
- set_data: zr,
- space: Br,
- text: qr,
- toggle_class: nt,
- transition_in: Er,
- transition_out: Mr
+ SvelteComponent: cf,
+ append: ti,
+ attr: il,
+ 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: pt,
+ transition_in: yf,
+ transition_out: Cf
} = window.__gradio__svelte__internal;
-function Ar(l) {
+function Sf(l) {
let e, t, n, i, o, s;
return n = new /*Icon*/
l[1]({}), {
c() {
- e = ji("label"), t = ji("span"), wr(n.$$.fragment), i = Br(), o = qr(
+ e = go("label"), t = go("span"), _f(n.$$.fragment), i = vf(), o = kf(
/*label*/
l[0]
- ), Fn(t, "class", "svelte-9gxdi0"), Fn(e, "for", ""), Fn(e, "data-testid", "block-label"), Fn(e, "class", "svelte-9gxdi0"), nt(e, "hide", !/*show_label*/
- l[2]), nt(e, "sr-only", !/*show_label*/
- l[2]), nt(
+ ), il(t, "class", "svelte-9gxdi0"), il(e, "for", ""), il(e, "data-testid", "block-label"), il(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]
- ), nt(
+ ), pt(
e,
"hide-label",
/*disable*/
@@ -589,26 +589,26 @@ function Ar(l) {
);
},
m(r, a) {
- yr(r, e, a), Rl(e, t), Cr(n, t, null), Rl(e, i), Rl(e, o), s = !0;
+ gf(r, e, a), ti(e, t), bf(n, t, null), ti(e, i), ti(e, o), s = !0;
},
p(r, [a]) {
(!s || a & /*label*/
- 1) && zr(
+ 1) && pf(
o,
/*label*/
r[0]
), (!s || a & /*show_label*/
- 4) && nt(e, "hide", !/*show_label*/
+ 4) && pt(e, "hide", !/*show_label*/
r[2]), (!s || a & /*show_label*/
- 4) && nt(e, "sr-only", !/*show_label*/
+ 4) && pt(e, "sr-only", !/*show_label*/
r[2]), (!s || a & /*float*/
- 16) && nt(
+ 16) && pt(
e,
"float",
/*float*/
r[4]
), (!s || a & /*disable*/
- 8) && nt(
+ 8) && pt(
e,
"hide-label",
/*disable*/
@@ -616,25 +616,25 @@ function Ar(l) {
);
},
i(r) {
- s || (Er(n.$$.fragment, r), s = !0);
+ s || (yf(n.$$.fragment, r), s = !0);
},
o(r) {
- Mr(n.$$.fragment, r), s = !1;
+ Cf(n.$$.fragment, r), s = !1;
},
d(r) {
- r && vr(e), pr(n);
+ r && hf(e), df(n);
}
};
}
-function Lr(l, e, t) {
+function zf(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 Rr extends br {
+class qf extends cf {
constructor(e) {
- super(), kr(this, e, Lr, Ar, Sr, {
+ super(), mf(this, e, zf, Sf, wf, {
label: 0,
Icon: 1,
show_label: 2,
@@ -644,121 +644,121 @@ class Rr extends br {
}
}
const {
- SvelteComponent: Dr,
- append: ri,
- attr: $e,
- bubble: Tr,
- create_component: Ir,
- destroy_component: Hr,
- detach: gs,
- element: fi,
- init: jr,
- insert: bs,
- listen: Fr,
- mount_component: Xr,
- safe_not_equal: Yr,
- set_data: Ur,
- set_style: Yt,
- space: Vr,
- text: Nr,
- toggle_class: he,
- transition_in: Or,
- transition_out: Wr
+ SvelteComponent: Bf,
+ append: ji,
+ attr: ut,
+ 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,
+ set_style: ln,
+ space: jf,
+ text: Hf,
+ toggle_class: ke,
+ transition_in: Ff,
+ transition_out: Xf
} = window.__gradio__svelte__internal;
-function Fi(l) {
+function bo(l) {
let e, t;
return {
c() {
- e = fi("span"), t = Nr(
+ e = Hi("span"), t = Hf(
/*label*/
l[1]
- ), $e(e, "class", "svelte-1lrphxw");
+ ), ut(e, "class", "svelte-1lrphxw");
},
m(n, i) {
- bs(n, e, i), ri(e, t);
+ sa(n, e, i), ji(e, t);
},
p(n, i) {
i & /*label*/
- 2 && Ur(
+ 2 && If(
t,
/*label*/
n[1]
);
},
d(n) {
- n && gs(e);
+ n && oa(e);
}
};
}
-function Pr(l) {
+function Yf(l) {
let e, t, n, i, o, s, r, a = (
/*show_label*/
- l[2] && Fi(l)
+ l[2] && bo(l)
);
return i = new /*Icon*/
l[0]({}), {
c() {
- e = fi("button"), a && a.c(), t = Vr(), n = fi("div"), Ir(i.$$.fragment), $e(n, "class", "svelte-1lrphxw"), he(
+ e = Hi("button"), a && a.c(), t = jf(), n = Hi("div"), Mf(i.$$.fragment), ut(n, "class", "svelte-1lrphxw"), ke(
n,
"small",
/*size*/
l[4] === "small"
- ), he(
+ ), ke(
n,
"large",
/*size*/
l[4] === "large"
- ), he(
+ ), ke(
n,
"medium",
/*size*/
l[4] === "medium"
), e.disabled = /*disabled*/
- l[7], $e(
+ l[7], ut(
e,
"aria-label",
/*label*/
l[1]
- ), $e(
+ ), ut(
e,
"aria-haspopup",
/*hasPopup*/
l[8]
- ), $e(
+ ), ut(
e,
"title",
/*label*/
l[1]
- ), $e(e, "class", "svelte-1lrphxw"), he(
+ ), ut(e, "class", "svelte-1lrphxw"), ke(
e,
"pending",
/*pending*/
l[3]
- ), he(
+ ), ke(
e,
"padded",
/*padded*/
l[5]
- ), he(
+ ), ke(
e,
"highlight",
/*highlight*/
l[6]
- ), he(
+ ), ke(
e,
"transparent",
/*transparent*/
l[9]
- ), Yt(e, "color", !/*disabled*/
+ ), ln(e, "color", !/*disabled*/
l[7] && /*_color*/
l[12] ? (
/*_color*/
l[12]
- ) : "var(--block-label-text-color)"), Yt(e, "--bg-color", /*disabled*/
+ ) : "var(--block-label-text-color)"), ln(e, "--bg-color", /*disabled*/
l[7] ? "auto" : (
/*background*/
l[10]
- )), Yt(
+ )), ln(
e,
"margin-left",
/*offset*/
@@ -766,7 +766,7 @@ function Pr(l) {
);
},
m(f, u) {
- bs(f, e, u), a && a.m(e, null), ri(e, t), ri(e, n), Xr(i, n, null), o = !0, s || (r = Fr(
+ sa(f, e, u), a && a.m(e, null), ji(e, t), ji(e, n), Rf(i, n, null), o = !0, s || (r = Df(
e,
"click",
/*click_handler*/
@@ -775,20 +775,20 @@ function Pr(l) {
},
p(f, [u]) {
/*show_label*/
- f[2] ? a ? a.p(f, u) : (a = Fi(f), a.c(), a.m(e, t)) : a && (a.d(1), a = null), (!o || u & /*size*/
- 16) && he(
+ 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(
n,
"small",
/*size*/
f[4] === "small"
), (!o || u & /*size*/
- 16) && he(
+ 16) && ke(
n,
"large",
/*size*/
f[4] === "large"
), (!o || u & /*size*/
- 16) && he(
+ 16) && ke(
n,
"medium",
/*size*/
@@ -796,60 +796,60 @@ function Pr(l) {
), (!o || u & /*disabled*/
128) && (e.disabled = /*disabled*/
f[7]), (!o || u & /*label*/
- 2) && $e(
+ 2) && ut(
e,
"aria-label",
/*label*/
f[1]
), (!o || u & /*hasPopup*/
- 256) && $e(
+ 256) && ut(
e,
"aria-haspopup",
/*hasPopup*/
f[8]
), (!o || u & /*label*/
- 2) && $e(
+ 2) && ut(
e,
"title",
/*label*/
f[1]
), (!o || u & /*pending*/
- 8) && he(
+ 8) && ke(
e,
"pending",
/*pending*/
f[3]
), (!o || u & /*padded*/
- 32) && he(
+ 32) && ke(
e,
"padded",
/*padded*/
f[5]
), (!o || u & /*highlight*/
- 64) && he(
+ 64) && ke(
e,
"highlight",
/*highlight*/
f[6]
), (!o || u & /*transparent*/
- 512) && he(
+ 512) && ke(
e,
"transparent",
/*transparent*/
f[9]
), u & /*disabled, _color*/
- 4224 && Yt(e, "color", !/*disabled*/
+ 4224 && ln(e, "color", !/*disabled*/
f[7] && /*_color*/
f[12] ? (
/*_color*/
f[12]
) : "var(--block-label-text-color)"), u & /*disabled, background*/
- 1152 && Yt(e, "--bg-color", /*disabled*/
+ 1152 && ln(e, "--bg-color", /*disabled*/
f[7] ? "auto" : (
/*background*/
f[10]
)), u & /*offset*/
- 2048 && Yt(
+ 2048 && ln(
e,
"margin-left",
/*offset*/
@@ -857,23 +857,23 @@ function Pr(l) {
);
},
i(f) {
- o || (Or(i.$$.fragment, f), o = !0);
+ o || (Ff(i.$$.fragment, f), o = !0);
},
o(f) {
- Wr(i.$$.fragment, f), o = !1;
+ Xf(i.$$.fragment, f), o = !1;
},
d(f) {
- f && gs(e), a && a.d(), Hr(i), s = !1, r();
+ f && oa(e), a && a.d(), Af(i), s = !1, r();
}
};
}
-function Zr(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: b = "var(--background-fill-primary)" } = e, { offset: w = 0 } = e;
- function g(p) {
- Tr.call(this, l, p);
+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);
}
- 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, b = p.background), "offset" in p && t(11, w = p.offset);
+ 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);
}, l.$$.update = () => {
l.$$.dirty & /*highlight, color*/
8256 && t(12, n = u ? "var(--color-accent)" : d);
@@ -887,17 +887,17 @@ function Zr(l, e, t) {
u,
c,
_,
+ m,
h,
- b,
- w,
+ p,
n,
d,
- g
+ w
];
}
-class vl extends Dr {
+class Ol extends Bf {
constructor(e) {
- super(), jr(this, e, Zr, Pr, Yr, {
+ super(), Lf(this, e, Nf, Yf, Tf, {
Icon: 0,
label: 1,
show_label: 2,
@@ -915,29 +915,29 @@ class vl extends Dr {
}
}
const {
- SvelteComponent: Kr,
- append: Gr,
- attr: Dl,
- binding_callbacks: Jr,
- create_slot: Qr,
- detach: xr,
- element: Xi,
- get_all_dirty_from_scope: $r,
- get_slot_changes: ef,
- init: tf,
- insert: nf,
- safe_not_equal: lf,
- toggle_class: lt,
- transition_in: of,
- transition_out: sf,
- update_slot_base: af
+ 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: vt,
+ transition_in: xf,
+ transition_out: $f,
+ update_slot_base: eu
} = window.__gradio__svelte__internal;
-function rf(l) {
+function tu(l) {
let e, t, n;
const i = (
/*#slots*/
l[5].default
- ), o = Qr(
+ ), o = Vf(
i,
l,
/*$$scope*/
@@ -946,22 +946,22 @@ function rf(l) {
);
return {
c() {
- e = Xi("div"), t = Xi("div"), o && o.c(), Dl(t, "class", "icon svelte-3w3rth"), Dl(e, "class", "empty svelte-3w3rth"), Dl(e, "aria-label", "Empty value"), lt(
+ 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"), vt(
e,
"small",
/*size*/
l[0] === "small"
- ), lt(
+ ), vt(
e,
"large",
/*size*/
l[0] === "large"
- ), lt(
+ ), vt(
e,
"unpadded_box",
/*unpadded_box*/
l[1]
- ), lt(
+ ), vt(
e,
"small_parent",
/*parent_height*/
@@ -969,47 +969,47 @@ function rf(l) {
);
},
m(s, r) {
- nf(s, e, r), Gr(e, t), o && o.m(t, null), l[6](e), n = !0;
+ Jf(s, e, r), Of(e, t), o && o.m(t, null), l[6](e), n = !0;
},
p(s, [r]) {
o && o.p && (!n || r & /*$$scope*/
- 16) && af(
+ 16) && eu(
o,
i,
s,
/*$$scope*/
s[4],
- n ? ef(
+ n ? Kf(
i,
/*$$scope*/
s[4],
r,
null
- ) : $r(
+ ) : Zf(
/*$$scope*/
s[4]
),
null
), (!n || r & /*size*/
- 1) && lt(
+ 1) && vt(
e,
"small",
/*size*/
s[0] === "small"
), (!n || r & /*size*/
- 1) && lt(
+ 1) && vt(
e,
"large",
/*size*/
s[0] === "large"
), (!n || r & /*unpadded_box*/
- 2) && lt(
+ 2) && vt(
e,
"unpadded_box",
/*unpadded_box*/
s[1]
), (!n || r & /*parent_height*/
- 8) && lt(
+ 8) && vt(
e,
"small_parent",
/*parent_height*/
@@ -1017,26 +1017,26 @@ function rf(l) {
);
},
i(s) {
- n || (of(o, s), n = !0);
+ n || (xf(o, s), n = !0);
},
o(s) {
- sf(o, s), n = !1;
+ $f(o, s), n = !1;
},
d(s) {
- s && xr(e), o && o.d(s), l[6](null);
+ s && Pf(e), o && o.d(s), l[6](null);
}
};
}
-function ff(l, e, t) {
+function nu(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: h } = ((_ = c.parentElement) === null || _ === void 0 ? void 0 : _.getBoundingClientRect()) || { height: d };
- return d > h + 2;
+ const { height: d } = c.getBoundingClientRect(), { height: m } = ((_ = c.parentElement) === null || _ === void 0 ? void 0 : _.getBoundingClientRect()) || { height: d };
+ return d > m + 2;
}
function u(c) {
- Jr[c ? "unshift" : "push"](() => {
+ Wf[c ? "unshift" : "push"](() => {
a = c, t(2, a);
});
}
@@ -1047,310 +1047,409 @@ function ff(l, e, t) {
4 && t(3, n = f(a));
}, [s, r, a, n, o, i, u];
}
-class uf extends Kr {
+class lu extends Uf {
constructor(e) {
- super(), tf(this, e, ff, rf, lf, { size: 0, unpadded_box: 1 });
+ super(), Gf(this, e, nu, tu, Qf, { size: 0, unpadded_box: 1 });
}
}
const {
- SvelteComponent: cf,
- append: Tl,
- attr: De,
- detach: _f,
- init: df,
- insert: hf,
- noop: Il,
- safe_not_equal: mf,
- set_style: Ne,
- svg_element: Xn
+ SvelteComponent: iu,
+ append: po,
+ attr: ye,
+ detach: ou,
+ init: su,
+ insert: au,
+ noop: li,
+ safe_not_equal: ru,
+ svg_element: ii
+} = window.__gradio__svelte__internal;
+function fu(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");
+ },
+ m(i, o) {
+ au(i, e, o), po(e, t), po(e, n);
+ },
+ p: li,
+ i: li,
+ o: li,
+ d(i) {
+ i && ou(e);
+ }
+ };
+}
+class uu extends iu {
+ constructor(e) {
+ super(), su(this, e, null, fu, ru, {});
+ }
+}
+const {
+ SvelteComponent: cu,
+ append: _u,
+ attr: Oe,
+ detach: du,
+ init: hu,
+ insert: mu,
+ noop: oi,
+ safe_not_equal: gu,
+ svg_element: vo
+} = window.__gradio__svelte__internal;
+function bu(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");
+ },
+ m(n, i) {
+ mu(n, e, i), _u(e, t);
+ },
+ p: oi,
+ i: oi,
+ o: oi,
+ d(n) {
+ n && du(e);
+ }
+ };
+}
+class wu extends cu {
+ constructor(e) {
+ super(), hu(this, e, null, bu, gu, {});
+ }
+}
+const {
+ SvelteComponent: pu,
+ append: si,
+ attr: We,
+ detach: vu,
+ init: ku,
+ insert: yu,
+ noop: ai,
+ safe_not_equal: Cu,
+ set_style: xe,
+ svg_element: ol
} = window.__gradio__svelte__internal;
-function gf(l) {
+function Su(l) {
let e, t, n, i;
return {
c() {
- e = Xn("svg"), t = Xn("g"), n = Xn("path"), i = Xn("path"), De(n, "d", "M18,6L6.087,17.913"), Ne(n, "fill", "none"), Ne(n, "fill-rule", "nonzero"), Ne(n, "stroke-width", "2px"), De(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), De(i, "d", "M4.364,4.364L19.636,19.636"), Ne(i, "fill", "none"), Ne(i, "fill-rule", "nonzero"), Ne(i, "stroke-width", "2px"), De(e, "width", "100%"), De(e, "height", "100%"), De(e, "viewBox", "0 0 24 24"), De(e, "version", "1.1"), De(e, "xmlns", "http://www.w3.org/2000/svg"), De(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), De(e, "xml:space", "preserve"), De(e, "stroke", "currentColor"), Ne(e, "fill-rule", "evenodd"), Ne(e, "clip-rule", "evenodd"), Ne(e, "stroke-linecap", "round"), Ne(e, "stroke-linejoin", "round");
+ e = ol("svg"), t = ol("g"), n = ol("path"), i = ol("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");
},
m(o, s) {
- hf(o, e, s), Tl(e, t), Tl(t, n), Tl(e, i);
+ yu(o, e, s), si(e, t), si(t, n), si(e, i);
},
- p: Il,
- i: Il,
- o: Il,
+ p: ai,
+ i: ai,
+ o: ai,
d(o) {
- o && _f(e);
+ o && vu(e);
}
};
}
-class ws extends cf {
+class aa extends pu {
constructor(e) {
- super(), df(this, e, null, gf, mf, {});
+ super(), ku(this, e, null, Su, Cu, {});
}
}
const {
- SvelteComponent: bf,
- append: wf,
- attr: an,
- detach: pf,
- init: vf,
- insert: kf,
- noop: Hl,
- safe_not_equal: yf,
- svg_element: Yi
+ SvelteComponent: zu,
+ append: qu,
+ attr: Sn,
+ detach: Bu,
+ init: Eu,
+ insert: Mu,
+ noop: ri,
+ safe_not_equal: Au,
+ svg_element: ko
} = window.__gradio__svelte__internal;
-function Cf(l) {
+function Lu(l) {
let e, t;
return {
c() {
- e = Yi("svg"), t = Yi("path"), an(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"), an(t, "fill", "currentColor"), an(e, "id", "icon"), an(e, "xmlns", "http://www.w3.org/2000/svg"), an(e, "viewBox", "0 0 32 32");
+ e = ko("svg"), t = ko("path"), Sn(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"), Sn(t, "fill", "currentColor"), Sn(e, "id", "icon"), Sn(e, "xmlns", "http://www.w3.org/2000/svg"), Sn(e, "viewBox", "0 0 32 32");
},
m(n, i) {
- kf(n, e, i), wf(e, t);
+ Mu(n, e, i), qu(e, t);
},
- p: Hl,
- i: Hl,
- o: Hl,
+ p: ri,
+ i: ri,
+ o: ri,
d(n) {
- n && pf(e);
+ n && Bu(e);
}
};
}
-class Sf extends bf {
+class Du extends zu {
constructor(e) {
- super(), vf(this, e, null, Cf, yf, {});
+ super(), Eu(this, e, null, Lu, Au, {});
}
}
const {
- SvelteComponent: zf,
- append: Bf,
- attr: Ut,
- detach: qf,
- init: Ef,
- insert: Mf,
- noop: jl,
- safe_not_equal: Af,
- svg_element: Ui
+ SvelteComponent: Ru,
+ append: Tu,
+ attr: on,
+ detach: Iu,
+ init: ju,
+ insert: Hu,
+ noop: fi,
+ safe_not_equal: Fu,
+ svg_element: yo
} = window.__gradio__svelte__internal;
-function Lf(l) {
+function Xu(l) {
let e, t;
return {
c() {
- e = Ui("svg"), t = Ui("path"), Ut(t, "fill", "currentColor"), Ut(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"), Ut(e, "xmlns", "http://www.w3.org/2000/svg"), Ut(e, "width", "100%"), Ut(e, "height", "100%"), Ut(e, "viewBox", "0 0 32 32");
+ 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");
},
m(n, i) {
- Mf(n, e, i), Bf(e, t);
+ Hu(n, e, i), Tu(e, t);
},
- p: jl,
- i: jl,
- o: jl,
+ p: fi,
+ i: fi,
+ o: fi,
d(n) {
- n && qf(e);
+ n && Iu(e);
}
};
}
-class Rf extends zf {
+class Yu extends Ru {
constructor(e) {
- super(), Ef(this, e, null, Lf, Af, {});
+ super(), ju(this, e, null, Xu, Fu, {});
}
}
const {
- SvelteComponent: Df,
- append: Tf,
- attr: Vt,
- detach: If,
- init: Hf,
- insert: jf,
- noop: Fl,
- safe_not_equal: Ff,
- svg_element: Vi
+ SvelteComponent: Nu,
+ append: Uu,
+ attr: sn,
+ detach: Ou,
+ init: Wu,
+ insert: Vu,
+ noop: ui,
+ safe_not_equal: Pu,
+ svg_element: Co
} = window.__gradio__svelte__internal;
-function Xf(l) {
+function Zu(l) {
let e, t;
return {
c() {
- e = Vi("svg"), t = Vi("path"), Vt(t, "d", "M5 8l4 4 4-4z"), Vt(e, "class", "dropdown-arrow svelte-145leq6"), Vt(e, "xmlns", "http://www.w3.org/2000/svg"), Vt(e, "width", "100%"), Vt(e, "height", "100%"), Vt(e, "viewBox", "0 0 18 18");
+ 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");
},
m(n, i) {
- jf(n, e, i), Tf(e, t);
+ Vu(n, e, i), Uu(e, t);
},
- p: Fl,
- i: Fl,
- o: Fl,
+ p: ui,
+ i: ui,
+ o: ui,
d(n) {
- n && If(e);
+ n && Ou(e);
}
};
}
-class Yf extends Df {
+class to extends Nu {
constructor(e) {
- super(), Hf(this, e, null, Xf, Ff, {});
+ super(), Wu(this, e, null, Zu, Pu, {});
}
}
const {
- SvelteComponent: Uf,
- append: Xl,
- attr: x,
- detach: Vf,
- init: Nf,
- insert: Of,
- noop: Yl,
- safe_not_equal: Wf,
- svg_element: Yn
+ SvelteComponent: Ku,
+ append: ci,
+ attr: ie,
+ detach: Gu,
+ init: Ju,
+ insert: Qu,
+ noop: _i,
+ safe_not_equal: xu,
+ svg_element: sl
} = window.__gradio__svelte__internal;
-function Pf(l) {
+function $u(l) {
let e, t, n, i;
return {
c() {
- e = Yn("svg"), t = Yn("rect"), n = Yn("circle"), i = Yn("polyline"), x(t, "x", "3"), x(t, "y", "3"), x(t, "width", "18"), x(t, "height", "18"), x(t, "rx", "2"), x(t, "ry", "2"), x(n, "cx", "8.5"), x(n, "cy", "8.5"), x(n, "r", "1.5"), x(i, "points", "21 15 16 10 5 21"), x(e, "xmlns", "http://www.w3.org/2000/svg"), x(e, "width", "100%"), x(e, "height", "100%"), x(e, "viewBox", "0 0 24 24"), x(e, "fill", "none"), x(e, "stroke", "currentColor"), x(e, "stroke-width", "1.5"), x(e, "stroke-linecap", "round"), x(e, "stroke-linejoin", "round"), x(e, "class", "feather feather-image");
+ e = sl("svg"), t = sl("rect"), n = sl("circle"), i = sl("polyline"), ie(t, "x", "3"), ie(t, "y", "3"), ie(t, "width", "18"), ie(t, "height", "18"), ie(t, "rx", "2"), ie(t, "ry", "2"), ie(n, "cx", "8.5"), ie(n, "cy", "8.5"), ie(n, "r", "1.5"), ie(i, "points", "21 15 16 10 5 21"), ie(e, "xmlns", "http://www.w3.org/2000/svg"), ie(e, "width", "100%"), ie(e, "height", "100%"), ie(e, "viewBox", "0 0 24 24"), ie(e, "fill", "none"), ie(e, "stroke", "currentColor"), ie(e, "stroke-width", "1.5"), ie(e, "stroke-linecap", "round"), ie(e, "stroke-linejoin", "round"), ie(e, "class", "feather feather-image");
},
m(o, s) {
- Of(o, e, s), Xl(e, t), Xl(e, n), Xl(e, i);
+ Qu(o, e, s), ci(e, t), ci(e, n), ci(e, i);
},
- p: Yl,
- i: Yl,
- o: Yl,
+ p: _i,
+ i: _i,
+ o: _i,
d(o) {
- o && Vf(e);
+ o && Gu(e);
}
};
}
-let ps = class extends Uf {
+let ra = class extends Ku {
constructor(e) {
- super(), Nf(this, e, null, Pf, Wf, {});
+ super(), Ju(this, e, null, $u, xu, {});
}
};
const {
- SvelteComponent: Zf,
- append: Kf,
- attr: Un,
- detach: Gf,
- init: Jf,
- insert: Qf,
- noop: Ul,
- safe_not_equal: xf,
- svg_element: Ni
+ SvelteComponent: ec,
+ append: tc,
+ attr: al,
+ detach: nc,
+ init: lc,
+ insert: ic,
+ noop: di,
+ safe_not_equal: oc,
+ svg_element: So
} = window.__gradio__svelte__internal;
-function $f(l) {
+function sc(l) {
let e, t;
return {
c() {
- e = Ni("svg"), t = Ni("path"), Un(t, "fill", "currentColor"), Un(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"), Un(e, "xmlns", "http://www.w3.org/2000/svg"), Un(e, "viewBox", "0 0 24 24");
+ e = So("svg"), t = So("path"), al(t, "fill", "currentColor"), al(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"), al(e, "xmlns", "http://www.w3.org/2000/svg"), al(e, "viewBox", "0 0 24 24");
},
m(n, i) {
- Qf(n, e, i), Kf(e, t);
+ ic(n, e, i), tc(e, t);
},
- p: Ul,
- i: Ul,
- o: Ul,
+ p: di,
+ i: di,
+ o: di,
d(n) {
- n && Gf(e);
+ n && nc(e);
}
};
}
-class vs extends Zf {
+class fa extends ec {
constructor(e) {
- super(), Jf(this, e, null, $f, xf, {});
+ super(), lc(this, e, null, sc, oc, {});
}
}
const {
- SvelteComponent: eu,
- append: Vn,
- attr: $,
- detach: tu,
- init: nu,
- insert: lu,
- noop: Vl,
- safe_not_equal: iu,
- svg_element: rn
+ SvelteComponent: ac,
+ append: rl,
+ attr: oe,
+ detach: rc,
+ init: fc,
+ insert: uc,
+ noop: hi,
+ safe_not_equal: cc,
+ svg_element: zn
} = window.__gradio__svelte__internal;
-function ou(l) {
+function _c(l) {
let e, t, n, i, o;
return {
c() {
- e = rn("svg"), t = rn("path"), n = rn("path"), i = rn("line"), o = rn("line"), $(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), $(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), $(i, "x1", "12"), $(i, "y1", "19"), $(i, "x2", "12"), $(i, "y2", "23"), $(o, "x1", "8"), $(o, "y1", "23"), $(o, "x2", "16"), $(o, "y2", "23"), $(e, "xmlns", "http://www.w3.org/2000/svg"), $(e, "width", "100%"), $(e, "height", "100%"), $(e, "viewBox", "0 0 24 24"), $(e, "fill", "none"), $(e, "stroke", "currentColor"), $(e, "stroke-width", "2"), $(e, "stroke-linecap", "round"), $(e, "stroke-linejoin", "round"), $(e, "class", "feather feather-mic");
+ e = zn("svg"), t = zn("path"), n = zn("path"), i = zn("line"), o = zn("line"), oe(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), oe(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), oe(i, "x1", "12"), oe(i, "y1", "19"), oe(i, "x2", "12"), oe(i, "y2", "23"), oe(o, "x1", "8"), oe(o, "y1", "23"), oe(o, "x2", "16"), oe(o, "y2", "23"), 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", "2"), oe(e, "stroke-linecap", "round"), oe(e, "stroke-linejoin", "round"), oe(e, "class", "feather feather-mic");
},
m(s, r) {
- lu(s, e, r), Vn(e, t), Vn(e, n), Vn(e, i), Vn(e, o);
+ uc(s, e, r), rl(e, t), rl(e, n), rl(e, i), rl(e, o);
},
- p: Vl,
- i: Vl,
- o: Vl,
+ p: hi,
+ i: hi,
+ o: hi,
d(s) {
- s && tu(e);
+ s && rc(e);
+ }
+ };
+}
+class dc extends ac {
+ constructor(e) {
+ super(), fc(this, e, null, _c, cc, {});
+ }
+}
+const {
+ SvelteComponent: hc,
+ append: mc,
+ attr: Ce,
+ detach: gc,
+ init: bc,
+ insert: wc,
+ noop: mi,
+ safe_not_equal: pc,
+ svg_element: zo
+} = window.__gradio__svelte__internal;
+function vc(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");
+ },
+ m(n, i) {
+ wc(n, e, i), mc(e, t);
+ },
+ p: mi,
+ i: mi,
+ o: mi,
+ d(n) {
+ n && gc(e);
}
};
}
-class su extends eu {
+class kc extends hc {
constructor(e) {
- super(), nu(this, e, null, ou, iu, {});
+ super(), bc(this, e, null, vc, pc, {});
}
}
const {
- SvelteComponent: au,
- append: Nl,
- attr: re,
- detach: ru,
- init: fu,
- insert: uu,
- noop: Ol,
- safe_not_equal: cu,
- svg_element: Nn
+ SvelteComponent: yc,
+ append: gi,
+ attr: we,
+ detach: Cc,
+ init: Sc,
+ insert: zc,
+ noop: bi,
+ safe_not_equal: qc,
+ svg_element: fl
} = window.__gradio__svelte__internal;
-function _u(l) {
+function Bc(l) {
let e, t, n, i;
return {
c() {
- e = Nn("svg"), t = Nn("path"), n = Nn("polyline"), i = Nn("line"), re(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), re(n, "points", "17 8 12 3 7 8"), re(i, "x1", "12"), re(i, "y1", "3"), re(i, "x2", "12"), re(i, "y2", "15"), re(e, "xmlns", "http://www.w3.org/2000/svg"), re(e, "width", "90%"), re(e, "height", "90%"), re(e, "viewBox", "0 0 24 24"), re(e, "fill", "none"), re(e, "stroke", "currentColor"), re(e, "stroke-width", "2"), re(e, "stroke-linecap", "round"), re(e, "stroke-linejoin", "round"), re(e, "class", "feather feather-upload");
+ e = fl("svg"), t = fl("path"), n = fl("polyline"), i = fl("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) {
- uu(o, e, s), Nl(e, t), Nl(e, n), Nl(e, i);
+ zc(o, e, s), gi(e, t), gi(e, n), gi(e, i);
},
- p: Ol,
- i: Ol,
- o: Ol,
+ p: bi,
+ i: bi,
+ o: bi,
d(o) {
- o && ru(e);
+ o && Cc(e);
}
};
}
-let ks = class extends au {
+let ua = class extends yc {
constructor(e) {
- super(), fu(this, e, null, _u, cu, {});
+ super(), Sc(this, e, null, Bc, qc, {});
}
};
const {
- SvelteComponent: du,
- append: Oi,
- attr: it,
- detach: hu,
- init: mu,
- insert: gu,
- noop: Wl,
- safe_not_equal: bu,
- svg_element: Pl
+ SvelteComponent: Ec,
+ append: qo,
+ attr: kt,
+ detach: Mc,
+ init: Ac,
+ insert: Lc,
+ noop: wi,
+ safe_not_equal: Dc,
+ svg_element: pi
} = window.__gradio__svelte__internal;
-function wu(l) {
+function Rc(l) {
let e, t, n;
return {
c() {
- e = Pl("svg"), t = Pl("path"), n = Pl("path"), it(t, "fill", "currentColor"), it(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"), it(n, "fill", "currentColor"), it(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"), it(e, "xmlns", "http://www.w3.org/2000/svg"), it(e, "width", "100%"), it(e, "height", "100%"), it(e, "viewBox", "0 0 24 24");
+ e = pi("svg"), t = pi("path"), n = pi("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) {
- gu(i, e, o), Oi(e, t), Oi(e, n);
+ Lc(i, e, o), qo(e, t), qo(e, n);
},
- p: Wl,
- i: Wl,
- o: Wl,
+ p: wi,
+ i: wi,
+ o: wi,
d(i) {
- i && hu(e);
+ i && Mc(e);
}
};
}
-class pu extends du {
+let ca = class extends Ec {
constructor(e) {
- super(), mu(this, e, null, wu, bu, {});
+ super(), Ac(this, e, null, Rc, Dc, {});
}
-}
-const vu = [
+};
+const Tc = [
{ color: "red", primary: 600, secondary: 100 },
{ color: "green", primary: 600, secondary: 100 },
{ color: "blue", primary: 600, secondary: 100 },
@@ -1361,7 +1460,7 @@ const vu = [
{ color: "cyan", primary: 600, secondary: 100 },
{ color: "lime", primary: 500, secondary: 100 },
{ color: "pink", primary: 600, secondary: 100 }
-], Wi = {
+], Bo = {
inherit: "inherit",
current: "currentColor",
transparent: "transparent",
@@ -1654,27 +1753,27 @@ const vu = [
950: "#4c0519"
}
};
-vu.reduce(
+Tc.reduce(
(l, { color: e, primary: t, secondary: n }) => ({
...l,
[e]: {
- primary: Wi[e][t],
- secondary: Wi[e][n]
+ primary: Bo[e][t],
+ secondary: Bo[e][n]
}
}),
{}
);
-class tl extends Error {
+class Cl extends Error {
constructor(e) {
super(e), this.name = "ShareError";
}
}
-async function ku(l, e) {
+async function Ic(l, e) {
var a;
if (window.__gradio_space__ == null)
- throw new tl("Must be on Spaces to share.");
+ throw new Cl("Must be on Spaces to share.");
let t, n, i;
- t = yu(l), n = l.split(";")[0].split(":")[1], i = "file" + n.split("/")[1];
+ t = jc(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,
@@ -1686,32 +1785,32 @@ async function ku(l, e) {
if (!s.ok) {
if ((a = s.headers.get("content-type")) != null && a.includes("application/json")) {
const f = await s.json();
- throw new tl(`Upload failed: ${f.error}`);
+ throw new Cl(`Upload failed: ${f.error}`);
}
- throw new tl("Upload failed.");
+ throw new Cl("Upload failed.");
}
return await s.text();
}
-function yu(l) {
+function jc(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: Cu,
- create_component: Su,
- destroy_component: zu,
- init: Bu,
- mount_component: qu,
- safe_not_equal: Eu,
- transition_in: Mu,
- transition_out: Au
-} = window.__gradio__svelte__internal, { createEventDispatcher: Lu } = window.__gradio__svelte__internal;
-function Ru(l) {
+ 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) {
let e, t;
- return e = new vl({
+ return e = new Ol({
props: {
- Icon: Sf,
+ Icon: Du,
label: (
/*i18n*/
l[2]("common.share")
@@ -1727,10 +1826,10 @@ function Ru(l) {
l[5]
), {
c() {
- Su(e.$$.fragment);
+ Fc(e.$$.fragment);
},
m(n, i) {
- qu(e, n, i), t = !0;
+ Nc(e, n, i), t = !0;
},
p(n, [i]) {
const o = {};
@@ -1741,18 +1840,18 @@ function Ru(l) {
n[3]), e.$set(o);
},
i(n) {
- t || (Mu(e.$$.fragment, n), t = !0);
+ t || (Oc(e.$$.fragment, n), t = !0);
},
o(n) {
- Au(e.$$.fragment, n), t = !1;
+ Wc(e.$$.fragment, n), t = !1;
},
d(n) {
- zu(e, n);
+ Xc(e, n);
}
};
}
-function Du(l, e, t) {
- const n = Lu();
+function Zc(l, e, t) {
+ const n = Vc();
let { formatter: i } = e, { value: o } = e, { i18n: s } = e, r = !1;
const a = async () => {
try {
@@ -1761,7 +1860,7 @@ function Du(l, e, t) {
n("share", { description: f });
} catch (f) {
console.error(f);
- let u = f instanceof tl ? f.message : "Share failed.";
+ let u = f instanceof Cl ? f.message : "Share failed.";
n("error", u);
} finally {
t(3, r = !1);
@@ -1771,73 +1870,73 @@ function Du(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 Tu extends Cu {
+class Kc extends Hc {
constructor(e) {
- super(), Bu(this, e, Du, Ru, Eu, { formatter: 0, value: 1, i18n: 2 });
+ super(), Yc(this, e, Zc, Pc, Uc, { formatter: 0, value: 1, i18n: 2 });
}
}
const {
- SvelteComponent: Iu,
- append: Et,
- attr: ui,
- check_outros: Hu,
- create_component: ys,
- destroy_component: Cs,
- detach: nl,
- element: ci,
- group_outros: ju,
- init: Fu,
- insert: ll,
- mount_component: Ss,
- safe_not_equal: Xu,
- set_data: _i,
- space: di,
- text: dn,
- toggle_class: Pi,
- transition_in: rl,
- transition_out: fl
+ SvelteComponent: Gc,
+ append: Vt,
+ attr: Fi,
+ check_outros: Jc,
+ create_component: _a,
+ destroy_component: da,
+ detach: Sl,
+ element: Xi,
+ group_outros: Qc,
+ init: xc,
+ insert: zl,
+ mount_component: ha,
+ safe_not_equal: $c,
+ set_data: Yi,
+ space: Ni,
+ text: An,
+ toggle_class: Eo,
+ transition_in: Al,
+ transition_out: Ll
} = window.__gradio__svelte__internal;
-function Yu(l) {
+function e_(l) {
let e, t;
- return e = new ks({}), {
+ return e = new ua({}), {
c() {
- ys(e.$$.fragment);
+ _a(e.$$.fragment);
},
m(n, i) {
- Ss(e, n, i), t = !0;
+ ha(e, n, i), t = !0;
},
i(n) {
- t || (rl(e.$$.fragment, n), t = !0);
+ t || (Al(e.$$.fragment, n), t = !0);
},
o(n) {
- fl(e.$$.fragment, n), t = !1;
+ Ll(e.$$.fragment, n), t = !1;
},
d(n) {
- Cs(e, n);
+ da(e, n);
}
};
}
-function Uu(l) {
+function t_(l) {
let e, t;
- return e = new vs({}), {
+ return e = new fa({}), {
c() {
- ys(e.$$.fragment);
+ _a(e.$$.fragment);
},
m(n, i) {
- Ss(e, n, i), t = !0;
+ ha(e, n, i), t = !0;
},
i(n) {
- t || (rl(e.$$.fragment, n), t = !0);
+ t || (Al(e.$$.fragment, n), t = !0);
},
o(n) {
- fl(e.$$.fragment, n), t = !1;
+ Ll(e.$$.fragment, n), t = !1;
},
d(n) {
- Cs(e, n);
+ da(e, n);
}
};
}
-function Zi(l) {
+function Mo(l) {
let e, t, n = (
/*i18n*/
l[1]("common.or") + ""
@@ -1848,25 +1947,25 @@ function Zi(l) {
), a;
return {
c() {
- e = ci("span"), t = dn("- "), i = dn(n), o = dn(" -"), s = di(), a = dn(r), ui(e, "class", "or svelte-kzcjhc");
+ e = Xi("span"), t = An("- "), i = An(n), o = An(" -"), s = Ni(), a = An(r), Fi(e, "class", "or svelte-kzcjhc");
},
m(f, u) {
- ll(f, e, u), Et(e, t), Et(e, i), Et(e, o), ll(f, s, u), ll(f, a, u);
+ zl(f, e, u), Vt(e, t), Vt(e, i), Vt(e, o), zl(f, s, u), zl(f, a, u);
},
p(f, u) {
u & /*i18n*/
2 && n !== (n = /*i18n*/
- f[1]("common.or") + "") && _i(i, n), u & /*message, i18n*/
+ f[1]("common.or") + "") && Yi(i, n), u & /*message, i18n*/
6 && r !== (r = /*message*/
(f[2] || /*i18n*/
- f[1]("upload_text.click_to_upload")) + "") && _i(a, r);
+ f[1]("upload_text.click_to_upload")) + "") && Yi(a, r);
},
d(f) {
- f && (nl(e), nl(s), nl(a));
+ f && (Sl(e), Sl(s), Sl(a));
}
};
}
-function Vu(l) {
+function n_(l) {
let e, t, n, i, o, s = (
/*i18n*/
l[1](
@@ -1878,64 +1977,64 @@ function Vu(l) {
l[5].file
) + ""
), r, a, f;
- const u = [Uu, Yu], c = [];
- function _(h, b) {
+ const u = [t_, e_], c = [];
+ function _(m, h) {
return (
/*type*/
- h[0] === "clipboard" ? 0 : 1
+ m[0] === "clipboard" ? 0 : 1
);
}
n = _(l), i = c[n] = u[n](l);
let d = (
/*mode*/
- l[3] !== "short" && Zi(l)
+ l[3] !== "short" && Mo(l)
);
return {
c() {
- e = ci("div"), t = ci("span"), i.c(), o = di(), r = dn(s), a = di(), d && d.c(), ui(t, "class", "icon-wrap svelte-kzcjhc"), Pi(
+ e = Xi("div"), t = Xi("span"), i.c(), o = Ni(), r = An(s), a = Ni(), d && d.c(), Fi(t, "class", "icon-wrap svelte-kzcjhc"), Eo(
t,
"hovered",
/*hovered*/
l[4]
- ), ui(e, "class", "wrap svelte-kzcjhc");
+ ), Fi(e, "class", "wrap svelte-kzcjhc");
},
- m(h, b) {
- ll(h, e, b), Et(e, t), c[n].m(t, null), Et(e, o), Et(e, r), Et(e, a), d && d.m(e, null), f = !0;
+ m(m, h) {
+ zl(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;
},
- p(h, [b]) {
- let w = n;
- n = _(h), n !== w && (ju(), fl(c[w], 1, 1, () => {
- c[w] = null;
- }), Hu(), i = c[n], i || (i = c[n] = u[n](h), i.c()), rl(i, 1), i.m(t, null)), (!f || b & /*hovered*/
- 16) && Pi(
+ p(m, [h]) {
+ let p = n;
+ n = _(m), n !== p && (Qc(), Ll(c[p], 1, 1, () => {
+ c[p] = null;
+ }), Jc(), i = c[n], i || (i = c[n] = u[n](m), i.c()), Al(i, 1), i.m(t, null)), (!f || h & /*hovered*/
+ 16) && Eo(
t,
"hovered",
/*hovered*/
- h[4]
- ), (!f || b & /*i18n, type*/
+ m[4]
+ ), (!f || h & /*i18n, type*/
3) && s !== (s = /*i18n*/
- h[1](
+ m[1](
/*defs*/
- h[5][
+ m[5][
/*type*/
- h[0]
+ m[0]
] || /*defs*/
- h[5].file
- ) + "") && _i(r, s), /*mode*/
- h[3] !== "short" ? d ? d.p(h, b) : (d = Zi(h), d.c(), d.m(e, null)) : d && (d.d(1), d = null);
+ 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);
},
- i(h) {
- f || (rl(i), f = !0);
+ i(m) {
+ f || (Al(i), f = !0);
},
- o(h) {
- fl(i), f = !1;
+ o(m) {
+ Ll(i), f = !1;
},
- d(h) {
- h && nl(e), c[n].d(), d && d.d();
+ d(m) {
+ m && Sl(e), c[n].d(), d && d.d();
}
};
}
-function Nu(l, e, t) {
+function l_(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",
@@ -1950,9 +2049,9 @@ function Nu(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 zs extends Iu {
+class ma extends Gc {
constructor(e) {
- super(), Fu(this, e, Nu, Vu, Xu, {
+ super(), xc(this, e, l_, n_, $c, {
type: 0,
i18n: 1,
message: 2,
@@ -1962,27 +2061,27 @@ class zs extends Iu {
}
}
const {
- SvelteComponent: Ou,
- append: Zl,
- attr: Ge,
- check_outros: hn,
- create_component: kl,
- destroy_component: yl,
- detach: nn,
- element: Dn,
- empty: Wu,
- group_outros: mn,
- init: Pu,
- insert: ln,
- listen: Cl,
- mount_component: Sl,
- safe_not_equal: Zu,
- space: Kl,
- toggle_class: ht,
- transition_in: te,
- transition_out: me
+ SvelteComponent: i_,
+ append: vi,
+ attr: it,
+ check_outros: Ln,
+ create_component: Wl,
+ destroy_component: Vl,
+ detach: wn,
+ element: $n,
+ empty: o_,
+ group_outros: Dn,
+ init: s_,
+ insert: pn,
+ listen: Pl,
+ mount_component: Zl,
+ safe_not_equal: a_,
+ space: ki,
+ toggle_class: At,
+ transition_in: fe,
+ transition_out: Se
} = window.__gradio__svelte__internal;
-function Ki(l) {
+function Ao(l) {
let e, t = (
/*sources*/
l[1].includes("upload")
@@ -1995,53 +2094,53 @@ function Ki(l) {
), r, a = (
/*sources*/
l[1].includes("clipboard")
- ), f, u = t && Gi(l), c = i && Ji(l), _ = s && Qi(l), d = a && xi(l);
+ ), f, u = t && Lo(l), c = i && Do(l), _ = s && Ro(l), d = a && To(l);
return {
c() {
- e = Dn("span"), u && u.c(), n = Kl(), c && c.c(), o = Kl(), _ && _.c(), r = Kl(), d && d.c(), Ge(e, "class", "source-selection svelte-1jp3vgd"), Ge(e, "data-testid", "source-select");
+ e = $n("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");
},
- m(h, b) {
- ln(h, e, b), u && u.m(e, null), Zl(e, n), c && c.m(e, null), Zl(e, o), _ && _.m(e, null), Zl(e, r), d && d.m(e, null), f = !0;
+ 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;
},
- p(h, b) {
- b & /*sources*/
+ p(m, h) {
+ h & /*sources*/
2 && (t = /*sources*/
- h[1].includes("upload")), t ? u ? (u.p(h, b), b & /*sources*/
- 2 && te(u, 1)) : (u = Gi(h), u.c(), te(u, 1), u.m(e, n)) : u && (mn(), me(u, 1, 1, () => {
+ m[1].includes("upload")), t ? u ? (u.p(m, h), h & /*sources*/
+ 2 && fe(u, 1)) : (u = Lo(m), u.c(), fe(u, 1), u.m(e, n)) : u && (Dn(), Se(u, 1, 1, () => {
u = null;
- }), hn()), b & /*sources*/
+ }), Ln()), h & /*sources*/
2 && (i = /*sources*/
- h[1].includes("microphone")), i ? c ? (c.p(h, b), b & /*sources*/
- 2 && te(c, 1)) : (c = Ji(h), c.c(), te(c, 1), c.m(e, o)) : c && (mn(), me(c, 1, 1, () => {
+ m[1].includes("microphone")), i ? c ? (c.p(m, h), h & /*sources*/
+ 2 && fe(c, 1)) : (c = Do(m), c.c(), fe(c, 1), c.m(e, o)) : c && (Dn(), Se(c, 1, 1, () => {
c = null;
- }), hn()), b & /*sources*/
+ }), Ln()), h & /*sources*/
2 && (s = /*sources*/
- h[1].includes("webcam")), s ? _ ? (_.p(h, b), b & /*sources*/
- 2 && te(_, 1)) : (_ = Qi(h), _.c(), te(_, 1), _.m(e, r)) : _ && (mn(), me(_, 1, 1, () => {
+ m[1].includes("webcam")), s ? _ ? (_.p(m, h), h & /*sources*/
+ 2 && fe(_, 1)) : (_ = Ro(m), _.c(), fe(_, 1), _.m(e, r)) : _ && (Dn(), Se(_, 1, 1, () => {
_ = null;
- }), hn()), b & /*sources*/
+ }), Ln()), h & /*sources*/
2 && (a = /*sources*/
- h[1].includes("clipboard")), a ? d ? (d.p(h, b), b & /*sources*/
- 2 && te(d, 1)) : (d = xi(h), d.c(), te(d, 1), d.m(e, null)) : d && (mn(), me(d, 1, 1, () => {
+ m[1].includes("clipboard")), a ? d ? (d.p(m, h), h & /*sources*/
+ 2 && fe(d, 1)) : (d = To(m), d.c(), fe(d, 1), d.m(e, null)) : d && (Dn(), Se(d, 1, 1, () => {
d = null;
- }), hn());
+ }), Ln());
},
- i(h) {
- f || (te(u), te(c), te(_), te(d), f = !0);
+ i(m) {
+ f || (fe(u), fe(c), fe(_), fe(d), f = !0);
},
- o(h) {
- me(u), me(c), me(_), me(d), f = !1;
+ o(m) {
+ Se(u), Se(c), Se(_), Se(d), f = !1;
},
- d(h) {
- h && nn(e), u && u.d(), c && c.d(), _ && _.d(), d && d.d();
+ d(m) {
+ m && wn(e), u && u.d(), c && c.d(), _ && _.d(), d && d.d();
}
};
}
-function Gi(l) {
+function Lo(l) {
let e, t, n, i, o;
- return t = new ks({}), {
+ return t = new ua({}), {
c() {
- e = Dn("button"), kl(t.$$.fragment), Ge(e, "class", "icon svelte-1jp3vgd"), Ge(e, "aria-label", "Upload file"), ht(
+ e = $n("button"), Wl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Upload file"), At(
e,
"selected",
/*active_source*/
@@ -2050,7 +2149,7 @@ function Gi(l) {
);
},
m(s, r) {
- ln(s, e, r), Sl(t, e, null), n = !0, i || (o = Cl(
+ pn(s, e, r), Zl(t, e, null), n = !0, i || (o = Pl(
e,
"click",
/*click_handler*/
@@ -2059,7 +2158,7 @@ function Gi(l) {
},
p(s, r) {
(!n || r & /*active_source*/
- 1) && ht(
+ 1) && At(
e,
"selected",
/*active_source*/
@@ -2068,21 +2167,21 @@ function Gi(l) {
);
},
i(s) {
- n || (te(t.$$.fragment, s), n = !0);
+ n || (fe(t.$$.fragment, s), n = !0);
},
o(s) {
- me(t.$$.fragment, s), n = !1;
+ Se(t.$$.fragment, s), n = !1;
},
d(s) {
- s && nn(e), yl(t), i = !1, o();
+ s && wn(e), Vl(t), i = !1, o();
}
};
}
-function Ji(l) {
+function Do(l) {
let e, t, n, i, o;
- return t = new su({}), {
+ return t = new dc({}), {
c() {
- e = Dn("button"), kl(t.$$.fragment), Ge(e, "class", "icon svelte-1jp3vgd"), Ge(e, "aria-label", "Record audio"), ht(
+ e = $n("button"), Wl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Record audio"), At(
e,
"selected",
/*active_source*/
@@ -2090,7 +2189,7 @@ function Ji(l) {
);
},
m(s, r) {
- ln(s, e, r), Sl(t, e, null), n = !0, i || (o = Cl(
+ pn(s, e, r), Zl(t, e, null), n = !0, i || (o = Pl(
e,
"click",
/*click_handler_1*/
@@ -2099,7 +2198,7 @@ function Ji(l) {
},
p(s, r) {
(!n || r & /*active_source*/
- 1) && ht(
+ 1) && At(
e,
"selected",
/*active_source*/
@@ -2107,21 +2206,21 @@ function Ji(l) {
);
},
i(s) {
- n || (te(t.$$.fragment, s), n = !0);
+ n || (fe(t.$$.fragment, s), n = !0);
},
o(s) {
- me(t.$$.fragment, s), n = !1;
+ Se(t.$$.fragment, s), n = !1;
},
d(s) {
- s && nn(e), yl(t), i = !1, o();
+ s && wn(e), Vl(t), i = !1, o();
}
};
}
-function Qi(l) {
+function Ro(l) {
let e, t, n, i, o;
- return t = new pu({}), {
+ return t = new ca({}), {
c() {
- e = Dn("button"), kl(t.$$.fragment), Ge(e, "class", "icon svelte-1jp3vgd"), Ge(e, "aria-label", "Capture from camera"), ht(
+ e = $n("button"), Wl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Capture from camera"), At(
e,
"selected",
/*active_source*/
@@ -2129,7 +2228,7 @@ function Qi(l) {
);
},
m(s, r) {
- ln(s, e, r), Sl(t, e, null), n = !0, i || (o = Cl(
+ pn(s, e, r), Zl(t, e, null), n = !0, i || (o = Pl(
e,
"click",
/*click_handler_2*/
@@ -2138,7 +2237,7 @@ function Qi(l) {
},
p(s, r) {
(!n || r & /*active_source*/
- 1) && ht(
+ 1) && At(
e,
"selected",
/*active_source*/
@@ -2146,21 +2245,21 @@ function Qi(l) {
);
},
i(s) {
- n || (te(t.$$.fragment, s), n = !0);
+ n || (fe(t.$$.fragment, s), n = !0);
},
o(s) {
- me(t.$$.fragment, s), n = !1;
+ Se(t.$$.fragment, s), n = !1;
},
d(s) {
- s && nn(e), yl(t), i = !1, o();
+ s && wn(e), Vl(t), i = !1, o();
}
};
}
-function xi(l) {
+function To(l) {
let e, t, n, i, o;
- return t = new vs({}), {
+ return t = new fa({}), {
c() {
- e = Dn("button"), kl(t.$$.fragment), Ge(e, "class", "icon svelte-1jp3vgd"), Ge(e, "aria-label", "Paste from clipboard"), ht(
+ e = $n("button"), Wl(t.$$.fragment), it(e, "class", "icon svelte-1jp3vgd"), it(e, "aria-label", "Paste from clipboard"), At(
e,
"selected",
/*active_source*/
@@ -2168,7 +2267,7 @@ function xi(l) {
);
},
m(s, r) {
- ln(s, e, r), Sl(t, e, null), n = !0, i || (o = Cl(
+ pn(s, e, r), Zl(t, e, null), n = !0, i || (o = Pl(
e,
"click",
/*click_handler_3*/
@@ -2177,7 +2276,7 @@ function xi(l) {
},
p(s, r) {
(!n || r & /*active_source*/
- 1) && ht(
+ 1) && At(
e,
"selected",
/*active_source*/
@@ -2185,86 +2284,86 @@ function xi(l) {
);
},
i(s) {
- n || (te(t.$$.fragment, s), n = !0);
+ n || (fe(t.$$.fragment, s), n = !0);
},
o(s) {
- me(t.$$.fragment, s), n = !1;
+ Se(t.$$.fragment, s), n = !1;
},
d(s) {
- s && nn(e), yl(t), i = !1, o();
+ s && wn(e), Vl(t), i = !1, o();
}
};
}
-function Ku(l) {
+function r_(l) {
let e, t, n = (
/*unique_sources*/
- l[2].length > 1 && Ki(l)
+ l[2].length > 1 && Ao(l)
);
return {
c() {
- n && n.c(), e = Wu();
+ n && n.c(), e = o_();
},
m(i, o) {
- n && n.m(i, o), ln(i, e, o), t = !0;
+ n && n.m(i, o), pn(i, e, o), t = !0;
},
p(i, [o]) {
/*unique_sources*/
i[2].length > 1 ? n ? (n.p(i, o), o & /*unique_sources*/
- 4 && te(n, 1)) : (n = Ki(i), n.c(), te(n, 1), n.m(e.parentNode, e)) : n && (mn(), me(n, 1, 1, () => {
+ 4 && fe(n, 1)) : (n = Ao(i), n.c(), fe(n, 1), n.m(e.parentNode, e)) : n && (Dn(), Se(n, 1, 1, () => {
n = null;
- }), hn());
+ }), Ln());
},
i(i) {
- t || (te(n), t = !0);
+ t || (fe(n), t = !0);
},
o(i) {
- me(n), t = !1;
+ Se(n), t = !1;
},
d(i) {
- i && nn(e), n && n.d(i);
+ i && wn(e), n && n.d(i);
}
};
}
-function Gu(l, e, t) {
+function f_(l, e, t) {
let n;
- var i = this && this.__awaiter || function(h, b, w, g) {
- function p(m) {
- return m instanceof w ? m : new w(function(k) {
- k(m);
+ var i = this && this.__awaiter || function(m, h, p, w) {
+ function b(g) {
+ return g instanceof p ? g : new p(function(k) {
+ k(g);
});
}
- return new (w || (w = Promise))(function(m, k) {
- function y(v) {
+ return new (p || (p = Promise))(function(g, k) {
+ function C(y) {
try {
- B(g.next(v));
- } catch (q) {
- k(q);
+ z(w.next(y));
+ } catch (A) {
+ k(A);
}
}
- function C(v) {
+ function v(y) {
try {
- B(g.throw(v));
- } catch (q) {
- k(q);
+ z(w.throw(y));
+ } catch (A) {
+ k(A);
}
}
- function B(v) {
- v.done ? m(v.value) : p(v.value).then(y, C);
+ function z(y) {
+ y.done ? g(y.value) : b(y.value).then(C, v);
}
- B((g = g.apply(h, b || [])).next());
+ z((w = w.apply(m, h || [])).next());
});
};
let { sources: o } = e, { active_source: s } = e, { handle_clear: r = () => {
} } = e, { handle_select: a = () => {
} } = e;
- function f(h) {
+ function f(m) {
return i(this, void 0, void 0, function* () {
- r(), t(0, s = h), a(h);
+ r(), t(0, s = m), a(m);
});
}
const u = () => f("upload"), c = () => f("microphone"), _ = () => f("webcam"), d = () => f("clipboard");
- 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);
+ 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);
}, l.$$.update = () => {
l.$$.dirty & /*sources*/
2 && t(2, n = [...new Set(o)]);
@@ -2281,9 +2380,9 @@ function Gu(l, e, t) {
d
];
}
-class Ju extends Ou {
+class u_ extends i_ {
constructor(e) {
- super(), Pu(this, e, Gu, Ku, Zu, {
+ super(), s_(this, e, f_, r_, a_, {
sources: 1,
active_source: 0,
handle_clear: 4,
@@ -2291,19 +2390,20 @@ class Ju extends Ou {
});
}
}
-function Qt(l) {
+function dn(l) {
let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
for (; l > 1e3 && t < e.length - 1; )
l /= 1e3, t++;
let n = e[t];
return (Number.isInteger(l) ? l : l.toFixed(1)) + n;
}
-function il() {
+function ql() {
}
-function Qu(l, e) {
+const c_ = (l) => l;
+function __(l, e) {
return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function";
}
-function $i(l) {
+function Io(l) {
const e = typeof l == "string" && l.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);
return e ? [parseFloat(e[1]), e[2] || "px"] : [
/** @type {number} */
@@ -2311,210 +2411,219 @@ function $i(l) {
"px"
];
}
-const Bs = typeof window < "u";
-let eo = Bs ? () => window.performance.now() : () => Date.now(), qs = Bs ? (l) => requestAnimationFrame(l) : il;
-const en = /* @__PURE__ */ new Set();
-function Es(l) {
- en.forEach((e) => {
- e.c(l) || (en.delete(e), e.f());
- }), en.size !== 0 && qs(Es);
+const ga = typeof window < "u";
+let jo = ga ? () => window.performance.now() : () => Date.now(), ba = ga ? (l) => requestAnimationFrame(l) : ql;
+const gn = /* @__PURE__ */ new Set();
+function wa(l) {
+ gn.forEach((e) => {
+ e.c(l) || (gn.delete(e), e.f());
+ }), gn.size !== 0 && ba(wa);
}
-function xu(l) {
+function d_(l) {
let e;
- return en.size === 0 && qs(Es), {
+ return gn.size === 0 && ba(wa), {
promise: new Promise((t) => {
- en.add(e = { c: l, f: t });
+ gn.add(e = { c: l, f: t });
}),
abort() {
- en.delete(e);
+ gn.delete(e);
}
};
}
-function $u(l) {
+function h_(l) {
const e = l - 1;
return e * e * e + 1;
}
-function to(l, { delay: e = 0, duration: t = 400, easing: n = $u, 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, _] = $i(i), [d, h] = $i(o);
+function m_(l, { delay: e = 0, duration: t = 400, easing: n = c_ } = {}) {
+ const i = +getComputedStyle(l).opacity;
+ return {
+ delay: e,
+ duration: t,
+ easing: n,
+ 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);
return {
delay: e,
duration: t,
easing: n,
- css: (b, w) => `
- transform: ${f} translate(${(1 - b) * c}${_}, ${(1 - b) * d}${h});
- opacity: ${a - u * w}`
+ css: (h, p) => `
+ transform: ${f} translate(${(1 - h) * c}${_}, ${(1 - h) * d}${m});
+ opacity: ${a - u * p}`
};
}
-const Nt = [];
-function ec(l, e = il) {
+const an = [];
+function g_(l, e = ql) {
let t;
const n = /* @__PURE__ */ new Set();
function i(r) {
- if (Qu(l, r) && (l = r, t)) {
- const a = !Nt.length;
+ if (__(l, r) && (l = r, t)) {
+ const a = !an.length;
for (const f of n)
- f[1](), Nt.push(f, l);
+ f[1](), an.push(f, l);
if (a) {
- for (let f = 0; f < Nt.length; f += 2)
- Nt[f][0](Nt[f + 1]);
- Nt.length = 0;
+ for (let f = 0; f < an.length; f += 2)
+ an[f][0](an[f + 1]);
+ an.length = 0;
}
}
}
function o(r) {
i(r(l));
}
- function s(r, a = il) {
+ function s(r, a = ql) {
const f = [r, a];
- return n.add(f), n.size === 1 && (t = e(i, o) || il), r(l), () => {
+ return n.add(f), n.size === 1 && (t = e(i, o) || ql), r(l), () => {
n.delete(f), n.size === 0 && t && (t(), t = null);
};
}
return { set: i, update: o, subscribe: s };
}
-function no(l) {
+function Fo(l) {
return Object.prototype.toString.call(l) === "[object Date]";
}
-function hi(l, e, t, n) {
- if (typeof t == "number" || no(t)) {
+function Ui(l, e, t, n) {
+ if (typeof t == "number" || Fo(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, no(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, Fo(t) ? new Date(t.getTime() + f) : t + f);
} else {
if (Array.isArray(t))
return t.map(
- (i, o) => hi(l, e[o], t[o], n[o])
+ (i, o) => Ui(l, e[o], t[o], n[o])
);
if (typeof t == "object") {
const i = {};
for (const o in t)
- i[o] = hi(l, e[o], t[o], n[o]);
+ i[o] = Ui(l, e[o], t[o], n[o]);
return i;
} else
throw new Error(`Cannot spring ${typeof t} values`);
}
}
-function lo(l, e = {}) {
- const t = ec(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e;
+function Xo(l, e = {}) {
+ const t = g_(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 h(w, g = {}) {
- u = w;
- const p = a = {};
- return l == null || g.hard || b.stiffness >= 1 && b.damping >= 1 ? (d = !0, s = eo(), f = w, t.set(l = u), Promise.resolve()) : (g.soft && (_ = 1 / ((g.soft === !0 ? 0.5 : +g.soft) * 60), c = 0), r || (s = eo(), d = !1, r = xu((m) => {
+ 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) => {
if (d)
return d = !1, r = null, !1;
c = Math.min(c + _, 1);
const k = {
inv_mass: c,
- opts: b,
+ opts: h,
settled: !0,
- dt: (m - s) * 60 / 1e3
- }, y = hi(k, f, l, u);
- return s = m, f = l, t.set(l = y), k.settled && (r = null), !k.settled;
- })), new Promise((m) => {
+ 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;
+ })), new Promise((g) => {
r.promise.then(() => {
- p === a && m();
+ b === a && g();
});
}));
}
- const b = {
- set: h,
- update: (w, g) => h(w(u, l), g),
+ const h = {
+ set: m,
+ update: (p, w) => m(p(u, l), w),
subscribe: t.subscribe,
stiffness: n,
damping: i,
precision: o
};
- return b;
+ return h;
}
const {
- SvelteComponent: tc,
- append: Te,
- attr: U,
- component_subscribe: io,
- detach: nc,
- element: lc,
- init: ic,
- insert: oc,
- noop: oo,
- safe_not_equal: sc,
- set_style: On,
- svg_element: Ie,
- toggle_class: so
-} = window.__gradio__svelte__internal, { onMount: ac } = window.__gradio__svelte__internal;
-function rc(l) {
+ SvelteComponent: b_,
+ append: Ve,
+ attr: W,
+ component_subscribe: Yo,
+ detach: w_,
+ element: p_,
+ init: v_,
+ insert: k_,
+ noop: No,
+ safe_not_equal: y_,
+ set_style: ul,
+ svg_element: Pe,
+ toggle_class: Uo
+} = window.__gradio__svelte__internal, { onMount: C_ } = window.__gradio__svelte__internal;
+function S_(l) {
let e, t, n, i, o, s, r, a, f, u, c, _;
return {
c() {
- e = lc("div"), t = Ie("svg"), n = Ie("g"), i = Ie("path"), o = Ie("path"), s = Ie("path"), r = Ie("path"), a = Ie("g"), f = Ie("path"), u = Ie("path"), c = Ie("path"), _ = Ie("path"), U(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), U(i, "fill", "#FF7C00"), U(i, "fill-opacity", "0.4"), U(i, "class", "svelte-43sxxs"), U(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), U(o, "fill", "#FF7C00"), U(o, "class", "svelte-43sxxs"), U(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), U(s, "fill", "#FF7C00"), U(s, "fill-opacity", "0.4"), U(s, "class", "svelte-43sxxs"), U(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), U(r, "fill", "#FF7C00"), U(r, "class", "svelte-43sxxs"), On(n, "transform", "translate(" + /*$top*/
+ 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"), ul(n, "transform", "translate(" + /*$top*/
l[1][0] + "px, " + /*$top*/
- l[1][1] + "px)"), U(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), U(f, "fill", "#FF7C00"), U(f, "fill-opacity", "0.4"), U(f, "class", "svelte-43sxxs"), U(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), U(u, "fill", "#FF7C00"), U(u, "class", "svelte-43sxxs"), U(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), U(c, "fill", "#FF7C00"), U(c, "fill-opacity", "0.4"), U(c, "class", "svelte-43sxxs"), U(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), U(_, "fill", "#FF7C00"), U(_, "class", "svelte-43sxxs"), On(a, "transform", "translate(" + /*$bottom*/
+ 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"), ul(a, "transform", "translate(" + /*$bottom*/
l[2][0] + "px, " + /*$bottom*/
- l[2][1] + "px)"), U(t, "viewBox", "-1200 -1200 3000 3000"), U(t, "fill", "none"), U(t, "xmlns", "http://www.w3.org/2000/svg"), U(t, "class", "svelte-43sxxs"), U(e, "class", "svelte-43sxxs"), so(
+ 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(
e,
"margin",
/*margin*/
l[0]
);
},
- m(d, h) {
- oc(d, e, h), Te(e, t), Te(t, n), Te(n, i), Te(n, o), Te(n, s), Te(n, r), Te(t, a), Te(a, f), Te(a, u), Te(a, c), Te(a, _);
+ 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, _);
},
- p(d, [h]) {
- h & /*$top*/
- 2 && On(n, "transform", "translate(" + /*$top*/
+ p(d, [m]) {
+ m & /*$top*/
+ 2 && ul(n, "transform", "translate(" + /*$top*/
d[1][0] + "px, " + /*$top*/
- d[1][1] + "px)"), h & /*$bottom*/
- 4 && On(a, "transform", "translate(" + /*$bottom*/
+ d[1][1] + "px)"), m & /*$bottom*/
+ 4 && ul(a, "transform", "translate(" + /*$bottom*/
d[2][0] + "px, " + /*$bottom*/
- d[2][1] + "px)"), h & /*margin*/
- 1 && so(
+ d[2][1] + "px)"), m & /*margin*/
+ 1 && Uo(
e,
"margin",
/*margin*/
d[0]
);
},
- i: oo,
- o: oo,
+ i: No,
+ o: No,
d(d) {
- d && nc(e);
+ d && w_(e);
}
};
}
-function fc(l, e, t) {
+function z_(l, e, t) {
let n, i;
- var o = this && this.__awaiter || function(d, h, b, w) {
- function g(p) {
- return p instanceof b ? p : new b(function(m) {
- m(p);
+ var o = this && this.__awaiter || function(d, m, h, p) {
+ function w(b) {
+ return b instanceof h ? b : new h(function(g) {
+ g(b);
});
}
- return new (b || (b = Promise))(function(p, m) {
- function k(B) {
+ return new (h || (h = Promise))(function(b, g) {
+ function k(z) {
try {
- C(w.next(B));
- } catch (v) {
- m(v);
+ v(p.next(z));
+ } catch (y) {
+ g(y);
}
}
- function y(B) {
+ function C(z) {
try {
- C(w.throw(B));
- } catch (v) {
- m(v);
+ v(p.throw(z));
+ } catch (y) {
+ g(y);
}
}
- function C(B) {
- B.done ? p(B.value) : g(B.value).then(k, y);
+ function v(z) {
+ z.done ? b(z.value) : w(z.value).then(k, C);
}
- C((w = w.apply(d, h || [])).next());
+ v((p = p.apply(d, m || [])).next());
});
};
let { margin: s = !0 } = e;
- const r = lo([0, 0]);
- io(l, r, (d) => t(1, n = d));
- const a = lo([0, 0]);
- io(l, a, (d) => t(2, i = d));
+ 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));
let f;
function u() {
return o(this, void 0, void 0, function* () {
@@ -2531,62 +2640,62 @@ function fc(l, e, t) {
yield Promise.all([r.set([125, 0]), a.set([-125, 0])]), c();
});
}
- return ac(() => (_(), () => f = !0)), l.$$set = (d) => {
+ return C_(() => (_(), () => f = !0)), l.$$set = (d) => {
"margin" in d && t(0, s = d.margin);
}, [s, n, i, r, a];
}
-class uc extends tc {
+class q_ extends b_ {
constructor(e) {
- super(), ic(this, e, fc, rc, sc, { margin: 0 });
+ super(), v_(this, e, z_, S_, y_, { margin: 0 });
}
}
const {
- SvelteComponent: cc,
- append: Mt,
- attr: Xe,
- binding_callbacks: ao,
- check_outros: mi,
- create_component: Ms,
- create_slot: As,
- destroy_component: Ls,
- destroy_each: Rs,
- detach: T,
- element: Ze,
- empty: on,
- ensure_array_like: ul,
- get_all_dirty_from_scope: Ds,
- get_slot_changes: Ts,
- group_outros: gi,
- init: _c,
- insert: I,
- mount_component: Is,
- noop: bi,
- safe_not_equal: dc,
- set_data: Ee,
- set_style: _t,
- space: qe,
- text: K,
- toggle_class: Be,
- transition_in: Fe,
- transition_out: Ke,
- update_slot_base: Hs
-} = window.__gradio__svelte__internal, { tick: hc } = window.__gradio__svelte__internal, { onDestroy: mc } = window.__gradio__svelte__internal, { createEventDispatcher: gc } = window.__gradio__svelte__internal, bc = (l) => ({}), ro = (l) => ({}), wc = (l) => ({}), fo = (l) => ({});
-function uo(l, e, t) {
+ SvelteComponent: B_,
+ append: Pt,
+ attr: Je,
+ binding_callbacks: Oo,
+ check_outros: Oi,
+ create_component: pa,
+ create_slot: va,
+ destroy_component: ka,
+ destroy_each: ya,
+ detach: X,
+ element: nt,
+ empty: vn,
+ ensure_array_like: Dl,
+ get_all_dirty_from_scope: Ca,
+ get_slot_changes: Sa,
+ group_outros: Wi,
+ init: E_,
+ insert: Y,
+ mount_component: za,
+ noop: Vi,
+ safe_not_equal: M_,
+ set_data: Ne,
+ set_style: Et,
+ space: Ye,
+ text: ne,
+ toggle_class: Xe,
+ 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) {
const n = l.slice();
return n[41] = e[t], n[43] = t, n;
}
-function co(l, e, t) {
+function Zo(l, e, t) {
const n = l.slice();
return n[41] = e[t], n;
}
-function pc(l) {
+function I_(l) {
let e, t, n, i, o = (
/*i18n*/
l[1]("common.error") + ""
), s, r, a;
- t = new vl({
+ t = new Ol({
props: {
- Icon: ws,
+ Icon: aa,
label: (
/*i18n*/
l[1]("common.clear")
@@ -2601,19 +2710,19 @@ function pc(l) {
const f = (
/*#slots*/
l[30].error
- ), u = As(
+ ), u = va(
f,
l,
/*$$scope*/
l[29],
- ro
+ Wo
);
return {
c() {
- e = Ze("div"), Ms(t.$$.fragment), n = qe(), i = Ze("span"), s = K(o), r = qe(), u && u.c(), Xe(e, "class", "clear-status svelte-16nch4a"), Xe(i, "class", "error svelte-16nch4a");
+ 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");
},
m(c, _) {
- I(c, e, _), Is(t, e, null), I(c, n, _), I(c, i, _), Mt(i, s), I(c, r, _), u && u.m(c, _), a = !0;
+ Y(c, e, _), za(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 = {};
@@ -2621,226 +2730,226 @@ function pc(l) {
2 && (d.label = /*i18n*/
c[1]("common.clear")), t.$set(d), (!a || _[0] & /*i18n*/
2) && o !== (o = /*i18n*/
- c[1]("common.error") + "") && Ee(s, o), u && u.p && (!a || _[0] & /*$$scope*/
- 536870912) && Hs(
+ c[1]("common.error") + "") && Ne(s, o), u && u.p && (!a || _[0] & /*$$scope*/
+ 536870912) && qa(
u,
f,
c,
/*$$scope*/
c[29],
- a ? Ts(
+ a ? Sa(
f,
/*$$scope*/
c[29],
_,
- bc
- ) : Ds(
+ R_
+ ) : Ca(
/*$$scope*/
c[29]
),
- ro
+ Wo
);
},
i(c) {
- a || (Fe(t.$$.fragment, c), Fe(u, c), a = !0);
+ a || (Ge(t.$$.fragment, c), Ge(u, c), a = !0);
},
o(c) {
- Ke(t.$$.fragment, c), Ke(u, c), a = !1;
+ lt(t.$$.fragment, c), lt(u, c), a = !1;
},
d(c) {
- c && (T(e), T(n), T(i), T(r)), Ls(t), u && u.d(c);
+ c && (X(e), X(n), X(i), X(r)), ka(t), u && u.d(c);
}
};
}
-function vc(l) {
+function j_(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" && _o(l)
+ l[6] === "full" && Ko(l)
);
- function c(m, k) {
+ function c(g, k) {
if (
/*progress*/
- m[7]
- ) return Cc;
+ g[7]
+ ) return X_;
if (
/*queue_position*/
- m[2] !== null && /*queue_size*/
- m[3] !== void 0 && /*queue_position*/
- m[2] >= 0
- ) return yc;
+ g[2] !== null && /*queue_size*/
+ g[3] !== void 0 && /*queue_position*/
+ g[2] >= 0
+ ) return F_;
if (
/*queue_position*/
- m[2] === 0
- ) return kc;
+ g[2] === 0
+ ) return H_;
}
- let _ = c(l), d = _ && _(l), h = (
+ let _ = c(l), d = _ && _(l), m = (
/*timer*/
- l[5] && go(l)
+ l[5] && Qo(l)
);
- const b = [qc, Bc], w = [];
- function g(m, k) {
+ const h = [O_, U_], p = [];
+ function w(g, k) {
return (
/*last_progress_level*/
- m[15] != null ? 0 : (
+ g[15] != null ? 0 : (
/*show_progress*/
- m[6] === "full" ? 1 : -1
+ g[6] === "full" ? 1 : -1
)
);
}
- ~(o = g(l)) && (s = w[o] = b[o](l));
- let p = !/*timer*/
- l[5] && Co(l);
+ ~(o = w(l)) && (s = p[o] = h[o](l));
+ let b = !/*timer*/
+ l[5] && is(l);
return {
c() {
- u && u.c(), e = qe(), t = Ze("div"), d && d.c(), n = qe(), h && h.c(), i = qe(), s && s.c(), r = qe(), p && p.c(), a = on(), Xe(t, "class", "progress-text svelte-16nch4a"), Be(
+ 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(
t,
"meta-text-center",
/*variant*/
l[8] === "center"
- ), Be(
+ ), Xe(
t,
"meta-text",
/*variant*/
l[8] === "default"
);
},
- m(m, k) {
- u && u.m(m, k), I(m, e, k), I(m, t, k), d && d.m(t, null), Mt(t, n), h && h.m(t, null), I(m, i, k), ~o && w[o].m(m, k), I(m, r, k), p && p.m(m, k), I(m, a, k), f = !0;
+ m(g, k) {
+ u && u.m(g, k), Y(g, e, k), Y(g, t, k), d && d.m(t, null), Pt(t, n), m && m.m(t, null), Y(g, i, k), ~o && p[o].m(g, k), Y(g, r, k), b && b.m(g, k), Y(g, a, k), f = !0;
},
- p(m, k) {
+ p(g, k) {
/*variant*/
- m[8] === "default" && /*show_eta_bar*/
- m[18] && /*show_progress*/
- m[6] === "full" ? u ? u.p(m, k) : (u = _o(m), u.c(), u.m(e.parentNode, e)) : u && (u.d(1), u = null), _ === (_ = c(m)) && d ? d.p(m, k) : (d && d.d(1), d = _ && _(m), d && (d.c(), d.m(t, n))), /*timer*/
- m[5] ? h ? h.p(m, k) : (h = go(m), h.c(), h.m(t, null)) : h && (h.d(1), h = null), (!f || k[0] & /*variant*/
- 256) && Be(
+ 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(
t,
"meta-text-center",
/*variant*/
- m[8] === "center"
+ g[8] === "center"
), (!f || k[0] & /*variant*/
- 256) && Be(
+ 256) && Xe(
t,
"meta-text",
/*variant*/
- m[8] === "default"
+ g[8] === "default"
);
- let y = o;
- o = g(m), o === y ? ~o && w[o].p(m, k) : (s && (gi(), Ke(w[y], 1, 1, () => {
- w[y] = null;
- }), mi()), ~o ? (s = w[o], s ? s.p(m, k) : (s = w[o] = b[o](m), s.c()), Fe(s, 1), s.m(r.parentNode, r)) : s = null), /*timer*/
- m[5] ? p && (gi(), Ke(p, 1, 1, () => {
- p = null;
- }), mi()) : p ? (p.p(m, k), k[0] & /*timer*/
- 32 && Fe(p, 1)) : (p = Co(m), p.c(), Fe(p, 1), p.m(a.parentNode, a));
+ 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));
},
- i(m) {
- f || (Fe(s), Fe(p), f = !0);
+ i(g) {
+ f || (Ge(s), Ge(b), f = !0);
},
- o(m) {
- Ke(s), Ke(p), f = !1;
+ o(g) {
+ lt(s), lt(b), f = !1;
},
- d(m) {
- m && (T(e), T(t), T(i), T(r), T(a)), u && u.d(m), d && d.d(), h && h.d(), ~o && w[o].d(m), p && p.d(m);
+ d(g) {
+ g && (X(e), X(t), X(i), X(r), X(a)), u && u.d(g), d && d.d(), m && m.d(), ~o && p[o].d(g), b && b.d(g);
}
};
}
-function _o(l) {
+function Ko(l) {
let e, t = `translateX(${/*eta_level*/
(l[17] || 0) * 100 - 100}%)`;
return {
c() {
- e = Ze("div"), Xe(e, "class", "eta-bar svelte-16nch4a"), _t(e, "transform", t);
+ e = nt("div"), Je(e, "class", "eta-bar svelte-16nch4a"), Et(e, "transform", t);
},
m(n, i) {
- I(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}%)`) && _t(e, "transform", t);
+ (n[17] || 0) * 100 - 100}%)`) && Et(e, "transform", t);
},
d(n) {
- n && T(e);
+ n && X(e);
}
};
}
-function kc(l) {
+function H_(l) {
let e;
return {
c() {
- e = K("processing |");
+ e = ne("processing |");
},
m(t, n) {
- I(t, e, n);
+ Y(t, e, n);
},
- p: bi,
+ p: Vi,
d(t) {
- t && T(e);
+ t && X(e);
}
};
}
-function yc(l) {
+function F_(l) {
let e, t = (
/*queue_position*/
l[2] + 1 + ""
), n, i, o, s;
return {
c() {
- e = K("queue: "), n = K(t), i = K("/"), o = K(
+ e = ne("queue: "), n = ne(t), i = ne("/"), o = ne(
/*queue_size*/
l[3]
- ), s = K(" |");
+ ), s = ne(" |");
},
m(r, a) {
- I(r, e, a), I(r, n, a), I(r, i, a), I(r, o, a), I(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 + "") && Ee(n, t), a[0] & /*queue_size*/
- 8 && Ee(
+ r[2] + 1 + "") && Ne(n, t), a[0] & /*queue_size*/
+ 8 && Ne(
o,
/*queue_size*/
r[3]
);
},
d(r) {
- r && (T(e), T(n), T(i), T(o), T(s));
+ r && (X(e), X(n), X(i), X(o), X(s));
}
};
}
-function Cc(l) {
- let e, t = ul(
+function X_(l) {
+ let e, t = Dl(
/*progress*/
l[7]
), n = [];
for (let i = 0; i < t.length; i += 1)
- n[i] = mo(co(l, t, i));
+ n[i] = Jo(Zo(l, t, i));
return {
c() {
for (let i = 0; i < n.length; i += 1)
n[i].c();
- e = on();
+ e = vn();
},
m(i, o) {
for (let s = 0; s < n.length; s += 1)
n[s] && n[s].m(i, o);
- I(i, e, o);
+ Y(i, e, o);
},
p(i, o) {
if (o[0] & /*progress*/
128) {
- t = ul(
+ t = Dl(
/*progress*/
i[7]
);
let s;
for (s = 0; s < t.length; s += 1) {
- const r = co(i, t, s);
- n[s] ? n[s].p(r, o) : (n[s] = mo(r), n[s].c(), n[s].m(e.parentNode, e));
+ 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));
}
for (; s < n.length; s += 1)
n[s].d(1);
@@ -2848,11 +2957,11 @@ function Cc(l) {
}
},
d(i) {
- i && T(e), Rs(n, i);
+ i && X(e), ya(n, i);
}
};
}
-function ho(l) {
+function Go(l) {
let e, t = (
/*p*/
l[41].unit + ""
@@ -2860,104 +2969,104 @@ function ho(l) {
function r(u, c) {
return (
/*p*/
- u[41].length != null ? zc : Sc
+ u[41].length != null ? N_ : Y_
);
}
let a = r(l), f = a(l);
return {
c() {
- f.c(), e = qe(), n = K(t), i = K(" | "), s = K(o);
+ f.c(), e = Ye(), n = ne(t), i = ne(" | "), s = ne(o);
},
m(u, c) {
- f.m(u, c), I(u, e, c), I(u, n, c), I(u, i, c), I(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 + "") && Ee(n, t);
+ u[41].unit + "") && Ne(n, t);
},
d(u) {
- u && (T(e), T(n), T(i), T(s)), f.d(u);
+ u && (X(e), X(n), X(i), X(s)), f.d(u);
}
};
}
-function Sc(l) {
- let e = Qt(
+function Y_(l) {
+ let e = dn(
/*p*/
l[41].index || 0
) + "", t;
return {
c() {
- t = K(e);
+ t = ne(e);
},
m(n, i) {
- I(n, t, i);
+ Y(n, t, i);
},
p(n, i) {
i[0] & /*progress*/
- 128 && e !== (e = Qt(
+ 128 && e !== (e = dn(
/*p*/
n[41].index || 0
- ) + "") && Ee(t, e);
+ ) + "") && Ne(t, e);
},
d(n) {
- n && T(t);
+ n && X(t);
}
};
}
-function zc(l) {
- let e = Qt(
+function N_(l) {
+ let e = dn(
/*p*/
l[41].index || 0
- ) + "", t, n, i = Qt(
+ ) + "", t, n, i = dn(
/*p*/
l[41].length
) + "", o;
return {
c() {
- t = K(e), n = K("/"), o = K(i);
+ t = ne(e), n = ne("/"), o = ne(i);
},
m(s, r) {
- I(s, t, r), I(s, n, r), I(s, o, r);
+ Y(s, t, r), Y(s, n, r), Y(s, o, r);
},
p(s, r) {
r[0] & /*progress*/
- 128 && e !== (e = Qt(
+ 128 && e !== (e = dn(
/*p*/
s[41].index || 0
- ) + "") && Ee(t, e), r[0] & /*progress*/
- 128 && i !== (i = Qt(
+ ) + "") && Ne(t, e), r[0] & /*progress*/
+ 128 && i !== (i = dn(
/*p*/
s[41].length
- ) + "") && Ee(o, i);
+ ) + "") && Ne(o, i);
},
d(s) {
- s && (T(t), T(n), T(o));
+ s && (X(t), X(n), X(o));
}
};
}
-function mo(l) {
+function Jo(l) {
let e, t = (
/*p*/
- l[41].index != null && ho(l)
+ l[41].index != null && Go(l)
);
return {
c() {
- t && t.c(), e = on();
+ t && t.c(), e = vn();
},
m(n, i) {
- t && t.m(n, i), I(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 = ho(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
+ 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);
},
d(n) {
- n && T(e), t && t.d(n);
+ n && X(e), t && t.d(n);
}
};
}
-function go(l) {
+function Qo(l) {
let e, t = (
/*eta*/
l[0] ? `/${/*formatted_eta*/
@@ -2965,43 +3074,43 @@ function go(l) {
), n, i;
return {
c() {
- e = K(
+ e = ne(
/*formatted_timer*/
l[20]
- ), n = K(t), i = K("s");
+ ), n = ne(t), i = ne("s");
},
m(o, s) {
- I(o, e, s), I(o, n, s), I(o, i, s);
+ Y(o, e, s), Y(o, n, s), Y(o, i, s);
},
p(o, s) {
s[0] & /*formatted_timer*/
- 1048576 && Ee(
+ 1048576 && Ne(
e,
/*formatted_timer*/
o[20]
), s[0] & /*eta, formatted_eta*/
524289 && t !== (t = /*eta*/
o[0] ? `/${/*formatted_eta*/
- o[19]}` : "") && Ee(n, t);
+ o[19]}` : "") && Ne(n, t);
},
d(o) {
- o && (T(e), T(n), T(i));
+ o && (X(e), X(n), X(i));
}
};
}
-function Bc(l) {
+function U_(l) {
let e, t;
- return e = new uc({
+ return e = new q_({
props: { margin: (
/*variant*/
l[8] === "default"
) }
}), {
c() {
- Ms(e.$$.fragment);
+ pa(e.$$.fragment);
},
m(n, i) {
- Is(e, n, i), t = !0;
+ za(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -3010,71 +3119,71 @@ function Bc(l) {
n[8] === "default"), e.$set(o);
},
i(n) {
- t || (Fe(e.$$.fragment, n), t = !0);
+ t || (Ge(e.$$.fragment, n), t = !0);
},
o(n) {
- Ke(e.$$.fragment, n), t = !1;
+ lt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ls(e, n);
+ ka(e, n);
}
};
}
-function qc(l) {
+function O_(l) {
let e, t, n, i, o, s = `${/*last_progress_level*/
l[15] * 100}%`, r = (
/*progress*/
- l[7] != null && bo(l)
+ l[7] != null && xo(l)
);
return {
c() {
- e = Ze("div"), t = Ze("div"), r && r.c(), n = qe(), i = Ze("div"), o = Ze("div"), Xe(t, "class", "progress-level-inner svelte-16nch4a"), Xe(o, "class", "progress-bar svelte-16nch4a"), _t(o, "width", s), Xe(i, "class", "progress-bar-wrap svelte-16nch4a"), Xe(e, "class", "progress-level svelte-16nch4a");
+ 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"), Et(o, "width", s), Je(i, "class", "progress-bar-wrap svelte-16nch4a"), Je(e, "class", "progress-level svelte-16nch4a");
},
m(a, f) {
- I(a, e, f), Mt(e, t), r && r.m(t, null), Mt(e, n), Mt(e, i), Mt(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 = bo(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 = xo(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}%`) && _t(o, "width", s);
+ a[15] * 100}%`) && Et(o, "width", s);
},
- i: bi,
- o: bi,
+ i: Vi,
+ o: Vi,
d(a) {
- a && T(e), r && r.d(), l[31](null);
+ a && X(e), r && r.d(), l[31](null);
}
};
}
-function bo(l) {
- let e, t = ul(
+function xo(l) {
+ let e, t = Dl(
/*progress*/
l[7]
), n = [];
for (let i = 0; i < t.length; i += 1)
- n[i] = yo(uo(l, t, i));
+ n[i] = ls(Po(l, t, i));
return {
c() {
for (let i = 0; i < n.length; i += 1)
n[i].c();
- e = on();
+ e = vn();
},
m(i, o) {
for (let s = 0; s < n.length; s += 1)
n[s] && n[s].m(i, o);
- I(i, e, o);
+ Y(i, e, o);
},
p(i, o) {
if (o[0] & /*progress_level, progress*/
16512) {
- t = ul(
+ t = Dl(
/*progress*/
i[7]
);
let s;
for (s = 0; s < t.length; s += 1) {
- const r = uo(i, t, s);
- n[s] ? n[s].p(r, o) : (n[s] = yo(r), n[s].c(), n[s].m(e.parentNode, e));
+ 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));
}
for (; s < n.length; s += 1)
n[s].d(1);
@@ -3082,17 +3191,17 @@ function bo(l) {
}
},
d(i) {
- i && T(e), Rs(n, i);
+ i && X(e), ya(n, i);
}
};
}
-function wo(l) {
+function $o(l) {
let e, t, n, i, o = (
/*i*/
- l[43] !== 0 && Ec()
+ l[43] !== 0 && W_()
), s = (
/*p*/
- l[41].desc != null && po(l)
+ l[41].desc != null && es(l)
), r = (
/*p*/
l[41].desc != null && /*progress_level*/
@@ -3100,85 +3209,85 @@ function wo(l) {
l[14][
/*i*/
l[43]
- ] != null && vo()
+ ] != null && ts()
), a = (
/*progress_level*/
- l[14] != null && ko(l)
+ l[14] != null && ns(l)
);
return {
c() {
- o && o.c(), e = qe(), s && s.c(), t = qe(), r && r.c(), n = qe(), a && a.c(), i = on();
+ o && o.c(), e = Ye(), s && s.c(), t = Ye(), r && r.c(), n = Ye(), a && a.c(), i = vn();
},
m(f, u) {
- o && o.m(f, u), I(f, e, u), s && s.m(f, u), I(f, t, u), r && r.m(f, u), I(f, n, u), a && a.m(f, u), I(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 = po(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 = es(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 = vo(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/
- f[14] != null ? a ? a.p(f, u) : (a = ko(f), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null);
+ ] != 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);
},
d(f) {
- f && (T(e), T(t), T(n), T(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 Ec(l) {
+function W_(l) {
let e;
return {
c() {
- e = K("Â /");
+ e = ne("Â /");
},
m(t, n) {
- I(t, e, n);
+ Y(t, e, n);
},
d(t) {
- t && T(e);
+ t && X(e);
}
};
}
-function po(l) {
+function es(l) {
let e = (
/*p*/
l[41].desc + ""
), t;
return {
c() {
- t = K(e);
+ t = ne(e);
},
m(n, i) {
- I(n, t, i);
+ Y(n, t, i);
},
p(n, i) {
i[0] & /*progress*/
128 && e !== (e = /*p*/
- n[41].desc + "") && Ee(t, e);
+ n[41].desc + "") && Ne(t, e);
},
d(n) {
- n && T(t);
+ n && X(t);
}
};
}
-function vo(l) {
+function ts(l) {
let e;
return {
c() {
- e = K("-");
+ e = ne("-");
},
m(t, n) {
- I(t, e, n);
+ Y(t, e, n);
},
d(t) {
- t && T(e);
+ t && X(e);
}
};
}
-function ko(l) {
+function ns(l) {
let e = (100 * /*progress_level*/
(l[14][
/*i*/
@@ -3186,10 +3295,10 @@ function ko(l) {
] || 0)).toFixed(1) + "", t, n;
return {
c() {
- t = K(e), n = K("%");
+ t = ne(e), n = ne("%");
},
m(i, o) {
- I(i, t, o), I(i, n, o);
+ Y(i, t, o), Y(i, n, o);
},
p(i, o) {
o[0] & /*progress_level*/
@@ -3197,14 +3306,14 @@ function ko(l) {
(i[14][
/*i*/
i[43]
- ] || 0)).toFixed(1) + "") && Ee(t, e);
+ ] || 0)).toFixed(1) + "") && Ne(t, e);
},
d(i) {
- i && (T(t), T(n));
+ i && (X(t), X(n));
}
};
}
-function yo(l) {
+function ls(l) {
let e, t = (
/*p*/
(l[41].desc != null || /*progress_level*/
@@ -3212,14 +3321,14 @@ function yo(l) {
l[14][
/*i*/
l[43]
- ] != null) && wo(l)
+ ] != null) && $o(l)
);
return {
c() {
- t && t.c(), e = on();
+ t && t.c(), e = vn();
},
m(n, i) {
- t && t.m(n, i), I(n, e, i);
+ t && t.m(n, i), Y(n, e, i);
},
p(n, i) {
/*p*/
@@ -3228,75 +3337,75 @@ function yo(l) {
n[14][
/*i*/
n[43]
- ] != null ? t ? t.p(n, i) : (t = wo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
+ ] != null ? t ? t.p(n, i) : (t = $o(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
},
d(n) {
- n && T(e), t && t.d(n);
+ n && X(e), t && t.d(n);
}
};
}
-function Co(l) {
+function is(l) {
let e, t, n, i;
const o = (
/*#slots*/
l[30]["additional-loading-text"]
- ), s = As(
+ ), s = va(
o,
l,
/*$$scope*/
l[29],
- fo
+ Vo
);
return {
c() {
- e = Ze("p"), t = K(
+ e = nt("p"), t = ne(
/*loading_text*/
l[9]
- ), n = qe(), s && s.c(), Xe(e, "class", "loading svelte-16nch4a");
+ ), n = Ye(), s && s.c(), Je(e, "class", "loading svelte-16nch4a");
},
m(r, a) {
- I(r, e, a), Mt(e, t), I(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) && Ee(
+ 512) && Ne(
t,
/*loading_text*/
r[9]
), s && s.p && (!i || a[0] & /*$$scope*/
- 536870912) && Hs(
+ 536870912) && qa(
s,
o,
r,
/*$$scope*/
r[29],
- i ? Ts(
+ i ? Sa(
o,
/*$$scope*/
r[29],
a,
- wc
- ) : Ds(
+ T_
+ ) : Ca(
/*$$scope*/
r[29]
),
- fo
+ Vo
);
},
i(r) {
- i || (Fe(s, r), i = !0);
+ i || (Ge(s, r), i = !0);
},
o(r) {
- Ke(s, r), i = !1;
+ lt(s, r), i = !1;
},
d(r) {
- r && (T(e), T(n)), s && s.d(r);
+ r && (X(e), X(n)), s && s.d(r);
}
};
}
-function Mc(l) {
+function V_(l) {
let e, t, n, i, o;
- const s = [vc, pc], r = [];
+ const s = [j_, I_], r = [];
function a(f, u) {
return (
/*status*/
@@ -3308,12 +3417,12 @@ function Mc(l) {
}
return ~(t = a(l)) && (n = r[t] = s[t](l)), {
c() {
- e = Ze("div"), n && n.c(), Xe(e, "class", i = "wrap " + /*variant*/
+ e = nt("div"), n && n.c(), Je(e, "class", i = "wrap " + /*variant*/
l[8] + " " + /*show_progress*/
- l[6] + " svelte-16nch4a"), Be(e, "hide", !/*status*/
+ l[6] + " svelte-16nch4a"), Xe(e, "hide", !/*status*/
l[4] || /*status*/
l[4] === "complete" || /*show_progress*/
- l[6] === "hidden"), Be(
+ l[6] === "hidden"), Xe(
e,
"translucent",
/*variant*/
@@ -3322,22 +3431,22 @@ function Mc(l) {
l[4] === "error") || /*translucent*/
l[11] || /*show_progress*/
l[6] === "minimal"
- ), Be(
+ ), Xe(
e,
"generating",
/*status*/
l[4] === "generating"
- ), Be(
+ ), Xe(
e,
"border",
/*border*/
l[12]
- ), _t(
+ ), Et(
e,
"position",
/*absolute*/
l[10] ? "absolute" : "static"
- ), _t(
+ ), Et(
e,
"padding",
/*absolute*/
@@ -3345,21 +3454,21 @@ function Mc(l) {
);
},
m(f, u) {
- I(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 && (gi(), Ke(r[c], 1, 1, () => {
+ t = a(f), t === c ? ~t && r[t].p(f, u) : (n && (Wi(), lt(r[c], 1, 1, () => {
r[c] = null;
- }), mi()), ~t ? (n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Fe(n, 1), n.m(e, null)) : n = null), (!o || u[0] & /*variant, show_progress*/
+ }), 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*/
320 && i !== (i = "wrap " + /*variant*/
f[8] + " " + /*show_progress*/
- f[6] + " svelte-16nch4a")) && Xe(e, "class", i), (!o || u[0] & /*variant, show_progress, status, show_progress*/
- 336) && Be(e, "hide", !/*status*/
+ f[6] + " svelte-16nch4a")) && Je(e, "class", i), (!o || u[0] & /*variant, show_progress, status, show_progress*/
+ 336) && Xe(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) && Be(
+ 2384) && Xe(
e,
"translucent",
/*variant*/
@@ -3369,25 +3478,25 @@ function Mc(l) {
f[11] || /*show_progress*/
f[6] === "minimal"
), (!o || u[0] & /*variant, show_progress, status*/
- 336) && Be(
+ 336) && Xe(
e,
"generating",
/*status*/
f[4] === "generating"
), (!o || u[0] & /*variant, show_progress, border*/
- 4416) && Be(
+ 4416) && Xe(
e,
"border",
/*border*/
f[12]
), u[0] & /*absolute*/
- 1024 && _t(
+ 1024 && Et(
e,
"position",
/*absolute*/
f[10] ? "absolute" : "static"
), u[0] & /*absolute*/
- 1024 && _t(
+ 1024 && Et(
e,
"padding",
/*absolute*/
@@ -3395,17 +3504,17 @@ function Mc(l) {
);
},
i(f) {
- o || (Fe(n), o = !0);
+ o || (Ge(n), o = !0);
},
o(f) {
- Ke(n), o = !1;
+ lt(n), o = !1;
},
d(f) {
- f && T(e), ~t && r[t].d(), l[33](null);
+ f && X(e), ~t && r[t].d(), l[33](null);
}
};
}
-var Ac = function(l, e, t, n) {
+var P_ = function(l, e, t, n) {
function i(o) {
return o instanceof t ? o : new t(function(s) {
s(o);
@@ -3432,73 +3541,73 @@ var Ac = function(l, e, t, n) {
f((n = n.apply(l, e || [])).next());
});
};
-let Wn = [], Gl = !1;
-function Lc(l) {
- return Ac(this, arguments, void 0, function* (e, t = !0) {
+let cl = [], yi = !1;
+function Z_(l) {
+ return P_(this, arguments, void 0, function* (e, t = !0) {
if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
- if (Wn.push(e), !Gl) Gl = !0;
+ if (cl.push(e), !yi) yi = !0;
else return;
- yield hc(), requestAnimationFrame(() => {
+ yield A_(), requestAnimationFrame(() => {
let n = [0, 0];
- for (let i = 0; i < Wn.length; i++) {
- const s = Wn[i].getBoundingClientRect();
+ for (let i = 0; i < cl.length; i++) {
+ const s = cl[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" }), Gl = !1, Wn = [];
+ window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), yi = !1, cl = [];
});
}
});
}
-function Rc(l, e, t) {
+function K_(l, e, t) {
let n, { $$slots: i = {}, $$scope: o } = e;
this && this.__awaiter;
- const s = gc();
- 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: b = null } = e, { progress: w = null } = e, { variant: g = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: m = !0 } = e, { translucent: k = !1 } = e, { border: y = !1 } = e, { autoscroll: C } = e, B, v = !1, q = 0, j = 0, X = null, R = null, Q = 0, O = null, P, H = null, ie = !0;
- const we = () => {
- t(0, a = t(27, X = t(19, ue = null))), t(25, q = performance.now()), t(26, j = 0), v = !0, oe();
+ 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, L = null, N = 0, J = null, x, V = null, U = !0;
+ const T = () => {
+ t(0, a = t(27, R = t(19, O = null))), t(25, A = performance.now()), t(26, S = 0), y = !0, K();
};
- function oe() {
+ function K() {
requestAnimationFrame(() => {
- t(26, j = (performance.now() - q) / 1e3), v && oe();
+ t(26, S = (performance.now() - A) / 1e3), y && K();
});
}
function D() {
- t(26, j = 0), t(0, a = t(27, X = t(19, ue = null))), v && (v = !1);
+ t(26, S = 0), t(0, a = t(27, R = t(19, O = null))), y && (y = !1);
}
- mc(() => {
- v && D();
+ L_(() => {
+ y && D();
});
- let ue = null;
- function pe(A) {
- ao[A ? "unshift" : "push"](() => {
- H = A, t(16, H), t(7, w), t(14, O), t(15, P);
+ let O = null;
+ function le(I) {
+ Oo[I ? "unshift" : "push"](() => {
+ V = I, t(16, V), t(7, p), t(14, J), t(15, x);
});
}
- const Ye = () => {
+ const ae = () => {
s("clear_status");
};
- function Ue(A) {
- ao[A ? "unshift" : "push"](() => {
- B = A, t(13, B);
+ function ue(I) {
+ Oo[I ? "unshift" : "push"](() => {
+ z = I, t(13, z);
});
}
- return l.$$set = (A) => {
- "i18n" in A && t(1, r = A.i18n), "eta" in A && t(0, a = A.eta), "queue_position" in A && t(2, f = A.queue_position), "queue_size" in A && t(3, u = A.queue_size), "status" in A && t(4, c = A.status), "scroll_to_output" in A && t(22, _ = A.scroll_to_output), "timer" in A && t(5, d = A.timer), "show_progress" in A && t(6, h = A.show_progress), "message" in A && t(23, b = A.message), "progress" in A && t(7, w = A.progress), "variant" in A && t(8, g = A.variant), "loading_text" in A && t(9, p = A.loading_text), "absolute" in A && t(10, m = A.absolute), "translucent" in A && t(11, k = A.translucent), "border" in A && t(12, y = A.border), "autoscroll" in A && t(24, C = A.autoscroll), "$$scope" in A && t(29, o = A.$$scope);
+ 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);
}, l.$$.update = () => {
l.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
- 436207617 && (a === null && t(0, a = X), a != null && X !== a && (t(28, R = (performance.now() - q) / 1e3 + a), t(19, ue = R.toFixed(1)), t(27, X = a))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/
- 335544320 && t(17, Q = R === null || R <= 0 || !j ? null : Math.min(j / R, 1)), l.$$.dirty[0] & /*progress*/
- 128 && w != null && t(18, ie = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
- 114816 && (w != null ? t(14, O = w.map((A) => {
- if (A.index != null && A.length != null)
- return A.index / A.length;
- if (A.progress != null)
- return A.progress;
- })) : t(14, O = null), O ? (t(15, P = O[O.length - 1]), H && (P === 0 ? t(16, H.style.transition = "0", H) : t(16, H.style.transition = "150ms", H))) : t(15, P = void 0)), l.$$.dirty[0] & /*status*/
- 16 && (c === "pending" ? we() : D()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
- 20979728 && B && _ && (c === "pending" || c === "complete") && Lc(B, C), l.$$.dirty[0] & /*status, message*/
+ 436207617 && (a === null && t(0, a = R), a != null && R !== a && (t(28, L = (performance.now() - A) / 1e3 + a), t(19, O = L.toFixed(1)), t(27, R = a))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/
+ 335544320 && t(17, N = L === null || L <= 0 || !S ? null : Math.min(S / L, 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) => {
+ 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, x = J[J.length - 1]), V && (x === 0 ? t(16, V.style.transition = "0", V) : t(16, V.style.transition = "150ms", V))) : t(15, x = void 0)), l.$$.dirty[0] & /*status*/
+ 16 && (c === "pending" ? T() : D()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
+ 20979728 && z && _ && (c === "pending" || c === "complete") && Z_(z, v), l.$$.dirty[0] & /*status, message*/
8388624, l.$$.dirty[0] & /*timer_diff*/
- 67108864 && t(20, n = j.toFixed(1));
+ 67108864 && t(20, n = S.toFixed(1));
}, [
a,
r,
@@ -3506,44 +3615,44 @@ function Rc(l, e, t) {
u,
c,
d,
- h,
+ m,
+ p,
w,
+ b,
g,
- p,
- m,
k,
- y,
- B,
+ C,
+ z,
+ J,
+ x,
+ V,
+ N,
+ U,
O,
- P,
- H,
- Q,
- ie,
- ue,
n,
s,
_,
- b,
- C,
- q,
- j,
- X,
+ h,
+ v,
+ A,
+ S,
R,
+ L,
o,
i,
- pe,
- Ye,
- Ue
+ le,
+ ae,
+ ue
];
}
-class Dc extends cc {
+class G_ extends B_ {
constructor(e) {
- super(), _c(
+ super(), E_(
this,
e,
- Rc,
- Mc,
- dc,
+ K_,
+ V_,
+ M_,
{
i18n: 1,
eta: 0,
@@ -3567,30 +3676,30 @@ class Dc extends cc {
);
}
}
-const { setContext: j0, getContext: Tc } = window.__gradio__svelte__internal, Ic = "WORKER_PROXY_CONTEXT_KEY";
-function js() {
- return Tc(Ic);
+const { setContext: Vm, getContext: J_ } = window.__gradio__svelte__internal, Q_ = "WORKER_PROXY_CONTEXT_KEY";
+function Ba() {
+ return J_(Q_);
}
-function Hc(l) {
+function x_(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 Fs(l, e) {
+function Ea(l, e) {
const t = e.toLowerCase();
for (const [n, i] of Object.entries(l))
if (n.toLowerCase() === t)
return i;
}
-function Xs(l) {
+function Ma(l) {
if (l == null)
return !1;
const e = new URL(l, window.location.href);
- return !(!Hc(e) || e.protocol !== "http:" && e.protocol !== "https:");
+ return !(!x_(e) || e.protocol !== "http:" && e.protocol !== "https:");
}
-async function jc(l) {
- if (l == null || !Xs(l))
+async function $_(l) {
+ if (l == null || !Ma(l))
return l;
- const e = js();
+ const e = Ba();
if (e == null)
return l;
const n = new URL(l, window.location.href).pathname;
@@ -3603,41 +3712,41 @@ async function jc(l) {
if (i.status !== 200)
throw new Error(`Failed to get file ${n} from the Wasm worker.`);
const o = new Blob([i.body], {
- type: Fs(i.headers, "content-type")
+ type: Ea(i.headers, "content-type")
});
return URL.createObjectURL(o);
});
}
const {
- SvelteComponent: Fc,
- assign: cl,
- check_outros: Ys,
- compute_rest_props: So,
- create_slot: Bi,
- detach: zl,
- element: Us,
- empty: Vs,
- exclude_internal_props: Xc,
- get_all_dirty_from_scope: qi,
- get_slot_changes: Ei,
- get_spread_update: Ns,
- group_outros: Os,
- init: Yc,
- insert: Bl,
- listen: Ws,
- prevent_default: Uc,
- safe_not_equal: Vc,
- set_attributes: _l,
- transition_in: Rt,
- transition_out: Dt,
- update_slot_base: Mi
-} = window.__gradio__svelte__internal, { createEventDispatcher: Nc } = window.__gradio__svelte__internal;
-function Oc(l) {
+ SvelteComponent: ed,
+ assign: Rl,
+ check_outros: Aa,
+ compute_rest_props: os,
+ create_slot: no,
+ detach: Kl,
+ 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: Gl,
+ listen: Ia,
+ prevent_default: ld,
+ safe_not_equal: id,
+ set_attributes: Tl,
+ transition_in: Gt,
+ transition_out: Jt,
+ update_slot_base: oo
+} = window.__gradio__svelte__internal, { createEventDispatcher: od } = window.__gradio__svelte__internal;
+function sd(l) {
let e, t, n, i, o;
const s = (
/*#slots*/
l[8].default
- ), r = Bi(
+ ), r = no(
s,
l,
/*$$scope*/
@@ -3661,13 +3770,13 @@ function Oc(l) {
l[6]
], f = {};
for (let u = 0; u < a.length; u += 1)
- f = cl(f, a[u]);
+ f = Rl(f, a[u]);
return {
c() {
- e = Us("a"), r && r.c(), _l(e, f);
+ e = La("a"), r && r.c(), Tl(e, f);
},
m(u, c) {
- Bl(u, e, c), r && r.m(e, null), n = !0, i || (o = Ws(
+ Gl(u, e, c), r && r.m(e, null), n = !0, i || (o = Ia(
e,
"click",
/*dispatch*/
@@ -3676,24 +3785,24 @@ function Oc(l) {
},
p(u, c) {
r && r.p && (!n || c & /*$$scope*/
- 128) && Mi(
+ 128) && oo(
r,
s,
u,
/*$$scope*/
u[7],
- n ? Ei(
+ n ? io(
s,
/*$$scope*/
u[7],
c,
null
- ) : qi(
+ ) : lo(
/*$$scope*/
u[7]
),
null
- ), _l(e, f = Ns(a, [
+ ), Tl(e, f = Ra(a, [
(!n || c & /*href*/
1) && { href: (
/*href*/
@@ -3712,19 +3821,19 @@ function Oc(l) {
]));
},
i(u) {
- n || (Rt(r, u), n = !0);
+ n || (Gt(r, u), n = !0);
},
o(u) {
- Dt(r, u), n = !1;
+ Jt(r, u), n = !1;
},
d(u) {
- u && zl(e), r && r.d(u), i = !1, o();
+ u && Kl(e), r && r.d(u), i = !1, o();
}
};
}
-function Wc(l) {
+function ad(l) {
let e, t, n, i;
- const o = [Zc, Pc], s = [];
+ const o = [fd, rd], s = [];
function r(a, f) {
return (
/*is_downloading*/
@@ -3733,34 +3842,34 @@ function Wc(l) {
}
return e = r(l), t = s[e] = o[e](l), {
c() {
- t.c(), n = Vs();
+ t.c(), n = Da();
},
m(a, f) {
- s[e].m(a, f), Bl(a, n, f), i = !0;
+ s[e].m(a, f), Gl(a, n, f), i = !0;
},
p(a, f) {
let u = e;
- e = r(a), e === u ? s[e].p(a, f) : (Os(), Dt(s[u], 1, 1, () => {
+ e = r(a), e === u ? s[e].p(a, f) : (Ta(), Jt(s[u], 1, 1, () => {
s[u] = null;
- }), Ys(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Rt(t, 1), t.m(n.parentNode, n));
+ }), 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));
},
i(a) {
- i || (Rt(t), i = !0);
+ i || (Gt(t), i = !0);
},
o(a) {
- Dt(t), i = !1;
+ Jt(t), i = !1;
},
d(a) {
- a && zl(n), s[e].d(a);
+ a && Kl(n), s[e].d(a);
}
};
}
-function Pc(l) {
+function rd(l) {
let e, t, n, i;
const o = (
/*#slots*/
l[8].default
- ), s = Bi(
+ ), s = no(
o,
l,
/*$$scope*/
@@ -3776,37 +3885,37 @@ function Pc(l) {
) }
], a = {};
for (let f = 0; f < r.length; f += 1)
- a = cl(a, r[f]);
+ a = Rl(a, r[f]);
return {
c() {
- e = Us("a"), s && s.c(), _l(e, a);
+ e = La("a"), s && s.c(), Tl(e, a);
},
m(f, u) {
- Bl(f, e, u), s && s.m(e, null), t = !0, n || (i = Ws(e, "click", Uc(
+ Gl(f, e, u), s && s.m(e, null), t = !0, n || (i = Ia(e, "click", ld(
/*wasm_click_handler*/
l[5]
)), n = !0);
},
p(f, u) {
s && s.p && (!t || u & /*$$scope*/
- 128) && Mi(
+ 128) && oo(
s,
o,
f,
/*$$scope*/
f[7],
- t ? Ei(
+ t ? io(
o,
/*$$scope*/
f[7],
u,
null
- ) : qi(
+ ) : lo(
/*$$scope*/
f[7]
),
null
- ), _l(e, a = Ns(r, [
+ ), Tl(e, a = Ra(r, [
u & /*$$restProps*/
64 && /*$$restProps*/
f[6],
@@ -3818,22 +3927,22 @@ function Pc(l) {
]));
},
i(f) {
- t || (Rt(s, f), t = !0);
+ t || (Gt(s, f), t = !0);
},
o(f) {
- Dt(s, f), t = !1;
+ Jt(s, f), t = !1;
},
d(f) {
- f && zl(e), s && s.d(f), n = !1, i();
+ f && Kl(e), s && s.d(f), n = !1, i();
}
};
}
-function Zc(l) {
+function fd(l) {
let e;
const t = (
/*#slots*/
l[8].default
- ), n = Bi(
+ ), n = no(
t,
l,
/*$$scope*/
@@ -3849,19 +3958,19 @@ function Zc(l) {
},
p(i, o) {
n && n.p && (!e || o & /*$$scope*/
- 128) && Mi(
+ 128) && oo(
n,
t,
i,
/*$$scope*/
i[7],
- e ? Ei(
+ e ? io(
t,
/*$$scope*/
i[7],
o,
null
- ) : qi(
+ ) : lo(
/*$$scope*/
i[7]
),
@@ -3869,85 +3978,85 @@ function Zc(l) {
);
},
i(i) {
- e || (Rt(n, i), e = !0);
+ e || (Gt(n, i), e = !0);
},
o(i) {
- Dt(n, i), e = !1;
+ Jt(n, i), e = !1;
},
d(i) {
n && n.d(i);
}
};
}
-function Kc(l) {
+function ud(l) {
let e, t, n, i, o;
- const s = [Wc, Oc], r = [];
+ const s = [ad, sd], r = [];
function a(f, u) {
return u & /*href*/
1 && (e = null), e == null && (e = !!/*worker_proxy*/
- (f[4] && Xs(
+ (f[4] && Ma(
/*href*/
f[0]
))), e ? 0 : 1;
}
return t = a(l, -1), n = r[t] = s[t](l), {
c() {
- n.c(), i = Vs();
+ n.c(), i = Da();
},
m(f, u) {
- r[t].m(f, u), Bl(f, i, u), o = !0;
+ r[t].m(f, u), Gl(f, i, u), o = !0;
},
p(f, [u]) {
let c = t;
- t = a(f, u), t === c ? r[t].p(f, u) : (Os(), Dt(r[c], 1, 1, () => {
+ t = a(f, u), t === c ? r[t].p(f, u) : (Ta(), Jt(r[c], 1, 1, () => {
r[c] = null;
- }), Ys(), n = r[t], n ? n.p(f, u) : (n = r[t] = s[t](f), n.c()), Rt(n, 1), n.m(i.parentNode, i));
+ }), 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));
},
i(f) {
- o || (Rt(n), o = !0);
+ o || (Gt(n), o = !0);
},
o(f) {
- Dt(n), o = !1;
+ Jt(n), o = !1;
},
d(f) {
- f && zl(i), r[t].d(f);
+ f && Kl(i), r[t].d(f);
}
};
}
-function Gc(l, e, t) {
+function cd(l, e, t) {
const n = ["href", "download"];
- let i = So(e, n), { $$slots: o = {}, $$scope: s } = e;
- var r = this && this.__awaiter || function(h, b, w, g) {
- function p(m) {
- return m instanceof w ? m : new w(function(k) {
- k(m);
+ 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);
});
}
- return new (w || (w = Promise))(function(m, k) {
- function y(v) {
+ return new (p || (p = Promise))(function(g, k) {
+ function C(y) {
try {
- B(g.next(v));
- } catch (q) {
- k(q);
+ z(w.next(y));
+ } catch (A) {
+ k(A);
}
}
- function C(v) {
+ function v(y) {
try {
- B(g.throw(v));
- } catch (q) {
- k(q);
+ z(w.throw(y));
+ } catch (A) {
+ k(A);
}
}
- function B(v) {
- v.done ? m(v.value) : p(v.value).then(y, C);
+ function z(y) {
+ y.done ? g(y.value) : b(y.value).then(C, v);
}
- B((g = g.apply(h, b || [])).next());
+ z((w = w.apply(m, h || [])).next());
});
};
let { href: a = void 0 } = e, { download: f } = e;
- const u = Nc();
+ const u = od();
let c = !1;
- const _ = js();
+ const _ = Ba();
function d() {
return r(this, void 0, void 0, function* () {
if (c)
@@ -3956,29 +4065,29 @@ function Gc(l, e, t) {
throw new Error("href is not defined.");
if (_ == null)
throw new Error("Wasm worker proxy is not available.");
- const b = new URL(a, window.location.href).pathname;
+ const h = new URL(a, window.location.href).pathname;
t(2, c = !0), _.httpRequest({
method: "GET",
- path: b,
+ path: h,
headers: {},
query_string: ""
- }).then((w) => {
- if (w.status !== 200)
- throw new Error(`Failed to get file ${b} from the Wasm worker.`);
- const g = new Blob(
- [w.body],
+ }).then((p) => {
+ if (p.status !== 200)
+ throw new Error(`Failed to get file ${h} from the Wasm worker.`);
+ const w = new Blob(
+ [p.body],
{
- type: Fs(w.headers, "content-type")
+ type: Ea(p.headers, "content-type")
}
- ), p = URL.createObjectURL(g), m = document.createElement("a");
- m.href = p, m.download = f, m.click(), URL.revokeObjectURL(p);
+ ), b = URL.createObjectURL(w), g = document.createElement("a");
+ g.href = b, g.download = f, g.click(), URL.revokeObjectURL(b);
}).finally(() => {
t(2, c = !1);
});
});
}
- return l.$$set = (h) => {
- e = cl(cl({}, e), Xc(h)), t(6, i = So(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);
+ return l.$$set = (m) => {
+ e = Rl(Rl({}, 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);
}, [
a,
f,
@@ -3991,23 +4100,23 @@ function Gc(l, e, t) {
o
];
}
-class Jc extends Fc {
+class _d extends ed {
constructor(e) {
- super(), Yc(this, e, Gc, Kc, Vc, { href: 0, download: 1 });
+ super(), nd(this, e, cd, ud, id, { href: 0, download: 1 });
}
}
-var Qc = Object.defineProperty, xc = (l, e, t) => e in l ? Qc(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, Qe = (l, e, t) => (xc(l, typeof e != "symbol" ? e + "" : e, t), t), Ps = (l, e, t) => {
+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, rt = (l, e, t) => (hd(l, typeof e != "symbol" ? e + "" : e, t), t), ja = (l, e, t) => {
if (!e.has(l))
throw TypeError("Cannot " + t);
-}, fn = (l, e, t) => (Ps(l, e, "read from private field"), t ? t.call(l) : e.get(l)), $c = (l, e, t) => {
+}, qn = (l, e, t) => (ja(l, e, "read from private field"), t ? t.call(l) : e.get(l)), md = (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);
-}, e_ = (l, e, t, n) => (Ps(l, e, "write to private field"), e.set(l, t), t), rt;
+}, gd = (l, e, t, n) => (ja(l, e, "write to private field"), e.set(l, t), t), zt;
new Intl.Collator(0, { numeric: 1 }).compare;
-async function t_(l, e) {
+async function Ha(l, e) {
return l.map(
- (t) => new n_({
+ (t) => new bd({
path: t.name,
orig_name: t.name,
blob: t,
@@ -4017,7 +4126,7 @@ async function t_(l, e) {
})
);
}
-class n_ {
+class bd {
constructor({
path: e,
url: t,
@@ -4028,16 +4137,16 @@ class n_ {
mime_type: r,
alt_text: a
}) {
- Qe(this, "path"), Qe(this, "url"), Qe(this, "orig_name"), Qe(this, "size"), Qe(this, "blob"), Qe(this, "is_stream"), Qe(this, "mime_type"), Qe(this, "alt_text"), Qe(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = i, this.blob = t ? void 0 : o, this.is_stream = s, this.mime_type = r, this.alt_text = a;
+ rt(this, "path"), rt(this, "url"), rt(this, "orig_name"), rt(this, "size"), rt(this, "blob"), rt(this, "is_stream"), rt(this, "mime_type"), rt(this, "alt_text"), rt(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = i, this.blob = t ? void 0 : o, this.is_stream = s, this.mime_type = r, this.alt_text = a;
}
}
typeof process < "u" && process.versions && process.versions.node;
-class F0 extends TransformStream {
+class Pm extends TransformStream {
/** Constructs a new instance. */
constructor(e = { allowCR: !1 }) {
super({
transform: (t, n) => {
- for (t = fn(this, rt) + 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)) {
@@ -4049,36 +4158,36 @@ class F0 extends TransformStream {
const s = t[i - 1] === "\r" ? i - 1 : i;
n.enqueue(t.slice(0, s)), t = t.slice(i + 1);
}
- e_(this, rt, t);
+ gd(this, zt, t);
},
flush: (t) => {
- if (fn(this, rt) === "")
+ if (qn(this, zt) === "")
return;
- const n = e.allowCR && fn(this, rt).endsWith("\r") ? fn(this, rt).slice(0, -1) : fn(this, rt);
+ const n = e.allowCR && qn(this, zt).endsWith("\r") ? qn(this, zt).slice(0, -1) : qn(this, zt);
t.enqueue(n);
}
- }), $c(this, rt, "");
+ }), md(this, zt, "");
}
}
-rt = /* @__PURE__ */ new WeakMap();
+zt = /* @__PURE__ */ new WeakMap();
const {
- SvelteComponent: l_,
- append: be,
- attr: St,
- detach: Zs,
- element: zt,
- init: i_,
- insert: Ks,
- noop: zo,
- safe_not_equal: o_,
- set_data: dl,
- set_style: Jl,
- space: wi,
- text: xt,
- toggle_class: Bo
-} = window.__gradio__svelte__internal, { onMount: s_, createEventDispatcher: a_, onDestroy: r_ } = window.__gradio__svelte__internal;
-function qo(l) {
- let e, t, n, i, o = gn(
+ SvelteComponent: wd,
+ append: qe,
+ attr: Nt,
+ detach: Fa,
+ element: Ut,
+ init: pd,
+ insert: Xa,
+ noop: ss,
+ safe_not_equal: vd,
+ set_data: Il,
+ set_style: Ci,
+ space: Pi,
+ text: hn,
+ toggle_class: as
+} = window.__gradio__svelte__internal, { onMount: kd, createEventDispatcher: yd, onDestroy: Cd } = window.__gradio__svelte__internal;
+function rs(l) {
+ let e, t, n, i, o = Rn(
/*file_to_display*/
l[2]
) + "", s, r, a, f, u = (
@@ -4087,33 +4196,33 @@ function qo(l) {
), c;
return {
c() {
- e = zt("div"), t = zt("span"), n = zt("div"), i = zt("progress"), s = xt(o), a = wi(), f = zt("span"), c = xt(u), Jl(i, "visibility", "hidden"), Jl(i, "height", "0"), Jl(i, "width", "0"), i.value = r = gn(
+ 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 = Rn(
/*file_to_display*/
l[2]
- ), St(i, "max", "100"), St(i, "class", "svelte-cr2edf"), St(n, "class", "progress-bar svelte-cr2edf"), St(f, "class", "file-name svelte-cr2edf"), St(e, "class", "file svelte-cr2edf");
+ ), 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) {
- Ks(_, e, d), be(e, t), be(t, n), be(n, i), be(i, s), be(e, a), be(e, f), be(f, c);
+ Xa(_, 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 = gn(
+ 4 && o !== (o = Rn(
/*file_to_display*/
_[2]
- ) + "") && dl(s, o), d & /*file_to_display*/
- 4 && r !== (r = gn(
+ ) + "") && Il(s, o), d & /*file_to_display*/
+ 4 && r !== (r = Rn(
/*file_to_display*/
_[2]
)) && (i.value = r), d & /*file_to_display*/
4 && u !== (u = /*file_to_display*/
- _[2].orig_name + "") && dl(c, u);
+ _[2].orig_name + "") && Il(c, u);
},
d(_) {
- _ && Zs(e);
+ _ && Fa(e);
}
};
}
-function f_(l) {
+function Sd(l) {
let e, t, n, i = (
/*files_with_progress*/
l[0].length + ""
@@ -4122,11 +4231,11 @@ function f_(l) {
l[0].length > 1 ? "files" : "file"
), a, f, u, c = (
/*file_to_display*/
- l[2] && qo(l)
+ l[2] && rs(l)
);
return {
c() {
- e = zt("div"), t = zt("span"), n = xt("Uploading "), o = xt(i), s = wi(), a = xt(r), f = xt("..."), u = wi(), c && c.c(), St(t, "class", "uploading svelte-cr2edf"), St(e, "class", "wrap svelte-cr2edf"), Bo(
+ 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,
"progress",
/*progress*/
@@ -4134,87 +4243,87 @@ function f_(l) {
);
},
m(_, d) {
- Ks(_, e, d), be(e, t), be(t, n), be(t, o), be(t, s), be(t, a), be(t, f), be(e, u), c && c.m(e, null);
+ 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);
},
p(_, [d]) {
d & /*files_with_progress*/
1 && i !== (i = /*files_with_progress*/
- _[0].length + "") && dl(o, i), d & /*files_with_progress*/
+ _[0].length + "") && Il(o, i), d & /*files_with_progress*/
1 && r !== (r = /*files_with_progress*/
- _[0].length > 1 ? "files" : "file") && dl(a, r), /*file_to_display*/
- _[2] ? c ? c.p(_, d) : (c = qo(_), c.c(), c.m(e, null)) : c && (c.d(1), c = null), d & /*progress*/
- 2 && Bo(
+ _[0].length > 1 ? "files" : "file") && Il(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(
e,
"progress",
/*progress*/
_[1]
);
},
- i: zo,
- o: zo,
+ i: ss,
+ o: ss,
d(_) {
- _ && Zs(e), c && c.d();
+ _ && Fa(e), c && c.d();
}
};
}
-function gn(l) {
+function Rn(l) {
return l.progress * 100 / (l.size || 0) || 0;
}
-function u_(l) {
+function zd(l) {
let e = 0;
return l.forEach((t) => {
- e += gn(t);
+ e += Rn(t);
}), document.documentElement.style.setProperty("--upload-progress-width", (e / l.length).toFixed(2) + "%"), e / l.length;
}
-function c_(l, e, t) {
- var n = this && this.__awaiter || function(b, w, g, p) {
- function m(k) {
- return k instanceof g ? k : new g(function(y) {
- y(k);
+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);
});
}
- return new (g || (g = Promise))(function(k, y) {
- function C(q) {
+ return new (w || (w = Promise))(function(k, C) {
+ function v(A) {
try {
- v(p.next(q));
- } catch (j) {
- y(j);
+ y(b.next(A));
+ } catch (S) {
+ C(S);
}
}
- function B(q) {
+ function z(A) {
try {
- v(p.throw(q));
- } catch (j) {
- y(j);
+ y(b.throw(A));
+ } catch (S) {
+ C(S);
}
}
- function v(q) {
- q.done ? k(q.value) : m(q.value).then(C, B);
+ function y(A) {
+ A.done ? k(A.value) : g(A.value).then(v, z);
}
- v((p = p.apply(b, w || [])).next());
+ y((b = b.apply(h, p || [])).next());
});
};
- let { upload_id: i } = e, { root: o } = e, { files: s } = e, { stream_handler: r } = e, a, f = !1, u, c, _ = s.map((b) => Object.assign(Object.assign({}, b), { progress: 0 }));
- const d = a_();
- function h(b, w) {
- t(0, _ = _.map((g) => (g.orig_name === b && (g.progress += w), g)));
+ 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)));
}
- return s_(() => n(void 0, void 0, void 0, function* () {
+ return kd(() => 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(b) {
+ a.onmessage = function(h) {
return n(this, void 0, void 0, function* () {
- const w = JSON.parse(b.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));
+ 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));
});
};
- })), r_(() => {
+ })), Cd(() => {
(a != null || a != null) && a.close();
- }), l.$$set = (b) => {
- "upload_id" in b && t(3, i = b.upload_id), "root" in b && t(4, o = b.root), "files" in b && t(5, s = b.files), "stream_handler" in b && t(6, r = b.stream_handler);
+ }), 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.$$.update = () => {
l.$$.dirty & /*files_with_progress*/
- 1 && u_(_), l.$$.dirty & /*current_file_upload, files_with_progress*/
+ 1 && zd(_), l.$$.dirty & /*current_file_upload, files_with_progress*/
129 && t(2, c = u || _[0]);
}, [
_,
@@ -4227,9 +4336,9 @@ function c_(l, e, t) {
u
];
}
-class __ extends l_ {
+class Bd extends wd {
constructor(e) {
- super(), i_(this, e, c_, f_, o_, {
+ super(), pd(this, e, qd, Sd, vd, {
upload_id: 3,
root: 4,
files: 5,
@@ -4238,42 +4347,42 @@ class __ extends l_ {
}
}
const {
- SvelteComponent: d_,
- append: Eo,
- attr: fe,
- binding_callbacks: h_,
- bubble: wt,
- check_outros: Gs,
- create_component: m_,
- create_slot: Js,
- destroy_component: g_,
- detach: ql,
- element: pi,
- empty: Qs,
- get_all_dirty_from_scope: xs,
- get_slot_changes: $s,
- group_outros: ea,
- init: b_,
- insert: El,
- listen: ke,
- mount_component: w_,
- prevent_default: pt,
- run_all: p_,
- safe_not_equal: v_,
- set_style: ta,
- space: k_,
- stop_propagation: vt,
- toggle_class: le,
- transition_in: dt,
- transition_out: Tt,
- update_slot_base: na
-} = window.__gradio__svelte__internal, { createEventDispatcher: y_, tick: C_ } = window.__gradio__svelte__internal;
-function S_(l) {
+ SvelteComponent: Ed,
+ append: fs,
+ attr: pe,
+ binding_callbacks: Md,
+ bubble: Dt,
+ check_outros: Ya,
+ create_component: Ad,
+ create_slot: Na,
+ destroy_component: Ld,
+ detach: Jl,
+ element: Zi,
+ empty: Ua,
+ get_all_dirty_from_scope: Oa,
+ get_slot_changes: Wa,
+ group_outros: Va,
+ init: Dd,
+ insert: Ql,
+ listen: Re,
+ mount_component: Rd,
+ prevent_default: Rt,
+ run_all: Td,
+ safe_not_equal: Id,
+ set_style: Pa,
+ space: jd,
+ stop_propagation: Tt,
+ 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) {
let e, t, n, i, o, s, r, a, f, u, c;
const _ = (
/*#slots*/
l[26].default
- ), d = Js(
+ ), d = Na(
_,
l,
/*$$scope*/
@@ -4282,93 +4391,93 @@ function S_(l) {
);
return {
c() {
- e = pi("button"), d && d.c(), t = k_(), n = pi("input"), fe(n, "aria-label", "file upload"), fe(n, "data-testid", "file-upload"), fe(n, "type", "file"), fe(n, "accept", i = /*accept_file_types*/
+ 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*/
l[16] || void 0), n.multiple = o = /*file_count*/
- l[6] === "multiple" || void 0, fe(n, "webkitdirectory", s = /*file_count*/
- l[6] === "directory" || void 0), fe(n, "mozdirectory", r = /*file_count*/
- l[6] === "directory" || void 0), fe(n, "class", "svelte-1s26xmt"), fe(e, "tabindex", a = /*hidden*/
- l[9] ? -1 : 0), fe(e, "class", "svelte-1s26xmt"), le(
+ 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"), de(
e,
"hidden",
/*hidden*/
l[9]
- ), le(
+ ), de(
e,
"center",
/*center*/
l[4]
- ), le(
+ ), de(
e,
"boundedheight",
/*boundedheight*/
l[3]
- ), le(
+ ), de(
e,
"flex",
/*flex*/
l[5]
- ), le(
+ ), de(
e,
"disable_click",
/*disable_click*/
l[7]
- ), ta(e, "height", "100%");
+ ), Pa(e, "height", "100%");
},
- m(h, b) {
- El(h, e, b), d && d.m(e, null), Eo(e, t), Eo(e, n), l[34](n), f = !0, u || (c = [
- ke(
+ m(m, h) {
+ Ql(m, e, h), d && d.m(e, null), fs(e, t), fs(e, n), l[34](n), f = !0, u || (c = [
+ Re(
n,
"change",
/*load_files_from_upload*/
l[18]
),
- ke(e, "drag", vt(pt(
+ Re(e, "drag", Tt(Rt(
/*drag_handler*/
l[27]
))),
- ke(e, "dragstart", vt(pt(
+ Re(e, "dragstart", Tt(Rt(
/*dragstart_handler*/
l[28]
))),
- ke(e, "dragend", vt(pt(
+ Re(e, "dragend", Tt(Rt(
/*dragend_handler*/
l[29]
))),
- ke(e, "dragover", vt(pt(
+ Re(e, "dragover", Tt(Rt(
/*dragover_handler*/
l[30]
))),
- ke(e, "dragenter", vt(pt(
+ Re(e, "dragenter", Tt(Rt(
/*dragenter_handler*/
l[31]
))),
- ke(e, "dragleave", vt(pt(
+ Re(e, "dragleave", Tt(Rt(
/*dragleave_handler*/
l[32]
))),
- ke(e, "drop", vt(pt(
+ Re(e, "drop", Tt(Rt(
/*drop_handler*/
l[33]
))),
- ke(
+ Re(
e,
"click",
/*open_file_upload*/
l[13]
),
- ke(
+ Re(
e,
"drop",
/*loadFilesFromDrop*/
l[19]
),
- ke(
+ Re(
e,
"dragenter",
/*updateDragging*/
l[17]
),
- ke(
+ Re(
e,
"dragleave",
/*updateDragging*/
@@ -4376,112 +4485,112 @@ function S_(l) {
)
], u = !0);
},
- p(h, b) {
- d && d.p && (!f || b[0] & /*$$scope*/
- 33554432) && na(
+ p(m, h) {
+ d && d.p && (!f || h[0] & /*$$scope*/
+ 33554432) && Za(
d,
_,
- h,
+ m,
/*$$scope*/
- h[25],
- f ? $s(
+ m[25],
+ f ? Wa(
_,
/*$$scope*/
- h[25],
- b,
+ m[25],
+ h,
null
- ) : xs(
+ ) : Oa(
/*$$scope*/
- h[25]
+ m[25]
),
null
- ), (!f || b[0] & /*accept_file_types*/
+ ), (!f || h[0] & /*accept_file_types*/
65536 && i !== (i = /*accept_file_types*/
- h[16] || void 0)) && fe(n, "accept", i), (!f || b[0] & /*file_count*/
+ m[16] || void 0)) && pe(n, "accept", i), (!f || h[0] & /*file_count*/
64 && o !== (o = /*file_count*/
- h[6] === "multiple" || void 0)) && (n.multiple = o), (!f || b[0] & /*file_count*/
+ m[6] === "multiple" || void 0)) && (n.multiple = o), (!f || h[0] & /*file_count*/
64 && s !== (s = /*file_count*/
- h[6] === "directory" || void 0)) && fe(n, "webkitdirectory", s), (!f || b[0] & /*file_count*/
+ m[6] === "directory" || void 0)) && pe(n, "webkitdirectory", s), (!f || h[0] & /*file_count*/
64 && r !== (r = /*file_count*/
- h[6] === "directory" || void 0)) && fe(n, "mozdirectory", r), (!f || b[0] & /*hidden*/
+ m[6] === "directory" || void 0)) && pe(n, "mozdirectory", r), (!f || h[0] & /*hidden*/
512 && a !== (a = /*hidden*/
- h[9] ? -1 : 0)) && fe(e, "tabindex", a), (!f || b[0] & /*hidden*/
- 512) && le(
+ m[9] ? -1 : 0)) && pe(e, "tabindex", a), (!f || h[0] & /*hidden*/
+ 512) && de(
e,
"hidden",
/*hidden*/
- h[9]
- ), (!f || b[0] & /*center*/
- 16) && le(
+ m[9]
+ ), (!f || h[0] & /*center*/
+ 16) && de(
e,
"center",
/*center*/
- h[4]
- ), (!f || b[0] & /*boundedheight*/
- 8) && le(
+ m[4]
+ ), (!f || h[0] & /*boundedheight*/
+ 8) && de(
e,
"boundedheight",
/*boundedheight*/
- h[3]
- ), (!f || b[0] & /*flex*/
- 32) && le(
+ m[3]
+ ), (!f || h[0] & /*flex*/
+ 32) && de(
e,
"flex",
/*flex*/
- h[5]
- ), (!f || b[0] & /*disable_click*/
- 128) && le(
+ m[5]
+ ), (!f || h[0] & /*disable_click*/
+ 128) && de(
e,
"disable_click",
/*disable_click*/
- h[7]
+ m[7]
);
},
- i(h) {
- f || (dt(d, h), f = !0);
+ i(m) {
+ f || (Mt(d, m), f = !0);
},
- o(h) {
- Tt(d, h), f = !1;
+ o(m) {
+ Qt(d, m), f = !1;
},
- d(h) {
- h && ql(e), d && d.d(h), l[34](null), u = !1, p_(c);
+ d(m) {
+ m && Jl(e), d && d.d(m), l[34](null), u = !1, Td(c);
}
};
}
-function z_(l) {
+function Yd(l) {
let e, t, n = !/*hidden*/
- l[9] && Mo(l);
+ l[9] && us(l);
return {
c() {
- n && n.c(), e = Qs();
+ n && n.c(), e = Ua();
},
m(i, o) {
- n && n.m(i, o), El(i, e, o), t = !0;
+ n && n.m(i, o), Ql(i, e, o), t = !0;
},
p(i, o) {
/*hidden*/
- i[9] ? n && (ea(), Tt(n, 1, 1, () => {
+ i[9] ? n && (Va(), Qt(n, 1, 1, () => {
n = null;
- }), Gs()) : n ? (n.p(i, o), o[0] & /*hidden*/
- 512 && dt(n, 1)) : (n = Mo(i), n.c(), dt(n, 1), n.m(e.parentNode, e));
+ }), Ya()) : n ? (n.p(i, o), o[0] & /*hidden*/
+ 512 && Mt(n, 1)) : (n = us(i), n.c(), Mt(n, 1), n.m(e.parentNode, e));
},
i(i) {
- t || (dt(n), t = !0);
+ t || (Mt(n), t = !0);
},
o(i) {
- Tt(n), t = !1;
+ Qt(n), t = !1;
},
d(i) {
- i && ql(e), n && n.d(i);
+ i && Jl(e), n && n.d(i);
}
};
}
-function B_(l) {
+function Nd(l) {
let e, t, n, i, o;
const s = (
/*#slots*/
l[26].default
- ), r = Js(
+ ), r = Na(
s,
l,
/*$$scope*/
@@ -4490,31 +4599,31 @@ function B_(l) {
);
return {
c() {
- e = pi("button"), r && r.c(), fe(e, "tabindex", t = /*hidden*/
- l[9] ? -1 : 0), fe(e, "class", "svelte-1s26xmt"), le(
+ e = Zi("button"), r && r.c(), pe(e, "tabindex", t = /*hidden*/
+ l[9] ? -1 : 0), pe(e, "class", "svelte-1s26xmt"), de(
e,
"hidden",
/*hidden*/
l[9]
- ), le(
+ ), de(
e,
"center",
/*center*/
l[4]
- ), le(
+ ), de(
e,
"boundedheight",
/*boundedheight*/
l[3]
- ), le(
+ ), de(
e,
"flex",
/*flex*/
l[5]
- ), ta(e, "height", "100%");
+ ), Pa(e, "height", "100%");
},
m(a, f) {
- El(a, e, f), r && r.m(e, null), n = !0, i || (o = ke(
+ Ql(a, e, f), r && r.m(e, null), n = !0, i || (o = Re(
e,
"click",
/*paste_clipboard*/
@@ -4523,45 +4632,45 @@ function B_(l) {
},
p(a, f) {
r && r.p && (!n || f[0] & /*$$scope*/
- 33554432) && na(
+ 33554432) && Za(
r,
s,
a,
/*$$scope*/
a[25],
- n ? $s(
+ n ? Wa(
s,
/*$$scope*/
a[25],
f,
null
- ) : xs(
+ ) : Oa(
/*$$scope*/
a[25]
),
null
), (!n || f[0] & /*hidden*/
512 && t !== (t = /*hidden*/
- a[9] ? -1 : 0)) && fe(e, "tabindex", t), (!n || f[0] & /*hidden*/
- 512) && le(
+ a[9] ? -1 : 0)) && pe(e, "tabindex", t), (!n || f[0] & /*hidden*/
+ 512) && de(
e,
"hidden",
/*hidden*/
a[9]
), (!n || f[0] & /*center*/
- 16) && le(
+ 16) && de(
e,
"center",
/*center*/
a[4]
), (!n || f[0] & /*boundedheight*/
- 8) && le(
+ 8) && de(
e,
"boundedheight",
/*boundedheight*/
a[3]
), (!n || f[0] & /*flex*/
- 32) && le(
+ 32) && de(
e,
"flex",
/*flex*/
@@ -4569,19 +4678,19 @@ function B_(l) {
);
},
i(a) {
- n || (dt(r, a), n = !0);
+ n || (Mt(r, a), n = !0);
},
o(a) {
- Tt(r, a), n = !1;
+ Qt(r, a), n = !1;
},
d(a) {
- a && ql(e), r && r.d(a), i = !1, o();
+ a && Jl(e), r && r.d(a), i = !1, o();
}
};
}
-function Mo(l) {
+function us(l) {
let e, t;
- return e = new __({
+ return e = new Bd({
props: {
root: (
/*root*/
@@ -4602,10 +4711,10 @@ function Mo(l) {
}
}), {
c() {
- m_(e.$$.fragment);
+ Ad(e.$$.fragment);
},
m(n, i) {
- w_(e, n, i), t = !0;
+ Rd(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -4620,19 +4729,19 @@ function Mo(l) {
n[11]), e.$set(o);
},
i(n) {
- t || (dt(e.$$.fragment, n), t = !0);
+ t || (Mt(e.$$.fragment, n), t = !0);
},
o(n) {
- Tt(e.$$.fragment, n), t = !1;
+ Qt(e.$$.fragment, n), t = !1;
},
d(n) {
- g_(e, n);
+ Ld(e, n);
}
};
}
-function q_(l) {
+function Ud(l) {
let e, t, n, i;
- const o = [B_, z_, S_], s = [];
+ const o = [Nd, Yd, Xd], s = [];
function r(a, f) {
return (
/*filetype*/
@@ -4645,29 +4754,29 @@ function q_(l) {
}
return e = r(l), t = s[e] = o[e](l), {
c() {
- t.c(), n = Qs();
+ t.c(), n = Ua();
},
m(a, f) {
- s[e].m(a, f), El(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) : (ea(), Tt(s[u], 1, 1, () => {
+ e = r(a), e === u ? s[e].p(a, f) : (Va(), Qt(s[u], 1, 1, () => {
s[u] = null;
- }), Gs(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), dt(t, 1), t.m(n.parentNode, n));
+ }), Ya(), 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 || (dt(t), i = !0);
+ i || (Mt(t), i = !0);
},
o(a) {
- Tt(t), i = !1;
+ Qt(t), i = !1;
},
d(a) {
- a && ql(n), s[e].d(a);
+ a && Jl(n), s[e].d(a);
}
};
}
-function E_(l, e, t) {
+function Od(l, e, t) {
if (!l || l === "*" || l === "file/*" || Array.isArray(l) && l.some((i) => i === "*" || i === "file/*"))
return !0;
let n;
@@ -4682,179 +4791,179 @@ function E_(l, e, t) {
return i.endsWith("/*") && t.startsWith(o + "/");
});
}
-function M_(l, e, t) {
+function Wd(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
- var o = this && this.__awaiter || function(M, Y, S, W) {
- function G(Me) {
- return Me instanceof S ? Me : new S(function(E) {
- E(Me);
+ var o = this && this.__awaiter || function(M, F, G, q) {
+ function ce(ge) {
+ return ge instanceof G ? ge : new G(function(Ae) {
+ Ae(ge);
});
}
- return new (S || (S = Promise))(function(Me, E) {
- function Ae(Le) {
+ return new (G || (G = Promise))(function(ge, Ae) {
+ function ot(Ue) {
try {
- _e(W.next(Le));
- } catch (Re) {
- E(Re);
+ Fe(q.next(Ue));
+ } catch (Lt) {
+ Ae(Lt);
}
}
- function ae(Le) {
+ function Le(Ue) {
try {
- _e(W.throw(Le));
- } catch (Re) {
- E(Re);
+ Fe(q.throw(Ue));
+ } catch (Lt) {
+ Ae(Lt);
}
}
- function _e(Le) {
- Le.done ? Me(Le.value) : G(Le.value).then(Ae, ae);
+ function Fe(Ue) {
+ Ue.done ? ge(Ue.value) : ce(Ue.value).then(ot, Le);
}
- _e((W = W.apply(M, Y || [])).next());
+ Fe((q = q.apply(M, F || [])).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: h = !1 } = e, { format: b = "file" } = e, { uploading: w = !1 } = e, { hidden_upload: g = null } = e, { show_progress: p = !0 } = e, { max_file_size: m = null } = e, { upload: k } = e, { stream_handler: y } = e, C, B, v;
- const q = y_(), j = ["image", "video", "audio", "text", "file"], X = (M) => M.startsWith(".") || M.endsWith("/*") ? M : j.includes(M) ? M + "/*" : "." + M;
- function R() {
+ 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 L() {
t(20, r = !r);
}
- function Q() {
+ function N() {
navigator.clipboard.read().then((M) => o(this, void 0, void 0, function* () {
- for (let Y = 0; Y < M.length; Y++) {
- const S = M[Y].types.find((W) => W.startsWith("image/"));
- if (S) {
- M[Y].getType(S).then((W) => o(this, void 0, void 0, function* () {
- const G = new File([W], `clipboard.${S.replace("image/", "")}`);
- yield H([G]);
+ for (let F = 0; F < M.length; F++) {
+ const G = M[F].types.find((q) => q.startsWith("image/"));
+ if (G) {
+ M[F].getType(G).then((q) => o(this, void 0, void 0, function* () {
+ const ce = new File([q], `clipboard.${G.replace("image/", "")}`);
+ yield V([ce]);
}));
break;
}
}
}));
}
- function O() {
- _ || g && (t(2, g.value = "", g), g.click());
+ function J() {
+ _ || w && (t(2, w.value = "", w), w.click());
}
- function P(M) {
+ function x(M) {
return o(this, void 0, void 0, function* () {
- yield C_(), t(14, C = Math.random().toString(36).substring(2, 15)), t(1, w = !0);
+ yield Fd(), t(14, v = Math.random().toString(36).substring(2, 15)), t(1, p = !0);
try {
- const Y = yield k(M, d, C, m ?? 1 / 0);
- return q("load", c === "single" ? Y == null ? void 0 : Y[0] : Y), t(1, w = !1), Y || [];
- } catch (Y) {
- return q("error", Y.message), t(1, w = !1), [];
+ const F = yield k(M, d, v, g ?? 1 / 0);
+ return A("load", c === "single" ? F == null ? void 0 : F[0] : F), t(1, p = !1), F || [];
+ } catch (F) {
+ return A("error", F.message), t(1, p = !1), [];
}
});
}
- function H(M) {
+ function V(M) {
return o(this, void 0, void 0, function* () {
if (!M.length)
return;
- let Y = M.map((S) => new File([S], S instanceof File ? S.name : "file", { type: S.type }));
- return t(15, B = yield t_(Y)), yield P(B);
+ let F = M.map((G) => new File([G], G instanceof File ? G.name : "file", { type: G.type }));
+ return t(15, z = yield Ha(F)), yield x(z);
});
}
- function ie(M) {
+ function U(M) {
return o(this, void 0, void 0, function* () {
- const Y = M.target;
- if (Y.files)
- if (b != "blob")
- yield H(Array.from(Y.files));
+ const F = M.target;
+ if (F.files)
+ if (h != "blob")
+ yield V(Array.from(F.files));
else {
if (c === "single") {
- q("load", Y.files[0]);
+ A("load", F.files[0]);
return;
}
- q("load", Y.files);
+ A("load", F.files);
}
});
}
- function we(M) {
+ function T(M) {
return o(this, void 0, void 0, function* () {
- var Y;
- if (t(20, r = !1), !(!((Y = M.dataTransfer) === null || Y === void 0) && Y.files)) return;
- const S = Array.from(M.dataTransfer.files).filter((W) => {
- const G = "." + W.name.split(".").pop();
- return G && E_(v, G, W.type) || (G && Array.isArray(s) ? s.includes(G) : G === s) ? !0 : (q("error", `Invalid file type only ${s} allowed.`), !1);
+ var F;
+ if (t(20, r = !1), !(!((F = M.dataTransfer) === null || F === void 0) && F.files)) return;
+ const G = Array.from(M.dataTransfer.files).filter((q) => {
+ const ce = "." + q.name.split(".").pop();
+ return ce && Od(y, ce, q.type) || (ce && Array.isArray(s) ? s.includes(ce) : ce === s) ? !0 : (A("error", `Invalid file type only ${s} allowed.`), !1);
});
- yield H(S);
+ yield V(G);
});
}
- function oe(M) {
- wt.call(this, l, M);
+ function K(M) {
+ Dt.call(this, l, M);
}
function D(M) {
- wt.call(this, l, M);
+ Dt.call(this, l, M);
}
- function ue(M) {
- wt.call(this, l, M);
+ function O(M) {
+ Dt.call(this, l, M);
}
- function pe(M) {
- wt.call(this, l, M);
+ function le(M) {
+ Dt.call(this, l, M);
}
- function Ye(M) {
- wt.call(this, l, M);
+ function ae(M) {
+ Dt.call(this, l, M);
}
- function Ue(M) {
- wt.call(this, l, M);
+ function ue(M) {
+ Dt.call(this, l, M);
}
- function A(M) {
- wt.call(this, l, M);
+ function I(M) {
+ Dt.call(this, l, M);
}
- function Je(M) {
- h_[M ? "unshift" : "push"](() => {
- g = M, t(2, g);
+ function Me(M) {
+ Md[M ? "unshift" : "push"](() => {
+ w = M, t(2, w);
});
}
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, h = M.hidden), "format" in M && t(21, b = M.format), "uploading" in M && t(1, w = M.uploading), "hidden_upload" in M && t(2, g = M.hidden_upload), "show_progress" in M && t(10, p = M.show_progress), "max_file_size" in M && t(22, m = M.max_file_size), "upload" in M && t(23, k = M.upload), "stream_handler" in M && t(11, y = 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, 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);
}, l.$$.update = () => {
l.$$.dirty[0] & /*filetype*/
- 1 && (s == null ? t(16, v = null) : typeof s == "string" ? t(16, v = X(s)) : (t(0, s = s.map(X)), t(16, v = s.join(", "))));
+ 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(", "))));
}, [
s,
+ p,
w,
- g,
a,
f,
u,
c,
_,
d,
- h,
- p,
- y,
- Q,
- O,
+ m,
+ b,
C,
- B,
+ N,
+ J,
v,
- R,
- ie,
- we,
+ z,
+ y,
+ L,
+ U,
+ T,
r,
- b,
- m,
+ h,
+ g,
k,
- H,
+ V,
i,
n,
- oe,
+ K,
D,
+ O,
+ le,
+ ae,
ue,
- pe,
- Ye,
- Ue,
- A,
- Je
+ I,
+ Me
];
}
-class A_ extends d_ {
+class Vd extends Ed {
constructor(e) {
- super(), b_(
+ super(), Dd(
this,
e,
- M_,
- q_,
- v_,
+ Wd,
+ Ud,
+ Id,
{
filetype: 0,
dragging: 20,
@@ -4891,157 +5000,850 @@ class A_ extends d_ {
}
}
const {
- SvelteComponent: L_,
- append: ot,
- attr: L,
- detach: R_,
- init: D_,
- insert: T_,
- noop: Ql,
- safe_not_equal: I_,
- set_style: st,
- svg_element: xe
-} = window.__gradio__svelte__internal;
-function H_(l) {
- let e, t, n, i, o, s, r, a, f;
- return {
+ SvelteComponent: Pd,
+ append: _l,
+ 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) {
+ let e, t, n, i, o, s = "Click to Access Webcam", r, a, f, u;
+ return i = new ca({}), {
c() {
- e = xe("svg"), t = xe("rect"), n = xe("rect"), i = xe("rect"), o = xe("rect"), s = xe("line"), r = xe("line"), a = xe("line"), f = xe("line"), L(t, "x", "2"), L(t, "y", "2"), L(t, "width", "5"), L(t, "height", "5"), L(t, "rx", "1"), L(t, "ry", "1"), L(t, "stroke-width", "2"), L(t, "fill", "none"), L(n, "x", "17"), L(n, "y", "2"), L(n, "width", "5"), L(n, "height", "5"), L(n, "rx", "1"), L(n, "ry", "1"), L(n, "stroke-width", "2"), L(n, "fill", "none"), L(i, "x", "2"), L(i, "y", "17"), L(i, "width", "5"), L(i, "height", "5"), L(i, "rx", "1"), L(i, "ry", "1"), L(i, "stroke-width", "2"), L(i, "fill", "none"), L(o, "x", "17"), L(o, "y", "17"), L(o, "width", "5"), L(o, "height", "5"), L(o, "rx", "1"), L(o, "ry", "1"), L(o, "stroke-width", "2"), L(o, "fill", "none"), L(s, "x1", "7.5"), L(s, "y1", "4.5"), L(s, "x2", "16"), L(s, "y2", "4.5"), st(s, "stroke-width", "2px"), L(r, "x1", "7.5"), L(r, "y1", "19.5"), L(r, "x2", "16"), L(r, "y2", "19.5"), st(r, "stroke-width", "2px"), L(a, "x1", "4.5"), L(a, "y1", "8"), L(a, "x2", "4.5"), L(a, "y2", "16"), st(a, "stroke-width", "2px"), L(f, "x1", "19.5"), L(f, "y1", "8"), L(f, "x2", "19.5"), L(f, "y2", "16"), st(f, "stroke-width", "2px"), L(e, "width", "100%"), L(e, "height", "100%"), L(e, "viewBox", "0 0 24 24"), L(e, "version", "1.1"), L(e, "xmlns", "http://www.w3.org/2000/svg"), L(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), L(e, "xml:space", "preserve"), L(e, "stroke", "currentColor"), st(e, "fill-rule", "evenodd"), st(e, "clip-rule", "evenodd"), st(e, "stroke-linecap", "round"), st(e, "stroke-linejoin", "round");
+ 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%");
},
- m(u, c) {
- T_(u, e, c), ot(e, t), ot(e, n), ot(e, i), ot(e, o), ot(e, s), ot(e, r), ot(e, a), ot(e, f);
+ m(c, _) {
+ Qd(c, e, _), _l(e, t), _l(t, n), $d(i, n, null), _l(t, o), _l(t, r), a = !0, f || (u = xd(
+ e,
+ "click",
+ /*click_handler*/
+ l[1]
+ ), f = !0);
},
- p: Ql,
- i: Ql,
- o: Ql,
- d(u) {
- u && R_(e);
+ p: e1,
+ i(c) {
+ a || (o1(i.$$.fragment, c), a = !0);
+ },
+ o(c) {
+ s1(i.$$.fragment, c), a = !1;
+ },
+ d(c) {
+ c && Gd(e), Kd(i), f = !1, u();
}
};
}
-class j_ extends L_ {
+function f1(l) {
+ const e = a1();
+ return [e, () => e("click")];
+}
+class u1 extends Pd {
constructor(e) {
- super(), D_(this, e, null, H_, I_, {});
+ super(), Jd(this, e, f1, r1, t1, {});
}
}
-const {
- SvelteComponent: F_,
- append: X_,
- attr: He,
- detach: Y_,
- init: U_,
- insert: V_,
- noop: xl,
- safe_not_equal: N_,
- set_style: Pn,
- svg_element: Ao
-} = window.__gradio__svelte__internal;
-function O_(l) {
- let e, t;
- return {
- c() {
- e = Ao("svg"), t = Ao("path"), He(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"), He(t, "fill", "none"), He(t, "stroke-width", "2"), He(e, "width", "100%"), He(e, "height", "100%"), He(e, "viewBox", "0 0 24 24"), He(e, "version", "1.1"), He(e, "xmlns", "http://www.w3.org/2000/svg"), He(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), He(e, "xml:space", "preserve"), He(e, "stroke", "currentColor"), Pn(e, "fill-rule", "evenodd"), Pn(e, "clip-rule", "evenodd"), Pn(e, "stroke-linecap", "round"), Pn(e, "stroke-linejoin", "round");
- },
- m(n, i) {
- V_(n, e, i), X_(e, t);
- },
- p: xl,
- i: xl,
- o: xl,
- d(n) {
- n && Y_(e);
- }
+function c1() {
+ return navigator.mediaDevices.enumerateDevices();
+}
+function _1(l, e) {
+ e.srcObject = l, e.muted = !0, e.play();
+}
+async function cs(l, e, t) {
+ const n = {
+ width: { ideal: 1920 },
+ height: { ideal: 1440 }
+ }, i = {
+ video: t ? { deviceId: { exact: t }, ...n } : n,
+ audio: l
};
+ return navigator.mediaDevices.getUserMedia(i).then((o) => (_1(o, e), o));
}
-class W_ extends F_ {
- constructor(e) {
- super(), U_(this, e, null, O_, N_, {});
- }
+function d1(l) {
+ return l.filter(
+ (t) => t.kind === "videoinput"
+ );
}
const {
- SvelteComponent: P_,
- append: Z_,
- attr: je,
- detach: K_,
- init: G_,
- insert: J_,
- noop: $l,
- safe_not_equal: Q_,
- set_style: Zn,
- svg_element: Lo
-} = window.__gradio__svelte__internal;
-function x_(l) {
- let e, t;
+ SvelteComponent: h1,
+ action_destroyer: m1,
+ add_render_callback: g1,
+ append: _t,
+ attr: se,
+ binding_callbacks: b1,
+ check_outros: Nn,
+ create_component: kn,
+ create_in_transition: w1,
+ destroy_component: yn,
+ destroy_each: p1,
+ detach: Be,
+ element: He,
+ empty: so,
+ ensure_array_like: _s,
+ group_outros: Un,
+ init: v1,
+ insert: Ee,
+ listen: jl,
+ mount_component: Cn,
+ noop: ao,
+ run_all: k1,
+ safe_not_equal: y1,
+ set_data: Ka,
+ set_input_value: Ki,
+ space: Zn,
+ stop_propagation: C1,
+ text: Ga,
+ toggle_class: dl,
+ transition_in: he,
+ transition_out: ve
+} = window.__gradio__svelte__internal, { createEventDispatcher: S1, onMount: z1 } = window.__gradio__svelte__internal;
+function ds(l, e, t) {
+ const n = l.slice();
+ return n[32] = e[t], n;
+}
+function q1(l) {
+ let e, t, n, i, o, s, r, a, f, u, c;
+ const _ = [M1, E1], d = [];
+ function m(w, b) {
+ return (
+ /*mode*/
+ w[1] === "video" || /*streaming*/
+ w[0] ? 0 : 1
+ );
+ }
+ n = m(l), i = d[n] = _[n](l);
+ let h = !/*recording*/
+ l[8] && hs(l), p = (
+ /*options_open*/
+ l[10] && /*selected_device*/
+ l[7] && ms(l)
+ );
return {
c() {
- e = Lo("svg"), t = Lo("path"), je(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"), je(t, "fill", "none"), je(t, "stroke-width", "2"), je(e, "width", "100%"), je(e, "height", "100%"), je(e, "viewBox", "0 0 24 24"), je(e, "version", "1.1"), je(e, "xmlns", "http://www.w3.org/2000/svg"), je(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), je(e, "xml:space", "preserve"), je(e, "stroke", "currentColor"), Zn(e, "fill-rule", "evenodd"), Zn(e, "clip-rule", "evenodd"), Zn(e, "stroke-linecap", "round"), Zn(e, "stroke-linejoin", "round");
+ e = He("div"), t = He("button"), i.c(), s = Zn(), h && h.c(), r = Zn(), p && p.c(), a = so(), se(t, "aria-label", o = /*mode*/
+ l[1] === "image" ? "capture photo" : "start recording"), se(t, "class", "svelte-8hqvb6"), se(e, "class", "button-wrap svelte-8hqvb6");
},
- m(n, i) {
- J_(n, e, i), Z_(e, t);
+ m(w, b) {
+ Ee(w, e, b), _t(e, t), d[n].m(t, null), _t(e, s), h && h.m(e, null), Ee(w, r, b), p && p.m(w, b), Ee(w, a, b), f = !0, u || (c = jl(
+ t,
+ "click",
+ /*record_video_or_photo*/
+ l[13]
+ ), u = !0);
+ },
+ p(w, b) {
+ let g = n;
+ n = m(w), n === g ? d[n].p(w, b) : (Un(), ve(d[g], 1, 1, () => {
+ d[g] = null;
+ }), Nn(), i = d[n], i ? i.p(w, b) : (i = d[n] = _[n](w), i.c()), he(i, 1), i.m(t, null)), (!f || b[0] & /*mode*/
+ 2 && o !== (o = /*mode*/
+ w[1] === "image" ? "capture photo" : "start recording")) && se(t, "aria-label", o), /*recording*/
+ w[8] ? h && (Un(), ve(h, 1, 1, () => {
+ h = null;
+ }), Nn()) : h ? (h.p(w, b), b[0] & /*recording*/
+ 256 && he(h, 1)) : (h = hs(w), h.c(), he(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 && he(p, 1)) : (p = ms(w), p.c(), he(p, 1), p.m(a.parentNode, a)) : p && (Un(), ve(p, 1, 1, () => {
+ p = null;
+ }), Nn());
},
- p: $l,
- i: $l,
- o: $l,
- d(n) {
- n && K_(e);
+ i(w) {
+ f || (he(i), he(h), he(p), f = !0);
+ },
+ o(w) {
+ ve(i), ve(h), ve(p), f = !1;
+ },
+ d(w) {
+ w && (Be(e), Be(r), Be(a)), d[n].d(), h && h.d(), p && p.d(w), u = !1, c();
}
};
}
-class $_ extends P_ {
- constructor(e) {
- super(), G_(this, e, null, x_, Q_, {});
- }
-}
-const {
- SvelteComponent: ed,
- append: Ro,
- attr: ei,
- bubble: Do,
- create_component: td,
- destroy_component: nd,
- detach: la,
- element: To,
- init: ld,
- insert: ia,
- listen: ti,
- mount_component: id,
- run_all: od,
- safe_not_equal: sd,
- set_data: ad,
- set_input_value: Io,
- space: rd,
- text: fd,
- transition_in: ud,
- transition_out: cd
-} = window.__gradio__svelte__internal, { createEventDispatcher: _d, afterUpdate: dd } = window.__gradio__svelte__internal;
-function hd(l) {
- let e;
+function B1(l) {
+ let e, t, n, i;
+ return t = new u1({}), t.$on(
+ "click",
+ /*click_handler*/
+ l[20]
+ ), {
+ c() {
+ e = He("div"), kn(t.$$.fragment), se(e, "title", "grant webcam access");
+ },
+ m(o, s) {
+ Ee(o, e, s), Cn(t, e, null), i = !0;
+ },
+ p: ao,
+ i(o) {
+ i || (he(t.$$.fragment, o), o && (n || g1(() => {
+ n = w1(e, m_, { delay: 100, duration: 200 }), n.start();
+ })), i = !0);
+ },
+ o(o) {
+ ve(t.$$.fragment, o), i = !1;
+ },
+ d(o) {
+ o && Be(e), yn(t);
+ }
+ };
+}
+function E1(l) {
+ let e, t, n;
+ return t = new uu({}), {
+ c() {
+ e = He("div"), kn(t.$$.fragment), se(e, "class", "icon svelte-8hqvb6"), se(e, "title", "capture photo");
+ },
+ m(i, o) {
+ Ee(i, e, o), Cn(t, e, null), n = !0;
+ },
+ p: ao,
+ i(i) {
+ n || (he(t.$$.fragment, i), n = !0);
+ },
+ o(i) {
+ ve(t.$$.fragment, i), n = !1;
+ },
+ d(i) {
+ i && Be(e), yn(t);
+ }
+ };
+}
+function M1(l) {
+ let e, t, n, i;
+ const o = [L1, A1], s = [];
+ function r(a, f) {
+ return (
+ /*recording*/
+ a[8] ? 0 : 1
+ );
+ }
+ return e = r(l), t = s[e] = o[e](l), {
+ c() {
+ t.c(), n = so();
+ },
+ m(a, f) {
+ s[e].m(a, f), Ee(a, n, f), i = !0;
+ },
+ p(a, f) {
+ let u = e;
+ e = r(a), e !== u && (Un(), ve(s[u], 1, 1, () => {
+ s[u] = null;
+ }), Nn(), t = s[e], t || (t = s[e] = o[e](a), t.c()), he(t, 1), t.m(n.parentNode, n));
+ },
+ i(a) {
+ i || (he(t), i = !0);
+ },
+ o(a) {
+ ve(t), i = !1;
+ },
+ d(a) {
+ a && Be(n), s[e].d(a);
+ }
+ };
+}
+function A1(l) {
+ let e, t, n;
+ return t = new wu({}), {
+ c() {
+ e = He("div"), kn(t.$$.fragment), se(e, "class", "icon red svelte-8hqvb6"), se(e, "title", "start recording");
+ },
+ m(i, o) {
+ Ee(i, e, o), Cn(t, e, null), n = !0;
+ },
+ i(i) {
+ n || (he(t.$$.fragment, i), n = !0);
+ },
+ o(i) {
+ ve(t.$$.fragment, i), n = !1;
+ },
+ d(i) {
+ i && Be(e), yn(t);
+ }
+ };
+}
+function L1(l) {
+ let e, t, n;
+ return t = new kc({}), {
+ c() {
+ e = He("div"), kn(t.$$.fragment), se(e, "class", "icon red svelte-8hqvb6"), se(e, "title", "stop recording");
+ },
+ m(i, o) {
+ Ee(i, e, o), Cn(t, e, null), n = !0;
+ },
+ i(i) {
+ n || (he(t.$$.fragment, i), n = !0);
+ },
+ o(i) {
+ ve(t.$$.fragment, i), n = !1;
+ },
+ d(i) {
+ i && Be(e), yn(t);
+ }
+ };
+}
+function hs(l) {
+ let e, t, n, i, o;
+ return t = new to({}), {
+ c() {
+ e = He("button"), kn(t.$$.fragment), se(e, "class", "icon svelte-8hqvb6"), se(e, "aria-label", "select input source");
+ },
+ m(s, r) {
+ Ee(s, e, r), Cn(t, e, null), n = !0, i || (o = jl(
+ e,
+ "click",
+ /*click_handler_1*/
+ l[21]
+ ), i = !0);
+ },
+ p: ao,
+ i(s) {
+ 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();
+ }
+ };
+}
+function ms(l) {
+ let e, t, n, i, o, s, r;
+ n = new to({});
+ function a(c, _) {
+ return (
+ /*available_video_devices*/
+ c[6].length === 0 ? R1 : D1
+ );
+ }
+ let f = a(l), u = f(l);
+ return {
+ c() {
+ e = He("select"), t = He("button"), kn(n.$$.fragment), i = Zn(), u.c(), se(t, "class", "inset-icon svelte-8hqvb6"), se(e, "class", "select-wrap svelte-8hqvb6"), se(e, "aria-label", "select source");
+ },
+ m(c, _) {
+ Ee(c, e, _), _t(e, t), Cn(n, t, null), _t(t, i), u.m(e, null), o = !0, s || (r = [
+ jl(t, "click", C1(
+ /*click_handler_2*/
+ l[22]
+ )),
+ m1(ro.call(
+ null,
+ e,
+ /*handle_click_outside*/
+ l[14]
+ )),
+ jl(
+ e,
+ "change",
+ /*handle_device_change*/
+ l[11]
+ )
+ ], s = !0);
+ },
+ p(c, _) {
+ f === (f = a(c)) && u ? u.p(c, _) : (u.d(1), u = f(c), u && (u.c(), u.m(e, null)));
+ },
+ i(c) {
+ 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);
+ }
+ };
+}
+function D1(l) {
+ let e, t = _s(
+ /*available_video_devices*/
+ l[6]
+ ), n = [];
+ for (let i = 0; i < t.length; i += 1)
+ n[i] = gs(ds(l, t, i));
return {
c() {
- e = fd(
+ for (let i = 0; i < n.length; i += 1)
+ n[i].c();
+ e = so();
+ },
+ m(i, o) {
+ for (let s = 0; s < n.length; s += 1)
+ n[s] && n[s].m(i, o);
+ Ee(i, e, o);
+ },
+ p(i, o) {
+ if (o[0] & /*available_video_devices, selected_device*/
+ 192) {
+ t = _s(
+ /*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));
+ }
+ for (; s < n.length; s += 1)
+ n[s].d(1);
+ n.length = t.length;
+ }
+ },
+ d(i) {
+ i && Be(e), p1(n, i);
+ }
+ };
+}
+function R1(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), se(e, "class", "svelte-8hqvb6");
+ },
+ m(i, o) {
+ Ee(i, e, o), _t(e, n);
+ },
+ p(i, o) {
+ o[0] & /*i18n*/
+ 8 && t !== (t = /*i18n*/
+ i[3]("common.no_devices") + "") && Ka(n, t);
+ },
+ d(i) {
+ i && Be(e);
+ }
+ };
+}
+function gs(l) {
+ let e, t = (
+ /*device*/
+ l[32].label + ""
+ ), n, i, o, s;
+ return {
+ c() {
+ e = He("option"), n = Ga(t), i = Zn(), e.__value = o = /*device*/
+ l[32].deviceId, Ki(e, e.__value), e.selected = s = /*selected_device*/
+ l[7].deviceId === /*device*/
+ l[32].deviceId, se(e, "class", "svelte-8hqvb6");
+ },
+ m(r, a) {
+ Ee(r, e, a), _t(e, n), _t(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*/
+ 64 && o !== (o = /*device*/
+ r[32].deviceId) && (e.__value = o, Ki(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);
+ }
+ };
+}
+function T1(l) {
+ let e, t, n, i, o, s;
+ const r = [B1, q1], a = [];
+ function f(u, c) {
+ return (
+ /*webcam_accessed*/
+ u[9] ? 1 : 0
+ );
+ }
+ return i = f(l), o = a[i] = r[i](l), {
+ c() {
+ e = He("div"), t = He("video"), n = Zn(), o.c(), se(t, "class", "svelte-8hqvb6"), dl(
+ t,
+ "flip",
+ /*mirror_webcam*/
+ l[2]
+ ), dl(t, "hide", !/*webcam_accessed*/
+ l[9]), se(e, "class", "wrap svelte-8hqvb6");
+ },
+ m(u, c) {
+ Ee(u, e, c), _t(e, t), l[19](t), _t(e, n), a[i].m(e, null), s = !0;
+ },
+ p(u, c) {
+ (!s || c[0] & /*mirror_webcam*/
+ 4) && dl(
+ t,
+ "flip",
+ /*mirror_webcam*/
+ u[2]
+ ), (!s || c[0] & /*webcam_accessed*/
+ 512) && dl(t, "hide", !/*webcam_accessed*/
+ u[9]);
+ let _ = i;
+ i = f(u), i === _ ? a[i].p(u, c) : (Un(), ve(a[_], 1, 1, () => {
+ a[_] = null;
+ }), Nn(), 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 || (he(o), s = !0);
+ },
+ o(u) {
+ ve(o), s = !1;
+ },
+ d(u) {
+ u && Be(e), l[19](null), a[i].d();
+ }
+ };
+}
+function ro(l, e) {
+ const t = (n) => {
+ l && !l.contains(n.target) && !n.defaultPrevented && e(n);
+ };
+ return document.addEventListener("click", t, !0), {
+ destroy() {
+ document.removeEventListener("click", t, !0);
+ }
+ };
+}
+function I1(l, e, t) {
+ var n = this && this.__awaiter || function(T, K, D, O) {
+ function le(ae) {
+ return ae instanceof D ? ae : new D(function(ue) {
+ ue(ae);
+ });
+ }
+ return new (D || (D = Promise))(function(ae, ue) {
+ function I(F) {
+ try {
+ M(O.next(F));
+ } catch (G) {
+ ue(G);
+ }
+ }
+ function Me(F) {
+ try {
+ M(O.throw(F));
+ } catch (G) {
+ ue(G);
+ }
+ }
+ function M(F) {
+ F.done ? ae(F.value) : le(F.value).then(I, Me);
+ }
+ M((O = O.apply(T, K || [])).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 D = T.target.value;
+ yield cs(d, i, D).then((O) => n(void 0, void 0, void 0, function* () {
+ v = O, t(7, s = o.find((le) => le.deviceId === D) || null), t(10, L = !1);
+ }));
+ });
+ function b() {
+ 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 K = v.getTracks().map((D) => {
+ var O;
+ return (O = D.getSettings()) === null || O === void 0 ? void 0 : O.deviceId;
+ })[0];
+ t(7, s = K && T.find((D) => D.deviceId === K) || 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"));
+ else
+ throw T;
+ }
+ });
+ }
+ 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(
+ (K) => {
+ p(a ? "stream" : "capture", K);
+ },
+ "image/png",
+ 0.8
+ ));
+ }
+ let k = !1, C = [], v, z, y;
+ function A() {
+ if (k) {
+ y.stop();
+ let T = new Blob(C, { type: z }), K = new FileReader();
+ K.onload = function(D) {
+ return n(this, void 0, void 0, function* () {
+ var O;
+ if (D.target) {
+ let le = new File([T], "sample." + z.substring(6));
+ const ae = yield Ha([le]);
+ let ue = ((O = yield h(ae, u)) === null || O === void 0 ? void 0 : O.filter(Boolean))[0];
+ p("capture", ue), p("stop_recording");
+ }
+ });
+ }, K.readAsDataURL(T);
+ } else {
+ p("start_recording"), C = [];
+ let T = ["video/webm", "video/mp4"];
+ for (let K of T)
+ if (MediaRecorder.isTypeSupported(K)) {
+ z = K;
+ break;
+ }
+ if (z === null) {
+ console.error("No supported MediaRecorder mimeType");
+ return;
+ }
+ y = new MediaRecorder(v, { mimeType: z }), y.addEventListener("dataavailable", function(K) {
+ C.push(K.data);
+ }), y.start(200);
+ }
+ t(8, k = !k);
+ }
+ 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));
+ }
+ a && c === "image" && window.setInterval(
+ () => {
+ i && !f && g();
+ },
+ 500
+ );
+ let L = !1;
+ function N(T) {
+ T.preventDefault(), T.stopPropagation(), t(10, L = !1);
+ }
+ function J(T) {
+ b1[T ? "unshift" : "push"](() => {
+ i = T, t(5, i);
+ });
+ }
+ const x = async () => b(), V = () => t(10, L = !0), U = () => t(10, L = !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);
+ }, [
+ a,
+ c,
+ _,
+ m,
+ ro,
+ i,
+ o,
+ s,
+ k,
+ S,
+ L,
+ w,
+ b,
+ R,
+ N,
+ f,
+ u,
+ d,
+ h,
+ J,
+ x,
+ V,
+ U
+ ];
+}
+class j1 extends h1 {
+ constructor(e) {
+ super(), v1(
+ this,
+ e,
+ I1,
+ T1,
+ y1,
+ {
+ streaming: 0,
+ pending: 15,
+ root: 16,
+ mode: 1,
+ mirror_webcam: 2,
+ include_audio: 17,
+ i18n: 3,
+ upload: 18,
+ click_outside: 4
+ },
+ null,
+ [-1, -1]
+ );
+ }
+ get click_outside() {
+ return ro;
+ }
+}
+const {
+ SvelteComponent: H1,
+ append: yt,
+ attr: j,
+ detach: F1,
+ init: X1,
+ insert: Y1,
+ noop: qi,
+ safe_not_equal: N1,
+ set_style: Ct,
+ svg_element: ft
+} = window.__gradio__svelte__internal;
+function U1(l) {
+ let e, t, n, i, o, s, r, a, f;
+ return {
+ c() {
+ e = ft("svg"), t = ft("rect"), n = ft("rect"), i = ft("rect"), o = ft("rect"), s = ft("line"), r = ft("line"), a = ft("line"), f = ft("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), 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,
+ d(u) {
+ u && F1(e);
+ }
+ };
+}
+class O1 extends H1 {
+ constructor(e) {
+ super(), X1(this, e, null, U1, N1, {});
+ }
+}
+const {
+ SvelteComponent: W1,
+ append: V1,
+ attr: Ze,
+ detach: P1,
+ init: Z1,
+ insert: K1,
+ noop: Bi,
+ safe_not_equal: G1,
+ set_style: hl,
+ svg_element: bs
+} = window.__gradio__svelte__internal;
+function J1(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"), hl(e, "fill-rule", "evenodd"), hl(e, "clip-rule", "evenodd"), hl(e, "stroke-linecap", "round"), hl(e, "stroke-linejoin", "round");
+ },
+ m(n, i) {
+ K1(n, e, i), V1(e, t);
+ },
+ p: Bi,
+ i: Bi,
+ o: Bi,
+ d(n) {
+ n && P1(e);
+ }
+ };
+}
+class Q1 extends W1 {
+ constructor(e) {
+ super(), Z1(this, e, null, J1, G1, {});
+ }
+}
+const {
+ SvelteComponent: x1,
+ append: $1,
+ attr: Ke,
+ detach: e0,
+ init: t0,
+ insert: n0,
+ noop: Ei,
+ safe_not_equal: l0,
+ set_style: ml,
+ svg_element: ws
+} = window.__gradio__svelte__internal;
+function i0(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"), ml(e, "fill-rule", "evenodd"), ml(e, "clip-rule", "evenodd"), ml(e, "stroke-linecap", "round"), ml(e, "stroke-linejoin", "round");
+ },
+ m(n, i) {
+ n0(n, e, i), $1(e, t);
+ },
+ p: Ei,
+ i: Ei,
+ o: Ei,
+ d(n) {
+ n && e0(e);
+ }
+ };
+}
+class o0 extends x1 {
+ constructor(e) {
+ super(), t0(this, e, null, i0, l0, {});
+ }
+}
+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) {
+ let e;
+ return {
+ c() {
+ e = m0(
/*label*/
l[1]
);
},
m(t, n) {
- ia(t, e, n);
+ Qa(t, e, n);
},
p(t, n) {
n & /*label*/
- 2 && ad(
+ 2 && d0(
e,
/*label*/
t[1]
);
},
d(t) {
- t && la(e);
+ t && Ja(e);
}
};
}
-function md(l) {
+function k0(l) {
let e, t, n, i, o, s, r;
- return t = new ms({
+ return t = new ia({
props: {
show_label: (
/*show_label*/
@@ -5051,33 +5853,33 @@ function md(l) {
/*info*/
l[2]
),
- $$slots: { default: [hd] },
+ $$slots: { default: [v0] },
$$scope: { ctx: l }
}
}), {
c() {
- e = To("label"), td(t.$$.fragment), n = rd(), i = To("input"), ei(i, "type", "color"), i.disabled = /*disabled*/
- l[3], ei(i, "class", "svelte-16l8u73"), ei(e, "class", "block");
+ 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");
},
m(a, f) {
- ia(a, e, f), id(t, e, null), Ro(e, n), Ro(e, i), Io(
+ Qa(a, e, f), u0(t, e, null), ps(e, n), ps(e, i), ys(
i,
/*value*/
l[0]
), o = !0, s || (r = [
- ti(
+ Ai(
i,
"input",
/*input_input_handler*/
l[8]
),
- ti(
+ Ai(
i,
"focus",
/*focus_handler*/
l[6]
),
- ti(
+ Ai(
i,
"blur",
/*blur_handler*/
@@ -5095,43 +5897,43 @@ function md(l) {
2050 && (u.$$scope = { dirty: f, ctx: a }), t.$set(u), (!o || f & /*disabled*/
8) && (i.disabled = /*disabled*/
a[3]), f & /*value*/
- 1 && Io(
+ 1 && ys(
i,
/*value*/
a[0]
);
},
i(a) {
- o || (ud(t.$$.fragment, a), o = !0);
+ o || (g0(t.$$.fragment, a), o = !0);
},
o(a) {
- cd(t.$$.fragment, a), o = !1;
+ b0(t.$$.fragment, a), o = !1;
},
d(a) {
- a && la(e), nd(t), s = !1, od(r);
+ a && Ja(e), r0(t), s = !1, c0(r);
}
};
}
-function gd(l, e, t) {
+function y0(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 = _d();
+ const f = w0();
function u() {
f("change", n), i || f("input");
}
- dd(() => {
+ p0(() => {
t(5, i = !1);
});
- function c(h) {
- Do.call(this, l, h);
+ function c(m) {
+ vs.call(this, l, m);
}
- function _(h) {
- Do.call(this, l, h);
+ function _(m) {
+ vs.call(this, l, m);
}
function d() {
n = this.value, t(0, n);
}
- 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);
+ 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);
}, l.$$.update = () => {
l.$$.dirty & /*value*/
1 && u();
@@ -5147,9 +5949,9 @@ function gd(l, e, t) {
d
];
}
-class bd extends ed {
+class C0 extends s0 {
constructor(e) {
- super(), ld(this, e, gd, md, sd, {
+ super(), f0(this, e, y0, k0, _0, {
value: 0,
value_is_output: 5,
label: 1,
@@ -5160,39 +5962,39 @@ class bd extends ed {
}
}
const {
- SvelteComponent: wd,
- append: oa,
- attr: Z,
- bubble: pd,
- check_outros: vd,
- create_slot: sa,
- detach: Tn,
- element: Ml,
- empty: kd,
- get_all_dirty_from_scope: aa,
- get_slot_changes: ra,
- group_outros: yd,
- init: Cd,
- insert: In,
- listen: Sd,
- safe_not_equal: zd,
- set_style: ge,
- space: fa,
- src_url_equal: hl,
- toggle_class: $t,
- transition_in: ml,
- transition_out: gl,
- update_slot_base: ua
+ SvelteComponent: S0,
+ append: xa,
+ attr: te,
+ bubble: z0,
+ check_outros: q0,
+ create_slot: $a,
+ detach: el,
+ element: xl,
+ empty: B0,
+ get_all_dirty_from_scope: er,
+ get_slot_changes: tr,
+ group_outros: E0,
+ init: M0,
+ insert: tl,
+ listen: A0,
+ safe_not_equal: L0,
+ set_style: ze,
+ space: nr,
+ src_url_equal: Hl,
+ toggle_class: mn,
+ transition_in: Fl,
+ transition_out: Xl,
+ update_slot_base: lr
} = window.__gradio__svelte__internal;
-function Bd(l) {
+function D0(l) {
let e, t, n, i, o, s, r = (
/*icon*/
- l[7] && Ho(l)
+ l[7] && Cs(l)
);
const a = (
/*#slots*/
l[12].default
- ), f = sa(
+ ), f = $a(
a,
l,
/*$$scope*/
@@ -5201,32 +6003,32 @@ function Bd(l) {
);
return {
c() {
- e = Ml("button"), r && r.c(), t = fa(), f && f.c(), Z(e, "class", n = /*size*/
+ e = xl("button"), r && r.c(), t = nr(), f && f.c(), te(e, "class", n = /*size*/
l[4] + " " + /*variant*/
l[3] + " " + /*elem_classes*/
- l[1].join(" ") + " svelte-8huxfn"), Z(
+ l[1].join(" ") + " svelte-8huxfn"), te(
e,
"id",
/*elem_id*/
l[0]
), e.disabled = /*disabled*/
- l[8], $t(e, "hidden", !/*visible*/
- l[2]), ge(
+ l[8], mn(e, "hidden", !/*visible*/
+ l[2]), ze(
e,
"flex-grow",
/*scale*/
l[9]
- ), ge(
+ ), ze(
e,
"width",
/*scale*/
l[9] === 0 ? "fit-content" : null
- ), ge(e, "min-width", typeof /*min_width*/
+ ), ze(e, "min-width", typeof /*min_width*/
l[10] == "number" ? `calc(min(${/*min_width*/
l[10]}px, 100%))` : null);
},
m(u, c) {
- In(u, e, c), r && r.m(e, null), oa(e, t), f && f.m(e, null), i = !0, o || (s = Sd(
+ tl(u, e, c), r && r.m(e, null), xa(e, t), f && f.m(e, null), i = !0, o || (s = A0(
e,
"click",
/*click_handler*/
@@ -5235,20 +6037,20 @@ function Bd(l) {
},
p(u, c) {
/*icon*/
- u[7] ? r ? r.p(u, c) : (r = Ho(u), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!i || c & /*$$scope*/
- 2048) && ua(
+ 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(
f,
a,
u,
/*$$scope*/
u[11],
- i ? ra(
+ i ? tr(
a,
/*$$scope*/
u[11],
c,
null
- ) : aa(
+ ) : er(
/*$$scope*/
u[11]
),
@@ -5257,8 +6059,8 @@ function Bd(l) {
26 && n !== (n = /*size*/
u[4] + " " + /*variant*/
u[3] + " " + /*elem_classes*/
- u[1].join(" ") + " svelte-8huxfn")) && Z(e, "class", n), (!i || c & /*elem_id*/
- 1) && Z(
+ u[1].join(" ") + " svelte-8huxfn")) && te(e, "class", n), (!i || c & /*elem_id*/
+ 1) && te(
e,
"id",
/*elem_id*/
@@ -5266,44 +6068,44 @@ function Bd(l) {
), (!i || c & /*disabled*/
256) && (e.disabled = /*disabled*/
u[8]), (!i || c & /*size, variant, elem_classes, visible*/
- 30) && $t(e, "hidden", !/*visible*/
+ 30) && mn(e, "hidden", !/*visible*/
u[2]), c & /*scale*/
- 512 && ge(
+ 512 && ze(
e,
"flex-grow",
/*scale*/
u[9]
), c & /*scale*/
- 512 && ge(
+ 512 && ze(
e,
"width",
/*scale*/
u[9] === 0 ? "fit-content" : null
), c & /*min_width*/
- 1024 && ge(e, "min-width", typeof /*min_width*/
+ 1024 && ze(e, "min-width", typeof /*min_width*/
u[10] == "number" ? `calc(min(${/*min_width*/
u[10]}px, 100%))` : null);
},
i(u) {
- i || (ml(f, u), i = !0);
+ i || (Fl(f, u), i = !0);
},
o(u) {
- gl(f, u), i = !1;
+ Xl(f, u), i = !1;
},
d(u) {
- u && Tn(e), r && r.d(), f && f.d(u), o = !1, s();
+ u && el(e), r && r.d(), f && f.d(u), o = !1, s();
}
};
}
-function qd(l) {
+function R0(l) {
let e, t, n, i, o = (
/*icon*/
- l[7] && jo(l)
+ l[7] && Ss(l)
);
const s = (
/*#slots*/
l[12].default
- ), r = sa(
+ ), r = $a(
s,
l,
/*$$scope*/
@@ -5312,80 +6114,80 @@ function qd(l) {
);
return {
c() {
- e = Ml("a"), o && o.c(), t = fa(), r && r.c(), Z(
+ e = xl("a"), o && o.c(), t = nr(), r && r.c(), te(
e,
"href",
/*link*/
l[6]
- ), Z(e, "rel", "noopener noreferrer"), Z(
+ ), te(e, "rel", "noopener noreferrer"), te(
e,
"aria-disabled",
/*disabled*/
l[8]
- ), Z(e, "class", n = /*size*/
+ ), te(e, "class", n = /*size*/
l[4] + " " + /*variant*/
l[3] + " " + /*elem_classes*/
- l[1].join(" ") + " svelte-8huxfn"), Z(
+ l[1].join(" ") + " svelte-8huxfn"), te(
e,
"id",
/*elem_id*/
l[0]
- ), $t(e, "hidden", !/*visible*/
- l[2]), $t(
+ ), mn(e, "hidden", !/*visible*/
+ l[2]), mn(
e,
"disabled",
/*disabled*/
l[8]
- ), ge(
+ ), ze(
e,
"flex-grow",
/*scale*/
l[9]
- ), ge(
+ ), ze(
e,
"pointer-events",
/*disabled*/
l[8] ? "none" : null
- ), ge(
+ ), ze(
e,
"width",
/*scale*/
l[9] === 0 ? "fit-content" : null
- ), ge(e, "min-width", typeof /*min_width*/
+ ), ze(e, "min-width", typeof /*min_width*/
l[10] == "number" ? `calc(min(${/*min_width*/
l[10]}px, 100%))` : null);
},
m(a, f) {
- In(a, e, f), o && o.m(e, null), oa(e, t), r && r.m(e, null), i = !0;
+ tl(a, e, f), o && o.m(e, null), xa(e, t), r && r.m(e, null), i = !0;
},
p(a, f) {
/*icon*/
- a[7] ? o ? o.p(a, f) : (o = jo(a), o.c(), o.m(e, t)) : o && (o.d(1), o = null), r && r.p && (!i || f & /*$$scope*/
- 2048) && ua(
+ 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(
r,
s,
a,
/*$$scope*/
a[11],
- i ? ra(
+ i ? tr(
s,
/*$$scope*/
a[11],
f,
null
- ) : aa(
+ ) : er(
/*$$scope*/
a[11]
),
null
), (!i || f & /*link*/
- 64) && Z(
+ 64) && te(
e,
"href",
/*link*/
a[6]
), (!i || f & /*disabled*/
- 256) && Z(
+ 256) && te(
e,
"aria-disabled",
/*disabled*/
@@ -5394,103 +6196,103 @@ function qd(l) {
26 && n !== (n = /*size*/
a[4] + " " + /*variant*/
a[3] + " " + /*elem_classes*/
- a[1].join(" ") + " svelte-8huxfn")) && Z(e, "class", n), (!i || f & /*elem_id*/
- 1) && Z(
+ a[1].join(" ") + " svelte-8huxfn")) && te(e, "class", n), (!i || f & /*elem_id*/
+ 1) && te(
e,
"id",
/*elem_id*/
a[0]
), (!i || f & /*size, variant, elem_classes, visible*/
- 30) && $t(e, "hidden", !/*visible*/
+ 30) && mn(e, "hidden", !/*visible*/
a[2]), (!i || f & /*size, variant, elem_classes, disabled*/
- 282) && $t(
+ 282) && mn(
e,
"disabled",
/*disabled*/
a[8]
), f & /*scale*/
- 512 && ge(
+ 512 && ze(
e,
"flex-grow",
/*scale*/
a[9]
), f & /*disabled*/
- 256 && ge(
+ 256 && ze(
e,
"pointer-events",
/*disabled*/
a[8] ? "none" : null
), f & /*scale*/
- 512 && ge(
+ 512 && ze(
e,
"width",
/*scale*/
a[9] === 0 ? "fit-content" : null
), f & /*min_width*/
- 1024 && ge(e, "min-width", typeof /*min_width*/
+ 1024 && ze(e, "min-width", typeof /*min_width*/
a[10] == "number" ? `calc(min(${/*min_width*/
a[10]}px, 100%))` : null);
},
i(a) {
- i || (ml(r, a), i = !0);
+ i || (Fl(r, a), i = !0);
},
o(a) {
- gl(r, a), i = !1;
+ Xl(r, a), i = !1;
},
d(a) {
- a && Tn(e), o && o.d(), r && r.d(a);
+ a && el(e), o && o.d(), r && r.d(a);
}
};
}
-function Ho(l) {
+function Cs(l) {
let e, t, n;
return {
c() {
- e = Ml("img"), Z(e, "class", "button-icon svelte-8huxfn"), hl(e.src, t = /*icon*/
- l[7].url) || Z(e, "src", t), Z(e, "alt", n = `${/*value*/
+ e = xl("img"), te(e, "class", "button-icon svelte-8huxfn"), Hl(e.src, t = /*icon*/
+ l[7].url) || te(e, "src", t), te(e, "alt", n = `${/*value*/
l[5]} icon`);
},
m(i, o) {
- In(i, e, o);
+ tl(i, e, o);
},
p(i, o) {
o & /*icon*/
- 128 && !hl(e.src, t = /*icon*/
- i[7].url) && Z(e, "src", t), o & /*value*/
+ 128 && !Hl(e.src, t = /*icon*/
+ i[7].url) && te(e, "src", t), o & /*value*/
32 && n !== (n = `${/*value*/
- i[5]} icon`) && Z(e, "alt", n);
+ i[5]} icon`) && te(e, "alt", n);
},
d(i) {
- i && Tn(e);
+ i && el(e);
}
};
}
-function jo(l) {
+function Ss(l) {
let e, t, n;
return {
c() {
- e = Ml("img"), Z(e, "class", "button-icon svelte-8huxfn"), hl(e.src, t = /*icon*/
- l[7].url) || Z(e, "src", t), Z(e, "alt", n = `${/*value*/
+ e = xl("img"), te(e, "class", "button-icon svelte-8huxfn"), Hl(e.src, t = /*icon*/
+ l[7].url) || te(e, "src", t), te(e, "alt", n = `${/*value*/
l[5]} icon`);
},
m(i, o) {
- In(i, e, o);
+ tl(i, e, o);
},
p(i, o) {
o & /*icon*/
- 128 && !hl(e.src, t = /*icon*/
- i[7].url) && Z(e, "src", t), o & /*value*/
+ 128 && !Hl(e.src, t = /*icon*/
+ i[7].url) && te(e, "src", t), o & /*value*/
32 && n !== (n = `${/*value*/
- i[5]} icon`) && Z(e, "alt", n);
+ i[5]} icon`) && te(e, "alt", n);
},
d(i) {
- i && Tn(e);
+ i && el(e);
}
};
}
-function Ed(l) {
+function T0(l) {
let e, t, n, i;
- const o = [qd, Bd], s = [];
+ const o = [R0, D0], s = [];
function r(a, f) {
return (
/*link*/
@@ -5500,35 +6302,35 @@ function Ed(l) {
}
return e = r(l), t = s[e] = o[e](l), {
c() {
- t.c(), n = kd();
+ t.c(), n = B0();
},
m(a, f) {
- s[e].m(a, f), In(a, n, f), i = !0;
+ s[e].m(a, f), tl(a, n, f), i = !0;
},
p(a, [f]) {
let u = e;
- e = r(a), e === u ? s[e].p(a, f) : (yd(), gl(s[u], 1, 1, () => {
+ e = r(a), e === u ? s[e].p(a, f) : (E0(), Xl(s[u], 1, 1, () => {
s[u] = null;
- }), vd(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), ml(t, 1), t.m(n.parentNode, n));
+ }), q0(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), Fl(t, 1), t.m(n.parentNode, n));
},
i(a) {
- i || (ml(t), i = !0);
+ i || (Fl(t), i = !0);
},
o(a) {
- gl(t), i = !1;
+ Xl(t), i = !1;
},
d(a) {
- a && Tn(n), s[e].d(a);
+ a && el(n), s[e].d(a);
}
};
}
-function Md(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: b = void 0 } = e;
- function w(g) {
- pd.call(this, l, g);
+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);
}
- return l.$$set = (g) => {
- "elem_id" in g && t(0, o = g.elem_id), "elem_classes" in g && t(1, s = g.elem_classes), "visible" in g && t(2, r = g.visible), "variant" in g && t(3, a = g.variant), "size" in g && t(4, f = g.size), "value" in g && t(5, u = g.value), "link" in g && t(6, c = g.link), "icon" in g && t(7, _ = g.icon), "disabled" in g && t(8, d = g.disabled), "scale" in g && t(9, h = g.scale), "min_width" in g && t(10, b = g.min_width), "$$scope" in g && t(11, i = g.$$scope);
+ 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);
}, [
o,
s,
@@ -5539,16 +6341,16 @@ function Md(l, e, t) {
c,
_,
d,
+ m,
h,
- b,
i,
n,
- w
+ p
];
}
-class vi extends wd {
+class Gi extends S0 {
constructor(e) {
- super(), Cd(this, e, Md, Ed, zd, {
+ super(), M0(this, e, I0, T0, L0, {
elem_id: 0,
elem_classes: 1,
visible: 2,
@@ -5564,56 +6366,56 @@ class vi extends wd {
}
}
const {
- SvelteComponent: Ad,
- add_render_callback: ca,
- append: Kn,
- attr: Ce,
- binding_callbacks: Fo,
- check_outros: Ld,
- create_bidirectional_transition: Xo,
- destroy_each: Rd,
- detach: Sn,
- element: bl,
- empty: Dd,
- ensure_array_like: Yo,
- group_outros: Td,
- init: Id,
- insert: zn,
- listen: ki,
- prevent_default: Hd,
- run_all: jd,
- safe_not_equal: Fd,
- set_data: Xd,
- set_style: Ot,
- space: yi,
- text: Yd,
- toggle_class: Oe,
- transition_in: ni,
- transition_out: Uo
-} = window.__gradio__svelte__internal, { createEventDispatcher: Ud } = window.__gradio__svelte__internal;
-function Vo(l, e, t) {
+ SvelteComponent: j0,
+ add_render_callback: ir,
+ append: gl,
+ attr: Ie,
+ binding_callbacks: zs,
+ check_outros: H0,
+ create_bidirectional_transition: qs,
+ destroy_each: F0,
+ detach: On,
+ element: Yl,
+ empty: X0,
+ ensure_array_like: Bs,
+ group_outros: Y0,
+ init: N0,
+ insert: Wn,
+ listen: Ji,
+ prevent_default: U0,
+ run_all: O0,
+ safe_not_equal: W0,
+ set_data: V0,
+ 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) {
const n = l.slice();
return n[26] = e[t], n;
}
-function No(l) {
- let e, t, n, i, o, s = Yo(
+function As(l) {
+ let e, t, n, i, o, s = Bs(
/*filtered_indices*/
l[1]
), r = [];
for (let a = 0; a < s.length; a += 1)
- r[a] = Oo(Vo(l, s, a));
+ r[a] = Ls(Ms(l, s, a));
return {
c() {
- e = bl("ul");
+ e = Yl("ul");
for (let a = 0; a < r.length; a += 1)
r[a].c();
- Ce(e, "class", "options svelte-yuohum"), Ce(e, "role", "listbox"), Ot(
+ Ie(e, "class", "options svelte-yuohum"), Ie(e, "role", "listbox"), rn(
e,
"bottom",
/*bottom*/
l[9]
- ), Ot(e, "max-height", `calc(${/*max_height*/
- l[10]}px - var(--window-padding))`), Ot(
+ ), rn(e, "max-height", `calc(${/*max_height*/
+ l[10]}px - var(--window-padding))`), rn(
e,
"width",
/*input_width*/
@@ -5621,10 +6423,10 @@ function No(l) {
);
},
m(a, f) {
- zn(a, e, f);
+ Wn(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 = ki(e, "mousedown", Hd(
+ l[22](e), n = !0, i || (o = Ji(e, "mousedown", U0(
/*mousedown_handler*/
l[21]
)), i = !0);
@@ -5632,29 +6434,29 @@ function No(l) {
p(a, f) {
if (f & /*filtered_indices, choices, selected_indices, active_index*/
51) {
- s = Yo(
+ s = Bs(
/*filtered_indices*/
a[1]
);
let u;
for (u = 0; u < s.length; u += 1) {
- const c = Vo(a, s, u);
- r[u] ? r[u].p(c, f) : (r[u] = Oo(c), r[u].c(), r[u].m(e, null));
+ 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));
}
for (; u < r.length; u += 1)
r[u].d(1);
r.length = s.length;
}
f & /*bottom*/
- 512 && Ot(
+ 512 && rn(
e,
"bottom",
/*bottom*/
a[9]
), f & /*max_height*/
- 1024 && Ot(e, "max-height", `calc(${/*max_height*/
+ 1024 && rn(e, "max-height", `calc(${/*max_height*/
a[10]}px - var(--window-padding))`), f & /*input_width*/
- 256 && Ot(
+ 256 && rn(
e,
"width",
/*input_width*/
@@ -5662,19 +6464,19 @@ function No(l) {
);
},
i(a) {
- n || (a && ca(() => {
- n && (t || (t = Xo(e, to, { duration: 200, y: 5 }, !0)), t.run(1));
+ n || (a && ir(() => {
+ n && (t || (t = qs(e, Ho, { duration: 200, y: 5 }, !0)), t.run(1));
}), n = !0);
},
o(a) {
- a && (t || (t = Xo(e, to, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1;
+ a && (t || (t = qs(e, Ho, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1;
},
d(a) {
- a && Sn(e), Rd(r, a), l[22](null), a && t && t.end(), i = !1, o();
+ a && On(e), F0(r, a), l[22](null), a && t && t.end(), i = !1, o();
}
};
}
-function Oo(l) {
+function Ls(l) {
let e, t, n, i = (
/*choices*/
l[0][
@@ -5684,20 +6486,20 @@ function Oo(l) {
), o, s, r, a, f;
return {
c() {
- e = bl("li"), t = bl("span"), t.textContent = "✓", n = yi(), o = Yd(i), s = yi(), Ce(t, "class", "inner-item svelte-yuohum"), Oe(t, "hide", !/*selected_indices*/
+ e = Yl("li"), t = Yl("span"), t.textContent = "✓", n = Qi(), o = P0(i), s = Qi(), Ie(t, "class", "inner-item svelte-yuohum"), $e(t, "hide", !/*selected_indices*/
l[4].includes(
/*index*/
l[26]
- )), Ce(e, "class", "item svelte-yuohum"), Ce(e, "data-index", r = /*index*/
- l[26]), Ce(e, "aria-label", a = /*choices*/
+ )), Ie(e, "class", "item svelte-yuohum"), Ie(e, "data-index", r = /*index*/
+ l[26]), Ie(e, "aria-label", a = /*choices*/
l[0][
/*index*/
l[26]
- ][0]), Ce(e, "data-testid", "dropdown-option"), Ce(e, "role", "option"), Ce(e, "aria-selected", f = /*selected_indices*/
+ ][0]), Ie(e, "data-testid", "dropdown-option"), Ie(e, "role", "option"), Ie(e, "aria-selected", f = /*selected_indices*/
l[4].includes(
/*index*/
l[26]
- )), Oe(
+ )), $e(
e,
"selected",
/*selected_indices*/
@@ -5705,19 +6507,19 @@ function Oo(l) {
/*index*/
l[26]
)
- ), Oe(
+ ), $e(
e,
"active",
/*index*/
l[26] === /*active_index*/
l[5]
- ), Oe(
+ ), $e(
e,
"bg-gray-100",
/*index*/
l[26] === /*active_index*/
l[5]
- ), Oe(
+ ), $e(
e,
"dark:bg-gray-600",
/*index*/
@@ -5726,11 +6528,11 @@ function Oo(l) {
);
},
m(u, c) {
- zn(u, e, c), Kn(e, t), Kn(e, n), Kn(e, o), Kn(e, s);
+ Wn(u, e, c), gl(e, t), gl(e, n), gl(e, o), gl(e, s);
},
p(u, c) {
c & /*selected_indices, filtered_indices*/
- 18 && Oe(t, "hide", !/*selected_indices*/
+ 18 && $e(t, "hide", !/*selected_indices*/
u[4].includes(
/*index*/
u[26]
@@ -5739,20 +6541,20 @@ function Oo(l) {
u[0][
/*index*/
u[26]
- ][0] + "") && Xd(o, i), c & /*filtered_indices*/
+ ][0] + "") && V0(o, i), c & /*filtered_indices*/
2 && r !== (r = /*index*/
- u[26]) && Ce(e, "data-index", r), c & /*choices, filtered_indices*/
+ u[26]) && Ie(e, "data-index", r), c & /*choices, filtered_indices*/
3 && a !== (a = /*choices*/
u[0][
/*index*/
u[26]
- ][0]) && Ce(e, "aria-label", a), c & /*selected_indices, filtered_indices*/
+ ][0]) && Ie(e, "aria-label", a), c & /*selected_indices, filtered_indices*/
18 && f !== (f = /*selected_indices*/
u[4].includes(
/*index*/
u[26]
- )) && Ce(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/
- 18 && Oe(
+ )) && Ie(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/
+ 18 && $e(
e,
"selected",
/*selected_indices*/
@@ -5761,21 +6563,21 @@ function Oo(l) {
u[26]
)
), c & /*filtered_indices, active_index*/
- 34 && Oe(
+ 34 && $e(
e,
"active",
/*index*/
u[26] === /*active_index*/
u[5]
), c & /*filtered_indices, active_index*/
- 34 && Oe(
+ 34 && $e(
e,
"bg-gray-100",
/*index*/
u[26] === /*active_index*/
u[5]
), c & /*filtered_indices, active_index*/
- 34 && Oe(
+ 34 && $e(
e,
"dark:bg-gray-600",
/*index*/
@@ -5784,34 +6586,34 @@ function Oo(l) {
);
},
d(u) {
- u && Sn(e);
+ u && On(e);
}
};
}
-function Vd(l) {
+function K0(l) {
let e, t, n, i, o;
- ca(
+ ir(
/*onwindowresize*/
l[19]
);
let s = (
/*show_options*/
l[2] && !/*disabled*/
- l[3] && No(l)
+ l[3] && As(l)
);
return {
c() {
- e = bl("div"), t = yi(), s && s.c(), n = Dd(), Ce(e, "class", "reference");
+ e = Yl("div"), t = Qi(), s && s.c(), n = X0(), Ie(e, "class", "reference");
},
m(r, a) {
- zn(r, e, a), l[20](e), zn(r, t, a), s && s.m(r, a), zn(r, n, a), i || (o = [
- ki(
+ Wn(r, e, a), l[20](e), Wn(r, t, a), s && s.m(r, a), Wn(r, n, a), i || (o = [
+ Ji(
window,
"scroll",
/*scroll_listener*/
l[12]
),
- ki(
+ Ji(
window,
"resize",
/*onwindowresize*/
@@ -5823,71 +6625,71 @@ function Vd(l) {
/*show_options*/
r[2] && !/*disabled*/
r[3] ? s ? (s.p(r, a), a & /*show_options, disabled*/
- 12 && ni(s, 1)) : (s = No(r), s.c(), ni(s, 1), s.m(n.parentNode, n)) : s && (Td(), Uo(s, 1, 1, () => {
+ 12 && Li(s, 1)) : (s = As(r), s.c(), Li(s, 1), s.m(n.parentNode, n)) : s && (Y0(), Es(s, 1, 1, () => {
s = null;
- }), Ld());
+ }), H0());
},
i(r) {
- ni(s);
+ Li(s);
},
o(r) {
- Uo(s);
+ Es(s);
},
d(r) {
- r && (Sn(e), Sn(t), Sn(n)), l[20](null), s && s.d(r), i = !1, jd(o);
+ r && (On(e), On(t), On(n)), l[20](null), s && s.d(r), i = !1, O0(o);
}
};
}
-function Nd(l, e, t) {
+function G0(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, h, b, w, g, p, m;
+ 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: R, bottom: Q } = b.getBoundingClientRect();
- t(16, c = R), t(17, _ = m - Q);
+ const { top: L, bottom: N } = h.getBoundingClientRect();
+ t(16, c = L), t(17, _ = g - N);
}
- let y = null;
- function C() {
- r && (y !== null && clearTimeout(y), y = setTimeout(
+ let C = null;
+ function v() {
+ r && (C !== null && clearTimeout(C), C = setTimeout(
() => {
- k(), y = null;
+ k(), C = null;
},
10
));
}
- const B = Ud();
- function v() {
- t(11, m = window.innerHeight);
+ const z = Z0();
+ function y() {
+ t(11, g = window.innerHeight);
}
- function q(R) {
- Fo[R ? "unshift" : "push"](() => {
- b = R, t(6, b);
+ function A(L) {
+ zs[L ? "unshift" : "push"](() => {
+ h = L, t(6, h);
});
}
- const j = (R) => B("change", R);
- function X(R) {
- Fo[R ? "unshift" : "push"](() => {
- w = R, t(7, w);
+ const S = (L) => z("change", L);
+ function R(L) {
+ zs[L ? "unshift" : "push"](() => {
+ p = L, t(7, p);
});
}
- 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);
+ return l.$$set = (L) => {
+ "choices" in L && t(0, o = L.choices), "filtered_indices" in L && t(1, s = L.filtered_indices), "show_options" in L && t(2, r = L.show_options), "disabled" in L && t(3, a = L.disabled), "selected_indices" in L && t(4, f = L.selected_indices), "active_index" in L && t(5, u = L.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 && b) {
- if (w && f.length > 0) {
- let Q = w.querySelectorAll("li");
- for (const O of Array.from(Q))
- if (O.getAttribute("data-index") === f[0].toString()) {
- t(14, n = w == null ? void 0 : w.scrollTo) === null || n === void 0 || n.call(w, 0, O.offsetTop);
+ 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);
break;
}
}
k();
- const R = t(15, i = b.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);
+ const L = t(15, i = h.parentElement) === null || i === void 0 ? void 0 : i.getBoundingClientRect();
+ t(18, d = (L == null ? void 0 : L.height) || 0), t(8, m = (L == null ? void 0 : L.width) || 0);
}
- _ > c ? (t(10, p = _), t(9, g = null)) : (t(9, g = `${_ + d}px`), t(10, p = c - d));
+ _ > c ? (t(10, b = _), t(9, w = null)) : (t(9, w = `${_ + d}px`), t(10, b = c - d));
}
}, [
o,
@@ -5896,28 +6698,28 @@ function Nd(l, e, t) {
a,
f,
u,
- b,
- w,
h,
- g,
p,
m,
- C,
- B,
+ w,
+ b,
+ g,
+ v,
+ z,
n,
i,
c,
_,
d,
- v,
- q,
- j,
- X
+ y,
+ A,
+ S,
+ R
];
}
-class Od extends Ad {
+class J0 extends j0 {
constructor(e) {
- super(), Id(this, e, Nd, Vd, Fd, {
+ super(), N0(this, e, G0, K0, W0, {
choices: 0,
filtered_indices: 1,
show_options: 2,
@@ -5927,16 +6729,16 @@ class Od extends Ad {
});
}
}
-function Wd(l, e) {
+function Q0(l, e) {
return (l % e + e) % e;
}
-function Wo(l, e) {
+function Ds(l, e) {
return l.reduce((t, n, i) => ((!e || n[0].toLowerCase().includes(e.toLowerCase())) && t.push(i), t), []);
}
-function Pd(l, e, t) {
+function x0(l, e, t) {
l("change", e), t || l("input");
}
-function Zd(l, e, t) {
+function $0(l, e, t) {
if (l.key === "Escape")
return [!1, e];
if ((l.key === "ArrowDown" || l.key === "ArrowUp") && t.length >= 0)
@@ -5944,83 +6746,83 @@ function Zd(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[Wd(n + i, t.length)];
+ e = t[Q0(n + i, t.length)];
}
return [!0, e];
}
const {
- SvelteComponent: Kd,
- append: kt,
- attr: ye,
- binding_callbacks: Gd,
- check_outros: Jd,
- create_component: Ci,
- destroy_component: Si,
- detach: Ai,
- element: Zt,
- group_outros: Qd,
- init: xd,
- insert: Li,
- listen: un,
- mount_component: zi,
- run_all: $d,
- safe_not_equal: e1,
- set_data: t1,
- set_input_value: Po,
- space: li,
- text: n1,
- toggle_class: Wt,
- transition_in: Kt,
- transition_out: bn
-} = window.__gradio__svelte__internal, { onMount: l1 } = window.__gradio__svelte__internal, { createEventDispatcher: i1, afterUpdate: o1 } = window.__gradio__svelte__internal;
-function s1(l) {
+ SvelteComponent: eh,
+ append: It,
+ attr: Te,
+ binding_callbacks: th,
+ check_outros: nh,
+ create_component: xi,
+ destroy_component: $i,
+ detach: fo,
+ element: cn,
+ group_outros: lh,
+ init: ih,
+ insert: uo,
+ listen: Bn,
+ mount_component: eo,
+ run_all: oh,
+ safe_not_equal: sh,
+ set_data: ah,
+ set_input_value: Rs,
+ space: Di,
+ text: rh,
+ toggle_class: fn,
+ transition_in: _n,
+ transition_out: Tn
+} = window.__gradio__svelte__internal, { onMount: fh } = window.__gradio__svelte__internal, { createEventDispatcher: uh, afterUpdate: ch } = window.__gradio__svelte__internal;
+function _h(l) {
let e;
return {
c() {
- e = n1(
+ e = rh(
/*label*/
l[0]
);
},
m(t, n) {
- Li(t, e, n);
+ uo(t, e, n);
},
p(t, n) {
n[0] & /*label*/
- 1 && t1(
+ 1 && ah(
e,
/*label*/
t[0]
);
},
d(t) {
- t && Ai(e);
+ t && fo(e);
}
};
}
-function Zo(l) {
+function Ts(l) {
let e, t, n;
- return t = new Yf({}), {
+ return t = new to({}), {
c() {
- e = Zt("div"), Ci(t.$$.fragment), ye(e, "class", "icon-wrap svelte-1m1zvyj");
+ e = cn("div"), xi(t.$$.fragment), Te(e, "class", "icon-wrap svelte-1m1zvyj");
},
m(i, o) {
- Li(i, e, o), zi(t, e, null), n = !0;
+ uo(i, e, o), eo(t, e, null), n = !0;
},
i(i) {
- n || (Kt(t.$$.fragment, i), n = !0);
+ n || (_n(t.$$.fragment, i), n = !0);
},
o(i) {
- bn(t.$$.fragment, i), n = !1;
+ Tn(t.$$.fragment, i), n = !1;
},
d(i) {
- i && Ai(e), Si(t);
+ i && fo(e), $i(t);
}
};
}
-function a1(l) {
- let e, t, n, i, o, s, r, a, f, u, c, _, d, h;
- t = new ms({
+function dh(l) {
+ let e, t, n, i, o, s, r, a, f, u, c, _, d, m;
+ t = new ia({
props: {
show_label: (
/*show_label*/
@@ -6030,13 +6832,13 @@ function a1(l) {
/*info*/
l[1]
),
- $$slots: { default: [s1] },
+ $$slots: { default: [_h] },
$$scope: { ctx: l }
}
});
- let b = !/*disabled*/
- l[3] && Zo();
- return c = new Od({
+ let h = !/*disabled*/
+ l[3] && Ts();
+ return c = new J0({
props: {
show_options: (
/*show_options*/
@@ -6072,66 +6874,66 @@ function a1(l) {
l[16]
), {
c() {
- e = Zt("div"), Ci(t.$$.fragment), n = li(), i = Zt("div"), o = Zt("div"), s = Zt("div"), r = Zt("input"), f = li(), b && b.c(), u = li(), Ci(c.$$.fragment), ye(r, "role", "listbox"), ye(r, "aria-controls", "dropdown-options"), ye(
+ 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(
r,
"aria-expanded",
/*show_options*/
l[12]
- ), ye(
+ ), Te(
r,
"aria-label",
/*label*/
l[0]
- ), ye(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/
- l[3], ye(r, "autocomplete", "off"), r.readOnly = a = !/*filterable*/
- l[7], Wt(r, "subdued", !/*choices_names*/
+ ), Te(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/
+ l[3], Te(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]), ye(s, "class", "secondary-wrap svelte-1m1zvyj"), ye(o, "class", "wrap-inner svelte-1m1zvyj"), Wt(
+ l[6]), Te(s, "class", "secondary-wrap svelte-1m1zvyj"), Te(o, "class", "wrap-inner svelte-1m1zvyj"), fn(
o,
"show_options",
/*show_options*/
l[12]
- ), ye(i, "class", "wrap svelte-1m1zvyj"), ye(e, "class", "svelte-1m1zvyj"), Wt(
+ ), Te(i, "class", "wrap svelte-1m1zvyj"), Te(e, "class", "svelte-1m1zvyj"), fn(
e,
"container",
/*container*/
l[5]
);
},
- m(w, g) {
- Li(w, e, g), zi(t, e, null), kt(e, n), kt(e, i), kt(i, o), kt(o, s), kt(s, r), Po(
+ 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(
r,
/*input_text*/
l[9]
- ), l[29](r), kt(s, f), b && b.m(s, null), kt(i, u), zi(c, i, null), _ = !0, d || (h = [
- un(
+ ), l[29](r), It(s, f), h && h.m(s, null), It(i, u), eo(c, i, null), _ = !0, d || (m = [
+ Bn(
r,
"input",
/*input_input_handler*/
l[28]
),
- un(
+ Bn(
r,
"keydown",
/*handle_key_down*/
l[19]
),
- un(
+ Bn(
r,
"keyup",
/*keyup_handler*/
l[30]
),
- un(
+ Bn(
r,
"blur",
/*handle_blur*/
l[18]
),
- un(
+ Bn(
r,
"focus",
/*handle_focus*/
@@ -6139,141 +6941,141 @@ function a1(l) {
)
], d = !0);
},
- p(w, g) {
- const p = {};
- g[0] & /*show_label*/
- 16 && (p.show_label = /*show_label*/
- w[4]), g[0] & /*info*/
- 2 && (p.info = /*info*/
- w[1]), g[0] & /*label*/
- 1 | g[1] & /*$$scope*/
- 4 && (p.$$scope = { dirty: g, ctx: w }), t.$set(p), (!_ || g[0] & /*show_options*/
- 4096) && ye(
+ 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(
r,
"aria-expanded",
/*show_options*/
- w[12]
- ), (!_ || g[0] & /*label*/
- 1) && ye(
+ p[12]
+ ), (!_ || w[0] & /*label*/
+ 1) && Te(
r,
"aria-label",
/*label*/
- w[0]
- ), (!_ || g[0] & /*disabled*/
+ p[0]
+ ), (!_ || w[0] & /*disabled*/
8) && (r.disabled = /*disabled*/
- w[3]), (!_ || g[0] & /*filterable*/
+ p[3]), (!_ || w[0] & /*filterable*/
128 && a !== (a = !/*filterable*/
- w[7])) && (r.readOnly = a), g[0] & /*input_text*/
+ p[7])) && (r.readOnly = a), w[0] & /*input_text*/
512 && r.value !== /*input_text*/
- w[9] && Po(
+ p[9] && Rs(
r,
/*input_text*/
- w[9]
- ), (!_ || g[0] & /*choices_names, input_text, allow_custom_value*/
- 8768) && Wt(r, "subdued", !/*choices_names*/
- w[13].includes(
+ p[9]
+ ), (!_ || w[0] & /*choices_names, input_text, allow_custom_value*/
+ 8768) && fn(r, "subdued", !/*choices_names*/
+ p[13].includes(
/*input_text*/
- w[9]
+ p[9]
) && !/*allow_custom_value*/
- w[6]), /*disabled*/
- w[3] ? b && (Qd(), bn(b, 1, 1, () => {
- b = null;
- }), Jd()) : b ? g[0] & /*disabled*/
- 8 && Kt(b, 1) : (b = Zo(), b.c(), Kt(b, 1), b.m(s, null)), (!_ || g[0] & /*show_options*/
- 4096) && Wt(
+ p[6]), /*disabled*/
+ p[3] ? h && (lh(), Tn(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*/
+ 4096) && fn(
o,
"show_options",
/*show_options*/
- w[12]
+ p[12]
);
- const m = {};
- g[0] & /*show_options*/
- 4096 && (m.show_options = /*show_options*/
- w[12]), g[0] & /*choices*/
- 4 && (m.choices = /*choices*/
- w[2]), g[0] & /*filtered_indices*/
- 1024 && (m.filtered_indices = /*filtered_indices*/
- w[10]), g[0] & /*disabled*/
- 8 && (m.disabled = /*disabled*/
- w[3]), g[0] & /*selected_index*/
- 2048 && (m.selected_indices = /*selected_index*/
- w[11] === null ? [] : [
+ const g = {};
+ w[0] & /*show_options*/
+ 4096 && (g.show_options = /*show_options*/
+ p[12]), w[0] & /*choices*/
+ 4 && (g.choices = /*choices*/
+ p[2]), w[0] & /*filtered_indices*/
+ 1024 && (g.filtered_indices = /*filtered_indices*/
+ p[10]), w[0] & /*disabled*/
+ 8 && (g.disabled = /*disabled*/
+ p[3]), w[0] & /*selected_index*/
+ 2048 && (g.selected_indices = /*selected_index*/
+ p[11] === null ? [] : [
/*selected_index*/
- w[11]
- ]), g[0] & /*active_index*/
- 16384 && (m.active_index = /*active_index*/
- w[14]), c.$set(m), (!_ || g[0] & /*container*/
- 32) && Wt(
+ p[11]
+ ]), w[0] & /*active_index*/
+ 16384 && (g.active_index = /*active_index*/
+ p[14]), c.$set(g), (!_ || w[0] & /*container*/
+ 32) && fn(
e,
"container",
/*container*/
- w[5]
+ p[5]
);
},
- i(w) {
- _ || (Kt(t.$$.fragment, w), Kt(b), Kt(c.$$.fragment, w), _ = !0);
+ i(p) {
+ _ || (_n(t.$$.fragment, p), _n(h), _n(c.$$.fragment, p), _ = !0);
},
- o(w) {
- bn(t.$$.fragment, w), bn(b), bn(c.$$.fragment, w), _ = !1;
+ o(p) {
+ Tn(t.$$.fragment, p), Tn(h), Tn(c.$$.fragment, p), _ = !1;
},
- d(w) {
- w && Ai(e), Si(t), l[29](null), b && b.d(), Si(c), d = !1, $d(h);
+ d(p) {
+ p && fo(e), $i(t), l[29](null), h && h.d(), $i(c), d = !1, oh(m);
}
};
}
-function r1(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, b, w = !1, g, p, m = "", k = "", y = !1, C = [], B = null, v = null, q;
- const j = i1();
- o ? (q = a.map((D) => D[1]).indexOf(o), v = q, v === -1 ? (s = o, v = null) : ([m, s] = a[v], k = m), R()) : a.length > 0 && (q = 0, v = 0, [m, o] = a[v], s = o, k = m);
- function X() {
- t(13, g = a.map((D) => D[0])), t(24, p = a.map((D) => D[1]));
- }
+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((D) => D[1]).indexOf(o), y = A, y === -1 ? (s = o, y = null) : ([g, s] = a[y], k = g), L()) : a.length > 0 && (A = 0, y = 0, [g, o] = a[y], s = o, k = g);
function R() {
- X(), o === void 0 || Array.isArray(o) && o.length === 0 ? (t(9, m = ""), t(11, v = null)) : p.includes(o) ? (t(9, m = g[p.indexOf(o)]), t(11, v = p.indexOf(o))) : d ? (t(9, m = o), t(11, v = null)) : (t(9, m = ""), t(11, v = null)), t(27, q = v);
+ t(13, w = a.map((D) => D[0])), t(24, b = a.map((D) => D[1]));
+ }
+ function L() {
+ 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 Q(D) {
- if (t(11, v = parseInt(D.detail.target.dataset.index)), isNaN(v)) {
- t(11, v = null);
+ function N(D) {
+ if (t(11, y = parseInt(D.detail.target.dataset.index)), isNaN(y)) {
+ t(11, y = null);
return;
}
- t(12, w = !1), t(14, B = null), b.blur();
+ t(12, p = !1), t(14, z = null), h.blur();
}
- function O(D) {
- t(10, C = a.map((ue, pe) => pe)), t(12, w = !0), j("focus");
+ function J(D) {
+ t(10, v = a.map((O, le) => le)), t(12, p = !0), S("focus");
}
- function P() {
- d ? t(20, o = m) : t(9, m = g[p.indexOf(o)]), t(12, w = !1), t(14, B = null), j("blur");
+ function x() {
+ d ? t(20, o = g) : t(9, g = w[b.indexOf(o)]), t(12, p = !1), t(14, z = null), S("blur");
}
- function H(D) {
- t(12, [w, B] = Zd(D, B, C), w, (t(14, B), t(2, a), t(23, f), t(6, d), t(9, m), t(10, C), t(8, b), t(25, k), t(11, v), t(27, q), t(26, y), t(24, p))), D.key === "Enter" && (B !== null ? (t(11, v = B), t(12, w = !1), b.blur(), t(14, B = null)) : g.includes(m) ? (t(11, v = g.indexOf(m)), t(12, w = !1), t(14, B = null), b.blur()) : d && (t(20, o = m), t(11, v = null), t(12, w = !1), t(14, B = null), b.blur()), j("enter", o));
+ function V(D) {
+ t(12, [p, z] = $0(D, 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))), D.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));
}
- o1(() => {
- t(21, r = !1), t(26, y = !0);
- }), l1(() => {
- b.focus();
+ ch(() => {
+ t(21, r = !1), t(26, C = !0);
+ }), fh(() => {
+ h.focus();
});
- function ie() {
- m = this.value, t(9, m), t(11, v), t(27, q), t(26, y), t(2, a), t(24, p);
+ function U() {
+ g = this.value, t(9, g), t(11, y), t(27, A), t(26, C), t(2, a), t(24, b);
}
- function we(D) {
- Gd[D ? "unshift" : "push"](() => {
- b = D, t(8, b);
+ function T(D) {
+ th[D ? "unshift" : "push"](() => {
+ h = D, t(8, h);
});
}
- const oe = (D) => j("key_up", { key: D.key, input_value: m });
+ const K = (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);
+ "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, m = D.filterable);
}, l.$$.update = () => {
l.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/
- 218105860 && v !== q && v !== null && y && (t(9, [m, o] = a[v], m, (t(20, o), t(11, v), t(27, q), t(26, y), t(2, a), t(24, p))), t(27, q = v), j("select", {
- index: v,
- value: p[v],
+ 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],
selected: !0
})), l.$$.dirty[0] & /*value, old_value, value_is_output*/
- 7340032 && o != s && (R(), Pd(j, o, r), t(22, s = o)), l.$$.dirty[0] & /*choices*/
- 4 && X(), 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, C = Wo(a, m)), !d && C.length > 0 && t(14, B = C[0]), b == document.activeElement && t(12, w = !0)), l.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/
- 33556036 && m !== k && (t(10, C = Wo(a, m)), t(25, k = m), !d && C.length > 0 && t(14, B = C[0]));
+ 7340032 && o != s && (L(), 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 || L(), 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]));
}, [
n,
i,
@@ -6282,40 +7084,40 @@ function r1(l, e, t) {
c,
_,
d,
- h,
- b,
m,
- C,
+ h,
+ g,
v,
+ y,
+ p,
w,
- g,
- B,
- j,
- Q,
- O,
- P,
- H,
+ z,
+ S,
+ N,
+ J,
+ x,
+ V,
o,
r,
s,
f,
- p,
+ b,
k,
- y,
- q,
- ie,
- we,
- oe
+ C,
+ A,
+ U,
+ T,
+ K
];
}
-class f1 extends Kd {
+class mh extends eh {
constructor(e) {
- super(), xd(
+ super(), ih(
this,
e,
- r1,
- a1,
- e1,
+ hh,
+ dh,
+ sh,
{
label: 0,
info: 1,
@@ -6334,45 +7136,45 @@ class f1 extends Kd {
}
}
const {
- SvelteComponent: u1,
- append: We,
- attr: Gn,
- check_outros: c1,
- create_component: wn,
- destroy_component: pn,
- detach: Hn,
- element: ft,
- group_outros: _1,
- init: d1,
- insert: jn,
- mount_component: vn,
- safe_not_equal: h1,
- set_style: kn,
- space: Jn,
- text: Ri,
- transition_in: ut,
- transition_out: Ct
-} = window.__gradio__svelte__internal, { createEventDispatcher: m1 } = window.__gradio__svelte__internal, { onMount: g1, onDestroy: b1 } = window.__gradio__svelte__internal;
-function w1(l) {
+ SvelteComponent: gh,
+ append: et,
+ attr: bl,
+ check_outros: bh,
+ create_component: In,
+ destroy_component: jn,
+ detach: nl,
+ element: qt,
+ group_outros: wh,
+ init: ph,
+ insert: ll,
+ mount_component: Hn,
+ safe_not_equal: vh,
+ set_style: Fn,
+ space: wl,
+ text: co,
+ transition_in: Bt,
+ transition_out: Ft
+} = window.__gradio__svelte__internal, { createEventDispatcher: kh } = window.__gradio__svelte__internal, { onMount: yh, onDestroy: Ch } = window.__gradio__svelte__internal;
+function Sh(l) {
let e;
return {
c() {
- e = Ri("Cancel");
+ e = co("Cancel");
},
m(t, n) {
- jn(t, e, n);
+ ll(t, e, n);
},
d(t) {
- t && Hn(e);
+ t && nl(e);
}
};
}
-function Ko(l) {
+function Is(l) {
let e, t, n;
- return t = new vi({
+ return t = new Gi({
props: {
variant: "stop",
- $$slots: { default: [p1] },
+ $$slots: { default: [zh] },
$$scope: { ctx: l }
}
}), t.$on(
@@ -6381,10 +7183,10 @@ function Ko(l) {
l[12]
), {
c() {
- e = ft("div"), wn(t.$$.fragment), kn(e, "margin-right", "8px");
+ e = qt("div"), In(t.$$.fragment), Fn(e, "margin-right", "8px");
},
m(i, o) {
- jn(i, e, o), vn(t, e, null), n = !0;
+ ll(i, e, o), Hn(t, e, null), n = !0;
},
p(i, o) {
const s = {};
@@ -6392,47 +7194,47 @@ function Ko(l) {
65536 && (s.$$scope = { dirty: o, ctx: i }), t.$set(s);
},
i(i) {
- n || (ut(t.$$.fragment, i), n = !0);
+ n || (Bt(t.$$.fragment, i), n = !0);
},
o(i) {
- Ct(t.$$.fragment, i), n = !1;
+ Ft(t.$$.fragment, i), n = !1;
},
d(i) {
- i && Hn(e), pn(t);
+ i && nl(e), jn(t);
}
};
}
-function p1(l) {
+function zh(l) {
let e;
return {
c() {
- e = Ri("Remove");
+ e = co("Remove");
},
m(t, n) {
- jn(t, e, n);
+ ll(t, e, n);
},
d(t) {
- t && Hn(e);
+ t && nl(e);
}
};
}
-function v1(l) {
+function qh(l) {
let e;
return {
c() {
- e = Ri("OK");
+ e = co("OK");
},
m(t, n) {
- jn(t, e, n);
+ ll(t, e, n);
},
d(t) {
- t && Hn(e);
+ t && nl(e);
}
};
}
-function k1(l) {
- let e, t, n, i, o, s, r, a, f, u, c, _, d, h, b, w;
- o = new f1({
+function Bh(l) {
+ let e, t, n, i, o, s, r, a, f, u, c, _, d, m, h, p;
+ o = new mh({
props: {
value: (
/*currentLabel*/
@@ -6454,7 +7256,7 @@ function k1(l) {
"enter",
/*onDropDownEnter*/
l[7]
- ), a = new bd({
+ ), a = new C0({
props: {
value: (
/*currentColor*/
@@ -6467,9 +7269,9 @@ function k1(l) {
"change",
/*onColorChange*/
l[6]
- ), c = new vi({
+ ), c = new Gi({
props: {
- $$slots: { default: [w1] },
+ $$slots: { default: [Sh] },
$$scope: { ctx: l }
}
}), c.$on(
@@ -6477,98 +7279,98 @@ function k1(l) {
/*click_handler*/
l[11]
);
- let g = (
+ let w = (
/*showRemove*/
- l[3] && Ko(l)
+ l[3] && Is(l)
);
- return b = new vi({
+ return h = new Gi({
props: {
variant: "primary",
- $$slots: { default: [v1] },
+ $$slots: { default: [qh] },
$$scope: { ctx: l }
}
- }), b.$on(
+ }), h.$on(
"click",
/*click_handler_2*/
l[13]
), {
c() {
- e = ft("div"), t = ft("div"), n = ft("span"), i = ft("div"), wn(o.$$.fragment), s = Jn(), r = ft("div"), wn(a.$$.fragment), f = Jn(), u = ft("div"), wn(c.$$.fragment), _ = Jn(), g && g.c(), d = Jn(), h = ft("div"), wn(b.$$.fragment), kn(i, "margin-right", "10px"), kn(r, "margin-right", "40px"), kn(r, "margin-bottom", "8px"), kn(u, "margin-right", "8px"), Gn(n, "class", "model-content svelte-hkn2q1"), Gn(t, "class", "modal-container svelte-hkn2q1"), Gn(e, "class", "modal svelte-hkn2q1"), Gn(e, "id", "model-box-edit");
+ e = qt("div"), t = qt("div"), n = qt("span"), i = qt("div"), In(o.$$.fragment), s = wl(), r = qt("div"), In(a.$$.fragment), f = wl(), u = qt("div"), In(c.$$.fragment), _ = wl(), w && w.c(), d = wl(), m = qt("div"), In(h.$$.fragment), Fn(i, "margin-right", "10px"), Fn(r, "margin-right", "40px"), Fn(r, "margin-bottom", "8px"), Fn(u, "margin-right", "8px"), bl(n, "class", "model-content svelte-hkn2q1"), bl(t, "class", "modal-container svelte-hkn2q1"), bl(e, "class", "modal svelte-hkn2q1"), bl(e, "id", "model-box-edit");
},
- m(p, m) {
- jn(p, e, m), We(e, t), We(t, n), We(n, i), vn(o, i, null), We(n, s), We(n, r), vn(a, r, null), We(n, f), We(n, u), vn(c, u, null), We(n, _), g && g.m(n, null), We(n, d), We(n, h), vn(b, h, null), w = !0;
+ m(b, g) {
+ ll(b, e, g), et(e, t), et(t, n), et(n, i), Hn(o, i, null), et(n, s), et(n, r), Hn(a, r, null), et(n, f), et(n, u), Hn(c, u, null), et(n, _), w && w.m(n, null), et(n, d), et(n, m), Hn(h, m, null), p = !0;
},
- p(p, [m]) {
+ p(b, [g]) {
const k = {};
- m & /*currentLabel*/
+ g & /*currentLabel*/
1 && (k.value = /*currentLabel*/
- p[0]), m & /*choices*/
+ b[0]), g & /*choices*/
4 && (k.choices = /*choices*/
- p[2]), o.$set(k);
- const y = {};
- m & /*currentColor*/
- 2 && (y.value = /*currentColor*/
- p[1]), a.$set(y);
+ b[2]), o.$set(k);
const C = {};
- m & /*$$scope*/
- 65536 && (C.$$scope = { dirty: m, ctx: p }), c.$set(C), /*showRemove*/
- p[3] ? g ? (g.p(p, m), m & /*showRemove*/
- 8 && ut(g, 1)) : (g = Ko(p), g.c(), ut(g, 1), g.m(n, d)) : g && (_1(), Ct(g, 1, 1, () => {
- g = null;
- }), c1());
- const B = {};
- m & /*$$scope*/
- 65536 && (B.$$scope = { dirty: m, ctx: p }), b.$set(B);
+ g & /*currentColor*/
+ 2 && (C.value = /*currentColor*/
+ b[1]), a.$set(C);
+ const v = {};
+ g & /*$$scope*/
+ 65536 && (v.$$scope = { dirty: g, ctx: b }), c.$set(v), /*showRemove*/
+ b[3] ? w ? (w.p(b, g), g & /*showRemove*/
+ 8 && Bt(w, 1)) : (w = Is(b), w.c(), Bt(w, 1), w.m(n, d)) : w && (wh(), Ft(w, 1, 1, () => {
+ w = null;
+ }), bh());
+ const z = {};
+ g & /*$$scope*/
+ 65536 && (z.$$scope = { dirty: g, ctx: b }), h.$set(z);
},
- i(p) {
- w || (ut(o.$$.fragment, p), ut(a.$$.fragment, p), ut(c.$$.fragment, p), ut(g), ut(b.$$.fragment, p), w = !0);
+ i(b) {
+ p || (Bt(o.$$.fragment, b), Bt(a.$$.fragment, b), Bt(c.$$.fragment, b), Bt(w), Bt(h.$$.fragment, b), p = !0);
},
- o(p) {
- Ct(o.$$.fragment, p), Ct(a.$$.fragment, p), Ct(c.$$.fragment, p), Ct(g), Ct(b.$$.fragment, p), w = !1;
+ o(b) {
+ Ft(o.$$.fragment, b), Ft(a.$$.fragment, b), Ft(c.$$.fragment, b), Ft(w), Ft(h.$$.fragment, b), p = !1;
},
- d(p) {
- p && Hn(e), pn(o), pn(a), pn(c), g && g.d(), pn(b);
+ d(b) {
+ b && nl(e), jn(o), jn(a), jn(c), w && w.d(), jn(h);
}
};
}
-function y1(l, e, t) {
+function Eh(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 = m1();
- function c(m) {
+ const u = kh();
+ function c(g) {
u("change", {
label: i,
color: a,
- ret: m
+ ret: g
// -1: remove, 0: cancel, 1: change
});
}
- function _(m) {
- const { detail: k } = m;
- let y = k;
- Number.isInteger(y) ? (Array.isArray(s) && y < s.length && t(1, a = s[y]), Array.isArray(o) && y < o.length && t(0, i = o[y][0])) : t(0, i = y);
+ 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);
}
- function d(m) {
- const { detail: k } = m;
+ function d(g) {
+ const { detail: k } = g;
t(1, a = k);
}
- function h(m) {
- _(m), c(1);
+ function m(g) {
+ _(g), c(1);
}
- function b(m) {
- switch (m.key) {
+ function h(g) {
+ switch (g.key) {
case "Enter":
c(1);
break;
}
}
- g1(() => {
- document.addEventListener("keydown", b), t(0, i = n), t(1, a = r);
- }), b1(() => {
- document.removeEventListener("keydown", b);
+ yh(() => {
+ document.addEventListener("keydown", h), t(0, i = n), t(1, a = r);
+ }), Ch(() => {
+ document.removeEventListener("keydown", h);
});
- const w = () => c(0), g = () => c(-1), p = () => c(1);
- return l.$$set = (m) => {
- "label" in m && t(8, n = m.label), "currentLabel" in m && t(0, i = m.currentLabel), "choices" in m && t(2, o = m.choices), "choicesColors" in m && t(9, s = m.choicesColors), "color" in m && t(10, r = m.color), "currentColor" in m && t(1, a = m.currentColor), "showRemove" in m && t(3, f = m.showRemove);
+ const p = () => c(0), w = () => c(-1), b = () => 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);
}, [
i,
a,
@@ -6577,18 +7379,18 @@ function y1(l, e, t) {
c,
_,
d,
- h,
+ m,
n,
s,
r,
+ p,
w,
- g,
- p
+ b
];
}
-class _a extends u1 {
+class or extends gh {
constructor(e) {
- super(), d1(this, e, y1, k1, h1, {
+ super(), ph(this, e, Eh, Bh, vh, {
label: 8,
currentLabel: 0,
choices: 2,
@@ -6599,8 +7401,8 @@ class _a extends u1 {
});
}
}
-const ne = (l, e, t) => Math.min(Math.max(l, e), t);
-function ii(l, e) {
+const _e = (l, e, t) => Math.min(Math.max(l, e), t);
+function Ri(l, e) {
if (l.startsWith("rgba"))
return l.replace(/[\d.]+$/, e.toString());
const t = l.match(/\d+/g);
@@ -6609,61 +7411,61 @@ function ii(l, e) {
const [n, i, o] = t;
return `rgba(${n}, ${i}, ${o}, ${e})`;
}
-class oi {
- constructor(e, t, n, i, o, s, r, a, f, u, c, _ = "rgb(255, 255, 255)", d = 0.5, h = 25, b = 8, w = 2, g = 4, p = 1) {
+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) {
this.stopDrag = () => {
this.isDragging = !1, document.removeEventListener("pointermove", this.handleDrag), document.removeEventListener("pointerup", this.stopDrag);
- }, this.handleDrag = (m) => {
+ }, this.handleDrag = (g) => {
if (this.isDragging) {
- let k = m.clientX - this.offsetMouseX - this.xmin, y = m.clientY - this.offsetMouseY - this.ymin;
- const C = this.canvasXmax - this.canvasXmin, B = this.canvasYmax - this.canvasYmin;
- k = ne(k, -this.xmin, C - this.xmax), y = ne(y, -this.ymin, B - this.ymax), this.xmin += k, this.ymin += y, this.xmax += k, this.ymax += y, this.updateHandles(), this.renderCallBack();
+ 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 = _e(k, -this.xmin, v - this.xmax), C = _e(C, -this.ymin, z - this.ymax), this.xmin += k, this.ymin += C, this.xmax += k, this.ymax += C, this.updateHandles(), this.renderCallBack();
}
- }, this.handleCreating = (m) => {
+ }, this.handleCreating = (g) => {
if (this.isCreating) {
- let [k, y] = this.toBoxCoordinates(m.clientX, m.clientY);
- k -= this.offsetMouseX, y -= 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"), y > this.ymax ? (this.creatingAnchorY == "ymax" && (this.ymin = this.ymax), this.ymax = y, this.creatingAnchorY = "ymin") : y > this.ymin && y < this.ymax && this.creatingAnchorY == "ymin" ? this.ymax = y : y > this.ymin && y < this.ymax && this.creatingAnchorY == "ymax" ? this.ymin = y : y < this.ymin && (this.creatingAnchorY == "ymin" && (this.ymax = this.ymin), this.ymin = y, this.creatingAnchorY = "ymax"), this.updateHandles(), this.renderCallBack();
+ 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();
}
- }, this.stopCreating = (m) => {
+ }, 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, y = this.canvasYmax - this.canvasYmin;
- this.xmin = ne(this.xmin, 0, k - this.minSize), this.ymin = ne(this.ymin, 0, y - this.minSize), this.xmax = ne(this.xmax, this.minSize, k), this.ymax = ne(this.ymax, this.minSize, y), 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 > y ? (this.ymin -= this.ymax - y, this.ymax = y) : this.ymin < 0 && (this.ymax -= this.ymin, this.ymin = 0)), this.updateHandles(), this.renderCallBack();
+ const k = this.canvasXmax - this.canvasXmin, C = this.canvasYmax - this.canvasYmin;
+ this.xmin = _e(this.xmin, 0, k - this.minSize), this.ymin = _e(this.ymin, 0, C - this.minSize), this.xmax = _e(this.xmax, this.minSize, k), this.ymax = _e(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();
}
this.onFinishCreation();
- }, this.handleResize = (m) => {
+ }, this.handleResize = (g) => {
if (this.isResizing) {
- const k = m.clientX, y = m.clientY, C = k - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, B = y - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, v = this.canvasXmax - this.canvasXmin, q = this.canvasYmax - this.canvasYmin;
+ 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;
switch (this.resizingHandleIndex) {
case 0:
- this.xmin += C, this.ymin += B, this.xmin = ne(this.xmin, 0, this.xmax - this.minSize), this.ymin = ne(this.ymin, 0, this.ymax - this.minSize);
+ this.xmin += v, this.ymin += z, 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 += C, this.ymin += B, this.xmax = ne(this.xmax, this.xmin + this.minSize, v), this.ymin = ne(this.ymin, 0, this.ymax - this.minSize);
+ this.xmax += v, this.ymin += z, this.xmax = _e(this.xmax, this.xmin + this.minSize, y), this.ymin = _e(this.ymin, 0, this.ymax - this.minSize);
break;
case 2:
- this.xmax += C, this.ymax += B, this.xmax = ne(this.xmax, this.xmin + this.minSize, v), this.ymax = ne(this.ymax, this.ymin + this.minSize, q);
+ this.xmax += v, this.ymax += z, this.xmax = _e(this.xmax, this.xmin + this.minSize, y), this.ymax = _e(this.ymax, this.ymin + this.minSize, A);
break;
case 3:
- this.xmin += C, this.ymax += B, this.xmin = ne(this.xmin, 0, this.xmax - this.minSize), this.ymax = ne(this.ymax, this.ymin + this.minSize, q);
+ this.xmin += v, this.ymax += z, 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 += B, this.ymin = ne(this.ymin, 0, this.ymax - this.minSize);
+ this.ymin += z, this.ymin = _e(this.ymin, 0, this.ymax - this.minSize);
break;
case 5:
- this.xmax += C, this.xmax = ne(this.xmax, this.xmin + this.minSize, v);
+ this.xmax += v, this.xmax = _e(this.xmax, this.xmin + this.minSize, y);
break;
case 6:
- this.ymax += B, this.ymax = ne(this.ymax, this.ymin + this.minSize, q);
+ this.ymax += z, this.ymax = _e(this.ymax, this.ymin + this.minSize, A);
break;
case 7:
- this.xmin += C, this.xmin = ne(this.xmin, 0, this.xmax - this.minSize);
+ this.xmin += v, 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 = 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 = b, this.thickness = w, this.selectedThickness = g, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = h, 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 = 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";
}
toJSON() {
return {
@@ -6691,56 +7493,64 @@ class oi {
xmin: this.xmin - e,
ymin: this.ymin - e,
xmax: this.xmin + e,
- ymax: this.ymin + e
+ ymax: this.ymin + e,
+ cursor: "nwse-resize"
},
{
// Top right
xmin: this.xmax - e,
ymin: this.ymin - e,
xmax: this.xmax + e,
- ymax: this.ymin + e
+ ymax: this.ymin + e,
+ cursor: "nesw-resize"
},
{
// Bottom right
xmin: this.xmax - e,
ymin: this.ymax - e,
xmax: this.xmax + e,
- ymax: this.ymax + e
+ ymax: this.ymax + e,
+ cursor: "nwse-resize"
},
{
// Bottom left
xmin: this.xmin - e,
ymin: this.ymax - e,
xmax: this.xmin + e,
- ymax: this.ymax + e
+ ymax: this.ymax + e,
+ cursor: "nesw-resize"
},
{
// Top center
xmin: this.xmin + t / 2 - e,
ymin: this.ymin - e,
xmax: this.xmin + t / 2 + e,
- ymax: this.ymin + e
+ ymax: this.ymin + e,
+ cursor: "ns-resize"
},
{
// Right center
xmin: this.xmax - e,
ymin: this.ymin + n / 2 - e,
xmax: this.xmax + e,
- ymax: this.ymin + n / 2 + e
+ ymax: this.ymin + n / 2 + e,
+ cursor: "ew-resize"
},
{
// Bottom center
xmin: this.xmin + t / 2 - e,
ymin: this.ymax - e,
xmax: this.xmin + t / 2 + e,
- ymax: this.ymax + e
+ ymax: this.ymax + e,
+ cursor: "ns-resize"
},
{
// Left center
xmin: this.xmin - e,
ymin: this.ymin + n / 2 - e,
xmax: this.xmin + e,
- ymax: this.ymin + n / 2 + e
+ ymax: this.ymin + n / 2 + e,
+ cursor: "ew-resize"
}
];
}
@@ -6761,13 +7571,13 @@ class oi {
}
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 = ii(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = ii(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 = 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() !== "") {
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 = ii(this.color, 1);
+ e.fillStyle = Ri(this.color, 1);
for (const i of this.resizeHandles)
[t, n] = this.toCanvasCoordinates(i.xmin, i.ymin), e.fillRect(
t,
@@ -6798,7 +7608,7 @@ class oi {
this.resizingHandleIndex = e, this.isResizing = !0, this.offsetMouseX = t.clientX - this.resizeHandles[e].xmin, this.offsetMouseY = t.clientY - this.resizeHandles[e].ymin, document.addEventListener("pointermove", this.handleResize), document.addEventListener("pointerup", this.stopResize);
}
}
-const yt = [
+const jt = [
"rgb(255, 168, 77)",
"rgb(92, 172, 238)",
"rgb(255, 99, 71)",
@@ -6813,130 +7623,131 @@ const yt = [
"rgb(255, 193, 7)",
"rgb(255, 250, 138)"
], {
- SvelteComponent: C1,
- append: yn,
- attr: Pe,
- binding_callbacks: S1,
- bubble: Go,
- check_outros: ol,
- create_component: En,
- destroy_component: Mn,
- detach: Bt,
- element: tn,
- empty: z1,
- group_outros: sl,
- init: B1,
- insert: qt,
+ SvelteComponent: Mh,
+ append: Xn,
+ attr: tt,
+ binding_callbacks: Ah,
+ bubble: js,
+ check_outros: Bl,
+ create_component: Kn,
+ destroy_component: Gn,
+ detach: Ot,
+ element: bn,
+ empty: Lh,
+ group_outros: El,
+ init: Dh,
+ insert: Wt,
+ is_function: Rh,
listen: ct,
- mount_component: An,
- noop: q1,
- run_all: da,
- safe_not_equal: E1,
- space: Bn,
- toggle_class: Qn,
- transition_in: se,
- transition_out: Se
-} = window.__gradio__svelte__internal, { onMount: M1, onDestroy: A1, createEventDispatcher: L1 } = window.__gradio__svelte__internal;
-function Jo(l) {
+ mount_component: Jn,
+ noop: Th,
+ run_all: sr,
+ safe_not_equal: Ih,
+ space: Vn,
+ toggle_class: pl,
+ transition_in: me,
+ transition_out: je
+} = window.__gradio__svelte__internal, { onMount: jh, onDestroy: Hh, createEventDispatcher: Fh } = window.__gradio__svelte__internal;
+function Hs(l) {
let e, t, n, i, o, s, r, a, f, u;
- n = new j_({}), s = new W_({});
+ n = new O1({}), s = new Q1({});
let c = (
/*showRemoveButton*/
- l[1] && Qo(l)
+ l[1] && Fs(l)
);
return {
c() {
- e = tn("span"), t = tn("button"), En(n.$$.fragment), i = Bn(), o = tn("button"), En(s.$$.fragment), r = Bn(), c && c.c(), Pe(t, "class", "icon svelte-3rql59"), Pe(t, "aria-label", "Create box"), Qn(
+ e = bn("span"), t = bn("button"), Kn(n.$$.fragment), i = Vn(), o = bn("button"), Kn(s.$$.fragment), r = Vn(), c && c.c(), tt(t, "class", "icon svelte-3rql59"), tt(t, "aria-label", "Create box"), pl(
t,
"selected",
/*mode*/
- l[8] === /*Mode*/
- l[5].creation
- ), Pe(o, "class", "icon svelte-3rql59"), Pe(o, "aria-label", "Edit boxes"), Qn(
+ l[9] === /*Mode*/
+ l[6].creation
+ ), tt(o, "class", "icon svelte-3rql59"), tt(o, "aria-label", "Edit boxes"), pl(
o,
"selected",
/*mode*/
- l[8] === /*Mode*/
- l[5].drag
- ), Pe(e, "class", "canvas-control svelte-3rql59");
+ l[9] === /*Mode*/
+ l[6].drag
+ ), tt(e, "class", "canvas-control svelte-3rql59");
},
m(_, d) {
- qt(_, e, d), yn(e, t), An(n, t, null), yn(e, i), yn(e, o), An(s, o, null), yn(e, r), c && c.m(e, null), a = !0, f || (u = [
+ Wt(_, e, d), Xn(e, t), Jn(n, t, null), Xn(e, i), Xn(e, o), Jn(s, o, null), Xn(e, r), c && c.m(e, null), a = !0, f || (u = [
ct(
t,
"click",
/*click_handler*/
- l[30]
+ l[32]
),
ct(
o,
"click",
/*click_handler_1*/
- l[31]
+ l[33]
)
], f = !0);
},
p(_, d) {
(!a || d[0] & /*mode, Mode*/
- 288) && Qn(
+ 576) && pl(
t,
"selected",
/*mode*/
- _[8] === /*Mode*/
- _[5].creation
+ _[9] === /*Mode*/
+ _[6].creation
), (!a || d[0] & /*mode, Mode*/
- 288) && Qn(
+ 576) && pl(
o,
"selected",
/*mode*/
- _[8] === /*Mode*/
- _[5].drag
+ _[9] === /*Mode*/
+ _[6].drag
), /*showRemoveButton*/
_[1] ? c ? (c.p(_, d), d[0] & /*showRemoveButton*/
- 2 && se(c, 1)) : (c = Qo(_), c.c(), se(c, 1), c.m(e, null)) : c && (sl(), Se(c, 1, 1, () => {
+ 2 && me(c, 1)) : (c = Fs(_), c.c(), me(c, 1), c.m(e, null)) : c && (El(), je(c, 1, 1, () => {
c = null;
- }), ol());
+ }), Bl());
},
i(_) {
- a || (se(n.$$.fragment, _), se(s.$$.fragment, _), se(c), a = !0);
+ a || (me(n.$$.fragment, _), me(s.$$.fragment, _), me(c), a = !0);
},
o(_) {
- Se(n.$$.fragment, _), Se(s.$$.fragment, _), Se(c), a = !1;
+ je(n.$$.fragment, _), je(s.$$.fragment, _), je(c), a = !1;
},
d(_) {
- _ && Bt(e), Mn(n), Mn(s), c && c.d(), f = !1, da(u);
+ _ && Ot(e), Gn(n), Gn(s), c && c.d(), f = !1, sr(u);
}
};
}
-function Qo(l) {
+function Fs(l) {
let e, t, n, i, o;
- return t = new $_({}), {
+ return t = new o0({}), {
c() {
- e = tn("button"), En(t.$$.fragment), Pe(e, "class", "icon svelte-3rql59"), Pe(e, "aria-label", "Remove boxes");
+ e = bn("button"), Kn(t.$$.fragment), tt(e, "class", "icon svelte-3rql59"), tt(e, "aria-label", "Remove boxes");
},
m(s, r) {
- qt(s, e, r), An(t, e, null), n = !0, i || (o = ct(
+ Wt(s, e, r), Jn(t, e, null), n = !0, i || (o = ct(
e,
"click",
/*click_handler_2*/
- l[32]
+ l[34]
), i = !0);
},
- p: q1,
+ p: Th,
i(s) {
- n || (se(t.$$.fragment, s), n = !0);
+ n || (me(t.$$.fragment, s), n = !0);
},
o(s) {
- Se(t.$$.fragment, s), n = !1;
+ je(t.$$.fragment, s), n = !1;
},
d(s) {
- s && Bt(e), Mn(t), i = !1, o();
+ s && Ot(e), Gn(t), i = !1, o();
}
};
}
-function xo(l) {
+function Xs(l) {
let e, t;
- return e = new _a({
+ return e = new or({
props: {
choices: (
/*choices*/
@@ -6948,25 +7759,25 @@ function xo(l) {
),
label: (
/*selectedBox*/
- l[7] >= 0 && /*selectedBox*/
- l[7] < /*value*/
+ l[8] >= 0 && /*selectedBox*/
+ l[8] < /*value*/
l[0].boxes.length ? (
/*value*/
l[0].boxes[
/*selectedBox*/
- l[7]
+ l[8]
].label
) : ""
),
color: (
/*selectedBox*/
- l[7] >= 0 && /*selectedBox*/
- l[7] < /*value*/
- l[0].boxes.length ? Ln(
+ l[8] >= 0 && /*selectedBox*/
+ l[8] < /*value*/
+ l[0].boxes.length ? Qn(
/*value*/
l[0].boxes[
/*selectedBox*/
- l[7]
+ l[8]
].color
) : ""
)
@@ -6974,17 +7785,17 @@ function xo(l) {
}), e.$on(
"change",
/*onModalEditChange*/
- l[16]
+ l[18]
), e.$on(
"enter{onModalEditChange}",
/*enter_onModalEditChange_handler*/
- l[33]
+ l[35]
), {
c() {
- En(e.$$.fragment);
+ Kn(e.$$.fragment);
},
m(n, i) {
- An(e, n, i), t = !0;
+ Jn(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -6993,41 +7804,41 @@ function xo(l) {
n[3]), i[0] & /*choicesColors*/
16 && (o.choicesColors = /*choicesColors*/
n[4]), i[0] & /*selectedBox, value*/
- 129 && (o.label = /*selectedBox*/
- n[7] >= 0 && /*selectedBox*/
- n[7] < /*value*/
+ 257 && (o.label = /*selectedBox*/
+ n[8] >= 0 && /*selectedBox*/
+ n[8] < /*value*/
n[0].boxes.length ? (
/*value*/
n[0].boxes[
/*selectedBox*/
- n[7]
+ n[8]
].label
) : ""), i[0] & /*selectedBox, value*/
- 129 && (o.color = /*selectedBox*/
- n[7] >= 0 && /*selectedBox*/
- n[7] < /*value*/
- n[0].boxes.length ? Ln(
+ 257 && (o.color = /*selectedBox*/
+ n[8] >= 0 && /*selectedBox*/
+ n[8] < /*value*/
+ n[0].boxes.length ? Qn(
/*value*/
n[0].boxes[
/*selectedBox*/
- n[7]
+ n[8]
].color
) : ""), e.$set(o);
},
i(n) {
- t || (se(e.$$.fragment, n), t = !0);
+ t || (me(e.$$.fragment, n), t = !0);
},
o(n) {
- Se(e.$$.fragment, n), t = !1;
+ je(e.$$.fragment, n), t = !1;
},
d(n) {
- Mn(e, n);
+ Gn(e, n);
}
};
}
-function $o(l) {
+function Ys(l) {
let e, t;
- return e = new _a({
+ return e = new or({
props: {
choices: (
/*choices*/
@@ -7040,25 +7851,25 @@ function $o(l) {
),
label: (
/*selectedBox*/
- l[7] >= 0 && /*selectedBox*/
- l[7] < /*value*/
+ l[8] >= 0 && /*selectedBox*/
+ l[8] < /*value*/
l[0].boxes.length ? (
/*value*/
l[0].boxes[
/*selectedBox*/
- l[7]
+ l[8]
].label
) : ""
),
color: (
/*selectedBox*/
- l[7] >= 0 && /*selectedBox*/
- l[7] < /*value*/
- l[0].boxes.length ? Ln(
+ l[8] >= 0 && /*selectedBox*/
+ l[8] < /*value*/
+ l[0].boxes.length ? Qn(
/*value*/
l[0].boxes[
/*selectedBox*/
- l[7]
+ l[8]
].color
) : ""
)
@@ -7066,17 +7877,17 @@ function $o(l) {
}), e.$on(
"change",
/*onModalNewChange*/
- l[17]
+ l[19]
), e.$on(
"enter{onModalNewChange}",
/*enter_onModalNewChange_handler*/
- l[34]
+ l[36]
), {
c() {
- En(e.$$.fragment);
+ Kn(e.$$.fragment);
},
m(n, i) {
- An(e, n, i), t = !0;
+ Jn(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -7085,344 +7896,373 @@ function $o(l) {
n[3]), i[0] & /*choicesColors*/
16 && (o.choicesColors = /*choicesColors*/
n[4]), i[0] & /*selectedBox, value*/
- 129 && (o.label = /*selectedBox*/
- n[7] >= 0 && /*selectedBox*/
- n[7] < /*value*/
+ 257 && (o.label = /*selectedBox*/
+ n[8] >= 0 && /*selectedBox*/
+ n[8] < /*value*/
n[0].boxes.length ? (
/*value*/
n[0].boxes[
/*selectedBox*/
- n[7]
+ n[8]
].label
) : ""), i[0] & /*selectedBox, value*/
- 129 && (o.color = /*selectedBox*/
- n[7] >= 0 && /*selectedBox*/
- n[7] < /*value*/
- n[0].boxes.length ? Ln(
+ 257 && (o.color = /*selectedBox*/
+ n[8] >= 0 && /*selectedBox*/
+ n[8] < /*value*/
+ n[0].boxes.length ? Qn(
/*value*/
n[0].boxes[
/*selectedBox*/
- n[7]
+ n[8]
].color
) : ""), e.$set(o);
},
i(n) {
- t || (se(e.$$.fragment, n), t = !0);
+ t || (me(e.$$.fragment, n), t = !0);
},
o(n) {
- Se(e.$$.fragment, n), t = !1;
+ je(e.$$.fragment, n), t = !1;
},
d(n) {
- Mn(e, n);
+ Gn(e, n);
}
};
}
-function R1(l) {
+function Xh(l) {
let e, t, n, i, o, s, r, a, f, u = (
/*interactive*/
- l[2] && Jo(l)
+ l[2] && Hs(l)
), c = (
/*editModalVisible*/
- l[9] && xo(l)
+ l[10] && Xs(l)
), _ = (
/*newModalVisible*/
- l[10] && $o(l)
+ l[11] && Ys(l)
);
return {
c() {
- e = tn("div"), t = tn("canvas"), n = Bn(), u && u.c(), i = Bn(), c && c.c(), o = Bn(), _ && _.c(), s = z1(), Pe(t, "class", "canvas-annotator svelte-3rql59"), Pe(e, "class", "canvas-container svelte-3rql59"), Pe(e, "tabindex", "-1");
+ e = bn("div"), t = bn("canvas"), n = Vn(), u && u.c(), i = Vn(), c && c.c(), o = Vn(), _ && _.c(), s = Lh(), tt(t, "class", "canvas-annotator svelte-3rql59"), tt(e, "class", "canvas-container svelte-3rql59"), tt(e, "tabindex", "-1");
},
- m(d, h) {
- qt(d, e, h), yn(e, t), l[29](t), qt(d, n, h), u && u.m(d, h), qt(d, i, h), c && c.m(d, h), qt(d, o, h), _ && _.m(d, h), qt(d, s, h), r = !0, a || (f = [
+ m(d, m) {
+ Wt(d, e, m), Xn(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 = [
ct(
t,
"pointerdown",
/*handlePointerDown*/
- l[11]
+ l[12]
),
ct(
t,
"pointerup",
/*handlePointerUp*/
- l[12]
+ l[13]
),
+ ct(t, "pointermove", function() {
+ Rh(
+ /*handlesCursor*/
+ l[5] ? (
+ /*handlePointerMove*/
+ l[14]
+ ) : null
+ ) && /*handlesCursor*/
+ (l[5] ? (
+ /*handlePointerMove*/
+ l[14]
+ ) : null).apply(this, arguments);
+ }),
ct(
t,
"dblclick",
/*handleDoubleClick*/
- l[15]
+ l[17]
),
ct(
e,
"focusin",
/*handleCanvasFocus*/
- l[19]
+ l[21]
),
ct(
e,
"focusout",
/*handleCanvasBlur*/
- l[20]
+ l[22]
)
], a = !0);
},
- p(d, h) {
- /*interactive*/
- d[2] ? u ? (u.p(d, h), h[0] & /*interactive*/
- 4 && se(u, 1)) : (u = Jo(d), u.c(), se(u, 1), u.m(i.parentNode, i)) : u && (sl(), Se(u, 1, 1, () => {
+ 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 && (El(), je(u, 1, 1, () => {
u = null;
- }), ol()), /*editModalVisible*/
- d[9] ? c ? (c.p(d, h), h[0] & /*editModalVisible*/
- 512 && se(c, 1)) : (c = xo(d), c.c(), se(c, 1), c.m(o.parentNode, o)) : c && (sl(), Se(c, 1, 1, () => {
+ }), Bl()), /*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 && (El(), je(c, 1, 1, () => {
c = null;
- }), ol()), /*newModalVisible*/
- d[10] ? _ ? (_.p(d, h), h[0] & /*newModalVisible*/
- 1024 && se(_, 1)) : (_ = $o(d), _.c(), se(_, 1), _.m(s.parentNode, s)) : _ && (sl(), Se(_, 1, 1, () => {
+ }), Bl()), /*newModalVisible*/
+ l[11] ? _ ? (_.p(l, m), m[0] & /*newModalVisible*/
+ 2048 && me(_, 1)) : (_ = Ys(l), _.c(), me(_, 1), _.m(s.parentNode, s)) : _ && (El(), je(_, 1, 1, () => {
_ = null;
- }), ol());
+ }), Bl());
},
i(d) {
- r || (se(u), se(c), se(_), r = !0);
+ r || (me(u), me(c), me(_), r = !0);
},
o(d) {
- Se(u), Se(c), Se(_), r = !1;
+ je(u), je(c), je(_), r = !1;
},
d(d) {
- d && (Bt(e), Bt(n), Bt(i), Bt(o), Bt(s)), l[29](null), u && u.d(d), c && c.d(d), _ && _.d(d), a = !1, da(f);
+ 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);
}
};
}
-function si(l) {
+function Ii(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 + ")";
}
-function Ln(l) {
+function Qn(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 D1(l, e, t) {
+function Yh(l, e, t) {
var n;
- (function(z) {
- z[z.creation = 0] = "creation", z[z.drag = 1] = "drag";
+ (function(E) {
+ E[E.creation = 0] = "creation", E[E.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: h = !1 } = e, { singleBox: b = !1 } = e, { showRemoveButton: w = null } = e;
- w === null && (w = h);
- let g, p, m = null, k = -1, y = n.drag;
- c !== null && c.boxes.length == 0 && (y = n.creation);
- let C = 0, B = 0, v = 0, q = 0, j = 1, X = 0, R = 0, Q = !1, O = !1;
- const P = L1();
- function H() {
- if (p) {
- p.clearRect(0, 0, g.width, g.height), m !== null && p.drawImage(m, C, B, X, R);
- for (const z of c.boxes.slice().reverse())
- z.render(p);
- }
- }
- function ie(z) {
- t(7, k = z), c.boxes.forEach((F) => {
- F.setSelected(!1);
- }), z >= 0 && z < c.boxes.length && c.boxes[z].setSelected(!0), H();
- }
- function we(z) {
- o && (z.target instanceof Element && z.target.hasPointerCapture(z.pointerId) && z.target.releasePointerCapture(z.pointerId), y === n.creation ? pe(z) : y === n.drag && oe(z));
- }
- function oe(z) {
- const F = g.getBoundingClientRect(), ee = z.clientX - F.left, ze = z.clientY - F.top;
- for (const [de, ce] of c.boxes.entries()) {
- const Di = ce.indexOfPointInsideHandle(ee, ze);
- if (Di >= 0) {
- ie(de), ce.startResize(Di, z);
+ 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, L = 0, N = 0, J = !1, x = !1;
+ const V = Fh();
+ function U() {
+ if (g) {
+ g.clearRect(0, 0, b.width, b.height), k !== null && g.drawImage(k, z, y, L, N);
+ for (const E of c.boxes.slice().reverse())
+ E.render(g);
+ }
+ }
+ function T(E) {
+ t(8, C = E), c.boxes.forEach((H) => {
+ H.setSelected(!1);
+ }), E >= 0 && E < c.boxes.length && c.boxes[E].setSelected(!0), U();
+ }
+ function K(E) {
+ o && (E.target instanceof Element && E.target.hasPointerCapture(E.pointerId) && E.target.releasePointerCapture(E.pointerId), v === n.creation ? ue(E) : v === n.drag && D(E));
+ }
+ function D(E) {
+ const H = b.getBoundingClientRect(), ee = E.clientX - H.left, be = E.clientY - H.top;
+ for (const [re, Q] of c.boxes.entries()) {
+ const at = Q.indexOfPointInsideHandle(ee, be);
+ if (at >= 0) {
+ T(re), Q.startResize(at, E);
return;
}
}
- for (const [de, ce] of c.boxes.entries())
- if (ce.isPointInsideBox(ee, ze)) {
- ie(de), ce.startDrag(z);
+ for (const [re, Q] of c.boxes.entries())
+ if (Q.isPointInsideBox(ee, be)) {
+ T(re), Q.startDrag(E);
return;
}
- ie(-1);
+ h || T(-1);
+ }
+ function O(E) {
+ V("change");
}
- function D(z) {
- P("change");
+ function le(E) {
+ if (c === null || v !== n.drag)
+ return;
+ const H = b.getBoundingClientRect(), ee = E.clientX - H.left, be = E.clientY - H.top;
+ for (const [re, Q] of c.boxes.entries()) {
+ const at = Q.indexOfPointInsideHandle(ee, be);
+ if (at >= 0) {
+ t(7, b.style.cursor = Q.resizeHandles[at].cursor, b);
+ return;
+ }
+ }
+ t(7, b.style.cursor = "default", b);
}
- function ue(z) {
+ function ae(E) {
if (o)
- switch (z.key) {
+ switch (E.key) {
case "Delete":
- W();
+ ge();
break;
}
}
- function pe(z) {
- const F = g.getBoundingClientRect(), ee = (z.clientX - F.left - C) / j, ze = (z.clientY - F.top - B) / j;
- let de;
- d.length > 0 ? de = si(d[0]) : b ? c.boxes.length > 0 ? de = c.boxes[0].color : de = yt[0] : de = yt[c.boxes.length % yt.length];
- let ce = new oi(H, A, C, B, v, q, "", ee, ze, ee, ze, de, s, r, a, f, u);
- ce.startCreating(z, F.left, F.top), b ? t(0, c.boxes = [ce], c) : t(0, c.boxes = [ce, ...c.boxes], c), ie(0), H(), P("change");
+ function ue(E) {
+ const H = b.getBoundingClientRect(), ee = (E.clientX - H.left - z) / R, be = (E.clientY - H.top - y) / R;
+ let re;
+ d.length > 0 ? re = Ii(d[0]) : h ? c.boxes.length > 0 ? re = c.boxes[0].color : re = jt[0] : re = jt[c.boxes.length % jt.length];
+ let Q = new Ti(U, M, z, y, A, S, "", ee, be, ee, be, re, s, r, a, f, u);
+ Q.startCreating(E, H.left, H.top), h ? (t(0, c.boxes = [Q], c), Me()) : t(0, c.boxes = [Q, ...c.boxes], c), T(0), U(), V("change");
}
- function Ye() {
- t(8, y = n.creation), t(6, g.style.cursor = "crosshair", g);
+ function I() {
+ t(9, v = n.creation), t(7, b.style.cursor = "crosshair", b);
}
- function Ue() {
- t(8, y = n.drag), t(6, g.style.cursor = "default", g);
+ function Me() {
+ t(9, v = n.drag), t(7, b.style.cursor = "default", b);
}
- function A() {
- k >= 0 && k < c.boxes.length && (c.boxes[k].getArea() < 1 ? W() : h || t(10, O = !0));
+ function M() {
+ C >= 0 && C < c.boxes.length && (c.boxes[C].getArea() < 1 ? ge() : m || t(11, x = !0));
}
- function Je() {
- k >= 0 && k < c.boxes.length && !h && t(9, Q = !0);
+ function F() {
+ C >= 0 && C < c.boxes.length && !m && t(10, J = !0);
}
- function M(z) {
- o && Je();
+ function G(E) {
+ o && F();
}
- function Y(z) {
- t(9, Q = !1);
- const { detail: F } = z;
- let ee = F.label, ze = F.color, de = F.ret;
- if (k >= 0 && k < c.boxes.length) {
- let ce = c.boxes[k];
- de == 1 ? (ce.label = ee, ce.color = si(ze), H(), P("change")) : de == -1 && W();
+ function q(E) {
+ t(10, J = !1);
+ const { detail: H } = E;
+ let ee = H.label, be = H.color, re = H.ret;
+ if (C >= 0 && C < c.boxes.length) {
+ let Q = c.boxes[C];
+ re == 1 ? (Q.label = ee, Q.color = Ii(be), U(), V("change")) : re == -1 && ge();
}
}
- function S(z) {
- t(10, O = !1);
- const { detail: F } = z;
- let ee = F.label, ze = F.color, de = F.ret;
- if (k >= 0 && k < c.boxes.length) {
- let ce = c.boxes[k];
- de == 1 ? (ce.label = ee, ce.color = si(ze), H(), P("change")) : W();
+ function ce(E) {
+ t(11, x = !1);
+ const { detail: H } = E;
+ let ee = H.label, be = H.color, re = H.ret;
+ if (C >= 0 && C < c.boxes.length) {
+ let Q = c.boxes[C];
+ re == 1 ? (Q.label = ee, Q.color = Ii(be), U(), V("change")) : ge();
}
}
- function W() {
- k >= 0 && k < c.boxes.length && (c.boxes.splice(k, 1), ie(-1), P("change"));
+ function ge() {
+ C >= 0 && C < c.boxes.length && (c.boxes.splice(C, 1), T(-1), h && I(), V("change"));
}
- function G() {
- if (g) {
- if (j = 1, t(6, g.width = g.clientWidth, g), m !== null)
- if (m.width > g.width)
- j = g.width / m.width, X = m.width * j, R = m.height * j, C = 0, B = 0, v = X, q = R, t(6, g.height = R, g);
+ 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, L = k.width * R, N = k.height * R, z = 0, y = 0, A = L, S = N, t(7, b.height = N, b);
else {
- X = m.width, R = m.height;
- var z = (g.width - X) / 2;
- C = z, B = 0, v = z + X, q = m.height, t(6, g.height = R, g);
+ L = k.width, N = k.height;
+ var E = (b.width - L) / 2;
+ z = E, y = 0, A = E + L, S = k.height, t(7, b.height = N, b);
}
else
- C = 0, B = 0, v = g.width, q = g.height, t(6, g.height = g.clientHeight, g);
- if (v > 0 && q > 0)
- for (const F of c.boxes)
- F.canvasXmin = C, F.canvasYmin = B, F.canvasXmax = v, F.canvasYmax = q, F.setScaleFactor(j);
- H(), P("change");
- }
- }
- const Me = new ResizeObserver(G);
- function E() {
- for (let z = 0; z < c.boxes.length; z++) {
- let F = c.boxes[z];
- if (!(F instanceof oi)) {
- let ee = "", ze = "";
- F.hasOwnProperty("color") ? (ee = F.color, Array.isArray(ee) && ee.length === 3 && (ee = `rgb(${ee[0]}, ${ee[1]}, ${ee[2]})`)) : ee = yt[z % yt.length], F.hasOwnProperty("label") && (ze = F.label), F = new oi(H, A, C, B, v, q, ze, F.xmin, F.ymin, F.xmax, F.ymax, ee, s, r, a, f, u), t(0, c.boxes[z] = F, c);
+ z = 0, y = 0, A = b.width, S = b.height, t(7, b.height = b.clientHeight, b);
+ if (A > 0 && S > 0)
+ for (const H of c.boxes)
+ H.canvasXmin = z, H.canvasYmin = y, H.canvasXmax = A, H.canvasYmax = S, H.setScaleFactor(R);
+ U(), V("change");
+ }
+ }
+ const ot = new ResizeObserver(Ae);
+ function Le() {
+ for (let E = 0; E < c.boxes.length; E++) {
+ let H = c.boxes[E];
+ if (!(H instanceof Ti)) {
+ let ee = "", be = "";
+ H.hasOwnProperty("color") ? (ee = H.color, Array.isArray(ee) && ee.length === 3 && (ee = `rgb(${ee[0]}, ${ee[1]}, ${ee[2]})`)) : ee = jt[E % jt.length], H.hasOwnProperty("label") && (be = H.label), H = new Ti(U, M, z, y, A, S, be, H.xmin, H.ymin, H.xmax, H.ymax, ee, s, r, a, f, u), t(0, c.boxes[E] = H, c);
}
}
}
- function Ae() {
- i !== null && (m === null || m.src != i) && (m = new Image(), m.src = i, m.onload = function() {
- G(), H();
+ function Fe() {
+ i !== null && (k === null || k.src != i) && (k = new Image(), k.src = i, k.onload = function() {
+ Ae(), U();
});
}
- M1(() => {
+ jh(() => {
if (Array.isArray(_) && _.length > 0 && (!Array.isArray(d) || d.length == 0))
- for (let z = 0; z < _.length; z++) {
- let F = yt[z % yt.length];
- d.push(Ln(F));
+ for (let E = 0; E < _.length; E++) {
+ let H = jt[E % jt.length];
+ d.push(Qn(H));
}
- p = g.getContext("2d"), Me.observe(g), Ae(), G(), H();
+ g = b.getContext("2d"), ot.observe(b), C < 0 && c !== null && c.boxes.length > 0 && T(0), Fe(), Ae(), U();
});
- function ae() {
- document.addEventListener("keydown", ue);
+ function Ue() {
+ document.addEventListener("keydown", ae);
}
- function _e() {
- document.removeEventListener("keydown", ue);
+ function Lt() {
+ document.removeEventListener("keydown", ae);
}
- A1(() => {
- document.removeEventListener("keydown", ue);
+ Hh(() => {
+ document.removeEventListener("keydown", ae);
});
- function Le(z) {
- S1[z ? "unshift" : "push"](() => {
- g = z, t(6, g);
+ function $l(E) {
+ Ah[E ? "unshift" : "push"](() => {
+ b = E, t(7, b);
});
}
- const Re = () => Ye(), Ft = () => Ue(), Al = () => W();
- function Ll(z) {
- Go.call(this, l, z);
+ const B = () => I(), wt = () => Me(), st = () => ge();
+ function tn(E) {
+ js.call(this, l, E);
}
- function sn(z) {
- Go.call(this, l, z);
+ function ei(E) {
+ js.call(this, l, E);
}
- return l.$$set = (z) => {
- "imageUrl" in z && t(21, i = z.imageUrl), "interactive" in z && t(2, o = z.interactive), "boxAlpha" in z && t(22, s = z.boxAlpha), "boxMinSize" in z && t(23, r = z.boxMinSize), "handleSize" in z && t(24, a = z.handleSize), "boxThickness" in z && t(25, f = z.boxThickness), "boxSelectedThickness" in z && t(26, u = z.boxSelectedThickness), "value" in z && t(0, c = z.value), "choices" in z && t(3, _ = z.choices), "choicesColors" in z && t(4, d = z.choicesColors), "disableEditBoxes" in z && t(27, h = z.disableEditBoxes), "singleBox" in z && t(28, b = z.singleBox), "showRemoveButton" in z && t(1, w = z.showRemoveButton);
+ 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);
}, l.$$.update = () => {
l.$$.dirty[0] & /*value*/
- 1 && (Ae(), E(), G(), H());
+ 1 && (Fe(), Le(), Ae(), U());
}, [
c,
- w,
+ p,
o,
_,
d,
+ w,
n,
- g,
- k,
- y,
- Q,
+ b,
+ C,
+ v,
+ J,
+ x,
+ K,
O,
- we,
- D,
- Ye,
+ le,
+ I,
+ Me,
+ G,
+ q,
+ ce,
+ ge,
Ue,
- M,
- Y,
- S,
- W,
- ae,
- _e,
+ Lt,
i,
s,
r,
a,
f,
u,
+ m,
h,
- b,
- Le,
- Re,
- Ft,
- Al,
- Ll,
- sn
+ $l,
+ B,
+ wt,
+ st,
+ tn,
+ ei
];
}
-class T1 extends C1 {
+class Nh extends Mh {
constructor(e) {
- super(), B1(
+ super(), Dh(
this,
e,
- D1,
- R1,
- E1,
+ Yh,
+ Xh,
+ Ih,
{
- imageUrl: 21,
+ imageUrl: 23,
interactive: 2,
- boxAlpha: 22,
- boxMinSize: 23,
- handleSize: 24,
- boxThickness: 25,
- boxSelectedThickness: 26,
+ boxAlpha: 24,
+ boxMinSize: 25,
+ handleSize: 26,
+ boxThickness: 27,
+ boxSelectedThickness: 28,
value: 0,
choices: 3,
choicesColors: 4,
- disableEditBoxes: 27,
- singleBox: 28,
- showRemoveButton: 1
+ disableEditBoxes: 29,
+ singleBox: 30,
+ showRemoveButton: 1,
+ handlesCursor: 5
},
null,
[-1, -1]
@@ -7430,22 +8270,22 @@ class T1 extends C1 {
}
}
const {
- SvelteComponent: I1,
- add_flush_callback: H1,
- bind: j1,
- binding_callbacks: F1,
- create_component: X1,
- destroy_component: Y1,
- init: U1,
- mount_component: V1,
- safe_not_equal: N1,
- transition_in: O1,
- transition_out: W1
-} = window.__gradio__svelte__internal, { createEventDispatcher: P1 } = window.__gradio__svelte__internal;
-function Z1(l) {
+ 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) {
let e, t, n;
function i(s) {
- l[16](s);
+ l[17](s);
}
let o = {
interactive: (
@@ -7492,24 +8332,28 @@ function Z1(l) {
/*showRemoveButton*/
l[11]
),
+ handlesCursor: (
+ /*handlesCursor*/
+ l[12]
+ ),
imageUrl: (
/*resolved_src*/
- l[12]
+ l[13]
)
};
return (
/*value*/
l[0] !== void 0 && (o.value = /*value*/
- l[0]), e = new T1({ props: o }), F1.push(() => j1(e, "value", i)), e.$on(
+ l[0]), e = new Nh({ props: o }), Vh.push(() => Wh(e, "value", i)), e.$on(
"change",
/*change_handler*/
- l[17]
+ l[18]
), {
c() {
- X1(e.$$.fragment);
+ Ph(e.$$.fragment);
},
m(s, r) {
- V1(e, s, r), n = !0;
+ Gh(e, s, r), n = !0;
},
p(s, [r]) {
const a = {};
@@ -7535,40 +8379,42 @@ function Z1(l) {
1024 && (a.singleBox = /*singleBox*/
s[10]), r & /*showRemoveButton*/
2048 && (a.showRemoveButton = /*showRemoveButton*/
- s[11]), r & /*resolved_src*/
- 4096 && (a.imageUrl = /*resolved_src*/
- s[12]), !t && r & /*value*/
+ s[11]), r & /*handlesCursor*/
+ 4096 && (a.handlesCursor = /*handlesCursor*/
+ s[12]), r & /*resolved_src*/
+ 8192 && (a.imageUrl = /*resolved_src*/
+ s[13]), !t && r & /*value*/
1 && (t = !0, a.value = /*value*/
- s[0], H1(() => t = !1)), e.$set(a);
+ s[0], Oh(() => t = !1)), e.$set(a);
},
i(s) {
- n || (O1(e.$$.fragment, s), n = !0);
+ n || (Qh(e.$$.fragment, s), n = !0);
},
o(s) {
- W1(e.$$.fragment, s), n = !1;
+ xh(e.$$.fragment, s), n = !1;
},
d(s) {
- Y1(e, s);
+ Zh(e, s);
}
}
);
}
-function K1(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: h } = e, { showRemoveButton: b } = e, w, g;
- const p = P1();
- function m(y) {
- _ = y, t(0, _);
+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, _);
}
- const k = () => p("change");
- return l.$$set = (y) => {
- "src" in y && t(14, n = y.src), "interactive" in y && t(1, i = y.interactive), "boxesAlpha" in y && t(2, o = y.boxesAlpha), "labelList" in y && t(3, s = y.labelList), "labelColors" in y && t(4, r = y.labelColors), "boxMinSize" in y && t(5, a = y.boxMinSize), "handleSize" in y && t(6, f = y.handleSize), "boxThickness" in y && t(7, u = y.boxThickness), "boxSelectedThickness" in y && t(8, c = y.boxSelectedThickness), "value" in y && t(0, _ = y.value), "disableEditBoxes" in y && t(9, d = y.disableEditBoxes), "singleBox" in y && t(10, h = y.singleBox), "showRemoveButton" in y && t(11, b = y.showRemoveButton);
+ 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);
}, l.$$.update = () => {
if (l.$$.dirty & /*src, latest_src*/
- 49152) {
- t(12, w = n), t(15, g = n);
- const y = n;
- jc(y).then((C) => {
- g === y && t(12, w = C);
+ 98304) {
+ t(13, w = n), t(16, b = n);
+ const v = n;
+ $_(v).then((z) => {
+ b === v && t(13, w = z);
});
}
}, [
@@ -7582,20 +8428,21 @@ function K1(l, e, t) {
u,
c,
d,
+ m,
h,
- b,
- w,
p,
- n,
+ w,
g,
- m,
- k
+ n,
+ b,
+ k,
+ C
];
}
-class G1 extends I1 {
+class nm extends Uh {
constructor(e) {
- super(), U1(this, e, K1, Z1, N1, {
- src: 14,
+ super(), Kh(this, e, tm, em, Jh, {
+ src: 15,
interactive: 1,
boxesAlpha: 2,
labelList: 3,
@@ -7607,47 +8454,48 @@ class G1 extends I1 {
value: 0,
disableEditBoxes: 9,
singleBox: 10,
- showRemoveButton: 11
+ showRemoveButton: 11,
+ handlesCursor: 12
});
}
}
-class J1 {
+class Ns {
constructor() {
this.boxes = [];
}
}
const {
- SvelteComponent: Q1,
- add_flush_callback: wl,
- append: cn,
- attr: Cn,
- bind: pl,
- binding_callbacks: Rn,
- bubble: ai,
- check_outros: Gt,
- create_component: mt,
- create_slot: x1,
- destroy_component: gt,
- detach: At,
- element: qn,
- empty: $1,
- get_all_dirty_from_scope: e0,
- get_slot_changes: t0,
- group_outros: Jt,
- init: n0,
- insert: Lt,
- mount_component: bt,
- noop: l0,
- safe_not_equal: i0,
- space: Pt,
- toggle_class: es,
- transition_in: N,
- transition_out: J,
- update_slot_base: o0
-} = window.__gradio__svelte__internal, { createEventDispatcher: s0 } = window.__gradio__svelte__internal;
-function ts(l) {
+ SvelteComponent: lm,
+ add_flush_callback: Nl,
+ append: un,
+ attr: Yn,
+ bind: Ul,
+ binding_callbacks: xn,
+ bubble: En,
+ check_outros: Xt,
+ create_component: dt,
+ create_slot: im,
+ destroy_component: ht,
+ detach: Zt,
+ element: Pn,
+ empty: om,
+ get_all_dirty_from_scope: sm,
+ get_slot_changes: am,
+ group_outros: Yt,
+ init: rm,
+ insert: Kt,
+ mount_component: mt,
+ noop: fm,
+ safe_not_equal: um,
+ space: Ht,
+ toggle_class: Us,
+ transition_in: Z,
+ transition_out: $,
+ update_slot_base: cm
+} = window.__gradio__svelte__internal, { createEventDispatcher: _m, tick: dm } = window.__gradio__svelte__internal;
+function Os(l) {
let e, t;
- return e = new Jc({
+ return e = new _d({
props: {
href: (
/*value*/
@@ -7657,15 +8505,15 @@ function ts(l) {
/*value*/
l[1].image.orig_name || "image"
),
- $$slots: { default: [a0] },
+ $$slots: { default: [hm] },
$$scope: { ctx: l }
}
}), {
c() {
- mt(e.$$.fragment);
+ dt(e.$$.fragment);
},
m(n, i) {
- bt(e, n, i), t = !0;
+ mt(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -7675,24 +8523,24 @@ function ts(l) {
2 && (o.download = /*value*/
n[1].image.orig_name || "image"), i[0] & /*i18n*/
256 | i[1] & /*$$scope*/
- 8192 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 1048576 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
},
i(n) {
- t || (N(e.$$.fragment, n), t = !0);
+ t || (Z(e.$$.fragment, n), t = !0);
},
o(n) {
- J(e.$$.fragment, n), t = !1;
+ $(e.$$.fragment, n), t = !1;
},
d(n) {
- gt(e, n);
+ ht(e, n);
}
};
}
-function a0(l) {
+function hm(l) {
let e, t;
- return e = new vl({
+ return e = new Ol({
props: {
- Icon: Rf,
+ Icon: Yu,
label: (
/*i18n*/
l[8]("common.download")
@@ -7700,10 +8548,10 @@ function a0(l) {
}
}), {
c() {
- mt(e.$$.fragment);
+ dt(e.$$.fragment);
},
m(n, i) {
- bt(e, n, i), t = !0;
+ mt(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -7712,19 +8560,19 @@ function a0(l) {
n[8]("common.download")), e.$set(o);
},
i(n) {
- t || (N(e.$$.fragment, n), t = !0);
+ t || (Z(e.$$.fragment, n), t = !0);
},
o(n) {
- J(e.$$.fragment, n), t = !1;
+ $(e.$$.fragment, n), t = !1;
},
d(n) {
- gt(e, n);
+ ht(e, n);
}
};
}
-function ns(l) {
+function Ws(l) {
let e, t;
- return e = new Tu({
+ return e = new Kc({
props: {
i18n: (
/*i18n*/
@@ -7732,7 +8580,7 @@ function ns(l) {
),
formatter: (
/*func*/
- l[34]
+ l[36]
),
value: (
/*value*/
@@ -7742,17 +8590,17 @@ function ns(l) {
}), e.$on(
"share",
/*share_handler*/
- l[35]
+ l[37]
), e.$on(
"error",
/*error_handler*/
- l[36]
+ l[38]
), {
c() {
- mt(e.$$.fragment);
+ dt(e.$$.fragment);
},
m(n, i) {
- bt(e, n, i), t = !0;
+ mt(e, n, i), t = !0;
},
p(n, i) {
const o = {};
@@ -7763,53 +8611,53 @@ function ns(l) {
n[1]), e.$set(o);
},
i(n) {
- t || (N(e.$$.fragment, n), t = !0);
+ t || (Z(e.$$.fragment, n), t = !0);
},
o(n) {
- J(e.$$.fragment, n), t = !1;
+ $(e.$$.fragment, n), t = !1;
},
d(n) {
- gt(e, n);
+ ht(e, n);
}
};
}
-function ls(l) {
+function Vs(l) {
let e, t, n;
- return t = new vl({
- props: { Icon: ws, label: "Remove Image" }
+ return t = new Ol({
+ props: { Icon: aa, label: "Remove Image" }
}), t.$on(
"click",
/*clear*/
- l[32]
+ l[34]
), {
c() {
- e = qn("div"), mt(t.$$.fragment);
+ e = Pn("div"), dt(t.$$.fragment);
},
m(i, o) {
- Lt(i, e, o), bt(t, e, null), n = !0;
+ Kt(i, e, o), mt(t, e, null), n = !0;
},
- p: l0,
+ p: fm,
i(i) {
- n || (N(t.$$.fragment, i), n = !0);
+ n || (Z(t.$$.fragment, i), n = !0);
},
o(i) {
- J(t.$$.fragment, i), n = !1;
+ $(t.$$.fragment, i), n = !1;
},
d(i) {
- i && At(e), gt(t);
+ i && Zt(e), ht(t);
}
};
}
-function is(l) {
+function Ps(l) {
let e;
const t = (
/*#slots*/
- l[33].default
- ), n = x1(
+ l[35].default
+ ), n = im(
t,
l,
/*$$scope*/
- l[44],
+ l[51],
null
);
return {
@@ -7821,70 +8669,137 @@ function is(l) {
},
p(i, o) {
n && n.p && (!e || o[1] & /*$$scope*/
- 8192) && o0(
+ 1048576) && cm(
n,
t,
i,
/*$$scope*/
- i[44],
- e ? t0(
+ i[51],
+ e ? am(
t,
/*$$scope*/
- i[44],
+ i[51],
o,
null
- ) : e0(
+ ) : sm(
/*$$scope*/
- i[44]
+ i[51]
),
null
);
},
i(i) {
- e || (N(n, i), e = !0);
+ e || (Z(n, i), e = !0);
},
o(i) {
- J(n, i), e = !1;
+ $(n, i), e = !1;
},
d(i) {
n && n.d(i);
}
};
}
-function r0(l) {
+function mm(l) {
let e, t, n = (
/*value*/
- l[1] === null && is(l)
+ l[1] === null && Ps(l)
);
return {
c() {
- n && n.c(), e = $1();
+ n && n.c(), e = om();
},
m(i, o) {
- n && n.m(i, o), Lt(i, e, o), t = !0;
+ n && n.m(i, o), Kt(i, e, o), t = !0;
},
p(i, o) {
/*value*/
i[1] === null ? n ? (n.p(i, o), o[0] & /*value*/
- 2 && N(n, 1)) : (n = is(i), n.c(), N(n, 1), n.m(e.parentNode, e)) : n && (Jt(), J(n, 1, 1, () => {
+ 2 && Z(n, 1)) : (n = Ps(i), n.c(), Z(n, 1), n.m(e.parentNode, e)) : n && (Yt(), $(n, 1, 1, () => {
n = null;
- }), Gt());
+ }), Xt());
},
i(i) {
- t || (N(n), t = !0);
+ t || (Z(n), t = !0);
},
o(i) {
- J(n), t = !1;
+ $(n), t = !1;
},
d(i) {
- i && At(e), n && n.d(i);
+ i && Zt(e), n && n.d(i);
}
};
}
-function os(l) {
+function Zs(l) {
+ let e, t;
+ return e = new j1({
+ props: {
+ root: (
+ /*root*/
+ l[6]
+ ),
+ mode: "image",
+ include_audio: !1,
+ i18n: (
+ /*i18n*/
+ l[8]
+ ),
+ upload: (
+ /*upload*/
+ l[28]
+ )
+ }
+ }), e.$on(
+ "capture",
+ /*capture_handler*/
+ l[43]
+ ), e.$on(
+ "stream",
+ /*stream_handler_1*/
+ l[44]
+ ), e.$on(
+ "error",
+ /*error_handler_2*/
+ l[45]
+ ), e.$on(
+ "drag",
+ /*drag_handler*/
+ l[46]
+ ), e.$on(
+ "upload",
+ /*upload_handler*/
+ l[47]
+ ), {
+ c() {
+ dt(e.$$.fragment);
+ },
+ m(n, i) {
+ mt(e, n, i), t = !0;
+ },
+ p(n, i) {
+ const o = {};
+ i[0] & /*root*/
+ 64 && (o.root = /*root*/
+ n[6]), i[0] & /*i18n*/
+ 256 && (o.i18n = /*i18n*/
+ n[8]), i[0] & /*upload*/
+ 268435456 && (o.upload = /*upload*/
+ n[28]), e.$set(o);
+ },
+ i(n) {
+ t || (Z(e.$$.fragment, n), t = !0);
+ },
+ o(n) {
+ $(e.$$.fragment, n), t = !1;
+ },
+ d(n) {
+ ht(e, n);
+ }
+ };
+}
+function Ks(l) {
let e, t, n, i;
function o(r) {
- l[41](r);
+ l[48](r);
}
let s = {
boxesAlpha: (
@@ -7927,9 +8842,13 @@ function os(l) {
/*showRemoveButton*/
l[20]
),
+ handlesCursor: (
+ /*handlesCursor*/
+ l[21]
+ ),
boxSelectedThickness: (
/*boxSelectedThickness*/
- l[21]
+ l[22]
),
src: (
/*value*/
@@ -7939,13 +8858,13 @@ function os(l) {
return (
/*value*/
l[1] !== void 0 && (s.value = /*value*/
- l[1]), t = new G1({ props: s }), Rn.push(() => pl(t, "value", o)), t.$on(
+ l[1]), t = new nm({ props: s }), xn.push(() => Ul(t, "value", o)), t.$on(
"change",
/*change_handler*/
- l[42]
+ l[49]
), {
c() {
- e = qn("div"), mt(t.$$.fragment), Cn(e, "class", "image-frame svelte-1gjdske"), es(
+ e = Pn("div"), dt(t.$$.fragment), Yn(e, "class", "image-frame svelte-1gjdske"), Us(
e,
"selectable",
/*selectable*/
@@ -7953,7 +8872,7 @@ function os(l) {
);
},
m(r, a) {
- Lt(r, e, a), bt(t, e, null), i = !0;
+ Kt(r, e, a), mt(t, e, null), i = !0;
},
p(r, a) {
const f = {};
@@ -7977,14 +8896,16 @@ function os(l) {
262144 && (f.disableEditBoxes = /*disableEditBoxes*/
r[18]), a[0] & /*showRemoveButton*/
1048576 && (f.showRemoveButton = /*showRemoveButton*/
- r[20]), a[0] & /*boxSelectedThickness*/
- 2097152 && (f.boxSelectedThickness = /*boxSelectedThickness*/
- r[21]), a[0] & /*value*/
+ r[20]), a[0] & /*handlesCursor*/
+ 2097152 && (f.handlesCursor = /*handlesCursor*/
+ r[21]), a[0] & /*boxSelectedThickness*/
+ 4194304 && (f.boxSelectedThickness = /*boxSelectedThickness*/
+ r[22]), a[0] & /*value*/
2 && (f.src = /*value*/
r[1].image.url), !n && a[0] & /*value*/
2 && (n = !0, f.value = /*value*/
- r[1], wl(() => n = !1)), t.$set(f), (!i || a[0] & /*selectable*/
- 32) && es(
+ r[1], Nl(() => n = !1)), t.$set(f), (!i || a[0] & /*selectable*/
+ 32) && Us(
e,
"selectable",
/*selectable*/
@@ -7992,21 +8913,21 @@ function os(l) {
);
},
i(r) {
- i || (N(t.$$.fragment, r), i = !0);
+ i || (Z(t.$$.fragment, r), i = !0);
},
o(r) {
- J(t.$$.fragment, r), i = !1;
+ $(t.$$.fragment, r), i = !1;
},
d(r) {
- r && At(e), gt(t);
+ r && Zt(e), ht(t);
}
}
);
}
-function ss(l) {
+function Gs(l) {
let e, t, n;
function i(s) {
- l[43](s);
+ l[50](s);
}
let o = {
sources: (
@@ -8015,22 +8936,22 @@ function ss(l) {
),
handle_clear: (
/*handle_clear*/
- l[29]
+ l[30]
),
handle_select: (
/*handle_select_source*/
- l[31]
+ l[33]
)
};
return (
/*active_source*/
l[0] !== void 0 && (o.active_source = /*active_source*/
- l[0]), e = new Ju({ props: o }), Rn.push(() => pl(e, "active_source", i)), {
+ l[0]), e = new u_({ props: o }), xn.push(() => Ul(e, "active_source", i)), {
c() {
- mt(e.$$.fragment);
+ dt(e.$$.fragment);
},
m(s, r) {
- bt(e, s, r), n = !0;
+ mt(e, s, r), n = !0;
},
p(s, r) {
const a = {};
@@ -8038,35 +8959,35 @@ function ss(l) {
16 && (a.sources = /*sources*/
s[4]), !t && r[0] & /*active_source*/
1 && (t = !0, a.active_source = /*active_source*/
- s[0], wl(() => t = !1)), e.$set(a);
+ s[0], Nl(() => t = !1)), e.$set(a);
},
i(s) {
- n || (N(e.$$.fragment, s), n = !0);
+ n || (Z(e.$$.fragment, s), n = !0);
},
o(s) {
- J(e.$$.fragment, s), n = !1;
+ $(e.$$.fragment, s), n = !1;
},
d(s) {
- gt(e, s);
+ ht(e, s);
}
}
);
}
-function f0(l) {
- let e, t, n, i, o, s, r, a, f, u, c, _, d, h = (
+function gm(l) {
+ let e, t, n, i, o, s, r, a, f, u, c, _, d, m, h = (
/*sources*/
(l[4].length > 1 || /*sources*/
l[4].includes("clipboard")) && /*value*/
l[1] === null && /*interactive*/
l[7]
- ), b;
- e = new Rr({
+ ), p;
+ e = new qf({
props: {
show_label: (
/*show_label*/
l[3]
),
- Icon: ps,
+ Icon: ra,
label: (
/*label*/
l[2] || "Image Annotator"
@@ -8076,27 +8997,28 @@ function f0(l) {
let w = (
/*showDownloadButton*/
l[10] && /*value*/
- l[1] !== null && ts(l)
- ), g = (
+ l[1] !== null && Os(l)
+ ), b = (
/*showShareButton*/
l[9] && /*value*/
- l[1] !== null && ns(l)
- ), p = (
+ l[1] !== null && Ws(l)
+ ), g = (
/*showClearButton*/
l[11] && /*value*/
l[1] !== null && /*interactive*/
- l[7] && ls(l)
+ l[7] && Vs(l)
);
- function m(v) {
- l[38](v);
+ function k(S) {
+ l[40](S);
}
- function k(v) {
- l[39](v);
+ function C(S) {
+ l[41](S);
}
- let y = {
+ let v = {
hidden: (
/*value*/
- l[1] !== null
+ l[1] !== null || /*active_source*/
+ l[0] === "webcam"
),
filetype: (
/*active_source*/
@@ -8108,201 +9030,225 @@ function f0(l) {
),
max_file_size: (
/*max_file_size*/
- l[22]
+ l[23]
),
disable_click: !/*sources*/
l[4].includes("upload"),
upload: (
/*cli_upload*/
- l[23]
+ l[24]
),
stream_handler: (
/*stream_handler*/
- l[24]
+ l[25]
),
- $$slots: { default: [r0] },
+ $$slots: { default: [mm] },
$$scope: { ctx: l }
};
/*uploading*/
- l[25] !== void 0 && (y.uploading = /*uploading*/
- l[25]), /*dragging*/
- l[26] !== void 0 && (y.dragging = /*dragging*/
- l[26]), f = new A_({ props: y }), l[37](f), Rn.push(() => pl(f, "uploading", m)), Rn.push(() => pl(f, "dragging", k)), f.$on(
+ 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[39](f), xn.push(() => Ul(f, "uploading", k)), xn.push(() => Ul(f, "dragging", C)), f.$on(
"load",
/*handle_upload*/
- l[28]
+ l[29]
), f.$on(
"error",
/*error_handler_1*/
- l[40]
+ l[42]
);
- let C = (
+ let z = (
/*value*/
- l[1] !== null && os(l)
- ), B = h && ss(l);
+ l[1] === null && /*active_source*/
+ l[0] === "webcam" && Zs(l)
+ ), y = (
+ /*value*/
+ l[1] !== null && Ks(l)
+ ), A = h && Gs(l);
return {
c() {
- mt(e.$$.fragment), t = Pt(), n = qn("div"), w && w.c(), i = Pt(), g && g.c(), o = Pt(), p && p.c(), s = Pt(), r = qn("div"), a = qn("div"), mt(f.$$.fragment), _ = Pt(), C && C.c(), d = Pt(), B && B.c(), Cn(n, "class", "icon-buttons svelte-1gjdske"), Cn(a, "class", "upload-container svelte-1gjdske"), Cn(r, "data-testid", "image"), Cn(r, "class", "image-container svelte-1gjdske");
- },
- m(v, q) {
- bt(e, v, q), Lt(v, t, q), Lt(v, n, q), w && w.m(n, null), cn(n, i), g && g.m(n, null), cn(n, o), p && p.m(n, null), Lt(v, s, q), Lt(v, r, q), cn(r, a), bt(f, a, null), cn(a, _), C && C.m(a, null), cn(r, d), B && B.m(r, null), b = !0;
- },
- p(v, q) {
- const j = {};
- q[0] & /*show_label*/
- 8 && (j.show_label = /*show_label*/
- v[3]), q[0] & /*label*/
- 4 && (j.label = /*label*/
- v[2] || "Image Annotator"), e.$set(j), /*showDownloadButton*/
- v[10] && /*value*/
- v[1] !== null ? w ? (w.p(v, q), q[0] & /*showDownloadButton, value*/
- 1026 && N(w, 1)) : (w = ts(v), w.c(), N(w, 1), w.m(n, i)) : w && (Jt(), J(w, 1, 1, () => {
+ dt(e.$$.fragment), t = Ht(), n = Pn("div"), w && w.c(), i = Ht(), b && b.c(), o = Ht(), g && g.c(), s = Ht(), r = Pn("div"), a = Pn("div"), dt(f.$$.fragment), _ = Ht(), z && z.c(), d = Ht(), y && y.c(), m = Ht(), A && A.c(), Yn(n, "class", "icon-buttons svelte-1gjdske"), Yn(a, "class", "upload-container svelte-1gjdske"), Yn(r, "data-testid", "image"), Yn(r, "class", "image-container svelte-1gjdske");
+ },
+ m(S, R) {
+ mt(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), mt(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 L = {};
+ R[0] & /*show_label*/
+ 8 && (L.show_label = /*show_label*/
+ S[3]), R[0] & /*label*/
+ 4 && (L.label = /*label*/
+ S[2] || "Image Annotator"), e.$set(L), /*showDownloadButton*/
+ S[10] && /*value*/
+ S[1] !== null ? w ? (w.p(S, R), R[0] & /*showDownloadButton, value*/
+ 1026 && Z(w, 1)) : (w = Os(S), w.c(), Z(w, 1), w.m(n, i)) : w && (Yt(), $(w, 1, 1, () => {
w = null;
- }), Gt()), /*showShareButton*/
- v[9] && /*value*/
- v[1] !== null ? g ? (g.p(v, q), q[0] & /*showShareButton, value*/
- 514 && N(g, 1)) : (g = ns(v), g.c(), N(g, 1), g.m(n, o)) : g && (Jt(), J(g, 1, 1, () => {
+ }), Xt()), /*showShareButton*/
+ S[9] && /*value*/
+ S[1] !== null ? b ? (b.p(S, R), R[0] & /*showShareButton, value*/
+ 514 && Z(b, 1)) : (b = Ws(S), b.c(), Z(b, 1), b.m(n, o)) : b && (Yt(), $(b, 1, 1, () => {
+ b = null;
+ }), Xt()), /*showClearButton*/
+ S[11] && /*value*/
+ S[1] !== null && /*interactive*/
+ S[7] ? g ? (g.p(S, R), R[0] & /*showClearButton, value, interactive*/
+ 2178 && Z(g, 1)) : (g = Vs(S), g.c(), Z(g, 1), g.m(n, null)) : g && (Yt(), $(g, 1, 1, () => {
g = null;
- }), Gt()), /*showClearButton*/
- v[11] && /*value*/
- v[1] !== null && /*interactive*/
- v[7] ? p ? (p.p(v, q), q[0] & /*showClearButton, value, interactive*/
- 2178 && N(p, 1)) : (p = ls(v), p.c(), N(p, 1), p.m(n, null)) : p && (Jt(), J(p, 1, 1, () => {
- p = null;
- }), Gt());
- const X = {};
- q[0] & /*value*/
- 2 && (X.hidden = /*value*/
- v[1] !== null), q[0] & /*active_source*/
- 1 && (X.filetype = /*active_source*/
- v[0] === "clipboard" ? "clipboard" : "image/*"), q[0] & /*root*/
- 64 && (X.root = /*root*/
- v[6]), q[0] & /*max_file_size*/
- 4194304 && (X.max_file_size = /*max_file_size*/
- v[22]), q[0] & /*sources*/
- 16 && (X.disable_click = !/*sources*/
- v[4].includes("upload")), q[0] & /*cli_upload*/
- 8388608 && (X.upload = /*cli_upload*/
- v[23]), q[0] & /*stream_handler*/
- 16777216 && (X.stream_handler = /*stream_handler*/
- v[24]), q[0] & /*value*/
- 2 | q[1] & /*$$scope*/
- 8192 && (X.$$scope = { dirty: q, ctx: v }), !u && q[0] & /*uploading*/
- 33554432 && (u = !0, X.uploading = /*uploading*/
- v[25], wl(() => u = !1)), !c && q[0] & /*dragging*/
- 67108864 && (c = !0, X.dragging = /*dragging*/
- v[26], wl(() => c = !1)), f.$set(X), /*value*/
- v[1] !== null ? C ? (C.p(v, q), q[0] & /*value*/
- 2 && N(C, 1)) : (C = os(v), C.c(), N(C, 1), C.m(a, null)) : C && (Jt(), J(C, 1, 1, () => {
- C = null;
- }), Gt()), q[0] & /*sources, value, interactive*/
+ }), Xt());
+ const N = {};
+ R[0] & /*value, active_source*/
+ 3 && (N.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*/
+ 1048576 && (N.$$scope = { dirty: R, ctx: S }), !u && R[0] & /*uploading*/
+ 67108864 && (u = !0, N.uploading = /*uploading*/
+ S[26], Nl(() => u = !1)), !c && R[0] & /*dragging*/
+ 134217728 && (c = !0, N.dragging = /*dragging*/
+ S[27], Nl(() => c = !1)), f.$set(N), /*value*/
+ S[1] === null && /*active_source*/
+ S[0] === "webcam" ? z ? (z.p(S, R), R[0] & /*value, active_source*/
+ 3 && Z(z, 1)) : (z = Zs(S), z.c(), Z(z, 1), z.m(a, d)) : z && (Yt(), $(z, 1, 1, () => {
+ z = null;
+ }), Xt()), /*value*/
+ S[1] !== null ? y ? (y.p(S, R), R[0] & /*value*/
+ 2 && Z(y, 1)) : (y = Ks(S), y.c(), Z(y, 1), y.m(a, null)) : y && (Yt(), $(y, 1, 1, () => {
+ y = null;
+ }), Xt()), R[0] & /*sources, value, interactive*/
146 && (h = /*sources*/
- (v[4].length > 1 || /*sources*/
- v[4].includes("clipboard")) && /*value*/
- v[1] === null && /*interactive*/
- v[7]), h ? B ? (B.p(v, q), q[0] & /*sources, value, interactive*/
- 146 && N(B, 1)) : (B = ss(v), B.c(), N(B, 1), B.m(r, null)) : B && (Jt(), J(B, 1, 1, () => {
- B = null;
- }), Gt());
+ (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 && Z(A, 1)) : (A = Gs(S), A.c(), Z(A, 1), A.m(r, null)) : A && (Yt(), $(A, 1, 1, () => {
+ A = null;
+ }), Xt());
},
- i(v) {
- b || (N(e.$$.fragment, v), N(w), N(g), N(p), N(f.$$.fragment, v), N(C), N(B), b = !0);
+ i(S) {
+ p || (Z(e.$$.fragment, S), Z(w), Z(b), Z(g), Z(f.$$.fragment, S), Z(z), Z(y), Z(A), p = !0);
},
- o(v) {
- J(e.$$.fragment, v), J(w), J(g), J(p), J(f.$$.fragment, v), J(C), J(B), b = !1;
+ o(S) {
+ $(e.$$.fragment, S), $(w), $(b), $(g), $(f.$$.fragment, S), $(z), $(y), $(A), p = !1;
},
- d(v) {
- v && (At(t), At(n), At(s), At(r)), gt(e, v), w && w.d(), g && g.d(), p && p.d(), l[37](null), gt(f), C && C.d(), B && B.d();
+ d(S) {
+ S && (Zt(t), Zt(n), Zt(s), Zt(r)), ht(e, S), w && w.d(), b && b.d(), g && g.d(), l[39](null), ht(f), z && z.d(), y && y.d(), A && A.d();
}
};
}
-function u0(l, e, t) {
+function bm(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
- var o = this && this.__awaiter || function(E, Ae, ae, _e) {
- function Le(Re) {
- return Re instanceof ae ? Re : new ae(function(Ft) {
- Ft(Re);
+ var o = this && this.__awaiter || function(B, wt, st, tn) {
+ function ei(E) {
+ return E instanceof st ? E : new st(function(H) {
+ H(E);
});
}
- return new (ae || (ae = Promise))(function(Re, Ft) {
- function Al(z) {
+ return new (st || (st = Promise))(function(E, H) {
+ function ee(Q) {
try {
- sn(_e.next(z));
- } catch (F) {
- Ft(F);
+ re(tn.next(Q));
+ } catch (at) {
+ H(at);
}
}
- function Ll(z) {
+ function be(Q) {
try {
- sn(_e.throw(z));
- } catch (F) {
- Ft(F);
+ re(tn.throw(Q));
+ } catch (at) {
+ H(at);
}
}
- function sn(z) {
- z.done ? Re(z.value) : Le(z.value).then(Al, Ll);
+ function re(Q) {
+ Q.done ? E(Q.value) : ei(Q.value).then(ee, be);
}
- sn((_e = _e.apply(E, Ae || [])).next());
+ re((tn = tn.apply(B, wt || [])).next());
});
};
- let { value: s } = e, { label: r = void 0 } = e, { show_label: a } = e, { sources: f = ["upload", "clipboard"] } = e, { selectable: u = !1 } = e, { root: c } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: h } = e, { showDownloadButton: b } = e, { showClearButton: w } = e, { boxesAlpha: g } = e, { labelList: p } = e, { labelColors: m } = e, { boxMinSize: k } = e, { handleSize: y } = e, { boxThickness: C } = e, { disableEditBoxes: B } = e, { singleBox: v } = e, { showRemoveButton: q } = e, { boxSelectedThickness: j } = e, { max_file_size: X = null } = e, { cli_upload: R } = e, { stream_handler: Q } = e, O, P = !1, { active_source: H = null } = e;
- function ie({ detail: E }) {
- t(1, s = new J1()), t(1, s.image = E, s), oe("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: 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: L = null } = e, { cli_upload: N } = e, { stream_handler: J } = e, x, V = !1, { active_source: U = null } = e;
+ function T({ detail: B }) {
+ t(1, s = new Ns()), t(1, s.image = B, s), O("upload");
}
- function we() {
- pe(), oe("clear"), oe("change");
+ function K() {
+ ue(), O("clear"), O("change");
}
- const oe = s0();
- let D = !1;
- function ue(E) {
+ function D(B) {
return o(this, void 0, void 0, function* () {
- switch (E) {
+ const wt = yield x.load_files([new File([B], "webcam.png")]), st = (wt == null ? void 0 : wt[0]) || null;
+ st ? (t(1, s = new Ns()), t(1, s.image = st, s)) : t(1, s = null), yield dm(), O("change");
+ });
+ }
+ const O = _m();
+ let le = !1;
+ function ae(B) {
+ return o(this, void 0, void 0, function* () {
+ switch (B) {
case "clipboard":
- O.paste_clipboard();
+ x.paste_clipboard();
break;
}
});
}
- function pe() {
+ function ue() {
t(1, s = null);
}
- const Ye = async (E) => E === null ? "" : ``;
- function Ue(E) {
- ai.call(this, l, E);
+ const I = async (B) => B === null ? "" : ``;
+ function Me(B) {
+ En.call(this, l, B);
}
- function A(E) {
- ai.call(this, l, E);
+ function M(B) {
+ En.call(this, l, B);
}
- function Je(E) {
- Rn[E ? "unshift" : "push"](() => {
- O = E, t(27, O);
+ function F(B) {
+ xn[B ? "unshift" : "push"](() => {
+ x = B, t(28, x);
});
}
- function M(E) {
- P = E, t(25, P);
+ function G(B) {
+ V = B, t(26, V);
}
- function Y(E) {
- D = E, t(26, D);
+ function q(B) {
+ le = B, t(27, le);
}
- function S(E) {
- ai.call(this, l, E);
+ function ce(B) {
+ En.call(this, l, B);
}
- function W(E) {
- s = E, t(1, s);
+ const ge = (B) => D(B.detail), Ae = (B) => D(B.detail);
+ function ot(B) {
+ En.call(this, l, B);
}
- const G = () => oe("change");
- function Me(E) {
- H = E, t(0, H), t(4, f);
+ function Le(B) {
+ En.call(this, l, B);
}
- return l.$$set = (E) => {
- "value" in E && t(1, s = E.value), "label" in E && t(2, r = E.label), "show_label" in E && t(3, a = E.show_label), "sources" in E && t(4, f = E.sources), "selectable" in E && t(5, u = E.selectable), "root" in E && t(6, c = E.root), "interactive" in E && t(7, _ = E.interactive), "i18n" in E && t(8, d = E.i18n), "showShareButton" in E && t(9, h = E.showShareButton), "showDownloadButton" in E && t(10, b = E.showDownloadButton), "showClearButton" in E && t(11, w = E.showClearButton), "boxesAlpha" in E && t(12, g = E.boxesAlpha), "labelList" in E && t(13, p = E.labelList), "labelColors" in E && t(14, m = E.labelColors), "boxMinSize" in E && t(15, k = E.boxMinSize), "handleSize" in E && t(16, y = E.handleSize), "boxThickness" in E && t(17, C = E.boxThickness), "disableEditBoxes" in E && t(18, B = E.disableEditBoxes), "singleBox" in E && t(19, v = E.singleBox), "showRemoveButton" in E && t(20, q = E.showRemoveButton), "boxSelectedThickness" in E && t(21, j = E.boxSelectedThickness), "max_file_size" in E && t(22, X = E.max_file_size), "cli_upload" in E && t(23, R = E.cli_upload), "stream_handler" in E && t(24, Q = E.stream_handler), "active_source" in E && t(0, H = E.active_source), "$$scope" in E && t(44, i = E.$$scope);
+ const Fe = (B) => D(B.detail);
+ function Ue(B) {
+ s = B, t(1, s);
+ }
+ const Lt = () => O("change");
+ function $l(B) {
+ U = B, t(0, U), 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, L = 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(51, i = B.$$scope);
}, l.$$.update = () => {
l.$$.dirty[0] & /*uploading*/
- 33554432 && P && pe(), l.$$.dirty[0] & /*dragging*/
- 67108864 && oe("drag", D), l.$$.dirty[0] & /*active_source, sources*/
- 17 && !H && f && t(0, H = f[0]);
+ 67108864 && V && ue(), l.$$.dirty[0] & /*dragging*/
+ 134217728 && O("drag", le), l.$$.dirty[0] & /*active_source, sources*/
+ 17 && !U && f && t(0, U = f[0]);
}, [
- H,
+ U,
s,
r,
a,
@@ -8311,52 +9257,59 @@ function u0(l, e, t) {
c,
_,
d,
+ m,
h,
- b,
+ p,
w,
+ b,
g,
- p,
- m,
k,
- y,
C,
- B,
v,
- q,
- j,
- X,
+ z,
+ y,
+ A,
+ S,
R,
- Q,
- P,
+ L,
+ N,
+ J,
+ V,
+ le,
+ x,
+ T,
+ K,
D,
O,
- ie,
- we,
- oe,
+ ae,
ue,
- pe,
n,
- Ye,
- Ue,
- A,
- Je,
+ I,
+ Me,
M,
- Y,
- S,
- W,
+ F,
G,
- Me,
+ q,
+ ce,
+ ge,
+ Ae,
+ ot,
+ Le,
+ Fe,
+ Ue,
+ Lt,
+ $l,
i
];
}
-class c0 extends Q1 {
+class wm extends lm {
constructor(e) {
- super(), n0(
+ super(), rm(
this,
e,
- u0,
- f0,
- i0,
+ bm,
+ gm,
+ um,
{
value: 1,
label: 2,
@@ -8378,10 +9331,11 @@ class c0 extends Q1 {
disableEditBoxes: 18,
singleBox: 19,
showRemoveButton: 20,
- boxSelectedThickness: 21,
- max_file_size: 22,
- cli_upload: 23,
- stream_handler: 24,
+ handlesCursor: 21,
+ boxSelectedThickness: 22,
+ max_file_size: 23,
+ cli_upload: 24,
+ stream_handler: 25,
active_source: 0
},
null,
@@ -8390,60 +9344,60 @@ class c0 extends Q1 {
}
}
const {
- SvelteComponent: _0,
- attr: al,
- detach: ha,
- element: ma,
- init: d0,
- insert: ga,
- noop: as,
- safe_not_equal: h0,
- src_url_equal: rs,
- toggle_class: at
+ SvelteComponent: pm,
+ attr: Ml,
+ detach: ar,
+ element: rr,
+ init: vm,
+ insert: fr,
+ noop: Js,
+ safe_not_equal: km,
+ src_url_equal: Qs,
+ toggle_class: St
} = window.__gradio__svelte__internal;
-function fs(l) {
+function xs(l) {
let e, t;
return {
c() {
- e = ma("img"), rs(e.src, t = /*value*/
- l[0].url) || al(e, "src", t), al(e, "alt", "");
+ e = rr("img"), Qs(e.src, t = /*value*/
+ l[0].url) || Ml(e, "src", t), Ml(e, "alt", "");
},
m(n, i) {
- ga(n, e, i);
+ fr(n, e, i);
},
p(n, i) {
i & /*value*/
- 1 && !rs(e.src, t = /*value*/
- n[0].url) && al(e, "src", t);
+ 1 && !Qs(e.src, t = /*value*/
+ n[0].url) && Ml(e, "src", t);
},
d(n) {
- n && ha(e);
+ n && ar(e);
}
};
}
-function m0(l) {
+function ym(l) {
let e, t = (
/*value*/
- l[0] && fs(l)
+ l[0] && xs(l)
);
return {
c() {
- e = ma("div"), t && t.c(), al(e, "class", "container svelte-1sgcyba"), at(
+ e = rr("div"), t && t.c(), Ml(e, "class", "container svelte-1sgcyba"), St(
e,
"table",
/*type*/
l[1] === "table"
- ), at(
+ ), St(
e,
"gallery",
/*type*/
l[1] === "gallery"
- ), at(
+ ), St(
e,
"selected",
/*selected*/
l[2]
- ), at(
+ ), St(
e,
"border",
/*value*/
@@ -8451,259 +9405,259 @@ function m0(l) {
);
},
m(n, i) {
- ga(n, e, i), t && t.m(e, null);
+ fr(n, e, i), t && t.m(e, null);
},
p(n, [i]) {
/*value*/
- n[0] ? t ? t.p(n, i) : (t = fs(n), t.c(), t.m(e, null)) : t && (t.d(1), t = null), i & /*type*/
- 2 && at(
+ 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 && St(
e,
"table",
/*type*/
n[1] === "table"
), i & /*type*/
- 2 && at(
+ 2 && St(
e,
"gallery",
/*type*/
n[1] === "gallery"
), i & /*selected*/
- 4 && at(
+ 4 && St(
e,
"selected",
/*selected*/
n[2]
), i & /*value*/
- 1 && at(
+ 1 && St(
e,
"border",
/*value*/
n[0]
);
},
- i: as,
- o: as,
+ i: Js,
+ o: Js,
d(n) {
- n && ha(e), t && t.d();
+ n && ar(e), t && t.d();
}
};
}
-function g0(l, e, t) {
+function Cm(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 X0 extends _0 {
+class Zm extends pm {
constructor(e) {
- super(), d0(this, e, g0, m0, h0, { value: 0, type: 1, selected: 2 });
+ super(), vm(this, e, Cm, ym, km, { value: 0, type: 1, selected: 2 });
}
}
const {
- SvelteComponent: b0,
- add_flush_callback: us,
- assign: w0,
- bind: cs,
- binding_callbacks: _s,
- check_outros: p0,
- create_component: It,
- destroy_component: Ht,
- detach: ba,
- empty: v0,
- flush: V,
- get_spread_object: k0,
- get_spread_update: y0,
- group_outros: C0,
- init: S0,
- insert: wa,
- mount_component: jt,
- safe_not_equal: z0,
- space: B0,
- transition_in: et,
- transition_out: tt
+ SvelteComponent: Sm,
+ add_flush_callback: $s,
+ assign: zm,
+ bind: ea,
+ binding_callbacks: ta,
+ check_outros: qm,
+ create_component: xt,
+ destroy_component: $t,
+ detach: ur,
+ empty: Bm,
+ flush: P,
+ get_spread_object: Em,
+ get_spread_update: Mm,
+ group_outros: Am,
+ init: Lm,
+ insert: cr,
+ mount_component: en,
+ safe_not_equal: Dm,
+ space: Rm,
+ transition_in: gt,
+ transition_out: bt
} = window.__gradio__svelte__internal;
-function q0(l) {
+function Tm(l) {
let e, t;
- return e = new uf({
+ return e = new lu({
props: {
unpadded_box: !0,
size: "large",
- $$slots: { default: [A0] },
+ $$slots: { default: [Hm] },
$$scope: { ctx: l }
}
}), {
c() {
- It(e.$$.fragment);
+ xt(e.$$.fragment);
},
m(n, i) {
- jt(e, n, i), t = !0;
+ en(e, n, i), t = !0;
},
p(n, i) {
const o = {};
i[1] & /*$$scope*/
- 2048 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 4096 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
},
i(n) {
- t || (et(e.$$.fragment, n), t = !0);
+ t || (gt(e.$$.fragment, n), t = !0);
},
o(n) {
- tt(e.$$.fragment, n), t = !1;
+ bt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ht(e, n);
+ $t(e, n);
}
};
}
-function E0(l) {
+function Im(l) {
let e, t;
- return e = new zs({
+ return e = new ma({
props: {
i18n: (
/*gradio*/
- l[29].i18n
+ l[30].i18n
),
type: "clipboard",
mode: "short"
}
}), {
c() {
- It(e.$$.fragment);
+ xt(e.$$.fragment);
},
m(n, i) {
- jt(e, n, i), t = !0;
+ en(e, n, i), t = !0;
},
p(n, i) {
const o = {};
i[0] & /*gradio*/
- 536870912 && (o.i18n = /*gradio*/
- n[29].i18n), e.$set(o);
+ 1073741824 && (o.i18n = /*gradio*/
+ n[30].i18n), e.$set(o);
},
i(n) {
- t || (et(e.$$.fragment, n), t = !0);
+ t || (gt(e.$$.fragment, n), t = !0);
},
o(n) {
- tt(e.$$.fragment, n), t = !1;
+ bt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ht(e, n);
+ $t(e, n);
}
};
}
-function M0(l) {
+function jm(l) {
let e, t;
- return e = new zs({
+ return e = new ma({
props: {
i18n: (
/*gradio*/
- l[29].i18n
+ l[30].i18n
),
type: "image"
}
}), {
c() {
- It(e.$$.fragment);
+ xt(e.$$.fragment);
},
m(n, i) {
- jt(e, n, i), t = !0;
+ en(e, n, i), t = !0;
},
p(n, i) {
const o = {};
i[0] & /*gradio*/
- 536870912 && (o.i18n = /*gradio*/
- n[29].i18n), e.$set(o);
+ 1073741824 && (o.i18n = /*gradio*/
+ n[30].i18n), e.$set(o);
},
i(n) {
- t || (et(e.$$.fragment, n), t = !0);
+ t || (gt(e.$$.fragment, n), t = !0);
},
o(n) {
- tt(e.$$.fragment, n), t = !1;
+ bt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ht(e, n);
+ $t(e, n);
}
};
}
-function A0(l) {
+function Hm(l) {
let e, t;
- return e = new ps({}), {
+ return e = new ra({}), {
c() {
- It(e.$$.fragment);
+ xt(e.$$.fragment);
},
m(n, i) {
- jt(e, n, i), t = !0;
+ en(e, n, i), t = !0;
},
i(n) {
- t || (et(e.$$.fragment, n), t = !0);
+ t || (gt(e.$$.fragment, n), t = !0);
},
o(n) {
- tt(e.$$.fragment, n), t = !1;
+ bt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ht(e, n);
+ $t(e, n);
}
};
}
-function L0(l) {
+function Fm(l) {
let e, t, n, i;
- const o = [M0, E0, q0], s = [];
+ const o = [jm, Im, Tm], s = [];
function r(a, f) {
return (
/*active_source*/
- a[31] === "upload" ? 0 : (
+ a[32] === "upload" ? 0 : (
/*active_source*/
- a[31] === "clipboard" ? 1 : 2
+ a[32] === "clipboard" ? 1 : 2
)
);
}
return e = r(l), t = s[e] = o[e](l), {
c() {
- t.c(), n = v0();
+ t.c(), n = Bm();
},
m(a, f) {
- s[e].m(a, f), wa(a, n, f), i = !0;
+ s[e].m(a, f), cr(a, n, f), i = !0;
},
p(a, f) {
let u = e;
- e = r(a), e === u ? s[e].p(a, f) : (C0(), tt(s[u], 1, 1, () => {
+ e = r(a), e === u ? s[e].p(a, f) : (Am(), bt(s[u], 1, 1, () => {
s[u] = null;
- }), p0(), t = s[e], t ? t.p(a, f) : (t = s[e] = o[e](a), t.c()), et(t, 1), t.m(n.parentNode, n));
+ }), qm(), 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 || (et(t), i = !0);
+ i || (gt(t), i = !0);
},
o(a) {
- tt(t), i = !1;
+ bt(t), i = !1;
},
d(a) {
- a && ba(n), s[e].d(a);
+ a && ur(n), s[e].d(a);
}
};
}
-function R0(l) {
+function Xm(l) {
let e, t, n, i, o, s;
const r = [
{
autoscroll: (
/*gradio*/
- l[29].autoscroll
+ l[30].autoscroll
)
},
{ i18n: (
/*gradio*/
- l[29].i18n
+ l[30].i18n
) },
/*loading_status*/
l[1]
];
let a = {};
for (let _ = 0; _ < r.length; _ += 1)
- a = w0(a, r[_]);
- e = new Dc({ props: a });
+ a = zm(a, r[_]);
+ e = new G_({ props: a });
function f(_) {
- l[32](_);
+ l[33](_);
}
function u(_) {
- l[33](_);
+ l[34](_);
}
let c = {
selectable: (
@@ -8736,7 +9690,7 @@ function R0(l) {
),
i18n: (
/*gradio*/
- l[29].i18n
+ l[30].i18n
),
boxesAlpha: (
/*boxes_alpha*/
@@ -8764,15 +9718,15 @@ function R0(l) {
),
max_file_size: (
/*gradio*/
- l[29].max_file_size
+ l[30].max_file_size
),
cli_upload: (
/*gradio*/
- l[29].client.upload
+ l[30].client.upload
),
stream_handler: (
/*gradio*/
- l[29].client.stream
+ l[30].client.stream
),
handleSize: (
/*handle_size*/
@@ -8798,145 +9752,151 @@ function R0(l) {
/*show_remove_button*/
l[28]
),
- $$slots: { default: [L0] },
+ handlesCursor: (
+ /*handles_cursor*/
+ l[29]
+ ),
+ $$slots: { default: [Fm] },
$$scope: { ctx: l }
};
return (
/*active_source*/
- l[31] !== void 0 && (c.active_source = /*active_source*/
- l[31]), /*value*/
+ l[32] !== void 0 && (c.active_source = /*active_source*/
+ l[32]), /*value*/
l[0] !== void 0 && (c.value = /*value*/
- l[0]), n = new c0({ props: c }), _s.push(() => cs(n, "active_source", f)), _s.push(() => cs(n, "value", u)), n.$on(
+ l[0]), n = new wm({ props: c }), ta.push(() => ea(n, "active_source", f)), ta.push(() => ea(n, "value", u)), n.$on(
"change",
/*change_handler*/
- l[34]
+ l[35]
), n.$on(
"edit",
/*edit_handler*/
- l[35]
+ l[36]
), n.$on(
"clear",
/*clear_handler*/
- l[36]
+ l[37]
), n.$on(
"drag",
/*drag_handler*/
- l[37]
+ l[38]
), n.$on(
"upload",
/*upload_handler*/
- l[38]
+ l[39]
), n.$on(
"select",
/*select_handler*/
- l[39]
+ l[40]
), n.$on(
"share",
/*share_handler*/
- l[40]
+ l[41]
), n.$on(
"error",
/*error_handler*/
- l[41]
+ l[42]
), {
c() {
- It(e.$$.fragment), t = B0(), It(n.$$.fragment);
+ xt(e.$$.fragment), t = Rm(), xt(n.$$.fragment);
},
m(_, d) {
- jt(e, _, d), wa(_, t, d), jt(n, _, d), s = !0;
+ en(e, _, d), cr(_, t, d), en(n, _, d), s = !0;
},
p(_, d) {
- const h = d[0] & /*gradio, loading_status*/
- 536870914 ? y0(r, [
+ const m = d[0] & /*gradio, loading_status*/
+ 1073741826 ? Mm(r, [
d[0] & /*gradio*/
- 536870912 && {
+ 1073741824 && {
autoscroll: (
/*gradio*/
- _[29].autoscroll
+ _[30].autoscroll
)
},
d[0] & /*gradio*/
- 536870912 && { i18n: (
+ 1073741824 && { i18n: (
/*gradio*/
- _[29].i18n
+ _[30].i18n
) },
d[0] & /*loading_status*/
- 2 && k0(
+ 2 && Em(
/*loading_status*/
_[1]
)
]) : {};
- e.$set(h);
- const b = {};
+ e.$set(m);
+ const h = {};
d[0] & /*_selectable*/
- 1024 && (b.selectable = /*_selectable*/
+ 1024 && (h.selectable = /*_selectable*/
_[10]), d[0] & /*root*/
- 128 && (b.root = /*root*/
+ 128 && (h.root = /*root*/
_[7]), d[0] & /*sources*/
- 16384 && (b.sources = /*sources*/
+ 16384 && (h.sources = /*sources*/
_[14]), d[0] & /*interactive*/
- 262144 && (b.interactive = /*interactive*/
+ 262144 && (h.interactive = /*interactive*/
_[18]), d[0] & /*show_download_button*/
- 32768 && (b.showDownloadButton = /*show_download_button*/
+ 32768 && (h.showDownloadButton = /*show_download_button*/
_[15]), d[0] & /*show_share_button*/
- 65536 && (b.showShareButton = /*show_share_button*/
+ 65536 && (h.showShareButton = /*show_share_button*/
_[16]), d[0] & /*show_clear_button*/
- 131072 && (b.showClearButton = /*show_clear_button*/
+ 131072 && (h.showClearButton = /*show_clear_button*/
_[17]), d[0] & /*gradio*/
- 536870912 && (b.i18n = /*gradio*/
- _[29].i18n), d[0] & /*boxes_alpha*/
- 524288 && (b.boxesAlpha = /*boxes_alpha*/
+ 1073741824 && (h.i18n = /*gradio*/
+ _[30].i18n), d[0] & /*boxes_alpha*/
+ 524288 && (h.boxesAlpha = /*boxes_alpha*/
_[19]), d[0] & /*label_list*/
- 1048576 && (b.labelList = /*label_list*/
+ 1048576 && (h.labelList = /*label_list*/
_[20]), d[0] & /*label_colors*/
- 2097152 && (b.labelColors = /*label_colors*/
+ 2097152 && (h.labelColors = /*label_colors*/
_[21]), d[0] & /*box_min_size*/
- 4194304 && (b.boxMinSize = /*box_min_size*/
+ 4194304 && (h.boxMinSize = /*box_min_size*/
_[22]), d[0] & /*label*/
- 32 && (b.label = /*label*/
+ 32 && (h.label = /*label*/
_[5]), d[0] & /*show_label*/
- 64 && (b.show_label = /*show_label*/
+ 64 && (h.show_label = /*show_label*/
_[6]), d[0] & /*gradio*/
- 536870912 && (b.max_file_size = /*gradio*/
- _[29].max_file_size), d[0] & /*gradio*/
- 536870912 && (b.cli_upload = /*gradio*/
- _[29].client.upload), d[0] & /*gradio*/
- 536870912 && (b.stream_handler = /*gradio*/
- _[29].client.stream), d[0] & /*handle_size*/
- 8388608 && (b.handleSize = /*handle_size*/
+ 1073741824 && (h.max_file_size = /*gradio*/
+ _[30].max_file_size), d[0] & /*gradio*/
+ 1073741824 && (h.cli_upload = /*gradio*/
+ _[30].client.upload), d[0] & /*gradio*/
+ 1073741824 && (h.stream_handler = /*gradio*/
+ _[30].client.stream), d[0] & /*handle_size*/
+ 8388608 && (h.handleSize = /*handle_size*/
_[23]), d[0] & /*box_thickness*/
- 16777216 && (b.boxThickness = /*box_thickness*/
+ 16777216 && (h.boxThickness = /*box_thickness*/
_[24]), d[0] & /*box_selected_thickness*/
- 33554432 && (b.boxSelectedThickness = /*box_selected_thickness*/
+ 33554432 && (h.boxSelectedThickness = /*box_selected_thickness*/
_[25]), d[0] & /*disable_edit_boxes*/
- 67108864 && (b.disableEditBoxes = /*disable_edit_boxes*/
+ 67108864 && (h.disableEditBoxes = /*disable_edit_boxes*/
_[26]), d[0] & /*single_box*/
- 134217728 && (b.singleBox = /*single_box*/
+ 134217728 && (h.singleBox = /*single_box*/
_[27]), d[0] & /*show_remove_button*/
- 268435456 && (b.showRemoveButton = /*show_remove_button*/
- _[28]), d[0] & /*gradio*/
- 536870912 | d[1] & /*$$scope, active_source*/
- 2049 && (b.$$scope = { dirty: d, ctx: _ }), !i && d[1] & /*active_source*/
- 1 && (i = !0, b.active_source = /*active_source*/
- _[31], us(() => i = !1)), !o && d[0] & /*value*/
- 1 && (o = !0, b.value = /*value*/
- _[0], us(() => o = !1)), n.$set(b);
+ 268435456 && (h.showRemoveButton = /*show_remove_button*/
+ _[28]), d[0] & /*handles_cursor*/
+ 536870912 && (h.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);
},
i(_) {
- s || (et(e.$$.fragment, _), et(n.$$.fragment, _), s = !0);
+ s || (gt(e.$$.fragment, _), gt(n.$$.fragment, _), s = !0);
},
o(_) {
- tt(e.$$.fragment, _), tt(n.$$.fragment, _), s = !1;
+ bt(e.$$.fragment, _), bt(n.$$.fragment, _), s = !1;
},
d(_) {
- _ && ba(t), Ht(e, _), Ht(n, _);
+ _ && ur(t), $t(e, _), $t(n, _);
}
}
);
}
-function D0(l) {
+function Ym(l) {
let e, t;
- return e = new Ta({
+ return e = new Br({
props: {
visible: (
/*visible*/
@@ -8945,7 +9905,7 @@ function D0(l) {
variant: "solid",
border_mode: (
/*dragging*/
- l[30] ? "focus" : "base"
+ l[31] ? "focus" : "base"
),
padding: !1,
elem_id: (
@@ -8977,23 +9937,23 @@ function D0(l) {
/*min_width*/
l[13]
),
- $$slots: { default: [R0] },
+ $$slots: { default: [Xm] },
$$scope: { ctx: l }
}
}), {
c() {
- It(e.$$.fragment);
+ xt(e.$$.fragment);
},
m(n, i) {
- jt(e, n, i), t = !0;
+ en(e, n, i), t = !0;
},
p(n, i) {
const o = {};
i[0] & /*visible*/
16 && (o.visible = /*visible*/
- n[4]), i[0] & /*dragging*/
- 1073741824 && (o.border_mode = /*dragging*/
- n[30] ? "focus" : "base"), i[0] & /*elem_id*/
+ n[4]), i[1] & /*dragging*/
+ 1 && (o.border_mode = /*dragging*/
+ n[31] ? "focus" : "base"), i[0] & /*elem_id*/
4 && (o.elem_id = /*elem_id*/
n[2]), i[0] & /*elem_classes*/
8 && (o.elem_classes = /*elem_classes*/
@@ -9007,39 +9967,39 @@ function D0(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, value, dragging, loading_status*/
- 2147468515 | i[1] & /*$$scope, active_source*/
- 2049 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 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*/
+ 4099 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
},
i(n) {
- t || (et(e.$$.fragment, n), t = !0);
+ t || (gt(e.$$.fragment, n), t = !0);
},
o(n) {
- tt(e.$$.fragment, n), t = !1;
+ bt(e.$$.fragment, n), t = !1;
},
d(n) {
- Ht(e, n);
+ $t(e, n);
}
};
}
-function T0(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: b = void 0 } = e, { loading_status: w } = e, { sources: g = ["upload", "clipboard"] } = e, { show_download_button: p } = e, { show_share_button: m } = e, { show_clear_button: k } = e, { interactive: y } = e, { boxes_alpha: C } = e, { label_list: B } = e, { label_colors: v } = e, { box_min_size: q } = e, { handle_size: j } = e, { box_thickness: X } = e, { box_selected_thickness: R } = e, { disable_edit_boxes: Q } = e, { single_box: O } = e, { show_remove_button: P } = e, { gradio: H } = e, ie, we = null;
- function oe(S) {
- we = S, t(31, we);
+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: L } = e, { disable_edit_boxes: N } = e, { single_box: J } = e, { show_remove_button: x } = e, { handles_cursor: V } = e, { gradio: U } = e, T, K = null;
+ function D(q) {
+ K = q, t(32, K);
}
- function D(S) {
- s = S, t(0, s);
+ function O(q) {
+ s = q, t(0, s);
}
- const ue = () => H.dispatch("change"), pe = () => H.dispatch("edit"), Ye = () => {
- H.dispatch("clear");
- }, Ue = ({ detail: S }) => t(30, ie = S), A = () => H.dispatch("upload"), Je = ({ detail: S }) => H.dispatch("select", S), M = ({ detail: S }) => H.dispatch("share", S), Y = ({ detail: S }) => {
- t(1, w = w || {}), t(1, w.status = "error", w), H.dispatch("error", S);
+ const le = () => U.dispatch("change"), ae = () => U.dispatch("edit"), ue = () => {
+ U.dispatch("clear");
+ }, I = ({ detail: q }) => t(31, T = q), Me = () => U.dispatch("upload"), M = ({ detail: q }) => U.dispatch("select", q), F = ({ detail: q }) => U.dispatch("share", q), G = ({ detail: q }) => {
+ t(1, p = p || {}), t(1, p.status = "error", p), U.dispatch("error", q);
};
- return l.$$set = (S) => {
- "elem_id" in S && t(2, n = S.elem_id), "elem_classes" in S && t(3, i = S.elem_classes), "visible" in S && t(4, o = S.visible), "value" in S && t(0, s = S.value), "label" in S && t(5, r = S.label), "show_label" in S && t(6, a = S.show_label), "root" in S && t(7, f = S.root), "height" in S && t(8, u = S.height), "width" in S && t(9, c = S.width), "_selectable" in S && t(10, _ = S._selectable), "container" in S && t(11, d = S.container), "scale" in S && t(12, h = S.scale), "min_width" in S && t(13, b = S.min_width), "loading_status" in S && t(1, w = S.loading_status), "sources" in S && t(14, g = S.sources), "show_download_button" in S && t(15, p = S.show_download_button), "show_share_button" in S && t(16, m = S.show_share_button), "show_clear_button" in S && t(17, k = S.show_clear_button), "interactive" in S && t(18, y = S.interactive), "boxes_alpha" in S && t(19, C = S.boxes_alpha), "label_list" in S && t(20, B = S.label_list), "label_colors" in S && t(21, v = S.label_colors), "box_min_size" in S && t(22, q = S.box_min_size), "handle_size" in S && t(23, j = S.handle_size), "box_thickness" in S && t(24, X = S.box_thickness), "box_selected_thickness" in S && t(25, R = S.box_selected_thickness), "disable_edit_boxes" in S && t(26, Q = S.disable_edit_boxes), "single_box" in S && t(27, O = S.single_box), "show_remove_button" in S && t(28, P = S.show_remove_button), "gradio" in S && t(29, H = S.gradio);
+ 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, L = 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, x = q.show_remove_button), "handles_cursor" in q && t(29, V = q.handles_cursor), "gradio" in q && t(30, U = q.gradio);
}, [
s,
- w,
+ p,
n,
i,
o,
@@ -9050,46 +10010,47 @@ function T0(l, e, t) {
c,
_,
d,
+ m,
h,
+ w,
b,
g,
- p,
- m,
k,
- y,
C,
- B,
v,
- q,
- j,
- X,
+ z,
+ y,
+ A,
+ S,
R,
- Q,
- O,
- P,
- H,
- ie,
- we,
- oe,
+ L,
+ N,
+ J,
+ x,
+ V,
+ U,
+ T,
+ K,
D,
+ O,
+ le,
+ ae,
ue,
- pe,
- Ye,
- Ue,
- A,
- Je,
+ I,
+ Me,
M,
- Y
+ F,
+ G
];
}
-class Y0 extends b0 {
+class Km extends Sm {
constructor(e) {
- super(), S0(
+ super(), Lm(
this,
e,
- T0,
- D0,
- z0,
+ Nm,
+ Ym,
+ Dm,
{
elem_id: 2,
elem_classes: 3,
@@ -9120,7 +10081,8 @@ class Y0 extends b0 {
disable_edit_boxes: 26,
single_box: 27,
show_remove_button: 28,
- gradio: 29
+ handles_cursor: 29,
+ gradio: 30
},
null,
[-1, -1]
@@ -9130,184 +10092,190 @@ class Y0 extends b0 {
return this.$$.ctx[2];
}
set elem_id(e) {
- this.$$set({ elem_id: e }), V();
+ this.$$set({ elem_id: e }), P();
}
get elem_classes() {
return this.$$.ctx[3];
}
set elem_classes(e) {
- this.$$set({ elem_classes: e }), V();
+ this.$$set({ elem_classes: e }), P();
}
get visible() {
return this.$$.ctx[4];
}
set visible(e) {
- this.$$set({ visible: e }), V();
+ this.$$set({ visible: e }), P();
}
get value() {
return this.$$.ctx[0];
}
set value(e) {
- this.$$set({ value: e }), V();
+ this.$$set({ value: e }), P();
}
get label() {
return this.$$.ctx[5];
}
set label(e) {
- this.$$set({ label: e }), V();
+ this.$$set({ label: e }), P();
}
get show_label() {
return this.$$.ctx[6];
}
set show_label(e) {
- this.$$set({ show_label: e }), V();
+ this.$$set({ show_label: e }), P();
}
get root() {
return this.$$.ctx[7];
}
set root(e) {
- this.$$set({ root: e }), V();
+ this.$$set({ root: e }), P();
}
get height() {
return this.$$.ctx[8];
}
set height(e) {
- this.$$set({ height: e }), V();
+ this.$$set({ height: e }), P();
}
get width() {
return this.$$.ctx[9];
}
set width(e) {
- this.$$set({ width: e }), V();
+ this.$$set({ width: e }), P();
}
get _selectable() {
return this.$$.ctx[10];
}
set _selectable(e) {
- this.$$set({ _selectable: e }), V();
+ this.$$set({ _selectable: e }), P();
}
get container() {
return this.$$.ctx[11];
}
set container(e) {
- this.$$set({ container: e }), V();
+ this.$$set({ container: e }), P();
}
get scale() {
return this.$$.ctx[12];
}
set scale(e) {
- this.$$set({ scale: e }), V();
+ this.$$set({ scale: e }), P();
}
get min_width() {
return this.$$.ctx[13];
}
set min_width(e) {
- this.$$set({ min_width: e }), V();
+ this.$$set({ min_width: e }), P();
}
get loading_status() {
return this.$$.ctx[1];
}
set loading_status(e) {
- this.$$set({ loading_status: e }), V();
+ this.$$set({ loading_status: e }), P();
}
get sources() {
return this.$$.ctx[14];
}
set sources(e) {
- this.$$set({ sources: e }), V();
+ this.$$set({ sources: e }), P();
}
get show_download_button() {
return this.$$.ctx[15];
}
set show_download_button(e) {
- this.$$set({ show_download_button: e }), V();
+ this.$$set({ show_download_button: e }), P();
}
get show_share_button() {
return this.$$.ctx[16];
}
set show_share_button(e) {
- this.$$set({ show_share_button: e }), V();
+ this.$$set({ show_share_button: e }), P();
}
get show_clear_button() {
return this.$$.ctx[17];
}
set show_clear_button(e) {
- this.$$set({ show_clear_button: e }), V();
+ this.$$set({ show_clear_button: e }), P();
}
get interactive() {
return this.$$.ctx[18];
}
set interactive(e) {
- this.$$set({ interactive: e }), V();
+ this.$$set({ interactive: e }), P();
}
get boxes_alpha() {
return this.$$.ctx[19];
}
set boxes_alpha(e) {
- this.$$set({ boxes_alpha: e }), V();
+ this.$$set({ boxes_alpha: e }), P();
}
get label_list() {
return this.$$.ctx[20];
}
set label_list(e) {
- this.$$set({ label_list: e }), V();
+ this.$$set({ label_list: e }), P();
}
get label_colors() {
return this.$$.ctx[21];
}
set label_colors(e) {
- this.$$set({ label_colors: e }), V();
+ this.$$set({ label_colors: e }), P();
}
get box_min_size() {
return this.$$.ctx[22];
}
set box_min_size(e) {
- this.$$set({ box_min_size: e }), V();
+ this.$$set({ box_min_size: e }), P();
}
get handle_size() {
return this.$$.ctx[23];
}
set handle_size(e) {
- this.$$set({ handle_size: e }), V();
+ this.$$set({ handle_size: e }), P();
}
get box_thickness() {
return this.$$.ctx[24];
}
set box_thickness(e) {
- this.$$set({ box_thickness: e }), V();
+ this.$$set({ box_thickness: e }), P();
}
get box_selected_thickness() {
return this.$$.ctx[25];
}
set box_selected_thickness(e) {
- this.$$set({ box_selected_thickness: e }), V();
+ this.$$set({ box_selected_thickness: e }), P();
}
get disable_edit_boxes() {
return this.$$.ctx[26];
}
set disable_edit_boxes(e) {
- this.$$set({ disable_edit_boxes: e }), V();
+ this.$$set({ disable_edit_boxes: e }), P();
}
get single_box() {
return this.$$.ctx[27];
}
set single_box(e) {
- this.$$set({ single_box: e }), V();
+ this.$$set({ single_box: e }), P();
}
get show_remove_button() {
return this.$$.ctx[28];
}
set show_remove_button(e) {
- this.$$set({ show_remove_button: e }), V();
+ this.$$set({ show_remove_button: e }), P();
}
- get gradio() {
+ get handles_cursor() {
return this.$$.ctx[29];
}
+ set handles_cursor(e) {
+ this.$$set({ handles_cursor: e }), P();
+ }
+ get gradio() {
+ return this.$$.ctx[30];
+ }
set gradio(e) {
- this.$$set({ gradio: e }), V();
+ this.$$set({ gradio: e }), P();
}
}
export {
- X0 as BaseExample,
- Y0 as default
+ Zm as BaseExample,
+ Km as default
};