1!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=9)}([function(e,t,n){"use strict";(function(e){n.d(t,"e",function(){return i}),n.d(t,"p",function(){return r}),n.d(t,"a",function(){return s}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return a}),n.d(t,"o",function(){return c}),n.d(t,"q",function(){return u}),n.d(t,"t",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"r",function(){return h}),n.d(t,"s",function(){return f}),n.d(t,"k",function(){return p}),n.d(t,"m",function(){return m}),n.d(t,"j",function(){return _}),n.d(t,"l",function(){return y}),n.d(t,"g",function(){return g}),n.d(t,"f",function(){return v}),n.d(t,"h",function(){return b}),n.d(t,"n",function(){return w}),n.d(t,"b",function(){return P});var i="1.13.7",r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},s=Array.prototype,o=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,c=s.push,u=s.slice,l=o.toString,d=o.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,p=Array.isArray,m=Object.keys,_=Object.create,y=h&&ArrayBuffer.isView,g=isNaN,v=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],P=Math.pow(2,53)-1}).call(t,n(6))},function(e,t,n){e.exports=n(42)},function(e,t,n){"use strict";var i=n(5);function r(){}var s=null,o={};function a(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._40=0,this._65=0,this._55=null,this._72=null,e!==r&&f(e,this)}function c(e,t){for(;3===e._65;)e=e._55;if(a._37&&a._37(e),0===e._65)return 0===e._40?(e._40=1,void(e._72=t)):1===e._40?(e._40=2,void(e._72=[e._72,t])):void e._72.push(t);!function(e,t){i(function(){var n=1===e._65?t.onFulfilled:t.onRejected;if(null!==n){var i=function(e,t){try{return e(t)}catch(e){return s=e,o}}(n,e._55);i===o?l(t.promise,s):u(t.promise,i)}else 1===e._65?u(t.promise,e._55):l(t.promise,e._55)})}(e,t)}function u(e,t){if(t===e)return l(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var n=function(e){try{return e.then}catch(e){return s=e,o}}(t);if(n===o)return l(e,s);if(n===e.then&&t instanceof a)return e._65=3,e._55=t,void d(e);if("function"==typeof n)return void f(n.bind(t),e)}e._65=1,e._55=t,d(e)}function l(e,t){e._65=2,e._55=t,a._87&&a._87(e,t),d(e)}function d(e){if(1===e._40&&(c(e,e._72),e._72=null),2===e._40){for(var t=0;t<e._72.length;t++)c(e,e._72[t]);e._72=null}}function h(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1,i=function(e,t,n){try{e(t,n)}catch(e){return s=e,o}}(e,function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,l(t,e))});n||i!==o||(n=!0,l(t,s))}e.exports=a,a._37=null,a._87=null,a._61=r,a.prototype.then=function(e,t){if(this.constructor!==a)return function(e,t,n){return new e.constructor(function(i,s){var o=new a(r);o.then(i,s),c(e,new h(t,n,o))})}(this,e,t);var n=new a(r);return c(this,new h(e,t,n)),n}},function(e,t){e.exports=moment},function(e,t){var n=2;function i(e){this.state=n,this.value=void 0,this.deferred=[];var t=this;try{e(function(e){t.resolve(e)},function(e){t.reject(e)})}catch(e){t.reject(e)}}i.reject=function(e){return new i(function(t,n){n(e)})},i.resolve=function(e){return new i(function(t,n){t(e)})},i.all=function(e){return new i(function(t,n){var i=0,r=[];function s(n){return function(s){r[n]=s,(i+=1)===e.length&&t(r)}}0===e.length&&t(r);for(var o=0;o<e.length;o+=1)e[o].then(s(o),n)})},i.race=function(e){return new i(function(t,n){for(var i=0;i<e.length;i+=1)e[i].then(t,n)})};var r=i.prototype;r.resolve=function(e){var t=this;if(t.state===n){if(e===t)throw new TypeError("Promise settled with itself.");var i=!1;try{var r=e&&e.then;if(null!==e&&"object"==typeof e&&"function"==typeof r)return void r.call(e,function(e){i||t.resolve(e),i=!0},function(e){i||t.reject(e),i=!0})}catch(e){return void(i||t.reject(e))}t.state=0,t.value=e,t.notify()}},r.reject=function(e){if(this.state===n){if(e===this)throw new TypeError("Promise settled with itself.");this.state=1,this.value=e,this.notify()}},r.notify=function(){var e=this;o(function(){if(e.state!==n)for(;e.deferred.length;){var t=e.deferred.shift(),i=t[0],r=t[1],s=t[2],o=t[3];try{0===e.state?s("function"==typeof i?i.call(void 0,e.value):e.value):1===e.state&&("function"==typeof r?s(r.call(void 0,e.value)):o(e.value))}catch(e){o(e)}}})},r.catch=function(e){return this.then(void 0,e)},r.then=function(e,t){var n=this;return new i(function(i,r){n.deferred.push([e,t,i,r]),n.notify()})};var s=[],o=function(e){s.push(e),1===s.length&&o.async()};if(o.run=function(){for(;s.length;)s[0](),s.shift()},window.MutationObserver){var a=document.createElement("div");new MutationObserver(o.run).observe(a,{attributes:!0}),o.async=function(){a.setAttribute("x",0)}}else o.async=function(){setTimeout(o.run)};e.exports=window.Promise||i},function(e,t,n){"use strict";(function(t){function n(e){r.length||(i(),!0),r[r.length]=e}e.exports=n;var i,r=[],s=0,o=1024;function a(){for(;s<r.length;){var e=s;if(s+=1,r[e].call(),s>o){for(var t=0,n=r.length-s;t<n;t++)r[t]=r[t+s];r.length-=s,s=0}}r.length=0,s=0,!1}var c,u,l,d=void 0!==t?t:self,h=d.MutationObserver||d.WebKitMutationObserver;function f(e){return function(){var t=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(t),clearInterval(n),e()}}}"function"==typeof h?(c=1,u=new h(a),l=document.createTextNode(""),u.observe(l,{characterData:!0}
1),i=function(){c=-c,l.data=c}):i=f(a),n.requestFlush=i,n.makeRequestCallFromTimer=f}).call(t,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={};n.d(i,"VERSION",function(){return r.e}),n.d(i,"restArguments",function(){return s}),n.d(i,"isObject",function(){return o}),n.d(i,"isNull",function(){return a}),n.d(i,"isUndefined",function(){return c}),n.d(i,"isBoolean",function(){return u}),n.d(i,"isElement",function(){return l}),n.d(i,"isString",function(){return h}),n.d(i,"isNumber",function(){return f}),n.d(i,"isDate",function(){return p}),n.d(i,"isRegExp",function(){return m}),n.d(i,"isError",function(){return _}),n.d(i,"isSymbol",function(){return y}),n.d(i,"isArrayBuffer",function(){return g}),n.d(i,"isDataView",function(){return x}),n.d(i,"isArray",function(){return S}),n.d(i,"isFunction",function(){return w}),n.d(i,"isArguments",function(){return I}),n.d(i,"isFinite",function(){return T}),n.d(i,"isNaN",function(){return D}),n.d(i,"isTypedArray",function(){return N}),n.d(i,"isEmpty",function(){return Y}),n.d(i,"isMatch",function(){return j}),n.d(i,"isEqual",function(){return z}),n.d(i,"isMap",function(){return re}),n.d(i,"isWeakMap",function(){return se}),n.d(i,"isSet",function(){return oe}),n.d(i,"isWeakSet",function(){return ae}),n.d(i,"keys",function(){return U}),n.d(i,"allKeys",function(){return Z}),n.d(i,"values",function(){return ce}),n.d(i,"pairs",function(){return ue}),n.d(i,"invert",function(){return le}),n.d(i,"functions",function(){return de}),n.d(i,"methods",function(){return de}),n.d(i,"extend",function(){return fe}),n.d(i,"extendOwn",function(){return pe}),n.d(i,"assign",function(){return pe}),n.d(i,"defaults",function(){return me}),n.d(i,"create",function(){return ye}),n.d(i,"clone",function(){return ge}),n.d(i,"tap",function(){return ve}),n.d(i,"get",function(){return Ee}),n.d(i,"has",function(){return Ce}),n.d(i,"mapObject",function(){return De}),n.d(i,"identity",function(){return ke}),n.d(i,"constant",function(){return F}),n.d(i,"noop",function(){return Fe}),n.d(i,"toPath",function(){return be}),n.d(i,"property",function(){return Se}),n.d(i,"propertyOf",function(){return Me}),n.d(i,"matcher",function(){return xe}),n.d(i,"matches",function(){return xe}),n.d(i,"times",function(){return Be}),n.d(i,"random",function(){return Re}),n.d(i,"now",function(){return $e}),n.d(i,"escape",function(){return qe}),n.d(i,"unescape",function(){return Ve}),n.d(i,"templateSettings",function(){return Ue}),n.d(i,"template",function(){return He}),n.d(i,"result",function(){return ze}),n.d(i,"uniqueId",function(){return Qe}),n.d(i,"chain",function(){return Xe}),n.d(i,"iteratee",function(){return Ie}),n.d(i,"partial",function(){return tt}),n.d(i,"bind",function(){return nt}),n.d(i,"bindAll",function(){return st}),n.d(i,"memoize",function(){return ot}),n.d(i,"delay",function(){return at}),n.d(i,"defer",function(){return ct}),n.d(i,"throttle",function(){return ut}),n.d(i,"debounce",function(){return lt}),n.d(i,"wrap",function(){return dt}),n.d(i,"negate",function(){return ht}),n.d(i,"compose",function(){return ft}),n.d(i,"after",function(){return pt}),n.d(i,"before",function(){return mt}),n.d(i,"once",function(){return _t}),n.d(i,"findKey",function(){return yt}),n.d(i,"findIndex",function(){return vt}),n.d(i,"findLastIndex",function(){return bt}),n.d(i,"sortedIndex",function(){return wt}),n.d(i,"indexOf",function(){return Et}),n.d(i,"lastIndexOf",function(){return Ct}),n.d(i,"find",function(){return kt}),n.d(i,"detect",function(){return kt}),n.d(i,"findWhere",function(){return xt}),n.d(i,"each",function(){return St}),n.d(i,"forEach",function(){return St}),n.d(i,"map",function(){return At}),n.d(i,"collect",function(){return At}),n.d(i,"reduce",function(){return It}),n.d(i,"foldl",function(){return It}),n.d(i,"inject",function(){return It}),n.d(i,"reduceRight",function(){return Tt}),n.d(i,"foldr",function(){return Tt}),n.d(i,"filter",function(){return Dt}),n.d(i,"select",function(){return Dt}),n.d(i,"reject",function(){return Ft}),n.d(i,"every",function(){return Mt}),n.d(i,"all",function(){return Mt}),n.d(i,"some",function(){return Bt}),n.d(i,"any",function(){return Bt}),n.d(i,"contains",function(){return Rt}),n.d(i,"includes",function(){return Rt}),n.d(i,"include",function(){return Rt}),n.d(i,"invoke",function(){return $t}),n.d(i,"pluck",function(){return Lt}),n.d(i,"where",function(){return Nt}),n.d(i,"max",function(){return qt}),n.d(i,"min",function(){return Vt}),n.d(i,"shuffle",function(){return Wt}),n.d(i,"sample",function(){return jt}),n.d(i,"sortBy",function(){return Kt}),n.d(i,"groupBy",function(){return Ht}),n.d(i,"indexBy",function(){return zt}),n.d(i,"countBy",function(){return Zt}),n.d(i,"partition",function(){return Qt}),n.d(i,"toArray",function(){return Yt}),n.d(i,"size",function(){return Xt}),n.d(i,"pick",function(){return en}),n.d(i,"omit",function(){return tn}),n.d(i,"first",function(){return rn}),n.d(i,"head",function(){return rn}),n.d(i,"take",function(){return rn}),n.d(i,"initial",function(){return nn}),n.d(i,"last",function(){return on}),n.d(i,"rest",function(){return sn}),n.d(i,"tail",function(){return sn}),n.d(i,"drop",function(){return sn}),n.d(i,"compact",function(){return an}),n.d(i,"flatten",function(){return cn}),n.d(i,"without",function(){return ln}),n.d(i,"uniq",function(){return dn}),n.d(i,"unique",function(){return dn}),n.d(i,"union",function(){return hn}),n.d(i,"intersection",function(){return fn}),n.d(i,"difference",function(){return un}),n.d(i,"unzip",function(){return pn}),n.d(i,"transpose",function(){return pn}),n.d(i,"zip",function(){return mn}),n.d(i,"object",function(){return _n}),n.d(i,"range",function(){return yn}),n.d(i,"chunk",function(){return gn}),n.d(i,"mixin",function(){return bn}),n.d(i,"default",function(){return wn});var r=n(0);function s(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),i=Array(n),r=0;r<n;r++)i[r]=arguments[r+t];switch(t){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i);case 2:return e.call(this,arguments[0],arguments[1],i)}var s=Array(t+1);for(r=0;r<t;r++)s[r]=arguments[r];return s[t]=i,e.apply(this,s)}}function o(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function a(e){return null===e}function c(e){return void 0===e}function u(e){return!0===e||!1===e||"[object Boolean]"===r.t.call(e)}function l(e){return!(!e||1!==e.nodeType)}function d(e){var t="[object "+e+"]";return function(e){return r.t.call(e)===t}}var h=d("String"),f=d("Number"),p=d("Date"),m=d("RegExp"),_=d("Error"),y=d("Symbol"),g=d("ArrayBuffer"),v=d("Function"),b=r.p.document&&r.p.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof b&&(v=function(e){return"function"==typeof e||!1});var w=v,P=d("Object"),E=r.s&&(!/\[native code\]/.test(String(DataView))||P(new DataView(new ArrayBuffer(8)))
vendor: 5,583 bytes, line 1
1),C="undefined"!=typeof Map&&P(new Map),k=d("DataView");var x=E?function(e){return null!=e&&w(e.getInt8)&&g(e.buffer)}:k,S=r.k||d("Array");function A(e,t){return null!=e&&r.i.call(e,t)}var O=d("Arguments");!function(){O(arguments)||(O=function(e){return A(e,"callee")})}();var I=O;function T(e){return!y(e)&&Object(r.f)(e)&&!isNaN(parseFloat(e))}function D(e){return f(e)&&Object(r.g)(e)}function F(e){return function(){return e}}function M(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=r.b}}function B(e){return function(t){return null==t?void 0:t[e]}}var R=B("byteLength"),$=M(R),L=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var N=r.r?function(e){return r.l?Object(r.l)(e)&&!x(e):$(e)&&L.test(r.t.call(e))}:F(!1),q=B("length");function V(e,t){t=function(e){for(var t={},n=e.length,i=0;i<n;++i)t[e[i]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=r.n.length,i=e.constructor,s=w(i)&&i.prototype||r.c,o="constructor";for(A(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=r.n[n])in e&&e[o]!==s[o]&&!t.contains(o)&&t.push(o)}function U(e){if(!o(e))return[];if(r.m)return Object(r.m)(e);var t=[];for(var n in e)A(e,n)&&t.push(n);return r.h&&V(e,t),t}function Y(e){if(null==e)return!0;var t=q(e);return"number"==typeof t&&(S(e)||h(e)||I(e))?0===t:0===q(U(e))}function j(e,t){var n=U(t),i=n.length;if(null==e)return!i;for(var r=Object(e),s=0;s<i;s++){var o=n[s];if(t[o]!==r[o]||!(o in r))return!1}return!0}function W(e){return e instanceof W?e:this instanceof W?void(this._wrapped=e):new W(e)}function K(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,R(e))}W.VERSION=r.e,W.prototype.value=function(){return this._wrapped},W.prototype.valueOf=W.prototype.toJSON=W.prototype.value,W.prototype.toString=function(){return String(this._wrapped)};var G="[object DataView]";function H(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var s=typeof e;return("function"===s||"object"===s||"object"==typeof t)&&function e(t,n,i,s){t instanceof W&&(t=t._wrapped);n instanceof W&&(n=n._wrapped);var o=r.t.call(t);if(o!==r.t.call(n))return!1;if(E&&"[object Object]"==o&&x(t)){if(!x(n))return!1;o=G}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return r.d.valueOf.call(t)===r.d.valueOf.call(n);case"[object ArrayBuffer]":case G:return e(K(t),K(n),i,s)}var a="[object Array]"===o;if(!a&&N(t)){var c=R(t);if(c!==R(n))return!1;if(t.buffer===n.buffer&&t.byteOffset===n.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof n)return!1;var u=t.constructor,l=n.constructor;if(u!==l&&!(w(u)&&u instanceof u&&w(l)&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}i=i||[];s=s||[];var d=i.length;for(;d--;)if(i[d]===t)return s[d]===n;i.push(t);s.push(n);if(a){if((d=t.length)!==n.length)return!1;for(;d--;)if(!H(t[d],n[d],i,s))return!1}else{var h,f=U(t);if(d=f.length,U(n).length!==d)return!1;for(;d--;)if(h=f[d],!A(n,h)||!H(t[h],n[h],i,s))return!1}i.pop();s.pop();return!0}(e,t,n,i)}function z(e,t){return H(e,t)}function Z(e){if(!o(e))return[];var t=[];for(var n in e)t.push(n);return r.h&&V(e,t),t}function Q(e){var t=q(e);return function(n){if(null==n)return!1;var i=Z(n);if(q(i))return!1;for(var r=0;r<t;r++)if(!w(n[e[r]]))return!1;return e!==ne||!w(n[X])}}var X="forEach",J=["clear","delete"],ee=["get","has","set"],te=J.concat(X,ee),ne=J.concat(ee),ie=["add"].concat(J,X,"has"),re=C?Q(te):d("Map"),se=C?Q(ne):d("WeakMap"),oe=C?Q(ie):d("Set"),ae=d("WeakSet");function ce(e){for(var t=U(e),n=t.length,i=Array(n),r=0;r<n;r++)i[r]=e[t[r]];return i}function ue(e){for(var t=U(e),n=t.length,i=Array(n),r=0;r<n;r++)i[r]=[t[r],e[t[r]]];return i}function le(e){for(var t={},n=U(e),i=0,r=n.length;i<r;i++)t[e[n[i]]]=n[i];return t}function de(e){var t=[];for(var n in e)w(e[n])&&t.push(n);return t.sort()}function he(e,t){return function(n){var i=arguments.length;if(t&&(n=Object(n)),i<2||null==n)return n;for(var r=1;r<i;r++)for(var s=arguments[r],o=e(s),a=o.length,c=0;c<a;c++){var u=o[c];t&&void 0!==n[u]||(n[u]=s[u])}return n}}var fe=he(Z),pe=he(U),me=he(Z,!0);function _e(e){if(!o(e))return{};if(r.j)return Object(r.j)(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function ye(e,t){var n=_e(e);return t&&pe(n,t),n}function ge(e){return o(e)?S(e)?e.slice():fe({},e):e}function ve(e,t){return t(e),e}function be(e){return S(e)?e:[e]}function we(e){return W.toPath(e)}function Pe(e,t){for(var n=t.length,i=0;i<n;i++){if(null==e)return;e=e[t[i]]}return n?e:void 0}function Ee(e,t,n){var i=Pe(e,we(t));return c(i)?n:i}function Ce(e,t){for(var n=(t=we(t)).length,i=0;i<n;i++){var r=t[i];if(!A(e,r))return!1;e=e[r]}return!!n}function ke(e){return e}function xe(e){return e=pe({},e),function(t){return j(t,e)}}function Se(e){return e=we(e),function(t){return Pe(t,e)}}function Ae(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,i,r){return e.call(t,n,i,r)};case 4:return function(n,i,r,s){return e.call(t,n,i,r,s)}}return function(){return e.apply(t,arguments)}}function Oe(e,t,n){return null==e?ke:w(e)?Ae(e,t,n):o(e)&&!S(e)?xe(e):Se(e)}function Ie(e,t){return Oe(e,t,1/0)}function Te(e,t,n){return W.iteratee!==Ie?W.iteratee(e,t):Oe(e,t,n)}function De(e,t,n){t=Te(t,n);for(var i=U(e),r=i.length,s={},o=0;o<r;o++){var a=i[o];s[a]=t(e[a],a,e)}return s}function Fe(){}
vendor: 4,472 bytes, line 1
1function Me(e){return null==e?Fe:function(t){return Ee(e,t)}}function Be(e,t,n){var i=Array(Math.max(0,e));t=Ae(t,n,1);for(var r=0;r<e;r++)i[r]=t(r);return i}function Re(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}W.toPath=be,W.iteratee=Ie;var $e=Date.now||function(){return(new Date).getTime()};function Le(e){var t=function(t){return e[t]},n="(?:"+U(e).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(r,t):e}}var Ne={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},qe=Le(Ne),Ve=Le(le(Ne)),Ue=W.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Ye=/(.)^/,je={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},We=/\\|'|\r|\n|\u2028|\u2029/g;function Ke(e){return"\\"+je[e]}var Ge=/^\s*(\w|\$)+\s*$/;function He(e,t,n){!t&&n&&(t=n),t=me({},t,W.templateSettings);var i=RegExp([(t.escape||Ye).source,(t.interpolate||Ye).source,(t.evaluate||Ye).source].join("|")+"|$","g"),r=0,s="__p+='";e.replace(i,function(t,n,i,o,a){return s+=e.slice(r,a).replace(We,Ke),r=a+t.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),t}),s+="';\n";var o,a=t.variable;if(a){if(!Ge.test(a))throw new Error("variable is not a bare identifier: "+a)}else s="with(obj||{}){\n"+s+"}\n",a="obj";s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{o=new Function(a,"_",s)}catch(e){throw e.source=s,e}var c=function(e){return o.call(this,e,W)};return c.source="function("+a+"){\n"+s+"}",c}function ze(e,t,n){var i=(t=we(t)).length;if(!i)return w(n)?n.call(e):n;for(var r=0;r<i;r++){var s=null==e?void 0:e[t[r]];void 0===s&&(s=n,r=i),e=w(s)?s.call(e):s}return e}var Ze=0;function Qe(e){var t=++Ze+"";return e?e+t:t}function Xe(e){var t=W(e);return t._chain=!0,t}function Je(e,t,n,i,r){if(!(i instanceof t))return e.apply(n,r);var s=_e(e.prototype),a=e.apply(s,r);return o(a)?a:s}var et=s(function(e,t){var n=et.placeholder,i=function(){for(var r=0,s=t.length,o=Array(s),a=0;a<s;a++)o[a]=t[a]===n?arguments[r++]:t[a];for(;r<arguments.length;)o.push(arguments[r++]);return Je(e,i,this,this,o)};return i});et.placeholder=W;var tt=et,nt=s(function(e,t,n){if(!w(e))throw new TypeError("Bind must be called on a function");var i=s(function(r){return Je(e,i,t,this,n.concat(r))});return i}),it=M(q);function rt(e,t,n,i){if(i=i||[],t||0===t){if(t<=0)return i.concat(e)}else t=1/0;for(var r=i.length,s=0,o=q(e);s<o;s++){var a=e[s];if(it(a)&&(S(a)||I(a)))if(t>1)rt(a,t-1,n,i),r=i.length;else for(var c=0,u=a.length;c<u;)i[r++]=a[c++];else n||(i[r++]=a)}return i}var st=s(function(e,t){var n=(t=rt(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var i=t[n];e[i]=nt(e[i],e)}return e});function ot(e,t){var n=function(i){var r=n.cache,s=""+(t?t.apply(this,arguments):i);return A(r,s)||(r[s]=e.apply(this,arguments)),r[s]};return n.cache={},n}var at=s(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),ct=tt(at,W,1);function ut(e,t,n){var i,r,s,o,a=0;n||(n={});var c=function(){a=!1===n.leading?0:$e(),i=null,o=e.apply(r,s),i||(r=s=null)},u=function(){var u=$e();a||!1!==n.leading||(a=u);var l=t-(u-a);return r=this,s=arguments,l<=0||l>t?(i&&(clearTimeout(i),i=null),a=u,o=e.apply(r,s),i||(r=s=null)):i||!1===n.trailing||(i=setTimeout(c,l)),o};return u.cancel=function(){clearTimeout(i),a=0,i=r=s=null},u}function lt(e,t,n){var i,r,o,a,c,u=function(){var s=$e()-r;t>s?i=setTimeout(u,t-s):(i=null,n||(a=e.apply(c,o)),i||(o=c=null))},l=s(function(s){return c=this,o=s,r=$e(),i||(i=setTimeout(u,t),n&&(a=e.apply(c,o))),a});return l.cancel=function(){clearTimeout(i),i=o=c=null},l}function dt(e,t){return tt(t,e)}function ht(e){return function(){return!e.apply(this,arguments)}}function ft(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}}function pt(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function mt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var _t=tt(mt,2);function yt(e,t,n){t=Te(t,n);for(var i,r=U(e),s=0,o=r.length;s<o;s++)if(t(e[i=r[s]],i,e))return i}function gt(e){return function(t,n,i){n=Te(n,i);for(var r=q(t),s=e>0?0:r-1;s>=0&&s<r;s+=e)if(n(t[s],s,t))return s;return-1}}
vendor: 5,311 bytes, line 1
1var vt=gt(1),bt=gt(-1);function wt(e,t,n,i){for(var r=(n=Te(n,i,1))(t),s=0,o=q(e);s<o;){var a=Math.floor((s+o)/2);n(e[a])<r?s=a+1:o=a}return s}function Pt(e,t,n){return function(i,s,o){var a=0,c=q(i);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+c,a):c=o>=0?Math.min(o+1,c):o+c+1;else if(n&&o&&c)return i[o=n(i,s)]===s?o:-1;if(s!=s)return(o=t(r.q.call(i,a,c),D))>=0?o+a:-1;for(o=e>0?a:c-1;o>=0&&o<c;o+=e)if(i[o]===s)return o;return-1}}var Et=Pt(1,vt,wt),Ct=Pt(-1,bt);function kt(e,t,n){var i=(it(e)?vt:yt)(e,t,n);if(void 0!==i&&-1!==i)return e[i]}function xt(e,t){return kt(e,xe(t))}function St(e,t,n){var i,r;if(t=Ae(t,n),it(e))for(i=0,r=e.length;i<r;i++)t(e[i],i,e);else{var s=U(e);for(i=0,r=s.length;i<r;i++)t(e[s[i]],s[i],e)}return e}function At(e,t,n){t=Te(t,n);for(var i=!it(e)&&U(e),r=(i||e).length,s=Array(r),o=0;o<r;o++){var a=i?i[o]:o;s[o]=t(e[a],a,e)}return s}function Ot(e){return function(t,n,i,r){var s=arguments.length>=3;return function(t,n,i,r){var s=!it(t)&&U(t),o=(s||t).length,a=e>0?0:o-1;for(r||(i=t[s?s[a]:a],a+=e);a>=0&&a<o;a+=e){var c=s?s[a]:a;i=n(i,t[c],c,t)}return i}(t,Ae(n,r,4),i,s)}}var It=Ot(1),Tt=Ot(-1);function Dt(e,t,n){var i=[];return t=Te(t,n),St(e,function(e,n,r){t(e,n,r)&&i.push(e)}),i}function Ft(e,t,n){return Dt(e,ht(Te(t)),n)}function Mt(e,t,n){t=Te(t,n);for(var i=!it(e)&&U(e),r=(i||e).length,s=0;s<r;s++){var o=i?i[s]:s;if(!t(e[o],o,e))return!1}return!0}function Bt(e,t,n){t=Te(t,n);for(var i=!it(e)&&U(e),r=(i||e).length,s=0;s<r;s++){var o=i?i[s]:s;if(t(e[o],o,e))return!0}return!1}function Rt(e,t,n,i){return it(e)||(e=ce(e)),("number"!=typeof n||i)&&(n=0),Et(e,t,n)>=0}var $t=s(function(e,t,n){var i,r;return w(t)?r=t:(t=we(t),i=t.slice(0,-1),t=t[t.length-1]),At(e,function(e){var s=r;if(!s){if(i&&i.length&&(e=Pe(e,i)),null==e)return;s=e[t]}return null==s?s:s.apply(e,n)})});function Lt(e,t){return At(e,Se(t))}function Nt(e,t){return Dt(e,xe(t))}function qt(e,t,n){var i,r,s=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,c=(e=it(e)?e:ce(e)).length;a<c;a++)null!=(i=e[a])&&i>s&&(s=i);else t=Te(t,n),St(e,function(e,n,i){((r=t(e,n,i))>o||r===-1/0&&s===-1/0)&&(s=e,o=r)});return s}function Vt(e,t,n){var i,r,s=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,c=(e=it(e)?e:ce(e)).length;a<c;a++)null!=(i=e[a])&&i<s&&(s=i);else t=Te(t,n),St(e,function(e,n,i){((r=t(e,n,i))<o||r===1/0&&s===1/0)&&(s=e,o=r)});return s}var Ut=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Yt(e){return e?S(e)?r.q.call(e):h(e)?e.match(Ut):it(e)?At(e,ke):ce(e):[]}function jt(e,t,n){if(null==t||n)return it(e)||(e=ce(e)),e[Re(e.length-1)];var i=Yt(e),r=q(i);t=Math.max(Math.min(t,r),0);for(var s=r-1,o=0;o<t;o++){var a=Re(o,s),c=i[o];i[o]=i[a],i[a]=c}return i.slice(0,t)}function Wt(e){return jt(e,1/0)}function Kt(e,t,n){var i=0;return t=Te(t,n),Lt(At(e,function(e,n,r){return{value:e,index:i++,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,i=t.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return e.index-t.index}),"value")}function Gt(e,t){return function(n,i,r){var s=t?[[],[]]:{};return i=Te(i,r),St(n,function(t,r){var o=i(t,r,n);e(s,t,o)}),s}}var Ht=Gt(function(e,t,n){A(e,n)?e[n].push(t):e[n]=[t]}),zt=Gt(function(e,t,n){e[n]=t}),Zt=Gt(function(e,t,n){A(e,n)?e[n]++:e[n]=1}),Qt=Gt(function(e,t,n){e[n?0:1].push(t)},!0);function Xt(e){return null==e?0:it(e)?e.length:U(e).length}function Jt(e,t,n){return t in n}var en=s(function(e,t){var n={},i=t[0];if(null==e)return n;w(i)?(t.length>1&&(i=Ae(i,t[1])),t=Z(e)):(i=Jt,t=rt(t,!1,!1),e=Object(e));for(var r=0,s=t.length;r<s;r++){var o=t[r],a=e[o];i(a,o,e)&&(n[o]=a)}return n}),tn=s(function(e,t){var n,i=t[0];return w(i)?(i=ht(i),t.length>1&&(n=t[1])):(t=At(rt(t,!1,!1),String),i=function(e,n){return!Rt(t,n)}),en(e,i,n)});function nn(e,t,n){return r.q.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function rn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:nn(e,e.length-t)}function sn(e,t,n){return r.q.call(e,null==t||n?1:t)}function on(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:sn(e,Math.max(0,e.length-t))}function an(e){return Dt(e,Boolean)}function cn(e,t){return rt(e,t,!1)}var un=s(function(e,t){return t=rt(t,!0,!0),Dt(e,function(e){return!Rt(t,e)})}),ln=s(function(e,t){return un(e,t)});function dn(e,t,n,i){u(t)||(i=n,n=t,t=!1),null!=n&&(n=Te(n,i));for(var r=[],s=[],o=0,a=q(e);o<a;o++){var c=e[o],l=n?n(c,o,e):c;t&&!n?(o&&s===l||r.push(c),s=l):n?Rt(s,l)||(s.push(l),r.push(c)):Rt(r,c)||r.push(c)}return r}var hn=s(function(e){return dn(rt(e,!0,!0))});function fn(e){for(var t=[],n=arguments.length,i=0,r=q(e);i<r;i++){var s=e[i];if(!Rt(t,s)){var o;for(o=1;o<n&&Rt(arguments[o],s);o++);o===n&&t.push(s)}}return t}function pn(e){for(var t=e&&qt(e,q).length||0,n=Array(t),i=0;i<t;i++)n[i]=Lt(e,i);return n}var mn=s(pn);function _n(e,t){for(var n={},i=0,r=q(e);i<r;i++)t?n[e[i]]=t[i]:n[e[i][0]]=e[i][1];return n}function yn(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var i=Math.max(Math.ceil((t-e)/n),0),r=Array(i),s=0;s<i;s++,e+=n)r[s]=e;return r}function gn(e,t){if(null==t||t<1)return[];for(var n=[],i=0,s=e.length;i<s;)n.push(r.q.call(e,i,i+=t));return n}function vn(e,t){return e._chain?W(t).chain():t}
1function bn(e){return St(de(e),function(t){var n=W[t]=e[t];W.prototype[t]=function(){var e=[this._wrapped];return r.o.apply(e,arguments),vn(this,n.apply(W,e))}}),W}St(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r.a[e];W.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),vn(this,n)}}),St(["concat","join","slice"],function(e){var t=r.a[e];W.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),vn(this,e)}});var wn=W,Pn=bn(i);Pn._=Pn;var En=Pn;n.d(t,"default",function(){return En}),n.d(t,"VERSION",function(){return r.e}),n.d(t,"restArguments",function(){return s}),n.d(t,"isObject",function(){return o}),n.d(t,"isNull",function(){return a}),n.d(t,"isUndefined",function(){return c}),n.d(t,"isBoolean",function(){return u}),n.d(t,"isElement",function(){return l}),n.d(t,"isString",function(){return h}),n.d(t,"isNumber",function(){return f}),n.d(t,"isDate",function(){return p}),n.d(t,"isRegExp",function(){return m}),n.d(t,"isError",function(){return _}),n.d(t,"isSymbol",function(){return y}),n.d(t,"isArrayBuffer",function(){return g}),n.d(t,"isDataView",function(){return x}),n.d(t,"isArray",function(){return S}),n.d(t,"isFunction",function(){return w}),n.d(t,"isArguments",function(){return I}),n.d(t,"isFinite",function(){return T}),n.d(t,"isNaN",function(){return D}),n.d(t,"isTypedArray",function(){return N}),n.d(t,"isEmpty",function(){return Y}),n.d(t,"isMatch",function(){return j}),n.d(t,"isEqual",function(){return z}),n.d(t,"isMap",function(){return re}),n.d(t,"isWeakMap",function(){return se}),n.d(t,"isSet",function(){return oe}),n.d(t,"isWeakSet",function(){return ae}),n.d(t,"keys",function(){return U}),n.d(t,"allKeys",function(){return Z}),n.d(t,"values",function(){return ce}),n.d(t,"pairs",function(){return ue}),n.d(t,"invert",function(){return le}),n.d(t,"functions",function(){return de}),n.d(t,"methods",function(){return de}),n.d(t,"extend",function(){return fe}),n.d(t,"extendOwn",function(){return pe}),n.d(t,"assign",function(){return pe}),n.d(t,"defaults",function(){return me}),n.d(t,"create",function(){return ye}),n.d(t,"clone",function(){return ge}),n.d(t,"tap",function(){return ve}),n.d(t,"get",function(){return Ee}),n.d(t,"has",function(){return Ce}),n.d(t,"mapObject",function(){return De}),n.d(t,"identity",function(){return ke}),n.d(t,"constant",function(){return F}),n.d(t,"noop",function(){return Fe}),n.d(t,"toPath",function(){return be}),n.d(t,"property",function(){return Se}),n.d(t,"propertyOf",function(){return Me}),n.d(t,"matcher",function(){return xe}),n.d(t,"matches",function(){return xe}),n.d(t,"times",function(){return Be}),n.d(t,"random",function(){return Re}),n.d(t,"now",function(){return $e}),n.d(t,"escape",function(){return qe}),n.d(t,"unescape",function(){return Ve}),n.d(t,"templateSettings",function(){return Ue}),n.d(t,"template",function(){return He}),n.d(t,"result",function(){return ze}),n.d(t,"uniqueId",function(){return Qe}),n.d(t,"chain",function(){return Xe}),n.d(t,"iteratee",function(){return Ie}),n.d(t,"partial",function(){return tt}),n.d(t,"bind",function(){return nt}),n.d(t,"bindAll",function(){return st}),n.d(t,"memoize",function(){return ot}),n.d(t,"delay",function(){return at}),n.d(t,"defer",function(){return ct}),n.d(t,"throttle",function(){return ut}),n.d(t,"debounce",function(){return lt}),n.d(t,"wrap",function(){return dt}),n.d(t,"negate",function(){return ht}),n.d(t,"compose",function(){return ft}),n.d(t,"after",function(){return pt}),n.d(t,"before",function(){return mt}),n.d(t,"once",function(){return _t}),n.d(t,"findKey",function(){return yt}),n.d(t,"findIndex",function(){return vt}),n.d(t,"findLastIndex",function(){return bt}),n.d(t,"sortedIndex",function(){return wt}),n.d(t,"indexOf",function(){return Et}),n.d(t,"lastIndexOf",function(){return Ct}),n.d(t,"find",function(){return kt}),n.d(t,"detect",function(){return kt}),n.d(t,"findWhere",function(){return xt}),n.d(t,"each",function(){return St}),n.d(t,"forEach",function(){return St}),n.d(t,"map",function(){return At}),n.d(t,"collect",function(){return At}),n.d(t,"reduce",function(){return It}),n.d(t,"foldl",function(){return It}),n.d(t,"inject",function(){return It}),n.d(t,"reduceRight",function(){return Tt}),n.d(t,"foldr",function(){return Tt}),n.d(t,"filter",function(){return Dt}),n.d(t,"select",function(){return Dt}),n.d(t,"reject",function(){return Ft}),n.d(t,"every",function(){return Mt}),n.d(t,"all",function(){return Mt}),n.d(t,"some",function(){return Bt}),n.d(t,"any",function(){return Bt}),n.d(t,"contains",function(){return Rt}),n.d(t,"includes",function(){return Rt}),n.d(t,"include",function(){return Rt}),n.d(t,"invoke",function(){return $t}),n.d(t,"pluck",function(){return Lt}),n.d(t,"where",function(){return Nt}),n.d(t,"max",function(){return qt}),n.d(t,"min",function(){return Vt}),n.d(t,"shuffle",function(){return Wt}),n.d(t,"sample",function(){return jt}),n.d(t,"sortBy",function(){return Kt}),n.d(t,"groupBy",function(){return Ht}),n.d(t,"indexBy",function(){return zt}),n.d(t,"countBy",function(){return Zt}),n.d(t,"partition",function(){return Qt}),n.d(t,"toArray",function(){return Yt}),n.d(t,"size",function(){return Xt}),n.d(t,"pick",function(){return en}),n.d(t,"omit",function(){return tn}),n.d(t,"first",function(){return rn}),n.d(t,"head",function(){return rn}),n.d(t,"take",function(){return rn}),n.d(t,"initial",function(){return nn}),n.d(t,"last",function(){return on}),n.d(t,"rest",function(){return sn}),n.d(t,"tail",function(){return sn}),n.d(t,"drop",function(){return sn}),n.d(t,"compact",function(){return an}),n.d(t,"flatten",function(){return cn}),n.d(t,"without",function(){return ln}),n.d(t,"uniq",function(){return dn}),n.d(t,"unique",function(){return dn}),n.d(t,"union",function(){return hn}),n.d(t,"intersection",function(){return fn}),n.d(t,"difference",function(){return un}),n.d(t,"unzip",function(){return pn}),n.d(t,"transpose",function(){return pn}),n.d(t,"zip",function(){return mn}),n.d(t,"object",function(){return _n}),n.d(t,"range",function(){return yn}),n.d(t,"chunk",function(){return gn}),n.d(t,"mixin",function(){return bn})},function(e,t){e.exports={props:{data:{type:Object,default:function(){return{current_page:1,data:[],from:1,last_page:1,next_page_url:null,per_page:10,prev_page_url:null,to:1,total:0}}},limit:{type:Number,default:0}},template:'<ul class="pagination" v-if="data.total > data.per_page">\t\t<li class="page-item pagination-prev-nav" v-if="data.prev_page_url">\t\t\t<a class="page-link" href="#" aria-label="Previous" @click.prevent="selectPage(--data.current_page)">\t\t\t\t<slot name="prev-nav">\t\t\t\t\t<span aria-hidden="true">«</span>\t\t\t\t\t<span class="sr-only">Previous</span>\t\t\t\t</slot>\t\t\t</a>\t\t</li>\t\t<li class="page-item pagination-page-nav" v-for="n in getPages()" :class="{ \'active\': n == data.current_page }">\t\t\t<a class="page-link" href="#" @click.prevent="selectPage(n)">{{ n }}</a>\t\t</li>\t\t<li class="page-item pagination-next-nav" v-if="data.next_page_url">\t\t\t<a class="page-link" href="#" aria-label="Next" @click.prevent="selectPage(++data.current_page)">\t\t\t\t<slot name="next-nav">\t\t\t\t\t<span aria-hidden="true">»</span>\t\t\t\t\t<span class="sr-only">Next</span>\t\t\t\t</slot>\t\t\t</a>\t\t</li>\t</ul>',methods:{selectPage:function(e){"..."!==e&&this.$emit("pagination-change-page",e)},getPages:function(){if(-1===this.limit)return 0;if(0===this.limit)return this.data.last_page;
1for(var e,t=this.data.current_page,n=this.data.last_page,i=this.limit,r=t-i,s=t+i+1,o=[],a=[],c=1;c<=n;c++)(1==c||c==n||c>=r&&c<s)&&o.push(c);return o.forEach(function(t){e&&(t-e==2?a.push(e+1):t-e!=1&&a.push("...")),a.push(t),e=t}),a}}}},function(e,t,n){n(10),e.exports=n(87)},function(e,t,n){n(11),n(33),window.Vue.config.productionTip=!1,window.Vue.config.devtools=!0,new Vue({el:"#app",ready:function(){App.userId&&this.getUser(),App.currentTeamId&&(this.getTeams(),this.getCurrentTeam()),this.whenReady()},events:{updateUser:function(){return this.getUser(),!0},updateTeams:function(){return this.getTeams(),!0}},methods:{whenReady:function(){},getUser:function(){this.$http.get("/api/users/me").success(function(e){this.$broadcast("userRetrieved",e)})},getTeams:function(){this.$http.get("/api/teams").success(function(e){this.$broadcast("teamsRetrieved",e)})},getCurrentTeam:function(){this.$http.get("/api/teams/"+App.currentTeamId).success(function(e){this.$broadcast("currentTeamRetrieved",e)})}}})},function(e,t,n){var i="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};void 0===window.Vue&&(window.Vue=n(12),Vue.config.debug=!1,Vue.config.devtools=!1),n(13),Vue.http.headers.common["X-CSRF-TOKEN"]=App.csrfToken,window.Promise=n(20),void 0===window._&&(window._=n(7)),"undefined"!=typeof Swal&&(window.swal=function(){var e=Array.prototype.slice.call(arguments),t={},n=null;e.length>0&&"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&"object"===i(e[0])?t=Object.assign({},e[0]):e.length>0&&(t.title=e[0],e.length>1&&"string"==typeof e[1]&&(t.text=e[1]),e.length>2&&"string"==typeof e[2]&&(t.icon=e[2])),t&&t.type&&(t.icon=t.type,delete t.type),t&&!0===t.html&&t.text&&(t.html=t.text,delete t.text),t&&(delete t.closeOnCancel,delete t.closeOnConfirm);var r=Swal.fire(t);return"function"==typeof n&&r.then(function(e){n(e.isConfirmed,e.isDismissed?e.dismiss:null,e)}),r},window.swal.close=function(){return Swal.close()},window.swal.fire=function(e){return Swal.fire(e)},window.swal.showLoading=function(){return Swal.showLoading()},window.swal.hideLoading=function(){return Swal.hideLoading()},window.swal.isVisible=function(){return Swal.isVisible()}),n(28)},function(e,t,n){"use strict";function i(e,t,n){if(o(e,t))e[t]=n;else if(e._isVue)i(e._data,t,n);else{var r=e.__ob__;if(r){if(r.convert(t,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(t),a._digest()}}else e[t]=n}}function r(e,t){if(o(e,t)){delete e[t];var n=e.__ob__;if(n&&(n.dep.notify(),n.vms))for(var i=n.vms.length;i--;){var r=n.vms[i];r._unproxy(t),r._digest()}}}var s=Object.prototype.hasOwnProperty;function o(e,t){return s.call(e,t)}var a=/^\s?(true|false|[\d\.]+|'[^']*'|"[^"]*")\s?$/;function c(e){return a.test(e)}function u(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function l(e){return null==e?"":e.toString()}function d(e){if("string"!=typeof e)return e;var t=Number(e);return isNaN(t)?e:t}function h(e){return"true"===e||"false"!==e&&e}function f(e){var t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}var p=/-(\w)/g;function m(e){return e.replace(p,_)}function _(e,t){return t?t.toUpperCase():""}var y=/([a-z\d])([A-Z])/g;function g(e){return e.replace(y,"$1-$2").toLowerCase()}var v=/(?:^|[-_\/])(\w)/g;function b(e){return e.replace(v,_)}function w(e,t){return function(n){var i=arguments.length;return i?i>1?e.apply(t,arguments):e.call(t,n):e.call(t)}}function P(e,t){t=t||0;for(var n=e.length-t,i=new Array(n);n--;)i[n]=e[n+t];return i}function E(e,t){for(var n=Object.keys(t),i=n.length;i--;)e[n[i]]=t[n[i]];return e}function C(e){return null!==e&&"object"==typeof e}var k=Object.prototype.toString,x="[object Object]";function S(e){return k.call(e)===x}var A=Array.isArray;function O(e,t,n,i){Object.defineProperty(e,t,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function I(e,t){var n,i,r,s,o,a=function a(){var c=Date.now()-s;c<t&&c>
1=0?n=setTimeout(a,t-c):(n=null,o=e.apply(r,i),n||(r=i=null))};return function(){return r=this,i=arguments,s=Date.now(),n||(n=setTimeout(a,t)),o}}function T(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function D(e){var t=function t(){if(!t.cancelled)return e.apply(this,arguments)};return t.cancel=function(){t.cancelled=!0},t}function F(e,t){return e==t||!(!C(e)||!C(t))&&JSON.stringify(e)===JSON.stringify(t)}var M="__proto__"in{},B="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),R=B&&navigator.userAgent.toLowerCase().indexOf("msie 9.0")>0,$=B&&navigator.userAgent.toLowerCase().indexOf("android")>0,L=void 0,N=void 0,q=void 0,V=void 0;if(B&&!R){var U=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,Y=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;L=U?"WebkitTransition":"transition",N=U?"webkitTransitionEnd":"transitionend",q=Y?"WebkitAnimation":"animation",V=Y?"webkitAnimationEnd":"animationend"}var j=function(){var e,t=[],n=!1;function i(){n=!1;var e=t.slice(0);t=[];for(var i=0;i<e.length;i++)e[i]()}if("undefined"!=typeof MutationObserver){var r=1,s=new MutationObserver(i),o=document.createTextNode(r);s.observe(o,{characterData:!0}),e=function(){r=(r+1)%2,o.data=r}}else e=setTimeout;return function(r,s){var o=s?function(){r.call(s)}:r;t.push(o),n||(n=!0,e(i,0))}}();function W(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap=Object.create(null)}var K=W.prototype;K.put=function(e,t){var n={key:e,value:t};if(this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit)return this.shift();this.size++},K.shift=function(){var e=this.head;return e&&(this.head=this.head.newer,this.head.older=void 0,e.newer=e.older=void 0,this._keymap[e.key]=void 0),e},K.get=function(e,t){var n=this._keymap[e];if(void 0!==n)return n===this.tail?t?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,t?n:n.value)};var G,H,z,Z,Q,X,J,ee,te=new W(1e3),ne=/[^\s'"]+|'[^']*'|"[^"]*"/g,ie=/^in$|^-?\d+/;function re(){var e,t=G.slice(X,Z).trim();if(t){e={};var n=t.match(ne);e.name=n[0],n.length>1&&(e.args=n.slice(1).map(se))}e&&(H.filters=H.filters||[]).push(e),X=Z+1}function se(e){if(ie.test(e))return{value:d(e),dynamic:!1}
1;var t=f(e),n=t===e;return{value:n?e:t,dynamic:n}}function oe(e){var t=te.get(e);if(t)return t;for(J=ee=!1,0,X=0,H={},Z=0,Q=(G=e).length;Z<Q;Z++)if(z=G.charCodeAt(Z),J)39===z&&(J=!J);else if(ee)34===z&&(ee=!ee);else if(124===z&&124!==G.charCodeAt(Z+1)&&124!==G.charCodeAt(Z-1))null==H.expression?(X=Z+1,H.expression=G.slice(0,Z).trim()):re();else switch(z){case 34:ee=!0;break;case 39:J=!0;break;case 40:0;break;case 41:0;break;case 91:0;break;case 93:0;break;case 123:0;break;case 125:0}return null==H.expression?H.expression=G.slice(0,Z).trim():0!==X&&re(),te.put(e,H),H}var ae=Object.freeze({parseDirective:oe}),ce=/[-.*+?^${}()|[\]\/\\]/g,ue=void 0,le=void 0,de=void 0;function he(e){return e.replace(ce,"\\$&")}function fe(){var e=he(we.delimiters[0]),t=he(we.delimiters[1]),n=he(we.unsafeDelimiters[0]),i=he(we.unsafeDelimiters[1]);le=new RegExp(n+"(.+?)"+i+"|"+e+"(.+?)"+t,"g"),de=new RegExp("^"+n+".*"+i+"$"),ue=new W(1e3)}function pe(e){ue||fe();var t=ue.get(e);if(t)return t;if(e=e.replace(/\n/g,""),!le.test(e))return null;for(var n,i,r,s,o,a=[],c=le.lastIndex=0;n=le.exec(e);)(i=n.index)>c&&a.push({value:e.slice(c,i)}),s=(o=42===(s=(r=de.test(n[0]))?n[1]:n[2]).charCodeAt(0))?s.slice(1):s,a.push({tag:!0,value:s.trim(),html:r,oneTime:o}),c=i+n[0].length;return c<e.length&&a.push({value:e.slice(c)}),ue.put(e,a),a}function me(e){return e.length>1?e.map(function(e){return _e(e)}).join("+"):_e(e[0],!0)}function _e(e,t){return e.tag?function(e,t){if(ye.test(e)){var n=oe(e);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+e+")"}return t?e:"("+e+")"}(e.value,t):'"'+e.value+'"'}var ye=/[^|]\|[^|]/;var ge=Object.freeze({compileRegex:fe,parseText:pe,tokensToExp:me}),ve=["{{","}}"],be=["{{{","}}}"],we=Object.defineProperties({debug:!1,silent:!1,async:!0,warnExpressionErrors:!0,convertAllProperties:!1,_delimitersChanged:!0,_assetTypes:["component","directive","elementDirective","filter","transition","partial"],_propBindingModes:{ONE_WAY:0,TWO_WAY:1,ONE_TIME:2},_maxUpdateCount:100},{delimiters:{get:function(){return ve},set:function(e){ve=e,fe()},configurable:!0,enumerable:!0},unsafeDelimiters:{get:function(){return be},set:function(e){be=e,fe()},configurable:!0,enumerable:!0}}),Pe=void 0;function Ee(e,t,n,i){xe(e,1,function(){t.appendChild(e)},n,i)}function Ce(e,t,n,i){xe(e,1,function(){Te(e,t)},n,i)}function ke(e,t,n){xe(e,-1,function(){Fe(e)},t,n)}function xe(e,t,n,i,r){var s=e.__v_trans;if(!s||!s.hooks&&!N||!i._isCompiled||i.$parent&&!i.$parent._isCompiled)return n(),void(r&&r());s[t>0?"enter":"leave"](n,r)}function Se(e){if("string"==typeof e){e=document.querySelector(e)}return e}function Ae(e){var t=document.documentElement,n=e&&e.parentNode;return t===e||t===n||!(!n||1!==n.nodeType||!t.contains(n))}function Oe(e,t){var n=e.getAttribute(t);return null!==n&&e.removeAttribute(t),n}function Ie(e,t){var n=Oe(e,":"+t);return null===n&&(n=Oe(e,"v-bind:"+t)),n}function Te(e,t){t.parentNode.insertBefore(e,t)}function De(e,t){t.nextSibling?Te(e,t.nextSibling):t.parentNode.appendChild(e)}function Fe(e){e.parentNode.removeChild(e)}function Me(e,t){t.firstChild?Te(e,t.firstChild):t.appendChild(e)}function Be(e,t){var n=e.parentNode;n&&n.replaceChild(t,e)}function Re(e,t,n){e.addEventListener(t,n)}function $e(e,t,n){e.removeEventListener(t,n)}function Le(e,t){if(e.classList)e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ne(e,t){if(e.classList)e.classList.remove(t);else{for(var n=" "+(e.getAttribute("class")||"")+" ",i=" "+t+" ";n.indexOf(i)>=0;)n=n.replace(i," ");e.setAttribute("class",n.trim())}e.className||e.removeAttribute("class")}function qe(e,t){var n,i;if(Ye(e)&&e.content instanceof DocumentFragment&&(e=e.content),e.hasChildNodes())for(Ve(e),i=t?document.createDocumentFragment():document.createElement("div");n=e.firstChild;)i.appendChild(n);return i}function Ve(e){Ue(e,e.firstChild),Ue(e,e.lastChild)}function Ue(e,t){t&&3===t.nodeType&&!t.data.trim()&&e.removeChild(t)}function Ye(e){return e.tagName&&"template"===e.tagName.toLowerCase()}function je(e,t){var n=we.debug?document.createComment(e):document.createTextNode(t?" ":"");return n.__vue_anchor=!0,n}var We=/^v-ref:/;function Ke(e){if(e.hasAttributes())for(var t=e.attributes,n=0,i=t.length;n<i;n++){var r=t[n].name;if(We.test(r))return m(r.replace(We,""))}}function Ge(e,t,n){for(var i;e!==t;)i=e.nextSibling,n(e),e=i;n(t)}function He(e,t,n,i,r){var s=!1,o=0,a=[];function c(){if(s&&++o>=a.length){for(var e=0;e<a.length;e++)i.appendChild(a[e]);r&&r()}}Ge(e,t,function(e){e===t&&(s=!0),a.push(e),ke(e,n,c)})}var ze=/^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/;function Ze(e,t){var n=e.tagName.toLowerCase(),i=e.hasAttributes();if(ze.test(n)||"component"===n){if(i)return Qe(e)}else{if(ot(t,"components",n))return{id:n};var r=i&&Qe(e);if(r)return r}}
1function Qe(e){var t=Oe(e,"is");return null!=t?{id:t}:null!=(t=Ie(e,"is"))?{id:t,dynamic:!0}:void 0}function Xe(e,t,n){var i=t.path;e[i]=e._data[i]=Je(t,n)?n:void 0}function Je(e,t){if(null===e.raw&&!e.required)return!0;var n=e.options,i=n.type,r=!0;if(i&&(i===String?r=typeof t==="string":i===Number?("number",r="number"==typeof t):i===Boolean?("boolean",r="boolean"==typeof t):i===Function?("function",r="function"==typeof t):i===Object?("object",r=S(t)):i===Array?("array",r=A(t)):r=t instanceof i),!r)return!1;var s=n.validator;return!(s&&!s.call(null,t))}var et=we.optionMergeStrategies=Object.create(null);function tt(e,t){var n,r,s;for(n in t)r=e[n],s=t[n],o(e,n)?C(r)&&C(s)&&tt(r,s):i(e,n,s);return e}function nt(e,t){var n=Object.create(e);return t?E(n,rt(t)):n}et.data=function(e,t,n){return n?e||t?function(){var i="function"==typeof t?t.call(n):t,r="function"==typeof e?e.call(n):void 0;return i?tt(i,r):r}:void 0:t?"function"!=typeof t?e:e?function(){return tt(t.call(this),e.call(this))}:t:e},et.el=function(e,t,n){if(n||!t||"function"==typeof t){var i=t||e;return n&&"function"==typeof i?i.call(n):i}},et.init=et.created=et.ready=et.attached=et.detached=et.beforeCompile=et.compiled=et.beforeDestroy=et.destroyed=function(e,t){return t?e?e.concat(t):A(t)?t:[t]:e},et.paramAttributes=function(){},we._assetTypes.forEach(function(e){et[e+"s"]=nt}),et.watch=et.events=function(e,t){if(!t)return e;if(!e)return t;var n={};for(var i in E(n,e),t){var r=n[i],s=t[i];r&&!A(r)&&(r=[r]),n[i]=r?r.concat(s):[s]}return n},et.props=et.methods=et.computed=function(e,t){if(!t)return e;if(!e)return t;var n=Object.create(null);return E(n,e),E(n,t),n};var it=function(e,t){return void 0===t?e:t};function rt(e){if(A(e)){for(var t,n={},i=e.length;i--;){var r="function"==typeof(t=e[i])?t.options&&t.options.name||t.id:t.name||t.id;r&&(n[r]=t)}return n}return e}function st(e,t,n){!function(e){if(e.components)for(var t,n=e.components=rt(e.components),i=Object.keys(n),r=0,s=i.length;r<s;r++){var o=i[r];ze.test(o)||S(t=n[o])&&(n[o]=tr.extend(t))}}(t),function(e){var t,n,i=e.props;if(A(i))for(e.props={},t=i.length;t--;)"string"==typeof(n=i[t])?e.props[n]=null:n.name&&(e.props[n.name]=n);else if(S(i)){var r=Object.keys(i);for(t=r.length;t--;)"function"==typeof(n=i[r[t]])&&(i[r[t]]={type:n})}}(t);var i,r={};if(t.mixins)for(var s=0,a=t.mixins.length;s<a;s++)e=st(e,t.mixins[s],n);for(i in e)c(i);for(i in t)o(e,i)||c(i);function c(i){var s=et[i]||it;r[i]=s(e[i],t[i],n,i)}return r}function ot(e,t,n){var i,r=e[t];return r[n]||r[i=m(n)]||r[i.charAt(0).toUpperCase()+i.slice(1)]}function at(e,t,n){}var ct=Array.prototype,ut=Object.create(ct);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=ct[e];O(ut,e,function(){for(var n=arguments.length,i=new Array(n);n--;)i[n]=arguments[n];var r,s=t.apply(this,i),o=this.__ob__;switch(e){case"push":case"unshift":r=i;break;case"splice":r=i.slice(2)}return r&&o.observeArray(r),o.dep.notify(),s})}),O(ct,"$set",function(e,t){return e>=this.length&&(this.length=e+1),this.splice(e,1,t)[0]}),O(ct,"$remove",function(e){if(this.length){var t=T(this,e);return t>-1?this.splice(t,1):void 0}});var lt=0;function dt(){this.id=lt++,this.subs=[]}dt.target=null,dt.prototype.addSub=function(e){this.subs.push(e)},dt.prototype.removeSub=function(e){this.subs.$remove(e)}
1,dt.prototype.depend=function(){dt.target.addDep(this)},dt.prototype.notify=function(){for(var e=P(this.subs),t=0,n=e.length;t<n;t++)e[t].update()};var ht=Object.getOwnPropertyNames(ut);function ft(e){(this.value=e,this.dep=new dt,O(e,"__ob__",this),A(e))?((M?pt:mt)(e,ut,ht),this.observeArray(e)):this.walk(e)}function pt(e,t){e.__proto__=t}function mt(e,t,n){for(var i,r=n.length;r--;)O(e,i=n[r],t[i])}function _t(e,t){var n;if(e&&"object"==typeof e)return o(e,"__ob__")&&e.__ob__ instanceof ft?n=e.__ob__:!A(e)&&!S(e)||Object.isFrozen(e)||e._isVue||(n=new ft(e)),n&&t&&n.addVm(t),n}function yt(e,t,n){var i,r,s=new dt;if(we.convertAllProperties){var o=Object.getOwnPropertyDescriptor(e,t);if(o&&!1===o.configurable)return;i=o&&o.get,r=o&&o.set}var a=_t(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=i?i.call(e):n;if(dt.target&&(s.depend(),a&&a.dep.depend(),A(t)))for(var r,o=0,c=t.length;o<c;o++)(r=t[o])&&r.__ob__&&r.__ob__.dep.depend();return t},set:function(t){t!==(i?i.call(e):n)&&(r?r.call(e,t):n=t,a=_t(t),s.notify())}})}ft.prototype.walk=function(e){for(var t=Object.keys(e),n=t.length;n--;)this.convert(t[n],e[t[n]])},ft.prototype.observeArray=function(e){for(var t=e.length;t--;)_t(e[t])},ft.prototype.convert=function(e,t){yt(this.value,e,t)},ft.prototype.addVm=function(e){(this.vms||(this.vms=[])).push(e)},ft.prototype.removeVm=function(e){this.vms.$remove(e)};var gt=Object.freeze({defineReactive:yt,set:i,del:r,hasOwn:o,isLiteral:c,isReserved:u,_toString:l,toNumber:d,toBoolean:h,stripQuotes:f,camelize:m,hyphenate:g,classify:b,bind:w,toArray:P,extend:E,isObject:C,isPlainObject:S,def:O,debounce:I,indexOf:T,cancellable:D,looseEqual:F,isArray:A,hasProto:M,inBrowser:B,isIE9:R,isAndroid:$,get transitionProp(){return L},get transitionEndEvent(){return N},get animationProp(){return q},get animationEndEvent(){return V},nextTick:j,query:Se,inDoc:Ae,getAttr:Oe,getBindAttr:Ie,before:Te,after:De,remove:Fe,prepend:Me,replace:Be,on:Re,off:$e,addClass:Le,removeClass:Ne,extractContent:qe,trimNode:Ve,isTemplate:Ye,createAnchor:je,findRef:Ke,mapNodeRange:Ge,removeNodeRange:He,mergeOptions:st,resolveAsset:ot,assertAsset:at,checkComponentAttr:Ze,initProp:Xe,assertProp:Je,commonTagRE:ze,get warn(){return Pe}}),vt=0;var bt=new W(1e3),wt=0,Pt=1,Et=2,Ct=3,kt=0,xt=4,St=5,At=6,Ot=7,It=8,Tt=[];function Dt(e){if(void 0===e)return"eof";var t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return e;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function Ft(e){var t,n,i,r,s,o,a,u=[],l=-1,d=kt,h=0,p=[];function m(){var t=e[l+1];if(d===St&&"'"===t||d===At&&'"'===t)return l++,n="\\"+t,p[wt](),!0}for(p[Pt]=function(){void 0!==i&&(u.push(i),i=void 0)},p[wt]=function(){void 0===i?i=n:i+=n},p[Et]=function(){p[wt](),h++},p[Ct]=function(){if(h>0)h--,d=xt,p[wt]();else{if(h=0,t=(e=i).trim(),!1===(i=("0"!==e.charAt(0)||!isNaN(e))&&(c(t)?f(t):"*"+t)))return!1;p[Pt]()}var e,t};null!=d;)if("\\"!==(t=e[++l])||!m()){if(r=Dt(t),(s=(a=Tt[d])[r]||a.else||It)===It)return;if(d=s[0],(o=p[s[1]])&&(n=void 0===(n=s[2])?t:n,!1===o()))return;if(d===Ot)return u.raw=e,u}}function Mt(e){var t=bt.get(e);return t||(t=Ft(e))&&bt.put(e,t),t}function Bt(e,t){return en(t).get(e)}function Rt(e,t,n){var r,s,o=e;if("string"==typeof t&&(t=Ft(t)),!t||!C(e))return!1;for(var a=0,c=t.length;a<c;a++)r=e,"*"===(s=t[a]).charAt(0)&&(s=en(s.slice(1)).get.call(o,o)),a<c-1?C(e=e[s])||i(r,s,e={}):A(e)?e.$set(s,n):s in e?e[s]=n:i(e,s,n);return!0}Tt[kt]={ws:[kt],ident:[3,wt],"[":[xt],eof:[Ot]},Tt[1]={ws:[1],".":[2],"[":[xt],eof:[Ot]},Tt[2]={ws:[2],ident:[3,wt]},Tt[3]={ident:[3,wt],0:[3,wt],number:[3,wt],ws:[1,Pt],".":[2,Pt],"[":[xt,Pt],eof:[Ot,Pt]},Tt[xt]={"'":[St,wt],'"':[At,wt],"[":[xt,Et],"]":[1,Ct],eof:It,else:[xt,wt]},Tt[St]={"'":[xt,wt],eof:It,else:[St,wt]},Tt[At]={'"':[xt,wt],eof:It,else:[At,wt]};var $t=Object.freeze({parsePath:Mt,getPath:Bt,setPath:Rt}),Lt=new W(1e3),Nt=new RegExp("^("+"Math,Date,this,true,false,null,undefined,Infinity,NaN,isNaN,isFinite,decode
1URI,decodeURIComponent,encodeURI,encodeURIComponent,parseInt,parseFloat".replace(/,/g,"\\b|")+"\\b)"),qt=new RegExp("^("+"break,case,class,catch,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,let,return,super,switch,throw,try,var,while,with,yield,enum,await,implements,package,proctected,static,interface,private,public".replace(/,/g,"\\b|")+"\\b)"),Vt=/\s/g,Ut=/\n/g,Yt=/[\{,]\s*[\w\$_]+\s*:|('[^']*'|"[^"]*")|new |typeof |void /g,jt=/"(\d+)"/g,Wt=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,Kt=/[^\w$\.]([A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\])*)/g,Gt=/^(true|false)$/,Ht=[];function zt(e,t){var n=Ht.length;return Ht[n]=t?e.replace(Ut,"\\n"):e,'"'+n+'"'}function Zt(e){var t=e.charAt(0),n=e.slice(1);return Nt.test(n)?e:t+"scope."+(n=n.indexOf('"')>-1?n.replace(jt,Qt):n)}function Qt(e,t){return Ht[t]}function Xt(e){try{return new Function("scope","return "+e+";")}catch(e){}}function Jt(e){var t=Mt(e);if(t)return function(e,n){Rt(e,t,n)}}function en(e,t){e=e.trim();var n=Lt.get(e);if(n)return t&&!n.set&&(n.set=Jt(n.exp)),n;var i={exp:e};return i.get=tn(e)&&e.indexOf("[")<0?Xt("scope."+e):function(e){qt.test(e),Ht.length=0;var t=e.replace(Yt,zt).replace(Vt,"");return Xt(t=(" "+t).replace(Kt,Zt).replace(jt,Qt))}(e),t&&(i.set=Jt(e)),Lt.put(e,i),i}function tn(e){return Wt.test(e)&&!Gt.test(e)&&"Math."!==e.slice(0,5)}var nn=Object.freeze({parseExpression:en,isSimplePath:tn}),rn=[],sn=[],on={},an=!1,cn=!1;function un(){ln(rn),cn=!0,ln(sn),rn=[],sn=[],on={},{},an=cn=!1}function ln(e){for(var t=0;t<e.length;t++){var n=e[t],i=n.id;on[i]=null,n.run()}}var dn=0;function hn(e,t,n,i){i&&E(this,i);var r="function"==typeof t;if(this.vm=e,e._watchers.push(this),this.expression=r?t.toString():t,this.cb=n,this.id=++dn,this.active=!0,this.dirty=this.lazy,this.deps=Object.create(null),this.newDeps=null,this.prevError=null,r)this.getter=t,this.setter=void 0;else{var s=en(t,this.twoWay);this.getter=s.get,this.setter=s.set}this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}hn.prototype.addDep=function(e){var t=e.id;this.newDeps[t]||(this.newDeps[t]=e,this.deps[t]||(this.deps[t]=e,e.addSub(this)))},hn.prototype.get=function(){this.beforeGet();var e,t=this.scope||this.vm;try{e=this.getter.call(t,t)}catch(e){0}return this.deep&&function e(t){var n,i;if(A(t))for(n=t.length;n--;)e(t[n]);else if(C(t))for(i=Object.keys(t),n=i.length;n--;)e(t[i[n]])}(e),this.preProcess&&(e=this.preProcess(e)),this.filters&&(e=t._applyFilters(e,null,this.filters,!1)),this.postProcess&&(e=this.postProcess(e)),this.afterGet(),e},hn.prototype.set=function(e){var t=this.scope||this.vm;this.filters&&(e=t._applyFilters(e,this.value,this.filters,!0));try{this.setter.call(t,t,e)}catch(e){0}var n=t.$forContext;if(n&&n.alias===this.expression){if(n.filters)return;n._withLock(function(){t.$key?n.rawValue[t.$key]=e:n.rawValue.$set(t.$index,e)})}},hn.prototype.beforeGet=function(){dt.target=this,this.newDeps=Object.create(null)},hn.prototype.afterGet=function(){dt.target=null;for(var e=Object.keys(this.deps),t=e.length;t--;){var n=e[t];this.newDeps[n]||this.deps[n].removeSub(this)}this.deps=this.newDeps},hn.prototype.update=function(e){this.lazy?this.dirty=!0:this.sync||!we.async?this.run():(this.shallow=this.queued?!!e&&this.shallow:!!e,this.queued=!0,function(e){var t=e.id;if(null==on[t]){if(cn&&!e.user)return void e.run();var n=e.user?sn:rn;on[t]=n.length,n.push(e),an||(an=!0,j(un))}}(this))},hn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||(A(e)||this.deep)&&!this.shallow){var t=this.value;this.value=e;this.prevError;this.cb.call(this.vm,e,t)}this.queued=this.shallow=!1}},hn.prototype.evaluate=function(){var e=dt.target;this.value=this.get(),this.dirty=!1,dt.target=e}
1,hn.prototype.depend=function(){for(var e=Object.keys(this.deps),t=e.length;t--;)this.deps[e[t]].depend()},hn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||this.vm._watchers.$remove(this);for(var e=Object.keys(this.deps),t=e.length;t--;)this.deps[e[t]].removeSub(this);this.active=!1,this.vm=this.cb=this.value=null}};var fn={bind:function(){}},pn={priority:1500,bind:function(){if(this.arg){var e=this.id=m(this.arg),t=(this._scope||this.vm).$els;o(t,e)?t[e]=this.el:yt(t,e,this.el)}},unbind:function(){var e=(this._scope||this.vm).$els;e[this.id]===this.el&&(e[this.id]=null)}},mn=["-webkit-","-moz-","-ms-"],_n=["Webkit","Moz","ms"],yn=/!important;?$/,gn=Object.create(null),vn=null,bn={deep:!0,update:function(e){"string"==typeof e?this.el.style.cssText=e:A(e)?this.handleObject(e.reduce(E,{})):this.handleObject(e||{})},handleObject:function(e){var t,n,i=this.cache||(this.cache={});for(t in i)t in e||(this.handleSingle(t,null),delete i[t]);for(t in e)(n=e[t])!==i[t]&&(i[t]=n,this.handleSingle(t,n))},handleSingle:function(e,t){if(e=function(e){if(gn[e])return gn[e];var t=function(e){var t=m(e=g(e)),n=t.charAt(0).toUpperCase()+t.slice(1);vn||(vn=document.createElement("div"));if(t in vn.style)return e;var i=mn.length;for(;i--;)if(_n[i]+n in vn.style)return mn[i]+e}(e);return gn[e]=gn[t]=t,t}(e))if(null!=t&&(t+=""),t){var n=yn.test(t)?"important":"";n&&(t=t.replace(yn,"").trim()),this.el.style.setProperty(e,t,n)}else this.el.style.removeProperty(e)}};var wn=/^xlink:/,Pn={value:1,checked:1,selected:1},En={value:"_value","true-value":"_trueValue","false-value":"_falseValue"},Cn=/^v-|^:|^@|^(is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/,kn={priority:850,bind:function(){var e=this.arg,t=this.el.tagName;(e||(this.deep=!0),this.descriptor.interp)&&((Cn.test(e)||"name"===e&&("PARTIAL"===t||"SLOT"===t))&&(this.el.removeAttribute(e),this.invalid=!0))},update:function(e){if(!this.invalid){var t=this.arg;this.arg?this.handleSingle(t,e):this.handleObject(e||{})}},handleObject:bn.handleObject,handleSingle:function(e,t){Pn[e]&&e in this.el&&(this.el[e]="value"===e?t||"":t);var n=En[e];if(n){this.el[n]=t;var i=this.el.__v_model;i&&i.listener()}("value"!==e||"TEXTAREA"!==this.el.tagName)&&null!=t&&!1!==t?wn.test(e)?this.el.setAttributeNS("http://www.w3.org/1999/xlink",e,t):this.el.setAttribute(e,t):this.el.removeAttribute(e)}},xn={esc:27,tab:9,enter:13,space:32,delete:46,up:38,left:37,right:39,down:40};var Sn={acceptStatement:!0,priority:700,bind:function(){if("IFRAME"===this.el.tagName&&"load"!==this.arg){var e=this;this.iframeBind=function(){Re(e.el.contentWindow,e.arg,e.handler)},this.on("load",this.iframeBind)}},update:function(e){if(this.descriptor.raw||(e=function(){}),"function"==typeof e){this.modifiers.stop&&(e=function(e){return function(t){return t.stopPropagation(),e.call(this,t)}}(e)),this.modifiers.prevent&&(e=function(e){return function(t){return t.preventDefault(),e.call(this,t)}}(e));var t=Object.keys(this.modifiers).filter(function(e){return"stop"!==e&&"prevent"!==e});t.length&&(e=function(e,t){var n=t.map(function(e){var t=e.charCodeAt(0);return t>47&&t<58?parseInt(e,10):1===e.length&&(t=e.toUpperCase().charCodeAt(0))>64&&t<91?t:xn[e]});return function(t){if(n.indexOf(t.keyCode)>-1)return e.call(this,t)}}(e,t)),this.reset(),this.handler=e,this.iframeBind?this.iframeBind():Re(this.el,this.arg,this.handler)}},reset:function(){var e=this.iframeBind?this.el.contentWindow:this.el;this.handler&&$e(e,this.arg,this.handler)},unbind:function(){this.reset()}};function An(e,t,n){for(var i,r,s=t?[]:null,o=0,a=e.options.length;o<a;o++)if(i=e.options[o],n?i.hasAttribute("selected"):i.selected){if(r=i.hasOwnProperty("_value")?i._value:i.value,!t)return r;s.push(r)}return s}function On(e,t){for(var n=e.length;n--;)if(F(e[n],t))return n;return-1}var In={text:{bind:function(){var e=this,t=this.el,n="range"===t.type,i=this.params.lazy,r=this.params.number,s=this.params.debounce,o=!1;$||n||(this.on("compositionstart",function(){o=!0}),this.on("compositionend",function(){o=!1,i||e.listener()})),this.focused=!1,n||(this.on("focus",function(){e.focused=!0}),this.on("blur",function(){e.focused=!1,e.listener()})),this.listener=function(){if(!o){var i=r||n?d(t.value):t.value;e.set(i),j(function(){e._bound&&!e.focused&&e.update(e._watcher.value)})}},s&&(this.listener=I(this.listener,s)),this.hasjQuery="function"==typeof jQuery,this.hasjQuery?(jQuery(t).on("change",this.listener),i||jQuery(t).on("input",this.listener)):(this.on("change",this.listener),i||this.on("input",this.listener)),!i&&R&&(this.on("cut",function(){j(e.listener)}),this.on("keyup",function(t){46!==t.keyCode&&8!==t.keyCode||e.listener()})),(t.hasAttribute("value")||"TEXTAREA"===t.tagName&&t.value.trim())&&(this.afterBind=this.listener)},update:function(e){this.el.value=l(e)},unbind:function(){var e=this.el;this.hasjQuery&&(jQuery(e).off("change",this.listener),jQuery(e).off("input",this.listener))}},radio:{bind:function(){var e=this,t=this.el;this.getValue=function(){if(t.hasOwnProperty("_value"))return t._value;var n=t.value;return e.params.number&&(n=d(n)),n},this.listener=function(){e.set(e.getValue())},this.on("change",this.listener),t.checked&&(this.afterBind=this.listener)},update:function(e){this.el.checked=F(e,this.getValue())}},select:{bind:function(){var e=this,t=this.el;this.forceUpdate=function(){e._watcher&&e.update(e._watcher.get())};var n=this.multiple=t.hasAttribute("multiple");this.listener=function(){var i=An(t,n);i=e.params.number?A(i)?i.map(d):d(i):i,e.set(i)},this.on("change",this.listener);var i=An(t,n,!0);(n&&i.length||!n&&null!==i)&&(this.afterBind=this.listener),this.vm.$on("hook:attached",this.forceUpdate)},update:function(e){var t=this.el;t.selectedIndex=-1;for(var n,i,r=this.multiple&&A(e),s=t.options,o=s.length;o--;
1)i=(n=s[o]).hasOwnProperty("_value")?n._value:n.value,n.selected=r?On(e,i)>-1:F(e,i)},unbind:function(){this.vm.$off("hook:attached",this.forceUpdate)}},checkbox:{bind:function(){var e=this,t=this.el;this.getValue=function(){return t.hasOwnProperty("_value")?t._value:e.params.number?d(t.value):t.value},this.listener=function(){var n=e._watcher.value;if(A(n)){var i=e.getValue();t.checked?T(n,i)<0&&n.push(i):n.$remove(i)}else e.set(function(){var e=t.checked;return e&&t.hasOwnProperty("_trueValue")?t._trueValue:!e&&t.hasOwnProperty("_falseValue")?t._falseValue:e}())},this.on("change",this.listener),t.checked&&(this.afterBind=this.listener)},update:function(e){var t=this.el;A(e)?t.checked=T(e,this.getValue())>-1:t.hasOwnProperty("_trueValue")?t.checked=F(e,t._trueValue):t.checked=!!e}}},Tn={priority:800,twoWay:!0,handlers:In,params:["lazy","number","debounce"],bind:function(){this.checkFilters(),this.hasRead&&this.hasWrite;var e,t=this.el,n=t.tagName;if("INPUT"===n)e=In[t.type]||In.text;else if("SELECT"===n)e=In.select;else{if("TEXTAREA"!==n)return;e=In.text}t.__v_model=this,e.bind.call(this),this.update=e.update,this._unbind=e.unbind},checkFilters:function(){var e=this.filters;if(e)for(var t=e.length;t--;){var n=ot(this.vm.$options,"filters",e[t].name);("function"==typeof n||n.read)&&(this.hasRead=!0),n.write&&(this.hasWrite=!0)}},unbind:function(){this.el.__v_model=null,this._unbind&&this._unbind()}},Dn={bind:function(){var e=this.el.nextElementSibling;e&&null!==Oe(e,"v-else")&&(this.elseEl=e)},update:function(e){this.apply(this.el,e),this.elseEl&&this.apply(this.elseEl,!e)},apply:function(e,t){xe(e,t?1:-1,function(){e.style.display=t?"":"none"},this.vm)}},Fn=new W(1e3),Mn=new W(1e3),Bn={efault:[0,"",""],legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]};function Rn(e){return Ye(e)&&e.content instanceof DocumentFragment}Bn.td=Bn.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Bn.option=Bn.optgroup=[1,'<select multiple="multiple">',"</select>"],Bn.thead=Bn.tbody=Bn.colgroup=Bn.caption=Bn.tfoot=[1,"<table>","</table>"],Bn.g=Bn.defs=Bn.symbol=Bn.use=Bn.image=Bn.text=Bn.circle=Bn.ellipse=Bn.line=Bn.path=Bn.polygon=Bn.polyline=Bn.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"version="1.1">',"</svg>"];var $n=/<([\w:]+)/,Ln=/&\w+;|&#\d+;|&#x[\dA-F]+;/;function Nn(e,t){var n=Fn.get(e);if(n)return n;var i=document.createDocumentFragment(),r=e.match($n),s=Ln.test(e);if(r||s){var o,a=r&&r[1],c=Bn[a]||Bn.efault,u=c[0],l=c[1],d=c[2],h=document.createElement("div");for(t||(e=e.trim()),h.innerHTML=l+e+d;u--;)h=h.lastChild;for(;o=h.firstChild;)i.appendChild(o)}else i.appendChild(document.createTextNode(e));return Fn.put(e,i),i}function qn(e){if(Rn(e))return Ve(e.content),e.content;if("SCRIPT"===e.tagName)return Nn(e.textContent);for(var t,n=Yn(e),i=document.createDocumentFragment();t=n.firstChild;)i.appendChild(t);return Ve(i),i}var Vn=function(){if(B){var e=document.createElement("div");return e.innerHTML="<template>1</template>",!e.cloneNode(!0).firstChild.innerHTML}return!1}(),Un=function(){if(B){var e=document.createElement("textarea");return e.placeholder="t","t"===e.cloneNode(!0).value}return!1}();function Yn(e){if(!e.querySelectorAll)return e.cloneNode();var t,n,i,r=e.cloneNode(!0);if(Vn){var s=r;if(Rn(e)&&(e=e.content,s=r.content),(n=e.querySelectorAll("template")).length)for(t=(i=s.querySelectorAll("template")).length;t--;)i[t].parentNode.replaceChild(Yn(n[t]),i[t])}if(Un)if("TEXTAREA"===e.tagName)r.value=e.value;else if((n=e.querySelectorAll("textarea")).length)for(t=(i=r.querySelectorAll("textarea")).length;t--;)i[t].value=n[t].value;return r}function jn(e,t,n){var i,r;return e instanceof DocumentFragment?(Ve(e),t?Yn(e):e):("string"==typeof e?n||"#"!==e.charAt(0)?r=Nn(e,n):(r=Mn.get(e))||(i=document.getElementById(e.slice(1)))&&(r=qn(i),Mn.put(e,r)):e.nodeType&&(r=qn(e)),r&&t?Yn(r):r)}var Wn=Object.freeze({cloneNode:Yn,parseTemplate:jn});function Kn(e,t,n,i,r,s){this.children=[],this.childFrags=[],this.vm=t,this.scope=r,this.inserted=!1,this.parentFrag=s,s&&s.childFrags.push(this),this.unlink=e(t,n,i,r,this),(this.single=1===n.childNodes.length&&!n.childNodes[0].__vue_anchor)?(this.node=n.childNodes[0],this.before=Gn,this.remove=Hn):(this.node=je("fragment-start"),this.end=je("fragment-end"),this.frag=n,Me(this.node,n),n.appendChild(this.end),this.before=zn,this.remove=Zn),this.node.__vfrag__=this}function Gn(e,t){this.inserted=!0,(!1!==t?Ce:Te)(this.node,e,this.vm),Ae(this.node)&&this.callHook(Qn)}function Hn(){this.inserted=!1;var e=Ae(this.node),t=this;t.callHook(Xn),ke(this.node,this.vm,function(){e&&t.callHook(Jn),t.destroy()})}function zn(e,t){this.inserted=!0;var n=this.vm,i=!1!==t?Ce:Te;Ge(this.node,this.end,function(t){i(t,e,n)}),Ae(this.node)&&this.callHook(Qn)}function Zn(){this.inserted=!1;var e=this,t=Ae(this.node);e.callHook(Xn),He(this.node,this.end,this.vm,this.frag,function(){t&&e.callHook(Jn),e.destroy()})}function Qn(e){e._isAttached||e._callHook("attached")}function Xn(e){e.$destroy(!1,!0)}function Jn(e){e._isAttached&&e._callHook("detached")}Kn.prototype.callHook=function(e){var t,n;for(t=0,n=this.children.length;t<n;t++)e(this.children[t]);for(t=0,n=this.childFrags.length;t<n;t++)this.childFrags[t].callHook(e)},Kn.prototype.destroy=function(){this.parentFrag&&this.parentFrag.childFrags.$remove(this),this.unlink()};var ei=new W(5e3);function ti(e,t){var n;this.vm=e;var i,r="string"==typeof t;r||Ye(t)?n=jn(t,!0):(n=document.createDocumentFragment()).appendChild(t),this.template=n;var s=e.constructor.cid;if(s>0){var o=s+(r?t:t.outerHTML);(i=ei.get(o))||(i=Fi(n,e.$options,!0),ei.put(o,i))}else i=Fi(n,e.$options,!0);this.linker=i}ti.prototype.create=function(e,t,n){var i=Yn(this.template);return new Kn(this.linker,this.vm,i,e,t,n)};var ni={priority:2e3,bind:function(){var e=this.el;if(e.__vue__)this.invalid=!0;else{var t=e.nextElementSibling;t&&null!==Oe(t,"v-else")&&(Fe(t),this.elseFactory=new ti(this.vm,t)),this.anchor=je("v-if"),Be(e,this.anchor),this.factory=new ti(this.vm,e)}},update:function(e){this.invalid||(e?this.frag||this.insert():this.remove())},insert:function(){this.elseFrag&&(this.elseFrag.remove(),this.elseFrag=null),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},remove:function(){this.frag&&(this.frag.remove(),this.frag=null),this.elseFactory&&!this.elseFrag&&(this.elseFrag=this.elseFactory.create(this._host,this._scope,this._frag),this.elseFrag.before(this.anchor))},unbind:function(){this.frag&&this.frag.destroy()}},ii=0,ri={priority:2e3,params:["track-by","stagger","enter-stagger","leave-stagger"],bind:function(){var e=this.expression.match(/(.*) in (.*)/);if(e){var t=e[1].match(/\((.*),(.*)\)/);t?(this.iterator=t[1].trim(),this.alias=t[2].trim()):this.alias=e[1].trim(),this.expression=e[2]}
1if(this.alias){this.id="__v-for__"+ ++ii;var n=this.el.tagName;this.isOption=("OPTION"===n||"OPTGROUP"===n)&&"SELECT"===this.el.parentNode.tagName,this.start=je("v-for-start"),this.end=je("v-for-end"),Be(this.el,this.end),Te(this.start,this.end),this.cache=Object.create(null),this.factory=new ti(this.vm,this.el)}},update:function(e){this.diff(e),this.updateRef(),this.updateModel()},diff:function(e){var t,n,i,r,s,a,c=e[0],u=this.fromObject=C(c)&&o(c,"$key")&&o(c,"$value"),l=this.params.trackBy,d=this.frags,h=this.frags=new Array(e.length),f=this.alias,p=this.iterator,m=this.start,_=this.end,y=Ae(m),g=!d;for(t=0,n=e.length;t<n;t++)c=e[t],r=u?c.$key:null,a=!C(s=u?c.$value:c),(i=!g&&this.getCachedFrag(s,t,r))?(i.reused=!0,i.scope.$index=t,r&&(i.scope.$key=r),p&&(i.scope[p]=null!==r?r:t),(l||u||a)&&(i.scope[f]=s)):(i=this.create(s,f,t,r)).fresh=!g,h[t]=i,g&&i.before(_);if(!g){var v,b,w,P=0,E=d.length-h.length;for(t=0,n=d.length;t<n;t++)(i=d[t]).reused||(this.deleteCachedFrag(i),this.remove(i,P++,E,y));var k=0;for(t=0,n=h.length;t<n;t++)i=h[t],b=(v=h[t-1])?v.staggerCb?v.staggerAnchor:v.end||v.node:m,i.reused&&!i.staggerCb?(w=si(i,m,this.id))===v||w&&si(w,m,this.id)===v||this.move(i,b):this.insert(i,k++,b,y),i.reused=i.fresh=!1}},create:function(e,t,n,i){var r=this._host,s=this._scope||this.vm,o=Object.create(s);o.$refs=Object.create(s.$refs),o.$els=Object.create(s.$els),o.$parent=s,o.$forContext=this,yt(o,t,e),yt(o,"$index",n),i?yt(o,"$key",i):o.$key&&O(o,"$key",null),this.iterator&&yt(o,this.iterator,null!==i?i:n);var a=this.factory.create(r,o,this._frag);return a.forId=this.id,this.cacheFrag(e,a,n,i),a},updateRef:function(){var e=this.descriptor.ref;if(e){var t,n=(this._scope||this.vm).$refs;this.fromObject?(t={}
1,this.frags.forEach(function(e){t[e.scope.$key]=oi(e)})):t=this.frags.map(oi),n[e]=t}},updateModel:function(){if(this.isOption){var e=this.start.parentNode,t=e&&e.__v_model;t&&t.forceUpdate()}},insert:function(e,t,n,i){e.staggerCb&&(e.staggerCb.cancel(),e.staggerCb=null);var r=this.getStagger(e,t,null,"enter");if(i&&r){var s=e.staggerAnchor;s||((s=e.staggerAnchor=je("stagger-anchor")).__vfrag__=e),De(s,n);var o=e.staggerCb=D(function(){e.staggerCb=null,e.before(s),Fe(s)});setTimeout(o,r)}else e.before(n.nextSibling)},remove:function(e,t,n,i){if(e.staggerCb)return e.staggerCb.cancel(),void(e.staggerCb=null);var r=this.getStagger(e,t,n,"leave");if(i&&r){var s=e.staggerCb=D(function(){e.staggerCb=null,e.remove()});setTimeout(s,r)}else e.remove()},move:function(e,t){e.before(t.nextSibling,!1)},cacheFrag:function(e,t,n,i){var r,s=this.params.trackBy,a=this.cache,c=!C(e);i||s||c?a[r=s?"$index"===s?n:e[s]:i||e]||(a[r]=t):o(e,r=this.id)?null===e[r]&&(e[r]=t):O(e,r,t),t.raw=e},getCachedFrag:function(e,t,n){var i,r=this.params.trackBy,s=!C(e);if(n||r||s){var o=r?"$index"===r?t:e[r]:n||e;i=this.cache[o]}else i=e[this.id];return i&&(i.reused||i.fresh),i},deleteCachedFrag:function(e){var t=e.raw,n=this.params.trackBy,i=e.scope,r=i.$index,s=o(i,"$key")&&i.$key,a=!C(t);if(n||s||a){var c=n?"$index"===n?r:t[n]:s||t;this.cache[c]=null}else t[this.id]=null,e.raw=null},getStagger:function(e,t,n,i){i+="Stagger";var r=e.node.__v_trans,s=r&&r.hooks,o=s&&(s[i]||s.stagger);return o?o.call(e,t,n):t*parseInt(this.params[i]||this.params.stagger,10)},_preProcess:function(e){return this.rawValue=e,e},_postProcess:function(e){if(A(e))return e;if(S(e)){for(var t,n=Object.keys(e),i=n.length,r=new Array(i);i--;)t=n[i],r[i]={$key:t,$value:e[t]};return r}return"number"==typeof e&&(e=function(e){var t=-1,n=new Array(e);for(;++t<e;)n[t]=t;return n}(e)),e||[]},unbind:function(){if(this.descriptor.ref&&((this._scope||this.vm).$refs[this.descriptor.ref]=null),this.frags)for(var e,t=this.frags.length;t--;)e=this.frags[t],this.deleteCachedFrag(e),e.destroy()}};function si(e,t,n){var i=e.node.previousSibling;if(i){for(e=i.__vfrag__;!(e&&e.forId===n&&e.inserted||i===t);){if(!(i=i.previousSibling))return;e=i.__vfrag__}return e}}function oi(e){var t=e.node;if(e.end)for(;!t.__vue__&&t!==e.end&&t.nextSibling;)t=t.nextSibling;return t.__vue__}var ai={text:{bind:function(){this.attr=3===this.el.nodeType?"data":"textContent"},update:function(e){this.el[this.attr]=l(e)}},html:{bind:function(){8===this.el.nodeType&&(this.nodes=[],this.anchor=je("v-html"),Be(this.el,this.anchor))},update:function(e){e=l(e),this.nodes?this.swap(e):this.el.innerHTML=e},swap:function(e){for(var t=this.nodes.length;t--;)Fe(this.nodes[t]);var n=jn(e,!0,!0);this.nodes=P(n.childNodes),Te(n,this.anchor)}},for:ri,if:ni,show:Dn,model:Tn,on:Sn,bind:kn,el:pn,ref:fn,cloak:{bind:function(){var e=this.el;this.vm.$once("hook:compiled",function(){e.removeAttribute("v-cloak")})}}},ci=[],ui=!1;function li(e){ci.push(e),ui||(ui=!0,j(di))}function di(){for(var e=document.documentElement.offsetHeight,t=0;t<ci.length;t++)ci[t]();return ci=[],ui=!1,e}var hi=L+"Duration",fi=q+"Duration";function pi(e,t,n,i){this.id=t,this.el=e,this.enterClass=t+"-enter",this.leaveClass=t+"-leave",this.hooks=n,this.vm=i,this.pendingCssEvent=this.pendingCssCb=this.cancel=this.pendingJsCb=this.op=this.cb=null,this.justEntered=!1,this.entered=this.left=!1,this.typeCache={};var r=this;["enterNextTick","enterDone","leaveNextTick","leaveDone"].forEach(function(e){r[e]=w(r[e],r)})}var mi=pi.prototype;mi.enter=function(e,t){this.cancelPending(),this.callHook("beforeEnter"),this.cb=t,Le(this.el,this.enterClass),e(),this.entered=!1,this.callHookWithCb("enter"),this.entered||(this.cancel=this.hooks&&this.hooks.enterCancelled,li(this.enterNextTick))},mi.enterNextTick=function(){this.justEntered=!0;var e=this;setTimeout(function(){e.justEntered=!1},17);var t=this.enterDone,n=this.getCssTransitionType(this.enterClass);this.pendingJsCb?1===n&&Ne(this.el,this.enterClass):1===n?(Ne(this.el,this.enterClass),this.setupCssCb(N,t)):2===n?this.setupCssCb(V,t):t()},mi.enterDone=function(){this.entered=!0,this.cancel=this.pendingJsCb=null,Ne(this.el,this.enterClass),this.callHook("afterEnter"),this.cb&&this.cb()},mi.leave=function(e,t){this.cancelPending(),this.callHook("beforeLeave"),this.op=e,this.cb=t,Le(this.el,this.leaveClass),this.left=!1,this.callHookWithCb("leave"),this.left||(this.cancel=this.hooks&&this.hooks.leaveCancelled,this.op&&!this.pendingJsCb&&(this.justEntered?this.leaveDone():li(this.leaveNextTick)))},mi.leaveNextTick=function(){var e=this.getCssTransitionType(this.leaveClass);if(e){var t=1===e?N:V;this.setupCssCb(t,this.leaveDone)}else this.leaveDone()},mi.leaveDone=function(){this.left=!0,this.cancel=this.pendingJsCb=null,this.op(),Ne(this.el,this.leaveClass),this.callHook("afterLeave"),this.cb&&this.cb(),this.op=null},mi.cancelPending=function(){this.op=this.cb=null;var e=!1;this.pendingCssCb&&(e=!0,$e(this.el,this.pendingCssEvent,this.pendingCssCb),this.pendingCssEvent=this.pendingCssCb=null),this.pendingJsCb&&(e=!0,this.pendingJsCb.cancel(),this.pendingJsCb=null),e&&(Ne(this.el,this.enterClass),Ne(this.el,this.leaveClass)),this.cancel&&(this.cancel.call(this.vm,this.el),this.cancel=null)},mi.callHook=function(e){this.hooks&&this.hooks[e]&&this.hooks[e].call(this.vm,this.el)},mi.callHookWithCb=function(e){var t=this.hooks&&this.hooks[e];t&&(t.length>1&&(this.pendingJsCb=D(this[e+"Done"])),t.call(this.vm,this.el,this.pendingJsCb))},mi.getCssTransitionType=function(e){if(!(!N||document.hidden||this.hooks&&!1===this.hooks.css)&&((t=this.el).offsetWidth||t.offsetHeight||t.getClientRects().length)){var t,n=this.typeCache[e];if(n)return n;var i=this.el.style,r=window.getComputedStyle(this.el),s=i[hi]||r[hi
1];if(s&&"0s"!==s)n=1;else{var o=i[fi]||r[fi];o&&"0s"!==o&&(n=2)}return n&&(this.typeCache[e]=n),n}},mi.setupCssCb=function(e,t){this.pendingCssEvent=e;var n=this,i=this.el,r=this.pendingCssCb=function(s){s.target===i&&($e(i,e,r),n.pendingCssEvent=n.pendingCssCb=null,!n.pendingJsCb&&t&&t())};Re(i,e,r)};var _i={priority:1100,update:function(e,t){var n=this.el,i=ot(this.vm.$options,"transitions",e);e=e||"v",n.__v_trans=new pi(n,e,i,this.el.__vue__||this.vm),t&&Ne(n,t+"-transition"),Le(n,e+"-transition")}},yi=we._propBindingModes,gi={bind:function(){var e=this.vm,t=e._context,n=this.descriptor.prop,i=n.path,r=n.parentPath,s=n.mode===yi.TWO_WAY,o=this.parentWatcher=new hn(t,r,function(t){Je(n,t)&&(e[i]=t)},{twoWay:s,filters:n.filters,scope:this._scope});if(Xe(e,n,o.value),s){var a=this;e.$once("hook:created",function(){a.childWatcher=new hn(e,i,function(e){o.set(e)},{sync:!0})})}},unbind:function(){this.parentWatcher.teardown(),this.childWatcher&&this.childWatcher.teardown()}};function vi(e,t){return A(e)?e.indexOf(t)>-1:o(e,t)}var bi={style:bn,class:{deep:!0,update:function(e){e&&"string"==typeof e?this.handleObject(function(e){var t={},n=e.trim().split(/\s+/),i=n.length;for(;i--;)t[n[i]]=!0;return t}(e)):S(e)?this.handleObject(e):A(e)?this.handleArray(e):this.cleanup()},handleObject:function(e){this.cleanup(e);for(var t=this.prevKeys=Object.keys(e),n=0,i=t.length;n<i;n++){var r=t[n];e[r]?Le(this.el,r):Ne(this.el,r)}},handleArray:function(e){this.cleanup(e);for(var t=0,n=e.length;t<n;t++)e[t]&&Le(this.el,e[t]);this.prevKeys=e.slice()},cleanup:function(e){if(this.prevKeys)for(var t=this.prevKeys.length;t--;){var n=this.prevKeys[t];!n||e&&vi(e,n)||Ne(this.el,n)}}},component:{priority:1500,params:["keep-alive","transition-mode","inline-template"],bind:function(){this.el.__vue__||(this.keepAlive=this.params.keepAlive,this.keepAlive&&(this.cache={}),this.params.inlineTemplate&&(this.inlineTemplate=qe(this.el,!0)),this.pendingComponentCb=this.Component=null,this.pendingRemovals=0,this.pendingRemovalCb=null,this.anchor=je("v-component"),Be(this.el,this.anchor),this.el.removeAttribute("is"),this.descriptor.ref&&this.el.removeAttribute("v-ref:"+g(this.descriptor.ref)),this.literal&&this.setComponent(this.expression))},update:function(e){this.literal||this.setComponent(e)},setComponent:function(e,t){if(this.invalidatePending(),e){var n=this;this.resolveComponent(e,function(){n.mountComponent(t)})}else this.unbuild(!0),this.remove(this.childVM,t),this.childVM=null},resolveComponent:function(e,t){var n=this;this.pendingComponentCb=D(function(i){n.ComponentName=i.options.name||e,n.Component=i,t()}),this.vm._resolveComponent(e,this.pendingComponentCb)},mountComponent:function(e){this.unbuild(!0);var t=this,n=this.Component.options.activate,i=this.getCached(),r=this.build();n&&!i?(this.waitingFor=r,n.call(r,function(){t.waitingFor=null,t.transition(r,e)})):(i&&r._updateRef(),this.transition(r,e))},invalidatePending:function(){this.pendingComponentCb&&(this.pendingComponentCb.cancel(),this.pendingComponentCb=null)},build:function(e){var t=this.getCached();if(t)return t;if(this.Component){var n={name:this.ComponentName,el:Yn(this.el),template:this.inlineTemplate,parent:this._host||this.vm,_linkerCachable:!this.inlineTemplate,_ref:this.descriptor.ref,_asComponent:!0,_isRouterView:this._isRouterView,_context:this.vm,_scope:this._scope,_frag:this._frag};e&&E(n,e);var i=new this.Component(n);return this.keepAlive&&(this.cache[this.Component.cid]=i),i}},getCached:function(){return this.keepAlive&&this.cache[this.Component.cid]},unbuild:function(e){this.waitingFor&&(this.waitingFor.$destroy(),this.waitingFor=null);var t=this.childVM;t&&!this.keepAlive?t.$destroy(!1,e):t&&t._updateRef(!0)},remove:function(e,t){var n=this.keepAlive;if(e){this.pendingRemovals++,this.pendingRemovalCb=t;var i=this;e.$remove(function(){i.pendingRemovals--,n||e._cleanup(),!i.pendingRemovals&&i.pendingRemovalCb&&(i.pendingRemovalCb(),i.pendingRemovalCb=null)})}else t&&t()},transition:function(e,t){var n=this,i=this.childVM;switch(this.childVM=e,n.params.transitionMode){case"in-out":e.$before(n.anchor,function(){n.remove(i,t)});break;case"out-in":n.remove(i,function(){e.$before(n.anchor,t)});break;default:n.remove(i),e.$before(n.anchor,t)}},unbind:function(){if(this.invalidatePending(),this.unbuild(),this.cache){for(var e in this.cache)this.cache[e].$destroy();this.cache=null}}},prop:gi,transition:_i},wi=we._propBindingModes,Pi={},Ei=/^[$_a-zA-Z]+[\w$]*$/;function Ci(e,t){for(var n,i,r,s,o,a,u,l=[],p=Object.keys(t),_=p.length;_--;)n=t[i=p[_]]||Pi,o=m(i),Ei.test(o)&&(u={name:i,path:o,options:n,mode:wi.ONE_WAY,raw:null},null===(s=Ie(e,r=g(i)))&&(null!==(s=Ie(e,r+".sync"))?u.mode=wi.TWO_WAY:null!==(s=Ie(e,r+".once"))&&(u.mode=wi.ONE_TIME)),null!==s?(u.raw=s,s=(a=oe(s)).expression,u.filters=a.filters,c(s)?u.optimizedLiteral=!0:u.dynamic=!0,u.parentPath=s):null!==(s=Oe(e,r))?u.raw=s:n.required,l.push(u));return function(e){return function(t,n){t._props={};for(var i,r,s,o,a,c=e.length;c--;)if(i=e[c],a=i.raw,r=i.path,s=i.options,t._props[r]=i,null===a)Xe(t,i,ki(t,s));else if(i.dynamic)t._context&&(i.mode===wi.ONE_TIME?(o=(n||t._context).$get(i.parentPath),Xe(t,i,o)):t._bindDir({name:"prop",def:gi,prop:i},null,null,n));else if(i.optimizedLiteral){var u=f(a);o=u===a?h(d(a)):u,Xe(t,i,o)}
1else o=s.type===Boolean&&""===a||a,Xe(t,i,o)}}(l)}function ki(e,t){if(!o(t,"default"))return t.type!==Boolean&&void 0;var n=t.default;return C(n),"function"==typeof n&&t.type!==Function?n.call(e):n}var xi=/^v-bind:|^:/,Si=/^v-on:|^@/,Ai=/:(.*)$/,Oi=/\.[^\.]+/g,Ii=/^(v-bind:|:)?transition$/,Ti=["for","if"],Di=1e3;function Fi(e,t,n){var i=n||!t._asComponent?qi(e,t):null,r=i&&i.terminal||"SCRIPT"===e.tagName||!e.hasChildNodes()?null:function e(t,n){var i=[];var r,s,o;for(var a=0,c=t.length;a<c;a++)o=t[a],r=qi(o,n),s=r&&r.terminal||"SCRIPT"===o.tagName||!o.hasChildNodes()?null:e(o.childNodes,n),i.push(r,s);return i.length?function(e){return function(t,n,i,r,s){for(var o,a,c,u=0,l=0,d=e.length;u<d;l++){o=n[l],a=e[u++],c=e[u++];var h=P(o.childNodes);a&&a(t,o,i,r,s),c&&c(t,h,i,r,s)}}}(i):null}(e.childNodes,t);return function(e,t,n,s,o){var a=P(t.childNodes),c=Mi(function(){i&&i(e,t,n,s,o),r&&r(e,a,n,s,o)},e);return Ri(e,c)}}function Mi(e,t){var n=t._directives.length;e();var i=t._directives.slice(n);i.sort(Bi);for(var r=0,s=i.length;r<s;r++)i[r]._bind();return i}function Bi(e,t){return(e=e.descriptor.def.priority||Di)>(t=t.descriptor.def.priority||Di)?-1:e===t?0:1}function Ri(e,t,n,i){return function(r){$i(e,t,r),n&&i&&$i(n,i)}}function $i(e,t,n){for(var i=t.length;i--;)t[i]._teardown(),n||e._directives.$remove(t[i])}function Li(e,t,n,i){var r=Ci(t,n),s=Mi(function(){r(e,i)},e);return Ri(e,s)}function Ni(e,t,n){var i,r,s=t._containerAttrs,o=t._replacerAttrs;11!==e.nodeType&&(t._asComponent?(s&&n&&(i=Wi(s,n)),o&&(r=Wi(o,t))):r=Wi(e.attributes,t));return function(e,t,n){var s,o=e._context;o&&i&&(s=Mi(function(){i(o,t,null,n)},o));var a=Mi(function(){r&&r(e,t)},e);return Ri(e,a,o,s)}}function qi(e,t){var n=e.nodeType;return 1===n&&"SCRIPT"!==e.tagName?function(e,t){if("TEXTAREA"===e.tagName){var n=pe(e.value);n&&(e.setAttribute(":value",me(n)),e.value="")}var i,r=e.hasAttributes();r&&(i=function(e,t){if(null!==Oe(e,"v-pre"))return Yi;if(e.hasAttribute("v-else")){var n=e.previousElementSibling;if(n&&n.hasAttribute("v-if"))return Yi}for(var i,r,s=0,o=Ti.length;s<o;s++)if(r=Ti[s],i=e.getAttribute("v-"+r))return ji(e,r,i,t)}(e,t));i||(i=function(e,t){var n=e.tagName.toLowerCase();if(ze.test(n))return;var i=ot(t,"elementDirectives",n);if(i)return ji(e,n,"",t,i)}(e,t));i||(i=function(e,t){var n=Ze(e,t);if(n){var i=Ke(e),r={name:"component",ref:i,expression:n.id,def:bi.c
1omponent,modifiers:{literal:!n.dynamic}},s=function(e,t,n,s,o){i&&yt((s||e).$refs,i,null),e._bindDir(r,t,n,s,o)};return s.terminal=!0,s}}(e,t));!i&&r&&(i=Wi(e.attributes,t));return i}(e,t):3===n&&e.data.trim()?function(e,t){if(e._skip)return Vi;var n=pe(e.wholeText);if(!n)return null;var i=e.nextSibling;for(;i&&3===i.nodeType;)i._skip=!0,i=i.nextSibling;for(var r,s,o=document.createDocumentFragment(),a=0,c=n.length;a<c;a++)s=n[a],r=s.tag?Ui(s,t):document.createTextNode(s.value),o.appendChild(r);return function(e,t){return function(n,i,r,s){for(var o,a,c,u=t.cloneNode(!0),l=P(u.childNodes),d=0,h=e.length;d<h;d++)o=e[d],a=o.value,o.tag&&(c=l[d],o.oneTime?(a=(s||n).$eval(a),o.html?Be(c,jn(a,!0)):c.data=a):n._bindDir(o.descriptor,c,r,s));Be(i,u)}}(n,o)}(e,t):null}function Vi(e,t){Fe(t)}function Ui(e,t){var n;function i(t){if(!e.descriptor){var n=oe(e.value);e.descriptor={name:t,def:ai[t],expression:n.expression,filters:n.filters}}}return e.oneTime?n=document.createTextNode(e.value):e.html?(n=document.createComment("v-html"),i("html")):(n=document.createTextNode(" "),i("text")),n}function Yi(){}function ji(e,t,n,i,r){var s=oe(n),o={name:t,expression:s.expression,filters:s.filters,raw:n,def:r||ai[t]};"for"!==t&&"router-view"!==t||(o.ref=Ke(e));var a=function(e,t,n,i,r){o.ref&&yt((i||e).$refs,o.ref,null),e._bindDir(o,t,n,i,r)};return a.terminal=!0,a}function Wi(e,t){for(var n,i,r,s,o,a,c,u,l,d,h,f=e.length,p=[];f--;)if(n=e[f],i=s=n.name,d=pe(r=o=n.value),c=null,u=Ki(i),i=i.replace(Oi,""),d)r=me(d),c=i,m("bind",ai.bind,!0);else if(Ii.test(i))u.literal=!xi.test(i),m("transition",bi.transition);else if(Si.test(i))c=i.replace(Si,""),m("on",ai.on);else if(xi.test(i))"style"===(a=i.replace(xi,""))||"class"===a?m(a,bi[a]):(c=a,m("bind",ai.bind));else if(0===i.indexOf("v-")){if((c=(c=i.match(Ai))&&c[1])&&(i=i.replace(Ai,"")),"else"===(a=i.slice(2)))continue;(l=ot(t,"directives",a))&&m(a,l)}function m(e,t,n){var i=oe(r);p.push({name:e,attr:s,raw:o,def:t,arg:c,modifiers:u,expression:i.expression,filters:i.filters,interp:n})}if(p.length)return h=p,function(e,t,n,i,r){for(var s=h.length;s--;)e._bindDir(h[s],t,n,i,r)}}function Ki(e){var t=Object.create(null),n=e.match(Oi);if(n)for(var i=n.length;i--;)t[n[i].slice(1)]=!0;return t}Yi.terminal=!0;var Gi=/[^\w\-:\.]/;function Hi(e,t){return t&&(t._containerAttrs=zi(e)),Ye(e)&&(e=jn(e)),t&&(t._asComponent&&!t.template&&(t.template="<slot></slot>"),t.template&&(t._content=qe(e),e=function(e,t){var n=t.template,i=jn(n,!0);if(i){var r=i.firstChild,s=r.tagName&&r.tagName.toLowerCase();return t.replace?(document.body,i.childNodes.length>1||1!==r.nodeType||"component"===s||ot(t,"components",s)||r.hasAttribute("is")||r.hasAttribute(":is")||r.hasAttribute("v-bind:is")||ot(t,"elementDirectives",s)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?i:(t._replacerAttrs=zi(r),function(e,t){var n,i,r=e.attributes,s=r.length;for(;s--;)n=r[s].name,i=r[s].value,t.hasAttribute(n)||Gi.test(n)?"class"===n&&i.split(/\s+/).forEach(function(e){Le(t,e)}):t.setAttribute(n,i)}(e,r),r)):(e.appendChild(i),e)}}(e,t))),e instanceof DocumentFragment&&(Me(je("v-start",!0),e),e.appendChild(je("v-end",!0))),e}function zi(e){if(1===e.nodeType&&e.hasAttributes())return P(e.attributes)}var Zi=Object.freeze({compile:Fi,compileAndLinkProps:Li,compileRoot:Ni,transclude:Hi});var Qi=/^v-on:|^@/;function Xi(){}function Ji(e,t,n,i,r,s){this.vm=t,this.el=n,this.descriptor=e,this.name=e.name,this.expression=e.expression,this.arg=e.arg,this.modifiers=e.modifiers,this.filters=e.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=i,this._scope=r,this._frag=s}Ji.prototype._bind=function(){var e=this.name,t=this.descriptor;if(("cloak"!==e||this.vm._isCompiled)&&this.el&&this.el.removeAttribute){var n=t.attr||"v-"+e;this.el.removeAttribute(n)}var i=t.def;if("function"==typeof i?this.update=i:E(this,i),this._setupParams(),this.bind&&this.bind(),this.literal)this.update&&this.update(t.raw);else if((this.expression||this.modifiers)&&(this.update||this.twoWay)&&!this._checkStatement
1()){var r=this;this.update?this._update=function(e,t){r._locked||r.update(e,t)}:this._update=Xi;var s=this._preProcess?w(this._preProcess,this):null,o=this._postProcess?w(this._postProcess,this):null,a=this._watcher=new hn(this.vm,this.expression,this._update,{filters:this.filters,twoWay:this.twoWay,deep:this.deep,preProcess:s,postProcess:o,scope:this._scope});this.afterBind?this.afterBind():this.update&&this.update(a.value)}this._bound=!0},Ji.prototype._setupParams=function(){if(this.params){var e=this.params;this.params=Object.create(null);for(var t,n,i,r=e.length;r--;)i=m(t=e[r]),null!=(n=Ie(this.el,t))?this._setupParamWatcher(i,n):null!=(n=Oe(this.el,t))&&(this.params[i]=""===n||n)}},Ji.prototype._setupParamWatcher=function(e,t){var n=this,i=!1,r=(this._scope||this.vm).$watch(t,function(t,r){if(n.params[e]=t,i){var s=n.paramWatchers&&n.paramWatchers[e];s&&s.call(n,t,r)}else i=!0},{immediate:!0});(this._paramUnwatchFns||(this._paramUnwatchFns=[])).push(r)},Ji.prototype._checkStatement=function(){var e=this.expression;if(e&&this.acceptStatement&&!tn(e)){var t=en(e).get,n=this._scope||this.vm,i=function(e){n.$event=e,t.call(n,n),n.$event=null};return this.filters&&(i=n._applyFilters(i,null,this.filters)),this.update(i),!0}},Ji.prototype.set=function(e){this.twoWay&&this._withLock(function(){this._watcher.set(e)})},Ji.prototype._withLock=function(e){var t=this;t._locked=!0,e.call(t),j(function(){t._locked=!1})},Ji.prototype.on=function(e,t){Re(this.el,e,t),(this._listeners||(this._listeners=[])).push([e,t])},Ji.prototype._teardown=function(){if(this._bound){this._bound=!1,this.unbind&&this.unbind(),this._watcher&&this._watcher.teardown();var e,t=this._listeners;if(t)for(e=t.length;e--;)$e(this.el,t[e][0],t[e][1]);var n=this._paramUnwatchFns;if(n)for(e=n.length;e--;)n[e]();0,this.vm=this.el=this._watcher=this._listeners=null}};var er=/[^|]\|[^|]/;function tr(e){this._init(e)}!function(e){e.prototype._init=function(e){e=e||{},this.$el=null,this.$parent=e.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=vt++,this._isVue=!0,this._events={},this._eventsCount={},this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=!1,this._unlinkFn=null,this._context=e._context||this.$parent,this._scope=e._scope,this._frag=e._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),e=this.$options=st(this.constructor.options,e,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),e.el&&this.$mount(e.el)}}(tr),function(e){function t(){}function n(e,t){var n=new hn(t,e,null,{lazy:!0});return function(){return n.dirty&&n.evaluate(),dt.target&&n.depend(),n.value}}Object.defineProperty(e.prototype,"$data",{get:function(){return this._data},set:function(e){e!==this._data&&this._setData(e)}}),e.prototype._initState=function(){this._initProps(),this._initMeta(),this._initMethods(),this._initData(),this._initComputed()},e.prototype._initProps=function(){var e=this.$options,t=e.el,n=e.props;t=e.el=Se(t),this._propsUnlinkFn=t&&1===t.nodeType&&n?Li(this,t,n,this._scope):null},e.prototype._initData=function(){var e=this._data,t=this.$options.data,n=t&&t();if(n)for(var r in this._data=n,e)null===this._props[r].raw&&o(n,r)||i(n,r,e[r]);var s,a,c=this._data,u=Object.keys(c);for(s=u.length;s--;)a=u[s],this._proxy(a);_t(c,this)},e.prototype._setData=function(e){e=e||{};var t,n,i,r=this._data;for(this._data=e,i=(t=Object.keys(r)).length;i--;)(n=t[i])in e||this._unproxy(n);for(i=(t=Object.keys(e)).length;i--;)o(this,n=t[i])||this._proxy(n);r.__ob__.removeVm(this),_t(e,this),this._digest()},e.prototype._proxy=function(e){if(!u(e)){var t=this;Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return t._data[e]},set:function(n){t._data[e]=n}})}},e.prototype._unproxy=function(e){u(e)||delete this[e]},e.prototype._digest=function(){for(var e=0,t=this._watchers.length;e<t;e++)this._watchers[e].update(!0)},e.prototype._initComputed=function(){var e=this.$options.computed;if(e)for(var i in e){var r=e[i],s={enumerable:!0,configurable:!0};"function"==typeof r?(s.get=n(r,this),s.set=t):(s.get=r.get?!1!==r.cache?n(r.get,this):w(r.get,this):t,s.set
1=r.set?w(r.set,this):t),Object.defineProperty(this,i,s)}},e.prototype._initMethods=function(){var e=this.$options.methods;if(e)for(var t in e)this[t]=w(e[t],this)},e.prototype._initMeta=function(){var e=this.$options._meta;if(e)for(var t in e)yt(this,t,e[t])}}(tr),function(e){function t(e,t,i){var r,s,o,a;if(i)for(s in i)if(r=i[s],A(r))for(o=0,a=r.length;o<a;o++)n(e,t,s,r[o]);else n(e,t,s,r)}function n(e,t,i,r,s){var o=typeof r;if("function"===o)e[t](i,r,s);else if("string"===o){var a=e.$options.methods,c=a&&a[r];c&&e[t](i,c,s)}else r&&"object"===o&&n(e,t,i,r.handler,r)}function i(){this._isAttached||(this._isAttached=!0,this.$children.forEach(r))}function r(e){!e._isAttached&&Ae(e.$el)&&e._callHook("attached")}function s(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(o))}function o(e){e._isAttached&&!Ae(e.$el)&&e._callHook("detached")}e.prototype._initEvents=function(){var e=this.$options;e._asComponent&&function(e,t){for(var n,i,r=t.attributes,s=0,o=r.length;s<o;s++)n=r[s].name,Qi.test(n)&&(n=n.replace(Qi,""),i=(e._scope||e._context).$eval(r[s].value,!0),e.$on(n.replace(Qi),i))}(this,e.el),t(this,"$on",e.events),t(this,"$watch",e.watch)},e.prototype._initDOMHooks=function(){this.$on("hook:attached",i),this.$on("hook:detached",s)},e.prototype._callHook=function(e){var t=this.$options[e];if(t)for(var n=0,i=t.length;n<i;n++)t[n].call(this);this.$emit("hook:"+e)}}(tr),function(e){e.prototype._updateRef=function(e){var t=this.$options._ref;if(t){var n=(this._scope||this._context).$refs;e?n[t]===this&&(n[t]=null):n[t]=this}},e.prototype._compile=function(e){var t=this.$options,n=e;e=Hi(e,t),this._initElement(e);var i,r=Ni(e,t,this._context&&this._context.$options),s=this.constructor;t._linkerCachable&&((i=s.linker)||(i=s.linker=Fi(e,t)));var o=r(this,e,this._scope),a=i?i(this,e):Fi(e,t)(this,e);return this._unlinkFn=function(){o(),a(!0)},t.replace&&Be(n,e),this._isCompiled=!0,this._callHook("compiled"),e},e.prototype._initElement=function(e){e instanceof DocumentFragment?(this._isFragment=!0,this.$el=this._fragmentStart=e.firstChild,this._fragmentEnd=e.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=e):this.$el=e,this.$el.__vue__=this,this._callHook("beforeCompile")},e.prototype._bindDir=function(e,t,n,i,r){this._directives.push(new Ji(e,this,t,n,i,r))},e.prototype._destroy=function(e,t){if(this._isBeingDestroyed)t||this._cleanup();else{var n;this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var i=this.$parent;for(i&&!i._isBeingDestroyed&&(i.$children.$remove(this),this._updateRef(!0)),n=this.$children.length;n--;)this.$children[n].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),n=this._watchers.length;n--;)this._watchers[n].teardown();this.$el&&(this.$el.__vue__=null);var r=this;e&&this.$el?this.$remove(function(){r._cleanup()}):t||this._cleanup()}},e.prototype._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}}(tr),function(e){e.prototype._applyFilters=function(e,t,n,i){var r,s,o,a,c,u,l,d,h;for(u=0,l=n.length;u<l;u++)if(r=n[u],(s=ot(this.$options,"filters",r.name))&&"function"==typeof(s=i?s.write:s.read||s)){if(o=i?[e,t]:[e],c=i?2:1,r.args)for(d=0,h=r.args.length;d<h;d++)a=r.args[d],o[d+c]=a.dynamic?this.$get(a.value):a.value;e=s.apply(this,o)}return e},e.prototype._resolveComponent=function(t,n){var i=ot(this.$options,"components",t);if(i)if(i.options)n(i);else if(i.resolved)n(i.resolved);else if(i.requested)i.pendingCallbacks.push(n);else{i.requested=!0;var r=i.pendingCallbacks=[n];i(function(t){S(t)&&(t=e.extend(t)),i.resolved=t;for(var n=0,s=r.length;n<s;n++)r[n](t)},function(e){})}}}(tr),function(e){e.util=gt,e.config=we,e.set=i,e.delete=r,e.nextTick=j,e.compiler=Zi,e.FragmentFactory=ti,e.internalDirectives=bi,e.parsers={path:$t,text:ge,template:Wn,directive:ae,expression:nn},e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,i=0===n.cid;if(i&&e._Ctor)return e._Ctor;var r=e.name||n.options.name,s=function(e){return new Function("return function "+b(e)+" (options) { this._init(options) }")()}(r||"VueComponent");return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=t++,s.options=st(n.options,e),s.super=n,s.extend=n.extend,we._assetTypes.forEac
1h(function(e){s[e]=n[e]}),r&&(s.options.components[r]=s),i&&(e._Ctor=s),s},e.use=function(e){if(!e.installed){var t=P(arguments,1);return t.unshift(this),"function"==typeof e.install?e.install.apply(e,t):e.apply(null,t),e.installed=!0,this}},e.mixin=function(t){e.options=st(e.options,t)},we._assetTypes.forEach(function(t){e[t]=function(n,i){return i?("component"===t&&S(i)&&(i.name=n,i=e.extend(i)),this.options[t+"s"][n]=i,i):this.options[t+"s"][n]}})}(tr),function(e){function t(e){return JSON.parse(JSON.stringify(e))}e.prototype.$get=function(e,t){var n=en(e);if(n){if(t&&!tn(e)){var i=this;return function(){n.get.call(i,i)}}try{return n.get.call(this,this)}catch(e){}}},e.prototype.$set=function(e,t){var n=en(e,!0);n&&n.set&&n.set.call(this,this,t)},e.prototype.$delete=function(e){r(this._data,e)},e.prototype.$watch=function(e,t,n){var i;"string"==typeof e&&(e=(i=oe(e)).expression);var r=new hn(this,e,t,{deep:n&&n.deep,filters:i&&i.filters});return n&&n.immediate&&t.call(this,r.value),function(){r.teardown()}},e.prototype.$eval=function(e,t){if(er.test(e)){var n=oe(e),i=this.$get(n.expression,t);return n.filters?this._applyFilters(i,null,n.filters):i}return this.$get(e,t)},e.prototype.$interpolate=function(e){var t=pe(e),n=this;return t?1===t.length?n.$eval(t[0].value)+"":t.map(function(e){return e.tag?n.$eval(e.value):e.value}).join(""):e},e.prototype.$log=function(e){var n=e?Bt(this._data,e):this._data;if(n&&(n=t(n)),!e)for(var i in this.$options.computed)n[i]=t(this[i]);console.log(n)}}(tr),function(e){function t(e,t,i,r,s,o){var a=!Ae(t=n(t)),c=!1===r||a?s:o,u=!a&&!e._isAttached&&!Ae(e.$el);return e._isFragment?(Ge(e._fragmentStart,e._fragmentEnd,function(n){c(n,t,e)}),i&&i()):c(e.$el,t,e,i),u&&e._callHook("attached"),e}function n(e){return"string"==typeof e?document.querySelector(e):e}function i(e,t,n,i){t.appendChild(e),i&&i()}function r(e,t,n,i){Te(e,t),i&&i()}function s(e,t,n){Fe(e),n&&n()}e.prototype.$nextTick=function(e){j(e,this)},e.prototype.$appendTo=function(e,n,r){return t(this,e,n,r,i,Ee)},e.prototype.$prependTo=function(e,t,i){return(e=n(e)).hasChildNodes()?this.$before(e.firstChild,t,i):this.$appendTo(e,t,i),this},e.prototype.$before=function(e,n,i){return t(this,e,n,i,r,Ce)},e.prototype.$after=function(e,t,i){return(e=n(e)).nextSibling?this.$before(e.nextSibling,t,i):this.$appendTo(e.parentNode,t,i),this},e.prototype.$remove=function(e,t){if(!this.$el.parentNode)return e&&e();var n=this._isAttached&&Ae(this.$el);n||(t=!1);var i=this,r=function(){n&&i._callHook("detached"),e&&e()};return this._isFragment?He(this._fragmentStart,this._fragmentEnd,this,this._fragment,r):(!1===t?s:ke)(this.$el,this,r),this}}(tr),function(e){e.prototype.$on=function(e,t){return(this._events[e]||(this._events[e]=[])).push(t),n(this,e,1),this},e.prototype.$once=function(e,t){var n=this;function i(){n.$off(e,i),t.apply(this,arguments)}return i.fn=t,this.$on(e,i),this},e.prototype.$off=function(e,t){var i,r;if(!arguments.length){if(this.$parent)for(e in this._events)(i=this._events[e])&&n(this,e,-i.length);return this._events={},this}if(!(i=this._events[e]))return this;if(1===arguments.length)return n(this,e,-i.length),this._events[e]=null,this;for(var s=i.length;s--;)if((r=i[s])===t||r.fn===t){n(this,e,-1),i.splice(s,1);break}return this},e.prototype.$emit=function(e){var t=this._events[e],n=!t;if(t){t=t.length>1?P(t):t;for(var i=P(arguments,1),r=0,s=t.length;r<s;r++)!0===t[r].apply(this,i)&&(n=!0)}return n},e.prototype.$broadcast=function(e){if(this._eventsCount[e]){for(var t=this.$children,n=0,i=t.length;n<i;n++){var r=t[n];r.$emit.apply(r,arguments)&&r.$broadcast.apply(r,arguments)}return this}},e.prototype.$dispatch=function(){this.$emit.apply(this,arguments);for(var e=this.$parent;e;)e=e.$emit.apply(e,arguments)?e.$parent:null;return this};var t=/^hook:/;function n(e,n,i){var r=e.$parent;if(r&&i&&!t.test(n))for(;r;)r._eventsCount[n]=(r._eventsCount[n]||0)+i,r=r.$parent}}(tr),function(e){function t(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")}e.prototype.$mount=function(e){if(!this._isCompiled)return(e=Se(e))||(e=document.createElement("div")),this._compile(e),this._initDOMHooks(),Ae(this.$el)?(this._callHook("attached"),t.call(this)):this.$once("hook:attached",t),this},e.prototype.$destroy=function(e,t){this._destroy(e,t)},e.prototype.$compile=function(e,t,n,i){return Fi(e,this.$options,!0)(this,e,t,n,i)}}(tr);var nr=ri._postProcess;function ir(e,t){var n;if(S(e)){var i=Object.keys(e);for(n=i.length;n--;)if(ir(e[i[n]],t))return!0}else if(A(e)){for(n=e.length;n--;)if(ir(e[n],t))return!0}else if(null!=e)return e.toString().toLowerCase().indexOf(t)>-1}var rr=/(\d{3})(?=\d)/g,sr={orderBy:function(e,t,n){if(e=nr(e),!t)return e;var i=n&&n<0?-1:1;return e.slice().sort(function(e,n){return"$key"!==t&&(C(e)&&"$value"in e&&(e=e.$value),C(n)&&"$value"in n&&(n=n.$value)),(e=C(e)?Bt(e,t):e)===(n=C(n)?Bt(n,t):n)?0:e>n?i:-i})},filterBy:function(e,t,n){if(e=nr(e),null==t)return e;if("function"==typeof t)return e.filter(t);t=(""+t).toLowerCase();for(var i,r,s,o,a=P(arguments,"in"===n?3:2).reduce(function(e,t){return e.concat(t)},[]),c=[],u=0,l=e.length;u<l;u++)if(s=(i=e[u])&&i.$value||i,o=a.length){for(;o--;)if("$key"===(r=a[o])&&ir(i.$key,t)||ir(Bt(s,r),t)){c.push(i);break}}else ir(i,t)&&c.push(i);return c},limitBy:function(e,t,n){return n=n?parseInt(n,10):0,"number"==typeof t?e.slice(n,n+t):e},json:{read:function(e,t){return"string"==typeof e?e:JSON.stringify(e,null,Number(t)||2)},write:function(e){try{return JSON.parse(e)}catch(t){return e}}},capitalize:function(e){return e||0===e?(e=e.toString()).charAt(0).toUpperCase()+e.slice(1):""},uppercase:function(e){return e||0===e?e.toString().toUpperCase():""},lowercase:function(e){return e||0===e?e.toString().toLowerCase():""},currency:function(e,t){if(e=parseFloat(e),!isFinite(e)||!e&&0!==e)return"";t=null!=t?t:"$";var n=Math.abs(e).toFixed(2),i=n.slice(0,-3),r=i.length%3,s=r>0?i.slice(0,r)+(i.length>3?",":""):"",o=n.slice(-3);return t+(e<0?"-":"")+s+i.slice(r).replace(rr,"$1,")+o}
1,pluralize:function(e){var t=P(arguments,1);return t.length>1?t[e%10-1]||t[t.length-1]:t[0]+(1===e?"":"s")},debounce:function(e,t){if(e)return t||(t=300),I(e,t)}};function or(e,t,n){for(var i=document.createDocumentFragment(),r=0,s=e.length;r<s;r++){var o=e[r];n&&!o.__v_selected?a(o):n||o.parentNode!==t||(o.__v_selected=!0,a(o))}return i;function a(e){!Ye(e)||e.hasAttribute("v-if")||e.hasAttribute("v-for")||(e=jn(e)),e=Yn(e),i.appendChild(e)}}var ar={slot:{priority:1750,params:["name"],bind:function(){var e,t=this.vm,n=t.$options._content;if(n){var i=t._context,r=this.params.name;if(r){var s='[slot="'+r+'"]',o=n.querySelectorAll(s);o.length&&(e=or(o,n)).hasChildNodes()?this.compile(e,i,t):this.fallback()}else{var a=this,c=function(){a.compile(or(n.childNodes,n,!0),i,t)};t._isCompiled?c():t.$once("hook:compiled",c)}}else this.fallback()},fallback:function(){this.compile(qe(this.el,!0),this.vm)},compile:function(e,t,n){if(e&&t){var i=n?n._scope:this._scope;this.unlink=t.$compile(e,n,i,this._frag)}e?Be(this.el,e):Fe(this.el)},unbind:function(){this.unlink&&this.unlink()}},partial:{priority:1750,params:["name"],paramWatchers:{name:function(e){ni.remove.call(this),e&&this.insert(e)}},bind:function(){this.anchor=je("v-partial"),Be(this.el,this.anchor),this.insert(this.params.name)},insert:function(e){var t=ot(this.vm.$options,"partials",e);t&&(this.factory=new ti(this.vm,t),ni.insert.call(this))},unbind:function(){this.frag&&this.frag.destroy()}}};tr.version="1.0.10",tr.options={directives:ai,elementDirectives:ar,filters:sr,transitions:{},components:{},partials:{},replace:!0},e.exports=tr},function(e,t,n){function i(e){var t=n(14)(e);e.url=n(15)(t),e.http=n(16)(t),e.resource=n(19)(t),Object.defineProperties(e.prototype,{$url:{get:function(){return t.options(e.url,this,this.$options.url)}},$http:{get:function(){return t.options(e.http,this,this.$options.http)}},$resource:{get:function(){return e.resource.bind(this)}}})}window.Vue&&Vue.use(i),e.exports=i},function(e,t){e.exports=function(e){var t=e.util.extend({},e.util);return t.isString=function(e){return"string"==typeof e},t.isFunction=function(e){return"function"==typeof e},t.options=function(e,n,i){return i=i||{},t.isFunction(i)&&(i=i.call(n)),t.extend(e.bind({vm:n,options:i}),e,{options:i})},t.each=function(e,n){var i,r;if("number"==typeof e.length)for(i=0;i<e.length;i++)n.call(e[i],e[i],i);else if(t.isObject(e))for(r in e)e.hasOwnProperty(r)&&n.call(e[r],e[r],r);return e},t.extend=function(e){var n,i=[].slice.call(arguments,1);return"boolean"==typeof e&&(n=e,e=i.shift()),i.forEach(function(i){!function e(n,i,r){for(var s in i)r&&(t.isPlainObject(i[s])||t.isArray(i[s]))?(t.isPlainObject(i[s])&&!t.isPlainObject(n[s])&&(n[s]={}),t.isArray(i[s])&&!t.isArray(n[s])&&(n[s]=[]),e(n[s],i[s],r)):void 0!==i[s]&&(n[s]=i[s])}(e,i,n)}),e},t}},function(e,t){var n=document.documentMode,i=document.createElement("a");e.exports=function(e){function t(n,i){var s,o={},a={},c=n;return e.isPlainObject(c)||(c={url:n,params:i}),n=(c=e.extend(!0,{},t.options,this.options,c)).url.replace(/(\/?):([a-z]\w*)/gi,function(e,t,n){return c.params[n]?(o[n]=!0,t+r(c.params[n])):""}),e.isString(c.root)&&!n.match(/^(https?:)?\//)&&(n=c.root+"/"+n),e.each(c.params,function(e,t){o[t]||(a[t]=e)}),(s=t.params(a))&&(n+=(-1==n.indexOf("?")?"?":"&")+s),n}function r(e){return function(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,t?"%20":"+")}(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}return t.options={url:"",root:null,params:{}},t.params=function(t){var n=[];return n.add=function(t,n){e.isFunction(n)&&(n=n()),null===n&&(n=""),this.push(r(t)+"="+r(n))},function t(n,i,r){var s,o=e.isArray(i),a=e.isPlainObject(i);e.each(i,function(i,c){s=e.isObject(i)||e.isArray(i),r&&(c=r+"["+(a||s?c:"")+"]"),!r&&o?n.add(i.name,i.value):s?t(n,i,c):n.add(c,i)})}(n,t),n.join("&")},t.parse=function(e){return n&&(i.href=e,e=i.href),i.href=e,{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",port:i.port,host:i.host,hostname:i.hostname,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):""}},e.url=t}},function(e,t,n){var i=n(17),r=n(18),s=n(4);e.exports=function(e){var t=e.url.parse(location.href),n={"Content-Type":"application/json;charset=utf-8"};function o(n,s){var c;return e.isPlainObject(n)&&(s=n,n=""),s=e.extend({url:n},s),null===(s=e.extend(!0,{},o.options,this.options,s)).crossOrigin&&(s.crossOrigin=function(n){var i=e.url.parse(n);return i.protocol!==t.protocol||i.host!==t.host}(s.url)),s.method=s.method.toUpperCase(),s.headers=e.extend({},o.headers.common,s.crossOrigin?{}:o.headers.custom,o.headers[s.method.toLowerCase()],s.headers),e.isPlainObject(s.data)&&/^(GET|JSONP)$/i.test(s.method)&&(e.extend(s.params,s.data),delete s.data),s.emulateHTTP&&!s.crossOrigin&&/^(PUT|PATCH|DELETE)$/i.test(s.method)&&(s.headers["X-HTTP-Method-Override"]=s.method,s.method="POST"),s.emulateJSON&&e.isPlainObject(s.data)&&(s.headers["Content-Type"]="application/x-www-form-urlencoded",s.data=e.url.params(s.data)),e.isObject(s.data)&&/FormData/i.test(s.data.toString())&&delete s.headers["Content-Type"],e.isPlainObject(s.data)&&(s.data=JSON.stringify(s.data)),c=function e(t,n){t.success=function(i){return e(t.then(function(e){return i.call(n,e.data,e.status,e)||e}),n)};t.error=function(i){return e(t.then(void 0,function(e){return i.call(n,e.data,e.status,e)||e}),n)};t.always=function(i){var r=function(e){return i.call(n,e.data,e.status,e)||e};return e(t.then(r,r),n)};return t}((c=("JSONP"==s.method?r:i).call(this.vm,e,s)).then(a,a),this.vm),s.success&&(c=c.success(s.success)),s.error&&(c=c.error(s.error)),c}function a(e){try{e.data=JSON.parse(e.responseText)}catch(t){e.data=e.responseText}return e.ok?e:s.reject(e)}return o.options={method:"get",params:{},data:"",xhr:null,jsonp:"callback",beforeSend:null,crossOrigin:null,emulateHTTP:!1,emulateJSON:!1},o.headers={put:n,post:n,patch:n,delete:n,common:{Accept:"application/json, text/plain, */*"},custom:{"X-Requested-With":"XMLHttpRequest"}},["get","put","post","patch","delete","jsonp"].forEach(function(t){o[t]=function(n,i,r,s){return e.isFunction(i)&&(s=r,r=i,i=void 0),this(n,e.extend({method:t,data:i,success:r},s))}}),e.http=o}},function(e,t,n){var i=n(4),r=window.XDomainRequest;e.exports=function(e,t){var n=new XMLHttpRequest;return r&&t.crossOrigin&&(n=new XDomainRequest,t.headers={}),e.isPlainObject(t.xhr)&&e.extend(n,t.xhr),e.isFunction(t.beforeSend)&&t.beforeSend.c
1all(this,n,t),new i(function(i,r){n.open(t.method,e.url(t),!0),e.each(t.headers,function(e,t){n.setRequestHeader(t,e)});var s=function(e){n.ok="load"===e.type,n.ok&&n.status&&(n.ok=n.status>=200&&n.status<300),(n.ok?i:r)(n)};n.onload=s,n.onabort=s,n.onerror=s,n.send(t.data)})}},function(e,t,n){var i=n(4);e.exports=function(e,t){var n,r,s="_jsonp"+Math.random().toString(36).substr(2),o={};return t.params[t.jsonp]=s,e.isFunction(t.beforeSend)&&t.beforeSend.call(this,{},t),new i(function(i,a){(n=document.createElement("script")).src=e.url(t),n.type="text/javascript",n.async=!0,window[s]=function(e){r=e};var c=function(e){delete window[s],document.body.removeChild(n),"load"!==e.type||r||(e.type="error"),o.ok="error"!==e.type,o.status=o.ok?200:404,o.responseText=r||e.type,(o.ok?i:a)(o)};n.onload=c,n.onerror=c,document.body.appendChild(n)})}},function(e,t){e.exports=function(e){function t(n,i,r,s){var o=this,a={};return r=e.extend({},t.actions,r),e.each(r,function(t,r){t=e.extend(!0,{url:n,params:i||{}},s,t),a[r]=function(){return(o.$http||e.http)(function(t,n){var i,r,s,o=e.extend({},t),a={};switch(n.length){case 4:s=n[3],r=n[2];case 3:case 2:if(!e.isFunction(n[1])){a=n[0],i=n[1],r=n[2];break}if(e.isFunction(n[0])){r=n[0],s=n[1];break}r=n[1],s=n[2];case 1:e.isFunction(n[0])?r=n[0]:/^(POST|PUT|PATCH)$/i.test(o.method)?i=n[0]:a=n[0];break;case 0:break;default:throw"Expected up to 4 arguments [params, data, success, error], got "+n.length+" arguments"}o.data=i,o.params=e.extend({},o.params,a),r&&(o.success=r);s&&(o.error=s);return o}(t,arguments))}}),a}return t.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},e.resource=t}},function(e,t,n){"use strict";e.exports=n(21)},function(e,t,n){"use strict";e.exports=n(2),n(22),n(23),n(24),n(25),n(27)},function(e,t,n){"use strict";var i=n(2);e.exports=i,i.prototype.done=function(e,t){(arguments.length?this.then.apply(this,arguments):this).then(null,function(e){setTimeout(function(){throw e},0)})}},function(e,t,n){"use strict";var i=n(2);e.exports=i,i.prototype.finally=function(e){return this.then(function(t){return i.resolve(e()).then(function(){return t})},function(t){return i.resolve(e()).then(function(){throw t})})}},function(e,t,n){"use strict";var i=n(2);e.exports=i;var r=l(!0),s=l(!1),o=l(null),a=l(void 0),c=l(0),u=l("");function l(e){var t=new i(i._61);return t._65=1,t._55=e,t}i.resolve=function(e){if(e instanceof i)return e;if(null===e)return o;if(void 0===e)return a;
1if(!0===e)return r;if(!1===e)return s;if(0===e)return c;if(""===e)return u;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new i(t.bind(e))}catch(e){return new i(function(t,n){n(e)})}return l(e)},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,n){if(0===t.length)return e([]);var r=t.length;function s(o,a){if(a&&("object"==typeof a||"function"==typeof a)){if(a instanceof i&&a.then===i.prototype.then){for(;3===a._65;)a=a._55;return 1===a._65?s(o,a._55):(2===a._65&&n(a._55),void a.then(function(e){s(o,e)},n))}var c=a.then;if("function"==typeof c)return void new i(c.bind(a)).then(function(e){s(o,e)},n)}t[o]=a,0==--r&&e(t)}for(var o=0;o<t.length;o++)s(o,t[o])})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){e.forEach(function(e){i.resolve(e).then(t,n)})})},i.prototype.catch=function(e){return this.then(null,e)}},function(e,t,n){"use strict";var i=n(2),r=n(26);e.exports=i,i.denodeify=function(e,t){return"number"==typeof t&&t!==1/0?function(e,t){for(var n=[],r=0;r<t;r++)n.push("a"+r);var o=["return function ("+n.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(n).concat([s]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],o)(i,e)}(e,t):function(e){for(var t=Math.max(e.length-1,3),n=[],r=0;r<t;r++)n.push("a"+r);var o=["return function ("+n.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+s+";","var res;","switch (argLength) {",n.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(n.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],o)(i,e)}(e)};var s="function (err, res) {if (err) { rj(err); } else { rs(res); }}";i.nodeify=function(e){return function(){var t=Array.prototype.slice.call(arguments),n="function"==typeof t[t.length-1]?t.pop():null,s=this;try{return e.apply(this,arguments).nodeify(n,s)}catch(e){if(null===n||void 0===n)return new i(function(t,n){n(e)});r(function(){n.call(s,e)})}}},i.prototype.nodeify=function(e,t){if("function"!=typeof e)return this;this.then(function(n){r(function(){e.call(t,null,n)})},function(n){r(function(){e.call(t,n)})})}},function(e,t,n){"use strict";var i=n(5),r=[],s=[],o=i.makeRequestCallFromTimer(function(){if(s.length)throw s.shift()});function a(e){var t;(t=r.length?r.pop():new c).task=e,i(t)}function c(){this.task=null}e.exports=a,c.prototype.call=function(){try{this.task.call()}catch(e){a.onerror?a.onerror(e):(s.push(e),o())}finally{this.task=null,r[r.length]=this}}},function(e,t,n){"use strict";var i=n(2);e.exports=i,i.enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},function(e,t,n){App.forms={registration:{},eventSignup:{},incomeReports:{},exportReport:{}},n(29),n(30),$.extend(App,n(31)),n(32)},function(e,t){window.AppForm=function(e){var t=this;$.extend(this,e),this.errors=new AppFormErrors,this.busy=!1,this.successful=!1,this.startProcessing=function(){t.errors.forget(),t.errors.forget(),t.busy=!0,t.successful=!1},this.finishProcessing=function(){t.busy=!1,t.successful=!0}}},function(e,t){var n="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};window.AppFormErrors=function(){this.errors={},this.hasErrors=function(){return!_.isEmpty(this.errors)},this.has=function(e){return _.indexOf(_.keys(this.errors),e)>-1},this.all=function(){return this.errors},this.flatten=function(){return _.flatten(_.toArray(this.errors))},this.get=function(e){if(this.has(e))return this.errors[e][0]},this.set=function(e){"object"===(void 0===e?"undefined":n(e))?this.errors=e:this.errors={field:["Something went wrong. Please try again."]}},this.forget=function(){this.errors={}}}},function(e,t){var n="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.exports={post:function(e,t){return App.sendForm("post",e,t)},put:function(e,t){return App.sendForm("put",e,t)},delete:function(e,t){return App.sendForm("delete",e,t)},sendForm:function(e,t,i){return new Promise(function(r,s){i.startProcessing(),Vue.http[e](t,i).success(function(e){i.finishProcessing(),r(e)}).error(function(e){console.log("HTTP ERROR:",e),e&&"object"===(void 0===e?"undefined":n(e))?i.errors.set(e):i.errors.set({message:"Something went wrong. Please try again."}),i.busy=!1,s(e)})})}}},function(e,t){Vue.component("app-text",{props:["display","form","name","input"],template:'<div class="form-group" :class="{\'has-error\': form.errors.has(name)}"> <label class="col-md-4 control-label">{{ display }}</label> <div class="col-md-6"> <input type="text" class="form-control" v-model="input">
1 <span class="help-block" v-show="form.errors.has(name)"> <strong>{{ form.errors.get(name) }}</strong> </span> </div></div>'}),Vue.component("app-email",{props:["display","form","name","input"],template:'<div class="form-group" :class="{\'has-error\': form.errors.has(name)}"> <label class="col-md-4 control-label">{{ display }}</label> <div class="col-md-6"> <input type="email" class="form-control" v-model="input"> <span class="help-block" v-show="form.errors.has(name)"> <strong>{{ form.errors.get(name) }}</strong> </span> </div></div>'}),Vue.component("app-password",{props:["display","form","name","input"],template:'<div class="form-group" :class="{\'has-error\': form.errors.has(name)}"> <label class="col-md-4 control-label">{{ display }}</label> <div class="col-md-6"> <input type="password" class="form-control" v-model="input"> <span class="help-block" v-show="form.errors.has(name)"> <strong>{{ form.errors.get(name) }}</strong> </span> </div></div>'}),Vue.component("app-date",{props:["display","form","name","input"],template:'<div class="form-group" :class="{\'has-error\': form.errors.has(name)}"> <input type="text" class="form-control is-date" v-model="input"> <span class="help-block" v-show="form.errors.has(name)"> <strong>{{ form.errors.get(name) }}</strong> </span></div>'}),Vue.component("app-select",{props:["display","form","name","items","input"],template:'<div class="form-group" :class="{\'has-error\': form.errors.has(name)}"> <label class="col-md-4 control-label">{{ display }}</label> <div class="col-md-8"> <select class="form-control" v-model="input"> <option v-for="item in items" :value="item.value"> {{ item.text }} </option> </select> <span class="help-block" v-show="form.errors.has(name)"> <strong>{{ form.errors.get(name) }}</strong> </span> </div></div>'})},function(e,t,n){n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(44),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65),n(66),n(67),n(68),n(69),n(8),n(70),n(71),n(72),n(73),n(74),n(75),n(76),n(77),n(78),n(79),n(80),n(81),n(82),n(83),n(84),n(85),n(86)},function(e,t){Vue.component("app-my-billing-screen",{props:{user:null,bank_codes:null},data:function(){return{redirect_form_key:[],busy:!1,payment_method:"",otp:null,waiting_on_otp:!1,requested_otp:!1,forms:{debit_order:$.extend(!0,new AppForm({busy:!1,debit:{bank:"",bank_temp:"",number:"",type:"",branch_name:"",branch_code:"",billable_date:"",account_holder:"",id_number:"",registration_number:"",type_of_account:"",otp:"",debit_order_mandate:"",signature:"",signature_date:null}}),App.forms.debit_order)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,addingCard:!1}},computed:{otpCorrect:function(){return null!=this.otp&&this.otp==this.forms.debit_order.debit.otp},debitOrderDetailsCompleted:function(){return"company"===this.forms.debit_order.debit.type_of_account?""!=this.forms.debit_order.debit.bank&&""!=this.forms.debit_order.debit.number&&""!=this.forms.debit_order.debit.type&&""!=this.forms.debit_order.debit.branch_code&&""!=this.forms.debit_order.debit.billable_date&&""!=this.forms.debit_order.debit.account_holder&&""!=this.forms.debit_order.debit.type_of_account&&""!=this.forms.debit_order.debit.registration_number&&""!=this.forms.debit_order.debit.debit_order_mandate&&""!=this.forms.debit_order.debit.signature&&""!=this.forms.debit_order.debit.signature_date:""!=this.forms.debit_order.debit.bank&&""!=this.forms.debit_order.debit.number&&""!=this.forms.debit_order.debit.type&&""!=this.forms.debit_order.debit.branch_code&&""!=this.forms.debit_order.debit.billable_date&&""!=this.forms.debit_order.debit.account_holder&&""!=this.forms.debit_order.debit.type_of_account&&""!=this.forms.debit_order.debit.id_number&&""!=this.forms.debit_order.debit.debit_order_mandate&&""!=this.forms.debit_order.debit.signature&&""!=this.forms.debit_order.debit.signature_date}},methods:{bankNameChanged:function(){var e=this.forms.debit_order.debit.bank_temp,t=""!=e?this.bank_codes[e]:"";this.forms.debit_order.debit.branch_code=this.forms.debit_order.debit.bank_temp,this.forms.debit_order.debit.bank=t},addCard:function(){var e=this;this.busy=!0,this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingCard=!1,e.busy=!1;else{e.busy=!1,e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0}}).catch(function(t){e.busy=!1,e.newcard.errors=t.data})},saveCard:function(e){var t=this;this.busy=!0,this.$http.post("/account/billing/card",{id:e}).then(function(e){t.busy=!1,t.user.cards.push(e.data.card),swal({type:"success",title:"Success",text:"Your card has successfully been verified - Please proceed to payment for your product. "})}).catch(function(e){console.log(e),t.busy=!1,e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},setPrimary:function(e){var t=this;this.user.primary_card=e,this.$http.post("/account/billing/primary",{id:e}).then(function(n){t.user.primary_card=e,swal({type:"success",title:"Success",text:"Primary Credit card has been changed"})}).catch(function(e){swal({type:"error",title:"Whoops",text:"Could not set that credit card as your primary card."})})},removeCard:function(e){var t=this;
1e.id!==this.user.primary_card?this.$http.post("/account/billing/remove",{card_id:e.id}).then(function(n){var i=t.user.cards.indexOf(e);i>-1&&t.user.cards.splice(i,1),swal({type:"success",title:"Success",text:"Credit card has been deleted"})}).catch(function(e){swal({type:"error",title:"Whoops",text:"Could not delete that credit card."})}):swal({type:"warning",title:"Cannot delete card",text:"Cannot delete Primary Card, please set a new Primary Card in order to delete this card."})},UpdateDebitOrderDetails:function(){var e=this;if("debit_order"==this.payment_method&&!this.debitOrderDetailsCompleted)return swal({type:"warning",title:"Error",text:"Your debit order details are not complete, please check and try again."}),void(this.forms.debit_order.busy=!1);if(""==this.user.cell||null==this.user.cell)return swal({type:"error",title:"Error!",text:"There is no cellphone number on your profile in order to send the OTP. Please update your profile first"}),$("#Debit_order_button").modal("hide"),void(this.forms.debit_order.busy=!1);if("debit_order"==this.payment_method&&!this.requested_otp){var t={account_number:this.forms.debit_order.debit.number,branch_code:this.forms.debit_order.debit.branch_code},n=!1;if(this.process(),this.$http.post("/peach/validate",t).then(function(t){return"Error"==t.data.Result||"Valid"!=t.data.Result?void swal({type:"error",title:"Oops!",text:"Unable to process your verification request at this time. Please try again later."}):(n=!0,e.requestOTP())}).catch(function(e){console.log(e)}),!n)return void(this.forms.debit_order.busy=!1)}},SubmitForUpdate:function(){var e=this;this.process();var t=this.forms.debit_order.debit;this.$http.post("/dashboard/edit/billing_information/update",t).then(function(t){swal({type:"success",title:"Success",text:"Thank you for updating your debit order details"}),$("#Debit_order_button").modal("hide"),e.busy=!1,window.location.reload()}).catch(function(t){swal({type:"error",title:"Whoops",text:"Could not update details."}),e.busy=!1}),this.requested_otp=!1,this.waiting_on_otp=!1,this.otpCorrect=!1,this.otp=""},requestOTP:function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.requested_otp=!0,e.waiting_on_otp=!0,swal.close()})},resendOtp:function(){this.$http.post("/peach/otp").then(function(e){swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}}})},function(e,t){Vue.component("app-insurance-register-screen",{ready:function(){},data:function(){return{step:1,user:null,forms:{basic:$.extend(!0,new AppForm({first_name:"",last_name:"",email:"",terms:""}),App.forms.basic),address:$.extend(!0,new AppForm({user_id:"",postal:{line_one:"",line_two:"",city:"",province:"",code:""},business:{line_one:"",line_two:"",city:"",province:"",code:""}}),App.forms.address),declaration:$.extend(!0,new AppForm({user_id:"",legal_entity:"",practice_abroad:"",work_abroad:"",negligence:"",aware:"",aware_description:"",declined:"",declined_reason:""}),App.forms.declaration),assessment:$.extend(!0,new AppForm({user_id:"",registered:"",body:"",options:{conduct:"",cpd:"",engagement:"",technical:"",resources:"",reviews:"",standards:"",technology:""}}),App.forms.assessment)}}},methods:{signup:function(){var e=this;this.forms.basic.busy=!0,App.post("/insurance/user",this.forms.basic).then(function(t){e.user=t,e.forms.address.user_id=t.id,e.forms.assessment.user_id=t.id,e.forms.declaration.user_id=t.id,e.step++}).catch(function(t){e.forms.basic.busy=!1})},submitAddress:function(){var e=this;this.forms.address.busy=!0,App.post("/insurance/address",this.forms.address).then(function(t){e.step++,e.forms.address.busy=!1}).catch(function(t){console.log(response),e.forms.address.busy=!1})},completeAssessment:function(){var e=this;App.post("/insurance/assessment",this.forms.assessment).then(function(t){e.step++,e.forms.address.busy=!1}).catch(function(t){console.log(response),e.forms.address.busy=!1})},completeApplication:function(){var e=this;App.post("/insurance/complete",this.forms.declaration).then(function(t){e.step++,e.forms.address.busy=!1}).catch(function(t){console.log(response),e.forms.address.busy=!1})}}})},function(e,t){Vue.component("app-errors",{props:["form"],template:"<div><div class='alert alert-danger' v-if='form.errors && form.errors.hasErrors()'> <strong>Whoops!</strong> There were some problems with your input.<br><br> <ul> <li v-for='error in form.errors.flatten()'> {{ error }} </li> </ul> </div></div>"}),Vue.component("app-error-alert",{props:["form"],template:"<div><div class='alert alert-danger' v-if='form.errors && form.errors.hasErrors()'> <strong>Whoops!</strong> There were some problems with your input or please try again after sometime. </div></div>"})},function(e,t){Vue.filter("date",function(e){return moment(e).startOf("hour").format("D MMMM YYYY")}),Vue.filter("datetime",function(e){return moment.utc(e).local().format("MMMM Do, YYYY h:mm A")}),Vue.filter("relative",function(e){return moment.locale("en",{relativeTime:{future:"in %s",past:"%s",s:"1s",m:"1m",mm:"%dm",h:"1h",hh:"%dh",d:"1d",dd:"%dd",M:"1 month ago",MM:"%d months ago",y:"1y",yy:"%dy"}}),moment.utc(e).local().fromNow()})},function(e,t){Vue.component("app-simple-registration-screen",{ready:function(){$(function(){$(".app-first-field").filter(":visible:first").focus()});var e=URI(document.URL).query(!0);e.invitation&&this.getInvitation(e.invitation)},data:function(){return{invitation:null,failedToLoadInvitation:!1,forms:{registration:$.extend(!0,new AppForm({team_name:"",first_name:"",last_name:"",id_number:"",cell:"",email:"",password:"",password_confirmation:"",plan:"",terms:!1,invitation:null,free:!0}),App.forms.registration)}}},methods:{getInvitation:function(e){this.$http.get("/api/teams/invitation/"+e).success(function(e){this.invitation=e,this.forms.registration.invitation=e.token,setTimeout(function(){$(function(){$(".app-first-field").filter(":visible:first").focus()})},250)}).error(function(e){this.failedToLoadInvitation=!0,console.error("Unable to load invitation for given code.")})},register:function(){App.post("/auth/register",this.forms.registration).then(function(e){window.location=e.path})}}})},function(e,t){Vue.component("app-subscription-register-screen",{ready:function(){this.getPlans()},data:function(){return{plans:[],selectedPlan:null,selectedFeatures:[],planTypeState:!0,profession:[],customFeatures:["compliance-and-legislation-update","digital-branding","xbrl"],forms:{registration:$.extend(!0,new AppForm({busy:!1,first_name:"",last_name:"",id_number:"",cell:"",email:"",password:"",password_confirmation:"",plan:"",terms:!1,pi_cover:!1,features:[]}),App.forms.registration)}}},computed:{countSelectedFeatures:function(){return this.selectedFeatures.length},canSelectMoreFeatures:function(){return this.countSelectedFeatures<8},fullName:function(){return this.forms.registration.first_name+" "+this.forms.registration.last_name},plansAreLoaded:function(){return this.plans.length>0},defaultPlans:function(){return this.monthlyPlans.length>0?this.monthlyPlans:this.yearlyPlans.length>0?this.yearlyPlans:void 0},monthlyPlans:function(){return _.filter(this.plans,function(e){return"month"==e.interval&&1!=e.inactive})},yearlyPlans:function(){return _.filter(this.plans,function(e){return"year"==e.interval&&1!=e.inactive})},freePlanIsSelected:function(){return this.selectedPlan&&this.selectedPlan.price<=0},shouldShowDefaultPlans:function(){return!this.planTypeState},shouldShowYearlyPlans:function(){return this.planTypeState},selectedPlanPrice:function(){if(this.selectedPlan)return"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0}},methods:{getPlans:function(){this.$http.get("/api/subscriptions/plans").success(function(e){this.plans=_.filter(e,function(e){return e});URI(document.URL).query(!0);1==this.plans.length&&(this.setSelectedPlan(this.plans[0]),setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100))})},selectPlan:function(e){this.setSelectedPlan(e),setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},setSelectedPlan:function(e){this.selectedPlan=e,this.forms.registration.plan=e.id},selectAnotherPlan:function(){this.selectedPlan=null,this.clearSelectedFeatures(),this.forms.registration.plan="",this.forms.registration.paymentOption=null,this.forms.registration.card={},this.forms.registration.debit={}},clearSelectedFeatures:function(){this.selectedFeatures=[]},register:function(){}}})},function(e,t){Vue.component("app-store-listing-product-selection",{props:["listing","discounts","cartItems","selectedProductId"],ready:function(){this.generateDetailedTitleForProductListing(
1),this.removeBackSlashesFromDiscountModels(),this.generateDiscountedPrices(),this.selectedProductId>0&&this.setSelectedProductFromId(this.selectedProductId)},data:function(){return{prospectiveDiscounts:["AppStoreDiscountsAllListingProductsDiscount"],selectedProductListing:0,totals:{price:this.calculateTotalProductsPrice(),tags:this.compileUniqueTags(),discounted_price:this.calculateTotalDiscountedPrice(),cpd_hours:this.calculateTotalCPDHours()}}},computed:{showCourierFeeNotice:function(){var e=!1;return(this.selectedProductListing.product&&this.selectedProductListing.product.is_physical||"all"==this.selectedProductListing&&this.listing.hasPhysicalProduct)&&(e=!0),e}},methods:{setSelectedProductFromId:function(e){var t=_.find(this.listing.product_listings,function(t,n){return!!t.product&&t.product.id==e});t&&(this.selectedProductListing=t)},submitForm:function(e){$("#add-to-cart-form").submit()},discounted:function(e,t,n){return parseFloat(e-this.discount(e,t,n))},discount:function(e,t,n){return"percentage"==n?parseFloat(e*(t/100)):t},calculateTotalProductsPrice:function(){var e=0;return _.forEach(this.listing.product_listings,function(t,n){e+=parseFloat(t.product.price)}),e},calculateTotalProductsDiscount:function(){var e=this,t=0;return _.forEach(this.listing.product_listings,function(n,i){n.discount>0&&(t+=e.discount(n.product.price,n.discount,n.discount_type))}),t},calculateTotalDiscountedPrice:function(){var e=this,t=this.calculateTotalProductsPrice()-this.calculateTotalProductsDiscount(),n=t;return this.listing.discount>0&&(n-=this.discount(t,this.listing.discount,this.listing.discount_type)),_.forEach(e.discounts,function(t,i){if("AppStoreDiscountsAllListingProductsDiscount"==e.discountModelWithoutBackSlashes(t.model))return t.value>0&&(n-=e.discount(n,t.value,t.type)),!1}),n},calculateTotalCPDHours:function(){var e=0;return _.forEach(this.listing.product_listings,function(t,n){e+=t.product.cpd_hours}),e},compileUniqueTags:function(){var e=[];return _.forEach(this.listing.product_listings,function(t,n){var i=t.product.tags;_.forEach(i,function(t,n){var i=!0;_.forEach(e,function(e,n){if(e.id===t.id)return i=!1,!1}),i&&e.push(t)})}),e},generateDetailedTitleForProductListing:function(){var e=this;_.forEach(this.listing.product_listings,function(t,n){var i=t.product,r=i.title;""!=i.topic.trim()&&(r=i.topic+": "+r),t.discount>0&&("percentage"==t.discount_type?r+=" [-"+t.discount+"%]":r+=" [-"+t.discount+"]");var s=r+=" ("+i.year+")";_.forEach(e.cartItems,function(e,n){if(e.id==t.id)return s+=" | "+e.qty+" in cart",!1}),s+=" | "+t.product.stock+" in stock",Vue.set(t,"detailedTitle",r),Vue.set(t,"optionTitle",s)})},generateDiscountedPrices:function(){var e=this;_.forEach(e.listing.product_listings,function(t,n){var i=t.product.price;i-=e.discount(i,t.discount,t.discount_type),i-=e.discount(i,t.listing.discount,t.listing.discount_type),_.forEach(t.qualifyingGlobalDiscounts,function(t,n){i-=e.discount(i,t.value,t.type)}),Vue.set(t,"discountedPrice",i)})},removeBackSlashesFromDiscountModels:function(){var e=this;_.forEach(this.discounts,function(t,n){t.model=e.discountModelWithoutBackSlashes(t.model)})},discountModelWithoutBackSlashes:function(e){return e.replace(/\\/g,"")}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-store-checkout",{props:["cartItems","cartHasPhysicalProduct","cartTotalQuantity","cartTotalDiscountedPrice","shippingMethods","addresses","countries","provinces","user","donations","scriptendpoint"],ready:function ready(){var _this=this;window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.checkout.busy=!1,swal.close()},2e3)}catch(e){_this.forms.checkout.busy=!1}}),this.generateOptionTitlesForAddresses()},data:function(){return{redirect_form_key:[],instantlink:"",payment_token:"",instant_eft_success:!1,id_number:"",id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",postal_address:"",forms:{checkout:$.extend(!0,new AppForm({busy:!1,shippingMethod:this.shippingMethods[0],deliveryAddress:this.getDefaultDeliveryAddress(),paymentOption:null,free:!1,card:null,terms:!1,donations:1}),App.forms.checkout)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},computed:{total:function(){var e=this.cartTotalDiscountedPrice;return this.cartHasPhysicalProduct&&(e+=parseFloat(this.forms.checkout.shippingMethod.price)),this.getDonations()&&(e+=this.getDonations()),e},free:function(){return this.total<=0&&(this.forms.checkout.free=!0),this.forms.checkout.free},checkFreePayment:function(){return!0===this.forms.checkout.free&&(this.forms.checkout.paymentOption="eft"),this.forms.checkout.paymentOption}},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.checkout.busy=!0,this.getEftLink())},addCard:function(){var e=this;this.newcard.return="/store/checkout?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1,swal.close();else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.process(),this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.checkout.card=e.data.card.id,swal.close()}).catch(function(e){swal.close(),e.number&&swal({type:"error",title:"Whoops",text:e.number})})},generateOptionTitlesForAddresses:function(){var e=this;_.forEach(this.addresses,function(t,n){var i=t.type.toUpperCase();t.line_one&&(i+=" - "+t.line_one),t.line_two&&(i+=", "+t.line_two),t.city&&(i+=", "+t.city),t.area_code&&(i+=", "+t.area_code),t.province&&(i+=", "+e.provinces[t.province]),t.country&&(i+=", "+e.countries[t.country]),Vue.set(t,"selectOptionTitle",i)})},getDefaultDeliveryAddress:function(){if(0==this.addresses.length)return 0;var e=!1;return _.forEach(this.addresses,function(t,n){if(t.primary)return e=t,!1}),e||this.addresses[0]},calculateTotalQuantity:function(){var e=0;return _.forEach(this.cart,function(t,n){e+=t.quantity}),e},checkout:function(){this.forms.checkout.errors.forget(),this.forms.checkout.busy=!0,this.sendCheckout()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];_.forEach(this.cart,function(t,n){e.push({item_id:String(t.id),item_name:t.title,item_category:"Webinar On Demand",price:parseFloat(parseFloat(t.price).toFixed(2)),quantity:t.qty})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>
10&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Webinars on demand",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.checkout.paymentOption?"Credit Card":"eft"==this.forms.checkout.paymentOption?"Instant EFT":"Purchase Order"},sendCheckout:function(){var e=this;if(this.validate())if(!1!==this.forms.checkout.free||"eft"!=this.forms.checkout.paymentOption||0!=this.instant_eft_success){var t={terms:this.forms.checkout.terms,free:this.forms.checkout.free,card:this.forms.checkout.card,paymentOption:this.forms.checkout.paymentOption,shippingMethodId:this.forms.checkout.shippingMethod.id,deliveryAddressId:this.forms.checkout.deliveryAddress.id,donations:this.getDonations(),id_number:this.id_number,id_type:this.id_type,country_of_issue:this.country_of_issue,incometax_reference_number:this.incometax_reference_number,company_name:this.company_name,company_registrations_number:this.company_registrations_number,date_of_birth:this.date_of_birth,post_code:this.post_code,postal_address:this.postal_address};this.beginCheckout(),this.processPayment(),this.$http.post("/store/checkout",t).success(function(e){this.forms.checkout.busy=!1,swal.close(),void 0!==e.invoice&&this.sendTransactions(e.invoice),window.location="/dashboard/products"}).error(function(t){e.forms.checkout.busy=!1,t.errors&&t.errors.card&&swal({type:"error",title:"Whoops",text:t.errors.card}),e.forms.checkout.errors.set(t)})}else this.forms.checkout.busy=!0},cancelPayment:function(){this.forms.checkout.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={store:!0,total:this.total},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.checkout.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.checkout.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendCheckout()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.checkout.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.checkout.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(console.log(t),!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendCheckout()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #000066;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},getDonations:function(){var e=0;return this.forms.checkout.donations&&(e=this.donations),e},validate:function(){if(!this.forms.checkout.terms)return swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.checkout.busy=!1,!1;if(this.forms.checkout.donations){if(""==this.id_number)return swal({type:"warning",title:"Error",text:"Please enter id number"}),this.forms.checkout.busy=!1,!1;if(""==this.id_type)return swal({type:"warning",title:"Error",text:"Please enter valid id type"}),this.forms.checkout.busy=!1,!1;if(""==this.country_of_issue)return swal({type:"warning",title:"Error",text:"Please select valid country"}),this.forms.checkout.busy=!1,!1;if(""==this.incometax_reference_number)return swal({type:"warning",title:"Error",text:"Please select valid income tax reference number!"}),this.forms.checkout.busy=!1,!1;if(""==this.company_name)return swal({type:"warning",title:"Error",text:"Please enter valid company name!"}),this.forms.checkout.busy=!1,!1;if(""==this.company_registrations_number)return swal({type:"warning",title:"Error",text:"Please enter company registration number"}),this.forms.checkout.busy=!1,!1;if(""==this.date_of_birth)return swal({type:"warning",title:"Error",text:"Please select date of birth"}),this.forms.checkout.busy=!1,!1;if(""==this.postal_address)return swal({type:"warning",title:"Error",text:"Please enter valid postal address"}),this.forms.checkout.busy=!1,!1;if(""==this.post_code)return swal({type:"warning",title:"Error",text:"Please enter valid postal code"}),this.forms.checkout.busy=!1,!1}return!0}}})},function(e,t,n){var i=function(){return this}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,s=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(43),r)i.regeneratorRuntime=s;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag",u="object"==typeof e,l=t.regeneratorRuntime;if(l)u&&(e.exports=l);else{(l=t.regeneratorRuntime=u?e.exports:{}).wrap=b;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",m={},_={};_[o]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(T([])));g&&g!==i&&r.call(g,o)&&(_=g);var v=C.prototype=P.prototype=Object.create(_);E.prototype=v.constructor=C,C.constructor=E,C[c]=E.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(v),e},l.awrap=function(e){return{__await:e}},k(x.prototype),x.prototype[a]=function(){return this},l.AsyncIterator=x,l.async=function(e,t,n,i){var r=new x(b(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},k(v),v[c]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEac
vendor: 4,273 bytes, line 1
1h(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),m}}}function b(e,t,n,i){var r=t&&t.prototype instanceof P?t:P,s=Object.create(r.prototype),o=new I(i||[]);return s._invoke=function(e,t,n){var i=d;return function(r,s){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw s;return D()}for(n.method=r,n.arg=s;;){var o=n.delegate;if(o){var a=S(o,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var c=w(e,t,n);if("normal"===c.type){if(i=n.done?p:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=p,n.method="throw",n.arg=c.arg)}}}(e,n,o),s}function w(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function P(){}function E(){}function C(){}function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function x(e){var t;this._invoke=function(n,i){function s(){return new Promise(function(t,s){!function t(n,i,s,o){var a=w(e[n],e,i);if("throw"!==a.type){var c=a.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(e){t("next",e,s,o)},function(e){t("throw",e,s,o)}):Promise.resolve(u).then(function(e){c.value=e,s(c)},o)}o(a.arg)}(n,i,t,s)})}return t=t?t.then(s,s):s()}}function S(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,S(e,t),"throw"===t.method))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=w(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,m;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,m):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=n,t.done=!0,t};return s.next=s}}return{next:D}}function D(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-simple-event-registration-screen",{props:{staff:{required:!0,default:[]},companys:{required:!0,default:null},event:{required:!0},dietary:{required:!0},promoCodes:{required:!1,default:[]},user:{required:!0},donations:{required:!1,default:!1},donationenable:{required:!0},pricegroup:{required:!1,default:[]},usedcoupon:{required:!1},scriptendpoint:"",preselectedvenueid:{required:!1,default:0}},ready:function ready(){var _this=this;if(this.forms.eventSignup.pricingOption&&(this.lastPrice=this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)),window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.eventSignup.busy=!1,swal.close()},2e3)}catch(e){_this.forms.eventSignup.busy=!1}}),this.setVenues(),this.preselectedvenueid){var self=this,allVenues=this.venues.concat(this.online_venues),preselected=_.find(allVenues,function(e){return e.id==self.preselectedvenueid});preselected&&self.selectVenue(preselected)}this.setExtras(),this.setDietary(),this.setMembers()},data:function(){return{totalGroupBookingUser:0,lastPrice:0,prices:[],redirect_form_key:[],used_coupon_discount:0,promo_code_id:0,venues:[],online_venues:[],pricingOptions:[],dates:[],extras:[],selectedStaff:[],members:[],pendingMembers:[],pendingMembersEmails:[],selectedStaffCount:0,inviteStaff:!1,isComanySetup:!1,AttendTypeState:!1,TicketTypeState:!1,instantlink:"",payment_token:"",instant_eft_success:!1,invite_email:"",addingMemberDetails:!1,id_number:"",id_type:"",country_of_issue:"",date_of_birth:"",post_code:"",postal_address:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",errors:{company:[],invite:[]},company:{invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},forms:{eventSignup:$.extend(!0,new AppForm({busy:!1,venue:null,pricingOption:null,dates:[],extras:[],staffs:[],dietaryRequirement:null,paymentOption:null,card:null,terms:!1,donations:1}),App.forms.eventSignup)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],address:{errors:[]},checkoutId:null,entityId:null}},watch:{"forms.eventSignup.pricingOption":function(e,t){var n=this;if(t&&(this.lastPrice=t.price),e){Vue.set(n.forms.eventSignup,"dates",[]);var i=n.forms.eventSignup.venue.dates.length,r=n.forms.eventSignup.pricingOption.day_count;0==this.prices.length?(this.prices.push(this.forms.eventSignup.pricingOption.discounted_price),this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)==this.forms.eventSignup.pricingOption.discounted_price&&(this.totalGroupBookingUser=1)):this.updatedPrices(),i<=r&&_.forEach(n.forms.eventSignup.venue.dates,function(e,t){n.forms.eventSignup.dates.push(e)})}},TicketTypeState:function(e,t){if(e){for(var n=0,i=0;i<this.members.length;i++)this.members[i].email==this.user.email&&(n++,this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)==this.forms.eventSignup.pricingOption.discounted_price&&(this.totalGroupBookingUser=1));
10==n&&0==this.members.length&&(this.members.push({first_name:this.user.first_name,last_name:this.user.last_name,email:this.user.email,id_number:this.user.id_number,alternative_cell:this.user.alternative_cell,cell:this.user.cell}),this.prices=[],this.forms.eventSignup.pricingOption&&(this.prices.push(this.forms.eventSignup.pricingOption.discounted_price),this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)==this.forms.eventSignup.pricingOption.discounted_price&&(this.totalGroupBookingUser=1)),this.forms.eventSignup.staffs.push(this.user.id))}}},mounted:function(){this.loadPeachScript()},computed:{hasSingleVenue:function(){return 1===this.event.venues.length},total:function(){try{var e=this.forms.eventSignup.pricingOption.discounted_price;if("true"==this.TicketTypeState)var t=this.prices.reduce(function(e,t){return parseFloat(e)+parseFloat(t)},0),n=this.getTotalGroupBookingDiscount();else t=e,n=0;var i=this.getTotalDiatry(),r=this.getTotalExtras(),s=this.getDonations(),o=parseFloat(t)+parseFloat(i)+parseFloat(r)+parseFloat(s)-parseFloat(n);return this.forms.eventSignup.pricingOption&&0==o&&(this.forms.eventSignup.paymentOption=null),o<0&&(o=0),o.toFixed(2)}catch(e){console.log(e.message)}},shouldShowPhysicalVenues:function(){return!this.AttendTypeState||0==this.online_venues.length},shouldShowOnlineVenues:function(){return this.AttendTypeState||0==this.venues.length}},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.eventSignup.busy=!0,this.getEftLink())},getAppliedDiscountPrice:function(){return null!=this.usedcoupon&&""!=this.usedcoupon&&void 0!=this.usedcoupon&&(this.promo_code_id=this.usedcoupon.id),this.used_coupon_discount},addCard:function(){var e=this;this.newcard.return="/events/"+this.event.slug+"/register?threeDs=yes&venue="+this.forms.eventSignup.venue.id,this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.eventSignup.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},dateChanged:function(){this.forms.eventSignup.dates.length>this.forms.eventSignup.pricingOption.day_count&&(this.forms.eventSignup.dates=_.slice(this.forms.eventSignup.dates,1))},register:function(){this.forms.eventSignup.errors.forget(),this.forms.eventSignup.busy=!0,this.sendRegistration()},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];e.push({item_id:String(this.event.id),item_name:this.event.name,item_category:"Event",price:parseFloat(parseFloat(this.total).toFixed(2)),quantity:this.forms.eventSignup.staffs.length>0?this.forms.eventSignup.staffs.length:1}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>0&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Event",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.eventSignup.paymentOption?"Credit Card":"eft"==this.forms.eventSignup.paymentOption?"Instant EFT":"Purchase Order"},sendRegistration:function(){var e=this;if(this.forms.eventSignup.busy=!0,this.validate())if("eft"!=this.forms.eventSignup.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.eventSignup.paymentOption&&!this.forms.eventSignup.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.eventSignup.busy=!1);var t={dates:this.forms.eventSignup.dates,extras:this.forms.eventSignup.extras,dietary:this.forms.eventSignup.dietaryRequirement,terms:this.forms.eventSignup.terms,card:this.forms.eventSignup.card,donations:this.getDonations(),paymentOption:this.forms.eventSignup.paymentOption,staffs:this.forms.eventSignup.staffs,isgroupbooking:this.TicketTypeState,promo_code_id:this.promo_code_id,selectedEventId:this.event.id,selectedVenueId:this.forms.eventSignup.venue.id,selectedPricingId:this.forms.eventSignup.pricingOption.id,type:"true"==this.TicketTypeState?1:0,id_number:this.id_number,id_type:this.id_type,country_of_issue:this.country_of_issue,incometax_reference_number:this.incometax_reference_number,company_name:this.company_name,company_registrations_number:this.company_registrations_number,is_new_feature:!0,date_of_birth:this.date_of_birth,post_code:this.post_code,postal_address:this.postal_address};this.beginCheckout(),this.processPayment(),this.$http.post("/events/"+this.event.slug+"/register",t).then(function(t){e.forms.eventSignup.busy=!1,void 0!==t.invoice&&e.sendTransactions(t.invoice),swal({type:"success",title:"Payment Successful",text:"Thank y
1ou for your payment",showConfirmButton:!1}),setTimeout(function(){window.location="po"==e.forms.eventSignup.paymentOption?"/dashboard/invoice_orders":"/dashboard/invoices"},2e3)}).catch(function(t){var n=t&&t.status,i=t&&t.data,r=i&&"string"==typeof i.message&&-1!==i.message.toLowerCase().indexOf("already registered")&&i.message||i&&"string"==typeof i.errors&&-1!==i.errors.toLowerCase().indexOf("already registered")&&i.errors;if(r)return swal({type:"info",title:"Already Registered",text:r,showConfirmButton:!0}),void setTimeout(function(){window.location="/dashboard/invoices"},3e3);if(429===n)return swal({type:"info",title:"Please Wait",text:"Your registration is already being processed. Please check your invoices in a moment.",showConfirmButton:!0}),void setTimeout(function(){window.location="/dashboard/invoices"},3e3);e.forms.eventSignup.busy=!1,e.forms.eventSignup.errors.set(t),e.address.errors=t;try{var s=i&&i.message||i&&"string"==typeof i.errors&&i.errors||"There was a problem with your registration. Please try again.";swal({type:"warning",title:"Error",text:s,showConfirmButton:!0})}catch(e){console.log(e)}})}else this.forms.eventSignup.busy=!0},cancelPayment:function(){this.forms.eventSignup.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={donations:this.getDonations(),paymentOption:this.forms.eventSignup.paymentOption,staffs:this.forms.eventSignup.staffs,isgroupbooking:this.TicketTypeState,promo_code_id:this.promo_code_id,selectedEventId:this.event.id,selectedVenueId:this.forms.eventSignup.venue.id,selectedPricingId:this.forms.eventSignup.pricingOption.id,type:"true"==this.TicketTypeState?1:0},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.eventSignup.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),e.closeModal(),void(e.forms.eventSignup.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.eventSignup.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.eventSignup.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},setVenues:function(){for(var e=this.event.venues.length-1;e>=0;e--)this.event.venues[e].city?this.venues.push(this.event.venues[e]):this.online_venues.push(this.event.venues[e]);this.venues=_.sortBy(this.venues,function(e){return e.dates[0].date}),0==this.venues.length&&1==this.online_venues.length&&this.selectVenue(this.online_venues[0])},setDietary:function(){this.forms.eventSignup.dietaryRequirement=this.dietary[0]},setMembers:function(){this.members=this.staff},setExtras:function(){for(var e=this.event.extras.length-1;e>=0;e--)this.extras.push(this.event.extras[e])},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.eventSignup.staffs=this.selectedStaff},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},cancelInvite:function(){this.company.invite.first_name="",this.company.invite.last_name="",this.company.invite.email="",this.company.invite.id_number="",this.company.invite.alternative_cell="",this.company.invite.cell="",this.addingMemberDetails=!1,this.inviteStaff=!1},checkInviteMember:function(){return""==this.company.invite.first_name&&(this.errors.invite.first_name="First name is required"),""==this.company.invite.last_name&&(this.errors.invite.last_name="Last name is required"),""==this.company.invite.email&&(this.errors.invite.email="Email is required"),""==this.company.invite.cell&&(this.errors.invite.cell="Cell is required"),!(this.errors.invite.cell||this.errors.invite.first_name||this.errors.invite.last_name||this.errors.invite.email)||(swal({type:"warning",title:"Fill all the fields"}),this.errors.invite.cell="",this.errors.invite.first_name="",this.errors.invite.last_name="",this.errors.invite.email="",!1)},sendInvitation:function(){if(this.checkInviteMember())if(this.pendingMembersEmails.includes(this.company.invite.email))swal({type:"warning",title:"This member is already added"});else{this.pendingMembersEmails.push(this.company.invite.email);var e=document.querySelector("#full_number_invite_cell"),t=window.intlTelInputGlobals.getInstance(e),n=document.querySelector("#full_number_invite_alternative_cell"),i=window.intlTelInputGlobals.getInstance(n);this.pendingMembers.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:i.getNumber(),cell:t.getNumber()}),this.members.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:i.getNumber(),cell:t.getNumber()}),this.forms.eventSignup.staffs.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:i.getNumber(),cell:t.getNumber()}),this.company.invite.first_name="",this.company.invite.last_name="",this.company.invite.email="",this.company.invite.id_number="",this.company.invite.alternative_cell="",this.company.invite.cell="",this.addingMemberDetails=!1,this.prices.push(this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)),this.totalGroupBookingUser+=1}},checkAndFillMember:function(){var e=this;if(""==this.invite_email||!this.isValidEmail(this.invite_email))return swal({type:"warning",title:"Please enter valid email"}),this.invite_email="",!1;var t=this.invite_email,n=!1;if(this.members.forEach(function(e,i){e.email==t&&(n=!0)}),n)return swal({type:"warning",title:"Given Email Is Already Added",text:"Try To Add Other Email"}),this.inviteStaff=!1,this.invite_email="",!1;this.$http.post("/checkuser",{email:this.invite_email,event_id:this.event.id,price_id:this.forms.eventSignup.pricingOption.id}).success(function(t){"success"==t.status?t.hasTicket?swal({type:"warning",title:"User already registered for this event",text:"Try To Add Other Email"}):(e.members.push(t.member),e.forms.eventSignup.staffs.push(t.member.id),e.prices.push(t.member.price),e.getPriceAfterApplyCoupon(e.forms.eventSignup.pricingOption.price)==t.member.price&&(e.totalGroupBookingUser+=1)):(e.company.invite.email=e.invite_email,e.addingMemberDetails=!0),e.inviteStaff=!1,e.invite_email=""}).catch(function(e){})},isValidEmail:function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},removeMember:function(e){var t;this.members.forEach(function(n,i){n.email==e.email&&(t=i)}),this.prices[t]==this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price)&&(this.totalGroupBookingUser-=1),this.members.splice(t,1),this.prices.splice(t,1),this.forms.eventSignup.staffs.splice(t,1),this.pendingMembers.splice(t,1),this.pendingMembersEmail
1s.splice($.inArray(e.email,this.pendingMembersEmails),1)},selectVenue:function(e){this.forms.eventSignup.venue=e,this.pricingOptions=e.pricings,e.pricings.length<=1&&this.autoSelectPricing(e)},selectAnotherVenue:function(){this.forms.eventSignup.venue=null,this.forms.eventSignup.pricingOption=null,this.forms.eventSignup.dates=[],this.forms.eventSignup.paymentOption=null},autoSelectPricing:function(e){this.forms.eventSignup.pricingOption=e.pricings[0]},autoSelectAllDates:function(){var e=this;_.forEach(e.forms.eventSignup.venue.dates,function(t,n){e.forms.eventSignup.dates.push(t)})},getTotalDiatry:function(){return null!=this.forms.eventSignup.dietaryRequirement&&this.forms.eventSignup.dietaryRequirement.price>0?(totalDiatry=this.forms.eventSignup.dietaryRequirement.price,this.forms.eventSignup.dates.length>1&&(totalDiatry*=this.forms.eventSignup.dates.length),this.forms.eventSignup.staffs.length>0&&(totalDiatry*=this.forms.eventSignup.staffs.length),this.TicketTypeState&&0==this.forms.eventSignup.staffs.length&&(totalDiatry=0),totalDiatry):0},getTotalExtras:function(){var e=0;return this.forms.eventSignup.extras.forEach(function(t){e=parseInt(e)+parseInt(t.price)}),this.forms.eventSignup.staffs.length>0&&(e*=this.forms.eventSignup.staffs.length),this.TicketTypeState&&0==this.forms.eventSignup.staffs.length&&(e=0),e},getDonations:function(){var e=0;return this.forms.eventSignup.donations&&(e=this.donations),e},getPriceCalculartion:function(e,t,n){var i,r,s=0,o=0,a=s=null!=this.forms.eventSignup.pricingOption?this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price):this.getPriceAfterApplyCoupon(this.pricingOptions[0].price);for(0==t&&(t=e),"medium-size"==n&&(e-=1),i=2;i<=e;i++)for(r=0;r<this.pricegroup.length;r++)i>=this.pricegroup[r].min_user&&i<=this.pricegroup[r].max_user&&(o=this.pricegroup[r].discount,a-=Math.round(a*o/100));for(i=2;i<=t;i++)for(r=0;r<this.pricegroup.length;r++)i>=this.pricegroup[r].min_user&&i<=this.pricegroup[r].max_user&&(o=this.pricegroup[r].discount,s-=Math.round(s*o/100));return t==e?"From "+s+" per person":"From "+a+" - "+s+" per person"},getTotalGroupBookingDiscount:function(){var e=0;if(!this.forms.eventSignup.pricingOption)return 0;var t=this.getPriceAfterApplyCoupon(this.forms.eventSignup.pricingOption.price),n=t;if(this.totalGroupBookingUser>0&&this.TicketTypeState&&this.pricegroup.length>0&&this.totalGroupBookingUser>1)for(var i=this.totalGroupBookingUser,r=2;r<=i;r++)for(var s=0;s<this.pricegroup.length;s++){if(r>=this.pricegroup[s].min_user&&r<=this.pricegroup[s].max_user)n-=n*this.pricegroup[s].discount/100}return e=parseFloat(t-n)*this.totalGroupBookingUser,this.TicketTypeState&&0==this.forms.eventSignup.staffs.length&&(e=0),e.toFixed(2)},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},getVenueColumnWidth:function(e){switch(e){case 1:return"col-md-4 col-md-offset-4";case 2:return"col-md-6";case 3:return"col-md-4";case 4:return"col-md-3";default:return"col-md-2"}},getPriceAfterApplyCoupon:function(e){if(null!=this.usedcoupon&&""!=this.usedcoupon&&void 0!=this.usedcoupon){if("percentage"==this.usedcoupon.discount_type){var t=e*this.usedcoupon.discount_amount/100;return parseFloat(e)-parseFloat(t)}return parseFloat(e)-parseFloat(this.usedcoupon.discount_amount)}return parseFloat(e)},updatedPrices:function(){var e=this;this.prices=[],this.totalGroupBookingUser=0,this.$http.post("/get_price_details",{staffs:this.forms.eventSignup.staffs,price_id:this.forms.eventSignup.pricingOption.id}).success(function(t){for(var n=0;n<t.length;n++)e.prices.push(t[n]),e.getPriceAfterApplyCoupon(e.forms.eventSignup.pricingOption.price)==t[n]&&(e.totalGroupBookingUser+=1)}).catch(function(e){})},validate:function(){if(!this.forms.eventSignup.terms)return swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.eventSignup.busy=!1,!1;if(this.forms.eventSignup.donations){if(""==this.id_number)return swal({type:"warning",title:"Error",text:"Please enter id number"}),this.forms.eventSignup.busy=!1,!1;if(""==this.id_type)return swal({type:"warning",title:"Error",text:"Please enter valid id type"}),this.forms.eventSignup.busy=!1,!1;if(""==this.country_of_issue)return swal({type:"warning",title:"Error",text:"Please select valid country"}),this.forms.eventSignup.busy=!1,!1;if(""==this.incometax_reference_number)return swal({type:"warning",title:"Error",text:"Please select valid income tax reference number!"}),this.forms.eventSignup.busy=!1,!1;if(""==this.company_name)return swal({type:"warning",title:"Error",text:"Please enter valid company name!"}),this.forms.eventSignup.busy=!1,!1;if(""==this.company_registrations_number)return swal({type:"warning",title:"Error",text:"Please enter company registration number"}),this.forms.eventSignup.busy=!1,!1;if(""==this.date_of_birth)return swal({type:"warning",title:"Error",text:"Please select date of birth"}),this.forms.eventSignup.busy=!1,!1;if(""==this.postal_address)return swal({type:"warning",title:"Error",text:"Please enter valid postal address"}),this.forms.eventSignup.busy=!1,!1;if(""==this.post_code)return swal({type:"warning",title:"Error",text:"Please enter valid postal code"}),this.forms.eventSignup.busy=!1,!1}return!0}}})},function(e,t){Vue.component("events-data-grid",{props:["events"],ready:function(){},data:function(){return{}},computed:{},methods:{}})},function(e,t){var n;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Vue.component("event-data-grid",(i(n={props:["event"],ready:function(){}},"ready",function(){}),i(n,"data",function(){var e={none:0,group:1,sum:2};return{aggregationTypes:e,columnConfigs:[{id:"s1",title:"Venue",aggregationType:e.group,ticketDataPath:"venue_name",default:"None",sortOrder:0},{id:"s2",title:"Pricing",aggregationType:e.group,ticketDataPath:"pricings_name",default:"None",sortOrder:1},{id:"s3",title:"Days",aggregationType:e.group,ticketDataPath:"dates",default:"None",sortOrder:2},{id:"s4",title:"Subscription",aggregationType:e.group,ticketDataPath:"subscription",default:"None",sortOrder:3},{id:"s5",title:"Invoice Number",aggregationType:e.none,ticketDataPath:"invoice_reference",default:"None",sortOrder:4},{id:"s6",title:"Invoice Status",aggregationType:e.group,ticketDataPath:"invoice_status",default:"None",sortOrder:5},{id:"s7",title:"Dietary requirements",aggregationType:e.group,ticketDataPath:"dietary_requirement_name",default:"None",sortOrder:6},{id:"s8",title:"Email",aggregationType:e.none,ticketDataPath:"user_email",default:"None",sortOrder:7},{id:"s9",title:"Name",aggregationType:e.none,ticketDataPath:"user_first_name",default:"None",sortOrder:8},{id:"s10",title:"Last name",aggregationType:e.none,ticketDataPath:"user_last_name",default:"None",sortOrder:9},{id:"s11",title:"Cell",aggregationType:e.none,ticketDataPath:"user_cell",default:"None",sortOrder:10},{id:"s13",title:"Total",aggregationType:e.sum,ticketDataPath:"invoice_total",default:0,sortOrder:12},{id:"s14",title:"Due",aggregationType:e.sum,ticketDataPath:"invoice_balance",default:0,sortOrder:13}],extrasColumnsSortStart:14,columnsFilters:{},showRows:!1,search:""}}),i(n,"computed",{extras:function(){var e=this,t={};return _.forEach(e.event.tickets,function(n,i){var r=n.extras;_.forEach(r,function(n,i){t[n.id]||Vue.set(t,n.id,{id:"e"+n.id,title:n.name,sortOrder:e.extrasColumnsSortStart+t.length})})}),t},headings:function(){var e=this,t=[];return _.forEach(e.columnConfigs,function(e,n){t.push({id:e.id,title:e.title,sortOrder:e.sortOrder,aggregationType:e.aggregationType})}),_.forEach(e.extras,function(n,i){t.push({id:n.id,title:n.title,sortOrder:n.sortOrder,aggregationType:e.aggregationTypes.group})}),t},rows:function(){var e=this,t=[];return _.forEach(e.event.tickets,function(n,i){var r={columns:[]};_.forEach(e.columnConfigs,function(t,i){var s=e.getNestedProperty(n,t.ticketDataPath,t.default);r.columns.push({id:t.id,title:t.title,isExtra:!1,data:s,sortOrder:t.sortOrder,aggregationType:t.aggregationType})}),_.forEach(e.extras,function(t,i){var s=_.find(n.extras,function(e){return t.id=="e"+e.id});r.columns.push({id:t.id,title:t.title,isExtra:!0,data:s?"Yes":"No",sortOrder:t.sortOrder,aggregationType:e.aggregationTypes.group})});var s=0;_.forEach(r.columns,function(t,n){var i=!1,r=0;_.forEach(e.columnsFilters,function(e,n){e.length>0&&t.id==n&&(r++,_.forEach(e,function(e,n){e==t.data&&(i=!0)}))}),r||(i=!0),i&&s++}),s==r.columns.length&&t.push(r)}),t},stats:function(){var e=this,t={};return _.forEach(e.rows,function(n,i){_.forEach(n.columns,function(n,i){if
1(n.aggregationType==e.aggregationTypes.none)return!1;n.aggregationType==e.aggregationTypes.group?(t[n.id]||Vue.set(t,n.id,{title:n.title,groups:{},type:e.aggregationTypes.group}),t[n.id].groups[n.data]||Vue.set(t[n.id].groups,n.data,{id:n.id,data:n.data,count:0,active:e.isActiveFilter(n.id,n.data)}),t[n.id].groups[n.data].count++):n.aggregationType==e.aggregationTypes.sum&&(t[n.id]||Vue.set(t,n.id,{title:n.title,sum:0,type:e.aggregationTypes.sum}),t[n.id].sum+=parseFloat(n.data))})}),t}}),i(n,"methods",{isInt:function(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))},clearAllFilters:function(){Vue.set(this,"columnsFilters",{})},isActiveFilter:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);return!!n&&_.find(n,function(e){return e==t})},toggleFilterActive:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);n?_.find(n,function(e){return e==t})?n.$remove(t):n.push(t):Vue.set(this.columnsFilters,e,[t])},findColumnConfigById:function(e){return _.find(this.columnConfigs,function(t){if(t.id==e)return!0})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}),n))},function(e,t){Vue.component("event-assign-to-plans",{props:["events","plans"],ready:function(){},data:function(){return{plansIds:[],selectedEventId:this.events[0].id,selectedVenueId:this.events[0].venues[0].id,selectedDateId:this.events[0].venues[0].dates[0].id}},computed:{selectedEvent:function(){return this.getSelectedEvent()},selectedVenue:function(){return this.getSelectedVenue()}},methods:{changeEventSelection:function(){this.selectedVenueId=this.selectedEvent.venues[0].id,this.selectedDateId=this.selectedVenue.dates[0].id},changeVenueSelection:function(){this.selectedDateId=this.selectedVenue.dates[0].id},getEventById:function(e){return _.find(this.events,{id:e})},getSelectedEvent:function(){return this.getEventById(this.selectedEventId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getSelectedVenue:function(){return this.getVenueById(this.selectedVenueId)}}})},function(e,t){Vue.component("select-event-and-venue",{props:["events"],ready:function(){},data:function(){return{selectedEventId:this.events[0].id,selectedVenueId:this.events[0].venues[0]?this.events[0].venues[0].id:0}},computed:{selectedEvent:function(){return this.getSelectedEvent()}},methods:{changeEventSelection:function(){this.selectedVenueId=this.selectedEvent.venues[0].id},getEventById:function(e){return _.find(this.events,{id:e})},getSelectedEvent:function(){return this.getEventById(this.selectedEventId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})}}})},function(e,t){Vue.component("create-edit-video",{props:["videoProviders"],data:function(){var e={none:0,busy:1,success:2,error:3};return{ajaxStates:e,fetchState:e.none,selectedVideoProviderId:this.videoProviders[0].id,form:{title:"",reference:"",videoProviderId:this.videoProviders[0].id,downloadLink:"",width:"",height:"",hours:"",tag:"",amount:"",description:""}}},ready:function(){this.fetchProviderVideos(this.selectedVideoProviderId)},computed:{selectedVideoProvider:function(){return this.getSelectedVideoProvider()},selectedVideo:function(){return this.getSelectedVideo()}},methods:{apply:function(){var e=this;e.form.title=e.selectedVideo.title,e.form.reference=e.selectedVideo.reference,e.form.videoProviderId=e.selectedVideoProviderId,e.form.downloadLink=e.selectedVideo.downloadLink,e.form.width=e.selectedVideo.width,e.form.height=e.selectedVideo.height,e.form.hours=e.selectedVideo.hours,e.form.tag=e.selectedVideo.tag,e.form.amount=e.selectedVideo.amount,e.form.description=e.selectedVideo.description},retry:function(){this.fetchProviderVideos(this.selectedVideoProviderId)},fetchProviderVideos:function(e){var t=this;t.fetchState=t.ajaxStates.busy,t.$http({url:"/admin/video-providers/"+e+"/videos",method:"GET"}).then(function(e){t.fetchState=t.ajaxStates.success,Vue.set(t.selectedVideoProvider,"videos",e.data),t.selectedVideoReference=t.selectedVideoProvider.videos[0].reference},function(e){t.fetchState=t.ajaxStates.error,console.log("error",e)})}
1,changeVideoProviderSelection:function(){this.fetchProviderVideos(this.selectedVideoProviderId)},getVideoProviderById:function(e){return _.find(this.videoProviders,{id:e})},getSelectedVideoProvider:function(){return this.getVideoProviderById(this.selectedVideoProviderId)},getVideoByReference:function(e){return _.find(this.selectedVideoProvider.videos,{reference:e})},getSelectedVideo:function(){return this.getVideoByReference(this.selectedVideoReference)}}})},function(e,t){Vue.filter("searchAndFilterAttendees",function(e,t){var n=this,i=t.trim().toLowerCase(),r=[];return _.forEach(e,function(e,t){var s=!1,o=(e.first_name.trim()+" "+e.last_name.trim()).toLowerCase();e.full_name=o,(o.indexOf(i)>-1||e.email.trim().toLowerCase().indexOf(i)>-1||e.code.trim().toLowerCase().indexOf(i)>-1)&&(s=!0);var a=!1,c=0,u=0;_.forOwn(n.filters,function(t,i){(u++,t.selected==t.options.Any)?c++:n.getNestedProperty(e,t.on,null)==t.selected&&c++}),c==u&&(a=!0),s&&a&&r.push(e)}),r}),Vue.filter("searchSelectedAttendees",function(e,t){var n=t.trim().toLowerCase(),i=[];return _.forEach(e,function(e,t){var r=(e.first_name.trim()+" "+e.last_name.trim()).toLowerCase();e.full_name=r,(r.indexOf(n)>-1||e.email.trim().toLowerCase().indexOf(n)>-1||e.code.trim().toLowerCase().indexOf(n)>-1)&&i.push(e)}),i}),Vue.component("assign-cpd",{props:["events"],ready:function(){var e=this;$(document).on("change",".btn-file :file",function(){var t=$(this),n=t.get(0).files[0];Papa.parse(n,{header:!0,complete:function(t){e.processCSVRows(t.data)}}),t.val("")})},data:function(){var e={none:0,busy:1,success:2,error:3};return{ajaxStates:e,fetchState:e.none,saveState:e.none,selectedEventId:0,selectedVenueId:0,search:"",selectedSearch:"",sortField:"full_name",attendees:[],selectedAttendees:[],filters:{invoice:{on:"invoice.status",title:"Invoice",options:{Any:-1,Free:null,Unpaid:"unpaid",Paid:"paid",Cancelled:"cancelled"},selected:-1},attendance:{on:"attended",title:"Attendance",options:{Any:-1,Unattended:0,Attended:1},selected:-1}}}},computed:{selectedEvent:function(){return this.getSelectedEvent()}},methods:{processCSVRows:function(e){var t=this,n=0,i=[],r=0;_.forEach(e,function(e,s){var o=t.findAttendeeByCodeEmailName(e.code,e.email,e.first_name,e.last_name);o?(t.addToSelected(o.id),n++):e.code&&""!=e.code.trim()||e.email&&""!=e.email.trim()||e.first_name&&""!=e.first_name.trim()||e.last_name&&""!=e.last_name.trim()?i.push(e):r++}),swal({title:"Select from CSV",html:!0,text:"<p><strong>"+n+"</strong> out of <strong>"+(e.length-r)+"</strong> attendees selected from CSV file.</p>",type:"success",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Download extra "+i.length+" attendees",cancelButtonText:"Close",closeOnConfirm:!1,closeOnCancel:!0},function(e){e&&(t.downloadExtraRowsFromCSV(i),swal.close())})},downloadExtraRowsFromCSV:function(e){var t=Papa.unparse(e,{quotes:!0,delimiter:",",newline:"\r\n"}),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=null;i=navigator.msSaveBlob?navigator.msSaveBlob(n,"extra-rows.csv"):window.URL.createObjectURL(n);var r=document.createElement("a");r.href=i,r.setAttribute("download","extra-rows.csv"),r.click()},findAttendeeByCodeEmailName:function(e,t,n,i){var r=!1,s=null;return e&&""!=e.trim()&&(s=_.find(this.attendees,{code:e}))&&(r=!0),!r&&t&&""!=t.trim()&&(s=_.find(this.attendees,{email:t}))&&(r=!0),!r&&n&&""!=n.trim()&&i&&""!=i.trim()&&(s=_.find(this.attendees,{first_name:n,last_name:i})),s},clearAttendeeSearch:function(){this.search=""},clearSelectedAttendeeSearch:function(){this.selectedSearch=""},addAllFilteredAttendeesToSelected:function(){var e=this,t=_.clone(e.attendees);_.forEach(t,function(t,n){e.attendees.$remove(t),e.selectedAttendees.push(t)})},clearAndResetAllSelectedAttendees:function(){var e=this,t=_.clone(e.selectedAttendees);_.forEach(t,function(t,n){e.selectedAttendees.$remove(t),e.resetAttendeeValuesToOriginalValues(t),e.attendees.push(t)})},save:function(){var e=this;e.saveState=e.ajaxStates.busy,e.$http({url:"/admin/event/"+e.selectedEventId+"/venue/"+e.selectedVenueId+"/attendees/save/",method:"POST",data:{attendees:e.selectedAttendees}}).then(function(t){e.saveState=e.ajaxStates.success,swal("Success","Attendees have been updated.","success"),e.fetchAttendees()}
1,function(t){e.saveState=e.ajaxStates.error,swal("Error","Something went wrong, please check your internet and try again.","error"),console.log("error",t)})},cancelAndDeleteAllSelected:function(){_.forEach(this.selectedAttendees,function(e,t){e.marked_for_deletion=!0,null!=e.invoice&&(e.invoice.status="cancelled")})},markAllSelectedAsAttended:function(){_.forEach(this.selectedAttendees,function(e,t){e.attended=!0})},markAllSelectedAsUnattended:function(){_.forEach(this.selectedAttendees,function(e,t){e.attended=!1})},addToSelected:function(e){var t=_.find(this.attendees,{id:e});t&&(this.attendees.$remove(t),this.selectedAttendees.push(t))},removeFromSelected:function(e){var t=_.find(this.selectedAttendees,{id:e});t&&(this.selectedAttendees.$remove(t),this.resetAttendeeValuesToOriginalValues(t),this.attendees.push(t))},resetAttendeeValuesToOriginalValues:function(e){e.marked_for_deletion=e.original_values.marked_for_deletion,e.attended=e.original_values.attended,null!=e.invoice&&(e.invoice.status=e.original_values.invoice.status)},fetchAttendees:function(){var e=this;e.attendees=[],e.selectedAttendees=[],e.fetchState=e.ajaxStates.busy,e.$http({url:"/admin/event/"+e.selectedEventId+"/venue/"+e.selectedVenueId+"/attendees",method:"GET"}).then(function(t){e.fetchState=e.ajaxStates.success,e.attendees=t.data,e.setupAttendees()},function(t){e.fetchState=e.ajaxStates.error,console.log("error",t)})},setupAttendees:function(){_.forEach(this.attendees,function(e,t){Vue.set(e,"marked_for_deletion",!1),Vue.set(e,"original_values",JSON.parse(JSON.stringify(e)))})},changeEventSelection:function(){this.selectedVenueId=0},changeVenueSelection:function(){this.selectedVenueId>0&&this.fetchAttendees()},getEventById:function(e){return _.find(this.events,{id:e})},getSelectedEvent:function(){return this.getEventById(this.selectedEventId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}})},function(e,t){Vue.filter("filterBySelectedListingsAndTitle",function(e){var t=this;return _.sortBy(e,function(e){return(_.find(t.selectedProducts,function(t,n){return t==e.id})?0:1)+e.title+e.listings.length})}),Vue.component("store-listings-admin-add-product",{props:["products","selectedProducts"],ready:function(){},data:function(){return{search:""}},computed:{},methods:{toggleSelectProduct:function(e){_.find(this.selectedProducts,function(t,n){return t==e.id})?this.selectedProducts.$remove(e.id):this.selectedProducts.push(e.id)}}})},function(e,t){Vue.component("store-products-admin-index",{props:["products"],ready:function(){},data:function(){return{}},computed:{},methods:{}})},function(e,t){Vue.component("store-admin-index",{props:["orders","shippingInformationStatuses","provinces","countries"],ready:function(){},data:function(){var e=this.orders,t={none:0,busy:1,success:2,error:3};return{search:"",ajaxStates:t,shippingInformationUpdateState:t.none,shippingInformationUpdate:{tracking_code:"",status:this.shippingInformationStatuses[0]},showingShippingInformation:null,showModal:!1,filteredOrders:e}},computed:{},filters:{momentFromNow:function(e){return moment(e).fromNow()}},methods:{showShippingInfoModal:function(e){this.showingShippingInformation=e,Vue.set(this,"shippingInformationUpdate",{tracking_code:e.tracking_code,status:e.status}),$("#shippingInfoModal").modal("show")},updateShippingInformation:function(){var e=this;e.shippingInformationUpdateState=e.ajaxStates.busy,e.$http({url:"/admin/shipping/"+e.showingShippingInformation.id+"/update",method:"POST",data:{status_id:e.shippingInformationUpdate.status.id,tracking_code:e.shippingInformationUpdate.tracking_code}}).then(function(t){e.shippingInformationUpdateState=e.ajaxStates.success,e.showingShippingInformation.status=e.shippingInformationUpdate.status,e.showingShippingInformation.tracking_code=e.shippingInformationUpdate.tracking_code,$("#shippingInfoModal").modal("hide"),swal({type:"success",title:"Success",text:"Shipping information updated.",timer:1500,showConfirmButton:!1})},function(t){e.shippingInformationUpdateState=e.ajaxStates.error,swal("Error","S
1omething went wrong, please check your internet and try again.","error"),console.log("error",t)})}}})},function(e,t){var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function r(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})}var s=function(){function e(e,t,n,i,s,o,a){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=1),void 0===i&&(i=50),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=!1),this.id=0,this.guid=r(),this.title=e,this.instructions=t,this.cpd_hours=n,this.pass_percentage=i,this.time_limit_minutes=s,this.maximum_attempts=o,this.randomize_questions_order=a,this.questions={}}return e.prototype.addBlankQuestion=function(){var e=new o("",this.nextSortOrder(),!1);e.addBlankOption(),this.addQuestion(e)},e.prototype.addQuestion=function(e){Vue.set(this.questions,e.guid,e),e.collapsed||(_.size(this.questions)>1?(this.collapseAllQuestionsExcept(e),e.expand()):e.initSummernote())},e.prototype.removeQuestion=function(e){Vue.delete(this.questions,e.guid),this.reOrderAllQuestions()},e.prototype.nextSortOrder=function(){return _.size(this.questions)+1},e.prototype.collapseAllQuestions=function(){_.forEach(this.questions,function(e,t){e.collapse()})},e.prototype.collapseAllQuestionsExcept=function(e){_.forEach(this.questions,function(t,n){e.guid!=t.guid&&t.collapse()})},e.prototype.expandAllQuestions=function(){_.forEach(this.questions,function(e,t){e.expand()})},e.prototype.reOrderAllQuestions=function(){var e=this,t=_.sortBy(this.questions,"sort_order"),n=1;_.forEach(t,function(t,i){Vue.set(e.questions[t.guid],"sort_order",n),n++})},e.prototype.questionsLength=function(){return _.size(this.questions)},e}(),o=function(){function e(e,t,n){void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=!0),this.id=0,this.guid=r(),this.description=e,this.sort_order=t,this.options={},this.collapsed=n}return e.prototype.nextOptionSymbol=function(){var e=_.size(this.options);return e<=0?i[0]:i[e]},e.prototype.addBlankOption=function(){var e=new a(this.nextOptionSymbol());this.addOption(e)},e.prototype.addOption=function(e){Vue.set(this.options,e.guid,e)},e.prototype.removeOption=function(e){Vue.delete(this.options,e.guid),this.reSymbolAllOptions()},e.prototype.setCorrectOption=function(e){_.forEach(this.options,function(t,n){t.is_correct=t.guid==e.guid})},e.prototype.initSummernote=function(){var e=this;Vue.nextTick(function(){$("#question-id-"+e.guid).summernote({minHeight:100,placeholder:"Question",focus:!0,toolbar:[["style",["bold","italic","underline","clear"]],["font",["strikethrough","superscript","subscript"]],["para",["ul","ol"]],["Misc",["codeview"]]],callbacks:{onChange:function(t,n){Vue.set(e,"description",t)}}})})},e.prototype.destroySummernote=function(){var e=this;Vue.nextTick(function(){$("#question-id-"+e.guid).summernote("destroy")})},e.prototype.toggleCollapsed=function(){this.collapsed=!this.collapsed,this.collapsed?this.destroySummernote():this.initSummernote()},e.prototype.collapse=function(){this.collapsed=!0,this.destroySummernote()},e.prototype.expand=function(){this.collapsed=!1,this.initSummernote()},e.prototype.reSymbolAllOptions=function(){var e=this,t=_.sortBy(e.options,"symbol"),n=0;_.forEach(t,function(t,r){Vue.set(e.options[t.guid],"symbol",i[n]),n++})},e}(),a=function(){return function(e,t,n){void 0===t&&(t=""),void 0===n&&(n=!1),this.id=0,this.guid=r(),this.symbol=e,this.description=t,this.is_correct=n}}();Vue.component("assessments-admin-create-edit",{props:{assessmentJson:{default:function(){return{}}}},ready:function(){},data:function(){var e={none:0,busy:1,success:2,error:3};return{assessment:this.createAssessmentFromJson(this.assessmentJson),ajaxStates:e,saveState:e.none,selectedFile:""}},computed:{},methods:{createAssessmentFromJson:function(e){var t=new s;return _.size(e)>0&&((t=new s(e.title,e.instructions,e.cpd_hours,e.pass_percentage,e.time_limit_minutes,e.maximum_attempts,e.randomize_questions_order)).id=e.id,t.guid=e.guid),_.has(e,"questions")&&_.forEach(e.questions,function(e,n){var i=new o(e.description,e.sort_order,!0);i.id=e.id,i.guid=e.guid,_.has(e,"options")?_.forEach(e.options,function(e,t){var n=new a(e.symbol,e.description,e.is_correct);n.id=e.id,n.guid=e.guid,i.addOption(n)}):i.addBlankOption(),t.addQuestion(i)}),t},save:function(){var e=this;e.saveState=e.ajaxStates.busy;var t=new FormData;t.append("file",e.selectedFile),t.append("assessment",JSON.stringify(n({}
1,e.assessment))),e.$http.post("/admin/assessments/store",t).then(function(t){e.saveState=e.ajaxStates.success,swal({title:"Success",text:"Assessment has been saved.",type:"success",showConfirmButton:!1,timer:2e3}),t.data.assessment_id&&t.data.assessment_id!=e.assessment.id&&setTimeout(function(){window.location.href="/admin/assessments/"+t.data.assessment_id+"/edit"},1e3)}).catch(function(t){e.saveState=e.ajaxStates.error;var n="Something went wrong, please check your internet and try again.";t&&t.data&&t.data.message&&(n=t.data.message),swal("Error",n,"error")})},handleFileChange:function(e){this.selectedFile=e.target.files[0]}}})},function(e,t){Vue.component("assessment",{props:{assessment:{required:!0},attempts:{type:Number,required:!1,default:function(){return 0}},maxAttempts:{type:Number,required:!1,default:function(){return 0}},itemId:{default:0},type:{type:String,required:!0}},ready:function(){},data:function(){var e=this,t={overview:0,question:1,results:2},n=0,i={none:0,busy:1,success:2,error:3},r={};_.forEach(e.assessment.questions,function(e,t){r[e.guid]={question:e,option:null,result:n}}),e.assessment.questions=_.sortBy(e.assessment.questions,"sort_order"),e.assessment.questions=_.keyBy(e.assessment.questions,"guid");var s=e.checkIfCanRetry();return{answers:r,navStates:t,navState:t.overview,markingStates:i,markingState:i.none,activeQuestion:null,hasBeenMarked:!1,certificateUrl:null,passed:!1,canRetry:s,remainingAttempts:e.calculateRemainingAttempts(),results:null,responseData:null}},computed:{progressPercentage:function(){return this.calculateProgressPercentage()},canPrevious:function(){return this.checkIfCanPrevious()},canNext:function(){return this.checkIfCanNext()},canSubmit:function(){return this.checkIfCanSubmit()}},methods:{start:function(){this.switchToQuestion(this.firstQuestion().guid)},viewAnswers:function(){this.switchToQuestion(this.lastQuestion().guid)},questionsLength:function(){return _.size(this.assessment.questions)},answersLength:function(){return _.size(this.answers)},switchToOverview:function(){this.navState=this.navStates.overview,this.activeQuestion=null},switchToResults:function(){this.navState=this.navStates.results,this.activeQuestion=null},switchToQuestion:function(e){this.activeQuestion=this.assessment.questions[e],this.navState=this.navStates.question},questionByIndex:function(e){var t=_.keys(this.assessment.questions);return this.assessment.questions[t[e]]},questionIndex:function(e){var t=_.keys(this.assessment.questions);return _.indexOf(t,e)},checkIfCanPrevious:function(){return this.navState==this.navStates.question&&this.questionIndex(this.activeQuestion.guid)>0},previous:function(){this.checkIfCanPrevious()&&this.switchToQuestion(this.previousQuestion().guid)},checkIfCanNext:function(){var e=this;return e.navState==e.navStates.overview||!!(e.navState==e.navStates.question&&e.questionIndex(e.activeQuestion.guid)<e.questionsLength()-1)},next:function(){var e=this;e.navState==e.navStates.overview?e.switchToQuestion(e.firstQuestion().guid):e.navState==e.navStates.question&&e.checkIfCanNext()?e.switchToQuestion(e.nextQuestion().guid):e.submit()},firstQuestion:function(){var e=_.keys(this.assessment.questions);return this.assessment.questions[e[0]]},lastQuestion:function(){var e=_.keys(this.assessment.questions);return this.assessment.questions[e[e.length-1]]},nextQuestion:function(){var e=this.questionIndex(this.activeQuestion.guid)+1;return e<this.questionsLength()?this.questionByIndex(e):null},previousQuestion:function(){var e=this.questionIndex(this.activeQuestion.guid)-1;return e>=0?this.questionByIndex(e):null},calculateProgressPercentage:function(){var e=0;return _.forEach(this.answers,function(t,n){t.option&&null!=t.option&&e++}),Math.round(e/this.answersLength()*100)},checkIfCanSubmit:function(){return this.calculateProgressPercentage()>0},submit:function(){var e=this,t="Are you sure you want so submit?<br><br><em>You will not be able to change your answers after you submit.</em>";e.progressPercentage<100&&(t+="<br><br><strong>You still have unanswered questions!</strong>"),swal({title:"Submit for marking",html:!0,text:t,type:"warning",showCancelButton:!0,confirmButtonText:"Yes, submit",cancelButtonText:"No, go back"},function(){e.markingState=e.markingStates.busy,e.$http({url:"/dashboard/assessments/"+e.assessment.id+"/mark",method:"POST",data:{answers:e.answers,itemType:e.type,itemId:e.itemId}}).then(function(t){e.markingState=e.markingStates.success,e.switchToResults(),e.results=t.data.results,e.responseData=t.data,t.data.passed?(swal("You passed!","Congratulations, you have been awarded "+t.data.hours+" hour(s) of CPD.","success"),e.hasBeenMarked=!0,e.passed=!0,e.certificateUrl=t.data.certificateUrl):(swal("So close!","Unfortunately you didn't get enough answers correct to pass.","error"),e.hasBeenMarked=!0,e.passed=!1)},function(t){e.markingState=e.markingStates.error,t.data.error?swal("Error",t.data.error,"error"):swal("Error","S
1omething went wrong, please check your internet and try again.","error"),console.log("error",t)})})},calculateRemainingAttempts:function(){return this.maxAttempts-this.attempts},checkIfCanRetry:function(){return this.calculateRemainingAttempts()>0||0==this.maxAttempts},retry:function(){this.canRetry&&window.location.reload()}}})},function(e,t){Vue.component("members-stats",{props:{members:{required:!0}},ready:function(){},data:function(){var e={none:0,group:1,sum:2};return{aggregationTypes:e,columnConfigs:[{id:"s2",title:"Membership",aggregationType:e.group,dataPath:"subscription.plan.name",default:"None",sortOrder:1},{id:"s3",title:"Installments",aggregationType:e.group,dataPath:"subscription.installments.status",default:"None",sortOrder:2},{id:"s4",title:"Installments Total",aggregationType:e.sum,dataPath:"subscription.installments.total",default:0,sortOrder:3},{id:"s5",title:"Installments Due",aggregationType:e.sum,dataPath:"subscription.installments.balance",default:0,sortOrder:4},{id:"s6",title:"Date Registered",aggregationType:e.none,dataPath:"created_at",default:"Unknown",sortOrder:5}],columnsFilters:{},showRows:!1}},computed:{headings:function(){var e=[];return _.forEach(this.columnConfigs,function(t,n){e.push({id:t.id,title:t.title,sortOrder:t.sortOrder,aggregationType:t.aggregationType})}),e},rows:function(){var e=this,t=[];return _.forEach(e.members,function(n,i){var r={columns:[]};_.forEach(e.columnConfigs,function(t,i){var s=e.getNestedProperty(n,t.dataPath,t.default);r.columns.push({id:t.id,title:t.title,data:s,sortOrder:t.sortOrder,aggregationType:t.aggregationType})});var s=0;_.forEach(r.columns,function(t,n){var i=!1,r=0;_.forEach(e.columnsFilters,function(e,n){e.length>0&&t.id==n&&(r++,_.forEach(e,function(e,n){e==t.data&&(i=!0)}))}),r||(i=!0),i&&s++}),s==r.columns.length&&t.push(r)}),t},stats:function(){var e=this,t={};return _.forEach(e.rows,function(n,i){_.forEach(n.columns,function(n,i){if(n.aggregationType==e.aggregationTypes.none)return!1;n.aggregationType==e.aggregationTypes.group?(t[n.id]||Vue.set(t,n.id,{title:n.title,groups:{},type:e.aggregationTypes.group}),t[n.id].groups[n.data]||Vue.set(t[n.id].groups,n.data,{id:n.id,data:n.data,count:0,active:e.isActiveFilter(n.id,n.data)}),t[n.id].groups[n.data].count++):n.aggregationType==e.aggregationTypes.sum&&(t[n.id]||Vue.set(t,n.id,{title:n.title,sum:0,type:e.aggregationTypes.sum}),t[n.id].sum+=parseFloat(n.data))})}),t}},methods:{isInt:function(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))},clearAllFilters:function(){Vue.set(this,"columnsFilters",{})},isActiveFilter:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);return!!n&&_.find(n,function(e){return e==t})},toggleFilterActive:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);n?_.find(n,function(e){return e==t})?n.$remove(t):n.push(t):Vue.set(this.columnsFilters,e,[t])},findColumnConfigById:function(e){return _.find(this.columnConfigs,function(t){if(t.id==e)return!0})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}})},function(e,t){Vue.component("orders-stats",{props:{orders:{required:!0}},ready:function(){},data:function(){var e={none:0,group:1,sum:2};return{aggregationTypes:e,columnConfigs:[{id:"s1",title:"Invoice",aggregationType:e.none,dataPath:"invoice.reference",default:"None",sortOrder:0},{id:"s2",title:"Invoice Status",aggregationType:e.group,dataPath:"invoice.status",default:"None",sortOrder:1},{id:"s3",title:"Shipping Method",aggregationType:e.group,dataPath:"shipping_method.title",default:"None",sortOrder:2},{id:"s4",title:"Shipping Status",aggregationType:e.group,dataPath:"shipping_information.status.title",default:"None",sortOrder:3},{id:"s5",title:"Total",aggregationType:e.sum,dataPath:"invoice.total",default:0,sortOrder:4},{id:"s6",title:"Due",aggregationType:e.sum,dataPath:"invoice.balance",default:0,sortOrder:5},{id:"s7",title:"Date Ordered",aggregationType:e.none,dataPath:"created_at",default:"Unknown",sortOrder:6}],columnsFilters:{},showRows:!1}},computed:{headings:function(){var e=[];return _.forEach(this.columnConfigs,function(t,n){e.push({id:t.id,title:t.title,sortOrder:t.sortOrder,aggregationType:t.aggregationType})}),e},rows:function(){var e=this,t=[];return _.forEach(e.orders,function(n,i){var r={columns:[]};_.forEach(e.columnConfigs,function(t,i){var s=e.getNestedProperty(n,t.dataPath,t.default);r.columns.push({id:t.id,title:t.title,data:s,sortOrder:t.sortOrder,aggregationType:t.aggregationType})});var s=0;_.forEach(r.columns,function(t,n){var i=!1,r=0;_.forEach(e.columnsFilters,function(e,n){e.length>0&&t.id==n&&(r++,_.forEach(e,function(e,n){e==t.data&&(i=!0)}))}),r||(i=!0),i&&s++}),s==r.columns.length&&t.push(r)}),t},stats:function(){var e=this,t={};return _.forEach(e.rows,function(n,i){_.forEach(n.columns,function(n,i){if
1(n.aggregationType==e.aggregationTypes.none)return!1;n.aggregationType==e.aggregationTypes.group?(t[n.id]||Vue.set(t,n.id,{title:n.title,groups:{},type:e.aggregationTypes.group}),t[n.id].groups[n.data]||Vue.set(t[n.id].groups,n.data,{id:n.id,data:n.data,count:0,active:e.isActiveFilter(n.id,n.data)}),t[n.id].groups[n.data].count++):n.aggregationType==e.aggregationTypes.sum&&(t[n.id]||Vue.set(t,n.id,{title:n.title,sum:0,type:e.aggregationTypes.sum}),t[n.id].sum+=parseFloat(n.data))})}),t}},methods:{isInt:function(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))},clearAllFilters:function(){Vue.set(this,"columnsFilters",{})},isActiveFilter:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);return!!n&&_.find(n,function(e){return e==t})},toggleFilterActive:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);n?_.find(n,function(e){return e==t})?n.$remove(t):n.push(t):Vue.set(this.columnsFilters,e,[t])},findColumnConfigById:function(e){return _.find(this.columnConfigs,function(t){if(t.id==e)return!0})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}})},function(e,t){Vue.component("registrations-stats",{props:{registrations:{required:!0}},ready:function(){},data:function(){var e={none:0,group:1,sum:2};return{aggregationTypes:e,columnConfigs:[{id:"s1",title:"Invoice",aggregationType:e.none,dataPath:"invoice.reference",default:"None",sortOrder:0},{id:"s2",title:"Invoice Status",aggregationType:e.group,dataPath:"invoice.status",default:"None",sortOrder:1},{id:"s3",title:"Event",aggregationType:e.group,dataPath:"event.name",default:"None",sortOrder:2},{id:"s4",title:"Venue",aggregationType:e.group,dataPath:"venue.name",default:"None",sortOrder:3},{id:"s5",title:"Subscription",aggregationType:e.group,dataPath:"user.subscription.plan.name",default:"None",sortOrder:4},{id:"s6",title:"Total",aggregationType:e.sum,dataPath:"invoice.total",default:0,sortOrder:5},{id:"s7",title:"Due",aggregationType:e.sum,dataPath:"invoice.balance",default:0,sortOrder:6},{id:"s8",title:"Date Registered",aggregationType:e.none,dataPath:"created_at",default:"Unknown",sortOrder:7}],columnsFilters:{},showRows:!1}},computed:{headings:function(){var e=[];return _.forEach(this.columnConfigs,function(t,n){e.push({id:t.id,title:t.title,sortOrder:t.sortOrder,aggregationType:t.aggregationType})}),e},rows:function(){var e=this,t=[];return _.forEach(e.registrations,function(n,i){var r={columns:[]};_.forEach(e.columnConfigs,function(t,i){var s=e.getNestedProperty(n,t.dataPath,t.default);r.columns.push({id:t.id,title:t.title,data:s,sortOrder:t.sortOrder,aggregationType:t.aggregationType})});var s=0;_.forEach(r.columns,function(t,n){var i=!1,r=0;_.forEach(e.columnsFilters,function(e,n){e.length>0&&t.id==n&&(r++,_.forEach(e,function(e,n){e==t.data&&(i=!0)}))}),r||(i=!0),i&&s++}),s==r.columns.length&&t.push(r)}),t},stats:function(){var e=this,t={};return _.forEach(e.rows,function(n,i){_.forEach(n.columns,function(n,i){if(n.aggregationType==e.aggregationTypes.none)return!1;n.aggregationType==e.aggregationTypes.group?(t[n.id]||Vue.set(t,n.id,{title:n.title,groups:{},type:e.aggregationTypes.group}),t[n.id].groups[n.data]||Vue.set(t[n.id].groups,n.data,{id:n.id,data:n.data,count:0,active:e.isActiveFilter(n.id,n.data)}),t[n.id].groups[n.data].count++):n.aggregationType==e.aggregationTypes.sum&&(t[n.id]||Vue.set(t,n.id,{title:n.title,sum:0,type:e.aggregationTypes.sum}),t[n.id].sum+=parseFloat(n.data))})}),t}},methods:{isInt:function(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))},clearAllFilters:function(){Vue.set(this,"columnsFilters",{})},isActiveFilter:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);return!!n&&_.find(n,function(e){return e==t})},toggleFilterActive:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);n?_.find(n,function(e){return e==t})?n.$remove(t):n.push(t):Vue.set(this.columnsFilters,e,[t])},findColumnConfigById:function(e){return _.find(this.columnConfigs,function(t){if(t.id==e)return!0})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}})},function(e,t){Vue.component("installments-stats",{props:{installments:{required:!0}},ready:function(){},data:function(){var e={none:0,group:1,sum:2};return{aggregationTypes:e,columnConfigs:[{id:"s1",title:"Invoice",aggregationType:e.none,dataPath:"invoice.reference",default:"None",sortOrder:0},{id:"s2",title:"Invoice Status",aggregationType:e.group,dataPath:"invoice.status",default:"None",sortOrder:1},{id:"s3",title:"Subscription",aggregationType:e.group,dataPath:"subscription.plan.name",default:"None",sortOrder:2},{id:"s4",title:"Total",aggregationType:e.sum,dataPath:"invoice.total",default:0,sortOrder:3},{id:"s6",title:"Due",aggregationType:e.sum,dataPath:"invoice.balance",default:0,sortOrder:5},{id:"s7",title:"Due Date",aggregationType:e.none,dataPath:"due_date",default:"Unknown",sortOrder:6}],columnsFilters:{},showRows:!1}},computed:{headings:function(){var e=[];return _.forEach(this.columnConfigs,function(t,n){e.push({id:t.id,title:t.title,sortOrder:t.sortOrder,aggregationType:t.aggregationType})}),e},rows:function(){var e=this,t=[];return _.forEach(e.installments,function(n,i){var r={columns:[]};_.forEach(e.columnConfigs,function(t,i){var s=e.getNestedProperty(n,t.dataPath,t.default);r.columns.push({id:t.id,title:t.title,data:s,sortOrder:t.sortOrder,aggregationType:t.aggregationType})});var s=0;_.forEach(r.columns,function(t,n){var i=!1,r=0;_.forEach(e.columnsFilters,function(e,n){e.length>0&&t.id==n&&(r++,_.forEach(e,function(e,n){e==t.data&&(i=!0)}))}),r||(i=!0),i&&s++}),s==r.columns.length&&t.push(r)}),t},stats:function(){var e=this,t={};return _.forEach(e.rows,function(n,i){_.forEach(n.columns,function(n,i){if
1(n.aggregationType==e.aggregationTypes.none)return!1;n.aggregationType==e.aggregationTypes.group?(t[n.id]||Vue.set(t,n.id,{title:n.title,groups:{},type:e.aggregationTypes.group}),t[n.id].groups[n.data]||Vue.set(t[n.id].groups,n.data,{id:n.id,data:n.data,count:0,active:e.isActiveFilter(n.id,n.data)}),t[n.id].groups[n.data].count++):n.aggregationType==e.aggregationTypes.sum&&(t[n.id]||Vue.set(t,n.id,{title:n.title,sum:0,type:e.aggregationTypes.sum}),t[n.id].sum+=parseFloat(n.data))})}),t}},methods:{isInt:function(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))},clearAllFilters:function(){Vue.set(this,"columnsFilters",{})},isActiveFilter:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);return!!n&&_.find(n,function(e){return e==t})},toggleFilterActive:function(e,t){var n=this.getNestedProperty(this.columnsFilters,e,!1);n?_.find(n,function(e){return e==t})?n.$remove(t):n.push(t):Vue.set(this.columnsFilters,e,[t])},findColumnConfigById:function(e){return _.find(this.columnConfigs,function(t){if(t.id==e)return!0})},getNestedProperty:function(e,t,n){if(void 0===e||null==e)return n;var i=t.indexOf(".");return i>-1?this.getNestedProperty(e[t.substring(0,i)],t.substr(i+1),n):e[t]}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-invoice-pay",{props:{invoice:{required:!0},user:{required:!0},scriptendpoint:""},data:function(){return{redirect_form_key:[],instantlink:"",payment_token:"",instant_eft_success:!1,forms:{pay:$.extend(!0,new AppForm({busy:!1,paymentOption:"cc",card:null,terms:!1}),App.forms.pay)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},ready:function ready(){var _this=this;window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.pay.busy=!1,swal.close()},2e3)}catch(e){_this.forms.pay.busy=!1,swal.close()}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.pay.busy=!0,this.getEftLink())},addCard:function(){var e=this;this.newcard.return="/invoices/settle/"+this.invoice.id+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1,swal.close();else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},pay:function(){this.forms.pay.errors.forget(),this.forms.pay.busy=!0,this.sendPay()},sendPay:function(){var e=this;if(this.validate())if("eft"!=this.forms.pay.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.pay.paymentOption&&!this.forms.pay.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.pay.busy=!1);var t={terms:this.forms.pay.terms,card:this.forms.pay.card,paymentOption:this.forms.pay.paymentOption};this.processPayment(),this.$http.post("/invoices/settle/"+this.invoice.id,t).success(function(t){e.forms.pay.busy=!1,swal.close(),window.location="/dashboard/invoices"}).error(function(t){e.forms.pay.busy=!1,t&&t.errors&&t.errors.card?swal({type:"error",title:"Whoops",text:t.errors.card}):t&&t.message&&""!==t.message?swal({type:"error",title:"Whoops",text:t.message}):swal.close(),e.forms.pay.errors.set(t)})}else this.forms.pay.busy=!0},cancelPayment:function(){this.forms.pay.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={invoice:this.invoice.id},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");
1case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.pay.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.pay.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendPay()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.pay.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.pay.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendPay()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},validate:function(){return!!this.forms.pay.terms||(swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.pay.busy=!1,!1)}}})},function(e,t,n){var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};n(7).last;Vue.component("import-members-register-for-event",{props:{events:null,user:{required:!0},dietraies:[]},ready:function(){},data:function(){return{registerEvents:[{id:0,venues:"",pricings:"",eventsDate:[],extras:[],allExtras:[],dates:[],dietary:null,donations:0,totalGroupBookingUser:0,selectedEventId:"",selectedVenueId:"",selectedDateId:"",selectedPricingId:"",venueType:"",type:0,total:0,usedcoupon:null,couponApplied:!1,discounted_price:"",eventPriceDetails:[],selectedOption:"",selectedPrice:null,pricegroup:[],lastPrice:0,prices:[],selectedStaff:[],pendingMembers:[],pendingMembersEmails:[],members:[],selectedStaffCount:0,staffs:[],inviteStaff:!1,isComanySetup:!1,AttendTypeState:!1,addingMemberDetails:!1,selectedExtraId:[],is_new_feature:!0,company:{invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},errors:{company:[],invite:[]}}],index:0,currentId:0,generate_invoice:!1,busy:!1,eventYear:(new Date).getFullYear()}},watch:{"registerEvents[currentId].dietary":function(e,t){e&&(this.registerEvents[this.currentId].dietaryRequirement=this.dietraies.filter(function(t){return t.id==e})[0])}
1,"registerEvents[currentId].selectedPrice":function(e,t){t&&(this.registerEvents[this.currentId].lastPrice=t.discounted_new_price),e&&(0==this.registerEvents[this.currentId].prices.length?(this.registerEvents[this.currentId].prices.push(e.discounted_new_price),this.getPriceAfterApplyCoupon(e.price)===e.discounted_new_price&&(this.registerEvents[this.currentId].totalGroupBookingUser=1)):this.updatedPrices())},"registerEvents[currentId].type":function(e,t){if(e){var n=0;this.registerEvents[this.currentId].totalGroupBookingUser=0;for(var i=0;i<this.registerEvents[this.currentId].members.length;i++)this.registerEvents[this.currentId].members[i].email==this.user.email&&(n++,this.registerEvents[this.currentId].selectedPrice&&this.getPriceAfterApplyCoupon(this.registerEvents[this.currentId].selectedPrice.price)==this.registerEvents[this.currentId].selectedPrice.discounted_new_price&&(this.registerEvents[this.currentId].totalGroupBookingUser=1));0==n&&0==this.registerEvents[this.currentId].members.length&&(this.registerEvents[this.currentId].members.push({first_name:this.user.first_name,last_name:this.user.last_name,email:this.user.email,id_number:this.user.id_number,alternative_cell:this.user.alternative_cell,cell:this.user.cell}),this.registerEvents[this.currentId].prices=[],this.registerEvents[this.currentId].selectedPrice&&this.registerEvents[this.currentId].prices.push(this.registerEvents[this.currentId].selectedPrice.discounted_new_price),this.registerEvents[this.currentId].selectedPrice&&this.getPriceAfterApplyCoupon(this.registerEvents[this.currentId].selectedPrice.price)==this.registerEvents[this.currentId].selectedPrice.discounted_new_price&&(this.registerEvents[this.currentId].totalGroupBookingUser=1),this.registerEvents[this.currentId].staffs.push(this.user.id))}}},computed:{selectedEvent:function(){return this.getSelectedEvent()},selectedVenue:function(){return this.getSelectedVenue()},selectedPricing:function(){return this.getSelectedPricing()},currentIndex:function(){var e=this;return this.registerEvents.findIndex(function(t){return t.id==e.currentId})},getDiscountedPrice:function(){this.registerEvents[this.currentIndex].discounted_price=this.discount(this.selectedProduct.price,this.selectedProduct.listings[0].discount,this.selectedProduct.listings[0].discount_type)},total:function(){for(var e=0,t=0;t<this.registerEvents.length;t++)if(this.registerEvents[t].selectedPrice){if(1==this.registerEvents[t].type)var n=this.registerEvents[t].prices.reduce(function(e,t){return parseFloat(e)+parseFloat(t)},0),i=this.getTotalGroupBookingDiscount(t);else n=this.registerEvents[t].selectedPrice.discounted_new_price,i=0;var r=this.getTotalDiatry(t),s=this.getTotalExtras(t),o=this.getDonations(t),a=parseFloat(n)+parseFloat(r)+parseFloat(s)+parseFloat(o)-parseFloat(i);e+=a}return e.toFixed(2)}},methods:{changeEventSelection:function(e){this.currentId=e,this.registerEvents[e].selectedEventId&&(this.registerEvents[e].selectedDateId="",this.registerEvents[e].selectedVenueId="",this.registerEvents[e].selectedExtraId=[],this.registerEvents[e].pricings=0,this.registerEvents[e].venues=0,this.getVenues(e),this.registerEvents[e].eventsDate=[],this.registerEvents[e].selectedPricingId=0,this.registerEvents[e].venues=[],this.registerEvents[e].allExtras=[])},updateSinglePrice:function(e){this.singlePrice=e},updatedSelectedPriceDetails:function(e){var t=this;this.$http.get("pricing/details/"+this.registerEvents[e].selectedPricingId).then(function(n){t.registerEvents[e].selectedPrice=n.data})},changeVenueSelection:function(e){this.currentId=e,this.registerEvents[e].selectedDateId=this.selectedVenue.dates[0].id,this.registerEvents[e].venueType=this.selectedVenue.type,this.getPricings(e),this.getDates(e)},addEvent:function(){this.index=this.index+1;var e={id:this.index,venues:"",pricings:"",dates:[],extras:[],allExtras:[],dietary:null,donations:0,selectedEventId:"",totalGroupBookingUser:0,selectedVenueId:"",selectedDateId:"",selectedPricingId:"",venueType:"",type:0,usedcoupon:null,dietaryRequirement:"",couponApplied:!1,discounted_price:"",eventPriceDetails:[],selectedOption:"",selectedPrice:null,pricegroup:[],lastPrice:0,prices:[],selectedStaff:[],pendingMembers:[],pendingMembersEmail
1s:[],members:[],selectedStaffCount:0,selectedExtraId:[],staffs:[],inviteStaff:!1,isComanySetup:!1,AttendTypeState:!1,addingMemberDetails:!1,is_new_feature:!0,company:{invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},errors:{company:[],invite:[]}};this.registerEvents=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this.registerEvents),[e])},registerData:function(){var e=this,t=this.registerEvents.filter(function(e){return parseInt(e.selectedEventId)>0}).map(function(e){return i({},e,{dates:e.dates.filter(function(t){return t.id===e.selectedDateId})})});this.busy=!0,swal({type:"warning",title:"Processing order",text:"Please wait while we are generating order.Do not Refresh page or close browser"}),this.$http.post("/admin/validate/users",{eventsObject:t,type:"BookEvent"}).success(function(n){if(0==n.data.length)e.$http.post("/admin/member/"+e.user.id+"/events/register",{eventsObject:t,generate_invoice:e.generate_invoice}).then(function(e){this.busy=!1,swal({type:"success",title:"Success",text:"Your order has successfully processed"}),window.location.reload()});else{var i=n.data.join(",");e.busy=!1,swal({type:"error",title:"Error",text:i})}}).catch(function(t){e.busy=!1,swal({type:"error",title:"Error",text:"Your order has failed, please try again"})})},getEventById:function(e){return _.find(this.events,{id:e})},getSelectedEvent:function(){return this.getEventById(this.registerEvents[this.currentIndex].selectedEventId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getSelectedVenue:function(){return this.getVenueById(this.registerEvents[this.currentIndex].selectedVenueId)},dateChanged:function(e){this.registerEvents[e].dates.length>this.registerEvents[e].selectedPrice.day_count&&(this.registerEvents[e].dates=_.slice(this.registerEvents[e].dates,1))},getVenues:function(e){var t=this;this.$http.get("find/"+this.registerEvents[e].selectedEventId+"/venues").then(function(n){t.registerEvents[e].venues=n.data.venues,t.registerEvents[e].selectedVenueId=n.data.venues[0].id,t.registerEvents[e].venueType=n.data.venues[0].type,t.getPricings(e),t.registerEvents[e].pricegroup=n.data.pricegroup,t.getDates(e)})},getPricings:function(e){var t=this;this.$http.get("find/"+this.registerEvents[e].selectedVenueId+"/pricings").then(function(n){t.registerEvents[e].pricings=n.data.pricings,t.registerEvents[e].eventPriceDetails=n.data.pricings,t.registerEvents[e].selectedPricingId=n.data.pricings[0].id,t.registerEvents[e].selectedPrice=n.data.pricings[0]})},getPriceCalculartion:function(e,t,n,i){currentPriceId=this.registerEvents[i].selectedPricingId;var r,s=_.filter(this.registerEvents[i].eventPriceDetails,function(e){return e.id==currentPriceId})[0].price,o=0,a=s;for(0==t&&(t=e),i=2;i<=e;i++)for(r=0;r<this.registerEvents[i].pricegroup.length;r++)i>=this.registerEvents[i].pricegroup[r].min_user&&i<=this.registerEvents[i].pricegroup[r].max_user&&(o=this.registerEvents[i].pricegroup[r].discount,a-=Math.round(a*o/100));for(i=2;i<=t;i++)for(r=0;r<this.registerEvents[i].pricegroup.length;r++)i>=this.registerEvents[i].pricegroup[r].min_user&&i<=this.registerEvents[i].pricegroup[r].max_user&&(o=this.registerEvents[i].pricegroup[r].discount,s-=Math.round(s*o/100));return t==e?"From "+s+" per person":"From "+a+" - "+s+" per person"},getDates:function(e){var t=this;this.$http.get("find/"+this.registerEvents[e].selectedVenueId+"/dates").then(function(n){t.registerEvents[e].eventsDate=n.data.dates,t.registerEvents[e].selectedDateId=t.registerEvents[e].eventsDate[0].id,t.registerEvents[e].allExtras=t.selectedEvent.extras})},discount:function(e,t,n){return"percentage"==n?parseFloat(e*(t/100)):t},applyCouponCode:function(){var e=this,t=this.registerEvents[this.currentIndex].selectedEventId,n={type:"event",event_name:this.registerEvents[this.currentIndex].name,code:this.Couponcode};this.$http.post("/check/"+t,n).then(function(t){1==t.data.status?(!0,e.couponApplied=!0,swal({type:"success",title:"Coupon Code",text:t.data.message})):swal({type:"error",title:"Error",text:t.data.message})})},setDietary:function(){this.dietaryRequirement=this.dietary[0]},setMembers:function(){this.members=this.staff},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.eventSignup.staffs=this.selectedStaff},toggleStaff:function(e){this.registerEvents[e].inviteStaff?this.registerEvents[e].inviteStaff=!1:this.registerEvents[e].inviteStaff=!0},cancelInvite:function(e){this.registerEvents[e].company.invite.first_name="",this.registerEvents[e].company.invite.last_name="",this.registerEvents[e].company.invite.email="",this.registerEvents[e].company.invite.id_number="",this.registerEvents[e].company.invite.alternative_cell="",this.registerEvents[e].company.invite.cell="",this.registerEvents[e].addingMemberDetails=!1,this.registerEvents[e].inviteStaff=!1},checkInviteMember:function(e){return""==this.registerEvents[e].company.invite.first_name&&(this.registerEvents[e].errors.invite.first_name="First name is required"),""==this.registerEvents[e].company.invite.last_name&&(this.registerEvents[e].errors.invite.last_name="Last name is required"),""==this.registerEvents[e].company.invite.email&&(this.registerEvents[e].errors.invite.email="Email is required"),""==this.registerEvents[e].company.invite.cell&&(this.registerEvents[e].errors.invite.cell="Cell is required"),!(this.registerEvents[e].errors.invite.cell||this.registerEvents[e].errors.invite.first_name||this.registerEvents[e].errors.invite.last_name||this.registerEvents[e].errors.invite.email)||(swal({type:"warning",title:"Fill all the fields"}),this.registerEvents[e].errors.invite.cell="",this.registerEvents[e].errors.invite.first_name="",this.registerEvents[e].errors.invite.last_name="",this.registerEvents[e].errors.invite.email="",!1)},sendInvitation:function(e){this.checkInviteMember(e)&&(this.registerEvents[e].pendingMembersEmails.includes(this.registerEvents[e].company.invite.email)?swal({type:"warning",title:"This member is already added"}):(this.registerEvents[e].pendingMembersEmails.push(this.registerEvents[e].company.invite.email),this.registerEvents[e].pendingMembers.push({first_name:this.registerEvents[e].company.invite.first_name,last_name:this.registerEvents[e].company.invite.last_name,email:this.registerEvents[e].company.invite.email,id_number:this.registerEvents[e].company.invite.id_number,alternative_cell:this.registerEvents[e].company.invite.alternative_cell,cell:this.registerEvents[e].company.invite.cell}),this.registerEvents[e].members.push({first_name:this.registerEvents[e].company.invite.first_name,last_name:this.registerEvents[e].company.invite.last_name,email:this.registerEvents[e].company.invite.email,id_number:this.registerEvents[e].company.invite.id_number,alternative_cell:this.registerEvents[e].company.invite.alternative_cell,cell:this.registerEvents[e].company.invite.cell}),this.registerEvents[e].staffs.push({first_name:this.registerEvents[e].company.invite.first_name,last_name:this.registerEvents[e].company.invite.last_name,email:this.registerEvents[e].company.invite.email,id_number:this.registerEvents[e].company.invite.id_number,alternative_cell:this.registerEvents[e].company.invite.alternative_cell,cell:this.registerEvents[e].company.invite.cell}),this.registerEvents[e].company.invite.first_name="",this.registerEvents[e].company.invite.last_name="",this.registerEvents[e].company.invite.email="",this.registerEvents[e].company.invite.id_number="",this.registerEvents[e].company.invite.alternative_cell="",this.registerEvents[e].company.invite.cell="",this.registerEvents[e].addingMemberDetails=!1,this.registerEvents[e].prices.push(this.getPriceAfterApplyCoupon(this.registerEvents[e].selectedPrice.price)),this.registerEvents[e].totalGroupBookingUser+=1))},checkAndFillMember:function(e){var t=this;if(""==this.registerEvents[e].invite_email||!this.isValidEmail(this.registerEvents[e].invite_email))return swal({type:"warning",title:"Please enter valid email"}),this.registerEvents[e].invite_email="",!1;var n=this.registerEvents[e].invite_email,i=!1;if(this.registerEvents[e].members.forEach(function(e,t){e.email==n&&(i=!0)}),i)return swal({type:"warning",title:"Given Email Is Already Added",text:"Try To Add Other Email"}),this.registerEvents[e].inviteStaff=!1,this.registerEvents[e].invite_email="",!1;this.$http.post("/checkuser",{email:this.registerEvents[e].invite_email,event_id:this.registerEvents[e].selectedEventId,price_id:this.registerEvents[e].selectedPricingId}).success(function(n){"success"==n.status?n.hasTicket?swal({type:"warning",title:"User already registered for this event",text:"Try To Add Other Email"}):(t.registerEvents[e].members.push(n.member),t.registerEvents[e].staffs.push(n.member.id),t.registerEvents[e].prices.push(n.member.price),t.getPriceAfterApplyCoupon(t.registerEvents[e].selectedPrice.price)==n.member.price&&(t.registerEvents[e].totalGroupBookingUser+=1)):(t.registerEvents[e].company.invite.email=t.registerEvents[e].invite_email,t.registerEvents[e].addingMemberDetails=!0),t.registerEvents[e].inviteStaff=!1,t.registerEvents[e].invite_email=""}).catch(function(e){})},isValidEmail:function(e){return/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,}$/.test(e)},removeMember:function(e,t){var n;
1this.registerEvents[t].members.forEach(function(t,i){t.email==e.email&&(n=i)}),this.registerEvents[t].prices[n]==this.getPriceAfterApplyCoupon(this.registerEvents[t].selectedPrice.price)&&(this.totalGroupBookingUser-=1),this.registerEvents[t].members.splice(n,1),this.registerEvents[t].prices.splice(n,1),this.registerEvents[t].staffs.splice(n,1),this.registerEvents[t].pendingMembers.splice(n,1),this.registerEvents[t].pendingMembersEmails.splice($.inArray(e.email,this.registerEvents[t].pendingMembersEmails),1)},getTotalPricing:function(){if(!this.registerEvents[this.currentIndex].selectedPrice)return 0;var e=this.registerEvents[this.currentIndex].selectedPrice.price;if(this.registerEvents[this.currentIndex].totalGroupBookingUser>0&&1==this.registerEvents[this.currentIndex].type){if(this.registerEvents[this.currentIndex].pricegroup.length>0&&this.registerEvents[this.currentIndex].totalGroupBookingUser>1){for(var t=e,n=0,i=this.registerEvents[this.currentIndex].totalGroupBookingUser,r=2;r<=i;r++)for(var s=0;s<this.registerEvents[this.currentIndex].pricegroup.length;s++){if(r>=this.registerEvents[this.currentIndex].pricegroup[s].min_user&&r<=this.registerEvents[this.currentIndex].pricegroup[s].max_user)n=this.registerEvents[this.currentIndex].pricegroup[s].discount,t-=Math.round(t*n/100)}e=t}e*=this.registerEvents[this.currentIndex].totalGroupBookingUser}return 1==this.registerEvents[this.currentIndex].type&&0==this.registerEvents[this.currentIndex].totalGroupBookingUser&&(e=0),e},getTotalDiatry:function(e){return null!=this.registerEvents[e].dietary&&this.registerEvents[e].dietary.price>0?(totalDiatry=this.registerEvents[e].dietary.price,this.registerEvents[e].dates.length>1&&(totalDiatry*=this.registerEvents[e].dates.length),this.registerEvents[e].staffs.length>0&&1==this.registerEvents[e].type&&(totalDiatry*=this.registerEvents[e].staffs.length),1==this.registerEvents[e].type&&0==this.registerEvents[e].staffs.length&&(totalDiatry=0),totalDiatry):0},getTotalExtras:function(e){var t=0;return this.registerEvents[e].extras.forEach(function(e){t=parseInt(t)+parseInt(e.price)}),this.registerEvents[e].staffs.length>0&&1==this.registerEvents[e].type&&(t*=this.registerEvents[e].staffs.length),1==this.registerEvents[e].type&&0==this.registerEvents[e].staffs.length&&(t=0),t},getDonations:function(e){var t=0;return this.registerEvents[e].donations&&(t=this.registerEvents[e].donations),t},getTotalGroupBookingDiscount:function(e){var t=0;if(!this.registerEvents[e].selectedPrice)return 0;var n=this.getPriceAfterApplyCoupon(this.registerEvents[e].selectedPrice.price),i=n;if(this.registerEvents[e].totalGroupBookingUser>0&&1==this.registerEvents[e].type&&this.registerEvents[e].pricegroup.length>0&&this.registerEvents[e].totalGroupBookingUser>1)for(var r=this.registerEvents[e].totalGroupBookingUser,s=2;s<=r;s++)for(var o=0;o<this.registerEvents[e].pricegroup.length;o++){if(s>=this.registerEvents[e].pricegroup[o].min_user&&s<=this.registerEvents[e].pricegroup[o].max_user)i-=i*this.registerEvents[e].pricegroup[o].discount/100}return t=parseFloat(n-i)*this.registerEvents[e].totalGroupBookingUser,1==this.registerEvents[e].type&&0==this.registerEvents[e].totalGroupBookingUser&&(t=0),t.toFixed(2)},updatedPrices:function(){for(var e=this,t=function(t){e.$http.post("/get_price_details",{staffs:e.registerEvents[t].staffs,price_id:e.registerEvents[t].selectedPricingId}).success(function(n){e.registerEvents[t].totalGroupBookingUser=0,e.registerEvents[t].prices=[];for(var i=0;i<n.length;i++)e.registerEvents[t].prices.push(n[i]),e.getPriceAfterApplyCoupon(e.registerEvents[t].selectedPrice.price)==n[i]&&(e.registerEvents[t].totalGroupBookingUser+=1)}).catch(function(e){})},n=0;n<this.registerEvents.length;n++)t(n)},getPriceAfterApplyCoupon:function(e){if(null!=this.registerEvents[this.currentIndex].usedcoupon&&""!=this.registerEvents[this.currentIndex].usedcoupon&&void 0!=this.registerEvents[this.currentIndex].usedcoupon){if("percentage"==this.registerEvents[this.currentIndex].usedcoupon.discount_type){var t=e*this.registerEvents[this.currentIndex].usedcoupon.discount_amount/100;return parseFloat(e)-parseFloat(t)}return parseFloat(e)-parseFloat(this.registerEvents[this.currentIndex].usedcoupon.discount_amount)}return parseFloat(e)},changeEventYear:function(){var e=this;this.$http.get("/get_event_by_year/"+this.eventYear).success(function(t){e.events=t}).catch(function(e){})}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__),__WEBPACK_IMPORTED_MODULE_1_moment__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_moment___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__),_methods;function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-subscriptions-screen",{props:{plans:null,staff:null,user:null,profession:null,companys:null,upgrade:"",bank_codes:null,donations:{required:!1,default:!1},input_plan_id:null,subscriptions:null,currentPlanPrice:0,scriptendpoint:""},data:function(){return{redirect_form_key:[],selectedPlan:null,selectedFeatures:[],selectedStaff:[],selectedStaffCount:0,customFeatures:[],filterPlan:[],selectedRoute:"",instantlink:"",payment_token:"",instant_eft_success:!1,is_practice_plan:!1,inviteStaff:!1,planTypeState:!1,isComanySetup:!1,otp:null,waiting_on_otp:!1,requested_otp:!1,id_number:"",id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",errors:{company:[],invite:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},forms:{subscription:$.extend(!0,new AppForm({busy:!1,bf:!1,plan:"",pricing_group:[],terms:!1,is_upgrade:!1,immediately:!1,paymentOption:"cc",pi_cover:!1,features:[],staff:[],card:null,donations:0,debit:{bank:"",bank_temp:"",account_number:"",account_type:"",branch_name:"",branch_code:"",billable_date:"",account_holder:"",id_number:"",registration_number:"",type_of_account:"",otp:""}}),App.forms.subscription)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.getConfig(),this.input_plan_id&&(this.selectedPlan=this.plans.filter(function(e){return e.id==parseInt(_this.input_plan_id)})[0],this.forms.subscription.plan=this.selectedPlan.id),this.companyId=this.companys.length>0?this.companys[0].id:0;var queryString=URI(document.URL).query(!0);window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.subscription.busy=!1,swal.close()},2e3)}catch(e){_this.forms.subscription.busy=!1}})},watch:{selectedStaffLength:function(e){e>0&&this.selectedPlanIsYearly&&this.forms.subscription.terms&&setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},paymentOption:function(e){var t=this;"debit"==e&&this.forms.subscription.is_upgrade&&swal({title:"Are you Want to upgrade immediately?",text:"Are you interested in changing your subscription plan? Click immediately and your debit order will proceed soon?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"immediately",cancelButtonText:"Regaular",closeOnConfirm:!1},function(e){e&&(t.forms.subscription.immediately=!0,swal.close())})}},computed:{pastDebitDateSelected:function(){return!!this.forms.subscription.debit.billable_date&&(__WEBPACK_IMPORTED_MODULE_1_moment___default()().date()>=this.forms.subscription.debit.billable_date||void 0)},otpCorrect:function(){return null!=this.otp&&this.otp==this.forms.subscription.debit.otp},countSelectedFeatures:function(){return this.selectedFeatures.length},getMaxFeatures:function(){return this.selectedPlan.max_no_of_features},canSelectMoreFeatures:function(){var e=this.selectedPlan.max_no_of_features;return this.countSelectedFeatures<e||0==e||(swal({type:"success",title:"Good job!",text:"You have selected "+e+" Topics, Please proceed or clear your selection to reselect."}),!1)},selectedStaffLength:function(){return this.selectedStaff.length},paymentOption:function(){return this.forms.subscription.paymentOption},plansAreLoaded:function(){return this.plans.length>=0},defaultPlans:function(){return this.plans.length>=1?this.monthlyPlans.length>0?this.monthlyPlans:this.yearlyPlans.length>0?this.yearlyPlans:void 0:this.plans[1]},monthlyPlans:function(){return _.filter(this.plans,function(e){return"month"==e.interval}).sort(function(e,t){return t.price-e.price})},yearlyPlans:function(){return _.filter(this.plans,function(e){return"year"==e.interval}).sort(function(e,t){return t.price-e.price})},freePlanIsSelected:function(){return this.selectedPlan&&this.selectedPlan.price<=0},shouldShowDefaultPlans:function(){return!this.planTypeState},shouldShowYearlyPlans:function(){return this.planTypeState},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.subscription.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0},debitOrderDetailsCompleted:function(){return"company"===this.forms.subscription.debit.type_of_account?""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.registration_number:""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.id_number}},mounted:function(){this.loadPeachScript()},methods:(_methods={bankNameChanged:function(){var e=this.forms.subscription.debit.bank_temp,t=""!=e?this.bank_codes[e]:"";this.forms.subscription.debit.branch_code=this.forms.subscription.debit.bank_temp,this.forms.subscription.debit.bank=t},SendMail:function(e){swal("Thanks! Our sales consultants will contact you"),this.$http.post("/dashboard/contact_email",{id:e.id}).success(function(e){})},getConfig:function(){var e=this;this.$http.get("/api/getMyCustomConfig").then(function(t){e.customFeatures=t.data})},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},createCompany:function(){var e=this;this.$http.post("/dashboard/company/saveCompany",{title:this.company.detail.title,company_vat:this.company.detail.company_vat,plan:this.company.detail.plan,plan_id:this.company.detail.plan_id,user_id:this.company.detail.user_id,employees:this.company.detail.employees,address_line_one:this.company.detail.address_line_one,address_line_two:this.company.detail.address_line_two,province:this.company.detail.province,city:this.company.detail.city,area_code:this.company.detail.area_code,country:this.company.detail.country}).success(function(t){e.companys.push(t),e.companyId=t.id}).catch(function(t){e.errors.company=t.data}),console.log(this.company.detail)},loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.subscription.busy=!0,this.selectedStaff.length==this.selectedStaffCount&&this.getEftLink())},sendInvitation:function(){var e=this;this.$http.post("/dashboard/company/store_invite",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,id_number:this.company.invite.id_number,cell:this.company.invite.cell,check_users:!0,company_id:this.companyId}).success(function(t){e.staff.push(t.staff),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data})},addCard:function(){var e=this;this.newcard.return="/"+window.location.pathname+"?threeDs=yes&plan="+this.forms.subscription.plan,this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},selectPlan:function(e){this.setSelectedPlan(e),this.plans.length>=2&&window.scrollTo({}),!this.is_practice_plan&&e.pricing_group>=0&&setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},changePlanPopup:function(e){var t=this;if(t.subscriptions&&parseFloat(t.subscriptions.price)<=0)return t.forms.subscription.is_upgrade=!0,t.selectPlan(e),!1;t.subscriptions&&parseFloat(t.subscriptions.price)>0&&swal({title:"Are you sure?",text:"Are you interested in changing your subscription plan? Click okay and one of our sales consultants will contact you?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",closeOnConfirm:!1},function(n){n&&t.SendMail(e)})},selectEft:function(){setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},setSelectedPlan:function(e){this.selectedPlan=e,this.forms.subscription.plan=e.id,this.forms.subscription.pricing_group=e.pricing_group},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.subscription.staff=this.selectedStaff},getPlanPrice:function(){if(this.forms.subscription.pricing_group&&this.forms.subscription.pricing_group.length>0){var e=parseInt(this.selectedStaff.length)+parseInt(1),t=_.max(this.forms.subscription.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.forms.subscription.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e>=i)return n}return 0==n.length&&e>t?_.filter(this.forms.subscription.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.forms.subscription.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},selectAnotherPlan:function(){this.cancelPayment(),this.selectedPlan=null,this.clearSelectedFeatures(),this.clearselectedStaff(),this.forms.subscription.plan="",this.forms.subscription.paymentOption="cc",this.forms.subscription.card=null,this.forms.subscription.debit={}},clearSelectedFeatures:function(){this.selectedFeatures=[]},clearselectedStaff:function(){this.selectedStaff=[]},register:function(){if(this.selectedPlan.is_practice&&this.selectedPlan.pricing_group&&this.selectedPlan.pricing_group.length>0){var e=_.min(this.selectedPlan.pricing_group.map(function(e){return e.min_user})),t=parseInt(this.selectedStaff.length)+parseInt(1);if(t<e)return void swal({type:"warning",title:"Select more Staff Members",text:"You have only selected ("+t+") staff Members You need to add Minimum ("+e+") staff Members for your subscription package."})}this.selectedPlan.is_custom&&this.selectedFeatures.length<this.selectedPlan.max_no_of_features?swal({type:"warning",title:"Select more topics",text:"You have only selected ("+this.selectedFeatures.length+"/"+this.selectedPlan.max_no_of_features+") required Topics for your subscription package."}):(this.forms.subscription.errors.forget(),this.forms.subscription.staff=this.selectedStaff,this.forms.subscription.busy=!0,this.sendRegistration())},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.showModal=!0,e.next=3,this.loadPeachScript();case 3:this.$http.post("/instant-eft",{staffs:this.forms.subscription.staff,plan:this.selectedPlan.id,bf:this.forms.subscription.bf,donation_amount:this.getDonations()}).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(n){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=n.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return t.checkoutId=i.checkoutId,t.entityId=i.entityId,t.selectedStaffCount=t.forms.subscription.staff.length,e.next=8,t.$nextTick();case 8:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),t.initCheckout()},300);case 10:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var n="Unable to process your request!";422==e.status&&(n=e.data.message),swal({type:"warning",title:"Error",text:n,showConfirmButton:!0}),t.forms.subscription.busy=!1});case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;if(this.selectedPlan.is_practice&&this.selectedPlan.pricing_group&&this.selectedPlan.pricing_group.length>0){var t=_.min(this.selectedPlan.pricing_group.map(function(e){return e.min_user})),n=parseInt(this.selectedStaff.length)+parseInt(1);if(n<t)return void swal({type:"warning",title:"Select more Staff Members",text:"You have only selected ("+n+") staff Members You need to add Minimum ("+t+") staff Members for your subscription package."})}window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.subscription.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.subscription.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.subscription.busy=!1}}}).render("#payment-form")}},_defineProperty(_methods,"SendMail",function(e){swal("Thanks! Our sales consultants will contact you"),this.$http.post("/dashboard/contact_email",{id:e.id}).success(function(e){})}),_defineProperty(_methods,"cancelPayment",function(){this.forms.subscription.busy=!1}),_defineProperty(_methods,"beginCheckout",function(){window.dataLayer=window.dataLayer||[];var e=[],t=this.getSubscriptionTotal(),n=parseInt(this.selectedStaff.length)+1;e.push({item_id:String(this.selectedPlan.id),item_name:this.selectedPlan.name,item_category:"Subscription",price:parseFloat(t.toFixed(2)),quantity:n}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(t).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})}),_defineProperty(_methods,"sendTransactions",function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>
10&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Subscription",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})}),_defineProperty(_methods,"getSubscriptionTotal",function(){if(!this.selectedPlan)return 0;var e=parseInt(this.selectedStaff.length)+1,t=this.forms.subscription.bf?parseFloat(this.selectedPlan.bf_price):parseFloat(this.selectedPlan.price),n=this.selectedPlan.pricing_group||[];if(n.length>0){t*=e,n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<=e&&r>=e&&(t=parseFloat(n.price)*e)});var i=Math.max.apply(null,n.map(function(e){return parseInt(e.max_user)}));if(e>i){var r=n.find(function(e){return parseInt(e.max_user)===i});r&&(t=parseFloat(r.price)*e)}n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<e&&0===r&&(t=parseFloat(n.price)*e)})}var s=parseFloat(this.getDonations())||0;return parseFloat((t+s).toFixed(2))}),_defineProperty(_methods,"getPaymentMethod",function(){return"cc"==this.forms.subscription.paymentOption?"Credit Card":"eft"==this.forms.subscription.paymentOption?"Instant EFT":""}),_defineProperty(_methods,"sendRegistration",function(){var e=this;if(this.validate()){if("eft"==this.forms.subscription.paymentOption&&0==this.instant_eft_success)return this.startListener(),this.forms.subscription.busy=!0,void swal({type:"warning",title:"Waiting on Payment",text:"We're waiting for payment confirmation, please do not close this page."});if("cc"==this.forms.subscription.paymentOption&&!this.forms.subscription.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.debitOrderDetailsCompleted)return swal({type:"warning",title:"Error",text:"Debit order details not completed"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.requested_otp){var t={account_number:this.forms.subscription.debit.account_number,branch_code:this.forms.subscription.debit.branch_code},n=!1;if(this.$http.post("/peach/validate",t).then(function(t){return"Valid"!=t.data.Result?void swal({type:"error",title:"Invalid Account Details",text:"Ensure that you have filled out your information correctly and try again."}):(n=!0,e.requestOTP())}).catch(function(e){console.log(e)}),!n)return void(this.forms.subscription.busy=!1)}if("debit"==this.forms.subscription.paymentOption&&!this.otpCorrect)return swal({type:"error",title:"Invalid OTP",text:"The OTP number you have entered is invalid, please try again."}),void(this.forms.subscription.busy=!1);this.selectedFeatures.length>0&&this.selectedPlan.is_custom&&(this.selectedFeatures.push(this.customFeatures),this.forms.subscription.features=this.selectedFeatures),this.selectedStaff.length>0&&(this.forms.subscription.staff=this.selectedStaff),this.beginCheckout(),this.processPayment();var i=this.forms.subscription;i.donations=this.getDonations(),this.$http.post("/subscriptions",i).success(function(t){e.forms.subscription.busy=!1,swal.close();var n="/dashboard/general";e.forms.subscription.pi_cover&&(n="/insurance"),void 0!==t.invoice&&e.sendTransactions(t.invoice),window.location=n}).error(function(t){swal.close(),e.selectedFeatures.$remove(e.customFeatures),e.forms.subscription.busy=!1,e.forms.subscription.errors.set(t)})}}),_defineProperty(_methods,"requestOTP",function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,e.requested_otp=!0,e.waiting_on_otp=!0,swal.close()})}),_defineProperty(_methods,"resendOtp",function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})}),_defineProperty(_methods,"startListener",function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})}),_defineProperty(_methods,"getPlanColumnWidth",function(e){switch(e){case 1:return"col-md-6 col-md-offset-3";case 2:return"col-md-6";case 3:return"col-md-4";case 4:return"col-md-3";case 5:return"col-md-5th";case 7:return"col-md-4";case 8:return"col-md-3";default:return"col-md-4"}}),_defineProperty(_methods,"process",function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}),_defineProperty(_methods,"updateDebitOrderDate",function(){var e=(new Date).getDate();this.forms.subscription.debit.billable_date<e?swal({title:"Debit Order",text:"Due to your selected date is past away. So, Your debit order will be run next month your selected date Wait until the debit order runs, (you will need to wait up to 5 working days to get access once the debit order has successfully run for current month \n Please select next day debit order to get instant access or Select credit card or Instant EFT payment to get instant access",type:"warning",showCancelButton:!0,confirmButtonColor:"#007AFF",confirmButtonText:"Next Day Debit Order!",cancelButtonText:"Select Other Payment Method",closeOnConfirm:!0},function(){$("input[name=bill_at_next_available_date]").val("1").trigger("change")}):swal({title:"Debit Order",text:"Wait until the debit order runs on your selected date, (you will need to wait up to 5 working days to get access once the debit order has successfully run for current month \n Please select next day debit order to get instant access or Select credit card or Instant EFT payment to get instant access",type:"warning",showCancelButton:!0,confirmButtonColor:"#007AFF",confirmButtonText:"Next Day Debit Order!",closeOnConfirm:!0},function(){$("input[name=bill_at_next_available_date]").val("0").trigger("change")})}),_defineProperty(_methods,"getDonations",function(){var e=0;return this.forms.subscription.donations&&this.selectedPlanIsYearly&&(e=this.donations),e}),_defineProperty(_methods,"buynow",function(e){$.cookie("plan",e.id),$.cookie("pathName",window.location.pathname),window.location="auth/login"}),_defineProperty(_methods,"validate",function(){if(!this.forms.subscription.terms)return swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.subscription.busy=!1,!1;if(this.forms.subscription.donations){if(""==this.id_number)return swal({type:"warning",title:"Error",text:"Please enter id number"}),this.forms.subscription.busy=!1,!1;if(""==this.id_type)return swal({type:"warning",title:"Error",text:"Please enter valid id type"}),this.forms.subscription.busy=!1,!1;if(""==this.country_of_issue)return swal({type:"warning",title:"Error",text:"Please select valid country"}),this.forms.subscription.busy=!1,!1;if(""==this.incometax_reference_number)return swal({type:"warning",title:"Error",text:"Please select valid income tax reference number!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_name)return swal({type:"warning",title:"Error",text:"Please enter valid company name!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_registrations_number)return swal({type:"warning",title:"Error",text:"Please enter company registration number"}),this.forms.subscription.busy=!1,!1;if(""==this.date_of_birth)return swal({type:"warning",title:"Error",text:"Please select date of birth"}),this.forms.subscription.busy=!1,!1;if(""==this.postal_address)return swal({type:"warning",title:"Error",text:"Please enter valid postal address"}),this.forms.subscription.busy=!1,!1;if(""==this.post_code)return swal({type:"warning",title:"Error",text:"Please enter valid postal code"}),this.forms.subscription.busy=!1,!1}return!0}),_methods)})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__),__WEBPACK_IMPORTED_MODULE_1_moment__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_moment___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__),_methods;function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-single-subscriptions-screen",{props:{plans:null,staff:null,user:null,subscriptions:null,profession:null,companys:null,upgrade:"",input_plan_id:null,scriptendpoint:""},data:function(){return{redirect_form_key:[],selectedPlan:null,selectedFeatures:[],selectedStaff:[],selectedStaffCount:0,customFeatures:[],filterPlan:[],selectedRoute:"",instantlink:"",payment_token:"",instant_eft_success:!1,is_practice_plan:!1,inviteStaff:!1,planTypeState:!1,isComanySetup:!1,otp:null,waiting_on_otp:!1,requested_otp:!1,id_number:"",id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",errors:{company:[],invite:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},forms:{subscription:$.extend(!0,new AppForm({busy:!1,bf:!1,plan:"",pricing_group:[],terms:!1,is_upgrade:!1,immediately:!1,donations:0,paymentOption:"cc",pi_cover:!1,features:[],staff:[],card:null,debit:{bank:"",account_number:"",account_type:"",branch_name:"",branch_code:"",billable_date:"",account_holder:"",id_number:"",registration_number:"",type_of_account:"",otp:""}}),App.forms.subscription)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.input_plan_id&&(this.selectedPlan=this.plans.filter(function(e){return e.id==parseInt(_this.input_plan_id)})[0],this.forms.subscription.plan=this.selectedPlan.id),this.getConfig(),this.companyId=this.companys.length>0?this.companys[0].id:0;var queryString=URI(document.URL).query(!0);window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.subscription.busy=!1,swal.close()},2e3)}catch(e){_this.forms.subscription.busy=!1}});var Selectplans=$.cookie("plan"),selectedP=_.filter(this.plans,function(e){return e.id==Selectplans});selectedP.length>0&&(this.selectPlan(selectedP[0]),$.cookie("plan",null),$.cookie("pathName",null))},watch:{selectedStaffLength:function(e){e>0&&this.selectedPlanIsYearly&&setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},paymentOption:function(e){var t=this;"debit"==e&&this.forms.subscription.is_upgrade&&swal({title:"Are you Want to upgrade immediately?",text:"Are you interested in changing your subscription plan? Click immediately and your debit order will proceed soon?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"immediately",cancelButtonText:"Regaular",closeOnConfirm:!1},function(e){e&&(t.forms.subscription.immediately=!0,swal.close())})}},computed:{pastDebitDateSelected:function(){return!!this.forms.subscription.debit.billable_date&&(__WEBPACK_IMPORTED_MODULE_1_moment___default()().date()>=this.forms.subscription.debit.billable_date||void 0)},otpCorrect:function(){return null!=this.otp&&this.otp==this.forms.subscription.debit.otp},countSelectedFeatures:function(){return this.selectedFeatures.length},getMaxFeatures:function(){return this.selectedPlan.max_no_of_features},canSelectMoreFeatures:function(){var e=this.selectedPlan.max_no_of_features;return this.countSelectedFeatures<e||0==e||(swal({type:"success",title:"Good job!",text:"You have selected "+e+" Topics, Please proceed or clear your selection to reselect."}),!1)},selectedStaffLength:function(){return this.selectedStaff.length},paymentOption:function(){return this.forms.subscription.paymentOption},plansAreLoaded:function(){return this.plans.length>=0},defaultPlans:function(){return this.plans.length>=1?this.monthlyPlans.length>0?this.monthlyPlans:this.yearlyPlans.length>0?this.yearlyPlans:void 0:this.plans[1]},monthlyPlans:function(){return _.filter(this.plans,function(e){return"month"==e.interval}).sort(function(e,t){return t.price-e.price})},yearlyPlans:function(){return _.filter(this.plans,function(e){return"year"==e.interval}).sort(function(e,t){return t.price-e.price})},freePlanIsSelected:function(){return this.selectedPlan&&this.selectedPlan.price<=0},shouldShowDefaultPlans:function(){return!this.planTypeState},shouldShowYearlyPlans:function(){return this.planTypeState},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.subscription.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0},debitOrderDetailsCompleted:function(){return"company"===this.forms.subscription.debit.type_of_account?""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.registration_number:""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.id_number}},mounted:function(){this.loadPeachScript()},methods:(_methods={changePlanPopup:function(e){var t=this;if(t.subscriptions&&parseFloat(t.subscriptions.price)<parseFloat(e.price))return t.forms.subscription.is_upgrade=!0,t.selectPlan(e),!1;t.subscriptions&&parseFloat(t.subscriptions.price)>=parseFloat(e.price)&&swal({title:"Are you sure?",text:"Are you interested in changing your subscription plan? Click okay and one of our sales consultants will contact you?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",closeOnConfirm:!1},function(n){n&&t.SendMail(e)})},buynow:function(e){$.cookie("plan",e.id),$.cookie("pathName",window.location.pathname),window.location="auth/login"},SendMail:function(e){swal("Thanks! Our sales consultants will contact you"),this.$http.post("/dashboard/contact_email",{id:e.id}).success(function(e){})},getConfig:function(){var e=this;this.$http.get("/api/getMyCustomConfig").then(function(t){e.customFeatures=t.data})},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},createCompany:function(){var e=this;this.$http.post("/dashboard/company/saveCompany",{title:this.company.detail.title,company_vat:this.company.detail.company_vat,plan:this.company.detail.plan,plan_id:this.company.detail.plan_id,user_id:this.company.detail.user_id,employees:this.company.detail.employees,address_line_one:this.company.detail.address_line_one,address_line_two:this.company.detail.address_line_two,province:this.company.detail.province,city:this.company.detail.city,area_code:this.company.detail.area_code,country:this.company.detail.country}).success(function(t){e.companys.push(t),e.companyId=t.id}).catch(function(t){e.errors.company=t.data})},popEft:function(){this.validate()&&(this.process(),this.forms.subscription.busy=!0,this.selectedStaff.length==this.selectedStaffCount&&this.getEftLink())},sendInvitation:function(){var e=this;this.$http.post("/dashboard/company/store_invite",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,id_number:this.company.invite.id_number,cell:this.company.invite.cell,company_id:this.companyId}).success(function(t){e.staff.push(t.staff),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data})},addCard:function(){var e=this;this.newcard.return="/"+window.location.pathname+"?threeDs=yes&plan="+this.forms.subscription.plan,this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},selectPlan:function(e){this.setSelectedPlan(e),this.plans.length>=2&&window.scrollTo({top:450,behavior:"smooth"}),!this.is_practice_plan&&e.pricing_group>=0&&setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},selectEft:function(){setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},setSelectedPlan:function(e){this.selectedPlan=e,this.forms.subscription.plan=e.id,this.forms.subscription.pricing_group=e.pricing_group},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.subscription.staff=this.selectedStaff},getPlanPrice:function(){if(this.forms.subscription.pricing_group.length>0){var e=parseInt(this.selectedStaff.length)+parseInt(1),t=_.max(this.forms.subscription.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.forms.subscription.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e>=i)return n}return 0==n.length&&e>t?_.filter(this.forms.subscription.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.forms.subscription.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},selectAnotherPlan:function(){this.cancelPayment(),this.selectedPlan=null,this.clearSelectedFeatures(),this.clearselectedStaff(),this.forms.subscription.plan="",this.forms.subscription.paymentOption="cc",this.forms.subscription.card=null,this.forms.subscription.debit={}},clearSelectedFeatures:function(){this.selectedFeatures=[]},clearselectedStaff:function(){this.selectedStaff=[]},register:function(){if(this.selectedPlan.is_practice&&this.selectedPlan.pricing_group.length>0){var e=_.min(this.selectedPlan.pricing_group.map(function(e){return e.min_user})),t=parseInt(this.selectedStaff.length)+parseInt(1);if(t<e)return void swal({type:"warning",title:"Select more Staff Members",text:"You have only selected ("+t+") staff Members You need to add Minimum ("+e+") staff Members for your subscription package."})}this.selectedPlan.is_custom&&this.selectedFeatures.length<this.selectedPlan.max_no_of_features?swal({type:"warning",title:"Select more topics",text:"You have only selected ("+this.selectedFeatures.length+"/"+this.selectedPlan.max_no_of_features+") required Topics for your subscription package."}):(this.forms.subscription.errors.forget(),this.forms.subscription.staff=this.selectedStaff,this.forms.subscription.busy=!0,this.sendRegistration())},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.showModal=!0,e.next=3,this.loadPeachScript();case 3:this.$http.post("/instant-eft",{staffs:this.forms.subscription.staff,plan:this.selectedPlan.id,bf:this.forms.subscription.bf}).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(n){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=n.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return t.checkoutId=i.checkoutId,t.entityId=i.entityId,t.selectedStaffCount=t.forms.subscription.staff.length,e.next=8,t.$nextTick();case 8:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),t.initCheckout()},300);case 10:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var n="Unable to process your request!";422==e.status&&(n=e.data.message),swal({type:"warning",title:"Error",text:n,showConfirmButton:!0}),t.forms.subscription.busy=!1});case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.subscription.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.subscription.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.subscription.busy=!1}}}).render("#payment-form")}},_defineProperty(_methods,"SendMail",function(e){swal("Thanks! Our sales consultants will contact you"),this.$http.post("/dashboard/contact_email",{id:e.id}).success(function(e){})}),_defineProperty(_methods,"loadPeachScript",function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})}),_defineProperty(_methods,"closeModal",function(){$("#checkout_model").modal("hide"),this.checkoutId=null}),_defineProperty(_methods,"handleSuccess",function(e){this.closeModal()}),_defineProperty(_methods,"cancelPayment",function(){this.forms.subscription.busy=!1}),_defineProperty(_methods,"beginCheckout",function(){window.dataLayer=window.dataLayer||[];var e=[],t=this.getSubscriptionTotal(),n=parseInt(this.selectedStaff.length)+1;e.push({item_id:String(this.selectedPlan.id),item_name:this.selectedPlan.name,item_category:"Subscription",price:parseFloat(t.toFixed(2)),quantity:n}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(t).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})}),_defineProperty(_methods,"sendTransactions",function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>
10&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Subscription",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})}),_defineProperty(_methods,"getSubscriptionTotal",function(){if(!this.selectedPlan)return 0;var e=parseInt(this.selectedStaff.length)+1,t=this.forms.subscription.bf?parseFloat(this.selectedPlan.bf_price):parseFloat(this.selectedPlan.price),n=this.selectedPlan.pricing_group||[];if(n.length>0){t*=e,n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<=e&&r>=e&&(t=parseFloat(n.price)*e)});var i=Math.max.apply(null,n.map(function(e){return parseInt(e.max_user)}));if(e>i){var r=n.find(function(e){return parseInt(e.max_user)===i});r&&(t=parseFloat(r.price)*e)}n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<e&&0===r&&(t=parseFloat(n.price)*e)})}var s=parseFloat(this.getDonations())||0;return parseFloat((t+s).toFixed(2))}),_defineProperty(_methods,"getPaymentMethod",function(){return"cc"==this.forms.subscription.paymentOption?"Credit Card":"eft"==this.forms.subscription.paymentOption?"Instant EFT":""}),_defineProperty(_methods,"sendRegistration",function(){var e=this;if(this.validate()){if("eft"==this.forms.subscription.paymentOption&&0==this.instant_eft_success)return this.startListener(),this.forms.subscription.busy=!0,void swal({type:"warning",title:"Waiting on Payment",text:"We're waiting for payment confirmation, please do not close this page."});if("cc"==this.forms.subscription.paymentOption&&!this.forms.subscription.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.debitOrderDetailsCompleted)return swal({type:"warning",title:"Error",text:"Debit order details not completed"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.requested_otp){var t={account_number:this.forms.subscription.debit.account_number,branch_code:this.forms.subscription.debit.branch_code},n=!1;if(this.$http.post("/peach/validate",t).then(function(t){return"Valid"!=t.data.Result?void swal({type:"error",title:"Invalid Account Details",text:"Ensure that you have filled out your information correctly and try again."}):(n=!0,e.requestOTP())}).catch(function(e){console.log(e)}),!n)return void(this.forms.subscription.busy=!1)}if("debit"==this.forms.subscription.paymentOption&&!this.otpCorrect)return swal({type:"error",title:"Invalid OTP",text:"The OTP number you have entered is invalid, please try again."}),void(this.forms.subscription.busy=!1);this.selectedFeatures.length>0&&this.selectedPlan.is_custom&&(this.selectedFeatures.push(this.customFeatures),this.forms.subscription.features=this.selectedFeatures),this.selectedStaff.length>0&&(this.forms.subscription.staff=this.selectedStaff),this.beginCheckout(),this.processPayment(),this.$http.post("/subscriptions",this.forms.subscription).success(function(t){e.forms.subscription.busy=!1,swal.close();var n="/dashboard/general";e.forms.subscription.pi_cover&&(n="/insurance"),void 0!==t.invoice&&e.sendTransactions(t.invoice),window.location=n}).error(function(t){swal.close(),e.selectedFeatures.$remove(e.customFeatures),e.forms.subscription.busy=!1,e.forms.subscription.errors.set(t)})}}),_defineProperty(_methods,"requestOTP",function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,e.requested_otp=!0,e.waiting_on_otp=!0,swal.close()})}),_defineProperty(_methods,"resendOtp",function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})}),_defineProperty(_methods,"startListener",function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})}),_defineProperty(_methods,"getPlanColumnWidth",function(e){switch(e){case 1:return"col-md-6 col-md-offset-3";case 2:return"col-md-6";case 3:return"col-md-4";case 4:return"col-md-3";case 5:return"col-md-5th";case 7:return"col-md-4";case 8:return"col-md-3";default:return"col-md-4"}}),_defineProperty(_methods,"process",function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}),_defineProperty(_methods,"updateDebitOrderDate",function(){var e=(new Date).getDate();this.forms.subscription.debit.billable_date<e?swal({title:"Debit Order",text:"Due to your selected date is past away. So, Your debit order will be run next month your selected date Wait until the debit order runs, (you will need to wait up to 5 working days to get access once the debit order has successfully run for current month \n Please select next day debit order to get instant access or Select credit card or Instant EFT payment to get instant access",type:"warning",showCancelButton:!0,confirmButtonColor:"#007AFF",confirmButtonText:"Next Day Debit Order!",cancelButtonText:"Select Other Payment Method",closeOnConfirm:!0},function(){$("input[name=bill_at_next_available_date]").val("1").trigger("change")}):swal({title:"Debit Order",text:"Wait until the debit order runs on your selected date, (you will need to wait up to 5 working days to get access once the debit order has successfully run for current month \n Please select next day debit order to get instant access or Select credit card or Instant EFT payment to get instant access",type:"warning",showCancelButton:!0,confirmButtonColor:"#007AFF",confirmButtonText:"Next Day Debit Order!",closeOnConfirm:!0},function(){$("input[name=bill_at_next_available_date]").val("0").trigger("change")})}),_defineProperty(_methods,"validate",function(){if(!this.forms.subscription.terms)return swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.subscription.busy=!1,!1;if(this.forms.subscription.donations){if(""==this.id_number)return swal({type:"warning",title:"Error",text:"Please enter id number"}),this.forms.subscription.busy=!1,!1;if(""==this.id_type)return swal({type:"warning",title:"Error",text:"Please enter valid id type"}),this.forms.subscription.busy=!1,!1;if(""==this.country_of_issue)return swal({type:"warning",title:"Error",text:"Please select valid country"}),this.forms.subscription.busy=!1,!1;if(""==this.incometax_reference_number)return swal({type:"warning",title:"Error",text:"Please select valid income tax reference number!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_name)return swal({type:"warning",title:"Error",text:"Please enter valid company name!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_registrations_number)return swal({type:"warning",title:"Error",text:"Please enter company registration number"}),this.forms.subscription.busy=!1,!1;if(""==this.date_of_birth)return swal({type:"warning",title:"Error",text:"Please select date of birth"}),this.forms.subscription.busy=!1,!1;if(""==this.postal_address)return swal({type:"warning",title:"Error",text:"Please enter valid postal address"}),this.forms.subscription.busy=!1,!1;if(""==this.post_code)return swal({type:"warning",title:"Error",text:"Please enter valid postal code"}),this.forms.subscription.busy=!1,!1}return!0}),_methods)})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__),__WEBPACK_IMPORTED_MODULE_1_moment__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_moment___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-subscriptions-donation",{props:{user:null,scriptendpoint:""},data:function(){return{redirect_form_key:[],forms:{busy:!1,subscription:$.extend(!0,new AppForm({amount:0,first_name:"",last_name:"",email:"",cell:"",company_name:"",company_registrations_number:"",address:"",paymentOption:"cc",paymentStatus:"",transactionId:null,terms:!1,id_type:"",id_number:"",country_of_issue:"",incometax_reference_number:"",date_of_birth:"",post_code:"",errors:[]}),App.forms.subscription)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.getConfig();var queryString=URI(document.URL).query(!0);window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.busy=!1,swal.close()},2e3)}catch(e){_this.forms.busy=!1}})},watch:{"forms.subscription":function(e){}},computed:{pastDebitDateSelected:function(){return!!this.forms.subscription.debit.billable_date&&(__WEBPACK_IMPORTED_MODULE_1_moment___default()().date()>=this.forms.subscription.debit.billable_date||void 0)},otpCorrect:function(){return null!=this.otp&&this.otp==this.forms.subscription.debit.otp},countSelectedFeatures:function(){return this.selectedFeatures.length},getMaxFeatures:function(){return this.selectedPlan.max_no_of_features},canSelectMoreFeatures:function(){var e=this.selectedPlan.max_no_of_features;return this.countSelectedFeatures<e||0==e||(swal({type:"success",title:"Good job!",text:"You have selected "+e+" Topics, Please proceed or clear your selection to reselect."}),!1)},selectedStaffLength:function(){return this.selectedStaff.length},paymentOption:function(){return this.forms.subscription.paymentOption},plansAreLoaded:function(){return this.plans.length>=0},defaultPlans:function(){return this.plans.length>=1?this.monthlyPlans.length>0?this.monthlyPlans:this.yearlyPlans.length>0?this.yearlyPlans:void 0:this.plans[1]},monthlyPlans:function(){return _.filter(this.filterPlan,function(e){return"month"==e.interval&&1!=e.inactive})},yearlyPlans:function(){return _.filter(this.filterPlan,function(e){return"year"==e.interval&&1!=e.inactive})},freePlanIsSelected:function(){return this.selectedPlan&&this.selectedPlan.price<=0},shouldShowDefaultPlans:function(){return!this.planTypeState},shouldShowYearlyPlans:function(){return this.planTypeState},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.subscription.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0},debitOrderDetailsCompleted:function(){return"company"===this.forms.subscription.debit.type_of_account?""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.branch_name&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.registration_number:""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.branch_name&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.id_number}},mounted:function(){this.loadPeachScript()},methods:{getConfig:function(){var e=this;this.$http.get("/api/getMyCustomConfig").then(function(t){e.customFeatures=t.data})},validateForm:function(){return""!=this.forms.subscription.first_name&&""!=this.forms.subscription.last_name&&""!=this.forms.subscription.email&&""!=this.forms.subscription.cell&&""!=this.forms.subscription.company_name&&""!=this.forms.subscription.company_registrations_number&&""!=this.forms.subscription.address&&this.forms.subscription.amount>0&&""!=this.forms.subscription.id_type&&""!=this.forms.subscription.id_number&&""!=this.forms.subscription.country_of_issue&&""!=this.forms.subscription.incometax_reference_number&&""!=this.forms.subscription.date_of_birth&&""!=this.forms.subscription.post_code||(swal({type:"error",title:"Invalid Details",text:"Please fill val
1id information!"}),!1)},loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.validateForm()){e.next=2;break}return e.abrupt("return",!1);case 2:this.process(),this.forms.busy,this.getEftLink();case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),addCard:function(){var e=this;this.newcard.return="/"+window.location.pathname+"?threeDs=yes&plan="+this.forms.subscription.plan,this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},selectPlan:function(e){this.setSelectedPlan(e),this.plans.length>=2&&window.scrollTo({top:450,behavior:"smooth"}),setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},getPlanPrice:function(){if(this.forms.subscription.pricing_group.length>0){var e=parseInt(this.selectedStaff.length)+parseInt(1),t=_.max(this.forms.subscription.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.forms.subscription.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e>=i)return n}return 0==n.length&&e>t?_.filter(this.forms.subscription.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.forms.subscription.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},register:function(){if(this.forms.busy=!0,!this.forms.subscription.terms)return this.forms.subscription.errors.set({terms:["You must accept the Terms & Conditions to proceed."]}),!0;this.saveform()},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.showModal=!0,e.next=3,this.loadPeachScript();case 3:this.$http.post("/instant-eft",{donation:!0,amount:this.forms.subscription.amount}).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(n){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=n.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return t.checkoutId=i.checkoutId,t.entityId=i.entityId,e.next=7,t.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),t.initCheckout()},300);case 9:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var n="Unable to process your request!";422==e.status&&(n=e.data.message),swal({type:"warning",title:"Error",text:n,showConfirmButton:!0}),t.forms.busy=!1});case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}
1(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.forms.subscription.transactionId=t.id,e.forms.subscription.paymentStatus="success",e.saveform()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.busy=!1}}}).render("#payment-form")},cancelPayment:function(){this.forms.busy=!1},sendRegistration:function(){var e=this;return"eft"==this.forms.subscription.paymentOption&&0==this.instant_eft_success?(this.startListener(),this.forms.busy=!0,void swal({type:"warning",title:"Waiting on Payment",text:"We're waiting for payment confirmation, please do not close this page."})):"cc"!=this.forms.subscription.paymentOption||this.forms.subscription.card?(this.processPayment(),void this.$http.post("/subscriptions",this.forms.subscription).success(function(t){e.forms.busy=!1,swal.close();var n="/dashboard/general";e.forms.subscription.pi_cover&&(n="/insurance"),window.location=n}).error(function(t){swal.close(),e.selectedFeatures.$remove(e.customFeatures),e.forms.busy=!1,e.forms.subscription.errors.set(t)})):(swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.busy=!1))},requestOTP:function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,e.requested_otp=!0,e.waiting_on_otp=!0,swal.close()})},resendOtp:function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},getPlanColumnWidth:function(e){switch(e){case 1:return"col-md-6 col-md-offset-3";case 2:return"col-md-6";case 3:return"col-md-4";case 4:return"col-md-3";case 5:return"col-md-5th";case 7:return"col-md-4";case 8:return"col-md-3";default:return"col-md-4"}},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},updateDebitDate:function(){$("#debit_options").modal("show")},saveform:function(){var e=this;if("eft"==this.forms.subscription.paymentOption&&0==this.instant_eft_success)return this.startListener(),this.forms.busy=!0,void swal({type:"warning",title:"Waiting on Payment",text:"We're waiting for payment confirmation, please do not close this page."});if("cc"==this.forms.subscription.paymentOption){if(this.user&&!this.forms.subscription.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.busy=!1);if(!this.user&&(""==this.newcard.number||""==this.newcard.holder||""==this.newcard.exp_month||""==this.newcard.exp_year||""==this.newcard.cvv))return swal({type:"warning",title:"Please fill all details",text:"Please fill all credit card details properly and try again"}),this.forms.busy=!1,!1;this.user||(this.newcard.return="/"+window.location.pathname+"?threeDs=yes&plan="+this.forms.subscription.plan,this.forms.subscription.newcard=this.newcard)}this.processPayment(),this.$http.post("/donate/save",this.forms.subscription).success(function(t){if(swal.close(),e.forms.busy=!1,t.status)setTimeout(function(){swal({type:"success",title:"Success",text:t.message},function(){window.location.href="/donate"})},500);else if(t.data){e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}else setTimeout(function(){swal({type:"error",title:"Error",text:t.message})},500)}).catch(function(t){e.forms.subscription.errors=t.data,swal.close()})},selectDebitOrder:function(e){"next day"==this.forms.subscription.debit_order_type?this.forms.subscription.debit.bill_at_next_available_date=1:"wait"==this.forms.subscription.debit_order_type||this.forms.subscription.debit_order_type,$("#debit_options").modal("hide")}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__),__WEBPACK_IMPORTED_MODULE_1_moment__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_moment___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-subscriptions-screen-plan",{props:{plans:null,staff:null,user:null,subscriptions:null,profession:null,companys:null,upgrade:"",bank_codes:null,donations:{required:!1,default:!1},input_plan_id:null,selected_plan_type:"",scriptendpoint:""},data:function(){return{companyId:0,redirect_form_key:[],selectedPlan:null,selectedFeatures:[],selectedStaff:[],selectedStaffCount:0,customFeatures:[],filterPlan:[],selectedRoute:"",Plantype:"",instantlink:"",payment_token:"",instant_eft_success:!1,is_practice_plan:!1,inviteStaff:!1,planTypeState:!1,isComanySetup:!1,otp:null,waiting_on_otp:!1,requested_otp:!1,id_number:"",id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",errors:{company:[],invite:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},forms:{subscription:$.extend(!0,new AppForm({busy:!1,bf:!1,debit_order_type:"",plan:"",pricing_group:[],terms:!1,is_upgrade:!1,immediately:!1,paymentOption:"cc",pi_cover:!1,features:[],staff:[],card:null,donations:0,debit:{bank:"",bank_temp:"",account_number:"",account_type:"",branch_name:"",branch_code:"",billable_date:"",bill_at_next_available_date:0,account_holder:"",id_number:"",registration_number:"",type_of_account:"",otp:""}}),App.forms.subscription)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.getConfig(),this.input_plan_id&&(this.selectedPlan=this.plans.filter(function(e){return e.id==parseInt(_this.input_plan_id)})[0],this.forms.subscription.plan=this.selectedPlan.id,this.forms.subscription.pricing_group=this.selectedPlan.pricing_group),this.selected_plan_type&&(this.Plantype=this.selected_plan_type);var queryString=URI(document.URL).query(!0);this.companys.length>0&&(this.companyId=this.companys[0].id),window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.subscription.busy=!1,swal.close()},2e3)}catch(e){_this.forms.subscription.busy=!1}}),this.selected_plan_type?"individual"==this.Plantype?this.makeactive("individual","chartered-accountant","auto"):this.makeactive("business","business-accountant-in-practice","auto"):this.makeactive("individual","chartered-accountant")},watch:{selectedStaffLength:function(e){e>0&&this.selectedPlanIsYearly&&setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},paymentOption:function(e){var t=this;"debit"==e&&this.forms.subscription.is_upgrade&&swal({title:"Are you Want to upgrade immediately?",text:"Are you interested in changing your subscription plan? Click immediately and your debit order will proceed soon?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"immediately",cancelButtonText:"Regaular",closeOnConfirm:!1},function(e){e&&(t.forms.subscription.immediately=!0,swal.close())})}},computed:{pastDebitDateSelected:function(){return!!this.forms.subscription.debit.billable_date&&(__WEBPACK_IMPORTED_MODULE_1_moment___default()().date()>=this.forms.subscription.debit.billable_date||void 0)},otpCorrect:function(){return null!=this.otp&&this.otp==this.forms.subscription.debit.otp},countSelectedFeatures:function(){return this.selectedFeatures.length},getMaxFeatures:function(){return this.selectedPlan.max_no_of_features},canSelectMoreFeatures:function(){var e=this.selectedPlan.max_no_of_features;return this.countSelectedFeatures<e||0==e||(swal({type:"success",title:"Good job!",text:"You have selected "+e+" Topics, Please proceed or clear your selection to reselect."}),!1)},selectedStaffLength:function(){return this.selectedStaff.length},paymentOption:function(){return this.forms.subscription.paymentOption},plansAreLoaded:function(){return this.plans.length>=0},defaultPlans:function(){return this.plans.length>=1?this.monthlyPlans.length>0?this.monthlyPlans:this.yearlyPlans.length>0?this.yearlyPlans:void 0:this.plans[1]},monthlyPlans:function(){return _.filter(this.filterPlan,function(e){return"month"==e.interval&&1!=e.inactive})},yearlyPlans:function(){return _.filter(this.filterPlan,function(e){return"year"==e.interval&&1!=e.inactive})},freePlanIsSelected:function(){return this.selectedPlan&&this.selectedPlan.price<=0},shouldShowDefaultPlans:function(){return!this.planTypeState},shouldShowYearlyPlans:function(){return this.planTypeState},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.subscription.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0},debitOrderDetailsCompleted:function(){return"company"===this.forms.subscription.debit.type_of_account?""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.registration_number:""!=this.forms.subscription.debit.bank&&""!=this.forms.subscription.debit.account_number&&""!=this.forms.subscription.debit.account_type&&""!=this.forms.subscription.debit.branch_code&&""!=this.forms.subscription.debit.billable_date&&""!=this.forms.subscription.debit.account_holder&&""!=this.forms.subscription.debit.type_of_account&&""!=this.forms.subscription.debit.id_number}},mounted:function(){this.loadPeachScript()},methods:{bankNameChanged:function(){var e=this.forms.subscription.debit.bank_temp,t=""!=e?this.bank_codes[e]:"";this.forms.subscription.debit.branch_code=this.forms.subscription.debit.bank_temp,this.forms.subscription.debit.bank=t},makeactive:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||(this.selectAnotherPlan(),this.Plantype=e),this.selectedRoute="/profession/"+t,"individual"==e?this.filterPlan=_.filter(this.plans,function(e,t){return"individual"==e.package_type&&1!=e.inactive}):"business"==e?this.filterPlan=_.filter(this.plans,function(e,t){return"business"==e.package_type&&1!=e.inactive}):"trainee"==e&&(this.filterPlan=_.filter(this.plans,function(e,t){return"trainee"==e.package_type&&1!=e.inactive})),this.monthlyPlans=_.filter(this.filterPlan,function(e){return"month"==e.interval&&1!=e.inactive}),this.yearlyPlans=_.filter(this.filterPlan,function(e){return"year"==e.interval&&1!=e.inactive}),this.monthlyPlans.sort(function(e,t){return t.price-e.price}),this.yearlyPlans.sort(function(e,t){return t.price-e.price})},getConfig:function(){var e=this;this.$http.get("/api/getMyCustomConfig").then(function(t){e.customFeatures=t.data})},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},createCompany:function(){var e=this;this.$http.post("/dashboard/company/saveCompany",{title:this.company.detail.title,company_vat:this.company.detail.company_vat,plan:this.company.detail.plan,plan_id:this.company.detail.plan_id,user_id:this.company.detail.user_id,employees:this.company.detail.employees,address_line_one:this.company.detail.address_line_one,address_line_two:this.company.detail.address_line_two,province:this.company.detail.province,city:this.company.detail.city,area_code:this.company.detail.area_code,country:this.company.detail.country}).success(function(t){e.companys.push(t),e.companyId=t.id}).catch(function(t){e.errors.company=t.data}),console.log(this.company.detail)},loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.subscription.busy=!0,this.selectedStaff.length==this.selectedStaffCount&&this.getEftLink())},sendInvitation:function(){var e=this;return this.isValidEmail(this.company.invite.email)?this.validatePhoneNumber(this.company.invite.cell)?void this.$http.post("/dashboard/company/store_invite",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,id_number:this.company.invite.id_number,cell:this.company.invite.cell,check_users:!0,company_id:this.companyId}).success(function(t){1==t.status?e.staff.push(t.staff):swal({type:"error",title:"Error",text:t.message}),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data}):(swal({type:"error",title:"Cell Error",text:"Please enter valid Cell Number"}),!1):(swal({type:"error",title:"Email Error",text:"Please enter valid Email"}),!1)},addCard:function(){var e=this;this.newcard.return="/"+window.location.pathname+"?threeDs=yes&plan="+this.forms.subscription.plan+"&plan_type="+this.Plantype,this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},selectPlan:function(e){this.setSelectedPlan(e),this.plans.length>=2&&window.scrollTo({top:450,behavior:"smooth"}),setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},changePlanPopup:function(e){var t=this;if(t.subscriptions&&parseFloat(t.subscriptions.price)<=0)return t.forms.subscription.is_upgrade=!0,t.selectPlan(e),!1;t.subscriptions&&parseFloat(t.subscriptions.price)>=0&&swal({title:"Are you sure?",text:"Are you interested in changing your subscription plan? Click okay and one of our sales consultants will contact you?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",closeOnConfirm:!1},function(n){n&&t.SendMail(e)})},selectEft:function(){setTimeout(function(){$(".app-first-field").filter(":visible:first").focus()},100)},setSelectedPlan:function(e){this.selectedPlan=e,this.forms.subscription.plan=e.id,this.forms.subscription.pricing_group=e.pricing_group},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.subscription.staff=this.selectedStaff},getPlanPrice:function(){if(this.forms.subscription.pricing_group.length>0){var e=parseInt(this.selectedStaff.length)+parseInt(1),t=_.max(this.forms.subscription.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.forms.subscription.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e>=i)return n}return 0==n.length&&e>t?_.filter(this.forms.subscription.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.forms.subscription.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},selectAnotherPlan:function(){this.cancelPayment(),this.selectedPlan=null,this.clearSelectedFeatures(),this.clearselectedStaff(),this.forms.subscription.plan="",this.forms.subscription.paymentOption="cc",this.forms.subscription.card=null,this.forms.subscription.debit={}},clearSelectedFeatures:function(){this.selectedFeatures=[]},clearselectedStaff:function(){this.selectedStaff=[]},getSubscriptionTotal:function(){if(!this.selectedPlan)return 0;var e=parseInt(this.selectedStaff.length)+1,t=this.forms.subscription.bf?parseFloat(this.selectedPlan.bf_price):parseFloat(this.selectedPlan.price),n=this.selectedPlan.pricing_group||[];if(n.length>0){t*=e,n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<=e&&r>=e&&(t=parseFloat(n.price)*e)});var i=Math.max.apply(null,n.map(function(e){return parseInt(e.max_user)}));if(e>i){var r=n.find(function(e){return parseInt(e.max_user)===i});r&&(t=parseFloat(r.price)*e)}n.forEach(function(n){var i=parseInt(n.min_user),r=parseInt(n.max_user);i<e&&0===r&&(t=parseFloat(n.price)*e)})}var s=parseFloat(this.getDonations())||0;return parseFloat((t+s).toFixed(2))},register:function(){if(this.selectedPlan.is_practice&&this.selectedPlan.pricing_group&&this.selectedPlan.pricing_group.length>0){var e=_.min(this.selectedPlan.pricing_group.map(function(e){return e.min_user})),t=parseInt(this.selectedStaff.length)+parseInt(1);if(t<e)return void swal({type:"warning",title:"Select more Staff Members",text:"You have only selected ("+t+") staff Members You need to add Minimum ("+e+") staff Members for your subscription package."})}this.selectedPlan.is_custom&&this.selectedFeatures.length<this.selectedPlan.max_no_of_features?swal({type:"warning",title:"Select more topics",text:"You have only selected ("+this.selectedFeatures.length+"/"+this.selectedPlan.max_no_of_features+") required Topics for your subscription package."}):(this.forms.subscription.errors.forget(),this.forms.subscription.staff=this.selectedStaff,this.forms.subscription.busy=!0,this.sendRegistration())},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.selectedStaff,this.showModal=!0,e.next=4,this.loadPeachScript();case 4:this.$http.post("/instant-eft",{staffs:this.forms.subscription.staff,plan:this.selectedPlan.id,bf:this.forms.subscription.bf,donation_amount:this.getDonations()}).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(n){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=n.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return t.checkoutId=i.checkoutId,t.entityId=i.entityId,e.next=7,t.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),t.initCheckout()},300);case 9:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var n="Unable to process your request!";422==e.status&&(n=e.data.message),swal({type:"warning",title:"Error",text:n,showConfirmButton:!0}),t.forms.subscription.busy=!1});case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),SendMail:function(e){swal("Thanks! Our sales consultants will contact you"),this.$http.post("/dashboard/contact_email",{id:e.id}).success(function(e){})},initCheckout:function(){var e=this;if(this.selectedPlan.is_practice&&this.selectedPlan.pricing_group&&this.selectedPlan.pricing_group.length>0){var t=_.min(this.selectedPlan.pricing_group.map(function(e){return e.min_user})),n=parseInt(this.selectedStaff.length)+parseInt(1);if(n<t)return swal({type:"warning",title:"Select more Staff Members",text:"You have only selected ("+n+") staff Members You need to add Minimum ("+t+") staff Members for your subscription package."}),void(this.forms.subscription.busy=!1)}
1window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.subscription.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.subscription.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.subscription.busy=!1}}}).render("#payment-form")},cancelPayment:function(){this.forms.subscription.busy=!1},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[],t=this.getSubscriptionTotal(),n=parseInt(this.selectedStaff.length)+1;e.push({item_id:String(this.selectedPlan.id),item_name:this.selectedPlan.name,item_category:"Subscription",price:parseFloat(t.toFixed(2)),quantity:n}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(t).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>0&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Subscription",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.subscription.paymentOption?"Credit Card":"eft"==this.forms.subscription.paymentOption?"Instant EFT":""},sendRegistration:function(){var e=this;if(this.validate()){if("eft"==this.forms.subscription.paymentOption&&0==this.instant_eft_success)return this.startListener(),this.forms.subscription.busy=!0,void swal({type:"warning",title:"Waiting on Payment",text:"We're waiting for payment confirmation, please do not close this page."});if("cc"==this.forms.subscription.paymentOption&&!this.forms.subscription.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.debitOrderDetailsCompleted)return swal({type:"warning",title:"Error",text:"Debit order details not completed"}),void(this.forms.subscription.busy=!1);if("debit"==this.forms.subscription.paymentOption&&!this.requested_otp){var t={account_number:this.forms.subscription.debit.account_number,branch_code:this.forms.subscription.debit.branch_code},n=!1;if(this.$http.post("/peach/validate",t).then(function(t){return"Valid"!=t.data.Result?void swal({type:"error",title:"Invalid Account Details",text:"Ensure that you have filled out your information correctly and try again."}):(n=!0,e.requestOTP())}).catch(function(e){console.log(e)}),!n)return void(this.forms.subscription.busy=!1)}if("debit"==this.forms.subscription.paymentOption&&!this.otpCorrect)return swal({type:"error",title:"Invalid OTP",text:"The OTP number you have entered is invalid, please try again."}),void(this.forms.subscription.busy=!1);this.selectedFeatures.length>0&&this.selectedPlan.is_custom&&(this.selectedFeatures.push(this.customFeatures),this.forms.subscription.features=this.selectedFeatures),this.selectedStaff.length>0&&(this.forms.subscription.staff=this.selectedStaff),this.beginCheckout(),this.processPayment();var i=this.forms.subscription;i.donations=this.getDonations(),i.id_number=this.id_number,i.id_type=this.id_type,i.country_of_issue=this.country_of_issue,i.incometax_reference_number=this.incometax_reference_number,i.company_name=this.company_name,i.company_registrations_number=this.company_registrations_number,i.date_of_birth=this.date_of_birth,i.post_code=this.post_code,i.postal_address=this.postal_address,this.$http.post("/subscriptions",i).success(function(t){e.forms.subscription.busy=!1,swal.close();var n="/dashboard/general";e.forms.subscription.pi_cover&&(n="/insurance"),void 0!==t.invoice&&e.sendTransactions(t.invoice),window.location=n}).error(function(t){swal.close(),e.selectedFeatures.$remove(e.customFeatures),e.forms.subscription.busy=!1,e.forms.subscription.errors.set(t)})}},requestOTP:function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,e.requested_otp=!0,e.waiting_on_otp=!0,swal.close()})},resendOtp:function(){var e=this;this.$http.post("/peach/otp").then(function(t){e.otp=t.data.otp,swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},getPlanColumnWidth:function(e){switch(e){case 1:return"col-md-6 col-md-offset-3";case 2:return"col-md-6";case 3:return"col-md-4";case 4:return"col-md-3";case 5:return"col-md-5th";case 7:return"col-md-4";case 8:return"col-md-3";default:return"col-md-4"}},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},updateDebitDate:function(){$("#debit_options").modal("show")},selectDebitOrder:function(e){"next day"==this.forms.subscription.debit_order_type?this.forms.subscription.debit.bill_at_next_available_date=1:"wait"==this.forms.subscription.debit_order_type||this.forms.subscription.debit_order_type,$("#debit_options").modal("hide")},getDonations:function(){var e=0;return this.forms.subscription.donations&&this.selectedPlanIsYearly&&(e=this.donations),e},buynow:function(e){$.cookie("plan",e.id),$.cookie("pathName",window.location.pathname),window.location="auth/login"},isValidEmail:function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},validatePhoneNumber:function(e){return/^\+?\d{11}$/.test(e)},validate:function(){if(!this.forms.subscription.terms)return swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.subscription.busy=!1,!1;if(this.forms.subscription.donations){if(""==this.id_number)return swal({type:"warning",title:"Error",text:"Please enter id number"}),this.forms.subscription.busy=!1,!1;if(""==this.id_type)return swal({type:"warning",title:"Error",text:"Please enter valid id type"}),this.forms.subscription.busy=!1,!1;if(""==this.country_of_issue)return swal({type:"warning",title:"Error",text:"Please select valid country"}),this.forms.subscription.busy=!1,!1;if(""==this.incometax_reference_number)return swal({type:"warning",title:"Error",text:"Please select valid income tax reference number!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_name)return swal({type:"warning",title:"Error",text:"Please enter valid company name!"}),this.forms.subscription.busy=!1,!1;if(""==this.company_registrations_number)return swal({type:"warning",title:"Error",text:"Please enter company registration number"}),this.forms.subscription.busy=!1,!1;if(""==this.date_of_birth)return swal({type:"warning",title:"Error",text:"Please select date of birth"}),this.forms.subscription.busy=!1,!1;if(""==this.postal_address)return swal({type:"warning",title:"Error",text:"Please enter valid postal address"}),this.forms.subscription.busy=!1,!1;if(""==this.post_code)return swal({type:"warning",title:"Error",text:"Please enter valid postal code"}),this.forms.subscription.busy=!1,!1}return!0}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("webinar-on-demand-checkout",{props:{video:{required:!0},user:{required:!0},donations:{required:!1,default:!1},usedcoupon:{required:!1},scriptendpoint:""},data:function(){return{redirect_form_key:[],used_coupon_discount:0,promo_code_id:0,instantlink:"",payment_token:"",instant_eft_success:!1,id_number:"",id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",postal_address:"",forms:{webinarCheckout:$.extend(!0,new AppForm({busy:!1,donations:1,paymentOption:"",card:null,terms:!1}),App.forms.webinarCheckout)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},computed:{total:function(){if(this.video.black_friday_discounts&&this.video.black_friday_price>0)var e=this.video.black_friday_price;else e=this.video.amount;var t=this.getDonations(),n=parseFloat(e)+parseFloat(t)-parseFloat(this.used_coupon_discount);return n}},created:function(){null!=this.usedcoupon&&""!=this.usedcoupon&&void 0!=this.usedcoupon&&(this.promo_code_id=this.usedcoupon.id,"percentage"==this.usedcoupon.discount_type?this.video.black_friday_discounts&&this.video.black_friday_price>0?this.used_coupon_discount=this.video.black_friday_price*this.usedcoupon.discount_amount/100:this.used_coupon_discount=this.video.amount*this.usedcoupon.discount_amount/100:this.used_coupon_discount=this.usedcoupon.discount_amount)},ready:function ready(){var _this=this;window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.webinarCheckout.busy=!1,swal.close()},2e3)}catch(e){_this.forms.webinarCheckout.busy=!1}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.webinarCheckout.busy=!0,this.getEftLink())},addCard:function(){var e=this;this.newcard.return="/webinars_on_demand/checkout/"+this.video.slug+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.webinarCheckout.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},cancelPayment:function(){this.forms.webinarCheckout.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={video:this.video.id,donation_amount:this.getDonations(),is_black_friday:0},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");
1case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.webinarCheckout.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.webinarCheckout.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},register:function(){this.forms.webinarCheckout.errors.forget(),this.forms.webinarCheckout.busy=!0,this.sendRegistration()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},total:function(){var e=this.getDonations();return(this.video.black_friday_discounts&&this.video.black_friday_price>0?this.video.black_friday_price:this.video.amount)+e},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];e.push({item_id:String(this.video.id),item_name:this.video.name,item_category:"Webinars on demand",price:parseFloat(parseFloat(this.total).toFixed(2)),quantity:1}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>0&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Webinars on demand",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.webinarCheckout.paymentOption?"Credit Card":"eft"==this.forms.webinarCheckout.paymentOption?"Instant EFT":""},sendRegistration:function(){if(this.validate())if("eft"!=this.forms.webinarCheckout.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.webinarCheckout.paymentOption&&!this.forms.webinarCheckout.card)return swal({type:"warning",title:"Error",text:"Unable to purchase without credit card, please select credit card"}),void(this.forms.webinarCheckout.busy=!1);var e={video:this.video.id,terms:this.forms.webinarCheckout.terms,card:this.forms.webinarCheckout.card,paymentOption:this.forms.webinarCheckout.paymentOption,donations:this.getDonations(),promo_code_id:this.promo_code_id,id_number:this.id_number,id_type:this.id_type,country_of_issue:this.country_of_issue,incometax_reference_number:this.incometax_reference_number,company_name:this.company_name,company_registrations_number:this.company_registrations_number,date_of_birth:this.date_of_birth,post_code:this.post_code,postal_address:this.postal_address};this.beginCheckout(),this.processPayment(),this.$http.post("/webinars_on_demand/checkout/"+this.video.slug+"/complete",e).success(function(e){this.forms.webinarCheckout.busy=!1,swal.close(),void 0!==e.invoice&&this.sendTransactions(e.invoice),window.location="/dashboard/webinars_on_demand"}).error(function(e){console.log(e),this.forms.webinarCheckout.busy=!1,swal.close(),e&&this.forms.webinarCheckout.errors.set(e)})}else this.forms.webinarCheckout.busy=!0}
1,getDonations:function(){var e=0;return this.forms.webinarCheckout.donations&&(e=this.donations),e},validate:function(){return!this.forms.webinarCheckout.donations||this.id_number&&this.id_type&&this.country_of_issue&&this.incometax_reference_number&&this.date_of_birth&&this.post_code&&this.postal_address?!!this.forms.webinarCheckout.terms||(swal({type:"warning",title:"Error",text:"Please accept terms and conditions to process"}),this.forms.webinarCheckout.busy=!1,!1):(swal({type:"error",title:"Donation Details Required",text:"Please complete all donation fields before proceeding."}),this.forms.webinarCheckout.busy=!1,!1)}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("bf-webinar-on-demand-checkout",{props:{video:{required:!0},user:{required:!0},donations:{required:!1,default:!1},usedcoupon:{required:!1},scriptendpoint:""},data:function(){return{redirect_form_key:[],used_coupon_discount:0,promo_code_id:0,instantlink:"",payment_token:"",instant_eft_success:!1,forms:{webinarCheckout:$.extend(!0,new AppForm({busy:!1,donations:1,paymentOption:"",card:null,terms:!1}),App.forms.webinarCheckout)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},computed:{total:function(){var e=this.video.amount,t=this.getDonations(),n=parseFloat(e)+parseFloat(t)-parseFloat(this.used_coupon_discount);return n}},created:function(){null!=this.usedcoupon&&""!=this.usedcoupon&&void 0!=this.usedcoupon&&(this.promo_code_id=this.usedcoupon.id,"percentage"==this.usedcoupon.discount_type?this.used_coupon_discount=this.video.amount*this.usedcoupon.discount_amount/100:this.used_coupon_discount=this.usedcoupon.discount_amount)},ready:function ready(){var _this=this;window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.webinarCheckout.busy=!1,swal.close()},2e3)}catch(e){_this.forms.webinarCheckout.busy=!1}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.webinarCheckout.busy=!0,this.getEftLink())},addCard:function(){var e=this;this.newcard.return="/webinars_on_demand/checkout/"+this.video.slug+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.webinarCheckout.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},cancelPayment:function(){this.forms.webinarCheckout.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={video:this.video.id,donation_amount:this.getDonations(),is_black_friday:1},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");
1case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.webinarCheckout.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.webinarCheckout.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},register:function(){this.forms.webinarCheckout.errors.forget(),this.forms.webinarCheckout.busy=!0,this.sendRegistration()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];e.push({item_id:String(this.video.id),item_name:this.video.name,item_category:"Webinars on demand",price:parseFloat(parseFloat(this.total).toFixed(2)),quantity:1}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>0&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:"Webinars on demand",price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.webinarCheckout.paymentOption?"Credit Card":"eft"==this.forms.webinarCheckout.paymentOption?"Instant EFT":""},total:function(){var e=this.getDonations();return(this.video.black_friday_discounts&&this.video.black_friday_price>0?this.video.black_friday_price:this.video.amount)+e},sendRegistration:function(){if(this.validate())if("eft"!=this.forms.webinarCheckout.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.webinarCheckout.paymentOption&&!this.forms.webinarCheckout.card)return swal({type:"warning",title:"Error",text:"Unable to purchase without credit card, please select credit card"}),void(this.forms.webinarCheckout.busy=!1);var e={video:this.video.id,terms:this.forms.webinarCheckout.terms,card:this.forms.webinarCheckout.card,paymentOption:this.forms.webinarCheckout.paymentOption,donations:this.getDonations(),promo_code_id:this.promo_code_id};this.beginCheckout(),this.processPayment(),this.$http.post("/webinars_on_demand/bfcheckout/"+this.video.slug+"/complete",e).success(function(e){this.forms.webinarCheckout.busy=!1,swal.close(),void 0!==e.invoice&&this.sendTransactions(e.invoice),window.location="/dashboard/webinars_on_demand"}).error(function(e){this.forms.webinarCheckout.busy=!1,swal.close(),this.forms.webinarCheckout.errors.set(e)})}else this.forms.webinarCheckout.busy=!0}
1,getDonations:function(){var e=0;return this.forms.webinarCheckout.donations&&(e=this.donations),e},validate:function(){return!this.forms.webinarCheckout.donations||this.id_number&&this.id_type&&this.country_of_issue&&this.incometax_reference_number&&this.date_of_birth&&this.post_code&&this.postal_address?!!this.forms.webinarCheckout.terms||(swal({type:"warning",title:"Error",text:"Please accept terms and conditions to process"}),this.forms.webinarCheckout.busy=!1,!1):(swal({type:"error",title:"Donation Details Required",text:"Please complete all donation fields before proceeding."}),this.forms.webinarCheckout.busy=!1,!1)}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),r=n.n(i);Vue.component("pagination",n(8)),Vue.component("debit-order-admin",{data:function(){return{search_results:[],selectedResult:null,search_results_count:null,forms:{search_debit_order:$.extend(!0,new AppForm({busy:!1,account_holder:"",number:"",branch:"",provider:"",status:"",debit_date:""}),App.forms.search_debit_order),debitOrderForm:$.extend(!0,new AppForm({busy:!1,account_holder:"",bank:"",number:"",branch_code:"",branch_name:"",type:"",type_of_account:"",registration_number:"",id_number:"",skip_next_debit:"",billable_date:"",peach:"",note:"",otp:"",errors:[]}),App.forms.debitOrderForm)}}},filters:{formatDate:function(e){if(e)return r()(String(e)).format("MM/DD/YYYY")}},methods:{download_data:function(){if(this.search_results_count){var e=this.forms.search_debit_order;this.$http.post("/admin/debit_orders/export_search",e).then(function(e){window.open(e.data.file),e.data.data.length>=1?swal.close():swal({type:"warning",title:"No Results Found",text:"We have not find any results using that filter."})})}else swal({type:"warning",title:"No Results Found",text:"We have not find any results using that filter."})},resetSearch:function(){this.search_results="",this.selectedResult="",this.search_results_count=""},clearSelected:function(){this.selectedResult=""},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.process();var n=this.forms.search_debit_order;this.$http.post("/admin/debit_orders/search?page="+t,n).then(function(t){e.search_results="",e.search_results_count=t.data.total,e.search_results=t.data,t.data.data.length>=1?swal.close():swal({type:"warning",title:"No Results Found",text:"We have not find any results using that filter."})})},fetch:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.selectedResult="";var n=this.forms.search_debit_order;this.$http.post("/admin/debit_orders/search?page="+t,n).then(function(t){e.search_results="",e.search_results=t.data})},sendOTP:function(){var e=this;this.$http.post("/admin/member/"+this.selectedResult.user.id+"/peach/otp").then(function(t){e.otp=t.data.otp,swal({type:"success",title:"OTP Sent!",text:"The OTP has been sent!."})})},updateDetails:function(){var e=this,t={account_number:this.forms.debitOrderForm.number,branch_code:this.forms.debitOrderForm.branch_code};this.process(),this.$http.post("/peach/validate",t).then(function(t){if("Valid"==t.data.Result){e.forms.debitOrderForm.errors=[];var n=e.forms.debitOrderForm;e.$http.post("/admin/debit_orders/update/"+e.selectedResult.id,n).then(function(t){t.data.errors?(e.forms.debitOrderForm.errors=t.data.errors,swal({type:"error",title:"Something went wrong!",text:"Please check your input and try again"})):(e.forms.debitOrderForm.errors=[],swal({type:"success",title:"Success!",text:"Details has been updated successfully!"}),e.selectedResult="")})}else swal({type:"error",title:"Invalid Account Details",text:"Ensure that you have filled out your information correctly and try again."})}).catch(function(e){console.log(e)})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},selectResult:function(e){this.forms.debitOrderForm.errors=[],this.selectedResult=e,this.forms.debitOrderForm.otp=e.otp,this.forms.debitOrderForm.type=e.type,this.forms.debitOrderForm.note=e.note,this.forms.debitOrderForm.bank=e.bank,this.forms.debitOrderForm.skip_next_debit=e.skip_next_debit,this.forms.debitOrderForm.peach=e.peach,this.forms.debitOrderForm.number=e.number,this.forms.debitOrderForm.id_number=e.user.id_number,this.forms.debitOrderForm.branch_code=e.branch_code,this.forms.debitOrderForm.branch_name=e.branch_name,this.forms.debitOrderForm.billable_date=e.billable_date,this.forms.debitOrderForm.account_holder=e.user.first_name+" "+e.user.last_name,this.forms.debitOrderForm.type_of_account=e.type_of_account,this.forms.debitOrderForm.registration_number=e.registration_number}}})},function(e,t){Vue.component("income-reports",{data:function(){return{filter:"",transactions:null,forms:{incomeReports:$.extend(!0,new AppForm({from:null,to:null}),App.forms.incomeReports),exportReport:$.extend(!0,new AppForm({file_name:"",discounts:null,cancellations:null,invoices:null,payments:null}),App.forms.exportReport)}}},computed:{invoices:function(){return _.filter(this.transactions,function(e){return"debit"==e.type&&"Invoice"==e.display_type})},invoicesTotal:function(){return _.reduce(this.invoices,function(e,t){return e+t.amount},0)},payments:function(){return _.filter(this.transactions,function(e){return"credit"==e.type&&"Payment"==e.display_type})},paymentsTotal:function(){return _.reduce(this.payments,function(e,t){return e+t.amount},0)},discounts:function(){return _.filter(this.transactions,function(e){return"Discount"==e.tags})},discountsTotal:function(){return _.reduce(this.discounts,function(e,t){return e+t.amount},0)},cancellations:function(){return _.filter(this.transactions,function(e){return"credit"==e.type&&"Cancellation"==e.tags})},cancellationsTotal:function(){return _.reduce(this.cancellations,function(e,t){return e+t.amount},0)},creditnotesTotal:function(){return this.discountsTotal+this.cancellationsTotal},totalDebit:function(){return this.invoicesTotal},totalCredit:function(){return this.creditnotesTotal+this.paymentsTotal},outstandingTotal:function(){return this.totalDebit-this.totalCredit}},methods:{runIncomeReport:function(){var e=this;this.transactions=null,this.forms.incomeReports.busy=!0,setTimeout(function(){e.$http.post("/admin/reports/payments/income",e.forms.incomeReports).then(function(t){e.transactions=t.data,e.forms.incomeReports.busy=!1}).catch(function(t){alert("Whoops, something went wrong."),e.forms.incomeReports.busy=!1})},3e3)},runExportReport:function(){var e=this;this.forms.exportReport.busy=!0,this.forms.exportReport.file_name="Income report: "+this.forms.incomeReports.from+" "+this.forms.incomeReports.to,this.forms.exportReport.discounts=this.discounts,this.forms.exportReport.cancellations=this.cancellations,this.forms.exportReport.invoices=this.invoices,this.forms.exportReport.payments=this.payments,setTimeout(function(){e.$http.post("/admin/reports/payments/export",e.forms.exportReport).then(function(t){e.forms.exportReport.busy=!1,t.data.success?window.open(t.data.file):(alert("Whoops, something went wrong."),e.forms.exportReport.busy=!1)}).catch(function(t){alert("Whoops, something went wrong."),e.forms.exportReport.busy=!1})},3e3)}}})},function(e,t){Vue.component("order-template",{props:{events:[],products:[],user:{required:!0}
1,dietraies:[]},data:function(){return{eventYear:(new Date).getFullYear(),eventsDate:[],extras:[],totalGroupBookingUser:0,usedcoupon:null,selectedEventId:"",selectedVenueId:"",selectedPricingId:"",selectedDateId:"",selectedproductId:"",dietary:null,donations:0,couponApplied:!1,discounted_price:"",venues:"",pricings:"",dates:[],eventPriceDetails:[],selectedOption:"",Couponcode:"",selectedPrice:null,staffCount:"",pricegroup:[],singlePrice:0,type:0,lastPrice:0,prices:[],selectedStaff:[],selectedExtraId:[],pendingMembers:[],pendingMembersEmails:[],members:[],selectedStaffCount:0,inviteStaff:!1,isComanySetup:!1,AttendTypeState:!1,addingMemberDetails:!1,staffs:[],company:{invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},errors:{company:[],invite:[]},busy:!1}},watch:{selectedPrice:function(e,t){t&&(this.lastPrice=t.discounted_new_price),e&&(0==this.prices.length?(this.prices.push(e.discounted_new_price),this.getPriceAfterApplyCoupon(e.price)===e.discounted_new_price&&(this.totalGroupBookingUser=1)):this.updatedPrices())},type:function(e,t){if(e){var n=0;this.totalGroupBookingUser=0;for(var i=0;i<this.members.length;i++)this.members[i].email==this.user.email&&(n++,this.selectedPrice&&this.getPriceAfterApplyCoupon(this.selectedPrice.price)==this.selectedPrice.discounted_new_price&&(this.totalGroupBookingUser=1));0==n&&0==this.members.length&&(this.members.push({first_name:this.user.first_name,last_name:this.user.last_name,email:this.user.email,id_number:this.user.id_number,alternative_cell:this.user.alternative_cell,cell:this.user.cell}),this.prices=[],this.selectedPrice&&this.prices.push(this.selectedPrice.discounted_new_price),this.selectedPrice&&this.getPriceAfterApplyCoupon(this.selectedPrice.price)==this.selectedPrice.discounted_new_price&&(this.totalGroupBookingUser=1),this.staffs.push(this.user.id))}}},computed:{selectedEvent:function(){return this.getSelectedEvent()},selectedVenue:function(){if(""!=this.selectedEventId)return this.getSelectedVenue()},selectedPricing:function(){return this.getSelectedPricing()},selectedProduct:function(){return this.getSelectedProduct()},getDiscountedPrice:function(){this.discounted_price=this.discount(this.selectedProduct.price,this.selectedProduct.listings[0].discount,this.selectedProduct.listings[0].discount_type)},total:function(){if(1==this.type)var e=this.prices.reduce(function(e,t){return parseFloat(e)+parseFloat(t)},0),t=this.getTotalGroupBookingDiscount();else e=this.selectedPrice.discounted_new_price,t=0;var n=this.getTotalDiatry(),i=this.getTotalExtras(),r=this.getDonations(),s=(s=0,parseFloat(e)+parseFloat(i)+parseFloat(n)+parseFloat(r)-parseFloat(t));return s<0&&(s=0),s.toFixed(2)}},methods:{SelectedOption:function(e){this.selectedOption=e,this.selectedEventId="",this.selectedVenueId="",this.selectedDateId="",this.selectedPricingId=""},changeEventSelection:function(){this.selectedDateId="",this.selectedVenueId="",this.selectedExtraId=[],this.pricings=0,this.venues=0,this.getVenues(),this.eventsDate=[],this.selectedPricingId=0,this.venues=0},changeVenueSelection:function(){this.selectedDateId=this.selectedVenue.dates[0].id,this.getPricings(),this.getDates()},updatedSelectedPrice:function(e){var t=this;this.$http.get("find/"+this.selectedVenueId+"/pricings").then(function(e){t.pricings=e.data.pricings,t.eventPriceDetails=e.data.pricings,t.selectedPricingId=t.pricings[0].id,t.selectedPrice=t.priceDatails[0]})},updatedSelectedPriceDetails:function(){var e=this;this.$http.get("pricing/details/"+this.selectedPricingId).then(function(t){e.selectedPrice=t.data})},updateSinglePrice:function(e){this.singlePrice=e},getEventById:function(e){return _.find(this.events,{id:e})},getSelectedEvent:function(){return this.getEventById(this.selectedEventId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getSelectedVenue:function(){return this.getVenueById(this.selectedVenueId)},getVenues:function(){var e=this;this.$http.get("find/"+this.selectedEventId+"/venues").then(function(t){e.venues=t.data.venues,e.selectedVenueId=e.venues[0].id,e.pricegroup=t.data.pricegroup,e.getPricings(),e.getDates()})},getPricings:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/pricings").then(function(t){e.pricings=t.data.pricings,e.eventPriceDetails=t.data.pricings,e.selectedPricingId=e.pricings[0].id,e.selectedPrice=e.pricings[0]})},getDates:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/dates").then(function(t){e.eventsDate=t.data.dates,e.selectedDateId=e.eventsDate[0].id,e.dates.push(e.eventsDate[0])})},getProductById:function(e){return _.find(this.products,{id:e})},getSelectedProduct:function(){return this.getProductById(this.selectedproductId)},getPriceCalculartion:function(e,t,n){currentPriceId=this.selectedPricingId;var i,r,s=_.filter(this.eventPriceDetails,function(e){return e.id==currentPriceId})[0].price,o=0,a=s;for(0==t&&(t=e),i=2;i<=e;i++)for(r=0;r<this.pricegroup.length;r++)i>=this.pricegroup[r].min_user&&i<=this.pricegroup[r].max_user&&(o=this.pricegroup[r].discount,a-=Math.round(a*o/100));for(i=2;i<=t;i++)for(r=0;r<this.pricegroup.length;r++)i>=this.pricegroup[r].min_user&&i<=this.pricegroup[r].max_user&&(o=this.pricegroup[r].discount,s-=Math.round(s*o/100));return t==e?"From "+s+" per person":"From "+a+" - "+s+" per person"},discount:function(e,t,n){return"percentage"==n?parseFloat(e*(t/100)):t},applyCouponCode:function(){var e=this,t=this.selectedEventId,n={type:"event",event_name:this.selectedEvent.name,code:this.Couponcode};this.$http.post("/check/"+t,n).then(function(t){1==t.data.status?(!0,e.couponApplied=!0,swal({type:"success",title:"Coupon Code",text:t.data.message})):swal({type:"error",title:"Error",text:t.data.message})})},dateChanged:function(){this.dates.length>this.selectedPrice.day_count&&(this.dates=_.slice(this.dates,1))},setMembers:function(){this.members=this.staff},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.pu
1sh(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.eventSignup.staffs=this.selectedStaff},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},cancelInvite:function(){this.company.invite.first_name="",this.company.invite.last_name="",this.company.invite.email="",this.company.invite.id_number="",this.company.invite.alternative_cell="",this.company.invite.cell="",this.addingMemberDetails=!1,this.inviteStaff=!1},checkInviteMember:function(){return""==this.company.invite.first_name&&(this.errors.invite.first_name="First name is required"),""==this.company.invite.last_name&&(this.errors.invite.last_name="Last name is required"),""==this.company.invite.email&&(this.errors.invite.email="Email is required"),""==this.company.invite.cell&&(this.errors.invite.cell="Cell is required"),!(this.errors.invite.cell||this.errors.invite.first_name||this.errors.invite.last_name||this.errors.invite.email)||(swal({type:"warning",title:"Fill all the fields"}),this.errors.invite.cell="",this.errors.invite.first_name="",this.errors.invite.last_name="",this.errors.invite.email="",!1)},sendInvitation:function(){this.checkInviteMember()&&(this.pendingMembersEmails.includes(this.company.invite.email)?swal({type:"warning",title:"This member is already added"}):(this.pendingMembersEmails.push(this.company.invite.email),this.pendingMembers.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:this.company.invite.alternative_cell,cell:this.company.invite.cell}),this.members.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:this.company.invite.alternative_cell,cell:this.company.invite.cell}),this.staffs.push({first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,id_number:this.company.invite.id_number,alternative_cell:this.company.invite.alternative_cell,cell:this.company.invite.cell}),this.company.invite.first_name="",this.company.invite.last_name="",this.company.invite.email="",this.company.invite.id_number="",this.company.invite.alternative_cell="",this.company.invite.cell="",this.addingMemberDetails=!1,this.prices.push(this.getPriceAfterApplyCoupon(this.selectedPrice.price)),this.totalGroupBookingUser++))},checkAndFillMember:function(){var e=this;if(""==this.invite_email||!this.isValidEmail(this.invite_email))return swal({type:"warning",title:"Please enter valid email"}),this.invite_email="",!1;var t=this.invite_email,n=!1;if(this.members.forEach(function(e,i){e.email==t&&(n=!0)}),n)return swal({type:"warning",title:"Given Email Is Already Added",text:"Try To Add Other Email"}),this.inviteStaff=!1,this.invite_email="",!1;this.$http.post("/checkuser",{email:this.invite_email,event_id:this.selectedEventId,price_id:this.selectedPricingId}).success(function(t){"success"==t.status?t.hasTicket?swal({type:"warning",title:"User already registered for this event",text:"Try To Add Other Email"}):(e.members.push(t.member),e.staffs.push(t.member.id),e.prices.push(t.member.price),e.getPriceAfterApplyCoupon(e.selectedPrice.price)==t.member.price&&(e.totalGroupBookingUser+=1)):(e.company.invite.email=e.invite_email,e.addingMemberDetails=!0),e.inviteStaff=!1,e.invite_email=""}).catch(function(e){})},isValidEmail:function(e){return/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,}$/.test(e)},removeMember:function(e){var t;this.members.forEach(function(n,i){n.email==e.email&&(t=i)}),this.prices[t]==this.getPriceAfterApplyCoupon(this.selectedPrice.price)&&(this.totalGroupBookingUser-=1),this.members.splice(t,1),this.prices.splice(t,1),this.staffs.splice(t,1),this.pendingMembers.splice(t,1),this.pendingMembersEmails.splice($.inArray(e.email,this.pendingMembersEmails),1)},getTotalPricing:function(){if(!this.selectedPrice)return 0;var e=this.selectedPrice.price;if(this.totalGroupBookingUser>0&&1==this.type){if(this.pricegroup.length>0&&this.totalGroupBookingUser>1){for(var t=e,n=0,i=this.totalGroupBookingUser,r=2;r<=i;r++)for(var s=0;s<this.pricegroup.length;s++){if(r>=this.pricegroup[s].min_user&&r<=this.pricegroup[s].max_user)n=this.pricegroup[s].discount,t-=Math.round(t*n/100)}e=t}e*=this.totalGroupBookingUser}return 1==this.type&&0==this.totalGroupBookingUser&&(e=0),e},getTotalDiatry:function(){return null!=this.dietary&&this.dietary.price>0?(totalDiatry=this.dietary.price,this.dates.length>1&&(totalDiatry*=this.dates.length),this.staffs.length>0&&1==this.type&&(totalDiatry*=this.staffs.length),1==this.type&&0==this.staffs.length&&(totalDiatry=0),totalDiatry):0},getTotalExtras:function(){var e=0;return this.extras.forEach(function(t){e=parseInt(e)+parseInt(t.price)}),this.staffs.length>0&&1==this.type&&(e*=this.staffs.length),1==this.type&&0==this.staffs.length&&(e=0),e},getDonations:function(){var e=0;return this.donations&&(e=this.donations*this.staffs.length),e},getTotalGroupBookingDiscount:function(){var e=0;if(!this.selectedPrice)return 0;var t=this.getPriceAfterApplyCoupon(this.selectedPrice.price),n=t;if(this.totalGroupBookingUser>0&&1==this.type&&this.pricegroup.length>0&&this.totalGroupBookingUser>1)for(var i=this.totalGroupBookingUser,r=2;r<=i;r++)for(var s=0;s<this.pricegroup.length;s++){if(r>=this.pricegroup[s].min_user&&r<=this.pricegroup[s].max_user)n-=n*this.pricegroup[s].discount/100}return e=parseFloat(t-n)*this.totalGroupBookingUser,1==this.type&&0==this.staffs.length&&(e=0),e.toFixed(2)},updatedPrices:function(){var e=this;this.prices=[],this.totalGroupBookingUser=0,this.$http.post("/get_price_details",{staffs:this.staffs,price_id:this.selectedPricingId}).success(function(t){for(var n=0;n<t.length;n++)e.prices.push(t[n]),e.getPriceAfterApplyCoupon(e.selectedPrice.price)==t[n]&&(e.totalGroupBookingUser+=1)}).catch(function(e){})},getPriceAfterApplyCoupon:function(e){if(null!=this.usedcoupon&&""!=this.usedcoupon&&void 0!=this.usedcoupon){if("percentage"==this.usedcoupon.discount_type){var t=e*this.usedcoupon.discount_amount/100;return parseFloat(e)-parseFloat(t)}return parseFloat(e)-parseFloat(this.usedcoupon.discount_amount)}return parseFloat(e)},generatePurchaseOrder:function(){var e=this;swal({type:"warning",title:"Processing order",text:"Please wait while we are generating order.Do not Refresh page or close browser"}),this.$http.post("/admin/validate/users",{selectedEventId:this.selectedEventId,staffs:this.staffs,type:"Normal"}).success(function(t){if(0==t.data.length)e.$http.post("/admin/member/"+e.user.id+"/events/register/order",{selectedEventId:e.selectedEventId,selectedVenueId:e.selectedVenueId,selectedDateId:e.selectedDateId,selectedPricingId:e.selectedPricingId,staffs:e.staffs,dietary:e.dietary,selectedExtraId:e.selectedExtraId,donatons:e.donations,extras:e.extras,dates:e.dates.filter(function(t){return t.id===e.selectedDateId}),date_id:e.date_id,type:e.type,is_new_feature:!0}).success(function(t){1==t.status?(e.busy=!1,swal.close(),setTimeout(function(){swal({type:"success",title:"Order Generated",text:"Your order generated successfully"}),window.location="/admin/"+e.user.id+"/orders"},2e3)):(e.busy=!1,swal.close(),setTimeout(function(){swal({type:"error",title:"Please try again",text:t.message})},1e3))}).catch(function(t){e.busy=!1,swal({type:"error",title:"Error",text:"Your order has failed, please try again"})});else{var n=t.data.join(",")+" already registered for event";e.busy=!1,swal({type:"error",title:"Error",text:n})}}).catch(function(t){e.busy=!1,swal({type:"error",title:"Error",text:"Your order has failed, please try again"})})},changeEventYear:function(){var e=this;this.$http.get("/get_event_by_year/"+this.eventYear).success(function(t){e.events=t}).catch(function(e){})}}})},function(e,t){Vue.component("course-order-template",{props:{selectedOption:"",courses:"",venues:"",pricings:"",dates:"",products:"",selectedCourseId:"",selectedVenueId:"",selectedDateId:"",selectedPricingId:"",selectedproductId:"",discounted_price:"",course_type:""},data:function(){return{couponApplied:!1}}
1,computed:{selectedEvent:function(){return this.getSelectedEvent()},selectedVenue:function(){return this.getSelectedVenue()},selectedPricing:function(){return this.getSelectedPricing()},selectedProduct:function(){return this.getSelectedProduct()},getDiscountedPrice:function(){this.discounted_price=this.discount(this.selectedProduct.price,this.selectedProduct.listings[0].discount,this.selectedProduct.listings[0].discount_type)}},methods:{SelectedOption:function(e){this.selectedOption=e,this.selectedCourseId="",this.selectedVenueId="",this.selectedDateId="",this.selectedPricingId=""},changeCourseselection:function(){this.selectedDateId="",this.selectedVenueId="",this.selectedExtraId=[],this.pricings=0,this.venues=0,this.dates=0,this.selectedPricingId=0,this.venues=0},changeVenueSelection:function(){this.selectedDateId=this.selectedVenue.dates[0].id,this.getPricings(),this.getDates()},getEventById:function(e){return _.find(this.courses,{id:e})},getSelectedEvent:function(){return this.getEventById(parseInt(this.selectedCourseId))},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getSelectedVenue:function(){return this.getVenueById(this.selectedVenueId)},getPrice:function(){return this.courses.filter(function(e){return e.id==this.selectedCourseId})},getPricings:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/pricings").then(function(t){e.pricings=t.data.pricings,e.selectedPricingId=e.pricings[0].id})},getDates:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/dates").then(function(t){e.dates=t.data.dates,e.selectedDateId=e.dates[0].id})},applyCouponCode:function(){var e=this,t=this.selectedCourseId,n={type:"course",event_name:this.selectedEvent.title,code:this.Couponcode};this.$http.post("/check/"+t,n).then(function(t){1==t.data.status?(!0,e.couponApplied=!0,swal({type:"success",title:"Coupon Code",text:t.data.message})):swal({type:"error",title:"Error",text:t.data.message})})},isOnDemandCourse:function(){var e=this,t=this.courses.filter(function(t){return t.id==parseInt(e.selectedCourseId)});return"on_demand"!=t[0].course_intake_type||"short"!=t[0].course_type}}})},function(e,t){Vue.component("plan-order-template",{props:{selectedOption:"",plans:"",venues:"",pricings:"",staff:null,companys:[],dates:"",products:"",selectedCourseId:"",selectedVenueId:"",selectedDateId:"",selectedPricingId:"",selectedproductId:"",discounted_price:"",user:null},data:function(){return{companyId:0,selectedPlan:[],inviteStaff:!1,selectedStaff:[],isComanySetup:!1,selectedStaffCount:0,isPracticePlan:!1,planType:"month",plansList:[],filterPlan:[],errors:{company:[],invite:[],billing_company:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}}}},ready:function(){this.setPlanType(),this.companyId=this.companys.length>0?this.companys[0].id:0},watch:{staff_count:function(e){}},computed:{selectedEvent:function(){return this.getSelectedEvent()},filterPlan:function(){return this.setPlanType()},selectedVenue:function(){return this.getSelectedVenue()},selectedPricing:function(){return this.getSelectedPricing()},selectedProduct:function(){return this.getSelectedProduct()},getDiscountedPrice:function(){this.discounted_price=this.discount(this.selectedProduct.price,this.selectedProduct.listings[0].discount,this.selectedProduct.listings[0].discount_type)},selectedPlanPrice:function(){if(this.selectedPlan)return void 0!==this.getPlanPrice()&&this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price}},methods:{SelectedOption:function(e){this.selectedOption=e,this.selectedCourseId="",this.selectedVenueId="",this.selectedDateId="",this.selectedPricingId=""},getPlanPrice:function(){if(this.selectedPlan.pricing_group.length>0){var e=this.staff_count,t=_.max(this.selectedPlan.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.selectedPlan.pricing_group,function(e){return 0==parseInt(e.max_user)});if(void 0!==n&&n.length>0){var i=n[0].min_user;n[0].max_user;if(e>=i)return n}return void 0!==t&&e>t?_.filter(this.selectedPlan.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.selectedPlan.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},changeplanselection:function(){this.selectedDateId="",this.selectedVenueId="",this.selectedExtraId=[],this.pricings=0,this.venues=0,this.selectedPlan=this.getPrice()[0],this.checkisPracticePlan(),this.dates=0,this.selectedPricingId=0,this.venues=0}
1,toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},changeVenueSelection:function(){this.selectedDateId=this.selectedVenue.dates[0].id,this.getPricings(),this.getDates()},getEventById:function(e){return _.find(this.plans,{id:e})},getSelectedEvent:function(){return this.getEventById(this.selectedCourseId)},getVenueById:function(e){return _.find(this.selectedEvent.venues,{id:e})},getSelectedVenue:function(){return this.getVenueById(this.selectedVenueId)},getPrice:function(){var e=this.selectedCourseId;return this.plans.filter(function(t){return t.id==e})},checkisPracticePlan:function(){this.selectedPlan.length>0&&(1==this.selectedPlan[0].is_practice?this.isPracticePlan=!0:this.isPracticePlan=!1)},getPricings:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/pricings").then(function(t){e.pricings=t.data.pricings,e.selectedPricingId=e.pricings[0].id})},getDates:function(){var e=this;this.$http.get("find/"+this.selectedVenueId+"/dates").then(function(t){e.dates=t.data.dates,e.selectedDateId=e.dates[0].id})},sendInvitation:function(){var e=this;return this.isValidEmail(this.company.invite.email)?this.validatePhoneNumber(this.company.invite.cell)?void this.$http.post("/dashboard/company/store_invite",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,id_number:this.company.invite.id_number,cell:this.company.invite.cell,company_id:this.companyId}).success(function(t){1==t.status?e.staff.push(t.staff):swal({type:"error",title:"Error",text:t.message}),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data}):(swal({type:"error",title:"Cell Error",text:"Please enter valid Cell Number"}),!1):(swal({type:"error",title:"Email Error",text:"Please enter valid Email"}),!1)},setSelectedStaff:function(e){e.target.checked?this.selectedStaff.push(e.target.value):this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.selectedStaff=this.selectedStaff},createCompany:function(){var e=this;this.$http.post("/dashboard/company/saveCompany",{title:this.company.detail.title,company_vat:this.company.detail.company_vat,plan:this.company.detail.plan,plan_id:this.company.detail.plan_id,user_id:this.user.id,employees:this.company.detail.employees,address_line_one:this.company.detail.address_line_one,address_line_two:this.company.detail.address_line_two,province:this.company.detail.province,city:this.company.detail.city,area_code:this.company.detail.area_code,country:this.company.detail.country}).success(function(t){e.companys.push(t),e.companyId=t.id}).catch(function(t){e.errors.company=t.data})},setPlanType:function(){var e=this.planType;return console.log(e),_.filter(this.plans,function(t){return t.interval==e&&1!=t.inactive})},isValidEmail:function(e){return/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,}$/.test(e)},validatePhoneNumber:function(e){return/^\+?\d{11}$/.test(e)}}})},function(e,t){Vue.component("app-legislation-index-screen",{props:{actlist:""},computed:{filteredList:function(){var e=this;return this.actlist.filter(function(t){return t.name.toLowerCase().includes(e.search.toLowerCase())})}},methods:{}})},function(e,t){Vue.component("app-new-subscription",{props:{plans:[]},data:function(){return{planId:"",selectedPlan:""}},ready:function(){},methods:{planChange:function(){this.selectedPlan=this.getPlanById(this.planId)},getPlanById:function(e){return _.find(this.plans,{id:e})}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-order-pay",{props:{order:{required:!0},user:{required:!0},staff:null,selectedplan:null,companys:null,scriptendpoint:""},data:function(){return{companyId:0,redirect_form_key:[],instantlink:"",selectedPlan:[],inviteStaff:!1,selectedStaff:[],isComanySetup:!1,selectedStaffCount:0,isPracticePlan:!1,is_practice_plan:!1,errors:{company:[],invite:[],billing_company:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},payment_token:"",instant_eft_success:!1,forms:{pay:$.extend(!0,new AppForm({busy:!1,paymentOption:"cc",card:null,terms:!1,staffcount:null,bf:!1,pricing_group:[]}),App.forms.pay)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.companyId=this.companys.length>0?this.companys[0].id:0,this.selectedPlan=this.selectedplan,window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.pay.busy=!1,swal.close()},2e3)}catch(e){_this.forms.pay.busy=!1,swal.close()}})},watch:{selectedStaffLength:function(e){e>0&&this.selectedPlanIsYearly}},computed:{selectedStaffLength:function(){return this.selectedStaff.length},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.pay.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0}},mounted:function(){this.loadPeachScript()},methods:{toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},getPlanPrice:function(){if(this.selectedplan.pricing_group.length>0){var e=parseInt(this.selectedStaff.length)+parseInt(1),t=_.max(this.selectedPlan.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.selectedPlan.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e>=i)return n}return 0==n.length&&e>t?_.filter(this.selectedPlan.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.selectedPlan.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e)&&parseInt(t.max_user)>=parseInt(e)})}return[]},setSelectedStaff:function(e){if(order_quantity=0,this.order.items.length>0&&(order_quantity=parseInt(this.order.items[0].quantity)-parseInt(1)),e.target.checked){if(parseInt(this.selectedStaff.length)+parseInt(1)>order_quantity)return swal({type:"warning",title:"Warning",text:"You Can't select more then "+order_quantity+" staff member"}),e.target.checked=!1,!1;
1this.selectedStaff.push(e.target.value)}else this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.pay.staff=this.selectedStaff},loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.pay.busy=!0,this.getEftLink())},addCard:function(){var e=this;this.newcard.return="/invoices/settle/"+this.order.id+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1,swal.close();else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},pay:function(){this.forms.pay.errors.forget(),this.forms.pay.busy=!0,this.process(),this.sendPay()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},sendPay:function(){var e=this;if(this.validate())if("eft"!=this.forms.pay.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.pay.paymentOption&&!this.forms.pay.card)return swal({type:"warning",title:"Error",text:"Unable to register without credit card, please select credit card"}),void(this.forms.pay.busy=!1);var t={terms:this.forms.pay.terms,card:this.forms.pay.card,paymentOption:this.forms.pay.paymentOption,staff:this.selectedStaff};this.processPayment(),this.$http.post("/invoice/order/settle/"+this.order.id,t).success(function(t){e.forms.pay.busy=!1,swal.close(),window.location="/dashboard/invoice_orders"}).error(function(t){e.forms.pay.busy=!1,t&&t.errors&&t.errors.card?swal({type:"error",title:"Whoops",text:t.errors.card}):t&&t.message&&""!==t.message?swal({type:"error",title:"Whoops",text:t.message}):swal.close(),e.forms.pay.errors.set(t)})}else this.forms.pay.busy=!0},cancelPayment:function(){this.forms.pay.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={order:this.order.id},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.pay.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}
1(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.pay.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendPay()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.pay.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.pay.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendPay()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},clearselectedStaff:function(){this.selectedStaff=[]},sendInvitation:function(){var e=this;return this.isValidEmail(this.company.invite.email)?this.validatePhoneNumber(this.company.invite.cell)?void this.$http.post("/dashboard/company/store_invite",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,id_number:this.company.invite.id_number,cell:this.company.invite.cell,company_id:this.companyId}).success(function(t){1==t.status?e.staff.push(t.staff):swal({type:"error",title:"Error",text:t.message}),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data}):(swal({type:"error",title:"Cell Error",text:"Please enter valid Cell Number"}),!1):(swal({type:"error",title:"Email Error",text:"Please enter valid Email"}),!1)},createCompany:function(){var e=this;this.$http.post("/dashboard/company/saveCompany",{title:this.company.detail.title,company_vat:this.company.detail.company_vat,plan:this.company.detail.plan,plan_id:this.company.detail.plan_id,user_id:this.company.detail.user_id,employees:this.company.detail.employees,address_line_one:this.company.detail.address_line_one,address_line_two:this.company.detail.address_line_two,province:this.company.detail.province,city:this.company.detail.city,area_code:this.company.detail.area_code,country:this.company.detail.country}).success(function(t){e.companys.push(t),e.companyId=t.id}).catch(function(t){e.errors.company=t.data})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},isValidEmail:function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},validatePhoneNumber:function(e){return/^\+?\d{11}$/.test(e)},validate:function(){return!!this.forms.pay.terms||(swal({type:"warning",title:"Error",text:"Please accept term's and condition to process booking!"}),this.forms.pay.busy=!1,!1)}}})},function(e,t){Vue.component("login_web",{data:function(){return{forms:{login:$.extend(!0,new AppForm({email:"",password:""}),App.forms.login_form)}}},ready:function(){URI(document.URL).query(!0)},methods:{sendLogin:function(){this.process(),this.$http.post("/login",this.forms.login).then(function(e){location.reload()})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}}})},function(e,t){Vue.component("auth-login",{data:function(){return{isSuccess:!1,isEmailExist:!1,createNew:!1,hidePassword:!1}},ready:function(){void 0!==$.cookie("plan")&&""!=$.cookie("plan")&&(this.hidePassword=!0)},methods:{checkemail:function(){var e=this;e.isSuccess?($("#login_form").submit(),$.cookie("email","")):e.$http.post("/checklogin",e.forms.login).then(function(t){"success"==t.data.status?($("#login_form").attr("onSubmit",""),e.isEmailExist=!0,e.isSuccess=!0,e.createNew=!1):(e.createNew=!0,$.co
1okie("email",e.forms.login.email))})},sendLogin:function(){this.process(),this.$http.post("/login",this.forms.login).then(function(e){location.reload()})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("app-admin-order-pay",{props:{order:{required:!0},user:{required:!0},staff:null,selectedplan:null,companys:null,scriptendpoint:""},data:function(){return{instantlink:"",amount:0,pricedeault:0,selectedPlan:[],inviteStaff:!1,selectedStaff:[],isComanySetup:!1,selectedStaffCount:0,isPracticePlan:!1,is_practice_plan:!1,errors:{company:[],invite:[],billing_company:[]},company:{detail:{title:"",company_vat:"",plan:"",plan_id:"",user_id:"",employees:"",address_line_one:"",address_line_two:"",province:"",city:"",area_code:"",country:""},invite:{first_name:"",last_name:"",cell:"",alternative_cell:"",email:"",id_number:""}},payment_token:"",instant_eft_success:!1,forms:{pay:$.extend(!0,new AppForm({busy:!1,paymentOption:"cc",card:null,terms:!1,staffcount:null,bf:!1,pricing_group:[]}),App.forms.pay)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},ready:function ready(){var _this=this;this.selectedPlan=this.selectedplan,this.order.items.length>0&&(this.amount=parseFloat(this.order.items[0].price)*parseInt(this.order.items[0].quantity)-parseFloat(this.order.discount),this.pricedeault=this.order.items[0].price),window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.pay.busy=!1,swal.close()},2e3)}catch(e){_this.forms.pay.busy=!1,swal.close()}})},mounted:function(){this.loadPeachScript()},watch:{selectedStaffLength:function(e){e>0&&this.selectedPlanIsYearly}},computed:{selectedStaffLength:function(){return this.selectedStaff.length},selectedPlanPrice:function(){if(this.selectedPlan)return this.forms.pay.bf?"R "+this.selectedPlan.bf_price:this.getPlanPrice().length>0?"R "+this.getPlanPrice()[0].price:"R "+this.selectedPlan.price},selectedPlanIsMonthly:function(){if("month"==this.selectedPlan.interval)return!0},selectedPlanIsYearly:function(){if("year"==this.selectedPlan.interval)return!0}},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},toggleStaff:function(){this.inviteStaff?this.inviteStaff=!1:this.inviteStaff=!0},sendInvitation:function(){var e=this;this.$http.post("/dashboard/company/store_invite_company",{first_name:this.company.invite.first_name,last_name:this.company.invite.last_name,email:this.company.invite.email,alternative_cell:this.company.invite.alternative_cell,user:this.order.user_id,id_number:this.company.invite.id_number,cell:this.company.invite.cell}).success(function(t){1==t.status?e.staff.push(t.staff):swal({type:"error",title:"Error",text:t.message}),e.company.invite.first_name="",e.company.invite.last_name="",e.company.invite.email="",e.company.invite.id_number="",e.company.invite.alternative_cell="",e.company.invite.cell="",e.toggleStaff()}).catch(function(t){e.errors.invite=t.data})},getPlanPrice:function(){if(this.selectedplan.pricing_group.length>0){var e=this.selectedStaff,t=_.max(this.selectedPlan.pricing_group.map(function(e){return e.max_user})),n=_.filter(this.selectedPlan.pricing_group,function(e){return 0==parseInt(e.max_user)});if(n.length>0){var i=n[0].min_user;if(e.length>i)return n}return e.length>t?_.filter(this.selectedPlan.pricing_group,function(e){return parseInt(e.max_user)==parseInt(t)}):_.filter(this.selectedPlan.pricing_group,function(t){return parseInt(t.min_user)<=parseInt(e.length)&&parseInt(t.max_user)>=parseInt(e.length)})}return[]},setSelectedStaff:function(e){if(order_quantity=0,this.order.items.length>0&&(order_quantity=parseInt(this.order.items[0].quantity)-parseInt(1)),e.target.checked){if(parseInt(this.selectedStaff.length)+parseInt(1)>order_quantity)return swal({type:"warning",title:"Warning",text:"You Can't select more then "+order_quantity+" staff member"}),e.target.checked=!1,!1;
1this.selectedStaff.push(e.target.value)}else this.selectedStaff.splice($.inArray(e.target.value,this.selectedStaff),1),this.forms.pay.staff=this.selectedStaff},popEft:function(){this.process(),this.forms.pay.busy=!0,this.getEftLink()},addCard:function(){var e=this;this.newcard.return="/invoices/settle/"+this.order.id+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1,swal.close();else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.subscription.card=e.data.card.id,swal.close()}).catch(function(e){e.data.number&&swal({type:"error",title:"Whoops",text:e.data.number})})},pay:function(){this.forms.pay.errors.forget(),this.forms.pay.busy=!0,this.process(),this.sendPay()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},sendPay:function(){var e=this;if("eft"!=this.forms.pay.paymentOption||0!=this.instant_eft_success){var t={terms:this.forms.pay.terms,card:this.forms.pay.card,paymentOption:this.forms.pay.paymentOption,staff:this.forms.pay.staff};this.processPayment(),this.$http.post("/invoice/order/settle/"+this.order.id,t).success(function(t){e.forms.pay.busy=!1,swal.close(),window.location="/dashboard/invoice_orders"}).error(function(t){e.forms.pay.busy=!1,t&&t.errors&&t.errors.card?swal({type:"error",title:"Whoops",text:t.errors.card}):t&&t.message&&""!==t.message?swal({type:"error",title:"Whoops",text:t.message}):swal.close(),e.forms.pay.errors.set(t)})}else this.forms.pay.busy=!0},cancelPayment:function(){this.forms.pay.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={order:this.order.id},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.pay.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.pay.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendPay()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.pay.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.pay.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendPay()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";
1Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("enroll",{props:{user:{required:!0},course:{required:!0},donations:{required:!1,default:!1},scriptendpoint:""},data:function(){return{redirect_form_key:[],option:null,course_total:0,course_type:"full",id_number:null,address:{street_name:"",building:"",suburb:"",city:"",province:"",country:"",postal_code:"",errors:[]},contact:{first_name:"",last_name:"",email:"",contact_number:"",errors:[]},id_type:"",country_of_issue:"",incometax_reference_number:"",company_name:"",company_registrations_number:"",date_of_birth:"",post_code:"",postal_address:"",instantlink:"",payment_token:"",instant_eft_success:!1,couponApplied:!1,forms:{enroll:$.extend(!0,new AppForm({busy:!1,paymentOption:null,card:null,donations:1,terms:!1}),App.forms.enroll),addingNewCard:!1},newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},ready:function ready(){var _this=this;""!=this.user.id_number&&(this.id_number=this.user.id_number),this.user.addresses[0]&&(this.address.street_name=this.user.addresses[0].line_one,this.address.suburb=this.user.addresses[0].line_two,this.address.province=this.user.addresses[0].province,this.address.country=this.user.addresses[0].country,this.address.city=this.user.addresses[0].city,this.address.postal_code=this.user.addresses[0].area_code),this.user&&(this.contact.first_name=this.user.first_name,this.contact.last_name=this.user.last_name,this.contact.email=this.user.email,this.contact.contact_number=this.user.cell),this.course.semester_price=""!=this.course.semester_price?this.course.semester_price:0,window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.enroll.busy=!1,swal.close()},2e3)}catch(e){_this.forms.enroll.busy=!1}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.enroll.busy=!0,this.forms.enroll.donations&&"yearly"==this.option?this.fieldValidate():this.getEftLink())},fieldValidate:function(){var e={id_number:this.id_number,street_name:this.address.street_name,building:this.address.building,suburb:this.address.suburb,city:this.address.city,province:this.address.province,country:this.address.country,postal_code:this.address.postal_code};this.processPayment(),this.$http.post("checkout/validate",e).success(function(e){this.forms.enroll.busy=!1,swal.close(),this.getEftLink()}).error(function(e){swal("Error","Donation details validation failed!","warning"),this.address.errors=e,this.forms.enroll.busy=!1,swal.close(),this.forms.enroll.errors.set(e)})},coursetotalCalculate:function(){"monthly"==this.option&&(this.course_total=this.course.monthly_enrollment_fee),"yearly"==this.option&&("on_demand"==this.course.course_intake_type&&"short"==this.course.course_type&&this.course.black_friday_discounts&&this.course.black_friday_price>0?this.course_total=this.course.black_friday_price:this.course_total=this.course.annual_discounted_price,"semester"==this.course.type_of_course&&("partially"==this.course_type&&(this.course_total=this.course.semester_price),"full"==this.course_type&&("on_demand"==this.course.course_intake_type&&"short"==this.course.course_type&&this.course.black_friday_discounts&&this.course.black_friday_price>0?this.course_total=this.course.black_friday_price:this.course_total=this.course.semester_price*this.course.no_of_semesters)))},addCard:function(){var e=this;this.newcard.return="/courses/enroll/"+this.course.reference+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.forms.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.enroll.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},applyCouponCode:function(){var e=this,t=$("input[name=course_id]").val(),n=this.serializeData($("#Coupon_code_apply").seri
1alizeArray());this.$http.post("/check/"+t,n).success(function(t){1==t.status?(e.couponApplied=!0,$courseObj=JSON.parse(t.object),e.course.annual_discounted_price=$courseObj.annual_discounted_price):swal({type:"error",title:"Error",text:t.message})})},serializeData:function(e){var t={};return $.each(e,function(){t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(this.value||"")):t[this.name]=this.value||""}),t},cancelPayment:function(){this.forms.enroll.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={course:this.course.id,option:this.option,course_type:this.course_type,donation_amount:this.getDonations()},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.enroll.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.enroll.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.enroll.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.enroll.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},processLead:function(){swal({type:"warning",title:"Request Processing",text:"Please wait while we are processing your request.Do not Refresh page or close browser"})},register:function(){this.forms.enroll.errors.forget(),this.forms.enroll.busy=!0,this.sendRegistration()},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];e.push({item_id:String(this.course.id),item_name:this.course.title,item_category:this.course.course_type,price:parseFloat(parseFloat(this.course_total).toFixed(2)),quantity:1}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.course_total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){var t=this;window.dataLayer=window.dataLayer||[];var n=[];e.items&&e.items.length>
10&&e.items.forEach(function(e){n.push({item_id:String(e.item_id),item_name:e.name,item_category:t.course.course_type,price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:n},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0}),console.log("done")},getPaymentMethod:function(){return"cc"==this.forms.enroll.paymentOption?"Credit Card":"eft"==this.forms.enroll.paymentOption?"Instant EFT":""},sendRegistration:function(){if(this.validate())if("eft"!=this.forms.enroll.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.enroll.paymentOption&&!this.forms.enroll.card)return swal({type:"warning",title:"Error",text:"Unable to purchase without credit card, please select credit card"}),void(this.forms.enroll.busy=!1);var e={course:this.course.id,course_type:this.course_type,terms:this.forms.enroll.terms,card:this.forms.enroll.card,paymentOption:this.forms.enroll.paymentOption,enrollmentOption:this.option,donations:this.getDonations(),id_number:this.id_number,street_name:this.address.street_name,building:this.address.building,suburb:this.address.suburb,city:this.address.city,province:this.address.province,country:this.address.country,postal_code:this.address.postal_code,id_type:this.id_type,country_of_issue:this.country_of_issue,incometax_reference_number:this.incometax_reference_number,company_name:this.company_name,company_registrations_number:this.company_registrations_number,date_of_birth:this.date_of_birth,post_code:this.post_code,postal_address:this.postal_address,first_name:this.contact.first_name,last_name:this.contact.last_name,email:this.contact.email,contact_number:this.contact.contact_number};"student_loan"!=this.forms.enroll.enrollmentOption&&(this.beginCheckout(),this.processPayment()),this.$http.post("/courses/checkout/"+this.course.reference+"/complete",e).success(function(e){this.forms.enroll.busy=!1,"student_loan"!=this.option&&swal.close(),"student_loan"==this.option?(swal({type:"success",title:"success",text:e.message}),setTimeout(function(){swal.close(),window.location="/dashboard/courses"},2e3)):(void 0!==e.invoice&&this.sendTransactions(e.invoice),window.location="/dashboard/courses")}).error(function(e){this.address.errors=e,this.forms.enroll.busy=!1,"student_loan"==this.option&&(this.contact.errors=e),swal.close(),this.forms.enroll.errors.set(e)})}else this.forms.enroll.busy=!0},getDonations:function(){var e=0;return this.forms.enroll.donations&&"yearly"==this.option&&(e=this.donations),e},validate:function(){if(this.forms.enroll.donations&&"yearly"==this.option&&!(this.id_number&&this.id_type&&this.country_of_issue&&this.incometax_reference_number&&this.date_of_birth&&this.post_code&&this.postal_address))return swal({type:"error",title:"Donation Details Required",text:"Please complete all donation fields before proceeding."}),this.forms.enroll.busy=!1,!1;if("student_loan"==this.option){var e=this.contact||{},t=e.first_name,n=e.last_name,i=e.contact_number,r=e.email;if(!(t&&""!==t.trim()&&n&&""!==n.trim()&&i&&""!==i.trim()&&r&&""!==r.trim()))return swal("Error","Please enter valid contact details","warning"),this.forms.enroll.busy=!1,!1}return!0}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("bfenroll",{props:{user:{required:!0},course:{required:!0},donations:{required:!1,default:!1},scriptendpoint:""},data:function(){return{redirect_form_key:[],option:null,course_total:0,course_type:"full",id_number:null,address:{street_name:"",building:"",suburb:"",city:"",province:"",country:"",postal_code:"",errors:[]},instantlink:"",payment_token:"",instant_eft_success:!1,couponApplied:!1,forms:{enroll:$.extend(!0,new AppForm({busy:!1,paymentOption:null,card:null,donations:1,terms:!1}),App.forms.enroll),addingNewCard:!1},newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[]},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,dataLayer:[],checkoutId:null,entityId:null}},ready:function ready(){var _this=this;""!=this.user.id_number&&(this.id_number=this.user.id_number),this.user.addresses[0]&&(this.address.street_name=this.user.addresses[0].line_one,this.address.suburb=this.user.addresses[0].line_two,this.address.province=this.user.addresses[0].province,this.address.country=this.user.addresses[0].country,this.address.city=this.user.addresses[0].city,this.address.postal_code=this.user.addresses[0].area_code),this.course.semester_price=""!=this.course.semester_price?this.course.semester_price:0,window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.enroll.busy=!1,swal.close()},2e3)}catch(e){_this.forms.enroll.busy=!1}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.validate()&&(this.process(),this.forms.enroll.busy=!0,this.forms.enroll.donations&&"yearly"==this.option?this.fieldValidate():this.getEftLink())},fieldValidate:function(){var e={id_number:this.id_number,street_name:this.address.street_name,building:this.address.building,suburb:this.address.suburb,city:this.address.city,province:this.address.province,country:this.address.country,postal_code:this.address.postal_code};this.processPayment(),this.$http.post("checkout/validate",e).success(function(e){this.forms.enroll.busy=!1,swal.close(),this.getEftLink()}).error(function(e){swal("Error","Donation details validation failed!","warning"),this.address.errors=e,this.forms.enroll.busy=!1,swal.close(),this.forms.enroll.errors.set(e)})},coursetotalCalculate:function(){"monthly"==this.option&&(this.course_total=this.course.monthly_enrollment_fee),"yearly"==this.option&&(this.course.black_friday_discounts&&this.course.black_friday_price>0?this.course_total=this.course.black_friday_price:this.course_total=this.course.annual_discounted_price,"semester"==this.course.type_of_course&&("partially"==this.course_type&&(this.course_total=this.course.semester_price),"full"==this.course_type&&(this.course.black_friday_discounts&&this.course.black_friday_price>0?this.course_total=this.course.black_friday_price:this.course_total=this.course.semester_price*this.course.no_of_semesters)))},addCard:function(){var e=this;this.newcard.return="/courses/bfenroll/"+this.course.reference+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.forms.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e}).then(function(e){t.user.cards.push(e.data.card),t.forms.enroll.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},applyCouponCode:function(){var e=this,t=$("input[name=course_id]").val(),n=this.serializeData($("#Coupon_code_apply").seri
1alizeArray());this.$http.post("/check/"+t,n).success(function(t){1==t.status?(e.couponApplied=!0,$courseObj=JSON.parse(t.object),e.course.annual_discounted_price=$courseObj.annual_discounted_price):swal({type:"error",title:"Error",text:t.message})})},serializeData:function(e){var t={};return $.each(e,function(){t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(this.value||"")):t[this.name]=this.value||""}),t},cancelPayment:function(){this.forms.enroll.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={course:this.course.id,option:this.option,course_type:this.course_type,donation_amount:this.getDonations()},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.enroll.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.enroll.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.enroll.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.enroll.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},beginCheckout:function(){window.dataLayer=window.dataLayer||[];var e=[];e.push({item_id:String(this.course.id),item_name:this.course.title,item_category:this.course.course_type,price:parseFloat(parseFloat(this.course_total).toFixed(2)),quantity:1}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"begin_checkout",ecommerce:{value:parseFloat(parseFloat(this.course_total).toFixed(2)),currency:"ZAR",items:e},email:this.user.email||void 0,cell:this.user.cell||void 0})},sendTransactions:function(e){window.dataLayer=window.dataLayer||[];var t=[];e.items&&e.items.length>
10&&e.items.forEach(function(e){t.push({item_id:String(e.item_id),item_name:e.name,item_category:this.course.course_type,price:parseFloat(parseFloat(e.price).toFixed(2)),quantity:e.quantity})}),window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.reference,value:parseFloat(parseFloat(e.total).toFixed(2)),currency:"ZAR",items:t},payment_method:this.getPaymentMethod()||void 0,payment_status:1==e.paid?"successful":"failed",email:this.user.email||void 0,cell:this.user.cell||void 0})},getPaymentMethod:function(){return"cc"==this.forms.enroll.paymentOption?"Credit Card":"eft"==this.forms.enroll.paymentOption?"Instant EFT":""},register:function(){this.forms.enroll.errors.forget(),this.forms.enroll.busy=!0,this.sendRegistration()},sendRegistration:function(){if(this.validate())if("eft"!=this.forms.enroll.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.enroll.paymentOption&&!this.forms.enroll.card)return swal({type:"warning",title:"Error",text:"Unable to purchase without credit card, please select credit card"}),void(this.forms.enroll.busy=!1);var e={course:this.course.id,course_type:this.course_type,terms:this.forms.enroll.terms,card:this.forms.enroll.card,paymentOption:this.forms.enroll.paymentOption,enrollmentOption:this.option,donations:this.getDonations(),id_number:this.id_number,street_name:this.address.street_name,building:this.address.building,suburb:this.address.suburb,city:this.address.city,province:this.address.province,country:this.address.country,postal_code:this.address.postal_code};this.beginCheckout(),this.processPayment(),this.$http.post("/courses/bfcheckout/"+this.course.reference+"/complete",e).success(function(e){this.forms.enroll.busy=!1,swal.close(),void 0!==e.invoice&&this.sendTransactions(e.invoice),window.location="/dashboard/courses"}).error(function(e){this.address.errors=e,this.forms.enroll.busy=!1,swal.close(),this.forms.enroll.errors.set(e)})}else this.forms.enroll.busy=!0},getDonations:function(){var e=0;return this.forms.enroll.donations&&"yearly"==this.option&&(e=this.donations),e},validate:function(){if(this.forms.enroll.donations&&!(this.id_number&&this.id_type&&this.country_of_issue&&this.incometax_reference_number&&this.date_of_birth&&this.post_code&&this.postal_address))return swal({type:"error",title:"Donation Details Required",text:"Please complete all donation fields before proceeding."}),this.forms.enroll.busy=!1,!1;if("student_loan"==this.option){var e=this.contact||{},t=e.first_name,n=e.last_name,i=e.contact_number,r=e.email;if(!(t&&""!==t.trim()&&n&&""!==n.trim()&&i&&""!==i.trim()&&r&&""!==r.trim()))return swal("Error","Please enter valid contact details","warning"),this.forms.enroll.busy=!1,!1}return!0}}})},function(e,t){Vue.component("app-upgrade-subscription",{props:{plans:[],monthly_plans:[],yearly_plans:[]},data:function(){return{planId:"",payment_method:"",selectedPlan:""}},ready:function(){},methods:{planChange:function(){this.selectedPlan=this.getPlanById(this.planId)},getPlanById:function(e){return _.find(this.plans,{id:e})}}})},function(e,t){Vue.component("support-ticket-popup",{props:{loggedin:null,categories:[],page_name:""},data:function(){return{createNew:!1,error:!1,errors:{},categoriesdd:[],forms:{support_ticket:{subject:"",support_email:"",mobile:"",type:"",tag:"",description:""}}}},ready:function(){this.categoriesdd=this.categories,this.typeChanged()},methods:{checkForm:function(){this.createNew=!1,this.error=!1,this.errors={};var e=this.forms.support_ticket;if(this.loggedin||(""==e.support_email?(this.error=!0,this.errors.support_email="Email address is required"):this.validEmail(e.support_email)||(this.error=!0,this.errors.support_email="Please enter a valid email address"),""==e.mobile&&(this.error=!0,this.errors.mobile="Mobile number is required")),""==e.subject&&(this.error=!0,this.errors.subject="Subject is required"),e.type,""==e.tag&&(this.error=!0,this.errors.tag="Ticket Category is required"),""==e.description&&(this.error=!0,this.errors.description="Description is required"),!this.error)if(this.loggedin){self=this,self.createNew=!1;var t=1==self.page_name?"#support_contact_ticket_popup_form":"#support_ticket_popup_form";$(t).submit()}else self=this,this.$http.post("/checklogin",{email:self.forms.support_ticket.support_email}).then(function(e){if("success"==e.data.status){self.createNew=!1;var t=1==self.page_name?"#support_contact_ticket_popup_form":"#support_ticket_popup_form";$(t).submit()}
1else self.createNew=!0,$.cookie("email",self.forms.support_ticket.support_email),self.error=!0,Vue.set(self.errors,"support_email","We couldn't found any email record")});return!1},typeChanged:function(){var e=this,t=this.forms.support_ticket.type;this.forms.support_ticket.tag="",t?(this.categoriesdd=[],Array.from(this.categories).forEach(function(n){n.faq_type==t&&e.categoriesdd.push(n)})):this.categoriesdd=this.categories},validEmail:function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}}})},function(e,t){Vue.component("resource-search",{props:{resourcerecordes:{required:!0,default:[]},categories:{required:!0},webinars:{required:!0},faqs:{required:!0},articles:{required:!0},events:{required:!0},acts:{required:!0},courses:{required:!0},tickets:{required:!0}},data:function(){return{filterArray:[],filterCategoryArray:[],filterSubCategoryArray:[],filterCategoryShow:!0,filterCategoryName:"",sortByName:"",totalcountforarticles:0,totalcountforwebinars:0,totalcountforfaqs:0,totalcountforevents:0,totalcountforcourse:0}},methods:{countTotalFIlter:function(){var e=this;this.categories.forEach(function(t){"webinars"==t.type&&t.category.forEach(function(t){e.totalcountforwebinars+=t.count}),"articles"==t.type&&t.category.forEach(function(t){e.totalcountforarticles+=t.count}),"faqs"==t.type&&t.category.forEach(function(t){e.totalcountforfaqs+=t.count}),"events"==t.type&&t.category.forEach(function(t){e.totalcountforevents+=t.count}),"courses"==t.type&&t.category.forEach(function(t){e.totalcountforcourse+=t.count})})},filterContent:function(e){var t=this;this.filterArray=[],this.filterCategoryArray=[],this.filterSubCategoryArray=[],this.resourcerecordes.forEach(function(n){n.search_type==e&&(t.filterArray.find(function(e){return e.id==n.id})||t.filterArray.push(n))}),this.categories.length>0&&this.categories.forEach(function(n){n.type==e&&t.filterCategoryArray.push(n),n.sub_category&&n.sub_category.length>0&&n.type==e&&t.filterSubCategoryArray.push(n)}),this.sortByDefault()},filterByCategory:function(e,t){var n=this;this.filterArray=[],this.filterSubCategoryArray=[];var i=[];this.categories.forEach(function(n){if(n.type==t){var r=n.category.find(function(t){return t.slug==e});n.sub_category.forEach(function(e){e.parent_category_id==r.category_id&&i.push(e.slug)})}}),this.resourcerecordes.forEach(function(r){search_type=r.search_type,r.categories&&search_type==t&&("webinars"==search_type?(r.categories.slug==e||i.includes(r.categories.slug))&&(n.filterArray.find(function(e){return e.id==r.id})||n.filterArray.push(r)):r.categories&&r.categories.length>0&&r.categories.forEach(function(t){(t.slug==e||i.includes(t.slug))&&(n.filterArray.find(function(e){return e.id==r.id})||n.filterArray.push(r))}))}),this.categories.forEach(function(i){if(i.sub_category&&i.sub_category.length>0&&i.type==t){var r=i.category.find(function(t){return t.slug==e}),s=i.sub_category.filter(function(e){return e.parent_category_id==r.category_id}),o={category:i.category,sub_category:s,type:i.type};n.filterSubCategoryArray.push(o)}}),this.sortByDefault()},filterBySubCategory:function(e,t){var n=this;this.filterArray=[],this.resourcerecordes.forEach(function(i){search_type=i.search_type,i.categories&&search_type==t&&("webinars"==search_type?i.categories.slug==e&&(n.filterArray.find(function(e){return e.id==i.id})||n.filterArray.push(i)):i.categories&&i.categories.length>0&&i.categories.forEach(function(t){t.slug==e&&(n.filterArray.find(function(e){return e.id==i.id})||n.filterArray.push(i))}))}),this.sortByDefault()},sortByRelevanceAndDate:function(e){if(this.sortByName=e.target.value,"relevance"==this.sortByName){return this.filterArray.sort(function(e,t){return e.relevance<t.relevance?-1:e.relevance>t.relevance?1:0}),this.filterArray.reverse()}if("last_updated"==this.sortByName){return this.filterArray.sort(function(e,t){return e.updated_at<t.updated_at?-1:e.updated_at>t.updated_at?1:0}),this.filterArray.reverse()}},sortByDefault:function(){if("relevance"==this.sortByName){return this.filterArray.sort(function(e,t){return e.relevance<t.relevance?-1:e.relevance>t.relevance?1:0}),this.filterArray.reverse()}if("last_updated"==this.sortByName){return this.filterArray.sort(function(e,t){return e.updated_at<t.updated_at?-1:e.updated_at>t.updated_at?1:0}),this.filterArray.reverse()}},redirectFunction:function(e){e.is_redirect?window.location.href=e.redirect_url:window.location.href="/events/show/"+e.slug},saperateSubCategory:function(){var e=this;
1this.categories.forEach(function(t){t.sub_category&&t.sub_category.length>0&&e.filterSubCategoryArray.push(t.sub_category)})}},created:function(){this.resourcerecordes=JSON.parse(this.resourcerecordes),this.categories=JSON.parse(this.categories),this.countTotalFIlter(),this.filterArray=this.resourcerecordes,this.filterCategoryArray=this.categories,this.filterSubCategoryArray=this.categories,this.saperateSubCategory()}})},function(e,t){Vue.component("renew-company-subscription",{props:{plan:"",staffs:null,companys:null,last_staff_count:""},ready:function(){this.staff_count=this.last_staff_count;var e=1;this.staffs.forEach(function(t){t.number=e,e++})},data:function(){return{selectedStaff:[],staff_count:0,staff_error:!1}},watch:{staff_count:function(e){var t=this;e<this.staffs.length&&(this.selectedStaff=[],this.staffs.forEach(function(n){n.number<=e&&t.selectedStaff.push(n.id)}))},selectedStaff:function(e){this.staff_error=!1,this.staff_count<this.staffs.length&&(e.length<this.staff_count||e.length>this.staff_count)&&(this.staff_error=!0)}},methods:{submit:function(){if(this.staff_error)return!1;$("#renew_subscription").submit()}}})},function(e,t){Vue.component("sync-course",{props:{courses:null,moodle_courses:null,moodle_course_ids:null},ready:function(){},data:function(){return{course_1:0,moodle_course_1:0,course_2:0,moodle_course_2:0,messages:{text:"",class:""},courseMessage:!1,moodleMessage:!1,type:"",busy:!1,busy1:!1,allowAccess:!1}},computed:{syncedMessage:function(){return"This course is already synced with moodle, on sync it will sync course on moodle with system course."},notSyncedMessage:function(){return"This course will be created on moodle."},syncedMoodleMessage:function(){return"This course is already available in our system and our system data will be altered, so please verify before sync."},notSyncedMoodleMessage:function(){return"This course will be created on our system."}},methods:{checkCourse:function(){var e=this;if(this.courseMessage=!0,this.moodleMessage=!1,this.messages={text:"",class:""},this.course_1>0||this.moodle_course_1>0?this.allowAccess=!0:this.allowAccess=!1,0!=this.course_1){var t=this.courses.find(function(t){return t.id==e.course_1});this.moodle_course_ids.includes(t.moodle_course_id)?(this.messages.text=this.syncedMessage,this.messages.class="alert-success",this.moodle_course_1=t.moodle_course_id):(this.messages.text=this.notSyncedMessage,this.messages.class="alert-info",this.moodle_course_1=0)}},checkMoodleCourse:function(){var e=this;if(this.courseMessage=!1,this.moodleMessage=!0,this.messages={text:"",class:""},this.course_1>0||this.moodle_course_1>0?this.allowAccess=!0:this.allowAccess=!1,0!=this.moodle_course_1){var t=this.courses.find(function(t){return t.moodle_course_id==e.moodle_course_1});t?(this.messages.text=this.syncedMoodleMessage,this.messages.class="alert-warning",this.course_1=t.id,this.type="update"):(this.messages.text=this.notSyncedMoodleMessage,this.messages.class="alert-info",this.course_1=0,this.type="create")}},checkCourseSync:function(){var e=this;if(this.courseMessage=!0,this.moodleMessage=!1,this.messages={text:"",class:""},this.course_2>0||this.moodle_course_2>0?this.allowAccess=!0:this.allowAccess=!1,0!=this.course_2){var t=this.courses.find(function(t){return t.id==e.course_2});this.moodle_course_ids.includes(t.moodle_course_id)?(this.messages.text=this.syncedMessage,this.messages.class="alert-success",this.moodle_course_2=t.moodle_course_id):(this.messages.text=this.notSyncedMessage,this.messages.class="alert-info",this.moodle_course_2=0)}},syncSystemCourse:function(){var e=this;this.busy1=!0;var t={};this.courseMessage&&(t={course:this.course_1}),this.moodleMessage&&(t={course:this.moodle_course_1,is_moodle_course:!0,type:this.t
1ype}),this.$http.post("/admin/course/sync",t).success(function(t){"success"==t[0]&&(e.busy=!1,window.location.reload(!0))}).error(function(t){e.busy=!1})},syncCourse:function(){var e=this;this.busy=!0;var t={};this.courseMessage&&(t={course:this.course_2,group:this.group_2,moodle_course:this.moodle_course}),this.moodleMessage&&(t={course:this.moodle_course_2,is_moodle_course:!0,type:this.type}),this.$http.post("/admin/course/sync",t).success(function(t){"success"==t[0]&&(e.busy=!1,window.location.reload(!0))}).error(function(t){e.busy=!1})}}})},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0});var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function i(r,s){try{var o=t[r](s),a=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(a).then(function(e){i("next",e)},function(e){i("throw",e)});e(a)}("next")})}}Vue.component("max-user-increase",{props:{plan:{required:!0},user:{required:!0},companys:{required:!1},pricing_group:{required:!1},old_staffs:{required:!0},scriptendpoint:""},data:function(){return{redirect_form_key:[],staffs:1,instantlink:"",payment_token:"",instant_eft_success:!1,forms:{webinarCheckout:$.extend(!0,new AppForm({busy:!1,paymentOption:"",card:null,terms:!1,errors:[]}),App.forms.webinarCheckout)},addingNewCard:!1,newcard:{number:"",holder:"",exp_month:"",exp_year:"",cvv:"",return:"",errors:[],_token:window.App.csrfToken},threeDs:{url:"",connector:"",MD:"",TermUrl:"",PaReq:""},readyForThreeDs:!1,checkoutId:null,entityId:null}},computed:{total:function(){for(var e=this.plan.price,t=parseInt(this.staffs)+parseInt(this.old_staffs),n=0;n<this.pricing_group.length;n++)t>=this.pricing_group[n].min_user&&t<=this.pricing_group[n].max_user&&(e=this.pricing_group[n].price),t>=this.pricing_group[n].min_user&&0==this.pricing_group[n].max_user&&(e=this.pricing_group[n].price);var i=e*this.staffs;return i.toFixed(2)}},created:function(){},ready:function ready(){var _this=this;window.addEventListener("message",function(event){if("string"==typeof event.data)try{eval(event.data),setTimeout(function(){_this.forms.webinarCheckout.busy=!1,swal.close()},2e3)}catch(e){_this.forms.webinarCheckout.busy=!1}})},mounted:function(){this.loadPeachScript()},methods:{loadPeachScript:function(){var e=this;return new Promise(function(t,n){if(window.Checkout)return t();var i=document.createElement("script");i.src=e.scriptendpoint,i.onload=t,i.onerror=n,console.log(e.scriptendpoint),document.head.appendChild(i)})},closeModal:function(){$("#checkout_model").modal("hide"),this.checkoutId=null},handleSuccess:function(e){this.closeModal()},popEft:function(){this.process(),this.forms.webinarCheckout.busy=!0,this.getEftLink()},addCard:function(){var e=this;this.newcard.return="/dashboard/company/renew_company_subscription/"+this.user.id+"?threeDs=yes",this.processPayment(),this.$http.post("/account/billing",this.newcard).then(function(t){if(void 0===t.data.redirect||null===t.data.redirect)e.saveCard(t.data.id),e.addingNewCard=!1;else{e.threeDs.url=t.data.redirect.url;for(var n=t.data.redirect.parameters.length-1;n>=0;n--)e.redirect_form_key.push({form_key:t.data.redirect.parameters[n].name,form_value:t.data.redirect.parameters[n].value}),e.threeDs[t.data.redirect.parameters[n].name]=t.data.redirect.parameters[n].value;e.readyForThreeDs=!0,swal.close()}}).catch(function(t){e.newcard.errors=t.data,swal.close()})},saveCard:function(e){var t=this;this.$http.post("/account/billing/card",{id:e,_token:window.App.csrfToken}).then(function(e){t.user.cards.push(e.data.card),t.forms.webinarCheckout.card=e.data.card.id,swal.close()}).catch(function(e){e.number&&swal({type:"error",title:"Whoops",text:e.number})})},cancelPayment:function(){this.forms.webinarCheckout.busy=!1},getEftLink:function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(){var t,n=this;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.processPayment(),this.showModal=!0,e.next=4,this.loadPeachScript();case 4:t={plan_id:this.plan.id,staffs:this.staffs},this.$http.post("/instant-eft",t).then(function(){var e=_asyncToGenerator(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function e(t){var i;return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.data).checkoutId&&i.entityId){e.next=3;break}return e.abrupt("return");
1case 3:return n.checkoutId=i.checkoutId,n.entityId=i.entityId,e.next=7,n.$nextTick();case 7:$("#checkout_model").modal("show"),setTimeout(function(){swal.close(),n.initCheckout()},300);case 9:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){var t="Unable to process your request!";422==e.status&&(t=e.data.message),swal({type:"warning",title:"Error",text:t,showConfirmButton:!0}),n.forms.webinarCheckout.busy=!1});case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),initCheckout:function(){var e=this;window.Checkout.initiate({key:this.entityId,checkoutId:this.checkoutId,options:{theme:{brand:{primary:"#ff0000"},cards:{background:"#00ff00",backgroundHover:"#F3F3F4"}},paymentMethods:{include:["CARD","OZOW","MASTERPASS","MOBICRED","PAYFLEX","1FORYOU","PAYSHAP","PAYBYBANK","CAPITECPAY","NEDBANKDIRECTEFT","ABSAEFT","PEACHEFT"]},ordering:{OZOW:1,CARD:2,MASTERPASS:3,MOBICRED:4,PAYFLEX:5,"1FORYOU":6,PAYSHAP:7,PAYBYBANK:8,CAPITECPAY:9,NEDBANKDIRECTEFT:10,ABSAEFT:11,PEACHEFT:12}},events:{onCompleted:function(t){var n=t.result.code||"",i=t.result.description||"Payment response received";if(!/^(000\.000\.|000\.100\.1|000\.[36]|000\.400\.[1][12]0)/.test(n))return swal({type:"error",title:"Payment Failed",text:i,showConfirmButton:!0}),void(e.forms.webinarCheckout.busy=!1);swal({type:"success",title:"Payment Successful",text:i,showConfirmButton:!0}),e.instant_eft_success=!0,e.sendRegistration()},onCancelled:function(t){swal({type:"error",title:"Error",text:"Your Payment has Cancelled, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1},onExpired:function(t){swal({type:"error",title:"Error",text:"Your Payment has Session Expired, please try again"}),swal.close(),e.forms.webinarCheckout.busy=!1}}}).render("#payment-form")},startListener:function(){var e=this;new Pusher("5e9e56a5a0ebaf5484b0",{cluster:"mt1"}).subscribe("instantefts").bind("App\\Events\\InstantEftNotificationReceived",function(t){e.payment_token==t.payment_key&&(!0===t.success?(e.process(),e.instant_eft_success=!0,e.sendRegistration()):(e.cancelPayment(),swal({type:"error",title:"Error",text:"Your Payment has failed, please try again"})))})},process:function(){swal({title:"",text:'<i id="busy" class="fa fa-spinner fa-pulse" style="font-size: 8em; color: #ffffff;"></i>',html:!0,allowEscapeKey:!1,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!1,closeOnCancel:!1,customClass:"no-bg"})},register:function(){this.forms.webinarCheckout.errors.forget(),this.forms.webinarCheckout.busy=!0,this.sendRegistration()},processPayment:function(){swal({type:"warning",title:"Payment Processing",text:"Please wait while we are processing your payment.Do not Refresh page or close browser"})},sendRegistration:function(){if("eft"!=this.forms.webinarCheckout.paymentOption||0!=this.instant_eft_success){if("cc"==this.forms.webinarCheckout.paymentOption&&!this.forms.webinarCheckout.card)return swal({type:"warning",title:"Error",text:"Unable to purchase without credit card, please select credit card"}),void(this.forms.webinarCheckout.busy=!1);var e={terms:this.forms.webinarCheckout.terms,card:this.forms.webinarCheckout.card,paymentOption:this.forms.webinarCheckout.paymentOption,staff_count:this.staffs,user_id:this.user.id,plan_id:this.plan.id};this.processPayment(),this.$http.post("/dashboard/company/company_subscription/renew",e).success(function(e){this.forms.webinarCheckout.busy=!1,swal.close(),window.location="/dashboard/company"}).error(function(e){this.forms.webinarCheckout.busy=!1,swal.close(),this.forms.webinarCheckout.errors.set(e)})}else this.forms.webinarCheckout.busy=!0}}})},function(e,t){}]); 2//# sourceMappingURL=app.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.