LennardZuendorf commited on
Commit
5306698
1 Parent(s): 2fdf375

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -2,8 +2,8 @@
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
  title: gradio_iframe V0.0.4
5
- colorFrom: red
6
- colorTo: red
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
 
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
  title: gradio_iframe V0.0.4
5
+ colorFrom: blue
6
+ colorTo: yellow
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
__pycache__/__init__.cpython-311.pyc ADDED
Binary file (183 Bytes). View file
 
__pycache__/app.cpython-311.pyc ADDED
Binary file (999 Bytes). View file
 
src/README.md CHANGED
@@ -5,9 +5,10 @@ It's currently still a work in progress.
5
  ## Usage
6
 
7
  The usage is similar to the HTML component. You can pass valid html and it will be rendered in the interface as an iframe, meaning you can embed any website or webapp that supports iframes.
8
- Also, JavaScript should run normal.
9
 
10
- You can still pass normal html that's not interactive.
 
11
 
12
  ### Example
13
 
@@ -18,19 +19,33 @@ from gradio_iframe import iFrame
18
  gr.Interface(
19
  iFrame(
20
  label="iFrame Example",
21
- value=("https://www.youtube.com/watch?v=dQw4w9WgXcQ"),
 
 
 
 
 
 
 
 
22
  show_label=True)
23
  )
24
  ```
25
 
 
 
 
 
 
26
  ## Known Issues
27
 
28
  **There are many reason why it's not a good idea to embed websites in an iframe.**
29
  See [this](https://blog.bitsrc.io/4-security-concerns-with-iframes-every-web-developer-should-know-24c73e6a33e4), or just google "iframe security concerns" for more information. Also, iFrames will use additional computing power and memory, which can slow down the interface.
30
 
31
- Also this component is still a work in progress and not fully tested. Use at your own risk.
32
 
33
  ### Other Issues
34
 
35
- - Height does not grow according to the inner component.
 
36
  - ...
 
5
  ## Usage
6
 
7
  The usage is similar to the HTML component. You can pass valid html and it will be rendered in the interface as an iframe, meaning you can embed any website or webapp that supports iframes.
8
+ Also, JavaScript should run normal. You can even pass an iframe inside an iframe (see below!), i.e. a youtube or spotify embed.
9
 
10
+ The size will adjust to the size of the iframe (onload), **this is gonna be a bit delayed**. The width is default at 100%.
11
+ You can also set the height and width manually.
12
 
13
  ### Example
14
 
 
19
  gr.Interface(
20
  iFrame(
21
  label="iFrame Example",
22
+ value=("""
23
+ <iframe width="560"
24
+ height="315"
25
+ src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G"
26
+ title="YouTube video player"
27
+ frameborder="0"
28
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
29
+ allowfullscreen>
30
+ </iframe>"""),
31
  show_label=True)
32
  )
33
  ```
34
 
35
+ ## Roadmap
36
+
37
+ - [ ] Add manual hand over of other iFrame options.
38
+ - [ ] Explore switch between src and srcdoc through variable.
39
+
40
  ## Known Issues
41
 
42
  **There are many reason why it's not a good idea to embed websites in an iframe.**
43
  See [this](https://blog.bitsrc.io/4-security-concerns-with-iframes-every-web-developer-should-know-24c73e6a33e4), or just google "iframe security concerns" for more information. Also, iFrames will use additional computing power and memory, which can slow down the interface.
44
 
45
+ Also, this component is still a work in progress and not fully tested. Use at your own risk.
46
 
47
  ### Other Issues
48
 
49
+ - Height sometimes does not grow according to the inner component.
50
+ - The component is not completely responsive yet and struggles with variable heigth.
51
  - ...
src/backend/gradio_iframe/iframe.py CHANGED
@@ -37,6 +37,7 @@ class iFrame(Component):
37
  elem_classes: list[str] | str | None = None,
38
  render: bool = True,
39
  height: str | None = None,
 
40
  ):
41
  """
42
  Parameters:
@@ -62,9 +63,10 @@ class iFrame(Component):
62
  )
63
 
64
  self.height = height
 
65
 
66
  def example_inputs(self) -> Any:
67
- return "<p>Hello</p>"
68
 
69
  def preprocess(self, payload: str | None) -> str | None:
70
  return payload
 
37
  elem_classes: list[str] | str | None = None,
38
  render: bool = True,
39
  height: str | None = None,
40
+ width: str | None = None,
41
  ):
42
  """
43
  Parameters:
 
63
  )
64
 
65
  self.height = height
66
+ self.width = width
67
 
68
  def example_inputs(self) -> Any:
69
+ return """<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>"""
70
 
71
  def preprocess(self, payload: str | None) -> str | None:
72
  return payload
src/backend/gradio_iframe/iframe.pyi CHANGED
@@ -38,6 +38,7 @@ class iFrame(Component):
38
  elem_classes: list[str] | str | None = None,
39
  render: bool = True,
40
  height: str | None = None,
 
41
  ):
42
  """
43
  Parameters:
@@ -63,9 +64,10 @@ class iFrame(Component):
63
  )
64
 
65
  self.height = height
 
66
 
67
  def example_inputs(self) -> Any:
68
- return "<p>Hello</p>"
69
 
70
  def preprocess(self, payload: str | None) -> str | None:
71
  return payload
 
38
  elem_classes: list[str] | str | None = None,
39
  render: bool = True,
40
  height: str | None = None,
41
+ width: str | None = None,
42
  ):
43
  """
44
  Parameters:
 
64
  )
65
 
66
  self.height = height
67
+ self.width = width
68
 
69
  def example_inputs(self) -> Any:
70
+ return """<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>"""
71
 
72
  def preprocess(self, payload: str | None) -> str | None:
73
  return payload
src/backend/gradio_iframe/templates/component/index.js CHANGED
@@ -1,95 +1,141 @@
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
- attr: P,
5
- detach: ft,
 
6
  element: we,
7
- init: st,
8
- insert: ot,
 
9
  noop: ve,
10
- safe_not_equal: at,
11
- toggle_class: x
12
- } = window.__gradio__svelte__internal, { createEventDispatcher: rt } = window.__gradio__svelte__internal;
13
- function _t(n) {
14
- let t, e, l;
15
  return {
16
  c() {
17
- t = we("div"), e = we("iframe"), P(e, "title", "iframe component"), P(e, "width", "100%"), P(
18
  e,
19
- "height",
20
- /*height*/
21
- n[4]
22
- ), P(
23
  e,
24
  "srcdoc",
25
  /*value*/
26
  n[1]
27
- ), P(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, P(t, "class", l = "prose " + /*elem_classes*/
28
- n[0].join(" ") + " svelte-2qygph"), x(
29
  t,
30
  "min",
31
  /*min_height*/
32
  n[3]
33
- ), x(t, "hide", !/*visible*/
34
- n[2]);
35
- },
36
- m(i, s) {
37
- ot(i, t, s), it(t, e);
38
- },
39
- p(i, [s]) {
40
- s & /*height*/
41
- 16 && P(
42
- e,
43
  "height",
44
  /*height*/
45
- i[4]
46
- ), s & /*value*/
47
- 2 && P(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  e,
49
  "srcdoc",
50
  /*value*/
51
- i[1]
52
- ), s & /*elem_classes*/
53
  1 && l !== (l = "prose " + /*elem_classes*/
54
- i[0].join(" ") + " svelte-2qygph") && P(t, "class", l), s & /*elem_classes, min_height*/
55
- 9 && x(
56
  t,
57
  "min",
58
  /*min_height*/
59
- i[3]
60
- ), s & /*elem_classes, visible*/
61
- 5 && x(t, "hide", !/*visible*/
62
- i[2]);
 
 
 
 
 
 
63
  },
64
  i: ve,
65
  o: ve,
66
- d(i) {
67
- i && ft(t);
68
  }
69
  };
70
  }
71
- function ut(n, t, e) {
72
- let { elem_classes: l = [] } = t, { value: i } = t, { visible: s = !0 } = t, { min_height: o = !1 } = t, { height: a = "100%" } = t;
73
- const r = rt();
74
- return n.$$set = (f) => {
75
- "elem_classes" in f && e(0, l = f.elem_classes), "value" in f && e(1, i = f.value), "visible" in f && e(2, s = f.visible), "min_height" in f && e(3, o = f.min_height), "height" in f && e(4, a = f.height);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }, n.$$.update = () => {
77
  n.$$.dirty & /*value*/
78
- 2 && r("change");
79
- }, [l, i, s, o, a];
 
 
 
 
 
 
 
 
 
 
80
  }
81
- class ct extends nt {
82
  constructor(t) {
83
- super(), st(this, t, ut, _t, at, {
84
  elem_classes: 0,
85
  value: 1,
86
  visible: 2,
87
  min_height: 3,
88
- height: 4
 
89
  });
90
  }
91
  }
92
- function Y(n) {
93
  let t = ["", "k", "M", "G", "T", "P", "E", "Z"], e = 0;
94
  for (; n > 1e3 && e < t.length - 1; )
95
  n /= 1e3, e++;
@@ -98,41 +144,41 @@ function Y(n) {
98
  }
99
  function te() {
100
  }
101
- function dt(n, t) {
102
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
103
  }
104
  const Re = typeof window < "u";
105
- let ye = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
106
- const G = /* @__PURE__ */ new Set();
107
- function Je(n) {
108
- G.forEach((t) => {
109
- t.c(n) || (G.delete(t), t.f());
110
- }), G.size !== 0 && Ue(Je);
111
  }
112
- function mt(n) {
113
  let t;
114
- return G.size === 0 && Ue(Je), {
115
  promise: new Promise((e) => {
116
- G.add(t = { c: n, f: e });
117
  }),
118
  abort() {
119
- G.delete(t);
120
  }
121
  };
122
  }
123
- const X = [];
124
- function bt(n, t = te) {
125
  let e;
126
  const l = /* @__PURE__ */ new Set();
127
  function i(a) {
128
- if (dt(n, a) && (n = a, e)) {
129
- const r = !X.length;
130
  for (const f of l)
131
- f[1](), X.push(f, n);
132
  if (r) {
133
- for (let f = 0; f < X.length; f += 2)
134
- X[f][0](X[f + 1]);
135
- X.length = 0;
136
  }
137
  }
138
  }
@@ -147,13 +193,13 @@ function bt(n, t = te) {
147
  }
148
  return { set: i, update: s, subscribe: o };
149
  }
150
- function ke(n) {
151
  return Object.prototype.toString.call(n) === "[object Date]";
152
  }
153
  function se(n, t, e, l) {
154
- if (typeof e == "number" || ke(e)) {
155
  const i = l - e, s = (e - t) / (n.dt || 1 / 60), o = n.opts.stiffness * i, a = n.opts.damping * s, r = (o - a) * n.inv_mass, f = (s + r) * n.dt;
156
- return Math.abs(f) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, ke(e) ? new Date(e.getTime() + f) : e + f);
157
  } else {
158
  if (Array.isArray(e))
159
  return e.map(
@@ -169,22 +215,22 @@ function se(n, t, e, l) {
169
  }
170
  }
171
  function pe(n, t = {}) {
172
- const e = bt(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
173
- let o, a, r, f = n, _ = n, m = 1, c = 0, w = !1;
174
- function y(p, L = {}) {
175
  _ = p;
176
  const F = r = {};
177
- return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (w = !0, o = ye(), f = p, e.set(n = _), Promise.resolve()) : (L.soft && (c = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), m = 0), a || (o = ye(), w = !1, a = mt((u) => {
178
- if (w)
179
- return w = !1, a = null, !1;
180
- m = Math.min(m + c, 1);
181
- const k = {
182
  inv_mass: m,
183
  opts: C,
184
  settled: !0,
185
  dt: (u - o) * 60 / 1e3
186
- }, b = se(k, f, n, _);
187
- return o = u, f = n, e.set(n = b), k.settled && (a = null), !k.settled;
188
  })), new Promise((u) => {
189
  a.promise.then(() => {
190
  F === r && u();
@@ -192,8 +238,8 @@ function pe(n, t = {}) {
192
  }));
193
  }
194
  const C = {
195
- set: y,
196
- update: (p, L) => y(p(_, n), L),
197
  subscribe: e.subscribe,
198
  stiffness: l,
199
  damping: i,
@@ -202,66 +248,66 @@ function pe(n, t = {}) {
202
  return C;
203
  }
204
  const {
205
- SvelteComponent: gt,
206
  append: N,
207
- attr: v,
208
  component_subscribe: qe,
209
- detach: ht,
210
- element: wt,
211
- init: vt,
212
- insert: yt,
213
  noop: Fe,
214
- safe_not_equal: kt,
215
  set_style: $,
216
  svg_element: z,
217
  toggle_class: Le
218
- } = window.__gradio__svelte__internal, { onMount: pt } = window.__gradio__svelte__internal;
219
- function qt(n) {
220
- let t, e, l, i, s, o, a, r, f, _, m, c;
221
  return {
222
  c() {
223
- t = wt("div"), e = z("svg"), l = z("g"), i = z("path"), s = z("path"), o = z("path"), a = z("path"), r = z("g"), f = z("path"), _ = z("path"), m = z("path"), c = z("path"), v(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), v(i, "fill", "#FF7C00"), v(i, "fill-opacity", "0.4"), v(i, "class", "svelte-43sxxs"), v(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), v(s, "fill", "#FF7C00"), v(s, "class", "svelte-43sxxs"), v(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), v(o, "fill", "#FF7C00"), v(o, "fill-opacity", "0.4"), v(o, "class", "svelte-43sxxs"), v(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), v(a, "fill", "#FF7C00"), v(a, "class", "svelte-43sxxs"), $(l, "transform", "translate(" + /*$top*/
224
  n[1][0] + "px, " + /*$top*/
225
- n[1][1] + "px)"), v(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), v(f, "fill", "#FF7C00"), v(f, "fill-opacity", "0.4"), v(f, "class", "svelte-43sxxs"), v(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), v(_, "fill", "#FF7C00"), v(_, "class", "svelte-43sxxs"), v(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), v(m, "fill", "#FF7C00"), v(m, "fill-opacity", "0.4"), v(m, "class", "svelte-43sxxs"), v(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), v(c, "fill", "#FF7C00"), v(c, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
226
  n[2][0] + "px, " + /*$bottom*/
227
- n[2][1] + "px)"), v(e, "viewBox", "-1200 -1200 3000 3000"), v(e, "fill", "none"), v(e, "xmlns", "http://www.w3.org/2000/svg"), v(e, "class", "svelte-43sxxs"), v(t, "class", "svelte-43sxxs"), Le(
228
  t,
229
  "margin",
230
  /*margin*/
231
  n[0]
232
  );
233
  },
234
- m(w, y) {
235
- yt(w, t, y), N(t, e), N(e, l), N(l, i), N(l, s), N(l, o), N(l, a), N(e, r), N(r, f), N(r, _), N(r, m), N(r, c);
236
  },
237
- p(w, [y]) {
238
- y & /*$top*/
239
  2 && $(l, "transform", "translate(" + /*$top*/
240
- w[1][0] + "px, " + /*$top*/
241
- w[1][1] + "px)"), y & /*$bottom*/
242
  4 && $(r, "transform", "translate(" + /*$bottom*/
243
- w[2][0] + "px, " + /*$bottom*/
244
- w[2][1] + "px)"), y & /*margin*/
245
  1 && Le(
246
  t,
247
  "margin",
248
  /*margin*/
249
- w[0]
250
  );
251
  },
252
  i: Fe,
253
  o: Fe,
254
- d(w) {
255
- w && ht(t);
256
  }
257
  };
258
  }
259
- function Ft(n, t, e) {
260
  let l, i, { margin: s = !0 } = t;
261
  const o = pe([0, 0]);
262
- qe(n, o, (c) => e(1, l = c));
263
  const a = pe([0, 0]);
264
- qe(n, a, (c) => e(2, i = c));
265
  let r;
266
  async function f() {
267
  await Promise.all([o.set([125, 140]), a.set([-125, -140])]), await Promise.all([o.set([-125, 140]), a.set([125, -140])]), await Promise.all([o.set([-125, 0]), a.set([125, -0])]), await Promise.all([o.set([125, 0]), a.set([-125, 0])]);
@@ -272,46 +318,46 @@ function Ft(n, t, e) {
272
  async function m() {
273
  await Promise.all([o.set([125, 0]), a.set([-125, 0])]), _();
274
  }
275
- return pt(() => (m(), () => r = !0)), n.$$set = (c) => {
276
- "margin" in c && e(0, s = c.margin);
277
  }, [s, l, i, o, a];
278
  }
279
- class Lt extends gt {
280
  constructor(t) {
281
- super(), vt(this, t, Ft, qt, kt, { margin: 0 });
282
  }
283
  }
284
  const {
285
- SvelteComponent: Ct,
286
  append: H,
287
  attr: T,
288
  binding_callbacks: Ce,
289
- check_outros: Ke,
290
- create_component: Mt,
291
- create_slot: Vt,
292
- destroy_component: St,
293
- destroy_each: Qe,
294
- detach: g,
295
- element: Z,
296
- empty: U,
297
  ensure_array_like: le,
298
- get_all_dirty_from_scope: Nt,
299
- get_slot_changes: zt,
300
- group_outros: We,
301
- init: Tt,
302
- insert: h,
303
- mount_component: jt,
304
  noop: oe,
305
- safe_not_equal: Pt,
306
  set_data: S,
307
- set_style: D,
308
  space: j,
309
  text: q,
310
  toggle_class: V,
311
- transition_in: O,
312
- transition_out: R,
313
- update_slot_base: Zt
314
- } = window.__gradio__svelte__internal, { tick: Bt } = window.__gradio__svelte__internal, { onDestroy: At } = window.__gradio__svelte__internal, Dt = (n) => ({}), Me = (n) => ({});
315
  function Ve(n, t, e) {
316
  const l = n.slice();
317
  return l[38] = t[e], l[40] = e, l;
@@ -320,7 +366,7 @@ function Se(n, t, e) {
320
  const l = n.slice();
321
  return l[38] = t[e], l;
322
  }
323
- function Et(n) {
324
  let t, e = (
325
  /*i18n*/
326
  n[1]("common.error") + ""
@@ -328,7 +374,7 @@ function Et(n) {
328
  const o = (
329
  /*#slots*/
330
  n[29].error
331
- ), a = Vt(
332
  o,
333
  n,
334
  /*$$scope*/
@@ -337,28 +383,28 @@ function Et(n) {
337
  );
338
  return {
339
  c() {
340
- t = Z("span"), l = q(e), i = j(), a && a.c(), T(t, "class", "error svelte-1txqlrd");
341
  },
342
  m(r, f) {
343
- h(r, t, f), H(t, l), h(r, i, f), a && a.m(r, f), s = !0;
344
  },
345
  p(r, f) {
346
  (!s || f[0] & /*i18n*/
347
  2) && e !== (e = /*i18n*/
348
  r[1]("common.error") + "") && S(l, e), a && a.p && (!s || f[0] & /*$$scope*/
349
- 268435456) && Zt(
350
  a,
351
  o,
352
  r,
353
  /*$$scope*/
354
  r[28],
355
- s ? zt(
356
  o,
357
  /*$$scope*/
358
  r[28],
359
  f,
360
- Dt
361
- ) : Nt(
362
  /*$$scope*/
363
  r[28]
364
  ),
@@ -366,48 +412,48 @@ function Et(n) {
366
  );
367
  },
368
  i(r) {
369
- s || (O(a, r), s = !0);
370
  },
371
  o(r) {
372
- R(a, r), s = !1;
373
  },
374
  d(r) {
375
- r && (g(t), g(i)), a && a.d(r);
376
  }
377
  };
378
  }
379
- function It(n) {
380
  let t, e, l, i, s, o, a, r, f, _ = (
381
  /*variant*/
382
  n[8] === "default" && /*show_eta_bar*/
383
  n[18] && /*show_progress*/
384
  n[6] === "full" && Ne(n)
385
  );
386
- function m(u, k) {
387
  if (
388
  /*progress*/
389
  u[7]
390
  )
391
- return Yt;
392
  if (
393
  /*queue_position*/
394
  u[2] !== null && /*queue_size*/
395
  u[3] !== void 0 && /*queue_position*/
396
  u[2] >= 0
397
  )
398
- return Xt;
399
  if (
400
  /*queue_position*/
401
  u[2] === 0
402
  )
403
- return Ht;
404
  }
405
- let c = m(n), w = c && c(n), y = (
406
  /*timer*/
407
  n[5] && je(n)
408
  );
409
- const C = [Ut, Rt], p = [];
410
- function L(u, k) {
411
  return (
412
  /*last_progress_level*/
413
  u[15] != null ? 0 : (
@@ -421,7 +467,7 @@ function It(n) {
421
  n[5] && Ie(n);
422
  return {
423
  c() {
424
- _ && _.c(), t = j(), e = Z("div"), w && w.c(), l = j(), y && y.c(), i = j(), o && o.c(), a = j(), F && F.c(), r = U(), T(e, "class", "progress-text svelte-1txqlrd"), V(
425
  e,
426
  "meta-text-center",
427
  /*variant*/
@@ -433,41 +479,41 @@ function It(n) {
433
  n[8] === "default"
434
  );
435
  },
436
- m(u, k) {
437
- _ && _.m(u, k), h(u, t, k), h(u, e, k), w && w.m(e, null), H(e, l), y && y.m(e, null), h(u, i, k), ~s && p[s].m(u, k), h(u, a, k), F && F.m(u, k), h(u, r, k), f = !0;
438
  },
439
- p(u, k) {
440
  /*variant*/
441
  u[8] === "default" && /*show_eta_bar*/
442
  u[18] && /*show_progress*/
443
- u[6] === "full" ? _ ? _.p(u, k) : (_ = Ne(u), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), c === (c = m(u)) && w ? w.p(u, k) : (w && w.d(1), w = c && c(u), w && (w.c(), w.m(e, l))), /*timer*/
444
- u[5] ? y ? y.p(u, k) : (y = je(u), y.c(), y.m(e, null)) : y && (y.d(1), y = null), (!f || k[0] & /*variant*/
445
  256) && V(
446
  e,
447
  "meta-text-center",
448
  /*variant*/
449
  u[8] === "center"
450
- ), (!f || k[0] & /*variant*/
451
  256) && V(
452
  e,
453
  "meta-text",
454
  /*variant*/
455
  u[8] === "default"
456
  );
457
- let b = s;
458
- s = L(u), s === b ? ~s && p[s].p(u, k) : (o && (We(), R(p[b], 1, 1, () => {
459
- p[b] = null;
460
- }), Ke()), ~s ? (o = p[s], o ? o.p(u, k) : (o = p[s] = C[s](u), o.c()), O(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
461
- u[5] ? F && (F.d(1), F = null) : F ? F.p(u, k) : (F = Ie(u), F.c(), F.m(r.parentNode, r));
462
  },
463
  i(u) {
464
- f || (O(o), f = !0);
465
  },
466
  o(u) {
467
- R(o), f = !1;
468
  },
469
  d(u) {
470
- u && (g(t), g(e), g(i), g(a), g(r)), _ && _.d(u), w && w.d(), y && y.d(), ~s && p[s].d(u), F && F.d(u);
471
  }
472
  };
473
  }
@@ -476,37 +522,37 @@ function Ne(n) {
476
  (n[17] || 0) * 100 - 100}%)`;
477
  return {
478
  c() {
479
- t = Z("div"), T(t, "class", "eta-bar svelte-1txqlrd"), D(t, "transform", e);
480
  },
481
  m(l, i) {
482
- h(l, t, i);
483
  },
484
  p(l, i) {
485
  i[0] & /*eta_level*/
486
  131072 && e !== (e = `translateX(${/*eta_level*/
487
- (l[17] || 0) * 100 - 100}%)`) && D(t, "transform", e);
488
  },
489
  d(l) {
490
- l && g(t);
491
  }
492
  };
493
  }
494
- function Ht(n) {
495
  let t;
496
  return {
497
  c() {
498
  t = q("processing |");
499
  },
500
  m(e, l) {
501
- h(e, t, l);
502
  },
503
  p: oe,
504
  d(e) {
505
- e && g(t);
506
  }
507
  };
508
  }
509
- function Xt(n) {
510
  let t, e = (
511
  /*queue_position*/
512
  n[2] + 1 + ""
@@ -519,7 +565,7 @@ function Xt(n) {
519
  ), o = q(" |");
520
  },
521
  m(a, r) {
522
- h(a, t, r), h(a, l, r), h(a, i, r), h(a, s, r), h(a, o, r);
523
  },
524
  p(a, r) {
525
  r[0] & /*queue_position*/
@@ -532,11 +578,11 @@ function Xt(n) {
532
  );
533
  },
534
  d(a) {
535
- a && (g(t), g(l), g(i), g(s), g(o));
536
  }
537
  };
538
  }
539
- function Yt(n) {
540
  let t, e = le(
541
  /*progress*/
542
  n[7]
@@ -547,12 +593,12 @@ function Yt(n) {
547
  c() {
548
  for (let i = 0; i < l.length; i += 1)
549
  l[i].c();
550
- t = U();
551
  },
552
  m(i, s) {
553
  for (let o = 0; o < l.length; o += 1)
554
  l[o] && l[o].m(i, s);
555
- h(i, t, s);
556
  },
557
  p(i, s) {
558
  if (s[0] & /*progress*/
@@ -572,7 +618,7 @@ function Yt(n) {
572
  }
573
  },
574
  d(i) {
575
- i && g(t), Qe(l, i);
576
  }
577
  };
578
  }
@@ -584,7 +630,7 @@ function ze(n) {
584
  function a(_, m) {
585
  return (
586
  /*p*/
587
- _[38].length != null ? Ot : Gt
588
  );
589
  }
590
  let r = a(n), f = r(n);
@@ -593,7 +639,7 @@ function ze(n) {
593
  f.c(), t = j(), l = q(e), i = q(" | "), o = q(s);
594
  },
595
  m(_, m) {
596
- f.m(_, m), h(_, t, m), h(_, l, m), h(_, i, m), h(_, o, m);
597
  },
598
  p(_, m) {
599
  r === (r = a(_)) && f ? f.p(_, m) : (f.d(1), f = r(_), f && (f.c(), f.m(t.parentNode, t))), m[0] & /*progress*/
@@ -601,12 +647,12 @@ function ze(n) {
601
  _[38].unit + "") && S(l, e);
602
  },
603
  d(_) {
604
- _ && (g(t), g(l), g(i), g(o)), f.d(_);
605
  }
606
  };
607
  }
608
- function Gt(n) {
609
- let t = Y(
610
  /*p*/
611
  n[38].index || 0
612
  ) + "", e;
@@ -615,25 +661,25 @@ function Gt(n) {
615
  e = q(t);
616
  },
617
  m(l, i) {
618
- h(l, e, i);
619
  },
620
  p(l, i) {
621
  i[0] & /*progress*/
622
- 128 && t !== (t = Y(
623
  /*p*/
624
  l[38].index || 0
625
  ) + "") && S(e, t);
626
  },
627
  d(l) {
628
- l && g(e);
629
  }
630
  };
631
  }
632
- function Ot(n) {
633
- let t = Y(
634
  /*p*/
635
  n[38].index || 0
636
- ) + "", e, l, i = Y(
637
  /*p*/
638
  n[38].length
639
  ) + "", s;
@@ -642,21 +688,21 @@ function Ot(n) {
642
  e = q(t), l = q("/"), s = q(i);
643
  },
644
  m(o, a) {
645
- h(o, e, a), h(o, l, a), h(o, s, a);
646
  },
647
  p(o, a) {
648
  a[0] & /*progress*/
649
- 128 && t !== (t = Y(
650
  /*p*/
651
  o[38].index || 0
652
  ) + "") && S(e, t), a[0] & /*progress*/
653
- 128 && i !== (i = Y(
654
  /*p*/
655
  o[38].length
656
  ) + "") && S(s, i);
657
  },
658
  d(o) {
659
- o && (g(e), g(l), g(s));
660
  }
661
  };
662
  }
@@ -667,17 +713,17 @@ function Te(n) {
667
  );
668
  return {
669
  c() {
670
- e && e.c(), t = U();
671
  },
672
  m(l, i) {
673
- e && e.m(l, i), h(l, t, i);
674
  },
675
  p(l, i) {
676
  /*p*/
677
  l[38].index != null ? e ? e.p(l, i) : (e = ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
678
  },
679
  d(l) {
680
- l && g(t), e && e.d(l);
681
  }
682
  };
683
  }
@@ -695,7 +741,7 @@ function je(n) {
695
  ), l = q(e), i = q("s");
696
  },
697
  m(s, o) {
698
- h(s, t, o), h(s, l, o), h(s, i, o);
699
  },
700
  p(s, o) {
701
  o[0] & /*formatted_timer*/
@@ -709,23 +755,23 @@ function je(n) {
709
  s[19]}` : "") && S(l, e);
710
  },
711
  d(s) {
712
- s && (g(t), g(l), g(i));
713
  }
714
  };
715
  }
716
- function Rt(n) {
717
  let t, e;
718
- return t = new Lt({
719
  props: { margin: (
720
  /*variant*/
721
  n[8] === "default"
722
  ) }
723
  }), {
724
  c() {
725
- Mt(t.$$.fragment);
726
  },
727
  m(l, i) {
728
- jt(t, l, i), e = !0;
729
  },
730
  p(l, i) {
731
  const s = {};
@@ -734,17 +780,17 @@ function Rt(n) {
734
  l[8] === "default"), t.$set(s);
735
  },
736
  i(l) {
737
- e || (O(t.$$.fragment, l), e = !0);
738
  },
739
  o(l) {
740
- R(t.$$.fragment, l), e = !1;
741
  },
742
  d(l) {
743
- St(t, l);
744
  }
745
  };
746
  }
747
- function Ut(n) {
748
  let t, e, l, i, s, o = `${/*last_progress_level*/
749
  n[15] * 100}%`, a = (
750
  /*progress*/
@@ -752,21 +798,21 @@ function Ut(n) {
752
  );
753
  return {
754
  c() {
755
- t = Z("div"), e = Z("div"), a && a.c(), l = j(), i = Z("div"), s = Z("div"), T(e, "class", "progress-level-inner svelte-1txqlrd"), T(s, "class", "progress-bar svelte-1txqlrd"), D(s, "width", o), T(i, "class", "progress-bar-wrap svelte-1txqlrd"), T(t, "class", "progress-level svelte-1txqlrd");
756
  },
757
  m(r, f) {
758
- h(r, t, f), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, s), n[30](s);
759
  },
760
  p(r, f) {
761
  /*progress*/
762
  r[7] != null ? a ? a.p(r, f) : (a = Pe(r), a.c(), a.m(e, null)) : a && (a.d(1), a = null), f[0] & /*last_progress_level*/
763
  32768 && o !== (o = `${/*last_progress_level*/
764
- r[15] * 100}%`) && D(s, "width", o);
765
  },
766
  i: oe,
767
  o: oe,
768
  d(r) {
769
- r && g(t), a && a.d(), n[30](null);
770
  }
771
  };
772
  }
@@ -776,17 +822,17 @@ function Pe(n) {
776
  n[7]
777
  ), l = [];
778
  for (let i = 0; i < e.length; i += 1)
779
- l[i] = Ee(Ve(n, e, i));
780
  return {
781
  c() {
782
  for (let i = 0; i < l.length; i += 1)
783
  l[i].c();
784
- t = U();
785
  },
786
  m(i, s) {
787
  for (let o = 0; o < l.length; o += 1)
788
  l[o] && l[o].m(i, s);
789
- h(i, t, s);
790
  },
791
  p(i, s) {
792
  if (s[0] & /*progress_level, progress*/
@@ -798,7 +844,7 @@ function Pe(n) {
798
  let o;
799
  for (o = 0; o < e.length; o += 1) {
800
  const a = Ve(i, e, o);
801
- l[o] ? l[o].p(a, s) : (l[o] = Ee(a), l[o].c(), l[o].m(t.parentNode, t));
802
  }
803
  for (; o < l.length; o += 1)
804
  l[o].d(1);
@@ -806,17 +852,17 @@ function Pe(n) {
806
  }
807
  },
808
  d(i) {
809
- i && g(t), Qe(l, i);
810
  }
811
  };
812
  }
813
  function Ze(n) {
814
  let t, e, l, i, s = (
815
  /*i*/
816
- n[40] !== 0 && Jt()
817
  ), o = (
818
  /*p*/
819
- n[38].desc != null && Be(n)
820
  ), a = (
821
  /*p*/
822
  n[38].desc != null && /*progress_level*/
@@ -824,49 +870,49 @@ function Ze(n) {
824
  n[14][
825
  /*i*/
826
  n[40]
827
- ] != null && Ae()
828
  ), r = (
829
  /*progress_level*/
830
- n[14] != null && De(n)
831
  );
832
  return {
833
  c() {
834
- s && s.c(), t = j(), o && o.c(), e = j(), a && a.c(), l = j(), r && r.c(), i = U();
835
  },
836
  m(f, _) {
837
- s && s.m(f, _), h(f, t, _), o && o.m(f, _), h(f, e, _), a && a.m(f, _), h(f, l, _), r && r.m(f, _), h(f, i, _);
838
  },
839
  p(f, _) {
840
  /*p*/
841
- f[38].desc != null ? o ? o.p(f, _) : (o = Be(f), o.c(), o.m(e.parentNode, e)) : o && (o.d(1), o = null), /*p*/
842
  f[38].desc != null && /*progress_level*/
843
  f[14] && /*progress_level*/
844
  f[14][
845
  /*i*/
846
  f[40]
847
- ] != null ? a || (a = Ae(), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null), /*progress_level*/
848
- f[14] != null ? r ? r.p(f, _) : (r = De(f), r.c(), r.m(i.parentNode, i)) : r && (r.d(1), r = null);
849
  },
850
  d(f) {
851
- f && (g(t), g(e), g(l), g(i)), s && s.d(f), o && o.d(f), a && a.d(f), r && r.d(f);
852
  }
853
  };
854
  }
855
- function Jt(n) {
856
  let t;
857
  return {
858
  c() {
859
  t = q(" /");
860
  },
861
  m(e, l) {
862
- h(e, t, l);
863
  },
864
  d(e) {
865
- e && g(t);
866
  }
867
  };
868
  }
869
- function Be(n) {
870
  let t = (
871
  /*p*/
872
  n[38].desc + ""
@@ -876,7 +922,7 @@ function Be(n) {
876
  e = q(t);
877
  },
878
  m(l, i) {
879
- h(l, e, i);
880
  },
881
  p(l, i) {
882
  i[0] & /*progress*/
@@ -884,25 +930,25 @@ function Be(n) {
884
  l[38].desc + "") && S(e, t);
885
  },
886
  d(l) {
887
- l && g(e);
888
  }
889
  };
890
  }
891
- function Ae(n) {
892
  let t;
893
  return {
894
  c() {
895
  t = q("-");
896
  },
897
  m(e, l) {
898
- h(e, t, l);
899
  },
900
  d(e) {
901
- e && g(t);
902
  }
903
  };
904
  }
905
- function De(n) {
906
  let t = (100 * /*progress_level*/
907
  (n[14][
908
  /*i*/
@@ -913,7 +959,7 @@ function De(n) {
913
  e = q(t), l = q("%");
914
  },
915
  m(i, s) {
916
- h(i, e, s), h(i, l, s);
917
  },
918
  p(i, s) {
919
  s[0] & /*progress_level*/
@@ -924,11 +970,11 @@ function De(n) {
924
  ] || 0)).toFixed(1) + "") && S(e, t);
925
  },
926
  d(i) {
927
- i && (g(e), g(l));
928
  }
929
  };
930
  }
931
- function Ee(n) {
932
  let t, e = (
933
  /*p*/
934
  (n[38].desc != null || /*progress_level*/
@@ -940,10 +986,10 @@ function Ee(n) {
940
  );
941
  return {
942
  c() {
943
- e && e.c(), t = U();
944
  },
945
  m(l, i) {
946
- e && e.m(l, i), h(l, t, i);
947
  },
948
  p(l, i) {
949
  /*p*/
@@ -955,7 +1001,7 @@ function Ee(n) {
955
  ] != null ? e ? e.p(l, i) : (e = Ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
956
  },
957
  d(l) {
958
- l && g(t), e && e.d(l);
959
  }
960
  };
961
  }
@@ -963,13 +1009,13 @@ function Ie(n) {
963
  let t, e;
964
  return {
965
  c() {
966
- t = Z("p"), e = q(
967
  /*loading_text*/
968
  n[9]
969
  ), T(t, "class", "loading svelte-1txqlrd");
970
  },
971
  m(l, i) {
972
- h(l, t, i), H(t, e);
973
  },
974
  p(l, i) {
975
  i[0] & /*loading_text*/
@@ -980,13 +1026,13 @@ function Ie(n) {
980
  );
981
  },
982
  d(l) {
983
- l && g(t);
984
  }
985
  };
986
  }
987
- function Kt(n) {
988
  let t, e, l, i, s;
989
- const o = [It, Et], a = [];
990
  function r(f, _) {
991
  return (
992
  /*status*/
@@ -998,7 +1044,7 @@ function Kt(n) {
998
  }
999
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
1000
  c() {
1001
- t = Z("div"), l && l.c(), T(t, "class", i = "wrap " + /*variant*/
1002
  n[8] + " " + /*show_progress*/
1003
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
1004
  n[4] || /*status*/
@@ -1022,12 +1068,12 @@ function Kt(n) {
1022
  "border",
1023
  /*border*/
1024
  n[12]
1025
- ), D(
1026
  t,
1027
  "position",
1028
  /*absolute*/
1029
  n[10] ? "absolute" : "static"
1030
- ), D(
1031
  t,
1032
  "padding",
1033
  /*absolute*/
@@ -1035,13 +1081,13 @@ function Kt(n) {
1035
  );
1036
  },
1037
  m(f, _) {
1038
- h(f, t, _), ~e && a[e].m(t, null), n[31](t), s = !0;
1039
  },
1040
  p(f, _) {
1041
  let m = e;
1042
- e = r(f), e === m ? ~e && a[e].p(f, _) : (l && (We(), R(a[m], 1, 1, () => {
1043
  a[m] = null;
1044
- }), Ke()), ~e ? (l = a[e], l ? l.p(f, _) : (l = a[e] = o[e](f), l.c()), O(l, 1), l.m(t, null)) : l = null), (!s || _[0] & /*variant, show_progress*/
1045
  320 && i !== (i = "wrap " + /*variant*/
1046
  f[8] + " " + /*show_progress*/
1047
  f[6] + " svelte-1txqlrd")) && T(t, "class", i), (!s || _[0] & /*variant, show_progress, status, show_progress*/
@@ -1071,13 +1117,13 @@ function Kt(n) {
1071
  /*border*/
1072
  f[12]
1073
  ), _[0] & /*absolute*/
1074
- 1024 && D(
1075
  t,
1076
  "position",
1077
  /*absolute*/
1078
  f[10] ? "absolute" : "static"
1079
  ), _[0] & /*absolute*/
1080
- 1024 && D(
1081
  t,
1082
  "padding",
1083
  /*absolute*/
@@ -1085,18 +1131,18 @@ function Kt(n) {
1085
  );
1086
  },
1087
  i(f) {
1088
- s || (O(l), s = !0);
1089
  },
1090
  o(f) {
1091
- R(l), s = !1;
1092
  },
1093
  d(f) {
1094
- f && g(t), ~e && a[e].d(), n[31](null);
1095
  }
1096
  };
1097
  }
1098
  let ee = [], fe = !1;
1099
- async function Qt(n, t = !0) {
1100
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
1101
  if (ee.push(n), !fe)
1102
  fe = !0;
@@ -1112,18 +1158,18 @@ async function Qt(n, t = !0) {
1112
  });
1113
  }
1114
  }
1115
- function Wt(n, t, e) {
1116
- let l, { $$slots: i = {}, $$scope: s } = t, { i18n: o } = t, { eta: a = null } = t, { queue: r = !1 } = t, { queue_position: f } = t, { queue_size: _ } = t, { status: m } = t, { scroll_to_output: c = !1 } = t, { timer: w = !0 } = t, { show_progress: y = "full" } = t, { message: C = null } = t, { progress: p = null } = t, { variant: L = "default" } = t, { loading_text: F = "Loading..." } = t, { absolute: u = !0 } = t, { translucent: k = !1 } = t, { border: b = !1 } = t, { autoscroll: ne } = t, J, K = !1, W = 0, E = 0, ie = null, de = 0, I = null, Q, B = null, me = !0;
1117
  const et = () => {
1118
- e(25, W = performance.now()), e(26, E = 0), K = !0, be();
1119
  };
1120
  function be() {
1121
  requestAnimationFrame(() => {
1122
- e(26, E = (performance.now() - W) / 1e3), K && be();
1123
  });
1124
  }
1125
  function ge() {
1126
- e(26, E = 0), K && (K = !1);
1127
  }
1128
  At(() => {
1129
  K && ge();
@@ -1131,7 +1177,7 @@ function Wt(n, t, e) {
1131
  let he = null;
1132
  function tt(d) {
1133
  Ce[d ? "unshift" : "push"](() => {
1134
- B = d, e(16, B), e(7, p), e(14, I), e(15, Q);
1135
  });
1136
  }
1137
  function lt(d) {
@@ -1140,50 +1186,50 @@ function Wt(n, t, e) {
1140
  });
1141
  }
1142
  return n.$$set = (d) => {
1143
- "i18n" in d && e(1, o = d.i18n), "eta" in d && e(0, a = d.eta), "queue" in d && e(21, r = d.queue), "queue_position" in d && e(2, f = d.queue_position), "queue_size" in d && e(3, _ = d.queue_size), "status" in d && e(4, m = d.status), "scroll_to_output" in d && e(22, c = d.scroll_to_output), "timer" in d && e(5, w = d.timer), "show_progress" in d && e(6, y = d.show_progress), "message" in d && e(23, C = d.message), "progress" in d && e(7, p = d.progress), "variant" in d && e(8, L = d.variant), "loading_text" in d && e(9, F = d.loading_text), "absolute" in d && e(10, u = d.absolute), "translucent" in d && e(11, k = d.translucent), "border" in d && e(12, b = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, s = d.$$scope);
1144
  }, n.$$.update = () => {
1145
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1146
- 169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - W) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
1147
- 67108865 && e(17, de = a === null || a <= 0 || !E ? null : Math.min(E / a, 1)), n.$$.dirty[0] & /*progress*/
1148
  128 && p != null && e(18, me = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1149
  114816 && (p != null ? e(14, I = p.map((d) => {
1150
  if (d.index != null && d.length != null)
1151
  return d.index / d.length;
1152
  if (d.progress != null)
1153
  return d.progress;
1154
- })) : e(14, I = null), I ? (e(15, Q = I[I.length - 1]), B && (Q === 0 ? e(16, B.style.transition = "0", B) : e(16, B.style.transition = "150ms", B))) : e(15, Q = void 0)), n.$$.dirty[0] & /*status*/
1155
  16 && (m === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1156
- 20979728 && J && c && (m === "pending" || m === "complete") && Qt(J, ne), n.$$.dirty[0] & /*status, message*/
1157
  8388624, n.$$.dirty[0] & /*timer_diff*/
1158
- 67108864 && e(20, l = E.toFixed(1));
1159
  }, [
1160
  a,
1161
  o,
1162
  f,
1163
  _,
1164
  m,
1165
- w,
1166
- y,
1167
  p,
1168
  L,
1169
  F,
1170
  u,
1171
- k,
1172
- b,
1173
  J,
1174
  I,
1175
  Q,
1176
- B,
1177
  de,
1178
  me,
1179
  he,
1180
  l,
1181
  r,
1182
- c,
1183
  C,
1184
  ne,
1185
- W,
1186
- E,
1187
  ie,
1188
  s,
1189
  i,
@@ -1191,14 +1237,14 @@ function Wt(n, t, e) {
1191
  lt
1192
  ];
1193
  }
1194
- class xt extends Ct {
1195
  constructor(t) {
1196
- super(), Tt(
1197
  this,
1198
  t,
1199
- Wt,
1200
- Kt,
1201
- Pt,
1202
  {
1203
  i18n: 1,
1204
  eta: 0,
@@ -1224,30 +1270,30 @@ class xt extends Ct {
1224
  }
1225
  }
1226
  const {
1227
- SvelteComponent: $t,
1228
- assign: el,
1229
- create_slot: tl,
1230
- detach: ll,
1231
- element: nl,
1232
- get_all_dirty_from_scope: il,
1233
- get_slot_changes: fl,
1234
- get_spread_update: sl,
1235
- init: ol,
1236
- insert: al,
1237
- safe_not_equal: rl,
1238
  set_dynamic_element_data: He,
1239
  set_style: M,
1240
- toggle_class: A,
1241
  transition_in: xe,
1242
  transition_out: $e,
1243
- update_slot_base: _l
1244
  } = window.__gradio__svelte__internal;
1245
- function ul(n) {
1246
  let t, e, l;
1247
  const i = (
1248
  /*#slots*/
1249
  n[17].default
1250
- ), s = tl(
1251
  i,
1252
  n,
1253
  /*$$scope*/
@@ -1269,31 +1315,31 @@ function ul(n) {
1269
  }
1270
  ], a = {};
1271
  for (let r = 0; r < o.length; r += 1)
1272
- a = el(a, o[r]);
1273
  return {
1274
  c() {
1275
- t = nl(
1276
  /*tag*/
1277
  n[14]
1278
  ), s && s.c(), He(
1279
  /*tag*/
1280
  n[14]
1281
- )(t, a), A(
1282
  t,
1283
  "hidden",
1284
  /*visible*/
1285
  n[10] === !1
1286
- ), A(
1287
  t,
1288
  "padded",
1289
  /*padding*/
1290
  n[6]
1291
- ), A(
1292
  t,
1293
  "border_focus",
1294
  /*border_mode*/
1295
  n[5] === "focus"
1296
- ), A(t, "hide-container", !/*explicit_call*/
1297
  n[8] && !/*container*/
1298
  n[9]), M(t, "height", typeof /*height*/
1299
  n[0] == "number" ? (
@@ -1320,23 +1366,23 @@ function ul(n) {
1320
  n[13]}px, 100%))`), M(t, "border-width", "var(--block-border-width)");
1321
  },
1322
  m(r, f) {
1323
- al(r, t, f), s && s.m(t, null), l = !0;
1324
  },
1325
  p(r, f) {
1326
  s && s.p && (!l || f & /*$$scope*/
1327
- 65536) && _l(
1328
  s,
1329
  i,
1330
  r,
1331
  /*$$scope*/
1332
  r[16],
1333
- l ? fl(
1334
  i,
1335
  /*$$scope*/
1336
  r[16],
1337
  f,
1338
  null
1339
- ) : il(
1340
  /*$$scope*/
1341
  r[16]
1342
  ),
@@ -1344,7 +1390,7 @@ function ul(n) {
1344
  ), He(
1345
  /*tag*/
1346
  r[14]
1347
- )(t, a = sl(o, [
1348
  (!l || f & /*test_id*/
1349
  128) && { "data-testid": (
1350
  /*test_id*/
@@ -1358,22 +1404,22 @@ function ul(n) {
1358
  (!l || f & /*elem_classes*/
1359
  8 && e !== (e = "block " + /*elem_classes*/
1360
  r[3].join(" ") + " svelte-1t38q2d")) && { class: e }
1361
- ])), A(
1362
  t,
1363
  "hidden",
1364
  /*visible*/
1365
  r[10] === !1
1366
- ), A(
1367
  t,
1368
  "padded",
1369
  /*padding*/
1370
  r[6]
1371
- ), A(
1372
  t,
1373
  "border_focus",
1374
  /*border_mode*/
1375
  r[5] === "focus"
1376
- ), A(t, "hide-container", !/*explicit_call*/
1377
  r[8] && !/*container*/
1378
  r[9]), f & /*height*/
1379
  1 && M(t, "height", typeof /*height*/
@@ -1412,14 +1458,14 @@ function ul(n) {
1412
  $e(s, r), l = !1;
1413
  },
1414
  d(r) {
1415
- r && ll(t), s && s.d(r);
1416
  }
1417
  };
1418
  }
1419
- function cl(n) {
1420
  let t, e = (
1421
  /*tag*/
1422
- n[14] && ul(n)
1423
  );
1424
  return {
1425
  c() {
@@ -1443,10 +1489,10 @@ function cl(n) {
1443
  }
1444
  };
1445
  }
1446
- function dl(n, t, e) {
1447
- let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: r = [] } = t, { variant: f = "solid" } = t, { border_mode: _ = "base" } = t, { padding: m = !0 } = t, { type: c = "normal" } = t, { test_id: w = void 0 } = t, { explicit_call: y = !1 } = t, { container: C = !0 } = t, { visible: p = !0 } = t, { allow_overflow: L = !0 } = t, { scale: F = null } = t, { min_width: u = 0 } = t, k = c === "fieldset" ? "fieldset" : "div";
1448
- return n.$$set = (b) => {
1449
- "height" in b && e(0, s = b.height), "width" in b && e(1, o = b.width), "elem_id" in b && e(2, a = b.elem_id), "elem_classes" in b && e(3, r = b.elem_classes), "variant" in b && e(4, f = b.variant), "border_mode" in b && e(5, _ = b.border_mode), "padding" in b && e(6, m = b.padding), "type" in b && e(15, c = b.type), "test_id" in b && e(7, w = b.test_id), "explicit_call" in b && e(8, y = b.explicit_call), "container" in b && e(9, C = b.container), "visible" in b && e(10, p = b.visible), "allow_overflow" in b && e(11, L = b.allow_overflow), "scale" in b && e(12, F = b.scale), "min_width" in b && e(13, u = b.min_width), "$$scope" in b && e(16, i = b.$$scope);
1450
  }, [
1451
  s,
1452
  o,
@@ -1455,22 +1501,22 @@ function dl(n, t, e) {
1455
  f,
1456
  _,
1457
  m,
1458
- w,
1459
- y,
1460
  C,
1461
  p,
1462
  L,
1463
  F,
1464
  u,
1465
- k,
1466
- c,
1467
  i,
1468
  l
1469
  ];
1470
  }
1471
- class ml extends $t {
1472
  constructor(t) {
1473
- super(), ol(this, t, dl, cl, rl, {
1474
  height: 0,
1475
  width: 1,
1476
  elem_id: 2,
@@ -1489,7 +1535,7 @@ class ml extends $t {
1489
  });
1490
  }
1491
  }
1492
- const bl = [
1493
  { color: "red", primary: 600, secondary: 100 },
1494
  { color: "green", primary: 600, secondary: 100 },
1495
  { color: "blue", primary: 600, secondary: 100 },
@@ -1793,7 +1839,7 @@ const bl = [
1793
  950: "#4c0519"
1794
  }
1795
  };
1796
- bl.reduce(
1797
  (n, { color: t, primary: e, secondary: l }) => ({
1798
  ...n,
1799
  [t]: {
@@ -1804,49 +1850,49 @@ bl.reduce(
1804
  {}
1805
  );
1806
  const {
1807
- SvelteComponent: gl,
1808
- assign: hl,
1809
- attr: wl,
1810
  create_component: ae,
1811
  destroy_component: re,
1812
  detach: Ye,
1813
- element: vl,
1814
- get_spread_object: yl,
1815
- get_spread_update: kl,
1816
- init: pl,
1817
  insert: Ge,
1818
  mount_component: _e,
1819
- safe_not_equal: ql,
1820
- space: Fl,
1821
  toggle_class: Oe,
1822
- transition_in: ue,
1823
- transition_out: ce
1824
  } = window.__gradio__svelte__internal;
1825
- function Ll(n) {
1826
  var r;
1827
  let t, e, l, i, s;
1828
  const o = [
1829
  { autoscroll: (
1830
  /*gradio*/
1831
- n[6].autoscroll
1832
  ) },
1833
  { i18n: (
1834
  /*gradio*/
1835
- n[6].i18n
1836
  ) },
1837
  /*loading_status*/
1838
- n[5],
1839
  { variant: "center" }
1840
  ];
1841
  let a = {};
1842
  for (let f = 0; f < o.length; f += 1)
1843
- a = hl(a, o[f]);
1844
- return t = new xt({ props: a }), i = new ct({
1845
  props: {
1846
  min_height: (
1847
  /*loading_status*/
1848
- n[5] && /*loading_status*/
1849
- ((r = n[5]) == null ? void 0 : r.status) !== "complete"
1850
  ),
1851
  value: (
1852
  /*value*/
@@ -1863,81 +1909,87 @@ function Ll(n) {
1863
  height: (
1864
  /*height*/
1865
  n[4]
 
 
 
 
1866
  )
1867
  }
1868
  }), i.$on(
1869
  "change",
1870
  /*change_handler*/
1871
- n[8]
1872
  ), {
1873
  c() {
1874
  var f;
1875
- ae(t.$$.fragment), e = Fl(), l = vl("div"), ae(i.$$.fragment), wl(l, "class", "svelte-gqsrr7"), Oe(
1876
  l,
1877
  "pending",
1878
  /*loading_status*/
1879
- ((f = n[5]) == null ? void 0 : f.status) === "pending"
1880
  );
1881
  },
1882
  m(f, _) {
1883
  _e(t, f, _), Ge(f, e, _), Ge(f, l, _), _e(i, l, null), s = !0;
1884
  },
1885
  p(f, _) {
1886
- var w, y;
1887
  const m = _ & /*gradio, loading_status*/
1888
- 96 ? kl(o, [
1889
  _ & /*gradio*/
1890
- 64 && { autoscroll: (
1891
  /*gradio*/
1892
- f[6].autoscroll
1893
  ) },
1894
  _ & /*gradio*/
1895
- 64 && { i18n: (
1896
  /*gradio*/
1897
- f[6].i18n
1898
  ) },
1899
  _ & /*loading_status*/
1900
- 32 && yl(
1901
  /*loading_status*/
1902
- f[5]
1903
  ),
1904
  o[3]
1905
  ]) : {};
1906
  t.$set(m);
1907
- const c = {};
1908
  _ & /*loading_status*/
1909
- 32 && (c.min_height = /*loading_status*/
1910
- f[5] && /*loading_status*/
1911
- ((w = f[5]) == null ? void 0 : w.status) !== "complete"), _ & /*value*/
1912
- 8 && (c.value = /*value*/
1913
  f[3]), _ & /*elem_classes*/
1914
- 2 && (c.elem_classes = /*elem_classes*/
1915
  f[1]), _ & /*visible*/
1916
- 4 && (c.visible = /*visible*/
1917
  f[2]), _ & /*height*/
1918
- 16 && (c.height = /*height*/
1919
- f[4]), i.$set(c), (!s || _ & /*loading_status*/
1920
- 32) && Oe(
 
 
1921
  l,
1922
  "pending",
1923
  /*loading_status*/
1924
- ((y = f[5]) == null ? void 0 : y.status) === "pending"
1925
  );
1926
  },
1927
  i(f) {
1928
- s || (ue(t.$$.fragment, f), ue(i.$$.fragment, f), s = !0);
1929
  },
1930
  o(f) {
1931
- ce(t.$$.fragment, f), ce(i.$$.fragment, f), s = !1;
1932
  },
1933
  d(f) {
1934
  f && (Ye(e), Ye(l)), re(t, f), re(i);
1935
  }
1936
  };
1937
  }
1938
- function Cl(n) {
1939
  let t, e;
1940
- return t = new ml({
1941
  props: {
1942
  visible: (
1943
  /*visible*/
@@ -1952,7 +2004,7 @@ function Cl(n) {
1952
  n[1]
1953
  ),
1954
  container: !1,
1955
- $$slots: { default: [Ll] },
1956
  $$scope: { ctx: n }
1957
  }
1958
  }), {
@@ -1970,28 +2022,28 @@ function Cl(n) {
1970
  1 && (s.elem_id = /*elem_id*/
1971
  l[0]), i & /*elem_classes*/
1972
  2 && (s.elem_classes = /*elem_classes*/
1973
- l[1]), i & /*$$scope, loading_status, value, elem_classes, visible, height, gradio*/
1974
- 638 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
1975
  },
1976
  i(l) {
1977
- e || (ue(t.$$.fragment, l), e = !0);
1978
  },
1979
  o(l) {
1980
- ce(t.$$.fragment, l), e = !1;
1981
  },
1982
  d(l) {
1983
  re(t, l);
1984
  }
1985
  };
1986
  }
1987
- function Ml(n, t, e) {
1988
- let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: s = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { height: r = "100%" } = t, { loading_status: f } = t, { gradio: _ } = t;
1989
- const m = () => _.dispatch("change");
1990
  return n.$$set = (c) => {
1991
- "label" in c && e(7, l = c.label), "elem_id" in c && e(0, i = c.elem_id), "elem_classes" in c && e(1, s = c.elem_classes), "visible" in c && e(2, o = c.visible), "value" in c && e(3, a = c.value), "height" in c && e(4, r = c.height), "loading_status" in c && e(5, f = c.loading_status), "gradio" in c && e(6, _ = c.gradio);
1992
  }, n.$$.update = () => {
1993
  n.$$.dirty & /*label, gradio*/
1994
- 192 && _.dispatch("change");
1995
  }, [
1996
  i,
1997
  s,
@@ -2000,24 +2052,26 @@ function Ml(n, t, e) {
2000
  r,
2001
  f,
2002
  _,
 
2003
  l,
2004
- m
2005
  ];
2006
  }
2007
- class Vl extends gl {
2008
  constructor(t) {
2009
- super(), pl(this, t, Ml, Cl, ql, {
2010
- label: 7,
2011
  elem_id: 0,
2012
  elem_classes: 1,
2013
  visible: 2,
2014
  value: 3,
2015
  height: 4,
2016
- loading_status: 5,
2017
- gradio: 6
 
2018
  });
2019
  }
2020
  }
2021
  export {
2022
- Vl as default
2023
  };
 
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
+ attr: D,
5
+ binding_callbacks: ft,
6
+ detach: st,
7
  element: we,
8
+ init: ot,
9
+ insert: at,
10
+ listen: rt,
11
  noop: ve,
12
+ safe_not_equal: _t,
13
+ toggle_class: X
14
+ } = window.__gradio__svelte__internal, { createEventDispatcher: ct } = window.__gradio__svelte__internal;
15
+ function ut(n) {
16
+ let t, e, l, i, s;
17
  return {
18
  c() {
19
+ t = we("div"), e = we("iframe"), D(e, "title", "iframe component"), D(
20
  e,
21
+ "width",
22
+ /*width*/
23
+ n[5]
24
+ ), D(
25
  e,
26
  "srcdoc",
27
  /*value*/
28
  n[1]
29
+ ), D(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, D(t, "class", l = "prose " + /*elem_classes*/
30
+ n[0].join(" ") + " svelte-2qygph"), X(
31
  t,
32
  "min",
33
  /*min_height*/
34
  n[3]
35
+ ), X(t, "hide", !/*visible*/
36
+ n[2]), X(
37
+ t,
 
 
 
 
 
 
 
38
  "height",
39
  /*height*/
40
+ n[4]
41
+ );
42
+ },
43
+ m(o, a) {
44
+ at(o, t, a), it(t, e), n[8](e), i || (s = rt(
45
+ e,
46
+ "load",
47
+ /*onLoad*/
48
+ n[7]
49
+ ), i = !0);
50
+ },
51
+ p(o, [a]) {
52
+ a & /*width*/
53
+ 32 && D(
54
+ e,
55
+ "width",
56
+ /*width*/
57
+ o[5]
58
+ ), a & /*value*/
59
+ 2 && D(
60
  e,
61
  "srcdoc",
62
  /*value*/
63
+ o[1]
64
+ ), a & /*elem_classes*/
65
  1 && l !== (l = "prose " + /*elem_classes*/
66
+ o[0].join(" ") + " svelte-2qygph") && D(t, "class", l), a & /*elem_classes, min_height*/
67
+ 9 && X(
68
  t,
69
  "min",
70
  /*min_height*/
71
+ o[3]
72
+ ), a & /*elem_classes, visible*/
73
+ 5 && X(t, "hide", !/*visible*/
74
+ o[2]), a & /*elem_classes, height*/
75
+ 17 && X(
76
+ t,
77
+ "height",
78
+ /*height*/
79
+ o[4]
80
+ );
81
  },
82
  i: ve,
83
  o: ve,
84
+ d(o) {
85
+ o && st(t), n[8](null), i = !1, s();
86
  }
87
  };
88
  }
89
+ function dt(n, t, e) {
90
+ let { elem_classes: l = [] } = t, { value: i } = t, { visible: s = !0 } = t, { min_height: o = !1 } = t, { height: a } = t, { width: r = "100%" } = t;
91
+ const f = ct();
92
+ let _;
93
+ const m = () => {
94
+ try {
95
+ const c = _.contentDocument || _.contentWindow.document;
96
+ if (a === void 0) {
97
+ const v = c.documentElement.scrollHeight;
98
+ e(6, _.style.height = `${v}px`, _);
99
+ }
100
+ } catch (c) {
101
+ console.error("Error accessing iframe content:", c);
102
+ }
103
+ };
104
+ function b(c) {
105
+ ft[c ? "unshift" : "push"](() => {
106
+ _ = c, e(6, _);
107
+ });
108
+ }
109
+ return n.$$set = (c) => {
110
+ "elem_classes" in c && e(0, l = c.elem_classes), "value" in c && e(1, i = c.value), "visible" in c && e(2, s = c.visible), "min_height" in c && e(3, o = c.min_height), "height" in c && e(4, a = c.height), "width" in c && e(5, r = c.width);
111
  }, n.$$.update = () => {
112
  n.$$.dirty & /*value*/
113
+ 2 && f("change");
114
+ }, [
115
+ l,
116
+ i,
117
+ s,
118
+ o,
119
+ a,
120
+ r,
121
+ _,
122
+ m,
123
+ b
124
+ ];
125
  }
126
+ class mt extends nt {
127
  constructor(t) {
128
+ super(), ot(this, t, dt, ut, _t, {
129
  elem_classes: 0,
130
  value: 1,
131
  visible: 2,
132
  min_height: 3,
133
+ height: 4,
134
+ width: 5
135
  });
136
  }
137
  }
138
+ function G(n) {
139
  let t = ["", "k", "M", "G", "T", "P", "E", "Z"], e = 0;
140
  for (; n > 1e3 && e < t.length - 1; )
141
  n /= 1e3, e++;
 
144
  }
145
  function te() {
146
  }
147
+ function bt(n, t) {
148
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
149
  }
150
  const Re = typeof window < "u";
151
+ let ke = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
152
+ const O = /* @__PURE__ */ new Set();
153
+ function We(n) {
154
+ O.forEach((t) => {
155
+ t.c(n) || (O.delete(t), t.f());
156
+ }), O.size !== 0 && Ue(We);
157
  }
158
+ function gt(n) {
159
  let t;
160
+ return O.size === 0 && Ue(We), {
161
  promise: new Promise((e) => {
162
+ O.add(t = { c: n, f: e });
163
  }),
164
  abort() {
165
+ O.delete(t);
166
  }
167
  };
168
  }
169
+ const Y = [];
170
+ function ht(n, t = te) {
171
  let e;
172
  const l = /* @__PURE__ */ new Set();
173
  function i(a) {
174
+ if (bt(n, a) && (n = a, e)) {
175
+ const r = !Y.length;
176
  for (const f of l)
177
+ f[1](), Y.push(f, n);
178
  if (r) {
179
+ for (let f = 0; f < Y.length; f += 2)
180
+ Y[f][0](Y[f + 1]);
181
+ Y.length = 0;
182
  }
183
  }
184
  }
 
193
  }
194
  return { set: i, update: s, subscribe: o };
195
  }
196
+ function ye(n) {
197
  return Object.prototype.toString.call(n) === "[object Date]";
198
  }
199
  function se(n, t, e, l) {
200
+ if (typeof e == "number" || ye(e)) {
201
  const i = l - e, s = (e - t) / (n.dt || 1 / 60), o = n.opts.stiffness * i, a = n.opts.damping * s, r = (o - a) * n.inv_mass, f = (s + r) * n.dt;
202
+ return Math.abs(f) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, ye(e) ? new Date(e.getTime() + f) : e + f);
203
  } else {
204
  if (Array.isArray(e))
205
  return e.map(
 
215
  }
216
  }
217
  function pe(n, t = {}) {
218
+ const e = ht(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
219
+ let o, a, r, f = n, _ = n, m = 1, b = 0, c = !1;
220
+ function v(p, L = {}) {
221
  _ = p;
222
  const F = r = {};
223
+ return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (c = !0, o = ke(), f = p, e.set(n = _), Promise.resolve()) : (L.soft && (b = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), m = 0), a || (o = ke(), c = !1, a = gt((u) => {
224
+ if (c)
225
+ return c = !1, a = null, !1;
226
+ m = Math.min(m + b, 1);
227
+ const y = {
228
  inv_mass: m,
229
  opts: C,
230
  settled: !0,
231
  dt: (u - o) * 60 / 1e3
232
+ }, g = se(y, f, n, _);
233
+ return o = u, f = n, e.set(n = g), y.settled && (a = null), !y.settled;
234
  })), new Promise((u) => {
235
  a.promise.then(() => {
236
  F === r && u();
 
238
  }));
239
  }
240
  const C = {
241
+ set: v,
242
+ update: (p, L) => v(p(_, n), L),
243
  subscribe: e.subscribe,
244
  stiffness: l,
245
  damping: i,
 
248
  return C;
249
  }
250
  const {
251
+ SvelteComponent: wt,
252
  append: N,
253
+ attr: k,
254
  component_subscribe: qe,
255
+ detach: vt,
256
+ element: kt,
257
+ init: yt,
258
+ insert: pt,
259
  noop: Fe,
260
+ safe_not_equal: qt,
261
  set_style: $,
262
  svg_element: z,
263
  toggle_class: Le
264
+ } = window.__gradio__svelte__internal, { onMount: Ft } = window.__gradio__svelte__internal;
265
+ function Lt(n) {
266
+ let t, e, l, i, s, o, a, r, f, _, m, b;
267
  return {
268
  c() {
269
+ t = kt("div"), e = z("svg"), l = z("g"), i = z("path"), s = z("path"), o = z("path"), a = z("path"), r = z("g"), f = z("path"), _ = z("path"), m = z("path"), b = z("path"), k(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), k(i, "fill", "#FF7C00"), k(i, "fill-opacity", "0.4"), k(i, "class", "svelte-43sxxs"), k(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), k(s, "fill", "#FF7C00"), k(s, "class", "svelte-43sxxs"), k(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), k(o, "fill", "#FF7C00"), k(o, "fill-opacity", "0.4"), k(o, "class", "svelte-43sxxs"), k(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), k(a, "fill", "#FF7C00"), k(a, "class", "svelte-43sxxs"), $(l, "transform", "translate(" + /*$top*/
270
  n[1][0] + "px, " + /*$top*/
271
+ n[1][1] + "px)"), k(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), k(f, "fill", "#FF7C00"), k(f, "fill-opacity", "0.4"), k(f, "class", "svelte-43sxxs"), k(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), k(_, "fill", "#FF7C00"), k(_, "class", "svelte-43sxxs"), k(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), k(m, "fill", "#FF7C00"), k(m, "fill-opacity", "0.4"), k(m, "class", "svelte-43sxxs"), k(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), k(b, "fill", "#FF7C00"), k(b, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
272
  n[2][0] + "px, " + /*$bottom*/
273
+ n[2][1] + "px)"), k(e, "viewBox", "-1200 -1200 3000 3000"), k(e, "fill", "none"), k(e, "xmlns", "http://www.w3.org/2000/svg"), k(e, "class", "svelte-43sxxs"), k(t, "class", "svelte-43sxxs"), Le(
274
  t,
275
  "margin",
276
  /*margin*/
277
  n[0]
278
  );
279
  },
280
+ m(c, v) {
281
+ pt(c, t, v), N(t, e), N(e, l), N(l, i), N(l, s), N(l, o), N(l, a), N(e, r), N(r, f), N(r, _), N(r, m), N(r, b);
282
  },
283
+ p(c, [v]) {
284
+ v & /*$top*/
285
  2 && $(l, "transform", "translate(" + /*$top*/
286
+ c[1][0] + "px, " + /*$top*/
287
+ c[1][1] + "px)"), v & /*$bottom*/
288
  4 && $(r, "transform", "translate(" + /*$bottom*/
289
+ c[2][0] + "px, " + /*$bottom*/
290
+ c[2][1] + "px)"), v & /*margin*/
291
  1 && Le(
292
  t,
293
  "margin",
294
  /*margin*/
295
+ c[0]
296
  );
297
  },
298
  i: Fe,
299
  o: Fe,
300
+ d(c) {
301
+ c && vt(t);
302
  }
303
  };
304
  }
305
+ function Ct(n, t, e) {
306
  let l, i, { margin: s = !0 } = t;
307
  const o = pe([0, 0]);
308
+ qe(n, o, (b) => e(1, l = b));
309
  const a = pe([0, 0]);
310
+ qe(n, a, (b) => e(2, i = b));
311
  let r;
312
  async function f() {
313
  await Promise.all([o.set([125, 140]), a.set([-125, -140])]), await Promise.all([o.set([-125, 140]), a.set([125, -140])]), await Promise.all([o.set([-125, 0]), a.set([125, -0])]), await Promise.all([o.set([125, 0]), a.set([-125, 0])]);
 
318
  async function m() {
319
  await Promise.all([o.set([125, 0]), a.set([-125, 0])]), _();
320
  }
321
+ return Ft(() => (m(), () => r = !0)), n.$$set = (b) => {
322
+ "margin" in b && e(0, s = b.margin);
323
  }, [s, l, i, o, a];
324
  }
325
+ class Mt extends wt {
326
  constructor(t) {
327
+ super(), yt(this, t, Ct, Lt, qt, { margin: 0 });
328
  }
329
  }
330
  const {
331
+ SvelteComponent: Vt,
332
  append: H,
333
  attr: T,
334
  binding_callbacks: Ce,
335
+ check_outros: Je,
336
+ create_component: St,
337
+ create_slot: Nt,
338
+ destroy_component: zt,
339
+ destroy_each: Ke,
340
+ detach: h,
341
+ element: P,
342
+ empty: W,
343
  ensure_array_like: le,
344
+ get_all_dirty_from_scope: Tt,
345
+ get_slot_changes: jt,
346
+ group_outros: Qe,
347
+ init: Pt,
348
+ insert: w,
349
+ mount_component: Zt,
350
  noop: oe,
351
+ safe_not_equal: Dt,
352
  set_data: S,
353
+ set_style: B,
354
  space: j,
355
  text: q,
356
  toggle_class: V,
357
+ transition_in: R,
358
+ transition_out: U,
359
+ update_slot_base: Et
360
+ } = window.__gradio__svelte__internal, { tick: Bt } = window.__gradio__svelte__internal, { onDestroy: At } = window.__gradio__svelte__internal, It = (n) => ({}), Me = (n) => ({});
361
  function Ve(n, t, e) {
362
  const l = n.slice();
363
  return l[38] = t[e], l[40] = e, l;
 
366
  const l = n.slice();
367
  return l[38] = t[e], l;
368
  }
369
+ function Ht(n) {
370
  let t, e = (
371
  /*i18n*/
372
  n[1]("common.error") + ""
 
374
  const o = (
375
  /*#slots*/
376
  n[29].error
377
+ ), a = Nt(
378
  o,
379
  n,
380
  /*$$scope*/
 
383
  );
384
  return {
385
  c() {
386
+ t = P("span"), l = q(e), i = j(), a && a.c(), T(t, "class", "error svelte-1txqlrd");
387
  },
388
  m(r, f) {
389
+ w(r, t, f), H(t, l), w(r, i, f), a && a.m(r, f), s = !0;
390
  },
391
  p(r, f) {
392
  (!s || f[0] & /*i18n*/
393
  2) && e !== (e = /*i18n*/
394
  r[1]("common.error") + "") && S(l, e), a && a.p && (!s || f[0] & /*$$scope*/
395
+ 268435456) && Et(
396
  a,
397
  o,
398
  r,
399
  /*$$scope*/
400
  r[28],
401
+ s ? jt(
402
  o,
403
  /*$$scope*/
404
  r[28],
405
  f,
406
+ It
407
+ ) : Tt(
408
  /*$$scope*/
409
  r[28]
410
  ),
 
412
  );
413
  },
414
  i(r) {
415
+ s || (R(a, r), s = !0);
416
  },
417
  o(r) {
418
+ U(a, r), s = !1;
419
  },
420
  d(r) {
421
+ r && (h(t), h(i)), a && a.d(r);
422
  }
423
  };
424
  }
425
+ function Xt(n) {
426
  let t, e, l, i, s, o, a, r, f, _ = (
427
  /*variant*/
428
  n[8] === "default" && /*show_eta_bar*/
429
  n[18] && /*show_progress*/
430
  n[6] === "full" && Ne(n)
431
  );
432
+ function m(u, y) {
433
  if (
434
  /*progress*/
435
  u[7]
436
  )
437
+ return Ot;
438
  if (
439
  /*queue_position*/
440
  u[2] !== null && /*queue_size*/
441
  u[3] !== void 0 && /*queue_position*/
442
  u[2] >= 0
443
  )
444
+ return Gt;
445
  if (
446
  /*queue_position*/
447
  u[2] === 0
448
  )
449
+ return Yt;
450
  }
451
+ let b = m(n), c = b && b(n), v = (
452
  /*timer*/
453
  n[5] && je(n)
454
  );
455
+ const C = [Jt, Wt], p = [];
456
+ function L(u, y) {
457
  return (
458
  /*last_progress_level*/
459
  u[15] != null ? 0 : (
 
467
  n[5] && Ie(n);
468
  return {
469
  c() {
470
+ _ && _.c(), t = j(), e = P("div"), c && c.c(), l = j(), v && v.c(), i = j(), o && o.c(), a = j(), F && F.c(), r = W(), T(e, "class", "progress-text svelte-1txqlrd"), V(
471
  e,
472
  "meta-text-center",
473
  /*variant*/
 
479
  n[8] === "default"
480
  );
481
  },
482
+ m(u, y) {
483
+ _ && _.m(u, y), w(u, t, y), w(u, e, y), c && c.m(e, null), H(e, l), v && v.m(e, null), w(u, i, y), ~s && p[s].m(u, y), w(u, a, y), F && F.m(u, y), w(u, r, y), f = !0;
484
  },
485
+ p(u, y) {
486
  /*variant*/
487
  u[8] === "default" && /*show_eta_bar*/
488
  u[18] && /*show_progress*/
489
+ u[6] === "full" ? _ ? _.p(u, y) : (_ = Ne(u), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), b === (b = m(u)) && c ? c.p(u, y) : (c && c.d(1), c = b && b(u), c && (c.c(), c.m(e, l))), /*timer*/
490
+ u[5] ? v ? v.p(u, y) : (v = je(u), v.c(), v.m(e, null)) : v && (v.d(1), v = null), (!f || y[0] & /*variant*/
491
  256) && V(
492
  e,
493
  "meta-text-center",
494
  /*variant*/
495
  u[8] === "center"
496
+ ), (!f || y[0] & /*variant*/
497
  256) && V(
498
  e,
499
  "meta-text",
500
  /*variant*/
501
  u[8] === "default"
502
  );
503
+ let g = s;
504
+ s = L(u), s === g ? ~s && p[s].p(u, y) : (o && (Qe(), U(p[g], 1, 1, () => {
505
+ p[g] = null;
506
+ }), Je()), ~s ? (o = p[s], o ? o.p(u, y) : (o = p[s] = C[s](u), o.c()), R(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
507
+ u[5] ? F && (F.d(1), F = null) : F ? F.p(u, y) : (F = Ie(u), F.c(), F.m(r.parentNode, r));
508
  },
509
  i(u) {
510
+ f || (R(o), f = !0);
511
  },
512
  o(u) {
513
+ U(o), f = !1;
514
  },
515
  d(u) {
516
+ u && (h(t), h(e), h(i), h(a), h(r)), _ && _.d(u), c && c.d(), v && v.d(), ~s && p[s].d(u), F && F.d(u);
517
  }
518
  };
519
  }
 
522
  (n[17] || 0) * 100 - 100}%)`;
523
  return {
524
  c() {
525
+ t = P("div"), T(t, "class", "eta-bar svelte-1txqlrd"), B(t, "transform", e);
526
  },
527
  m(l, i) {
528
+ w(l, t, i);
529
  },
530
  p(l, i) {
531
  i[0] & /*eta_level*/
532
  131072 && e !== (e = `translateX(${/*eta_level*/
533
+ (l[17] || 0) * 100 - 100}%)`) && B(t, "transform", e);
534
  },
535
  d(l) {
536
+ l && h(t);
537
  }
538
  };
539
  }
540
+ function Yt(n) {
541
  let t;
542
  return {
543
  c() {
544
  t = q("processing |");
545
  },
546
  m(e, l) {
547
+ w(e, t, l);
548
  },
549
  p: oe,
550
  d(e) {
551
+ e && h(t);
552
  }
553
  };
554
  }
555
+ function Gt(n) {
556
  let t, e = (
557
  /*queue_position*/
558
  n[2] + 1 + ""
 
565
  ), o = q(" |");
566
  },
567
  m(a, r) {
568
+ w(a, t, r), w(a, l, r), w(a, i, r), w(a, s, r), w(a, o, r);
569
  },
570
  p(a, r) {
571
  r[0] & /*queue_position*/
 
578
  );
579
  },
580
  d(a) {
581
+ a && (h(t), h(l), h(i), h(s), h(o));
582
  }
583
  };
584
  }
585
+ function Ot(n) {
586
  let t, e = le(
587
  /*progress*/
588
  n[7]
 
593
  c() {
594
  for (let i = 0; i < l.length; i += 1)
595
  l[i].c();
596
+ t = W();
597
  },
598
  m(i, s) {
599
  for (let o = 0; o < l.length; o += 1)
600
  l[o] && l[o].m(i, s);
601
+ w(i, t, s);
602
  },
603
  p(i, s) {
604
  if (s[0] & /*progress*/
 
618
  }
619
  },
620
  d(i) {
621
+ i && h(t), Ke(l, i);
622
  }
623
  };
624
  }
 
630
  function a(_, m) {
631
  return (
632
  /*p*/
633
+ _[38].length != null ? Ut : Rt
634
  );
635
  }
636
  let r = a(n), f = r(n);
 
639
  f.c(), t = j(), l = q(e), i = q(" | "), o = q(s);
640
  },
641
  m(_, m) {
642
+ f.m(_, m), w(_, t, m), w(_, l, m), w(_, i, m), w(_, o, m);
643
  },
644
  p(_, m) {
645
  r === (r = a(_)) && f ? f.p(_, m) : (f.d(1), f = r(_), f && (f.c(), f.m(t.parentNode, t))), m[0] & /*progress*/
 
647
  _[38].unit + "") && S(l, e);
648
  },
649
  d(_) {
650
+ _ && (h(t), h(l), h(i), h(o)), f.d(_);
651
  }
652
  };
653
  }
654
+ function Rt(n) {
655
+ let t = G(
656
  /*p*/
657
  n[38].index || 0
658
  ) + "", e;
 
661
  e = q(t);
662
  },
663
  m(l, i) {
664
+ w(l, e, i);
665
  },
666
  p(l, i) {
667
  i[0] & /*progress*/
668
+ 128 && t !== (t = G(
669
  /*p*/
670
  l[38].index || 0
671
  ) + "") && S(e, t);
672
  },
673
  d(l) {
674
+ l && h(e);
675
  }
676
  };
677
  }
678
+ function Ut(n) {
679
+ let t = G(
680
  /*p*/
681
  n[38].index || 0
682
+ ) + "", e, l, i = G(
683
  /*p*/
684
  n[38].length
685
  ) + "", s;
 
688
  e = q(t), l = q("/"), s = q(i);
689
  },
690
  m(o, a) {
691
+ w(o, e, a), w(o, l, a), w(o, s, a);
692
  },
693
  p(o, a) {
694
  a[0] & /*progress*/
695
+ 128 && t !== (t = G(
696
  /*p*/
697
  o[38].index || 0
698
  ) + "") && S(e, t), a[0] & /*progress*/
699
+ 128 && i !== (i = G(
700
  /*p*/
701
  o[38].length
702
  ) + "") && S(s, i);
703
  },
704
  d(o) {
705
+ o && (h(e), h(l), h(s));
706
  }
707
  };
708
  }
 
713
  );
714
  return {
715
  c() {
716
+ e && e.c(), t = W();
717
  },
718
  m(l, i) {
719
+ e && e.m(l, i), w(l, t, i);
720
  },
721
  p(l, i) {
722
  /*p*/
723
  l[38].index != null ? e ? e.p(l, i) : (e = ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
724
  },
725
  d(l) {
726
+ l && h(t), e && e.d(l);
727
  }
728
  };
729
  }
 
741
  ), l = q(e), i = q("s");
742
  },
743
  m(s, o) {
744
+ w(s, t, o), w(s, l, o), w(s, i, o);
745
  },
746
  p(s, o) {
747
  o[0] & /*formatted_timer*/
 
755
  s[19]}` : "") && S(l, e);
756
  },
757
  d(s) {
758
+ s && (h(t), h(l), h(i));
759
  }
760
  };
761
  }
762
+ function Wt(n) {
763
  let t, e;
764
+ return t = new Mt({
765
  props: { margin: (
766
  /*variant*/
767
  n[8] === "default"
768
  ) }
769
  }), {
770
  c() {
771
+ St(t.$$.fragment);
772
  },
773
  m(l, i) {
774
+ Zt(t, l, i), e = !0;
775
  },
776
  p(l, i) {
777
  const s = {};
 
780
  l[8] === "default"), t.$set(s);
781
  },
782
  i(l) {
783
+ e || (R(t.$$.fragment, l), e = !0);
784
  },
785
  o(l) {
786
+ U(t.$$.fragment, l), e = !1;
787
  },
788
  d(l) {
789
+ zt(t, l);
790
  }
791
  };
792
  }
793
+ function Jt(n) {
794
  let t, e, l, i, s, o = `${/*last_progress_level*/
795
  n[15] * 100}%`, a = (
796
  /*progress*/
 
798
  );
799
  return {
800
  c() {
801
+ t = P("div"), e = P("div"), a && a.c(), l = j(), i = P("div"), s = P("div"), T(e, "class", "progress-level-inner svelte-1txqlrd"), T(s, "class", "progress-bar svelte-1txqlrd"), B(s, "width", o), T(i, "class", "progress-bar-wrap svelte-1txqlrd"), T(t, "class", "progress-level svelte-1txqlrd");
802
  },
803
  m(r, f) {
804
+ w(r, t, f), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, s), n[30](s);
805
  },
806
  p(r, f) {
807
  /*progress*/
808
  r[7] != null ? a ? a.p(r, f) : (a = Pe(r), a.c(), a.m(e, null)) : a && (a.d(1), a = null), f[0] & /*last_progress_level*/
809
  32768 && o !== (o = `${/*last_progress_level*/
810
+ r[15] * 100}%`) && B(s, "width", o);
811
  },
812
  i: oe,
813
  o: oe,
814
  d(r) {
815
+ r && h(t), a && a.d(), n[30](null);
816
  }
817
  };
818
  }
 
822
  n[7]
823
  ), l = [];
824
  for (let i = 0; i < e.length; i += 1)
825
+ l[i] = Ae(Ve(n, e, i));
826
  return {
827
  c() {
828
  for (let i = 0; i < l.length; i += 1)
829
  l[i].c();
830
+ t = W();
831
  },
832
  m(i, s) {
833
  for (let o = 0; o < l.length; o += 1)
834
  l[o] && l[o].m(i, s);
835
+ w(i, t, s);
836
  },
837
  p(i, s) {
838
  if (s[0] & /*progress_level, progress*/
 
844
  let o;
845
  for (o = 0; o < e.length; o += 1) {
846
  const a = Ve(i, e, o);
847
+ l[o] ? l[o].p(a, s) : (l[o] = Ae(a), l[o].c(), l[o].m(t.parentNode, t));
848
  }
849
  for (; o < l.length; o += 1)
850
  l[o].d(1);
 
852
  }
853
  },
854
  d(i) {
855
+ i && h(t), Ke(l, i);
856
  }
857
  };
858
  }
859
  function Ze(n) {
860
  let t, e, l, i, s = (
861
  /*i*/
862
+ n[40] !== 0 && Kt()
863
  ), o = (
864
  /*p*/
865
+ n[38].desc != null && De(n)
866
  ), a = (
867
  /*p*/
868
  n[38].desc != null && /*progress_level*/
 
870
  n[14][
871
  /*i*/
872
  n[40]
873
+ ] != null && Ee()
874
  ), r = (
875
  /*progress_level*/
876
+ n[14] != null && Be(n)
877
  );
878
  return {
879
  c() {
880
+ s && s.c(), t = j(), o && o.c(), e = j(), a && a.c(), l = j(), r && r.c(), i = W();
881
  },
882
  m(f, _) {
883
+ s && s.m(f, _), w(f, t, _), o && o.m(f, _), w(f, e, _), a && a.m(f, _), w(f, l, _), r && r.m(f, _), w(f, i, _);
884
  },
885
  p(f, _) {
886
  /*p*/
887
+ f[38].desc != null ? o ? o.p(f, _) : (o = De(f), o.c(), o.m(e.parentNode, e)) : o && (o.d(1), o = null), /*p*/
888
  f[38].desc != null && /*progress_level*/
889
  f[14] && /*progress_level*/
890
  f[14][
891
  /*i*/
892
  f[40]
893
+ ] != null ? a || (a = Ee(), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null), /*progress_level*/
894
+ f[14] != null ? r ? r.p(f, _) : (r = Be(f), r.c(), r.m(i.parentNode, i)) : r && (r.d(1), r = null);
895
  },
896
  d(f) {
897
+ f && (h(t), h(e), h(l), h(i)), s && s.d(f), o && o.d(f), a && a.d(f), r && r.d(f);
898
  }
899
  };
900
  }
901
+ function Kt(n) {
902
  let t;
903
  return {
904
  c() {
905
  t = q(" /");
906
  },
907
  m(e, l) {
908
+ w(e, t, l);
909
  },
910
  d(e) {
911
+ e && h(t);
912
  }
913
  };
914
  }
915
+ function De(n) {
916
  let t = (
917
  /*p*/
918
  n[38].desc + ""
 
922
  e = q(t);
923
  },
924
  m(l, i) {
925
+ w(l, e, i);
926
  },
927
  p(l, i) {
928
  i[0] & /*progress*/
 
930
  l[38].desc + "") && S(e, t);
931
  },
932
  d(l) {
933
+ l && h(e);
934
  }
935
  };
936
  }
937
+ function Ee(n) {
938
  let t;
939
  return {
940
  c() {
941
  t = q("-");
942
  },
943
  m(e, l) {
944
+ w(e, t, l);
945
  },
946
  d(e) {
947
+ e && h(t);
948
  }
949
  };
950
  }
951
+ function Be(n) {
952
  let t = (100 * /*progress_level*/
953
  (n[14][
954
  /*i*/
 
959
  e = q(t), l = q("%");
960
  },
961
  m(i, s) {
962
+ w(i, e, s), w(i, l, s);
963
  },
964
  p(i, s) {
965
  s[0] & /*progress_level*/
 
970
  ] || 0)).toFixed(1) + "") && S(e, t);
971
  },
972
  d(i) {
973
+ i && (h(e), h(l));
974
  }
975
  };
976
  }
977
+ function Ae(n) {
978
  let t, e = (
979
  /*p*/
980
  (n[38].desc != null || /*progress_level*/
 
986
  );
987
  return {
988
  c() {
989
+ e && e.c(), t = W();
990
  },
991
  m(l, i) {
992
+ e && e.m(l, i), w(l, t, i);
993
  },
994
  p(l, i) {
995
  /*p*/
 
1001
  ] != null ? e ? e.p(l, i) : (e = Ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
1002
  },
1003
  d(l) {
1004
+ l && h(t), e && e.d(l);
1005
  }
1006
  };
1007
  }
 
1009
  let t, e;
1010
  return {
1011
  c() {
1012
+ t = P("p"), e = q(
1013
  /*loading_text*/
1014
  n[9]
1015
  ), T(t, "class", "loading svelte-1txqlrd");
1016
  },
1017
  m(l, i) {
1018
+ w(l, t, i), H(t, e);
1019
  },
1020
  p(l, i) {
1021
  i[0] & /*loading_text*/
 
1026
  );
1027
  },
1028
  d(l) {
1029
+ l && h(t);
1030
  }
1031
  };
1032
  }
1033
+ function Qt(n) {
1034
  let t, e, l, i, s;
1035
+ const o = [Xt, Ht], a = [];
1036
  function r(f, _) {
1037
  return (
1038
  /*status*/
 
1044
  }
1045
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
1046
  c() {
1047
+ t = P("div"), l && l.c(), T(t, "class", i = "wrap " + /*variant*/
1048
  n[8] + " " + /*show_progress*/
1049
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
1050
  n[4] || /*status*/
 
1068
  "border",
1069
  /*border*/
1070
  n[12]
1071
+ ), B(
1072
  t,
1073
  "position",
1074
  /*absolute*/
1075
  n[10] ? "absolute" : "static"
1076
+ ), B(
1077
  t,
1078
  "padding",
1079
  /*absolute*/
 
1081
  );
1082
  },
1083
  m(f, _) {
1084
+ w(f, t, _), ~e && a[e].m(t, null), n[31](t), s = !0;
1085
  },
1086
  p(f, _) {
1087
  let m = e;
1088
+ e = r(f), e === m ? ~e && a[e].p(f, _) : (l && (Qe(), U(a[m], 1, 1, () => {
1089
  a[m] = null;
1090
+ }), Je()), ~e ? (l = a[e], l ? l.p(f, _) : (l = a[e] = o[e](f), l.c()), R(l, 1), l.m(t, null)) : l = null), (!s || _[0] & /*variant, show_progress*/
1091
  320 && i !== (i = "wrap " + /*variant*/
1092
  f[8] + " " + /*show_progress*/
1093
  f[6] + " svelte-1txqlrd")) && T(t, "class", i), (!s || _[0] & /*variant, show_progress, status, show_progress*/
 
1117
  /*border*/
1118
  f[12]
1119
  ), _[0] & /*absolute*/
1120
+ 1024 && B(
1121
  t,
1122
  "position",
1123
  /*absolute*/
1124
  f[10] ? "absolute" : "static"
1125
  ), _[0] & /*absolute*/
1126
+ 1024 && B(
1127
  t,
1128
  "padding",
1129
  /*absolute*/
 
1131
  );
1132
  },
1133
  i(f) {
1134
+ s || (R(l), s = !0);
1135
  },
1136
  o(f) {
1137
+ U(l), s = !1;
1138
  },
1139
  d(f) {
1140
+ f && h(t), ~e && a[e].d(), n[31](null);
1141
  }
1142
  };
1143
  }
1144
  let ee = [], fe = !1;
1145
+ async function xt(n, t = !0) {
1146
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
1147
  if (ee.push(n), !fe)
1148
  fe = !0;
 
1158
  });
1159
  }
1160
  }
1161
+ function $t(n, t, e) {
1162
+ let l, { $$slots: i = {}, $$scope: s } = t, { i18n: o } = t, { eta: a = null } = t, { queue: r = !1 } = t, { queue_position: f } = t, { queue_size: _ } = t, { status: m } = t, { scroll_to_output: b = !1 } = t, { timer: c = !0 } = t, { show_progress: v = "full" } = t, { message: C = null } = t, { progress: p = null } = t, { variant: L = "default" } = t, { loading_text: F = "Loading..." } = t, { absolute: u = !0 } = t, { translucent: y = !1 } = t, { border: g = !1 } = t, { autoscroll: ne } = t, J, K = !1, x = 0, A = 0, ie = null, de = 0, I = null, Q, Z = null, me = !0;
1163
  const et = () => {
1164
+ e(25, x = performance.now()), e(26, A = 0), K = !0, be();
1165
  };
1166
  function be() {
1167
  requestAnimationFrame(() => {
1168
+ e(26, A = (performance.now() - x) / 1e3), K && be();
1169
  });
1170
  }
1171
  function ge() {
1172
+ e(26, A = 0), K && (K = !1);
1173
  }
1174
  At(() => {
1175
  K && ge();
 
1177
  let he = null;
1178
  function tt(d) {
1179
  Ce[d ? "unshift" : "push"](() => {
1180
+ Z = d, e(16, Z), e(7, p), e(14, I), e(15, Q);
1181
  });
1182
  }
1183
  function lt(d) {
 
1186
  });
1187
  }
1188
  return n.$$set = (d) => {
1189
+ "i18n" in d && e(1, o = d.i18n), "eta" in d && e(0, a = d.eta), "queue" in d && e(21, r = d.queue), "queue_position" in d && e(2, f = d.queue_position), "queue_size" in d && e(3, _ = d.queue_size), "status" in d && e(4, m = d.status), "scroll_to_output" in d && e(22, b = d.scroll_to_output), "timer" in d && e(5, c = d.timer), "show_progress" in d && e(6, v = d.show_progress), "message" in d && e(23, C = d.message), "progress" in d && e(7, p = d.progress), "variant" in d && e(8, L = d.variant), "loading_text" in d && e(9, F = d.loading_text), "absolute" in d && e(10, u = d.absolute), "translucent" in d && e(11, y = d.translucent), "border" in d && e(12, g = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, s = d.$$scope);
1190
  }, n.$$.update = () => {
1191
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1192
+ 169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - x) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
1193
+ 67108865 && e(17, de = a === null || a <= 0 || !A ? null : Math.min(A / a, 1)), n.$$.dirty[0] & /*progress*/
1194
  128 && p != null && e(18, me = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1195
  114816 && (p != null ? e(14, I = p.map((d) => {
1196
  if (d.index != null && d.length != null)
1197
  return d.index / d.length;
1198
  if (d.progress != null)
1199
  return d.progress;
1200
+ })) : e(14, I = null), I ? (e(15, Q = I[I.length - 1]), Z && (Q === 0 ? e(16, Z.style.transition = "0", Z) : e(16, Z.style.transition = "150ms", Z))) : e(15, Q = void 0)), n.$$.dirty[0] & /*status*/
1201
  16 && (m === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1202
+ 20979728 && J && b && (m === "pending" || m === "complete") && xt(J, ne), n.$$.dirty[0] & /*status, message*/
1203
  8388624, n.$$.dirty[0] & /*timer_diff*/
1204
+ 67108864 && e(20, l = A.toFixed(1));
1205
  }, [
1206
  a,
1207
  o,
1208
  f,
1209
  _,
1210
  m,
1211
+ c,
1212
+ v,
1213
  p,
1214
  L,
1215
  F,
1216
  u,
1217
+ y,
1218
+ g,
1219
  J,
1220
  I,
1221
  Q,
1222
+ Z,
1223
  de,
1224
  me,
1225
  he,
1226
  l,
1227
  r,
1228
+ b,
1229
  C,
1230
  ne,
1231
+ x,
1232
+ A,
1233
  ie,
1234
  s,
1235
  i,
 
1237
  lt
1238
  ];
1239
  }
1240
+ class el extends Vt {
1241
  constructor(t) {
1242
+ super(), Pt(
1243
  this,
1244
  t,
1245
+ $t,
1246
+ Qt,
1247
+ Dt,
1248
  {
1249
  i18n: 1,
1250
  eta: 0,
 
1270
  }
1271
  }
1272
  const {
1273
+ SvelteComponent: tl,
1274
+ assign: ll,
1275
+ create_slot: nl,
1276
+ detach: il,
1277
+ element: fl,
1278
+ get_all_dirty_from_scope: sl,
1279
+ get_slot_changes: ol,
1280
+ get_spread_update: al,
1281
+ init: rl,
1282
+ insert: _l,
1283
+ safe_not_equal: cl,
1284
  set_dynamic_element_data: He,
1285
  set_style: M,
1286
+ toggle_class: E,
1287
  transition_in: xe,
1288
  transition_out: $e,
1289
+ update_slot_base: ul
1290
  } = window.__gradio__svelte__internal;
1291
+ function dl(n) {
1292
  let t, e, l;
1293
  const i = (
1294
  /*#slots*/
1295
  n[17].default
1296
+ ), s = nl(
1297
  i,
1298
  n,
1299
  /*$$scope*/
 
1315
  }
1316
  ], a = {};
1317
  for (let r = 0; r < o.length; r += 1)
1318
+ a = ll(a, o[r]);
1319
  return {
1320
  c() {
1321
+ t = fl(
1322
  /*tag*/
1323
  n[14]
1324
  ), s && s.c(), He(
1325
  /*tag*/
1326
  n[14]
1327
+ )(t, a), E(
1328
  t,
1329
  "hidden",
1330
  /*visible*/
1331
  n[10] === !1
1332
+ ), E(
1333
  t,
1334
  "padded",
1335
  /*padding*/
1336
  n[6]
1337
+ ), E(
1338
  t,
1339
  "border_focus",
1340
  /*border_mode*/
1341
  n[5] === "focus"
1342
+ ), E(t, "hide-container", !/*explicit_call*/
1343
  n[8] && !/*container*/
1344
  n[9]), M(t, "height", typeof /*height*/
1345
  n[0] == "number" ? (
 
1366
  n[13]}px, 100%))`), M(t, "border-width", "var(--block-border-width)");
1367
  },
1368
  m(r, f) {
1369
+ _l(r, t, f), s && s.m(t, null), l = !0;
1370
  },
1371
  p(r, f) {
1372
  s && s.p && (!l || f & /*$$scope*/
1373
+ 65536) && ul(
1374
  s,
1375
  i,
1376
  r,
1377
  /*$$scope*/
1378
  r[16],
1379
+ l ? ol(
1380
  i,
1381
  /*$$scope*/
1382
  r[16],
1383
  f,
1384
  null
1385
+ ) : sl(
1386
  /*$$scope*/
1387
  r[16]
1388
  ),
 
1390
  ), He(
1391
  /*tag*/
1392
  r[14]
1393
+ )(t, a = al(o, [
1394
  (!l || f & /*test_id*/
1395
  128) && { "data-testid": (
1396
  /*test_id*/
 
1404
  (!l || f & /*elem_classes*/
1405
  8 && e !== (e = "block " + /*elem_classes*/
1406
  r[3].join(" ") + " svelte-1t38q2d")) && { class: e }
1407
+ ])), E(
1408
  t,
1409
  "hidden",
1410
  /*visible*/
1411
  r[10] === !1
1412
+ ), E(
1413
  t,
1414
  "padded",
1415
  /*padding*/
1416
  r[6]
1417
+ ), E(
1418
  t,
1419
  "border_focus",
1420
  /*border_mode*/
1421
  r[5] === "focus"
1422
+ ), E(t, "hide-container", !/*explicit_call*/
1423
  r[8] && !/*container*/
1424
  r[9]), f & /*height*/
1425
  1 && M(t, "height", typeof /*height*/
 
1458
  $e(s, r), l = !1;
1459
  },
1460
  d(r) {
1461
+ r && il(t), s && s.d(r);
1462
  }
1463
  };
1464
  }
1465
+ function ml(n) {
1466
  let t, e = (
1467
  /*tag*/
1468
+ n[14] && dl(n)
1469
  );
1470
  return {
1471
  c() {
 
1489
  }
1490
  };
1491
  }
1492
+ function bl(n, t, e) {
1493
+ let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: r = [] } = t, { variant: f = "solid" } = t, { border_mode: _ = "base" } = t, { padding: m = !0 } = t, { type: b = "normal" } = t, { test_id: c = void 0 } = t, { explicit_call: v = !1 } = t, { container: C = !0 } = t, { visible: p = !0 } = t, { allow_overflow: L = !0 } = t, { scale: F = null } = t, { min_width: u = 0 } = t, y = b === "fieldset" ? "fieldset" : "div";
1494
+ return n.$$set = (g) => {
1495
+ "height" in g && e(0, s = g.height), "width" in g && e(1, o = g.width), "elem_id" in g && e(2, a = g.elem_id), "elem_classes" in g && e(3, r = g.elem_classes), "variant" in g && e(4, f = g.variant), "border_mode" in g && e(5, _ = g.border_mode), "padding" in g && e(6, m = g.padding), "type" in g && e(15, b = g.type), "test_id" in g && e(7, c = g.test_id), "explicit_call" in g && e(8, v = g.explicit_call), "container" in g && e(9, C = g.container), "visible" in g && e(10, p = g.visible), "allow_overflow" in g && e(11, L = g.allow_overflow), "scale" in g && e(12, F = g.scale), "min_width" in g && e(13, u = g.min_width), "$$scope" in g && e(16, i = g.$$scope);
1496
  }, [
1497
  s,
1498
  o,
 
1501
  f,
1502
  _,
1503
  m,
1504
+ c,
1505
+ v,
1506
  C,
1507
  p,
1508
  L,
1509
  F,
1510
  u,
1511
+ y,
1512
+ b,
1513
  i,
1514
  l
1515
  ];
1516
  }
1517
+ class gl extends tl {
1518
  constructor(t) {
1519
+ super(), rl(this, t, bl, ml, cl, {
1520
  height: 0,
1521
  width: 1,
1522
  elem_id: 2,
 
1535
  });
1536
  }
1537
  }
1538
+ const hl = [
1539
  { color: "red", primary: 600, secondary: 100 },
1540
  { color: "green", primary: 600, secondary: 100 },
1541
  { color: "blue", primary: 600, secondary: 100 },
 
1839
  950: "#4c0519"
1840
  }
1841
  };
1842
+ hl.reduce(
1843
  (n, { color: t, primary: e, secondary: l }) => ({
1844
  ...n,
1845
  [t]: {
 
1850
  {}
1851
  );
1852
  const {
1853
+ SvelteComponent: wl,
1854
+ assign: vl,
1855
+ attr: kl,
1856
  create_component: ae,
1857
  destroy_component: re,
1858
  detach: Ye,
1859
+ element: yl,
1860
+ get_spread_object: pl,
1861
+ get_spread_update: ql,
1862
+ init: Fl,
1863
  insert: Ge,
1864
  mount_component: _e,
1865
+ safe_not_equal: Ll,
1866
+ space: Cl,
1867
  toggle_class: Oe,
1868
+ transition_in: ce,
1869
+ transition_out: ue
1870
  } = window.__gradio__svelte__internal;
1871
+ function Ml(n) {
1872
  var r;
1873
  let t, e, l, i, s;
1874
  const o = [
1875
  { autoscroll: (
1876
  /*gradio*/
1877
+ n[7].autoscroll
1878
  ) },
1879
  { i18n: (
1880
  /*gradio*/
1881
+ n[7].i18n
1882
  ) },
1883
  /*loading_status*/
1884
+ n[6],
1885
  { variant: "center" }
1886
  ];
1887
  let a = {};
1888
  for (let f = 0; f < o.length; f += 1)
1889
+ a = vl(a, o[f]);
1890
+ return t = new el({ props: a }), i = new mt({
1891
  props: {
1892
  min_height: (
1893
  /*loading_status*/
1894
+ n[6] && /*loading_status*/
1895
+ ((r = n[6]) == null ? void 0 : r.status) !== "complete"
1896
  ),
1897
  value: (
1898
  /*value*/
 
1909
  height: (
1910
  /*height*/
1911
  n[4]
1912
+ ),
1913
+ width: (
1914
+ /*width*/
1915
+ n[5]
1916
  )
1917
  }
1918
  }), i.$on(
1919
  "change",
1920
  /*change_handler*/
1921
+ n[9]
1922
  ), {
1923
  c() {
1924
  var f;
1925
+ ae(t.$$.fragment), e = Cl(), l = yl("div"), ae(i.$$.fragment), kl(l, "class", "svelte-gqsrr7"), Oe(
1926
  l,
1927
  "pending",
1928
  /*loading_status*/
1929
+ ((f = n[6]) == null ? void 0 : f.status) === "pending"
1930
  );
1931
  },
1932
  m(f, _) {
1933
  _e(t, f, _), Ge(f, e, _), Ge(f, l, _), _e(i, l, null), s = !0;
1934
  },
1935
  p(f, _) {
1936
+ var c, v;
1937
  const m = _ & /*gradio, loading_status*/
1938
+ 192 ? ql(o, [
1939
  _ & /*gradio*/
1940
+ 128 && { autoscroll: (
1941
  /*gradio*/
1942
+ f[7].autoscroll
1943
  ) },
1944
  _ & /*gradio*/
1945
+ 128 && { i18n: (
1946
  /*gradio*/
1947
+ f[7].i18n
1948
  ) },
1949
  _ & /*loading_status*/
1950
+ 64 && pl(
1951
  /*loading_status*/
1952
+ f[6]
1953
  ),
1954
  o[3]
1955
  ]) : {};
1956
  t.$set(m);
1957
+ const b = {};
1958
  _ & /*loading_status*/
1959
+ 64 && (b.min_height = /*loading_status*/
1960
+ f[6] && /*loading_status*/
1961
+ ((c = f[6]) == null ? void 0 : c.status) !== "complete"), _ & /*value*/
1962
+ 8 && (b.value = /*value*/
1963
  f[3]), _ & /*elem_classes*/
1964
+ 2 && (b.elem_classes = /*elem_classes*/
1965
  f[1]), _ & /*visible*/
1966
+ 4 && (b.visible = /*visible*/
1967
  f[2]), _ & /*height*/
1968
+ 16 && (b.height = /*height*/
1969
+ f[4]), _ & /*width*/
1970
+ 32 && (b.width = /*width*/
1971
+ f[5]), i.$set(b), (!s || _ & /*loading_status*/
1972
+ 64) && Oe(
1973
  l,
1974
  "pending",
1975
  /*loading_status*/
1976
+ ((v = f[6]) == null ? void 0 : v.status) === "pending"
1977
  );
1978
  },
1979
  i(f) {
1980
+ s || (ce(t.$$.fragment, f), ce(i.$$.fragment, f), s = !0);
1981
  },
1982
  o(f) {
1983
+ ue(t.$$.fragment, f), ue(i.$$.fragment, f), s = !1;
1984
  },
1985
  d(f) {
1986
  f && (Ye(e), Ye(l)), re(t, f), re(i);
1987
  }
1988
  };
1989
  }
1990
+ function Vl(n) {
1991
  let t, e;
1992
+ return t = new gl({
1993
  props: {
1994
  visible: (
1995
  /*visible*/
 
2004
  n[1]
2005
  ),
2006
  container: !1,
2007
+ $$slots: { default: [Ml] },
2008
  $$scope: { ctx: n }
2009
  }
2010
  }), {
 
2022
  1 && (s.elem_id = /*elem_id*/
2023
  l[0]), i & /*elem_classes*/
2024
  2 && (s.elem_classes = /*elem_classes*/
2025
+ l[1]), i & /*$$scope, loading_status, value, elem_classes, visible, height, width, gradio*/
2026
+ 1278 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
2027
  },
2028
  i(l) {
2029
+ e || (ce(t.$$.fragment, l), e = !0);
2030
  },
2031
  o(l) {
2032
+ ue(t.$$.fragment, l), e = !1;
2033
  },
2034
  d(l) {
2035
  re(t, l);
2036
  }
2037
  };
2038
  }
2039
+ function Sl(n, t, e) {
2040
+ let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: s = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { height: r } = t, { width: f = "100%" } = t, { loading_status: _ } = t, { gradio: m } = t;
2041
+ const b = () => m.dispatch("change");
2042
  return n.$$set = (c) => {
2043
+ "label" in c && e(8, l = c.label), "elem_id" in c && e(0, i = c.elem_id), "elem_classes" in c && e(1, s = c.elem_classes), "visible" in c && e(2, o = c.visible), "value" in c && e(3, a = c.value), "height" in c && e(4, r = c.height), "width" in c && e(5, f = c.width), "loading_status" in c && e(6, _ = c.loading_status), "gradio" in c && e(7, m = c.gradio);
2044
  }, n.$$.update = () => {
2045
  n.$$.dirty & /*label, gradio*/
2046
+ 384 && m.dispatch("change");
2047
  }, [
2048
  i,
2049
  s,
 
2052
  r,
2053
  f,
2054
  _,
2055
+ m,
2056
  l,
2057
+ b
2058
  ];
2059
  }
2060
+ class Nl extends wl {
2061
  constructor(t) {
2062
+ super(), Fl(this, t, Sl, Vl, Ll, {
2063
+ label: 8,
2064
  elem_id: 0,
2065
  elem_classes: 1,
2066
  visible: 2,
2067
  value: 3,
2068
  height: 4,
2069
+ width: 5,
2070
+ loading_status: 6,
2071
+ gradio: 7
2072
  });
2073
  }
2074
  }
2075
  export {
2076
+ Nl as default
2077
  };
src/frontend/Index.svelte CHANGED
@@ -10,7 +10,8 @@
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
13
- export let height: string = "100%";
 
14
  export let loading_status: LoadingStatus;
15
  export let gradio: Gradio<{
16
  change: never;
@@ -33,6 +34,7 @@
33
  {elem_classes}
34
  {visible}
35
  {height}
 
36
  on:change={() => gradio.dispatch("change")}
37
  />
38
  </div>
 
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
13
+ export let height: string;
14
+ export let width: string = "100%";
15
  export let loading_status: LoadingStatus;
16
  export let gradio: Gradio<{
17
  change: never;
 
34
  {elem_classes}
35
  {visible}
36
  {height}
37
+ {width}
38
  on:change={() => gradio.dispatch("change")}
39
  />
40
  </div>
src/frontend/shared/HTML.svelte CHANGED
@@ -5,10 +5,25 @@
5
  export let visible = true;
6
  export let min_height = false;
7
 
8
- export let height = "100%";
 
9
 
10
  const dispatch = createEventDispatcher<{ change: undefined }>();
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  $: value, dispatch("change");
13
  </script>
14
 
@@ -16,8 +31,17 @@
16
  class="prose {elem_classes.join(' ')}"
17
  class:min={min_height}
18
  class:hide={!visible}
 
19
  >
20
- <iframe title="iframe component" width="100%" height={height} srcdoc={value} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
 
 
 
 
 
 
 
 
21
  </div>
22
 
23
  <style>
 
5
  export let visible = true;
6
  export let min_height = false;
7
 
8
+ export let height;
9
+ export let width = "100%";
10
 
11
  const dispatch = createEventDispatcher<{ change: undefined }>();
12
 
13
+ let iframeElement;
14
+
15
+ const onLoad = () => {
16
+ try {
17
+ const iframeDocument = iframeElement.contentDocument || iframeElement.contentWindow.document;
18
+ if (height === undefined) {
19
+ const height = iframeDocument.documentElement.scrollHeight;
20
+ iframeElement.style.height = `${height}px`;
21
+ }
22
+ } catch (e) {
23
+ console.error("Error accessing iframe content:", e);
24
+ }
25
+ };
26
+
27
  $: value, dispatch("change");
28
  </script>
29
 
 
31
  class="prose {elem_classes.join(' ')}"
32
  class:min={min_height}
33
  class:hide={!visible}
34
+ class:height={height}
35
  >
36
+ <iframe
37
+ bind:this={iframeElement}
38
+ title="iframe component"
39
+ width={width}
40
+ srcdoc={value}
41
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
42
+ allowfullscreen
43
+ on:load={onLoad}
44
+ ></iframe>
45
  </div>
46
 
47
  <style>
src/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_iframe"
11
- version = "0.0.5"
12
  description = "Experimental empowered iFrame component based on existing HTML gradio component."
13
  readme = "README.md"
14
  license = "MIT"
@@ -36,7 +36,7 @@ classifiers = [
36
  dev = ["build", "twine"]
37
 
38
  [tool.hatch.build]
39
- artifacts = ["/backend/gradio_iframe/templates", "*.pyi", "backend/gradio_iframe/templates", "home/lennard/.virtualenvs/thesis/lib/python3.11/site-packages/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_iframe"]
 
8
 
9
  [project]
10
  name = "gradio_iframe"
11
+ version = "0.0.6"
12
  description = "Experimental empowered iFrame component based on existing HTML gradio component."
13
  readme = "README.md"
14
  license = "MIT"
 
36
  dev = ["build", "twine"]
37
 
38
  [tool.hatch.build]
39
+ artifacts = ["/backend/gradio_iframe/templates", "*.pyi", "backend/gradio_iframe/templates", "home/lennard/.virtualenvs/thesis/lib/python3.11/site-packages/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_iframe"]