diff --git "a/src/backend/gradio_carousel/templates/component/index.js" "b/src/backend/gradio_carousel/templates/component/index.js" --- "a/src/backend/gradio_carousel/templates/component/index.js" +++ "b/src/backend/gradio_carousel/templates/component/index.js" @@ -1,28 +1,28 @@ const { - SvelteComponent: ra, - assign: ia, - create_slot: oa, - detach: la, - element: sa, - get_all_dirty_from_scope: aa, - get_slot_changes: ua, - get_spread_update: fa, - init: ca, - insert: da, - safe_not_equal: _a, - set_dynamic_element_data: Mi, - set_style: Pe, - toggle_class: ot, - transition_in: Il, - transition_out: Ll, - update_slot_base: ha + SvelteComponent: Ys, + assign: Ks, + create_slot: $s, + detach: ea, + element: ta, + get_all_dirty_from_scope: na, + get_slot_changes: ra, + get_spread_update: ia, + init: oa, + insert: la, + safe_not_equal: sa, + set_dynamic_element_data: Pi, + set_style: Oe, + toggle_class: nt, + transition_in: Sl, + transition_out: kl, + update_slot_base: aa } = window.__gradio__svelte__internal; -function ma(e) { +function ua(e) { let t, n, r; const i = ( /*#slots*/ e[18].default - ), o = oa( + ), o = $s( i, e, /*$$scope*/ @@ -44,33 +44,33 @@ function ma(e) { } ], u = {}; for (let s = 0; s < l.length; s += 1) - u = ia(u, l[s]); + u = Ks(u, l[s]); return { c() { - t = sa( + t = ta( /*tag*/ e[14] - ), o && o.c(), Mi( + ), o && o.c(), Pi( /*tag*/ e[14] - )(t, u), ot( + )(t, u), nt( t, "hidden", /*visible*/ e[10] === !1 - ), ot( + ), nt( t, "padded", /*padding*/ e[6] - ), ot( + ), nt( t, "border_focus", /*border_mode*/ e[5] === "focus" - ), ot(t, "hide-container", !/*explicit_call*/ + ), nt(t, "hide-container", !/*explicit_call*/ e[8] && !/*container*/ - e[9]), Pe( + e[9]), Oe( t, "height", /*get_dimension*/ @@ -78,7 +78,7 @@ function ma(e) { /*height*/ e[0] ) - ), Pe(t, "width", typeof /*width*/ + ), Oe(t, "width", typeof /*width*/ e[1] == "number" ? `calc(min(${/*width*/ e[1]}px, 100%))` : ( /*get_dimension*/ @@ -86,50 +86,50 @@ function ma(e) { /*width*/ e[1] ) - )), Pe( + )), Oe( t, "border-style", /*variant*/ e[4] - ), Pe( + ), Oe( t, "overflow", /*allow_overflow*/ e[11] ? "visible" : "hidden" - ), Pe( + ), Oe( t, "flex-grow", /*scale*/ e[12] - ), Pe(t, "min-width", `calc(min(${/*min_width*/ - e[13]}px, 100%))`), Pe(t, "border-width", "var(--block-border-width)"); + ), Oe(t, "min-width", `calc(min(${/*min_width*/ + e[13]}px, 100%))`), Oe(t, "border-width", "var(--block-border-width)"); }, m(s, a) { - da(s, t, a), o && o.m(t, null), r = !0; + la(s, t, a), o && o.m(t, null), r = !0; }, p(s, a) { o && o.p && (!r || a & /*$$scope*/ - 131072) && ha( + 131072) && aa( o, i, s, /*$$scope*/ s[17], - r ? ua( + r ? ra( i, /*$$scope*/ s[17], a, null - ) : aa( + ) : na( /*$$scope*/ s[17] ), null - ), Mi( + ), Pi( /*tag*/ s[14] - )(t, u = fa(l, [ + )(t, u = ia(l, [ (!r || a & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -143,25 +143,25 @@ function ma(e) { (!r || a & /*elem_classes*/ 8 && n !== (n = "block " + /*elem_classes*/ s[3].join(" ") + " svelte-1t38q2d")) && { class: n } - ])), ot( + ])), nt( t, "hidden", /*visible*/ s[10] === !1 - ), ot( + ), nt( t, "padded", /*padding*/ s[6] - ), ot( + ), nt( t, "border_focus", /*border_mode*/ s[5] === "focus" - ), ot(t, "hide-container", !/*explicit_call*/ + ), nt(t, "hide-container", !/*explicit_call*/ s[8] && !/*container*/ s[9]), a & /*height*/ - 1 && Pe( + 1 && Oe( t, "height", /*get_dimension*/ @@ -170,7 +170,7 @@ function ma(e) { s[0] ) ), a & /*width*/ - 2 && Pe(t, "width", typeof /*width*/ + 2 && Oe(t, "width", typeof /*width*/ s[1] == "number" ? `calc(min(${/*width*/ s[1]}px, 100%))` : ( /*get_dimension*/ @@ -179,42 +179,42 @@ function ma(e) { s[1] ) )), a & /*variant*/ - 16 && Pe( + 16 && Oe( t, "border-style", /*variant*/ s[4] ), a & /*allow_overflow*/ - 2048 && Pe( + 2048 && Oe( t, "overflow", /*allow_overflow*/ s[11] ? "visible" : "hidden" ), a & /*scale*/ - 4096 && Pe( + 4096 && Oe( t, "flex-grow", /*scale*/ s[12] ), a & /*min_width*/ - 8192 && Pe(t, "min-width", `calc(min(${/*min_width*/ + 8192 && Oe(t, "min-width", `calc(min(${/*min_width*/ s[13]}px, 100%))`); }, i(s) { - r || (Il(o, s), r = !0); + r || (Sl(o, s), r = !0); }, o(s) { - Ll(o, s), r = !1; + kl(o, s), r = !1; }, d(s) { - s && la(t), o && o.d(s); + s && ea(t), o && o.d(s); } }; } -function pa(e) { +function fa(e) { let t, n = ( /*tag*/ - e[14] && ma(e) + e[14] && ua(e) ); return { c() { @@ -228,28 +228,28 @@ function pa(e) { r[14] && n.p(r, i); }, i(r) { - t || (Il(n, r), t = !0); + t || (Sl(n, r), t = !0); }, o(r) { - Ll(n, r), t = !1; + kl(n, r), t = !1; }, d(r) { n && n.d(r); } }; } -function ga(e, t, n) { - let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: u = "" } = t, { elem_classes: s = [] } = t, { variant: a = "solid" } = t, { border_mode: f = "base" } = t, { padding: d = !0 } = t, { type: c = "normal" } = t, { test_id: h = void 0 } = t, { explicit_call: _ = !1 } = t, { container: m = !0 } = t, { visible: g = !0 } = t, { allow_overflow: p = !0 } = t, { scale: v = null } = t, { min_width: b = 0 } = t, w = c === "fieldset" ? "fieldset" : "div"; - const y = (S) => { - if (S !== void 0) { - if (typeof S == "number") - return S + "px"; - if (typeof S == "string") - return S; +function ca(e, t, n) { + let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: u = "" } = t, { elem_classes: s = [] } = t, { variant: a = "solid" } = t, { border_mode: f = "base" } = t, { padding: d = !0 } = t, { type: c = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: h = !1 } = t, { container: p = !0 } = t, { visible: g = !0 } = t, { allow_overflow: m = !0 } = t, { scale: v = null } = t, { min_width: w = 0 } = t, b = c === "fieldset" ? "fieldset" : "div"; + const y = (k) => { + if (k !== void 0) { + if (typeof k == "number") + return k + "px"; + if (typeof k == "string") + return k; } }; - return e.$$set = (S) => { - "height" in S && n(0, o = S.height), "width" in S && n(1, l = S.width), "elem_id" in S && n(2, u = S.elem_id), "elem_classes" in S && n(3, s = S.elem_classes), "variant" in S && n(4, a = S.variant), "border_mode" in S && n(5, f = S.border_mode), "padding" in S && n(6, d = S.padding), "type" in S && n(16, c = S.type), "test_id" in S && n(7, h = S.test_id), "explicit_call" in S && n(8, _ = S.explicit_call), "container" in S && n(9, m = S.container), "visible" in S && n(10, g = S.visible), "allow_overflow" in S && n(11, p = S.allow_overflow), "scale" in S && n(12, v = S.scale), "min_width" in S && n(13, b = S.min_width), "$$scope" in S && n(17, i = S.$$scope); + return e.$$set = (k) => { + "height" in k && n(0, o = k.height), "width" in k && n(1, l = k.width), "elem_id" in k && n(2, u = k.elem_id), "elem_classes" in k && n(3, s = k.elem_classes), "variant" in k && n(4, a = k.variant), "border_mode" in k && n(5, f = k.border_mode), "padding" in k && n(6, d = k.padding), "type" in k && n(16, c = k.type), "test_id" in k && n(7, _ = k.test_id), "explicit_call" in k && n(8, h = k.explicit_call), "container" in k && n(9, p = k.container), "visible" in k && n(10, g = k.visible), "allow_overflow" in k && n(11, m = k.allow_overflow), "scale" in k && n(12, v = k.scale), "min_width" in k && n(13, w = k.min_width), "$$scope" in k && n(17, i = k.$$scope); }, [ o, l, @@ -258,23 +258,23 @@ function ga(e, t, n) { a, f, d, - h, _, - m, - g, + h, p, + g, + m, v, - b, w, + b, y, c, i, r ]; } -class ba extends ra { +class da extends Ys { constructor(t) { - super(), ca(this, t, ga, pa, _a, { + super(), oa(this, t, ca, fa, sa, { height: 0, width: 1, elem_id: 2, @@ -294,40 +294,40 @@ class ba extends ra { } } const { - SvelteComponent: wa, - append: dr, - attr: Tn, - create_component: va, - destroy_component: ya, - detach: Ea, - element: Di, - init: Sa, - insert: ka, - mount_component: Ta, - safe_not_equal: Aa, - set_data: Ba, - space: Ca, - text: Ia, - toggle_class: lt, - transition_in: La, - transition_out: Pa + SvelteComponent: _a, + append: fr, + attr: kn, + create_component: ha, + destroy_component: ma, + detach: pa, + element: Ni, + init: ga, + insert: ba, + mount_component: wa, + safe_not_equal: va, + set_data: ya, + space: Ea, + text: Sa, + toggle_class: rt, + transition_in: ka, + transition_out: Ta } = window.__gradio__svelte__internal; -function Oa(e) { +function Aa(e) { let t, n, r, i, o, l; return r = new /*Icon*/ e[1]({}), { c() { - t = Di("label"), n = Di("span"), va(r.$$.fragment), i = Ca(), o = Ia( + t = Ni("label"), n = Ni("span"), ha(r.$$.fragment), i = Ea(), o = Sa( /*label*/ e[0] - ), Tn(n, "class", "svelte-9gxdi0"), Tn(t, "for", ""), Tn(t, "data-testid", "block-label"), Tn(t, "class", "svelte-9gxdi0"), lt(t, "hide", !/*show_label*/ - e[2]), lt(t, "sr-only", !/*show_label*/ - e[2]), lt( + ), kn(n, "class", "svelte-9gxdi0"), kn(t, "for", ""), kn(t, "data-testid", "block-label"), kn(t, "class", "svelte-9gxdi0"), rt(t, "hide", !/*show_label*/ + e[2]), rt(t, "sr-only", !/*show_label*/ + e[2]), rt( t, "float", /*float*/ e[4] - ), lt( + ), rt( t, "hide-label", /*disable*/ @@ -335,26 +335,26 @@ function Oa(e) { ); }, m(u, s) { - ka(u, t, s), dr(t, n), Ta(r, n, null), dr(t, i), dr(t, o), l = !0; + ba(u, t, s), fr(t, n), wa(r, n, null), fr(t, i), fr(t, o), l = !0; }, p(u, [s]) { (!l || s & /*label*/ - 1) && Ba( + 1) && ya( o, /*label*/ u[0] ), (!l || s & /*show_label*/ - 4) && lt(t, "hide", !/*show_label*/ + 4) && rt(t, "hide", !/*show_label*/ u[2]), (!l || s & /*show_label*/ - 4) && lt(t, "sr-only", !/*show_label*/ + 4) && rt(t, "sr-only", !/*show_label*/ u[2]), (!l || s & /*float*/ - 16) && lt( + 16) && rt( t, "float", /*float*/ u[4] ), (!l || s & /*disable*/ - 8) && lt( + 8) && rt( t, "hide-label", /*disable*/ @@ -362,25 +362,25 @@ function Oa(e) { ); }, i(u) { - l || (La(r.$$.fragment, u), l = !0); + l || (ka(r.$$.fragment, u), l = !0); }, o(u) { - Pa(r.$$.fragment, u), l = !1; + Ta(r.$$.fragment, u), l = !1; }, d(u) { - u && Ea(t), ya(r); + u && pa(t), ma(r); } }; } -function Ha(e, t, n) { +function Ba(e, t, n) { let { label: r = null } = t, { Icon: i } = t, { show_label: o = !0 } = t, { disable: l = !1 } = t, { float: u = !0 } = t; return e.$$set = (s) => { "label" in s && n(0, r = s.label), "Icon" in s && n(1, i = s.Icon), "show_label" in s && n(2, o = s.show_label), "disable" in s && n(3, l = s.disable), "float" in s && n(4, u = s.float); }, [r, i, o, l, u]; } -class Pl extends wa { +class Tl extends _a { constructor(t) { - super(), Sa(this, t, Ha, Oa, Aa, { + super(), ga(this, t, Ba, Aa, va, { label: 0, Icon: 1, show_label: 2, @@ -390,66 +390,66 @@ class Pl extends wa { } } const { - SvelteComponent: Na, - append: zr, + SvelteComponent: Ca, + append: qr, attr: et, - bubble: Ma, - create_component: Da, - destroy_component: Ra, - detach: Ol, - element: Vr, - init: Ua, - insert: Hl, - listen: Fa, - mount_component: Ga, - safe_not_equal: qa, - set_data: ja, - set_style: An, - space: xa, - text: za, - toggle_class: Ne, - transition_in: Va, - transition_out: Xa + bubble: Ia, + create_component: La, + destroy_component: Oa, + detach: Al, + element: jr, + init: Pa, + insert: Bl, + listen: Na, + mount_component: Ha, + safe_not_equal: Da, + set_data: Ma, + set_style: Tn, + space: Ra, + text: Ua, + toggle_class: He, + transition_in: Fa, + transition_out: Ga } = window.__gradio__svelte__internal; -function Ri(e) { +function Hi(e) { let t, n; return { c() { - t = Vr("span"), n = za( + t = jr("span"), n = Ua( /*label*/ e[1] ), et(t, "class", "svelte-lpi64a"); }, m(r, i) { - Hl(r, t, i), zr(t, n); + Bl(r, t, i), qr(t, n); }, p(r, i) { i & /*label*/ - 2 && ja( + 2 && Ma( n, /*label*/ r[1] ); }, d(r) { - r && Ol(t); + r && Al(t); } }; } -function Wa(e) { +function qa(e) { let t, n, r, i, o, l, u, s = ( /*show_label*/ - e[2] && Ri(e) + e[2] && Hi(e) ); return i = new /*Icon*/ e[0]({}), { c() { - t = Vr("button"), s && s.c(), n = xa(), r = Vr("div"), Da(i.$$.fragment), et(r, "class", "svelte-lpi64a"), Ne( + t = jr("button"), s && s.c(), n = Ra(), r = jr("div"), La(i.$$.fragment), et(r, "class", "svelte-lpi64a"), He( r, "small", /*size*/ e[4] === "small" - ), Ne( + ), He( r, "large", /*size*/ @@ -470,39 +470,39 @@ function Wa(e) { "title", /*label*/ e[1] - ), et(t, "class", "svelte-lpi64a"), Ne( + ), et(t, "class", "svelte-lpi64a"), He( t, "pending", /*pending*/ e[3] - ), Ne( + ), He( t, "padded", /*padded*/ e[5] - ), Ne( + ), He( t, "highlight", /*highlight*/ e[6] - ), Ne( + ), He( t, "transparent", /*transparent*/ e[9] - ), An(t, "color", !/*disabled*/ + ), Tn(t, "color", !/*disabled*/ e[7] && /*_color*/ e[11] ? ( /*_color*/ e[11] - ) : "var(--block-label-text-color)"), An(t, "--bg-color", /*disabled*/ + ) : "var(--block-label-text-color)"), Tn(t, "--bg-color", /*disabled*/ e[7] ? "auto" : ( /*background*/ e[10] )); }, m(a, f) { - Hl(a, t, f), s && s.m(t, null), zr(t, n), zr(t, r), Ga(i, r, null), o = !0, l || (u = Fa( + Bl(a, t, f), s && s.m(t, null), qr(t, n), qr(t, r), Ha(i, r, null), o = !0, l || (u = Na( t, "click", /*click_handler*/ @@ -511,14 +511,14 @@ function Wa(e) { }, p(a, [f]) { /*show_label*/ - a[2] ? s ? s.p(a, f) : (s = Ri(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/ - 16) && Ne( + a[2] ? s ? s.p(a, f) : (s = Hi(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/ + 16) && He( r, "small", /*size*/ a[4] === "small" ), (!o || f & /*size*/ - 16) && Ne( + 16) && He( r, "large", /*size*/ @@ -544,63 +544,63 @@ function Wa(e) { /*label*/ a[1] ), (!o || f & /*pending*/ - 8) && Ne( + 8) && He( t, "pending", /*pending*/ a[3] ), (!o || f & /*padded*/ - 32) && Ne( + 32) && He( t, "padded", /*padded*/ a[5] ), (!o || f & /*highlight*/ - 64) && Ne( + 64) && He( t, "highlight", /*highlight*/ a[6] ), (!o || f & /*transparent*/ - 512) && Ne( + 512) && He( t, "transparent", /*transparent*/ a[9] ), f & /*disabled, _color*/ - 2176 && An(t, "color", !/*disabled*/ + 2176 && Tn(t, "color", !/*disabled*/ a[7] && /*_color*/ a[11] ? ( /*_color*/ a[11] ) : "var(--block-label-text-color)"), f & /*disabled, background*/ - 1152 && An(t, "--bg-color", /*disabled*/ + 1152 && Tn(t, "--bg-color", /*disabled*/ a[7] ? "auto" : ( /*background*/ a[10] )); }, i(a) { - o || (Va(i.$$.fragment, a), o = !0); + o || (Fa(i.$$.fragment, a), o = !0); }, o(a) { - Xa(i.$$.fragment, a), o = !1; + Ga(i.$$.fragment, a), o = !1; }, d(a) { - a && Ol(t), s && s.d(), Ra(i), l = !1, u(); + a && Al(t), s && s.d(), Oa(i), l = !1, u(); } }; } -function Za(e, t, n) { - let r, { Icon: i } = t, { label: o = "" } = t, { show_label: l = !1 } = t, { pending: u = !1 } = t, { size: s = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: d = !1 } = t, { hasPopup: c = !1 } = t, { color: h = "var(--block-label-text-color)" } = t, { transparent: _ = !1 } = t, { background: m = "var(--background-fill-primary)" } = t; - function g(p) { - Ma.call(this, e, p); +function ja(e, t, n) { + let r, { Icon: i } = t, { label: o = "" } = t, { show_label: l = !1 } = t, { pending: u = !1 } = t, { size: s = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: d = !1 } = t, { hasPopup: c = !1 } = t, { color: _ = "var(--block-label-text-color)" } = t, { transparent: h = !1 } = t, { background: p = "var(--background-fill-primary)" } = t; + function g(m) { + Ia.call(this, e, m); } - return e.$$set = (p) => { - "Icon" in p && n(0, i = p.Icon), "label" in p && n(1, o = p.label), "show_label" in p && n(2, l = p.show_label), "pending" in p && n(3, u = p.pending), "size" in p && n(4, s = p.size), "padded" in p && n(5, a = p.padded), "highlight" in p && n(6, f = p.highlight), "disabled" in p && n(7, d = p.disabled), "hasPopup" in p && n(8, c = p.hasPopup), "color" in p && n(12, h = p.color), "transparent" in p && n(9, _ = p.transparent), "background" in p && n(10, m = p.background); + return e.$$set = (m) => { + "Icon" in m && n(0, i = m.Icon), "label" in m && n(1, o = m.label), "show_label" in m && n(2, l = m.show_label), "pending" in m && n(3, u = m.pending), "size" in m && n(4, s = m.size), "padded" in m && n(5, a = m.padded), "highlight" in m && n(6, f = m.highlight), "disabled" in m && n(7, d = m.disabled), "hasPopup" in m && n(8, c = m.hasPopup), "color" in m && n(12, _ = m.color), "transparent" in m && n(9, h = m.transparent), "background" in m && n(10, p = m.background); }, e.$$.update = () => { e.$$.dirty & /*highlight, color*/ - 4160 && n(11, r = f ? "var(--color-accent)" : h); + 4160 && n(11, r = f ? "var(--color-accent)" : _); }, [ i, o, @@ -611,16 +611,16 @@ function Za(e, t, n) { f, d, c, - _, - m, - r, h, + p, + r, + _, g ]; } -class Jt extends Na { +class dn extends Ca { constructor(t) { - super(), Ua(this, t, Za, Wa, qa, { + super(), Pa(this, t, ja, qa, Da, { Icon: 0, label: 1, show_label: 2, @@ -637,29 +637,29 @@ class Jt extends Na { } } const { - SvelteComponent: Ja, - append: Qa, - attr: _r, - binding_callbacks: Ya, - create_slot: Ka, - detach: $a, - element: Ui, - get_all_dirty_from_scope: eu, - get_slot_changes: tu, - init: nu, - insert: ru, - safe_not_equal: iu, - toggle_class: st, - transition_in: ou, - transition_out: lu, - update_slot_base: su + SvelteComponent: xa, + append: za, + attr: cr, + binding_callbacks: Va, + create_slot: Xa, + detach: Wa, + element: Di, + get_all_dirty_from_scope: Za, + get_slot_changes: Ja, + init: Qa, + insert: Ya, + safe_not_equal: Ka, + toggle_class: it, + transition_in: $a, + transition_out: eu, + update_slot_base: tu } = window.__gradio__svelte__internal; -function au(e) { +function nu(e) { let t, n, r; const i = ( /*#slots*/ e[5].default - ), o = Ka( + ), o = Xa( i, e, /*$$scope*/ @@ -668,22 +668,22 @@ function au(e) { ); return { c() { - t = Ui("div"), n = Ui("div"), o && o.c(), _r(n, "class", "icon svelte-3w3rth"), _r(t, "class", "empty svelte-3w3rth"), _r(t, "aria-label", "Empty value"), st( + t = Di("div"), n = Di("div"), o && o.c(), cr(n, "class", "icon svelte-3w3rth"), cr(t, "class", "empty svelte-3w3rth"), cr(t, "aria-label", "Empty value"), it( t, "small", /*size*/ e[0] === "small" - ), st( + ), it( t, "large", /*size*/ e[0] === "large" - ), st( + ), it( t, "unpadded_box", /*unpadded_box*/ e[1] - ), st( + ), it( t, "small_parent", /*parent_height*/ @@ -691,47 +691,47 @@ function au(e) { ); }, m(l, u) { - ru(l, t, u), Qa(t, n), o && o.m(n, null), e[6](t), r = !0; + Ya(l, t, u), za(t, n), o && o.m(n, null), e[6](t), r = !0; }, p(l, [u]) { o && o.p && (!r || u & /*$$scope*/ - 16) && su( + 16) && tu( o, i, l, /*$$scope*/ l[4], - r ? tu( + r ? Ja( i, /*$$scope*/ l[4], u, null - ) : eu( + ) : Za( /*$$scope*/ l[4] ), null ), (!r || u & /*size*/ - 1) && st( + 1) && it( t, "small", /*size*/ l[0] === "small" ), (!r || u & /*size*/ - 1) && st( + 1) && it( t, "large", /*size*/ l[0] === "large" ), (!r || u & /*unpadded_box*/ - 2) && st( + 2) && it( t, "unpadded_box", /*unpadded_box*/ l[1] ), (!r || u & /*parent_height*/ - 8) && st( + 8) && it( t, "small_parent", /*parent_height*/ @@ -739,17 +739,17 @@ function au(e) { ); }, i(l) { - r || (ou(o, l), r = !0); + r || ($a(o, l), r = !0); }, o(l) { - lu(o, l), r = !1; + eu(o, l), r = !1; }, d(l) { - l && $a(t), o && o.d(l), e[6](null); + l && Wa(t), o && o.d(l), e[6](null); } }; } -function uu(e) { +function ru(e) { let t, n = e[0], r = 1; for (; r < e.length; ) { const i = e[r], o = e[r + 1]; @@ -759,24 +759,24 @@ function uu(e) { } return n; } -function fu(e, t, n) { +function iu(e, t, n) { let r, { $$slots: i = {}, $$scope: o } = t, { size: l = "small" } = t, { unpadded_box: u = !1 } = t, s; function a(d) { if (!d) return !1; - const { height: c } = d.getBoundingClientRect(), { height: h } = uu([ + const { height: c } = d.getBoundingClientRect(), { height: _ } = ru([ d, "access", - (_) => _.parentElement, + (h) => h.parentElement, "optionalAccess", - (_) => _.getBoundingClientRect, + (h) => h.getBoundingClientRect, "call", - (_) => _() + (h) => h() ]) || { height: c }; - return c > h + 2; + return c > _ + 2; } function f(d) { - Ya[d ? "unshift" : "push"](() => { + Va[d ? "unshift" : "push"](() => { s = d, n(2, s); }); } @@ -787,310 +787,277 @@ function fu(e, t, n) { 4 && n(3, r = a(s)); }, [l, u, s, r, o, i, f]; } -class cu extends Ja { +class ou extends xa { constructor(t) { - super(), nu(this, t, fu, au, iu, { size: 0, unpadded_box: 1 }); + super(), Qa(this, t, iu, nu, Ka, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: du, - append: hr, - attr: qe, - detach: _u, - init: hu, - insert: mu, - noop: mr, - safe_not_equal: pu, - set_style: Je, - svg_element: Bn + SvelteComponent: lu, + append: dr, + attr: Fe, + detach: su, + init: au, + insert: uu, + noop: _r, + safe_not_equal: fu, + set_style: Ze, + svg_element: An } = window.__gradio__svelte__internal; -function gu(e) { +function cu(e) { let t, n, r, i; return { c() { - t = Bn("svg"), n = Bn("g"), r = Bn("path"), i = Bn("path"), qe(r, "d", "M18,6L6.087,17.913"), Je(r, "fill", "none"), Je(r, "fill-rule", "nonzero"), Je(r, "stroke-width", "2px"), qe(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), qe(i, "d", "M4.364,4.364L19.636,19.636"), Je(i, "fill", "none"), Je(i, "fill-rule", "nonzero"), Je(i, "stroke-width", "2px"), qe(t, "width", "100%"), qe(t, "height", "100%"), qe(t, "viewBox", "0 0 24 24"), qe(t, "version", "1.1"), qe(t, "xmlns", "http://www.w3.org/2000/svg"), qe(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), qe(t, "xml:space", "preserve"), qe(t, "stroke", "currentColor"), Je(t, "fill-rule", "evenodd"), Je(t, "clip-rule", "evenodd"), Je(t, "stroke-linecap", "round"), Je(t, "stroke-linejoin", "round"); + t = An("svg"), n = An("g"), r = An("path"), i = An("path"), Fe(r, "d", "M18,6L6.087,17.913"), Ze(r, "fill", "none"), Ze(r, "fill-rule", "nonzero"), Ze(r, "stroke-width", "2px"), Fe(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Fe(i, "d", "M4.364,4.364L19.636,19.636"), Ze(i, "fill", "none"), Ze(i, "fill-rule", "nonzero"), Ze(i, "stroke-width", "2px"), Fe(t, "width", "100%"), Fe(t, "height", "100%"), Fe(t, "viewBox", "0 0 24 24"), Fe(t, "version", "1.1"), Fe(t, "xmlns", "http://www.w3.org/2000/svg"), Fe(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Fe(t, "xml:space", "preserve"), Fe(t, "stroke", "currentColor"), Ze(t, "fill-rule", "evenodd"), Ze(t, "clip-rule", "evenodd"), Ze(t, "stroke-linecap", "round"), Ze(t, "stroke-linejoin", "round"); }, m(o, l) { - mu(o, t, l), hr(t, n), hr(n, r), hr(t, i); + uu(o, t, l), dr(t, n), dr(n, r), dr(t, i); }, - p: mr, - i: mr, - o: mr, + p: _r, + i: _r, + o: _r, d(o) { - o && _u(t); - } - }; -} -class bu extends du { - constructor(t) { - super(), hu(this, t, null, gu, pu, {}); - } -} -const { - SvelteComponent: wu, - append: vu, - attr: en, - detach: yu, - init: Eu, - insert: Su, - noop: pr, - safe_not_equal: ku, - svg_element: Fi -} = window.__gradio__svelte__internal; -function Tu(e) { - let t, n; - return { - c() { - t = Fi("svg"), n = Fi("path"), en(n, "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"), en(n, "fill", "currentColor"), en(t, "id", "icon"), en(t, "xmlns", "http://www.w3.org/2000/svg"), en(t, "viewBox", "0 0 32 32"); - }, - m(r, i) { - Su(r, t, i), vu(t, n); - }, - p: pr, - i: pr, - o: pr, - d(r) { - r && yu(t); + o && su(t); } }; } -class Au extends wu { +class du extends lu { constructor(t) { - super(), Eu(this, t, null, Tu, ku, {}); + super(), au(this, t, null, cu, fu, {}); } } const { - SvelteComponent: Bu, - append: Cu, - attr: Nt, - detach: Iu, - init: Lu, - insert: Pu, - noop: gr, - safe_not_equal: Ou, - svg_element: Gi + SvelteComponent: _u, + append: hu, + attr: Ht, + detach: mu, + init: pu, + insert: gu, + noop: hr, + safe_not_equal: bu, + svg_element: Mi } = window.__gradio__svelte__internal; -function Hu(e) { +function wu(e) { let t, n; return { c() { - t = Gi("svg"), n = Gi("path"), Nt(n, "fill", "currentColor"), Nt(n, "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"), Nt(t, "xmlns", "http://www.w3.org/2000/svg"), Nt(t, "width", "100%"), Nt(t, "height", "100%"), Nt(t, "viewBox", "0 0 32 32"); + t = Mi("svg"), n = Mi("path"), Ht(n, "fill", "currentColor"), Ht(n, "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"), Ht(t, "xmlns", "http://www.w3.org/2000/svg"), Ht(t, "width", "100%"), Ht(t, "height", "100%"), Ht(t, "viewBox", "0 0 32 32"); }, m(r, i) { - Pu(r, t, i), Cu(t, n); + gu(r, t, i), hu(t, n); }, - p: gr, - i: gr, - o: gr, + p: hr, + i: hr, + o: hr, d(r) { - r && Iu(t); + r && mu(t); } }; } -class Nl extends Bu { +class Cl extends _u { constructor(t) { - super(), Lu(this, t, null, Hu, Ou, {}); + super(), pu(this, t, null, wu, bu, {}); } } const { - SvelteComponent: Nu, - append: Mu, - attr: je, - detach: Du, - init: Ru, - insert: Uu, - noop: br, - safe_not_equal: Fu, - svg_element: qi + SvelteComponent: vu, + append: yu, + attr: Ge, + detach: Eu, + init: Su, + insert: ku, + noop: mr, + safe_not_equal: Tu, + svg_element: Ri } = window.__gradio__svelte__internal; -function Gu(e) { +function Au(e) { let t, n; return { c() { - t = qi("svg"), n = qi("path"), je(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), je(t, "xmlns", "http://www.w3.org/2000/svg"), je(t, "width", "100%"), je(t, "height", "100%"), je(t, "viewBox", "0 0 24 24"), je(t, "fill", "none"), je(t, "stroke", "currentColor"), je(t, "stroke-width", "1.5"), je(t, "stroke-linecap", "round"), je(t, "stroke-linejoin", "round"), je(t, "class", "feather feather-edit-2"); + t = Ri("svg"), n = Ri("path"), Ge(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), Ge(t, "xmlns", "http://www.w3.org/2000/svg"), Ge(t, "width", "100%"), Ge(t, "height", "100%"), Ge(t, "viewBox", "0 0 24 24"), Ge(t, "fill", "none"), Ge(t, "stroke", "currentColor"), Ge(t, "stroke-width", "1.5"), Ge(t, "stroke-linecap", "round"), Ge(t, "stroke-linejoin", "round"), Ge(t, "class", "feather feather-edit-2"); }, m(r, i) { - Uu(r, t, i), Mu(t, n); + ku(r, t, i), yu(t, n); }, - p: br, - i: br, - o: br, + p: mr, + i: mr, + o: mr, d(r) { - r && Du(t); + r && Eu(t); } }; } -class qu extends Nu { +class Bu extends vu { constructor(t) { - super(), Ru(this, t, null, Gu, Fu, {}); + super(), Su(this, t, null, Au, Tu, {}); } } const { - SvelteComponent: ju, - append: ji, - attr: Me, - detach: xu, - init: zu, - insert: Vu, - noop: wr, - safe_not_equal: Xu, - svg_element: vr + SvelteComponent: Cu, + append: Ui, + attr: De, + detach: Iu, + init: Lu, + insert: Ou, + noop: pr, + safe_not_equal: Pu, + svg_element: gr } = window.__gradio__svelte__internal; -function Wu(e) { +function Nu(e) { let t, n, r; return { c() { - t = vr("svg"), n = vr("path"), r = vr("polyline"), Me(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), Me(r, "points", "13 2 13 9 20 9"), Me(t, "xmlns", "http://www.w3.org/2000/svg"), Me(t, "width", "100%"), Me(t, "height", "100%"), Me(t, "viewBox", "0 0 24 24"), Me(t, "fill", "none"), Me(t, "stroke", "currentColor"), Me(t, "stroke-width", "1.5"), Me(t, "stroke-linecap", "round"), Me(t, "stroke-linejoin", "round"), Me(t, "class", "feather feather-file"); + t = gr("svg"), n = gr("path"), r = gr("polyline"), De(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), De(r, "points", "13 2 13 9 20 9"), De(t, "xmlns", "http://www.w3.org/2000/svg"), De(t, "width", "100%"), De(t, "height", "100%"), De(t, "viewBox", "0 0 24 24"), De(t, "fill", "none"), De(t, "stroke", "currentColor"), De(t, "stroke-width", "1.5"), De(t, "stroke-linecap", "round"), De(t, "stroke-linejoin", "round"), De(t, "class", "feather feather-file"); }, m(i, o) { - Vu(i, t, o), ji(t, n), ji(t, r); + Ou(i, t, o), Ui(t, n), Ui(t, r); }, - p: wr, - i: wr, - o: wr, + p: pr, + i: pr, + o: pr, d(i) { - i && xu(t); + i && Iu(t); } }; } -let Zu = class extends ju { +let Hu = class extends Cu { constructor(t) { - super(), zu(this, t, null, Wu, Xu, {}); + super(), Lu(this, t, null, Nu, Pu, {}); } }; const { - SvelteComponent: Ju, - append: yr, + SvelteComponent: Du, + append: br, attr: he, - detach: Qu, - init: Yu, - insert: Ku, - noop: Er, - safe_not_equal: $u, - svg_element: Cn + detach: Mu, + init: Ru, + insert: Uu, + noop: wr, + safe_not_equal: Fu, + svg_element: Bn } = window.__gradio__svelte__internal; -function ef(e) { +function Gu(e) { let t, n, r, i; return { c() { - t = Cn("svg"), n = Cn("rect"), r = Cn("circle"), i = Cn("polyline"), he(n, "x", "3"), he(n, "y", "3"), he(n, "width", "18"), he(n, "height", "18"), he(n, "rx", "2"), he(n, "ry", "2"), he(r, "cx", "8.5"), he(r, "cy", "8.5"), he(r, "r", "1.5"), he(i, "points", "21 15 16 10 5 21"), he(t, "xmlns", "http://www.w3.org/2000/svg"), he(t, "width", "100%"), he(t, "height", "100%"), he(t, "viewBox", "0 0 24 24"), he(t, "fill", "none"), he(t, "stroke", "currentColor"), he(t, "stroke-width", "1.5"), he(t, "stroke-linecap", "round"), he(t, "stroke-linejoin", "round"), he(t, "class", "feather feather-image"); + t = Bn("svg"), n = Bn("rect"), r = Bn("circle"), i = Bn("polyline"), he(n, "x", "3"), he(n, "y", "3"), he(n, "width", "18"), he(n, "height", "18"), he(n, "rx", "2"), he(n, "ry", "2"), he(r, "cx", "8.5"), he(r, "cy", "8.5"), he(r, "r", "1.5"), he(i, "points", "21 15 16 10 5 21"), he(t, "xmlns", "http://www.w3.org/2000/svg"), he(t, "width", "100%"), he(t, "height", "100%"), he(t, "viewBox", "0 0 24 24"), he(t, "fill", "none"), he(t, "stroke", "currentColor"), he(t, "stroke-width", "1.5"), he(t, "stroke-linecap", "round"), he(t, "stroke-linejoin", "round"), he(t, "class", "feather feather-image"); }, m(o, l) { - Ku(o, t, l), yr(t, n), yr(t, r), yr(t, i); + Uu(o, t, l), br(t, n), br(t, r), br(t, i); }, - p: Er, - i: Er, - o: Er, + p: wr, + i: wr, + o: wr, d(o) { - o && Qu(t); + o && Mu(t); } }; } -let Ml = class extends Ju { +let Il = class extends Du { constructor(t) { - super(), Yu(this, t, null, ef, $u, {}); + super(), Ru(this, t, null, Gu, Fu, {}); } }; const { - SvelteComponent: tf, - append: nf, - attr: Mt, - detach: rf, - init: of, - insert: lf, - noop: Sr, - safe_not_equal: sf, - svg_element: xi + SvelteComponent: qu, + append: ju, + attr: Dt, + detach: xu, + init: zu, + insert: Vu, + noop: vr, + safe_not_equal: Xu, + svg_element: Fi } = window.__gradio__svelte__internal; -function af(e) { +function Wu(e) { let t, n; return { c() { - t = xi("svg"), n = xi("path"), Mt(n, "fill", "currentColor"), Mt(n, "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.78a3.99 3.99 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-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 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-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z"), Mt(t, "xmlns", "http://www.w3.org/2000/svg"), Mt(t, "width", "100%"), Mt(t, "height", "100%"), Mt(t, "viewBox", "0 0 24 24"); + t = Fi("svg"), n = Fi("path"), Dt(n, "fill", "currentColor"), Dt(n, "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.78a3.99 3.99 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-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 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-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z"), Dt(t, "xmlns", "http://www.w3.org/2000/svg"), Dt(t, "width", "100%"), Dt(t, "height", "100%"), Dt(t, "viewBox", "0 0 24 24"); }, m(r, i) { - lf(r, t, i), nf(t, n); + Vu(r, t, i), ju(t, n); }, - p: Sr, - i: Sr, - o: Sr, + p: vr, + i: vr, + o: vr, d(r) { - r && rf(t); + r && xu(t); } }; } -class uf extends tf { +class Zu extends qu { constructor(t) { - super(), of(this, t, null, af, sf, {}); + super(), zu(this, t, null, Wu, Xu, {}); } } const { - SvelteComponent: ff, - append: zi, - attr: De, - detach: cf, - init: df, - insert: _f, - noop: kr, - safe_not_equal: hf, - svg_element: Tr + SvelteComponent: Ju, + append: Gi, + attr: Me, + detach: Qu, + init: Yu, + insert: Ku, + noop: yr, + safe_not_equal: $u, + svg_element: Er } = window.__gradio__svelte__internal; -function mf(e) { +function ef(e) { let t, n, r; return { c() { - t = Tr("svg"), n = Tr("polyline"), r = Tr("path"), De(n, "points", "1 4 1 10 7 10"), De(r, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), De(t, "xmlns", "http://www.w3.org/2000/svg"), De(t, "width", "100%"), De(t, "height", "100%"), De(t, "viewBox", "0 0 24 24"), De(t, "fill", "none"), De(t, "stroke", "currentColor"), De(t, "stroke-width", "2"), De(t, "stroke-linecap", "round"), De(t, "stroke-linejoin", "round"), De(t, "class", "feather feather-rotate-ccw"); + t = Er("svg"), n = Er("polyline"), r = Er("path"), Me(n, "points", "1 4 1 10 7 10"), Me(r, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Me(t, "xmlns", "http://www.w3.org/2000/svg"), Me(t, "width", "100%"), Me(t, "height", "100%"), Me(t, "viewBox", "0 0 24 24"), Me(t, "fill", "none"), Me(t, "stroke", "currentColor"), Me(t, "stroke-width", "2"), Me(t, "stroke-linecap", "round"), Me(t, "stroke-linejoin", "round"), Me(t, "class", "feather feather-rotate-ccw"); }, m(i, o) { - _f(i, t, o), zi(t, n), zi(t, r); + Ku(i, t, o), Gi(t, n), Gi(t, r); }, - p: kr, - i: kr, - o: kr, + p: yr, + i: yr, + o: yr, d(i) { - i && cf(t); + i && Qu(t); } }; } -class pf extends ff { +class tf extends Ju { constructor(t) { - super(), df(this, t, null, mf, hf, {}); + super(), Yu(this, t, null, ef, $u, {}); } } const { - SvelteComponent: gf, - append: Ar, + SvelteComponent: nf, + append: Sr, attr: ve, - detach: bf, - init: wf, - insert: vf, - noop: Br, - safe_not_equal: yf, - svg_element: In + detach: rf, + init: of, + insert: lf, + noop: kr, + safe_not_equal: sf, + svg_element: Cn } = window.__gradio__svelte__internal; -function Ef(e) { +function af(e) { let t, n, r, i; return { c() { - t = In("svg"), n = In("path"), r = In("polyline"), i = In("line"), ve(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ve(r, "points", "17 8 12 3 7 8"), ve(i, "x1", "12"), ve(i, "y1", "3"), ve(i, "x2", "12"), ve(i, "y2", "15"), ve(t, "xmlns", "http://www.w3.org/2000/svg"), ve(t, "width", "90%"), ve(t, "height", "90%"), ve(t, "viewBox", "0 0 24 24"), ve(t, "fill", "none"), ve(t, "stroke", "currentColor"), ve(t, "stroke-width", "2"), ve(t, "stroke-linecap", "round"), ve(t, "stroke-linejoin", "round"), ve(t, "class", "feather feather-upload"); + t = Cn("svg"), n = Cn("path"), r = Cn("polyline"), i = Cn("line"), ve(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ve(r, "points", "17 8 12 3 7 8"), ve(i, "x1", "12"), ve(i, "y1", "3"), ve(i, "x2", "12"), ve(i, "y2", "15"), ve(t, "xmlns", "http://www.w3.org/2000/svg"), ve(t, "width", "90%"), ve(t, "height", "90%"), ve(t, "viewBox", "0 0 24 24"), ve(t, "fill", "none"), ve(t, "stroke", "currentColor"), ve(t, "stroke-width", "2"), ve(t, "stroke-linecap", "round"), ve(t, "stroke-linejoin", "round"), ve(t, "class", "feather feather-upload"); }, m(o, l) { - vf(o, t, l), Ar(t, n), Ar(t, r), Ar(t, i); + lf(o, t, l), Sr(t, n), Sr(t, r), Sr(t, i); }, - p: Br, - i: Br, - o: Br, + p: kr, + i: kr, + o: kr, d(o) { - o && bf(t); + o && rf(t); } }; } -let Sf = class extends gf { +let uf = class extends nf { constructor(t) { - super(), wf(this, t, null, Ef, yf, {}); + super(), of(this, t, null, af, sf, {}); } }; -const kf = [ +const ff = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -1101,7 +1068,7 @@ const kf = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], Vi = { +], qi = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -1394,203 +1361,78 @@ const kf = [ 950: "#4c0519" } }; -kf.reduce( +ff.reduce( (e, { color: t, primary: n, secondary: r }) => ({ ...e, [t]: { - primary: Vi[t][n], - secondary: Vi[t][r] + primary: qi[t][n], + secondary: qi[t][r] } }), {} ); -function Tf(e) { - let t, n = e[0], r = 1; - for (; r < e.length; ) { - const i = e[r], o = e[r + 1]; - if (r += 2, (i === "optionalAccess" || i === "optionalCall") && n == null) - return; - i === "access" || i === "optionalAccess" ? (t = n, n = o(n)) : (i === "call" || i === "optionalCall") && (n = o((...l) => n.call(t, ...l)), t = void 0); - } - return n; -} -class Nn extends Error { - constructor(t) { - super(t), this.name = "ShareError"; - } -} -async function Af(e, t) { - if (window.__gradio_space__ == null) - throw new Nn("Must be on Spaces to share."); - let n, r, i; - if (t === "url") { - const s = await fetch(e); - n = await s.blob(), r = s.headers.get("content-type") || "", i = s.headers.get("content-disposition") || ""; - } else - n = Bf(e), r = e.split(";")[0].split(":")[1], i = "file" + r.split("/")[1]; - const o = new File([n], i, { type: r }), l = await fetch("https://huggingface.co/uploads", { - method: "POST", - body: o, - headers: { - "Content-Type": o.type, - "X-Requested-With": "XMLHttpRequest" - } - }); - if (!l.ok) { - if (Tf([l, "access", (s) => s.headers, "access", (s) => s.get, "call", (s) => s("content-type"), "optionalAccess", (s) => s.includes, "call", (s) => s("application/json")])) { - const s = await l.json(); - throw new Nn(`Upload failed: ${s.error}`); - } - throw new Nn("Upload failed."); - } - return await l.text(); -} -function Bf(e) { - for (var t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]), i = r.length, o = new Uint8Array(i); i--; ) - o[i] = r.charCodeAt(i); - return new Blob([o], { type: n }); -} -const { - SvelteComponent: Cf, - create_component: If, - destroy_component: Lf, - init: Pf, - mount_component: Of, - safe_not_equal: Hf, - transition_in: Nf, - transition_out: Mf -} = window.__gradio__svelte__internal, { createEventDispatcher: Df } = window.__gradio__svelte__internal; -function Rf(e) { - let t, n; - return t = new Jt({ - props: { - Icon: Au, - label: ( - /*i18n*/ - e[2]("common.share") - ), - pending: ( - /*pending*/ - e[3] - ) - } - }), t.$on( - "click", - /*click_handler*/ - e[5] - ), { - c() { - If(t.$$.fragment); - }, - m(r, i) { - Of(t, r, i), n = !0; - }, - p(r, [i]) { - const o = {}; - i & /*i18n*/ - 4 && (o.label = /*i18n*/ - r[2]("common.share")), i & /*pending*/ - 8 && (o.pending = /*pending*/ - r[3]), t.$set(o); - }, - i(r) { - n || (Nf(t.$$.fragment, r), n = !0); - }, - o(r) { - Mf(t.$$.fragment, r), n = !1; - }, - d(r) { - Lf(t, r); - } - }; -} -function Uf(e, t, n) { - const r = Df(); - let { formatter: i } = t, { value: o } = t, { i18n: l } = t, u = !1; - const s = async () => { - try { - n(3, u = !0); - const a = await i(o); - r("share", { description: a }); - } catch (a) { - console.error(a); - let f = a instanceof Nn ? a.message : "Share failed."; - r("error", f); - } finally { - n(3, u = !1); - } - }; - return e.$$set = (a) => { - "formatter" in a && n(0, i = a.formatter), "value" in a && n(1, o = a.value), "i18n" in a && n(2, l = a.i18n); - }, [i, o, l, u, r, s]; -} -class Ff extends Cf { - constructor(t) { - super(), Pf(this, t, Uf, Rf, Hf, { formatter: 0, value: 1, i18n: 2 }); - } -} const { - SvelteComponent: Gf, - append: yt, - attr: Xr, - check_outros: qf, - create_component: Dl, - destroy_component: Rl, - detach: Mn, - element: Wr, - group_outros: jf, - init: xf, - insert: Dn, - mount_component: Ul, - safe_not_equal: zf, - set_data: Zr, - space: Jr, - text: rn, - toggle_class: Xi, - transition_in: Gn, - transition_out: qn + SvelteComponent: cf, + append: wt, + attr: xr, + check_outros: df, + create_component: Ll, + destroy_component: Ol, + detach: Nn, + element: zr, + group_outros: _f, + init: hf, + insert: Hn, + mount_component: Pl, + safe_not_equal: mf, + set_data: Vr, + space: Xr, + text: tn, + toggle_class: ji, + transition_in: Un, + transition_out: Fn } = window.__gradio__svelte__internal; -function Vf(e) { +function pf(e) { let t, n; - return t = new Sf({}), { + return t = new uf({}), { c() { - Dl(t.$$.fragment); + Ll(t.$$.fragment); }, m(r, i) { - Ul(t, r, i), n = !0; + Pl(t, r, i), n = !0; }, i(r) { - n || (Gn(t.$$.fragment, r), n = !0); + n || (Un(t.$$.fragment, r), n = !0); }, o(r) { - qn(t.$$.fragment, r), n = !1; + Fn(t.$$.fragment, r), n = !1; }, d(r) { - Rl(t, r); + Ol(t, r); } }; } -function Xf(e) { +function gf(e) { let t, n; - return t = new uf({}), { + return t = new Zu({}), { c() { - Dl(t.$$.fragment); + Ll(t.$$.fragment); }, m(r, i) { - Ul(t, r, i), n = !0; + Pl(t, r, i), n = !0; }, i(r) { - n || (Gn(t.$$.fragment, r), n = !0); + n || (Un(t.$$.fragment, r), n = !0); }, o(r) { - qn(t.$$.fragment, r), n = !1; + Fn(t.$$.fragment, r), n = !1; }, d(r) { - Rl(t, r); + Ol(t, r); } }; } -function Wi(e) { +function xi(e) { let t, n, r = ( /*i18n*/ e[1]("common.or") + "" @@ -1601,25 +1443,25 @@ function Wi(e) { ), s; return { c() { - t = Wr("span"), n = rn("- "), i = rn(r), o = rn(" -"), l = Jr(), s = rn(u), Xr(t, "class", "or svelte-kzcjhc"); + t = zr("span"), n = tn("- "), i = tn(r), o = tn(" -"), l = Xr(), s = tn(u), xr(t, "class", "or svelte-kzcjhc"); }, m(a, f) { - Dn(a, t, f), yt(t, n), yt(t, i), yt(t, o), Dn(a, l, f), Dn(a, s, f); + Hn(a, t, f), wt(t, n), wt(t, i), wt(t, o), Hn(a, l, f), Hn(a, s, f); }, p(a, f) { f & /*i18n*/ 2 && r !== (r = /*i18n*/ - a[1]("common.or") + "") && Zr(i, r), f & /*message, i18n*/ + a[1]("common.or") + "") && Vr(i, r), f & /*message, i18n*/ 6 && u !== (u = /*message*/ (a[2] || /*i18n*/ - a[1]("upload_text.click_to_upload")) + "") && Zr(s, u); + a[1]("upload_text.click_to_upload")) + "") && Vr(s, u); }, d(a) { - a && (Mn(t), Mn(l), Mn(s)); + a && (Nn(t), Nn(l), Nn(s)); } }; } -function Wf(e) { +function bf(e) { let t, n, r, i, o, l = ( /*i18n*/ e[1]( @@ -1631,64 +1473,64 @@ function Wf(e) { e[5].file ) + "" ), u, s, a; - const f = [Xf, Vf], d = []; - function c(_, m) { + const f = [gf, pf], d = []; + function c(h, p) { return ( /*type*/ - _[0] === "clipboard" ? 0 : 1 + h[0] === "clipboard" ? 0 : 1 ); } r = c(e), i = d[r] = f[r](e); - let h = ( + let _ = ( /*mode*/ - e[3] !== "short" && Wi(e) + e[3] !== "short" && xi(e) ); return { c() { - t = Wr("div"), n = Wr("span"), i.c(), o = Jr(), u = rn(l), s = Jr(), h && h.c(), Xr(n, "class", "icon-wrap svelte-kzcjhc"), Xi( + t = zr("div"), n = zr("span"), i.c(), o = Xr(), u = tn(l), s = Xr(), _ && _.c(), xr(n, "class", "icon-wrap svelte-kzcjhc"), ji( n, "hovered", /*hovered*/ e[4] - ), Xr(t, "class", "wrap svelte-kzcjhc"); + ), xr(t, "class", "wrap svelte-kzcjhc"); }, - m(_, m) { - Dn(_, t, m), yt(t, n), d[r].m(n, null), yt(t, o), yt(t, u), yt(t, s), h && h.m(t, null), a = !0; + m(h, p) { + Hn(h, t, p), wt(t, n), d[r].m(n, null), wt(t, o), wt(t, u), wt(t, s), _ && _.m(t, null), a = !0; }, - p(_, [m]) { + p(h, [p]) { let g = r; - r = c(_), r !== g && (jf(), qn(d[g], 1, 1, () => { + r = c(h), r !== g && (_f(), Fn(d[g], 1, 1, () => { d[g] = null; - }), qf(), i = d[r], i || (i = d[r] = f[r](_), i.c()), Gn(i, 1), i.m(n, null)), (!a || m & /*hovered*/ - 16) && Xi( + }), df(), i = d[r], i || (i = d[r] = f[r](h), i.c()), Un(i, 1), i.m(n, null)), (!a || p & /*hovered*/ + 16) && ji( n, "hovered", /*hovered*/ - _[4] - ), (!a || m & /*i18n, type*/ + h[4] + ), (!a || p & /*i18n, type*/ 3) && l !== (l = /*i18n*/ - _[1]( + h[1]( /*defs*/ - _[5][ + h[5][ /*type*/ - _[0] + h[0] ] || /*defs*/ - _[5].file - ) + "") && Zr(u, l), /*mode*/ - _[3] !== "short" ? h ? h.p(_, m) : (h = Wi(_), h.c(), h.m(t, null)) : h && (h.d(1), h = null); + h[5].file + ) + "") && Vr(u, l), /*mode*/ + h[3] !== "short" ? _ ? _.p(h, p) : (_ = xi(h), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null); }, - i(_) { - a || (Gn(i), a = !0); + i(h) { + a || (Un(i), a = !0); }, - o(_) { - qn(i), a = !1; + o(h) { + Fn(i), a = !1; }, - d(_) { - _ && Mn(t), d[r].d(), h && h.d(); + d(h) { + h && Nn(t), d[r].d(), _ && _.d(); } }; } -function Zf(e, t, n) { +function wf(e, t, n) { let { type: r = "file" } = t, { i18n: i } = t, { message: o = void 0 } = t, { mode: l = "full" } = t, { hovered: u = !1 } = t; const s = { image: "upload_text.drop_image", @@ -1703,9 +1545,9 @@ function Zf(e, t, n) { "type" in a && n(0, r = a.type), "i18n" in a && n(1, i = a.i18n), "message" in a && n(2, o = a.message), "mode" in a && n(3, l = a.mode), "hovered" in a && n(4, u = a.hovered); }, [r, i, o, l, u, s]; } -class Jf extends Gf { +class vf extends cf { constructor(t) { - super(), xf(this, t, Zf, Wf, zf, { + super(), hf(this, t, wf, bf, mf, { type: 0, i18n: 1, message: 2, @@ -1714,14 +1556,14 @@ class Jf extends Gf { }); } } -var Cr = new Intl.Collator(0, { numeric: 1 }).compare; -function Zi(e, t, n) { - return e = e.split("."), t = t.split("."), Cr(e[0], t[0]) || Cr(e[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(e[2] = e.slice(2).join(".")), n == /[.-]/.test(t[2]) ? Cr(e[2], t[2]) : n ? -1 : 1); +var Tr = new Intl.Collator(0, { numeric: 1 }).compare; +function zi(e, t, n) { + return e = e.split("."), t = t.split("."), Tr(e[0], t[0]) || Tr(e[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(e[2] = e.slice(2).join(".")), n == /[.-]/.test(t[2]) ? Tr(e[2], t[2]) : n ? -1 : 1); } -function Fl(e, t, n) { +function Nl(e, t, n) { return t.startsWith("http://") || t.startsWith("https://") ? n ? e : t : e + t; } -function Ir(e) { +function Ar(e) { if (e.startsWith("http")) { const { protocol: t, host: n } = new URL(e); return n.endsWith("hf.space") ? { @@ -1746,12 +1588,12 @@ function Ir(e) { host: e }; } -const Gl = /^[^\/]*\/[^\/]*$/, Qf = /.*hf\.space\/{0,1}$/; -async function Yf(e, t) { +const Hl = /^[^\/]*\/[^\/]*$/, yf = /.*hf\.space\/{0,1}$/; +async function Ef(e, t) { const n = {}; t && (n.Authorization = `Bearer ${t}`); const r = e.trim(); - if (Gl.test(r)) + if (Hl.test(r)) try { const i = await fetch( `https://huggingface.co/api/spaces/${r}/host`, @@ -1762,13 +1604,13 @@ async function Yf(e, t) { const o = (await i.json()).host; return { space_id: e, - ...Ir(o) + ...Ar(o) }; } catch (i) { throw new Error("Space metadata could not be loaded." + i.message); } - if (Qf.test(r)) { - const { ws_protocol: i, http_protocol: o, host: l } = Ir(r); + if (yf.test(r)) { + const { ws_protocol: i, http_protocol: o, host: l } = Ar(r); return { space_id: l.replace(".hf.space", ""), ws_protocol: i, @@ -1778,17 +1620,17 @@ async function Yf(e, t) { } return { space_id: !1, - ...Ir(r) + ...Ar(r) }; } -function Kf(e) { +function Sf(e) { let t = {}; return e.forEach(({ api_name: n }, r) => { n && (t[n] = r); }), t; } -const $f = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; -async function Ji(e) { +const kf = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; +async function Vi(e) { try { const n = (await fetch( `https://huggingface.co/api/spaces/${e}/discussions`, @@ -1796,18 +1638,18 @@ async function Ji(e) { method: "HEAD" } )).headers.get("x-error-message"); - return !(n && $f.test(n)); + return !(n && kf.test(n)); } catch { return !1; } } -function Et(e, t, n) { +function vt(e, t, n) { if (e == null) return null; if (Array.isArray(e)) { const r = []; for (const i of e) - i == null ? r.push(null) : r.push(Et(i, t, n)); + i == null ? r.push(null) : r.push(vt(i, t, n)); return r; } return e.is_stream ? n == null ? new Ft({ @@ -1818,10 +1660,10 @@ function Et(e, t, n) { url: "/proxy=" + n + "stream/" + e.path }) : new Ft({ ...e, - url: tc(e.path, t, n) + url: Af(e.path, t, n) }); } -function ec(e) { +function Tf(e) { try { const t = new URL(e); return t.protocol === "http:" || t.protocol === "https:"; @@ -1829,10 +1671,10 @@ function ec(e) { return !1; } } -function tc(e, t, n) { - return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : ec(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; +function Af(e, t, n) { + return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : Tf(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; } -async function nc(e, t, n, r = oc) { +async function Bf(e, t, n, r = Lf) { let i = (Array.isArray(e) ? e : [e]).map( (o) => o.blob ); @@ -1843,13 +1685,13 @@ async function nc(e, t, n, r = oc) { throw new Error(o.error); return o.files ? o.files.map((l, u) => { const s = new Ft({ ...e[u], path: l }); - return Et(s, t, null); + return vt(s, t, null); }) : []; } ) ); } -async function rc(e, t) { +async function Cf(e, t) { return e.map( (n, r) => new Ft({ path: n.name, @@ -1875,9 +1717,9 @@ class Ft { this.path = t, this.url = n, this.orig_name = r, this.size = i, this.blob = n ? void 0 : o, this.is_stream = l, this.mime_type = u, this.alt_text = s; } } -const ql = "This application is too busy. Keep trying!", ht = "Connection errored out."; -let jl; -function ic(e, t) { +const Dl = "This application is too busy. Keep trying!", dt = "Connection errored out."; +let Ml; +function If(e, t) { return { post_data: n, upload_files: r, client: i, handle_blob: o }; async function n(l, u, s) { const a = { "Content-Type": "application/json" }; @@ -1889,13 +1731,13 @@ function ic(e, t) { headers: a }); } catch { - return [{ error: ht }, 500]; + return [{ error: dt }, 500]; } let d, c; try { d = await f.json(), c = f.status; - } catch (h) { - d = { error: `Could not parse server response: ${h}` }, c = 500; + } catch (_) { + d = { error: `Could not parse server response: ${_}` }, c = 500; } return [d, c]; } @@ -1903,72 +1745,72 @@ function ic(e, t) { const f = {}; s && (f.Authorization = `Bearer ${s}`); const d = 1e3, c = []; - for (let _ = 0; _ < u.length; _ += d) { - const m = u.slice(_, _ + d), g = new FormData(); - m.forEach((v) => { + for (let h = 0; h < u.length; h += d) { + const p = u.slice(h, h + d), g = new FormData(); + p.forEach((v) => { g.append("files", v); }); try { const v = a ? `${l}/upload?upload_id=${a}` : `${l}/upload`; - var h = await e(v, { + var _ = await e(v, { method: "POST", body: g, headers: f }); } catch { - return { error: ht }; + return { error: dt }; } - const p = await h.json(); - c.push(...p); + const m = await _.json(); + c.push(...m); } return { files: c }; } async function i(l, u = { normalise_files: !0 }) { return new Promise(async (s) => { const { status_callback: a, hf_token: f, normalise_files: d } = u, c = { - predict: ne, - submit: ce, + predict: te, + submit: fe, view_api: pe, component_server: B - }, h = d ?? !0; + }, _ = d ?? !0; if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) { - const E = await import("./wrapper-6f348d45-f837cf34.js"); - jl = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = E.WebSocket; + const S = await import("./wrapper-6f348d45-f837cf34.js"); + Ml = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = S.WebSocket; } - const { ws_protocol: _, http_protocol: m, host: g, space_id: p } = await Yf(l, f), v = Math.random().toString(36).substring(2), b = {}; - let w = !1, y = {}, S = null; - const C = {}, P = /* @__PURE__ */ new Set(); - let k, O = {}, U = !1; - f && p && (U = await sc(p, f)); - async function x(E) { - if (k = E, O = Kf((E == null ? void 0 : E.dependencies) || []), k.auth_required) + const { ws_protocol: h, http_protocol: p, host: g, space_id: m } = await Ef(l, f), v = Math.random().toString(36).substring(2), w = {}; + let b = !1, y = {}, k = null; + const C = {}, O = /* @__PURE__ */ new Set(); + let T, P = {}, M = !1; + f && m && (M = await Pf(m, f)); + async function j(S) { + if (T = S, P = Sf((S == null ? void 0 : S.dependencies) || []), T.auth_required) return { - config: k, + config: T, ...c }; try { - j = await pe(k); - } catch (M) { - console.error(`Could not get api details: ${M.message}`); + q = await pe(T); + } catch (D) { + console.error(`Could not get api details: ${D.message}`); } return { - config: k, + config: T, ...c }; } - let j; - async function te(E) { - if (a && a(E), E.status === "running") + let q; + async function ee(S) { + if (a && a(S), S.status === "running") try { - k = await $i( + T = await Ji( e, - `${m}//${g}`, + `${p}//${g}`, f ); - const M = await x(k); - s(M); - } catch (M) { - console.error(M), a && a({ + const D = await j(T); + s(D); + } catch (D) { + console.error(D), a && a({ status: "error", message: "Could not load this space.", load_status: "error", @@ -1977,18 +1819,18 @@ function ic(e, t) { } } try { - k = await $i( + T = await Ji( e, - `${m}//${g}`, + `${p}//${g}`, f ); - const E = await x(k); - s(E); - } catch (E) { - console.error(E), p ? Yr( - p, - Gl.test(p) ? "space_name" : "subdomain", - te + const S = await j(T); + s(S); + } catch (S) { + console.error(S), m ? Zr( + m, + Hl.test(m) ? "space_name" : "subdomain", + ee ) : a && a({ status: "error", message: "Could not load this space.", @@ -1996,196 +1838,196 @@ function ic(e, t) { detail: "NOT_FOUND" }); } - function ne(E, M, A) { - let F = !1, L = !1, re; - if (typeof E == "number") - re = k.dependencies[E]; + function te(S, D, A) { + let R = !1, L = !1, ne; + if (typeof S == "number") + ne = T.dependencies[S]; else { - const z = E.replace(/^\//, ""); - re = k.dependencies[O[z]]; + const E = S.replace(/^\//, ""); + ne = T.dependencies[P[E]]; } - if (re.types.continuous) + if (ne.types.continuous) throw new Error( "Cannot call predict on this function as it may run forever. Use submit instead" ); - return new Promise((z, ee) => { - const T = ce(E, M, A); - let H; - T.on("data", (D) => { - L && (T.destroy(), z(D)), F = !0, H = D; - }).on("status", (D) => { - D.stage === "error" && ee(D), D.stage === "complete" && (L = !0, F && (T.destroy(), z(H))); + return new Promise((E, z) => { + const K = fe(S, D, A); + let N; + K.on("data", (U) => { + L && (K.destroy(), E(U)), R = !0, N = U; + }).on("status", (U) => { + U.stage === "error" && z(U), U.stage === "complete" && (L = !0, R && (K.destroy(), E(N))); }); }); } - function ce(E, M, A, F = null) { - let L, re; - if (typeof E == "number") - L = E, re = j.unnamed_endpoints[L]; + function fe(S, D, A, R = null) { + let L, ne; + if (typeof S == "number") + L = S, ne = q.unnamed_endpoints[L]; else { - const de = E.replace(/^\//, ""); - L = O[de], re = j.named_endpoints[E.trim()]; + const ce = S.replace(/^\//, ""); + L = P[ce], ne = q.named_endpoints[S.trim()]; } if (typeof L != "number") throw new Error( "There is no endpoint matching that name of fn_index matching that number." ); - let z, ee, T = k.protocol ?? "ws"; - const H = typeof E == "number" ? "/predict" : E; - let D, I = null, N = !1; - const Q = {}; - let Y = ""; - typeof window < "u" && (Y = new URLSearchParams(window.location.search).toString()), o(`${k.root}`, M, re, f).then( - (de) => { - if (D = { - data: de || [], + let E, z, K = T.protocol ?? "ws"; + const N = typeof S == "number" ? "/predict" : S; + let U, I = null, H = !1; + const Z = {}; + let oe = ""; + typeof window < "u" && (oe = new URLSearchParams(window.location.search).toString()), o(`${T.root}`, D, ne, f).then( + (ce) => { + if (U = { + data: ce || [], event_data: A, fn_index: L, - trigger_id: F - }, ac(L, k)) - R({ + trigger_id: R + }, Nf(L, T)) + x({ type: "status", - endpoint: H, + endpoint: N, stage: "pending", queue: !1, fn_index: L, time: /* @__PURE__ */ new Date() }), n( - `${k.root}/run${H.startsWith("/") ? H : `/${H}`}${Y ? "?" + Y : ""}`, + `${T.root}/run${N.startsWith("/") ? N : `/${N}`}${oe ? "?" + oe : ""}`, { - ...D, + ...U, session_hash: v }, f - ).then(([oe, se]) => { - const Le = h ? Ln( - oe.data, - re, - k.root, - k.root_url - ) : oe.data; - se == 200 ? (R({ + ).then(([re, le]) => { + const Le = _ ? In( + re.data, + ne, + T.root, + T.root_url + ) : re.data; + le == 200 ? (x({ type: "data", - endpoint: H, + endpoint: N, fn_index: L, data: Le, time: /* @__PURE__ */ new Date() - }), R({ + }), x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, stage: "complete", - eta: oe.average_duration, + eta: re.average_duration, queue: !1, time: /* @__PURE__ */ new Date() - })) : R({ + })) : x({ type: "status", stage: "error", - endpoint: H, + endpoint: N, fn_index: L, - message: oe.error, + message: re.error, queue: !1, time: /* @__PURE__ */ new Date() }); - }).catch((oe) => { - R({ + }).catch((re) => { + x({ type: "status", stage: "error", - message: oe.message, - endpoint: H, + message: re.message, + endpoint: N, fn_index: L, queue: !1, time: /* @__PURE__ */ new Date() }); }); - else if (T == "ws") { - R({ + else if (K == "ws") { + x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - let oe = new URL(`${_}://${Fl( + let re = new URL(`${h}://${Nl( g, - k.path, + T.path, !0 )} - /queue/join${Y ? "?" + Y : ""}`); - U && oe.searchParams.set("__sign", U), z = new WebSocket(oe), z.onclose = (se) => { - se.wasClean || R({ + /queue/join${oe ? "?" + oe : ""}`); + M && re.searchParams.set("__sign", M), E = new WebSocket(re), E.onclose = (le) => { + le.wasClean || x({ type: "status", stage: "error", broken: !0, - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - }, z.onmessage = function(se) { - const Le = JSON.parse(se.data), { type: ge, status: K, data: Z } = Lr( + }, E.onmessage = function(le) { + const Le = JSON.parse(le.data), { type: ge, status: Q, data: J } = Br( Le, - b[L] + w[L] ); - if (ge === "update" && K && !N) - R({ + if (ge === "update" && Q && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...K - }), K.stage === "error" && z.close(); + ...Q + }), Q.stage === "error" && E.close(); else if (ge === "hash") { - z.send(JSON.stringify({ fn_index: L, session_hash: v })); + E.send(JSON.stringify({ fn_index: L, session_hash: v })); return; } else - ge === "data" ? z.send(JSON.stringify({ ...D, session_hash: v })) : ge === "complete" ? N = K : ge === "log" ? R({ + ge === "data" ? E.send(JSON.stringify({ ...U, session_hash: v })) : ge === "complete" ? H = Q : ge === "log" ? x({ type: "log", - log: Z.log, - level: Z.level, - endpoint: H, + log: J.log, + level: J.level, + endpoint: N, fn_index: L - }) : ge === "generating" && R({ + }) : ge === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...K, - stage: K == null ? void 0 : K.stage, + ...Q, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Z && (R({ + J && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( - Z.data, - re, - k.root, - k.root_url - ) : Z.data, - endpoint: H, + data: _ ? In( + J.data, + ne, + T.root, + T.root_url + ) : J.data, + endpoint: N, fn_index: L - }), N && (R({ + }), H && (x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: K == null ? void 0 : K.stage, + ...H, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - }), z.close())); - }, Zi(k.version || "2.0.0", "3.6") < 0 && addEventListener( + }), E.close())); + }, zi(T.version || "2.0.0", "3.6") < 0 && addEventListener( "open", - () => z.send(JSON.stringify({ hash: v })) + () => E.send(JSON.stringify({ hash: v })) ); - } else if (T == "sse") { - R({ + } else if (K == "sse") { + x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); @@ -2193,191 +2035,191 @@ function ic(e, t) { fn_index: L.toString(), session_hash: v }).toString(); - let oe = new URL( - `${k.root}/queue/join?${Y ? Y + "&" : ""}${we}` + let re = new URL( + `${T.root}/queue/join?${oe ? oe + "&" : ""}${we}` ); - ee = t(oe), ee.onmessage = async function(se) { - const Le = JSON.parse(se.data), { type: ge, status: K, data: Z } = Lr( + z = t(re), z.onmessage = async function(le) { + const Le = JSON.parse(le.data), { type: ge, status: Q, data: J } = Br( Le, - b[L] + w[L] ); - if (ge === "update" && K && !N) - R({ + if (ge === "update" && Q && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...K - }), K.stage === "error" && ee.close(); + ...Q + }), Q.stage === "error" && z.close(); else if (ge === "data") { I = Le.event_id; - let [Ae, $t] = await n( - `${k.root}/queue/data`, + let [Ae, Kt] = await n( + `${T.root}/queue/data`, { - ...D, + ...U, session_hash: v, event_id: I }, f ); - $t !== 200 && (R({ + Kt !== 200 && (x({ type: "status", stage: "error", - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() - }), ee.close()); + }), z.close()); } else - ge === "complete" ? N = K : ge === "log" ? R({ + ge === "complete" ? H = Q : ge === "log" ? x({ type: "log", - log: Z.log, - level: Z.level, - endpoint: H, + log: J.log, + level: J.level, + endpoint: N, fn_index: L - }) : ge === "generating" && R({ + }) : ge === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...K, - stage: K == null ? void 0 : K.stage, + ...Q, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Z && (R({ + J && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( - Z.data, - re, - k.root, - k.root_url - ) : Z.data, - endpoint: H, + data: _ ? In( + J.data, + ne, + T.root, + T.root_url + ) : J.data, + endpoint: N, fn_index: L - }), N && (R({ + }), H && (x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: K == null ? void 0 : K.stage, + ...H, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - }), ee.close())); + }), z.close())); }; } else - T == "sse_v1" && (R({ + K == "sse_v1" && (x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }), n( - `${k.root}/queue/join?${Y}`, + `${T.root}/queue/join?${oe}`, { - ...D, + ...U, session_hash: v }, f - ).then(([oe, se]) => { - if (se === 503) - R({ + ).then(([re, le]) => { + if (le === 503) + x({ type: "status", stage: "error", - message: ql, + message: Dl, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - else if (se !== 200) - R({ + else if (le !== 200) + x({ type: "status", stage: "error", - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); else { - I = oe.event_id; + I = re.event_id; let Le = async function(ge) { try { - const { type: K, status: Z, data: Ae } = Lr( + const { type: Q, status: J, data: Ae } = Br( ge, - b[L] + w[L] ); - if (K == "heartbeat") + if (Q == "heartbeat") return; - if (K === "update" && Z && !N) - R({ + if (Q === "update" && J && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...Z + ...J }); - else if (K === "complete") - N = Z; - else if (K == "unexpected_error") - console.error("Unexpected error", Z == null ? void 0 : Z.message), R({ + else if (Q === "complete") + H = J; + else if (Q == "unexpected_error") + console.error("Unexpected error", J == null ? void 0 : J.message), x({ type: "status", stage: "error", - message: (Z == null ? void 0 : Z.message) || "An Unexpected Error Occurred!", + message: (J == null ? void 0 : J.message) || "An Unexpected Error Occurred!", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - else if (K === "log") { - R({ + else if (Q === "log") { + x({ type: "log", log: Ae.log, level: Ae.level, - endpoint: H, + endpoint: N, fn_index: L }); return; } else - K === "generating" && R({ + Q === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...Z, - stage: Z == null ? void 0 : Z.stage, + ...J, + stage: J == null ? void 0 : J.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Ae && (R({ + Ae && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( + data: _ ? In( Ae.data, - re, - k.root, - k.root_url + ne, + T.root, + T.root_url ) : Ae.data, - endpoint: H, + endpoint: N, fn_index: L - }), N && R({ + }), H && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: Z == null ? void 0 : Z.stage, + ...H, + stage: J == null ? void 0 : J.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - })), ((Z == null ? void 0 : Z.stage) === "complete" || (Z == null ? void 0 : Z.stage) === "error") && C[I] && delete C[I]; - } catch (K) { - console.error("Unexpected client exception", K), R({ + })), ((J == null ? void 0 : J.stage) === "complete" || (J == null ? void 0 : J.stage) === "error") && C[I] && delete C[I]; + } catch (Q) { + console.error("Unexpected client exception", Q), x({ type: "status", stage: "error", message: "An Unexpected Error Occurred!", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }), _e(); @@ -2385,42 +2227,42 @@ function ic(e, t) { }; I in y && (y[I].forEach( (ge) => Le(ge) - ), delete y[I]), C[I] = Le, P.add(I), w || me(); + ), delete y[I]), C[I] = Le, O.add(I), b || me(); } })); } ); - function R(de) { - const oe = Q[de.type] || []; - oe == null || oe.forEach((se) => se(de)); + function x(ce) { + const re = Z[ce.type] || []; + re == null || re.forEach((le) => le(ce)); } - function Te(de, we) { - const oe = Q, se = oe[de] || []; - return oe[de] = se, se == null || se.push(we), { on: Te, off: He, cancel: Ie, destroy: $e }; + function Te(ce, we) { + const re = Z, le = re[ce] || []; + return re[ce] = le, le == null || le.push(we), { on: Te, off: Ne, cancel: Ie, destroy: $e }; } - function He(de, we) { - const oe = Q; - let se = oe[de] || []; - return se = se == null ? void 0 : se.filter((Le) => Le !== we), oe[de] = se, { on: Te, off: He, cancel: Ie, destroy: $e }; + function Ne(ce, we) { + const re = Z; + let le = re[ce] || []; + return le = le == null ? void 0 : le.filter((Le) => Le !== we), re[ce] = le, { on: Te, off: Ne, cancel: Ie, destroy: $e }; } async function Ie() { - const de = { + const ce = { stage: "complete", queue: !1, time: /* @__PURE__ */ new Date() }; - N = de, R({ - ...de, + H = ce, x({ + ...ce, type: "status", - endpoint: H, + endpoint: N, fn_index: L }); let we = {}; - T === "ws" ? (z && z.readyState === 0 ? z.addEventListener("open", () => { - z.close(); - }) : z.close(), we = { fn_index: L, session_hash: v }) : (ee.close(), we = { event_id: I }); + K === "ws" ? (E && E.readyState === 0 ? E.addEventListener("open", () => { + E.close(); + }) : E.close(), we = { fn_index: L, session_hash: v }) : (z.close(), we = { event_id: I }); try { - await e(`${k.root}/reset`, { + await e(`${T.root}/reset`, { headers: { "Content-Type": "application/json" }, method: "POST", body: JSON.stringify(we) @@ -2432,106 +2274,106 @@ function ic(e, t) { } } function $e() { - for (const de in Q) - Q[de].forEach((we) => { - He(de, we); + for (const ce in Z) + Z[ce].forEach((we) => { + Ne(ce, we); }); } return { on: Te, - off: He, + off: Ne, cancel: Ie, destroy: $e }; } function me() { - w = !0; - let E = new URLSearchParams({ + b = !0; + let S = new URLSearchParams({ session_hash: v - }).toString(), M = new URL(`${k.root}/queue/data?${E}`); - S = t(M), S.onmessage = async function(A) { - let F = JSON.parse(A.data); - const L = F.event_id; + }).toString(), D = new URL(`${T.root}/queue/data?${S}`); + k = t(D), k.onmessage = async function(A) { + let R = JSON.parse(A.data); + const L = R.event_id; if (!L) await Promise.all( Object.keys(C).map( - (re) => C[re](F) + (ne) => C[ne](R) ) ); else if (C[L]) { - F.msg === "process_completed" && (P.delete(L), P.size === 0 && _e()); - let re = C[L]; - window.setTimeout(re, 0, F); + R.msg === "process_completed" && (O.delete(L), O.size === 0 && _e()); + let ne = C[L]; + window.setTimeout(ne, 0, R); } else - y[L] || (y[L] = []), y[L].push(F); - }, S.onerror = async function(A) { + y[L] || (y[L] = []), y[L].push(R); + }, k.onerror = async function(A) { await Promise.all( Object.keys(C).map( - (F) => C[F]({ + (R) => C[R]({ msg: "unexpected_error", - message: ht + message: dt }) ) ), _e(); }; } function _e() { - w = !1, S == null || S.close(); + b = !1, k == null || k.close(); } - async function B(E, M, A) { - var F; + async function B(S, D, A) { + var R; const L = { "Content-Type": "application/json" }; f && (L.Authorization = `Bearer ${f}`); - let re, z = k.components.find( - (H) => H.id === E + let ne, E = T.components.find( + (N) => N.id === S ); - (F = z == null ? void 0 : z.props) != null && F.root_url ? re = z.props.root_url : re = k.root; - const ee = await e( - `${re}/component_server/`, + (R = E == null ? void 0 : E.props) != null && R.root_url ? ne = E.props.root_url : ne = T.root; + const z = await e( + `${ne}/component_server/`, { method: "POST", body: JSON.stringify({ data: A, - component_id: E, - fn_name: M, + component_id: S, + fn_name: D, session_hash: v }), headers: L } ); - if (!ee.ok) + if (!z.ok) throw new Error( - "Could not connect to component server: " + ee.statusText + "Could not connect to component server: " + z.statusText ); - return await ee.json(); + return await z.json(); } - async function pe(E) { - if (j) - return j; - const M = { "Content-Type": "application/json" }; - f && (M.Authorization = `Bearer ${f}`); + async function pe(S) { + if (q) + return q; + const D = { "Content-Type": "application/json" }; + f && (D.Authorization = `Bearer ${f}`); let A; - if (Zi(E.version || "2.0.0", "3.30") < 0 ? A = await e( + if (zi(S.version || "2.0.0", "3.30") < 0 ? A = await e( "https://gradio-space-api-fetcher-v2.hf.space/api", { method: "POST", body: JSON.stringify({ serialize: !1, - config: JSON.stringify(E) + config: JSON.stringify(S) }), - headers: M + headers: D } - ) : A = await e(`${E.root}/info`, { - headers: M + ) : A = await e(`${S.root}/info`, { + headers: D }), !A.ok) - throw new Error(ht); - let F = await A.json(); - return "api" in F && (F = F.api), F.named_endpoints["/predict"] && !F.unnamed_endpoints[0] && (F.unnamed_endpoints[0] = F.named_endpoints["/predict"]), lc(F, E, O); + throw new Error(dt); + let R = await A.json(); + return "api" in R && (R = R.api), R.named_endpoints["/predict"] && !R.unnamed_endpoints[0] && (R.unnamed_endpoints[0] = R.named_endpoints["/predict"]), Of(R, S, P); } }); } async function o(l, u, s, a) { - const f = await Qr( + const f = await Wr( u, void 0, [], @@ -2539,34 +2381,34 @@ function ic(e, t) { s ); return Promise.all( - f.map(async ({ path: d, blob: c, type: h }) => { + f.map(async ({ path: d, blob: c, type: _ }) => { if (c) { - const _ = (await r(l, [c], a)).files[0]; - return { path: d, file_url: _, type: h, name: c == null ? void 0 : c.name }; + const h = (await r(l, [c], a)).files[0]; + return { path: d, file_url: h, type: _, name: c == null ? void 0 : c.name }; } - return { path: d, type: h }; + return { path: d, type: _ }; }) - ).then((d) => (d.forEach(({ path: c, file_url: h, type: _, name: m }) => { - if (_ === "Gallery") - Ki(u, h, c); - else if (h) { - const g = new Ft({ path: h, orig_name: m }); - Ki(u, g, c); + ).then((d) => (d.forEach(({ path: c, file_url: _, type: h, name: p }) => { + if (h === "Gallery") + Zi(u, _, c); + else if (_) { + const g = new Ft({ path: _, orig_name: p }); + Zi(u, g, c); } }), u)); } } -const { post_data: op, upload_files: oc, client: lp, handle_blob: sp } = ic( +const { post_data: Im, upload_files: Lf, client: Lm, handle_blob: Om } = If( fetch, (...e) => new EventSource(...e) ); -function Ln(e, t, n, r) { +function In(e, t, n, r) { return e.map((i, o) => { var l, u, s, a; - return ((u = (l = t == null ? void 0 : t.returns) == null ? void 0 : l[o]) == null ? void 0 : u.component) === "File" ? Et(i, n, r) : ((a = (s = t == null ? void 0 : t.returns) == null ? void 0 : s[o]) == null ? void 0 : a.component) === "Gallery" ? i.map((f) => Array.isArray(f) ? [Et(f[0], n, r), f[1]] : [Et(f, n, r), null]) : typeof i == "object" && i.path ? Et(i, n, r) : i; + return ((u = (l = t == null ? void 0 : t.returns) == null ? void 0 : l[o]) == null ? void 0 : u.component) === "File" ? vt(i, n, r) : ((a = (s = t == null ? void 0 : t.returns) == null ? void 0 : s[o]) == null ? void 0 : a.component) === "Gallery" ? i.map((f) => Array.isArray(f) ? [vt(f[0], n, r), f[1]] : [vt(f, n, r), null]) : typeof i == "object" && i.path ? vt(i, n, r) : i; }); } -function Qi(e, t, n, r) { +function Xi(e, t, n, r) { switch (e.type) { case "string": return "string"; @@ -2586,10 +2428,10 @@ function Qi(e, t, n, r) { if (n === "GallerySerializable") return r === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; } -function Yi(e, t) { +function Wi(e, t) { return t === "GallerySerializable" ? "array of [file, label] tuples" : t === "ListStringSerializable" ? "array of strings" : t === "FileSerializable" ? "array of files or single file" : e.description; } -function lc(e, t, n) { +function Of(e, t, n) { const r = { named_endpoints: {}, unnamed_endpoints: {} @@ -2602,22 +2444,22 @@ function lc(e, t, n) { ({ label: a, component: f, type: d, serializer: c }) => ({ label: a, component: f, - type: Qi(d, f, c, "parameter"), - description: Yi(d, c) + type: Xi(d, f, c, "parameter"), + description: Wi(d, c) }) ), r[i][l].returns = s.returns.map( ({ label: a, component: f, type: d, serializer: c }) => ({ label: a, component: f, - type: Qi(d, f, c, "return"), - description: Yi(d, c) + type: Xi(d, f, c, "return"), + description: Wi(d, c) }) ); } } return r; } -async function sc(e, t) { +async function Pf(e, t) { try { return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, { headers: { @@ -2628,12 +2470,12 @@ async function sc(e, t) { return console.error(n), !1; } } -function Ki(e, t, n) { +function Zi(e, t, n) { for (; n.length > 1; ) e = e[n.shift()]; e[n.shift()] = t; } -async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { +async function Wr(e, t = void 0, n = [], r = !1, i = void 0) { if (Array.isArray(e)) { let o = []; return await Promise.all( @@ -2641,7 +2483,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { var s; let a = n.slice(); a.push(u); - const f = await Qr( + const f = await Wr( e[u], r ? ((s = i == null ? void 0 : i.parameters[u]) == null ? void 0 : s.component) || void 0 : t, a, @@ -2656,7 +2498,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { return [ { path: n, - blob: t === "Image" ? !1 : new jl([e]), + blob: t === "Image" ? !1 : new Ml([e]), type: t } ]; @@ -2666,7 +2508,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { if (e.hasOwnProperty(l)) { let u = n.slice(); u.push(l), o = o.concat( - await Qr( + await Wr( e[l], void 0, u, @@ -2680,15 +2522,15 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { } return []; } -function ac(e, t) { +function Nf(e, t) { var n, r, i, o; return !(((r = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[e]) == null ? void 0 : r.queue) === null ? t.enable_queue : (o = (i = t == null ? void 0 : t.dependencies) == null ? void 0 : i[e]) != null && o.queue) || !1; } -async function $i(e, t, n) { +async function Ji(e, t, n) { const r = {}; if (n && (r.Authorization = `Bearer ${n}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { const i = window.gradio_config.root, o = window.gradio_config; - return o.root = Fl(t, o.root, !1), { ...o, path: i }; + return o.root = Nl(t, o.root, !1), { ...o, path: i }; } else if (t) { let i = await e(`${t}/config`, { headers: r @@ -2701,7 +2543,7 @@ async function $i(e, t, n) { } throw new Error("No config or app endpoint found"); } -async function Yr(e, t, n) { +async function Zr(e, t, n) { let r = t === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${e}` : `https://huggingface.co/api/spaces/${e}`, i, o; try { if (i = await fetch(r), o = i.status, o !== 200) @@ -2731,7 +2573,7 @@ async function Yr(e, t, n) { message: "Space is asleep. Waking it up...", detail: l }), setTimeout(() => { - Yr(e, t, n); + Zr(e, t, n); }, 1e3); break; case "PAUSED": @@ -2740,7 +2582,7 @@ async function Yr(e, t, n) { load_status: "error", message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.", detail: l, - discussions_enabled: await Ji(u) + discussions_enabled: await Vi(u) }); break; case "RUNNING": @@ -2759,7 +2601,7 @@ async function Yr(e, t, n) { message: "Space is building...", detail: l }), setTimeout(() => { - Yr(e, t, n); + Zr(e, t, n); }, 1e3); break; default: @@ -2768,12 +2610,12 @@ async function Yr(e, t, n) { load_status: "error", message: "This space is experiencing an issue.", detail: l, - discussions_enabled: await Ji(u) + discussions_enabled: await Vi(u) }); break; } } -function Lr(e, t) { +function Br(e, t) { switch (e.msg) { case "send_data": return { type: "data" }; @@ -2784,7 +2626,7 @@ function Lr(e, t) { type: "update", status: { queue: !0, - message: ql, + message: Dl, stage: "error", code: e.code, success: e.success @@ -2880,40 +2722,40 @@ function Lr(e, t) { } return { type: "none", status: { stage: "error", queue: !0 } }; } -function kt() { +function Et() { } -function uc(e) { +function Hf(e) { return e(); } -function fc(e) { - e.forEach(uc); +function Df(e) { + e.forEach(Hf); } -function cc(e) { +function Mf(e) { return typeof e == "function"; } -function dc(e, t) { +function Rf(e, t) { return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function"; } -function _c(e, ...t) { +function Uf(e, ...t) { if (e == null) { for (const r of t) r(void 0); - return kt; + return Et; } const n = e.subscribe(...t); return n.unsubscribe ? () => n.unsubscribe() : n; } -const xl = typeof window < "u"; -let eo = xl ? () => window.performance.now() : () => Date.now(), zl = xl ? (e) => requestAnimationFrame(e) : kt; +const Rl = typeof window < "u"; +let Qi = Rl ? () => window.performance.now() : () => Date.now(), Ul = Rl ? (e) => requestAnimationFrame(e) : Et; const Gt = /* @__PURE__ */ new Set(); -function Vl(e) { +function Fl(e) { Gt.forEach((t) => { t.c(e) || (Gt.delete(t), t.f()); - }), Gt.size !== 0 && zl(Vl); + }), Gt.size !== 0 && Ul(Fl); } -function hc(e) { +function Ff(e) { let t; - return Gt.size === 0 && zl(Vl), { + return Gt.size === 0 && Ul(Fl), { promise: new Promise((n) => { Gt.add(t = { c: e, f: n }); }), @@ -2922,187 +2764,187 @@ function hc(e) { } }; } -const Dt = []; -function mc(e, t) { +const Mt = []; +function Gf(e, t) { return { - subscribe: hn(e, t).subscribe + subscribe: _n(e, t).subscribe }; } -function hn(e, t = kt) { +function _n(e, t = Et) { let n; const r = /* @__PURE__ */ new Set(); function i(u) { - if (dc(e, u) && (e = u, n)) { - const s = !Dt.length; + if (Rf(e, u) && (e = u, n)) { + const s = !Mt.length; for (const a of r) - a[1](), Dt.push(a, e); + a[1](), Mt.push(a, e); if (s) { - for (let a = 0; a < Dt.length; a += 2) - Dt[a][0](Dt[a + 1]); - Dt.length = 0; + for (let a = 0; a < Mt.length; a += 2) + Mt[a][0](Mt[a + 1]); + Mt.length = 0; } } } function o(u) { i(u(e)); } - function l(u, s = kt) { + function l(u, s = Et) { const a = [u, s]; - return r.add(a), r.size === 1 && (n = t(i, o) || kt), u(e), () => { + return r.add(a), r.size === 1 && (n = t(i, o) || Et), u(e), () => { r.delete(a), r.size === 0 && n && (n(), n = null); }; } return { set: i, update: o, subscribe: l }; } -function Qt(e, t, n) { +function Jt(e, t, n) { const r = !Array.isArray(e), i = r ? [e] : e; if (!i.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); const o = t.length < 2; - return mc(n, (l, u) => { + return Gf(n, (l, u) => { let s = !1; const a = []; - let f = 0, d = kt; + let f = 0, d = Et; const c = () => { if (f) return; d(); - const _ = t(r ? a[0] : a, l, u); - o ? l(_) : d = cc(_) ? _ : kt; - }, h = i.map( - (_, m) => _c( - _, + const h = t(r ? a[0] : a, l, u); + o ? l(h) : d = Mf(h) ? h : Et; + }, _ = i.map( + (h, p) => Uf( + h, (g) => { - a[m] = g, f &= ~(1 << m), s && c(); + a[p] = g, f &= ~(1 << p), s && c(); }, () => { - f |= 1 << m; + f |= 1 << p; } ) ); return s = !0, c(), function() { - fc(h), d(), s = !1; + Df(_), d(), s = !1; }; }); } -function to(e) { +function Yi(e) { return Object.prototype.toString.call(e) === "[object Date]"; } -function Kr(e, t, n, r) { - if (typeof n == "number" || to(n)) { +function Jr(e, t, n, r) { + if (typeof n == "number" || Yi(n)) { const i = r - n, o = (n - t) / (e.dt || 1 / 60), l = e.opts.stiffness * i, u = e.opts.damping * o, s = (l - u) * e.inv_mass, a = (o + s) * e.dt; - return Math.abs(a) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, to(n) ? new Date(n.getTime() + a) : n + a); + return Math.abs(a) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, Yi(n) ? new Date(n.getTime() + a) : n + a); } else { if (Array.isArray(n)) return n.map( - (i, o) => Kr(e, t[o], n[o], r[o]) + (i, o) => Jr(e, t[o], n[o], r[o]) ); if (typeof n == "object") { const i = {}; for (const o in n) - i[o] = Kr(e, t[o], n[o], r[o]); + i[o] = Jr(e, t[o], n[o], r[o]); return i; } else throw new Error(`Cannot spring ${typeof n} values`); } } -function no(e, t = {}) { - const n = hn(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t; - let l, u, s, a = e, f = e, d = 1, c = 0, h = !1; - function _(g, p = {}) { +function Ki(e, t = {}) { + const n = _n(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t; + let l, u, s, a = e, f = e, d = 1, c = 0, _ = !1; + function h(g, m = {}) { f = g; const v = s = {}; - return e == null || p.hard || m.stiffness >= 1 && m.damping >= 1 ? (h = !0, l = eo(), a = g, n.set(e = f), Promise.resolve()) : (p.soft && (c = 1 / ((p.soft === !0 ? 0.5 : +p.soft) * 60), d = 0), u || (l = eo(), h = !1, u = hc((b) => { - if (h) - return h = !1, u = null, !1; + return e == null || m.hard || p.stiffness >= 1 && p.damping >= 1 ? (_ = !0, l = Qi(), a = g, n.set(e = f), Promise.resolve()) : (m.soft && (c = 1 / ((m.soft === !0 ? 0.5 : +m.soft) * 60), d = 0), u || (l = Qi(), _ = !1, u = Ff((w) => { + if (_) + return _ = !1, u = null, !1; d = Math.min(d + c, 1); - const w = { + const b = { inv_mass: d, - opts: m, + opts: p, settled: !0, - dt: (b - l) * 60 / 1e3 - }, y = Kr(w, a, e, f); - return l = b, a = e, n.set(e = y), w.settled && (u = null), !w.settled; - })), new Promise((b) => { + dt: (w - l) * 60 / 1e3 + }, y = Jr(b, a, e, f); + return l = w, a = e, n.set(e = y), b.settled && (u = null), !b.settled; + })), new Promise((w) => { u.promise.then(() => { - v === s && b(); + v === s && w(); }); })); } - const m = { - set: _, - update: (g, p) => _(g(f, e), p), + const p = { + set: h, + update: (g, m) => h(g(f, e), m), subscribe: n.subscribe, stiffness: r, damping: i, precision: o }; - return m; + return p; } -function pc(e) { +function qf(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var gc = function(t) { - return bc(t) && !wc(t); +var jf = function(t) { + return xf(t) && !zf(t); }; -function bc(e) { +function xf(e) { return !!e && typeof e == "object"; } -function wc(e) { +function zf(e) { var t = Object.prototype.toString.call(e); - return t === "[object RegExp]" || t === "[object Date]" || Ec(e); + return t === "[object RegExp]" || t === "[object Date]" || Wf(e); } -var vc = typeof Symbol == "function" && Symbol.for, yc = vc ? Symbol.for("react.element") : 60103; -function Ec(e) { - return e.$$typeof === yc; +var Vf = typeof Symbol == "function" && Symbol.for, Xf = Vf ? Symbol.for("react.element") : 60103; +function Wf(e) { + return e.$$typeof === Xf; } -function Sc(e) { +function Zf(e) { return Array.isArray(e) ? [] : {}; } -function an(e, t) { - return t.clone !== !1 && t.isMergeableObject(e) ? jt(Sc(e), e, t) : e; +function ln(e, t) { + return t.clone !== !1 && t.isMergeableObject(e) ? jt(Zf(e), e, t) : e; } -function kc(e, t, n) { +function Jf(e, t, n) { return e.concat(t).map(function(r) { - return an(r, n); + return ln(r, n); }); } -function Tc(e, t) { +function Qf(e, t) { if (!t.customMerge) return jt; var n = t.customMerge(e); return typeof n == "function" ? n : jt; } -function Ac(e) { +function Yf(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) { return Object.propertyIsEnumerable.call(e, t); }) : []; } -function ro(e) { - return Object.keys(e).concat(Ac(e)); +function $i(e) { + return Object.keys(e).concat(Yf(e)); } -function Xl(e, t) { +function Gl(e, t) { try { return t in e; } catch { return !1; } } -function Bc(e, t) { - return Xl(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); +function Kf(e, t) { + return Gl(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); } -function Cc(e, t, n) { +function $f(e, t, n) { var r = {}; - return n.isMergeableObject(e) && ro(e).forEach(function(i) { - r[i] = an(e[i], n); - }), ro(t).forEach(function(i) { - Bc(e, i) || (Xl(e, i) && n.isMergeableObject(t[i]) ? r[i] = Tc(i, n)(e[i], t[i], n) : r[i] = an(t[i], n)); + return n.isMergeableObject(e) && $i(e).forEach(function(i) { + r[i] = ln(e[i], n); + }), $i(t).forEach(function(i) { + Kf(e, i) || (Gl(e, i) && n.isMergeableObject(t[i]) ? r[i] = Qf(i, n)(e[i], t[i], n) : r[i] = ln(t[i], n)); }), r; } function jt(e, t, n) { - n = n || {}, n.arrayMerge = n.arrayMerge || kc, n.isMergeableObject = n.isMergeableObject || gc, n.cloneUnlessOtherwiseSpecified = an; + n = n || {}, n.arrayMerge = n.arrayMerge || Jf, n.isMergeableObject = n.isMergeableObject || jf, n.cloneUnlessOtherwiseSpecified = ln; var r = Array.isArray(t), i = Array.isArray(e), o = r === i; - return o ? r ? n.arrayMerge(e, t, n) : Cc(e, t, n) : an(t, n); + return o ? r ? n.arrayMerge(e, t, n) : $f(e, t, n) : ln(t, n); } jt.all = function(t, n) { if (!Array.isArray(t)) @@ -3111,36 +2953,36 @@ jt.all = function(t, n) { return jt(r, i, n); }, {}); }; -var Ic = jt, Lc = Ic; -const Pc = /* @__PURE__ */ pc(Lc); -var $r = function(e, t) { - return $r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) { +var ec = jt, tc = ec; +const nc = /* @__PURE__ */ qf(tc); +var Qr = function(e, t) { + return Qr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) { n.__proto__ = r; } || function(n, r) { for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]); - }, $r(e, t); + }, Qr(e, t); }; -function tr(e, t) { +function $n(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); - $r(e, t); + Qr(e, t); function n() { this.constructor = e; } e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n()); } -var $ = function() { - return $ = Object.assign || function(t) { +var Y = function() { + return Y = Object.assign || function(t) { for (var n, r = 1, i = arguments.length; r < i; r++) { n = arguments[r]; for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); } return t; - }, $.apply(this, arguments); + }, Y.apply(this, arguments); }; -function Pr(e, t, n) { +function Cr(e, t, n) { if (n || arguments.length === 2) for (var r = 0, i = t.length, o; r < i; r++) (o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]); @@ -3150,51 +2992,51 @@ var V; (function(e) { e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(V || (V = {})); -var ae; +var se; (function(e) { e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag"; -})(ae || (ae = {})); +})(se || (se = {})); var xt; (function(e) { e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime"; })(xt || (xt = {})); -function io(e) { - return e.type === ae.literal; +function eo(e) { + return e.type === se.literal; } -function Oc(e) { - return e.type === ae.argument; +function rc(e) { + return e.type === se.argument; } -function Wl(e) { - return e.type === ae.number; +function ql(e) { + return e.type === se.number; } -function Zl(e) { - return e.type === ae.date; +function jl(e) { + return e.type === se.date; } -function Jl(e) { - return e.type === ae.time; +function xl(e) { + return e.type === se.time; } -function Ql(e) { - return e.type === ae.select; +function zl(e) { + return e.type === se.select; } -function Yl(e) { - return e.type === ae.plural; +function Vl(e) { + return e.type === se.plural; } -function Hc(e) { - return e.type === ae.pound; +function ic(e) { + return e.type === se.pound; } -function Kl(e) { - return e.type === ae.tag; +function Xl(e) { + return e.type === se.tag; } -function $l(e) { +function Wl(e) { return !!(e && typeof e == "object" && e.type === xt.number); } -function ei(e) { +function Yr(e) { return !!(e && typeof e == "object" && e.type === xt.dateTime); } -var es = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Nc = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; -function Mc(e) { +var Zl = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, oc = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; +function lc(e) { var t = {}; - return e.replace(Nc, function(n) { + return e.replace(oc, function(n) { var r = n.length; switch (n[0]) { case "G": @@ -3283,11 +3125,11 @@ function Mc(e) { return ""; }), t; } -var Dc = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function Rc(e) { +var sc = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function ac(e) { if (e.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var t = e.split(Dc).filter(function(c) { + for (var t = e.split(sc).filter(function(c) { return c.length > 0; }), n = [], r = 0, i = t; r < i.length; r++) { var o = i[r], l = o.split("/"); @@ -3302,17 +3144,17 @@ function Rc(e) { } return n; } -function Uc(e) { +function uc(e) { return e.replace(/^(.*?)-/, ""); } -var oo = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, ts = /^(@+)?(\+|#+)?[rs]?$/g, Fc = /(\*)(0+)|(#+)(0+)|(0+)/g, ns = /^(0+)$/; -function lo(e) { +var to = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Jl = /^(@+)?(\+|#+)?[rs]?$/g, fc = /(\*)(0+)|(#+)(0+)|(0+)/g, Ql = /^(0+)$/; +function no(e) { var t = {}; - return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(ts, function(n, r, i) { + return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Jl, function(n, r, i) { return typeof i != "string" ? (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length) : i === "+" ? t.minimumSignificantDigits = r.length : r[0] === "#" ? t.maximumSignificantDigits = r.length : (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length + (typeof i == "string" ? i.length : 0)), ""; }), t; } -function rs(e) { +function Yl(e) { switch (e) { case "sign-auto": return { @@ -3352,7 +3194,7 @@ function rs(e) { }; } } -function Gc(e) { +function cc(e) { var t; if (e[0] === "E" && e[1] === "E" ? (t = { notation: "engineering" @@ -3360,17 +3202,17 @@ function Gc(e) { notation: "scientific" }, e = e.slice(1)), t) { var n = e.slice(0, 2); - if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !ns.test(e)) + if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Ql.test(e)) throw new Error("Malformed concise eng/scientific notation"); t.minimumIntegerDigits = e.length; } return t; } -function so(e) { - var t = {}, n = rs(e); +function ro(e) { + var t = {}, n = Yl(e); return n || t; } -function qc(e) { +function dc(e) { for (var t = {}, n = 0, r = e; n < r.length; n++) { var i = r[n]; switch (i.stem) { @@ -3394,7 +3236,7 @@ function qc(e) { continue; case "measure-unit": case "unit": - t.style = "unit", t.unit = Uc(i.options[0]); + t.style = "unit", t.unit = uc(i.options[0]); continue; case "compact-short": case "K": @@ -3405,13 +3247,13 @@ function qc(e) { t.notation = "compact", t.compactDisplay = "long"; continue; case "scientific": - t = $($($({}, t), { notation: "scientific" }), i.options.reduce(function(s, a) { - return $($({}, s), so(a)); + t = Y(Y(Y({}, t), { notation: "scientific" }), i.options.reduce(function(s, a) { + return Y(Y({}, s), ro(a)); }, {})); continue; case "engineering": - t = $($($({}, t), { notation: "engineering" }), i.options.reduce(function(s, a) { - return $($({}, s), so(a)); + t = Y(Y(Y({}, t), { notation: "engineering" }), i.options.reduce(function(s, a) { + return Y(Y({}, s), ro(a)); }, {})); continue; case "notation-simple": @@ -3435,45 +3277,45 @@ function qc(e) { case "integer-width": if (i.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - i.options[0].replace(Fc, function(s, a, f, d, c, h) { + i.options[0].replace(fc, function(s, a, f, d, c, _) { if (a) t.minimumIntegerDigits = f.length; else { if (d && c) throw new Error("We currently do not support maximum integer digits"); - if (h) + if (_) throw new Error("We currently do not support exact integer digits"); } return ""; }); continue; } - if (ns.test(i.stem)) { + if (Ql.test(i.stem)) { t.minimumIntegerDigits = i.stem.length; continue; } - if (oo.test(i.stem)) { + if (to.test(i.stem)) { if (i.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - i.stem.replace(oo, function(s, a, f, d, c, h) { - return f === "*" ? t.minimumFractionDigits = a.length : d && d[0] === "#" ? t.maximumFractionDigits = d.length : c && h ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + h.length) : (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length), ""; + i.stem.replace(to, function(s, a, f, d, c, _) { + return f === "*" ? t.minimumFractionDigits = a.length : d && d[0] === "#" ? t.maximumFractionDigits = d.length : c && _ ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + _.length) : (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length), ""; }); var o = i.options[0]; - o === "w" ? t = $($({}, t), { trailingZeroDisplay: "stripIfInteger" }) : o && (t = $($({}, t), lo(o))); + o === "w" ? t = Y(Y({}, t), { trailingZeroDisplay: "stripIfInteger" }) : o && (t = Y(Y({}, t), no(o))); continue; } - if (ts.test(i.stem)) { - t = $($({}, t), lo(i.stem)); + if (Jl.test(i.stem)) { + t = Y(Y({}, t), no(i.stem)); continue; } - var l = rs(i.stem); - l && (t = $($({}, t), l)); - var u = Gc(i.stem); - u && (t = $($({}, t), u)); + var l = Yl(i.stem); + l && (t = Y(Y({}, t), l)); + var u = cc(i.stem); + u && (t = Y(Y({}, t), u)); } return t; } -var Pn = { +var Ln = { AX: [ "H" ], @@ -4810,13 +4652,13 @@ var Pn = { "h" ] }; -function jc(e, t) { +function _c(e, t) { for (var n = "", r = 0; r < e.length; r++) { var i = e.charAt(r); if (i === "j") { for (var o = 0; r + 1 < e.length && e.charAt(r + 1) === i; ) o++, r++; - var l = 1 + (o & 1), u = o < 2 ? 1 : 3 + (o >> 1), s = "a", a = xc(t); + var l = 1 + (o & 1), u = o < 2 ? 1 : 3 + (o >> 1), s = "a", a = hc(t); for ((a == "H" || a == "k") && (u = 0); u-- > 0; ) n += s; for (; l-- > 0; ) @@ -4826,7 +4668,7 @@ function jc(e, t) { } return n; } -function xc(e) { +function hc(e) { var t = e.hourCycle; if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet e.hourCycles && // @ts-ignore @@ -4845,23 +4687,23 @@ function xc(e) { } var n = e.language, r; n !== "root" && (r = e.maximize().region); - var i = Pn[r || ""] || Pn[n || ""] || Pn["".concat(n, "-001")] || Pn["001"]; + var i = Ln[r || ""] || Ln[n || ""] || Ln["".concat(n, "-001")] || Ln["001"]; return i[0]; } -var Or, zc = new RegExp("^".concat(es.source, "*")), Vc = new RegExp("".concat(es.source, "*$")); +var Ir, mc = new RegExp("^".concat(Zl.source, "*")), pc = new RegExp("".concat(Zl.source, "*$")); function X(e, t) { return { start: e, end: t }; } -var Xc = !!String.prototype.startsWith, Wc = !!String.fromCodePoint, Zc = !!Object.fromEntries, Jc = !!String.prototype.codePointAt, Qc = !!String.prototype.trimStart, Yc = !!String.prototype.trimEnd, Kc = !!Number.isSafeInteger, $c = Kc ? Number.isSafeInteger : function(e) { +var gc = !!String.prototype.startsWith, bc = !!String.fromCodePoint, wc = !!Object.fromEntries, vc = !!String.prototype.codePointAt, yc = !!String.prototype.trimStart, Ec = !!String.prototype.trimEnd, Sc = !!Number.isSafeInteger, kc = Sc ? Number.isSafeInteger : function(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991; -}, ti = !0; +}, Kr = !0; try { - var e0 = os("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - ti = ((Or = e0.exec("a")) === null || Or === void 0 ? void 0 : Or[0]) === "a"; + var Tc = $l("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + Kr = ((Ir = Tc.exec("a")) === null || Ir === void 0 ? void 0 : Ir[0]) === "a"; } catch { - ti = !1; + Kr = !1; } -var ao = Xc ? ( +var io = gc ? ( // Native function(t, n, r) { return t.startsWith(n, r); @@ -4871,7 +4713,7 @@ var ao = Xc ? ( function(t, n, r) { return t.slice(r, r + n.length) === n; } -), ni = Wc ? String.fromCodePoint : ( +), $r = bc ? String.fromCodePoint : ( // IE11 function() { for (var t = [], n = 0; n < arguments.length; n++) @@ -4883,9 +4725,9 @@ var ao = Xc ? ( } return r; } -), uo = ( +), oo = ( // native - Zc ? Object.fromEntries : ( + wc ? Object.fromEntries : ( // Ponyfill function(t) { for (var n = {}, r = 0, i = t; r < i.length; r++) { @@ -4895,7 +4737,7 @@ var ao = Xc ? ( return n; } ) -), is = Jc ? ( +), Kl = vc ? ( // Native function(t, n) { return t.codePointAt(n); @@ -4909,7 +4751,7 @@ var ao = Xc ? ( return i < 55296 || i > 56319 || n + 1 === r || (o = t.charCodeAt(n + 1)) < 56320 || o > 57343 ? i : (i - 55296 << 10) + (o - 56320) + 65536; } } -), t0 = Qc ? ( +), Ac = yc ? ( // Native function(t) { return t.trimStart(); @@ -4917,9 +4759,9 @@ var ao = Xc ? ( ) : ( // Ponyfill function(t) { - return t.replace(zc, ""); + return t.replace(mc, ""); } -), n0 = Yc ? ( +), Bc = Ec ? ( // Native function(t) { return t.trimEnd(); @@ -4927,32 +4769,32 @@ var ao = Xc ? ( ) : ( // Ponyfill function(t) { - return t.replace(Vc, ""); + return t.replace(pc, ""); } ); -function os(e, t) { +function $l(e, t) { return new RegExp(e, t); } -var ri; -if (ti) { - var fo = os("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - ri = function(t, n) { +var ei; +if (Kr) { + var lo = $l("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + ei = function(t, n) { var r; - fo.lastIndex = n; - var i = fo.exec(t); + lo.lastIndex = n; + var i = lo.exec(t); return (r = i[1]) !== null && r !== void 0 ? r : ""; }; } else - ri = function(t, n) { + ei = function(t, n) { for (var r = []; ; ) { - var i = is(t, n); - if (i === void 0 || ls(i) || l0(i)) + var i = Kl(t, n); + if (i === void 0 || es(i) || Oc(i)) break; r.push(i), n += i >= 65536 ? 2 : 1; } - return ni.apply(void 0, r); + return $r.apply(void 0, r); }; -var r0 = ( +var Cc = ( /** @class */ function() { function e(t, n) { @@ -4976,14 +4818,14 @@ var r0 = ( if (o === 35 && (n === "plural" || n === "selectordinal")) { var u = this.clonePosition(); this.bump(), i.push({ - type: ae.pound, + type: se.pound, location: X(u, this.clonePosition()) }); } else if (o === 60 && !this.ignoreTag && this.peek() === 47) { if (r) break; return this.error(V.UNMATCHED_CLOSING_TAG, X(this.clonePosition(), this.clonePosition())); - } else if (o === 60 && !this.ignoreTag && ii(this.peek() || 0)) { + } else if (o === 60 && !this.ignoreTag && ti(this.peek() || 0)) { var l = this.parseTag(t, n); if (l.err) return l; @@ -5004,7 +4846,7 @@ var r0 = ( if (this.bumpSpace(), this.bumpIf("/>")) return { val: { - type: ae.literal, + type: se.literal, value: "<".concat(i, "/>"), location: X(r, this.clonePosition()) }, @@ -5016,12 +4858,12 @@ var r0 = ( return o; var l = o.val, u = this.clonePosition(); if (this.bumpIf("") ? { val: { - type: ae.tag, + type: se.tag, value: i, children: l, location: X(r, this.clonePosition()) @@ -5034,7 +4876,7 @@ var r0 = ( return this.error(V.INVALID_TAG, X(r, this.clonePosition())); }, e.prototype.parseTagName = function() { var t = this.offset(); - for (this.bump(); !this.isEOF() && o0(this.char()); ) + for (this.bump(); !this.isEOF() && Lc(this.char()); ) this.bump(); return this.message.slice(t, this.offset()); }, e.prototype.parseLiteral = function(t, n) { @@ -5058,12 +4900,12 @@ var r0 = ( } var s = X(r, this.clonePosition()); return { - val: { type: ae.literal, value: i, location: s }, + val: { type: se.literal, value: i, location: s }, err: null }; }, e.prototype.tryParseLeftAngleBracket = function() { return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. - !i0(this.peek() || 0)) ? (this.bump(), "<") : null; + !Ic(this.peek() || 0)) ? (this.bump(), "<") : null; }, e.prototype.tryParseQuote = function(t) { if (this.isEOF() || this.char() !== 39) return null; @@ -5097,12 +4939,12 @@ var r0 = ( n.push(r); this.bump(); } - return ni.apply(void 0, n); + return $r.apply(void 0, n); }, e.prototype.tryParseUnquoted = function(t, n) { if (this.isEOF()) return null; var r = this.char(); - return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), ni(r)); + return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), $r(r)); }, e.prototype.parseArgument = function(t, n) { var r = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) @@ -5118,7 +4960,7 @@ var r0 = ( case 125: return this.bump(), { val: { - type: ae.argument, + type: se.argument, // value does not include the opening and closing braces. value: i, location: X(r, this.clonePosition()) @@ -5131,7 +4973,7 @@ var r0 = ( return this.error(V.MALFORMED_ARGUMENT, X(r, this.clonePosition())); } }, e.prototype.parseIdentifierIfPossible = function() { - var t = this.clonePosition(), n = this.offset(), r = ri(this.message, n), i = n + r.length; + var t = this.clonePosition(), n = this.offset(), r = ei(this.message, n), i = n + r.length; this.bumpTo(i); var o = this.clonePosition(), l = X(t, o); return { value: r, location: l }; @@ -5150,46 +4992,46 @@ var r0 = ( var f = this.clonePosition(), d = this.parseSimpleArgStyleIfPossible(); if (d.err) return d; - var c = n0(d.val); + var c = Bc(d.val); if (c.length === 0) return this.error(V.EXPECT_ARGUMENT_STYLE, X(this.clonePosition(), this.clonePosition())); - var h = X(f, this.clonePosition()); - a = { style: c, styleLocation: h }; + var _ = X(f, this.clonePosition()); + a = { style: c, styleLocation: _ }; } - var _ = this.tryParseArgumentClose(i); - if (_.err) - return _; - var m = X(i, this.clonePosition()); - if (a && ao(a == null ? void 0 : a.style, "::", 0)) { - var g = t0(a.style.slice(2)); + var h = this.tryParseArgumentClose(i); + if (h.err) + return h; + var p = X(i, this.clonePosition()); + if (a && io(a == null ? void 0 : a.style, "::", 0)) { + var g = Ac(a.style.slice(2)); if (u === "number") { var d = this.parseNumberSkeletonFromString(g, a.styleLocation); return d.err ? d : { - val: { type: ae.number, value: r, location: m, style: d.val }, + val: { type: se.number, value: r, location: p, style: d.val }, err: null }; } else { if (g.length === 0) - return this.error(V.EXPECT_DATE_TIME_SKELETON, m); - var p = g; - this.locale && (p = jc(g, this.locale)); + return this.error(V.EXPECT_DATE_TIME_SKELETON, p); + var m = g; + this.locale && (m = _c(g, this.locale)); var c = { type: xt.dateTime, - pattern: p, + pattern: m, location: a.styleLocation, - parsedOptions: this.shouldParseSkeletons ? Mc(p) : {} - }, v = u === "date" ? ae.date : ae.time; + parsedOptions: this.shouldParseSkeletons ? lc(m) : {} + }, v = u === "date" ? se.date : se.time; return { - val: { type: v, value: r, location: m, style: c }, + val: { type: v, value: r, location: p, style: c }, err: null }; } } return { val: { - type: u === "number" ? ae.number : u === "date" ? ae.date : ae.time, + type: u === "number" ? se.number : u === "date" ? se.date : se.time, value: r, - location: m, + location: p, style: (o = a == null ? void 0 : a.style) !== null && o !== void 0 ? o : null }, err: null @@ -5198,40 +5040,40 @@ var r0 = ( case "plural": case "selectordinal": case "select": { - var b = this.clonePosition(); + var w = this.clonePosition(); if (this.bumpSpace(), !this.bumpIf(",")) - return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS, X(b, $({}, b))); + return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS, X(w, Y({}, w))); this.bumpSpace(); - var w = this.parseIdentifierIfPossible(), y = 0; - if (u !== "select" && w.value === "offset") { + var b = this.parseIdentifierIfPossible(), y = 0; + if (u !== "select" && b.value === "offset") { if (!this.bumpIf(":")) return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, X(this.clonePosition(), this.clonePosition())); this.bumpSpace(); var d = this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); if (d.err) return d; - this.bumpSpace(), w = this.parseIdentifierIfPossible(), y = d.val; + this.bumpSpace(), b = this.parseIdentifierIfPossible(), y = d.val; } - var S = this.tryParsePluralOrSelectOptions(t, u, n, w); - if (S.err) - return S; - var _ = this.tryParseArgumentClose(i); - if (_.err) - return _; + var k = this.tryParsePluralOrSelectOptions(t, u, n, b); + if (k.err) + return k; + var h = this.tryParseArgumentClose(i); + if (h.err) + return h; var C = X(i, this.clonePosition()); return u === "select" ? { val: { - type: ae.select, + type: se.select, value: r, - options: uo(S.val), + options: oo(k.val), location: C }, err: null } : { val: { - type: ae.plural, + type: se.plural, value: r, - options: uo(S.val), + options: oo(k.val), offset: y, pluralType: u === "plural" ? "cardinal" : "ordinal", location: C @@ -5282,7 +5124,7 @@ var r0 = ( }, e.prototype.parseNumberSkeletonFromString = function(t, n) { var r = []; try { - r = Rc(t); + r = ac(t); } catch { return this.error(V.INVALID_NUMBER_SKELETON, n); } @@ -5291,7 +5133,7 @@ var r0 = ( type: xt.number, tokens: r, location: n, - parsedOptions: this.shouldParseSkeletons ? qc(r) : {} + parsedOptions: this.shouldParseSkeletons ? dc(r) : {} }, err: null }; @@ -5310,20 +5152,20 @@ var r0 = ( if (s.has(a)) return this.error(n === "select" ? V.DUPLICATE_SELECT_ARGUMENT_SELECTOR : V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f); a === "other" && (l = !0), this.bumpSpace(); - var h = this.clonePosition(); + var _ = this.clonePosition(); if (!this.bumpIf("{")) return this.error(n === "select" ? V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, X(this.clonePosition(), this.clonePosition())); - var _ = this.parseMessage(t + 1, n, r); - if (_.err) - return _; - var m = this.tryParseArgumentClose(h); - if (m.err) - return m; + var h = this.parseMessage(t + 1, n, r); + if (h.err) + return h; + var p = this.tryParseArgumentClose(_); + if (p.err) + return p; u.push([ a, { - value: _.val, - location: X(h, this.clonePosition()) + value: h.val, + location: X(_, this.clonePosition()) } ]), s.add(a), this.bumpSpace(), o = this.parseIdentifierIfPossible(), a = o.value, f = o.location; } @@ -5339,7 +5181,7 @@ var r0 = ( break; } var s = X(i, this.clonePosition()); - return o ? (l *= r, $c(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s); + return o ? (l *= r, kc(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s); }, e.prototype.offset = function() { return this.position.offset; }, e.prototype.isEOF = function() { @@ -5354,7 +5196,7 @@ var r0 = ( var t = this.position.offset; if (t >= this.message.length) throw Error("out of bound"); - var n = is(this.message, t); + var n = Kl(this.message, t); if (n === void 0) throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary")); return n; @@ -5373,7 +5215,7 @@ var r0 = ( t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2); } }, e.prototype.bumpIf = function(t) { - if (ao(this.message, t, this.offset())) { + if (io(this.message, t, this.offset())) { for (var n = 0; n < t.length; n++) this.bump(); return !0; @@ -5395,7 +5237,7 @@ var r0 = ( break; } }, e.prototype.bumpSpace = function() { - for (; !this.isEOF() && ls(this.char()); ) + for (; !this.isEOF() && es(this.char()); ) this.bump(); }, e.prototype.peek = function() { if (this.isEOF()) @@ -5405,97 +5247,97 @@ var r0 = ( }, e; }() ); -function ii(e) { +function ti(e) { return e >= 97 && e <= 122 || e >= 65 && e <= 90; } -function i0(e) { - return ii(e) || e === 47; +function Ic(e) { + return ti(e) || e === 47; } -function o0(e) { +function Lc(e) { return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039; } -function ls(e) { +function es(e) { return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233; } -function l0(e) { +function Oc(e) { return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094; } -function oi(e) { +function ni(e) { e.forEach(function(t) { - if (delete t.location, Ql(t) || Yl(t)) + if (delete t.location, zl(t) || Vl(t)) for (var n in t.options) - delete t.options[n].location, oi(t.options[n].value); + delete t.options[n].location, ni(t.options[n].value); else - Wl(t) && $l(t.style) || (Zl(t) || Jl(t)) && ei(t.style) ? delete t.style.location : Kl(t) && oi(t.children); + ql(t) && Wl(t.style) || (jl(t) || xl(t)) && Yr(t.style) ? delete t.style.location : Xl(t) && ni(t.children); }); } -function s0(e, t) { - t === void 0 && (t = {}), t = $({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); - var n = new r0(e, t).parse(); +function Pc(e, t) { + t === void 0 && (t = {}), t = Y({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); + var n = new Cc(e, t).parse(); if (n.err) { var r = SyntaxError(V[n.err.kind]); throw r.location = n.err.location, r.originalMessage = n.err.message, r; } - return t != null && t.captureLocation || oi(n.val), n.val; + return t != null && t.captureLocation || ni(n.val), n.val; } -function Hr(e, t) { - var n = t && t.cache ? t.cache : _0, r = t && t.serializer ? t.serializer : d0, i = t && t.strategy ? t.strategy : u0; +function Lr(e, t) { + var n = t && t.cache ? t.cache : Uc, r = t && t.serializer ? t.serializer : Rc, i = t && t.strategy ? t.strategy : Hc; return i(e, { cache: n, serializer: r }); } -function a0(e) { +function Nc(e) { return e == null || typeof e == "number" || typeof e == "boolean"; } -function ss(e, t, n, r) { - var i = a0(r) ? r : n(r), o = t.get(i); +function ts(e, t, n, r) { + var i = Nc(r) ? r : n(r), o = t.get(i); return typeof o > "u" && (o = e.call(this, r), t.set(i, o)), o; } -function as(e, t, n) { +function ns(e, t, n) { var r = Array.prototype.slice.call(arguments, 3), i = n(r), o = t.get(i); return typeof o > "u" && (o = e.apply(this, r), t.set(i, o)), o; } -function pi(e, t, n, r, i) { +function _i(e, t, n, r, i) { return n.bind(t, e, r, i); } -function u0(e, t) { - var n = e.length === 1 ? ss : as; - return pi(e, this, n, t.cache.create(), t.serializer); +function Hc(e, t) { + var n = e.length === 1 ? ts : ns; + return _i(e, this, n, t.cache.create(), t.serializer); } -function f0(e, t) { - return pi(e, this, as, t.cache.create(), t.serializer); +function Dc(e, t) { + return _i(e, this, ns, t.cache.create(), t.serializer); } -function c0(e, t) { - return pi(e, this, ss, t.cache.create(), t.serializer); +function Mc(e, t) { + return _i(e, this, ts, t.cache.create(), t.serializer); } -var d0 = function() { +var Rc = function() { return JSON.stringify(arguments); }; -function gi() { +function hi() { this.cache = /* @__PURE__ */ Object.create(null); } -gi.prototype.get = function(e) { +hi.prototype.get = function(e) { return this.cache[e]; }; -gi.prototype.set = function(e, t) { +hi.prototype.set = function(e, t) { this.cache[e] = t; }; -var _0 = { +var Uc = { create: function() { - return new gi(); + return new hi(); } -}, Nr = { - variadic: f0, - monadic: c0 +}, Or = { + variadic: Dc, + monadic: Mc }, zt; (function(e) { e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API"; })(zt || (zt = {})); -var nr = ( +var er = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i) { var o = e.call(this, n) || this; return o.code = r, o.originalMessage = i, o; @@ -5504,155 +5346,155 @@ var nr = ( return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); }, t; }(Error) -), co = ( +), so = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i, o) { return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(i).join('", "'), '"'), zt.INVALID_VALUE, o) || this; } return t; - }(nr) -), h0 = ( + }(er) +), Fc = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i) { return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), zt.INVALID_VALUE, i) || this; } return t; - }(nr) -), m0 = ( + }(er) +), Gc = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r) { return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'), zt.MISSING_VALUE, r) || this; } return t; - }(nr) -), ke; + }(er) +), Se; (function(e) { e[e.literal = 0] = "literal", e[e.object = 1] = "object"; -})(ke || (ke = {})); -function p0(e) { +})(Se || (Se = {})); +function qc(e) { return e.length < 2 ? e : e.reduce(function(t, n) { var r = t[t.length - 1]; - return !r || r.type !== ke.literal || n.type !== ke.literal ? t.push(n) : r.value += n.value, t; + return !r || r.type !== Se.literal || n.type !== Se.literal ? t.push(n) : r.value += n.value, t; }, []); } -function g0(e) { +function jc(e) { return typeof e == "function"; } -function Rn(e, t, n, r, i, o, l) { - if (e.length === 1 && io(e[0])) +function Dn(e, t, n, r, i, o, l) { + if (e.length === 1 && eo(e[0])) return [ { - type: ke.literal, + type: Se.literal, value: e[0].value } ]; for (var u = [], s = 0, a = e; s < a.length; s++) { var f = a[s]; - if (io(f)) { + if (eo(f)) { u.push({ - type: ke.literal, + type: Se.literal, value: f.value }); continue; } - if (Hc(f)) { + if (ic(f)) { typeof o == "number" && u.push({ - type: ke.literal, + type: Se.literal, value: n.getNumberFormat(t).format(o) }); continue; } var d = f.value; if (!(i && d in i)) - throw new m0(d, l); + throw new Gc(d, l); var c = i[d]; - if (Oc(f)) { + if (rc(f)) { (!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), u.push({ - type: typeof c == "string" ? ke.literal : ke.object, + type: typeof c == "string" ? Se.literal : Se.object, value: c }); continue; } - if (Zl(f)) { - var h = typeof f.style == "string" ? r.date[f.style] : ei(f.style) ? f.style.parsedOptions : void 0; + if (jl(f)) { + var _ = typeof f.style == "string" ? r.date[f.style] : Yr(f.style) ? f.style.parsedOptions : void 0; u.push({ - type: ke.literal, - value: n.getDateTimeFormat(t, h).format(c) + type: Se.literal, + value: n.getDateTimeFormat(t, _).format(c) }); continue; } - if (Jl(f)) { - var h = typeof f.style == "string" ? r.time[f.style] : ei(f.style) ? f.style.parsedOptions : r.time.medium; + if (xl(f)) { + var _ = typeof f.style == "string" ? r.time[f.style] : Yr(f.style) ? f.style.parsedOptions : r.time.medium; u.push({ - type: ke.literal, - value: n.getDateTimeFormat(t, h).format(c) + type: Se.literal, + value: n.getDateTimeFormat(t, _).format(c) }); continue; } - if (Wl(f)) { - var h = typeof f.style == "string" ? r.number[f.style] : $l(f.style) ? f.style.parsedOptions : void 0; - h && h.scale && (c = c * (h.scale || 1)), u.push({ - type: ke.literal, - value: n.getNumberFormat(t, h).format(c) + if (ql(f)) { + var _ = typeof f.style == "string" ? r.number[f.style] : Wl(f.style) ? f.style.parsedOptions : void 0; + _ && _.scale && (c = c * (_.scale || 1)), u.push({ + type: Se.literal, + value: n.getNumberFormat(t, _).format(c) }); continue; } - if (Kl(f)) { - var _ = f.children, m = f.value, g = i[m]; - if (!g0(g)) - throw new h0(m, "function", l); - var p = Rn(_, t, n, r, i, o), v = g(p.map(function(y) { + if (Xl(f)) { + var h = f.children, p = f.value, g = i[p]; + if (!jc(g)) + throw new Fc(p, "function", l); + var m = Dn(h, t, n, r, i, o), v = g(m.map(function(y) { return y.value; })); Array.isArray(v) || (v = [v]), u.push.apply(u, v.map(function(y) { return { - type: typeof y == "string" ? ke.literal : ke.object, + type: typeof y == "string" ? Se.literal : Se.object, value: y }; })); } - if (Ql(f)) { - var b = f.options[c] || f.options.other; - if (!b) - throw new co(f.value, c, Object.keys(f.options), l); - u.push.apply(u, Rn(b.value, t, n, r, i)); + if (zl(f)) { + var w = f.options[c] || f.options.other; + if (!w) + throw new so(f.value, c, Object.keys(f.options), l); + u.push.apply(u, Dn(w.value, t, n, r, i)); continue; } - if (Yl(f)) { - var b = f.options["=".concat(c)]; - if (!b) { + if (Vl(f)) { + var w = f.options["=".concat(c)]; + if (!w) { if (!Intl.PluralRules) - throw new nr(`Intl.PluralRules is not available in this environment. + throw new er(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" `, zt.MISSING_INTL_API, l); - var w = n.getPluralRules(t, { type: f.pluralType }).select(c - (f.offset || 0)); - b = f.options[w] || f.options.other; + var b = n.getPluralRules(t, { type: f.pluralType }).select(c - (f.offset || 0)); + w = f.options[b] || f.options.other; } - if (!b) - throw new co(f.value, c, Object.keys(f.options), l); - u.push.apply(u, Rn(b.value, t, n, r, i, c - (f.offset || 0))); + if (!w) + throw new so(f.value, c, Object.keys(f.options), l); + u.push.apply(u, Dn(w.value, t, n, r, i, c - (f.offset || 0))); continue; } } - return p0(u); + return qc(u); } -function b0(e, t) { - return t ? $($($({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) { - return n[r] = $($({}, e[r]), t[r] || {}), n; +function xc(e, t) { + return t ? Y(Y(Y({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) { + return n[r] = Y(Y({}, e[r]), t[r] || {}), n; }, {})) : e; } -function w0(e, t) { +function zc(e, t) { return t ? Object.keys(e).reduce(function(n, r) { - return n[r] = b0(e[r], t[r]), n; - }, $({}, e)) : e; + return n[r] = xc(e[r], t[r]), n; + }, Y({}, e)) : e; } -function Mr(e) { +function Pr(e) { return { create: function() { return { @@ -5666,39 +5508,39 @@ function Mr(e) { } }; } -function v0(e) { +function Vc(e) { return e === void 0 && (e = { number: {}, dateTime: {}, pluralRules: {} }), { - getNumberFormat: Hr(function() { + getNumberFormat: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.NumberFormat).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.NumberFormat).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.number), - strategy: Nr.variadic + cache: Pr(e.number), + strategy: Or.variadic }), - getDateTimeFormat: Hr(function() { + getDateTimeFormat: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.DateTimeFormat).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.DateTimeFormat).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.dateTime), - strategy: Nr.variadic + cache: Pr(e.dateTime), + strategy: Or.variadic }), - getPluralRules: Hr(function() { + getPluralRules: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.PluralRules).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.PluralRules).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.pluralRules), - strategy: Nr.variadic + cache: Pr(e.pluralRules), + strategy: Or.variadic }) }; } -var y0 = ( +var Xc = ( /** @class */ function() { function e(t, n, r, i) { @@ -5712,11 +5554,11 @@ var y0 = ( if (u.length === 1) return u[0].value; var s = u.reduce(function(a, f) { - return !a.length || f.type !== ke.literal || typeof a[a.length - 1] != "string" ? a.push(f.value) : a[a.length - 1] += f.value, a; + return !a.length || f.type !== Se.literal || typeof a[a.length - 1] != "string" ? a.push(f.value) : a[a.length - 1] += f.value, a; }, []); return s.length <= 1 ? s[0] || "" : s; }, this.formatToParts = function(l) { - return Rn(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message); + return Dn(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message); }, this.resolvedOptions = function() { return { locale: o.resolvedLocale.toString() @@ -5734,7 +5576,7 @@ var y0 = ( this.ast = t; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = w0(e.formats, r), this.formatters = i && i.formatters || v0(this.formatterCache); + this.formats = zc(e.formats, r), this.formatters = i && i.formatters || Vc(this.formatterCache); } return Object.defineProperty(e, "defaultLocale", { get: function() { @@ -5745,7 +5587,7 @@ var y0 = ( }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) { var n = Intl.NumberFormat.supportedLocalesOf(t); return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]); - }, e.__parse = s0, e.formats = { + }, e.__parse = Pc, e.formats = { number: { integer: { maximumFractionDigits: 0 @@ -5806,7 +5648,7 @@ var y0 = ( }, e; }() ); -function E0(e, t) { +function Wc(e, t) { if (t == null) return; if (t in e) @@ -5827,92 +5669,92 @@ function E0(e, t) { r = void 0; return r; } -const ut = {}, S0 = (e, t, n) => n && (t in ut || (ut[t] = {}), e in ut[t] || (ut[t][e] = n), n), us = (e, t) => { +const lt = {}, Zc = (e, t, n) => n && (t in lt || (lt[t] = {}), e in lt[t] || (lt[t][e] = n), n), rs = (e, t) => { if (t == null) return; - if (t in ut && e in ut[t]) - return ut[t][e]; - const n = rr(t); + if (t in lt && e in lt[t]) + return lt[t][e]; + const n = tr(t); for (let r = 0; r < n.length; r++) { - const i = n[r], o = T0(i, e); + const i = n[r], o = Qc(i, e); if (o) - return S0(e, t, o); + return Zc(e, t, o); } }; -let bi; -const mn = hn({}); -function k0(e) { - return bi[e] || null; +let mi; +const hn = _n({}); +function Jc(e) { + return mi[e] || null; } -function fs(e) { - return e in bi; +function is(e) { + return e in mi; } -function T0(e, t) { - if (!fs(e)) +function Qc(e, t) { + if (!is(e)) return null; - const n = k0(e); - return E0(n, t); + const n = Jc(e); + return Wc(n, t); } -function A0(e) { +function Yc(e) { if (e == null) return; - const t = rr(e); + const t = tr(e); for (let n = 0; n < t.length; n++) { const r = t[n]; - if (fs(r)) + if (is(r)) return r; } } -function B0(e, ...t) { - delete ut[e], mn.update((n) => (n[e] = Pc.all([n[e] || {}, ...t]), n)); +function Kc(e, ...t) { + delete lt[e], hn.update((n) => (n[e] = nc.all([n[e] || {}, ...t]), n)); } -Qt( - [mn], +Jt( + [hn], ([e]) => Object.keys(e) ); -mn.subscribe((e) => bi = e); -const Un = {}; -function C0(e, t) { - Un[e].delete(t), Un[e].size === 0 && delete Un[e]; +hn.subscribe((e) => mi = e); +const Mn = {}; +function $c(e, t) { + Mn[e].delete(t), Mn[e].size === 0 && delete Mn[e]; } -function cs(e) { - return Un[e]; +function os(e) { + return Mn[e]; } -function I0(e) { - return rr(e).map((t) => { - const n = cs(t); +function e0(e) { + return tr(e).map((t) => { + const n = os(t); return [t, n ? [...n] : []]; }).filter(([, t]) => t.length > 0); } -function li(e) { - return e == null ? !1 : rr(e).some( +function ri(e) { + return e == null ? !1 : tr(e).some( (t) => { var n; - return (n = cs(t)) == null ? void 0 : n.size; + return (n = os(t)) == null ? void 0 : n.size; } ); } -function L0(e, t) { +function t0(e, t) { return Promise.all( - t.map((r) => (C0(e, r), r().then((i) => i.default || i))) - ).then((r) => B0(e, ...r)); -} -const tn = {}; -function ds(e) { - if (!li(e)) - return e in tn ? tn[e] : Promise.resolve(); - const t = I0(e); - return tn[e] = Promise.all( + t.map((r) => ($c(e, r), r().then((i) => i.default || i))) + ).then((r) => Kc(e, ...r)); +} +const $t = {}; +function ls(e) { + if (!ri(e)) + return e in $t ? $t[e] : Promise.resolve(); + const t = e0(e); + return $t[e] = Promise.all( t.map( - ([n, r]) => L0(n, r) + ([n, r]) => t0(n, r) ) ).then(() => { - if (li(e)) - return ds(e); - delete tn[e]; - }), tn[e]; + if (ri(e)) + return ls(e); + delete $t[e]; + }), $t[e]; } -const P0 = { +const n0 = { number: { scientific: { notation: "scientific" }, engineering: { notation: "engineering" }, @@ -5941,148 +5783,148 @@ const P0 = { timeZoneName: "short" } } -}, O0 = { +}, r0 = { fallbackLocale: null, loadingDelay: 200, - formats: P0, + formats: n0, warnOnMissingMessages: !0, handleMissingMessage: void 0, ignoreTag: !0 -}, H0 = O0; +}, i0 = r0; function Vt() { - return H0; + return i0; } -const Dr = hn(!1); -var N0 = Object.defineProperty, M0 = Object.defineProperties, D0 = Object.getOwnPropertyDescriptors, _o = Object.getOwnPropertySymbols, R0 = Object.prototype.hasOwnProperty, U0 = Object.prototype.propertyIsEnumerable, ho = (e, t, n) => t in e ? N0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, F0 = (e, t) => { +const Nr = _n(!1); +var o0 = Object.defineProperty, l0 = Object.defineProperties, s0 = Object.getOwnPropertyDescriptors, ao = Object.getOwnPropertySymbols, a0 = Object.prototype.hasOwnProperty, u0 = Object.prototype.propertyIsEnumerable, uo = (e, t, n) => t in e ? o0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f0 = (e, t) => { for (var n in t || (t = {})) - R0.call(t, n) && ho(e, n, t[n]); - if (_o) - for (var n of _o(t)) - U0.call(t, n) && ho(e, n, t[n]); + a0.call(t, n) && uo(e, n, t[n]); + if (ao) + for (var n of ao(t)) + u0.call(t, n) && uo(e, n, t[n]); return e; -}, G0 = (e, t) => M0(e, D0(t)); -let si; -const jn = hn(null); -function mo(e) { +}, c0 = (e, t) => l0(e, s0(t)); +let ii; +const Gn = _n(null); +function fo(e) { return e.split("-").map((t, n, r) => r.slice(0, n + 1).join("-")).reverse(); } -function rr(e, t = Vt().fallbackLocale) { - const n = mo(e); - return t ? [.../* @__PURE__ */ new Set([...n, ...mo(t)])] : n; +function tr(e, t = Vt().fallbackLocale) { + const n = fo(e); + return t ? [.../* @__PURE__ */ new Set([...n, ...fo(t)])] : n; } -function Ht() { - return si ?? void 0; +function Nt() { + return ii ?? void 0; } -jn.subscribe((e) => { - si = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); +Gn.subscribe((e) => { + ii = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); }); -const q0 = (e) => { - if (e && A0(e) && li(e)) { +const d0 = (e) => { + if (e && Yc(e) && ri(e)) { const { loadingDelay: t } = Vt(); let n; - return typeof window < "u" && Ht() != null && t ? n = window.setTimeout( - () => Dr.set(!0), + return typeof window < "u" && Nt() != null && t ? n = window.setTimeout( + () => Nr.set(!0), t - ) : Dr.set(!0), ds(e).then(() => { - jn.set(e); + ) : Nr.set(!0), ls(e).then(() => { + Gn.set(e); }).finally(() => { - clearTimeout(n), Dr.set(!1); + clearTimeout(n), Nr.set(!1); }); } - return jn.set(e); -}, pn = G0(F0({}, jn), { - set: q0 -}), ir = (e) => { + return Gn.set(e); +}, mn = c0(f0({}, Gn), { + set: d0 +}), nr = (e) => { const t = /* @__PURE__ */ Object.create(null); return (r) => { const i = JSON.stringify(r); return i in t ? t[i] : t[i] = e(r); }; }; -var j0 = Object.defineProperty, xn = Object.getOwnPropertySymbols, _s = Object.prototype.hasOwnProperty, hs = Object.prototype.propertyIsEnumerable, po = (e, t, n) => t in e ? j0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, wi = (e, t) => { +var _0 = Object.defineProperty, qn = Object.getOwnPropertySymbols, ss = Object.prototype.hasOwnProperty, as = Object.prototype.propertyIsEnumerable, co = (e, t, n) => t in e ? _0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, pi = (e, t) => { for (var n in t || (t = {})) - _s.call(t, n) && po(e, n, t[n]); - if (xn) - for (var n of xn(t)) - hs.call(t, n) && po(e, n, t[n]); + ss.call(t, n) && co(e, n, t[n]); + if (qn) + for (var n of qn(t)) + as.call(t, n) && co(e, n, t[n]); return e; -}, Yt = (e, t) => { +}, Qt = (e, t) => { var n = {}; for (var r in e) - _s.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); - if (e != null && xn) - for (var r of xn(e)) - t.indexOf(r) < 0 && hs.call(e, r) && (n[r] = e[r]); + ss.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); + if (e != null && qn) + for (var r of qn(e)) + t.indexOf(r) < 0 && as.call(e, r) && (n[r] = e[r]); return n; }; -const un = (e, t) => { +const sn = (e, t) => { const { formats: n } = Vt(); if (e in n && t in n[e]) return n[e][t]; throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`); -}, x0 = ir( +}, h0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return r && (i = un("number", r)), new Intl.NumberFormat(n, i); + return r && (i = sn("number", r)), new Intl.NumberFormat(n, i); } -), z0 = ir( +), m0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return r ? i = un("date", r) : Object.keys(i).length === 0 && (i = un("date", "short")), new Intl.DateTimeFormat(n, i); + return r ? i = sn("date", r) : Object.keys(i).length === 0 && (i = sn("date", "short")), new Intl.DateTimeFormat(n, i); } -), V0 = ir( +), p0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return r ? i = un("time", r) : Object.keys(i).length === 0 && (i = un("time", "short")), new Intl.DateTimeFormat(n, i); + return r ? i = sn("time", r) : Object.keys(i).length === 0 && (i = sn("time", "short")), new Intl.DateTimeFormat(n, i); } -), X0 = (e = {}) => { +), g0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return x0(wi({ locale: n }, r)); -}, W0 = (e = {}) => { + return h0(pi({ locale: n }, r)); +}, b0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return z0(wi({ locale: n }, r)); -}, Z0 = (e = {}) => { + return m0(pi({ locale: n }, r)); +}, w0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return V0(wi({ locale: n }, r)); -}, J0 = ir( + return p0(pi({ locale: n }, r)); +}, v0 = nr( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (e, t = Ht()) => new y0(e, t, Vt().formats, { + (e, t = Nt()) => new Xc(e, t, Vt().formats, { ignoreTag: Vt().ignoreTag }) -), Q0 = (e, t = {}) => { +), y0 = (e, t = {}) => { var n, r, i, o; let l = t; typeof e == "object" && (l = e, e = l.id); const { values: u, - locale: s = Ht(), + locale: s = Nt(), default: a } = l; if (s == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let f = us(e, s); + let f = rs(e, s); if (!f) f = (o = (i = (r = (n = Vt()).handleMissingMessage) == null ? void 0 : r.call(n, { locale: s, id: e, defaultValue: a })) != null ? i : a) != null ? o : e; else if (typeof f != "string") @@ -6093,7 +5935,7 @@ const un = (e, t) => { return f; let d = f; try { - d = J0(f, s).format(u); + d = v0(f, s).format(u); } catch (c) { c instanceof Error && console.warn( `[svelte-i18n] Message "${e}" has syntax error:`, @@ -6101,30 +5943,30 @@ const un = (e, t) => { ); } return d; -}, Y0 = (e, t) => Z0(t).format(e), K0 = (e, t) => W0(t).format(e), $0 = (e, t) => X0(t).format(e), ed = (e, t = Ht()) => us(e, t); -Qt([pn, mn], () => Q0); -Qt([pn], () => Y0); -Qt([pn], () => K0); -Qt([pn], () => $0); -Qt([pn, mn], () => ed); +}, E0 = (e, t) => w0(t).format(e), S0 = (e, t) => b0(t).format(e), k0 = (e, t) => g0(t).format(e), T0 = (e, t = Nt()) => rs(e, t); +Jt([mn, hn], () => y0); +Jt([mn], () => E0); +Jt([mn], () => S0); +Jt([mn], () => k0); +Jt([mn, hn], () => T0); const { - SvelteComponent: td, + SvelteComponent: A0, append: Ce, - attr: wt, - detach: ms, - element: vt, - init: nd, - insert: ps, - noop: go, - safe_not_equal: rd, - set_data: zn, - set_style: Rr, - space: ai, + attr: gt, + detach: us, + element: bt, + init: B0, + insert: fs, + noop: _o, + safe_not_equal: C0, + set_data: jn, + set_style: Hr, + space: oi, text: Rt, - toggle_class: bo -} = window.__gradio__svelte__internal, { onMount: id, createEventDispatcher: od, getContext: ld } = window.__gradio__svelte__internal; -function wo(e) { - let t, n, r, i, o = on( + toggle_class: ho +} = window.__gradio__svelte__internal, { onMount: I0, createEventDispatcher: L0, getContext: O0 } = window.__gradio__svelte__internal; +function mo(e) { + let t, n, r, i, o = nn( /*file_to_display*/ e[2] ) + "", l, u, s, a, f = ( @@ -6133,33 +5975,33 @@ function wo(e) { ), d; return { c() { - t = vt("div"), n = vt("span"), r = vt("div"), i = vt("progress"), l = Rt(o), s = ai(), a = vt("span"), d = Rt(f), Rr(i, "visibility", "hidden"), Rr(i, "height", "0"), Rr(i, "width", "0"), i.value = u = on( + t = bt("div"), n = bt("span"), r = bt("div"), i = bt("progress"), l = Rt(o), s = oi(), a = bt("span"), d = Rt(f), Hr(i, "visibility", "hidden"), Hr(i, "height", "0"), Hr(i, "width", "0"), i.value = u = nn( /*file_to_display*/ e[2] - ), wt(i, "max", "100"), wt(i, "class", "svelte-12ckl9l"), wt(r, "class", "progress-bar svelte-12ckl9l"), wt(a, "class", "file-name svelte-12ckl9l"), wt(t, "class", "file svelte-12ckl9l"); + ), gt(i, "max", "100"), gt(i, "class", "svelte-12ckl9l"), gt(r, "class", "progress-bar svelte-12ckl9l"), gt(a, "class", "file-name svelte-12ckl9l"), gt(t, "class", "file svelte-12ckl9l"); }, - m(c, h) { - ps(c, t, h), Ce(t, n), Ce(n, r), Ce(r, i), Ce(i, l), Ce(t, s), Ce(t, a), Ce(a, d); + m(c, _) { + fs(c, t, _), Ce(t, n), Ce(n, r), Ce(r, i), Ce(i, l), Ce(t, s), Ce(t, a), Ce(a, d); }, - p(c, h) { - h & /*file_to_display*/ - 4 && o !== (o = on( + p(c, _) { + _ & /*file_to_display*/ + 4 && o !== (o = nn( /*file_to_display*/ c[2] - ) + "") && zn(l, o), h & /*file_to_display*/ - 4 && u !== (u = on( + ) + "") && jn(l, o), _ & /*file_to_display*/ + 4 && u !== (u = nn( /*file_to_display*/ c[2] - )) && (i.value = u), h & /*file_to_display*/ + )) && (i.value = u), _ & /*file_to_display*/ 4 && f !== (f = /*file_to_display*/ - c[2].orig_name + "") && zn(d, f); + c[2].orig_name + "") && jn(d, f); }, d(c) { - c && ms(t); + c && us(t); } }; } -function sd(e) { +function P0(e) { let t, n, r, i = ( /*files_with_progress*/ e[0].length + "" @@ -6168,67 +6010,67 @@ function sd(e) { e[0].length > 1 ? "files" : "file" ), s, a, f, d = ( /*file_to_display*/ - e[2] && wo(e) + e[2] && mo(e) ); return { c() { - t = vt("div"), n = vt("span"), r = Rt("Uploading "), o = Rt(i), l = ai(), s = Rt(u), a = Rt("..."), f = ai(), d && d.c(), wt(n, "class", "uploading svelte-12ckl9l"), wt(t, "class", "wrap svelte-12ckl9l"), bo( + t = bt("div"), n = bt("span"), r = Rt("Uploading "), o = Rt(i), l = oi(), s = Rt(u), a = Rt("..."), f = oi(), d && d.c(), gt(n, "class", "uploading svelte-12ckl9l"), gt(t, "class", "wrap svelte-12ckl9l"), ho( t, "progress", /*progress*/ e[1] ); }, - m(c, h) { - ps(c, t, h), Ce(t, n), Ce(n, r), Ce(n, o), Ce(n, l), Ce(n, s), Ce(n, a), Ce(t, f), d && d.m(t, null); + m(c, _) { + fs(c, t, _), Ce(t, n), Ce(n, r), Ce(n, o), Ce(n, l), Ce(n, s), Ce(n, a), Ce(t, f), d && d.m(t, null); }, - p(c, [h]) { - h & /*files_with_progress*/ + p(c, [_]) { + _ & /*files_with_progress*/ 1 && i !== (i = /*files_with_progress*/ - c[0].length + "") && zn(o, i), h & /*files_with_progress*/ + c[0].length + "") && jn(o, i), _ & /*files_with_progress*/ 1 && u !== (u = /*files_with_progress*/ - c[0].length > 1 ? "files" : "file") && zn(s, u), /*file_to_display*/ - c[2] ? d ? d.p(c, h) : (d = wo(c), d.c(), d.m(t, null)) : d && (d.d(1), d = null), h & /*progress*/ - 2 && bo( + c[0].length > 1 ? "files" : "file") && jn(s, u), /*file_to_display*/ + c[2] ? d ? d.p(c, _) : (d = mo(c), d.c(), d.m(t, null)) : d && (d.d(1), d = null), _ & /*progress*/ + 2 && ho( t, "progress", /*progress*/ c[1] ); }, - i: go, - o: go, + i: _o, + o: _o, d(c) { - c && ms(t), d && d.d(); + c && us(t), d && d.d(); } }; } -function on(e) { +function nn(e) { return e.progress * 100 / (e.size || 0) || 0; } -function ad(e) { +function N0(e) { let t = 0; return e.forEach((n) => { - t += on(n); + t += nn(n); }), document.documentElement.style.setProperty("--upload-progress-width", (t / e.length).toFixed(2) + "%"), t / e.length; } -function ud(e, t, n) { - let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, u = !1, s, a, f = o.map((_) => ({ ..._, progress: 0 })); - const d = od(); - function c(_, m) { - n(0, f = f.map((g) => (g.orig_name === _ && (g.progress += m), g))); - } - const h = ld("EventSource_factory"); - return id(() => { - l = h(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(_) { - const m = JSON.parse(_.data); - u || n(1, u = !0), m.msg === "done" ? (l.close(), d("done")) : (n(6, s = m), c(m.orig_name, m.chunk_size)); +function H0(e, t, n) { + let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, u = !1, s, a, f = o.map((h) => ({ ...h, progress: 0 })); + const d = L0(); + function c(h, p) { + n(0, f = f.map((g) => (g.orig_name === h && (g.progress += p), g))); + } + const _ = O0("EventSource_factory"); + return I0(() => { + l = _(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(h) { + const p = JSON.parse(h.data); + u || n(1, u = !0), p.msg === "done" ? (l.close(), d("done")) : (n(6, s = p), c(p.orig_name, p.chunk_size)); }; - }), e.$$set = (_) => { - "upload_id" in _ && n(3, r = _.upload_id), "root" in _ && n(4, i = _.root), "files" in _ && n(5, o = _.files); + }), e.$$set = (h) => { + "upload_id" in h && n(3, r = h.upload_id), "root" in h && n(4, i = h.root), "files" in h && n(5, o = h.files); }, e.$$.update = () => { e.$$.dirty & /*files_with_progress*/ - 1 && ad(f), e.$$.dirty & /*current_file_upload, files_with_progress*/ + 1 && N0(f), e.$$.dirty & /*current_file_upload, files_with_progress*/ 65 && n(2, a = s || f[0]); }, [ f, @@ -6240,48 +6082,48 @@ function ud(e, t, n) { s ]; } -class fd extends td { +class D0 extends A0 { constructor(t) { - super(), nd(this, t, ud, sd, rd, { upload_id: 3, root: 4, files: 5 }); + super(), B0(this, t, H0, P0, C0, { upload_id: 3, root: 4, files: 5 }); } } const { - SvelteComponent: cd, - append: vo, + SvelteComponent: M0, + append: po, attr: ye, - binding_callbacks: dd, - bubble: mt, - check_outros: gs, - create_component: _d, - create_slot: bs, - destroy_component: hd, - detach: or, - element: ui, - empty: ws, - get_all_dirty_from_scope: vs, - get_slot_changes: ys, - group_outros: Es, - init: md, - insert: lr, - listen: Oe, - mount_component: pd, - prevent_default: pt, - run_all: gd, - safe_not_equal: bd, - set_style: Ss, - space: wd, - stop_propagation: gt, + binding_callbacks: R0, + bubble: _t, + check_outros: cs, + create_component: U0, + create_slot: ds, + destroy_component: F0, + detach: rr, + element: li, + empty: _s, + get_all_dirty_from_scope: hs, + get_slot_changes: ms, + group_outros: ps, + init: G0, + insert: ir, + listen: Pe, + mount_component: q0, + prevent_default: ht, + run_all: j0, + safe_not_equal: x0, + set_style: gs, + space: z0, + stop_propagation: mt, toggle_class: Ee, - transition_in: ct, - transition_out: It, - update_slot_base: ks -} = window.__gradio__svelte__internal, { createEventDispatcher: vd, tick: yd, getContext: Ed } = window.__gradio__svelte__internal; -function Sd(e) { + transition_in: at, + transition_out: Bt, + update_slot_base: bs +} = window.__gradio__svelte__internal, { createEventDispatcher: V0, tick: X0, getContext: W0 } = window.__gradio__svelte__internal; +function Z0(e) { let t, n, r, i, o, l, u, s, a, f; const d = ( /*#slots*/ e[22].default - ), c = bs( + ), c = ds( d, e, /*$$scope*/ @@ -6290,7 +6132,7 @@ function Sd(e) { ); return { c() { - t = ui("button"), c && c.c(), n = wd(), r = ui("input"), ye(r, "aria-label", "file upload"), ye(r, "data-testid", "file-upload"), ye(r, "type", "file"), ye( + t = li("button"), c && c.c(), n = z0(), r = li("input"), ye(r, "aria-label", "file upload"), ye(r, "data-testid", "file-upload"), ye(r, "type", "file"), ye( r, "accept", /*accept_file_types*/ @@ -6319,63 +6161,63 @@ function Sd(e) { "flex", /*flex*/ e[4] - ), Ss(t, "height", "100%"); + ), gs(t, "height", "100%"); }, - m(h, _) { - lr(h, t, _), c && c.m(t, null), vo(t, n), vo(t, r), e[30](r), s = !0, a || (f = [ - Oe( + m(_, h) { + ir(_, t, h), c && c.m(t, null), po(t, n), po(t, r), e[30](r), s = !0, a || (f = [ + Pe( r, "change", /*load_files_from_upload*/ e[15] ), - Oe(t, "drag", gt(pt( + Pe(t, "drag", mt(ht( /*drag_handler*/ e[23] ))), - Oe(t, "dragstart", gt(pt( + Pe(t, "dragstart", mt(ht( /*dragstart_handler*/ e[24] ))), - Oe(t, "dragend", gt(pt( + Pe(t, "dragend", mt(ht( /*dragend_handler*/ e[25] ))), - Oe(t, "dragover", gt(pt( + Pe(t, "dragover", mt(ht( /*dragover_handler*/ e[26] ))), - Oe(t, "dragenter", gt(pt( + Pe(t, "dragenter", mt(ht( /*dragenter_handler*/ e[27] ))), - Oe(t, "dragleave", gt(pt( + Pe(t, "dragleave", mt(ht( /*dragleave_handler*/ e[28] ))), - Oe(t, "drop", gt(pt( + Pe(t, "drop", mt(ht( /*drop_handler*/ e[29] ))), - Oe( + Pe( t, "click", /*open_file_upload*/ e[9] ), - Oe( + Pe( t, "drop", /*loadFilesFromDrop*/ e[16] ), - Oe( + Pe( t, "dragenter", /*updateDragging*/ e[14] ), - Oe( + Pe( t, "dragleave", /*updateDragging*/ @@ -6383,110 +6225,110 @@ function Sd(e) { ) ], a = !0); }, - p(h, _) { - c && c.p && (!s || _[0] & /*$$scope*/ - 2097152) && ks( + p(_, h) { + c && c.p && (!s || h[0] & /*$$scope*/ + 2097152) && bs( c, d, - h, + _, /*$$scope*/ - h[21], - s ? ys( + _[21], + s ? ms( d, /*$$scope*/ - h[21], - _, + _[21], + h, null - ) : vs( + ) : hs( /*$$scope*/ - h[21] + _[21] ), null - ), (!s || _[0] & /*accept_file_types*/ + ), (!s || h[0] & /*accept_file_types*/ 4096) && ye( r, "accept", /*accept_file_types*/ - h[12] - ), (!s || _[0] & /*file_count*/ + _[12] + ), (!s || h[0] & /*file_count*/ 32 && i !== (i = /*file_count*/ - h[5] === "multiple" || void 0)) && (r.multiple = i), (!s || _[0] & /*file_count*/ + _[5] === "multiple" || void 0)) && (r.multiple = i), (!s || h[0] & /*file_count*/ 32 && o !== (o = /*file_count*/ - h[5] === "directory" || void 0)) && ye(r, "webkitdirectory", o), (!s || _[0] & /*file_count*/ + _[5] === "directory" || void 0)) && ye(r, "webkitdirectory", o), (!s || h[0] & /*file_count*/ 32 && l !== (l = /*file_count*/ - h[5] === "directory" || void 0)) && ye(r, "mozdirectory", l), (!s || _[0] & /*hidden*/ + _[5] === "directory" || void 0)) && ye(r, "mozdirectory", l), (!s || h[0] & /*hidden*/ 128 && u !== (u = /*hidden*/ - h[7] ? -1 : 0)) && ye(t, "tabindex", u), (!s || _[0] & /*hidden*/ + _[7] ? -1 : 0)) && ye(t, "tabindex", u), (!s || h[0] & /*hidden*/ 128) && Ee( t, "hidden", /*hidden*/ - h[7] - ), (!s || _[0] & /*center*/ + _[7] + ), (!s || h[0] & /*center*/ 8) && Ee( t, "center", /*center*/ - h[3] - ), (!s || _[0] & /*boundedheight*/ + _[3] + ), (!s || h[0] & /*boundedheight*/ 4) && Ee( t, "boundedheight", /*boundedheight*/ - h[2] - ), (!s || _[0] & /*flex*/ + _[2] + ), (!s || h[0] & /*flex*/ 16) && Ee( t, "flex", /*flex*/ - h[4] + _[4] ); }, - i(h) { - s || (ct(c, h), s = !0); + i(_) { + s || (at(c, _), s = !0); }, - o(h) { - It(c, h), s = !1; + o(_) { + Bt(c, _), s = !1; }, - d(h) { - h && or(t), c && c.d(h), e[30](null), a = !1, gd(f); + d(_) { + _ && rr(t), c && c.d(_), e[30](null), a = !1, j0(f); } }; } -function kd(e) { +function J0(e) { let t, n, r = !/*hidden*/ - e[7] && yo(e); + e[7] && go(e); return { c() { - r && r.c(), t = ws(); + r && r.c(), t = _s(); }, m(i, o) { - r && r.m(i, o), lr(i, t, o), n = !0; + r && r.m(i, o), ir(i, t, o), n = !0; }, p(i, o) { /*hidden*/ - i[7] ? r && (Es(), It(r, 1, 1, () => { + i[7] ? r && (ps(), Bt(r, 1, 1, () => { r = null; - }), gs()) : r ? (r.p(i, o), o[0] & /*hidden*/ - 128 && ct(r, 1)) : (r = yo(i), r.c(), ct(r, 1), r.m(t.parentNode, t)); + }), cs()) : r ? (r.p(i, o), o[0] & /*hidden*/ + 128 && at(r, 1)) : (r = go(i), r.c(), at(r, 1), r.m(t.parentNode, t)); }, i(i) { - n || (ct(r), n = !0); + n || (at(r), n = !0); }, o(i) { - It(r), n = !1; + Bt(r), n = !1; }, d(i) { - i && or(t), r && r.d(i); + i && rr(t), r && r.d(i); } }; } -function Td(e) { +function Q0(e) { let t, n, r, i, o; const l = ( /*#slots*/ e[22].default - ), u = bs( + ), u = ds( l, e, /*$$scope*/ @@ -6495,7 +6337,7 @@ function Td(e) { ); return { c() { - t = ui("button"), u && u.c(), ye(t, "tabindex", n = /*hidden*/ + t = li("button"), u && u.c(), ye(t, "tabindex", n = /*hidden*/ e[7] ? -1 : 0), ye(t, "class", "svelte-1aq8tno"), Ee( t, "hidden", @@ -6516,10 +6358,10 @@ function Td(e) { "flex", /*flex*/ e[4] - ), Ss(t, "height", "100%"); + ), gs(t, "height", "100%"); }, m(s, a) { - lr(s, t, a), u && u.m(t, null), r = !0, i || (o = Oe( + ir(s, t, a), u && u.m(t, null), r = !0, i || (o = Pe( t, "click", /*paste_clipboard*/ @@ -6528,19 +6370,19 @@ function Td(e) { }, p(s, a) { u && u.p && (!r || a[0] & /*$$scope*/ - 2097152) && ks( + 2097152) && bs( u, l, s, /*$$scope*/ s[21], - r ? ys( + r ? ms( l, /*$$scope*/ s[21], a, null - ) : vs( + ) : hs( /*$$scope*/ s[21] ), @@ -6574,19 +6416,19 @@ function Td(e) { ); }, i(s) { - r || (ct(u, s), r = !0); + r || (at(u, s), r = !0); }, o(s) { - It(u, s), r = !1; + Bt(u, s), r = !1; }, d(s) { - s && or(t), u && u.d(s), i = !1, o(); + s && rr(t), u && u.d(s), i = !1, o(); } }; } -function yo(e) { +function go(e) { let t, n; - return t = new fd({ + return t = new D0({ props: { root: ( /*root*/ @@ -6603,10 +6445,10 @@ function yo(e) { } }), { c() { - _d(t.$$.fragment); + U0(t.$$.fragment); }, m(r, i) { - pd(t, r, i), n = !0; + q0(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -6619,19 +6461,19 @@ function yo(e) { r[11]), t.$set(o); }, i(r) { - n || (ct(t.$$.fragment, r), n = !0); + n || (at(t.$$.fragment, r), n = !0); }, o(r) { - It(t.$$.fragment, r), n = !1; + Bt(t.$$.fragment, r), n = !1; }, d(r) { - hd(t, r); + F0(t, r); } }; } -function Ad(e) { +function Y0(e) { let t, n, r, i; - const o = [Td, kd, Sd], l = []; + const o = [Q0, J0, Z0], l = []; function u(s, a) { return ( /*filetype*/ @@ -6643,29 +6485,29 @@ function Ad(e) { } return t = u(e), n = l[t] = o[t](e), { c() { - n.c(), r = ws(); + n.c(), r = _s(); }, m(s, a) { - l[t].m(s, a), lr(s, r, a), i = !0; + l[t].m(s, a), ir(s, r, a), i = !0; }, p(s, a) { let f = t; - t = u(s), t === f ? l[t].p(s, a) : (Es(), It(l[f], 1, 1, () => { + t = u(s), t === f ? l[t].p(s, a) : (ps(), Bt(l[f], 1, 1, () => { l[f] = null; - }), gs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), ct(n, 1), n.m(r.parentNode, r)); + }), cs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), at(n, 1), n.m(r.parentNode, r)); }, i(s) { - i || (ct(n), i = !0); + i || (at(n), i = !0); }, o(s) { - It(n), i = !1; + Bt(n), i = !1; }, d(s) { - s && or(r), l[t].d(s); + s && rr(r), l[t].d(s); } }; } -function Eo(e) { +function bo(e) { let t, n = e[0], r = 1; for (; r < e.length; ) { const i = e[r], o = e[r + 1]; @@ -6675,143 +6517,143 @@ function Eo(e) { } return n; } -function Bd(e, t) { +function K0(e, t) { return !e || e === "*" || e === "file/*" ? !0 : (typeof e == "string" && e.endsWith("/*") && (e = e.split(",")), Array.isArray(e) ? e.includes(t) || e.some((n) => { const [r] = n.split("/"); return n.endsWith("/*") && t.startsWith(r + "/"); }) : e === t); } -function Cd(e, t, n) { - let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: u = !0 } = t, { center: s = !0 } = t, { flex: a = !0 } = t, { file_count: f = "single" } = t, { disable_click: d = !1 } = t, { root: c } = t, { hidden: h = !1 } = t, { format: _ = "file" } = t, { uploading: m = !1 } = t, g, p, v; - const b = Ed("upload_files"); - let w; - const y = vd(); - function S() { +function $0(e, t, n) { + let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: u = !0 } = t, { center: s = !0 } = t, { flex: a = !0 } = t, { file_count: f = "single" } = t, { disable_click: d = !1 } = t, { root: c } = t, { hidden: _ = !1 } = t, { format: h = "file" } = t, { uploading: p = !1 } = t, g, m, v; + const w = W0("upload_files"); + let b; + const y = V0(); + function k() { n(17, l = !l); } function C() { - navigator.clipboard.read().then(async (E) => { - for (let M = 0; M < E.length; M++) { - const A = E[M].types.find((F) => F.startsWith("image/")); + navigator.clipboard.read().then(async (S) => { + for (let D = 0; D < S.length; D++) { + const A = S[D].types.find((R) => R.startsWith("image/")); if (A) { - E[M].getType(A).then(async (F) => { - const L = new File([F], `clipboard.${A.replace("image/", "")}`); - await O([L]); + S[D].getType(A).then(async (R) => { + const L = new File([R], `clipboard.${A.replace("image/", "")}`); + await P([L]); }); break; } } }); } - function P() { - d || (n(13, w.value = "", w), w.click()); + function O() { + d || (n(13, b.value = "", b), b.click()); } - async function k(E) { - await yd(), n(10, g = Math.random().toString(36).substring(2, 15)), n(1, m = !0); - const M = await nc(E, c, g, b); - return y("load", f === "single" ? Eo([M, "optionalAccess", (A) => A[0]]) : M), n(1, m = !1), M || []; + async function T(S) { + await X0(), n(10, g = Math.random().toString(36).substring(2, 15)), n(1, p = !0); + const D = await Bf(S, c, g, w); + return y("load", f === "single" ? bo([D, "optionalAccess", (A) => A[0]]) : D), n(1, p = !1), D || []; } - async function O(E) { - if (!E.length) + async function P(S) { + if (!S.length) return; - let M = E.map((A) => new File([A], A.name)); - return n(11, p = await rc(M)), await k(p); - } - async function U(E) { - const M = E.target; - if (M.files) - if (_ != "blob") - await O(Array.from(M.files)); + let D = S.map((A) => new File([A], A.name)); + return n(11, m = await Cf(D)), await T(m); + } + async function M(S) { + const D = S.target; + if (D.files) + if (h != "blob") + await P(Array.from(D.files)); else { if (f === "single") { - y("load", M.files[0]); + y("load", D.files[0]); return; } - y("load", M.files); + y("load", D.files); } } - async function x(E) { - if (n(17, l = !1), !Eo([E, "access", (A) => A.dataTransfer, "optionalAccess", (A) => A.files])) + async function j(S) { + if (n(17, l = !1), !bo([S, "access", (A) => A.dataTransfer, "optionalAccess", (A) => A.files])) return; - const M = Array.from(E.dataTransfer.files).filter((A) => { - const F = "." + A.name.split(".").pop(); - return A.type && Bd(o, A.type) || (F && Array.isArray(o) ? o.includes(F) : F === o) ? !0 : (y("error", `Invalid file type only ${o} allowed.`), !1); + const D = Array.from(S.dataTransfer.files).filter((A) => { + const R = "." + A.name.split(".").pop(); + return A.type && K0(o, A.type) || (R && Array.isArray(o) ? o.includes(R) : R === o) ? !0 : (y("error", `Invalid file type only ${o} allowed.`), !1); }); - await O(M); + await P(D); } - function j(E) { - mt.call(this, e, E); + function q(S) { + _t.call(this, e, S); } - function te(E) { - mt.call(this, e, E); + function ee(S) { + _t.call(this, e, S); } - function ne(E) { - mt.call(this, e, E); + function te(S) { + _t.call(this, e, S); } - function ce(E) { - mt.call(this, e, E); + function fe(S) { + _t.call(this, e, S); } - function me(E) { - mt.call(this, e, E); + function me(S) { + _t.call(this, e, S); } - function _e(E) { - mt.call(this, e, E); + function _e(S) { + _t.call(this, e, S); } - function B(E) { - mt.call(this, e, E); + function B(S) { + _t.call(this, e, S); } - function pe(E) { - dd[E ? "unshift" : "push"](() => { - w = E, n(13, w); + function pe(S) { + R0[S ? "unshift" : "push"](() => { + b = S, n(13, b); }); } - return e.$$set = (E) => { - "filetype" in E && n(0, o = E.filetype), "dragging" in E && n(17, l = E.dragging), "boundedheight" in E && n(2, u = E.boundedheight), "center" in E && n(3, s = E.center), "flex" in E && n(4, a = E.flex), "file_count" in E && n(5, f = E.file_count), "disable_click" in E && n(18, d = E.disable_click), "root" in E && n(6, c = E.root), "hidden" in E && n(7, h = E.hidden), "format" in E && n(19, _ = E.format), "uploading" in E && n(1, m = E.uploading), "$$scope" in E && n(21, i = E.$$scope); + return e.$$set = (S) => { + "filetype" in S && n(0, o = S.filetype), "dragging" in S && n(17, l = S.dragging), "boundedheight" in S && n(2, u = S.boundedheight), "center" in S && n(3, s = S.center), "flex" in S && n(4, a = S.flex), "file_count" in S && n(5, f = S.file_count), "disable_click" in S && n(18, d = S.disable_click), "root" in S && n(6, c = S.root), "hidden" in S && n(7, _ = S.hidden), "format" in S && n(19, h = S.format), "uploading" in S && n(1, p = S.uploading), "$$scope" in S && n(21, i = S.$$scope); }, e.$$.update = () => { e.$$.dirty[0] & /*filetype*/ - 1 && (o == null || typeof o == "string" ? n(12, v = o) : (n(0, o = o.map((E) => E.startsWith(".") ? E : E + "/*")), n(12, v = o.join(", ")))); + 1 && (o == null || typeof o == "string" ? n(12, v = o) : (n(0, o = o.map((S) => S.startsWith(".") ? S : S + "/*")), n(12, v = o.join(", ")))); }, [ o, - m, + p, u, s, a, f, c, - h, + _, C, - P, + O, g, - p, + m, v, - w, - S, - U, - x, + b, + k, + M, + j, l, d, - _, - O, + h, + P, i, r, - j, + q, + ee, te, - ne, - ce, + fe, me, _e, B, pe ]; } -class Id extends cd { +class ed extends M0 { constructor(t) { - super(), md( + super(), G0( this, t, - Cd, - Ad, - bd, + $0, + Y0, + x0, { filetype: 0, dragging: 17, @@ -6842,30 +6684,30 @@ class Id extends cd { return this.$$.ctx[20]; } } -const { setContext: ap, getContext: Ld } = window.__gradio__svelte__internal, Pd = "WORKER_PROXY_CONTEXT_KEY"; -function Ts() { - return Ld(Pd); +const { setContext: Pm, getContext: td } = window.__gradio__svelte__internal, nd = "WORKER_PROXY_CONTEXT_KEY"; +function ws() { + return td(nd); } -function Od(e) { +function rd(e) { return e.host === window.location.host || e.host === "localhost:7860" || e.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 e.host === "lite.local"; } -function As(e, t) { +function vs(e, t) { const n = t.toLowerCase(); for (const [r, i] of Object.entries(e)) if (r.toLowerCase() === n) return i; } -function Bs(e) { +function ys(e) { if (e == null) return !1; const t = new URL(e); - return !(!Od(t) || t.protocol !== "http:" && t.protocol !== "https:"); + return !(!rd(t) || t.protocol !== "http:" && t.protocol !== "https:"); } -async function Hd(e) { - if (e == null || !Bs(e)) +async function id(e) { + if (e == null || !ys(e)) return e; - const t = Ts(); + const t = ws(); if (t == null) return e; const r = new URL(e).pathname; @@ -6878,41 +6720,41 @@ async function Hd(e) { if (i.status !== 200) throw new Error(`Failed to get file ${r} from the Wasm worker.`); const o = new Blob([i.body], { - type: As(i.headers, "content-type") + type: vs(i.headers, "content-type") }); return URL.createObjectURL(o); }); } const { - SvelteComponent: Nd, - assign: Vn, - check_outros: Cs, - compute_rest_props: So, - create_slot: vi, - detach: sr, - element: Is, - empty: Ls, - exclude_internal_props: Md, - get_all_dirty_from_scope: yi, - get_slot_changes: Ei, - get_spread_update: Ps, - group_outros: Os, - init: Dd, - insert: ar, - listen: Hs, - prevent_default: Rd, - safe_not_equal: Ud, - set_attributes: Xn, - transition_in: Lt, - transition_out: Pt, - update_slot_base: Si -} = window.__gradio__svelte__internal, { createEventDispatcher: Fd } = window.__gradio__svelte__internal; -function Gd(e) { + SvelteComponent: od, + assign: xn, + check_outros: Es, + compute_rest_props: wo, + create_slot: gi, + detach: or, + element: Ss, + empty: ks, + exclude_internal_props: ld, + get_all_dirty_from_scope: bi, + get_slot_changes: wi, + get_spread_update: Ts, + group_outros: As, + init: sd, + insert: lr, + listen: Bs, + prevent_default: ad, + safe_not_equal: ud, + set_attributes: zn, + transition_in: Ct, + transition_out: It, + update_slot_base: vi +} = window.__gradio__svelte__internal, { createEventDispatcher: fd } = window.__gradio__svelte__internal; +function cd(e) { let t, n, r, i, o; const l = ( /*#slots*/ e[8].default - ), u = vi( + ), u = gi( l, e, /*$$scope*/ @@ -6936,13 +6778,13 @@ function Gd(e) { e[6] ], a = {}; for (let f = 0; f < s.length; f += 1) - a = Vn(a, s[f]); + a = xn(a, s[f]); return { c() { - t = Is("a"), u && u.c(), Xn(t, a); + t = Ss("a"), u && u.c(), zn(t, a); }, m(f, d) { - ar(f, t, d), u && u.m(t, null), r = !0, i || (o = Hs( + lr(f, t, d), u && u.m(t, null), r = !0, i || (o = Bs( t, "click", /*dispatch*/ @@ -6951,24 +6793,24 @@ function Gd(e) { }, p(f, d) { u && u.p && (!r || d & /*$$scope*/ - 128) && Si( + 128) && vi( u, l, f, /*$$scope*/ f[7], - r ? Ei( + r ? wi( l, /*$$scope*/ f[7], d, null - ) : yi( + ) : bi( /*$$scope*/ f[7] ), null - ), Xn(t, a = Ps(s, [ + ), zn(t, a = Ts(s, [ (!r || d & /*href*/ 1) && { href: ( /*href*/ @@ -6987,19 +6829,19 @@ function Gd(e) { ])); }, i(f) { - r || (Lt(u, f), r = !0); + r || (Ct(u, f), r = !0); }, o(f) { - Pt(u, f), r = !1; + It(u, f), r = !1; }, d(f) { - f && sr(t), u && u.d(f), i = !1, o(); + f && or(t), u && u.d(f), i = !1, o(); } }; } -function qd(e) { +function dd(e) { let t, n, r, i; - const o = [xd, jd], l = []; + const o = [hd, _d], l = []; function u(s, a) { return ( /*is_downloading*/ @@ -7008,34 +6850,34 @@ function qd(e) { } return t = u(e), n = l[t] = o[t](e), { c() { - n.c(), r = Ls(); + n.c(), r = ks(); }, m(s, a) { - l[t].m(s, a), ar(s, r, a), i = !0; + l[t].m(s, a), lr(s, r, a), i = !0; }, p(s, a) { let f = t; - t = u(s), t === f ? l[t].p(s, a) : (Os(), Pt(l[f], 1, 1, () => { + t = u(s), t === f ? l[t].p(s, a) : (As(), It(l[f], 1, 1, () => { l[f] = null; - }), Cs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), Lt(n, 1), n.m(r.parentNode, r)); + }), Es(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), Ct(n, 1), n.m(r.parentNode, r)); }, i(s) { - i || (Lt(n), i = !0); + i || (Ct(n), i = !0); }, o(s) { - Pt(n), i = !1; + It(n), i = !1; }, d(s) { - s && sr(r), l[t].d(s); + s && or(r), l[t].d(s); } }; } -function jd(e) { +function _d(e) { let t, n, r, i; const o = ( /*#slots*/ e[8].default - ), l = vi( + ), l = gi( o, e, /*$$scope*/ @@ -7051,37 +6893,37 @@ function jd(e) { ) } ], s = {}; for (let a = 0; a < u.length; a += 1) - s = Vn(s, u[a]); + s = xn(s, u[a]); return { c() { - t = Is("a"), l && l.c(), Xn(t, s); + t = Ss("a"), l && l.c(), zn(t, s); }, m(a, f) { - ar(a, t, f), l && l.m(t, null), n = !0, r || (i = Hs(t, "click", Rd( + lr(a, t, f), l && l.m(t, null), n = !0, r || (i = Bs(t, "click", ad( /*wasm_click_handler*/ e[5] )), r = !0); }, p(a, f) { l && l.p && (!n || f & /*$$scope*/ - 128) && Si( + 128) && vi( l, o, a, /*$$scope*/ a[7], - n ? Ei( + n ? wi( o, /*$$scope*/ a[7], f, null - ) : yi( + ) : bi( /*$$scope*/ a[7] ), null - ), Xn(t, s = Ps(u, [ + ), zn(t, s = Ts(u, [ f & /*$$restProps*/ 64 && /*$$restProps*/ a[6], @@ -7093,22 +6935,22 @@ function jd(e) { ])); }, i(a) { - n || (Lt(l, a), n = !0); + n || (Ct(l, a), n = !0); }, o(a) { - Pt(l, a), n = !1; + It(l, a), n = !1; }, d(a) { - a && sr(t), l && l.d(a), r = !1, i(); + a && or(t), l && l.d(a), r = !1, i(); } }; } -function xd(e) { +function hd(e) { let t; const n = ( /*#slots*/ e[8].default - ), r = vi( + ), r = gi( n, e, /*$$scope*/ @@ -7124,19 +6966,19 @@ function xd(e) { }, p(i, o) { r && r.p && (!t || o & /*$$scope*/ - 128) && Si( + 128) && vi( r, n, i, /*$$scope*/ i[7], - t ? Ei( + t ? wi( n, /*$$scope*/ i[7], o, null - ) : yi( + ) : bi( /*$$scope*/ i[7] ), @@ -7144,57 +6986,57 @@ function xd(e) { ); }, i(i) { - t || (Lt(r, i), t = !0); + t || (Ct(r, i), t = !0); }, o(i) { - Pt(r, i), t = !1; + It(r, i), t = !1; }, d(i) { r && r.d(i); } }; } -function zd(e) { +function md(e) { let t, n, r, i, o; - const l = [qd, Gd], u = []; + const l = [dd, cd], u = []; function s(a, f) { return f & /*href*/ 1 && (t = null), t == null && (t = !!/*worker_proxy*/ - (a[4] && Bs( + (a[4] && ys( /*href*/ a[0] ))), t ? 0 : 1; } return n = s(e, -1), r = u[n] = l[n](e), { c() { - r.c(), i = Ls(); + r.c(), i = ks(); }, m(a, f) { - u[n].m(a, f), ar(a, i, f), o = !0; + u[n].m(a, f), lr(a, i, f), o = !0; }, p(a, [f]) { let d = n; - n = s(a, f), n === d ? u[n].p(a, f) : (Os(), Pt(u[d], 1, 1, () => { + n = s(a, f), n === d ? u[n].p(a, f) : (As(), It(u[d], 1, 1, () => { u[d] = null; - }), Cs(), r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Lt(r, 1), r.m(i.parentNode, i)); + }), Es(), r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Ct(r, 1), r.m(i.parentNode, i)); }, i(a) { - o || (Lt(r), o = !0); + o || (Ct(r), o = !0); }, o(a) { - Pt(r), o = !1; + It(r), o = !1; }, d(a) { - a && sr(i), u[n].d(a); + a && or(i), u[n].d(a); } }; } -function Vd(e, t, n) { +function pd(e, t, n) { const r = ["href", "download"]; - let i = So(t, r), { $$slots: o = {}, $$scope: l } = t, { href: u = void 0 } = t, { download: s } = t; - const a = Fd(); + let i = wo(t, r), { $$slots: o = {}, $$scope: l } = t, { href: u = void 0 } = t, { download: s } = t; + const a = fd(); let f = !1; - const d = Ts(); + const d = ws(); async function c() { if (f) return; @@ -7202,28 +7044,28 @@ function Vd(e, t, n) { throw new Error("href is not defined."); if (d == null) throw new Error("Wasm worker proxy is not available."); - const _ = new URL(u).pathname; + const h = new URL(u).pathname; n(2, f = !0), d.httpRequest({ method: "GET", - path: _, + path: h, headers: {}, query_string: "" - }).then((m) => { - if (m.status !== 200) - throw new Error(`Failed to get file ${_} from the Wasm worker.`); + }).then((p) => { + if (p.status !== 200) + throw new Error(`Failed to get file ${h} from the Wasm worker.`); const g = new Blob( - [m.body], + [p.body], { - type: As(m.headers, "content-type") + type: vs(p.headers, "content-type") } - ), p = URL.createObjectURL(g), v = document.createElement("a"); - v.href = p, v.download = s, v.click(), URL.revokeObjectURL(p); + ), m = URL.createObjectURL(g), v = document.createElement("a"); + v.href = m, v.download = s, v.click(), URL.revokeObjectURL(m); }).finally(() => { n(2, f = !1); }); } - return e.$$set = (h) => { - t = Vn(Vn({}, t), Md(h)), n(6, i = So(t, r)), "href" in h && n(0, u = h.href), "download" in h && n(1, s = h.download), "$$scope" in h && n(7, l = h.$$scope); + return e.$$set = (_) => { + t = xn(xn({}, t), ld(_)), n(6, i = wo(t, r)), "href" in _ && n(0, u = _.href), "download" in _ && n(1, s = _.download), "$$scope" in _ && n(7, l = _.$$scope); }, [ u, s, @@ -7236,36 +7078,36 @@ function Vd(e, t, n) { o ]; } -class Ns extends Nd { +class Cs extends od { constructor(t) { - super(), Dd(this, t, Vd, zd, Ud, { href: 0, download: 1 }); + super(), sd(this, t, pd, md, ud, { href: 0, download: 1 }); } } const { - SvelteComponent: Xd, - append: Ur, - attr: Wd, - check_outros: Fr, - create_component: gn, - destroy_component: bn, - detach: Zd, - element: Jd, - group_outros: Gr, - init: Qd, - insert: Yd, - mount_component: wn, - safe_not_equal: Kd, - set_style: ko, - space: qr, - toggle_class: To, + SvelteComponent: gd, + append: Dr, + attr: bd, + check_outros: Mr, + create_component: pn, + destroy_component: gn, + detach: wd, + element: vd, + group_outros: Rr, + init: yd, + insert: Ed, + mount_component: bn, + safe_not_equal: Sd, + set_style: vo, + space: Ur, + toggle_class: yo, transition_in: Be, - transition_out: Xe -} = window.__gradio__svelte__internal, { createEventDispatcher: $d } = window.__gradio__svelte__internal; -function Ao(e) { + transition_out: ze +} = window.__gradio__svelte__internal, { createEventDispatcher: kd } = window.__gradio__svelte__internal; +function Eo(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: qu, + Icon: Bu, label: ( /*i18n*/ e[4]("common.edit") @@ -7277,10 +7119,10 @@ function Ao(e) { e[6] ), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7292,18 +7134,18 @@ function Ao(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function Bo(e) { +function So(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: pf, + Icon: tf, label: ( /*i18n*/ e[4]("common.undo") @@ -7315,10 +7157,10 @@ function Bo(e) { e[7] ), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7330,31 +7172,31 @@ function Bo(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function Co(e) { +function ko(e) { let t, n; - return t = new Ns({ + return t = new Cs({ props: { href: ( /*download*/ e[2] ), download: !0, - $$slots: { default: [e_] }, + $$slots: { default: [Td] }, $$scope: { ctx: e } } }), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7367,18 +7209,18 @@ function Co(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function e_(e) { +function Td(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: Nl, + Icon: Cl, label: ( /*i18n*/ e[4]("common.download") @@ -7386,10 +7228,10 @@ function e_(e) { } }), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7401,27 +7243,27 @@ function e_(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function t_(e) { +function Ad(e) { let t, n, r, i, o, l, u = ( /*editable*/ - e[0] && Ao(e) + e[0] && Eo(e) ), s = ( /*undoable*/ - e[1] && Bo(e) + e[1] && So(e) ), a = ( /*download*/ - e[2] && Co(e) + e[2] && ko(e) ); - return o = new Jt({ + return o = new dn({ props: { - Icon: bu, + Icon: du, label: ( /*i18n*/ e[4]("common.clear") @@ -7433,8 +7275,8 @@ function t_(e) { e[8] ), { c() { - t = Jd("div"), u && u.c(), n = qr(), s && s.c(), r = qr(), a && a.c(), i = qr(), gn(o.$$.fragment), Wd(t, "class", "svelte-1wj0ocy"), To(t, "not-absolute", !/*absolute*/ - e[3]), ko( + t = vd("div"), u && u.c(), n = Ur(), s && s.c(), r = Ur(), a && a.c(), i = Ur(), pn(o.$$.fragment), bd(t, "class", "svelte-1wj0ocy"), yo(t, "not-absolute", !/*absolute*/ + e[3]), vo( t, "position", /*absolute*/ @@ -7442,29 +7284,29 @@ function t_(e) { ); }, m(f, d) { - Yd(f, t, d), u && u.m(t, null), Ur(t, n), s && s.m(t, null), Ur(t, r), a && a.m(t, null), Ur(t, i), wn(o, t, null), l = !0; + Ed(f, t, d), u && u.m(t, null), Dr(t, n), s && s.m(t, null), Dr(t, r), a && a.m(t, null), Dr(t, i), bn(o, t, null), l = !0; }, p(f, [d]) { /*editable*/ f[0] ? u ? (u.p(f, d), d & /*editable*/ - 1 && Be(u, 1)) : (u = Ao(f), u.c(), Be(u, 1), u.m(t, n)) : u && (Gr(), Xe(u, 1, 1, () => { + 1 && Be(u, 1)) : (u = Eo(f), u.c(), Be(u, 1), u.m(t, n)) : u && (Rr(), ze(u, 1, 1, () => { u = null; - }), Fr()), /*undoable*/ + }), Mr()), /*undoable*/ f[1] ? s ? (s.p(f, d), d & /*undoable*/ - 2 && Be(s, 1)) : (s = Bo(f), s.c(), Be(s, 1), s.m(t, r)) : s && (Gr(), Xe(s, 1, 1, () => { + 2 && Be(s, 1)) : (s = So(f), s.c(), Be(s, 1), s.m(t, r)) : s && (Rr(), ze(s, 1, 1, () => { s = null; - }), Fr()), /*download*/ + }), Mr()), /*download*/ f[2] ? a ? (a.p(f, d), d & /*download*/ - 4 && Be(a, 1)) : (a = Co(f), a.c(), Be(a, 1), a.m(t, i)) : a && (Gr(), Xe(a, 1, 1, () => { + 4 && Be(a, 1)) : (a = ko(f), a.c(), Be(a, 1), a.m(t, i)) : a && (Rr(), ze(a, 1, 1, () => { a = null; - }), Fr()); + }), Mr()); const c = {}; d & /*i18n*/ 16 && (c.label = /*i18n*/ f[4]("common.clear")), o.$set(c), (!l || d & /*absolute*/ - 8) && To(t, "not-absolute", !/*absolute*/ + 8) && yo(t, "not-absolute", !/*absolute*/ f[3]), d & /*absolute*/ - 8 && ko( + 8 && vo( t, "position", /*absolute*/ @@ -7475,16 +7317,16 @@ function t_(e) { l || (Be(u), Be(s), Be(a), Be(o.$$.fragment, f), l = !0); }, o(f) { - Xe(u), Xe(s), Xe(a), Xe(o.$$.fragment, f), l = !1; + ze(u), ze(s), ze(a), ze(o.$$.fragment, f), l = !1; }, d(f) { - f && Zd(t), u && u.d(), s && s.d(), a && a.d(), bn(o); + f && wd(t), u && u.d(), s && s.d(), a && a.d(), gn(o); } }; } -function n_(e, t, n) { +function Bd(e, t, n) { let { editable: r = !1 } = t, { undoable: i = !1 } = t, { download: o = null } = t, { absolute: l = !0 } = t, { i18n: u } = t; - const s = $d(), a = () => s("edit"), f = () => s("undo"), d = (c) => { + const s = kd(), a = () => s("edit"), f = () => s("undo"), d = (c) => { s("clear"), c.stopPropagation(); }; return e.$$set = (c) => { @@ -7501,9 +7343,9 @@ function n_(e, t, n) { d ]; } -class ki extends Xd { +class yi extends gd { constructor(t) { - super(), Qd(this, t, n_, t_, Kd, { + super(), yd(this, t, Bd, Ad, Sd, { editable: 0, undoable: 1, download: 2, @@ -7513,21 +7355,21 @@ class ki extends Xd { } } const { - SvelteComponent: r_, - assign: fi, - compute_rest_props: Io, - detach: i_, - element: o_, - exclude_internal_props: l_, - get_spread_update: s_, - init: a_, - insert: u_, - noop: Lo, - safe_not_equal: f_, - set_attributes: Po, - src_url_equal: c_ + SvelteComponent: Cd, + assign: si, + compute_rest_props: To, + detach: Id, + element: Ld, + exclude_internal_props: Od, + get_spread_update: Pd, + init: Nd, + insert: Hd, + noop: Ao, + safe_not_equal: Dd, + set_attributes: Bo, + src_url_equal: Md } = window.__gradio__svelte__internal; -function d_(e) { +function Rd(e) { let t, n, r = [ { src: n = /*resolved_src*/ @@ -7537,59 +7379,59 @@ function d_(e) { e[1] ], i = {}; for (let o = 0; o < r.length; o += 1) - i = fi(i, r[o]); + i = si(i, r[o]); return { c() { - t = o_("img"), Po(t, i); + t = Ld("img"), Bo(t, i); }, m(o, l) { - u_(o, t, l); + Hd(o, t, l); }, p(o, [l]) { - Po(t, i = s_(r, [ + Bo(t, i = Pd(r, [ l & /*resolved_src*/ - 1 && !c_(t.src, n = /*resolved_src*/ + 1 && !Md(t.src, n = /*resolved_src*/ o[0]) && { src: n }, l & /*$$restProps*/ 2 && /*$$restProps*/ o[1] ])); }, - i: Lo, - o: Lo, + i: Ao, + o: Ao, d(o) { - o && i_(t); + o && Id(t); } }; } -function __(e, t, n) { +function Ud(e, t, n) { const r = ["src"]; - let i = Io(t, r), { src: o = void 0 } = t, l, u; + let i = To(t, r), { src: o = void 0 } = t, l, u; return e.$$set = (s) => { - t = fi(fi({}, t), l_(s)), n(1, i = Io(t, r)), "src" in s && n(2, o = s.src); + t = si(si({}, t), Od(s)), n(1, i = To(t, r)), "src" in s && n(2, o = s.src); }, e.$$.update = () => { if (e.$$.dirty & /*src, latest_src*/ 12) { n(0, l = o), n(3, u = o); const s = o; - Hd(s).then((a) => { + id(s).then((a) => { u === s && n(0, l = a); }); } }, [l, i, o, u]; } -class Ms extends r_ { +class Is extends Cd { constructor(t) { - super(), a_(this, t, __, d_, f_, { src: 2 }); + super(), Nd(this, t, Ud, Rd, Dd, { src: 2 }); } } -var Oo = Object.prototype.hasOwnProperty; -function Ho(e, t, n) { +var Co = Object.prototype.hasOwnProperty; +function Io(e, t, n) { for (n of e.keys()) - if (ln(n, t)) + if (rn(n, t)) return n; } -function ln(e, t) { +function rn(e, t) { var n, r, i; if (e === t) return !0; @@ -7600,7 +7442,7 @@ function ln(e, t) { return e.toString() === t.toString(); if (n === Array) { if ((r = e.length) === t.length) - for (; r-- && ln(e[r], t[r]); ) + for (; r-- && rn(e[r], t[r]); ) ; return r === -1; } @@ -7608,7 +7450,7 @@ function ln(e, t) { if (e.size !== t.size) return !1; for (r of e) - if (i = r, i && typeof i == "object" && (i = Ho(t, i), !i) || !t.has(i)) + if (i = r, i && typeof i == "object" && (i = Io(t, i), !i) || !t.has(i)) return !1; return !0; } @@ -7616,7 +7458,7 @@ function ln(e, t) { if (e.size !== t.size) return !1; for (r of e) - if (i = r[0], i && typeof i == "object" && (i = Ho(t, i), !i) || !ln(r[1], t.get(i))) + if (i = r[0], i && typeof i == "object" && (i = Io(t, i), !i) || !rn(r[1], t.get(i))) return !1; return !0; } @@ -7637,99 +7479,99 @@ function ln(e, t) { if (!n || typeof e == "object") { r = 0; for (n in e) - if (Oo.call(e, n) && ++r && !Oo.call(t, n) || !(n in t) || !ln(e[n], t[n])) + if (Co.call(e, n) && ++r && !Co.call(t, n) || !(n in t) || !rn(e[n], t[n])) return !1; return Object.keys(t).length === r; } } return e !== e && t !== t; } -function h_(e) { +function Fd(e) { return Object.prototype.toString.call(e) === "[object Object]"; } -function No(e) { - return h_(e) || Array.isArray(e); +function Lo(e) { + return Fd(e) || Array.isArray(e); } -function m_() { +function Gd() { return !!(typeof window < "u" && window.document && window.document.createElement); } -function Ti(e, t) { +function Ei(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; const i = JSON.stringify(Object.keys(e.breakpoints || {})), o = JSON.stringify(Object.keys(t.breakpoints || {})); return i !== o ? !1 : n.every((l) => { const u = e[l], s = t[l]; - return typeof u == "function" ? `${u}` == `${s}` : !No(u) || !No(s) ? u === s : Ti(u, s); + return typeof u == "function" ? `${u}` == `${s}` : !Lo(u) || !Lo(s) ? u === s : Ei(u, s); }); } -function Mo(e) { +function Oo(e) { return e.concat().sort((t, n) => t.name > n.name ? 1 : -1).map((t) => t.options); } -function p_(e, t) { +function qd(e, t) { if (e.length !== t.length) return !1; - const n = Mo(e), r = Mo(t); + const n = Oo(e), r = Oo(t); return n.every((i, o) => { const l = r[o]; - return Ti(i, l); + return Ei(i, l); }); } -function Ai(e) { +function Si(e) { return typeof e == "number"; } -function ci(e) { +function ai(e) { return typeof e == "string"; } -function Bi(e) { +function ki(e) { return typeof e == "boolean"; } -function Do(e) { +function Po(e) { return Object.prototype.toString.call(e) === "[object Object]"; } -function ue(e) { +function ae(e) { return Math.abs(e); } -function Ci(e) { +function Ti(e) { return Math.sign(e); } -function sn(e, t) { - return ue(e - t); +function on(e, t) { + return ae(e - t); } -function g_(e, t) { - if (e === 0 || t === 0 || ue(e) <= ue(t)) +function jd(e, t) { + if (e === 0 || t === 0 || ae(e) <= ae(t)) return 0; - const n = sn(ue(e), ue(t)); - return ue(n / e); + const n = on(ae(e), ae(t)); + return ae(n / e); } -function fn(e) { - return cn(e).map(Number); +function an(e) { + return un(e).map(Number); } -function Ze(e) { - return e[vn(e)]; +function Ve(e) { + return e[wn(e)]; } -function vn(e) { +function wn(e) { return Math.max(0, e.length - 1); } -function Ii(e, t) { - return t === vn(e); +function Ai(e, t) { + return t === wn(e); } -function Ro(e, t = 0) { +function No(e, t = 0) { return Array.from(Array(e), (n, r) => t + r); } -function cn(e) { +function un(e) { return Object.keys(e); } -function Ds(e, t) { - return [e, t].reduce((n, r) => (cn(r).forEach((i) => { - const o = n[i], l = r[i], u = Do(o) && Do(l); - n[i] = u ? Ds(o, l) : l; +function Ls(e, t) { + return [e, t].reduce((n, r) => (un(r).forEach((i) => { + const o = n[i], l = r[i], u = Po(o) && Po(l); + n[i] = u ? Ls(o, l) : l; }), n), {}); } -function Rs(e, t) { +function Os(e, t) { return typeof t.MouseEvent < "u" && e instanceof t.MouseEvent; } -function b_(e, t) { +function xd(e, t) { const n = { start: r, center: i, @@ -7745,13 +7587,13 @@ function b_(e, t) { return t - s; } function l(s, a) { - return ci(e) ? n[e](s) : e(t, s, a); + return ai(e) ? n[e](s) : e(t, s, a); } return { measure: l }; } -function dn() { +function fn() { let e = []; function t(i, o, l, u = { passive: !0 @@ -7774,44 +7616,44 @@ function dn() { }; return r; } -function w_(e, t, n, r) { - const i = dn(), o = 1e3 / 60; +function zd(e, t, n, r) { + const i = fn(), o = 1e3 / 60; let l = null, u = 0, s = 0; function a() { i.add(e, "visibilitychange", () => { - e.hidden && _(); + e.hidden && h(); }); } function f() { - h(), i.clear(); + _(), i.clear(); } function d(g) { l || (l = g); - const p = g - l; - for (l = g, u += p; u >= o; ) + const m = g - l; + for (l = g, u += m; u >= o; ) n(), u -= o; - const v = ue(u / o); + const v = ae(u / o); r(v), s && t.requestAnimationFrame(d); } function c() { s || (s = t.requestAnimationFrame(d)); } - function h() { + function _() { t.cancelAnimationFrame(s), l = null, u = 0, s = 0; } - function _() { + function h() { l = null, u = 0; } return { init: a, destroy: f, start: c, - stop: h, + stop: _, update: n, render: r }; } -function v_(e, t) { +function Vd(e, t) { const n = e === "y" ? "y" : "x", r = e === "y" ? "x" : "y", i = u(), o = s(); function l(f) { const { @@ -7834,8 +7676,8 @@ function v_(e, t) { measureSize: l }; } -function Ot(e = 0, t = 0) { - const n = ue(e - t); +function Lt(e = 0, t = 0) { + const n = ae(e - t); function r(a) { return a < e; } @@ -7862,13 +7704,13 @@ function Ot(e = 0, t = 0) { removeOffset: u }; } -function Us(e, t, n) { +function Ps(e, t, n) { const { constrain: r - } = Ot(0, e), i = e + 1; + } = Lt(0, e), i = e + 1; let o = l(t); function l(c) { - return n ? ue((i + c) % i) : r(c); + return n ? ae((i + c) % i) : r(c); } function u() { return o; @@ -7880,7 +7722,7 @@ function Us(e, t, n) { return f().set(u() + c); } function f() { - return Us(e, u(), n); + return Ps(e, u(), n); } const d = { get: u, @@ -7890,7 +7732,7 @@ function Us(e, t, n) { }; return d; } -function y_(e) { +function Xd(e) { const t = e === "rtl" ? -1 : 1; function n(i) { return i * t; @@ -7899,96 +7741,96 @@ function y_(e) { apply: n }; } -function E_(e, t, n, r, i, o, l, u, s, a, f, d, c, h, _, m, g, p, v, b) { +function Wd(e, t, n, r, i, o, l, u, s, a, f, d, c, _, h, p, g, m, v, w) { const { - cross: w - } = e, y = ["INPUT", "SELECT", "TEXTAREA"], S = { + cross: b + } = e, y = ["INPUT", "SELECT", "TEXTAREA"], k = { passive: !1 - }, C = dn(), P = dn(), k = Ot(50, 225).constrain(_.measure(20)), O = { + }, C = fn(), O = fn(), T = Lt(50, 225).constrain(h.measure(20)), P = { mouse: 300, touch: 400 - }, U = { + }, M = { mouse: 500, touch: 600 - }, x = m ? 43 : 25; - let j = !1, te = 0, ne = 0, ce = !1, me = !1, _e = !1, B = !1; + }, j = p ? 43 : 25; + let q = !1, ee = 0, te = 0, fe = !1, me = !1, _e = !1, B = !1; function pe(I) { - if (!b) + if (!w) return; - function N(Y) { - (Bi(b) || b(I, Y)) && re(Y); + function H(oe) { + (ki(w) || w(I, oe)) && ne(oe); } - const Q = n; - C.add(Q, "dragstart", (Y) => Y.preventDefault(), S).add(Q, "touchmove", () => { - }, S).add(Q, "touchend", () => { - }).add(Q, "touchstart", N).add(Q, "mousedown", N).add(Q, "touchcancel", ee).add(Q, "contextmenu", ee).add(Q, "click", T, !0); + const Z = n; + C.add(Z, "dragstart", (oe) => oe.preventDefault(), k).add(Z, "touchmove", () => { + }, k).add(Z, "touchend", () => { + }).add(Z, "touchstart", H).add(Z, "mousedown", H).add(Z, "touchcancel", z).add(Z, "contextmenu", z).add(Z, "click", K, !0); } - function E() { - C.clear(), P.clear(); + function S() { + C.clear(), O.clear(); } - function M() { + function D() { const I = B ? r : n; - P.add(I, "touchmove", z, S).add(I, "touchend", ee).add(I, "mousemove", z, S).add(I, "mouseup", ee); + O.add(I, "touchmove", E, k).add(I, "touchend", z).add(I, "mousemove", E, k).add(I, "mouseup", z); } function A(I) { - const N = I.nodeName || ""; - return y.includes(N); + const H = I.nodeName || ""; + return y.includes(H); } - function F() { - return (m ? U : O)[B ? "mouse" : "touch"]; + function R() { + return (p ? M : P)[B ? "mouse" : "touch"]; } - function L(I, N) { - const Q = c.add(Ci(I) * -1), Y = d.byDistance(I, !m).distance; - return m || ue(I) < k ? Y : p && N ? Y * 0.5 : d.byIndex(Q.get(), 0).distance; + function L(I, H) { + const Z = c.add(Ti(I) * -1), oe = d.byDistance(I, !p).distance; + return p || ae(I) < T ? oe : m && H ? oe * 0.5 : d.byIndex(Z.get(), 0).distance; } - function re(I) { - const N = Rs(I, i); - B = N, !(N && I.button !== 0) && (A(I.target) || (_e = m && N && !I.buttons && j, j = sn(o.get(), u.get()) >= 2, ce = !0, l.pointerDown(I), f.useFriction(0).useDuration(0), o.set(u), M(), te = l.readPoint(I), ne = l.readPoint(I, w), h.emit("pointerDown"))); + function ne(I) { + const H = Os(I, i); + B = H, !(H && I.button !== 0) && (A(I.target) || (_e = p && H && !I.buttons && q, q = on(o.get(), u.get()) >= 2, fe = !0, l.pointerDown(I), f.useFriction(0).useDuration(0), o.set(u), D(), ee = l.readPoint(I), te = l.readPoint(I, b), _.emit("pointerDown"))); } - function z(I) { - const N = l.readPoint(I), Q = l.readPoint(I, w), Y = sn(N, te), R = sn(Q, ne); - if (!me && !B && (!I.cancelable || (me = Y > R, !me))) - return ee(I); + function E(I) { + const H = l.readPoint(I), Z = l.readPoint(I, b), oe = on(H, ee), x = on(Z, te); + if (!me && !B && (!I.cancelable || (me = oe > x, !me))) + return z(I); const Te = l.pointerMove(I); - Y > g && (_e = !0), f.useFriction(0.3).useDuration(1), s.start(), o.add(t.apply(Te)), I.preventDefault(); + oe > g && (_e = !0), f.useFriction(0.3).useDuration(1), s.start(), o.add(t.apply(Te)), I.preventDefault(); } - function ee(I) { - const Q = d.byDistance(0, !1).index !== c.get(), Y = l.pointerUp(I) * F(), R = L(t.apply(Y), Q), Te = g_(Y, R), He = x - 10 * Te, Ie = v + Te / 50; - me = !1, ce = !1, P.clear(), f.useDuration(He).useFriction(Ie), a.distance(R, !m), B = !1, h.emit("pointerUp"); + function z(I) { + const Z = d.byDistance(0, !1).index !== c.get(), oe = l.pointerUp(I) * R(), x = L(t.apply(oe), Z), Te = jd(oe, x), Ne = j - 10 * Te, Ie = v + Te / 50; + me = !1, fe = !1, O.clear(), f.useDuration(Ne).useFriction(Ie), a.distance(x, !p), B = !1, _.emit("pointerUp"); } - function T(I) { + function K(I) { _e && (I.stopPropagation(), I.preventDefault()); } - function H() { - return ce; + function N() { + return fe; } return { init: pe, - pointerDown: H, - destroy: E + pointerDown: N, + destroy: S }; } -function S_(e, t) { +function Zd(e, t) { let r, i; function o(d) { return d.timeStamp; } function l(d, c) { - const _ = `client${(c || e.scroll) === "x" ? "X" : "Y"}`; - return (Rs(d, t) ? d : d.touches[0])[_]; + const h = `client${(c || e.scroll) === "x" ? "X" : "Y"}`; + return (Os(d, t) ? d : d.touches[0])[h]; } function u(d) { return r = d, i = d, l(d); } function s(d) { - const c = l(d) - l(i), h = o(d) - o(r) > 170; - return i = d, h && (r = d), c; + const c = l(d) - l(i), _ = o(d) - o(r) > 170; + return i = d, _ && (r = d), c; } function a(d) { if (!r || !i) return 0; - const c = l(i) - l(r), h = o(d) - o(r), _ = o(d) - o(i) > 170, m = c / h; - return h && !_ && ue(m) > 0.1 ? m : 0; + const c = l(i) - l(r), _ = o(d) - o(r), h = o(d) - o(i) > 170, p = c / _; + return _ && !h && ae(p) > 0.1 ? p : 0; } return { pointerDown: u, @@ -7997,7 +7839,7 @@ function S_(e, t) { readPoint: l }; } -function k_() { +function Jd() { function e(n) { const { offsetTop: r, @@ -8018,7 +7860,7 @@ function k_() { measure: e }; } -function T_(e) { +function Qd(e) { function t(r) { return e * (r / 100); } @@ -8026,120 +7868,120 @@ function T_(e) { measure: t }; } -function A_(e, t, n, r, i, o, l) { +function Yd(e, t, n, r, i, o, l) { let u, s, a = [], f = !1; - function d(m) { - return i.measureSize(l.measure(m)); + function d(p) { + return i.measureSize(l.measure(p)); } - function c(m) { + function c(p) { if (!o) return; s = d(e), a = r.map(d); function g(v) { - for (const b of v) { - const w = b.target === e, y = r.indexOf(b.target), S = w ? s : a[y], C = d(w ? e : r[y]); - if (ue(C - S) >= 0.5) { + for (const w of v) { + const b = w.target === e, y = r.indexOf(w.target), k = b ? s : a[y], C = d(b ? e : r[y]); + if (ae(C - k) >= 0.5) { n.requestAnimationFrame(() => { - m.reInit(), t.emit("resize"); + p.reInit(), t.emit("resize"); }); break; } } } u = new ResizeObserver((v) => { - f || (Bi(o) || o(m, v)) && g(v); + f || (ki(o) || o(p, v)) && g(v); }), [e].concat(r).forEach((v) => u.observe(v)); } - function h() { + function _() { u && u.disconnect(), f = !0; } return { init: c, - destroy: h + destroy: _ }; } -function B_(e, t, n, r, i) { +function Kd(e, t, n, r, i) { let o = 0, l = 0, u = r, s = i, a = e.get(), f = 0; function d() { - const y = n.get() - e.get(), S = !u; + const y = n.get() - e.get(), k = !u; let C = 0; - return S ? (o = 0, e.set(n), C = y) : (o += y / u, o *= s, a += o, e.add(o), C = a - f), l = Ci(C), f = a, w; + return k ? (o = 0, e.set(n), C = y) : (o += y / u, o *= s, a += o, e.add(o), C = a - f), l = Ti(C), f = a, b; } function c() { const y = n.get() - t.get(); - return ue(y) < 1e-3; + return ae(y) < 1e-3; } - function h() { + function _() { return u; } - function _() { + function h() { return l; } - function m() { + function p() { return o; } function g() { return v(r); } - function p() { - return b(i); + function m() { + return w(i); } function v(y) { - return u = y, w; + return u = y, b; } - function b(y) { - return s = y, w; + function w(y) { + return s = y, b; } - const w = { - direction: _, - duration: h, - velocity: m, + const b = { + direction: h, + duration: _, + velocity: p, seek: d, settled: c, - useBaseFriction: p, + useBaseFriction: m, useBaseDuration: g, - useFriction: b, + useFriction: w, useDuration: v }; - return w; + return b; } -function C_(e, t, n, r, i) { - const o = i.measure(10), l = i.measure(50), u = Ot(0.1, 0.99); +function $d(e, t, n, r, i) { + const o = i.measure(10), l = i.measure(50), u = Lt(0.1, 0.99); let s = !1; function a() { return !(s || !e.reachedAny(n.get()) || !e.reachedAny(t.get())); } - function f(h) { + function f(_) { if (!a()) return; - const _ = e.reachedMin(t.get()) ? "min" : "max", m = ue(e[_] - t.get()), g = n.get() - t.get(), p = u.constrain(m / l); - n.subtract(g * p), !h && ue(g) < o && (n.set(e.constrain(n.get())), r.useDuration(25).useBaseFriction()); + const h = e.reachedMin(t.get()) ? "min" : "max", p = ae(e[h] - t.get()), g = n.get() - t.get(), m = u.constrain(p / l); + n.subtract(g * m), !_ && ae(g) < o && (n.set(e.constrain(n.get())), r.useDuration(25).useBaseFriction()); } - function d(h) { - s = !h; + function d(_) { + s = !_; } return { constrain: f, toggleActive: d }; } -function I_(e, t, n, r, i) { - const o = Ot(-t + e, 0), l = d(), u = f(), s = c(); - function a(_, m) { - return sn(_, m) < 1; +function e_(e, t, n, r, i) { + const o = Lt(-t + e, 0), l = d(), u = f(), s = c(); + function a(h, p) { + return on(h, p) < 1; } function f() { - const _ = l[0], m = Ze(l), g = l.lastIndexOf(_), p = l.indexOf(m) + 1; - return Ot(g, p); + const h = l[0], p = Ve(l), g = l.lastIndexOf(h), m = l.indexOf(p) + 1; + return Lt(g, m); } function d() { - return n.map((_, m) => { + return n.map((h, p) => { const { min: g, - max: p - } = o, v = o.constrain(_), b = !m, w = Ii(n, m); - return b ? p : w || a(g, v) ? g : a(p, v) ? p : v; - }).map((_) => parseFloat(_.toFixed(3))); + max: m + } = o, v = o.constrain(h), w = !p, b = Ai(n, p); + return w ? m : b || a(g, v) ? g : a(m, v) ? m : v; + }).map((h) => parseFloat(h.toFixed(3))); } function c() { if (t <= e + i) @@ -8147,41 +7989,41 @@ function I_(e, t, n, r, i) { if (r === "keepSnaps") return l; const { - min: _, - max: m + min: h, + max: p } = u; - return l.slice(_, m); + return l.slice(h, p); } return { snapsContained: s, scrollContainLimit: u }; } -function L_(e, t, n) { - const r = t[0], i = n ? r - e : Ze(t); +function t_(e, t, n) { + const r = t[0], i = n ? r - e : Ve(t); return { - limit: Ot(i, r) + limit: Lt(i, r) }; } -function P_(e, t, n, r) { +function n_(e, t, n, r) { const o = t.min + 0.1, l = t.max + 0.1, { reachedMin: u, reachedMax: s - } = Ot(o, l); + } = Lt(o, l); function a(c) { return c === 1 ? s(n.get()) : c === -1 ? u(n.get()) : !1; } function f(c) { if (!a(c)) return; - const h = e * (c * -1); - r.forEach((_) => _.add(h)); + const _ = e * (c * -1); + r.forEach((h) => h.add(_)); } return { loop: f }; } -function O_(e) { +function r_(e) { const { max: t, length: n @@ -8194,28 +8036,28 @@ function O_(e) { get: r }; } -function H_(e, t, n, r, i) { +function i_(e, t, n, r, i) { const { startEdge: o, endEdge: l } = e, { groupSlides: u - } = i, s = d().map(t.measure), a = c(), f = h(); + } = i, s = d().map(t.measure), a = c(), f = _(); function d() { - return u(r).map((m) => Ze(m)[l] - m[0][o]).map(ue); + return u(r).map((p) => Ve(p)[l] - p[0][o]).map(ae); } function c() { - return r.map((m) => n[o] - m[o]).map((m) => -ue(m)); + return r.map((p) => n[o] - p[o]).map((p) => -ae(p)); } - function h() { - return u(a).map((m) => m[0]).map((m, g) => m + s[g]); + function _() { + return u(a).map((p) => p[0]).map((p, g) => p + s[g]); } return { snaps: a, snapsAligned: f }; } -function N_(e, t, n, r, i, o) { +function o_(e, t, n, r, i, o) { const { groupSlides: l } = i, { @@ -8223,74 +8065,74 @@ function N_(e, t, n, r, i, o) { max: s } = r, a = f(); function f() { - const c = l(o), h = !e || t === "keepSnaps"; - return n.length === 1 ? [o] : h ? c : c.slice(u, s).map((_, m, g) => { - const p = !m, v = Ii(g, m); - if (p) { - const b = Ze(g[0]) + 1; - return Ro(b); + const c = l(o), _ = !e || t === "keepSnaps"; + return n.length === 1 ? [o] : _ ? c : c.slice(u, s).map((h, p, g) => { + const m = !p, v = Ai(g, p); + if (m) { + const w = Ve(g[0]) + 1; + return No(w); } if (v) { - const b = vn(o) - Ze(g)[0] + 1; - return Ro(b, Ze(g)[0]); + const w = wn(o) - Ve(g)[0] + 1; + return No(w, Ve(g)[0]); } - return _; + return h; }); } return { slideRegistry: a }; } -function M_(e, t, n, r, i) { +function l_(e, t, n, r, i) { const { reachedAny: o, removeOffset: l, constrain: u } = r; - function s(_) { - return _.concat().sort((m, g) => ue(m) - ue(g))[0]; + function s(h) { + return h.concat().sort((p, g) => ae(p) - ae(g))[0]; } - function a(_) { - const m = e ? l(_) : u(_), g = t.map((v) => v - m).map((v) => f(v, 0)).map((v, b) => ({ + function a(h) { + const p = e ? l(h) : u(h), g = t.map((v) => v - p).map((v) => f(v, 0)).map((v, w) => ({ diff: v, - index: b - })).sort((v, b) => ue(v.diff) - ue(b.diff)), { - index: p + index: w + })).sort((v, w) => ae(v.diff) - ae(w.diff)), { + index: m } = g[0]; return { - index: p, - distance: m + index: m, + distance: p }; } - function f(_, m) { - const g = [_, _ + n, _ - n]; + function f(h, p) { + const g = [h, h + n, h - n]; if (!e) return g[0]; - if (!m) + if (!p) return s(g); - const p = g.filter((v) => Ci(v) === m); - return p.length ? s(p) : Ze(g) - n; + const m = g.filter((v) => Ti(v) === p); + return m.length ? s(m) : Ve(g) - n; } - function d(_, m) { - const g = t[_] - i.get(), p = f(g, m); + function d(h, p) { + const g = t[h] - i.get(), m = f(g, p); return { - index: _, - distance: p + index: h, + distance: m }; } - function c(_, m) { - const g = i.get() + _, { - index: p, + function c(h, p) { + const g = i.get() + h, { + index: m, distance: v - } = a(g), b = !e && o(g); - if (!m || b) + } = a(g), w = !e && o(g); + if (!p || w) return { - index: p, - distance: _ + index: m, + distance: h }; - const w = t[p] - v, y = _ + f(w, 0); + const b = t[m] - v, y = h + f(b, 0); return { - index: p, + index: m, distance: y }; } @@ -8300,25 +8142,25 @@ function M_(e, t, n, r, i) { shortcut: f }; } -function D_(e, t, n, r, i, o, l) { +function s_(e, t, n, r, i, o, l) { function u(d) { - const c = d.distance, h = d.index !== t.get(); - o.add(c), c && (r.duration() ? e.start() : (e.update(), e.render(1), e.update())), h && (n.set(t.get()), t.set(d.index), l.emit("select")); + const c = d.distance, _ = d.index !== t.get(); + o.add(c), c && (r.duration() ? e.start() : (e.update(), e.render(1), e.update())), _ && (n.set(t.get()), t.set(d.index), l.emit("select")); } function s(d, c) { - const h = i.byDistance(d, c); - u(h); + const _ = i.byDistance(d, c); + u(_); } function a(d, c) { - const h = t.clone().set(d), _ = i.byIndex(h.get(), c); - u(_); + const _ = t.clone().set(d), h = i.byIndex(_.get(), c); + u(h); } return { distance: s, index: a }; } -function R_(e, t, n, r, i, o) { +function a_(e, t, n, r, i, o) { let l = 0; function u() { o.add(document, "keydown", s, !1), t.forEach(a); @@ -8331,8 +8173,8 @@ function R_(e, t, n, r, i, o) { if ((/* @__PURE__ */ new Date()).getTime() - l > 10) return; e.scrollLeft = 0; - const m = t.indexOf(d), g = n.findIndex((p) => p.includes(m)); - Ai(g) && (i.useDuration(0), r.index(g, 0)); + const p = t.indexOf(d), g = n.findIndex((m) => m.includes(p)); + Si(g) && (i.useDuration(0), r.index(g, 0)); }; o.add(d, "focus", c, { passive: !0, @@ -8343,7 +8185,7 @@ function R_(e, t, n, r, i, o) { init: u }; } -function Fn(e) { +function Rn(e) { let t = e; function n() { return t; @@ -8358,7 +8200,7 @@ function Fn(e) { t -= l(s); } function l(s) { - return Ai(s) ? s : s.get(); + return Si(s) ? s : s.get(); } return { get: n, @@ -8367,7 +8209,7 @@ function Fn(e) { subtract: o }; } -function Fs(e, t, n) { +function Ns(e, t, n) { const r = e.scroll === "x" ? l : u, i = n.style; let o = !1; function l(c) { @@ -8391,70 +8233,70 @@ function Fs(e, t, n) { toggleActive: a }; } -function U_(e, t, n, r, i, o, l, u, s, a) { - const d = fn(o), c = fn(o).reverse(), h = v().concat(b()); - function _(P, k) { - return P.reduce((O, U) => O - o[U], k); +function u_(e, t, n, r, i, o, l, u, s, a) { + const d = an(o), c = an(o).reverse(), _ = v().concat(w()); + function h(O, T) { + return O.reduce((P, M) => P - o[M], T); } - function m(P, k) { - return P.reduce((O, U) => _(O, k) > 0 ? O.concat([U]) : O, []); + function p(O, T) { + return O.reduce((P, M) => h(P, T) > 0 ? P.concat([M]) : P, []); } - function g(P) { - return l.map((k, O) => ({ - start: k - i[O] + 0.5 + P, - end: k + n - 0.5 + P + function g(O) { + return l.map((T, P) => ({ + start: T - i[P] + 0.5 + O, + end: T + n - 0.5 + O })); } - function p(P, k, O) { - const U = g(k); - return P.map((x) => { - const j = O ? 0 : -r, te = O ? r : 0, ne = O ? "end" : "start", ce = U[x][ne]; + function m(O, T, P) { + const M = g(T); + return O.map((j) => { + const q = P ? 0 : -r, ee = P ? r : 0, te = P ? "end" : "start", fe = M[j][te]; return { - index: x, - loopPoint: ce, - slideLocation: Fn(-1), - translate: Fs(e, t, a[x]), - target: () => s.get() > ce ? j : te + index: j, + loopPoint: fe, + slideLocation: Rn(-1), + translate: Ns(e, t, a[j]), + target: () => s.get() > fe ? q : ee }; }); } function v() { - const P = u[0], k = m(c, P); - return p(k, r, !1); - } - function b() { - const P = n - u[0] - 1, k = m(d, P); - return p(k, -r, !0); + const O = u[0], T = p(c, O); + return m(T, r, !1); } function w() { - return h.every(({ - index: P + const O = n - u[0] - 1, T = p(d, O); + return m(T, -r, !0); + } + function b() { + return _.every(({ + index: O }) => { - const k = d.filter((O) => O !== P); - return _(k, n) <= 0.1; + const T = d.filter((P) => P !== O); + return h(T, n) <= 0.1; }); } function y() { - h.forEach((P) => { + _.forEach((O) => { const { - target: k, - translate: O, - slideLocation: U - } = P, x = k(); - x !== U.get() && (O.to(x), U.set(x)); + target: T, + translate: P, + slideLocation: M + } = O, j = T(); + j !== M.get() && (P.to(j), M.set(j)); }); } - function S() { - h.forEach((P) => P.translate.clear()); + function k() { + _.forEach((O) => O.translate.clear()); } return { - canLoop: w, - clear: S, + canLoop: b, + clear: k, loop: y, - loopPoints: h + loopPoints: _ }; } -function F_(e, t, n) { +function f_(e, t, n) { let r, i = !1; function o(s) { if (!n) @@ -8467,7 +8309,7 @@ function F_(e, t, n) { } } r = new MutationObserver((f) => { - i || (Bi(n) || n(s, f)) && a(f); + i || (ki(n) || n(s, f)) && a(f); }), r.observe(e, { childList: !0 }); @@ -8480,38 +8322,38 @@ function F_(e, t, n) { destroy: l }; } -function G_(e, t, n, r) { +function c_(e, t, n, r) { const i = {}; let o = null, l = null, u, s = !1; function a() { - u = new IntersectionObserver((_) => { - s || (_.forEach((m) => { - const g = t.indexOf(m.target); - i[g] = m; + u = new IntersectionObserver((h) => { + s || (h.forEach((p) => { + const g = t.indexOf(p.target); + i[g] = p; }), o = null, l = null, n.emit("slidesInView")); }, { root: e.parentElement, threshold: r - }), t.forEach((_) => u.observe(_)); + }), t.forEach((h) => u.observe(h)); } function f() { u && u.disconnect(), s = !0; } - function d(_) { - return cn(i).reduce((m, g) => { - const p = parseInt(g), { + function d(h) { + return un(i).reduce((p, g) => { + const m = parseInt(g), { isIntersecting: v - } = i[p]; - return (_ && v || !_ && !v) && m.push(p), m; + } = i[m]; + return (h && v || !h && !v) && p.push(m), p; }, []); } - function c(_ = !0) { - if (_ && o) + function c(h = !0) { + if (h && o) return o; - if (!_ && l) + if (!h && l) return l; - const m = d(_); - return _ && (o = m), _ || (l = m), m; + const p = d(h); + return h && (o = p), h || (l = p), p; } return { init: a, @@ -8519,62 +8361,62 @@ function G_(e, t, n, r) { get: c }; } -function q_(e, t, n, r, i, o) { +function d_(e, t, n, r, i, o) { const { measureSize: l, startEdge: u, endEdge: s - } = e, a = n[0] && i, f = _(), d = m(), c = n.map(l), h = g(); - function _() { + } = e, a = n[0] && i, f = h(), d = p(), c = n.map(l), _ = g(); + function h() { if (!a) return 0; const v = n[0]; - return ue(t[u] - v[u]); + return ae(t[u] - v[u]); } - function m() { + function p() { if (!a) return 0; - const v = o.getComputedStyle(Ze(r)); + const v = o.getComputedStyle(Ve(r)); return parseFloat(v.getPropertyValue(`margin-${s}`)); } function g() { - return n.map((v, b, w) => { - const y = !b, S = Ii(w, b); - return y ? c[b] + f : S ? c[b] + d : w[b + 1][u] - v[u]; - }).map(ue); + return n.map((v, w, b) => { + const y = !w, k = Ai(b, w); + return y ? c[w] + f : k ? c[w] + d : b[w + 1][u] - v[u]; + }).map(ae); } return { slideSizes: c, - slideSizesWithGaps: h, + slideSizesWithGaps: _, startGap: f, endGap: d }; } -function j_(e, t, n, r, i, o, l, u, s, a) { +function __(e, t, n, r, i, o, l, u, s, a) { const { startEdge: f, endEdge: d - } = e, c = Ai(r); - function h(p, v) { - return fn(p).filter((b) => b % v === 0).map((b) => p.slice(b, b + v)); - } - function _(p) { - return p.length ? fn(p).reduce((v, b) => { - const w = Ze(v) || 0, y = w === 0, S = b === vn(p), C = o[f] - l[w][f], P = o[f] - l[b][d], k = !i && y ? t.apply(u) : 0, O = !i && S ? t.apply(s) : 0; - return ue(P - O - (C + k)) > n + a && v.push(b), S && v.push(p.length), v; - }, []).map((v, b, w) => { - const y = Math.max(w[b - 1] || 0); - return p.slice(y, v); + } = e, c = Si(r); + function _(m, v) { + return an(m).filter((w) => w % v === 0).map((w) => m.slice(w, w + v)); + } + function h(m) { + return m.length ? an(m).reduce((v, w) => { + const b = Ve(v) || 0, y = b === 0, k = w === wn(m), C = o[f] - l[b][f], O = o[f] - l[w][d], T = !i && y ? t.apply(u) : 0, P = !i && k ? t.apply(s) : 0; + return ae(O - P - (C + T)) > n + a && v.push(w), k && v.push(m.length), v; + }, []).map((v, w, b) => { + const y = Math.max(b[w - 1] || 0); + return m.slice(y, v); }) : []; } - function m(p) { - return c ? h(p, r) : _(p); + function p(m) { + return c ? _(m, r) : h(m); } return { - groupSlides: m + groupSlides: p }; } -function x_(e, t, n, r, i, o, l) { +function h_(e, t, n, r, i, o, l) { const { align: u, axis: s, @@ -8582,95 +8424,95 @@ function x_(e, t, n, r, i, o, l) { startIndex: f, loop: d, duration: c, - dragFree: h, - dragThreshold: _, - inViewThreshold: m, + dragFree: _, + dragThreshold: h, + inViewThreshold: p, slidesToScroll: g, - skipSnaps: p, + skipSnaps: m, containScroll: v, - watchResize: b, - watchSlides: w, + watchResize: w, + watchSlides: b, watchDrag: y - } = o, S = 2, C = k_(), P = C.measure(t), k = n.map(C.measure), O = y_(a), U = v_(s, a), x = U.measureSize(P), j = T_(x), te = b_(u, x), ne = !d && !!v, ce = d || !!v, { + } = o, k = 2, C = Jd(), O = C.measure(t), T = n.map(C.measure), P = Xd(a), M = Vd(s, a), j = M.measureSize(O), q = Qd(j), ee = xd(u, j), te = !d && !!v, fe = d || !!v, { slideSizes: me, slideSizesWithGaps: _e, startGap: B, endGap: pe - } = q_(U, P, k, n, ce, i), E = j_(U, O, x, g, d, P, k, B, pe, S), { - snaps: M, + } = d_(M, O, T, n, fe, i), S = __(M, P, j, g, d, O, T, B, pe, k), { + snaps: D, snapsAligned: A - } = H_(U, te, P, k, E), F = -Ze(M) + Ze(_e), { + } = i_(M, ee, O, T, S), R = -Ve(D) + Ve(_e), { snapsContained: L, - scrollContainLimit: re - } = I_(x, F, A, v, S), z = ne ? L : A, { - limit: ee - } = L_(F, z, d), T = Us(vn(z), f, d), H = T.clone(), D = fn(n), I = ({ + scrollContainLimit: ne + } = e_(j, R, A, v, k), E = te ? L : A, { + limit: z + } = t_(R, E, d), K = Ps(wn(E), f, d), N = K.clone(), U = an(n), I = ({ dragHandler: Ae, - scrollBody: $t, - scrollBounds: cr, + scrollBody: Kt, + scrollBounds: ur, options: { - loop: kn + loop: Sn } }) => { - kn || cr.constrain(Ae.pointerDown()), $t.seek(); - }, N = ({ + Sn || ur.constrain(Ae.pointerDown()), Kt.seek(); + }, H = ({ scrollBody: Ae, - translate: $t, - location: cr, - offsetLocation: kn, - scrollLooper: Ys, - slideLooper: Ks, - dragHandler: $s, - animation: ea, - eventHandler: Oi, + translate: Kt, + location: ur, + offsetLocation: Sn, + scrollLooper: Vs, + slideLooper: Xs, + dragHandler: Ws, + animation: Zs, + eventHandler: Ii, options: { - loop: ta + loop: Js } - }, na) => { - const Hi = Ae.velocity(), Ni = Ae.settled(); - Ni && !$s.pointerDown() && (ea.stop(), Oi.emit("settle")), Ni || Oi.emit("scroll"), kn.set(cr.get() - Hi + Hi * na), ta && (Ys.loop(Ae.direction()), Ks.loop()), $t.to(kn.get()); - }, Q = w_(r, i, () => I(Z), (Ae) => N(Z, Ae)), Y = 0.68, R = z[T.get()], Te = Fn(R), He = Fn(R), Ie = Fn(R), $e = B_(Te, He, Ie, c, Y), de = M_(d, z, F, ee, Ie), we = D_(Q, T, H, $e, de, Ie, l), oe = O_(ee), se = dn(), Le = G_(t, n, l, m), { + }, Qs) => { + const Li = Ae.velocity(), Oi = Ae.settled(); + Oi && !Ws.pointerDown() && (Zs.stop(), Ii.emit("settle")), Oi || Ii.emit("scroll"), Sn.set(ur.get() - Li + Li * Qs), Js && (Vs.loop(Ae.direction()), Xs.loop()), Kt.to(Sn.get()); + }, Z = zd(r, i, () => I(J), (Ae) => H(J, Ae)), oe = 0.68, x = E[K.get()], Te = Rn(x), Ne = Rn(x), Ie = Rn(x), $e = Kd(Te, Ne, Ie, c, oe), ce = l_(d, E, R, z, Ie), we = s_(Z, K, N, $e, ce, Ie, l), re = r_(z), le = fn(), Le = c_(t, n, l, p), { slideRegistry: ge - } = N_(ne, v, z, re, E, D), K = R_(e, n, ge, we, $e, se), Z = { + } = o_(te, v, E, ne, S, U), Q = a_(e, n, ge, we, $e, le), J = { ownerDocument: r, ownerWindow: i, eventHandler: l, - containerRect: P, - slideRects: k, - animation: Q, - axis: U, - direction: O, - dragHandler: E_(U, O, e, r, i, Ie, S_(U, i), Te, Q, we, $e, de, T, l, j, h, _, p, Y, y), - eventStore: se, - percentOfView: j, - index: T, - indexPrevious: H, - limit: ee, + containerRect: O, + slideRects: T, + animation: Z, + axis: M, + direction: P, + dragHandler: Wd(M, P, e, r, i, Ie, Zd(M, i), Te, Z, we, $e, ce, K, l, q, _, h, m, oe, y), + eventStore: le, + percentOfView: q, + index: K, + indexPrevious: N, + limit: z, location: Te, - offsetLocation: He, + offsetLocation: Ne, options: o, - resizeHandler: A_(t, l, i, n, U, b, C), + resizeHandler: Yd(t, l, i, n, M, w, C), scrollBody: $e, - scrollBounds: C_(ee, Te, Ie, $e, j), - scrollLooper: P_(F, ee, He, [Te, He, Ie]), - scrollProgress: oe, - scrollSnapList: z.map(oe.get), - scrollSnaps: z, - scrollTarget: de, + scrollBounds: $d(z, Te, Ie, $e, q), + scrollLooper: n_(R, z, Ne, [Te, Ne, Ie]), + scrollProgress: re, + scrollSnapList: E.map(re.get), + scrollSnaps: E, + scrollTarget: ce, scrollTo: we, - slideLooper: U_(U, O, x, F, me, _e, M, z, He, n), - slideFocus: K, - slidesHandler: F_(t, l, w), + slideLooper: u_(M, P, j, R, me, _e, D, E, Ne, n), + slideFocus: Q, + slidesHandler: f_(t, l, b), slidesInView: Le, - slideIndexes: D, + slideIndexes: U, slideRegistry: ge, - slidesToScroll: E, + slidesToScroll: S, target: Ie, - translate: Fs(U, O, t) + translate: Ns(M, P, t) }; - return Z; + return J; } -function z_() { +function m_() { const e = {}; let t; function n(s) { @@ -8696,7 +8538,7 @@ function z_() { }; return u; } -const V_ = { +const p_ = { align: "center", axis: "x", container: null, @@ -8717,16 +8559,16 @@ const V_ = { watchResize: !0, watchSlides: !0 }; -function X_(e) { +function g_(e) { function t(o, l) { - return Ds(o, l || {}); + return Ls(o, l || {}); } function n(o) { - const l = o.breakpoints || {}, u = cn(l).filter((s) => e.matchMedia(s).matches).map((s) => l[s]).reduce((s, a) => t(s, a), {}); + const l = o.breakpoints || {}, u = un(l).filter((s) => e.matchMedia(s).matches).map((s) => l[s]).reduce((s, a) => t(s, a), {}); return t(o, u); } function r(o) { - return o.map((l) => cn(l.breakpoints || {})).reduce((l, u) => l.concat(u), []).map(e.matchMedia); + return o.map((l) => un(l.breakpoints || {})).reduce((l, u) => l.concat(u), []).map(e.matchMedia); } return { mergeOptions: t, @@ -8734,7 +8576,7 @@ function X_(e) { optionsMediaQueries: r }; } -function W_(e) { +function b_(e) { let t = []; function n(o, l) { return t = l.filter(({ @@ -8751,148 +8593,148 @@ function W_(e) { destroy: r }; } -function Wn(e, t, n) { - const r = e.ownerDocument, i = r.defaultView, o = X_(i), l = W_(o), u = dn(), s = z_(), { +function Vn(e, t, n) { + const r = e.ownerDocument, i = r.defaultView, o = g_(i), l = b_(o), u = fn(), s = m_(), { mergeOptions: a, optionsAtMedia: f, optionsMediaQueries: d } = o, { on: c, - off: h, - emit: _ - } = s, m = U; - let g = !1, p, v = a(V_, Wn.globalOptions), b = a(v), w = [], y, S, C; - function P() { + off: _, + emit: h + } = s, p = M; + let g = !1, m, v = a(p_, Vn.globalOptions), w = a(v), b = [], y, k, C; + function O() { const { - container: D, + container: U, slides: I - } = b; - S = (ci(D) ? e.querySelector(D) : D) || e.children[0]; - const Q = ci(I) ? S.querySelectorAll(I) : I; - C = [].slice.call(Q || S.children); - } - function k(D) { - const I = x_(e, S, C, r, i, D, s); - if (D.loop && !I.slideLooper.canLoop()) { - const N = Object.assign({}, D, { + } = w; + k = (ai(U) ? e.querySelector(U) : U) || e.children[0]; + const Z = ai(I) ? k.querySelectorAll(I) : I; + C = [].slice.call(Z || k.children); + } + function T(U) { + const I = h_(e, k, C, r, i, U, s); + if (U.loop && !I.slideLooper.canLoop()) { + const H = Object.assign({}, U, { loop: !1 }); - return k(N); + return T(H); } return I; } - function O(D, I) { - g || (v = a(v, D), b = f(v), w = I || w, P(), p = k(b), d([v, ...w.map(({ - options: N - }) => N)]).forEach((N) => u.add(N, "change", U)), b.active && (p.translate.to(p.location.get()), p.animation.init(), p.slidesInView.init(), p.slideFocus.init(), p.eventHandler.init(H), p.resizeHandler.init(H), p.slidesHandler.init(H), p.options.loop && p.slideLooper.loop(), S.offsetParent && C.length && p.dragHandler.init(H), y = l.init(H, w))); + function P(U, I) { + g || (v = a(v, U), w = f(v), b = I || b, O(), m = T(w), d([v, ...b.map(({ + options: H + }) => H)]).forEach((H) => u.add(H, "change", M)), w.active && (m.translate.to(m.location.get()), m.animation.init(), m.slidesInView.init(), m.slideFocus.init(), m.eventHandler.init(N), m.resizeHandler.init(N), m.slidesHandler.init(N), m.options.loop && m.slideLooper.loop(), k.offsetParent && C.length && m.dragHandler.init(N), y = l.init(N, b))); } - function U(D, I) { - const N = E(); - x(), O(a({ - startIndex: N - }, D), I), s.emit("reInit"); - } - function x() { - p.dragHandler.destroy(), p.eventStore.clear(), p.translate.clear(), p.slideLooper.clear(), p.resizeHandler.destroy(), p.slidesHandler.destroy(), p.slidesInView.destroy(), p.animation.destroy(), l.destroy(), u.clear(); + function M(U, I) { + const H = S(); + j(), P(a({ + startIndex: H + }, U), I), s.emit("reInit"); } function j() { - g || (g = !0, u.clear(), x(), s.emit("destroy")); + m.dragHandler.destroy(), m.eventStore.clear(), m.translate.clear(), m.slideLooper.clear(), m.resizeHandler.destroy(), m.slidesHandler.destroy(), m.slidesInView.destroy(), m.animation.destroy(), l.destroy(), u.clear(); + } + function q() { + g || (g = !0, u.clear(), j(), s.emit("destroy")); } - function te(D, I, N) { - !b.active || g || (p.scrollBody.useBaseFriction().useDuration(I === !0 ? 0 : b.duration), p.scrollTo.index(D, N || 0)); + function ee(U, I, H) { + !w.active || g || (m.scrollBody.useBaseFriction().useDuration(I === !0 ? 0 : w.duration), m.scrollTo.index(U, H || 0)); } - function ne(D) { - const I = p.index.add(1).get(); - te(I, D, -1); + function te(U) { + const I = m.index.add(1).get(); + ee(I, U, -1); } - function ce(D) { - const I = p.index.add(-1).get(); - te(I, D, 1); + function fe(U) { + const I = m.index.add(-1).get(); + ee(I, U, 1); } function me() { - return p.index.add(1).get() !== E(); + return m.index.add(1).get() !== S(); } function _e() { - return p.index.add(-1).get() !== E(); + return m.index.add(-1).get() !== S(); } function B() { - return p.scrollSnapList; + return m.scrollSnapList; } function pe() { - return p.scrollProgress.get(p.location.get()); + return m.scrollProgress.get(m.location.get()); } - function E() { - return p.index.get(); + function S() { + return m.index.get(); } - function M() { - return p.indexPrevious.get(); + function D() { + return m.indexPrevious.get(); } function A() { - return p.slidesInView.get(); + return m.slidesInView.get(); } - function F() { - return p.slidesInView.get(!1); + function R() { + return m.slidesInView.get(!1); } function L() { return y; } - function re() { - return p; + function ne() { + return m; } - function z() { + function E() { return e; } - function ee() { - return S; + function z() { + return k; } - function T() { + function K() { return C; } - const H = { + const N = { canScrollNext: me, canScrollPrev: _e, - containerNode: ee, - internalEngine: re, - destroy: j, - off: h, + containerNode: z, + internalEngine: ne, + destroy: q, + off: _, on: c, - emit: _, + emit: h, plugins: L, - previousScrollSnap: M, - reInit: m, - rootNode: z, - scrollNext: ne, - scrollPrev: ce, + previousScrollSnap: D, + reInit: p, + rootNode: E, + scrollNext: te, + scrollPrev: fe, scrollProgress: pe, scrollSnapList: B, - scrollTo: te, - selectedScrollSnap: E, - slideNodes: T, + scrollTo: ee, + selectedScrollSnap: S, + slideNodes: K, slidesInView: A, - slidesNotInView: F + slidesNotInView: R }; - return O(t, n), setTimeout(() => s.emit("init"), 0), H; + return P(t, n), setTimeout(() => s.emit("init"), 0), N; } -Wn.globalOptions = void 0; -function Li(e, t = { +Vn.globalOptions = void 0; +function Bi(e, t = { options: {}, plugins: [] }) { let n = t, r; - return m_() && (Wn.globalOptions = Li.globalOptions, r = Wn(e, n.options, n.plugins), r.on("init", () => e.dispatchEvent(new CustomEvent("emblaInit", { + return Gd() && (Vn.globalOptions = Bi.globalOptions, r = Vn(e, n.options, n.plugins), r.on("init", () => e.dispatchEvent(new CustomEvent("emblaInit", { detail: r })))), { destroy: () => { r && r.destroy(); }, update: (i) => { - const o = !Ti(n.options, i.options), l = !p_(n.plugins, i.plugins); + const o = !Ei(n.options, i.options), l = !qd(n.plugins, i.plugins); !o && !l || (n = i, r && r.reInit(n.options, n.plugins)); } }; } -Li.globalOptions = void 0; -const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { +Bi.globalOptions = void 0; +const w_ = 4.2, v_ = (e, t, n) => Math.min(Math.max(e, t), n), y_ = (e) => { const t = e.internalEngine(), n = e.scrollProgress(); return e.scrollSnapList().map((r, i) => { if (!e.slidesInView().includes(i)) @@ -8905,14 +8747,14 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { a === -1 && (o = r - (1 + n)), a === 1 && (o = r + (1 - n)); } }); - const l = 1 - Math.abs(o * Z_); - return J_(l, 0, 1); + const l = 1 - Math.abs(o * w_); + return v_(l, 0, 1); }); -}, Y_ = (e) => { +}, E_ = (e) => { const t = e.slideNodes(); return { applyTweenOpacity: () => { - Q_(e).forEach((o, l) => { + y_(e).forEach((o, l) => { t[l].style.opacity = o.toString(); }); }, @@ -8920,7 +8762,7 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { t.forEach((i) => i.removeAttribute("style")); } }; -}, K_ = { +}, S_ = { active: !0, breakpoints: {}, delay: 4e3, @@ -8932,26 +8774,26 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { stopOnLastSnap: !1, rootNode: null }; -function Pi(e = {}) { +function Ci(e = {}) { let t, n, r, i = !1, o = !0, l = !1, u = 0, s = 0; - function a(w, y) { - n = w; + function a(b, y) { + n = b; const { - mergeOptions: S, + mergeOptions: k, optionsAtMedia: C - } = y, P = S(K_, Pi.globalOptions), k = S(P, e); - if (t = C(k), n.scrollSnapList().length <= 1) + } = y, O = k(S_, Ci.globalOptions), T = k(O, e); + if (t = C(T), n.scrollSnapList().length <= 1) return; l = t.jump, r = !1; const { - eventStore: O, - ownerDocument: U - } = n.internalEngine(), x = n.rootNode(), j = t.rootNode && t.rootNode(x) || x, te = n.containerNode(); - n.on("pointerDown", c), t.stopOnInteraction || n.on("pointerUp", d), t.stopOnMouseEnter && (O.add(j, "mouseenter", () => { + eventStore: P, + ownerDocument: M + } = n.internalEngine(), j = n.rootNode(), q = t.rootNode && t.rootNode(j) || j, ee = n.containerNode(); + n.on("pointerDown", c), t.stopOnInteraction || n.on("pointerUp", d), t.stopOnMouseEnter && (P.add(q, "mouseenter", () => { o = !1, c(); - }), t.stopOnInteraction || O.add(j, "mouseleave", () => { + }), t.stopOnInteraction || P.add(q, "mouseleave", () => { o = !0, d(); - })), t.stopOnFocusIn && (O.add(te, "focusin", c), t.stopOnInteraction || O.add(te, "focusout", d)), O.add(U, "visibilitychange", h), t.playOnInit && n.on("init", d).on("reInit", d); + })), t.stopOnFocusIn && (P.add(ee, "focusin", c), t.stopOnInteraction || P.add(ee, "focusout", d)), P.add(M, "visibilitychange", _), t.playOnInit && n.on("init", d).on("reInit", d); } function f() { r = !0, i = !1, n.off("init", d).off("reInit", d).off("pointerDown", c).off("pointerUp", d), c(), cancelAnimationFrame(u), u = 0; @@ -8961,45 +8803,45 @@ function Pi(e = {}) { return; i || n.emit("autoplay:play"); const { - ownerWindow: w + ownerWindow: b } = n.internalEngine(); - w.clearInterval(s), s = w.setInterval(v, t.delay), i = !0; + b.clearInterval(s), s = b.setInterval(v, t.delay), i = !0; } function c() { if (r) return; i && n.emit("autoplay:stop"); const { - ownerWindow: w + ownerWindow: b } = n.internalEngine(); - w.clearInterval(s), s = 0, i = !1; + b.clearInterval(s), s = 0, i = !1; } - function h() { + function _() { const { - ownerDocument: w + ownerDocument: b } = n.internalEngine(); - if (w.visibilityState === "hidden") + if (b.visibilityState === "hidden") return o = i, c(); o && d(); } - function _(w) { - typeof w < "u" && (l = w), o = !0, d(); + function h(b) { + typeof b < "u" && (l = b), o = !0, d(); } - function m() { + function p() { i && c(); } function g() { - i && _(); + i && h(); } - function p() { + function m() { return i; } function v() { u = requestAnimationFrame(() => { const { - index: w - } = n.internalEngine(), y = w.clone().add(1).get(), S = n.scrollSnapList().length - 1; - t.stopOnLastSnap && y === S && c(), n.canScrollNext() ? n.scrollNext(l) : n.scrollTo(0, l); + index: b + } = n.internalEngine(), y = b.clone().add(1).get(), k = n.scrollSnapList().length - 1; + t.stopOnLastSnap && y === k && c(), n.canScrollNext() ? n.scrollNext(l) : n.scrollTo(0, l); }); } return { @@ -9007,68 +8849,62 @@ function Pi(e = {}) { options: e, init: a, destroy: f, - play: _, - stop: m, + play: h, + stop: p, reset: g, - isPlaying: p + isPlaying: m }; } -Pi.globalOptions = void 0; -async function $_(e) { - return e ? `
${(await Promise.all( - e.map(async ([n, r]) => n === null || !n.url ? "" : await Af(n.url, "url")) - )).map((n) => ``).join("")}
` : ""; -} +Ci.globalOptions = void 0; const { - SvelteComponent: eh, - action_destroyer: th, - add_render_callback: nh, + SvelteComponent: k_, + action_destroyer: T_, + add_render_callback: A_, append: be, attr: ie, - binding_callbacks: Uo, - bubble: Fo, - check_outros: dt, - create_component: nt, - destroy_component: rt, - destroy_each: Gs, - detach: Ue, - element: Se, - empty: rh, - ensure_array_like: Zn, - globals: ih, - group_outros: _t, - init: oh, - insert: Fe, + binding_callbacks: Ho, + check_outros: Ot, + create_component: ut, + destroy_component: ft, + destroy_each: Hs, + detach: Xe, + element: ke, + empty: B_, + ensure_array_like: Xn, + globals: C_, + group_outros: Pt, + init: I_, + insert: We, listen: Xt, - mount_component: it, - run_all: qs, - safe_not_equal: lh, - set_data: js, - set_style: Go, - space: We, - src_url_equal: qo, - text: xs, - toggle_class: Jn, - transition_in: J, - transition_out: le -} = window.__gradio__svelte__internal, { window: zs } = ih, { createEventDispatcher: sh, getContext: ah } = window.__gradio__svelte__internal, { tick: uh } = window.__gradio__svelte__internal; -function jo(e, t, n) { + mount_component: ct, + run_all: Ds, + safe_not_equal: L_, + set_data: Ms, + set_style: Do, + space: Qe, + src_url_equal: Mo, + text: Rs, + toggle_class: Wn, + transition_in: $, + transition_out: de +} = window.__gradio__svelte__internal, { window: Us } = C_, { createEventDispatcher: O_, getContext: P_ } = window.__gradio__svelte__internal, { tick: N_ } = window.__gradio__svelte__internal; +function Ro(e, t, n) { const r = e.slice(); - return r[42] = t[n], r[44] = n, r; + return r[40] = t[n], r[42] = n, r; } -function xo(e, t, n) { +function Uo(e, t, n) { const r = e.slice(); - return r[45] = t[n], r[46] = t, r[44] = n, r; + return r[43] = t[n], r[44] = t, r[42] = n, r; } -function zo(e) { +function Fo(e) { let t, n; - return t = new Pl({ + return t = new Tl({ props: { show_label: ( /*show_label*/ e[2] ), - Icon: Ml, + Icon: Il, label: ( /*label*/ e[3] || "Gallery" @@ -9076,10 +8912,10 @@ function zo(e) { } }), { c() { - nt(t.$$.fragment); + ut(t.$$.fragment); }, m(r, i) { - it(t, r, i), n = !0; + ct(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -9090,192 +8926,192 @@ function zo(e) { r[3] || "Gallery"), t.$set(o); }, i(r) { - n || (J(t.$$.fragment, r), n = !0); + n || ($(t.$$.fragment, r), n = !0); }, o(r) { - le(t.$$.fragment, r), n = !1; + de(t.$$.fragment, r), n = !1; }, d(r) { - rt(t, r); + ft(t, r); } }; } -function fh(e) { +function H_(e) { let t, n, r, i, o, l, u, s = ( /*selected_image*/ - e[13] && /*allow_preview*/ - e[4] && Vo(e) - ), a = Zn( + e[12] && /*allow_preview*/ + e[4] && Go(e) + ), a = Xn( /*resolved_value*/ - e[9] + e[8] ), f = []; for (let c = 0; c < a.length; c += 1) - f[c] = Ko(jo(e, a, c)); - const d = (c) => le(f[c], 1, 1, () => { + f[c] = Xo(Ro(e, a, c)); + const d = (c) => de(f[c], 1, 1, () => { f[c] = null; }); return { c() { - s && s.c(), t = We(), n = Se("div"), r = Se("div"), i = Se("div"); + s && s.c(), t = Qe(), n = ke("div"), r = ke("div"), i = ke("div"); for (let c = 0; c < f.length; c += 1) f[c].c(); ie(i, "class", "embla__container svelte-a675k2"), ie(r, "class", "embla__viewport svelte-a675k2"), ie(n, "class", "embla svelte-a675k2"); }, - m(c, h) { - s && s.m(c, h), Fe(c, t, h), Fe(c, n, h), be(n, r), be(r, i); - for (let _ = 0; _ < f.length; _ += 1) - f[_] && f[_].m(i, null); + m(c, _) { + s && s.m(c, _), We(c, t, _), We(c, n, _), be(n, r), be(r, i); + for (let h = 0; h < f.length; h += 1) + f[h] && f[h].m(i, null); o = !0, l || (u = [ - th(Li.call(null, r, { + T_(Bi.call(null, r, { options: ( /*options*/ - e[14] + e[13] ), - plugins: [Pi({ delay: 2e3 })] + plugins: [Ci({ delay: 2e3 })] })), Xt( r, "emblaInit", /*onInit*/ - e[15] + e[14] ) ], l = !0); }, - p(c, h) { + p(c, _) { if (/*selected_image*/ - c[13] && /*allow_preview*/ - c[4] ? s ? (s.p(c, h), h[0] & /*selected_image, allow_preview*/ - 8208 && J(s, 1)) : (s = Vo(c), s.c(), J(s, 1), s.m(t.parentNode, t)) : s && (_t(), le(s, 1, 1, () => { + c[12] && /*allow_preview*/ + c[4] ? s ? (s.p(c, _), _[0] & /*selected_image, allow_preview*/ + 4112 && $(s, 1)) : (s = Go(c), s.c(), $(s, 1), s.m(t.parentNode, t)) : s && (Pt(), de(s, 1, 1, () => { s = null; - }), dt()), h[0] & /*resolved_value, selected_index, i18n, show_share_button, value, interactive*/ - 931) { - a = Zn( + }), Ot()), _[0] & /*resolved_value, selected_index, i18n, value, interactive*/ + 451) { + a = Xn( /*resolved_value*/ - c[9] + c[8] ); - let _; - for (_ = 0; _ < a.length; _ += 1) { - const m = jo(c, a, _); - f[_] ? (f[_].p(m, h), J(f[_], 1)) : (f[_] = Ko(m), f[_].c(), J(f[_], 1), f[_].m(i, null)); + let h; + for (h = 0; h < a.length; h += 1) { + const p = Ro(c, a, h); + f[h] ? (f[h].p(p, _), $(f[h], 1)) : (f[h] = Xo(p), f[h].c(), $(f[h], 1), f[h].m(i, null)); } - for (_t(), _ = a.length; _ < f.length; _ += 1) - d(_); - dt(); + for (Pt(), h = a.length; h < f.length; h += 1) + d(h); + Ot(); } }, i(c) { if (!o) { - J(s); - for (let h = 0; h < a.length; h += 1) - J(f[h]); + $(s); + for (let _ = 0; _ < a.length; _ += 1) + $(f[_]); o = !0; } }, o(c) { - le(s), f = f.filter(Boolean); - for (let h = 0; h < f.length; h += 1) - le(f[h]); + de(s), f = f.filter(Boolean); + for (let _ = 0; _ < f.length; _ += 1) + de(f[_]); o = !1; }, d(c) { - c && (Ue(t), Ue(n)), s && s.d(c), Gs(f, c), l = !1, qs(u); + c && (Xe(t), Xe(n)), s && s.d(c), Hs(f, c), l = !1, Ds(u); } }; } -function ch(e) { +function D_(e) { let t, n; - return t = new cu({ + return t = new ou({ props: { unpadded_box: !0, size: "large", - $$slots: { default: [dh] }, + $$slots: { default: [M_] }, $$scope: { ctx: e } } }), { c() { - nt(t.$$.fragment); + ut(t.$$.fragment); }, m(r, i) { - it(t, r, i), n = !0; + ct(t, r, i), n = !0; }, p(r, i) { const o = {}; i[1] & /*$$scope*/ - 65536 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o); + 16384 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o); }, i(r) { - n || (J(t.$$.fragment, r), n = !0); + n || ($(t.$$.fragment, r), n = !0); }, o(r) { - le(t.$$.fragment, r), n = !1; + de(t.$$.fragment, r), n = !1; }, d(r) { - rt(t, r); + ft(t, r); } }; } -function Vo(e) { - var b; - let t, n, r, i, o, l, u, s, a, f, d, c, h, _ = ( +function Go(e) { + var w; + let t, n, r, i, o, l, u, s, a, f, d, c, _, h = ( /*show_download_button*/ - e[6] && Xo(e) + e[5] && qo(e) ); - i = new ki({ + i = new yi({ props: { i18n: ( /*i18n*/ - e[7] + e[6] ), absolute: !1 } }), i.$on( "clear", /*clear_handler*/ e[28] - ), u = new Ms({ + ), u = new Is({ props: { "data-testid": "detailed-image", src: ( /*selected_image*/ - e[13].image.url + e[12].image.url ), alt: ( /*selected_image*/ - e[13].caption || "" + e[12].caption || "" ), title: ( /*selected_image*/ - e[13].caption || null + e[12].caption || null ), class: ( /*selected_image*/ - e[13].caption && "with-caption" + e[12].caption && "with-caption" ), loading: "lazy" } }); - let m = ( + let p = ( /*selected_image*/ - ((b = e[13]) == null ? void 0 : b.caption) && Wo(e) - ), g = Zn( + ((w = e[12]) == null ? void 0 : w.caption) && jo(e) + ), g = Xn( /*resolved_value*/ - e[9] - ), p = []; - for (let w = 0; w < g.length; w += 1) - p[w] = Zo(xo(e, g, w)); - const v = (w) => le(p[w], 1, 1, () => { - p[w] = null; + e[8] + ), m = []; + for (let b = 0; b < g.length; b += 1) + m[b] = xo(Uo(e, g, b)); + const v = (b) => de(m[b], 1, 1, () => { + m[b] = null; }); return { c() { - t = Se("button"), n = Se("div"), _ && _.c(), r = We(), nt(i.$$.fragment), o = We(), l = Se("button"), nt(u.$$.fragment), s = We(), m && m.c(), a = We(), f = Se("div"); - for (let w = 0; w < p.length; w += 1) - p[w].c(); - ie(n, "class", "icon-buttons svelte-a675k2"), ie(l, "class", "image-button svelte-a675k2"), Go(l, "height", "calc(100% - " + /*selected_image*/ - (e[13].caption ? "80px" : "60px") + ")"), ie(l, "aria-label", "detailed view of selected image"), ie(f, "class", "thumbnails scroll-hide svelte-a675k2"), ie(f, "data-testid", "container_el"), ie(t, "class", "preview svelte-a675k2"); - }, - m(w, y) { - Fe(w, t, y), be(t, n), _ && _.m(n, null), be(n, r), it(i, n, null), be(t, o), be(t, l), it(u, l, null), be(t, s), m && m.m(t, null), be(t, a), be(t, f); - for (let S = 0; S < p.length; S += 1) - p[S] && p[S].m(f, null); - e[32](f), d = !0, c || (h = [ + t = ke("button"), n = ke("div"), h && h.c(), r = Qe(), ut(i.$$.fragment), o = Qe(), l = ke("button"), ut(u.$$.fragment), s = Qe(), p && p.c(), a = Qe(), f = ke("div"); + for (let b = 0; b < m.length; b += 1) + m[b].c(); + ie(n, "class", "icon-buttons svelte-a675k2"), ie(l, "class", "image-button svelte-a675k2"), Do(l, "height", "calc(100% - " + /*selected_image*/ + (e[12].caption ? "80px" : "60px") + ")"), ie(l, "aria-label", "detailed view of selected image"), ie(f, "class", "thumbnails scroll-hide svelte-a675k2"), ie(f, "data-testid", "container_el"), ie(t, "class", "preview svelte-a675k2"); + }, + m(b, y) { + We(b, t, y), be(t, n), h && h.m(n, null), be(n, r), ct(i, n, null), be(t, o), be(t, l), ct(u, l, null), be(t, s), p && p.m(t, null), be(t, a), be(t, f); + for (let k = 0; k < m.length; k += 1) + m[k] && m[k].m(f, null); + e[32](f), d = !0, c || (_ = [ Xt( l, "click", @@ -9286,76 +9122,76 @@ function Vo(e) { t, "keydown", /*on_keydown*/ - e[17] + e[16] ) ], c = !0); }, - p(w, y) { - var P; + p(b, y) { + var O; /*show_download_button*/ - w[6] ? _ ? (_.p(w, y), y[0] & /*show_download_button*/ - 64 && J(_, 1)) : (_ = Xo(w), _.c(), J(_, 1), _.m(n, r)) : _ && (_t(), le(_, 1, 1, () => { - _ = null; - }), dt()); - const S = {}; + b[5] ? h ? (h.p(b, y), y[0] & /*show_download_button*/ + 32 && $(h, 1)) : (h = qo(b), h.c(), $(h, 1), h.m(n, r)) : h && (Pt(), de(h, 1, 1, () => { + h = null; + }), Ot()); + const k = {}; y[0] & /*i18n*/ - 128 && (S.i18n = /*i18n*/ - w[7]), i.$set(S); + 64 && (k.i18n = /*i18n*/ + b[6]), i.$set(k); const C = {}; if (y[0] & /*selected_image*/ - 8192 && (C.src = /*selected_image*/ - w[13].image.url), y[0] & /*selected_image*/ - 8192 && (C.alt = /*selected_image*/ - w[13].caption || ""), y[0] & /*selected_image*/ - 8192 && (C.title = /*selected_image*/ - w[13].caption || null), y[0] & /*selected_image*/ - 8192 && (C.class = /*selected_image*/ - w[13].caption && "with-caption"), u.$set(C), (!d || y[0] & /*selected_image*/ - 8192) && Go(l, "height", "calc(100% - " + /*selected_image*/ - (w[13].caption ? "80px" : "60px") + ")"), /*selected_image*/ - (P = w[13]) != null && P.caption ? m ? m.p(w, y) : (m = Wo(w), m.c(), m.m(t, a)) : m && (m.d(1), m = null), y[0] & /*resolved_value, el, selected_index*/ - 1538) { - g = Zn( + 4096 && (C.src = /*selected_image*/ + b[12].image.url), y[0] & /*selected_image*/ + 4096 && (C.alt = /*selected_image*/ + b[12].caption || ""), y[0] & /*selected_image*/ + 4096 && (C.title = /*selected_image*/ + b[12].caption || null), y[0] & /*selected_image*/ + 4096 && (C.class = /*selected_image*/ + b[12].caption && "with-caption"), u.$set(C), (!d || y[0] & /*selected_image*/ + 4096) && Do(l, "height", "calc(100% - " + /*selected_image*/ + (b[12].caption ? "80px" : "60px") + ")"), /*selected_image*/ + (O = b[12]) != null && O.caption ? p ? p.p(b, y) : (p = jo(b), p.c(), p.m(t, a)) : p && (p.d(1), p = null), y[0] & /*resolved_value, el, selected_index*/ + 770) { + g = Xn( /*resolved_value*/ - w[9] + b[8] ); - let k; - for (k = 0; k < g.length; k += 1) { - const O = xo(w, g, k); - p[k] ? (p[k].p(O, y), J(p[k], 1)) : (p[k] = Zo(O), p[k].c(), J(p[k], 1), p[k].m(f, null)); + let T; + for (T = 0; T < g.length; T += 1) { + const P = Uo(b, g, T); + m[T] ? (m[T].p(P, y), $(m[T], 1)) : (m[T] = xo(P), m[T].c(), $(m[T], 1), m[T].m(f, null)); } - for (_t(), k = g.length; k < p.length; k += 1) - v(k); - dt(); + for (Pt(), T = g.length; T < m.length; T += 1) + v(T); + Ot(); } }, - i(w) { + i(b) { if (!d) { - J(_), J(i.$$.fragment, w), J(u.$$.fragment, w); + $(h), $(i.$$.fragment, b), $(u.$$.fragment, b); for (let y = 0; y < g.length; y += 1) - J(p[y]); + $(m[y]); d = !0; } }, - o(w) { - le(_), le(i.$$.fragment, w), le(u.$$.fragment, w), p = p.filter(Boolean); - for (let y = 0; y < p.length; y += 1) - le(p[y]); + o(b) { + de(h), de(i.$$.fragment, b), de(u.$$.fragment, b), m = m.filter(Boolean); + for (let y = 0; y < m.length; y += 1) + de(m[y]); d = !1; }, - d(w) { - w && Ue(t), _ && _.d(), rt(i), rt(u), m && m.d(), Gs(p, w), e[32](null), c = !1, qs(h); + d(b) { + b && Xe(t), h && h.d(), ft(i), ft(u), p && p.d(), Hs(m, b), e[32](null), c = !1, Ds(_); } }; } -function Xo(e) { +function qo(e) { let t, n, r; - return n = new Jt({ + return n = new dn({ props: { - Icon: Nl, + Icon: Cl, label: ( /*i18n*/ - e[7]("common.download") + e[6]("common.download") ) } }), n.$on( @@ -9364,67 +9200,67 @@ function Xo(e) { e[27] ), { c() { - t = Se("div"), nt(n.$$.fragment), ie(t, "class", "download-button-container svelte-a675k2"); + t = ke("div"), ut(n.$$.fragment), ie(t, "class", "download-button-container svelte-a675k2"); }, m(i, o) { - Fe(i, t, o), it(n, t, null), r = !0; + We(i, t, o), ct(n, t, null), r = !0; }, p(i, o) { const l = {}; o[0] & /*i18n*/ - 128 && (l.label = /*i18n*/ - i[7]("common.download")), n.$set(l); + 64 && (l.label = /*i18n*/ + i[6]("common.download")), n.$set(l); }, i(i) { - r || (J(n.$$.fragment, i), r = !0); + r || ($(n.$$.fragment, i), r = !0); }, o(i) { - le(n.$$.fragment, i), r = !1; + de(n.$$.fragment, i), r = !1; }, d(i) { - i && Ue(t), rt(n); + i && Xe(t), ft(n); } }; } -function Wo(e) { +function jo(e) { let t, n = ( /*selected_image*/ - e[13].caption + "" + e[12].caption + "" ), r; return { c() { - t = Se("caption"), r = xs(n), ie(t, "class", "caption svelte-a675k2"); + t = ke("caption"), r = Rs(n), ie(t, "class", "caption svelte-a675k2"); }, m(i, o) { - Fe(i, t, o), be(t, r); + We(i, t, o), be(t, r); }, p(i, o) { o[0] & /*selected_image*/ - 8192 && n !== (n = /*selected_image*/ - i[13].caption + "") && js(r, n); + 4096 && n !== (n = /*selected_image*/ + i[12].caption + "") && Ms(r, n); }, d(i) { - i && Ue(t); + i && Xe(t); } }; } -function Zo(e) { +function xo(e) { let t, n, r, i, o = ( /*i*/ - e[44] + e[42] ), l, u, s; - n = new Ms({ + n = new Is({ props: { src: ( /*image*/ - e[45].image.url + e[43].image.url ), title: ( /*image*/ - e[45].caption || null + e[43].caption || null ), "data-testid": "thumbnail " + /*i*/ - (e[44] + 1), + (e[42] + 1), alt: "", loading: "lazy" } @@ -9441,63 +9277,63 @@ function Zo(e) { /*click_handler_2*/ e[31]( /*i*/ - e[44] + e[42] ) ); } return { c() { - t = Se("button"), nt(n.$$.fragment), r = We(), ie(t, "class", "thumbnail-item thumbnail-small svelte-a675k2"), ie(t, "aria-label", i = "Thumbnail " + /*i*/ - (e[44] + 1) + " of " + /*resolved_value*/ - e[9].length), Jn( + t = ke("button"), ut(n.$$.fragment), r = Qe(), ie(t, "class", "thumbnail-item thumbnail-small svelte-a675k2"), ie(t, "aria-label", i = "Thumbnail " + /*i*/ + (e[42] + 1) + " of " + /*resolved_value*/ + e[8].length), Wn( t, "selected", /*selected_index*/ e[1] === /*i*/ - e[44] + e[42] ); }, - m(c, h) { - Fe(c, t, h), it(n, t, null), be(t, r), a(), l = !0, u || (s = Xt(t, "click", d), u = !0); + m(c, _) { + We(c, t, _), ct(n, t, null), be(t, r), a(), l = !0, u || (s = Xt(t, "click", d), u = !0); }, - p(c, h) { + p(c, _) { e = c; - const _ = {}; - h[0] & /*resolved_value*/ - 512 && (_.src = /*image*/ - e[45].image.url), h[0] & /*resolved_value*/ - 512 && (_.title = /*image*/ - e[45].caption || null), n.$set(_), (!l || h[0] & /*resolved_value*/ - 512 && i !== (i = "Thumbnail " + /*i*/ - (e[44] + 1) + " of " + /*resolved_value*/ - e[9].length)) && ie(t, "aria-label", i), o !== /*i*/ - e[44] && (f(), o = /*i*/ - e[44], a()), (!l || h[0] & /*selected_index*/ - 2) && Jn( + const h = {}; + _[0] & /*resolved_value*/ + 256 && (h.src = /*image*/ + e[43].image.url), _[0] & /*resolved_value*/ + 256 && (h.title = /*image*/ + e[43].caption || null), n.$set(h), (!l || _[0] & /*resolved_value*/ + 256 && i !== (i = "Thumbnail " + /*i*/ + (e[42] + 1) + " of " + /*resolved_value*/ + e[8].length)) && ie(t, "aria-label", i), o !== /*i*/ + e[42] && (f(), o = /*i*/ + e[42], a()), (!l || _[0] & /*selected_index*/ + 2) && Wn( t, "selected", /*selected_index*/ e[1] === /*i*/ - e[44] + e[42] ); }, i(c) { - l || (J(n.$$.fragment, c), l = !0); + l || ($(n.$$.fragment, c), l = !0); }, o(c) { - le(n.$$.fragment, c), l = !1; + de(n.$$.fragment, c), l = !1; }, d(c) { - c && Ue(t), rt(n), f(), u = !1, s(); + c && Xe(t), ft(n), f(), u = !1, s(); } }; } -function Jo(e) { +function zo(e) { let t, n, r; - return n = new ki({ + return n = new yi({ props: { i18n: ( /*i18n*/ - e[7] + e[6] ), absolute: !1 } }), n.$on( "clear", @@ -9505,249 +9341,194 @@ function Jo(e) { e[33] ), { c() { - t = Se("div"), nt(n.$$.fragment), ie(t, "class", "icon-button svelte-a675k2"); - }, - m(i, o) { - Fe(i, t, o), it(n, t, null), r = !0; - }, - p(i, o) { - const l = {}; - o[0] & /*i18n*/ - 128 && (l.i18n = /*i18n*/ - i[7]), n.$set(l); - }, - i(i) { - r || (J(n.$$.fragment, i), r = !0); - }, - o(i) { - le(n.$$.fragment, i), r = !1; - }, - d(i) { - i && Ue(t), rt(n); - } - }; -} -function Qo(e) { - let t, n, r; - return n = new Ff({ - props: { - i18n: ( - /*i18n*/ - e[7] - ), - value: ( - /*resolved_value*/ - e[9] - ), - formatter: $_ - } - }), n.$on( - "share", - /*share_handler*/ - e[34] - ), n.$on( - "error", - /*error_handler*/ - e[35] - ), { - c() { - t = Se("div"), nt(n.$$.fragment), ie(t, "class", "icon-button svelte-a675k2"); + t = ke("div"), ut(n.$$.fragment), ie(t, "class", "icon-button svelte-a675k2"); }, m(i, o) { - Fe(i, t, o), it(n, t, null), r = !0; + We(i, t, o), ct(n, t, null), r = !0; }, p(i, o) { const l = {}; o[0] & /*i18n*/ - 128 && (l.i18n = /*i18n*/ - i[7]), o[0] & /*resolved_value*/ - 512 && (l.value = /*resolved_value*/ - i[9]), n.$set(l); + 64 && (l.i18n = /*i18n*/ + i[6]), n.$set(l); }, i(i) { - r || (J(n.$$.fragment, i), r = !0); + r || ($(n.$$.fragment, i), r = !0); }, o(i) { - le(n.$$.fragment, i), r = !1; + de(n.$$.fragment, i), r = !1; }, d(i) { - i && Ue(t), rt(n); + i && Xe(t), ft(n); } }; } -function Yo(e) { +function Vo(e) { let t, n = ( /*entry*/ - e[42].caption + "" + e[40].caption + "" ), r; return { c() { - t = Se("div"), r = xs(n), ie(t, "class", "caption-label svelte-a675k2"); + t = ke("div"), r = Rs(n), ie(t, "class", "caption-label svelte-a675k2"); }, m(i, o) { - Fe(i, t, o), be(t, r); + We(i, t, o), be(t, r); }, p(i, o) { o[0] & /*resolved_value*/ - 512 && n !== (n = /*entry*/ - i[42].caption + "") && js(r, n); + 256 && n !== (n = /*entry*/ + i[40].caption + "") && Ms(r, n); }, d(i) { - i && Ue(t); + i && Xe(t); } }; } -function Ko(e) { - let t, n, r, i, o, l, u, s, a, f, d, c, h, _ = ( +function Xo(e) { + let t, n, r, i, o, l, u, s, a, f, d, c, _ = ( /*interactive*/ - e[8] && Jo(e) - ), m = ( - /*show_share_button*/ - e[5] && Qo(e) - ), g = ( + e[7] && zo(e) + ), h = ( /*entry*/ - e[42].caption && Yo(e) + e[40].caption && Vo(e) ); function p() { return ( /*click_handler_3*/ - e[36]( + e[34]( /*i*/ - e[44] + e[42] ) ); } return { c() { - t = Se("div"), _ && _.c(), n = We(), m && m.c(), r = We(), i = Se("button"), o = Se("img"), s = We(), g && g.c(), f = We(), ie(o, "class", "embla__slide__img svelte-a675k2"), qo(o.src, l = /*entry*/ - e[42].image.url) || ie(o, "src", l), ie(o, "alt", u = /*entry*/ - e[42].caption || null), ie(o, "loading", "lazy"), ie(i, "class", "embla__slide__img svelte-a675k2"), ie(i, "aria-label", a = "Thumbnail " + /*i*/ - (e[44] + 1) + " of " + /*resolved_value*/ - e[9].length), Jn( - i, + t = ke("div"), _ && _.c(), n = Qe(), r = ke("button"), i = ke("img"), u = Qe(), h && h.c(), a = Qe(), ie(i, "class", "embla__slide__img svelte-a675k2"), Mo(i.src, o = /*entry*/ + e[40].image.url) || ie(i, "src", o), ie(i, "alt", l = /*entry*/ + e[40].caption || null), ie(i, "loading", "lazy"), ie(r, "class", "embla__slide__img svelte-a675k2"), ie(r, "aria-label", s = "Thumbnail " + /*i*/ + (e[42] + 1) + " of " + /*resolved_value*/ + e[8].length), Wn( + r, "selected", /*selected_index*/ e[1] === /*i*/ - e[44] + e[42] ), ie(t, "class", "embla__slide svelte-a675k2"); }, - m(v, b) { - Fe(v, t, b), _ && _.m(t, null), be(t, n), m && m.m(t, null), be(t, r), be(t, i), be(i, o), be(i, s), g && g.m(i, null), be(t, f), d = !0, c || (h = Xt(i, "click", p), c = !0); + m(g, m) { + We(g, t, m), _ && _.m(t, null), be(t, n), be(t, r), be(r, i), be(r, u), h && h.m(r, null), be(t, a), f = !0, d || (c = Xt(r, "click", p), d = !0); }, - p(v, b) { - e = v, /*interactive*/ - e[8] ? _ ? (_.p(e, b), b[0] & /*interactive*/ - 256 && J(_, 1)) : (_ = Jo(e), _.c(), J(_, 1), _.m(t, n)) : _ && (_t(), le(_, 1, 1, () => { + p(g, m) { + e = g, /*interactive*/ + e[7] ? _ ? (_.p(e, m), m[0] & /*interactive*/ + 128 && $(_, 1)) : (_ = zo(e), _.c(), $(_, 1), _.m(t, n)) : _ && (Pt(), de(_, 1, 1, () => { _ = null; - }), dt()), /*show_share_button*/ - e[5] ? m ? (m.p(e, b), b[0] & /*show_share_button*/ - 32 && J(m, 1)) : (m = Qo(e), m.c(), J(m, 1), m.m(t, r)) : m && (_t(), le(m, 1, 1, () => { - m = null; - }), dt()), (!d || b[0] & /*resolved_value*/ - 512 && !qo(o.src, l = /*entry*/ - e[42].image.url)) && ie(o, "src", l), (!d || b[0] & /*resolved_value*/ - 512 && u !== (u = /*entry*/ - e[42].caption || null)) && ie(o, "alt", u), /*entry*/ - e[42].caption ? g ? g.p(e, b) : (g = Yo(e), g.c(), g.m(i, null)) : g && (g.d(1), g = null), (!d || b[0] & /*resolved_value*/ - 512 && a !== (a = "Thumbnail " + /*i*/ - (e[44] + 1) + " of " + /*resolved_value*/ - e[9].length)) && ie(i, "aria-label", a), (!d || b[0] & /*selected_index*/ - 2) && Jn( - i, + }), Ot()), (!f || m[0] & /*resolved_value*/ + 256 && !Mo(i.src, o = /*entry*/ + e[40].image.url)) && ie(i, "src", o), (!f || m[0] & /*resolved_value*/ + 256 && l !== (l = /*entry*/ + e[40].caption || null)) && ie(i, "alt", l), /*entry*/ + e[40].caption ? h ? h.p(e, m) : (h = Vo(e), h.c(), h.m(r, null)) : h && (h.d(1), h = null), (!f || m[0] & /*resolved_value*/ + 256 && s !== (s = "Thumbnail " + /*i*/ + (e[42] + 1) + " of " + /*resolved_value*/ + e[8].length)) && ie(r, "aria-label", s), (!f || m[0] & /*selected_index*/ + 2) && Wn( + r, "selected", /*selected_index*/ e[1] === /*i*/ - e[44] + e[42] ); }, - i(v) { - d || (J(_), J(m), d = !0); + i(g) { + f || ($(_), f = !0); }, - o(v) { - le(_), le(m), d = !1; + o(g) { + de(_), f = !1; }, - d(v) { - v && Ue(t), _ && _.d(), m && m.d(), g && g.d(), c = !1, h(); + d(g) { + g && Xe(t), _ && _.d(), h && h.d(), d = !1, c(); } }; } -function dh(e) { +function M_(e) { let t, n; - return t = new Ml({}), { + return t = new Il({}), { c() { - nt(t.$$.fragment); + ut(t.$$.fragment); }, m(r, i) { - it(t, r, i), n = !0; + ct(t, r, i), n = !0; }, i(r) { - n || (J(t.$$.fragment, r), n = !0); + n || ($(t.$$.fragment, r), n = !0); }, o(r) { - le(t.$$.fragment, r), n = !1; + de(t.$$.fragment, r), n = !1; }, d(r) { - rt(t, r); + ft(t, r); } }; } -function _h(e) { +function R_(e) { let t, n, r, i, o, l, u; - nh( + A_( /*onwindowresize*/ e[26] ); let s = ( /*show_label*/ - e[2] && zo(e) + e[2] && Fo(e) ); - const a = [ch, fh], f = []; - function d(c, h) { + const a = [D_, H_], f = []; + function d(c, _) { return ( /*value*/ c[0] == null || /*resolved_value*/ - c[9] == null || /*resolved_value*/ - c[9].length === 0 ? 0 : 1 + c[8] == null || /*resolved_value*/ + c[8].length === 0 ? 0 : 1 ); } return n = d(e), r = f[n] = a[n](e), { c() { - s && s.c(), t = We(), r.c(), i = rh(); + s && s.c(), t = Qe(), r.c(), i = B_(); }, - m(c, h) { - s && s.m(c, h), Fe(c, t, h), f[n].m(c, h), Fe(c, i, h), o = !0, l || (u = Xt( - zs, + m(c, _) { + s && s.m(c, _), We(c, t, _), f[n].m(c, _), We(c, i, _), o = !0, l || (u = Xt( + Us, "resize", /*onwindowresize*/ e[26] ), l = !0); }, - p(c, h) { + p(c, _) { /*show_label*/ - c[2] ? s ? (s.p(c, h), h[0] & /*show_label*/ - 4 && J(s, 1)) : (s = zo(c), s.c(), J(s, 1), s.m(t.parentNode, t)) : s && (_t(), le(s, 1, 1, () => { + c[2] ? s ? (s.p(c, _), _[0] & /*show_label*/ + 4 && $(s, 1)) : (s = Fo(c), s.c(), $(s, 1), s.m(t.parentNode, t)) : s && (Pt(), de(s, 1, 1, () => { s = null; - }), dt()); - let _ = n; - n = d(c), n === _ ? f[n].p(c, h) : (_t(), le(f[_], 1, 1, () => { - f[_] = null; - }), dt(), r = f[n], r ? r.p(c, h) : (r = f[n] = a[n](c), r.c()), J(r, 1), r.m(i.parentNode, i)); + }), Ot()); + let h = n; + n = d(c), n === h ? f[n].p(c, _) : (Pt(), de(f[h], 1, 1, () => { + f[h] = null; + }), Ot(), r = f[n], r ? r.p(c, _) : (r = f[n] = a[n](c), r.c()), $(r, 1), r.m(i.parentNode, i)); }, i(c) { - o || (J(s), J(r), o = !0); + o || ($(s), $(r), o = !0); }, o(c) { - le(s), le(r), o = !1; + de(s), de(r), o = !1; }, d(c) { - c && (Ue(t), Ue(i)), s && s.d(c), f[n].d(c), l = !1, u(); + c && (Xe(t), Xe(i)), s && s.d(c), f[n].d(c), l = !1, u(); } }; } -function nn(e, t) { +function en(e, t) { return e ?? t(); } -function bt(e) { +function pt(e) { let t, n = e[0], r = 1; for (; r < e.length; ) { const i = e[r], o = e[r + 1]; @@ -9757,123 +9538,116 @@ function bt(e) { } return n; } -function hh(e, t, n) { - let r, i, o, { show_label: l = !0 } = t, { label: u } = t, { root: s = "" } = t, { proxy_url: a = null } = t, { value: f = null } = t, { preview: d } = t, { allow_preview: c = !0 } = t, { show_share_button: h = !1 } = t, { show_download_button: _ = !1 } = t, { i18n: m } = t, { selected_index: g = null } = t, { interactive: p } = t; - const v = sh(); - let b, w = { loop: !0 }; - const y = (T) => { - n(22, b = T.detail), console.log(b.slideNodes()); - }; - let S = !0, C = null, P = f; - g == null && d && bt([f, "optionalAccess", (T) => T.length]) && (g = 0); - let k = g; - function O(T) { - const H = T.target, D = T.clientX, N = H.offsetWidth / 2; - D < N ? n(1, g = r) : n(1, g = i); - } - function U(T) { - switch (T.code) { +function U_(e, t, n) { + let r, i, o, { show_label: l = !0 } = t, { label: u } = t, { root: s = "" } = t, { proxy_url: a = null } = t, { value: f = null } = t, { preview: d } = t, { allow_preview: c = !0 } = t, { show_share_button: _ = !1 } = t, { show_download_button: h = !1 } = t, { i18n: p } = t, { selected_index: g = null } = t, { interactive: m } = t; + const v = O_(); + let w, b = { loop: !0 }; + const y = (E) => { + n(22, w = E.detail), console.log(w.slideNodes()); + }; + let k = !0, C = null, O = f; + g == null && d && pt([f, "optionalAccess", (E) => E.length]) && (g = 0); + let T = g; + function P(E) { + const z = E.target, K = E.clientX, U = z.offsetWidth / 2; + K < U ? n(1, g = r) : n(1, g = i); + } + function M(E) { + switch (E.code) { case "Escape": - T.preventDefault(), n(1, g = null); + E.preventDefault(), n(1, g = null); break; case "ArrowLeft": - T.preventDefault(), n(1, g = r); + E.preventDefault(), n(1, g = r); break; case "ArrowRight": - T.preventDefault(), n(1, g = i); + E.preventDefault(), n(1, g = i); break; } } - let x = [], j; - async function te(T) { - if (typeof T != "number" || (await uh(), x[T] === void 0)) + let j = [], q; + async function ee(E) { + if (typeof E != "number" || (await N_(), j[E] === void 0)) return; - bt([ - x, + pt([ + j, "access", - (R) => R[T], + (Z) => Z[E], "optionalAccess", - (R) => R.focus, + (Z) => Z.focus, "call", - (R) => R() + (Z) => Z() ]); - const { left: H, width: D } = j.getBoundingClientRect(), { left: I, width: N } = x[T].getBoundingClientRect(), Y = I - H + N / 2 - D / 2 + j.scrollLeft; - j && typeof j.scrollTo == "function" && j.scrollTo({ - left: Y < 0 ? 0 : Y, + const { left: z, width: K } = q.getBoundingClientRect(), { left: N, width: U } = j[E].getBoundingClientRect(), H = N - z + U / 2 - K / 2 + q.scrollLeft; + q && typeof q.scrollTo == "function" && q.scrollTo({ + left: H < 0 ? 0 : H, behavior: "smooth" }); } - let ne = 0; - const ce = ah("fetch_implementation"); - async function me(T, H) { - let D; + let te = 0; + const fe = P_("fetch_implementation"); + async function me(E, z) { + let K; try { - D = await ce(T); - } catch (Y) { - if (Y instanceof TypeError) { - window.open(T, "_blank", "noreferrer"); + K = await fe(E); + } catch (H) { + if (H instanceof TypeError) { + window.open(E, "_blank", "noreferrer"); return; } - throw Y; + throw H; } - const I = await D.blob(), N = URL.createObjectURL(I), Q = document.createElement("a"); - Q.href = N, Q.download = H, Q.click(), URL.revokeObjectURL(N); + const N = await K.blob(), U = URL.createObjectURL(N), I = document.createElement("a"); + I.href = U, I.download = z, I.click(), URL.revokeObjectURL(U); } function _e() { - n(12, ne = zs.innerHeight); + n(11, te = Us.innerHeight); } const B = () => { - const T = o == null ? void 0 : o.image; - if (T == null) + const E = o == null ? void 0 : o.image; + if (E == null) return; - const { url: H, orig_name: D } = T; - H && me(H, D ?? "image"); - }, pe = () => n(1, g = null), E = (T) => O(T); - function M(T, H) { - Uo[T ? "unshift" : "push"](() => { - x[H] = T, n(10, x); + const { url: z, orig_name: K } = E; + z && me(z, K ?? "image"); + }, pe = () => n(1, g = null), S = (E) => P(E); + function D(E, z) { + Ho[E ? "unshift" : "push"](() => { + j[z] = E, n(9, j); }); } - const A = (T) => n(1, g = T); - function F(T) { - Uo[T ? "unshift" : "push"](() => { - j = T, n(11, j); + const A = (E) => n(1, g = E); + function R(E) { + Ho[E ? "unshift" : "push"](() => { + q = E, n(10, q); }); } - const L = () => n(0, f = null); - function re(T) { - Fo.call(this, e, T); - } - function z(T) { - Fo.call(this, e, T); - } - const ee = (T) => n(1, g = T); - return e.$$set = (T) => { - "show_label" in T && n(2, l = T.show_label), "label" in T && n(3, u = T.label), "root" in T && n(19, s = T.root), "proxy_url" in T && n(20, a = T.proxy_url), "value" in T && n(0, f = T.value), "preview" in T && n(21, d = T.preview), "allow_preview" in T && n(4, c = T.allow_preview), "show_share_button" in T && n(5, h = T.show_share_button), "show_download_button" in T && n(6, _ = T.show_download_button), "i18n" in T && n(7, m = T.i18n), "selected_index" in T && n(1, g = T.selected_index), "interactive" in T && n(8, p = T.interactive); + const L = () => n(0, f = null), ne = (E) => n(1, g = E); + return e.$$set = (E) => { + "show_label" in E && n(2, l = E.show_label), "label" in E && n(3, u = E.label), "root" in E && n(18, s = E.root), "proxy_url" in E && n(19, a = E.proxy_url), "value" in E && n(0, f = E.value), "preview" in E && n(20, d = E.preview), "allow_preview" in E && n(4, c = E.allow_preview), "show_share_button" in E && n(21, _ = E.show_share_button), "show_download_button" in E && n(5, h = E.show_download_button), "i18n" in E && n(6, p = E.i18n), "selected_index" in E && n(1, g = E.selected_index), "interactive" in E && n(7, m = E.interactive); }, e.$$.update = () => { if (e.$$.dirty[0] & /*emblaApi*/ - 4194304 && b != null) { - const { applyTweenOpacity: T } = Y_(b); - b.on("init", T).on("scroll", T).on("reInit", T); + 4194304 && w != null) { + const { applyTweenOpacity: E } = E_(w); + w.on("init", E).on("scroll", E).on("reInit", E); } e.$$.dirty[0] & /*value, was_reset*/ - 8388609 && n(23, S = f == null || f.length === 0 ? !0 : S), e.$$.dirty[0] & /*value, root, proxy_url*/ - 1572865 && n(9, C = f == null ? null : f.map((T) => ({ - image: Et(T.image, s, a), - caption: T.caption + 8388609 && n(23, k = f == null || f.length === 0 ? !0 : k), e.$$.dirty[0] & /*value, root, proxy_url*/ + 786433 && n(8, C = f == null ? null : f.map((E) => ({ + image: vt(E.image, s, a), + caption: E.caption }))), e.$$.dirty[0] & /*prev_value, value, was_reset, preview, selected_index*/ - 27262979 && (ln(P, f) || (S ? (n(1, g = d && bt([f, "optionalAccess", (T) => T.length]) ? 0 : null), n(23, S = !1)) : n( + 26214403 && (rn(O, f) || (k ? (n(1, g = d && pt([f, "optionalAccess", (E) => E.length]) ? 0 : null), n(23, k = !1)) : n( 1, g = g != null && f != null && g < f.length ? g : null - ), v("change"), n(24, P = f))), e.$$.dirty[0] & /*selected_index, resolved_value*/ - 514 && (r = (nn(g, () => 0) + nn(bt([C, "optionalAccess", (T) => T.length]), () => 0) - 1) % nn(bt([C, "optionalAccess", (T) => T.length]), () => 0)), e.$$.dirty[0] & /*selected_index, resolved_value*/ - 514 && (i = (nn(g, () => 0) + 1) % nn(bt([C, "optionalAccess", (T) => T.length]), () => 0)), e.$$.dirty[0] & /*selected_index, old_selected_index, resolved_value*/ - 33554946 && g !== k && (n(25, k = g), g !== null && v("select", { + ), v("change"), n(24, O = f))), e.$$.dirty[0] & /*selected_index, resolved_value*/ + 258 && (r = (en(g, () => 0) + en(pt([C, "optionalAccess", (E) => E.length]), () => 0) - 1) % en(pt([C, "optionalAccess", (E) => E.length]), () => 0)), e.$$.dirty[0] & /*selected_index, resolved_value*/ + 258 && (i = (en(g, () => 0) + 1) % en(pt([C, "optionalAccess", (E) => E.length]), () => 0)), e.$$.dirty[0] & /*selected_index, old_selected_index, resolved_value*/ + 33554690 && g !== T && (n(25, T = g), g !== null && v("select", { index: g, - value: bt([C, "optionalAccess", (T) => T[g]]) + value: pt([C, "optionalAccess", (E) => E[g]]) })), e.$$.dirty[0] & /*allow_preview, selected_index*/ - 18 && c && te(g), e.$$.dirty[0] & /*selected_index, resolved_value*/ - 514 && n(13, o = g != null && C != null ? C[g] : null); + 18 && c && ee(g), e.$$.dirty[0] & /*selected_index, resolved_value*/ + 258 && n(12, o = g != null && C != null ? C[g] : null); }, [ f, g, @@ -9881,60 +9655,58 @@ function hh(e, t, n) { u, c, h, - _, - m, p, + m, C, - x, j, - ne, + q, + te, o, - w, + b, y, - O, - U, + P, + M, me, s, a, d, - b, - S, - P, + _, + w, k, + O, + T, _e, B, pe, - E, - M, + S, + D, A, - F, + R, L, - re, - z, - ee + ne ]; } -class mh extends eh { +class F_ extends k_ { constructor(t) { - super(), oh( + super(), I_( this, t, - hh, - _h, - lh, + U_, + R_, + L_, { show_label: 2, label: 3, - root: 19, - proxy_url: 20, + root: 18, + proxy_url: 19, value: 0, - preview: 21, + preview: 20, allow_preview: 4, - show_share_button: 5, - show_download_button: 6, - i18n: 7, + show_share_button: 21, + show_download_button: 5, + i18n: 6, selected_index: 1, - interactive: 8 + interactive: 7 }, null, [-1, -1] @@ -9949,66 +9721,66 @@ function Ut(e) { return (Number.isInteger(e) ? e : e.toFixed(1)) + r; } const { - SvelteComponent: ph, - append: xe, + SvelteComponent: G_, + append: qe, attr: W, - component_subscribe: $o, - detach: gh, - element: bh, - init: wh, - insert: vh, - noop: el, - safe_not_equal: yh, + component_subscribe: Wo, + detach: q_, + element: j_, + init: x_, + insert: z_, + noop: Zo, + safe_not_equal: V_, set_style: On, - svg_element: ze, - toggle_class: tl -} = window.__gradio__svelte__internal, { onMount: Eh } = window.__gradio__svelte__internal; -function Sh(e) { + svg_element: je, + toggle_class: Jo +} = window.__gradio__svelte__internal, { onMount: X_ } = window.__gradio__svelte__internal; +function W_(e) { let t, n, r, i, o, l, u, s, a, f, d, c; return { c() { - t = bh("div"), n = ze("svg"), r = ze("g"), i = ze("path"), o = ze("path"), l = ze("path"), u = ze("path"), s = ze("g"), a = ze("path"), f = ze("path"), d = ze("path"), c = ze("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(l, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), W(l, "fill", "#FF7C00"), W(l, "fill-opacity", "0.4"), W(l, "class", "svelte-43sxxs"), W(u, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), W(u, "fill", "#FF7C00"), W(u, "class", "svelte-43sxxs"), On(r, "transform", "translate(" + /*$top*/ + t = j_("div"), n = je("svg"), r = je("g"), i = je("path"), o = je("path"), l = je("path"), u = je("path"), s = je("g"), a = je("path"), f = je("path"), d = je("path"), c = je("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(l, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), W(l, "fill", "#FF7C00"), W(l, "fill-opacity", "0.4"), W(l, "class", "svelte-43sxxs"), W(u, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), W(u, "fill", "#FF7C00"), W(u, "class", "svelte-43sxxs"), On(r, "transform", "translate(" + /*$top*/ e[1][0] + "px, " + /*$top*/ e[1][1] + "px)"), W(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), W(a, "fill", "#FF7C00"), W(a, "fill-opacity", "0.4"), W(a, "class", "svelte-43sxxs"), W(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), W(f, "fill", "#FF7C00"), W(f, "class", "svelte-43sxxs"), W(d, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), W(d, "fill", "#FF7C00"), W(d, "fill-opacity", "0.4"), W(d, "class", "svelte-43sxxs"), W(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), W(c, "fill", "#FF7C00"), W(c, "class", "svelte-43sxxs"), On(s, "transform", "translate(" + /*$bottom*/ e[2][0] + "px, " + /*$bottom*/ - e[2][1] + "px)"), W(n, "viewBox", "-1200 -1200 3000 3000"), W(n, "fill", "none"), W(n, "xmlns", "http://www.w3.org/2000/svg"), W(n, "class", "svelte-43sxxs"), W(t, "class", "svelte-43sxxs"), tl( + e[2][1] + "px)"), W(n, "viewBox", "-1200 -1200 3000 3000"), W(n, "fill", "none"), W(n, "xmlns", "http://www.w3.org/2000/svg"), W(n, "class", "svelte-43sxxs"), W(t, "class", "svelte-43sxxs"), Jo( t, "margin", /*margin*/ e[0] ); }, - m(h, _) { - vh(h, t, _), xe(t, n), xe(n, r), xe(r, i), xe(r, o), xe(r, l), xe(r, u), xe(n, s), xe(s, a), xe(s, f), xe(s, d), xe(s, c); + m(_, h) { + z_(_, t, h), qe(t, n), qe(n, r), qe(r, i), qe(r, o), qe(r, l), qe(r, u), qe(n, s), qe(s, a), qe(s, f), qe(s, d), qe(s, c); }, - p(h, [_]) { - _ & /*$top*/ + p(_, [h]) { + h & /*$top*/ 2 && On(r, "transform", "translate(" + /*$top*/ - h[1][0] + "px, " + /*$top*/ - h[1][1] + "px)"), _ & /*$bottom*/ + _[1][0] + "px, " + /*$top*/ + _[1][1] + "px)"), h & /*$bottom*/ 4 && On(s, "transform", "translate(" + /*$bottom*/ - h[2][0] + "px, " + /*$bottom*/ - h[2][1] + "px)"), _ & /*margin*/ - 1 && tl( + _[2][0] + "px, " + /*$bottom*/ + _[2][1] + "px)"), h & /*margin*/ + 1 && Jo( t, "margin", /*margin*/ - h[0] + _[0] ); }, - i: el, - o: el, - d(h) { - h && gh(t); + i: Zo, + o: Zo, + d(_) { + _ && q_(t); } }; } -function kh(e, t, n) { +function Z_(e, t, n) { let r, i, { margin: o = !0 } = t; - const l = no([0, 0]); - $o(e, l, (c) => n(1, r = c)); - const u = no([0, 0]); - $o(e, u, (c) => n(2, i = c)); + const l = Ki([0, 0]); + Wo(e, l, (c) => n(1, r = c)); + const u = Ki([0, 0]); + Wo(e, u, (c) => n(2, i = c)); let s; async function a() { await Promise.all([l.set([125, 140]), u.set([-125, -140])]), await Promise.all([l.set([-125, 140]), u.set([125, -140])]), await Promise.all([l.set([-125, 0]), u.set([125, -0])]), await Promise.all([l.set([125, 0]), u.set([-125, 0])]); @@ -10019,55 +9791,55 @@ function kh(e, t, n) { async function d() { await Promise.all([l.set([125, 0]), u.set([-125, 0])]), f(); } - return Eh(() => (d(), () => s = !0)), e.$$set = (c) => { + return X_(() => (d(), () => s = !0)), e.$$set = (c) => { "margin" in c && n(0, o = c.margin); }, [o, r, i, l, u]; } -class Th extends ph { +class J_ extends G_ { constructor(t) { - super(), wh(this, t, kh, Sh, yh, { margin: 0 }); + super(), x_(this, t, Z_, W_, V_, { margin: 0 }); } } const { - SvelteComponent: Ah, - append: St, + SvelteComponent: Q_, + append: yt, attr: Ye, - binding_callbacks: nl, - check_outros: Vs, - create_component: Bh, - create_slot: Ch, - destroy_component: Ih, - destroy_each: Xs, - detach: G, + binding_callbacks: Qo, + check_outros: Fs, + create_component: Y_, + create_slot: K_, + destroy_component: $_, + destroy_each: Gs, + detach: F, element: tt, - empty: Kt, - ensure_array_like: Qn, - get_all_dirty_from_scope: Lh, - get_slot_changes: Ph, - group_outros: Ws, - init: Oh, - insert: q, - mount_component: Hh, - noop: di, - safe_not_equal: Nh, - set_data: Ge, - set_style: ft, + empty: Yt, + ensure_array_like: Zn, + get_all_dirty_from_scope: eh, + get_slot_changes: th, + group_outros: qs, + init: nh, + insert: G, + mount_component: rh, + noop: ui, + safe_not_equal: ih, + set_data: Ue, + set_style: st, space: Ke, - text: fe, + text: ue, toggle_class: Re, transition_in: Wt, transition_out: Zt, - update_slot_base: Mh -} = window.__gradio__svelte__internal, { tick: Dh } = window.__gradio__svelte__internal, { onDestroy: Rh } = window.__gradio__svelte__internal, Uh = (e) => ({}), rl = (e) => ({}); -function il(e, t, n) { + update_slot_base: oh +} = window.__gradio__svelte__internal, { tick: lh } = window.__gradio__svelte__internal, { onDestroy: sh } = window.__gradio__svelte__internal, ah = (e) => ({}), Yo = (e) => ({}); +function Ko(e, t, n) { const r = e.slice(); return r[38] = t[n], r[40] = n, r; } -function ol(e, t, n) { +function $o(e, t, n) { const r = e.slice(); return r[38] = t[n], r; } -function Fh(e) { +function uh(e) { let t, n = ( /*i18n*/ e[1]("common.error") + "" @@ -10075,41 +9847,41 @@ function Fh(e) { const l = ( /*#slots*/ e[29].error - ), u = Ch( + ), u = K_( l, e, /*$$scope*/ e[28], - rl + Yo ); return { c() { - t = tt("span"), r = fe(n), i = Ke(), u && u.c(), Ye(t, "class", "error svelte-1txqlrd"); + t = tt("span"), r = ue(n), i = Ke(), u && u.c(), Ye(t, "class", "error svelte-1txqlrd"); }, m(s, a) { - q(s, t, a), St(t, r), q(s, i, a), u && u.m(s, a), o = !0; + G(s, t, a), yt(t, r), G(s, i, a), u && u.m(s, a), o = !0; }, p(s, a) { (!o || a[0] & /*i18n*/ 2) && n !== (n = /*i18n*/ - s[1]("common.error") + "") && Ge(r, n), u && u.p && (!o || a[0] & /*$$scope*/ - 268435456) && Mh( + s[1]("common.error") + "") && Ue(r, n), u && u.p && (!o || a[0] & /*$$scope*/ + 268435456) && oh( u, l, s, /*$$scope*/ s[28], - o ? Ph( + o ? th( l, /*$$scope*/ s[28], a, - Uh - ) : Lh( + ah + ) : eh( /*$$scope*/ s[28] ), - rl + Yo ); }, i(s) { @@ -10119,56 +9891,56 @@ function Fh(e) { Zt(u, s), o = !1; }, d(s) { - s && (G(t), G(i)), u && u.d(s); + s && (F(t), F(i)), u && u.d(s); } }; } -function Gh(e) { +function fh(e) { let t, n, r, i, o, l, u, s, a, f = ( /*variant*/ e[8] === "default" && /*show_eta_bar*/ e[18] && /*show_progress*/ - e[6] === "full" && ll(e) + e[6] === "full" && el(e) ); - function d(b, w) { + function d(w, b) { if ( /*progress*/ - b[7] + w[7] ) - return xh; + return _h; if ( /*queue_position*/ - b[2] !== null && /*queue_size*/ - b[3] !== void 0 && /*queue_position*/ - b[2] >= 0 + w[2] !== null && /*queue_size*/ + w[3] !== void 0 && /*queue_position*/ + w[2] >= 0 ) - return jh; + return dh; if ( /*queue_position*/ - b[2] === 0 + w[2] === 0 ) - return qh; + return ch; } - let c = d(e), h = c && c(e), _ = ( + let c = d(e), _ = c && c(e), h = ( /*timer*/ - e[5] && ul(e) + e[5] && rl(e) ); - const m = [Wh, Xh], g = []; - function p(b, w) { + const p = [gh, ph], g = []; + function m(w, b) { return ( /*last_progress_level*/ - b[15] != null ? 0 : ( + w[15] != null ? 0 : ( /*show_progress*/ - b[6] === "full" ? 1 : -1 + w[6] === "full" ? 1 : -1 ) ); } - ~(o = p(e)) && (l = g[o] = m[o](e)); + ~(o = m(e)) && (l = g[o] = p[o](e)); let v = !/*timer*/ - e[5] && pl(e); + e[5] && fl(e); return { c() { - f && f.c(), t = Ke(), n = tt("div"), h && h.c(), r = Ke(), _ && _.c(), i = Ke(), l && l.c(), u = Ke(), v && v.c(), s = Kt(), Ye(n, "class", "progress-text svelte-1txqlrd"), Re( + f && f.c(), t = Ke(), n = tt("div"), _ && _.c(), r = Ke(), h && h.c(), i = Ke(), l && l.c(), u = Ke(), v && v.c(), s = Yt(), Ye(n, "class", "progress-text svelte-1txqlrd"), Re( n, "meta-text-center", /*variant*/ @@ -10180,138 +9952,138 @@ function Gh(e) { e[8] === "default" ); }, - m(b, w) { - f && f.m(b, w), q(b, t, w), q(b, n, w), h && h.m(n, null), St(n, r), _ && _.m(n, null), q(b, i, w), ~o && g[o].m(b, w), q(b, u, w), v && v.m(b, w), q(b, s, w), a = !0; + m(w, b) { + f && f.m(w, b), G(w, t, b), G(w, n, b), _ && _.m(n, null), yt(n, r), h && h.m(n, null), G(w, i, b), ~o && g[o].m(w, b), G(w, u, b), v && v.m(w, b), G(w, s, b), a = !0; }, - p(b, w) { + p(w, b) { /*variant*/ - b[8] === "default" && /*show_eta_bar*/ - b[18] && /*show_progress*/ - b[6] === "full" ? f ? f.p(b, w) : (f = ll(b), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), c === (c = d(b)) && h ? h.p(b, w) : (h && h.d(1), h = c && c(b), h && (h.c(), h.m(n, r))), /*timer*/ - b[5] ? _ ? _.p(b, w) : (_ = ul(b), _.c(), _.m(n, null)) : _ && (_.d(1), _ = null), (!a || w[0] & /*variant*/ + w[8] === "default" && /*show_eta_bar*/ + w[18] && /*show_progress*/ + w[6] === "full" ? f ? f.p(w, b) : (f = el(w), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), c === (c = d(w)) && _ ? _.p(w, b) : (_ && _.d(1), _ = c && c(w), _ && (_.c(), _.m(n, r))), /*timer*/ + w[5] ? h ? h.p(w, b) : (h = rl(w), h.c(), h.m(n, null)) : h && (h.d(1), h = null), (!a || b[0] & /*variant*/ 256) && Re( n, "meta-text-center", /*variant*/ - b[8] === "center" - ), (!a || w[0] & /*variant*/ + w[8] === "center" + ), (!a || b[0] & /*variant*/ 256) && Re( n, "meta-text", /*variant*/ - b[8] === "default" + w[8] === "default" ); let y = o; - o = p(b), o === y ? ~o && g[o].p(b, w) : (l && (Ws(), Zt(g[y], 1, 1, () => { + o = m(w), o === y ? ~o && g[o].p(w, b) : (l && (qs(), Zt(g[y], 1, 1, () => { g[y] = null; - }), Vs()), ~o ? (l = g[o], l ? l.p(b, w) : (l = g[o] = m[o](b), l.c()), Wt(l, 1), l.m(u.parentNode, u)) : l = null), /*timer*/ - b[5] ? v && (v.d(1), v = null) : v ? v.p(b, w) : (v = pl(b), v.c(), v.m(s.parentNode, s)); + }), Fs()), ~o ? (l = g[o], l ? l.p(w, b) : (l = g[o] = p[o](w), l.c()), Wt(l, 1), l.m(u.parentNode, u)) : l = null), /*timer*/ + w[5] ? v && (v.d(1), v = null) : v ? v.p(w, b) : (v = fl(w), v.c(), v.m(s.parentNode, s)); }, - i(b) { + i(w) { a || (Wt(l), a = !0); }, - o(b) { + o(w) { Zt(l), a = !1; }, - d(b) { - b && (G(t), G(n), G(i), G(u), G(s)), f && f.d(b), h && h.d(), _ && _.d(), ~o && g[o].d(b), v && v.d(b); + d(w) { + w && (F(t), F(n), F(i), F(u), F(s)), f && f.d(w), _ && _.d(), h && h.d(), ~o && g[o].d(w), v && v.d(w); } }; } -function ll(e) { +function el(e) { let t, n = `translateX(${/*eta_level*/ (e[17] || 0) * 100 - 100}%)`; return { c() { - t = tt("div"), Ye(t, "class", "eta-bar svelte-1txqlrd"), ft(t, "transform", n); + t = tt("div"), Ye(t, "class", "eta-bar svelte-1txqlrd"), st(t, "transform", n); }, m(r, i) { - q(r, t, i); + G(r, t, i); }, p(r, i) { i[0] & /*eta_level*/ 131072 && n !== (n = `translateX(${/*eta_level*/ - (r[17] || 0) * 100 - 100}%)`) && ft(t, "transform", n); + (r[17] || 0) * 100 - 100}%)`) && st(t, "transform", n); }, d(r) { - r && G(t); + r && F(t); } }; } -function qh(e) { +function ch(e) { let t; return { c() { - t = fe("processing |"); + t = ue("processing |"); }, m(n, r) { - q(n, t, r); + G(n, t, r); }, - p: di, + p: ui, d(n) { - n && G(t); + n && F(t); } }; } -function jh(e) { +function dh(e) { let t, n = ( /*queue_position*/ e[2] + 1 + "" ), r, i, o, l; return { c() { - t = fe("queue: "), r = fe(n), i = fe("/"), o = fe( + t = ue("queue: "), r = ue(n), i = ue("/"), o = ue( /*queue_size*/ e[3] - ), l = fe(" |"); + ), l = ue(" |"); }, m(u, s) { - q(u, t, s), q(u, r, s), q(u, i, s), q(u, o, s), q(u, l, s); + G(u, t, s), G(u, r, s), G(u, i, s), G(u, o, s), G(u, l, s); }, p(u, s) { s[0] & /*queue_position*/ 4 && n !== (n = /*queue_position*/ - u[2] + 1 + "") && Ge(r, n), s[0] & /*queue_size*/ - 8 && Ge( + u[2] + 1 + "") && Ue(r, n), s[0] & /*queue_size*/ + 8 && Ue( o, /*queue_size*/ u[3] ); }, d(u) { - u && (G(t), G(r), G(i), G(o), G(l)); + u && (F(t), F(r), F(i), F(o), F(l)); } }; } -function xh(e) { - let t, n = Qn( +function _h(e) { + let t, n = Zn( /*progress*/ e[7] ), r = []; for (let i = 0; i < n.length; i += 1) - r[i] = al(ol(e, n, i)); + r[i] = nl($o(e, n, i)); return { c() { for (let i = 0; i < r.length; i += 1) r[i].c(); - t = Kt(); + t = Yt(); }, m(i, o) { for (let l = 0; l < r.length; l += 1) r[l] && r[l].m(i, o); - q(i, t, o); + G(i, t, o); }, p(i, o) { if (o[0] & /*progress*/ 128) { - n = Qn( + n = Zn( /*progress*/ i[7] ); let l; for (l = 0; l < n.length; l += 1) { - const u = ol(i, n, l); - r[l] ? r[l].p(u, o) : (r[l] = al(u), r[l].c(), r[l].m(t.parentNode, t)); + const u = $o(i, n, l); + r[l] ? r[l].p(u, o) : (r[l] = nl(u), r[l].c(), r[l].m(t.parentNode, t)); } for (; l < r.length; l += 1) r[l].d(1); @@ -10319,11 +10091,11 @@ function xh(e) { } }, d(i) { - i && G(t), Xs(r, i); + i && F(t), Gs(r, i); } }; } -function sl(e) { +function tl(e) { let t, n = ( /*p*/ e[38].unit + "" @@ -10331,52 +10103,52 @@ function sl(e) { function u(f, d) { return ( /*p*/ - f[38].length != null ? Vh : zh + f[38].length != null ? mh : hh ); } let s = u(e), a = s(e); return { c() { - a.c(), t = Ke(), r = fe(n), i = fe(" | "), l = fe(o); + a.c(), t = Ke(), r = ue(n), i = ue(" | "), l = ue(o); }, m(f, d) { - a.m(f, d), q(f, t, d), q(f, r, d), q(f, i, d), q(f, l, d); + a.m(f, d), G(f, t, d), G(f, r, d), G(f, i, d), G(f, l, d); }, p(f, d) { s === (s = u(f)) && a ? a.p(f, d) : (a.d(1), a = s(f), a && (a.c(), a.m(t.parentNode, t))), d[0] & /*progress*/ 128 && n !== (n = /*p*/ - f[38].unit + "") && Ge(r, n); + f[38].unit + "") && Ue(r, n); }, d(f) { - f && (G(t), G(r), G(i), G(l)), a.d(f); + f && (F(t), F(r), F(i), F(l)), a.d(f); } }; } -function zh(e) { +function hh(e) { let t = Ut( /*p*/ e[38].index || 0 ) + "", n; return { c() { - n = fe(t); + n = ue(t); }, m(r, i) { - q(r, n, i); + G(r, n, i); }, p(r, i) { i[0] & /*progress*/ 128 && t !== (t = Ut( /*p*/ r[38].index || 0 - ) + "") && Ge(n, t); + ) + "") && Ue(n, t); }, d(r) { - r && G(n); + r && F(n); } }; } -function Vh(e) { +function mh(e) { let t = Ut( /*p*/ e[38].index || 0 @@ -10386,49 +10158,49 @@ function Vh(e) { ) + "", o; return { c() { - n = fe(t), r = fe("/"), o = fe(i); + n = ue(t), r = ue("/"), o = ue(i); }, m(l, u) { - q(l, n, u), q(l, r, u), q(l, o, u); + G(l, n, u), G(l, r, u), G(l, o, u); }, p(l, u) { u[0] & /*progress*/ 128 && t !== (t = Ut( /*p*/ l[38].index || 0 - ) + "") && Ge(n, t), u[0] & /*progress*/ + ) + "") && Ue(n, t), u[0] & /*progress*/ 128 && i !== (i = Ut( /*p*/ l[38].length - ) + "") && Ge(o, i); + ) + "") && Ue(o, i); }, d(l) { - l && (G(n), G(r), G(o)); + l && (F(n), F(r), F(o)); } }; } -function al(e) { +function nl(e) { let t, n = ( /*p*/ - e[38].index != null && sl(e) + e[38].index != null && tl(e) ); return { c() { - n && n.c(), t = Kt(); + n && n.c(), t = Yt(); }, m(r, i) { - n && n.m(r, i), q(r, t, i); + n && n.m(r, i), G(r, t, i); }, p(r, i) { /*p*/ - r[38].index != null ? n ? n.p(r, i) : (n = sl(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); + r[38].index != null ? n ? n.p(r, i) : (n = tl(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); }, d(r) { - r && G(t), n && n.d(r); + r && F(t), n && n.d(r); } }; } -function ul(e) { +function rl(e) { let t, n = ( /*eta*/ e[0] ? `/${/*formatted_eta*/ @@ -10436,43 +10208,43 @@ function ul(e) { ), r, i; return { c() { - t = fe( + t = ue( /*formatted_timer*/ e[20] - ), r = fe(n), i = fe("s"); + ), r = ue(n), i = ue("s"); }, m(o, l) { - q(o, t, l), q(o, r, l), q(o, i, l); + G(o, t, l), G(o, r, l), G(o, i, l); }, p(o, l) { l[0] & /*formatted_timer*/ - 1048576 && Ge( + 1048576 && Ue( t, /*formatted_timer*/ o[20] ), l[0] & /*eta, formatted_eta*/ 524289 && n !== (n = /*eta*/ o[0] ? `/${/*formatted_eta*/ - o[19]}` : "") && Ge(r, n); + o[19]}` : "") && Ue(r, n); }, d(o) { - o && (G(t), G(r), G(i)); + o && (F(t), F(r), F(i)); } }; } -function Xh(e) { +function ph(e) { let t, n; - return t = new Th({ + return t = new J_({ props: { margin: ( /*variant*/ e[8] === "default" ) } }), { c() { - Bh(t.$$.fragment); + Y_(t.$$.fragment); }, m(r, i) { - Hh(t, r, i), n = !0; + rh(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -10487,65 +10259,65 @@ function Xh(e) { Zt(t.$$.fragment, r), n = !1; }, d(r) { - Ih(t, r); + $_(t, r); } }; } -function Wh(e) { +function gh(e) { let t, n, r, i, o, l = `${/*last_progress_level*/ e[15] * 100}%`, u = ( /*progress*/ - e[7] != null && fl(e) + e[7] != null && il(e) ); return { c() { - t = tt("div"), n = tt("div"), u && u.c(), r = Ke(), i = tt("div"), o = tt("div"), Ye(n, "class", "progress-level-inner svelte-1txqlrd"), Ye(o, "class", "progress-bar svelte-1txqlrd"), ft(o, "width", l), Ye(i, "class", "progress-bar-wrap svelte-1txqlrd"), Ye(t, "class", "progress-level svelte-1txqlrd"); + t = tt("div"), n = tt("div"), u && u.c(), r = Ke(), i = tt("div"), o = tt("div"), Ye(n, "class", "progress-level-inner svelte-1txqlrd"), Ye(o, "class", "progress-bar svelte-1txqlrd"), st(o, "width", l), Ye(i, "class", "progress-bar-wrap svelte-1txqlrd"), Ye(t, "class", "progress-level svelte-1txqlrd"); }, m(s, a) { - q(s, t, a), St(t, n), u && u.m(n, null), St(t, r), St(t, i), St(i, o), e[30](o); + G(s, t, a), yt(t, n), u && u.m(n, null), yt(t, r), yt(t, i), yt(i, o), e[30](o); }, p(s, a) { /*progress*/ - s[7] != null ? u ? u.p(s, a) : (u = fl(s), u.c(), u.m(n, null)) : u && (u.d(1), u = null), a[0] & /*last_progress_level*/ + s[7] != null ? u ? u.p(s, a) : (u = il(s), u.c(), u.m(n, null)) : u && (u.d(1), u = null), a[0] & /*last_progress_level*/ 32768 && l !== (l = `${/*last_progress_level*/ - s[15] * 100}%`) && ft(o, "width", l); + s[15] * 100}%`) && st(o, "width", l); }, - i: di, - o: di, + i: ui, + o: ui, d(s) { - s && G(t), u && u.d(), e[30](null); + s && F(t), u && u.d(), e[30](null); } }; } -function fl(e) { - let t, n = Qn( +function il(e) { + let t, n = Zn( /*progress*/ e[7] ), r = []; for (let i = 0; i < n.length; i += 1) - r[i] = ml(il(e, n, i)); + r[i] = ul(Ko(e, n, i)); return { c() { for (let i = 0; i < r.length; i += 1) r[i].c(); - t = Kt(); + t = Yt(); }, m(i, o) { for (let l = 0; l < r.length; l += 1) r[l] && r[l].m(i, o); - q(i, t, o); + G(i, t, o); }, p(i, o) { if (o[0] & /*progress_level, progress*/ 16512) { - n = Qn( + n = Zn( /*progress*/ i[7] ); let l; for (l = 0; l < n.length; l += 1) { - const u = il(i, n, l); - r[l] ? r[l].p(u, o) : (r[l] = ml(u), r[l].c(), r[l].m(t.parentNode, t)); + const u = Ko(i, n, l); + r[l] ? r[l].p(u, o) : (r[l] = ul(u), r[l].c(), r[l].m(t.parentNode, t)); } for (; l < r.length; l += 1) r[l].d(1); @@ -10553,17 +10325,17 @@ function fl(e) { } }, d(i) { - i && G(t), Xs(r, i); + i && F(t), Gs(r, i); } }; } -function cl(e) { +function ol(e) { let t, n, r, i, o = ( /*i*/ - e[40] !== 0 && Zh() + e[40] !== 0 && bh() ), l = ( /*p*/ - e[38].desc != null && dl(e) + e[38].desc != null && ll(e) ), u = ( /*p*/ e[38].desc != null && /*progress_level*/ @@ -10571,85 +10343,85 @@ function cl(e) { e[14][ /*i*/ e[40] - ] != null && _l() + ] != null && sl() ), s = ( /*progress_level*/ - e[14] != null && hl(e) + e[14] != null && al(e) ); return { c() { - o && o.c(), t = Ke(), l && l.c(), n = Ke(), u && u.c(), r = Ke(), s && s.c(), i = Kt(); + o && o.c(), t = Ke(), l && l.c(), n = Ke(), u && u.c(), r = Ke(), s && s.c(), i = Yt(); }, m(a, f) { - o && o.m(a, f), q(a, t, f), l && l.m(a, f), q(a, n, f), u && u.m(a, f), q(a, r, f), s && s.m(a, f), q(a, i, f); + o && o.m(a, f), G(a, t, f), l && l.m(a, f), G(a, n, f), u && u.m(a, f), G(a, r, f), s && s.m(a, f), G(a, i, f); }, p(a, f) { /*p*/ - a[38].desc != null ? l ? l.p(a, f) : (l = dl(a), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*p*/ + a[38].desc != null ? l ? l.p(a, f) : (l = ll(a), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*p*/ a[38].desc != null && /*progress_level*/ a[14] && /*progress_level*/ a[14][ /*i*/ a[40] - ] != null ? u || (u = _l(), u.c(), u.m(r.parentNode, r)) : u && (u.d(1), u = null), /*progress_level*/ - a[14] != null ? s ? s.p(a, f) : (s = hl(a), s.c(), s.m(i.parentNode, i)) : s && (s.d(1), s = null); + ] != null ? u || (u = sl(), u.c(), u.m(r.parentNode, r)) : u && (u.d(1), u = null), /*progress_level*/ + a[14] != null ? s ? s.p(a, f) : (s = al(a), s.c(), s.m(i.parentNode, i)) : s && (s.d(1), s = null); }, d(a) { - a && (G(t), G(n), G(r), G(i)), o && o.d(a), l && l.d(a), u && u.d(a), s && s.d(a); + a && (F(t), F(n), F(r), F(i)), o && o.d(a), l && l.d(a), u && u.d(a), s && s.d(a); } }; } -function Zh(e) { +function bh(e) { let t; return { c() { - t = fe(" /"); + t = ue(" /"); }, m(n, r) { - q(n, t, r); + G(n, t, r); }, d(n) { - n && G(t); + n && F(t); } }; } -function dl(e) { +function ll(e) { let t = ( /*p*/ e[38].desc + "" ), n; return { c() { - n = fe(t); + n = ue(t); }, m(r, i) { - q(r, n, i); + G(r, n, i); }, p(r, i) { i[0] & /*progress*/ 128 && t !== (t = /*p*/ - r[38].desc + "") && Ge(n, t); + r[38].desc + "") && Ue(n, t); }, d(r) { - r && G(n); + r && F(n); } }; } -function _l(e) { +function sl(e) { let t; return { c() { - t = fe("-"); + t = ue("-"); }, m(n, r) { - q(n, t, r); + G(n, t, r); }, d(n) { - n && G(t); + n && F(t); } }; } -function hl(e) { +function al(e) { let t = (100 * /*progress_level*/ (e[14][ /*i*/ @@ -10657,10 +10429,10 @@ function hl(e) { ] || 0)).toFixed(1) + "", n, r; return { c() { - n = fe(t), r = fe("%"); + n = ue(t), r = ue("%"); }, m(i, o) { - q(i, n, o), q(i, r, o); + G(i, n, o), G(i, r, o); }, p(i, o) { o[0] & /*progress_level*/ @@ -10668,14 +10440,14 @@ function hl(e) { (i[14][ /*i*/ i[40] - ] || 0)).toFixed(1) + "") && Ge(n, t); + ] || 0)).toFixed(1) + "") && Ue(n, t); }, d(i) { - i && (G(n), G(r)); + i && (F(n), F(r)); } }; } -function ml(e) { +function ul(e) { let t, n = ( /*p*/ (e[38].desc != null || /*progress_level*/ @@ -10683,14 +10455,14 @@ function ml(e) { e[14][ /*i*/ e[40] - ] != null) && cl(e) + ] != null) && ol(e) ); return { c() { - n && n.c(), t = Kt(); + n && n.c(), t = Yt(); }, m(r, i) { - n && n.m(r, i), q(r, t, i); + n && n.m(r, i), G(r, t, i); }, p(r, i) { /*p*/ @@ -10699,41 +10471,41 @@ function ml(e) { r[14][ /*i*/ r[40] - ] != null ? n ? n.p(r, i) : (n = cl(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); + ] != null ? n ? n.p(r, i) : (n = ol(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); }, d(r) { - r && G(t), n && n.d(r); + r && F(t), n && n.d(r); } }; } -function pl(e) { +function fl(e) { let t, n; return { c() { - t = tt("p"), n = fe( + t = tt("p"), n = ue( /*loading_text*/ e[9] ), Ye(t, "class", "loading svelte-1txqlrd"); }, m(r, i) { - q(r, t, i), St(t, n); + G(r, t, i), yt(t, n); }, p(r, i) { i[0] & /*loading_text*/ - 512 && Ge( + 512 && Ue( n, /*loading_text*/ r[9] ); }, d(r) { - r && G(t); + r && F(t); } }; } -function Jh(e) { +function wh(e) { let t, n, r, i, o; - const l = [Gh, Fh], u = []; + const l = [fh, uh], u = []; function s(a, f) { return ( /*status*/ @@ -10769,12 +10541,12 @@ function Jh(e) { "border", /*border*/ e[12] - ), ft( + ), st( t, "position", /*absolute*/ e[10] ? "absolute" : "static" - ), ft( + ), st( t, "padding", /*absolute*/ @@ -10782,13 +10554,13 @@ function Jh(e) { ); }, m(a, f) { - q(a, t, f), ~n && u[n].m(t, null), e[31](t), o = !0; + G(a, t, f), ~n && u[n].m(t, null), e[31](t), o = !0; }, p(a, f) { let d = n; - n = s(a), n === d ? ~n && u[n].p(a, f) : (r && (Ws(), Zt(u[d], 1, 1, () => { + n = s(a), n === d ? ~n && u[n].p(a, f) : (r && (qs(), Zt(u[d], 1, 1, () => { u[d] = null; - }), Vs()), ~n ? (r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Wt(r, 1), r.m(t, null)) : r = null), (!o || f[0] & /*variant, show_progress*/ + }), Fs()), ~n ? (r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Wt(r, 1), r.m(t, null)) : r = null), (!o || f[0] & /*variant, show_progress*/ 320 && i !== (i = "wrap " + /*variant*/ a[8] + " " + /*show_progress*/ a[6] + " svelte-1txqlrd")) && Ye(t, "class", i), (!o || f[0] & /*variant, show_progress, status, show_progress*/ @@ -10818,13 +10590,13 @@ function Jh(e) { /*border*/ a[12] ), f[0] & /*absolute*/ - 1024 && ft( + 1024 && st( t, "position", /*absolute*/ a[10] ? "absolute" : "static" ), f[0] & /*absolute*/ - 1024 && ft( + 1024 && st( t, "padding", /*absolute*/ @@ -10838,71 +10610,71 @@ function Jh(e) { Zt(r), o = !1; }, d(a) { - a && G(t), ~n && u[n].d(), e[31](null); + a && F(t), ~n && u[n].d(), e[31](null); } }; } -let Hn = [], jr = !1; -async function Qh(e, t = !0) { +let Pn = [], Fr = !1; +async function vh(e, t = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) { - if (Hn.push(e), !jr) - jr = !0; + if (Pn.push(e), !Fr) + Fr = !0; else return; - await Dh(), requestAnimationFrame(() => { + await lh(), requestAnimationFrame(() => { let n = [0, 0]; - for (let r = 0; r < Hn.length; r++) { - const o = Hn[r].getBoundingClientRect(); + for (let r = 0; r < Pn.length; r++) { + const o = Pn[r].getBoundingClientRect(); (r === 0 || o.top + window.scrollY <= n[0]) && (n[0] = o.top + window.scrollY, n[1] = r); } - window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), jr = !1, Hn = []; + window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Fr = !1, Pn = []; }); } } -function Yh(e, t, n) { - let r, { $$slots: i = {}, $$scope: o } = t, { i18n: l } = t, { eta: u = null } = t, { queue_position: s } = t, { queue_size: a } = t, { status: f } = t, { scroll_to_output: d = !1 } = t, { timer: c = !0 } = t, { show_progress: h = "full" } = t, { message: _ = null } = t, { progress: m = null } = t, { variant: g = "default" } = t, { loading_text: p = "Loading..." } = t, { absolute: v = !0 } = t, { translucent: b = !1 } = t, { border: w = !1 } = t, { autoscroll: y } = t, S, C = !1, P = 0, k = 0, O = null, U = null, x = 0, j = null, te, ne = null, ce = !0; +function yh(e, t, n) { + let r, { $$slots: i = {}, $$scope: o } = t, { i18n: l } = t, { eta: u = null } = t, { queue_position: s } = t, { queue_size: a } = t, { status: f } = t, { scroll_to_output: d = !1 } = t, { timer: c = !0 } = t, { show_progress: _ = "full" } = t, { message: h = null } = t, { progress: p = null } = t, { variant: g = "default" } = t, { loading_text: m = "Loading..." } = t, { absolute: v = !0 } = t, { translucent: w = !1 } = t, { border: b = !1 } = t, { autoscroll: y } = t, k, C = !1, O = 0, T = 0, P = null, M = null, j = 0, q = null, ee, te = null, fe = !0; const me = () => { - n(0, u = n(26, O = n(19, pe = null))), n(24, P = performance.now()), n(25, k = 0), C = !0, _e(); + n(0, u = n(26, P = n(19, pe = null))), n(24, O = performance.now()), n(25, T = 0), C = !0, _e(); }; function _e() { requestAnimationFrame(() => { - n(25, k = (performance.now() - P) / 1e3), C && _e(); + n(25, T = (performance.now() - O) / 1e3), C && _e(); }); } function B() { - n(25, k = 0), n(0, u = n(26, O = n(19, pe = null))), C && (C = !1); + n(25, T = 0), n(0, u = n(26, P = n(19, pe = null))), C && (C = !1); } - Rh(() => { + sh(() => { C && B(); }); let pe = null; - function E(A) { - nl[A ? "unshift" : "push"](() => { - ne = A, n(16, ne), n(7, m), n(14, j), n(15, te); + function S(A) { + Qo[A ? "unshift" : "push"](() => { + te = A, n(16, te), n(7, p), n(14, q), n(15, ee); }); } - function M(A) { - nl[A ? "unshift" : "push"](() => { - S = A, n(13, S); + function D(A) { + Qo[A ? "unshift" : "push"](() => { + k = A, n(13, k); }); } return e.$$set = (A) => { - "i18n" in A && n(1, l = A.i18n), "eta" in A && n(0, u = A.eta), "queue_position" in A && n(2, s = A.queue_position), "queue_size" in A && n(3, a = A.queue_size), "status" in A && n(4, f = A.status), "scroll_to_output" in A && n(21, d = A.scroll_to_output), "timer" in A && n(5, c = A.timer), "show_progress" in A && n(6, h = A.show_progress), "message" in A && n(22, _ = A.message), "progress" in A && n(7, m = A.progress), "variant" in A && n(8, g = A.variant), "loading_text" in A && n(9, p = A.loading_text), "absolute" in A && n(10, v = A.absolute), "translucent" in A && n(11, b = A.translucent), "border" in A && n(12, w = A.border), "autoscroll" in A && n(23, y = A.autoscroll), "$$scope" in A && n(28, o = A.$$scope); + "i18n" in A && n(1, l = A.i18n), "eta" in A && n(0, u = A.eta), "queue_position" in A && n(2, s = A.queue_position), "queue_size" in A && n(3, a = A.queue_size), "status" in A && n(4, f = A.status), "scroll_to_output" in A && n(21, d = A.scroll_to_output), "timer" in A && n(5, c = A.timer), "show_progress" in A && n(6, _ = A.show_progress), "message" in A && n(22, h = A.message), "progress" in A && n(7, p = A.progress), "variant" in A && n(8, g = A.variant), "loading_text" in A && n(9, m = A.loading_text), "absolute" in A && n(10, v = A.absolute), "translucent" in A && n(11, w = A.translucent), "border" in A && n(12, b = A.border), "autoscroll" in A && n(23, y = A.autoscroll), "$$scope" in A && n(28, o = A.$$scope); }, e.$$.update = () => { e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 218103809 && (u === null && n(0, u = O), u != null && O !== u && (n(27, U = (performance.now() - P) / 1e3 + u), n(19, pe = U.toFixed(1)), n(26, O = u))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 167772160 && n(17, x = U === null || U <= 0 || !k ? null : Math.min(k / U, 1)), e.$$.dirty[0] & /*progress*/ - 128 && m != null && n(18, ce = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (m != null ? n(14, j = m.map((A) => { + 218103809 && (u === null && n(0, u = P), u != null && P !== u && (n(27, M = (performance.now() - O) / 1e3 + u), n(19, pe = M.toFixed(1)), n(26, P = u))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 167772160 && n(17, j = M === null || M <= 0 || !T ? null : Math.min(T / M, 1)), e.$$.dirty[0] & /*progress*/ + 128 && p != null && n(18, fe = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (p != null ? n(14, q = p.map((A) => { if (A.index != null && A.length != null) return A.index / A.length; if (A.progress != null) return A.progress; - })) : n(14, j = null), j ? (n(15, te = j[j.length - 1]), ne && (te === 0 ? n(16, ne.style.transition = "0", ne) : n(16, ne.style.transition = "150ms", ne))) : n(15, te = void 0)), e.$$.dirty[0] & /*status*/ + })) : n(14, q = null), q ? (n(15, ee = q[q.length - 1]), te && (ee === 0 ? n(16, te.style.transition = "0", te) : n(16, te.style.transition = "150ms", te))) : n(15, ee = void 0)), e.$$.dirty[0] & /*status*/ 16 && (f === "pending" ? me() : B()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 10493968 && S && d && (f === "pending" || f === "complete") && Qh(S, y), e.$$.dirty[0] & /*status, message*/ + 10493968 && k && d && (f === "pending" || f === "complete") && vh(k, y), e.$$.dirty[0] & /*status, message*/ 4194320, e.$$.dirty[0] & /*timer_diff*/ - 33554432 && n(20, r = k.toFixed(1)); + 33554432 && n(20, r = T.toFixed(1)); }, [ u, l, @@ -10910,42 +10682,42 @@ function Yh(e, t, n) { a, f, c, - h, - m, - g, + _, p, + g, + m, v, - b, w, - S, - j, + b, + k, + q, + ee, te, - ne, - x, - ce, + j, + fe, pe, r, d, - _, + h, y, - P, - k, O, - U, + T, + P, + M, o, i, - E, - M + S, + D ]; } -class Kh extends Ah { +class Eh extends Q_ { constructor(t) { - super(), Oh( + super(), nh( this, t, - Yh, - Jh, - Nh, + yh, + wh, + ih, { i18n: 1, eta: 0, @@ -10969,7 +10741,7 @@ class Kh extends Ah { ); } } -const gl = (e) => { +const cl = (e) => { let t = ["B", "KB", "MB", "GB", "PB"], n = 0; for (; e > 1024; ) e /= 1024, n++; @@ -10977,63 +10749,63 @@ const gl = (e) => { return e.toFixed(1) + " " + r; }; const { - HtmlTag: $h, - SvelteComponent: em, - append: Ve, - attr: Qe, - check_outros: Zs, - create_component: tm, - destroy_component: nm, - destroy_each: rm, - detach: ur, - element: at, - ensure_array_like: bl, - group_outros: Js, - init: im, - insert: fr, - listen: om, - mount_component: lm, - noop: wl, - safe_not_equal: sm, - set_data: _i, - set_style: vl, - space: xr, - text: Yn, - toggle_class: yl, + HtmlTag: Sh, + SvelteComponent: kh, + append: xe, + attr: Je, + check_outros: js, + create_component: Th, + destroy_component: Ah, + destroy_each: Bh, + detach: sr, + element: ot, + ensure_array_like: dl, + group_outros: xs, + init: Ch, + insert: ar, + listen: Ih, + mount_component: Lh, + noop: _l, + safe_not_equal: Oh, + set_data: fi, + set_style: hl, + space: Gr, + text: Jn, + toggle_class: ml, transition_in: qt, - transition_out: _n -} = window.__gradio__svelte__internal, { createEventDispatcher: am } = window.__gradio__svelte__internal; -function El(e, t, n) { + transition_out: cn +} = window.__gradio__svelte__internal, { createEventDispatcher: Ph } = window.__gradio__svelte__internal; +function pl(e, t, n) { const r = e.slice(); return r[7] = t[n], r[9] = n, r; } -function um(e) { +function Nh(e) { let t = ( /*i18n*/ e[2]("file.uploading") + "" ), n; return { c() { - n = Yn(t); + n = Jn(t); }, m(r, i) { - fr(r, n, i); + ar(r, n, i); }, p(r, i) { i & /*i18n*/ 4 && t !== (t = /*i18n*/ - r[2]("file.uploading") + "") && _i(n, t); + r[2]("file.uploading") + "") && fi(n, t); }, - i: wl, - o: wl, + i: _l, + o: _l, d(r) { - r && ur(n); + r && sr(n); } }; } -function fm(e) { +function Hh(e) { let t, n; - return t = new Ns({ + return t = new Cs({ props: { href: ( /*file*/ @@ -11043,15 +10815,15 @@ function fm(e) { /*file*/ e[7].orig_name ), - $$slots: { default: [cm] }, + $$slots: { default: [Dh] }, $$scope: { ctx: e } } }), { c() { - tm(t.$$.fragment); + Th(t.$$.fragment); }, m(r, i) { - lm(t, r, i), n = !0; + Lh(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -11068,58 +10840,58 @@ function fm(e) { n || (qt(t.$$.fragment, r), n = !0); }, o(r) { - _n(t.$$.fragment, r), n = !1; + cn(t.$$.fragment, r), n = !1; }, d(r) { - nm(t, r); + Ah(t, r); } }; } -function cm(e) { +function Dh(e) { let t, n = ( /*file*/ - (e[7].size != null ? gl( + (e[7].size != null ? cl( /*file*/ e[7].size ) : "(size unknown)") + "" ), r; return { c() { - t = new $h(!1), r = Yn(" ⇣"), t.a = r; + t = new Sh(!1), r = Jn(" ⇣"), t.a = r; }, m(i, o) { - t.m(n, i, o), fr(i, r, o); + t.m(n, i, o), ar(i, r, o); }, p(i, o) { o & /*normalized_files*/ 8 && n !== (n = /*file*/ - (i[7].size != null ? gl( + (i[7].size != null ? cl( /*file*/ i[7].size ) : "(size unknown)") + "") && t.p(n); }, d(i) { - i && (t.d(), ur(r)); + i && (t.d(), sr(r)); } }; } -function Sl(e) { +function gl(e) { let t, n, r, i = ( /*file*/ e[7].filename_stem + "" ), o, l, u, s = ( /*file*/ e[7].filename_ext + "" - ), a, f, d, c, h, _, m, g, p, v; - const b = [fm, um], w = []; - function y(C, P) { + ), a, f, d, c, _, h, p, g, m, v; + const w = [Hh, Nh], b = []; + function y(C, O) { return ( /*file*/ C[7].url ? 0 : 1 ); } - h = y(e), _ = w[h] = b[h](e); - function S() { + _ = y(e), h = b[_] = w[_](e); + function k() { return ( /*click_handler*/ e[6]( @@ -11132,30 +10904,30 @@ function Sl(e) { } return { c() { - t = at("tr"), n = at("td"), r = at("span"), o = Yn(i), l = xr(), u = at("span"), a = Yn(s), d = xr(), c = at("td"), _.c(), m = xr(), Qe(r, "class", "stem svelte-144xq2d"), Qe(u, "class", "ext svelte-144xq2d"), Qe(n, "class", "filename svelte-144xq2d"), Qe(n, "aria-label", f = /*file*/ - e[7].orig_name), Qe(c, "class", "download svelte-144xq2d"), Qe(t, "class", "file svelte-144xq2d"), yl( + t = ot("tr"), n = ot("td"), r = ot("span"), o = Jn(i), l = Gr(), u = ot("span"), a = Jn(s), d = Gr(), c = ot("td"), h.c(), p = Gr(), Je(r, "class", "stem svelte-144xq2d"), Je(u, "class", "ext svelte-144xq2d"), Je(n, "class", "filename svelte-144xq2d"), Je(n, "aria-label", f = /*file*/ + e[7].orig_name), Je(c, "class", "download svelte-144xq2d"), Je(t, "class", "file svelte-144xq2d"), ml( t, "selectable", /*selectable*/ e[0] ); }, - m(C, P) { - fr(C, t, P), Ve(t, n), Ve(n, r), Ve(r, o), Ve(n, l), Ve(n, u), Ve(u, a), Ve(t, d), Ve(t, c), w[h].m(c, null), Ve(t, m), g = !0, p || (v = om(t, "click", S), p = !0); + m(C, O) { + ar(C, t, O), xe(t, n), xe(n, r), xe(r, o), xe(n, l), xe(n, u), xe(u, a), xe(t, d), xe(t, c), b[_].m(c, null), xe(t, p), g = !0, m || (v = Ih(t, "click", k), m = !0); }, - p(C, P) { - e = C, (!g || P & /*normalized_files*/ + p(C, O) { + e = C, (!g || O & /*normalized_files*/ 8) && i !== (i = /*file*/ - e[7].filename_stem + "") && _i(o, i), (!g || P & /*normalized_files*/ + e[7].filename_stem + "") && fi(o, i), (!g || O & /*normalized_files*/ 8) && s !== (s = /*file*/ - e[7].filename_ext + "") && _i(a, s), (!g || P & /*normalized_files*/ + e[7].filename_ext + "") && fi(a, s), (!g || O & /*normalized_files*/ 8 && f !== (f = /*file*/ - e[7].orig_name)) && Qe(n, "aria-label", f); - let k = h; - h = y(e), h === k ? w[h].p(e, P) : (Js(), _n(w[k], 1, 1, () => { - w[k] = null; - }), Zs(), _ = w[h], _ ? _.p(e, P) : (_ = w[h] = b[h](e), _.c()), qt(_, 1), _.m(c, null)), (!g || P & /*selectable*/ - 1) && yl( + e[7].orig_name)) && Je(n, "aria-label", f); + let T = _; + _ = y(e), _ === T ? b[_].p(e, O) : (xs(), cn(b[T], 1, 1, () => { + b[T] = null; + }), js(), h = b[_], h ? h.p(e, O) : (h = b[_] = w[_](e), h.c()), qt(h, 1), h.m(c, null)), (!g || O & /*selectable*/ + 1) && ml( t, "selectable", /*selectable*/ @@ -11163,39 +10935,39 @@ function Sl(e) { ); }, i(C) { - g || (qt(_), g = !0); + g || (qt(h), g = !0); }, o(C) { - _n(_), g = !1; + cn(h), g = !1; }, d(C) { - C && ur(t), w[h].d(), p = !1, v(); + C && sr(t), b[_].d(), m = !1, v(); } }; } -function dm(e) { - let t, n, r, i, o = bl( +function Mh(e) { + let t, n, r, i, o = dl( /*normalized_files*/ e[3] ), l = []; for (let s = 0; s < o.length; s += 1) - l[s] = Sl(El(e, o, s)); - const u = (s) => _n(l[s], 1, 1, () => { + l[s] = gl(pl(e, o, s)); + const u = (s) => cn(l[s], 1, 1, () => { l[s] = null; }); return { c() { - t = at("div"), n = at("table"), r = at("tbody"); + t = ot("div"), n = ot("table"), r = ot("tbody"); for (let s = 0; s < l.length; s += 1) l[s].c(); - Qe(r, "class", "svelte-144xq2d"), Qe(n, "class", "file-preview svelte-144xq2d"), Qe(t, "class", "file-preview-holder"), vl(t, "max-height", typeof /*height*/ + Je(r, "class", "svelte-144xq2d"), Je(n, "class", "file-preview svelte-144xq2d"), Je(t, "class", "file-preview-holder"), hl(t, "max-height", typeof /*height*/ e[1] === void 0 ? "auto" : ( /*height*/ e[1] + "px" )); }, m(s, a) { - fr(s, t, a), Ve(t, n), Ve(n, r); + ar(s, t, a), xe(t, n), xe(n, r); for (let f = 0; f < l.length; f += 1) l[f] && l[f].m(r, null); i = !0; @@ -11203,21 +10975,21 @@ function dm(e) { p(s, [a]) { if (a & /*selectable, dispatch, normalized_files, window, i18n*/ 29) { - o = bl( + o = dl( /*normalized_files*/ s[3] ); let f; for (f = 0; f < o.length; f += 1) { - const d = El(s, o, f); - l[f] ? (l[f].p(d, a), qt(l[f], 1)) : (l[f] = Sl(d), l[f].c(), qt(l[f], 1), l[f].m(r, null)); + const d = pl(s, o, f); + l[f] ? (l[f].p(d, a), qt(l[f], 1)) : (l[f] = gl(d), l[f].c(), qt(l[f], 1), l[f].m(r, null)); } - for (Js(), f = o.length; f < l.length; f += 1) + for (xs(), f = o.length; f < l.length; f += 1) u(f); - Zs(); + js(); } (!i || a & /*height*/ - 2) && vl(t, "max-height", typeof /*height*/ + 2) && hl(t, "max-height", typeof /*height*/ s[1] === void 0 ? "auto" : ( /*height*/ s[1] + "px" @@ -11233,24 +11005,24 @@ function dm(e) { o(s) { l = l.filter(Boolean); for (let a = 0; a < l.length; a += 1) - _n(l[a]); + cn(l[a]); i = !1; }, d(s) { - s && ur(t), rm(l, s); + s && sr(t), Bh(l, s); } }; } -function _m(e, t) { +function Rh(e, t) { return e ?? t(); } -function hm(e) { +function Uh(e) { const t = e.lastIndexOf("."); return t === -1 ? [e, ""] : [e.slice(0, t), e.slice(t)]; } -function mm(e, t, n) { +function Fh(e, t, n) { let r; - const i = am(); + const i = Ph(); let { value: o } = t, { selectable: l = !1 } = t, { height: u = void 0 } = t, { i18n: s } = t; const a = (f, d) => i("select", { value: f.orig_name, index: d }); return e.$$set = (f) => { @@ -11258,14 +11030,14 @@ function mm(e, t, n) { }, e.$$.update = () => { e.$$.dirty & /*value*/ 32 && n(3, r = (Array.isArray(o) ? o : [o]).map((f) => { - const [d, c] = hm(_m(f.orig_name, () => "")); + const [d, c] = Uh(Rh(f.orig_name, () => "")); return { ...f, filename_stem: d, filename_ext: c }; })); }, [l, u, s, r, i, o, a]; } -class pm extends em { +class Gh extends kh { constructor(t) { - super(), im(this, t, mm, dm, sm, { + super(), Ch(this, t, Fh, Mh, Oh, { value: 5, selectable: 0, height: 1, @@ -11274,30 +11046,30 @@ class pm extends em { } } const { - SvelteComponent: gm, - add_flush_callback: bm, - bind: wm, - binding_callbacks: vm, - bubble: ym, - check_outros: Em, - create_component: Kn, - create_slot: Sm, - destroy_component: $n, - detach: hi, - empty: km, - get_all_dirty_from_scope: Tm, - get_slot_changes: Am, - group_outros: Bm, - init: Cm, - insert: mi, - mount_component: er, - safe_not_equal: Im, - space: Qs, - transition_in: Tt, - transition_out: At, - update_slot_base: Lm -} = window.__gradio__svelte__internal, { createEventDispatcher: Pm, tick: Om } = window.__gradio__svelte__internal; -function Hm(e) { + SvelteComponent: qh, + add_flush_callback: jh, + bind: xh, + binding_callbacks: zh, + bubble: Vh, + check_outros: Xh, + create_component: Qn, + create_slot: Wh, + destroy_component: Yn, + detach: ci, + empty: Zh, + get_all_dirty_from_scope: Jh, + get_slot_changes: Qh, + group_outros: Yh, + init: Kh, + insert: di, + mount_component: Kn, + safe_not_equal: $h, + space: zs, + transition_in: St, + transition_out: kt, + update_slot_base: em +} = window.__gradio__svelte__internal, { createEventDispatcher: tm, tick: nm } = window.__gradio__svelte__internal; +function rm(e) { let t, n, r; function i(l) { e[15](l); @@ -11315,22 +11087,22 @@ function Hm(e) { /*root*/ e[5] ), - $$slots: { default: [Mm] }, + $$slots: { default: [om] }, $$scope: { ctx: e } }; return ( /*dragging*/ e[8] !== void 0 && (o.dragging = /*dragging*/ - e[8]), t = new Id({ props: o }), vm.push(() => wm(t, "dragging", i)), t.$on( + e[8]), t = new ed({ props: o }), zh.push(() => xh(t, "dragging", i)), t.$on( "load", /*handle_upload*/ e[10] ), { c() { - Kn(t.$$.fragment); + Qn(t.$$.fragment); }, m(l, u) { - er(t, l, u), r = !0; + Kn(t, l, u), r = !0; }, p(l, u) { const s = {}; @@ -11343,23 +11115,23 @@ function Hm(e) { l[5]), u & /*$$scope*/ 65536 && (s.$$scope = { dirty: u, ctx: l }), !n && u & /*dragging*/ 256 && (n = !0, s.dragging = /*dragging*/ - l[8], bm(() => n = !1)), t.$set(s); + l[8], jh(() => n = !1)), t.$set(s); }, i(l) { - r || (Tt(t.$$.fragment, l), r = !0); + r || (St(t.$$.fragment, l), r = !0); }, o(l) { - At(t.$$.fragment, l), r = !1; + kt(t.$$.fragment, l), r = !1; }, d(l) { - $n(t, l); + Yn(t, l); } } ); } -function Nm(e) { +function im(e) { let t, n, r, i; - return t = new ki({ + return t = new yi({ props: { i18n: ( /*i18n*/ e[7] @@ -11368,7 +11140,7 @@ function Nm(e) { "clear", /*handle_clear*/ e[11] - ), r = new pm({ + ), r = new Gh({ props: { i18n: ( /*i18n*/ @@ -11393,10 +11165,10 @@ function Nm(e) { e[14] ), { c() { - Kn(t.$$.fragment), n = Qs(), Kn(r.$$.fragment); + Qn(t.$$.fragment), n = zs(), Qn(r.$$.fragment); }, m(o, l) { - er(t, o, l), mi(o, n, l), er(r, o, l), i = !0; + Kn(t, o, l), di(o, n, l), Kn(r, o, l), i = !0; }, p(o, l) { const u = {}; @@ -11415,22 +11187,22 @@ function Nm(e) { o[6]), r.$set(s); }, i(o) { - i || (Tt(t.$$.fragment, o), Tt(r.$$.fragment, o), i = !0); + i || (St(t.$$.fragment, o), St(r.$$.fragment, o), i = !0); }, o(o) { - At(t.$$.fragment, o), At(r.$$.fragment, o), i = !1; + kt(t.$$.fragment, o), kt(r.$$.fragment, o), i = !1; }, d(o) { - o && hi(n), $n(t, o), $n(r, o); + o && ci(n), Yn(t, o), Yn(r, o); } }; } -function Mm(e) { +function om(e) { let t; const n = ( /*#slots*/ e[13].default - ), r = Sm( + ), r = Wh( n, e, /*$$scope*/ @@ -11446,19 +11218,19 @@ function Mm(e) { }, p(i, o) { r && r.p && (!t || o & /*$$scope*/ - 65536) && Lm( + 65536) && em( r, n, i, /*$$scope*/ i[16], - t ? Am( + t ? Qh( n, /*$$scope*/ i[16], o, null - ) : Tm( + ) : Jh( /*$$scope*/ i[16] ), @@ -11466,25 +11238,25 @@ function Mm(e) { ); }, i(i) { - t || (Tt(r, i), t = !0); + t || (St(r, i), t = !0); }, o(i) { - At(r, i), t = !1; + kt(r, i), t = !1; }, d(i) { r && r.d(i); } }; } -function Dm(e) { +function lm(e) { let t, n, r, i, o, l, u; - t = new Pl({ + t = new Tl({ props: { show_label: ( /*show_label*/ e[2] ), - Icon: Zu, + Icon: Hu, float: ( /*value*/ e[0] === null @@ -11495,7 +11267,7 @@ function Dm(e) { ) } }); - const s = [Nm, Hm], a = []; + const s = [im, rm], a = []; function f(d, c) { return c & /*value*/ 1 && (r = null), r == null && (r = !!/*value*/ @@ -11507,56 +11279,56 @@ function Dm(e) { } return i = f(e, -1), o = a[i] = s[i](e), { c() { - Kn(t.$$.fragment), n = Qs(), o.c(), l = km(); + Qn(t.$$.fragment), n = zs(), o.c(), l = Zh(); }, m(d, c) { - er(t, d, c), mi(d, n, c), a[i].m(d, c), mi(d, l, c), u = !0; + Kn(t, d, c), di(d, n, c), a[i].m(d, c), di(d, l, c), u = !0; }, p(d, [c]) { - const h = {}; + const _ = {}; c & /*show_label*/ - 4 && (h.show_label = /*show_label*/ + 4 && (_.show_label = /*show_label*/ d[2]), c & /*value*/ - 1 && (h.float = /*value*/ + 1 && (_.float = /*value*/ d[0] === null), c & /*label*/ - 2 && (h.label = /*label*/ - d[1] || "File"), t.$set(h); - let _ = i; - i = f(d, c), i === _ ? a[i].p(d, c) : (Bm(), At(a[_], 1, 1, () => { - a[_] = null; - }), Em(), o = a[i], o ? o.p(d, c) : (o = a[i] = s[i](d), o.c()), Tt(o, 1), o.m(l.parentNode, l)); + 2 && (_.label = /*label*/ + d[1] || "File"), t.$set(_); + let h = i; + i = f(d, c), i === h ? a[i].p(d, c) : (Yh(), kt(a[h], 1, 1, () => { + a[h] = null; + }), Xh(), o = a[i], o ? o.p(d, c) : (o = a[i] = s[i](d), o.c()), St(o, 1), o.m(l.parentNode, l)); }, i(d) { - u || (Tt(t.$$.fragment, d), Tt(o), u = !0); + u || (St(t.$$.fragment, d), St(o), u = !0); }, o(d) { - At(t.$$.fragment, d), At(o), u = !1; + kt(t.$$.fragment, d), kt(o), u = !1; }, d(d) { - d && (hi(n), hi(l)), $n(t, d), a[i].d(d); + d && (ci(n), ci(l)), Yn(t, d), a[i].d(d); } }; } -function Rm(e, t, n) { - let { $$slots: r = {}, $$scope: i } = t, { value: o } = t, { label: l } = t, { show_label: u = !0 } = t, { file_count: s = "single" } = t, { file_types: a = null } = t, { selectable: f = !1 } = t, { root: d } = t, { height: c = void 0 } = t, { i18n: h } = t; - async function _({ detail: y }) { - n(0, o = y), await Om(), g("change", o), g("upload", y); +function sm(e, t, n) { + let { $$slots: r = {}, $$scope: i } = t, { value: o } = t, { label: l } = t, { show_label: u = !0 } = t, { file_count: s = "single" } = t, { file_types: a = null } = t, { selectable: f = !1 } = t, { root: d } = t, { height: c = void 0 } = t, { i18n: _ } = t; + async function h({ detail: y }) { + n(0, o = y), await nm(), g("change", o), g("upload", y); } - function m() { + function p() { n(0, o = null), g("change", null), g("clear"); } - const g = Pm(); - let p; - a == null ? p = null : (a = a.map((y) => y.startsWith(".") ? y : y + "/*"), p = a.join(", ")); + const g = tm(); + let m; + a == null ? m = null : (a = a.map((y) => y.startsWith(".") ? y : y + "/*"), m = a.join(", ")); let v = !1; - function b(y) { - ym.call(this, e, y); - } function w(y) { + Vh.call(this, e, y); + } + function b(y) { v = y, n(8, v); } return e.$$set = (y) => { - "value" in y && n(0, o = y.value), "label" in y && n(1, l = y.label), "show_label" in y && n(2, u = y.show_label), "file_count" in y && n(3, s = y.file_count), "file_types" in y && n(12, a = y.file_types), "selectable" in y && n(4, f = y.selectable), "root" in y && n(5, d = y.root), "height" in y && n(6, c = y.height), "i18n" in y && n(7, h = y.i18n), "$$scope" in y && n(16, i = y.$$scope); + "value" in y && n(0, o = y.value), "label" in y && n(1, l = y.label), "show_label" in y && n(2, u = y.show_label), "file_count" in y && n(3, s = y.file_count), "file_types" in y && n(12, a = y.file_types), "selectable" in y && n(4, f = y.selectable), "root" in y && n(5, d = y.root), "height" in y && n(6, c = y.height), "i18n" in y && n(7, _ = y.i18n), "$$scope" in y && n(16, i = y.$$scope); }, e.$$.update = () => { e.$$.dirty & /*dragging*/ 256 && g("drag", v); @@ -11568,21 +11340,21 @@ function Rm(e, t, n) { f, d, c, - h, - v, - p, _, + v, m, + h, + p, a, r, - b, w, + b, i ]; } -class Um extends gm { +class am extends qh { constructor(t) { - super(), Cm(this, t, Rm, Dm, Im, { + super(), Kh(this, t, sm, lm, $h, { value: 0, label: 1, show_label: 2, @@ -11596,28 +11368,28 @@ class Um extends gm { } } const { - SvelteComponent: Fm, - add_flush_callback: kl, - assign: Gm, - bind: Tl, - binding_callbacks: Al, - check_outros: qm, - create_component: yn, - destroy_component: En, - detach: Bl, - empty: jm, - get_spread_object: xm, - get_spread_update: zm, - group_outros: Vm, - init: Xm, - insert: Cl, - mount_component: Sn, - safe_not_equal: Wm, - space: Zm, - transition_in: Bt, - transition_out: Ct -} = window.__gradio__svelte__internal, { createEventDispatcher: Jm } = window.__gradio__svelte__internal; -function Qm(e) { + SvelteComponent: um, + add_flush_callback: bl, + assign: fm, + bind: wl, + binding_callbacks: vl, + check_outros: cm, + create_component: vn, + destroy_component: yn, + detach: yl, + empty: dm, + get_spread_object: _m, + get_spread_update: hm, + group_outros: mm, + init: pm, + insert: El, + mount_component: En, + safe_not_equal: gm, + space: bm, + transition_in: Tt, + transition_out: At +} = window.__gradio__svelte__internal, { createEventDispatcher: wm } = window.__gradio__svelte__internal; +function vm(e) { let t, n, r, i; function o(s) { e[25](s); @@ -11688,7 +11460,7 @@ function Qm(e) { e[1] !== void 0 && (u.selected_index = /*selected_index*/ e[1]), /*value*/ e[0] !== void 0 && (u.value = /*value*/ - e[0]), t = new mh({ props: u }), Al.push(() => Tl(t, "selected_index", o)), Al.push(() => Tl(t, "value", l)), t.$on( + e[0]), t = new F_({ props: u }), vl.push(() => wl(t, "selected_index", o)), vl.push(() => wl(t, "value", l)), t.$on( "change", /*change_handler*/ e[27] @@ -11706,10 +11478,10 @@ function Qm(e) { e[30] ), { c() { - yn(t.$$.fragment); + vn(t.$$.fragment); }, m(s, a) { - Sn(t, s, a), i = !0; + En(t, s, a), i = !0; }, p(s, a) { const f = {}; @@ -11743,25 +11515,25 @@ function Qm(e) { 4194304 && (f.i18n = /*gradio*/ s[22].i18n), !n && a[0] & /*selected_index*/ 2 && (n = !0, f.selected_index = /*selected_index*/ - s[1], kl(() => n = !1)), !r && a[0] & /*value*/ + s[1], bl(() => n = !1)), !r && a[0] & /*value*/ 1 && (r = !0, f.value = /*value*/ - s[0], kl(() => r = !1)), t.$set(f); + s[0], bl(() => r = !1)), t.$set(f); }, i(s) { - i || (Bt(t.$$.fragment, s), i = !0); + i || (Tt(t.$$.fragment, s), i = !0); }, o(s) { - Ct(t.$$.fragment, s), i = !1; + At(t.$$.fragment, s), i = !1; }, d(s) { - En(t, s); + yn(t, s); } } ); } -function Ym(e) { +function ym(e) { let t, n; - return t = new Um({ + return t = new am({ props: { value: null, root: ( @@ -11778,7 +11550,7 @@ function Ym(e) { /*gradio*/ e[22].i18n ), - $$slots: { default: [Km] }, + $$slots: { default: [Em] }, $$scope: { ctx: e } } }), t.$on( @@ -11787,10 +11559,10 @@ function Ym(e) { e[24] ), { c() { - yn(t.$$.fragment); + vn(t.$$.fragment); }, m(r, i) { - Sn(t, r, i), n = !0; + En(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -11805,19 +11577,19 @@ function Ym(e) { 2 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o); }, i(r) { - n || (Bt(t.$$.fragment, r), n = !0); + n || (Tt(t.$$.fragment, r), n = !0); }, o(r) { - Ct(t.$$.fragment, r), n = !1; + At(t.$$.fragment, r), n = !1; }, d(r) { - En(t, r); + yn(t, r); } }; } -function Km(e) { +function Em(e) { let t, n; - return t = new Jf({ + return t = new vf({ props: { i18n: ( /*gradio*/ @@ -11827,10 +11599,10 @@ function Km(e) { } }), { c() { - yn(t.$$.fragment); + vn(t.$$.fragment); }, m(r, i) { - Sn(t, r, i), n = !0; + En(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -11839,17 +11611,17 @@ function Km(e) { r[22].i18n), t.$set(o); }, i(r) { - n || (Bt(t.$$.fragment, r), n = !0); + n || (Tt(t.$$.fragment, r), n = !0); }, o(r) { - Ct(t.$$.fragment, r), n = !1; + At(t.$$.fragment, r), n = !1; }, d(r) { - En(t, r); + yn(t, r); } }; } -function $m(e) { +function Sm(e) { let t, n, r, i, o, l; const u = [ { @@ -11867,10 +11639,10 @@ function $m(e) { ]; let s = {}; for (let c = 0; c < u.length; c += 1) - s = Gm(s, u[c]); - t = new Kh({ props: s }); - const a = [Ym, Qm], f = []; - function d(c, h) { + s = fm(s, u[c]); + t = new Eh({ props: s }); + const a = [ym, vm], f = []; + function d(c, _) { return ( /*interactive*/ c[20] && /*no_value*/ @@ -11879,52 +11651,52 @@ function $m(e) { } return r = d(e), i = f[r] = a[r](e), { c() { - yn(t.$$.fragment), n = Zm(), i.c(), o = jm(); + vn(t.$$.fragment), n = bm(), i.c(), o = dm(); }, - m(c, h) { - Sn(t, c, h), Cl(c, n, h), f[r].m(c, h), Cl(c, o, h), l = !0; + m(c, _) { + En(t, c, _), El(c, n, _), f[r].m(c, _), El(c, o, _), l = !0; }, - p(c, h) { - const _ = h[0] & /*gradio, loading_status*/ - 4194308 ? zm(u, [ - h[0] & /*gradio*/ + p(c, _) { + const h = _[0] & /*gradio, loading_status*/ + 4194308 ? hm(u, [ + _[0] & /*gradio*/ 4194304 && { autoscroll: ( /*gradio*/ c[22].autoscroll ) }, - h[0] & /*gradio*/ + _[0] & /*gradio*/ 4194304 && { i18n: ( /*gradio*/ c[22].i18n ) }, - h[0] & /*loading_status*/ - 4 && xm( + _[0] & /*loading_status*/ + 4 && _m( /*loading_status*/ c[2] ) ]) : {}; - t.$set(_); - let m = r; - r = d(c), r === m ? f[r].p(c, h) : (Vm(), Ct(f[m], 1, 1, () => { - f[m] = null; - }), qm(), i = f[r], i ? i.p(c, h) : (i = f[r] = a[r](c), i.c()), Bt(i, 1), i.m(o.parentNode, o)); + t.$set(h); + let p = r; + r = d(c), r === p ? f[r].p(c, _) : (mm(), At(f[p], 1, 1, () => { + f[p] = null; + }), cm(), i = f[r], i ? i.p(c, _) : (i = f[r] = a[r](c), i.c()), Tt(i, 1), i.m(o.parentNode, o)); }, i(c) { - l || (Bt(t.$$.fragment, c), Bt(i), l = !0); + l || (Tt(t.$$.fragment, c), Tt(i), l = !0); }, o(c) { - Ct(t.$$.fragment, c), Ct(i), l = !1; + At(t.$$.fragment, c), At(i), l = !1; }, d(c) { - c && (Bl(n), Bl(o)), En(t, c), f[r].d(c); + c && (yl(n), yl(o)), yn(t, c), f[r].d(c); } }; } -function ep(e) { +function km(e) { let t, n; - return t = new ba({ + return t = new da({ props: { visible: ( /*visible*/ @@ -11958,15 +11730,15 @@ function ep(e) { /*height*/ e[15] ) : void 0, - $$slots: { default: [$m] }, + $$slots: { default: [Sm] }, $$scope: { ctx: e } } }), { c() { - yn(t.$$.fragment); + vn(t.$$.fragment); }, m(r, i) { - Sn(t, r, i), n = !0; + En(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -11992,35 +11764,35 @@ function ep(e) { 2 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o); }, i(r) { - n || (Bt(t.$$.fragment, r), n = !0); + n || (Tt(t.$$.fragment, r), n = !0); }, o(r) { - Ct(t.$$.fragment, r), n = !1; + At(t.$$.fragment, r), n = !1; }, d(r) { - En(t, r); + yn(t, r); } }; } -function tp(e, t, n) { - let r, { loading_status: i } = t, { show_label: o } = t, { label: l } = t, { root: u } = t, { proxy_url: s } = t, { elem_id: a = "" } = t, { elem_classes: f = [] } = t, { visible: d = !0 } = t, { value: c = null } = t, { container: h = !0 } = t, { scale: _ = null } = t, { min_width: m = void 0 } = t, { columns: g = [2] } = t, { rows: p = void 0 } = t, { height: v = "auto" } = t, { preview: b } = t, { allow_preview: w = !0 } = t, { selected_index: y = null } = t, { object_fit: S = "cover" } = t, { show_share_button: C = !1 } = t, { interactive: P } = t, { show_download_button: k = !1 } = t, { gradio: O } = t; - const U = Jm(), x = (B) => { +function Tm(e, t, n) { + let r, { loading_status: i } = t, { show_label: o } = t, { label: l } = t, { root: u } = t, { proxy_url: s } = t, { elem_id: a = "" } = t, { elem_classes: f = [] } = t, { visible: d = !0 } = t, { value: c = null } = t, { container: _ = !0 } = t, { scale: h = null } = t, { min_width: p = void 0 } = t, { columns: g = [2] } = t, { rows: m = void 0 } = t, { height: v = "auto" } = t, { preview: w } = t, { allow_preview: b = !0 } = t, { selected_index: y = null } = t, { object_fit: k = "cover" } = t, { show_share_button: C = !1 } = t, { interactive: O } = t, { show_download_button: T = !1 } = t, { gradio: P } = t; + const M = wm(), j = (B) => { const pe = Array.isArray(B.detail) ? B.detail : [B.detail]; - n(0, c = pe.map((E) => ({ image: E, caption: null }))), O.dispatch("upload", c); + n(0, c = pe.map((S) => ({ image: S, caption: null }))), P.dispatch("upload", c); }; - function j(B) { + function q(B) { y = B, n(1, y); } - function te(B) { + function ee(B) { c = B, n(0, c); } - const ne = () => O.dispatch("change", c), ce = (B) => O.dispatch("select", B.detail), me = (B) => O.dispatch("share", B.detail), _e = (B) => O.dispatch("error", B.detail); + const te = () => P.dispatch("change", c), fe = (B) => P.dispatch("select", B.detail), me = (B) => P.dispatch("share", B.detail), _e = (B) => P.dispatch("error", B.detail); return e.$$set = (B) => { - "loading_status" in B && n(2, i = B.loading_status), "show_label" in B && n(3, o = B.show_label), "label" in B && n(4, l = B.label), "root" in B && n(5, u = B.root), "proxy_url" in B && n(6, s = B.proxy_url), "elem_id" in B && n(7, a = B.elem_id), "elem_classes" in B && n(8, f = B.elem_classes), "visible" in B && n(9, d = B.visible), "value" in B && n(0, c = B.value), "container" in B && n(10, h = B.container), "scale" in B && n(11, _ = B.scale), "min_width" in B && n(12, m = B.min_width), "columns" in B && n(13, g = B.columns), "rows" in B && n(14, p = B.rows), "height" in B && n(15, v = B.height), "preview" in B && n(16, b = B.preview), "allow_preview" in B && n(17, w = B.allow_preview), "selected_index" in B && n(1, y = B.selected_index), "object_fit" in B && n(18, S = B.object_fit), "show_share_button" in B && n(19, C = B.show_share_button), "interactive" in B && n(20, P = B.interactive), "show_download_button" in B && n(21, k = B.show_download_button), "gradio" in B && n(22, O = B.gradio); + "loading_status" in B && n(2, i = B.loading_status), "show_label" in B && n(3, o = B.show_label), "label" in B && n(4, l = B.label), "root" in B && n(5, u = B.root), "proxy_url" in B && n(6, s = B.proxy_url), "elem_id" in B && n(7, a = B.elem_id), "elem_classes" in B && n(8, f = B.elem_classes), "visible" in B && n(9, d = B.visible), "value" in B && n(0, c = B.value), "container" in B && n(10, _ = B.container), "scale" in B && n(11, h = B.scale), "min_width" in B && n(12, p = B.min_width), "columns" in B && n(13, g = B.columns), "rows" in B && n(14, m = B.rows), "height" in B && n(15, v = B.height), "preview" in B && n(16, w = B.preview), "allow_preview" in B && n(17, b = B.allow_preview), "selected_index" in B && n(1, y = B.selected_index), "object_fit" in B && n(18, k = B.object_fit), "show_share_button" in B && n(19, C = B.show_share_button), "interactive" in B && n(20, O = B.interactive), "show_download_button" in B && n(21, T = B.show_download_button), "gradio" in B && n(22, P = B.gradio); }, e.$$.update = () => { e.$$.dirty[0] & /*value*/ 1 && n(23, r = Array.isArray(c) ? c.length === 0 : !c), e.$$.dirty[0] & /*selected_index*/ - 2 && U("prop_change", { selected_index: y }); + 2 && M("prop_change", { selected_index: y }); }, [ c, y, @@ -12032,37 +11804,37 @@ function tp(e, t, n) { a, f, d, - h, _, - m, - g, + h, p, + g, + m, v, - b, w, - S, - C, - P, + b, k, + C, O, + T, + P, r, - x, j, + q, + ee, te, - ne, - ce, + fe, me, _e ]; } -class up extends Fm { +class Nm extends um { constructor(t) { - super(), Xm( + super(), pm( this, t, - tp, - ep, - Wm, + Tm, + km, + gm, { loading_status: 2, show_label: 3, @@ -12094,6 +11866,6 @@ class up extends Fm { } } export { - mh as BaseGallery, - up as default + F_ as BaseGallery, + Nm as default };