1import { B as BranchManager, p as prop, i as if_block, b as set_class, a as set_attribute, f as set_style } from './i18n-CMo5lpzy.js'; 2import { p as block, E as EFFECT_TRANSPARENT, h as hydrating, e as hydrate_next, t as template_effect, a as append, X as sibling, W as from_html, V as child, aj as delegate, w as get, a5 as user_derived, a0 as set_text, a6 as comment, S as first_child, Y as reset, f as from_svg, R as push, T as pop } from './index-BvBk1Iap.js'; 3import { s as snippet } from './snippet-Bl5YVoCg.js'; 4 5/** @import { TemplateNode, Dom } from '#client' */ 6 7/** 8 * @template P 9 * @template {(props: P) => void} C 10 * @param {TemplateNode} node 11 * @param {() => C} get_component 12 * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn 13 * @returns {void} 14 */ 15function component(node, get_component, render_fn) { 16 if (hydrating) { 17 hydrate_next(); 18 } 19 20 var branches = new BranchManager(node); 21 22 block(() => { 23 var component = get_component() ?? null; 24 branches.ensure(component, component && ((target) => render_fn(target, component))); 25 }, EFFECT_TRANSPARENT); 26} 27 28var root_1$1 = from_html(`<span class="svelte-3jwzs9"> </span>`); 29var root$5 = from_html(`<button><!> <div><!> <!></div></button>`); 30 31function IconButton($$anchor, $$props) { 32 let label = prop($$props, 'label', 3, ""), 33 show_label = prop($$props, 'show_label', 3, false), 34 pending = prop($$props, 'pending', 3, false), 35 size = prop($$props, 'size', 3, "small"), 36 padded = prop($$props, 'padded', 3, true), 37 highlight = prop($$props, 'highlight', 3, false), 38 disabled = prop($$props, 'disabled', 3, false), 39 hasPopup = prop($$props, 'hasPopup', 3, false), 40 color = prop($$props, 'color', 3, "var(--block-label-text-color)"), 41 transparent = prop($$props, 'transparent', 3, false), 42 background = prop($$props, 'background', 3, "var(--block-background-fill)"), 43 border = prop($$props, 'border', 3, "transparent"); 44 45 let _color = user_derived(() => highlight() ? "var(--color-accent)" : color()); 46 var button = root$5(); 47 let classes; 48 49 button.__click = function (...$$args) { 50 $$props.onclick?.apply(this, $$args); 51 }; 52 53 let styles; 54 var node = child(button); 55 56 { 57 var consequent = ($$anchor) => { 58 var span = root_1$1(); 59 var text = child(span, true); 60 61 reset(span); 62 template_effect(() => set_text(text, label())); 63 append($$anchor, span); 64 }; 65 66 if_block(node, ($$render) => { 67 if (show_label()) $$render(consequent); 68 }); 69 } 70 71 var div = sibling(node, 2); 72 let classes_1; 73 var node_1 = child(div); 74 75 component(node_1, () => $$props.Icon, ($$anchor, Icon_1) => { 76 Icon_1($$anchor, {}); 77 }); 78 79 var node_2 = sibling(node_1, 2); 80 81 { 82 var consequent_1 = ($$anchor) => { 83 var fragment = comment(); 84 var node_3 = first_child(fragment); 85 86 snippet(node_3, () => $$props.children); 87 append($$anchor, fragment); 88 }; 89 90 if_block(node_2, ($$render) => { 91 if ($$props.children) $$render(consequent_1); 92 }); 93 } 94 95 reset(div); 96 reset(button); 97 98 template_effect(() => { 99 classes = set_class(button, 1, 'icon-button svelte-3jwzs9', null, classes, { 100 pending: pending(), 101 padded: padded(), 102 highlight: highlight(), 103 transparent: transparent() 104 }); 105 106 button.disabled = disabled(); 107 set_attribute(button, 'aria-label', label()); 108 set_attribute(button, 'aria-haspopup', hasPopup()); 109 set_attribute(button, 'title', label()); 110 111 styles = set_style(button, '', styles, { 112 '--border-color': border(), 113 color: !disabled() && get(_color) ? get(_color) : "var(--block-label-text-color)", 114 '--bg-color': !disabled() ? background() : "auto" 115 }); 116 117 classes_1 = set_class(div, 1, 'svelte-3jwzs9', null, classes_1, { 118 'x-small': size() === "x-small", 119 small: size() === "small", 120 large: size() === "large", 121 medium: size() === "medium" 122 }); 123 }); 124 125 append($$anchor, button); 126} 127 128delegate(['click']); 129 130var root$4 = from_svg(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 256 256"><path fill="currentColor" d="M200 32h-36.26a47.92 47.92 0 0 0-71.48 0H56a16 16 0 0 0-16 16v168a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m-72 0a32 32 0 0 1 32 32H96a32 32 0 0 1 32-32m72 184H56V48h26.75A47.9 47.9 0 0 0 80 64v8a8 8 0 0 0 8 8h80a8 8 0 0 0 8-8v-8a47.9 47.9 0 0 0-2.75-16H200Z"></path></svg>`); 131 132function ImagePaste($$anchor) { 133 var svg = root$4(); 134 135 append($$anchor, svg); 136} 137 138var root$3 = from_svg(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewB
138ox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mic"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>`); 139 140function Microphone($$anchor) { 141 var svg = root$3(); 142 143 append($$anchor, svg); 144} 145 146var root$2 = from_svg(`<svg xmlns="http://www.w3.org/2000/svg" width="90%" height="90%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-upload"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>`); 147 148function Upload($$anchor) { 149 var svg = root$2(); 150 151 append($$anchor, svg); 152} 153 154var root$1 = from_svg(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-video"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>`); 155 156function Video($$anchor) { 157 var svg = root$1(); 158 159 append($$anchor, svg); 160} 161 162var root = from_svg(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"></path><path fill="currentColor" d="M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"></path></svg>`); 163 164function Webcam($$anchor) { 165 var svg = root(); 166 167 append($$anchor, svg); 168} 169 170var root_2 = from_html(`<button aria-label="Upload file"><!></button>`); 171var root_3 = from_html(`<button aria-label="Record audio"><!></button>`); 172var root_4 = from_html(`<button aria-label="Capture from camera"><!></button>`); 173var root_5 = from_html(`<button aria-label="Record video from camera"><!></button>`); 174var root_6 = from_html(`<button aria-label="Paste from clipboard"><!></button>`); 175var root_1 = from_html(`<span class="source-selection svelte-exvkcd" data-testid="source-select"><!> <!> <!> <!> <!></span>`); 176 177function SelectSource($$anchor, $$props) { 178 push($$props, true); 179 180 let active_source = prop($$props, 'active_source', 15), 181 handle_clear = prop($$props, 'handle_clear', 3, () => {}), 182 handle_select = prop($$props, 'handle_select', 3, () => {}); 183 184 let unique_sources = user_derived(() => [...new Set($$props.sources)]); 185 186 async function handle_select_source(source) { 187 handle_clear()(); 188 active_source(source); 189 handle_select()(source); 190 } 191 192 var fragment = comment(); 193 var node = first_child(fragment); 194 195 { 196 var consequent_5 = ($$anchor) => { 197 var span = root_1(); 198 var node_1 = child(span); 199 200 { 201 var consequent = ($$anchor) => { 202 var button = root_2(); 203 let classes; 204 205 button.__click = () => handle_select_source("upload"); 206 207 var node_2 = child(button); 208 209 Upload(node_2); 210 reset(button); 211 template_effect(() => classes = set_class(button, 1, 'icon svelte-exvkcd', null, classes, { selected: active_source() === "upload" || !active_source() })); 212 append($$anchor, button); 213 }; 214 215 if_block(node_1, ($$render) => { 216 if ($$props.sources.includes("upload")) $$render(consequent); 217 }); 218 } 219 220 var node_3 = sibling(node_1, 2); 221 222 { 223 var consequent_1 = ($$anchor) => { 224 var button_1 = root_3(); 225 let classes_1; 226 227 button_1.__click = () => handle_select_source("microphone"); 228 229 var node_4 = child(button_1); 230 231 Microphone(node_4); 232 reset(button_1); 233 template_effect(() => classes_1 = set_class(button_1, 1, 'icon svelte-exvkcd', null, classes_1, { selected: active_source() === "microphone" })); 234 append($$anchor, button_1); 235 }; 236 237 if_block(node_3, ($$render) => { 238 if ($$props.sources.includes("microphone")) $$render(consequent_1); 239 }); 240 } 241 242 var node_5 = sibling(node_3, 2); 243 244 { 245 var consequent_2 = ($$anchor) => { 246 var button_2 = root_4();
247 let classes_2; 248 249 button_2.__click = () => handle_select_source("webcam"); 250 251 var node_6 = child(button_2); 252 253 Webcam(node_6); 254 reset(button_2); 255 template_effect(() => classes_2 = set_class(button_2, 1, 'icon svelte-exvkcd', null, classes_2, { selected: active_source() === "webcam" })); 256 append($$anchor, button_2); 257 }; 258 259 if_block(node_5, ($$render) => { 260 if ($$props.sources.includes("webcam")) $$render(consequent_2); 261 }); 262 } 263 264 var node_7 = sibling(node_5, 2); 265 266 { 267 var consequent_3 = ($$anchor) => { 268 var button_3 = root_5(); 269 let classes_3; 270 271 button_3.__click = () => handle_select_source("webcam-video"); 272 273 var node_8 = child(button_3); 274 275 Video(node_8); 276 reset(button_3); 277 template_effect(() => classes_3 = set_class(button_3, 1, 'icon svelte-exvkcd', null, classes_3, { selected: active_source() === "webcam-video" })); 278 append($$anchor, button_3); 279 }; 280 281 if_block(node_7, ($$render) => { 282 if ($$props.sources.includes("webcam-video")) $$render(consequent_3); 283 }); 284 } 285 286 var node_9 = sibling(node_7, 2); 287 288 { 289 var consequent_4 = ($$anchor) => { 290 var button_4 = root_6(); 291 let classes_4; 292 293 button_4.__click = () => handle_select_source("clipboard"); 294
295 var node_10 = child(button_4); 296 297 ImagePaste(node_10); 298 reset(button_4); 299 template_effect(() => classes_4 = set_class(button_4, 1, 'icon svelte-exvkcd', null, classes_4, { selected: active_source() === "clipboard" })); 300 append($$anchor, button_4); 301 }; 302 303 if_block(node_9, ($$render) => { 304 if ($$props.sources.includes("clipboard")) $$render(consequent_4); 305 }); 306 } 307 308 reset(span); 309 append($$anchor, span); 310 }; 311 312 if_block(node, ($$render) => { 313 if (get(unique_sources).length > 1 || $$props.sources.includes("clipboard")) $$render(consequent_5); 314 }); 315 } 316 317 append($$anchor, fragment); 318 pop(); 319} 320 321delegate(['click']); 322 323export { IconButton as I, Microphone as M, SelectSource as S, Upload as U, Video as V, Webcam as W, ImagePaste as a, component as c }; 324//# sourceMappingURL=ScrollFade.svelte_svelte_type_style_lang-Xm-PLg9E.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.