diff --git a/pluginTester/scripts/framework/app.min.js b/pluginTester/scripts/framework/app.min.js
old mode 100644
new mode 100755
index babface7..814040cb
--- a/pluginTester/scripts/framework/app.min.js
+++ b/pluginTester/scripts/framework/app.min.js
@@ -7,13 +7,13 @@
"use strict";!function(){function e(t){return this.promise=new Promise(t),this.promise.success=function(t){return this.then(t),this},this.promise.error=function(t){return this.then(null,t),this},this.promise}function o(){}console.log("httpClient is loading"),o.get=function(t,e){return o.request("GET",t,void 0,e)},o.post=function(t,e,n){return o.request("POST",t,e)},o.put=function(t,e,n){return o.request("PUT",t,e)},o.jsonp=function(t,e){function n(t){this.promise=new Promise(t)}return n.prototype.success=function(t){return this.promise.then(t,null),this},n.prototype.error=function(t){return this.promise.then(null,t),this},new n(function(r,s){setTimeout(function(){console.info("Angular $http is not ready"),window.bfUtils.http.jsonp(t,e).success(function(t,e,n,o){return r(t,e,n,o)}).error(function(t,e,n,o){return s(t,e,n,o)})},200)})},o.request=function(o,r,s,t){return console.log("httpClient create request for url: ",r," using method: ",o),new e(function(e,t){var n=new XMLHttpRequest;n.onload=function(){console.log("httpClient read response for url: ",r," using method: ",o);n.status,n.statusText;var t="response"in n?n.response:n.responseText;e(t?JSON.parse(t):null)},n.onerror=function(){console.log("httpClient failed for url: ",r," using method: ",o),t(new TypeError("Network request failed"))},n.ontimeout=function(){console.log("httpClient timed out for url: ",r," using method: ",o),t(new TypeError("Network request failed"))},console.log("httpClient requesting for url: ",r," using method: ",o),n.open(o,r,!0),n.send(s)})},window.httpClient=o}();
"use strict";function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);nr.length)&&(t=r.length);for(var a=0,e=new Array(t);al.settings.maxAgeRequired?this.error=l.options.errorMessages.maxAge+" "+l.settings.maxAgeRequired:l.settings.minAgeIsRequired&&l.settings.minAgeRequired&&ef.settings.maxNumRequired&&f.settings.maxNumEnabled?this.error=f.options.errorMessages.maxNum+" "+f.settings.maxNumRequired:ee.maxLength&&(e.value=e.value.substring(0,e.maxLength))},editVisibilityOptions:function(e,s){var t=new ComponentUIAPI;t.openDrawer({header:e.field.label,listItems:[{text:"Public"},{text:"Private"}],enableFilter:!1},function(e,i){return e?console.error(e):(i&&s(null,i),void t.closeDrawer())})}};function gm_authFailure(){customRegistration.googleMapServices.checkMapsApiKeyErrors&&(customRegistration.googleMapServices.mapsApiKeyError="There seems to be an issue with google maps key")}
+"use strict";var customRegistration={googleMapServices:{},get wl_name(){var e="Full ";return e=appContext&&appContext.currentApp&&appContext.currentApp.config?appContext.currentApp.config.whitlabelName+" ":e},getFields:function(t,e){var l,r,o,n,u,d,i=t.customRegistrationSettings;i&&i.singlePage&&i.singlePage.formControls?(l=[],r={},o=[],n="",u=t.defaults||{},i.singlePage.formControls.forEach(function(e,i){var s;t.isProfileMode&&"registrationOnly"===e.settings.displayOn||("custom"!=e.type?(s={control:e,controlIndex:i,fields:l,rules:r,initializers:o,isProfileMode:t.isProfileMode,defaults:t.defaults,refreshUI:t.refreshUI},customRegistration.preparePresetField(s)):(i={control:e,controlIndex:i,fields:l,defaults:t.defaults},customRegistration.prepareCustomField(i)))}),d=function(e,i){var s=e.field;"edit"!==e.mode||"email"!==s.name&&!s.preventEditing?"edit"===e.mode&&"profilePicture"===s.name?(s.value=e.profilePicture,s.validate(s.value,function(e,i){n=e?e:null})):"multipleSelect"===s.type?s.validate(s.values):s.validate(s.value):s.error=null,i&&i(null,{profilePictureError:n})},e(null,{fields:l,rules:r,initializers:o,fetch:function(i,e){var s,t,r=!1,o={},a=[];i&&i.validateFields&&l.forEach(function(e){if(i.field=e,d(i),e.error&&(r=!0),e.isCustom)switch(e.type){case"singleSelect":a.push({id:e.id,tag:e.tag,type:e.type,value:e.value,displayValue:e.displayValue,visibilityChoice:e.visibilityChoice});break;case"multipleSelect":a.push({id:e.id,type:e.type,values:e.values,visibilityChoice:e.visibilityChoice});break;case"text":case"number":case"textarea":a.push({id:e.id,type:e.type,value:e.value,visibilityChoice:e.visibilityChoice})}else o[e.name]={value:e.value,extra:e.extra,messages:e.messages,visibilityChoice:e.visibilityChoice}}),r?e({profilePictureError:n},null):((t=(s={user:u}).user).email=o.email.value,t.password=o.password?o.password.value:void 0,t.firstName=o.firstName?o.firstName.value:t.firstName,t.lastName=o.lastName?o.lastName.value:t.lastName,t.displayName=o.displayName?o.displayName.value:t.displayName,t.userProfile=t.userProfile||{},t.userProfile.address=t.userProfile.address||{},t.userProfile.address.fullAddress=o.address?o.address.value:t.userProfile.address.fullAddress,t.userProfile.address.customFields=t.userProfile.address.customFields||{},t.userProfile.address.customFields.aptNo=o.aptNo?o.aptNo.value:t.userProfile.address.customFields.aptNo,t.userProfile.address.customFields.zipCode=o.zipCode?o.zipCode.value:t.userProfile.address.customFields.zipCode,t.userProfile.address.geoLocation=o.address?o.address.value?o.address.extra:void 0:t.userProfile.address.geoLocation,t.userProfile.addressVisibilityChoice=o.address?o.address.visibilityChoice:o.zipCode?o.zipCode.visibilityChoice:t.userProfile.addressVisibilityChoice,t.userProfile.bio=o.bio?o.bio.value:t.userProfile.bio,t.userProfile.bioVisibilityChoice=o.bio?o.bio.visibilityChoice:t.userProfile.bioVisibilityChoice,t.userProfile.birthDate=o.birthDate?o.birthDate.value?new Date(o.birthDate.value):null:"string"==typeof t.userProfile.birthDate?new Date(t.userProfile.birthDate):t.userProfile.birthDate,t.userProfile.birthDateVisibilityChoice=o.birthDate?o.birthDate.visibilityChoice:t.userProfile.birthDateVisibilityChoice,t.userProfile.tel=o.tel?o.tel.value:t.userProfile.tel,t.userProfile.telVisibilityChoice=o.tel?o.tel.visibilityChoice:t.userProfile.telVisibilityChoice,t.userProfile.emailVisibilityChoice=o.email?o.email.visibilityChoice:t.userProfile.emailVisibilityChoice,t.userProfile.customTypeFields=t.userProfile.customTypeFields||[],a.forEach(function(i){var e=t.userProfile.customTypeFields.findIndex(function(e){return i.id===e.id});0<=e?t.userProfile.customTypeFields[e]=i:t.userProfile.customTypeFields.push(i)}),delete t.imageUrl,s.messages={emailAlreadyInUse:o.email.messages.emailAlreadyInUse},o.displayName&&o.displayName.messages&&(s.messages.fullNameAlreadyInUse=o.displayName.messages.fullNameAlreadyInUse),s.profilePictureFile=o.profilePicture?o.profilePicture.value:void 0,e(null,s))},checkFieldsErrors:function(i,s){i&&i.validateFields&&l.forEach(function(e){i.field=e,d(i,s)})}})):e(null,null)},preparePresetField:function(a){var t,e,i,s,l=a.control,r=a.controlIndex,o=a.fields,n=a.rules,u=a.initializers;switch(l.id){case"fullName":l.active&&(l.settings.displayNameEnabled&&(o.push({id:l.id,type:"text",viewType:"none",name:"displayName",maxLength:150,order:r,label:l.options.fieldsLabels.displayName,iconClass:l.icon||"glyphicon glyphicon-font",validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.fullNameRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults?a.defaults.displayName:void 0}),n.checkUniqueName=l.active&&l.settings&&l.settings.unique&&l.settings.required&&l.settings.displayNameEnabled),l.settings.firstNameEnabled&&o.push({type:"text",viewType:"text",name:"firstName",maxLength:150,order:r,label:l.options.fieldsLabels.firstName,iconClass:l.icon||"glyphicon glyphicon-font",validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.fullNameRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults?a.defaults.firstName:void 0}),l.settings.lastNameEnabled&&o.push({type:"text",viewType:"text",name:"lastName",maxLength:150,order:r,label:l.options.fieldsLabels.lastName,iconClass:l.icon||"glyphicon glyphicon-font",validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.fullNameRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults?a.defaults.lastName:void 0}));break;case"email":var d="userChoice"===l.settings.visibility?"public":void 0,d=a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.emailVisibilityChoice||d;o.push({type:"email",viewType:"email",name:"email",order:r,label:l.options.fieldsLabels.email,info:l.options.infoMessages?l.options.infoMessages.assistiveText:void 0,iconClass:l.icon||"glyphicon glyphicon-send",visibility:l.settings.visibility||"private",visibilityChoice:d,validate:function(e){this.error=null,e&&e.trim().length?window.validator.validateEmail(e)?e&&e.trim().length||(this.error=l.options.errorMessages.emailAlreadyInUse):this.error=l.options.errorMessages.emailInvalidFormat:this.error=l.options.errorMessages.emailRequired},touch:function(e,i){!e&&i&&i.target&&(e=i.target.value),this.validate(e)},messages:l.options.errorMessages,value:a.defaults?a.defaults.email:void 0});break;case"address":l.active&&(t=l.options.addressGoogleApiKey,e="userChoice"===l.settings.visibility?"public":void 0,e=a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.addressVisibilityChoice||e,l.options.addressGoogleApiKey&&u.push(function(){setTimeout(function(){var e=document.getElementById("customRegistrationScript"),i=e&&e.src,s="https://maps.googleapis.com/maps/api/js?key=".concat(t,"&libraries=places&callback=googleMapsInitCallback");e&&i!=s&&document.getElementsByTagName("head")[0].removeChild(e),customRegistration.googleMapServices.mapsApiKeyError=null,i!=s&&((e=document.createElement("script")).id="customRegistrationScript",e.src=s,e.type="text/javascript",document.getElementsByTagName("head")[0].appendChild(e)),window.googleMapsInitCallback=function(){customRegistration.googleMapServices.autoAddressCompleteService=new google.maps.places.AutocompleteService,customRegistration.googleMapServices.addressGeocoder=new google.maps.Geocoder},a.refreshUI&&a.refreshUI()},0)}),l.settings.showFullAddress&&(o.push({type:"text",viewType:"text",name:"address",maxLength:150,order:r,label:l.options.fieldsLabels.address,iconClass:l.icon||"glyphicon glyphicon-pushpin",visibility:l.settings.visibility||"private",visibilityChoice:e,preventEditing:!1===l.settings.allowEditingInProfile,change:function(e){var s=this;s.extra=null,customRegistration.googleMapServices.mapsApiKeyError&&(s.error=customRegistration.googleMapServices.mapsApiKeyError),customRegistration.googleMapServices.autoAddressCompleteService?(customRegistration.googleMapServices.checkMapsApiKeyErrors=!0,setTimeout(function(){customRegistration.googleMapServices.checkMapsApiKeyErrors=!1},3e3),customRegistration.googleMapServices.autoAddressCompleteService.getPlacePredictions({input:e,types:["street_number","street_address","route"]},function(e,i){i!==google.maps.places.PlacesServiceStatus.OK&&(s.error=l.options.errorMessages.invalidGoogleAddress),s.suggestions=e,a.refreshUI&&a.refreshUI()})):s.error=l.options.errorMessages.invalidGoogleAddress},selectSuggestion:function(r){var o=this;o.error=null,o.suggestions=null,o.value=r.description,customRegistration.googleMapServices.addressGeocoder.geocode({placeId:r.place_id},function(e,i){var s,t;e&&e[0]&&e[0]?(s=e[0].geometry.location.lat(),t=e[0].geometry.location.lng(),l.settings.required&&(e[0].address_components.find(function(e){return e.types&&e.types.find(function(e){return"street_number"===e||"street_address"===e||"route"===e})})||(o.error=l.options.errorMessages.invalidGoogleAddress)),o.extra={lat:s,lng:t,place:r,addressComponents:e[0].address_components}):o.error=l.options.errorMessages.invalidGoogleAddress,a.refreshUI&&a.refreshUI()})},validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required?e&&e.trim().length&&!this.extra&&(this.error=l.options.errorMessages.invalidGoogleAddress):this.error=l.options.errorMessages.addressRequired},touch:function(e){this.suggestions&&this.suggestions.length||this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this),this.change(this.value)},messages:l.options.errorMessages,value:a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.address?a.defaults.userProfile.address.fullAddress:void 0,extra:a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.address?a.defaults.userProfile.address.geoLocation:void 0}),l.settings.showAptNo&&o.push({type:"text",viewType:"text",name:"aptNo",maxLength:150,order:r,label:l.options.fieldsLabels.aptNo,iconClass:l.icon||"glyphicon glyphicon-pushpin",containerClass:"small-login-field",preventEditing:!1===l.settings.allowEditingInProfile,validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.addressRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.address&&a.defaults.userProfile.address.customFields?a.defaults.userProfile.address.customFields.aptNo:void 0})),l.settings.showZipCode&&o.push({type:"text",viewType:"text",name:"zipCode",maxLength:150,order:r,label:l.options.fieldsLabels.zipCode,iconClass:l.icon||"glyphicon glyphicon-pushpin",visibility:l.settings.visibility||"private",visibilityChoice:e,preventEditing:!1===l.settings.allowEditingInProfile,validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.addressRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.address&&a.defaults.userProfile.address.customFields?a.defaults.userProfile.address.customFields.zipCode:void 0}));break;case"password":a.isProfileMode||(o.push({type:"password",name:"password",order:r,label:l.options.fieldsLabels.password,iconClass:l.icon||"glyphicon glyphicon-lock",togglePasswordVisibility:"showHidePassword"===l.settings.validation,info:"simple"===l.settings.passwordStrength?l.options.infoMessages.passwordSimpleRules:l.options.infoMessages.passwordRules,validate:function(e){this.error=null,"retypePassword"===l.settings.validation&&(o.find(function(e){return"retypePassword"===e.name}).error=null),e&&e.trim().length?window.validator.validatePassword(e,{simplePasswordValidation:"simple"===l.settings.passwordStrength})||(this.error="simple"===l.settings.passwordStrength?l.options.errorMessages.invalidPasswordSimpleRules:l.options.errorMessages.invalidPasswordRules):this.error=l.options.errorMessages.passwordRequired},touch:function(e){this.validate(e)},messages:l.options.errorMessages}),"retypePassword"===l.settings.validation&&o.push({type:"password",name:"retypePassword",order:r,label:l.options.fieldsLabels.retypePassword,iconClass:l.icon||"glyphicon glyphicon-lock",togglePasswordVisibility:"showHidePassword"===l.settings.validation,validate:function(e){var i=o.find(function(e){return"password"===e.name});this.error=null,e&&e.trim().length?i.value!==e&&(this.error=l.options.errorMessages.passwordsDontMatch):this.error=l.options.errorMessages.passwordRequired},touch:function(e){this.validate(e)},messages:l.options.errorMessages})),n.passwordStrength=l.settings.passwordStrength;break;case"bio":l.active&&(e="userChoice"===l.settings.visibility?"public":void 0,e=a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.bioVisibilityChoice||e,o.push({type:"textarea",viewType:"multiline",name:"bio",maxLength:1024,order:r,label:l.options.fieldsLabels.bio,info:l.options.infoMessages?l.options.infoMessages.assistiveText:void 0,iconClass:l.icon||"glyphicon glyphicon-list-alt",visibility:l.settings.visibility||"private",visibilityChoice:e,preventEditing:!1===l.settings.allowEditingInProfile,validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required||(this.error=l.options.errorMessages.bioRequired)},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults&&a.defaults.userProfile?a.defaults.userProfile.bio:void 0}));break;case"telephone":l.active&&(i="userChoice"===l.settings.visibility?"public":void 0,i=a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.telVisibilityChoice||i,o.push({type:"tel",viewType:"text",name:"tel",maxLength:150,order:r,label:l.options.fieldsLabels.tel,info:l.settings.showReasonForTelephone?l.options.infoMessages.reasonForTelephone:null,iconClass:l.icon||"glyphicon glyphicon-earphone",visibility:l.settings.visibility||"private",visibilityChoice:i,preventEditing:!1===l.settings.allowEditingInProfile,validate:function(e){this.error=null,e&&e.trim().length||!l.settings.required?e&&(/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/i.test(e)||(this.error=l.options.errorMessages.invalidEntry)):this.error=l.options.errorMessages.invalidEntry},touch:function(e){this.validate(e)},enforceMaxLength:function(){customRegistration.enforceMaxLength(this)},messages:l.options.errorMessages,value:a.defaults&&a.defaults.userProfile?a.defaults.userProfile.tel:void 0}));break;case"birthDate":l.active&&(i="userChoice"===l.settings.visibility?"public":void 0,i=a.defaults&&a.defaults.userProfile&&a.defaults.userProfile.birthDateVisibilityChoice||i,s=function(e){return e?moment(e).format("L"):null},o.push({type:"date",viewType:"text",name:"birthDate",order:r,label:l.options.fieldsLabels.dateBirth,info:l.options.infoMessages?l.options.infoMessages.assistiveText:void 0,minDate:l.settings.maxAgeIsRequired&&l.settings.maxAgeRequired?moment().subtract(l.settings.maxAgeRequired,"years").toDate():void 0,maxDate:l.settings.minAgeIsRequired&&l.settings.minAgeRequired?moment().subtract(l.settings.minAgeRequired,"years").toDate():void 0,iconClass:l.icon||"glyphicon glyphicon-calendar",displayValue:s(a.defaults&&a.defaults.userProfile?a.defaults.userProfile.birthDate:void 0),visibility:l.settings.visibility||"private",visibilityChoice:i,preventEditing:!1===l.settings.allowEditingInProfile,validate:function(e){this.error=null,e?(e=moment(e),e=moment().diff(e,"years"),l.settings.maxAgeIsRequired&&l.settings.maxAgeRequired&&e>l.settings.maxAgeRequired?this.error=l.options.errorMessages.maxAge+" "+l.settings.maxAgeRequired:l.settings.minAgeIsRequired&&l.settings.minAgeRequired&&ef.settings.maxNumRequired&&f.settings.maxNumEnabled?this.error=f.options.errorMessages.maxNum+" "+f.settings.maxNumRequired:ee.maxLength&&(e.value=e.value.substring(0,e.maxLength))},editVisibilityOptions:function(e,s){var t=new ComponentUIAPI;t.openDrawer({header:e.field.label,listItems:[{text:"Public"},{text:"Private"}],enableFilter:!1},function(e,i){return e?console.error(e):(i&&s(null,i),void t.closeDrawer())})}};function gm_authFailure(){customRegistration.googleMapServices.checkMapsApiKeyErrors&&(customRegistration.googleMapServices.mapsApiKeyError="There seems to be an issue with google maps key")}
"use strict";function _readOnlyError(e){throw new TypeError('"'+e+'" is read-only')}function ownKeys(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)),a}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nn?e(null,i.value):(o[t]=void 0,e(null,null))},FirebaseAPI._setUser=function(n,e){n=n.appId+"_"+n.instanceId+"_"+n.integrationToken;o[n]={createdOn:new Date,value:e}},authAPI.onLogout(function(){o={}})}();
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n\n \x3c!-- Background of PhotoSwipe.\n It\'s a separate element as animating opacity is faster than rgba(). --\x3e\n \n\n \x3c!-- Slides wrapper with overflow:hidden. --\x3e\n
\n\n \x3c!-- Container that holds slides.\n PhotoSwipe keeps only 3 of them in the DOM to save memory.\n Don\'t modify these 3 pswp__item elements, data is added later on. --\x3e\n
\n \n \n \n
\n\n \x3c!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. --\x3e\n
\n\n
\n\n \x3c!-- Controls are self-explanatory. Order can be changed. --\x3e\n\n \n \n \n\n \n\n \n\n \x3c!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR --\x3e\n \x3c!-- element will get class pswp__preloader--active when preloader is running --\x3e\n
'},o=window.PhotoSwipeUI_Default;n&&n.images&&n.images.length&&(window.spinner.show(),n.images[0]&&n.images[0].name&&(n.images=n.images.map(function(n){return n.name})),n.images=n.images.map(function(n){var e=-1!==n.indexOf("?");return{src:imageTools.toCdnUrl(n),msrc:"".concat(imageTools.toCdnUrl(n,{_quality:10})+(e?"&":"?"),"w=300"),h:window.innerHeight,w:window.innerWidth}}),window.pswp=new PhotoSwipe(i,o,n.images,t),window.pswp.listen("close",e),window.pswp.listen("destroy",function(){document.querySelector("div#bfPsContainer").remove(),imagePreviewerAPI.initialized=!1}),window.pswp.listen("imageLoadComplete",function(n,e){var i,t=(null===(i=e.container)||void 0===i?void 0:i.children)?Array.from(null===(t=e.container)||void 0===t?void 0:t.children).find(function(n){return n.classList.contains("pswp__img--placeholder")}):null;t&&(t.style.display="none")}),window.pswp.listen("gettingData",function(n,i){var e=new Image;e.onload=function(){var n,e=(null===(n=i.container)||void 0===n?void 0:n.children)?Array.from(null===(e=i.container)||void 0===e?void 0:e.children).find(function(n){return n.src===i.src}):null;e&&!e.dataset.updated&&(e.dataset.updated="1",i.w=this.width,i.h=this.height,window.pswp.updateSize(!0))},e.src=i.src}),window.pswp.init(),window.spinner.hide())},renderHTML:function(){var n=document.createElement("div");n.id="bfPsContainer",n.style.zIndex=99999999,n.style.position="relative",n.innerHTML='\n \x3c!-- Root element of PhotoSwipe. Must have class pswp. --\x3e\n
\n\n \x3c!-- Background of PhotoSwipe.\n It\'s a separate element as animating opacity is faster than rgba(). --\x3e\n \n\n \x3c!-- Slides wrapper with overflow:hidden. --\x3e\n
\n\n \x3c!-- Container that holds slides.\n PhotoSwipe keeps only 3 of them in the DOM to save memory.\n Don\'t modify these 3 pswp__item elements, data is added later on. --\x3e\n
\n \n \n \n
\n\n \x3c!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. --\x3e\n
\n\n
\n\n \x3c!-- Controls are self-explanatory. Order can be changed. --\x3e\n\n \n \n \n\n \n\n \n\n \x3c!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR --\x3e\n \x3c!-- element will get class pswp__preloader--active when preloader is running --\x3e\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n \n
\n\n \n\n \n\n
\n \n
\n\n
\n\n
\n\n
\n ',(0<=window.location.pathname.toLowerCase().indexOf("plugintester")?document.getElementById("app"):document.body).appendChild(n),this.initialized=!0}};
"use strict";function searchEngineAPI(e){this.context=e}searchEngineAPI.prototype={_sendRequest:function(e,i,t,n){var s="",a=new XMLHttpRequest,i=window.siteConfig.endPoints.searchEngineHost+"/search_engine/"+i;if("GET"===(e=e.toUpperCase())&&t){var d,g="?";for(d in t)t.hasOwnProperty(d)&&(g+=d+"="+encodeURIComponent(t[d])+"&");i+=g=g.slice(0,-1)}else s=JSON.stringify(t);a.open(e,i,!0),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("app_id",this.context.appId),a.setRequestHeader("x-api-key","GpzNPRVIld3WxoKDAXJZM7cjoUA5p0rS6pqYkCqy"),a.onreadystatechange=function(){var e=null;try{e=JSON.parse(a.responseText)}catch(e){}4==a.readyState&&(200===a.status?n&&n(null,e):n&&n(e))},a.send(s)},search:function(e,t){var n,i=this;function s(){i._sendRequest("POST","search",n,function(e,i){t&&t(e,i)})}e?(n={instance_id:this.context.instanceId,plugin_id:this.context.pluginId,tag:e.tag,page_index:e.pageIndex,page_size:e.pageSize,search_text:e.searchText,pre_highlight_tag:e.preHighlightTag,post_highlight_tag:e.postHighlightTag},e.linkedUser?window.authAPI.getCurrentUser(function(e,i){n.user_id=i&&i._id?i._id.toString():null,n.user_id?s():t&&t({message:"no user found"})}):s()):t&&t("invalid params",null)},insert:function(e,t){var n,i=this;function s(){i._sendRequest("POST","",n,function(e,i){t&&t(e,i)})}e?e.tag?e.title?(n={instance_id:this.context.instanceId,plugin_id:this.context.pluginId,tag:e.tag,title:e.title,description:e.description,keywords:e.keywords,image_url:e.imageUrl,data:e.data},e.linkedUser?window.authAPI.getCurrentUser(function(e,i){n.user_id=i&&i._id?i._id.toString():null,n.user_id?s():t&&t({message:"no user found"})}):s()):t&&t({message:"Missing params title"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"invalid params"},null)},save:function(e,t){var n,i=this;function s(){i._sendRequest("POST","save",n,function(e,i){t&&t(e,i)})}e?e.key?e.tag?e.title?(n={instance_id:this.context.instanceId,plugin_id:this.context.pluginId,key:e.key,tag:e.tag,title:e.title,description:e.description,keywords:e.keywords,image_url:e.imageUrl,data:e.data},e.linkedUser?window.authAPI.getCurrentUser(function(e,i){n.user_id=i&&i._id?i._id.toString():null,n.user_id?s():t&&t({message:"no user found"})}):s()):t&&t({message:"Missing params title"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"Missing params key"},null):t&&t({message:"invalid params"},null)},update:function(e,t){var n,i=this;function s(){i._sendRequest("PUT","",n,function(e,i){t&&t(e,i)})}e?e.id?e.tag?e.title?(n={id:e.id,instance_id:this.context.instanceId,plugin_id:this.context.pluginId,tag:e.tag,title:e.title,description:e.description,keywords:e.keywords,image_url:e.imageUrl,data:e.data},e.linkedUser?window.authAPI.getCurrentUser(function(e,i){n.user_id=i&&i._id?i._id.toString():null,n.user_id?s():t&&t({message:"no user found"})}):s()):t&&t({message:"Missing params title"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"Missing params id"},null):t&&t({message:"invalid params"},null)},delete:function(e,t){var n,s=this;e?e.id||e.key?e.tag?(n={id:e.id,instance_id:this.context.instanceId,plugin_id:this.context.pluginId,tag:e.tag},e.key&&(n.key=e.key),window.authAPI.getCurrentUser(function(e,i){n.user_id=i&&i._id?i._id.toString():null,s._sendRequest("DELETE","",n,function(e,i){t&&t(e,i)})})):t&&t({message:"Missing params tag"},null):t&&t({message:"Missing params (id or key)"},null):t&&t({message:"invalid params"},null)},get feeds(){var n=this;return{insert:function(e,t){var i;e?e.tag?e.title?e.feedType?e.feedConfig&&e.feedConfig.url?(e.feedItemConfig||(e.feedItemConfig={}),i={instance_id:n.context.instanceId,plugin_id:n.context.pluginId,tag:e.tag,title:e.title,description:e.description,feed_type:e.feedType,feed_config:{url:e.feedConfig.url},feed_item_config:{unique_key:e.feedItemConfig.uniqueKey,title_key:e.feedItemConfig.titleKey,description_key:e.feedItemConfig.descriptionKey,url_key:e.feedItemConfig.urlKey,publish_date_key:e.feedItemConfig.publishDateKey,image_url_key:e.feedItemConfig.imageUrlKey}},n._sendRequest("POST","feeds",i,function(e,i){t&&t(e,i)})):t&&t({message:"Missing params feedConfig.url"},null):t&&t({message:"Missing params feedType"},null):t&&t({message:"Missing params title"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"invalid params"},null)},delete:function(e,t){var i;e?e.tag?e.feedId?(i={instance_id:n.context.instanceId,plugin_id:n.context.pluginId,tag:e.tag,feed_id:e.feedId,remove_feed_data:e.removeFeedData},n._sendRequest("DELETE","feeds",i,function(e,i){t&&t(e,i)})):t&&t({message:"Missing params feedId"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"invalid params"},null)},get:function(e,t){var i;e?e.tag?e.feedType?(i={instance_id:n.context.instanceId,plugin_id:n.context.pluginId,tag:e.tag,feed_type:e.feedType},n._sendRequest("GET","feeds",i,function(e,i){t&&t(e,i)})):t&&t({message:"Missing params feedType"},null):t&&t({message:"Missing params tag"},null):t&&t({message:"invalid params"},null)}}}};
"use strict";function CreditsAPI(e){if(this.context=e,!this.context)throw Error("invalid creditsSystem context");this.context.apiKeys&&(this.secretKey=this.context.apiKeys.creditsSystemSecretKey)}CreditsAPI.prototype={_sendRequest:function(e,n,t,s){var i="",r=void 0,c=void 0;t.public_key&&(r=t.public_key),t.secret_key&&(c=t.secret_key),delete t.public_key,delete t.secret_key;var a=new XMLHttpRequest,n=window.siteConfig.endPoints.creditSystemHost+"/credit_system/"+n;if("GET"===(e=e.toUpperCase())&&t){var o,u="?";for(o in t)t.hasOwnProperty(o)&&(u+=o+"="+encodeURIComponent(t[o])+"&");n+=u=u.slice(0,-1)}else i=JSON.stringify(t);a.open(e,n,!0),a.setRequestHeader("Content-Type","application/json"),r&&a.setRequestHeader("public_key",r),c&&a.setRequestHeader("secret_key",c),a.setRequestHeader("x-api-key","ZBtYjI3ZlNaKdhWApTjIF3NYaynO4snJ1zikGTDr"),a.onreadystatechange=function(){var e=null;try{e=JSON.parse(a.responseText)}catch(e){}4==a.readyState&&(200===a.status?s&&s(null,e):s&&s(e))},a.send(i)},updateMerchant:function(s,i){var r=this;appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,json_config:s.jsonConfig};window.authAPI.getCurrentUser(function(e,n){t.user_token=n&&n._id?n._id.toString():null,t.user_token?r._sendRequest("PUT","merchants",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})})},purchaseBundle:function(r,c){var a=this;function s(e){var s=e.sessionId,i=e.transactionId;i?s?appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,payment_provider:r.paymentProvider,transaction_id:i,stripe:{session_id:s},bundle_id:r.bundleId,access_token:r.access_token};window.authAPI.getCurrentUser(function(e,n){t.access_token=n&&n.accessToken?n.accessToken.toString():null,t.access_token?a._sendRequest("POST","credits/purchase",t,function(e,n){c&&c(e,n)}):c&&c({message:"no logged in user"})})}):c&&c("Missing sessionId parameter in purchase",null):c&&c("Missing transactionId parameter in purchase",null)}r?r.bundleId?window.authAPI.getCurrentUser(function(e,n){r.access_token=n&&n.accessToken?n.accessToken.toString():null,r.access_token?(r.paymentProvider="stripe",appApiKeys.get(function(e,n){n={public_key:n.creditsSystemPublicKey,payment_provider:r.paymentProvider,bundle_id:r.bundleId,memo:r.memo,x_ref_1:r.xRef1,x_ref_2:r.xRef2,x_ref_3:r.xRef3,access_token:r.access_token};a._sendRequest("POST","credits/transactions",n,function(e,t){e?c(e):t&&t.transactionId&&t.stripe&&t.stripe.clientReferenceId?new StripeAPI(a.context).purchase({items:[{sku:t.stripe.skuId}],clientReferenceId:t.stripe.clientReferenceId},function(e,n){e||s({transactionId:t.transactionId,sessionId:n.id})}):c({message:"missing stripe data in transaction"})})})):c&&c({message:"no logged in user"})}):c&&c("Missing bundleId parameter",null):c&&c("invalid params",null)},getMerchant:function(e,s){var i=this;appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,secret_key:i.secretKey};i._sendRequest("GET","merchants",t,function(e,n){s&&s(e,n)})})},getBundles:function(e,s){var i=this;appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,secret_key:i.secretKey};i._sendRequest("GET","bundles",t,function(e,n){s&&s(e,n)})})},deleteBundle:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,bundle_id:s.bundleId};window.authAPI.getCurrentUser(function(e,n){t.user_token=n&&n._id?n._id.toString():null,t.user_token?r._sendRequest("DELETE","bundles",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid params",null)},insertBundle:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,name:s.name,stripe_product_id:s.stripeProductId,description:s.description,credit_amount:s.creditAmount,user_token:s.userToken,image_url:s.imageUrl};window.authAPI.getCurrentUser(function(e,n){t.user_token=n&&n._id?n._id.toString():null,t.user_token?r._sendRequest("POST","bundles",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid params",null)},updateBundle:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,name:s.name,stripe_product_id:s.stripeProductId,description:s.description,credit_amount:s.creditAmount,bundle_id:s.bundleId,user_token:s.userToken,image_url:s.imageUrl};window.authAPI.getCurrentUser(function(e,n){t.user_token=n&&n._id?n._id.toString():null,t.user_token?r._sendRequest("PUT","bundles",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid params",null)},adjustCredits:function(s,i){var r=this;s?s.userToken?s.creditAmount?appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,user_token:s.userToken,credit_amount:s.creditAmount,memo:s.memo,x_ref_1:s.xRef1,x_ref_2:s.xRef2,x_ref_3:s.xRef3};window.authAPI.getCurrentUser(function(e,n){t.created_by_user_token=n&&n._id?n._id.toString():null,t.created_by_user_token?r._sendRequest("POST","credits/adjust",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid creditAmount",null):i&&i("invalid userToken",null):i&&i("invalid params",null)},consumeCredits:function(s,i){var r=this;s?s.creditAmount?appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,credit_amount:s.creditAmount,x_ref_1:s.xRef1,x_ref_2:s.xRef2,x_ref_3:s.xRef3,memo:s.memo};window.authAPI.getCurrentUser(function(e,n){t.access_token=n&&n.accessToken?n.accessToken.toString():null,t.access_token?r._sendRequest("POST","credits/consume",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("Missing creditAmount parameter",null):i&&i("invalid params",null)},transferCredits:function(s,i){var r=this;s?s.creditAmount?s.receiverUserToken||s.receiverUserEmail?appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,credit_amount:s.creditAmount,receiver_user_token:s.receiverUserToken,receiver_user_email:s.receiverUserEmail,x_ref_1:s.xRef1,x_ref_2:s.xRef2,x_ref_3:s.xRef3};window.authAPI.getCurrentUser(function(e,n){t.access_token=n&&n.accessToken?n.accessToken.toString():null,t.access_token?r._sendRequest("POST","credits/transfer",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("Missing (receiverUserToken or receiverUserEmail) parameter",null):i&&i("Missing creditAmount parameter",null):i&&i("invalid params",null)},searchTransactions:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey,secret_key:r.secretKey,users_tokens:s.usersTokens,page_size:s.pageSize,page_index:s.pageIndex,from_date:s.fromDate,to_date:s.toDate,x_ref_1:s.xRef1,x_ref_2:s.xRef2,x_ref_3:s.xRef3};window.authAPI.getCurrentUser(function(e,n){!t.public_key||(t.access_token=n&&n.accessToken?n.accessToken.toString():null,t.access_token)?r._sendRequest("POST","credits/transactions/search",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid params",null)},getUser:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={public_key:n.creditsSystemPublicKey};s.secretKey&&(t.secret_key=s.secretKey),window.authAPI.getCurrentUser(function(e,n){t.access_token=n&&n.accessToken?n.accessToken.toString():null,t.access_token?r._sendRequest("GET","credits/user",t,function(e,n){i&&i(e,n)}):i&&i({message:"no logged in user"})})}):i&&i("invalid params",null)},searchUsers:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t={secret_key:r.secretKey,users_tokens:s.usersTokens,page_size:s.pageSize,page_index:s.pageIndex};r._sendRequest("POST","credits/users",t,function(e,n){i&&i(e,n)})}):i&&i("invalid params",null)},getTransactionsLogs:function(s,i){var r=this;s?appApiKeys.get(function(e,n){var t;s.creditTransactionId?(t={secret_key:r.secretKey},r._sendRequest("GET","credits/transaction/"+s.creditTransactionId+"/logs",t,function(e,n){i&&i(e,n)})):i&&i("Missing creditTransactionId parameter",null)}):i&&i("invalid params",null)}};
"use strict";function StripeAPI(e){if(this.context=e,!this.context)throw Error("stripeAPI: invalid context")}StripeAPI.prototype={_sendRequest:function(e,n,i,t,s){var c="",o=new XMLHttpRequest,n=window.siteConfig.endPoints.gatewayHost+"/stripe/"+n;if("GET"===(e=e.toUpperCase())&&i){var a="?";for(u in i)i.hasOwnProperty(u)&&void 0!==i[u]&&(a+=u+"="+encodeURIComponent(i[u])+"&");n+=a=a.slice(0,-1)}else c=JSON.stringify(i);if(o.open(e,n,!0),o.setRequestHeader("Content-Type","application/json"),t)for(var u in t)t.hasOwnProperty(u)&&o.setRequestHeader(u,t[u]);o.onreadystatechange=function(){var e=null;try{e=JSON.parse(o.responseText)}catch(e){}4==o.readyState&&(200===o.status?s&&s(null,e):s&&s(e))},o.send(c)},_loadScript:function(e,n){var i=document.createElement("script");if(i.type="text/javascript",i.readyState?i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(i.onreadystatechange=null,n&&n())}:i.onload=function(){n&&n()},i.src=e.url,e.attr)for(var t in e.attr)i.setAttribute(t,e.attr[t]);for(var s=document.getElementsByTagName("script"),c=s.length;c--;)if(s[c].src==e.url)return n&&n(),!0;document.getElementsByTagName("head")[0].appendChild(i)},_guid:function(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},_openStripeCheckout:function(e,i){var n=e.items,t=e.successUrl,s=e.cancelUrl,c=e.submitType,o=e.customerEmail,a=e.sessionId,u=e.clientReferenceId,l=e.domain,r=e.events,p=this,m=null,d=!1,y=null,f=!1;function _(){window.richModal&&window.richModal.close()}function g(e){e=e||{},clearInterval(m),!e.invokeDismiss&&void 0!==e.invokeDismiss||_(),y&&y.close(),r&&"function"==typeof r.onClose&&r.onClose()}function v(){p._sendRequest("GET","checkout/sessions",{session_id:a,client_reference_id:u},{"x-api-key":p.context.apiKeys.awsApiPublicKey},function(e,n){n&&(f||(f=!0,g(),i&&i(e,n)))})}var w=l+"/payments/checkout?stripeKey="+p.context.apiKeys.stripePublicKey;function K(){(y=window.open(w,"_blank","location=no")).addEventListener("exit",function(){_()}),y.addEventListener("close",function(){_()}),m=setInterval(function(){y&&y.closed&&g(),"visible"==window.document.visibilityState?v():d||(d=!0,setTimeout(function(){d=!1,v()},6e4))},5e3),setTimeout(function(){g()},9e5)}a&&(w+="&sessionId="+encodeURIComponent(a)),u&&(w+="&clientReferenceId="+encodeURIComponent(u)),t&&(w+="&successUrl="+encodeURIComponent(t)),s&&(w+="&cancelUrl="+encodeURIComponent(s)),c&&(w+="&submitType="+encodeURIComponent(c)),o&&(w+="&customerEmail="+encodeURIComponent(o)),n&&(w+="&items="+encodeURIComponent(JSON.stringify(n))),window.bfUtils.isApp&&window.richModal.display({title:"",showDismissButton:!1,richContent:"
",action:{title:"Cancel",handler:function(){r({invokeDismiss:!1})}}}),!1===c.openPaymentWindow||d()},_checkApiKeys:function(i){var t=this;function e(){appApiKeys.get(function(e,n){t.context.apiKeys=n,i&&i()})}t.context.apiKeys&&t.context.apiKeys.awsApiPublicKey?i&&i():!window.appContext.currentApp.apiKeys||0===Object.keys(window.appContext.currentApp.apiKeys).length&&window.appContext.currentApp.apiKeys.constructor===Object?e():(t.context.apiKeys=window.appContext.currentApp.apiKeys,i&&i())},pay:function(e,i){var t=this;t._checkApiKeys(function(){t.context.apiKeys.stripePublicKey?t._loadScript({url:"https://checkout.stripe.com/checkout.js"},function(){var n=StripeCheckout.configure({key:t.context.apiKeys.stripePublicKey,image:"https://stripe.com/img/documentation/checkout/marketplace.png",locale:"auto",token:function(e){n.close(),i&&i(null,{sourceToken:e})}});n.open({}),window.addEventListener("popstate",function(){n.close()})}):i&&i("Missing stripePublicKey in context",null)})},charge:function(a,u){var l=this;l._checkApiKeys(function(){if(l.context.apiKeys.stripePublicKey)if(a){l.openPaymentWindow=a.openPaymentWindow;var e=[];if(!a.invoiceId){if(!a.items||0==a.items.length)return void(u&&u("Missing items",null));for(var n=0;n Unknown, an event was received and we do not know what it is")}},successHandler:function(e){},errorHandler:function(e){console.error("error:"+e)}},pushiOSNotificationHandler.prototype={onRegistered:function(e){push.deviceId=e},register:function(){if(navigator.onLine)try{this.pushNotification.register(this.onRegistered,this.errorHandler,{badge:"true",sound:"true",alert:"true",ecb:"_oldPush.notificationHandler.onNotification"})}catch(e){console.error("There was an error on this page.\n\nError description: "+e.message+"\n\n")}else console.warn("offline: not attempting to register push notifications")},onNotification:function(e){var i=new CustomEvent("pushNotificationsOnReceived",{detail:e});document.dispatchEvent(i),e?(i={},"social"==e.messageType?i.buttons=["Dismiss"]:i.buttons=["Dismiss","Show Details"],e.alert&&(push.decrementBadge(),push.displayMessage(e,i))):window.location.hash="/pushHistory",e.sound},tokenHandler:function(e){push.deviceId=e},successHandler:function(e){this.onRegistered(e)},errorHandler:function(e){console.error("ios error:"+e)}},bfUtils.isMobileDevice&&appState.subscribe({state:appState.RUNNING},function(){window.capabilities&&window.capabilities.pushNotification?(console.log("running old plugin for push notification"),_oldPush.init()):(console.log("running new plugin phonegap-plugin-push"),push.init())}),window.testNotification=function(){push.displayMessage({message:"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
",title:"Notification Title",alert:"This is the alert, not sure what it means",messageType:null,additionalData:{notificationId:"5b5f9bbe39003904daa4f093",coldstart:!0,foreground:!0}},{buttons:["Dismiss","Show Details"]})};
+"use strict";var _push;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}var push=(_defineProperty(_push={get instance(){return window.capabilities&&window.capabilities.pushNotification?_oldPush:"undefined"!=typeof bridge&&bridge.capabilities&&bridge.capabilities.firebase&&bridge.capabilities.firebase.messaging?push_firebase:push_phonegap},init:function(){return window.push=this,window.capabilities&&window.capabilities.pushNotification?(console.log("running old plugin for push notification"),_oldPush.init()):"undefined"!=typeof bridge&&bridge.capabilities&&bridge.capabilities.firebase&&bridge.capabilities.firebase.messaging?push_firebase.init():(console.log("running new plugin phonegap-plugin-push"),void push_phonegap.init())},get deviceId(){return this.instance.deviceId},get platform(){return"undefined"!=typeof device&&device.platform&&device.platform.toLowerCase()||""},get getBadgeNumber(){return this.instance.getBadgeNumber},get decrementBadge(){return this.instance.decrementBadge},get clearBadge(){return this.instance.clearBadge},get displayMessage(){return this.instance.displayMessage},getNotificationData:function(e,i,t,n){window.bfUtils.http.jsonp(e,i).success(function(e){e=e&&e.result[0]?e.result[0]:{actionItem:!1};t=Object.assign(t,e),n(null,t)}).catch(n)}},"displayMessage",function(e,i){i=i||{};push.trackPushNotifications({eventName:"push_notification/viewed",payload:e}),console.log("pushNotifications#displayMessage L152",e),localStorage.payload=JSON.stringify(e);try{var t=e._id||e.notificationId||e.additionalData.notificationId;if(console.log("Checking message type",e.messageType,e),e.additionalData&&"social"===e.additionalData.messageType)return e.title="Alert",e.richContent=e.message,richModal.display(e),void console.log("Got social notification",e);var n=window.siteConfig.endPoints.push+"/src/server.js?callback=JSON_CALLBACK",o={params:{data:{method:"notifications/get",params:{appID:window.appContext.currentApp.appId.toString(),notificationID:t}}}};push.getNotificationData(n,o,e,function(e,i){if(e)return console.error(e);e=Object.assign({},i);i.actionItem&&(e.action={title:i.actionItem&&i.actionItem.title?i.actionItem.title:"View",handler:function(){var e=new ActionItemsAPI;push.trackPushNotifications({eventName:"push_notification/clicked",payload:i}),window.closeSideMenu&&window.closeSideMenu(),e.execute(i.actionItem,function(e,i){console.info("Action Taken!")})}}),e.richContent=e.richMessage||e.message,e.subtitle="Sent "+moment(e.sendAfter).fromNow(),richModal.display(e)})}catch(e){console.error("Failed to parse push notification",e)}}),_defineProperty(_push,"notificationsTracked",{}),_defineProperty(_push,"trackPushNotifications",function(e){var i,t,n;"undefined"!=typeof device&&"undefined"!=typeof AnalyticsAPI&&e&&e.payload&&e.eventName&&((i=e.payload._id||e.payload.notificationId||e.payload.additionalData.notificationId)&&(push.notificationsTracked||(push.notificationsTracked={}),(t=(t=push.notificationsTracked[i])||(push.notificationsTracked[i]={events:[]})).events||(t.events=[]),-1 Unknown, an event was received and we do not know what it is")}},successHandler:function(e){},errorHandler:function(e){console.error("error:"+e)}},pushiOSNotificationHandler.prototype={onRegistered:function(e){push.deviceId=e},register:function(){if(navigator.onLine)try{this.pushNotification.register(this.onRegistered,this.errorHandler,{badge:"true",sound:"true",alert:"true",ecb:"_oldPush.notificationHandler.onNotification"})}catch(e){console.error("There was an error on this page.\n\nError description: "+e.message+"\n\n")}else console.warn("offline: not attempting to register push notifications")},onNotification:function(e){var i=new CustomEvent("pushNotificationsOnReceived",{detail:e});document.dispatchEvent(i),e?(i={},"social"==e.messageType?i.buttons=["Dismiss"]:i.buttons=["Dismiss","Show Details"],e.alert&&(push.decrementBadge(),push.displayMessage(e,i))):window.location.hash="/pushHistory",e.sound},tokenHandler:function(e){push.deviceId=e},successHandler:function(e){this.onRegistered(e)},errorHandler:function(e){console.error("ios error:"+e)}},bfUtils.isMobileDevice&&appState.subscribe({state:appState.RUNNING},function(){window.capabilities&&window.capabilities.pushNotification?(console.log("running old plugin for push notification"),_oldPush.init()):(console.log("running new plugin phonegap-plugin-push"),push.init())}),window.testNotification=function(){push.displayMessage({message:"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti officiis perferendis expedita rerum delectus dolor neque veniam necessitatibus fuga cum voluptatibus placeat, totam voluptate, nisi reprehenderit odio porro cumque ipsa.
",title:"Notification Title",alert:"This is the alert, not sure what it means",messageType:null,additionalData:{notificationId:"5b5f9bbe39003904daa4f093",coldstart:!0,foreground:!0}},{buttons:["Dismiss","Show Details"]})};
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,n){for(var t=0;t
").concat(a?''+a+"":""),showCancelButton:!0,actionButtons:[{text:"Generate",type:"success"}]},function(t,e){var n;return t?o(t):void("success"===(null==e||null===(n=e.selectedButton)||void 0===n?void 0:n.type)&&(n=document.querySelector("#aiDataRequest"),o(null,{userMessage:n.value})))})})},AiAPI.prototype.showSeederCSVPrompt=function(t,o){var e=t.sampleCSV,n=t.showResetAndSaveButton,a=t.hintText;if("string"!=typeof e)return o("Invalid parameter 'sampleCSV'. It must be a valid string.");var i=new DialogAPI(this.context),t=[{text:"Save",type:"success"}];n&&t.unshift({type:"warning",text:"Reset And Save"}),i._show({isMessageHTML:!0,title:"AI Import Data",message:'