{% load static %}
{% load i18n %}
{% load humanize %}
{% load ledger %}

<script type="application/javascript">
    // Extract the 'main' parameter from the current URL
    const urlParams = new URLSearchParams(window.location.search);
    const singleViewParms = urlParams.get('single');

    // Construct the planetaryUrl with the 'main' parameter
    let planetaryUrl = '/ledger/api/character/{{ character_id }}/planetary/0/details/';
    if (singleViewParms) {
        planetaryUrl += '?single=' + singleViewParms;
    }

	let planetarySettings = {
        planetaryUrl: planetaryUrl,
		switchAlarmUrl: '{% url "ledger:switch_alarm" character_id=1337 planet_id=1337 %}',
		csrfToken: '{% csrf_token %}',
		switchAlarmText: '{% translate "Are you sure to Switch Notification" %}',
        switchAlarm: '{% translate "Switch Notification" %}',
        switchAlarmAll: '{% translate "Switch All Notifications" %}',
        alarmActivated: '{% translate "Notification Activated" %}',
        alarmDeactivated: '{% translate "Notification Deactivated" %}',
        characterPk: '{{ character_id }}',
        updateInterval: '{{ update_interval }}',
	};
</script>

{% ledger_static 'js/planetary-confirm.js' %}
{% ledger_static 'js/planetary.js' %}
