import { S as SvelteComponent, i as init, s as safe_not_equal, e as element, b as attr, Y as set_style, f as insert, w as noop, n as detach, E as createEventDispatcher, c as create_component, m as mount_component, j as transition_in, k as transition_out, o as destroy_component, J as bubble } from './index.4872dbae.js';

var typography = '';

/* home/runner/work/gradio/gradio/ui/packages/markdown/src/Markdown.svelte generated by Svelte v3.49.0 */

function create_fragment$1(ctx) {
	let div;

	return {
		c() {
			div = element("div");
			attr(div, "id", /*elem_id*/ ctx[0]);
			attr(div, "class", "output-markdown gr-prose");
			set_style(div, "max-width", "100%");
		},
		m(target, anchor) {
			insert(target, div, anchor);
			div.innerHTML = /*value*/ ctx[1];
		},
		p(ctx, [dirty]) {
			if (dirty & /*value*/ 2) div.innerHTML = /*value*/ ctx[1];
			if (dirty & /*elem_id*/ 1) {
				attr(div, "id", /*elem_id*/ ctx[0]);
			}
		},
		i: noop,
		o: noop,
		d(detaching) {
			if (detaching) detach(div);
		}
	};
}

function instance$1($$self, $$props, $$invalidate) {
	let { elem_id = "" } = $$props;
	let { value } = $$props;
	const dispatch = createEventDispatcher();

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

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*value*/ 2) {
			(dispatch("change"));
		}
	};

	return [elem_id, value];
}

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

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

function create_fragment(ctx) {
	let markdown;
	let current;

	markdown = new Markdown({
			props: {
				value: /*value*/ ctx[1],
				elem_id: /*elem_id*/ ctx[0]
			}
		});

	markdown.$on("change", /*change_handler*/ ctx[3]);

	return {
		c() {
			create_component(markdown.$$.fragment);
		},
		m(target, anchor) {
			mount_component(markdown, target, anchor);
			current = true;
		},
		p(ctx, [dirty]) {
			const markdown_changes = {};
			if (dirty & /*value*/ 2) markdown_changes.value = /*value*/ ctx[1];
			if (dirty & /*elem_id*/ 1) markdown_changes.elem_id = /*elem_id*/ ctx[0];
			markdown.$set(markdown_changes);
		},
		i(local) {
			if (current) return;
			transition_in(markdown.$$.fragment, local);
			current = true;
		},
		o(local) {
			transition_out(markdown.$$.fragment, local);
			current = false;
		},
		d(detaching) {
			destroy_component(markdown, detaching);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { label } = $$props;
	let { elem_id = "" } = $$props;
	let { value = "" } = $$props;
	const dispatch = createEventDispatcher();

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

	$$self.$$set = $$props => {
		if ('label' in $$props) $$invalidate(2, label = $$props.label);
		if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id);
		if ('value' in $$props) $$invalidate(1, value = $$props.value);
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*label*/ 4) {
			(dispatch("change"));
		}
	};

	return [elem_id, value, label, change_handler];
}

class Markdown_1 extends SvelteComponent {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal, { label: 2, elem_id: 0, value: 1 });
	}
}

var Markdown_1$1 = Markdown_1;

const modes = ["static"];

export { Markdown_1$1 as Component, modes };
