!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).NgShortCode={})}(this,function(t){"use strict";function e(){let t=!1;try{t=window.top.cordova&&window.top.cordova.platformId}catch(t){}return t}function r(){let t=!1;try{t="undefined"!=typeof document&&"undefined"!=typeof window}catch(t){}return!t}let i=null;function s(t){return String.prototype.trim?String.prototype.trim.call(t):t.replace(/(^\s*|\s*$)/gm,"")}function n(t,e){return"number"==typeof t&&isFinite(t)}function o(t){return Array.isArray(t)}function l(t,e,r=t){if(!o(t))throw new TypeError("forEach called on a non-array type value. The given value is "+typeof t);let i;r||(r=t);let s=0,n=t.length;for(;s<n&&(i=e.call(r,t[s],s,t),"boolean"!=typeof i||i);)s++}function c(t){return"function"==typeof t}function a(t){return null!==t&&"object"==typeof t&&!o(t)}function u(t,e=!0,r=!1){let i=Object.keys(t),s=[];return l(i,i=>{r&&null===t[i]||s.push(encodeURIComponent(i)+"="+(e?encodeURIComponent(t[i]):t[i]))}),s.join("&")}function h(t,e,r=t){var i,s=r||t;if(!a(t))throw new TypeError("Object.forEach called on non-object. The given value is "+typeof t);if(!c(e))throw new TypeError("The given iterator is not a function");for(var n in t){if("hasOwn"in Object){if(!Object.hasOwn(t,n))continue}else if(t.hasOwnProperty&&!t.hasOwnProperty(n))continue;if("boolean"==typeof(i=e.apply(s,[t[n],n]))&&!i)break}}function d(t,e){return e.includes(t)}function p(t){return null==t||void 0===t}let f={};function b(t,e){var r;void 0===t&&(t="");var i=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return f||(f={}),f.uniqidSeed||(f.uniqidSeed=Math.floor(123456789*Math.random())),f.uniqidSeed++,r=t,r+=i(parseInt(((new Date).getTime()/1e3).toString(),10),8),r+=i(f.uniqidSeed,5)}const v=function(){var t;if("undefined"!=typeof window){if(window.requestAnimationFrame)return function(t,e){return window.requestAnimationFrame.apply(window,[t,e])};var e=0;t=function(t){var r=(new Date).getTime(),i=Math.max(0,16-(r-e)),s=window.setTimeout(function(){t(r+i)},i);return e=r+i,s}}else t=function(t){t()};return t}();function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}var g=function(t,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},g(t,e)};function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var y=function(){return y=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var s in e=arguments[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},y.apply(this,arguments)};function _(t,e,r,i){return new(r||(r=Promise))(function(s,n){function o(t){try{c(i.next(t))}catch(t){n(t)}}function l(t){try{c(i.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,l)}c((i=i.apply(t,e||[])).next())})}function S(t,e){var r,i,s,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(s=2&l[0]?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[2&l[0],s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==l[0]&&2!==l[0])){n=0;continue}if(3===l[0]&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(6===l[0]&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(t){l=[6,t],i=0}finally{r=s=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function x(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,s,n=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function A(t,e,r){if(r||2===arguments.length)for(var i,s=0,n=e.length;s<n;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}function k(t){return this instanceof k?(this.v=t,this):new k(t)}function T(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=r.apply(t,e||[]),n=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(t){return function(e){return Promise.resolve(e).then(t,a)}}),i[Symbol.asyncIterator]=function(){return this},i;function o(t,e){s[t]&&(i[t]=function(e){return new Promise(function(r,i){n.push([t,e,r,i])>1||l(t,e)})},e&&(i[t]=e(i[t])))}function l(t,e){try{(r=s[t](e)).value instanceof k?Promise.resolve(r.value.v).then(c,a):u(n[0][2],r)}catch(t){u(n[0][3],t)}var r}function c(t){l("next",t)}function a(t){l("throw",t)}function u(t,e){t(e),n.shift(),n.length&&l(n[0][0],n[0][1])}}function O(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=x(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise(function(i,s){(function(t,e,r,i){Promise.resolve(i).then(function(e){t({value:e,done:r})},e)})(i,s,(e=t[r](e)).done,e.value)})}}}function L(t){return"function"==typeof t}function C(t){var e=t(function(t){Error.call(t),t.stack=(new Error).stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}"function"==typeof SuppressedError&&SuppressedError;var I=C(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=e}});function q(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var D=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,i,s;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var o=x(n),l=o.next();!l.done;l=o.next()){l.value.remove(this)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else n.remove(this);var c=this.initialTeardown;if(L(c))try{c()}catch(t){s=t instanceof I?t.errors:[t]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var u=x(a),h=u.next();!h.done;h=u.next()){var d=h.value;try{j(d)}catch(t){s=null!=s?s:[],t instanceof I?s=A(A([],E(s)),E(t.errors)):s.push(t)}}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}if(s)throw new I(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)j(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&q(e,t)},t.prototype.remove=function(e){var r=this._finalizers;r&&q(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),P=D.EMPTY;function H(t){return t instanceof D||t&&"closed"in t&&L(t.remove)&&L(t.add)&&L(t.unsubscribe)}function j(t){L(t)?t():t.unsubscribe()}var V={Promise:void 0},N={setTimeout:function(t){function e(e,r){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var s=N.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,A([t,e],E(r))):setTimeout.apply(void 0,A([t,e],E(r)))}),clearTimeout:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){var e=N.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)}),delegate:void 0};function R(t){N.setTimeout(function(){throw t})}function M(){}function B(t){t()}var z=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,H(e)&&e.add(r)):r.destination=Y,r}return m(e,t),e.create=function(t,e,r){return new U(t,e,r)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(D),F=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){W(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){W(t)}else W(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){W(t)}},t}(),U=function(t){function e(e,r,i){var s,n=t.call(this)||this;return s=L(e)||!e?{next:null!=e?e:void 0,error:null!=r?r:void 0,complete:null!=i?i:void 0}:e,n.destination=new F(s),n}return m(e,t),e}(z);function W(t){R(t)}var Y={closed:!0,next:M,error:function(t){throw t},complete:M},G="function"==typeof Symbol&&Symbol.observable||"@@observable";function J(t){return t}var $=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i,s=this,n=(i=t)&&i instanceof z||function(t){return t&&L(t.next)&&L(t.error)&&L(t.complete)}(i)&&H(i)?t:new U(t,e,r);return B(function(){var t=s,e=t.operator,r=t.source;n.add(e?e.call(n,r):r?s._subscribe(n):s._trySubscribe(n))}),n},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=K(e))(function(e,i){var s=new U({next:function(e){try{t(e)}catch(t){i(t),s.unsubscribe()}},error:i,complete:e});r.subscribe(s)})},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[G]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return(0===(t=e).length?J:1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=K(t))(function(t,r){var i;e.subscribe(function(t){return i=t},function(t){return r(t)},function(){return t(i)})})},t.create=function(e){return new t(e)},t}();function K(t){var e;return null!==(e=null!=t?t:V.Promise)&&void 0!==e?e:Promise}function X(t){return function(e){if(function(t){return L(null==t?void 0:t.lift)}(e))return e.lift(function(e){try{return t(e,this)}catch(t){this.error(t)}});throw new TypeError("Unable to lift unknown Observable type")}}function Z(t,e,r,i,s){return new Q(t,e,r,i,s)}var Q=function(t){function e(e,r,i,s,n,o){var l=t.call(this,e)||this;return l.onFinalize=n,l.shouldUnsubscribe=o,l._next=r?function(t){try{r(t)}catch(t){e.error(t)}}:t.prototype._next,l._error=s?function(t){try{s(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,l}return m(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(z),tt=C(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),et=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return m(e,t),e.prototype.lift=function(t){var e=new rt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new tt},e.prototype.next=function(t){var e=this;B(function(){var r,i;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var s=x(e.currentObservers),n=s.next();!n.done;n=s.next()){n.value.next(t)}}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var e=this;B(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;B(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=this,i=r.hasError,s=r.isStopped,n=r.observers;return i||s?P:(this.currentObservers=null,n.push(t),new D(function(){e.currentObservers=null,q(n,t)}))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,i=e.thrownError,s=e.isStopped;r?t.error(i):s&&t.complete()},e.prototype.asObservable=function(){var t=new $;return t.source=this,t},e.create=function(t,e){return new rt(t,e)},e}($),rt=function(t){function e(e,r){var i=t.call(this)||this;return i.destination=e,i.source=r,i}return m(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:P},e}(et),it={now:function(){return(it.delegate||Date).now()},delegate:void 0},st=function(t){function e(e,r,i){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===i&&(i=it);var s=t.call(this)||this;return s._bufferSize=e,s._windowTime=r,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,e),s._windowTime=Math.max(1,r),s}return m(e,t),e.prototype.next=function(e){var r=this,i=r.isStopped,s=r._buffer,n=r._infiniteTimeWindow,o=r._timestampProvider,l=r._windowTime;i||(s.push(e),!n&&s.push(o.now()+l)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,i=this._buffer.slice(),s=0;s<i.length&&!t.closed;s+=r?1:2)t.next(i[s]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,n=(s?1:2)*e;if(e<1/0&&n<i.length&&i.splice(0,i.length-n),!s){for(var o=r.now(),l=0,c=1;c<i.length&&i[c]<=o;c+=2)l=c;l&&i.splice(0,l+1)}},e}(et),nt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};var ot="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function lt(t){if(t instanceof $)return t;if(null!=t){if(function(t){return L(t[G])}(t))return n=t,new $(function(t){var e=n[G]();if(L(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(nt(t))return s=t,new $(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()});if(L(null==(i=t)?void 0:i.then))return r=t,new $(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,R)});if(function(t){return Symbol.asyncIterator&&L(null==t?void 0:t[Symbol.asyncIterator])}(t))return ct(t);if(function(t){return L(null==t?void 0:t[ot])}(t))return e=t,new $(function(t){var r,i;try{for(var s=x(e),n=s.next();!n.done;n=s.next()){var o=n.value;if(t.next(o),t.closed)return}}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}t.complete()});if(function(t){return L(null==t?void 0:t.getReader)}(t))return ct(function(t){return T(this,arguments,function(){var e,r,i;return S(this,function(s){switch(s.label){case 0:e=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,k(e.read())];case 3:return r=s.sent(),i=r.value,r.done?[4,k(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,k(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}(t))}var e,r,i,s,n;throw function(t){return new TypeError("You provided "+(null!==t&&"object"===w(t)?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(t)}function ct(t){return new $(function(e){(function(t,e){var r,i,s,n;return _(this,void 0,void 0,function(){var o,l;return S(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=O(t),c.label=1;case 1:return[4,r.next()];case 2:if((i=c.sent()).done)return[3,4];if(o=i.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=c.sent(),s={error:l},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(n=r.return)?[4,n.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})})(t,e).catch(function(t){return e.error(t)})})}function at(t,e){return X(function(r,i){var s=0;r.subscribe(Z(i,function(r){i.next(t.call(e,r,s++))}))})}var ut=Array.isArray;function ht(t){return at(function(e){return function(t,e){return ut(e)?t.apply(void 0,A([],E(e))):t(e)}(t,e)})}function dt(t,e,r){return void 0===r&&(r=1/0),L(e)?dt(function(r,i){return at(function(t,s){return e(r,t,i,s)})(lt(t(r,i)))},r):("number"==typeof e&&(r=e),X(function(e,i){return function(t,e,r,i,s,n,o){var l=[],c=0,a=0,u=!1,h=function(){!u||l.length||c||e.complete()},d=function(t){c++;var s=!1;lt(r(t,a++)).subscribe(Z(e,function(t){e.next(t)},function(){s=!0},void 0,function(){if(s)try{c--;for(var t=function(){var t=l.shift();o||d(t)};l.length&&c<i;)t();h()}catch(t){e.error(t)}}))};return t.subscribe(Z(e,function(t){return c<i?d(t):l.push(t)},function(){u=!0,h()})),function(){}}(e,i,t,r)}))}var pt=["addListener","removeListener"],ft=["addEventListener","removeEventListener"],bt=["on","off"];function vt(t,e,r,i){if(L(r)&&(i=r,r=void 0),i)return vt(t,e,r).pipe(ht(i));var s=E(function(t){return L(t.addEventListener)&&L(t.removeEventListener)}(t)?ft.map(function(i){return function(s){return t[i](e,s,r)}}):function(t){return L(t.addListener)&&L(t.removeListener)}(t)?pt.map(wt(t,e)):function(t){return L(t.on)&&L(t.off)}(t)?bt.map(wt(t,e)):[],2),n=s[0],o=s[1];if(!n&&nt(t))return dt(function(t){return vt(t,e,r)})(lt(t));if(!n)throw new TypeError("Invalid event target");return new $(function(t){var e=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.next(1<e.length?e:e[0])};return n(e),function(){return o(e)}})}function wt(t,e){return function(r){return function(i){return t[r](e,i)}}}class gt{constructor(t,e=.5,r=250){this._dservice=t,this.threshold=e,this._obsEl=[],this._sbs=[],this._obs=[],this._intersected=[],window.IntersectionObserver&&(this._intersectionObserver=new IntersectionObserver(t=>{this.CheckForIntersection(t)},{threshold:.5})),this._sbs.push(this._dservice.onScroll.subscribe(()=>{clearTimeout(this._scrolltimer),this._scrolltimer=setTimeout(()=>{this._intersectionObserver?(l(this._intersected,t=>{let e=this._obsEl.findIndex(e=>e.el==t),r=this._obsEl[e];r&&(r.obs.next(),r.obs.complete(),this._obsEl.splice(e,1),this._intersectionObserver.unobserve(r.el))}),this._intersected=[]):this.CheckInView()},r)})),this._obs.push(vt(window,"resize")),this._obs[this._obs.length-1].subscribe(()=>{v(()=>{this._GetViewportSize(),this._intersectionObserver||this.CheckInView()})}),this._GetViewportSize()}Destroy(){l(this._obsEl,t=>{t.obs.complete()}),l(this._sbs,t=>{t.unsubscribe()}),this._intersected=[],this._obsEl=[],this._obs=[]}Observe(t){let e,r=this._obsEl.findIndex(e=>e.el==t);return e=new et,r<0?(this._obsEl.push({el:t,obs:e}),r=this._obsEl.length-1):(this._obsEl[r].obs.complete(),this._obsEl[r].obs=e),v(()=>{if(null==this._obsEl||!this._obsEl.length)return;this._InViewport(t)?(this._obsEl.splice(r,1),e.next(),e.complete(),this._intersectionObserver&&this._intersectionObserver.unobserve(t)):this._intersectionObserver&&(this._intersectionObserver.unobserve(t),this._intersectionObserver.observe(t))}),e}Unobserve(t){let e=this._obsEl.findIndex(e=>e.el==t);e>-1&&(this._obsEl[e].obs.complete(),this._obsEl.splice(e,1),this._intersectionObserver&&this._intersectionObserver.unobserve(t))}_GetViewportSize(){var t=window;null!=t.innerWidth&&(this._viewport={w:t.innerWidth,h:t.innerHeight})}_InViewport(t){if(!this._viewport)return!1;var e=t instanceof Element?t.getBoundingClientRect():t.boundingClientRect,r=e.height||e.bottom-e.top,i=e.width||e.right-e.left;return!(!r||!i)&&!(e.top+e.height*this.threshold>this._viewport.h||e.bottom<0)}CheckForIntersection(t){this._intersected=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=t[e].target;(r.isIntersecting||p(r.isIntersecting)&&this._InViewport(r))&&this._intersected.push(i)}}CheckInView(){this._obsEl&&l(this._obsEl,(t,e)=>{if(this._InViewport(t.el))return t.obs.next(),t.obs.complete(),this._obsEl.splice(e,1),!1})}}const mt=new class{get _storage(){return document.cookie}set _storage(t){document.cookie=t}useMemory(t){this._usememstorage=t,t||(this._memstorage={})}clearMemory(){this._memstorage={}}get(t){if(!this._usememstorage&&!document.cookie)return;if(this._usememstorage)return this._memstorage[t];let e,r=this._storage.split(";"),i=t+"=";for(let t=0;t<r.length;t++){let s=r[t];for(;" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(i)){e=decodeURIComponent(s.substring(i.length,s.length));break}}if("mw_signon"==t&&void 0!==e&&("{"!=e.slice(0,1)||"}"!=e.slice(-1)))try{e=window.atob(e)}catch(t){console.error("window.atob() failed on 'mw_signon'")}return e}asyncget(t){if(e()){let e=(void 0).replace(/^https?:\/\//,"");return e.lastIndexOf("/")>0&&(e=e.substring(0,e.lastIndexOf("/")-1)),new Promise(r=>{window.top.sslHTTP.getCookies(e,function(e){if(e[t]){let i="value"in e[t]?e[t].value:e[t].Value;if("mw_signon"==t)try{if(i=decodeURIComponent(i),void 0!==i&&/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(i||""))try{i=window.atob(i)}catch(t){console.error("window.atob() failed on 'mw_signon'")}}catch(t){i=""}r(i)}else r(null)},function(){r(null)})})}return Promise.resolve(this.get(t))}set(t,r,i){if(e()&&!this._usememstorage&&console.warn("Cannot set cookies in a cordova app, memory will be used instead"),this._usememstorage&&-1==i)delete this._memstorage[t];else if(this._usememstorage){let e;if(a(r)||o(r))try{e=JSON.stringify(r)}catch(t){}else e=c(r)?"":r;this._memstorage[t]=e}else{let e,s=new Date;0===i?e='expires=""':(i||(i=0),s.setTime(s.getTime()+24*i*60*60*1e3),e="expires="+s.toUTCString());let n=".wallethub.com",o="."+(window.location.hostname||window.location.host);n!=o&&o.endsWith(n)&&(o=n),this._storage=t+"="+r+"; "+(this._usememstorage?"":e+"; path=/; secure; domain="+o)}this._eventsHandlers.set&&this._eventsHandlers.set.forEach(e=>{e(t,r,i)})}get enabled(){return!r()&&!1!==navigator.cookieEnabled&&(document.cookie="testcookie=1",-1!=document.cookie.indexOf("testcookie"))}remove(t){this.set(t,"",-1),this._eventsHandlers.remove&&this._eventsHandlers.remove.forEach(e=>{e(t)})}constructor(){this._memstorage={},this._eventsHandlers={},this.enabled||this.useMemory(!0)}subscribe(t,e){return this._eventsHandlers[t]=this._eventsHandlers[t]||[],this._eventsHandlers[t].push(e),()=>{let r=this._eventsHandlers[t].indexOf(e);r>-1&&this._eventsHandlers[t].splice(r,1)}}};const yt=new class{useCookieStorage(){mt&&mt.enabled?(this._storage={setItem:function(t,e,r){mt.set(t,e,r)},removeItem:function(t){document.cookie=t+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},getItem:function(t){return mt.get(t)}},this.isExpired=()=>(console.warn("not available for cookies"),0),this.removeGroup=t=>{l(function(){for(var t=document.cookie.split(";"),e=[],r=1,i=t.length;r<=i;r++)e[r-1]=s(t[r-1]);return e}(),(e,r)=>{0==e.indexOf(t+"_")&&this._storage.removeItem(e.split("=")[0])})}):this.useMemory(!0)}useSession(t){this._storage=t?window.sessionStorage:window.localStorage}useMemory(t){if(t&&!this._oldStorage){this._oldStorage=this._storage;let t={_data:{},setItem:(t,e)=>this._storage._data[t]=String(e),getItem:t=>this._storage._data[t],removeItem:t=>delete this._storage._data[t],clear:()=>this._storage._data={}};this._storage=t}else t||(this._storage=this._oldStorage,this._oldStorage=null,this._storage||(this._storage=!r()&&"localStorage"in window?window.localStorage:null))}clearMemory(){this._storage&&this._storage.clear&&this._storage.clear()}get(t){var e,r,i=t;t=this._group+t;for(var s=0;s<this._types.length;s++){let n=this._types[s];if(this._storage.getItem(t+n)){if(this.isExpired(i))return void this._storage.removeItem(t+n);switch(n){case this._types[0]:case this._types[3]:e=JSON.parse(this._storage.getItem(t+n)),r=!0;break;case this._types[1]:e=this._storage.getItem(t+n),r=!0;break;case this._types[2]:e=parseFloat(this._storage.getItem(t+n)),r=!0}break}}return r||"string"!=typeof this._storage.getItem(t)||(e=this._storage.getItem(t)),e="undefined"==e||null==e?void 0:"true"==e||"false"!=e&&e}set(t,e,r){var i=t,s="";if("expirations"==t)return!1;t=this._group+t,a(e)||o(e)?(e=JSON.stringify(e),s=this._types[0]):n(e)?(e=e.toString(),s=this._types[2]):"boolean"==typeof e?(e=e.toString(),s=this._types[3]):s=this._types[1];for(var l=0,c=this._types.length;l<c;l++)if(this._storage.getItem(t+this._types[l])){this._storage.removeItem(t+this._types[l]);break}try{this._storage.setItem(t+s,e)}catch(t){console.warn(t)}r&&this.expire(i,r)}remove(t){t=this._group+t;for(var e=0,r=this._types.length;e<r;e++)this._storage.getItem(t+this._types[e])&&this._storage.removeItem(t+this._types[e])}expire(t,e){var r,i=this._storage.getItem("_expirations.json")||null;try{(r=JSON.parse(i))||(r={})}catch(t){r={}}r[this._group+t]={in:e,since:(new Date).getTime()},this._storage.setItem("_expirations.json",JSON.stringify(r))}getExpiration(t){var e=this._storage.getItem("_expirations.json")||!1;if(!e)return null;try{if(!(e=JSON.parse(e)))return null}catch(t){return null}return e[this._group+t]||null}isExpired(t,e){var r=this.getExpiration(t);if(null===r)return 0;let i=(new Date).getTime()-r.since;return i>=r.in?1:e?r.in-i:0}group(t){if(null==t){let t=this._group;return t&&(t=t.substring(0,t.length-1)),t}!1===t&&(this._group=""),this._group=t+"_"}removeGroup(t){l(Object.keys(this._storage)||[],e=>{0===e.indexOf(t)&&this._storage.removeItem(e)})}constructor(){let t;this._storage=null,this._oldStorage=null,this._types=[".json",".string",".number",".boolean"],this._group="";try{this._storage=!r()&&"localStorage"in window?window.localStorage:null,t=!0}catch(t){this.useMemory(!0)}if(!r()){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(t){this.useCookieStorage()}if(t&&this._storage==window.localStorage){let t,e=this._storage.getItem("_expirations.json")||null,r=new Date;if(e)try{t=JSON.parse(e),h(t,(e,i)=>{if(!e)return!0;for(var s,n=0;n<this._types.length;n++){if(this._storage.getItem(i+this._types[n])){s=!1,r.getTime()-e.since>=e.in&&(this._storage.removeItem(i+this._types[n]),delete t[i]);break}s=!0}s&&delete t[i]});this._storage.setItem("_expirations.json",JSON.stringify(t))}catch(t){}}}}};function _t(t){switch(t.responseType){case"json":if("response"in t)return t.response;var e=t;return JSON.parse(e.responseText);case"document":return t.responseXML;default:return"response"in t?t.response:(e=t).responseText}}var St=function(t,e,r,i){void 0===i&&(i="download_load"),this.originalEvent=t,this.xhr=e,this.request=r,this.type=i;var s=e.status,n=e.responseType;this.status=null!=s?s:0,this.responseType=null!=n?n:"";var o=e.getAllResponseHeaders();this.responseHeaders=o?o.split("\n").reduce(function(t,e){var r=e.indexOf(": ");return t[e.slice(0,r)]=e.slice(r+2),t},{}):{},this.response=_t(e);var l=t.loaded,c=t.total;this.loaded=l,this.total=c},xt=C(function(t){return function(t,e,r){var i;this.message=t,this.name="AjaxError",this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType;try{i=_t(e)}catch(t){i=e.responseText}this.response=i}}),Et=function(){function t(t,e){return xt.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this}return t.prototype=Object.create(xt.prototype),t}();function At(t,e){return Dt({method:"GET",url:t,headers:e})}function kt(t,e,r){return Dt({method:"POST",url:t,body:e,headers:r})}function Tt(t,e){return Dt({method:"DELETE",url:t,headers:e})}function Ot(t,e,r){return Dt({method:"PUT",url:t,body:e,headers:r})}function Lt(t,e,r){return Dt({method:"PATCH",url:t,body:e,headers:r})}var Ct=at(function(t){return t.response});function It(t,e){return Ct(Dt({method:"GET",url:t,headers:e}))}var qt,Dt=(qt=function(t){var e;return e="string"==typeof t?{url:t}:t,new $(function(t){var r,i,s,n=y({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},e),o=n.queryParams,l=n.body,c=n.headers,a=n.url;if(!a)throw new TypeError("url is required");if(o)if(a.includes("?")){var u=a.split("?");if(2<u.length)throw new TypeError("invalid url");s=new URLSearchParams(u[1]),new URLSearchParams(o).forEach(function(t,e){return s.set(e,t)}),a=u[0]+"?"+s}else a=a+"?"+(s=new URLSearchParams(o));var h={};if(c)for(var d in c)c.hasOwnProperty(d)&&(h[d.toLowerCase()]=c[d]);var p=n.crossDomain;p||"x-requested-with"in h||(h["x-requested-with"]="XMLHttpRequest");var f=n.withCredentials,b=n.xsrfCookieName,v=n.xsrfHeaderName;if((f||!p)&&b&&v){var g=null!==(i=null===(r=null===document||void 0===document?void 0:document.cookie.match(new RegExp("(^|;\\s*)("+b+")=([^;]*)")))||void 0===r?void 0:r.pop())&&void 0!==i?i:"";g&&(h[v]=g)}var m,_=function(t,e){var r;if(!t||"string"==typeof t||function(t){return"undefined"!=typeof FormData&&t instanceof FormData}(t)||function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}(t)||function(t){return Mt(t,"ArrayBuffer")}(t)||function(t){return Mt(t,"File")}(t)||function(t){return Mt(t,"Blob")}(t)||function(t){return"undefined"!=typeof ReadableStream&&t instanceof ReadableStream}(t))return t;if(function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(t)}(t))return t.buffer;if("object"===w(t))return e["content-type"]=null!==(r=e["content-type"])&&void 0!==r?r:"application/json;charset=utf-8",JSON.stringify(t);throw new TypeError("Unknown body type")}(l,h),S=y(y({},n),{url:a,headers:h,body:_});m=e.createXHR?e.createXHR():new XMLHttpRequest;var x=e.progressSubscriber,E=e.includeDownloadProgress,A=void 0!==E&&E,k=e.includeUploadProgress,T=void 0!==k&&k,O=function(e,r){m.addEventListener(e,function(){var e,i=r();null===(e=null==x?void 0:x.error)||void 0===e||e.call(x,i),t.error(i)})};O("timeout",function(){return new Et(m,S)}),O("abort",function(){return new xt("aborted",m,S)});var L=function(t,e){return new St(e,m,S,t+"_"+e.type)},C=function(e,r,i){e.addEventListener(r,function(e){t.next(L(i,e))})};T&&[jt,Vt,Nt].forEach(function(t){return C(m.upload,t,Pt)}),x&&[jt,Vt].forEach(function(t){return m.upload.addEventListener(t,function(t){var e;return null===(e=null==x?void 0:x.next)||void 0===e?void 0:e.call(x,t)})}),A&&[jt,Vt].forEach(function(t){return C(m,t,Ht)});var I=function(e){var r="ajax error"+(e?" "+e:"");t.error(new xt(r,m,S))};m.addEventListener("error",function(t){var e;null===(e=null==x?void 0:x.error)||void 0===e||e.call(x,t),I()}),m.addEventListener(Nt,function(e){var r,i,s=m.status;if(s<400){null===(r=null==x?void 0:x.complete)||void 0===r||r.call(x);var n=void 0;try{n=L(Ht,e)}catch(e){return void t.error(e)}t.next(n),t.complete()}else null===(i=null==x?void 0:x.error)||void 0===i||i.call(x,e),I(s)});var q=S.user,D=S.method,P=S.async;for(var d in q?m.open(D,a,P,q,S.password):m.open(D,a,P),P&&(m.timeout=S.timeout,m.responseType=S.responseType),"withCredentials"in m&&(m.withCredentials=S.withCredentials),h)h.hasOwnProperty(d)&&m.setRequestHeader(d,h[d]);return _?m.send(_):m.send(),function(){m&&4!==m.readyState&&m.abort()}})},qt.get=At,qt.post=kt,qt.delete=Tt,qt.put=Ot,qt.patch=Lt,qt.getJSON=It,qt),Pt="upload",Ht="download",jt="loadstart",Vt="progress",Nt="load";var Rt=Object.prototype.toString;function Mt(t,e){return Rt.call(t)==="[object "+e+"]"}let Bt;(new class{constructor(){this.events={},this.replayevents={}}eventGetorCreate(t){return this.events[t]||(this.replayevents[t]?this.events[t]=new st(1,n(this.replayevents[t])?this.replayevents[t]:999999999):this.events[t]=new et),this.events[t]}keepValueFor(t,e){this.replayevents[t]=e||!0}subscribe(t,e,r,i,s=[]){let n,o=this.eventGetorCreate(t);return n=o.pipe.apply(o,s).subscribe({next:e,error:r,complete:()=>{i&&i(),n&&n.unsubscribe()}}),n}emit(t,e,r){if(r&&!this.events[t])return;this.eventGetorCreate(t).next(e)}terminate(t){let e;this.events[t]&&(e=this.events[t],e.complete(),delete this.events[t],this.replayevents[t]&&delete this.replayevents[t])}clear(){h(this.events,t=>{t.complete()}),this.events={},this.replayevents={}}}).subscribe("$server:captcha-block",function(t){if(Bt)return!1;Bt=!0});let zt=window.top.sslHTTP;function Ft(t){let e;e="GET"==t.method?zt.get:"PUT"==t.method?zt.put:"DELETE"==t.method?zt.delete:zt.post;let r=new et,i={url:t.url,data:t.body||{},headers:t.headers||{}};i.headers.Accept="text/plain, */*";let s=yt.group();if(yt.group("mw"),i.headers["APP-ID"]=yt.get("support_id")||"",i.url.indexOf("/ajax.php")>-1||i.url.indexOf("/mobile-rpc")>-1){let t=yt.get("user_sign_on");i.headers.PublicID=t?t.id.toString():-1}return yt.group(s),e(i,t=>{let e=t.response||t.data&&t.data.response||t.data||t,i=t.status,s=t.headers;r.next({response:e,status:i,headers:s}),r.complete()},t=>{let e={headers:t.headers,status:t.httperrorcode||t.errorcode,errorcode:t.errorcode||null,xhr:{response:t.errorinfo||t.errordomain||t.data},type:"request"};var i,s;-1001==e.status&&(e.status=408),s=[-1022,-1200,-1201,-1202,-1203,-1204,-1205,-1206],(i=e)&&(d(i.errorcode,s)||d(i.status,s))&&(e.status=-999,e.type=t.errordomain||"network"),r.error(e),r.complete()}),r}function Ut(){return!(r()&&(null==i&&(i=function(){let t=!1;try{t="undefined"!=typeof document&&"undefined"!=typeof window,t&&(t=window&&(window.JSTESTING||window.jasmine))}catch(t){}return t}()),!i))&&(yt.group("mw"),!!(function(){let t=!1;try{t="undefined"!=typeof document&&"undefined"!=typeof window}catch(t){}return t&&!e()}()&&mt.get("mw_signon")||yt.get("user_sign_on")))}function Wt(t){return t&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(t)["scroll-behavior"]}function Yt(t,e,r){var i;e=e||999,r||0===r||(r=9);var s=function(t){i=t},n=function(){clearTimeout(i),s(0)},o=function(e){return Math.max(0,t.getTopOf(e)-r)},l=function(r,i,o){if(n(),0===i||i&&i<0||Wt(t.body))t.toY(r),o&&o();else{var l=t.getY(),c=Math.max(0,r)-l,a=(new Date).getTime();i=i||Math.min(Math.abs(c),e),function e(){s(setTimeout(function(){var r=Math.min(1,((new Date).getTime()-a)/i),s=Math.max(0,Math.floor(l+c*(r<.5?2*r*r:r*(4-2*r)-1)));t.toY(s),r<1&&t.getHeight()+s<t.body.scrollHeight?e():(setTimeout(n,99),o&&o())},9))}()}},c=function(t,e,r){l(o(t),e,r)};return{setup:function(t,i){return(0===t||t)&&(e=t),(0===i||i)&&(r=i),{defaultDuration:e,edgeOffset:r}},to:c,toY:l,intoView:function(e,i,s){var n=e.getBoundingClientRect().height,a=t.getTopOf(e)+n,u=t.getHeight(),h=t.getY(),d=h+u;o(e)<h||n+r>u?c(e,i,s):a+r>d?l(a-u+r,i,s):s&&s()},center:function(e,r,i,s){l(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(i||e.getBoundingClientRect().height/2)),r,s)},stop:n,moving:function(){return!!i},getY:t.getY,getTopOf:t.getTopOf}}let Gt={};if("undefined"!=typeof window&&"document"in window){const je=document.documentElement;function Ve(){return window.scrollY||je.scrollTop}if(Gt=Yt({body:document.scrollingElement||document.body,toY:function(t){window.scrollTo(0,t)},getY:Ve,getHeight:function(){return window.innerHeight||je.clientHeight},getTopOf:function(t){return t.getBoundingClientRect().top+Ve()-je.offsetTop}}),Gt.createScroller=function(t,e,r){return Yt({body:t,toY:function(e){t.scrollTop=e},getY:function(){return t.scrollTop},getHeight:function(){return Math.min(t.clientHeight,window.innerHeight||je.clientHeight)},getTopOf:function(t){return t.offsetTop}},e,r)},"addEventListener"in window&&!Wt(document.body)){var Jt="history"in window&&"pushState"in history,$t=Jt&&"scrollRestoration"in history;$t&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){$t&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(t){t.state&&"zenscrollY"in t.state&&Gt.toY(t.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var t=Gt.setup().edgeOffset;if(t){var e=document.getElementById(window.location.href.split("#")[1]);if(e){var r=Math.max(0,Gt.getTopOf(e)-t),i=Gt.getY()-r;0<=i&&i<9&&window.scrollTo(0,r)}}},9)},!1);var Kt=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(t){let e=t.target;for(;e&&"A"!==e.tagName;)e=e.parentNode;if(!e||1!==t.which||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;if($t){var r=history.state&&"object"==typeof history.state?history.state:{};r.zenscrollY=Gt.getY();try{history.replaceState(r,"")}catch(t){}}let i=e.getAttribute("href")||"";if(0===i.indexOf("#")&&!Kt.test(e.className)){let e=0,r=document.getElementById(i.substring(1));if("#"!==i){if(!r)return;e=Gt.getTopOf(r)}t.preventDefault();var s=function(){window.location=i},n=Gt.setup().edgeOffset;n&&(e=Math.max(0,e-n),Jt&&(s=function(){history.pushState({},"",i)})),Gt.toY(e,null,s)}},!1)}}var Xt=Gt;class Zt{constructor(t,e){this._box=t,this._ad=e,this._sbs=[],this._overlay=this._box.querySelector(".cc-detail-overlay");let r=vt(this._box.querySelector("[data-show-details]"),"click");this._sbs.push(r.subscribe(()=>{this.OpenOverlay()})),this._sbs.push(vt(this._overlay.querySelector("[data-disclosure-bt]"),"click").subscribe(()=>{this.ToDisclosure()}));let i=this._overlay.querySelectorAll("[data-apply-link]");i&&i.length>0&&this._sbs.push(vt(i,"click").subscribe(t=>{this.ApplyLink(t)})),this._sbs.push(vt(this._overlay.querySelector("[data-close-bt]"),"click").subscribe(t=>{this.CloseOverlay()})),this.onOverlay=new et}ApplyLink(t){re.OpenApply(t,this._ad)}ToDisclosure(){this._scrollerOverlayControl&&this._scrollerOverlayControl.to(this._overlay.querySelector("[data-disclosure]"))}OpenOverlay(){this._scrollerOverlay=new ge(this._overlay),document.body.appendChild(this._overlay),v(()=>{this._overlay.classList.add("opened")}),this._scrollerOverlayControl=Xt.createScroller(this._overlay,300,0),this.onOverlay.next(!0)}CloseOverlay(){this._overlay.classList.remove("opened"),setTimeout(()=>{this._box?this._box.appendChild(this._overlay):this._overlay&&this._overlay.parentNode.removeChild(this._overlay)},300),this._scrollerOverlay&&this._scrollerOverlay.Destroy(),this._scrollerOverlay=null,this._scrollerOverlayControl=null,this.onOverlay.next(!1)}Destroy(){this.CloseOverlay(),this._scrollerOverlay&&this._scrollerOverlay.Destroy(),this._scrollerOverlay=null,l(this._sbs,t=>{t.unsubscribe()})}}class Qt{constructor(t,e,r){this._list=t,this._pagescroll=e,this._baseurl=r,this._sbs=[],this._ads=[],this._adviews=[],this._expanded=!1;let i=this._list.querySelectorAll(".cc-list-toggle-btn"),s=this._list.querySelectorAll(".cc-list-ul li");for(let t=0,e=s.length;t<e;t++)this._adviews.push(new me(this._pagescroll,this._baseurl)),this._ads.push(this._adviews[t].SetAd(s[t],!0));i&&i.length>0&&this._sbs.push(vt(i,"click").subscribe(t=>{this.Toggle()})),this.initSetup()}initSetup(){v(()=>{if(!this._windowSubs){const t=vt(window,"resize");this._windowSubs=t.subscribe(()=>{this._resizeWatch()}),this._resizeWatch()}})}_resizeWatch(){let t=window.innerWidth,r=this._list.querySelectorAll(".cc-list-link");if(t<769&&!e())for(let t=0,e=r.length;t<e;t++)r[t].setAttribute("target","_self");else for(let t=0,e=r.length;t<e;t++)r[t].setAttribute("target","_blank")}Toggle(){}Destroy(){l(this._sbs,t=>{t.unsubscribe()}),l(this._adviews,t=>{t.Destroy()}),this._windowSubs&&this._windowSubs.unsubscribe(),this._windowSubs=null,this._ads=[],this._sbs=[],this._adviews=[]}}class te{constructor(t,r){this._list=t,this._sbs=[],this._expanded=!1,this._tips=[];let i=this._list.querySelectorAll(".cc-edt-toggle-btn"),s=this._list.querySelectorAll(".spnsrd-button");i&&i.length>0&&this._sbs.push(vt(i,"click").subscribe(t=>{this.Toggle(t)})),s&&s.length>0&&this._sbs.push(vt(s,"click").subscribe(t=>{let r=document.querySelector(".edu-page-disclaimer-box");if(r)if(r.querySelector(".ed-disc-ad").classList.add("ed-disc-yellow"),e())r.scrollIntoView({behavior:"smooth",block:"start"});else{const t=document.querySelector(".edu-fixed-bar"),e=t&&"none"!==window.getComputedStyle(t).display?(null==t?void 0:t.offsetHeight)+55:30,i=r.getBoundingClientRect().top+window.scrollY-e;window.scrollTo({top:i,behavior:"smooth"})}}));let n=this._list.querySelectorAll(".srt-tool-tip");if(n&&n.length>0)for(let t=0,e=n.length;t<e;t++)this._tips.push(new ye(n[t],r))}Toggle(t){this._expanded?this._list.classList.remove("cc-edt-show-details"):this._list.classList.add("cc-edt-show-details"),this._expanded=!this._expanded}Destroy(){l(this._sbs,t=>{t.unsubscribe()})}}class ee{constructor(t,e,r){this._body=t,this._default_html_text=e,this._default_text=r,this._sbs=[],this._expanded=!1,this.initSetup()}initSetup(){v(()=>{if(!this._windowSubs){const t=vt(window,"resize");this._windowSubs=t.subscribe(()=>{this._resizeWatch()}),this._resizeWatch()}})}_resizeWatch(){let t=window.innerWidth,e=70;t<416?e=35:t<541&&(e=50),t<768?(this._truncated_text=function(t,e,r=null,i=null,s=null){r||(r=30);i||(i="... ");s||(s='<span class="ct-author-toggle link">read more</span>');let n=e.split(" ");return n.length>r?n.splice(0,r).join(" ")+i+s:t}(this._default_html_text,this._default_text,e),this._body.innerHTML=this._truncated_text,this.AttachClickEvent()):this._body.innerHTML=this._default_html_text}AttachClickEvent(){this.clearSubscribe();let t=this._body.querySelectorAll(".ct-author-toggle");t&&t.length>0&&this._sbs.push(vt(t,"click").subscribe(t=>{this.Toggle(t)}))}Toggle(t){this._expanded?this._body.innerHTML=this._truncated_text:this._body.innerHTML=this._default_html_text+'<br/><span class="ct-author-toggle link">hide more</span>',this._expanded=!this._expanded,this.AttachClickEvent()}clearSubscribe(){l(this._sbs,t=>{t.unsubscribe()})}Destroy(){l(this._sbs,t=>{t.unsubscribe()}),this._windowSubs&&this._windowSubs.unsubscribe(),this._body.innerHTML=this._default_html_text,this._windowSubs=null}}let re,ie=[],se=[],ne=[],oe=[];class le{constructor(t){this._list=t,this._sbs=[],this.forceupdate=4;let e=this._list.querySelectorAll(".cc-table-wh-rating-btn-info"),r=this._list.querySelectorAll(".cct-rewards-info"),i=this._list.querySelectorAll(".cct-bonus-info"),s=this._list.querySelectorAll(".cct-close-btn"),n=this._list.querySelectorAll(".cct-close-btn-bonus");e&&e.length>0&&this._sbs.push(vt(e,"click").subscribe(t=>{this.ShowDist(t),this.ForceHideDist(t,""),this.RemoveAllShow(t)})),r&&r.length>0&&this._sbs.push(vt(r,"click").subscribe(t=>{this.ShowRewards(t),this.ForceHideDist(t,"reward"),this.RemoveAllShow(t)})),i&&i.length>0&&this._sbs.push(vt(i,"click").subscribe(t=>{this.ShowBonus(t),this.ForceHideDist(t,"bonus"),this.RemoveAllShow(t)})),s&&s.length>0&&this._sbs.push(vt(s,"click").subscribe(t=>{this.HideRewards(t)})),n&&n.length>0&&this._sbs.push(vt(n,"click").subscribe(t=>{this.HideBonus(t)})),(e&&e.length>0||r&&r.length>0)&&this._sbs.push(vt(document,"click").subscribe(t=>{this.HideDist(t)}))}HideRewards(t){let e=t.target.closest("td");e||(e=t.target.closest(".ccc-t-col"));const r=e.querySelector(".cc-review-tooltip");e&&r&&(e.classList.remove("details-wh-rating-dist-show"),r.classList.remove("cct-show-review"))}HideBonus(t){let e=t.target.closest("td");e||(e=t.target.closest(".ccc-t-col"));const r=e.querySelector(".cc-bonus-tooltip");e&&r&&(e.classList.remove("details-wh-rating-dist-show"),r.classList.remove("cct-show-bonus"))}ShowRewards(t){let e=t.target.closest("td");const r=document.querySelectorAll(".cc-review-tooltip");if(e||(e=t.target.closest(".ccc-t-col")),!e)return;const i=e.querySelector(".cc-review-tooltip");e&&i&&(e.classList.add("details-wh-rating-dist-show"),i.classList.add("cct-show-review")),r.forEach((t,e)=>{t!==i&&t.classList.remove("cct-show-review")})}ShowBonus(t){let e=t.target.closest("td");if(e||(e=t.target.closest(".ccc-t-col")),!e)return;const r=e.querySelector(".cc-bonus-tooltip");r&&(e.classList.add("details-wh-rating-dist-show"),r.classList.add("cct-show-bonus"),document.querySelectorAll(".cc-bonus-tooltip").forEach(t=>{t!==r&&t.classList.remove("cct-show-bonus")}))}RemoveAllShow(t){const e=t.target.closest("td"),r=this._list.querySelectorAll("td");e?r.forEach((t,r)=>{t!==e&&t.classList.remove("details-wh-rating-dist-show")}):r.forEach((t,e)=>{t.classList.remove("details-wh-rating-dist-show")})}ShowDist(t){const e=t.target.closest("td");if(!e)return;const r=e.querySelector(".cc-table-wh-rating-dist");r&&requestAnimationFrame(()=>{e.classList.add("details-wh-rating-dist-show"),r.classList.add("details-wh-rating-dist-show"),document.querySelectorAll(".details-wh-rating-dist-show").forEach((t,i)=>{t!==r&&t!==e&&t.classList.remove("details-wh-rating-dist-show")})})}ForceHideDist(t,e){const r=t.target;this._list.querySelectorAll(".cc-table-wh-rating-dist").forEach(t=>{var e;t!==r&&(t.classList.remove("details-wh-rating-dist-show"),null===(e=t.closest("td"))||void 0===e||e.classList.remove("details-wh-rating-dist-show"))}),"bonus"===e?document.querySelectorAll(".cc-review-tooltip").forEach(t=>{var e;r.closest(".cct-rewards-grid")||(null===(e=t.closest("td"))||void 0===e||e.classList.remove("details-wh-rating-dist-show"),t.classList.remove("cct-show-review"))}):"reward"===e&&document.querySelectorAll(".cc-bonus-tooltip").forEach(t=>{var e;r.closest(".cct-bonus-grid")||(null===(e=t.closest("td"))||void 0===e||e.classList.remove("details-wh-rating-dist-show"),t.classList.remove("cct-show-bonus"))})}HideDist(t){const e=document.querySelectorAll(".cc-table-wh-rating-dist"),r=document.querySelectorAll(".cc-review-tooltip"),i=document.querySelectorAll(".cc-bonus-tooltip"),s=t.target;if(e||r){for(const t of e)if(!s.closest(".cc-table-wh-rating")){const e=t.closest("td");e&&e.classList.remove("details-wh-rating-dist-show"),t.classList.remove("details-wh-rating-dist-show")}for(const t of r)if(!s.closest(".cct-rewards-grid")){const e=t.closest("td");e&&e.classList.remove("details-wh-rating-dist-show"),t.classList.remove("cct-show-review")}for(const t of i)if(!s.closest(".cct-bonus-grid")){const e=t.closest("td");e&&e.classList.remove("details-wh-rating-dist-show"),t.classList.remove("cct-show-bonus")}}}Destroy(){l(this._sbs,t=>{t.unsubscribe()})}}let ce=[];class ae{constructor(t){this._list=t,this._sbs=[],this._expanded=!1,this._dummy=!1;let e=this._list.querySelectorAll(".cc-trust-hd:not(.bk-hd)"),r=this._list.querySelectorAll(".cc-trust-hd.bk-hd");e&&e.length>0&&this._sbs.push(vt(e,"click").subscribe(t=>{this.Toggle(t)})),r&&r.length>0&&this._sbs.push(vt(e,"click").subscribe(t=>{this.Toggle(t,!0)}))}Toggle(t,e=!1){let r=(e?t.target.closest(".bk-trust"):t.target.closest(".cc-trust")).querySelector('input[type="checkbox"]'),i=r&&r.checked;this._expanded||i?(this._list.classList.remove("ct-list-expanded"),this._expanded=!1):(this._list.classList.add("ct-list-expanded"),this._expanded=!0)}Destroy(){l(this._sbs,t=>{t.unsubscribe()})}}let ue=[];class he{constructor(t){this._list=t,this._sbs=[],this._expanded=!1,this._dummy=!1;let e=this._list.querySelectorAll(".edu-metric-more-btn");e&&e.length>0&&this._sbs.push(vt(e,"click").subscribe(t=>{this.Toggle(t)}))}Toggle(t){this._expanded?this._list.classList.remove("metric-list-expanded"):this._list.classList.add("metric-list-expanded"),this._expanded=!this._expanded}Destroy(){l(this._sbs,t=>{t.unsubscribe()})}}let de,pe=[];class fe{constructor(t,e,r){this._box=t,this._adViewer=e,this._sbs=[],this._tips=[];let i=this._box.querySelectorAll(".srt-tool-tip");if(i&&i.length>0)for(let t=0,e=i.length;t<e;t++)this._tips.push(new ye(i[t],r));let s=this._box.querySelectorAll("[data-apply-link]");if(s&&s.length>0)for(let t=0,e=s.length;t<e;t++){let e=s[t],r=this._adViewer.SetAd(e);this._sbs.push(vt(e,"click").subscribe(()=>{if(this._adViewer.TriggerPixelClick(r),!r.view)return;let t=JSON.stringify({view:r.view});try{window.sessionStorage.setItem("mw_prequal_start",t)}catch(e){mt.set("mw_prequal_start",t,0)}}))}}Destroy(){l(this._sbs,t=>{t.unsubscribe()}),l(this._tips,t=>{t.Destroy()})}}class be{constructor(t,e){this._box=t,this._adViewer=e,this._sbs=[],this._tips=[];let r=this._box.querySelectorAll(".adview-pq-loan-button a");if(r&&r.length>0)for(let t=0,e=r.length;t<e;t++){let e=r[t];e.setAttribute("data-apply-link","true");let i=this._adViewer.SetAd(e,!0);this._sbs.push(vt(e,"click").subscribe(()=>{if(this._adViewer.TriggerPixelClick(i),!i.view)return;let t=JSON.stringify({view:i.view});try{window.sessionStorage.setItem("mw_prequal_start",t)}catch(e){mt.set("mw_prequal_start",t,0)}}))}let i=this._box.querySelectorAll(".adview-npq-loan-button a");if(i&&i.length>0)for(let t=0,e=i.length;t<e;t++){let e=i[t],r=this._adViewer.SetAd(e);this._sbs.push(vt(e,"click").subscribe(()=>{this._adViewer.TriggerPixelClick(r)}))}}Destroy(){l(this._sbs,t=>{t.unsubscribe()}),l(this._tips,t=>{t.Destroy()})}}let ve=[];function we(t){return e()?Ft(t):Dt(t)}class ge{constructor(t){this._scroller=t,this._obs=[],this._sbs=[],this._forceUpdate=5,this.onScroll=new st(0),this._forceUpdate=2;let e=vt(this._scroller,"scroll");this._obs.push(e),this._sbs.push(e.subscribe(()=>{let t=0;t=this._scroller instanceof Window?document.scrollingElement&&document.scrollingElement.scrollTop||document.documentElement.scrollTop:this._scroller.scrollTop,v(()=>{this.onScroll&&this.onScroll.next(t)})}))}Destroy(){this._obs=null,l(this._sbs,t=>{t.unsubscribe()}),this._sbs=null,this.onScroll.complete(),this.onScroll=null,this._scroller=null}}class me{constructor(t,e){this._baseurl=e,this._elements=[],this._ads=[],this._sbs=[],this._srv=new ge(t),this._intersect=new gt(this._srv)}TriggerPixel(t){const r={adview_id:t.view,adview_page:document.location.pathname,adview_pid:t.pid,adview_position:this._ads.indexOf(t)+1,adview_totals:this._ads.length,adview_version:2};if(e()){let t=document.location.pathname.split("/www/");t[1]&&(r.adview_page="www/"+t[1])}t.addprms&&Object.assign(r,t.addprms),1==r.adview_totals&&(delete r.adview_totals,delete r.adview_position),r.adview_pid||delete r.adview_pid,we({url:this._baseurl+"/pixel.png?"+u(r),crossDomain:!0,method:"GET",timeout:15e3,responseType:"text",async:!0,withCredentials:!1,headers:{}}).subscribe(t=>{},t=>{})}TriggerPixelClick(t){const r={adview_id:t.view,adview_click:t.click||b(),adview_page:document.location.pathname,adview_pid:t.pid,adview_position:this._ads.indexOf(t)+1,adview_totals:this._ads.length,adview_version:2};if(e()){let t=document.location.pathname.split("/www/");t[1]&&(r.adview_page="www/"+t[1])}t.addprms&&Object.assign(r,t.addprms),1==r.adview_totals&&(delete r.adview_totals,delete r.adview_position),r.adview_pid||delete r.adview_pid,Dt({url:this._baseurl+"/pixel.png?"+u(r),crossDomain:!0,method:"GET",timeout:15e3,async:!0,withCredentials:!1}).subscribe(t=>{},t=>{})}OpenApply(t,e){if(e.modify_link)return;const r={viewId:e.view,clickId:e.click||b()};let i=t.target;if(!i.getAttribute("data-apply-link"))if(i.parentNode)for(i=i.parentNode;parent;){if("body"==i.tagName.toLowerCase()){i=null;break}if(i.getAttribute("data-apply-link"))break;i=i.parentNode}else i=null;if(!i)return;let s=i.href;(s.indexOf("clickId")<0||s.indexOf("viewId")<0)&&(s.indexOf("?")>-1?s+="&":s+="?",s+=u(r)),i.href=s,window.open(s,i.target||"_blank"),t.preventDefault()}SetAd(t,e=!1){this._elements.push(t);let r=b();t.hasAttribute("data-ad-viewed")&&(r=t.getAttribute("data-ad-viewed"));const i={el:t,sub:this._intersect.Observe(t),view:r,click:b(),pid:t.getAttribute("data-pid"),modify_link:e};this._ads.length;let s=t.getAttribute("data-adview-queries");try{s&&(i.addprms=JSON.parse(decodeURI(s)))}catch(t){}return i.sbs=i.sub.subscribe(()=>{if(setTimeout(()=>{i.sbs.unsubscribe()}),!t.hasAttribute("data-ad-viewed")){if(e){let e=t;if(e.getAttribute("data-apply-link")){let t=e.href;if(t.indexOf("clickId")<0||t.indexOf("viewId")<0){t.indexOf("?")>-1?t+="&":t+="?",t+=u({viewId:i.view,clickId:i.click})}e.href=t}else{let t=e.querySelectorAll("a");for(let e=0,r=t.length;e<r;e++){if(t[e].hasAttribute("data-apply-link")){let r=t[e].href;if(r.indexOf("clickId")<0||r.indexOf("viewId")<0){r.indexOf("?")>-1?r+="&":r+="?",r+=u({viewId:i.view,clickId:i.click})}t[e].href=r}}}}t.setAttribute("data-ad-viewed",i.view),this.TriggerPixel(i)}}),this._sbs.push(vt(t,"click").subscribe(t=>{this.OpenApply(t,i)})),this._ads.push(i),i}Destroy(){l(this._ads,t=>{t.sbs.unsubscribe()}),this._intersect.Destroy(),this._srv.Destroy(),this._intersect=null,this._srv=null,l(this._sbs,t=>{t.unsubscribe()})}}class ye{constructor(t,e){this._poppupbox=t,this._mainscroller=e,this._eventsub=[],this._poppup=this._poppupbox.querySelector(".tool-tip-md");const r=this._poppupbox.querySelector(".tool-tip-bt");r&&this._eventsub.push(vt(r,"click").subscribe(t=>{this.Open(),t.stopPropagation()}));const i=this._poppup.querySelector(".tt-md-close-bt");i&&this._eventsub.push(vt(i,"click").subscribe(()=>{this.Close()})),this._eventsub.push(vt(document,"click").subscribe(()=>{this.Close()})),this._eventsub.push(vt(this._poppup,"click").subscribe(t=>{t.stopPropagation()}))}_resizeWatch(){let t=this._poppup;t.style.marginLeft="",t.style.marginTop="",t.style.width="";let e=t.getBoundingClientRect(),r="innerWidth"in this._mainscroller,i=r?0:this._mainscroller.getBoundingClientRect().left,s=r?this._mainscroller.innerWidth:this._mainscroller.clientWidth,n=(r?this._mainscroller.innerHeight:this._mainscroller.clientHeight,0);e.right>s&&(n=Math.min(0,s-e.right-15),t.style.marginLeft=n+"px");let o=t.getBoundingClientRect();if(o.left<i){let e=Math.abs(i-o.left-15);t.style.width=o.width-e+"px",n&&(n+=e,t.style.marginLeft=n+"px")}}Open(){this._poppup.classList.add("tt-md-opened"),v(()=>{if(!this._windowSubs){const t=vt(window,"resize");this._windowSubs=t.subscribe(()=>{this._resizeWatch()}),this._resizeWatch()}})}Close(){this._windowSubs&&this._windowSubs.unsubscribe(),this._poppup.classList.remove("tt-md-opened"),this._windowSubs=null}Destroy(){this._windowSubs&&this._windowSubs.unsubscribe(),l(this._eventsub,t=>{t.unsubscribe()}),this._eventsub=[],this._poppup=null,this._mainscroller=null,this._poppupbox=null,this._windowSubs=null}}function _e(t,e,r=!0){for(;t&&t!==document;){if(t.classList.contains(e))return t;if(!r)break;t=t.parentNode}return null}function Se(t){const e=document.querySelectorAll(t);for(const t of e)if(xe(t))return t;return null}function xe(t){for(;t;){if("none"===window.getComputedStyle(t).display)return!1;t=t.parentElement}return!0}function Ee(t){const e=t.closest(".cc-list-buttons");let r=null;if(e&&e.querySelector("div.js-cc-list-wrapper")&&(r=e.querySelector("div.js-cc-list-wrapper")),!r)return;t.classList.add("active");let i=t.getAttribute("data-toggle-style");i&&!r.classList.contains(i)&&r.classList.add(i),Array.from(t.closest(".toggle-wrapper").querySelectorAll(".ccl-top-toggle-btn")).forEach(e=>{if(e!==t){e.classList.remove("active");const t=e.getAttribute("data-toggle-style");t&&r.classList.contains(t)&&r.classList.remove(t)}})}function Ae(t){if(!t)return;const e=t.getAttribute("data-cc-vs-toggle");if(!e)return;const r=document.querySelectorAll(".details-wh-rating-dist"),i=document.getElementById(e);i&&(r.forEach(t=>{i!==t&&t.classList.remove("details-wh-rating-dist-show")}),i.classList.add("details-wh-rating-dist-show"))}function ke(){document.querySelectorAll(".cc-vs-wh-rating-dist").forEach(t=>{t.classList.remove("details-wh-rating-dist-show")})}document.addEventListener("click",function(t){if(_e(t.target,"cc-vs-rating-row")||ke(),_e(t.target,"cc-vs-toggle-btn",!1)){Ae(_e(t.target,"cc-vs-toggle-btn",!1))}if(_e(t.target,"ccl-top-toggle-btn")){Ee(_e(t.target,"ccl-top-toggle-btn"))}if(_e(t.target,"cc-aff-asterisk")){let t=Se("#card-disclosure")||Se("#cards-disclosure");if(t)if(e())t.scrollIntoView({behavior:"smooth",block:"start"});else{const e=document.querySelector(".cc-details-fixed-bar"),r=e&&"none"!==window.getComputedStyle(e).display?(null==e?void 0:e.offsetHeight)+55:30,i=t.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:i,behavior:"smooth"})}}}),document.addEventListener("click",function(t){if(_e(t.target,"spnsrd-link")||_e(t.target,"spnsrd-button")){let r=Se(".disclosure-scroll-target");if(r){const i=document.querySelectorAll(".should-highlighted");for(const t of i)t.classList.add("yellow"),t.classList.add("prdt-disc-yellow"),t.classList.add("ed-disc-yellow");if(e())r.scrollIntoView({behavior:"smooth",block:"start"});else{let t=document.querySelector(".cc-details-fixed-bar");t||(t=document.querySelector(".head-mob-nav-scrollable")),t||(t=document.querySelector("#js-ccc-cta-sm")),t||(t=document.querySelector(".edu-fixed-bar"));const e=t&&"none"!==window.getComputedStyle(t).display?(null==t?void 0:t.offsetHeight)+55:20,i=r.getBoundingClientRect().top+window.scrollY-e;window.scrollTo({top:i,behavior:"smooth"})}t.preventDefault()}}});class Te{constructor(t,e={}){if(this._lastValue=null,!(t instanceof HTMLInputElement))throw new Error("NumericInput can only be attached to an input element.");this.element=t,this.container=this.element.closest("[data-wh-calc]");const r=t.getAttribute("data-nr-max"),i=t.getAttribute("data-nr-min"),s=t.getAttribute("data-nr-style"),n=t.getAttribute("data-nr-value");this.options=Object.assign({min:null!==i?parseFloat(i):0,max:null!==r?parseFloat(r):1e6,numericStyle:s||"dollarPos",correctOnBlur:t.hasAttribute("data-nr-correct-blur")},e);const o=Pe(this.container);if(null===o||isNaN(parseFloat(o)))qe(t,n);else{try{this.setValue(parseFloat(o))}catch(t){console.error("input error:",t)}qe(t,parseFloat(o))}this.setupNumeric()}setupNumeric(){this.formatValue(),this.element.addEventListener("input",this.onInput.bind(this)),this.element.addEventListener("blur",this.onBlur.bind(this)),this.element.addEventListener("keydown",this.onKeyDown.bind(this))}formatValue(){let t=this.element.value.trim();if(""===t)return;let e=parseFloat(t.replace(/[^0-9.-]/g,""));isNaN(e)&&(e=0),this._lastValue=e,this.element.value=this.applyNumericStyle(e)}applyNumericStyle(t){switch(this.options.numericStyle){case"percentageUS2decPos":return`${t.toFixed(2)}%`;case"dollarPos":return`$${t.toLocaleString("en-US",{minimumFractionDigits:0})}`;default:return t.toString()}}onInput(t){const e=this.element,r=e.selectionStart||0;let i=e.value.replace(/[^0-9.-]/g,""),s=parseFloat(i);isNaN(s)&&(s=0),this._lastValue=s,e.value=this.applyNumericStyle(s),setTimeout(()=>{e.selectionStart=e.selectionEnd=r},0),qe(e,s),this.emitChangeEvent(s)}onBlur(){let t=parseFloat(this.element.value.replace(/[^0-9.-]/g,""));isNaN(t)&&(t=0),this.options.correctOnBlur&&(t<this.options.min&&(t=this.options.min),t>this.options.max&&(t=this.options.max)),this._lastValue=t,this.element.value=this.applyNumericStyle(t),this.emitChangeEvent(t)}onKeyDown(t){if("-"===t.key&&this.options.min>=0&&t.preventDefault(),"Backspace"===t.key){const e=this.element;1===(e.selectionStart||0)&&e.value.startsWith("$")&&t.preventDefault()}}emitChangeEvent(t){const e=new CustomEvent("numericInputChange",{detail:t});this.element.dispatchEvent(e)}setValue(t){t<this.options.min&&(t=this.options.min),t>this.options.max&&(t=this.options.max),this._lastValue=t,this.element.value=this.applyNumericStyle(t)}getValue(){var t;return null!==(t=this._lastValue)&&void 0!==t?t:0}destroy(){this.element.removeEventListener("input",this.onInput.bind(this)),this.element.removeEventListener("blur",this.onBlur.bind(this)),this.element.removeEventListener("keydown",this.onKeyDown.bind(this))}}class Oe{constructor(t,e){this.activeValue=null,this.container=t,this.buttons=this.container.querySelectorAll("button"),this.buttons.forEach((t,r)=>{const i=`btn0${r+1}`;t.textContent=e[i]}),this.buttons.forEach(t=>{t.addEventListener("click",()=>this.toggle(t))});const r=Pe(this.container);r?(this.setActive(r),qe(this.buttons[0],r)):(this.setActive(e.btn01),qe(this.buttons[0],e.btn01))}toggle(t){const e=t.textContent;this.setActive(e),qe(t,e)}setActive(t){this.activeValue=t,this.buttons.forEach(t=>{t.textContent===this.activeValue?(t.classList.add("aqua"),t.classList.remove("blank")):(t.classList.add("blank"),t.classList.remove("aqua"))})}}class Le{constructor(t,e,r={}){this.value=null,this.externalLinkText="Add New",this.container=t,this.button=this.container.querySelector(".dropdown-btn"),this.list=this.container.querySelector(".dropdown-list"),this.clearButton=this.container.querySelector(".dropdown-clear"),this.items=e,this.placeholder=t.getAttribute("data-placeholder")||"Select...",this.clearable="true"===t.getAttribute("data-clearable"),this.hasExternalLink="true"===t.getAttribute("data-has-external"),this.externalLinkText=t.getAttribute("data-external-text")||this.externalLinkText,this.init()}init(){this.button.textContent=this.placeholder,this.button.addEventListener("click",()=>this.toggleDropdown()),this.clearButton.addEventListener("click",t=>this.clearSelection(t)),document.addEventListener("click",t=>this.handleOutsideClick(t)),this.populateList()}populateList(){if(this.list.innerHTML="",this.items.forEach((t,e)=>{const r=document.createElement("li");r.classList.add("dropdown-item"),r.setAttribute("role","option"),r.setAttribute("data-index",e.toString()),r.textContent=t,r.addEventListener("click",()=>this.selectItem(e)),this.list.appendChild(r)}),this.hasExternalLink){const t=document.createElement("li");t.classList.add("dropdown-item","external-link"),t.setAttribute("role","option"),t.textContent=this.externalLinkText,t.addEventListener("click",()=>this.externalAction()),this.list.appendChild(t)}}toggleDropdown(){const t=this.container.classList.contains("open");document.querySelectorAll(".dropdown-container.open").forEach(t=>{t!==this.container&&t.classList.remove("open")}),this.container.classList.toggle("open",!t),this.button.setAttribute("aria-expanded",(!t).toString())}selectItem(t){this.value=this.items[t],this.button.textContent=this.value,this.container.classList.remove("open"),this.button.setAttribute("aria-expanded","false"),this.container.dispatchEvent(new CustomEvent("dropdownChange",{detail:this.value}))}clearSelection(t){t.stopPropagation(),this.value=null,this.button.textContent=this.placeholder,this.container.dispatchEvent(new CustomEvent("dropdownClear"))}handleOutsideClick(t){this.container.contains(t.target)||(this.container.classList.remove("open"),this.button.setAttribute("aria-expanded","false"))}externalAction(){this.container.dispatchEvent(new CustomEvent("dropdownExternalClick"))}}document.querySelectorAll(".calc-dropdown-container").forEach(t=>{const e=(t.getAttribute("data-items")||"").split("|").map(t=>t.trim()).filter(t=>t);new Le(t,e,{clearable:!0,hasExternalLink:!0})});const Ce=document.querySelectorAll(".wh-calc-toggle-field");Ce.length>0&&Ce.forEach(t=>{const e=t.querySelectorAll("button");if(e.length<2)return;const r={btn01:e[0].getAttribute("data-toggle-label")||"Yes",btn02:e[1].getAttribute("data-toggle-label")||"No"};new Oe(t,r)});document.querySelectorAll('input[data-nr-input="true"]').forEach(t=>{new Te(t),t.addEventListener("numericInputChange",function(t){})});class Ie{constructor(t){this.selectedValue=null,this.container=t,this.radios=this.container.querySelectorAll("input[type='radio']"),this.init()}init(){this.radios.forEach(t=>{t.addEventListener("change",()=>this.updateSelection(t)),t.checked&&(this.selectedValue=t.getAttribute("data-value")||null)});const t=this.container.getAttribute("data-name")||"radio-group";this.radios.forEach(e=>{e.setAttribute("name",t)})}updateSelection(t){this.selectedValue=t.getAttribute("data-value")||null,this.container.dispatchEvent(new CustomEvent("radioChange",{detail:this.selectedValue}))}getValue(){return this.selectedValue}setValue(t){this.radios.forEach(e=>{e.getAttribute("data-value")===t&&(e.checked=!0,this.selectedValue=t)})}}function qe(t,e){const r=t.closest("[data-wh-calc]");r&&(r.setAttribute("data-wh-calc-answer",e.toString()),He(r,e),r.dispatchEvent(new CustomEvent("calcAnswerUpdated",{detail:{answer:e,element:r}})))}function De(t){const e=t.hasAttribute("data-wh-calc")?t:t.closest("[data-wh-calc]");return(null==e?void 0:e.getAttribute("data-wh-calc-store"))||null}function Pe(t){const e=De(t);return e?localStorage.getItem(e):null}function He(t,e){const r=De(t);r&&localStorage.setItem(r,e.toString())}document.querySelectorAll(".calc-radio-group").forEach(t=>{new Ie(t)}),document.querySelectorAll("[data-calc-next]").forEach(t=>{t.addEventListener("click",function(){const e=t.closest("[data-wh-calc]");if(!e)return;const r=e.getAttribute("data-wh-calc-answer")||null,i=e.getAttribute("data-wh-calc-uri"),s=e.getAttribute("data-wh-param");if(r&&i&&s){He(e,r);const t=`${i}?from_wh_calc=true&${encodeURIComponent(s)}=${encodeURIComponent(r)}`;window.open(t,"_blank")}e.dispatchEvent(new CustomEvent("calcNextClicked",{detail:{answer:r,element:e}}))})}),t.AdView=me,t.Ajax=we,t.ClearBoxes=function(){l(ie,t=>{t.Destroy()}),l(se,t=>{t.Destroy()}),l(ne,t=>{t.Destroy()}),l(oe,t=>{t.Destroy()}),re&&re.Destroy(),re=null,ie=[],se=[],ne=[],oe=[]},t.ClearCCTable=function(){l(ce,t=>{t.Destroy()}),ce=[]},t.ClearCCTrust=function(){l(ue,t=>{t.Destroy()}),ue=[]},t.ClearEduBoxes=function(){l(pe,t=>{t.Destroy()}),pe=[]},t.ClearPrsWidgets=function(){l(ve,t=>{t.Destroy()}),de&&de.Destroy(),de=null,ve=[]},t.NumericInput=Te,t.ScrollService=ge,t.SetBodyAuthSate=function(){if(e()){const t=document.querySelector("body");t&&(t.classList.add("logged-out"),Ut()&&(t.classList.remove("logged-out"),t.classList.add("logged-in")))}},t.SetBoxes=function(t,e){const r=document.querySelectorAll("[cc-mini-box]"),i=document.querySelectorAll(".cc-list-buttons"),s=document.querySelectorAll(".cc-editorial-box"),n=document.querySelectorAll(".ct-author-body");!re&&r&&r.length>0&&(re=new me(t,e)),!re&&s&&s.length>0&&(re=new me(t,e));for(let t=0,e=r.length;t<e;t++){let e=r[t];ie.push(new Zt(e,re.SetAd(e)))}for(let r=0,s=i.length;r<s;r++){let s=i[r];se.push(new Qt(s,t,e))}for(let e=0,r=s.length;e<r;e++){let r=s[e];ne.push(new te(r,t)),re.SetAd(r)}for(let t=0,e=n.length;t<e;t++){let e=n[t],r=e.innerHTML,i=e.textContent;oe.push(new ee(e,r,i))}},t.SetCCTable=function(){const t=document.querySelectorAll("div.cc-table");for(let e=0,r=t.length;e<r;e++){let r=t[e];ce.push(new le(r))}const e=document.querySelectorAll("div.cc-vs-table-rew");for(let t=0,r=e.length;t<r;t++){let r=e[t];ce.push(new le(r))}},t.SetCCTrust=function(){const t=document.querySelectorAll(".cc-trust"),e=document.querySelectorAll(".bk-trust");for(let e=0,r=t.length;e<r;e++){let r=t[e];r.clientWidth<=767?r.classList.add("ctbrkgrid"):r.classList.remove("ctbrkgrid"),ue.push(new ae(r))}for(let r=0,i=e.length;r<i;r++){let e=t[r];e.clientWidth<=767?e.classList.add("ctbrkgrid"):e.classList.remove("ctbrkgrid"),ue.push(new ae(e))}},t.SetEduBoxes=function(){const t=document.querySelectorAll(".edu-info-graphic");for(let e=0,r=t.length;e<r;e++){let r=t[e];pe.push(new he(r))}},t.SetPrsWidgets=function(t,e){const r=document.querySelectorAll(".personal-loan-rates"),i=document.querySelectorAll(".cardhub-edu-table.personal-terms"),s=document.querySelectorAll(".pl-offers-box a.btn");!de&&(r&&r.length>0||i&&i.length>0||s&&s.length)&&(de=new me(t,e));for(let e=0,i=r.length;e<i;e++){let i=r[e];ve.push(new fe(i,de,t))}for(let t=0,e=i.length;t<e;t++){let e=i[t];ve.push(new be(e,de))}for(let t=0,e=s.length;t<e;t++){let e=s[t],r=de.SetAd(e);r.addprms={adview_offer_type:"Personal_Loan_NOPQ_Button"};let i=vt(r.el,"click").subscribe(()=>{de.TriggerPixelClick(r)});ve.push({Destroy:()=>{i.unsubscribe()}})}},t.ToolTip=ye,t.ccVsToggle=Ae,t.cclToggle=Ee,t.dummyCall=function(){},t.findVisibleElement=Se,t.getCalcStorageKey=De,t.hasClassOrParentHasClass=_e,t.isVisible=xe,t.loadStoredValue=Pe,t.removeShowClassFromAll=ke,t.storeValue=He});