<!-- File for Poup type=> image -->

<?php

use InstantPopup\Settings\class_instant_setting;

if (! defined('ABSPATH')) exit; // Exit if accessed directly

// Set global variable to indicate this is an image popup
$GLOBALS['instant_popup_builder_ipb_current_popup_type'] = 'image';

include_once plugin_dir_path(dirname(__FILE__)) . 'settings/class-instant-setting.php';
?>
<div class="intant_new_popup_type">
    <div class="instant_inner_wrapper">
        <div class="heading">
            <h1>POPUP TYPE: IMAGE</h1>
            <!-- <p class='preview_link'>
                <a href="#preview_popup" rel="modal:open" style="display:none;">Preview Popup <span></span></a>
            </p> -->
        </div>
        <form action="" method="post">
            <div class="instant_left_col">
                <div class="input_wrapper">
                    <input type="text" name="popup_title" id="popup_title" placeholder="Enter Your popup name">
                </div>
                <div class="input_wrapper">
                    <div class="label media_upload" id="ipb_media_upload_btn">
                        <i class="fa-solid fa-images"></i>
                        <label for="">Select from Media Library</label>
                    </div>
                    <input type="hidden" name="popu_image_url" id="popu_image_url" />
                    <img src="" id="ipb_img_front" style="display:none; max-width: 100%; height: auto; margin-top: 10px;" />
                    <div id="ipb_remove_image" style="display:none; margin-top: 10px;">
                        <button type="button" class="button" style="color: #dc3232;">
                            <i class="fa-solid fa-trash"></i> Remove Image
                        </button>
                    </div>
                    <input type="hidden" name="popup_temp_type" value="popup_image">
                </div>
            </div>
            <?php
            wp_nonce_field('instant_popup_nonce', '_wpnonce');

            ?>
            <div class="instant-right_col postbox">
                <div id="ipb_actions_wrapper">
                    <!-- <div id="delete-action">
                        <a class="submit delete deletion" href="#" style="display: inline;">Move to Trash</a>
                    </div> -->
                    <div id="ipb_pop_action">
                        <p class='preview_links'>
                            <a href="#" class="enhanced-preview-trigger"><i class="fa-solid fa-eye"></i> Preview<span></span></a>
                        </p>
                    </div>
                    <div id="ipb_pop_action">
                        <!-- <button name="instant_popup_builder_draft" id="ipb_action_draft">Save To Draft</button> -->
                        <button type="submit" name="instant_popup_builder_submit" value="Save Draft" class="ipb-save-draft">
                        <i class="fa-solid fa-save"></i> Save Draft
                    </button>
                    </div>
                    <div id="ipb_pop_action">
                        <button type="submit" name="instant_popup_builder_submit" value="Publish" class="ipb-publish">
                        <i class="fa-solid fa-paper-plane"></i> Publish
                    </button>
                    </div>
                </div>


                <!-- <div class="text_submit_btn">
                    <input class="ipb_submit" type="submit" value="Publish" id="text_popup" name="instant_popup_builder_submit">
                </div> -->
            </div>
            <div class="instant_popup_setting">
                <h3>Popup Setting</h3>
                <div class="tabs_list">
                    <ul>
                        <li class="general active" data-id="general">General</li>
                        <li class="design" data-id="design">Design</li>
                        <!-- <li class="advance" data-id="advance">Advanced</li> -->
                        <li class="condition" data-id="condition">Conditions</li>
                        <!-- <li class="integration" data-id="integration">Integration</li> -->
                    </ul>
                </div>
                <div class="tabs_content">
                    <div id="general" class="tab_content active">

                        <div class="ipb-settings-tabs">
                            <!-- <ul class="v_tabs_list">
                                <li class="display active" data-id="display">Display</li>
                                <li class="trigger" data-id="trigger">Trigger</li>
                                <li class="closing" data-id="closing">Closing</li>
                                <li class="limitation" data-id="limitation">Frequency</li>
                                <li class="position" data-id="position">Position</li>
                                <li class="action " data-id="action">Action</li>
                            </ul> -->
                            <div class="ipb-tab-content">

                                <div id="display" class="ipb-tab-pane active">
                                    <?php class_instant_setting::general_setting('display'); ?>
                                </div>
                                <div id="trigger" class="ipb-tab-pane">
                                    <?php class_instant_setting::general_setting('trigger'); ?>
                                </div>
                                <div id="closing" class="ipb-tab-pane">
                                    <?php class_instant_setting::general_setting('closing'); ?>
                                </div>
                                <div id="limitation" class="ipb-tab-pane">
                                    <?php class_instant_setting::general_setting('limit'); ?>
                                </div>
                                <div id="position" class="ipb-tab-pane">
                                    <?php class_instant_setting::general_setting('position'); ?>
                                </div>
                                <div id="action" class="ipb-tab-pane">
                                    <?php class_instant_setting::general_setting('action'); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="design" class="tab_content">

                        <div class="ipb-settings-tabs">
                            <!-- <ul class="v_tabs_list">
                                 <li class="theme active" data-id="theme">Theme</li>
                                <li class="background active" data-id="background">Background</li>
                                <li class="size" data-id="size">Size</li>
                                <li class="animation" data-id="animation">Animation</li>
                                <li class="sound" data-id="sound">Sound</li>
                            </ul> -->
                            <div class="ipb-tab-content">
                                <!-- </div> -->
                                <div id="background" class="ipb-tab-pane active">
                                    <?php class_instant_setting::design_setting('background'); ?>
                                </div>
                                <div id="size" class="ipb-tab-pane">
                                    <?php class_instant_setting::design_setting('size'); ?>
                                </div>
                                <div id="animation" class="ipb-tab-pane">
                                    <?php class_instant_setting::design_setting('animation'); ?>
                                </div>
                                <div id="sound" class="ipb-tab-pane">
                                    <?php class_instant_setting::design_setting('sound'); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php /*
                    <div id="advance" class="tab_content">
                        <div class="ipb-settings-tabs">
                            <ul class="v_tabs_list">
                                <li class="action active" data-id="action">Action</li>
                                <li class="sound" data-id="sound">Sound</li>
                            </ul>
                            <div class="ipb-tab-content">

                                <div id="action" class="ipb-tab-pane active">
                                    <?php class_instant_setting::advance_setting('action'); ?>
                                </div>
                                <div id="sound" class="ipb-tab-pane">
                                    <?php class_instant_setting::advance_setting('sound'); ?>
                                </div>
                            </div>
                        </div>
                    </div> */ ?>
                    <div id="condition" class="tab_content">
                        <div class="ipb-settings-tabs">
                            <!-- <ul class="v_tabs_list">
                                <li class="targeting active" data-id="targeting">Targeting</li>
                                <li class="location" data-id="location">Location</li>
                                <li class="scheduling" data-id="scheduling">Scheduling</li>
                            </ul> -->
                            <div class="ipb-tab-content">

                                <div id="targeting" class="ipb-tab-pane active">
                                    <?php class_instant_setting::condition_setting('targeting'); ?>
                                </div>
                                <div id="location" class="ipb-tab-pane">
                                    <?php class_instant_setting::condition_setting('location'); ?>
                                </div>
                                <div id="scheduling" class="ipb-tab-pane">
                                    <?php class_instant_setting::condition_setting('scheduling'); ?>
                                </div>
                                <div id="language_targeting" class="ipb-tab-pane">
                                    <?php class_instant_setting::condition_setting('language_targeting'); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>