<?php
declare(strict_types=1);
require_once __DIR__ . '/../../_helpers.php';
require_once __DIR__ . '/../../auth/guard.php';
require_login();

$file = __DIR__ . '/data/sectores_mapa.json';
if (!is_file($file)) {
  json_response(["ok" => true, "data" => [], "items" => []]);
}

$raw = file_get_contents($file) ?: '{}';
$data = json_decode($raw, true);
if (!is_array($data)) $data = [];

json_response(["ok" => true, "data" => $data, "items" => $data]);
