PageSourceSearch

https://seq23-longcat-video-avatar-1-5-extended.hf.space/assets/IconButtonWrapper-KjCt2Pl8.js

js seq23-longcat-video-avatar-1-5-extended.hf.space collected 2026-10-03 17:22:34 UTC 3,932 bytes, 152 lines download raw bytes

1import { p as prop, e as init, i as if_block, a as set_attribute, b as set_class, k as each, u as index } from './i18n-dpAHICcw.js';
2import { R as push, I as deep_read_state, z as untrack, t as template_effect, Z as event, a as append, T as pop, U as flushSync, V as child, a0 as set_text, W as from_html, Y as reset, X as sibling, a6 as comment, S as first_child, w as get } from './index-CDZuCcOm.js';
3import { s as snippet } from './snippet-DVkMfmSq.js';
4import './ScrollFade.svelte_svelte_type_style_lang-DUvCSfRk.js';
5
6var root_1 = from_html(`<span class="custom-button-label svelte-gnx6f7"> </span>`);
7var root$1 = from_html(`<button class="custom-button svelte-gnx6f7"><!></button>`);
8
9function CustomButton($$anchor, $$props) {
10	push($$props, false);
11
12	let button = prop($$props, 'button', 12);
13	let on_click = prop($$props, 'on_click', 12);
14
15	var $$exports = {
16		get button() {
17			return button();
18		},
19
20		set button($$value) {
21			button($$value);
22			flushSync();
23		},
24
25		get on_click() {
26			return on_click();
27		},
28
29		set on_click($$value) {
30			on_click($$value);
31			flushSync();
32		}
33	};
34
35	init();
36
37	var button_1 = root$1();
38	var node = child(button_1);
39
40	{
41		var consequent = ($$anchor) => {
42			var span = root_1();
43			var text = child(span, true);
44
45			reset(span);
46			template_effect(() => set_text(text, (deep_read_state(button()), untrack(() => button().value))));
47			append($$anchor, span);
48		};
49
50		if_block(node, ($$render) => {
51			if ((deep_read_state(button()), untrack(() => button().value))) $$render(consequent);
52		});
53	}
54
55	reset(button_1);
56
57	template_effect(() => {
58		set_attribute(button_1, 'title', (
59			deep_read_state(button()),
60			untrack(() => button().value || "")
61		));
62
63		set_attribute(button_1, 'aria-label', (
64			deep_read_state(button()),
65			untrack(() => button().value || "Custom action")
66		));
67	});
68
69	event('click', button_1, () => on_click()(button().id));
70	append($$anchor, button_1);
71
72	return pop($$exports);
73}
74
75var root = from_html(`<div><!> <!></div>`);
76
77function IconButtonWrapper($$anchor, $$props) {
78	push($$props, true);
79
80	let top_panel = prop($$props, 'top_panel', 3, true),
81		display_top_corner = prop($$props, 'display_top_corner', 3, false),
82		show_background = prop($$props, 'show_background', 3, true),
83		buttons = prop($$props, 'buttons', 3, null),
84		on_custom_button_click = prop($$props, 'on_custom_button_click', 3, null);
85
86	var div = root();
87	var node = child(div);
88
89	{
90		var consequent = ($$anchor) => {
91			var fragment = comment();
92			var node_1 = first_child(fragment);
93
94			snippet(node_1, () => $$props.children);
95			append($$anchor, fragment);
96		};
97
98		if_block(node, ($$render) => {
99			if ($$props.children) $$render(consequent);
100		});
101	}
102
103	var node_2 = sibling(node, 2);
104
105	{
106		var consequent_2 = ($$anchor) => {
107			var fragment_1 = comment();
108			var node_3 = first_child(fragment_1);
109
110			each(node_3, 17, buttons, index, ($$anchor, btn) => {
111				var fragment_2 = comment();
112				var node_4 = first_child(fragment_2);
113
114				{
115					var consequent_1 = ($$anchor) => {
116						CustomButton($$anchor, {
117							get button() {
118								return get(btn);
119							},
120
121							on_click: (id) => {
122								if (on_custom_button_click()) {
123									on_custom_button_click()(id);
124								}
125							}
126						});
127					};
128
129					if_block(node_4, ($$render) => {
130						if (typeof get(btn) !== "string") $$render(consequent_1);
131					});
132				}
133
134				append($$anchor, fragment_2);
135			});
136
137			append($$anchor, fragment_1);
138		};
139
140		if_block(node_2, ($$render) => {
141			if (buttons()) $$render(consequent_2);
142		});
143	}
144
145	reset(div);
146	template_effect(() => set_class(div, 1, `icon-button-wrapper ${top_panel() ? "top-panel" : ""} ${display_top_corner() ? "display-top-corner" : "hide-top-corner"} ${!show_background() ? "no-background" : ""}`, 'svelte-1pnho82'));
147	append($$anchor, div);
148	pop();
149}
150
151export { CustomButton as C, IconButtonWrapper as I };
152//# sourceMappingURL=IconButtonWrapper-KjCt2Pl8.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.