<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Perizinan
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">
            <!-- Bagian Perizinan -->
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
                <label class="form-label max-w-56">Perizinan Lainnya</label>
                <div class="flex-wrap items-stretch w-full">
                    <div class="flex flex-col items-start gap-4 w-full">
                        @if (isset($basicData['perizinan']))
                            @foreach ($basicData['perizinan'] as $key => $item)
                                <div class="flex items-center gap-4 w-full">
                                    <label class="form-label flex items-center gap-2.5 text-nowrap min-w-[200px]">
                                        <input class="checkbox"
                                               name="perizinan[{{ $key }}]"
                                               type="checkbox"
                                               value="{{ $item->name }}"
                                               @checked(in_array($item->name, old('perizinan', [])) ||
                                                       (isset($forminspeksi['perizinan']) &&
                                                        in_array($item->name, array_column($forminspeksi['perizinan'], 'perizinan'))))>
                                        {{ $item->name }}
                                    </label>

                                    <div class="grid gap-2.5 w-full">
                                        <div class="flex items-center gap-4 w-full">
                                            @php
                                                $existingFile = isset($forminspeksi['perizinan'])
                                                    ? collect($forminspeksi['perizinan'])->firstWhere('perizinan', $item->name)
                                                    : null;
                                            @endphp

                                            @if ($existingFile)
                                                <div class="flex items-center gap-4 w-full">
                                                    <span class="text-sm text-gray-600">
                                                        {{ basename($existingFile['perizinan_file']) }}
                                                    </span>
                                                    <span class="flex-none badge badge-sm badge-outline badge-warning mt-2"
                                                          onclick="viewPDF('{{ Storage::url($existingFile['perizinan_file']) }}')">
                                                        <i class="ki-filled ki-eye mr-2"></i>Preview
                                                    </span>
                                                </div>
                                            @endif
                                        </div>

                                        <div class="flex items-center gap-4 w-full">
                                            <input class="file-input w-full"
                                                   name="perizinan_file[{{ $key }}]"
                                                   type="file"
                                                   accept=".pdf"
                                                   data-index="{{ $key }}">
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        @endif
                    </div>
                </div>
            </div>

            <!-- Bagian Brosur & Pricelist -->
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
                <label class="form-label max-w-56">Brosur & Pricelist</label>
                <div class="flex-wrap items-stretch w-full">
                    @php
                        $brosurItems = [
                            [
                                'label' => 'Brosur',
                                'name' => 'brosur_price_list',
                                'inputname' => 'brosur_price_list_file',
                            ],
                            [
                                'label' => 'Pricelist',
                                'name' => 'brosur_price_list',
                                'inputname' => 'brosur_price_list_file',
                            ],
                        ];
                    @endphp

                    <div class="flex flex-col items-start gap-4 w-full">
                        @foreach ($brosurItems as $index => $item)
                            <div class="flex items-center gap-4 w-full">
                                <label class="form-label flex items-center gap-2.5 text-nowrap min-w-[200px]">
                                    <input class="checkbox"
                                           name="{{ $item['name'] }}[{{ $index }}]"
                                           type="checkbox"
                                           value="{{ $item['label'] }}"
                                           @checked(in_array($item['label'], old('brosur_price_list', [])) ||
                                                   (isset($forminspeksi['brosur_price_list']) &&
                                                    in_array($item['label'], array_column($forminspeksi['brosur_price_list'], 'jenis'))))>
                                    {{ $item['label'] }}
                                </label>

                                <div class="grid gap-2.5 w-full">
                                    <div class="flex items-center gap-4 w-full">
                                        @php
                                            $existingFile = isset($forminspeksi['brosur_price_list'])
                                                ? collect($forminspeksi['brosur_price_list'])->firstWhere('jenis', $item['label'])
                                                : null;
                                        @endphp

                                        @if ($existingFile)
                                            <div class="flex items-center gap-4 w-full">
                                                <span class="text-sm text-gray-600">
                                                    {{ basename($existingFile['file_path']) }}
                                                </span>
                                                <span class="flex-none badge badge-sm badge-outline badge-warning mt-2"
                                                      onclick="viewPDF('{{ Storage::url($existingFile['file_path']) }}')">
                                                    <i class="ki-filled ki-eye mr-2"></i>Preview
                                                </span>
                                            </div>
                                        @endif
                                    </div>

                                    <div class="flex items-center gap-4 w-full">
                                        <input class="file-input w-full"
                                               name="{{ $item['inputname'] }}[{{ $index }}]"
                                               type="file"
                                               accept=".pdf"
                                               data-index="{{ $index }}"
                                               id="file_{{ $index }}">
                                    </div>
                                </div>
                            </div>
                        @endforeach
                    </div>
                </div>
                </div>
        </div>
    </div>


</div>
<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Deskripsi developer
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Pengalaman Developer & Proyek Yang Pernah Dibuat</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['pengalaman_developer']))
                        <div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="pengalaman_developer" rows="10">{{ old('pengalaman_developer', $forminspeksi['pengalaman_developer']) }}</textarea>
                        </div>
                    @else
                        <div class="pengalaman_developer flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="pengalaman_developer" rows="10">{{ old('pengalaman_developer') }}</textarea>
                        </div>
                    @endif
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Apakah Developer Anggota REI</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['developer_anggota']))
                        <div class="developer_anggota flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="developer_anggota" rows="10">{{ old('developer_anggota', $forminspeksi['developer_anggota']) }}</textarea>
                        </div>
                    @else
                        <div class="developer_anggota flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="developer_anggota" rows="10">{{ old('developer_anggota') }}</textarea>
                        </div>
                    @endif

                </div>
            </div>


            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Lainnya</label>
                <div class="w-full">
                    <div id="lainnya_developer-container" class="flex flex-wrap items-baseline w-full">
                        @if (!empty($forminspeksi['lainnya_developer']))
                            @foreach ($forminspeksi['lainnya_developer'] as $index => $item)
                                <div class="lainnya_developer flex items-center gap-2 mt-2 textarea-group w-full">
                                    <textarea class="textarea mt-2" name="lainnya_developer[]" rows="10">{{ old("lainnya_developer.$index", $item) }}</textarea>
                                </div>
                                <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                    <i class="ki-outline ki-trash"></i>
                                </button>
                            @endforeach
                        @else
                            <div class="lainnya_developer flex items-center gap-2 mt-2 textarea-group w-full">
                                <textarea class="textarea mt-2" name="lainnya_developer[]" rows="10">{{ old('lainnya_developer.0', '') }}</textarea>
                            </div>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        @endif
                    </div>
                    <button type="button" class="btn btn-primary btn-sm mt-5"
                        onclick="addClonableItem('lainnya_developer-container', 'lainnya_developer')">
                        <i class="ki-outline ki-plus"></i>
                    </button>
                </div>
            </div>
        </div>

    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            KONDISI, LINGKUNGAN DAN PROGRESS PEMBANGUNAN
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Kapan Mulai Dibangun & Target Penyelesaian</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['kapan_mulai_dibangun']))
                        <div class="kapan_mulai_dibangun flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kapan_mulai_dibangun" rows="10">{{ old('kapan_mulai_dibangun', $forminspeksi['kapan_mulai_dibangun']) }}</textarea>

                        </div>
                    @else
                        <div class="kapan_mulai_dibangun flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kapan_mulai_dibangun" rows="10">{{ old('kapan_mulai_dibangun') }}</textarea>

                        </div>
                    @endif
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Kondisi Perumahan Saat Ini</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['kondisi_perumahan']))
                        <div class="kondisi_perumahan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kondisi_perumahan" rows="10">{{ old('kondisi_perumahan', $forminspeksi['kondisi_perumahan']) }}</textarea>
                        </div>
                    @else
                        <div class="kondisi_perumahan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kondisi_perumahan" rows="10">{{ old('kondisi_perumahan') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>



            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Progress Pembangunan</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['progres_pembangunan']))
                        <div class="progres_pembangunan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="progres_pembangunan" rows="10">{{ old('progres_pembangunan', $forminspeksi['progres_pembangunan']) }}</textarea>
                        </div>
                    @else
                        <div class="progres_pembangunan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="progres_pembangunan" rows="10">{{ old('progres_pembangunan') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Kontraktor (internal/eksternal)</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['kontraktor']))
                        <div class="kontraktor flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kontraktor" rows="10">{{ old('kontraktor', $forminspeksi['kontraktor']) }}</textarea>
                        </div>
                    @else
                        <div class="kontraktor flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kontraktor" rows="10">{{ old('kontraktor') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Lingkungan Sekitar</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['lingkungan_sekitar']))
                        <div class="lingkungan_sekitar flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="lingkungan_sekitar" rows="10">{{ old('lingkungan_sekitar', $forminspeksi['lingkungan_sekitar']) }}</textarea>
                        </div>
                    @else
                        <div class="lingkungan_sekitar flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="lingkungan_sekitar" rows="10">{{ old('lingkungan_sekitar') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Komplek Lain Disekitar Lokasi</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['komplek_disekitar']))
                        <div class="komplek_disekitar flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="komplek_disekitar" rows="10">{{ old('komplek_disekitar', $forminspeksi['komplek_disekitar']) }}</textarea>
                        </div>
                    @else
                        <div class="komplek_disekitar flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="komplek_disekitar" rows="10">{{ old('komplek_disekitar') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Pusat Keramaian Dekat Lokasi</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['pusat_keramaian']))
                        <div class="pusat_keramaian flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="pusat_keramaian" rows="10">{{ old('pusat_keramaian', $forminspeksi['pusat_keramaian']) }}</textarea>
                        </div>
                    @else
                        <div class="pusat_keramaian flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="pusat_keramaian" rows="10">{{ old('pusat_keramaian') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Transportasi Umum Yang Tersedia</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['transportasi_umum']))
                        <div class="transportasi_umum flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="transportasi_umum" rows="10">{{ old('transportasi_umum', $forminspeksi['transportasi_umum']) }}</textarea>
                        </div>
                    @else
                        <div class="transportasi_umum flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="transportasi_umum" rows="10">{{ old('transportasi_umum') }}</textarea>

                        </div>
                    @endif

                </div>
            </div>
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Lainnya</label>
                <div id="lainnya-kondisi-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['lainnya_kondisi']))
                        @foreach ($forminspeksi['lainnya_kondisi'] as $index => $positif)
                            <div class="lainnya_kondisi flex items-center gap-2 mt-2 textarea-group w-full">
                                <textarea class="textarea mt-2" name="lainnya_kondisi[]" rows="10">{{ old("lainnya_kondisi.$index", $positif) }}</textarea>
                                <button class="btn btn-danger btn-sm remove-btn" type="button"
                                    style="display: none;">
                                    <i class="ki-outline ki-trash"></i>
                                </button>
                            </div>
                        @endforeach
                    @else
                        <div class="lainnya_kondisi flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="lainnya_kondisi[]" rows="10">{{ old('lainnya_kondisi.0', '') }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endif
                    <button type="button" class="btn btn-primary btn-sm mt-5"
                        onclick="addClonableItem('lainnya-kondisi-container', 'lainnya_kondisi')">
                        <i class="ki-outline ki-plus"></i>
                    </button>
                </div>
            </div>

        </div>

    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            PARTISI BANGUNAN
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-2.5">
            @if (isset($basicData['spekKategoriBangunan']))
                @foreach ($basicData['spekKategoriBangunan'] as $item)
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item->name ?? '' }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="hidden" name="partisi[{{ $item->name }}][nama]"
                                value="{{ $item->name ?? '' }}">
                            <input type="text" name="partisi[{{ $item->name }}][value]" class="input"
                                placeholder="Masukkan {{ $item->name }}"
                                value="{{ isset($forminspeksi['partisi'][$item->name]['value']) ? $forminspeksi['partisi'][$item->name]['value'] : old('partisi.' . $item->name . '.value') }}">
                        </div>
                    </div>
                @endforeach
            @endif
        </div>
    </div>

</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            JUMLAH UNIT, BLOK, TYPE DAN LUAS BANGUNAN
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="jumlah-unit" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['jumlah_unit']))
                    @foreach ($forminspeksi['jumlah_unit'] as $index => $positif)
                        <div class="jumlah_unit flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="jumlah_unit[]" rows="10">{{ old("jumlah_unit.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="jumlah_unit flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="jumlah_unit[]" rows="10">{{ old('jumlah_unit.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('jumlah-unit', 'jumlah_unit')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            BATAS-BATAS PERUMAHAN
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="bata-perumahan-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['batas_batas_perumahan']))
                    @foreach ($forminspeksi['batas_batas_perumahan'] as $index => $positif)
                        <div class="batas_batas_perumahan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="batas_batas_perumahan[]" rows="10">{{ old("batas_batas_perumahan.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="batas_batas_perumahan flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="batas_batas_perumahan[]" rows="10">{{ old('batas_batas_perumahan.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('bata-perumahan-container', 'batas_batas_perumahan')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            FASOS/FASUM
        </h3>
    </div>
    <div class="card-body">

        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="fasos-fasum-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['fasus_fasum']))
                    @foreach ($forminspeksi['fasus_fasum'] as $index => $positif)
                        <div class="fasus_fasum flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="fasus_fasum[]" rows="10">{{ old("fasus_fasum.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="fasus_fasum flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="fasus_fasum[]" rows="10">{{ old('fasus_fasum.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif
            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('fasos-fasum-container', 'fasus_fasum')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            PROGRES PENJUALAN SAAT INI
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="progres-penjualan-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['progres_penjualan']))
                    @foreach ($forminspeksi['progres_penjualan'] as $index => $positif)
                        <div class="progres_penjualan flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="progres_penjualan[]" rows="10">{{ old("progres_penjualan.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="progres_penjualan flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="progres_penjualan[]" rows="10">{{ old('progres_penjualan.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif
            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('progres-penjualan-container', 'progres_penjualan')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            HARGA UNIT
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="harga-unit-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['harga_unit']))
                    @foreach ($forminspeksi['harga_unit'] as $index => $positif)
                        <div class="harga_unit flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="harga_unit[]" rows="10">{{ old("harga_unit.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="harga_unit flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="harga_unit[]" rows="10">{{ old('harga_unit.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('harga-unit-container', 'harga_unit')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>
<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            TARGET MARKET
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
            <div id="target_market-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['target_market']))
                    @foreach ($forminspeksi['target_market'] as $index => $positif)
                        <div class="target_market flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="target_market[]" rows="10">{{ old("target_market.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="target_market flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="target_market[]" rows="10">{{ old('target_market.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('target_market-container', 'target_market')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>
<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            KERJASAMA DENGAN BANK LAIN
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

            <div id="kerjasama_dengan_bank-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['kerjasama_dengan_bank']))
                    @foreach ($forminspeksi['kerjasama_dengan_bank'] as $index => $positif)
                        <div class="kerjasama_dengan_bank flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="kerjasama_dengan_bank[]" rows="10">{{ old("kerjasama_dengan_bank.$index", $positif) }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endforeach
                @else
                    <div class="kerjasama_dengan_bank flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="kerjasama_dengan_bank[]" rows="10">{{ old('kerjasama_dengan_bank.0', '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>

        </div>
        <button type="button" class="btn btn-primary btn-sm mt-5"
            onclick="addClonableItem('kerjasama_dengan_bank-container', 'kerjasama_dengan_bank')">
            <i class="ki-outline ki-plus"></i>
        </button>
    </div>
</div>
<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            RUTE MENUJU LOKASI
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

            <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['rute_menuju_lokasi']))
                    <div class="rute_menuju_lokasi flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="rute_menuju_lokasi" rows="10">{{ old('rute_menuju_lokasi', $forminspeksi['rute_menuju_lokasi']) }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @else
                    <div class="rute_menuju_lokasi flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="rute_menuju_lokasi" rows="10">{{ old('rute_menuju_lokasi') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>

    </div>
</div>

<div class="card border border-agi-100 w-full  rounded-lg shadow-md  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Properti Sejenis
        </h3>
    </div>
    <div class="card-body">
        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

            <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                @if (!empty($forminspeksi['properti_sejenis']))
                    <div class="properti_sejenis flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="properti_sejenis" rows="10">{{ old('properti_sejenis', $forminspeksi['properti_sejenis']) }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @else
                    <div class="properti_sejenis flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="properti_sejenis" rows="10">{{ old('properti_sejenis') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                    </div>
                @endif

            </div>
        </div>

    </div>
</div>
@include('lpj::surveyor.components.informasi')
