!function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(53),e(81),e(82),e(93),e(94),e(99),e(100),e(110),e(120),e(122),e(123),e(124),r.exports=e(125)},function(r,t,e){var n=e(2),o=e(4),a=e(48),c=ArrayBuffer.prototype;n&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function(){return a(this)}})},function(r,t,e){var n=e(3);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(5),o=e(23);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(t,e,n){var o=n(6),a=n(3),c=n(8),i=n(9),u=n(2),s=n(13).CONFIGURABLE,f=n(14),p=n(19),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),b=o("".replace),m=o([].join),d=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),E=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+b(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return i(o,"source")||(o.source=m(w,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return c(this)&&y(this).source||f(this)}),"toString")},function(r,t,e){var n=e(7),o=Function.prototype,a=o.call,c=n&&o.bind.bind(a,a);r.exports=n?c:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(3);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(6),o=e(10),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(11),o=Object;r.exports=function(r){return o(n(r))}},function(r,t,e){var n=e(12),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(2),o=e(9),a=Function.prototype,c=n&&Object.getOwnPropertyDescriptor,i=o(a,"name"),u=i&&"something"===function(){}.name,s=i&&(!n||n&&c(a,"name").configurable);r.exports={EXISTS:i,PROPER:u,CONFIGURABLE:s}},function(r,t,e){var n=e(6),o=e(8),a=e(15),c=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return c(r)}),r.exports=a.inspectSource},function(r,t,e){var n=e(16),o=e(17),a=e(18),c="__core-js_shared__",i=r.exports=o[c]||a(c,{});(i.versions||(i.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(17),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n,o,a,c=e(20),i=e(17),u=e(21),s=e(22),f=e(9),p=e(15),l=e(46),y=e(47),v="Object already initialized",h=i.TypeError,g=i.WeakMap;if(c||p.state){var b=p.state||(p.state=new g);b.get=b.get,b.has=b.has,b.set=b.set,n=function(r,t){if(b.has(r))throw new h(v);return t.facade=r,b.set(r,t),t},o=function(r){return b.get(r)||{}},a=function(r){return b.has(r)}}else{var m=l("state");y[m]=!0,n=function(r,t){if(f(r,m))throw new h(v);return t.facade=r,s(r,m,t),t},o=function(r){return f(r,m)?r[m]:{}},a=function(r){return f(r,m)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(17),o=e(8),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(8);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(2),o=e(24),a=e(26),c=e(27),i=e(28),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(c(r),t=i(t),c(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=f(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(r,t,e)}:s:function(r,t,e){if(c(r),t=i(t),c(e),o)try{return s(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(2),o=e(3),a=e(25);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(17),o=e(21),a=n.document,c=o(a)&&o(a.createElement);r.exports=function(r){return c?a.createElement(r):{}}},function(r,t,e){var n=e(2),o=e(3);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(21),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(r,t,e){var n=e(29),o=e(31);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(30),a=n(21),c=n(31),i=n(38),u=n(41),s=n(42),f=TypeError,p=s("toPrimitive");t.exports=function(t,e){if(!a(t)||c(t))return t;var n,s=i(t,p);if(s){if(e===r&&(e="default"),n=o(s,t,e),!a(n)||c(n))return n;throw new f("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(7),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(32),o=e(8),a=e(33),c=e(34),i=Object;r.exports=c?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,i(r))}},function(t,e,n){var o=n(17),a=n(8);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(6);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(35);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(36),o=e(3),a=e(17).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(17),c=e(37),i=a.process,u=a.Deno,s=i&&i.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&c&&(!(n=c.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=c.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(17).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(39),a=n(12);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(8),o=e(40),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(30),o=e(8),a=e(21),c=TypeError;r.exports=function(r,t){var e,i;if("string"===t&&o(e=r.toString)&&!a(i=n(e,r)))return i;if(o(e=r.valueOf)&&!a(i=n(e,r)))return i;if("string"!==t&&o(e=r.toString)&&!a(i=n(e,r)))return i;throw new c("Can't convert object to primitive value")}},function(r,t,e){var n=e(17),o=e(43),a=e(9),c=e(44),i=e(35),u=e(34),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||c;r.exports=function(r){return a(f,r)||(f[r]=i&&a(s,r)?s[r]:p("Symbol."+r)),f[r]}},function(r,t,e){var n=e(15);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(t,e,n){var o=n(6),a=0,c=Math.random(),i=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+i(++a+c,36)}},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(43),o=e(44),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(17),o=e(49),a=e(51),c=n.ArrayBuffer,i=c&&c.prototype,u=i&&o(i.slice);r.exports=function(r){if(0!==a(r))return!1;if(!u)return!1;try{return u(r,0,0),!1}catch(r){return!0}}},function(r,t,e){var n=e(50),o=e(6);r.exports=function(r){if("Function"===n(r))return o(r)}},function(r,t,e){var n=e(6),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(17),o=e(52),a=e(50),c=n.ArrayBuffer,i=n.TypeError;r.exports=c&&o(c.prototype,"byteLength","get")||function(r){if("ArrayBuffer"!==a(r))throw new i("ArrayBuffer expected");return r.byteLength}},function(r,t,e){var n=e(6),o=e(39);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:r,!0)}})},function(t,e,n){var o=n(17),a=n(55).f,c=n(22),i=n(59),u=n(18),s=n(60),f=n(72);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,b=t.stat;if(n=g?o:b?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!f(g?p:h+(b?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;s(y,l)}(t.sham||l&&l.sham)&&c(y,"sham",!0),i(n,p,y,t)}}},function(r,t,e){var n=e(2),o=e(30),a=e(56),c=e(45),i=e(57),u=e(28),s=e(9),f=e(24),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=i(r),t=u(t),f)try{return p(r,t)}catch(r){}if(s(r,t))return c(!o(a.f,r,t),r[t])}},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){var n=e(58),o=e(11);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(6),o=e(3),a=e(50),c=Object,i=n("".split);r.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?i(r,""):c(r)}:c},function(t,e,n){var o=n(8),a=n(23),c=n(5),i=n(18);t.exports=function(t,e,n,u){u||(u={});var s=u.enumerable,f=u.name!==r?u.name:e;if(o(n)&&c(n,f,u),u.global)s?t[e]=n:i(e,n);else{try{u.unsafe?t[e]&&(s=!0):delete t[e]}catch(r){}s?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(r,t,e){var n=e(9),o=e(61),a=e(55),c=e(23);r.exports=function(r,t,e){for(var i=o(t),u=c.f,s=a.f,f=0;fs;)o(n,e=t[s++])&&(~c(f,e)||u(f,e));return f}},function(r,t,e){var n=e(57),o=e(65),a=e(68),c=function(r){return function(t,e,c){var i=n(t),u=a(i);if(0===u)return!r&&-1;var s,f=o(c,u);if(r&&e!=e){for(;u>f;)if((s=i[f++])!=s)return!0}else for(;u>f;f++)if((r||f in i)&&i[f]===e)return r||f||0;return!r&&-1}};r.exports={includes:c(!0),indexOf:c(!1)}},function(r,t,e){var n=e(66),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(67);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(69);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(66),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(3),o=e(8),a=/#|\.prototype\./,c=function(r,t){var e=u[i(r)];return e===f||e!==s&&(o(t)?n(t):!!t)},i=c.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=c.data={},s=c.NATIVE="N",f=c.POLYFILL="P";r.exports=c},function(t,e,n){var o=n(17),a=n(6),c=n(52),i=n(74),u=n(75),s=n(51),f=n(76),p=n(80),l=o.structuredClone,y=o.ArrayBuffer,v=o.DataView,h=Math.min,g=y.prototype,b=v.prototype,m=a(g.slice),d=c(g,"resizable","get"),w=c(g,"maxByteLength","get"),E=a(b.getInt8),x=a(b.setInt8);t.exports=(p||f)&&function(t,e,n){var o,a=s(t),c=e===r?a:i(e),g=!d||!d(t);if(u(t),p&&(t=l(t,{transfer:[t]}),a===c&&(n||g)))return t;if(a>=c&&(!n||g))o=m(t,0,c);else{var b=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(c,b);for(var O=new v(t),R=new v(o),S=h(c,a),A=0;A92||"NODE"===c&&a>94||"BROWSER"===c&&a>97)return!1;var r=new ArrayBuffer(8),t=i(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(54),o=e(6),a=e(39),c=e(11),i=e(83),u=e(92),s=e(16),f=e(3),p=u.Map,l=u.has,y=u.get,v=u.set,h=o([].push),g=s||f((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:s||g},{groupBy:function(r,t){c(r),a(t);var e=new p,n=0;return i(r,(function(r){var o=t(r,n++);l(e,o)?h(y(e,o),r):v(e,o,[r])})),e}})},function(r,t,e){var n=e(84),o=e(30),a=e(27),c=e(40),i=e(85),u=e(68),s=e(33),f=e(87),p=e(88),l=e(91),y=TypeError,v=function(r,t){this.stopped=r,this.result=t},h=v.prototype;r.exports=function(r,t,e){var g,b,m,d,w,E,x,O=e&&e.that,R=!(!e||!e.AS_ENTRIES),S=!(!e||!e.IS_RECORD),A=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),D=n(t,O),_=function(r){return g&&l(g,"normal",r),new v(!0,r)},I=function(r){return R?(a(r),T?D(r[0],r[1],_):D(r[0],r[1])):T?D(r,_):D(r)};if(S)g=r.iterator;else if(A)g=r;else{if(!(b=p(r)))throw new y(c(r)+" is not iterable");if(i(b)){for(m=0,d=u(r);d>m;m++)if((w=I(r[m]))&&s(h,w))return w;return new v(!1)}g=f(r,b)}for(E=S?r.next:g.next;!(x=o(E,g)).done;){try{w=I(x.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&s(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(49),a=n(39),c=n(7),i=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:c?i(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(42),a=n(86),c=o("iterator"),i=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||i[c]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(30),o=e(39),a=e(27),c=e(40),i=e(88),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?i(r):t;if(o(e))return a(n(e,r));throw new u(c(r)+" is not iterable")}},function(r,t,e){var n=e(89),o=e(38),a=e(12),c=e(86),i=e(42)("iterator");r.exports=function(r){if(!a(r))return o(r,i)||o(r,"@@iterator")||c[n(r)]}},function(t,e,n){var o=n(90),a=n(8),c=n(50),i=n(42)("toStringTag"),u=Object,s="Arguments"===c(function(){return arguments}());t.exports=o?c:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),i))?n:s?c(e):"Object"===(o=c(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(42)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(30),o=e(27),a=e(38);r.exports=function(r,t,e){var c,i;o(r);try{if(!(c=a(r,"return"))){if("throw"===t)throw e;return e}c=n(c,r)}catch(r){i=!0,c=r}if("throw"===t)throw e;if(i)throw c;return o(c),e}},function(r,t,e){var n=e(6),o=Map.prototype;r.exports={Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(54),o=e(32),a=e(6),c=e(39),i=e(11),u=e(28),s=e(83),f=e(3),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||f((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){i(r),c(t);var e=l(null),n=0;return s(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(54),a=n(17),c=n(95),i=n(96),u=n(97),s=n(39),f=n(98),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||f((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?i(arguments,1):[],n=u.f(this),o=f((function(){return c(s(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(7),o=Function.prototype,a=o.apply,c=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?c.bind(a):function(){return c.apply(a,arguments)})},function(r,t,e){var n=e(6);r.exports=n([].slice)},function(t,e,n){var o=n(39),a=TypeError,c=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new c(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(54),o=e(97);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(t,e,n){var o=n(54),a=n(17),c=n(32),i=n(45),u=n(23).f,s=n(9),f=n(101),p=n(102),l=n(106),y=n(108),v=n(109),h=n(2),g=n(16),b="DOMException",m=c("Error"),d=c(b),w=function(){f(this,E);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new d(e,n),a=new m(e);return a.name=b,u(o,"stack",i(1,v(a.stack,1))),p(o,this,w),o},E=w.prototype=d.prototype,x="stack"in new m(b),O="stack"in new d(1,2),R=d&&h&&Object.getOwnPropertyDescriptor(a,b),S=!(!R||R.writable&&R.configurable),A=x&&!S&&!O;o({global:!0,constructor:!0,forced:g||A},{DOMException:A?w:d});var T=c(b),D=T.prototype;if(D.constructor!==T)for(var _ in g||u(D,"constructor",i(1,T)),y)if(s(y,_)){var I=y[_],j=I.s;s(T,j)||u(T,j,i(6,I.c))}},function(r,t,e){var n=e(33),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(8),o=e(21),a=e(103);r.exports=function(r,t,e){var c,i;return a&&n(c=t.constructor)&&c!==e&&o(i=c.prototype)&&i!==e.prototype&&a(r,i),r}},function(t,e,n){var o=n(52),a=n(21),c=n(11),i=n(104);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return c(e),i(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(105),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(21);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(107);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){var n=e(89),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(6),o=Error,a=n("".replace),c=String(new o("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,u=i.test(c);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,i,"");return r}},function(t,e,n){var o,a=n(16),c=n(54),i=n(17),u=n(32),s=n(6),f=n(3),p=n(44),l=n(8),y=n(111),v=n(12),h=n(21),g=n(31),b=n(83),m=n(27),d=n(89),w=n(9),E=n(112),x=n(22),O=n(68),R=n(113),S=n(114),A=n(92),T=n(116),D=n(117),_=n(76),I=n(119),j=n(80),M=i.Object,k=i.Array,P=i.Date,C=i.Error,L=i.TypeError,B=i.PerformanceMark,N=u("DOMException"),U=A.Map,F=A.has,z=A.get,W=A.set,V=T.Set,H=T.add,G=T.has,Y=u("Object","keys"),Q=s([].push),q=s((!0).valueOf),X=s(1..valueOf),K=s("".valueOf),Z=s(P.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!f((function(){var t=new i.Set([7]),e=r(t),n=r(M(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!f((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=i.structuredClone,or=a||!er(nr,C)||!er(nr,N)||(o=nr,!!f((function(){var r=o(new i.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new B($,{detail:r}).detail})),cr=tr(nr)||ar,ir=function(r){throw new N("Uncloneable type: "+r,J)},ur=function(r,t){throw new N((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},sr=function(r,t){return cr||ur(t),cr(r)},fr=function(t,e,n){if(F(e,t))return z(e,t);var o,a,c,u,s,f;if("SharedArrayBuffer"===(n||d(t)))o=cr?cr(t):t;else{var p=i.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,c="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,c),u=new p(t),s=new p(o);for(f=0;f1&&!v(arguments[1])?m(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new L("Transfer option cannot be converted to a sequence");var n=[];b(t,(function(r){Q(n,m(r))}));for(var o,a,c,u,s,f=0,p=O(n),v=new V;f{var e,t,n={212:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"use strict";n.d(t,{K:()=>i});var r=n(941);const s=n.n(r)()("wc-analytics:consent"),o="statistics";const i=new class{consentListeners=[];isListenerInitialized=!1;isWpConsentApiAvailable(){return"function"==typeof window.wp_has_consent}hasAnalyticsConsent(){if(!this.isWpConsentApiAvailable())return s("WP Consent API not available, defaulting to true for backward compatibility"),!0;const e=window.wp_has_consent(o);return s("Analytics consent status:",e),e}addConsentChangeListener(e){this.consentListeners.push(e),this.initializeConsentListener()}initializeConsentListener(){!this.isListenerInitialized&&this.isWpConsentApiAvailable()&&(s("Initializing consent change listener"),document.addEventListener("wp_listen_for_consent_change",e=>{const t=e.detail;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e===o&&this.notifyListeners("allow"===t[e])}),this.isListenerInitialized=!0)}notifyListeners(e){this.consentListeners.forEach(t=>{try{t(e)}catch(e){s("Error in consent change listener:",e)}})}}},455:e=>{"use strict";e.exports=window.wp.apiFetch},941:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(212)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},997:e=>{var t=1e3,n=60*t,r=60*n,s=24*r,o=7*s,i=365.25*s;function a(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=s)return a(e,o,s,"day");if(o>=r)return a(e,o,r,"hour");if(o>=n)return a(e,o,n,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,s),o.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>e+".js?minify=false&ver="+{613:"3c3d9cdbc087c47cacc5",956:"f60e4b77da2ce00a2e0f"}[e],s.miniCssF=e=>{},(()=>{if(!s.miniCssF)throw new Error("MiniCSSWithRTLPlugin was loaded before MiniCSSExtractPlugin");var e;s.miniCssF=(e=s.miniCssF,t=>{var n="rtl"===document.dir,r=e(t);return n?r.replace(/\.css(?:$|\?)/,".rtl$&"):r})})(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@automattic/woocommerce-analytics:",s.l=(n,r,o,i)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(C);var s=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach(e=>e(r)),t)return t(r)},C=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={310:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,s)=>r=e[t]=[n,s]);n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,a,c]=n,u=0;if(i.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(c)c(s)}for(t&&t(n);u{"use strict";var e=s(269);jQuery(()=>{window.wcAnalytics&&(e.K.hasAnalyticsConsent()?s.e(956).then(s.bind(s,633)):e.K.addConsentChangeListener(e=>{e&&s.e(956).then(s.bind(s,633))}))})})()})();; /* eslint-disable no-var */ jQuery(function ($) { var hash = window.location.hash; learndashFocusModeSidebarAutoScroll(); initLoginModal(); if ('#login' == hash) { openLoginModal(); } if ('undefined' !== typeof ldGetUrlVars().login) { var loginStatus = ldGetUrlVars().login; if ('failed' == loginStatus) { openLoginModal(); } } if ('undefined' !== typeof ldGetUrlVars()['ld-topic-page']) { var topicPage = ldGetUrlVars()['ld-topic-page']; var topicIds = topicPage.split('-'); var topicId = Object.values(topicIds)[0]; var lesson = $('#ld-expand-' + topicId); var button = $(lesson).find('.ld-expand-button'); ld_expand_element(button); $('html, body').animate( { scrollTop: $(lesson).offset().top, }, 500 ); } $('body').on('click', 'a[href="#login"]', function (e) { e.preventDefault(); openLoginModal(); }); $('body').on('click', '.ld-modal-closer', function (e) { e.preventDefault(); closeLoginModal(); }); $('body').on('click', '#ld-comments-post-button', function (e) { $(this).addClass('ld-open'); $('#ld-comments-form').removeClass('ld-collapsed'); $('textarea#comment').focus(); }); // Close modal if clicking away /* $('body').on('click', function(e) { if ($('.learndash-wrapper').hasClass('ld-modal-open')) { if ( ! $(e.target).parents('.ld-modal').length && (! $(e.target).is('a'))) { closeLoginModal(); } } }); */ // Close modal on Esc key $(document).on('keyup', function (e) { if (27 === e.keyCode) { closeLoginModal(); } }); $('.learndash-wrapper').on( 'click', 'a.user_statistic', learndash_ld30_show_user_statistic ); focusMobileCheck(); $('body').on('click', '.ld-focus-sidebar-trigger', function (e) { if ($('.ld-focus').hasClass('ld-focus-sidebar-collapsed')) { openFocusSidebar(); } else { closeFocusSidebar(); } }); $('body').on('click', '.ld-mobile-nav a', function (e) { e.preventDefault(); if ($('.ld-focus').hasClass('ld-focus-sidebar-collapsed')) { openFocusSidebar(); } else { closeFocusSidebar(); } }); $('.ld-js-register-account').on('click', function (e) { e.preventDefault(); $('.ld-login-modal-register .ld-modal-text').slideUp('slow'); $('.ld-login-modal-register .ld-alert').slideUp('slow'); $(this).slideUp('slow', function () { $('#ld-user-register').slideDown('slow'); }); }); // If registration login link filter not defined, allow to replace the register form with login form if ('' == $('.registration-login-link').attr('href')) { $('.registration-login-link').on('click', function (e) { e.preventDefault(); $('#learndash_registerform, .registration-login').hide(); $( '.registration-login-form, .show-register-form, .show-password-reset-link' ).show(); }); $('.show-register-form').on('click', function (e) { e.preventDefault(); $( '.registration-login-form, .show-register-form, .show-password-reset-link' ).hide(); $('#learndash_registerform, .registration-login').show(); }); } var windowWidth = $(window).width(); $(window).on('orientationchange', function () { windowWidth = $(window).width(); }); $(window).on('resize', function () { if ($(this).width() !== windowWidth && 1024 >= $(this).width()) { setTimeout(function () { focusMobileResizeCheck(); }, 50); } }); if ($('.ld-course-status-content').length) { var tallest = 0; $('.ld-course-status-content').each(function () { if ($(this).height() > tallest) { tallest = $(this).height(); } }); $('.ld-course-status-content').height(tallest); } function focusMobileCheck() { if (1024 > $(window).width()) { closeFocusSidebarPageLoad(); } } function focusMobileResizeCheck() { if ( 1024 > $(window).width() && !$('.ld-focus').hasClass('ld-focus-sidebar-collapsed') ) { closeFocusSidebar(); } else if ( 1024 <= $(window).width() && $('.ld-focus').hasClass('ld-focus-sidebar-filtered') ) { closeFocusSidebar(); } else if ( 1024 <= $(window).width() && !$('.ld-focus').hasClass('ld-focus-sidebar-filtered') && $('.ld-focus').hasClass('ld-focus-sidebar-collapsed') ) { openFocusSidebar(); } } function focusMobileHandleOrientationChange(e) { if (e.matches) { if ( 1024 <= $(window).width() && !$('.ld-focus').hasClass('ld-focus-sidebar-filtered') && $('.ld-focus').hasClass('ld-focus-sidebar-collapsed') ) { openFocusSidebar(); } } } window .matchMedia('(orientation: landscape)') .addListener(focusMobileHandleOrientationChange); function closeFocusSidebarPageLoad() { $('.ld-focus').addClass('ld-focus-sidebar-collapsed'); $('.ld-focus').removeClass('ld-focus-initial-transition'); $('.ld-mobile-nav').removeClass('expanded'); positionTooltips(); } function closeFocusSidebar() { $('.ld-focus').addClass('ld-focus-sidebar-collapsed'); $('.ld-mobile-nav').removeClass('expanded'); if ( $('.ld-focus-sidebar-trigger .ld-icon').hasClass( 'ld-icon-arrow-left' ) ) { $('.ld-focus-sidebar-trigger .ld-icon').removeClass( 'ld-icon-arrow-left' ); $('.ld-focus-sidebar-trigger .ld-icon').addClass( 'ld-icon-arrow-right' ); } else if ( $('.ld-focus-sidebar-trigger .ld-icon').hasClass( 'ld-icon-arrow-right' ) ) { $('.ld-focus-sidebar-trigger .ld-icon').removeClass( 'ld-icon-arrow-right' ); $('.ld-focus-sidebar-trigger .ld-icon').addClass( 'ld-icon-arrow-left' ); } positionTooltips(); } function openFocusSidebar() { focusMobileCheck(); $('.ld-focus').removeClass('ld-focus-sidebar-collapsed'); $('.ld-mobile-nav').addClass('expanded'); if ( $('.ld-focus-sidebar-trigger .ld-icon').hasClass( 'ld-icon-arrow-left' ) ) { $('.ld-focus-sidebar-trigger .ld-icon').removeClass( 'ld-icon-arrow-left' ); $('.ld-focus-sidebar-trigger .ld-icon').addClass( 'ld-icon-arrow-right' ); } else if ( $('.ld-focus-sidebar-trigger .ld-icon').hasClass( 'ld-icon-arrow-right' ) ) { $('.ld-focus-sidebar-trigger .ld-icon').removeClass( 'ld-icon-arrow-right' ); $('.ld-focus-sidebar-trigger .ld-icon').addClass( 'ld-icon-arrow-left' ); } positionTooltips(); } $('.ld-file-input').each(function () { var $input = $(this), $label = $input.next('label'), labelVal = $label.html(); $input.on('change', function (e) { var fileName = ''; if (this.files && 1 < this.files.length) { fileName = ( this.getAttribute('data-multiple-caption') || '' ).replace('{count}', this.files.length); } else if (e.target.value) { fileName = e.target.value.split('\\').pop(); } if (fileName) { $label.find('span').html(fileName); $label.addClass('ld-file-selected'); $('#uploadfile_btn').attr('disabled', false); } else { $label.html(labelVal); $label.removeClass('ld-file-selected'); $('#uploadfile_btn').attr('disabled', true); } }); $('#uploadfile_form').on('submit', function () { $label.removeClass('ld-file-selected'); $('#uploadfile_btn').attr('disabled', true); }); // Firefox bug fix $input .on('focus', function () { $input.addClass('has-focus'); }) .on('blur', function () { $input.removeClass('has-focus'); }); }); $('body').on('click', '.ld-expand-button', function (e) { e.preventDefault(); ld_expand_element($(this)); positionTooltips(); }); $('body').on('click', '.ld-search-prompt', function (e) { e.preventDefault(); $('#course_name_field').focus(); ld_expand_element($(this)); }); function ld_expand_button_state(state, elm) { var $expandText = $(elm)[0].hasAttribute('data-ld-expand-text') ? $(elm).attr('data-ld-expand-text') : 'Expand'; var $collapseText = $(elm)[0].hasAttribute('data-ld-collapse-text') ? $(elm).attr('data-ld-collapse-text') : 'Collapse'; if ('collapse' == state) { $(elm).removeClass('ld-expanded'); if ('false' !== $collapseText) { $(elm).find('.ld-text').text($expandText); } } else { $(elm).addClass('ld-expanded'); if ('false' !== $collapseText) { $(elm).find('.ld-text').text($collapseText); } } } function ld_expand_element(elm, collapse) { if (collapse === undefined) { collapse = false; } var elmParentWrapper = elm.parents('.ld-focus-sidebar'); if ( 'undefined' === typeof elmParentWrapper || !elmParentWrapper.length ) { var elmParentWrapper = elm.parents('.learndash-wrapper'); } if ( 'undefined' === typeof elmParentWrapper || !elmParentWrapper.length ) { return; } // Get the button's state var $expanded = $(elm).hasClass('ld-expanded'); // Get the element to expand if ($(elm)[0] && $(elm)[0].hasAttribute('data-ld-expands')) { var $expands = $(elm).attr('data-ld-expands'); if ('undefined' === typeof $expands || !$expands.length) { return; } var $expandElm = $(elmParentWrapper).find( '[data-ld-expand-id="' + $expands + '"]' ); if ('undefined' === typeof $expandElm || !$expandElm.length) { return; } var $expandsChild = $($expandElm).find( '.ld-item-list-item-expanded' ); if ($expandsChild.length) { $expandElm = $expandsChild; } var totalHeight = 0; $expandElm.find('> *').each(function () { totalHeight += $(this).outerHeight(); }); $expandElm.attr('data-height', '' + (totalHeight + 50) + ''); // If the element expands a list if ( $(elmParentWrapper) .find('[data-ld-expand-id="' + $expands + '"]')[0] .hasAttribute('data-ld-expand-list') ) { var $container = $(elmParentWrapper).find( '[data-ld-expand-id="' + $expands + '"]' ); var innerButtons = $container.find('.ld-expand-button'); if ($expanded) { ld_expand_button_state('collapse', elm); innerButtons.each(function () { ld_expand_element($(this), true); }); } else { ld_expand_button_state('expand', elm); innerButtons.each(function () { ld_expand_element($(this)); }); } // If the element expands an item } else if ( $(elmParentWrapper).find( '[data-ld-expand-id="' + $expands + '"]' ).length ) { if ($expanded || true == collapse) { ld_expand_singular_item( elm, $(elmParentWrapper).find( '[data-ld-expand-id="' + $expands + '"]' ), $expandElm ); } else { ld_collapse_singular_item( elm, $(elmParentWrapper).find( '[data-ld-expand-id="' + $expands + '"]' ), $expandElm ); } } else { console.log('LearnDash: No expandable content was found'); } positionTooltips(); } } function ld_expand_singular_item(elm, $containerElm, $expandElm) { $containerElm.removeClass('ld-expanded'); ld_expand_button_state('collapse', elm); $expandElm.css({ 'max-height': 0, }); } function ld_collapse_singular_item(elm, $containerElm, $expandElm) { $containerElm.addClass('ld-expanded'); ld_expand_button_state('expand', elm); $expandElm.css({ 'max-height': $expandElm.data('height'), }); } $('body').on('click', '.ld-closer', function (e) { ld_expand_element($('.ld-search-prompt'), true); }); $('body').on('click', '.ld-tabs-navigation .ld-tab', function () { var $tab = $('#' + $(this).attr('data-ld-tab')); if ($tab.length) { $('.ld-tabs-navigation .ld-tab.ld-active').removeClass('ld-active'); $('.ld-tabs-navigation .ld-tab').removeAttr('aria-selected'); $(this).addClass('ld-active'); $(this).attr('aria-selected', 'true'); $('.ld-tabs-content .ld-tab-content.ld-visible').removeClass( 'ld-visible' ); $tab.addClass('ld-visible'); } positionTooltips(); }); var $tooltips = $('*[data-ld-tooltip]'); initTooltips(); function initTooltips() { // Clear out old tooltips if ($('#learndash-tooltips').length) { $('#learndash-tooltips').remove(); $tooltips = $('*[data-ld-tooltip]'); } if ($tooltips.length) { $('body').prepend('
'); var $ctr = 1; $tooltips.each(function () { var anchor = $(this); if (anchor.hasClass('ld-item-list-item')) { anchor = anchor.find('.ld-item-title'); } /** * Prevent calendar icon from being clickable. */ if ( 'undefined' !== typeof anchor && $(anchor).hasClass('ld-status-waiting') ) { $(anchor).on('click', function (e) { e.preventDefault(); return false; }); // Also prevent parent from being clickable. var parent_anchor = $(anchor).parents('a'); if ('undefined' !== typeof parent_anchor) { $(parent_anchor).on('click', function (e) { e.preventDefault(); return false; }); } } var elementOffsets = { top: anchor.offset().top, left: anchor.offset().left + anchor.outerWidth() / 2, }; var $content = $(this).attr('data-ld-tooltip'); var $rel_id = Math.floor(Math.random() * 99999); //var $tooltip = '' + $content + ''; var $tooltip = '' + $content + ''; $(this).attr('data-ld-tooltip-id', $rel_id); $('#learndash-tooltips').append($tooltip); $ctr++; var $tooltip = $('#ld-tooltip-' + $rel_id); $(this) .on('mouseenter', function () { $tooltip.addClass('ld-visible'); }) .on('mouseleave', function () { $tooltip.removeClass('ld-visible'); }); }); $(window).on('resize', function () { // Reposition tooltips after resizing positionTooltips(); }); $(window) .add('.ld-focus-sidebar-wrapper') .on('scroll', function () { // Hide tooltips so they don't persist while scrolling $('.ld-visible.ld-tooltip').removeClass('ld-visible'); // Reposition tooltips after scrolling positionTooltips(); }); positionTooltips(); } } function initLoginModal() { var modal_wrapper = $('.learndash-wrapper-login-modal'); if ('undefined' !== typeof modal_wrapper && modal_wrapper.length) { // Move the model to be first element of the body. See LEARNDASH-3503 $(modal_wrapper).prependTo('body'); } } function openLoginModal() { var modal_wrapper = $('.learndash-wrapper-login-modal'); if ('undefined' !== typeof modal_wrapper && modal_wrapper.length) { $(modal_wrapper).addClass('ld-modal-open'); $(modal_wrapper).removeClass('ld-modal-closed'); // Removed LEARNDASH-3867 #4 $('html, body').animate( { scrollTop: $('.ld-modal', modal_wrapper).offset().top, }, 50 ); } } function closeLoginModal() { var modal_wrapper = $('.learndash-wrapper-login-modal'); if ('undefined' !== typeof modal_wrapper && modal_wrapper.length) { $(modal_wrapper).removeClass('ld-modal-open'); $(modal_wrapper).addClass('ld-modal-closed'); } } function positionTooltips() { if ('undefined' !== typeof $tooltips) { setTimeout(function () { $tooltips.each(function () { var anchor = $(this); var $rel_id = anchor.attr('data-ld-tooltip-id'); $tooltip = $('#ld-tooltip-' + $rel_id); if (anchor.hasClass('ld-item-list-item')) { //anchor = anchor.find('.ld-item-title'); anchor = anchor.find('.ld-status-icon'); } var parent_focus = jQuery(anchor).parents('.ld-focus-sidebar'); var left_post = anchor.offset().left + (anchor.outerWidth() + 10); if (parent_focus.length) { left_post = anchor.offset().left + (anchor.outerWidth() - 18); } // Get the main content height var focusModeMainContentHeight = $('.ld-focus-main').height(); // Current tooltip height var focusModeCurrentTooltipHeight = anchor.offset().top + -3; // Position tooltip depending on focus mode or not if (!focusModeMainContentHeight) { var anchorTop = anchor.offset().top + -3; var anchorLeft = anchor.offset().left; } else { anchorTop = focusModeCurrentTooltipHeight < focusModeMainContentHeight ? focusModeCurrentTooltipHeight : focusModeMainContentHeight; anchorLeft = left_post; } $tooltip .css({ top: anchorTop, //'left' : anchor.offset().left + (anchor.outerWidth() / 2), //'left': left_post, //anchor.offset().left + (anchor.outerWidth() +10), left: anchorLeft, //anchor.offset().left + (anchor.outerWidth() +10), 'margin-left': 0, 'margin-right': 0, }) .removeClass('ld-shifted-left ld-shifted-right'); if ($tooltip.offset().left <= 0) { $tooltip .css({ 'margin-left': Math.abs($tooltip.offset().left), }) .addClass('ld-shifted-left'); } var $tooltipRight = $(window).width() - ($tooltip.offset().left + $tooltip.outerWidth()); if (0 >= $tooltipRight && 360 < $(window).width()) { $tooltip .css({ 'margin-right': Math.abs($tooltipRight) }) .addClass('ld-shifted-right'); } }); }, 500); } } $('body').on('click', '#ld-profile .ld-reset-button', function (e) { e.preventDefault(); $('#ld-profile #course_name_field').val(''); var searchVars = { shortcode_instance: $('#ld-profile').data('shortcode_instance'), }; searchVars['ld-profile-search'] = $(this) .parents('.ld-item-search-wrapper') .find('#course_name_field') .val(); searchVars['ld-profile-search-nonce'] = $(this) .parents('.ld-item-search-wrapper') .find('form.ld-item-search-fields') .data('nonce'); $('#ld-profile #ld-main-course-list').addClass('ld-loading'); $.ajax({ type: 'GET', url: ldVars.ajaxurl + '?action=ld30_ajax_profile_search', data: searchVars, success(response) { if ('undefined' !== typeof response.data.markup) { $('#ld-profile').html(response.data.markup); ld_expand_element('#ld-profile .ld-search-prompt', false); } }, }); }); $('body').on('submit', '.ld-item-search-fields', function (e) { e.preventDefault(); var searchVars = { shortcode_instance: $('#ld-profile').data('shortcode_instance'), }; searchVars['ld-profile-search'] = $(this) .parents('.ld-item-search-wrapper') .find('#course_name_field') .val(); searchVars['ld-profile-search-nonce'] = $(this) .parents('.ld-item-search-wrapper') .find('form.ld-item-search-fields') .data('nonce'); $('#ld-profile #ld-main-course-list').addClass('ld-loading'); $.ajax({ type: 'GET', url: ldVars.ajaxurl + '?action=ld30_ajax_profile_search', data: searchVars, success(response) { if ('undefined' !== typeof response.data.markup) { $('#ld-profile').html(response.data.markup); ld_expand_element('#ld-profile .ld-search-prompt', false); } }, }); }); $('body').on('click', '.ld-pagination a', function (e) { e.preventDefault(); var linkVars = {}; var parentVars = {}; $(this) .attr('href') .replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { linkVars[key] = value; }); linkVars.pager_nonce = $(this) .parents('.ld-pagination') .data('pager-nonce'); linkVars.pager_results = $(this) .parents('.ld-pagination') .data('pager-results'); linkVars.context = $(this).data('context'); console.log('linkVars[%o]', linkVars); parentVars.currentTarget = e.currentTarget; if ('profile' != linkVars.context) { linkVars.lesson_id = $(this).data('lesson_id'); linkVars.course_id = $(this).data('course_id'); if ($('.ld-course-nav-' + linkVars.course_id).length) { linkVars.widget_instance = $( '.ld-course-nav-' + linkVars.course_id ).data('widget_instance'); } } if ('course_topics' == linkVars.context) { $('#ld-topic-list-' + linkVars.lesson_id).addClass('ld-loading'); $('#ld-nav-content-list-' + linkVars.lesson_id).addClass( 'ld-loading' ); } if ('course_content_shortcode' == linkVars.context) { parentVars.parent_container = $(parentVars.currentTarget).closest( '.ld-course-content-' + linkVars.course_id ); if ( 'undefined' !== typeof parentVars.parent_container && parentVars.parent_container.length ) { $(parentVars.parent_container).addClass('ld-loading'); linkVars.shortcode_instance = $( parentVars.parent_container ).data('shortcode_instance'); } else { $('.ld-course-content-' + linkVars.course_id).addClass( 'ld-loading' ); linkVars.shortcode_instance = $( '.ld-course-content-' + linkVars.course_id ).data('shortcode_instance'); } } else if ('course_lessons' == linkVars.context) { var parent_container; // Check if we are within the Course Navigation Widget. if ( 'undefined' === typeof parentVars.parent_container || !parentVars.parent_container.length ) { parent_container = $(parentVars.currentTarget).parents( '.ld-lesson-navigation' ); if ( 'undefined' !== typeof parent_container && parent_container.length ) { parentVars.context_sub = 'course_navigation_widget'; parentVars.parent_container = $( parentVars.currentTarget ).parents('#ld-lesson-list-' + linkVars.course_id); } } // Check if we are within the Focus Mode Sidebar. if ( 'undefined' === typeof parentVars.parent_container || !parentVars.parent_container.length ) { parent_container = $(parentVars.currentTarget).parents( '.ld-focus-sidebar-wrapper' ); if ( 'undefined' !== typeof parent_container && parent_container.length ) { parentVars.context_sub = 'focus_mode_sidebar'; parentVars.parent_container = $( parentVars.currentTarget ).parents('#ld-lesson-list-' + linkVars.course_id); } } if ( 'undefined' === typeof parentVars.parent_container || !parentVars.parent_container.length ) { parentVars.parent_container = $( parentVars.currentTarget ).closest( '#ld-item-list-' + linkVars.course_id, '#ld-lesson-list-' + linkVars.course_id ); } if ( 'undefined' !== typeof parentVars.parent_container && parentVars.parent_container.length ) { $(parentVars.parent_container).addClass('ld-loading'); } else { // Fallback solution. $('#ld-item-list-' + linkVars.course_id).addClass('ld-loading'); $('#ld-lesson-list-' + linkVars.course_id).addClass( 'ld-loading' ); } } if ('profile' == linkVars.context) { $('#ld-profile #ld-main-course-list').addClass('ld-loading'); linkVars.shortcode_instance = $('#ld-profile').data('shortcode_instance'); } if ('profile_quizzes' == linkVars.context) { $( '#ld-course-list-item-' + linkVars.pager_results.quiz_course_id + ' .ld-item-contents' ).addClass('ld-loading'); } if ('course_info_courses' == linkVars.context) { $('.ld-user-status').addClass('ld-loading'); linkVars.shortcode_instance = $('.ld-user-status').data('shortcode-atts'); } if ('group_courses' == linkVars.context) { linkVars.group_id = $(this).data('group_id'); if ('undefined' !== typeof linkVars.group_id) { parent_container = $(parentVars.currentTarget).parents( '.ld-group-courses-' + linkVars.group_id ); if ( 'undefined' !== typeof parent_container && parent_container.length ) { $(parent_container).addClass('ld-loading'); parentVars.parent_container = parent_container; } } } $.ajax({ type: 'GET', url: ldVars.ajaxurl + '?action=ld30_ajax_pager', data: linkVars, success(response) { // If we have a course listing, update if ('course_topics' == linkVars.context) { if ($('#ld-topic-list-' + linkVars.lesson_id).length) { if ('undefined' !== typeof response.data.topics) { $('#ld-topic-list-' + linkVars.lesson_id).html( response.data.topics ); } if ('undefined' !== typeof response.data.pager) { $('#ld-expand-' + linkVars.lesson_id) .find('.ld-table-list-footer') .html(response.data.pager); } learndashSetMaxHeight( $('.ld-lesson-item-' + linkVars.lesson_id).find( '.ld-item-list-item-expanded' ) ); $('#ld-topic-list-' + linkVars.lesson_id).removeClass( 'ld-loading' ); } if ( $('#ld-nav-content-list-' + linkVars.lesson_id).length ) { if ('undefined' !== typeof response.data.nav_topics) { $('#ld-nav-content-list-' + linkVars.lesson_id) .find('.ld-table-list-items') .html(response.data.topics); } if ('undefined' !== typeof response.data.pager) { $('#ld-nav-content-list-' + linkVars.lesson_id) .find('.ld-table-list-footer') .html(response.data.pager); } $( '#ld-nav-content-list-' + linkVars.lesson_id ).removeClass('ld-loading'); } } if ('course_content_shortcode' == linkVars.context) { if ('undefined' !== typeof response.data.markup) { if ( 'undefined' !== typeof parentVars.parent_container && parentVars.parent_container.length ) { $(parentVars.parent_container).replaceWith( response.data.markup ); } else { $( '#learndash_post_' + linkVars.course_id ).replaceWith(response.data.markup); } } } else if ('course_lessons' == linkVars.context) { if ( 'undefined' !== typeof parentVars.parent_container && parentVars.parent_container.length ) { if ( 'course_navigation_widget' == parentVars.context_sub ) { if ( 'undefined' !== typeof response.data.nav_lessons ) { $(parentVars.parent_container) .html(response.data.nav_lessons) .removeClass('ld-loading'); } } else if ( 'focus_mode_sidebar' == parentVars.context_sub ) { if ( 'undefined' !== typeof response.data.nav_lessons ) { $(parentVars.parent_container) .html(response.data.nav_lessons) .removeClass('ld-loading'); } } else if ( 'undefined' !== typeof response.data.lessons ) { $(parentVars.parent_container) .html(response.data.lessons) .removeClass('ld-loading'); } } else { if ($('#ld-item-list-' + linkVars.course_id).length) { if ('undefined' !== typeof response.data.lessons) { $('#ld-item-list-' + linkVars.course_id) .html(response.data.lessons) .removeClass('ld-loading'); } } if ($('#ld-lesson-list-' + linkVars.course_id).length) { if ( 'undefined' !== typeof response.data.nav_lessons ) { $('#ld-lesson-list-' + linkVars.course_id) .html(response.data.nav_lessons) .removeClass('ld-loading'); } } } } if ('group_courses' == linkVars.context) { if ( 'undefined' !== typeof parentVars.parent_container && parentVars.parent_container.length ) { if ('undefined' !== typeof response.data.markup) { $(parentVars.parent_container) .html(response.data.markup) .removeClass('ld-loading'); } } } if ('profile' == linkVars.context) { if ('undefined' !== typeof response.data.markup) { $('#ld-profile').html(response.data.markup); } } if ('profile_quizzes' == linkVars.context) { if ('undefined' !== typeof response.data.markup) { $( '#ld-course-list-item-' + linkVars.pager_results.quiz_course_id + ' .ld-item-list-item-expanded .ld-item-contents' ).replaceWith(response.data.markup); $( '#ld-course-list-item-' + linkVars.pager_results.quiz_course_id ) .get(0) .scrollIntoView({ behavior: 'smooth' }); } } if ('course_info_courses' == linkVars.context) { if ('undefined' !== typeof response.data.markup) { $('.ld-user-status').replaceWith(response.data.markup); } } $('body').trigger('ld_has_paginated'); initTooltips(); }, }); }); if ($('#learndash_timer').length) { var timer_el = jQuery('#learndash_timer'); var timer_seconds = timer_el.attr('data-timer-seconds'); var timer_button_el = jQuery(timer_el.attr('data-button')); var cookie_key = timer_el.attr('data-cookie-key'); if ('undefined' !== typeof cookie_key) { var cookie_name = 'learndash_timer_cookie_' + cookie_key; } else { var cookie_name = 'learndash_timer_cookie'; } cookie_timer_seconds = jQuery.cookie(cookie_name); if ('undefined' !== typeof cookie_timer_seconds) { timer_seconds = parseInt(cookie_timer_seconds); } if (0 == timer_seconds) { $(timer_el).hide(); } $(timer_button_el).on('learndash-time-finished', function () { $(timer_el).hide(); }); } $(document).on('learndash_video_disable_assets', function (event, status) { if ('undefined' === typeof learndash_video_data) { return false; } if ('BEFORE' == learndash_video_data.videos_shown) { if (true == status) { $('.ld-lesson-topic-list').hide(); $('.ld-lesson-navigation') .find('#ld-nav-content-list-' + ldVars.postID) .addClass('user_has_no_access'); $('.ld-quiz-list').hide(); } else { $('.ld-lesson-topic-list').slideDown(); $('.ld-quiz-list').slideDown(); $('.ld-lesson-navigation') .find('#ld-nav-content-list-' + ldVars.postID) .removeClass('user_has_no_access'); } } }); $('.learndash-wrapper').on( 'click', '.wpProQuiz_questionListItem input[type="radio"]', function (e) { $(this) .parents('.wpProQuiz_questionList') .find('label') .removeClass('is-selected'); $(this).parents('label').addClass('is-selected'); } ); $('.learndash-wrapper').on( 'click', '.wpProQuiz_questionListItem input[type="checkbox"]', function (e) { if (jQuery(e.currentTarget).is(':checked')) { $(this).parents('label').addClass('is-selected'); } else { $(this).parents('label').removeClass('is-selected'); } } ); function learndash_ld30_show_user_statistic(e) { e.preventDefault(); var refId = jQuery(this).data('ref-id'); var quizId = jQuery(this).data('quiz-id'); var userId = jQuery(this).data('user-id'); var statistic_nonce = jQuery(this).data('statistic-nonce'); var post_data = { action: 'wp_pro_quiz_admin_ajax_statistic_load_user', func: 'statisticLoadUser', data: { quizId, userId, refId, statistic_nonce, avg: 0, }, }; jQuery('#wpProQuiz_user_overlay, #wpProQuiz_loadUserData').show(); var content = jQuery('#wpProQuiz_user_content').hide(); //console.log('- learndash.js'); jQuery.ajax({ type: 'POST', url: ldVars.ajaxurl, dataType: 'json', cache: false, data: post_data, error(jqXHR, textStatus, errorThrown) {}, success(reply_data) { if ('undefined' !== typeof reply_data.html) { content.html(reply_data.html); jQuery('#wpProQuiz_user_content').show(); //console.log('trigger event change - learndash.js'); jQuery('body').trigger( 'learndash-statistics-contentchanged' ); jQuery('#wpProQuiz_loadUserData').hide(); content.find('.statistic_data').on('click', function () { jQuery(this).parents('tr').next().toggle('fast'); return false; }); } }, }); jQuery('#wpProQuiz_overlay_close').on('click', function () { jQuery('#wpProQuiz_user_overlay').hide(); }); } function learndashSetMaxHeight(elm) { var totalHeight = 0; elm.find('> *').each(function () { totalHeight += $(this).outerHeight(); }); elm.attr('data-height', '' + (totalHeight + 50) + ''); elm.css({ 'max-height': totalHeight + 50, }); } /** * Will scroll the position of the Focus Mode sidebar * to the active step. */ function learndashFocusModeSidebarAutoScroll() { if (jQuery('.learndash-wrapper .ld-focus').length) { var sidebar_wrapper = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar-wrapper' ); var sidebar_current_topic = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar-wrapper .ld-is-current-item' ); if ( 'undefined' !== typeof sidebar_current_topic && sidebar_current_topic.length ) { var sidebar_scrollTo = sidebar_current_topic; } else { var sidebar_current_lesson = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar-wrapper .ld-is-current-lesson' ); if ( 'undefined' !== typeof sidebar_current_lesson && sidebar_current_lesson.length ) { var sidebar_scrollTo = sidebar_current_lesson; } } if ( 'undefined' !== typeof sidebar_scrollTo && sidebar_scrollTo.length ) { var offset_top = 0; if ( jQuery('.learndash-wrapper .ld-focus .ld-focus-header') .length ) { var logo_height = jQuery( '.learndash-wrapper .ld-focus .ld-focus-header' ).height(); offset_top += logo_height; } if ( jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-course-navigation-heading' ).length ) { var heading_height = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-course-navigation-heading' ).height(); offset_top += heading_height; } if ( jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-focus-sidebar-wrapper' ).length ) { var container_height = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-focus-sidebar-wrapper' ).height(); offset_top += container_height; } var current_item_height = jQuery(sidebar_scrollTo).height(); offset_top -= current_item_height; sidebar_wrapper.animate( { scrollTop: sidebar_scrollTo.offset().top - offset_top, }, 1000 ); } } } // Coupon processing. function update_payment_forms(data) { $('#total-row').attr('data-total', data.total.value); // Update PayPal form amount. $('form[name="buynow"] input[name="amount"]').val(data.total.value); // Update Stripe form amount. $('form.learndash-stripe-checkout input[name="stripe_price"]').val( data.total.stripe_value ); // Remove Stripe Connect session to respect the new amount. const stripe_course_id = $( '.learndash-stripe-checkout input[name="stripe_course_id"]' ).val(); if (stripe_course_id) { LD_Cookies.remove('ld_stripe_session_id_' + stripe_course_id); // Stripe Plugin (Checkout). LD_Cookies.remove( 'ld_stripe_connect_session_id_' + stripe_course_id ); // Stripe Connect in core. } // Re-init Stripe Plugin (Legacy) to respect the new amount. if (typeof ld_init_stripe_legacy === 'function') { ld_init_stripe_legacy(); } } $('.btn-join').on('click', function (e) { if ($(this).hasClass('btn-disabled')) { e.preventDefault(); return false; } const total = parseFloat($('#total-row').attr('data-total')); if (0 === total) { $.ajax({ type: 'POST', url: ldVars.ajaxurl, dataType: 'json', cache: false, data: { action: 'learndash_enroll_with_zero_price', nonce: $('#apply-coupon-form').data('nonce'), post_id: $('#apply-coupon-form').data('post-id'), }, success(response) { if (response.success) { window.location.replace(response.data.redirect_url); } else { alert(response.data.message); } }, }); e.preventDefault(); return false; } }); $('#apply-coupon-form').on('submit', function (e) { e.preventDefault(); $.ajax({ type: 'POST', url: ldVars.ajaxurl, dataType: 'json', cache: false, data: { action: 'learndash_apply_coupon', nonce: $(this).data('nonce'), coupon_code: $(this).find('#coupon-field').val(), post_id: $(this).data('post-id'), }, success(response) { $('#coupon-alerts .coupon-alert').hide(); const $alert = $('#coupon-alerts').find( response.success ? '.coupon-alert-success' : '.coupon-alert-warning' ); const $coupon_row = $('#coupon-row'); if (response.success) { $coupon_row .find('.purchase-label > span') .html(response.data.coupon_code); // Set coupon code in totals. $coupon_row .find('.purchase-value span') .html(response.data.discount); // Set discount value in totals. $coupon_row.css('display', 'flex').hide().fadeIn(); // Show a coupon row in totals. $('#total-row .purchase-value').html( response.data.total.formatted ); // Update Total. $('#totals').show(); update_payment_forms(response.data); } $alert.find('.ld-alert-messages').html(response.data.message); $alert.fadeIn(); }, }); }); $('#remove-coupon-form').on('submit', function (e) { e.preventDefault(); $.ajax({ type: 'POST', url: ldVars.ajaxurl, dataType: 'json', cache: false, data: { action: 'learndash_remove_coupon', nonce: $(this).data('nonce'), post_id: $(this).data('post-id'), }, success(response) { $('#coupon-alerts .coupon-alert').hide(); const $alert = $('#coupon-alerts').find( response.success ? '.coupon-alert-success' : '.coupon-alert-warning' ); if (response.success) { $('#coupon-row').hide(); // Hide a coupon row in totals. $('#coupon-field').val(''); // Set coupon field empty. $('#price-row .purchase-value').html( response.data.total.formatted ); // Update Price. $('#subtotal-row .purchase-value').html( response.data.total.formatted ); // Update Subtotal. $('#total-row .purchase-value').html( response.data.total.formatted ); // Update Total. $('#totals').hide(); update_payment_forms(response.data); } $alert.find('.ld-alert-messages').html(response.data.message); $alert.fadeIn(); }, }); }); }); function ldGetUrlVars() { var vars = {}; var parts = window.location.href.replace( /[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { vars[key] = value; } ); return vars; } ; !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s0))return r=s.getHost(e),!0;for(var t=0;t0)for(var i=0;i0)for(var s=0;se.split(".").reduce((t,e)=>t&&t[e],t)),s=()=>null,i=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function r(){return"undefined"!=typeof sbjs}function c(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),a(t.getAttributionData())},o)}}t.getAttributionData=function(){const i=e.allowTracking&&r()?n:s,o=r()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,i(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!r())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const s=t.getAttributionData();!function(t){for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}(s),a(s)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const s=document.createElement("input");s.type="hidden",s.name=`${e.prefix}${n}`,s.value=i(this.values&&this.values[n]||""),t.appendChild(s)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=i(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);; /*! This file is auto-generated */ (()=>{"use strict";var e={d:(t,d)=>{for(var o in d)e.o(d,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:d[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function d(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:()=>d}),(window.wp=window.wp||{}).domReady=t.default})();;