<?php
    $data = $this->db_obj->get_data();

    $api_key = isset( $data['api_key'] ) && $data['api_key'] != '' ? esc_attr( $data['api_key'] ) : '';
    
    $settings_obj = new ChatGPT_Assistant_Settings_DB_Actions( $this->plugin_name , $this->settings_db_name );
    $options = ($settings_obj->get_setting('options') === false) ? array() : json_decode($settings_obj->get_setting('options'), true);

    $chatgpt_assistant_show_dashboard_chat = ( isset( $options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'show_dashboard_chat'] ) && $options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'show_dashboard_chat'] == 'off' ) ? false : true;
    $chatgpt_assistant_show_dashboard_chat_mobile = ( isset( $options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'show_dashboard_chat_mobile'] ) && $options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'show_dashboard_chat_mobile'] == 'off' ) ? false : true;
    if ($chatgpt_assistant_show_dashboard_chat || $chatgpt_assistant_show_dashboard_chat_mobile) {
        $check_openai_connection = ChatGPT_assistant_Data::makeRequest($api_key, 'GET', 'models');
    } 
    if(!empty($api_key)){
        $check_openai_connection_code = true; 
    } else{
        $check_openai_connection_code = false; 
    }  
    // General settings options start

        $general_options = (empty($this->general_settings_obj->get_all_data())) ? array() : $this->general_settings_obj->get_all_data();
                    
        $textarea_height = isset( $general_options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'textarea_height'] ) && intval($general_options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'textarea_height']) > 0 ? esc_attr($general_options[CHATGPT_ASSISTANT_OPTIONS_PREFIX.'textarea_height']) : 70;

    // General settings options end

    $models = array(
        'dall-e-2' => 'DALL·E 2',
        // 'dall-e-3' => 'DALL·E 3 (ChatGPT Plus) (PRO)',
    );

    $styles = array(
        "vivid"                      => __("Vivid (hyper-real and dramatic images)", "ays-chatgpt-assistant"),
        "natural"                    => __("Natural (natural, less hyper-real looking images)", "ays-chatgpt-assistant"),
        "surrealism"                 => __("Surrealism", "ays-chatgpt-assistant"),
        "abstract"                   => __("Abstract", "ays-chatgpt-assistant"),
        "abstract expressionism"     => __("Abstract Expressionism", "ays-chatgpt-assistant"),
        "action painting"            => __("Action Painting", "ays-chatgpt-assistant"),
        "art brut"                   => __("Art Brut", "ays-chatgpt-assistant"),
        "art deco"                   => __("Art Deco", "ays-chatgpt-assistant"),
        "art nouveau"                => __("Art Nouveau", "ays-chatgpt-assistant"),
        "baroque"                    => __("Baroque", "ays-chatgpt-assistant"),
        "byzantine"                  => __("Byzantine", "ays-chatgpt-assistant"),
        "classical"                  => __("Classical", "ays-chatgpt-assistant"),
        "color field"                => __("Color Field", "ays-chatgpt-assistant"),
        "conceptual"                 => __("Conceptual", "ays-chatgpt-assistant"),
        "cubism"                     => __("Cubism", "ays-chatgpt-assistant"),
        "dada"                       => __("Dada", "ays-chatgpt-assistant"),
        "expressionism"              => __("Expressionism", "ays-chatgpt-assistant"),
        "fauvism"                    => __("Fauvism", "ays-chatgpt-assistant"),
        "figurative"                 => __("Figurative", "ays-chatgpt-assistant"),
        "futurism"                   => __("Futurism", "ays-chatgpt-assistant"),
        "gothic"                     => __("Gothic", "ays-chatgpt-assistant"),
        "hard-edge painting"         => __("Hard-edge Painting", "ays-chatgpt-assistant"),
        "hyperrealism"               => __("Hyperrealism", "ays-chatgpt-assistant"),
        "impressionism"              => __("Impressionism", "ays-chatgpt-assistant"),
        "japonisme"                  => __("Japonisme", "ays-chatgpt-assistant"),
        "luminism"                   => __("Luminism", "ays-chatgpt-assistant"),
        "lyrical abstraction"        => __("Lyrical Abstraction", "ays-chatgpt-assistant"),
        "mannerism"                  => __("Mannerism", "ays-chatgpt-assistant"),
        "minimalism"                 => __("Minimalism", "ays-chatgpt-assistant"),
        "naive art"                  => __("Naive Art", "ays-chatgpt-assistant"),
        "new realism"                => __("New Realism", "ays-chatgpt-assistant"),
        "neo-expressionism"          => __("Neo-expressionism", "ays-chatgpt-assistant"),
        "neo-pop"                    => __("Neo-pop", "ays-chatgpt-assistant"),
        "op art"                     => __("Op Art", "ays-chatgpt-assistant"),
        "opus anglicanum"            => __("Opus Anglicanum", "ays-chatgpt-assistant"),
        "outsider art"               => __("Outsider Art", "ays-chatgpt-assistant"),
        "pop art"                    => __("Pop Art", "ays-chatgpt-assistant"),
        "photorealism"               => __("Photorealism", "ays-chatgpt-assistant"),
        "pointillism"                => __("Pointillism", "ays-chatgpt-assistant"),
        "post-impressionism"         => __("Post-Impressionism", "ays-chatgpt-assistant"),
        "realism"                    => __("Realism", "ays-chatgpt-assistant"),
        "renaissance"                => __("Renaissance", "ays-chatgpt-assistant"),
        "rococo"                     => __("Rococo", "ays-chatgpt-assistant"),
        "romanticism"                => __("Romanticism", "ays-chatgpt-assistant"),
        "street art"                 => __("Street Art", "ays-chatgpt-assistant"),
        "superflat"                  => __("Superflat", "ays-chatgpt-assistant"),
        "symbolism"                  => __("Symbolism", "ays-chatgpt-assistant"),
        "tenebrism"                  => __("Tenebrism", "ays-chatgpt-assistant"),
        "ukiyo-e"                    => __("Ukiyo-e", "ays-chatgpt-assistant"),
        "western art"                => __("Western Art", "ays-chatgpt-assistant"),
        "yba"                        => __("YBA", "ays-chatgpt-assistant"),
        "none"                       => __("None", "ays-chatgpt-assistant"),
    );    

    $artists = array(
        "None"                       => __("None", "ays-chatgpt-assistant"),
        "Albrecht Dürer"             => __("Albrecht Dürer", "ays-chatgpt-assistant"),
        "Alfred Sisley"              => __("Alfred Sisley", "ays-chatgpt-assistant"),
        "Amedeo Modigliani"          => __("Amedeo Modigliani", "ays-chatgpt-assistant"),
        "Andrea Mantegna"            => __("Andrea Mantegna", "ays-chatgpt-assistant"),
        "Andy Warhol"                => __("Andy Warhol", "ays-chatgpt-assistant"),
        "Camille Pissarro"           => __("Camille Pissarro", "ays-chatgpt-assistant"),
        "Caravaggio"                 => __("Caravaggio", "ays-chatgpt-assistant"),
        "Caspar David Friedrich"     => __("Caspar David Friedrich", "ays-chatgpt-assistant"),
        "Cézanne"                    => __("Cézanne", "ays-chatgpt-assistant"),
        "Claude Monet"               => __("Claude Monet", "ays-chatgpt-assistant"),
        "Diego Velázquez"            => __("Diego Velázquez", "ays-chatgpt-assistant"),
        "Eugène Delacroix"           => __("Eugène Delacroix", "ays-chatgpt-assistant"),
        "Frida Kahlo"                => __("Frida Kahlo", "ays-chatgpt-assistant"),
        "Gustav Klimt"               => __("Gustav Klimt", "ays-chatgpt-assistant"),
        "Henri de Toulouse-Lautrec"  => __("Henri de Toulouse-Lautrec", "ays-chatgpt-assistant"),
        "Henri Matisse"              => __("Henri Matisse", "ays-chatgpt-assistant"),
        "Jackson Pollock"            => __("Jackson Pollock", "ays-chatgpt-assistant"),
        "Jasper Johns"               => __("Jasper Johns", "ays-chatgpt-assistant"),
        "Joan Miró"                  => __("Joan Miró", "ays-chatgpt-assistant"),
        "John Singer Sargent"        => __("John Singer Sargent", "ays-chatgpt-assistant"),
        "Johannes Vermeer"           => __("Johannes Vermeer", "ays-chatgpt-assistant"),
        "Leonardo da Vinci"          => __("Leonardo da Vinci", "ays-chatgpt-assistant"),
        "M. C. Escher"               => __("M. C. Escher", "ays-chatgpt-assistant"),
        "Mary Cassatt"               => __("Mary Cassatt", "ays-chatgpt-assistant"),
        "Michelangelo"               => __("Michelangelo", "ays-chatgpt-assistant"),
        "Pablo Picasso"              => __("Pablo Picasso", "ays-chatgpt-assistant"),
        "Paul Cézanne"               => __("Paul Cézanne", "ays-chatgpt-assistant"),
        "Paul Gauguin"               => __("Paul Gauguin", "ays-chatgpt-assistant"),
        "Paul Klee"                  => __("Paul Klee", "ays-chatgpt-assistant"),
        "Piet Mondrian"              => __("Piet Mondrian", "ays-chatgpt-assistant"),
        "Pieter Bruegel the Elder"   => __("Pieter Bruegel the Elder", "ays-chatgpt-assistant"),
        "Pierre-Auguste Renoir"      => __("Pierre-Auguste Renoir", "ays-chatgpt-assistant"),
        "Raphael"                    => __("Raphael", "ays-chatgpt-assistant"),
        "Rembrandt"                  => __("Rembrandt", "ays-chatgpt-assistant"),
        "René Magritte"              => __("René Magritte", "ays-chatgpt-assistant"),
        "Salvador Dalí"              => __("Salvador Dalí", "ays-chatgpt-assistant"),
        "Sandro Botticelli"          => __("Sandro Botticelli", "ays-chatgpt-assistant"),
        "Theo van Gogh"              => __("Theo van Gogh", "ays-chatgpt-assistant"),
        "Titian"                     => __("Titian", "ays-chatgpt-assistant"),
        "Vassily Kandinsky"          => __("Vassily Kandinsky", "ays-chatgpt-assistant"),
        "Vincent van Gogh"           => __("Vincent van Gogh", "ays-chatgpt-assistant"),
        "Winslow Homer"              => __("Winslow Homer", "ays-chatgpt-assistant"),
    );    
    
    $lighting = array(
        "None"                => __("None", "ays-chatgpt-assistant"),
        "Ambient"             => __("Ambient", "ays-chatgpt-assistant"),
        "Artificial light"    => __("Artificial light", "ays-chatgpt-assistant"),
        "Backlight"           => __("Backlight", "ays-chatgpt-assistant"),
        "Black light"         => __("Black light", "ays-chatgpt-assistant"),
        "Candle light"        => __("Candle light", "ays-chatgpt-assistant"),
        "Chiaroscuro"         => __("Chiaroscuro", "ays-chatgpt-assistant"),
        "Cloudy"              => __("Cloudy", "ays-chatgpt-assistant"),
        "Continuous light"    => __("Continuous light", "ays-chatgpt-assistant"),
        "Contre-jour"         => __("Contre-jour", "ays-chatgpt-assistant"),
        "Direct light"        => __("Direct light", "ays-chatgpt-assistant"),
        "Direct sunlight"     => __("Direct sunlight", "ays-chatgpt-assistant"),
        "Diffused light"      => __("Diffused light", "ays-chatgpt-assistant"),
        "Firelight"           => __("Firelight", "ays-chatgpt-assistant"),
        "Flash"               => __("Flash", "ays-chatgpt-assistant"),
        "Flat light"          => __("Flat light", "ays-chatgpt-assistant"),
        "Fluorescent"         => __("Fluorescent", "ays-chatgpt-assistant"),
        "Fog"                 => __("Fog", "ays-chatgpt-assistant"),
        "Front light"         => __("Front light", "ays-chatgpt-assistant"),
        "Golden hour"         => __("Golden hour", "ays-chatgpt-assistant"),
        "Hard light"          => __("Hard light", "ays-chatgpt-assistant"),
        "Hazy sunlight"       => __("Hazy sunlight", "ays-chatgpt-assistant"),
        "High key"            => __("High key", "ays-chatgpt-assistant"),
        "Incandescent"        => __("Incandescent", "ays-chatgpt-assistant"),
        "Key light"           => __("Key light", "ays-chatgpt-assistant"),
        "LED"                 => __("LED", "ays-chatgpt-assistant"),
        "Low key"             => __("Low key", "ays-chatgpt-assistant"),
        "Moonlight"           => __("Moonlight", "ays-chatgpt-assistant"),
        "Natural light"       => __("Natural light", "ays-chatgpt-assistant"),
        "Neon"                => __("Neon", "ays-chatgpt-assistant"),
        "None"                => __("None", "ays-chatgpt-assistant"),
        "Open shade"          => __("Open shade", "ays-chatgpt-assistant"),
        "Overcast"            => __("Overcast", "ays-chatgpt-assistant"),
        "Paramount"           => __("Paramount", "ays-chatgpt-assistant"),
        "Party lights"        => __("Party lights", "ays-chatgpt-assistant"),
        "Photoflood"          => __("Photoflood", "ays-chatgpt-assistant"),
        "Quarter light"       => __("Quarter light", "ays-chatgpt-assistant"),
        "Reflected light"     => __("Reflected light", "ays-chatgpt-assistant"),
        "Shaded"              => __("Shaded", "ays-chatgpt-assistant"),
        "Shaded light"        => __("Shaded light", "ays-chatgpt-assistant"),
        "Silhouette"          => __("Silhouette", "ays-chatgpt-assistant"),
        "Soft light"          => __("Soft light", "ays-chatgpt-assistant"),
        "Softbox"             => __("Softbox", "ays-chatgpt-assistant"),
        "Split lighting"      => __("Split lighting", "ays-chatgpt-assistant"),
        "Stage lighting"      => __("Stage lighting", "ays-chatgpt-assistant"),
        "Studio light"        => __("Studio light", "ays-chatgpt-assistant"),
        "Sunburst"            => __("Sunburst", "ays-chatgpt-assistant"),
        "Tungsten"            => __("Tungsten", "ays-chatgpt-assistant"),
        "Umbrella lighting"   => __("Umbrella lighting", "ays-chatgpt-assistant"),
        "Underexposed"        => __("Underexposed", "ays-chatgpt-assistant"),
        "Venetian blinds"     => __("Venetian blinds", "ays-chatgpt-assistant"),
        "Warm light"          => __("Warm light", "ays-chatgpt-assistant"),
        "White balance"       => __("White balance", "ays-chatgpt-assistant"),
    );    

    $composition = array(
        "None"                   => __("None", "ays-chatgpt-assistant"),
        "Asymmetrical"           => __("Asymmetrical", "ays-chatgpt-assistant"),
        "Balance"                => __("Balance", "ays-chatgpt-assistant"),
        "Centered"               => __("Centered", "ays-chatgpt-assistant"),
        "Close-up"               => __("Close-up", "ays-chatgpt-assistant"),
        "Color blocking"         => __("Color blocking", "ays-chatgpt-assistant"),
        "Contrast"               => __("Contrast", "ays-chatgpt-assistant"),
        "Cropping"               => __("Cropping", "ays-chatgpt-assistant"),
        "Diagonal"               => __("Diagonal", "ays-chatgpt-assistant"),
        "Documentary"            => __("Documentary", "ays-chatgpt-assistant"),
        "Environmental Portrait" => __("Environmental Portrait", "ays-chatgpt-assistant"),
        "Fill the Frame"         => __("Fill the Frame", "ays-chatgpt-assistant"),
        "Framing"                => __("Framing", "ays-chatgpt-assistant"),
        "Golden Ratio"           => __("Golden Ratio", "ays-chatgpt-assistant"),
        "High Angle"             => __("High Angle", "ays-chatgpt-assistant"),
        "Leading Lines"          => __("Leading Lines", "ays-chatgpt-assistant"),
        "Long Exposure"          => __("Long Exposure", "ays-chatgpt-assistant"),
        "Low Angle"              => __("Low Angle", "ays-chatgpt-assistant"),
        "Macro"                  => __("Macro", "ays-chatgpt-assistant"),
        "Minimalism"             => __("Minimalism", "ays-chatgpt-assistant"),
        "Negative Space"         => __("Negative Space", "ays-chatgpt-assistant"),
        "None"                   => __("None", "ays-chatgpt-assistant"),
        "Panning"                => __("Panning", "ays-chatgpt-assistant"),
        "Patterns"               => __("Patterns", "ays-chatgpt-assistant"),
        "Photojournalism"        => __("Photojournalism", "ays-chatgpt-assistant"),
        "Point of View"          => __("Point of View", "ays-chatgpt-assistant"),
        "Portrait"               => __("Portrait", "ays-chatgpt-assistant"),
        "Reflections"            => __("Reflections", "ays-chatgpt-assistant"),
        "Rule of Thirds"         => __("Rule of Thirds", "ays-chatgpt-assistant"),
        "Saturation"             => __("Saturation", "ays-chatgpt-assistant"),
        "Scale"                  => __("Scale", "ays-chatgpt-assistant"),
        "Selective Focus"        => __("Selective Focus", "ays-chatgpt-assistant"),
        "Shallow Depth of Field" => __("Shallow Depth of Field", "ays-chatgpt-assistant"),
        "Silhouette"             => __("Silhouette", "ays-chatgpt-assistant"),
        "Simplicity"             => __("Simplicity", "ays-chatgpt-assistant"),
        "Snapshot"               => __("Snapshot", "ays-chatgpt-assistant"),
        "Street Photography"     => __("Street Photography", "ays-chatgpt-assistant"),
        "Symmetry"               => __("Symmetry", "ays-chatgpt-assistant"),
        "Telephoto"              => __("Telephoto", "ays-chatgpt-assistant"),
        "Texture"                => __("Texture", "ays-chatgpt-assistant"),
        "Tilt-Shift"             => __("Tilt-Shift", "ays-chatgpt-assistant"),
        "Time-lapse"             => __("Time-lapse", "ays-chatgpt-assistant"),
        "Tracking Shot"          => __("Tracking Shot", "ays-chatgpt-assistant"),
        "Travel"                 => __("Travel", "ays-chatgpt-assistant"),
        "Triptych"               => __("Triptych", "ays-chatgpt-assistant"),
        "Ultra-wide"             => __("Ultra-wide", "ays-chatgpt-assistant"),
        "Vanishing Point"        => __("Vanishing Point", "ays-chatgpt-assistant"),
        "Viewpoint"              => __("Viewpoint", "ays-chatgpt-assistant"),
        "Vintage"                => __("Vintage", "ays-chatgpt-assistant"),
        "Wide Angle"             => __("Wide Angle", "ays-chatgpt-assistant"),
        "Zoom Blur"              => __("Zoom Blur", "ays-chatgpt-assistant"),
        "Zoom In/Zoom Out"       => __("Zoom In/Zoom Out", "ays-chatgpt-assistant"),
    );    

    $color = array(
        "None"          => __("None", "ays-chatgpt-assistant"),
        "RGB"           => __("RGB", "ays-chatgpt-assistant"),
        "CMYK"          => __("CMYK", "ays-chatgpt-assistant"),
        "Grayscale"     => __("Grayscale", "ays-chatgpt-assistant"),
        "HEX"           => __("HEX", "ays-chatgpt-assistant"),
        "Pantone"       => __("Pantone", "ays-chatgpt-assistant"),
        "CMY"           => __("CMY", "ays-chatgpt-assistant"),
        "HSL"           => __("HSL", "ays-chatgpt-assistant"),
        "HSV"           => __("HSV", "ays-chatgpt-assistant"),
        "LAB"           => __("LAB", "ays-chatgpt-assistant"),
        "LCH"           => __("LCH", "ays-chatgpt-assistant"),
        "LUV"           => __("LUV", "ays-chatgpt-assistant"),
        "XYZ"           => __("XYZ", "ays-chatgpt-assistant"),
        "YUV"           => __("YUV", "ays-chatgpt-assistant"),
        "YIQ"           => __("YIQ", "ays-chatgpt-assistant"),
        "YCbCr"         => __("YCbCr", "ays-chatgpt-assistant"),
        "YCoCg"         => __("YCoCg", "ays-chatgpt-assistant"),
        "YCgCo"         => __("YCgCo", "ays-chatgpt-assistant")
    );

    $photography = array(
        "Portrait"          => __("Portrait", "ays-chatgpt-assistant"),
        "Landscape"         => __("Landscape", "ays-chatgpt-assistant"),
        "Abstract"          => __("Abstract", "ays-chatgpt-assistant"),
        "Action"            => __("Action", "ays-chatgpt-assistant"),
        "Aerial"            => __("Aerial", "ays-chatgpt-assistant"),
        "Agricultural"      => __("Agricultural", "ays-chatgpt-assistant"),
        "Animal"            => __("Animal", "ays-chatgpt-assistant"),
        "Architectural"     => __("Architectural", "ays-chatgpt-assistant"),
        "Astrophotography"  => __("Astrophotography", "ays-chatgpt-assistant"),
        "Bird photography"  => __("Bird photography", "ays-chatgpt-assistant"),
        "Black and white"   => __("Black and white", "ays-chatgpt-assistant"),
        "Candid"            => __("Candid", "ays-chatgpt-assistant"),
        "Cityscape"         => __("Cityscape", "ays-chatgpt-assistant"),
        "Close-up"          => __("Close-up", "ays-chatgpt-assistant"),
        "Commercial"        => __("Commercial", "ays-chatgpt-assistant"),
        "Conceptual"        => __("Conceptual", "ays-chatgpt-assistant"),
        "Corporate"         => __("Corporate", "ays-chatgpt-assistant"),
        "Documentary"       => __("Documentary", "ays-chatgpt-assistant"),
        "Event"             => __("Event", "ays-chatgpt-assistant"),
        "Family"            => __("Family", "ays-chatgpt-assistant"),
        "Fashion"           => __("Fashion", "ays-chatgpt-assistant"),
        "Fine art"          => __("Fine art", "ays-chatgpt-assistant"),
        "Food"              => __("Food", "ays-chatgpt-assistant"),
        "Food photography"  => __("Food photography", "ays-chatgpt-assistant"),
        "Glamour"           => __("Glamour", "ays-chatgpt-assistant"),
        "Industrial"        => __("Industrial", "ays-chatgpt-assistant"),
        "Lifestyle"         => __("Lifestyle", "ays-chatgpt-assistant"),
        "Macro"             => __("Macro", "ays-chatgpt-assistant"),
        "Nature"            => __("Nature", "ays-chatgpt-assistant"),
        "Night"             => __("Night", "ays-chatgpt-assistant"),
        "Product"           => __("Product", "ays-chatgpt-assistant"),
        "Sports"            => __("Sports", "ays-chatgpt-assistant"),
        "Street"            => __("Street", "ays-chatgpt-assistant"),
        "Travel"            => __("Travel", "ays-chatgpt-assistant"),
        "Underwater"        => __("Underwater", "ays-chatgpt-assistant"),
        "Wedding"           => __("Wedding", "ays-chatgpt-assistant"),
        "Wildlife"          => __("Wildlife", "ays-chatgpt-assistant"),
        "None"              => __("None", "ays-chatgpt-assistant")
    );    
    
    $resolutions = array(
        "4K (3840x2160)"    => "4K (3840x2160)",
        "1080p (1920x1080)" => "1080p (1920x1080)",
        "720p (1280x720)"   => "720p (1280x720)",
        "480p (854x480)"    => "480p (854x480)",
        "2K (2560x1440)"    => "2K (2560x1440)",
        "1080i (1920x1080)" => "1080i (1920x1080)",
        "720i (1280x720)"   => "720i (1280x720)",
        "None"              => "None"
    );

    $sizes = array(
        '1024x1024' => '1024x1024 (Both)',
        '256x256'   => '256x256 (DALL·E 2)',
        '512x512'   => '512x512 (DALL·E 2)',
        // '1792x1024' => '1792x1024 (DALL·E 3) (PRO)',
        // '1024x1792' => '1024x1792 (DALL·E 3) (PRO)',
    );
    
?>