PageSourceSearch

https://linoyts-qwen-image-2-1-relight.hf.space/assets/Example-BqGmQLY6.js

js linoyts-qwen-image-2-1-relight.hf.space collected 2026-10-03 17:05:36 UTC 3,944 bytes, 146 lines download raw bytes

1import { p as prop, k as each, d as bind_this, u as index, i as if_block, b as set_class, a as set_attribute } from './i18n-CMo5lpzy.js';
2import { R as push, y as user_effect, t as template_effect, a as append, T as pop, X as sibling, x as set, W as from_html, V as child, u as state, a6 as comment, S as first_child, w as get, a0 as set_text, Y as reset, a7 as text } from './index-BvBk1Iap.js';
3import { b as bind_element_size } from './size-Cu4PabCL.js';
4import { I as Image } from './Image-CDw5qb5O.js';
5import './ScrollFade.svelte_svelte_type_style_lang-Xm-PLg9E.js';
6/* empty css                                                    */
7import { V as Video } from './Video-B3xDM6GN.js';
8import './misc-ByVveAau.js';
9/* empty css                                             */
10import './snippet-Bl5YVoCg.js';
11import './actions-Cit_UA5S.js';
12
13var root_6 = from_html(`<audio controls></audio>`);
14var root = from_html(`<div><p> </p> <!></div>`);
15
16function Example($$anchor, $$props) {
17	push($$props, true);
18
19	let value = prop($$props, 'value', 19, () => ({ text: "", files: [] })),
20		selected = prop($$props, 'selected', 3, false);
21
22	let size = state(0);
23	let el;
24
25	function set_styles(element, el_width) {
26		element.style.setProperty("--local-text-width", `${el_width && el_width < 150 ? el_width : 200}px`);
27		element.style.whiteSpace = "unset";
28	}
29
30	user_effect(() => {
31		if (el && get(size)) {
32			set_styles(el, get(size));
33		}
34	});
35
36	var div = root();
37	let classes;
38	var p = child(div);
39	var text$1 = child(p, true);
40
41	reset(p);
42
43	var node = sibling(p, 2);
44
45	each(node, 17, () => value().files, index, ($$anchor, file) => {
46		var fragment = comment();
47		var node_1 = first_child(fragment);
48
49		{
50			var consequent = ($$anchor) => {
51				Image($$anchor, {
52					get src() {
53						return get(file).url;
54					},
55					alt: ''
56				});
57			};
58
59			var alternate_2 = ($$anchor) => {
60				var fragment_2 = comment();
61				var node_2 = first_child(fragment_2);
62
63				{
64					var consequent_1 = ($$anchor) => {
65						Video($$anchor, {
66							get src() {
67								return get(file).url;
68							},
69							alt: '',
70							loop: true,
71							is_stream: false
72						});
73					};
74
75					var alternate_1 = ($$anchor) => {
76						var fragment_4 = comment();
77						var node_3 = first_child(fragment_4);
78
79						{
80							var consequent_2 = ($$anchor) => {
81								var audio = root_6();
82
83								template_effect(() => set_attribute(audio, 'src', get(file).url));
84								append($$anchor, audio);
85							};
86
87							var alternate = ($$anchor) => {
88								var text_1 = text();
89
90								template_effect(() => set_text(text_1, get(file).orig_name));
91								append($$anchor, text_1);
92							};
93
94							if_block(
95								node_3,
96								($$render) => {
97									if (get(file).mime_type && get(file).mime_type.includes("audio")) $$render(consequent_2); else $$render(alternate, false);
98								},
99								true
100							);
101						}
102
103						append($$anchor, fragment_4);
104					};
105
106					if_block(
107						node_2,
108						($$render) => {
109							if (get(file).mime_type && get(file).mime_type.includes("video")) $$render(consequent_1); else $$render(alternate_1, false);
110						},
111						true
112					);
113				}
114
115				append($$anchor, fragment_2);
116			};
117
118			if_block(node_1, ($$render) => {
119				if (get(file).mime_type && get(file).mime_type.includes("image")) $$render(consequent); else $$render(alternate_2, false);
120			});
121		}
122
123		append($$anchor, fragment);
124	});
125
126	reset(div);
127	bind_this(div, ($$value) => el = $$value, () => el);
128
129	template_effect(() => {
130		classes = set_class(div, 1, 'container svelte-xz0m7l', null, classes, {
131			table: $$props.type === "table",
132			gallery: $$props.type === "gallery",
133			selected: selected(),
134			border: value()
135		});
136
137		set_text(text$1, value().text ? value().text : "");
138	});
139
140	bind_element_size(div, 'clientWidth', ($$value) => set(size, $$value));
141	append($$anchor, div);
142	pop();
143}
144
145export { Example as default };
146//# sourceMappingURL=Example-BqGmQLY6.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.