1const Example_svelte_svelte_type_style_lang = ''; 2 3/* home/runner/work/gradio/gradio/js/fileexplorer/Example.svelte generated by Svelte v4.2.2 */ 4const { 5 SvelteComponent, 6 append, 7 attr, 8 destroy_each, 9 detach, 10 element, 11 ensure_array_like, 12 init, 13 insert, 14 noop, 15 safe_not_equal, 16 set_data, 17 space, 18 text, 19 toggle_class 20} = window.__gradio__svelte__internal; 21function get_each_context(ctx, list, i) { 22 const child_ctx = ctx.slice(); 23 child_ctx[3] = list[i]; 24 return child_ctx; 25} 26 27// (11:1) {#each Array.isArray(value) ? value.slice(0, 3) : [value] as path} 28function create_each_block(ctx) { 29 let li; 30 let code; 31 let t0; 32 let t1_value = /*path*/ ctx[3] + ""; 33 let t1; 34 35 return { 36 c() { 37 li = element("li"); 38 code = element("code"); 39 t0 = text("./"); 40 t1 = text(t1_value); 41 }, 42 m(target, anchor) { 43 insert(target, li, anchor); 44 append(li, code); 45 append(code, t0); 46 append(code, t1); 47 }, 48 p(ctx, dirty) { 49 if (dirty & /*value*/ 1 && t1_value !== (t1_value = /*path*/ ctx[3] + "")) set_data(t1, t1_value); 50 }, 51 d(detaching) { 52 if (detaching) { 53 detach(li); 54 } 55 } 56 }; 57} 58 59// (14:1) {#if Array.isArray(value) && value.length > 3} 60function create_if_block(ctx) { 61 let li; 62 63 return { 64 c() { 65 li = element("li"); 66 li.textContent = "..."; 67 attr(li, "class", "extra svelte-4tf8f"); 68 }, 69 m(target, anchor) { 70 insert(target, li, anchor); 71 }, 72 d(detaching) { 73 if (detaching) { 74 detach(li); 75 } 76 } 77 }; 78} 79 80function create_fragment(ctx) { 81 let ul; 82 let t; 83 let show_if = Array.isArray(/*value*/ ctx[0]) && /*value*/ ctx[0].length > 3; 84 85 let each_value = ensure_array_like(Array.isArray(/*value*/ ctx[0]) 86 ? /*value*/ ctx[0].slice(0, 3) 87 : [/*value*/ ctx[0]]); 88 89 let each_blocks = []; 90 91 for (let i = 0; i < each_value.length; i += 1) { 92 each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); 93 } 94 95 let if_block = show_if && create_if_block(); 96 97 return { 98 c() { 99 ul = element("ul"); 100 101 for (let i = 0; i < each_blocks.length; i += 1) { 102 each_blocks[i].c(); 103 } 104 105 t = space(); 106 if (if_block) if_block.c(); 107 attr(ul, "class", "svelte-4tf8f"); 108 toggle_class(ul, "table", /*type*/ ctx[1] === "table"); 109 toggle_class(ul, "gallery", /*type*/ ctx[1] === "gallery"); 110 toggle_class(ul, "selected", /*selected*/ ctx[2]); 111 }, 112 m(target, anchor) { 113 insert(target, ul, anchor); 114 115 for (let i = 0; i < each_blocks.length; i += 1) { 116 if (each_blocks[i]) { 117 each_blocks[i].m(ul, null); 118 } 119 } 120 121 append(ul, t); 122 if (if_block) if_block.m(ul, null); 123 }, 124 p(ctx, [dirty]) { 125 if (dirty & /*Array, value*/ 1) { 126 each_value = ensure_array_like(Array.isArray(/*value*/ ctx[0]) 127 ? /*value*/ ctx[0].slice(0, 3) 128 : [/*value*/ ctx[0]]); 129 130 let i; 131 132 for (i = 0; i < each_value.length; i += 1) { 133 const child_ctx = get_each_context(ctx, each_value, i); 134 135 if (each_blocks[i]) { 136 each_blocks[i].p(child_ctx, dirty); 137 } else { 138 each_blocks[i] = create_each_block(child_ctx); 139 each_blocks[i].c(); 140 each_blocks[i].m(ul, t); 141 } 142 } 143 144 for (; i < each_blocks.length; i += 1) { 145 each_blocks[i].d(1); 146 } 147 148 each_blocks.length = each_value.length; 149 } 150 151 if (dirty & /*value*/ 1) show_if = Array.isArray(/*value*/ ctx[0]) && /*value*/ ctx[0].length > 3; 152 153 if (show_if) { 154 if (if_block) ; else { 155 if_block = create_if_block(); 156 if_block.c(); 157 if_block.m(ul, null); 158 } 159 } else if (if_block) { 160 if_block.d(1); 161 if_block = null; 162 } 163 164 if (dirty & /*type*/ 2) { 165 toggle_class(ul, "table", /*type*/ ctx[1] === "table"); 166 } 167 168 if (dirty & /*type*/ 2) { 169 toggle_class(ul, "gallery", /*type*/ ctx[1] === "gallery"); 170 } 171 172 if (dirty & /*selected*/ 4) { 173 toggle_class(ul, "selected", /*selected*/ ctx[2]); 174 } 175 }, 176 i: noop, 177 o: noop, 178 d(detaching) { 179 if (detaching) { 180 detach(ul); 181 } 182 183 destroy_each(each_blocks, detaching); 184 if (if_block) if_block.d(); 185 } 186 }; 187} 188 189function instance($$self, $$props, $$invalidate) { 190 let { value } = $$props; 191 let { type } = $$props; 192 let { selected = false } = $$props; 193 194 $$self.$$set = $$props => {
195 if ('value' in $$props) $$invalidate(0, value = $$props.value); 196 if ('type' in $$props) $$invalidate(1, type = $$props.type); 197 if ('selected' in $$props) $$invalidate(2, selected = $$props.selected); 198 }; 199 200 return [value, type, selected]; 201} 202 203class Example extends SvelteComponent { 204 constructor(options) { 205 super(); 206 init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 }); 207 } 208} 209 210export { Example as default }; 211//# sourceMappingURL=Example-3e057617.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.