class Configuration {
  static instance = null;

  static getInstance() {
    if (this.instance == null) {
      this.instance = new Configuration();
    }
    return this.instance;
  }

  get is_debug() {
    return false;
  }

  get ajax_url() {
    return window.ajaxurl;
  }

  get categories() {
    let cats = []
    for (let i=0; i<10; i++) {
      cats.push({value: 'cat'+i, label: 'Category '+i})
    }
    return cats
  }

  get selectedCategories()
  {
    return window.dreamfox_wdd_params['categories'];
  }

  get deliveryDays()
  {
    return window.dreamfox_wdd_params['deliveryDays'];
  }

  get asset_images_url() {
    return window.dreamfox_wdd_params['assetImageUrl'];
  }

  get is_premium() {
    return !!window.dreamfox_wdd_params['isPremium'];
  }

  get upgrade_url() {
    return window.dreamfox_wdd_params['upgradeUrl'] || '';
  }

  get premium_features_url() {
    return window.dreamfox_wdd_params['premiumFeaturesUrl'] || this.upgrade_url;
  }

  get support_url() {
    return window.dreamfox_wdd_params['supportUrl'] || 'https://dreamfoxmedia.com/support';
  }

  get contact_url() {
    return window.dreamfox_wdd_params['contactUrl'] || this.support_url;
  }

  get kb_url() {
    return window.dreamfox_wdd_params['kbUrl'] || 'https://help.dreamfoxmedia.com/delivery-date-for-woocommerce';
  }

  get faq_url() {
    return window.dreamfox_wdd_params['faqUrl'] || 'https://wordpress.org/plugins/woocommerce-delivery-date/#faq';
  }

  get wp_support_url() {
    return window.dreamfox_wdd_params['wpSupportUrl'] || 'https://wordpress.org/support/plugin/woocommerce-delivery-date/';
  }

  get nonce() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['nonce'] : '';
  }
}

export default Configuration