1import { I as Info } from './Info-222aa883.js'; 2import './Button-20c14f3f.js'; 3 4/* home/runner/work/gradio/gradio/js/atoms/src/BlockTitle.svelte generated by Svelte v4.2.2 */ 5const { 6 SvelteComponent, 7 attr, 8 check_outros, 9 create_component, 10 create_slot, 11 destroy_component, 12 detach, 13 element, 14 empty, 15 get_all_dirty_from_scope, 16 get_slot_changes, 17 group_outros, 18 init, 19 insert, 20 mount_component, 21 safe_not_equal, 22 set_data, 23 space, 24 text, 25 toggle_class, 26 transition_in, 27 transition_out, 28 update_slot_base 29} = window.__gradio__svelte__internal; 30function create_if_block(ctx) { 31 let info_1; 32 let current; 33 34 info_1 = new Info({ 35 props: { 36 $$slots: { default: [create_default_slot] }, 37 $$scope: { ctx } 38 } 39 }); 40 41 return { 42 c() { 43 create_component(info_1.$$.fragment); 44 }, 45 m(target, anchor) { 46 mount_component(info_1, target, anchor); 47 current = true; 48 }, 49 p(ctx, dirty) { 50 const info_1_changes = {}; 51 52 if (dirty & /*$$scope, info*/ 10) { 53 info_1_changes.$$scope = { dirty, ctx }; 54 } 55 56 info_1.$set(info_1_changes); 57 }, 58 i(local) { 59 if (current) return; 60 transition_in(info_1.$$.fragment, local); 61 current = true; 62 }, 63 o(local) { 64 transition_out(info_1.$$.fragment, local); 65 current = false; 66 }, 67 d(detaching) { 68 destroy_component(info_1, detaching); 69 } 70 }; 71} 72 73// (15:1) <Info> 74function create_default_slot(ctx) { 75 let t; 76 77 return { 78 c() { 79 t = text(/*info*/ ctx[1]); 80 }, 81 m(target, anchor) { 82 insert(target, t, anchor); 83 }, 84 p(ctx, dirty) { 85 if (dirty & /*info*/ 2) set_data(t, /*info*/ ctx[1]); 86 }, 87 d(detaching) { 88 if (detaching) { 89 detach(t); 90 } 91 } 92 }; 93} 94 95function create_fragment(ctx) { 96 let span; 97 let t; 98 let if_block_anchor; 99 let current; 100 const default_slot_template = /*#slots*/ ctx[2].default; 101 const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null); 102 let if_block = /*info*/ ctx[1] && create_if_block(ctx); 103 104 return { 105 c() { 106 span = element("span"); 107 if (default_slot) default_slot.c(); 108 t = space(); 109 if (if_block) if_block.c(); 110 if_block_anchor = empty(); 111 attr(span, "data-testid", "block-info"); 112 attr(span, "class", "svelte-1gfkn6j"); 113 toggle_class(span, "sr-only", !/*show_label*/ ctx[0]); 114 toggle_class(span, "hide", !/*show_label*/ ctx[0]); 115 toggle_class(span, "has-info", /*info*/ ctx[1] != null); 116 }, 117 m(target, anchor) { 118 insert(target, span, anchor); 119 120 if (default_slot) { 121 default_slot.m(span, null); 122 } 123 124 insert(target, t, anchor); 125 if (if_block) if_block.m(target, anchor); 126 insert(target, if_block_anchor, anchor); 127 current = true; 128 }, 129 p(ctx, [dirty]) { 130 if (default_slot) { 131 if (default_slot.p && (!current || dirty & /*$$scope*/ 8)) { 132 update_slot_base( 133 default_slot, 134 default_slot_template, 135 ctx, 136 /*$$scope*/ ctx[3], 137 !current 138 ? get_all_dirty_from_scope(/*$$scope*/ ctx[3]) 139 : get_slot_changes(default_slot_template, /*$$scope*/ ctx[3], dirty, null), 140 null 141 ); 142 } 143 } 144 145 if (!current || dirty & /*show_label*/ 1) { 146 toggle_class(span, "sr-only", !/*show_label*/ ctx[0]); 147 } 148 149 if (!current || dirty & /*show_label*/ 1) { 150 toggle_class(span, "hide", !/*show_label*/ ctx[0]); 151 } 152 153 if (!current || dirty & /*info*/ 2) { 154 toggle_class(span, "has-info", /*info*/ ctx[1] != null); 155 } 156 157 if (/*info*/ ctx[1]) { 158 if (if_block) { 159 if_block.p(ctx, dirty); 160 161 if (dirty & /*info*/ 2) { 162 transition_in(if_block, 1); 163 } 164 } else { 165 if_block = create_if_block(ctx); 166 if_block.c(); 167 transition_in(if_block, 1); 168 if_block.m(if_block_anchor.parentNode, if_block_anchor); 169 } 170 } else if (if_block) { 171 group_outros(); 172 173 transition_out(if_block, 1, 1, () => { 174 if_block = null; 175 }); 176 177 check_outros(); 178 } 179 }, 180 i(local) { 181 if (current) return; 182 transition_in(default_slot, local); 183 transition_in(if_block); 184 current = true; 185 }, 186 o(local) { 187 transition_out(default_slot, local); 188 transition_out(if_block); 189 current = false; 190 }, 191 d(detaching) { 192 if (detaching) { 193 detach(span); 194 detach(t); 195 detach(if_block_anchor); 196 } 197 198 if (default_slot) default_slot.d(detaching); 199 if (if_block) if_block.d(detaching); 200 } 201 }; 202} 203
204function instance($$self, $$props, $$invalidate) { 205 let { $$slots: slots = {}, $$scope } = $$props; 206 let { show_label = true } = $$props; 207 let { info = undefined } = $$props; 208 209 $$self.$$set = $$props => { 210 if ('show_label' in $$props) $$invalidate(0, show_label = $$props.show_label); 211 if ('info' in $$props) $$invalidate(1, info = $$props.info); 212 if ('$$scope' in $$props) $$invalidate(3, $$scope = $$props.$$scope); 213 }; 214 215 return [show_label, info, slots, $$scope]; 216} 217 218class BlockTitle extends SvelteComponent { 219 constructor(options) { 220 super(); 221 init(this, options, instance, create_fragment, safe_not_equal, { show_label: 0, info: 1 }); 222 } 223} 224 225export { BlockTitle as B }; 226//# sourceMappingURL=BlockTitle-1fab1ef7.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.