<?php

/* extension/module/facebook_business.twig */
class __TwigTemplate_d4e1673863f6954569689423d4a20dff52220ae29a7dd17595985fa5a7076d67 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<!-- Copyright (c) Facebook, Inc. and its affiliates. -->
<!-- All rights reserved. -->

<!-- This source code is licensed under the license found in the -->
<!-- LICENSE file in the root directory of this source tree. -->
";
        // line 6
        echo (isset($context["header"]) ? $context["header"] : null);
        echo (isset($context["column_left"]) ? $context["column_left"] : null);
        echo "
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"pull-right\">
        <button type=\"submit\" form=\"form-facebook-business\" data-toggle=\"tooltip\" title=\"";
        // line 11
        echo (isset($context["button_save"]) ? $context["button_save"] : null);
        echo "\" class=\"btn btn-primary\"><i class=\"fa fa-save\"></i></button>
        <a href=\"";
        // line 12
        echo (isset($context["cancel"]) ? $context["cancel"] : null);
        echo "\" data-toggle=\"tooltip\" title=\"";
        echo (isset($context["button_cancel"]) ? $context["button_cancel"] : null);
        echo "\" class=\"btn btn-default\"><i class=\"fa fa-reply\"></i></a></div>
      <h1>";
        // line 13
        echo (isset($context["heading_title"]) ? $context["heading_title"] : null);
        echo "</h1>
      <ul class=\"breadcrumb\">
        ";
        // line 15
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["breadcrumbs"]) ? $context["breadcrumbs"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["breadcrumb"]) {
            // line 16
            echo "        <li><a href=\"";
            echo $this->getAttribute($context["breadcrumb"], "href", array());
            echo "\">";
            echo $this->getAttribute($context["breadcrumb"], "text", array());
            echo "</a></li>
        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['breadcrumb'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 18
        echo "      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    ";
        // line 22
        if ((isset($context["error_warning"]) ? $context["error_warning"] : null)) {
            // line 23
            echo "    <div class=\"alert alert-danger\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo (isset($context["error_warning"]) ? $context["error_warning"] : null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 27
        echo "    ";
        if ((isset($context["error_maintenance_mode"]) ? $context["error_maintenance_mode"] : null)) {
            // line 28
            echo "    <div class=\"alert alert-danger\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo (isset($context["error_maintenance_mode"]) ? $context["error_maintenance_mode"] : null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 32
        echo "    <div class=\"panel panel-default\">
      <div class=\"panel-heading\">
        <h3 class=\"panel-title\"><i class=\"fa fa-pencil\"></i> ";
        // line 34
        echo (isset($context["text_edit"]) ? $context["text_edit"] : null);
        echo "</h3>
      </div>
      <div class=\"panel-body\">
        <form action=\"";
        // line 37
        echo (isset($context["action"]) ? $context["action"] : null);
        echo "\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-facebook-business\" class=\"form-horizontal\">
          <ul class=\"nav nav-tabs\">
            <li class=\"active\"><a href=\"#tab-connection\" data-toggle=\"tab\">";
        // line 39
        echo (isset($context["tab_connection"]) ? $context["tab_connection"] : null);
        echo "</a></li>
            <li><a href=\"#tab-settings\" data-toggle=\"tab\">";
        // line 40
        echo (isset($context["tab_settings"]) ? $context["tab_settings"] : null);
        echo "</a></li>
          </ul>
          <div class=\"tab-content\">
            <div class=\"tab-pane active\" id=\"tab-connection\">
              <div id=\"facebook-info\">
                <img src=\"view/image/facebook_business/f_logo.png\" alt=\"Facebook\" title=\"Facebook\" width=\"60px\" class=\"img-responsive\" /><br />
                <h3>";
        // line 46
        echo (isset($context["text_heading"]) ? $context["text_heading"] : null);
        echo "</h3>
                <p><i class=\"fa fa-puzzle-piece\"></i> ";
        // line 47
        echo (isset($context["text_info_1"]) ? $context["text_info_1"] : null);
        echo "</p>
                <p><i class=\"fa fa-pie-chart\"></i> ";
        // line 48
        echo (isset($context["text_info_2"]) ? $context["text_info_2"] : null);
        echo "</p>
                <p><i class=\"fa fa-cart-plus\"></i> ";
        // line 49
        echo (isset($context["text_info_3"]) ? $context["text_info_3"] : null);
        echo "</p>
              </div>
              <iframe id=\"fbIframe\" src=\"";
        // line 51
        echo (isset($context["opencart_iframe_url"]) ? $context["opencart_iframe_url"] : null);
        echo "\" width=\"100%\" height=\"150\" frameBorder=\"0\"></iframe>
              <div class=\"text-left\"><p><small>";
        // line 52
        echo (isset($context["text_plugin_version"]) ? $context["text_plugin_version"] : null);
        echo "</small></p></div>
            </div>
            <div class=\"tab-pane\" id=\"tab-settings\">
              <div class=\"form-group\">
                <label class=\"col-sm-2 control-label\" for=\"input-cookie-bar\">";
        // line 56
        echo (isset($context["entry_cookie_bar"]) ? $context["entry_cookie_bar"] : null);
        echo "</label>
                <div class=\"col-sm-10\">
                  <select name=\"module_facebook_business_cookie_bar_status\" id=\"input-cookie-bar\" class=\"form-control\">
                    ";
        // line 59
        if ((isset($context["module_facebook_business_cookie_bar_status"]) ? $context["module_facebook_business_cookie_bar_status"] : null)) {
            // line 60
            echo "                    <option value=\"1\" selected=\"selected\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
                    <option value=\"0\">";
            // line 61
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
                    ";
        } else {
            // line 63
            echo "                    <option value=\"1\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
                    <option value=\"0\" selected=\"selected\">";
            // line 64
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
                    ";
        }
        // line 66
        echo "                  </select>
                </div>
              </div>
              <div class=\"form-group\">
                <label class=\"col-sm-2 control-label\" for=\"input-sync-specials\"><span data-toggle=\"tooltip\" data-container=\"#tab-settings\" title=\"";
        // line 70
        echo (isset($context["help_sync_specials"]) ? $context["help_sync_specials"] : null);
        echo "\">";
        echo (isset($context["entry_sync_specials"]) ? $context["entry_sync_specials"] : null);
        echo "</span></label>
                <div class=\"col-sm-10\">
                  <select name=\"module_facebook_business_sync_specials_status\" id=\"input-sync-specials\" class=\"form-control\">
                    ";
        // line 73
        if ((isset($context["module_facebook_business_sync_specials_status"]) ? $context["module_facebook_business_sync_specials_status"] : null)) {
            // line 74
            echo "                    <option value=\"1\" selected=\"selected\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
                    <option value=\"0\">";
            // line 75
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
                    ";
        } else {
            // line 77
            echo "                    <option value=\"1\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
                    <option value=\"0\" selected=\"selected\">";
            // line 78
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
                    ";
        }
        // line 80
        echo "                  </select>
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
";
        // line 90
        echo (isset($context["footer"]) ? $context["footer"] : null);
        echo "
<style>
#facebook-info h3 {
    padding-top: 10px;
    padding-bottom: 10px;
    font-weight: 700;
}
#facebook-info p {
    font-size: 16px;
}
</style>
<script type=\"text/javascript\">
window.fbAsyncInit = function() {
    // FB JavaScript SDK configuration and setup
    FB.init({
        appId      : '";
        // line 105
        echo (isset($context["facebook_app_id"]) ? $context["facebook_app_id"] : null);
        echo "', // FB App ID
        cookie     : true,  // enable cookies to allow the server to access the session
        xfbml      : true,  // parse social plugins on this page
        version    : 'v10.0' // uses graph api version v10.0
    });
};

// Load the JavaScript SDK asynchronously
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = \"https://connect.facebook.net/en_US/sdk.js\";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

(function() {
  window.facebookAdsToolboxConfig = {
    token_string: \"";
        // line 123
        echo (isset($context["user_token"]) ? $context["user_token"] : null);
        echo "\",
    error_message: \"\"
  };
  var eventMethod = window.addEventListener ? \"addEventListener\" : \"attachEvent\";
  var messageEvent = eventMethod === \"attachEvent\" ? \"onmessage\" : \"message\";
  window.addEventListener(messageEvent, receiveMessage);
})();

function receiveMessage(e) {
  return new Promise(function(resolve, reject) {
    if(e.origin === \"";
        // line 133
        echo (isset($context["opencart_server_base_url"]) ? $context["opencart_server_base_url"] : null);
        echo "\" && e.data) {
      var message = JSON.parse(e.data);
      if(!message.success && message.error_message) {
        reject(new Error(message.error_message));
      } else if(message.installed) {
        // installed
        if(!message.pixel_id || !message.profiles || !message.profiles[0]) {
          var messageStr = JSON.stringify(message);
          reject(new Error(`An error occured when creating Facebook Business Extension setup. \${messageStr}`));
        } else {
          var settings = {
            facebook_pixel_id: message.pixel_id,
            facebook_page_id: message.profiles[0],
            facebook_fbe_v2_installed: message.installed,
            facebook_system_user_access_token: message.system_user_access_token,
            facebook_jssdk_version: 'v10.0',
            facebook_messenger_activated: false
          };
          resolve(settings);
        }
      } else if(message.updated) {
        // launch management view and updated configs
        var data = message.data;
        var settings = {
          updated: true,
          facebook_messenger_activated: data.messenger_chat.enabled,
          facebook_customization_locale: data.messenger_chat.default_locale
        };
        resolve(settings);
      } else {
        // uninstalled
        resolve();
      }
    }
  })
  .then(result => handleMessageReceived(result))
  .catch(error => logErrorMessage(error));
}

function handleMessageReceived(value) {
    if (!value) {
        return deleteSettings()
          .then(result => reloadCurrentPage(result));
    } else if (value.updated) {
        // management view
        return updateFacebookBusinessExtensionSettings(value);
    } else {
        // setup
        return updateFacebookBusinessExtensionSettings(value)
          .then(result => reloadCurrentPage(result));
    }
}

function updateFacebookBusinessExtensionSettings(data) {
    return new Promise(function(resolve, reject) {
        \$.ajax({
            url: \"index.php?route=extension/module/facebook_business/updateSettings&user_token=\" + window.facebookAdsToolboxConfig.token_string,
            type: \"post\",
            data: data,
            dataType: \"json\",
            success: function(json) {
                if(!json || !json.success) {
                    reject(new Error(\"An error occured when updating Facebook Business Extension settings.\"));
                } else {
                    resolve(\"\");
                }
            },
            error: function(xhr, ajaxOptions, thrownError) {
                reject(new Error(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText));
            }
        });
    });
}

function deleteSettings() {
    return new Promise(function(resolve, reject) {
        \$.ajax({
          url: 'index.php?route=extension/module/facebook_business/deleteSettings&user_token=' + window.facebookAdsToolboxConfig.token_string,
          type: 'post',
          success: function(json) {
            if(!json || !json.success) {
              reject(new Error(\"An error occured when deleting Facebook Business Extension settings.\"));
            } else {
              resolve(\"Your FBE settings are deleted.\");
            }
          },
          error: function(xhr, ajaxOptions, thrownError) {
            reject(new Error(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText));
          }
        });
    });
};

function logErrorMessage(error) {
    window.facebookAdsToolboxConfig.error_message = error.message;
    alert(window.facebookAdsToolboxConfig.error_message);
}

function reloadCurrentPage(result) {
    if (result) {
        alert(result);
    }
    
    location.reload();
}
</script>";
    }

    public function getTemplateName()
    {
        return "extension/module/facebook_business.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  276 => 133,  263 => 123,  242 => 105,  224 => 90,  212 => 80,  207 => 78,  202 => 77,  197 => 75,  192 => 74,  190 => 73,  182 => 70,  176 => 66,  171 => 64,  166 => 63,  161 => 61,  156 => 60,  154 => 59,  148 => 56,  141 => 52,  137 => 51,  132 => 49,  128 => 48,  124 => 47,  120 => 46,  111 => 40,  107 => 39,  102 => 37,  96 => 34,  92 => 32,  84 => 28,  81 => 27,  73 => 23,  71 => 22,  65 => 18,  54 => 16,  50 => 15,  45 => 13,  39 => 12,  35 => 11,  26 => 6,  19 => 1,);
    }
}
/* <!-- Copyright (c) Facebook, Inc. and its affiliates. -->*/
/* <!-- All rights reserved. -->*/
/* */
/* <!-- This source code is licensed under the license found in the -->*/
/* <!-- LICENSE file in the root directory of this source tree. -->*/
/* {{ header }}{{ column_left }}*/
/* <div id="content">*/
/*   <div class="page-header">*/
/*     <div class="container-fluid">*/
/*       <div class="pull-right">*/
/*         <button type="submit" form="form-facebook-business" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>*/
/*         <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>*/
/*       <h1>{{ heading_title }}</h1>*/
/*       <ul class="breadcrumb">*/
/*         {% for breadcrumb in breadcrumbs %}*/
/*         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>*/
/*         {% endfor %}*/
/*       </ul>*/
/*     </div>*/
/*   </div>*/
/*   <div class="container-fluid">*/
/*     {% if error_warning %}*/
/*     <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}*/
/*       <button type="button" class="close" data-dismiss="alert">&times;</button>*/
/*     </div>*/
/*     {% endif %}*/
/*     {% if error_maintenance_mode %}*/
/*     <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_maintenance_mode }}*/
/*       <button type="button" class="close" data-dismiss="alert">&times;</button>*/
/*     </div>*/
/*     {% endif %}*/
/*     <div class="panel panel-default">*/
/*       <div class="panel-heading">*/
/*         <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>*/
/*       </div>*/
/*       <div class="panel-body">*/
/*         <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-facebook-business" class="form-horizontal">*/
/*           <ul class="nav nav-tabs">*/
/*             <li class="active"><a href="#tab-connection" data-toggle="tab">{{ tab_connection }}</a></li>*/
/*             <li><a href="#tab-settings" data-toggle="tab">{{ tab_settings }}</a></li>*/
/*           </ul>*/
/*           <div class="tab-content">*/
/*             <div class="tab-pane active" id="tab-connection">*/
/*               <div id="facebook-info">*/
/*                 <img src="view/image/facebook_business/f_logo.png" alt="Facebook" title="Facebook" width="60px" class="img-responsive" /><br />*/
/*                 <h3>{{ text_heading }}</h3>*/
/*                 <p><i class="fa fa-puzzle-piece"></i> {{ text_info_1 }}</p>*/
/*                 <p><i class="fa fa-pie-chart"></i> {{ text_info_2 }}</p>*/
/*                 <p><i class="fa fa-cart-plus"></i> {{ text_info_3 }}</p>*/
/*               </div>*/
/*               <iframe id="fbIframe" src="{{ opencart_iframe_url }}" width="100%" height="150" frameBorder="0"></iframe>*/
/*               <div class="text-left"><p><small>{{ text_plugin_version }}</small></p></div>*/
/*             </div>*/
/*             <div class="tab-pane" id="tab-settings">*/
/*               <div class="form-group">*/
/*                 <label class="col-sm-2 control-label" for="input-cookie-bar">{{ entry_cookie_bar }}</label>*/
/*                 <div class="col-sm-10">*/
/*                   <select name="module_facebook_business_cookie_bar_status" id="input-cookie-bar" class="form-control">*/
/*                     {% if module_facebook_business_cookie_bar_status %}*/
/*                     <option value="1" selected="selected">{{ text_enabled }}</option>*/
/*                     <option value="0">{{ text_disabled }}</option>*/
/*                     {% else %}*/
/*                     <option value="1">{{ text_enabled }}</option>*/
/*                     <option value="0" selected="selected">{{ text_disabled }}</option>*/
/*                     {% endif %}*/
/*                   </select>*/
/*                 </div>*/
/*               </div>*/
/*               <div class="form-group">*/
/*                 <label class="col-sm-2 control-label" for="input-sync-specials"><span data-toggle="tooltip" data-container="#tab-settings" title="{{ help_sync_specials }}">{{ entry_sync_specials }}</span></label>*/
/*                 <div class="col-sm-10">*/
/*                   <select name="module_facebook_business_sync_specials_status" id="input-sync-specials" class="form-control">*/
/*                     {% if module_facebook_business_sync_specials_status %}*/
/*                     <option value="1" selected="selected">{{ text_enabled }}</option>*/
/*                     <option value="0">{{ text_disabled }}</option>*/
/*                     {% else %}*/
/*                     <option value="1">{{ text_enabled }}</option>*/
/*                     <option value="0" selected="selected">{{ text_disabled }}</option>*/
/*                     {% endif %}*/
/*                   </select>*/
/*                 </div>*/
/*               </div>*/
/*             </div>*/
/*           </div>*/
/*         </form>*/
/*       </div>*/
/*     </div>*/
/*   </div>*/
/* </div>*/
/* {{ footer }}*/
/* <style>*/
/* #facebook-info h3 {*/
/*     padding-top: 10px;*/
/*     padding-bottom: 10px;*/
/*     font-weight: 700;*/
/* }*/
/* #facebook-info p {*/
/*     font-size: 16px;*/
/* }*/
/* </style>*/
/* <script type="text/javascript">*/
/* window.fbAsyncInit = function() {*/
/*     // FB JavaScript SDK configuration and setup*/
/*     FB.init({*/
/*         appId      : '{{ facebook_app_id }}', // FB App ID*/
/*         cookie     : true,  // enable cookies to allow the server to access the session*/
/*         xfbml      : true,  // parse social plugins on this page*/
/*         version    : 'v10.0' // uses graph api version v10.0*/
/*     });*/
/* };*/
/* */
/* // Load the JavaScript SDK asynchronously*/
/* (function(d, s, id) {*/
/*     var js, fjs = d.getElementsByTagName(s)[0];*/
/*     if (d.getElementById(id)) return;*/
/*     js = d.createElement(s); js.id = id;*/
/*     js.src = "https://connect.facebook.net/en_US/sdk.js";*/
/*     fjs.parentNode.insertBefore(js, fjs);*/
/* }(document, 'script', 'facebook-jssdk'));*/
/* */
/* (function() {*/
/*   window.facebookAdsToolboxConfig = {*/
/*     token_string: "{{ user_token }}",*/
/*     error_message: ""*/
/*   };*/
/*   var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";*/
/*   var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";*/
/*   window.addEventListener(messageEvent, receiveMessage);*/
/* })();*/
/* */
/* function receiveMessage(e) {*/
/*   return new Promise(function(resolve, reject) {*/
/*     if(e.origin === "{{ opencart_server_base_url }}" && e.data) {*/
/*       var message = JSON.parse(e.data);*/
/*       if(!message.success && message.error_message) {*/
/*         reject(new Error(message.error_message));*/
/*       } else if(message.installed) {*/
/*         // installed*/
/*         if(!message.pixel_id || !message.profiles || !message.profiles[0]) {*/
/*           var messageStr = JSON.stringify(message);*/
/*           reject(new Error(`An error occured when creating Facebook Business Extension setup. ${messageStr}`));*/
/*         } else {*/
/*           var settings = {*/
/*             facebook_pixel_id: message.pixel_id,*/
/*             facebook_page_id: message.profiles[0],*/
/*             facebook_fbe_v2_installed: message.installed,*/
/*             facebook_system_user_access_token: message.system_user_access_token,*/
/*             facebook_jssdk_version: 'v10.0',*/
/*             facebook_messenger_activated: false*/
/*           };*/
/*           resolve(settings);*/
/*         }*/
/*       } else if(message.updated) {*/
/*         // launch management view and updated configs*/
/*         var data = message.data;*/
/*         var settings = {*/
/*           updated: true,*/
/*           facebook_messenger_activated: data.messenger_chat.enabled,*/
/*           facebook_customization_locale: data.messenger_chat.default_locale*/
/*         };*/
/*         resolve(settings);*/
/*       } else {*/
/*         // uninstalled*/
/*         resolve();*/
/*       }*/
/*     }*/
/*   })*/
/*   .then(result => handleMessageReceived(result))*/
/*   .catch(error => logErrorMessage(error));*/
/* }*/
/* */
/* function handleMessageReceived(value) {*/
/*     if (!value) {*/
/*         return deleteSettings()*/
/*           .then(result => reloadCurrentPage(result));*/
/*     } else if (value.updated) {*/
/*         // management view*/
/*         return updateFacebookBusinessExtensionSettings(value);*/
/*     } else {*/
/*         // setup*/
/*         return updateFacebookBusinessExtensionSettings(value)*/
/*           .then(result => reloadCurrentPage(result));*/
/*     }*/
/* }*/
/* */
/* function updateFacebookBusinessExtensionSettings(data) {*/
/*     return new Promise(function(resolve, reject) {*/
/*         $.ajax({*/
/*             url: "index.php?route=extension/module/facebook_business/updateSettings&user_token=" + window.facebookAdsToolboxConfig.token_string,*/
/*             type: "post",*/
/*             data: data,*/
/*             dataType: "json",*/
/*             success: function(json) {*/
/*                 if(!json || !json.success) {*/
/*                     reject(new Error("An error occured when updating Facebook Business Extension settings."));*/
/*                 } else {*/
/*                     resolve("");*/
/*                 }*/
/*             },*/
/*             error: function(xhr, ajaxOptions, thrownError) {*/
/*                 reject(new Error(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText));*/
/*             }*/
/*         });*/
/*     });*/
/* }*/
/* */
/* function deleteSettings() {*/
/*     return new Promise(function(resolve, reject) {*/
/*         $.ajax({*/
/*           url: 'index.php?route=extension/module/facebook_business/deleteSettings&user_token=' + window.facebookAdsToolboxConfig.token_string,*/
/*           type: 'post',*/
/*           success: function(json) {*/
/*             if(!json || !json.success) {*/
/*               reject(new Error("An error occured when deleting Facebook Business Extension settings."));*/
/*             } else {*/
/*               resolve("Your FBE settings are deleted.");*/
/*             }*/
/*           },*/
/*           error: function(xhr, ajaxOptions, thrownError) {*/
/*             reject(new Error(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText));*/
/*           }*/
/*         });*/
/*     });*/
/* };*/
/* */
/* function logErrorMessage(error) {*/
/*     window.facebookAdsToolboxConfig.error_message = error.message;*/
/*     alert(window.facebookAdsToolboxConfig.error_message);*/
/* }*/
/* */
/* function reloadCurrentPage(result) {*/
/*     if (result) {*/
/*         alert(result);*/
/*     }*/
/*     */
/*     location.reload();*/
/* }*/
/* </script>*/
