1import { S as Static } from './Index-a19f568c.js'; 2import { B as Block } from './Button-515ad287.js'; 3import './index-7905665e.js'; 4import './svelte/svelte.js'; 5 6const HTML_svelte_svelte_type_style_lang = ''; 7 8/* home/runner/work/gradio/gradio/js/html/shared/HTML.svelte generated by Svelte v4.2.2 */ 9const { 10 SvelteComponent: SvelteComponent$1, 11 attr: attr$1, 12 detach: detach$1, 13 element: element$1, 14 init: init$1, 15 insert: insert$1, 16 noop, 17 safe_not_equal: safe_not_equal$1, 18 toggle_class: toggle_class$1 19} = window.__gradio__svelte__internal; 20const { createEventDispatcher } = window.__gradio__svelte__internal; 21function create_fragment$1(ctx) { 22 let div; 23 let div_class_value; 24 25 return { 26 c() { 27 div = element$1("div"); 28 attr$1(div, "class", div_class_value = "prose " + /*elem_classes*/ ctx[0].join(' ') + " svelte-1ybaih5"); 29 toggle_class$1(div, "min", /*min_height*/ ctx[3]); 30 toggle_class$1(div, "hide", !/*visible*/ ctx[2]); 31 }, 32 m(target, anchor) { 33 insert$1(target, div, anchor); 34 div.innerHTML = /*value*/ ctx[1]; 35 }, 36 p(ctx, [dirty]) { 37 if (dirty & /*value*/ 2) div.innerHTML = /*value*/ ctx[1]; 38 if (dirty & /*elem_classes*/ 1 && div_class_value !== (div_class_value = "prose " + /*elem_classes*/ ctx[0].join(' ') + " svelte-1ybaih5")) { 39 attr$1(div, "class", div_class_value); 40 } 41 42 if (dirty & /*elem_classes, min_height*/ 9) { 43 toggle_class$1(div, "min", /*min_height*/ ctx[3]); 44 } 45 46 if (dirty & /*elem_classes, visible*/ 5) { 47 toggle_class$1(div, "hide", !/*visible*/ ctx[2]); 48 } 49 }, 50 i: noop, 51 o: noop, 52 d(detaching) { 53 if (detaching) { 54 detach$1(div); 55 } 56 } 57 }; 58} 59 60function instance$1($$self, $$props, $$invalidate) { 61 let { elem_classes = [] } = $$props; 62 let { value } = $$props; 63 let { visible = true } = $$props; 64 let { min_height = false } = $$props; 65 const dispatch = createEventDispatcher(); 66 67 $$self.$$set = $$props => {
68 if ('elem_classes' in $$props) $$invalidate(0, elem_classes = $$props.elem_classes); 69 if ('value' in $$props) $$invalidate(1, value = $$props.value); 70 if ('visible' in $$props) $$invalidate(2, visible = $$props.visible); 71 if ('min_height' in $$props) $$invalidate(3, min_height = $$props.min_height); 72 }; 73 74 $$self.$$.update = () => { 75 if ($$self.$$.dirty & /*value*/ 2) { 76 (dispatch("change")); 77 } 78 }; 79 80 return [elem_classes, value, visible, min_height]; 81} 82 83class HTML extends SvelteComponent$1 { 84 constructor(options) { 85 super(); 86 87 init$1(this, options, instance$1, create_fragment$1, safe_not_equal$1, { 88 elem_classes: 0, 89 value: 1, 90 visible: 2, 91 min_height: 3 92 }); 93 } 94} 95 96const Index_svelte_svelte_type_style_lang = ''; 97 98/* home/runner/work/gradio/gradio/js/html/Index.svelte generated by Svelte v4.2.2 */ 99const { 100 SvelteComponent, 101 assign, 102 attr, 103 create_component, 104 destroy_component, 105 detach, 106 element, 107 get_spread_object, 108 get_spread_update, 109 init, 110 insert, 111 mount_component, 112 safe_not_equal, 113 space, 114 toggle_class, 115 transition_in, 116 transition_out 117} = window.__gradio__svelte__internal; 118function create_default_slot(ctx) { 119 let statustracker; 120 let t; 121 let div; 122 let html; 123 let current; 124 125 const statustracker_spread_levels = [ 126 { autoscroll: /*gradio*/ ctx[5].autoscroll }, 127 { i18n: /*gradio*/ ctx[5].i18n }, 128 /*loading_status*/ ctx[4], 129 { variant: "center" } 130 ]; 131 132 let statustracker_props = {}; 133 134 for (let i = 0; i < statustracker_spread_levels.length; i += 1) { 135 statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]); 136 } 137 138 statustracker = new Static({ props: statustracker_props }); 139 140 html = new HTML({ 141 props: { 142 min_height: /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4]?.status !== "complete", 143 value: /*value*/ ctx[3], 144 elem_classes: /*elem_classes*/ ctx[1], 145 visible: /*visible*/ ctx[2] 146 } 147 }); 148 149 html.$on("change", /*change_handler*/ ctx[7]); 150 151 return { 152 c() { 153 create_component(statustracker.$$.fragment); 154 t = space(); 155 div = element("div"); 156 create_component(html.$$.fragment); 157 attr(div, "class", "svelte-1ed2p3z"); 158 toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending"); 159 }, 160 m(target, anchor) { 161 mount_component(statustracker, target, anchor); 162 insert(target, t, anchor); 163 insert(target, div, anchor); 164 mount_component(html, div, null); 165 current = true; 166 }, 167 p(ctx, dirty) { 168 const statustracker_changes = (dirty & /*gradio, loading_status*/ 48) 169 ? get_spread_update(statustracker_spread_levels, [ 170 dirty & /*gradio*/ 32 && { autoscroll: /*gradio*/ ctx[5].autoscroll }, 171 dirty & /*gradio*/ 32 && { i18n: /*gradio*/ ctx[5].i18n }, 172 dirty & /*loading_status*/ 16 && get_spread_object(/*loading_status*/ ctx[4]), 173 statustracker_spread_levels[3] 174 ]) 175 : {}; 176 177 statustracker.$set(statustracker_changes); 178 const html_changes = {}; 179 if (dirty & /*loading_status*/ 16) html_changes.min_height = /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4]?.status !== "complete"; 180 if (dirty & /*value*/ 8) html_changes.value = /*value*/ ctx[3]; 181 if (dirty & /*elem_classes*/ 2) html_changes.elem_classes = /*elem_classes*/ ctx[1]; 182 if (dirty & /*visible*/ 4) html_changes.visible = /*visible*/ ctx[2]; 183 html.$set(html_changes); 184 185 if (!current || dirty & /*loading_status*/ 16) { 186 toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending"); 187 } 188 }, 189 i(local) { 190 if (current) return; 191 transition_in(statustracker.$$.fragment, local); 192 transition_in(html.$$.fragment, local); 193 current = true; 194 }, 195 o(local) { 196 transition_out(statustracker.$$.fragment, local); 197 transition_out(html.$$.fragment, local); 198 current = false; 199 }, 200 d(detaching) { 201 if (detaching) { 202 detach(t); 203 detach(div); 204 } 205 206 destroy_component(statustracker, detaching); 207 destroy_component(html); 208 } 209 }; 210} 211 212function create_fragment(ctx) { 213 let block; 214 let current; 215 216 block = new Block({ 217 props: { 218 visible: /*visible*/ ctx[2], 219 elem_id: /*elem_id*/ ctx[0], 220 elem_classes: /*elem_classes*/ ctx[1], 221 container: false, 222 $$slots: { default: [create_default_slot] }, 223 $$scope: { ctx } 224 } 225 }); 226 227 return { 228 c() { 229 create_component(block.$$.fragment); 230 }, 231 m(target, anchor) { 232 mount_component(block, target, anchor); 233 current = true; 234 }, 235 p(ctx, [dirty]) { 236 const block_changes = {};
237 if (dirty & /*visible*/ 4) block_changes.visible = /*visible*/ ctx[2]; 238 if (dirty & /*elem_id*/ 1) block_changes.elem_id = /*elem_id*/ ctx[0]; 239 if (dirty & /*elem_classes*/ 2) block_changes.elem_classes = /*elem_classes*/ ctx[1]; 240 241 if (dirty & /*$$scope, loading_status, value, elem_classes, visible, gradio*/ 318) { 242 block_changes.$$scope = { dirty, ctx }; 243 } 244 245 block.$set(block_changes); 246 }, 247 i(local) { 248 if (current) return; 249 transition_in(block.$$.fragment, local); 250 current = true; 251 }, 252 o(local) { 253 transition_out(block.$$.fragment, local); 254 current = false; 255 }, 256 d(detaching) { 257 destroy_component(block, detaching); 258 } 259 }; 260} 261 262function instance($$self, $$props, $$invalidate) { 263 let { label } = $$props; 264 let { elem_id = "" } = $$props; 265 let { elem_classes = [] } = $$props; 266 let { visible = true } = $$props; 267 let { value = "" } = $$props; 268 let { loading_status } = $$props; 269 let { gradio } = $$props; 270 const change_handler = () => gradio.dispatch("change"); 271 272 $$self.$$set = $$props => {
273 if ('label' in $$props) $$invalidate(6, label = $$props.label); 274 if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id); 275 if ('elem_classes' in $$props) $$invalidate(1, elem_classes = $$props.elem_classes); 276 if ('visible' in $$props) $$invalidate(2, visible = $$props.visible); 277 if ('value' in $$props) $$invalidate(3, value = $$props.value); 278 if ('loading_status' in $$props) $$invalidate(4, loading_status = $$props.loading_status); 279 if ('gradio' in $$props) $$invalidate(5, gradio = $$props.gradio); 280 }; 281 282 $$self.$$.update = () => { 283 if ($$self.$$.dirty & /*label, gradio*/ 96) { 284 (gradio.dispatch("change")); 285 } 286 }; 287 288 return [ 289 elem_id, 290 elem_classes, 291 visible, 292 value, 293 loading_status, 294 gradio, 295 label, 296 change_handler 297 ]; 298} 299 300class Index extends SvelteComponent { 301 constructor(options) { 302 super(); 303 304 init(this, options, instance, create_fragment, safe_not_equal, { 305 label: 6, 306 elem_id: 0, 307 elem_classes: 1, 308 visible: 2, 309 value: 3, 310 loading_status: 4, 311 gradio: 5 312 }); 313 } 314} 315 316export { Index as default }; 317//# sourceMappingURL=Index-a6b22f5a.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.