/**
 * Elementor
 *
 * @package
 * @author WP Zinc
 */

const pageGeneratorProElementor = elementor.modules.controls.BaseData.extend({
	/**
	 * Initialize selectize, autocomplete and conditional fields
	 */
	onReady() {
		setTimeout(function () {
			// Initialize autocomplete instances, if Keywords exist.
			if (typeof wp_zinc_autocomplete_initialize !== 'undefined') {
				wp_zinc_autocomplete_initialize();
			}
		}, 1000);
	},
});

// Bind to controls.
elementor.addControlView(
	'page-generator-pro-autocomplete',
	pageGeneratorProElementor
);
elementor.addControlView(
	'page-generator-pro-autocomplete-textarea',
	pageGeneratorProElementor
);
