PageSourceSearch

https://ck42-sentiment-model-comparison.hf.space/assets/Example-5a888e08.js

js ck42-sentiment-model-comparison.hf.space collected 2026-10-03 10:19:19 UTC 4,241 bytes, 190 lines download raw bytes

1const Example_svelte_svelte_type_style_lang = '';
2
3/* home/runner/work/gradio/gradio/js/checkboxgroup/Example.svelte generated by Svelte v4.2.2 */
4const {
5	SvelteComponent,
6	attr,
7	destroy_each,
8	detach,
9	element,
10	empty,
11	ensure_array_like,
12	init,
13	insert,
14	noop,
15	safe_not_equal,
16	set_data,
17	text,
18	toggle_class
19} = window.__gradio__svelte__internal;
20function get_each_context(ctx, list, i) {
21	const child_ctx = ctx.slice();
22	child_ctx[3] = list[i];
23	child_ctx[5] = i;
24	return child_ctx;
25}
26
27// (11:50) {#if i !== value.length - 1}
28function create_if_block(ctx) {
29	let t;
30
31	return {
32		c() {
33			t = text(", ");
34		},
35		m(target, anchor) {
36			insert(target, t, anchor);
37		},
38		d(detaching) {
39			if (detaching) {
40				detach(t);
41			}
42		}
43	};
44}
45
46// (11:1) {#each value as check, i}
47function create_each_block(ctx) {
48	let t_value = /*check*/ ctx[3].toLocaleString() + "";
49	let t;
50	let if_block_anchor;
51	let if_block = /*i*/ ctx[5] !== /*value*/ ctx[0].length - 1 && create_if_block();
52
53	return {
54		c() {
55			t = text(t_value);
56			if (if_block) if_block.c();
57			if_block_anchor = empty();
58		},
59		m(target, anchor) {
60			insert(target, t, anchor);
61			if (if_block) if_block.m(target, anchor);
62			insert(target, if_block_anchor, anchor);
63		},
64		p(ctx, dirty) {
65			if (dirty & /*value*/ 1 && t_value !== (t_value = /*check*/ ctx[3].toLocaleString() + "")) set_data(t, t_value);
66
67			if (/*i*/ ctx[5] !== /*value*/ ctx[0].length - 1) {
68				if (if_block) ; else {
69					if_block = create_if_block();
70					if_block.c();
71					if_block.m(if_block_anchor.parentNode, if_block_anchor);
72				}
73			} else if (if_block) {
74				if_block.d(1);
75				if_block = null;
76			}
77		},
78		d(detaching) {
79			if (detaching) {
80				detach(t);
81				detach(if_block_anchor);
82			}
83
84			if (if_block) if_block.d(detaching);
85		}
86	};
87}
88
89function create_fragment(ctx) {
90	let div;
91	let each_value = ensure_array_like(/*value*/ ctx[0]);
92	let each_blocks = [];
93
94	for (let i = 0; i < each_value.length; i += 1) {
95		each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
96	}
97
98	return {
99		c() {
100			div = element("div");
101
102			for (let i = 0; i < each_blocks.length; i += 1) {
103				each_blocks[i].c();
104			}
105
106			attr(div, "class", "svelte-1ayixqk");
107			toggle_class(div, "table", /*type*/ ctx[1] === "table");
108			toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
109			toggle_class(div, "selected", /*selected*/ ctx[2]);
110		},
111		m(target, anchor) {
112			insert(target, div, anchor);
113
114			for (let i = 0; i < each_blocks.length; i += 1) {
115				if (each_blocks[i]) {
116					each_blocks[i].m(div, null);
117				}
118			}
119		},
120		p(ctx, [dirty]) {
121			if (dirty & /*value*/ 1) {
122				each_value = ensure_array_like(/*value*/ ctx[0]);
123				let i;
124
125				for (i = 0; i < each_value.length; i += 1) {
126					const child_ctx = get_each_context(ctx, each_value, i);
127
128					if (each_blocks[i]) {
129						each_blocks[i].p(child_ctx, dirty);
130					} else {
131						each_blocks[i] = create_each_block(child_ctx);
132						each_blocks[i].c();
133						each_blocks[i].m(div, null);
134					}
135				}
136
137				for (; i < each_blocks.length; i += 1) {
138					each_blocks[i].d(1);
139				}
140
141				each_blocks.length = each_value.length;
142			}
143
144			if (dirty & /*type*/ 2) {
145				toggle_class(div, "table", /*type*/ ctx[1] === "table");
146			}
147
148			if (dirty & /*type*/ 2) {
149				toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
150			}
151
152			if (dirty & /*selected*/ 4) {
153				toggle_class(div, "selected", /*selected*/ ctx[2]);
154			}
155		},
156		i: noop,
157		o: noop,
158		d(detaching) {
159			if (detaching) {
160				detach(div);
161			}
162
163			destroy_each(each_blocks, detaching);
164		}
165	};
166}
167
168function instance($$self, $$props, $$invalidate) {
169	let { value } = $$props;
170	let { type } = $$props;
171	let { selected = false } = $$props;
172
173	$$self.$$set = $$props => {
174		if ('value' in $$props) $$invalidate(0, value = $$props.value);
175		if ('type' in $$props) $$invalidate(1, type = $$props.type);
176		if ('selected' in $$props) $$invalidate(2, selected = $$props.selected);
177	};
178
179	return [value, type, selected];
180}
181
182class Example extends SvelteComponent {
183	constructor(options) {
184		super();
185		init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 });
186	}
187}
188
189export { Example as default };
190//# sourceMappingURL=Example-5a888e08.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.