import { S as SvelteComponent, i as init, s as safe_not_equal, H as binding_callbacks, N as bind, c as create_component, m as mount_component, K as add_flush_callback, j as transition_in, k as transition_out, o as destroy_component, E as createEventDispatcher, p as create_slot, u as update_slot_base, q as get_all_dirty_from_scope, r as get_slot_changes, J as bubble } from './index.4872dbae.js';
import { T as Tabs } from './Tabs.4e472f72.js';
import './Column.9013c6da.js';
import './styles.c72835fa.js';

/* src/components/Tabs/Tabs.svelte generated by Svelte v3.49.0 */

function create_default_slot(ctx) {
	let current;
	const default_slot_template = /*#slots*/ ctx[2].default;
	const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[5], null);

	return {
		c() {
			if (default_slot) default_slot.c();
		},
		m(target, anchor) {
			if (default_slot) {
				default_slot.m(target, anchor);
			}

			current = true;
		},
		p(ctx, dirty) {
			if (default_slot) {
				if (default_slot.p && (!current || dirty & /*$$scope*/ 32)) {
					update_slot_base(
						default_slot,
						default_slot_template,
						ctx,
						/*$$scope*/ ctx[5],
						!current
						? get_all_dirty_from_scope(/*$$scope*/ ctx[5])
						: get_slot_changes(default_slot_template, /*$$scope*/ ctx[5], dirty, null),
						null
					);
				}
			}
		},
		i(local) {
			if (current) return;
			transition_in(default_slot, local);
			current = true;
		},
		o(local) {
			transition_out(default_slot, local);
			current = false;
		},
		d(detaching) {
			if (default_slot) default_slot.d(detaching);
		}
	};
}

function create_fragment(ctx) {
	let tabs;
	let updating_selected;
	let current;

	function tabs_selected_binding(value) {
		/*tabs_selected_binding*/ ctx[3](value);
	}

	let tabs_props = {
		elem_id: /*elem_id*/ ctx[1],
		$$slots: { default: [create_default_slot] },
		$$scope: { ctx }
	};

	if (/*selected*/ ctx[0] !== void 0) {
		tabs_props.selected = /*selected*/ ctx[0];
	}

	tabs = new Tabs({ props: tabs_props });
	binding_callbacks.push(() => bind(tabs, 'selected', tabs_selected_binding));
	tabs.$on("change", /*change_handler*/ ctx[4]);

	return {
		c() {
			create_component(tabs.$$.fragment);
		},
		m(target, anchor) {
			mount_component(tabs, target, anchor);
			current = true;
		},
		p(ctx, [dirty]) {
			const tabs_changes = {};
			if (dirty & /*elem_id*/ 2) tabs_changes.elem_id = /*elem_id*/ ctx[1];

			if (dirty & /*$$scope*/ 32) {
				tabs_changes.$$scope = { dirty, ctx };
			}

			if (!updating_selected && dirty & /*selected*/ 1) {
				updating_selected = true;
				tabs_changes.selected = /*selected*/ ctx[0];
				add_flush_callback(() => updating_selected = false);
			}

			tabs.$set(tabs_changes);
		},
		i(local) {
			if (current) return;
			transition_in(tabs.$$.fragment, local);
			current = true;
		},
		o(local) {
			transition_out(tabs.$$.fragment, local);
			current = false;
		},
		d(detaching) {
			destroy_component(tabs, detaching);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { $$slots: slots = {}, $$scope } = $$props;
	const dispatch = createEventDispatcher();
	let { elem_id = "" } = $$props;
	let { selected } = $$props;

	function tabs_selected_binding(value) {
		selected = value;
		$$invalidate(0, selected);
	}

	function change_handler(event) {
		bubble.call(this, $$self, event);
	}

	$$self.$$set = $$props => {
		if ('elem_id' in $$props) $$invalidate(1, elem_id = $$props.elem_id);
		if ('selected' in $$props) $$invalidate(0, selected = $$props.selected);
		if ('$$scope' in $$props) $$invalidate(5, $$scope = $$props.$$scope);
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*selected*/ 1) {
			dispatch("prop_change", { selected });
		}
	};

	return [selected, elem_id, slots, tabs_selected_binding, change_handler, $$scope];
}

class Tabs_1 extends SvelteComponent {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal, { elem_id: 1, selected: 0 });
	}
}

var Tabs_1$1 = Tabs_1;

const modes = ["static"];

export { Tabs_1$1 as Component, modes };
