/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./assets/helloplus-addons/editor/dev/element-editor-module.js":
/*!*********************************************************************!*\
  !*** ./assets/helloplus-addons/editor/dev/element-editor-module.js ***!
  \*********************************************************************/
/***/ ((module) => {

module.exports = elementorModules.editor.utils.Module.extend({
  elementType: null,
  __construct(elementType) {
    this.elementType = elementType;
    this.addEditorListener();
  },
  updateOptions(name, options) {
    const controlView = this.getEditorControlView(name);
    if (controlView) {
      this.getEditorControlModel(name).set('options', options);
      controlView.render();
    }
  },
  addEditorListener() {
    var self = this;
    if (self.onElementChange) {
      var eventName = 'change';
      if ('global' !== self.elementType) {
        eventName += ':' + self.elementType;
      }
      elementor.channels.editor.on(eventName, function (controlView, elementView) {
        self.onElementChange(controlView.model.get('name'), controlView, elementView);
      });
    }
  },
  /**
   * Add a spinner to a control inside its control title.
   *
   * @param {string} controlName - The control name to add the spinner to.
   *
   * @return {void}
   */
  addControlSpinner(controlName) {
    const $el = this.getEditorControlView(controlName).$el;

    // Exit if there is a spinner already.
    if ($el.find('.elementor-control-spinner').length) {
      return;
    }
    const $input = $el.find(':input');
    $input.attr('disabled', true);
    $el.find('.elementor-control-title').after('<span class="elementor-control-spinner"><i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>');
  },
  /**
   * Remove a spinner from a control.
   *
   * @param {string} controlName - The control name to remove the spinner from.
   *
   * @return {void}
   */
  removeControlSpinner(controlName) {
    const $controlEl = this.getEditorControlView(controlName).$el;
    $controlEl.find(':input').attr('disabled', false);
    $controlEl.find('.elementor-control-spinner').remove();
  },
  /**
   * Add an error message under the control.
   *
   * @param {string} controlName - The control name to add the error to.
   * @param {string} error       - Set an error message.
   * @param {string} location    - A CSS selector to the element which the error will be appended to.
   *
   * @return {void}
   */
  addControlError(controlName, error) {
    let location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.elementor-control-content';
    const $el = this.getEditorControlView(controlName).$el;

    // Remove any existing error in order to override it.
    if ($el.find('.e-control-error').length) {
      $el.find('.e-control-error').remove();
    }

    // Select only the first elements to prevent cases where the error is added to many elements.
    // (usually in repeater controls).
    $el.find(location).first().after(`<span class="elementor-control-field-description e-control-error">${error}</span>`);
  },
  /**
   * Remove the control error message.
   *
   * @param {string} controlName - The control name to add the error to.
   *
   * @return {void}
   */
  removeControlError(controlName) {
    const $el = this.getEditorControlView(controlName).$el;
    $el.find('.e-control-error').remove();
  },
  /**
   * Remove any indicators that are related to the control. (e.g. spinner, error, etc.)
   *
   * @param {string} controlName - The control name to reset.
   *
   * @return {void}
   */
  resetControlIndicators(controlName) {
    this.removeControlSpinner(controlName);
    this.removeControlError(controlName);
  },
  addSectionListener(section, callback) {
    const self = this;
    elementor.channels.editor.on('section:activated', function (sectionName, editor) {
      var model = editor.getOption('editedElementView').getEditModel(),
        currentElementType = model.get('elType'),
        _arguments = arguments;
      if ('widget' === currentElementType) {
        currentElementType = model.get('widgetType');
      }
      if (self.elementType === currentElementType && section === sectionName) {
        setTimeout(function () {
          callback.apply(self, _arguments);
        }, 10);
      }
    });
  }
});

/***/ }),

/***/ "./assets/helloplus-addons/editor/integrations/base.js":
/*!*************************************************************!*\
  !*** ./assets/helloplus-addons/editor/integrations/base.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dev_element_editor_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dev/element-editor-module */ "./assets/helloplus-addons/editor/dev/element-editor-module.js");
/* harmony import */ var _dev_element_editor_module__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dev_element_editor_module__WEBPACK_IMPORTED_MODULE_0__);

const BaseIntegrationModule = _dev_element_editor_module__WEBPACK_IMPORTED_MODULE_0___default().extend({
  __construct() {
    this.cache = {};
    _dev_element_editor_module__WEBPACK_IMPORTED_MODULE_0___default().prototype.__construct.apply(this, arguments);
  },
  getName() {
    return '';
  },
  getCacheKey(args) {
    return JSON.stringify({
      service: this.getName(),
      data: args
    });
  },
  fetchCache(type, cacheKey, requestArgs) {
    let immediately = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
    return HelloPlusApp.ajax.addRequest('forms_panel_action_data', {
      unique_id: 'integrations_' + this.getName(),
      data: requestArgs,
      success: data => {
        this.cache[type] = _.extend({}, this.cache[type]);
        this.cache[type][cacheKey] = data[type];
      }
    }, immediately);
  },
  onInit() {
    this.addSectionListener('section_' + this.getName(), this.onSectionActive);
  },
  onSectionActive() {
    this.onApiUpdate();
  },
  onApiUpdate() {}
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseIntegrationModule);

/***/ }),

/***/ "./assets/helloplus-addons/editor/integrations/getresponse.js":
/*!********************************************************************!*\
  !*** ./assets/helloplus-addons/editor/integrations/getresponse.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./assets/helloplus-addons/editor/integrations/base.js");

const GetResponse = _base__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  getName() {
    return 'getresponse';
  },
  onElementChange(setting) {
    switch (setting) {
      case 'getresponse_api_key_source':
      case 'getresponse_custom_api_key':
        this.onApiUpdate();
        break;
      case 'getresponse_list':
        this.onGetResponseListUpdate();
        break;
    }
  },
  onApiUpdate() {
    const self = this;
    const customKeyControl = self.getEditorControlView('getresponse_custom_api_key');
    const globalKeyControl = self.getEditorControlView('getresponse_api_key_source');
    if (!customKeyControl || !globalKeyControl) {
      return;
    }

    // If using a non-default global key but no custom key → clear list
    if ('default' !== globalKeyControl.getControlValue() && '' === customKeyControl.getControlValue()) {
      self.updateOptions('getresponse_list', []);
      const listControl = self.getEditorControlView('getresponse_list');
      if (listControl) listControl.setValue('');
      return;
    }

    // Add a spinner to the list control
    self.resetControlIndicators('getresponse_list');
    self.addControlSpinner('getresponse_list');
    const cacheKey = this.getCacheKey({
      type: 'lists',
      controls: [customKeyControl.getControlValue(), globalKeyControl.getControlValue()]
    });

    // Fetch GetResponse lists
    self.getGetResponseCache('lists', 'lists', cacheKey).done(function (data) {
      self.updateOptions('getresponse_list', data.lists);
      self.updateGetResponseList();
    }).fail(function (error) {
      self.addControlError('getresponse_list', error);
    }).always(function () {
      self.removeControlSpinner('getresponse_list');
    });
  },
  onGetResponseListUpdate() {
    // Just refresh field mapping when list changes
    this.updateGetResponseList();
  },
  updateGetResponseList() {
    const self = this;
    const listControl = self.getEditorControlView('getresponse_list');
    if (!listControl || !listControl.getControlValue()) {
      return;
    }

    // Add spinner to fields map
    self.resetControlIndicators('getresponse_fields_map');
    self.addControlSpinner('getresponse_fields_map');

    // Fetch fields for selected list
    const cacheKey = this.getCacheKey({
      type: 'fields',
      controls: [listControl.getControlValue()]
    });
    self.getGetResponseCache('fields', 'get_fields', cacheKey, {
      getresponse_list: listControl.getControlValue()
    }).done(function (data) {
      const fieldsMap = self.getEditorControlView('getresponse_fields_map');
      if (fieldsMap && data.fields) {
        fieldsMap.updateMap(data.fields);
      }
    }).fail(function (error) {
      self.addControlError('getresponse_fields_map', error);
    }).always(function () {
      self.removeControlSpinner('getresponse_fields_map');
    });
  },
  // ✅ Backward compatibility alias (some versions still call this name)
  updatGetResonseList() {
    this.updateGetResponseList();
  },
  getGetResponseCache(type, action, cacheKey, requestArgs, immediately = false) {
    if (_.has(this.cache[type], cacheKey)) {
      const data = {};
      data[type] = this.cache[type][cacheKey];
      return jQuery.Deferred().resolve(data);
    }
    requestArgs = _.extend({}, requestArgs, {
      service: 'getresponse',
      getresponse_action: action,
      api_key: this.getEditorControlView('getresponse_api_key_source').getControlValue(),
      custom_api_key: this.getEditorControlView('getresponse_custom_api_key').getControlValue()
    });
    return this.fetchCache(type, cacheKey, requestArgs, immediately);
  },
  onSectionActive() {
    _base__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.onSectionActive.apply(this, arguments);
    this.onApiUpdate();
  }
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GetResponse);

/***/ }),

/***/ "./assets/helloplus-addons/editor/integrations/mailchimp.js":
/*!******************************************************************!*\
  !*** ./assets/helloplus-addons/editor/integrations/mailchimp.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./assets/helloplus-addons/editor/integrations/base.js");

const Mailchimp = _base__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
  getName() {
    return 'mailchimp';
  },
  onElementChange(setting) {
    switch (setting) {
      case 'mailchimp_api_key_source':
      case 'mailchimp_api_key':
        this.onApiUpdate();
        break;
      case 'mailchimp_list':
        this.onMailchimpListUpdate();
        break;
    }
  },
  onApiUpdate() {
    var self = this,
      controlView = self.getEditorControlView('mailchimp_api_key'),
      GlobalApiKeycontrolView = self.getEditorControlView('mailchimp_api_key_source');
    if ('default' !== GlobalApiKeycontrolView.getControlValue() && '' === controlView.getControlValue()) {
      self.updateOptions('mailchimp_list', []);
      self.getEditorControlView('mailchimp_list').setValue('');
      return;
    }

    // Add a spinner to the `Audience` list control.
    self.resetControlIndicators('mailchimp_list');
    self.addControlSpinner('mailchimp_list');
    const cacheKey = this.getCacheKey({
      type: 'lists',
      controls: [controlView.getControlValue(), GlobalApiKeycontrolView.getControlValue()]
    });

    // Fetch data
    self.getMailchimpCache('lists', 'lists', cacheKey).done(function (data) {
      self.updateOptions('mailchimp_list', data.lists);
      self.updatMailchimpList();
    }).fail(function (error) {
      self.addControlError('mailchimp_list', error);
    }).always(function () {
      self.removeControlSpinner('mailchimp_list');
    });
  },
  onMailchimpListUpdate() {
    this.updateOptions('mailchimp_groups', []);
    this.getEditorControlView('mailchimp_groups').setValue('');
    this.updatMailchimpList();
  },
  updatMailchimpList() {
    var self = this,
      controlView = self.getEditorControlView('mailchimp_list');
    if (!controlView.getControlValue()) {
      return;
    }

    // Add a spinner to the groups select box.
    self.resetControlIndicators('mailchimp_groups');
    self.addControlSpinner('mailchimp_groups');
    this.getCacheKey({
      type: 'list_details',
      controls: [controlView.getControlValue()]
    });

    // Fetch The data
    self.getMailchimpCache('list_details', 'list_details', controlView.getControlValue(), {
      mailchimp_list: controlView.getControlValue()
    }).done(function (data) {
      self.updateOptions('mailchimp_groups', data.list_details.groups);
      self.getEditorControlView('mailchimp_fields_map').updateMap(data.list_details.fields);
    }).fail(function (error) {
      self.addControlError('mailchimp_groups', error);
    }).always(function () {
      self.removeControlSpinner('mailchimp_groups');
    });

    // Get list fields.
    // The requests needed to be executed immediately in order to fill the `Field Mapping` select-boxes
    // without waiting for other requests to finish.
    const args = {
      type: 'fields',
      action: 'fields',
      cacheKey: controlView.getControlValue(),
      args: {
        mailchimp_list: controlView.getControlValue()
      },
      immediately: true
    };
    self.getMailchimpCache(...Object.values(args)).done(function (data) {
      self.getEditorControlView('mailchimp_fields_map').updateMap(data.fields);
    });
  },
  getMailchimpCache(type, action, cacheKey, requestArgs) {
    let immediately = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
    if (_.has(this.cache[type], cacheKey)) {
      var data = {};
      data[type] = this.cache[type][cacheKey];
      return jQuery.Deferred().resolve(data);
    }
    requestArgs = _.extend({}, requestArgs, {
      service: 'mailchimp',
      mailchimp_action: action,
      api_key: this.getEditorControlView('mailchimp_api_key').getControlValue(),
      use_global_api_key: this.getEditorControlView('mailchimp_api_key_source').getControlValue()
    });
    return this.fetchCache(type, cacheKey, requestArgs, immediately);
  },
  onSectionActive() {
    _base__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.onSectionActive.apply(this, arguments);
    this.onApiUpdate();
  }
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Mailchimp);

/***/ }),

/***/ "./assets/helloplus-addons/editor/module/module.js":
/*!*********************************************************!*\
  !*** ./assets/helloplus-addons/editor/module/module.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ FormsModule)
/* harmony export */ });
/* harmony import */ var _integrations_mailchimp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../integrations/mailchimp */ "./assets/helloplus-addons/editor/integrations/mailchimp.js");
/* harmony import */ var _integrations_getresponse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../integrations/getresponse */ "./assets/helloplus-addons/editor/integrations/getresponse.js");


class FormsModule extends elementorModules.editor.utils.Module {
  onElementorInit() {
    this.mailchimp = new _integrations_mailchimp__WEBPACK_IMPORTED_MODULE_0__["default"]('ehp-form');
    this.getresponse = new _integrations_getresponse__WEBPACK_IMPORTED_MODULE_1__["default"]('ehp-form');
  }
}

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!**************************************************!*\
  !*** ./assets/helloplus-addons/editor/editor.js ***!
  \**************************************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _module_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module/module */ "./assets/helloplus-addons/editor/module/module.js");

class HelloPlusApp {
  constructor() {
    this.modules = {};
    this.ajax = {
      prepareArgs(args) {
        args[0] = 'ehp_' + args[0];
        return args;
      },
      send() {
        return elementorCommon.ajax.send.apply(elementorCommon.ajax, this.prepareArgs(arguments));
      },
      addRequest() {
        return elementorCommon.ajax.addRequest.apply(elementorCommon.ajax, this.prepareArgs(arguments));
      }
    };
  }
  start() {
    jQuery(window).on('elementor:init', () => this.onElementorInit());
  }
  onElementorInit() {
    this.modules.forms = new _module_module__WEBPACK_IMPORTED_MODULE_0__["default"]();
    this.modules.forms.onElementorInit();
    jQuery(document).trigger('coolformkit:helloplus_app_init');
  }
}
window.HelloPlusApp = new HelloPlusApp();
window.HelloPlusApp.start();
})();

/******/ })()
;
//# sourceMappingURL=HelloPlus-editor-custom-integration.js.map