{* Drop was not choosen yet *} 
{if empty($dropInstance->getDrop())}
<div class="alert alert-info _m-0 text-center">Bitte wähle ein Drop aus.</div>
{* Real preview *}
{else}
<!-- preview container (replaced by actual preview content when ajax is done) -->
<div class="portlet-drop-preview" data-uid="{$instance->getUid()}">
	<div class="_p-2 text-center">Lade Drop...</div>
</div>
<script type="text/javascript" data-ignore="true">
$(function() {
	// render function
	let render = () => {
		if (!window.opc || !window.opc.dropper) return false;
		window.opc.dropper.renderDropPreview({$dropInstance->getPreviewParameters()});
		return true;
	}

	// initial render try
	if (!render()) {
		// wait for opc to get ready
		let renderInterval = setInterval(function() {
			if (!render()) {
				console.log('Dropper OPC Integration not loaded yet, retrying later...');
				return;
			}
			clearInterval(renderInterval);
		}, 200);
	}
});

</script>
{/if}