1import { w as writable, S as Static } from './Index-e541bea9.js'; 2import { F as File } from './File-e96cd7d6.js'; 3import { B as Block } from './Button-d6e4788d.js'; 4import { B as BlockLabel } from './BlockLabel-f63facf2.js'; 5import { d as dequal } from './index-f38d9616.js'; 6import { E as Empty } from './Empty-fb6b0260.js'; 7import './index-0b565b60.js'; 8import './svelte/svelte.js'; 9 10/* home/runner/work/gradio/gradio/js/fileexplorer/shared/ArrowIcon.svelte generated by Svelte v4.2.2 */ 11const { 12 SvelteComponent: SvelteComponent$4, 13 append: append$1, 14 attr: attr$3, 15 detach: detach$4, 16 init: init$4, 17 insert: insert$4, 18 noop: noop$2, 19 safe_not_equal: safe_not_equal$4, 20 set_style, 21 svg_element 22} = window.__gradio__svelte__internal; 23function create_fragment$4(ctx) { 24 let svg; 25 let g; 26 let path; 27 28 return { 29 c() { 30 svg = svg_element("svg"); 31 g = svg_element("g"); 32 path = svg_element("path"); 33 attr$3(path, "d", "M12.7,24.033C12.256,24.322 11.806,24.339 11.351,24.084C10.896,23.829 10.668,23.434 10.667,22.9L10.667,9.1C10.667,8.567 10.895,8.172 11.351,7.916C11.807,7.66 12.256,7.677 12.7,7.967L23.567,14.867C23.967,15.133 24.167,15.511 24.167,16C24.167,16.489 23.967,16.867 23.567,17.133L12.7,24.033Z"); 34 set_style(path, "fill", "currentColor"); 35 set_style(path, "fill-rule", "nonzero"); 36 attr$3(g, "transform", "matrix(1,0,0,1,-10.6667,-7.73588)"); 37 attr$3(svg, "width", "100%"); 38 attr$3(svg, "height", "100%"); 39 attr$3(svg, "viewBox", "0 0 14 17"); 40 attr$3(svg, "version", "1.1"); 41 set_style(svg, "fill-rule", "evenodd"); 42 set_style(svg, "clip-rule", "evenodd"); 43 set_style(svg, "stroke-linejoin", "round"); 44 set_style(svg, "stroke-miterlimit", "2"); 45 }, 46 m(target, anchor) { 47 insert$4(target, svg, anchor); 48 append$1(svg, g); 49 append$1(g, path); 50 }, 51 p: noop$2, 52 i: noop$2, 53 o: noop$2, 54 d(detaching) { 55 if (detaching) { 56 detach$4(svg); 57 } 58 } 59 }; 60} 61 62class ArrowIcon extends SvelteComponent$4 { 63 constructor(options) { 64 super(); 65 init$4(this, options, null, create_fragment$4, safe_not_equal$4, {}); 66 } 67} 68 69const Checkbox_svelte_svelte_type_style_lang = ''; 70 71/* home/runner/work/gradio/gradio/js/fileexplorer/shared/Checkbox.svelte generated by Svelte v4.2.2 */ 72const { 73 SvelteComponent: SvelteComponent$3, 74 attr: attr$2, 75 detach: detach$3, 76 element: element$2, 77 init: init$3, 78 insert: insert$3, 79 listen: listen$1, 80 noop: noop$1, 81 run_all: run_all$1, 82 safe_not_equal: safe_not_equal$3, 83 toggle_class: toggle_class$1 84} = window.__gradio__svelte__internal; 85const { createEventDispatcher: createEventDispatcher$2 } = window.__gradio__svelte__internal; 86function create_fragment$3(ctx) { 87 let input; 88 let mounted; 89 let dispose; 90 91 return { 92 c() { 93 input = element$2("input"); 94 attr$2(input, "type", "checkbox"); 95 input.disabled = /*disabled*/ ctx[1]; 96 attr$2(input, "class", "svelte-8ywr9r"); 97 toggle_class$1(input, "disabled", /*disabled*/ ctx[1] && !/*value*/ ctx[0]); 98 }, 99 m(target, anchor) { 100 insert$3(target, input, anchor); 101 input.checked = /*value*/ ctx[0]; 102 103 if (!mounted) { 104 dispose = [ 105 listen$1(input, "change", /*input_change_handler*/ ctx[3]), 106 listen$1(input, "click", /*click_handler*/ ctx[4]), 107 listen$1(input, "keydown", /*keydown_handler*/ ctx[5]) 108 ]; 109 110 mounted = true; 111 } 112 }, 113 p(ctx, [dirty]) { 114 if (dirty & /*disabled*/ 2) { 115 input.disabled = /*disabled*/ ctx[1]; 116 } 117 118 if (dirty & /*value*/ 1) { 119 input.checked = /*value*/ ctx[0]; 120 } 121 122 if (dirty & /*disabled, value*/ 3) { 123 toggle_class$1(input, "disabled", /*disabled*/ ctx[1] && !/*value*/ ctx[0]); 124 } 125 }, 126 i: noop$1, 127 o: noop$1, 128 d(detaching) { 129 if (detaching) { 130 detach$3(input); 131 } 132 133 mounted = false; 134 run_all$1(dispose); 135 } 136 }; 137} 138 139function instance$3($$self, $$props, $$invalidate) { 140 let { value } = $$props; 141 let { disabled } = $$props; 142 const dispatch = createEventDispatcher$2(); 143 144 function input_change_handler() { 145 value = this.checked; 146 $$invalidate(0, value); 147 } 148 149 const click_handler = () => dispatch("change", value); 150 const keydown_handler = ({ key }) => (key === " " || key === "Enter") && dispatch("change", value); 151 152 $$self.$$set = $$props => {
153 if ('value' in $$props) $$invalidate(0, value = $$props.value); 154 if ('disabled' in $$props) $$invalidate(1, disabled = $$props.disabled); 155 }; 156 157 return [ 158 value, 159 disabled, 160 dispatch, 161 input_change_handler, 162 click_handler, 163 keydown_handler 164 ]; 165} 166 167class Checkbox extends SvelteComponent$3 { 168 constructor(options) { 169 super(); 170 init$3(this, options, instance$3, create_fragment$3, safe_not_equal$3, { value: 0, disabled: 1 }); 171 } 172} 173 174const FileIcon = ""+new URL('light-file-0e72c1e1.svg', import.meta.url).href+""; 175 176const FolderIcon = ""+new URL('light-folder-4e9756c4.svg', import.meta.url).href+""; 177 178const FileTree_svelte_svelte_type_style_lang = ''; 179 180/* home/runner/work/gradio/gradio/js/fileexplorer/shared/FileTree.svelte generated by Svelte v4.2.2 */ 181const { 182 SvelteComponent: SvelteComponent$2, 183 add_flush_callback: add_flush_callback$1, 184 append, 185 attr: attr$1, 186 bind: bind$1, 187 binding_callbacks: binding_callbacks$1, 188 bubble, 189 check_outros: check_outros$1, 190 create_component: create_component$2, 191 destroy_component: destroy_component$2, 192 destroy_each, 193 detach: detach$2, 194 element: element$1, 195 ensure_array_like, 196 group_outros: group_outros$1, 197 init: init$2, 198 insert: insert$2, 199 listen, 200 mount_component: mount_component$2, 201 noop, 202 run_all, 203 safe_not_equal: safe_not_equal$2, 204 set_data, 205 space: space$1, 206 stop_propagation, 207 text, 208 toggle_class, 209 transition_in: transition_in$2, 210 transition_out: transition_out$2 211} = window.__gradio__svelte__internal; 212const { createEventDispatcher: createEventDispatcher$1, tick } = window.__gradio__svelte__internal; 213function get_each_context(ctx, list, i) { 214 const child_ctx = ctx.slice(); 215 child_ctx[12] = list[i].type; 216 child_ctx[13] = list[i].path; 217 child_ctx[14] = list[i].children; 218 child_ctx[15] = list[i].children_visible; 219 child_ctx[16] = list[i].checked; 220 child_ctx[17] = list; 221 child_ctx[18] = i; 222 return child_ctx; 223} 224 225// (50:4) {:else} 226function create_else_block$1(ctx) { 227 let span; 228 229 return { 230 c() { 231 span = element$1("span"); 232 span.innerHTML = `<img src="${FileIcon}" alt="file icon" class="svelte-hyugph"/>`; 233 attr$1(span, "class", "file-icon svelte-hyugph"); 234 }, 235 m(target, anchor) { 236 insert$2(target, span, anchor); 237 }, 238 p: noop, 239 i: noop, 240 o: noop, 241 d(detaching) { 242 if (detaching) { 243 detach$2(span); 244 } 245 } 246 }; 247} 248 249// (46:26) 250function create_if_block_2(ctx) { 251 let span; 252 253 return { 254 c() { 255 span = element$1("span"); 256 span.innerHTML = `<img src="${FolderIcon}" alt="folder icon" class="svelte-hyugph"/>`; 257 attr$1(span, "class", "file-icon svelte-hyugph"); 258 }, 259 m(target, anchor) { 260 insert$2(target, span, anchor); 261 }, 262 p: noop, 263 i: noop, 264 o: noop, 265 d(detaching) { 266 if (detaching) { 267 detach$2(span); 268 } 269 } 270 }; 271} 272 273// (32:4) {#if type === "folder"} 274function create_if_block_1(ctx) { 275 let span; 276 let arrow; 277 let current; 278 let mounted; 279 let dispose; 280 arrow = new ArrowIcon({}); 281 282 function click_handler() { 283 return /*click_handler*/ ctx[8](/*i*/ ctx[18]); 284 } 285 286 function keydown_handler(...args) { 287 return /*keydown_handler*/ ctx[9](/*i*/ ctx[18], ...args); 288 } 289 290 return { 291 c() { 292 span = element$1("span"); 293 create_component$2(arrow.$$.fragment); 294 attr$1(span, "class", "icon svelte-hyugph"); 295 attr$1(span, "role", "button"); 296 attr$1(span, "aria-label", "expand directory"); 297 attr$1(span, "tabindex", "0"); 298 toggle_class(span, "hidden", !/*tree*/ ctx[0][/*i*/ ctx[18]].children_visible); 299 }, 300 m(target, anchor) { 301 insert$2(target, span, anchor); 302 mount_component$2(arrow, span, null); 303 current = true; 304 305 if (!mounted) { 306 dispose = [ 307 listen(span, "click", stop_propagation(click_handler)), 308 listen(span, "keydown", keydown_handler) 309 ]; 310 311 mounted = true; 312 } 313 }, 314 p(new_ctx, dirty) { 315 ctx = new_ctx; 316 317 if (!current || dirty & /*tree*/ 1) { 318 toggle_class(span, "hidden", !/*tree*/ ctx[0][/*i*/ ctx[18]].children_visible); 319 } 320 }, 321 i(local) { 322 if (current) return; 323 transition_in$2(arrow.$$.fragment, local); 324 current = true; 325 }, 326 o(local) { 327 transition_out$2(arrow.$$.fragment, local); 328 current = false; 329 }, 330 d(detaching) { 331 if (detaching) { 332 detach$2(span); 333 } 334 335 destroy_component$2(arrow);
336 mounted = false; 337 run_all(dispose); 338 } 339 }; 340} 341 342// (57:3) {#if children && children_visible} 343function create_if_block$1(ctx) { 344 let filetree; 345 let current; 346 347 filetree = new FileTree({ 348 props: { 349 tree: /*children*/ ctx[14], 350 icons: /*icons*/ ctx[2], 351 node_indices: [.../*node_indices*/ ctx[3], /*i*/ ctx[18]], 352 interactive: /*interactive*/ ctx[1], 353 file_count: /*file_count*/ ctx[4] 354 } 355 }); 356 357 filetree.$on("check", /*check_handler*/ ctx[10]); 358 359 return { 360 c() { 361 create_component$2(filetree.$$.fragment); 362 }, 363 m(target, anchor) { 364 mount_component$2(filetree, target, anchor); 365 current = true; 366 }, 367 p(ctx, dirty) { 368 const filetree_changes = {}; 369 if (dirty & /*tree*/ 1) filetree_changes.tree = /*children*/ ctx[14]; 370 if (dirty & /*icons*/ 4) filetree_changes.icons = /*icons*/ ctx[2]; 371 if (dirty & /*node_indices*/ 8) filetree_changes.node_indices = [.../*node_indices*/ ctx[3], /*i*/ ctx[18]]; 372 if (dirty & /*interactive*/ 2) filetree_changes.interactive = /*interactive*/ ctx[1]; 373 if (dirty & /*file_count*/ 16) filetree_changes.file_count = /*file_count*/ ctx[4]; 374 filetree.$set(filetree_changes); 375 }, 376 i(local) { 377 if (current) return; 378 transition_in$2(filetree.$$.fragment, local); 379 current = true; 380 }, 381 o(local) { 382 transition_out$2(filetree.$$.fragment, local); 383 current = false; 384 }, 385 d(detaching) { 386 destroy_component$2(filetree, detaching); 387 } 388 }; 389} 390 391// (22:1) {#each tree as { type, path, children, children_visible, checked } 392function create_each_block(ctx) { 393 let li; 394 let span; 395 let checkbox; 396 let updating_value; 397 let t0; 398 let current_block_type_index; 399 let if_block0; 400 let t1; 401 let t2_value = (/*path*/ ctx[13] ? /*path*/ ctx[13] : ".") + ""; 402 let t2; 403 let t3; 404 let t4; 405 let current; 406 407 function checkbox_value_binding(value) { 408 /*checkbox_value_binding*/ ctx[6](value, /*checked*/ ctx[16], /*each_value*/ ctx[17], /*i*/ ctx[18]); 409 } 410 411 function change_handler() { 412 return /*change_handler*/ ctx[7](/*i*/ ctx[18]); 413 } 414 415 let checkbox_props = { 416 disabled: !/*interactive*/ ctx[1] || /*type*/ ctx[12] === "folder" && /*file_count*/ ctx[4] === "single" 417 }; 418 419 if (/*checked*/ ctx[16] !== void 0) { 420 checkbox_props.value = /*checked*/ ctx[16]; 421 } 422 423 checkbox = new Checkbox({ props: checkbox_props }); 424 binding_callbacks$1.push(() => bind$1(checkbox, 'value', checkbox_value_binding)); 425 checkbox.$on("change", change_handler); 426 const if_block_creators = [create_if_block_1, create_if_block_2, create_else_block$1]; 427 const if_blocks = []; 428 429 function select_block_type(ctx, dirty) { 430 if (/*type*/ ctx[12] === "folder") return 0; 431 if (/*path*/ ctx[13] === "") return 1; 432 return 2; 433 } 434 435 current_block_type_index = select_block_type(ctx); 436 if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 437 let if_block1 = /*children*/ ctx[14] && /*children_visible*/ ctx[15] && create_if_block$1(ctx); 438 439 return { 440 c() { 441 li = element$1("li"); 442 span = element$1("span"); 443 create_component$2(checkbox.$$.fragment); 444 t0 = space$1(); 445 if_block0.c(); 446 t1 = space$1(); 447 t2 = text(t2_value); 448 t3 = space$1(); 449 if (if_block1) if_block1.c(); 450 t4 = space$1(); 451 attr$1(span, "class", "wrap svelte-hyugph"); 452 attr$1(li, "class", "svelte-hyugph"); 453 }, 454 m(target, anchor) { 455 insert$2(target, li, anchor); 456 append(li, span); 457 mount_component$2(checkbox, span, null); 458 append(span, t0); 459 if_blocks[current_block_type_index].m(span, null); 460 append(span, t1); 461 append(span, t2); 462 append(li, t3); 463 if (if_block1) if_block1.m(li, null); 464 append(li, t4); 465 current = true; 466 }, 467 p(new_ctx, dirty) { 468 ctx = new_ctx; 469 const checkbox_changes = {}; 470 if (dirty & /*interactive, tree, file_count*/ 19) checkbox_changes.disabled = !/*interactive*/ ctx[1] || /*type*/ ctx[12] === "folder" && /*file_count*/ ctx[4] === "single"; 471 472 if (!updating_value && dirty & /*tree*/ 1) { 473 updating_value = true; 474 checkbox_changes.value = /*checked*/ ctx[16]; 475 add_flush_callback$1(() => updating_value = false); 476 } 477 478 checkbox.$set(checkbox_changes); 479 let previous_block_index = current_block_type_index; 480 current_block_type_index = select_block_type(ctx); 481 482 if (current_block_type_index === previous_block_index) { 483 if_blocks[current_block_type_index].p(ctx, dirty); 484 } else { 485 group_outros$1(); 486 487 transition_out$2(if_blocks[previous_block_index], 1, 1, () => { 488 if_blocks[previous_block_index] = null; 489 }); 490 491 check_outros$1(); 492 if_block0 = if_blocks[current_block_type_index]; 493 494 if (!if_block0) { 495 if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 496 if_block0.c(); 497 } else { 498 if_block0.p(ctx, dirty); 499 } 500 501 transition_in$2(if_block0, 1); 502 if_block0.m(span, t1); 503 } 504 505 if ((!current || dirty & /*tree*/ 1) && t2_value !== (t2_value = (/*path*/ ctx[13] ? /*path*/ ctx[13] : ".") + "")) set_data(t2, t2_value); 506 507 if (/*children*/ ctx[14] && /*children_visible*/ ctx[15]) { 508 if (if_block1) { 509 if_block1.p(ctx, dirty); 510
511 if (dirty & /*tree*/ 1) { 512 transition_in$2(if_block1, 1); 513 } 514 } else { 515 if_block1 = create_if_block$1(ctx); 516 if_block1.c(); 517 transition_in$2(if_block1, 1); 518 if_block1.m(li, t4); 519 } 520 } else if (if_block1) { 521 group_outros$1(); 522 523 transition_out$2(if_block1, 1, 1, () => { 524 if_block1 = null; 525 }); 526 527 check_outros$1(); 528 } 529 }, 530 i(local) { 531 if (current) return; 532 transition_in$2(checkbox.$$.fragment, local); 533 transition_in$2(if_block0); 534 transition_in$2(if_block1); 535 current = true; 536 }, 537 o(local) { 538 transition_out$2(checkbox.$$.fragment, local); 539 transition_out$2(if_block0); 540 transition_out$2(if_block1); 541 current = false; 542 }, 543 d(detaching) { 544 if (detaching) { 545 detach$2(li); 546 } 547 548 destroy_component$2(checkbox); 549 if_blocks[current_block_type_index].d(); 550 if (if_block1) if_block1.d(); 551 } 552 }; 553} 554 555function create_fragment$2(ctx) { 556 let ul; 557 let current; 558 let each_value = ensure_array_like(/*tree*/ ctx[0]); 559 let each_blocks = []; 560 561 for (let i = 0; i < each_value.length; i += 1) { 562 each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); 563 } 564 565 const out = i => transition_out$2(each_blocks[i], 1, 1, () => { 566 each_blocks[i] = null; 567 }); 568 569 return { 570 c() { 571 ul = element$1("ul"); 572 573 for (let i = 0; i < each_blocks.length; i += 1) { 574 each_blocks[i].c(); 575 } 576 577 attr$1(ul, "class", "svelte-hyugph"); 578 }, 579 m(target, anchor) { 580 insert$2(target, ul, anchor); 581 582 for (let i = 0; i < each_blocks.length; i += 1) { 583 if (each_blocks[i]) { 584 each_blocks[i].m(ul, null); 585 } 586 } 587 588 current = true; 589 }, 590 p(ctx, [dirty]) { 591 if (dirty & /*tree, icons, node_indices, interactive, file_count, dispatch_change*/ 63) { 592 each_value = ensure_array_like(/*tree*/ ctx[0]); 593 let i; 594 595 for (i = 0; i < each_value.length; i += 1) { 596 const child_ctx = get_each_context(ctx, each_value, i); 597 598 if (each_blocks[i]) { 599 each_blocks[i].p(child_ctx, dirty); 600 transition_in$2(each_blocks[i], 1); 601 } else { 602 each_blocks[i] = create_each_block(child_ctx); 603 each_blocks[i].c(); 604 transition_in$2(each_blocks[i], 1); 605 each_blocks[i].m(ul, null); 606 } 607 } 608 609 group_outros$1(); 610 611 for (i = each_value.length; i < each_blocks.length; i += 1) { 612 out(i); 613 } 614 615 check_outros$1(); 616 } 617 }, 618 i(local) { 619 if (current) return; 620 621 for (let i = 0; i < each_value.length; i += 1) { 622 transition_in$2(each_blocks[i]); 623 } 624 625 current = true; 626 }, 627 o(local) {
628 each_blocks = each_blocks.filter(Boolean); 629 630 for (let i = 0; i < each_blocks.length; i += 1) { 631 transition_out$2(each_blocks[i]); 632 } 633 634 current = false; 635 }, 636 d(detaching) { 637 if (detaching) { 638 detach$2(ul); 639 } 640 641 destroy_each(each_blocks, detaching); 642 } 643 }; 644} 645 646function instance$2($$self, $$props, $$invalidate) { 647 let { interactive } = $$props; 648 let { tree = [] } = $$props; 649 let { icons = {} } = $$props; 650 let { node_indices = [] } = $$props; 651 let { file_count = "multiple" } = $$props; 652 const dispatch = createEventDispatcher$1(); 653 654 async function dispatch_change(i) { 655 await tick(); 656 657 dispatch("check", { 658 node_indices: [...node_indices, i], 659 checked: !tree[i].checked 660 }); 661 } 662 663 function checkbox_value_binding(value, checked, each_value, i) { 664 each_value[i].checked = value; 665 $$invalidate(0, tree); 666 } 667 668 const change_handler = i => dispatch_change(i); 669 const click_handler = i => $$invalidate(0, tree[i].children_visible = !tree[i].children_visible, tree); 670 const keydown_handler = (i, { key }) => (key === " " || key === "Enter") && $$invalidate(0, tree[i].children_visible = !tree[i].children_visible, tree); 671 672 function check_handler(event) { 673 bubble.call(this, $$self, event); 674 } 675 676 $$self.$$set = $$props => {
677 if ('interactive' in $$props) $$invalidate(1, interactive = $$props.interactive); 678 if ('tree' in $$props) $$invalidate(0, tree = $$props.tree); 679 if ('icons' in $$props) $$invalidate(2, icons = $$props.icons); 680 if ('node_indices' in $$props) $$invalidate(3, node_indices = $$props.node_indices); 681 if ('file_count' in $$props) $$invalidate(4, file_count = $$props.file_count); 682 }; 683 684 return [ 685 tree, 686 interactive, 687 icons, 688 node_indices, 689 file_count, 690 dispatch_change, 691 checkbox_value_binding, 692 change_handler, 693 click_handler, 694 keydown_handler, 695 check_handler 696 ]; 697} 698 699class FileTree extends SvelteComponent$2 { 700 constructor(options) { 701 super(); 702 703 init$2(this, options, instance$2, create_fragment$2, safe_not_equal$2, { 704 interactive: 1, 705 tree: 0, 706 icons: 2, 707 node_indices: 3, 708 file_count: 4 709 }); 710 } 711} 712 713const make_fs_store = () => { 714 const { subscribe, set } = writable(null); 715 let root = { 716 type: "folder", 717 path: "", 718 checked: false, 719 children_visible: false, 720 parent: null 721 }; 722 let tree_updated = false; 723 function create_fs_graph(serialised_node) { 724 root.children = process_tree(serialised_node); 725 tree_updated = true; 726 set(root.children); 727 } 728 let old_checked_paths = []; 729 function set_checked_from_paths(checked_paths) { 730 if (dequal(checked_paths, old_checked_paths) && !tree_updated) { 731 return checked_paths; 732 } 733 old_checked_paths = checked_paths; 734 check_node_and_children(root.children, false, []); 735 const new_checked_paths = []; 736 const seen_nodes = /* @__PURE__ */ new Set(); 737 for (let i = 0; i < checked_paths.length; i++) { 738 let _node = root; 739 let _path = []; 740 for (let j = 0; j < checked_paths[i].length; j++) { 741 if (!_node?.children) { 742 continue; 743 } 744 _path.push(checked_paths[i][j]); 745 _node = _node.children.find((v) => v.path === checked_paths[i][j]); 746 } 747 if (!_node) { 748 continue; 749 } 750 _node.checked = true; 751 ensure_visible(_node); 752 const nodes = check_node_and_children(_node.children, true, [_node]); 753 check_parent(_node); 754 nodes.forEach((node) => { 755 const path = get_full_path(node); 756 const normalized_path = path.join("/"); 757 if (node.type === "file") { 758 if (seen_nodes.has(normalized_path)) { 759 return; 760 } 761 new_checked_paths.push(path); 762 seen_nodes.add(normalized_path); 763 } 764 }); 765 } 766 set(root.children); 767 tree_updated = false; 768 return new_checked_paths; 769 } 770 function set_checked(indices, checked, checked_paths, file_count) { 771 let _node = root; 772 if (file_count === "single") { 773 check_node_and_children(root.children, false, []); 774 set(root.children); 775 } 776 for (let i = 0; i < indices.length; i++) { 777 _node = _node.children[indices[i]]; 778 } 779 _node.checked = checked; 780 const nodes = check_node_and_children(_node.children, checked, [_node]); 781 let new_checked_paths = new Map(checked_paths.map((v) => [v.join("/"), v])); 782 for (let i = 0; i < nodes.length; i++) { 783 const _path = get_full_path(nodes[i]); 784 if (!nodes[i].checked) { 785 new_checked_paths.delete(_path.join("/")); 786 } else if (nodes[i].checked) { 787 if (file_count === "single") { 788 new_checked_paths = /* @__PURE__ */ new Map(); 789 } 790 new_checked_paths.set(_path.join("/"), _path); 791 } 792 } 793 check_parent(_node); 794 set(root.children); 795 old_checked_paths = Array.from(new_checked_paths).map((v) => v[1]); 796 return old_checked_paths; 797 } 798 return { 799 subscribe, 800 create_fs_graph, 801 set_checked, 802 set_checked_from_paths 803 }; 804}; 805function ensure_visible(node) { 806 if (node.parent) { 807 node.parent.children_visible = true; 808 ensure_visible(node.parent); 809 } 810} 811function process_tree(node, depth = 0, path_segments = [], parent = null) { 812 const folders = []; 813 const files = []; 814 for (let i = 0; i < node.length; i++) { 815 let n = node[i]; 816 if (n.type === "file") { 817 let index = files.findIndex( 818 (v) => v.path.toLocaleLowerCase() >= n.path.toLocaleLowerCase() 819 ); 820 const _node = { 821 children: void 0, 822 type: "file", 823 path: n.path,
824 checked: false, 825 children_visible: false, 826 parent 827 }; 828 files.splice(index === -1 ? files.length : index, 0, _node); 829 } else { 830 let index = folders.findIndex( 831 (v) => v.path.toLocaleLowerCase() >= n.path.toLocaleLowerCase() 832 ); 833 const _node = { 834 type: "folder", 835 path: n.path, 836 checked: false, 837 children_visible: false, 838 parent 839 }; 840 const children = process_tree( 841 n.children, 842 depth + 1, 843 [...path_segments, n.path], 844 _node 845 ); 846 _node.children = children; 847 folders.splice(index === -1 ? folders.length : index, 0, _node); 848 } 849 } 850 const last = files[files.length - 1] || folders[folders.length - 1]; 851 for (let i = 0; i < folders.length; i++) { 852 folders[i].last = last; 853 folders[i].previous = folders[i - 1] || null; 854 } 855 for (let i = 0; i < files.length; i++) { 856 if (i === 0) { 857 files[i].previous = folders[folders.length - 1] || null; 858 } else { 859 files[i].previous = files[i - 1] || null; 860 } 861 files[i].last = last; 862 } 863 return Array().concat(folders, files); 864} 865function get_full_path(node, path = []) { 866 const new_path = [node.path, ...path]; 867 if (node.parent) { 868 return get_full_path(node.parent, new_path); 869 } 870 return new_path; 871} 872function check_node_and_children(node, checked, checked_nodes) { 873 if (node === null || node === void 0) 874 return checked_nodes; 875 for (let i = 0; i < node.length; i++) { 876 node[i].checked = checked; 877 checked_nodes.push(node[i]); 878 if (checked) 879 ensure_visible(node[i]); 880 checked_nodes.concat( 881 check_node_and_children(node[i].children, checked, checked_nodes) 882 ); 883 } 884 return checked_nodes; 885} 886function check_parent(node) { 887 if (node === null || node === void 0 || !node.parent) 888 return; 889 let _node = node.last; 890 let nodes_checked = []; 891 while (_node) { 892 nodes_checked.push(_node.checked); 893 _node = _node.previous; 894 } 895 if (nodes_checked.every((v) => v === true)) { 896 node.parent.checked = true; 897 check_parent(node?.parent); 898 } else if (nodes_checked.some((v) => v === false)) { 899 node.parent.checked = false; 900 check_parent(node?.parent); 901 } 902} 903 904const DirectoryExplorer_svelte_svelte_type_style_lang = ''; 905 906/* home/runner/work/gradio/gradio/js/fileexplorer/shared/DirectoryExplorer.svelte generated by Svelte v4.2.2 */ 907const { 908 SvelteComponent: SvelteComponent$1, 909 attr, 910 check_outros, 911 component_subscribe, 912 create_component: create_component$1, 913 destroy_component: destroy_component$1, 914 detach: detach$1, 915 element, 916 empty, 917 group_outros, 918 init: init$1, 919 insert: insert$1, 920 mount_component: mount_component$1, 921 safe_not_equal: safe_not_equal$1, 922 transition_in: transition_in$1, 923 transition_out: transition_out$1 924} = window.__gradio__svelte__internal; 925const { createEventDispatcher } = window.__gradio__svelte__internal; 926function create_else_block(ctx) { 927 let empty_1; 928 let current; 929 930 empty_1 = new Empty({ 931 props: { 932 size: "large", 933 $$slots: { default: [create_default_slot$1] }, 934 $$scope: { ctx } 935 } 936 }); 937 938 return { 939 c() { 940 create_component$1(empty_1.$$.fragment); 941 }, 942 m(target, anchor) { 943 mount_component$1(empty_1, target, anchor); 944 current = true; 945 }, 946 p(ctx, dirty) { 947 const empty_1_changes = {}; 948 949 if (dirty & /*$$scope*/ 16384) { 950 empty_1_changes.$$scope = { dirty, ctx }; 951 } 952 953 empty_1.$set(empty_1_changes); 954 }, 955 i(local) { 956 if (current) return; 957 transition_in$1(empty_1.$$.fragment, local); 958 current = true; 959 }, 960 o(local) { 961 transition_out$1(empty_1.$$.fragment, local); 962 current = false; 963 }, 964 d(detaching) { 965 destroy_component$1(empty_1, detaching); 966 } 967 }; 968} 969 970// (41:0) {#if $tree && $tree.length} 971function create_if_block(ctx) { 972 let div; 973 let filetree; 974 let current; 975 976 filetree = new FileTree({ 977 props: { 978 tree: /*$tree*/ ctx[2], 979 interactive: /*interactive*/ ctx[0], 980 file_count: /*file_count*/ ctx[1] 981 } 982 }); 983 984 filetree.$on("check", /*check_handler*/ ctx[10]); 985 986 return { 987 c() { 988 div = element("div"); 989 create_component$1(filetree.$$.fragment); 990 attr(div, "class", "file-wrap svelte-dicskc"); 991 }, 992 m(target, anchor) { 993 insert$1(target, div, anchor);
994 mount_component$1(filetree, div, null); 995 current = true; 996 }, 997 p(ctx, dirty) { 998 const filetree_changes = {}; 999 if (dirty & /*$tree*/ 4) filetree_changes.tree = /*$tree*/ ctx[2]; 1000 if (dirty & /*interactive*/ 1) filetree_changes.interactive = /*interactive*/ ctx[0]; 1001 if (dirty & /*file_count*/ 2) filetree_changes.file_count = /*file_count*/ ctx[1]; 1002 filetree.$set(filetree_changes); 1003 }, 1004 i(local) { 1005 if (current) return; 1006 transition_in$1(filetree.$$.fragment, local); 1007 current = true; 1008 }, 1009 o(local) { 1010 transition_out$1(filetree.$$.fragment, local); 1011 current = false; 1012 }, 1013 d(detaching) { 1014 if (detaching) { 1015 detach$1(div); 1016 } 1017 1018 destroy_component$1(filetree); 1019 } 1020 }; 1021} 1022 1023// (51:1) <Empty size="large"> 1024function create_default_slot$1(ctx) { 1025 let file; 1026 let current; 1027 file = new File({}); 1028 1029 return { 1030 c() { 1031 create_component$1(file.$$.fragment); 1032 }, 1033 m(target, anchor) { 1034 mount_component$1(file, target, anchor); 1035 current = true; 1036 }, 1037 i(local) { 1038 if (current) return; 1039 transition_in$1(file.$$.fragment, local); 1040 current = true; 1041 }, 1042 o(local) { 1043 transition_out$1(file.$$.fragment, local); 1044 current = false; 1045 }, 1046 d(detaching) { 1047 destroy_component$1(file, detaching); 1048 } 1049 }; 1050} 1051 1052function create_fragment$1(ctx) { 1053 let current_block_type_index; 1054 let if_block; 1055 let if_block_anchor; 1056 let current; 1057 const if_block_creators = [create_if_block, create_else_block]; 1058 const if_blocks = []; 1059 1060 function select_block_type(ctx, dirty) { 1061 if (/*$tree*/ ctx[2] && /*$tree*/ ctx[2].length) return 0; 1062 return 1; 1063 } 1064 1065 current_block_type_index = select_block_type(ctx); 1066 if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 1067 1068 return { 1069 c() { 1070 if_block.c(); 1071 if_block_anchor = empty(); 1072 }, 1073 m(target, anchor) { 1074 if_blocks[current_block_type_index].m(target, anchor); 1075 insert$1(target, if_block_anchor, anchor); 1076 current = true; 1077 }, 1078 p(ctx, [dirty]) { 1079 let previous_block_index = current_block_type_index; 1080 current_block_type_index = select_block_type(ctx); 1081 1082 if (current_block_type_index === previous_block_index) { 1083 if_blocks[current_block_type_index].p(ctx, dirty); 1084 } else { 1085 group_outros(); 1086 1087 transition_out$1(if_blocks[previous_block_index], 1, 1, () => { 1088 if_blocks[previous_block_index] = null; 1089 }); 1090 1091 check_outros(); 1092 if_block = if_blocks[current_block_type_index]; 1093 1094 if (!if_block) { 1095 if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 1096 if_block.c(); 1097 } else { 1098 if_block.p(ctx, dirty); 1099 } 1100 1101 transition_in$1(if_block, 1); 1102 if_block.m(if_block_anchor.parentNode, if_block_anchor); 1103 } 1104 }, 1105 i(local) { 1106 if (current) return; 1107 transition_in$1(if_block); 1108 current = true; 1109 }, 1110 o(local) { 1111 transition_out$1(if_block); 1112 current = false; 1113 }, 1114 d(detaching) { 1115 if (detaching) { 1116 detach$1(if_block_anchor); 1117 } 1118 1119 if_blocks[current_block_type_index].d(detaching); 1120 } 1121 }; 1122} 1123 1124function instance$1($$self, $$props, $$invalidate) { 1125 let $tree; 1126 let { glob } = $$props; 1127 let { ignore_glob } = $$props; 1128 let { root } = $$props; 1129 let { interactive } = $$props; 1130 let { server } = $$props; 1131 let { file_count = "multiple" } = $$props; 1132 let { value = [] } = $$props; 1133 const dispatch = createEventDispatcher(); 1134 const tree = make_fs_store(); 1135 component_subscribe($$self, tree, value => $$invalidate(2, $tree = value)); 1136 1137 function set_checked_from_paths() { 1138 $$invalidate(5, value = file_count === "single" ? [value[0] || []] : value); 1139 $$invalidate(5, value = tree.set_checked_from_paths(value)); 1140 1141 if (!dequal(value, old_value)) { 1142 old_value = value; 1143 dispatch("change", value); 1144 } 1145 } 1146 1147 let old_value = []; 1148 1149 function handle_select({ node_indices, checked }) { 1150 $$invalidate(5, value = tree.set_checked(node_indices, checked, value, file_count)); 1151 1152 if (!dequal(value, old_value)) { 1153 old_value = value; 1154 dispatch("change", value); 1155 } 1156 } 1157 1158 const check_handler = ({ detail }) => handle_select(detail); 1159 1160 $$self.$$set = $$props => {
1161 if ('glob' in $$props) $$invalidate(6, glob = $$props.glob); 1162 if ('ignore_glob' in $$props) $$invalidate(7, ignore_glob = $$props.ignore_glob); 1163 if ('root' in $$props) $$invalidate(8, root = $$props.root); 1164 if ('interactive' in $$props) $$invalidate(0, interactive = $$props.interactive); 1165 if ('server' in $$props) $$invalidate(9, server = $$props.server); 1166 if ('file_count' in $$props) $$invalidate(1, file_count = $$props.file_count); 1167 if ('value' in $$props) $$invalidate(5, value = $$props.value); 1168 }; 1169 1170 $$self.$$.update = () => { 1171 if ($$self.$$.dirty & /*glob, ignore_glob, root, server*/ 960) { 1172 (server.ls().then(v => { 1173 tree.create_fs_graph(v); 1174 })); 1175 } 1176 1177 if ($$self.$$.dirty & /*value, $tree*/ 36) { 1178 value.length && $tree && set_checked_from_paths(); 1179 } 1180 }; 1181 1182 return [ 1183 interactive, 1184 file_count, 1185 $tree, 1186 tree, 1187 handle_select, 1188 value, 1189 glob, 1190 ignore_glob, 1191 root, 1192 server, 1193 check_handler 1194 ]; 1195} 1196 1197class DirectoryExplorer extends SvelteComponent$1 { 1198 constructor(options) { 1199 super(); 1200 1201 init$1(this, options, instance$1, create_fragment$1, safe_not_equal$1, { 1202 glob: 6, 1203 ignore_glob: 7, 1204 root: 8, 1205 interactive: 0, 1206 server: 9, 1207 file_count: 1, 1208 value: 5 1209 }); 1210 } 1211} 1212 1213/* home/runner/work/gradio/gradio/js/fileexplorer/Index.svelte generated by Svelte v4.2.2 */ 1214const { 1215 SvelteComponent, 1216 add_flush_callback, 1217 assign, 1218 bind, 1219 binding_callbacks, 1220 create_component, 1221 destroy_component, 1222 detach, 1223 flush, 1224 get_spread_object, 1225 get_spread_update, 1226 init, 1227 insert, 1228 mount_component, 1229 safe_not_equal, 1230 space, 1231 transition_in, 1232 transition_out 1233} = window.__gradio__svelte__internal; 1234function create_default_slot(ctx) { 1235 let statustracker; 1236 let t0; 1237 let blocklabel; 1238 let t1; 1239 let directoryexplorer; 1240 let updating_value; 1241 let current; 1242 1243 const statustracker_spread_levels = [ 1244 /*loading_status*/ ctx[11], 1245 { 1246 autoscroll: /*gradio*/ ctx[15].autoscroll 1247 }, 1248 { i18n: /*gradio*/ ctx[15].i18n } 1249 ]; 1250 1251 let statustracker_props = {}; 1252 1253 for (let i = 0; i < statustracker_spread_levels.length; i += 1) { 1254 statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]); 1255 } 1256 1257 statustracker = new Static({ props: statustracker_props }); 1258 1259 blocklabel = new BlockLabel({ 1260 props: { 1261 show_label: /*show_label*/ ctx[5], 1262 Icon: File, 1263 label: /*label*/ ctx[4] || "FileExplorer", 1264 float: false 1265 } 1266 }); 1267 1268 function directoryexplorer_value_binding(value) { 1269 /*directoryexplorer_value_binding*/ ctx[18](value); 1270 } 1271 1272 let directoryexplorer_props = { 1273 file_count: /*file_count*/ ctx[7], 1274 server: /*server*/ ctx[16], 1275 interactive: /*interactive*/ ctx[17], 1276 root: /*root*/ ctx[10], 1277 glob: /*glob*/ ctx[8], 1278 ignore_glob: /*ignore_glob*/ ctx[9] 1279 }; 1280 1281 if (/*value*/ ctx[0] !== void 0) { 1282 directoryexplorer_props.value = /*value*/ ctx[0]; 1283 } 1284 1285 directoryexplorer = new DirectoryExplorer({ props: directoryexplorer_props }); 1286 binding_callbacks.push(() => bind(directoryexplorer, 'value', directoryexplorer_value_binding)); 1287 directoryexplorer.$on("change", /*change_handler*/ ctx[19]); 1288 1289 return { 1290 c() { 1291 create_component(statustracker.$$.fragment); 1292 t0 = space(); 1293 create_component(blocklabel.$$.fragment); 1294 t1 = space(); 1295 create_component(directoryexplorer.$$.fragment); 1296 }, 1297 m(target, anchor) { 1298 mount_component(statustracker, target, anchor); 1299 insert(target, t0, anchor); 1300 mount_component(blocklabel, target, anchor); 1301 insert(target, t1, anchor); 1302 mount_component(directoryexplorer, target, anchor); 1303 current = true; 1304 }, 1305 p(ctx, dirty) { 1306 const statustracker_changes = (dirty & /*loading_status, gradio*/ 34816) 1307 ? get_spread_update(statustracker_spread_levels, [ 1308 dirty & /*loading_status*/ 2048 && get_spread_object(/*loading_status*/ ctx[11]), 1309 dirty & /*gradio*/ 32768 && { 1310 autoscroll: /*gradio*/ ctx[15].autoscroll 1311 }, 1312 dirty & /*gradio*/ 32768 && { i18n: /*gradio*/ ctx[15].i18n } 1313 ]) 1314 : {}; 1315 1316 statustracker.$set(statustracker_changes); 1317 const blocklabel_changes = {}; 1318 if (dirty & /*show_label*/ 32) blocklabel_changes.show_label = /*show_label*/ ctx[5]; 1319 if (dirty & /*label*/ 16) blocklabel_changes.label = /*label*/ ctx[4] || "FileExplorer"; 1320 blocklabel.$set(blocklabel_changes); 1321 const directoryexplorer_changes = {};
1322 if (dirty & /*file_count*/ 128) directoryexplorer_changes.file_count = /*file_count*/ ctx[7]; 1323 if (dirty & /*server*/ 65536) directoryexplorer_changes.server = /*server*/ ctx[16]; 1324 if (dirty & /*interactive*/ 131072) directoryexplorer_changes.interactive = /*interactive*/ ctx[17]; 1325 if (dirty & /*root*/ 1024) directoryexplorer_changes.root = /*root*/ ctx[10]; 1326 if (dirty & /*glob*/ 256) directoryexplorer_changes.glob = /*glob*/ ctx[8]; 1327 if (dirty & /*ignore_glob*/ 512) directoryexplorer_changes.ignore_glob = /*ignore_glob*/ ctx[9]; 1328 1329 if (!updating_value && dirty & /*value*/ 1) { 1330 updating_value = true; 1331 directoryexplorer_changes.value = /*value*/ ctx[0]; 1332 add_flush_callback(() => updating_value = false); 1333 } 1334 1335 directoryexplorer.$set(directoryexplorer_changes); 1336 }, 1337 i(local) { 1338 if (current) return; 1339 transition_in(statustracker.$$.fragment, local); 1340 transition_in(blocklabel.$$.fragment, local); 1341 transition_in(directoryexplorer.$$.fragment, local); 1342 current = true; 1343 }, 1344 o(local) { 1345 transition_out(statustracker.$$.fragment, local); 1346 transition_out(blocklabel.$$.fragment, local); 1347 transition_out(directoryexplorer.$$.fragment, local); 1348 current = false; 1349 }, 1350 d(detaching) { 1351 if (detaching) { 1352 detach(t0); 1353 detach(t1); 1354 } 1355 1356 destroy_component(statustracker, detaching); 1357 destroy_component(blocklabel, detaching); 1358 destroy_component(directoryexplorer, detaching); 1359 } 1360 }; 1361} 1362 1363function create_fragment(ctx) { 1364 let block; 1365 let current; 1366 1367 block = new Block({ 1368 props: { 1369 visible: /*visible*/ ctx[3], 1370 variant: /*value*/ ctx[0] === null ? "dashed" : "solid", 1371 border_mode: "base", 1372 padding: false, 1373 elem_id: /*elem_id*/ ctx[1], 1374 elem_classes: /*elem_classes*/ ctx[2], 1375 container: /*container*/ ctx[12], 1376 scale: /*scale*/ ctx[13], 1377 min_width: /*min_width*/ ctx[14], 1378 allow_overflow: false, 1379 height: /*height*/ ctx[6], 1380 $$slots: { default: [create_default_slot] }, 1381 $$scope: { ctx } 1382 } 1383 }); 1384 1385 return { 1386 c() { 1387 create_component(block.$$.fragment); 1388 }, 1389 m(target, anchor) { 1390 mount_component(block, target, anchor); 1391 current = true; 1392 }, 1393 p(ctx, [dirty]) { 1394 const block_changes = {}; 1395 if (dirty & /*visible*/ 8) block_changes.visible = /*visible*/ ctx[3]; 1396 if (dirty & /*value*/ 1) block_changes.variant = /*value*/ ctx[0] === null ? "dashed" : "solid"; 1397 if (dirty & /*elem_id*/ 2) block_changes.elem_id = /*elem_id*/ ctx[1]; 1398 if (dirty & /*elem_classes*/ 4) block_changes.elem_classes = /*elem_classes*/ ctx[2]; 1399 if (dirty & /*container*/ 4096) block_changes.container = /*container*/ ctx[12]; 1400 if (dirty & /*scale*/ 8192) block_changes.scale = /*scale*/ ctx[13]; 1401 if (dirty & /*min_width*/ 16384) block_changes.min_width = /*min_width*/ ctx[14]; 1402 if (dirty & /*height*/ 64) block_changes.height = /*height*/ ctx[6]; 1403 1404 if (dirty & /*$$scope, file_count, server, interactive, root, glob, ignore_glob, value, gradio, show_label, label, loading_status*/ 1281969) { 1405 block_changes.$$scope = { dirty, ctx }; 1406 } 1407 1408 block.$set(block_changes); 1409 }, 1410 i(local) { 1411 if (current) return; 1412 transition_in(block.$$.fragment, local); 1413 current = true; 1414 }, 1415 o(local) { 1416 transition_out(block.$$.fragment, local); 1417 current = false; 1418 }, 1419 d(detaching) { 1420 destroy_component(block, detaching); 1421 } 1422 }; 1423} 1424 1425function instance($$self, $$props, $$invalidate) { 1426 let { elem_id = "" } = $$props; 1427 let { elem_classes = [] } = $$props; 1428 let { visible = true } = $$props; 1429 let { value } = $$props; 1430 let { label } = $$props; 1431 let { show_label } = $$props; 1432 let { height = undefined } = $$props; 1433 let { file_count = "multiple" } = $$props; 1434 let { glob } = $$props; 1435 let { ignore_glob } = $$props; 1436 let { root } = $$props; 1437 let { loading_status } = $$props; 1438 let { container = true } = $$props; 1439 let { scale = null } = $$props; 1440 let { min_width = undefined } = $$props; 1441 let { gradio } = $$props; 1442 let { server } = $$props; 1443 let { interactive } = $$props; 1444 1445 function directoryexplorer_value_binding(value$1) { 1446 value = value$1; 1447 $$invalidate(0, value); 1448 } 1449 1450 const change_handler = () => gradio.dispatch("change"); 1451 1452 $$self.$$set = $$props => {
1453 if ('elem_id' in $$props) $$invalidate(1, elem_id = $$props.elem_id); 1454 if ('elem_classes' in $$props) $$invalidate(2, elem_classes = $$props.elem_classes); 1455 if ('visible' in $$props) $$invalidate(3, visible = $$props.visible); 1456 if ('value' in $$props) $$invalidate(0, value = $$props.value); 1457 if ('label' in $$props) $$invalidate(4, label = $$props.label); 1458 if ('show_label' in $$props) $$invalidate(5, show_label = $$props.show_label); 1459 if ('height' in $$props) $$invalidate(6, height = $$props.height); 1460 if ('file_count' in $$props) $$invalidate(7, file_count = $$props.file_count); 1461 if ('glob' in $$props) $$invalidate(8, glob = $$props.glob); 1462 if ('ignore_glob' in $$props) $$invalidate(9, ignore_glob = $$props.ignore_glob); 1463 if ('root' in $$props) $$invalidate(10, root = $$props.root); 1464 if ('loading_status' in $$props) $$invalidate(11, loading_status = $$props.loading_status); 1465 if ('container' in $$props) $$invalidate(12, container = $$props.container); 1466 if ('scale' in $$props) $$invalidate(13, scale = $$props.scale);
1467 if ('min_width' in $$props) $$invalidate(14, min_width = $$props.min_width); 1468 if ('gradio' in $$props) $$invalidate(15, gradio = $$props.gradio); 1469 if ('server' in $$props) $$invalidate(16, server = $$props.server); 1470 if ('interactive' in $$props) $$invalidate(17, interactive = $$props.interactive); 1471 }; 1472 1473 return [ 1474 value, 1475 elem_id, 1476 elem_classes, 1477 visible, 1478 label, 1479 show_label, 1480 height, 1481 file_count, 1482 glob, 1483 ignore_glob, 1484 root, 1485 loading_status, 1486 container, 1487 scale, 1488 min_width, 1489 gradio, 1490 server, 1491 interactive, 1492 directoryexplorer_value_binding, 1493 change_handler 1494 ]; 1495} 1496 1497class Index extends SvelteComponent { 1498 constructor(options) { 1499 super(); 1500 1501 init(this, options, instance, create_fragment, safe_not_equal, { 1502 elem_id: 1, 1503 elem_classes: 2, 1504 visible: 3, 1505 value: 0, 1506 label: 4, 1507 show_label: 5, 1508 height: 6, 1509 file_count: 7, 1510 glob: 8, 1511 ignore_glob: 9, 1512 root: 10, 1513 loading_status: 11, 1514 container: 12, 1515 scale: 13, 1516 min_width: 14, 1517 gradio: 15, 1518 server: 16, 1519 interactive: 17 1520 }); 1521 } 1522 1523 get elem_id() { 1524 return this.$$.ctx[1]; 1525 } 1526 1527 set elem_id(elem_id) { 1528 this.$$set({ elem_id }); 1529 flush(); 1530 } 1531 1532 get elem_classes() { 1533 return this.$$.ctx[2]; 1534 } 1535 1536 set elem_classes(elem_classes) { 1537 this.$$set({ elem_classes }); 1538 flush(); 1539 } 1540 1541 get visible() { 1542 return this.$$.ctx[3]; 1543 } 1544 1545 set visible(visible) { 1546 this.$$set({ visible }); 1547 flush(); 1548 } 1549 1550 get value() { 1551 return this.$$.ctx[0]; 1552 } 1553 1554 set value(value) { 1555 this.$$set({ value }); 1556 flush(); 1557 } 1558 1559 get label() { 1560 return this.$$.ctx[4]; 1561 } 1562 1563 set label(label) { 1564 this.$$set({ label }); 1565 flush(); 1566 } 1567 1568 get show_label() { 1569 return this.$$.ctx[5]; 1570 } 1571 1572 set show_label(show_label) { 1573 this.$$set({ show_label }); 1574 flush(); 1575 } 1576 1577 get height() { 1578 return this.$$.ctx[6]; 1579 } 1580 1581 set height(height) { 1582 this.$$set({ height }); 1583 flush(); 1584 } 1585 1586 get file_count() { 1587 return this.$$.ctx[7]; 1588 } 1589 1590 set file_count(file_count) { 1591 this.$$set({ file_count }); 1592 flush(); 1593 } 1594 1595 get glob() { 1596 return this.$$.ctx[8]; 1597 } 1598 1599 set glob(glob) { 1600 this.$$set({ glob }); 1601 flush(); 1602 } 1603 1604 get ignore_glob() { 1605 return this.$$.ctx[9]; 1606 } 1607 1608 set ignore_glob(ignore_glob) { 1609 this.$$set({ ignore_glob }); 1610 flush(); 1611 } 1612 1613 get root() { 1614 return this.$$.ctx[10]; 1615 } 1616 1617 set root(root) { 1618 this.$$set({ root }); 1619 flush(); 1620 } 1621 1622 get loading_status() { 1623 return this.$$.ctx[11]; 1624 } 1625 1626 set loading_status(loading_status) { 1627 this.$$set({ loading_status }); 1628 flush(); 1629 } 1630 1631 get container() { 1632 return this.$$.ctx[12]; 1633 } 1634 1635 set container(container) { 1636 this.$$set({ container }); 1637 flush(); 1638 } 1639 1640 get scale() { 1641 return this.$$.ctx[13]; 1642 } 1643 1644 set scale(scale) { 1645 this.$$set({ scale }); 1646 flush(); 1647 } 1648 1649 get min_width() { 1650 return this.$$.ctx[14]; 1651 } 1652 1653 set min_width(min_width) { 1654 this.$$set({ min_width }); 1655 flush(); 1656 } 1657 1658 get gradio() { 1659 return this.$$.ctx[15]; 1660 } 1661 1662 set gradio(gradio) { 1663 this.$$set({ gradio }); 1664 flush(); 1665 } 1666 1667 get server() { 1668 return this.$$.ctx[16]; 1669 } 1670 1671 set server(server) { 1672 this.$$set({ server }); 1673 flush(); 1674 } 1675 1676 get interactive() { 1677 return this.$$.ctx[17]; 1678 } 1679 1680 set interactive(interactive) { 1681 this.$$set({ interactive }); 1682 flush(); 1683 } 1684} 1685 1686export { Index as default }; 1687//# sourceMappingURL=Index-272dddda.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.