Current File : /home/kelaby89/www/wp/wp-content/plugins/happy-elementor-addons/assets/admin/js/wizard.min.js
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _createForOfIteratorHelper(t,e){var r,n,i,a,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(o)return i=!(n=!0),{s:function(){o=o.call(t)},n:function(){var t=o.next();return n=t.done,t},e:function(t){i=!0,r=t},f:function(){try{n||null==o.return||o.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return o&&(t=o),a=0,{s:e=function(){},n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _regeneratorRuntime(){_regeneratorRuntime=function(){return o};var c,o={},t=Object.prototype,u=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(c){a=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i,a,o,s,e=e&&e.prototype instanceof v?e:v,e=Object.create(e.prototype),n=new k(n||[]);return l(e,"_invoke",{value:(i=t,a=r,o=n,s=p,function(t,e){if(s===f)throw Error("Generator is already running");if(s===y){if("throw"===t)throw e;return{value:c,done:!0}}for(o.method=t,o.arg=e;;){var r=o.delegate;if(r){r=function t(e,r){var n=r.method,i=e.iterator[n];if(i===c)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=c,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;n=d(i,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,g;i=n.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}(r,o);if(r){if(r===g)continue;return r}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(s===p)throw s=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s=f;r=d(i,a,o);if("normal"===r.type){if(s=o.done?y:h,r.arg===g)continue;return{value:r.arg,done:o.done}}"throw"===r.type&&(s=y,o.method="throw",o.arg=r.arg)}})}),e}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var p="suspendedStart",h="suspendedYield",f="executing",y="completed",g={};function v(){}function w(){}function m(){}var e={},b=(a(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(W([]))),L=(b&&b!==t&&u.call(b,n)&&(e=b),m.prototype=v.prototype=Object.create(e));function _(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function C(o,s){var e;l(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,i){var a,t=d(o[t],o,r);if("throw"!==t.type)return(r=(a=t.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?s.resolve(r.__await).then(function(t){e("next",t,n,i)},function(t){e("throw",t,n,i)}):s.resolve(r).then(function(t){a.value=t,n(a)},function(t){return e("throw",t,n,i)});i(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function W(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(u.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=c,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(L,"constructor",{value:w.prototype=m,configurable:!0}),l(m,"constructor",{value:w,configurable:!0}),w.displayName=a(m,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,a(t,i,"GeneratorFunction")),t.prototype=Object.create(L),t},o.awrap=function(t){return{__await:t}},_(C.prototype),a(C.prototype,r,function(){return this}),o.AsyncIterator=C,o.async=function(t,e,r,n,i){void 0===i&&(i=Promise);var a=new C(s(t,e,r,n),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(L),a(L,i,"Generator"),a(L,n,function(){return this}),a(L,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=W,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&u.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=u.call(i,"catchLoc"),s=u.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(r=i.completion).type&&(n=r.arg,T(i)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:W(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=c),g}},o}function asyncGeneratorStep(t,e,r,n,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function _asyncToGenerator(s){return function(){var t=this,o=arguments;return new Promise(function(e,r){var n=s.apply(t,o);function i(t){asyncGeneratorStep(n,e,r,i,a,"next",t)}function a(t){asyncGeneratorStep(n,e,r,i,a,"throw",t)}i(void 0)})}}var Wizard={data:function(){return{loaded:!1,screen:0,hasCache:!1,currentPage:"welcome",userType:"normal",hasConsent:!0,steps:[{key:"welcome",name:"Welcome",isComplete:!1},{key:"widgets",name:"Widgets",isComplete:!1},{key:"features",name:"Features",isComplete:!1},{key:"bepro",name:"Be a pro!",isComplete:!1},{key:"contribute",name:"Contribute",isComplete:!1},{key:"congrats",name:"Congrats",isComplete:!1}],widgetList:[],disabledWidgets:[],featureList:[],disabledFeatures:[],settings:{welcome:{userType:null},widgets:[],features:null,contribute:!1,all:[],checkedWidgets:[]},widgetMore:!0}},mounted:function(){this.fetchCache(),this.getCurrentPage()},methods:{fetchWidgetData:function(){var r=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=window.HappyWizard.apiBase+"/widgets/all/",t.next=3,fetch(e,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(t){return t.json()}).then(function(t){t&&(r.widgetList=t.all,r.disabledWidgets=t.disabled)}).catch(function(t){console.error("Error:",t)});case 3:case"end":return t.stop()}},t)}))()},fetchCache:function(){var r=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=window.HappyWizard.apiBase+"/wizard/cache",t.next=3,fetch(e,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(t){return t.json()}).then(function(t){t.data?(t.data.steps&&(r.steps=t.data.steps),t.data.currentPage&&(r.currentPage=t.data.currentPage),t.data.userType&&(r.userType=t.data.userType),t.data.widgets&&(r.widgetList=t.data.widgets),t.data.widgets_disabled&&(r.disabledWidgets=t.data.widgets_disabled),t.data.features&&(r.featureList=t.data.features),t.data.features_disabled&&(r.disabledFeatures=t.data.features_disabled),r.loaded=!0):r.fetchPreset(r.userType)}).catch(function(t){console.error("Error:",t)});case 3:case"end":return t.stop()}},t)}))()},fetchPreset:function(r){var n=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=window.HappyWizard.apiBase+"/wizard/preset/"+r,t.next=3,fetch(e,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(t){return t.json()}).then(function(t){t&&(n.widgetList=t.widgets.all,n.disabledWidgets=t.widgets.disabled,n.featureList=t.features.all,n.disabledFeatures=t.features.disabled),n.loaded=!0}).catch(function(t){console.error("Error:",t)});case 3:case"end":return t.stop()}},t)}))()},saveWizardData:function(){var i=arguments,a=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var e,r,n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=0<i.length&&void 0!==i[0]?i[0]:"",r=window.HappyWizard.apiBase+"/wizard/save",n={widget:a.disabledWidgets,features:a.disabledFeatures,consent:a.consent?"yes":"no"},"cache"==e&&(r=window.HappyWizard.apiBase+"/wizard/save-cache",n={currentPage:a.currentPage,userType:a.userType,steps:a.steps,widgets:a.widgetList,widgets_disabled:a.disabledWidgets,features:a.featureList,features_disabled:a.disabledFeatures,consent:a.hasConsent?"yes":"no"}),t.next=6,fetch(r,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce},body:JSON.stringify(n),contentType:"application/json; charset=utf-8"}).then(function(t){return t.json()}).then(function(t){t&&200===t.status&&"cache"!==e&&window.open(window.HappyWizard.haAdmin,"_self")}).catch(function(t){console.error("Error:",t)});case 6:case"end":return t.stop()}},t)}))()},endWizard:function(){return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(confirm("Head’s up. This action is non reversible and you won’t be able to see this wizard again. Proceed?"))return e=window.HappyWizard.apiBase+"/wizard/skip",t.next=5,fetch(e,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(t){return t.json()}).then(function(t){t&&200===t.status&&window.open(window.HappyWizard.haAdmin,"_self")}).catch(function(t){console.error("Error:",t)});t.next=5;break;case 5:case"end":return t.stop()}},t)}))()},setUserType:function(t){this.userType=t,this.fetchPreset(t)},setTab:function(t){t&&("buypro"==t?window.open("https://happyaddons.com/go/get-pro","_blank").focus():"done"==t?this.saveWizardData():(this.setStepComplete(this.currentPage),this.currentPage=t,this.screen=t),this.saveWizardData("cache"))},setStepComplete:function(t){var e,r=_createForOfIteratorHelper(this.steps);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.key==t){n.isComplete=!0;break}}}catch(t){r.e(t)}finally{r.f()}},revealWidgetList:function(){this.widgetMore=!1},getCurrentPage:function(){var t,e=_createForOfIteratorHelper(this.steps);try{for(e.s();!(t=e.n()).done;){var r=t.value;if(0==r.isComplete){this.currentPage=r.key;break}}}catch(t){e.e(t)}finally{e.f()}return this.currentPage},goNext:function(t){this.setTab(t)},allAdd:function(t){var e=this.widgetList[t],r=this;return Object.keys(e).forEach(function(t){e[t].is_active=!0,r.isActive(e[t].slug,!1)}),-1===this.settings.all.indexOf(t)&&this.settings.all.push(t),e},allRemove:function(n){var e=this.widgetList[n],r=this;return Object.keys(e).forEach(function(t){e[t].is_active=!1,r.isActive(e[t].slug,!0)}),this.settings.all=this.settings.all.filter(function(t,e,r){return t!=n}),e},isActive:function(n,t){!0===t?-1===this.disabledWidgets.indexOf(n)&&this.disabledWidgets.push(n):this.disabledWidgets=this.disabledWidgets.filter(function(t,e,r){return t!=n})},isFeatureActive:function(n,t){!0===t?-1===this.disabledFeatures.indexOf(n)&&this.disabledFeatures.push(n):this.disabledFeatures=this.disabledFeatures.filter(function(t,e,r){return t!=n})},makeTitle:function(t){t=t.replace(/-/g," ").replace("and","&");return t.charAt(0).toUpperCase()+t.slice(1)},makeLabel:function(t){return t?"PRO":"FREE"},sortByTitle:function(t){return t.sort(function(t,e){return t.title<e.title?-1:1})}},watch:{"settings.checkedWidgets":function(t){},"settings.all":function(t){},hasConsent:function(t){}},computed:{}},app=Vue.createApp(Wizard);app.config.globalProperties.window=window,app.component("ha-step",{props:{active:String,complete:Boolean,step:String,title:String,index:Number},emits:["setTab"],computed:{isActive:function(){return this.active==this.step}},methods:{handleClick:function(t){this.complete&&this.$emit("setTab",t)}},template:'<div class="ha-stepper__step" :class="{ \'is-complete\': this.complete, \'is-active\': this.isActive }" @click="handleClick(step)">\n\t<button class="ha-stepper__step-label-wrapper">\n\t\t<div class="ha-stepper__step-icon">\n\t\t\t<span class="ha-stepper__step-number">{{index}}</span>\n\t\t\t<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M5.09467 10.784L0.219661 5.98988C-0.0732203 5.70186 -0.0732203 5.23487 0.219661 4.94682L1.2803 3.90377C1.57318 3.61572 2.04808 3.61572 2.34096 3.90377L5.625 7.13326L12.659 0.216014C12.9519 -0.0720048 13.4268 -0.0720048 13.7197 0.216014L14.7803 1.25907C15.0732 1.54709 15.0732 2.01408 14.7803 2.30213L6.15533 10.784C5.86242 11.072 5.38755 11.072 5.09467 10.784Z" fill="white"/>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class="ha-stepper__step-text">\n\t\t\t<span class="ha-stepper__step-label">{{title}}</span>\n\t\t</div>\n\t</button>\n</div>\n<div class="ha-stepper__step-divider">\n<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.2218 4.80762C13.8313 4.4171 13.1981 4.4171 12.8076 4.80762C12.4171 5.19815 12.4171 5.83131 12.8076 6.22184L14.2218 4.80762ZM18.4853 10.4853L19.1924 11.1924L19.8995 10.4853L19.1924 9.77818L18.4853 10.4853ZM12.8076 14.7487C12.4171 15.1393 12.4171 15.7724 12.8076 16.163C13.1981 16.5535 13.8313 16.5535 14.2218 16.163L12.8076 14.7487ZM7.19238 4.80762C6.80186 4.4171 6.16869 4.4171 5.77817 4.80762C5.38764 5.19814 5.38764 5.83131 5.77817 6.22183L7.19238 4.80762ZM11.4558 10.4853L12.1629 11.1924L12.87 10.4853L12.1629 9.77818L11.4558 10.4853ZM5.77817 14.7487C5.38764 15.1393 5.38764 15.7724 5.77817 16.163C6.16869 16.5535 6.80186 16.5535 7.19238 16.163L5.77817 14.7487ZM12.8076 6.22184L17.7782 11.1924L19.1924 9.77818L14.2218 4.80762L12.8076 6.22184ZM17.7782 9.77818L12.8076 14.7487L14.2218 16.163L19.1924 11.1924L17.7782 9.77818ZM5.77817 6.22183L10.7487 11.1924L12.1629 9.77818L7.19238 4.80762L5.77817 6.22183ZM10.7487 9.77818L5.77817 14.7487L7.19238 16.163L12.1629 11.1924L10.7487 9.77818Z" fill="currentColor"/>\n</svg>\n</div>'}),app.component("ha-nav",{props:{prev:String,next:String,done:String,bepro:String},emits:["setTab"],template:'<div class="ha-setup-wizard__nav">\n        <button class="ha-setup-wizard__nav_prev" v-if="prev" @click="$emit(\'setTab\',prev)">\n            <svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">\n                <path d="M12 3.33333H2.55333L4.94 0.94L4 0L0 4L4 8L4.94 7.06L2.55333 4.66667H12V3.33333Z" fill="black"/>\n            </svg>\n            <span>Back</span>\n        </button>\n\t\t<button class="ha-setup-wizard__nav_bepro" v-if="bepro" @click="$emit(\'setTab\',\'buypro\')">\n\t\t\t<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M19.8347 5.42149C19.8347 6.21488 19.1736 6.87603 18.3802 6.87603C18.2479 6.87603 18.2479 6.87603 18.1157 6.87603L15.8678 12.9587H3.96694L1.71901 6.87603C1.58678 6.87603 1.58678 6.87603 1.45455 6.87603C0.661157 6.87603 0 6.21488 0 5.42149C0 4.6281 0.661157 3.96694 1.45455 3.96694C2.24793 3.96694 2.90909 4.6281 2.90909 5.42149C2.90909 5.68595 2.90909 5.81818 2.77686 6.08264L5.02479 7.40496C5.55372 7.66942 6.08264 7.53719 6.34711 7.00826L8.99174 2.64463C8.59504 2.38017 8.46281 1.98347 8.46281 1.45455C8.46281 0.661157 9.12397 0 9.91736 0C10.7107 0 11.3719 0.661157 11.3719 1.45455C11.3719 1.98347 11.1074 2.38017 10.843 2.64463L13.3554 7.00826C13.6198 7.53719 14.281 7.66942 14.6777 7.40496L16.9256 6.08264C16.7934 5.95041 16.7934 5.68595 16.7934 5.42149C16.7934 4.6281 17.4545 3.96694 18.2479 3.96694C19.0413 3.96694 19.8347 4.6281 19.8347 5.42149ZM16.9256 14.4132V15.4711C16.9256 15.7355 16.6612 16 16.3967 16H3.43802C3.17355 16 2.90909 15.7355 2.90909 15.4711V14.4132C2.90909 14.1488 3.17355 13.8843 3.43802 13.8843H16.3967C16.6612 13.8843 16.9256 14.1488 16.9256 14.4132Z" fill="#FFC5C5"/>\n\t\t\t</svg>\t\t\n\t\t\t<span>Be A Pro</span>\n\t\t</button>\n        <button class="ha-setup-wizard__nav_next" v-if="next" @click="$emit(\'setTab\',next)"><span>Next</span></button>\n        <button class="ha-setup-wizard__nav_done" v-if="done" @click="$emit(\'setTab\',\'done\')"><span>Done</span></button>\n    </div>\n\t'}),app.mount("#ha-setup-wizard");
Page not found – Hello World !