<div id="<?php echo e((empty($idModal) ? 'dlgFormulario' : $idModal)); ?>" class="modal fade <?php echo e((!empty($classeModal) ? $classeModal : '')); ?>"  tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg " <?php echo e(empty($responsivo) ? ('style=width:'.(empty($largura) ? '500' : $largura).'px') : ''); ?> >
        <!-- Modal content-->
        <div class="modal-content" role="document">
            <div class="modal-header <?php echo e((!empty($classeHeader) ? $classeHeader : '')); ?>">
                <h4 class="modal-title"><i id="icone_form_modal<?php echo e((empty($idModal) ? '' :''.$idModal)); ?>" class="fas <?php echo e((empty($icone) ? '' : $icone)); ?>"></i> <txt id="titulo_form_modal<?php echo e((empty($idModal) ? '' :''.$idModal)); ?>"><?php echo e($titulo); ?></txt></h4>
                <button type="button" class="close" data-dismiss="modal">×</button>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <form method="POST" enctype="multipart/form-data" action="<?php echo e((empty($rota) ? '' : route($rota))); ?>" >
                        <?php echo csrf_field(); ?>

                        <input type="hidden" id="id_form_modal<?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>" name="id"/>

                        <?php $__currentLoopData = $campos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $controle): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <?php if($controle["tipo"] == 'hidden'): ?>

                                <?php echo $__env->make('partials._controles_form',['controle'=>$controle], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                            <?php elseif($controle["tipo"] == 'tabs'): ?>

                                <!-- lista de abas -->
                                <ul class="nav nav-tabs" id="<?php echo e($controle["id"]); ?>" role="tablist">

                                    <?php $__currentLoopData = $controle["abas"]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $aba): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="nav-item">
                                            <a id="tab_<?php echo e(Util::RemoveCaracter($aba)); ?><?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>"
                                               class="nav-link <?php echo e($loop->first ? 'active' : ''); ?>"
                                               data-toggle="tab"
                                               href="#content_tab_<?php echo e(Util::RemoveCaracter($aba)); ?><?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>"
                                               role="tab"
                                               aria-controls="content_tab_<?php echo e(Util::RemoveCaracter($aba)); ?><?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>"
                                               aria-selected="<?php echo e($loop->first ? 'true' : 'false'); ?>"><?php echo e($aba); ?></a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                </ul>

                                <!-- conteúdo -->
                                <div id="<?php echo e($controle["id"]); ?>_conteudo" class="tab-content pt-2 " style="overflow-y:auto;overflow-x:hidden; <?php echo e((!empty($controle["altura"]) ? ('height:'.$controle["altura"]  . ';max-height:'.$controle["altura"] ) : '')); ?>">


                                    <?php $__currentLoopData = $controle["conteudo"]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $conteudo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="tab-pane fade <?php echo e($loop->first ? 'show active' : ''); ?>"
                                             id="content_tab_<?php echo e(Util::RemoveCaracter($conteudo['aba'])); ?><?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>"
                                             role="tabpanel"
                                             aria-labelledby="tab_<?php echo e(Util::RemoveCaracter($conteudo['aba'])); ?><?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>">

                                            <?php $__currentLoopData = $conteudo["campos"]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $linha): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php echo $__env->make('partials._modal_form_row',['controle'=>$linha,'sem_padding'=>'false'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                </div>


                            <?php else: ?>

                                <?php echo $__env->make('partials._modal_form_row',['controle'=>$controle,'sem_padding'=>'false'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                            <?php endif; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        <?php if(empty($controles_salvar) || $controles_salvar == 'true'): ?>
                            <div class="modal-footer">
                                
                                <button id="btnFormModal<?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>" type="submit" class="btn btn-success" style="margin-right:10px;"><i class="fas fa-save"></i> Salvar</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fas fa-times-circle"></i> Fechar</button>
                            </div>

                        <?php elseif(empty($controles_editar) || $controles_editar == 'true'): ?>
                            <div class="modal-footer">
                                <button id="btnFormEditar<?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>" name='editar' value='editar' type="submit" class="btn btn-primary" style="margin-lefts:10px;"><i class="fas fa-lock"></i> Enviar para Reedição</button>
                                <button id="btnFormConcluir<?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>" name='concluir' value='concluir' type="submit" class="btn btn-success" style="margin-lefts:10px;"><i class="fas fa-lock"></i> Concluir Cadastro</button>
                                <button id="btnFormModal<?php echo e((empty($idModal) ? '' :'_'.$idModal)); ?>" type="submit" class="btn btn-success" style="margin-right:10px;"><i class="fas fa-save"></i> Salvar</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fas fa-times-circle"></i> Fechar</button>
                            </div>

                        <?php endif; ?>

                    </form>
                </div>
            </div>

            <?php if(!empty($controles_fechar) && $controles_fechar == 'true'): ?>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"  data-dismiss="modal">FECHAR</button>
                </div>
            <?php endif; ?>


        </div>
    </div>
</div>