1import { S as SvelteComponent, i as init, s as safe_not_equal, f as element, h as text, b as attr, c as insert, d as append, j as set_data, e as detach, V as create_slot, m as space, t as toggle_class, Q as update_slot_base, R as get_all_dirty_from_scope, T as get_slot_changes, v as transition_in, w as transition_out, U as getContext, K as component_subscribe, E as onDestroy, q as create_component, u as mount_component, x as destroy_component } from './index.230aa104.js'; 2import { a as CAROUSEL } from './CarouselItem.svelte_svelte_type_style_lang.b72f6d83.js'; 3 4/* home/runner/work/gradio/gradio/ui/packages/carousel/src/CarouselItem.svelte generated by Svelte v3.49.0 */ 5 6function create_if_block(ctx) { 7 let div; 8 let t; 9 10 return { 11 c() { 12 div = element("div"); 13 t = text(/*label*/ ctx[0]); 14 attr(div, "class", "absolute left-0 top-0 py-1 px-2 rounded-br-lg shadow-sm text-xs text-gray-500 flex items-center pointer-events-none bg-white z-20 dark:bg-gray-800"); 15 }, 16 m(target, anchor) { 17 insert(target, div, anchor); 18 append(div, t); 19 }, 20 p(ctx, dirty) { 21 if (dirty & /*label*/ 1) set_data(t, /*label*/ ctx[0]); 22 }, 23 d(detaching) { 24 if (detaching) detach(div); 25 } 26 }; 27} 28 29function create_fragment$1(ctx) { 30 let div; 31 let t; 32 let current; 33 let if_block = /*label*/ ctx[0] && create_if_block(ctx); 34 const default_slot_template = /*#slots*/ ctx[5].default; 35 const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null); 36 37 return { 38 c() { 39 div = element("div"); 40 if (if_block) if_block.c(); 41 t = space(); 42 if (default_slot) default_slot.c(); 43 attr(div, "class", "carousel-item hidden component min-h-[200px] border rounded-lg overflow-hidden relative svelte-89gglt"); 44 toggle_class(div, "!block", /*$current*/ ctx[1] === /*id*/ ctx[3]); 45 }, 46 m(target, anchor) { 47 insert(target, div, anchor); 48 if (if_block) if_block.m(div, null); 49 append(div, t); 50 51 if (default_slot) { 52 default_slot.m(div, null); 53 } 54 55 current = true; 56 }, 57 p(ctx, [dirty]) { 58 if (/*label*/ ctx[0]) { 59 if (if_block) { 60 if_block.p(ctx, dirty); 61 } else { 62 if_block = create_if_block(ctx); 63 if_block.c(); 64 if_block.m(div, t); 65 } 66 } else if (if_block) { 67 if_block.d(1); 68 if_block = null; 69 } 70 71 if (default_slot) { 72 if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) { 73 update_slot_base( 74 default_slot, 75 default_slot_template, 76 ctx, 77 /*$$scope*/ ctx[4], 78 !current 79 ? get_all_dirty_from_scope(/*$$scope*/ ctx[4]) 80 : get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null), 81 null 82 ); 83 } 84 } 85 86 if (dirty & /*$current, id*/ 10) { 87 toggle_class(div, "!block", /*$current*/ ctx[1] === /*id*/ ctx[3]); 88 } 89 }, 90 i(local) { 91 if (current) return; 92 transition_in(default_slot, local); 93 current = true; 94 }, 95 o(local) { 96 transition_out(default_slot, local); 97 current = false; 98 }, 99 d(detaching) { 100 if (detaching) detach(div); 101 if (if_block) if_block.d(); 102 if (default_slot) default_slot.d(detaching); 103 } 104 }; 105} 106 107function instance$1($$self, $$props, $$invalidate) { 108 let $current; 109 let { $$slots: slots = {}, $$scope } = $$props; 110 let { label = undefined } = $$props; 111 const { register, unregister, current } = getContext(CAROUSEL); 112 component_subscribe($$self, current, value => $$invalidate(1, $current = value)); 113 let id = register(); 114 onDestroy(() => unregister(id)); 115 116 $$self.$$set = $$props => {
117 if ('label' in $$props) $$invalidate(0, label = $$props.label); 118 if ('$$scope' in $$props) $$invalidate(4, $$scope = $$props.$$scope); 119 }; 120 121 return [label, $current, current, id, $$scope, slots]; 122} 123 124class CarouselItem extends SvelteComponent { 125 constructor(options) { 126 super(); 127 init(this, options, instance$1, create_fragment$1, safe_not_equal, { label: 0 }); 128 } 129} 130 131/* src/components/CarouselItem/CarouselItem.svelte generated by Svelte v3.49.0 */ 132 133function create_default_slot(ctx) { 134 let current; 135 const default_slot_template = /*#slots*/ ctx[0].default; 136 const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], null); 137 138 return { 139 c() { 140 if (default_slot) default_slot.c(); 141 }, 142 m(target, anchor) { 143 if (default_slot) { 144 default_slot.m(target, anchor); 145 } 146 147 current = true; 148 }, 149 p(ctx, dirty) { 150 if (default_slot) { 151 if (default_slot.p && (!current || dirty & /*$$scope*/ 2)) { 152 update_slot_base( 153 default_slot, 154 default_slot_template, 155 ctx, 156 /*$$scope*/ ctx[1], 157 !current 158 ? get_all_dirty_from_scope(/*$$scope*/ ctx[1]) 159 : get_slot_changes(default_slot_template, /*$$scope*/ ctx[1], dirty, null), 160 null 161 ); 162 } 163 } 164 }, 165 i(local) { 166 if (current) return; 167 transition_in(default_slot, local); 168 current = true; 169 }, 170 o(local) { 171 transition_out(default_slot, local); 172 current = false; 173 }, 174 d(detaching) { 175 if (default_slot) default_slot.d(detaching); 176 } 177 }; 178} 179 180function create_fragment(ctx) { 181 let carouselitem; 182 let current; 183 184 carouselitem = new CarouselItem({ 185 props: { 186 $$slots: { default: [create_default_slot] }, 187 $$scope: { ctx } 188 } 189 }); 190 191 return { 192 c() { 193 create_component(carouselitem.$$.fragment); 194 }, 195 m(target, anchor) { 196 mount_component(carouselitem, target, anchor); 197 current = true; 198 }, 199 p(ctx, [dirty]) { 200 const carouselitem_changes = {}; 201 202 if (dirty & /*$$scope*/ 2) { 203 carouselitem_changes.$$scope = { dirty, ctx }; 204 } 205 206 carouselitem.$set(carouselitem_changes); 207 }, 208 i(local) { 209 if (current) return; 210 transition_in(carouselitem.$$.fragment, local); 211 current = true; 212 }, 213 o(local) { 214 transition_out(carouselitem.$$.fragment, local); 215 current = false; 216 }, 217 d(detaching) { 218 destroy_component(carouselitem, detaching); 219 } 220 }; 221} 222 223function instance($$self, $$props, $$invalidate) { 224 let { $$slots: slots = {}, $$scope } = $$props; 225 226 $$self.$$set = $$props => {
227 if ('$$scope' in $$props) $$invalidate(1, $$scope = $$props.$$scope); 228 }; 229 230 return [slots, $$scope]; 231} 232 233class CarouselItem_1 extends SvelteComponent { 234 constructor(options) { 235 super(); 236 init(this, options, instance, create_fragment, safe_not_equal, {}); 237 } 238} 239 240var CarouselItem_1$1 = CarouselItem_1; 241 242const modes = ["static"]; 243 244export { CarouselItem_1$1 as Component, modes };
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.