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