<?php
    $selectedIds = array_values(array_map('intval', $selectedAccountIds ?? []));
    $isAllLedger = !empty($allLedger);
    $toggleLabel = $selectedAccountsLabel ?? 'Select account(s)';
?>
<script type="application/json" id="glAccountPickerTreeData"><?php echo json_encode($accountTree ?? [], 15, 512) ?></script>
<div class="gl-account-picker voucher-account-picker" id="glAccountPicker"
     data-selected='<?php echo json_encode($selectedIds, 15, 512) ?>'
     data-all-ledger='<?php echo json_encode($isAllLedger, 15, 512) ?>'>
    <button type="button" class="form-select voucher-account-picker-toggle text-start" id="glAccountPickerToggle" aria-expanded="false">
        <span class="voucher-account-picker-label" id="glAccountPickerLabel"><?php echo e($toggleLabel); ?></span>
    </button>
    <div class="voucher-account-picker-menu d-none" id="glAccountPickerMenu">
        <div class="voucher-account-picker-search">
            <i class="bi bi-search"></i>
            <input type="search" class="form-control form-control-sm" id="glAccountPickerSearch" placeholder="Search accounts..." autocomplete="off">
        </div>
        <label class="gl-account-picker-all-row">
            <input type="checkbox" id="glAccountPickerAllLedger" <?php echo e($isAllLedger ? 'checked' : ''); ?>>
            <span class="fw-semibold">All Ledger</span>
        </label>
        <div class="voucher-account-picker-columns gl-account-picker-columns">
            <span></span>
            <span></span>
            <span>Code</span>
            <span>Name</span>
            <span>Type</span>
        </div>
        <div class="voucher-account-picker-tree gl-account-picker-tree" id="glAccountPickerTree"></div>
        <div class="voucher-account-picker-empty d-none" id="glAccountPickerEmpty">No matching accounts</div>
        <div class="voucher-account-picker-actions">
            <button type="button" class="btn btn-link btn-sm p-0" id="glAccountPickerClear">Clear selection</button>
        </div>
    </div>
    <div id="glAccountPickerInputs">
        <input type="hidden" name="all_ledger" id="glAllLedgerInput" value="<?php echo e($isAllLedger ? '1' : ''); ?>">
        <?php $__currentLoopData = $selectedIds; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $selectedId): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <input type="hidden" name="account_ids[]" value="<?php echo e($selectedId); ?>">
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>
<?php /**PATH /home/duiclick/public_html/test.duiclick.com/resources/views/reports/general-ledger/_account-picker.blade.php ENDPATH**/ ?>