<div class="tab-pane fade " id="Sources" role="tabpanel" aria-labelledby="Sources-tab">
    <div class="container">
        <div class="row">
            <div class="col-lg-9">
                <div class="bda-section-padding-bot">
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-border-bottom bda-pb-30">
                        <div class="row">
                            <div class="col-md-6">
                                <h4 class="bda-fs-24 bda-mb-10 title-light"><?php echo e(__("Webpage Url")); ?></h4>
                                <p><?php echo e(__("Add websites, which crawl all links starting with the URL, or individual pages.")); ?></p>
                            </div>
                        </div>
                    </div>
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-pt-30 ">
                        <div class="d-flex bda-gab-30">
                            <input type="text" class="bda-from-control" placeholder="<?php echo e(__("Url")); ?>"
                                   id="webUrlInputField">
                            <button type="button" class="bda-btu-theme flex-shrink-0" id="webUrlAddButton">
                                + <?php echo e(__("Add")); ?></button>
                        </div>
                    </div>
                </div>
                <div
                    class="bda-section-padding-bot bda-mt-30 <?php echo e(( isset($chatbotData->sourceUrls) && count($chatbotData->sourceUrls)) != 0?'':'d-none'); ?>"
                    id="urlListSection">
                    <ul class="bda-mt-30" id="urlList">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(isset($chatbotData->sourceUrls) && count($chatbotData->sourceUrls) != 0 ): ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $chatbotData->sourceUrls; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$urlData): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li class="d-flex gap-3 align-items-center  bda-mb-20 url-delete-section single-url-box">
                                    <input type="hidden" value="<?php echo e($urlData->length); ?>"
                                           class="count-text source-url-length" name="source_url[<?php echo e($key); ?>][length]">
                                    <button type="button" class="bda-delete-btu-acton url-delete">
                                        <img src="<?php echo e(asset('assets/images/icon/Delete.svg')); ?>" alt="">
                                    </button>
                                    <span><?php echo e($urlData->url); ?></span>
                                    <input type="hidden" value="<?php echo e($urlData->url); ?>" name="source_url[<?php echo e($key); ?>][url]">
                                </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </ul>
                </div>

                <div class="bda-section-padding-bot bda-mt-30">
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-border-bottom bda-pt-30 bda-pb-30">
                        <h4 class="bda-fs-24 bda-mb-10 title-light"><?php echo e(__("Add PDF")); ?></h4>
                        <p><?php echo e(__("When uploading a PDF file, make sure the text can be highlighted.")); ?></p>
                    </div>
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-pt-30">
                        <div
                            class="bda-from-box align-items-center d-flex justify-content-between gap-3 bda-from-control">
                            <div
                                class="file-list bd-file-list-show-box mt-0 placeholder-color file-name source-pdf-section">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(isset($chatbotData->sourcePdf) && count($chatbotData->sourcePdf) != 0): ?>
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $chatbotData->sourcePdf; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pdfItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="bd-file-item-show">
                                            <p><?php echo e($pdfItem->file_name); ?></p>
                                            <input type="hidden" value="<?php echo e($pdfItem->length); ?>" class="pdfSourceLength">
                                            <div class="bd-close-btu pdf-source-remove">×</div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                <?php else: ?>
                                    <?php echo e(__("Choose file")); ?>

                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                            <label for="file-input-2" class="bda-file-upload source-pdf-icon">
                                <i class="fa fa-spinner text-white fa-spin d-none"></i>
                                <img src="<?php echo e(asset("assets/images/icon/pdf.svg")); ?>" alt="pdf-source-icon">
                                <input type="file" name="source_pdf" id="file-input-2" class="file-input d-none"
                                       accept=".pdf">
                            </label>
                        </div>
                    </div>
                </div>
                <!-- section -->
                <div class="bda-section-padding-bot bda-mt-30">
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-border-bottom bda-pt-30 bda-pb-30">
                        <h4 class="bda-fs-24 bda-mb-10 title-light"><?php echo e(__("Add Content")); ?></h4>
                        <p><?php echo e(__("Write something .")); ?></p>
                    </div>
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-pt-30">
                        <textarea name="source_content" placeholder="<?php echo e(__("Add text here")); ?>"
                                  class="bda-from-control bda-height-200"
                                  id="sourceContent"><?php echo e(isset($chatbotData->sourceSummary) ?$chatbotData->sourceSummary->content:''); ?></textarea>
                    </div>
                </div>
                <!-- section -->
                <div class="bda-section-padding-bot bda-mt-30">
                    <!-- single sub section -->
                    <div class="bda-sub-section-bot bda-border-bottom bda-pt-30 bda-pb-30">
                        <div class="row">
                            <div class="col-md-6">
                                <h4 class="bda-fs-24 bda-mb-10 title-light"><?php echo e(__("Add Q&A")); ?></h4>
                                <p><?php echo e(__("Teach your chatbot specific questions and answers.")); ?></p>
                            </div>
                            <div class="col-md-6 mt-4 mt-md-0">
                                <div class="text-end">
                                    <button type="button" class="bda-btu-theme" id="sourceQuestionAddButton">
                                        + <?php echo e(__("Add")); ?></button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="qa-sections-container">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(isset($chatbotData->sourceQA) && count($chatbotData->sourceQA) != 0): ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $chatbotData->sourceQA; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$qaItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="single-qa-box">
                                    <div class="bda-sub-section-bot bda-pt-30">
                                        <div class="d-flex justify-content-between gap-2 flex-wrap">
                                            <label for="Questions" class="bda-text-label"><?php echo e(__("Questions")); ?></label>
                                            <button
                                                class="list-delete-btn mb-3 px-1 qa-section-delete"><?php echo e(__("Delete")); ?></button>
                                        </div>
                                        <input type="text" class="bda-from-control qa-text-count"
                                               placeholder="<?php echo e(__("Enter your question")); ?>"
                                               name="qas_list[<?php echo e($key); ?>][question]" value="<?php echo e($qaItem->question); ?>">
                                    </div>
                                    <div class="bda-sub-section-bot bda-pt-30">
                                        <label for="Answer" class="bda-text-label"><?php echo e(__("Answer")); ?></label>
                                        <textarea name="qas_list[<?php echo e($key); ?>][answer]"
                                                  placeholder="<?php echo e(__("Add texts here")); ?>"
                                                  class="bda-from-control bda-height-200 qa-text-count"><?php echo e($qaItem->answer); ?></textarea>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <?php else: ?>
                            <div class="single-qa-box">
                                <div class="bda-sub-section-bot bda-pt-30">
                                    <div class="d-flex justify-content-between gap-2 flex-wrap">
                                        <label for="Questions" class="bda-text-label"><?php echo e(__("Questions")); ?></label>
                                        <button
                                            class="list-delete-btn mb-3 px-1 qa-section-delete"><?php echo e(__("Delete")); ?></button>
                                    </div>
                                    <input type="text" class="bda-from-control qa-text-count qas-list-question"
                                           placeholder="<?php echo e(__("Enter your question")); ?>" name="qas_list[0][question]">
                                </div>
                                <div class="bda-sub-section-bot bda-pt-30">
                                    <label for="Answer" class="bda-text-label"><?php echo e(__("Answer")); ?></label>
                                    <textarea name="qas_list[0][answer]" placeholder="<?php echo e(__("Add texts here")); ?>"
                                              class="bda-from-control bda-height-200 qa-text-count qas-list-answer"></textarea>
                                </div>
                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                    </div>
                </div>
            </div>
            <div class="col-lg-3 bda-position-sticky">
                <div class="bda-section-padding-bot">
                    <div class="d-flex justify-content-between gap-2 flex-wrap bda-border-bottom  bda-mb-20">
                        <h6 class="bda-fs-16 bda-fw-500 bda-mb-10 title-light"><?php echo e(__("Source")); ?></h6>
                        <P><?php echo e(__("characters")); ?>: <span
                                id="totalSourceCount"><?php echo e(!is_null($source)?$source['totalChar']:0); ?></span> / <span
                                id="sourceLimit"><?php echo e($character_limit); ?></span>
                        </P>
                    </div>
                    <p class="bda-mb-10"><span
                            id="webUrlCountShow"><?php echo e(!is_null($source)?$source['url_count']:0); ?></span> <?php echo e(__("Web URL")); ?> (<span
                            id="webUrlSourceCountShow"><?php echo e(!is_null($source)?$source['url_length']:0); ?></span> <?php echo e(__("characters")); ?>

                        )</p>
                    <p class="bda-mb-10"><span
                            id="pdfUrlCountShow"><?php echo e(!is_null($source)?$source['pdf_count']:0); ?></span> <?php echo e(__("PDF URL")); ?> (<span
                            id="pdfFileSourceCountShow"><?php echo e(!is_null($source)?$source['pdf_length']:0); ?></span> <?php echo e(__("characters")); ?>

                        )</p>
                    <p class="bda-mb-10"><span
                            id="contentCountShow"><?php echo e(!is_null($source)?$source['summary_count']:0); ?></span> <?php echo e(__("Content URL")); ?>

                        (<span
                            id="contentSourceCountShow"><?php echo e(!is_null($source)?$source['summary_length']:0); ?></span> <?php echo e(__("characters")); ?>

                        )</p>
                    <p class="bda-mb-10"><span
                            id="qaCountShow"><?php echo e(!is_null($source)?$source['qa_count']:0); ?></span> <?php echo e(__("QA")); ?> (<span
                            id="qaSourceCountShow"><?php echo e(!is_null($source)?$source['qa_length']:0); ?></span> <?php echo e(__("characters")); ?>

                        )</p>
                    <button type="button" class="bda-btu-theme w-100 py-2 bda-mt-10 training-chatbot-button"
                            data-total-character="<?php echo e(!is_null($source)?$source['totalChar']:0); ?>"><?php echo e(__("Train Chatbot")); ?></button>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" value="<?php echo e(route('user.chatbot.source.count')); ?>" id="sourceCountRoute">
<input type="hidden" value="<?php echo e(route('user.chatbot.source.pdf.count')); ?>" id="pdfSourceCountRoute">
<input type="hidden" value="<?php echo e(route('user.chatbot.train-chatbot')); ?>" id="chatbotTrain">
<?php /**PATH /home/www/voizur.bdcoder.com/resources/views/user/chatbot/source.blade.php ENDPATH**/ ?>