# Assets Directory

This directory contains the icibot booking widget loader script.

## Files

- `booking-widget-loader.js` - Minimal local wrapper script that loads widget-specific JavaScript from the booking service provider.
- `booking_widget.js` - Template widget JavaScript file (used as reference/template).

## How it works

The loader script (`booking-widget-loader.js`) is included locally in the plugin. It dynamically loads the widget-specific JavaScript file from the booking service provider's servers. The remote JavaScript file already contains `BOOKING_WIDGET_CONFIG` with all necessary configuration, so the loader simply loads the remote script and ensures the container element exists.

The remote JavaScript file automatically initializes when loaded (via `initAutoWidget()` function) and creates a container with the ID format `booking-widget-2-{widget_id}`.

