PageSourceSearch

https://weyaxi-merge-lora.hf.space/assets/Example-abcadb77.js

js weyaxi-merge-lora.hf.space collected 2026-10-03 10:25:26 UTC 2,899 bytes, 116 lines download raw bytes

1/* empty css                                                */
2/* home/runner/work/gradio/gradio/js/textbox/Example.svelte generated by Svelte v4.2.2 */
3const {
4	SvelteComponent,
5	add_iframe_resize_listener,
6	add_render_callback,
7	append,
8	attr,
9	binding_callbacks,
10	detach,
11	element,
12	init,
13	insert,
14	noop,
15	safe_not_equal,
16	set_data,
17	text,
18	toggle_class
19} = window.__gradio__svelte__internal;
20const { onMount } = window.__gradio__svelte__internal;
21function create_fragment(ctx) {
22	let div;
23	let t;
24	let div_resize_listener;
25
26	return {
27		c() {
28			div = element("div");
29			t = text(/*value*/ ctx[0]);
30			attr(div, "class", "svelte-1viwdyg");
31			add_render_callback(() => /*div_elementresize_handler*/ ctx[5].call(div));
32			toggle_class(div, "table", /*type*/ ctx[1] === "table");
33			toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
34			toggle_class(div, "selected", /*selected*/ ctx[2]);
35		},
36		m(target, anchor) {
37			insert(target, div, anchor);
38			append(div, t);
39			div_resize_listener = add_iframe_resize_listener(div, /*div_elementresize_handler*/ ctx[5].bind(div));
40			/*div_binding*/ ctx[6](div);
41		},
42		p(ctx, [dirty]) {
43			if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]);
44
45			if (dirty & /*type*/ 2) {
46				toggle_class(div, "table", /*type*/ ctx[1] === "table");
47			}
48
49			if (dirty & /*type*/ 2) {
50				toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery");
51			}
52
53			if (dirty & /*selected*/ 4) {
54				toggle_class(div, "selected", /*selected*/ ctx[2]);
55			}
56		},
57		i: noop,
58		o: noop,
59		d(detaching) {
60			if (detaching) {
61				detach(div);
62			}
63
64			div_resize_listener();
65			/*div_binding*/ ctx[6](null);
66		}
67	};
68}
69
70function instance($$self, $$props, $$invalidate) {
71	let { value } = $$props;
72	let { type } = $$props;
73	let { selected = false } = $$props;
74	let size;
75	let el;
76
77	function set_styles(element, el_width) {
78		if (!element || !el_width) return;
79		el.style.setProperty("--local-text-width", `${el_width < 150 ? el_width : 200}px`);
80		$$invalidate(4, el.style.whiteSpace = "unset", el);
81	}
82
83	onMount(() => {
84		set_styles(el, size);
85	});
86
87	function div_elementresize_handler() {
88		size = this.clientWidth;
89		$$invalidate(3, size);
90	}
91
92	function div_binding($$value) {
93		binding_callbacks[$$value ? 'unshift' : 'push'](() => {
94			el = $$value;
95			$$invalidate(4, el);
96		});
97	}
98
99	$$self.$$set = $$props => {
100		if ('value' in $$props) $$invalidate(0, value = $$props.value);
101		if ('type' in $$props) $$invalidate(1, type = $$props.type);
102		if ('selected' in $$props) $$invalidate(2, selected = $$props.selected);
103	};
104
105	return [value, type, selected, size, el, div_elementresize_handler, div_binding];
106}
107
108class Example extends SvelteComponent {
109	constructor(options) {
110		super();
111		init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 });
112	}
113}
114
115export { Example as default };
116//# sourceMappingURL=Example-abcadb77.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.