PageSourceSearch

https://welovereading.org/_static/??-eJydjsEOgjAQRH/IpRgO6MH4LVA2Z…/yT8ut/7AK7u9u5vdZte6mb5gnMFX9Y

js welovereading.org collected 2026-10-02 10:53:21 UTC 71,144 bytes, 2,151 lines download raw bytes

1jQuery(document).ready(function(){jQuery('body').on('click','.jm-post-like',function(event){event.preventDefault();heart=jQuery(this);post_id=heart.data("post_id");/*heart.html("<i class='fa fa-heart'></i><i class='fa fa-cog fa-spin'></i>");*/jQuery.ajax({type:"post",url:ajax_var.url,data:"action=jm-post-like&nonce="+ajax_var.nonce+"&jm_post_like=&post_id="+post_id,success:function(count){if(count.indexOf("already")!==-1){var lecount=count.replace("already","");if(lecount==="0"){lecount="Like"}heart.prop('title','Like');heart.removeClass("liked");heart.html("<i class='fa fa-heart-o'></i><span>"+lecount+"</span>")}else{heart.prop('title','Unlike');heart.addClass("liked");heart.html("<i class='fa fa-heart'></i><span>"+count+"</span>")}}})})});;
2!function(){const o=window.navigator.userAgent;Object.entries({android:/android/i,iphone:/iPhone/i,ipad:/iPad/i}).forEach((([n,i])=>{o.match(i)&&document.body.classList.add(`tec-is-${n}`)}))}(),window.tec=window.tec||{},window.tec.common=window.tec.common||{},window.tec.common.userAgent={};;
3// math helper...
4function cluevoPolygraphValueToPoint(value, index, total) {
5  var x = 0;
6  var y = -value * 0.8;
7  var angle = ((Math.PI * 2) / total) * index;
8  var cos = Math.cos(angle);
9  var sin = Math.sin(angle);
10  var tx = x * cos - y * sin + 100;
11  var ty = x * sin + y * cos + 100;
12  return {
13    x: tx,
14    y: ty,
15  };
16}
17
18jQuery(window).ready(function() {
19  if (jQuery("#cluevo-polygraph").length > 0) {
20    const cluevoCompetencePolygraphApp = Vue.createApp({
21      name: "cluevo-polygraph",
22      data() {
23        return {
24          stats: [],
25          radius: 80,
26        };
27      },
28      created() {
29        this.stats = cluevoPolygraphData ?? [];
30      },
31      computed: {
32        points: function() {
33          var total = this.stats.length;
34          return this.stats
35            .map(function(stat, i) {
36              var point = cluevoPolygraphValueToPoint(stat.value, i, total);
37              return point.x + "," + point.y;
38            })
39            .join(" ");
40        },
41      },
42      template: `
43        <svg width="200" height="200">
44          <g>
45            <circle cx="100" cy="100" :r="radius"></circle>
46            <polygon :points="points"></polygon>
47            <axis-label
48              v-for="(stat, index) in stats"
49              :stat="stat"
50              :index="index"
51              :total="stats.length">
52            </axis-label>
53          </g>
54        </svg>
55        <div class="cluevo-polygraph-stats-container">
56          <div v-for="stat, i in stats" :key="i">
57            <div class="cluevo-labels">
58              <label class="cluevo-comp-name">{{ stat.label }}</label>
59              <label>{{ stat.value.toFixed(2) }}%</label>
60            </div>
61            <div class="cluevo-progress-container">
62                <span
63                  :style="{
64                    width: (100 - stat.value) + '%'
65                  }"
66                  :data-value="stat.value" data-max="100"
67                  class="cluevo-progress"
68                >
69                </span>
70            </div>
71          </div>
72        </div>
73      `,
74    });
75    cluevoCompetencePolygraphApp.component("axis-label", {
76      props: {
77        stat: Object,
78        index: Number,
79        total: Number,
80      },
81      template: `<text :x="point.x" :y="point.y">{{stat.label}}</text>`,
82      computed: {
83        point: function() {
84          return cluevoPolygraphValueToPoint(100, this.index, this.total);
85        },
86      },
87    });
88    cluevoCompetencePolygraphApp.mount("#cluevo-polygraph");
89  }
90});
91;
92/*!
93 * jQuery Validation Plugin v1.12.0
94 *
95 * http://jqueryvalidation.org/
96 *
97 * Copyright (c) 2014 Jörn Zaefferer
98 * Released under the MIT license
99 */
100(function($) {
101
102$.extend($.fn, {
103	// http://jqueryvalidation.org/validate/
104	validate: function( options ) {
105
106		// if nothing is selected, return nothing; can't chain anyway
107		if ( !this.length ) {
108			if ( options && options.debug && window.console ) {
109				console.warn( "Nothing selected, can't validate, returning nothing." );
110			}
111			return;
112		}
113
114		// check if a validator for this form was already created
115		var validator = $.data( this[0], "validator" );
116		if ( validator ) {
117			return validator;
118		}
119
120		// Add novalidate tag if HTML5.
121		this.attr( "novalidate", "novalidate" );
122
123		validator = new $.validator( options, this[0] );
124		$.data( this[0], "validator", validator );
125
126		if ( validator.settings.onsubmit ) {
127
128			this.validateDelegate( ":submit", "click", function( event ) {
129				if ( validator.settings.submitHandler ) {
130					validator.submitButton = event.target;
131				}
132				// allow suppressing validation by adding a cancel class to the submit button
133				if ( $(event.target).hasClass("cancel") ) {
134					validator.cancelSubmit = true;
135				}
136
137				// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
138				if ( $(event.target).attr("formnovalidate") !== undefined ) {
139					validator.cancelSubmit = true;
140				}
141			});
142
143			// validate the form on submit
144			this.submit( function( event ) {
145				if ( validator.settings.debug ) {
146					// prevent form submit to be able to see console output
147					event.preventDefault();
148				}
149				function handle() {
150					var hidden;
151					if ( validator.settings.submitHandler ) {
152						if ( validator.submitButton ) {
153							// insert a hidden input as a replacement for the missing submit button
154							hidden = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val( $(validator.submitButton).val() ).appendTo(validator.currentForm);
155						}
156						validator.settings.submitHandler.call( validator, validator.currentForm, event );
157						if ( validator.submitButton ) {
158							// and clean up afterwards; thanks to no-block-scope, hidden can be referenced
159							hidden.remove();
160						}
161						return false;
162					}
163					return true;
164				}
165
166				// prevent submit for invalid forms or custom submit handlers
167				if ( validator.cancelSubmit ) {
168					validator.cancelSubmit = false;
169					return handle();
170				}
171				if ( validator.form() ) {
172					if ( validator.pendingRequest ) {
173						validator.formSubmitted = true;
174						return false;
175					}
176					return handle();
177				} else {
178					validator.focusInvalid();
179					return false;
180				}
181			});
182		}
183
184		return validator;
185	},
186	// http://jqueryvalidation.org/valid/
187	valid: function() {
188		var valid, validator;
189
190		if ( $(this[0]).is("form")) {
191			valid = this.validate().form();
192		} else {
193			valid = true;
194			validator = $(this[0].form).validate();
195			this.each(function() {
196				valid = validator.element(this) && valid;
197			});
198		}
199		return valid;
200	},
201	// attributes: space separated list of attributes to retrieve and remove
202	removeAttrs: function( attributes ) {
203		var result = {},
204			$element = this;
205		$.each(attributes.split(/\s/), function( index, value ) {
206			result[value] = $element.attr(value);
207			$element.removeAttr(value);
208		});
209		return result;
210	},
211	// http://jqueryvalidation.org/rules/
212	rules: function( command, argument ) {
213		var element = this[0],
214			settings, staticRules, existingRules, data, param, filtered;
215
216		if ( command ) {
217			settings = $.data(element.form, "validator").settings;
218			staticRules = settings.rules;
219			existingRules = $.validator.staticRules(element);
220			switch (command) {
221			case "add":
222				$.extend(existingRules, $.validator.normalizeRule(argument));
223				// remove messages from rules, but allow them to be set separately
224				delete existingRules.messages;
225				staticRules[element.name] = existingRules;
226				if ( argument.messages ) {
227					settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages );
228				}
229				break;
230			case "remove":
231				if ( !argument ) {
232					delete staticRules[element.name];
233					return existingRules;
234				}
235				filtered = {};
236				$.each(argument.split(/\s/), function( index, method ) {
237					filtered[method] = existingRules[method];
238					delete existingRules[method];
239					if ( method === "required" ) {
240						$(element).removeAttr("aria-required");
241					}
242				});
243				return filtered;
244			}
245		}
246
247		data = $.validator.normalizeRules(
248		$.extend(
249			{},
250			$.validator.classRules(element),
251			$.validator.attributeRules(element),
252			$.validator.dataRules(element),
253			$.validator.staticRules(element)
254		), element);
255
256		// make sure required is at front
257		if ( data.required ) {
258			param = data.required;
259			delete data.required;
260			data = $.extend({ required: param }, data );
261			$(element).attr( "aria-required", "true" );
262		}
263
264		// make sure remote is at back
265		if ( data.remote ) {
266			param = data.remote;
267			delete data.remote;
268			data = $.extend( data, { remote: param });
269		}
270
271		return data;
272	}
273});
274
275// Custom selectors
276$.extend($.expr[":"], {
277	// http://jqueryvalidation.org/blank-selector/
278	blank: function( a ) { return !$.trim("" + $(a).val()); },
279	// http://jqueryvalidation.org/filled-selector/
280	filled: function( a ) { return !!$.trim("" + $(a).val()); },
281	// http://jqueryvalidation.org/unchecked-selector/
282	unchecked: function( a ) { return !$(a).prop("checked"); }
283});
284
285// constructor for validator
286$.validator = function( options, form ) {
287	this.settings = $.extend( true, {}, $.validator.defaults, options );
288	this.currentForm = form;
289	this.init();
290};
291
292// http://jqueryvalidation.org/jQuery.validator.format/
293$.validator.format = function( source, params ) {
294	if ( arguments.length === 1 ) {
295		return function() {
296			var args = $.makeArray(arguments);
297			args.unshift(source);
298			return $.validator.format.apply( this, args );
299		};
300	}
301	if ( arguments.length > 2 && params.constructor !== Array  ) {
302		params = $.makeArray(arguments).slice(1);
303	}
304	if ( params.constructor !== Array ) {
305		params = [ params ];
306	}
307	$.each(params, function( i, n ) {
308		source = source.replace( new RegExp("\\{" + i + "\\}", "g"), function() {
309			return n;
310		});
311	});
312	return source;
313};
314
315$.extend($.validator, {
316
317	defaults: {
318		messages: {},
319		groups: {},
320		rules: {},
321		errorClass: "error",
322		validClass: "valid",
323		errorElement: "label",
324		focusInvalid: true,
325		errorContainer: $([]),
326		errorLabelContainer: $([]),
327		onsubmit: true,
328		ignore: ":hidden",
329		ignoreTitle: false,
330		onfocusin: function( element ) {
331			this.lastActive = element;
332
333			// hide error label and remove error class on focus if enabled
334			if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
335				if ( this.settings.unhighlight ) {
336					this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
337				}
338				this.addWrapper(this.errorsFor(element)).hide();
339			}
340		},
341		onfocusout: function( element ) {
342			if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) {
343				this.element(element);
344			}
345		},
346		onkeyup: function( element, event ) {
347			if ( event.which === 9 && this.elementValue(element) === "" ) {
348				return;
349			} else if ( element.name in this.submitted || element === this.lastElement ) {
350				this.element(element);
351			}
352		},
353		onclick: function( element ) {
354			// click on selects, radiobuttons and checkboxes
355			if ( element.name in this.submitted ) {
356				this.element(element);
357
358			// or option elements, check parent select in that case
359			} else if ( element.parentNode.name in this.submitted ) {
360				this.element(element.parentNode);
361			}
362		},
363		highlight: function( element, errorClass, validClass ) {
364			if ( element.type === "radio" ) {
365				this.findByName(element.name).addClass(errorClass).removeClass(validClass);
366			} else {
367				$(element).addClass(errorClass).removeClass(validClass);
368			}
369		},
370		unhighlight: function( element, errorClass, validClass ) {
371			if ( element.type === "radio" ) {
372				this.findByName(element.name).removeClass(errorClass).addClass(validClass);
373			} else {
374				$(element).removeClass(errorClass).addClass(validClass);
375			}
376		}
377	},
378
379	// http://jqueryvalidation.org/jQuery.validator.setDefaults/
380	setDefaults: function( settings ) {
381		$.extend( $.validator.defaults, settings );
382	},
383
384	messages: {
385		required: "This field is required.",
386		remote: "Please fix this field.",
387		email: "Please enter a valid email address.",
388		url: "Please enter a valid URL.",
389		date: "Please enter a valid date.",
390		dateISO: "Please enter a valid date (ISO).",
391		number: "Please enter a valid number.",
392		digits: "Please enter only digits.",
393		creditcard: "Please enter a valid credit card number.",
394		equalTo: "Please enter the same value again.",
395		maxlength: $.validator.format("Please enter no more than {0} characters."),
396		minlength: $.validator.format("Please enter at least {0} characters."),
397		rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
398		range: $.validator.format("Please enter a value between {0} and {1}."),
399		max: $.validator.format("Please enter a value less than or equal to {0}."),
400		min: $.validator.format("Please enter a value greater than or equal to {0}.")
401	},
402
403	autoCreateRanges: false,
404
405	prototype: {
406
407		init: function() {
408			this.labelContainer = $(this.settings.errorLabelContainer);
409			this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
410			this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
411			this.submitted = {};
412			this.valueCache = {};
413			this.pendingRequest = 0;
414			this.pending = {};
415			this.invalid = {};
416			this.reset();
417
418			var groups = (this.groups = {}),
419				rules;
420			$.each(this.settings.groups, function( key, value ) {
421				if ( typeof value === "string" ) {
422					value = value.split(/\s/);
423				}
424				$.each(value, function( index, name ) {
425					groups[name] = key;
426				});
427			});
428			rules = this.settings.rules;
429			$.each(rules, function( key, value ) {
430				rules[key] = $.validator.normalizeRule(value);
431			});
432
433			function delegate(event) {
434				var validator = $.data(this[0].form, "validator"),
435					eventType = "on" + event.type.replace(/^validate/, ""),
436					settings = validator.settings;
437				if ( settings[eventType] && !this.is( settings.ignore ) ) {
438					settings[eventType].call(validator, this[0], event);
439				}
440			}
441			$(this.currentForm)
442				.validateDelegate(":text, [type='password'], [type='file'], select, textarea, " +
443					"[type='number'], [type='search'] ,[type='tel'], [type='url'], " +
444					"[type='email'], [type='datetime'], [type='date'], [type='month'], " +
445					"[type='week'], [type='time'], [type='datetime-local'], " +
446					"[type='range'], [type='color'] ",
447					"focusin focusout keyup", delegate)
448				.validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate);
449
450			if ( this.settings.invalidHandler ) {
451				$(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);
452			}
453
454			// Add aria-required to any Static/Data/Class required fields before first validation
455			// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
456			$(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
457		},
458
459		// http://jqueryvalidation.org/Validator.form/
460		form: function() {
461			this.checkForm();
462			$.extend(this.submitted, this.errorMap);
463			this.invalid = $.extend({}, this.errorMap);
464			if ( !this.valid() ) {
465				$(this.currentForm).triggerHandler("invalid-form", [ this ]);
466			}
467			this.showErrors();
468			return this.valid();
469		},
470
471		checkForm: function() {
472			this.prepareForm();
473			for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
474				this.check( elements[i] );
475			}
476			return this.valid();
477		},
478
479		// http://jqueryvalidation.org/Validator.element/
480		element: function( element ) {
481			var cleanElement = this.clean( element ),
482				checkElement = this.validationTargetFor( cleanElement ),
483				result = true;
484
485			this.lastElement = checkElement;
486
487			if ( checkElement === undefined ) {
488				delete this.invalid[ cleanElement.name ];
489			} else {
490				this.prepareElement( checkElement );
491				this.currentElements = $( checkElement );
492
493				result = this.check( checkElement ) !== false;
494				if (result) {
495					delete this.invalid[checkElement.name];
496				} else {
497					this.invalid[checkElement.name] = true;
498				}
499			}
500			// Add aria-invalid status for screen readers
501			$( element ).attr( "aria-invalid", !result );
502
503			if ( !this.numberOfInvalids() ) {
504				// Hide error containers on last error
505				this.toHide = this.toHide.add( this.containers );
506			}
507			this.showErrors();
508			return result;
509		},
510
511		// http://jqueryvalidation.org/Validator.showErrors/
512		showErrors: function( errors ) {
513			if ( errors ) {
514				// add items to error list and map
515				$.extend( this.errorMap, errors );
516				this.errorList = [];
517				for ( var name in errors ) {
518					this.errorList.push({
519						message: errors[name],
520						element: this.findByName(name)[0]
521					});
522				}
523				// remove items from success list
524				this.successList = $.grep( this.successList, function( element ) {
525					return !(element.name in errors);
526				});
527			}
528			if ( this.settings.showErrors ) {
529				this.settings.showErrors.call( this, this.errorMap, this.errorList );
530			} else {
531				this.defaultShowErrors();
532			}
533		},
534
535		// http://jqueryvalidation.org/Validator.resetForm/
536		resetForm: function() {
537			if ( $.fn.resetForm ) {
538				$(this.currentForm).resetForm();
539			}
540			this.submitted = {};
541			this.lastElement = null;
542			this.prepareForm();
543			this.hideErrors();
544			this.elements()
545					.removeClass( this.settings.errorClass )
546					.removeData( "previousValue" )
547					.removeAttr( "aria-invalid" );
548		},
549
550		numberOfInvalids: function() {
551			return this.objectLength(this.invalid);
552		},
553
554		objectLength: function( obj ) {
555			/* jshint unused: false */
556			var count = 0,
557				i;
558			for ( i in obj ) {
559				count++;
560			}
561			return count;
562		},
563
564		hideErrors: function() {
565			this.addWrapper( this.toHide ).hide();
566		},
567
568		valid: function() {
569			return this.size() === 0;
570		},
571
572		size: function() {
573			return this.errorList.length;
574		},
575
576		focusInvalid: function() {
577			if ( this.settings.focusInvalid ) {
578				try {
579					$(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
580					.filter(":visible")
581					.focus()
582					// manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
583					.trigger("focusin");
584				} catch(e) {
585					// ignore IE throwing errors when focusing hidden elements
586				}
587			}
588		},
589
590		findLastActive: function() {
591			var lastActive = this.lastActive;
592			return lastActive && $.grep(this.errorList, function( n ) {
593				return n.element.name === lastActive.name;
594			}).length === 1 && lastActive;
595		},
596
597		elements: function() {
598			var validator = this,
599				rulesCache = {};
600
601			// select all valid inputs inside the form (no submit or reset buttons)
602			return $(this.currentForm)
603			.find("input, select, textarea")
604			.not(":submit, :reset, :image, [disabled]")
605			.not( this.settings.ignore )
606			.filter(function() {
607				if ( !this.name && validator.settings.debug && window.console ) {
608					console.error( "%o has no name assigned", this);
609				}
610
611				// select only the first element for each name, and only those with rules specified
612				if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) {
613					return false;
614				}
615
616				rulesCache[this.name] = true;
617				return true;
618			});
619		},
620
621		clean: function( selector ) {
622			return $(selector)[0];
623		},
624
625		errors: function() {
626			var errorClass = this.settings.errorClass.split(" ").join(".");
627			return $(this.settings.errorElement + "." + errorClass, this.errorContext);
628		},
629
630		reset: function() {
631			this.successList = [];
632			this.errorList = [];
633			this.errorMap = {};
634			this.toShow = $([]);
635			this.toHide = $([]);
636			this.currentElements = $([]);
637		},
638
639		prepareForm: function() {
640			this.reset();
641			this.toHide = this.errors().add( this.containers );
642		},
643
644		prepareElement: function( element ) {
645			this.reset();
646			this.toHide = this.errorsFor(element);
647		},
648
649		elementValue: function( element ) {
650			var val,
651				$element = $(element),
652				type = $element.attr("type");
653
654			if ( type === "radio" || type === "checkbox" ) {
655				return $("input[name='" + $element.attr("name") + "']:checked").val();
656			}
657
658			val = $element.val();
659			if ( typeof val === "string" ) {
660				return val.replace(/\r/g, "");
661			}
662			return val;
663		},
664
665		check: function( element ) {
666			element = this.validationTargetFor( this.clean( element ) );
667
668			var rules = $(element).rules(),
669				rulesCount = $.map( rules, function(n, i) {
670					return i;
671				}).length,
672				dependencyMismatch = false,
673				val = this.elementValue(element),
674				result, method, rule;
675
676			for (method in rules ) {
677				rule = { method: method, parameters: rules[method] };
678				try {
679
680					result = $.validator.methods[method].call( this, val, element, rule.parameters );
681
682					// if a method indicates that the field is optional and therefore valid,
683					// don't mark it as valid when there are no other rules
684					if ( result === "dependency-mismatch" && rulesCount === 1 ) {
685						dependencyMismatch = true;
686						continue;
687					}
688					dependencyMismatch = false;
689
690					if ( result === "pending" ) {
691						this.toHide = this.toHide.not( this.errorsFor(element) );
692						return;
693					}
694
695					if ( !result ) {
696						this.formatAndAdd( element, rule );
697						return false;
698					}
699				} catch(e) {
700					if ( this.settings.debug && window.console ) {
701						console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
702					}
703					throw e;
704				}
705			}
706			if ( dependencyMismatch ) {
707				return;
708			}
709			if ( this.objectLength(rules) ) {
710				this.successList.push(element);
711			}
712			return true;
713		},
714
715		// return the custom message for the given element and validation method
716		// specified in the element's HTML5 data attribute
717		// return the generic message if present and no method specific message is present
718		customDataMessage: function( element, method ) {
719			return $( element ).data( "msg" + method[ 0 ].toUpperCase() +
720				method.substring( 1 ).toLowerCase() ) || $( element ).data("msg");
721		},
722
723		// return the custom message for the given element name and validation method
724		customMessage: function( name, method ) {
725			var m = this.settings.messages[name];
726			return m && (m.constructor === String ? m : m[method]);
727		},
728
729		// return the first defined argument, allowing empty strings
730		findDefined: function() {
731			for (var i = 0; i < arguments.length; i++) {
732				if ( arguments[i] !== undefined ) {
733					return arguments[i];
734				}
735			}
736			return undefined;
737		},
738
739		defaultMessage: function( element, method ) {
740			return this.findDefined(
741				this.customMessage( element.name, method ),
742				this.customDataMessage( element, method ),
743				// title is never undefined, so handle empty string as undefined
744				!this.settings.ignoreTitle && element.title || undefined,
745				$.validator.messages[method],
746				"<strong>Warning: No message defined for " + element.name + "</strong>"
747			);
748		},
749
750		formatAndAdd: function( element, rule ) {
751			var message = this.defaultMessage( element, rule.method ),
752				theregex = /\$?\{(\d+)\}/g;
753			if ( typeof message === "function" ) {
754				message = message.call(this, rule.parameters, element);
755			} else if (theregex.test(message)) {
756				message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
757			}
758			this.errorList.push({
759				message: message,
760				element: element,
761				method: rule.method
762			});
763
764			this.errorMap[element.name] = message;
765			this.submitted[element.name] = message;
766		},
767
768		addWrapper: function( toToggle ) {
769			if ( this.settings.wrapper ) {
770				toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
771			}
772			return toToggle;
773		},
774
775		defaultShowErrors: function() {
776			var i, elements, error;
777			for ( i = 0; this.errorList[i]; i++ ) {
778				error = this.errorList[i];
779				if ( this.settings.highlight ) {
780					this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.val
780idClass );
781				}
782				this.showLabel( error.element, error.message );
783			}
784			if ( this.errorList.length ) {
785				this.toShow = this.toShow.add( this.containers );
786			}
787			if ( this.settings.success ) {
788				for ( i = 0; this.successList[i]; i++ ) {
789					this.showLabel( this.successList[i] );
790				}
791			}
792			if ( this.settings.unhighlight ) {
793				for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
794					this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
795				}
796			}
797			this.toHide = this.toHide.not( this.toShow );
798			this.hideErrors();
799			this.addWrapper( this.toShow ).show();
800		},
801
802		validElements: function() {
803			return this.currentElements.not(this.invalidElements());
804		},
805
806		invalidElements: function() {
807			return $(this.errorList).map(function() {
808				return this.element;
809			});
810		},
811
812		showLabel: function( element, message ) {
813			var label = this.errorsFor( element );
814			if ( label.length ) {
815				// refresh error/success class
816				label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
817				// replace message on existing label
818				label.html(message);
819			} else {
820				// create label
821				label = $("<" + this.settings.errorElement + ">")
822					.attr("for", this.idOrName(element))
823					.addClass(this.settings.errorClass)
824					.html(message || "");
825				if ( this.settings.wrapper ) {
826					// make sure the element is visible, even in IE
827					// actually showing the wrapped element is handled elsewhere
828					label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
829				}
830				if ( !this.labelContainer.append(label).length ) {
831					if ( this.settings.errorPlacement ) {
832						this.settings.errorPlacement(label, $(element) );
833					} else {
834						label.insertAfter(element);
835					}
836				}
837			}
838			if ( !message && this.settings.success ) {
839				label.text("");
840				if ( typeof this.settings.success === "string" ) {
841					label.addClass( this.settings.success );
842				} else {
843					this.settings.success( label, element );
844				}
845			}
846			this.toShow = this.toShow.add(label);
847		},
848
849		errorsFor: function( element ) {
850			var name = this.idOrName(element);
851			return this.errors().filter(function() {
852				return $(this).attr("for") === name;
853			});
854		},
855
856		idOrName: function( element ) {
857			return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
858		},
859
860		validationTargetFor: function( element ) {
861			// if radio/checkbox, validate first element in group instead
862			if ( this.checkable(element) ) {
863				element = this.findByName( element.name ).not(this.settings.ignore)[0];
864			}
865			return element;
866		},
867
868		checkable: function( element ) {
869			return (/radio|checkbox/i).test(element.type);
870		},
871
872		findByName: function( name ) {
873			return $(this.currentForm).find("[name='" + name + "']");
874		},
875
876		getLength: function( value, element ) {
877			switch ( element.nodeName.toLowerCase() ) {
878			case "select":
879				return $("option:selected", element).length;
880			case "input":
881				if ( this.checkable( element) ) {
882					return this.findByName(element.name).filter(":checked").length;
883				}
884			}
885			return value.length;
886		},
887
888		depend: function( param, element ) {
889			return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;
890		},
891
892		dependTypes: {
893			"boolean": function( param ) {
894				return param;
895			},
896			"string": function( param, element ) {
897				return !!$(param, element.form).length;
898			},
899			"function": function( param, element ) {
900				return param(element);
901			}
902		},
903
904		optional: function( element ) {
905			var val = this.elementValue(element);
906			return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";
907		},
908
909		startRequest: function( element ) {
910			if ( !this.pending[element.name] ) {
911				this.pendingRequest++;
912				this.pending[element.name] = true;
913			}
914		},
915
916		stopRequest: function( element, valid ) {
917			this.pendingRequest--;
918			// sometimes synchronization fails, make sure pendingRequest is never < 0
919			if ( this.pendingRequest < 0 ) {
920				this.pendingRequest = 0;
921			}
922			delete this.pending[element.name];
923			if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
924				$(this.currentForm).submit();
925				this.formSubmitted = false;
926			} else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
927				$(this.currentForm).triggerHandler("invalid-form", [ this ]);
928				this.formSubmitted = false;
929			}
930		},
931
932		previousValue: function( element ) {
933			return $.data(element, "previousValue") || $.data(element, "previousValue", {
934				old: null,
935				valid: true,
936				message: this.defaultMessage( element, "remote" )
937			});
938		}
939
940	},
941
942	classRuleSettings: {
943		required: { required: true },
944		email: { email: true },
945		url: { url: true },
946		date: { date: true },
947		dateISO: { dateISO: true },
948		number: { number: true },
949		digits: { digits: true },
950		creditcard: { creditcard: true }
951	},
952
953	addClassRules: function( className, rules ) {
954		if ( className.constructor === String ) {
955			this.classRuleSettings[className] = rules;
956		} else {
957			$.extend(this.classRuleSettings, className);
958		}
959	},
960
961	classRules: function( element ) {
962		var rules = {},
963			classes = $(element).attr("class");
964
965		if ( classes ) {
966			$.each(classes.split(" "), function() {
967				if ( this in $.validator.classRuleSettings ) {
968					$.extend(rules, $.validator.classRuleSettings[this]);
969				}
970			});
971		}
972		return rules;
973	},
974
975	attributeRules: function( element ) {
976		var rules = {},
977			$element = $(element),
978			type = element.getAttribute("type"),
979			method, value;
980
981		for (method in $.validator.methods) {
982
983			// support for <input required> in both html5 and older browsers
984			if ( method === "required" ) {
985				value = element.getAttribute(method);
986				// Some browsers return an empty string for the required attribute
987				// and non-HTML5 browsers might have required="" markup
988				if ( value === "" ) {
989					value = true;
990				}
991				// force non-HTML5 browsers to return bool
992				value = !!value;
993			} else {
994				value = $element.attr(method);
995			}
996
997			// convert the value to a number for number inputs, and for text for backwards compability
998			// allows type="date" and others to be compared as strings
999			if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
1000				value = Number(value);
1001			}
1002
1003			if ( value || value === 0 ) {
1004				rules[method] = value;
1005			} else if ( type === method && type !== "range" ) {
1006				// exception: the jquery validate 'range' method
1007				// does not test for the html5 'range' type
1008				rules[method] = true;
1009			}
1010		}
1011
1012		// maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs
1013		if ( rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength) ) {
1014			delete rules.maxlength;
1015		}
1016
1017		return rules;
1018	},
1019
1020	dataRules: function( element ) {
1021		var method, value,
1022			rules = {}, $element = $( element );
1023		for ( method in $.validator.methods ) {
1024			value = $element.data( "rule" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() );
1025			if ( value !== undefined ) {
1026				rules[ method ] = value;
1027			}
1028		}
1029		return rules;
1030	},
1031
1032	staticRules: function( element ) {
1033		var rules = {},
1034			validator = $.data(element.form, "validator");
1035
1036		if ( validator.settings.rules ) {
1037			rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
1038		}
1039		return rules;
1040	},
1041
1042	normalizeRules: function( rules, element ) {
1043		// handle dependency check
1044		$.each(rules, function( prop, val ) {
1045			// ignore rule when param is explicitly false, eg. required:false
1046			if ( val === false ) {
1047				delete rules[prop];
1048				return;
1049			}
1050			if ( val.param || val.depends ) {
1051				var keepRule = true;
1052				switch (typeof val.depends) {
1053				case "string":
1054					keepRule = !!$(val.depends, element.form).length;
1055					break;
1056				case "function":
1057					keepRule = val.depends.call(element, element);
1058					break;
1059				}
1060				if ( keepRule ) {
1061					rules[prop] = val.param !== undefined ? val.param : true;
1062				} else {
1063					delete rules[prop];
1064				}
1065			}
1066		});
1067
1068		// evaluate parameters
1069		$.each(rules, function( rule, parameter ) {
1070			rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
1071		});
1072
1073		// clean number parameters
1074		$.each([ "minlength", "maxlength" ], function() {
1075			if ( rules[this] ) {
1076				rules[this] = Number(rules[this]);
1077			}
1078		});
1079		$.each([ "rangelength", "range" ], function() {
1080			var parts;
1081			if ( rules[this] ) {
1082				if ( $.isArray(rules[this]) ) {
1083					rules[this] = [ Number(rules[this][0]), Number(rules[this][1]) ];
1084				} else if ( typeof rules[this] === "string" ) {
1085					parts = rules[this].split(/[\s,]+/);
1086					rules[this] = [ Number(parts[0]), Number(parts[1]) ];
1087				}
1088			}
1089		});
1090
1091		if ( $.validator.autoCreateRanges ) {
1092			// auto-create ranges
1093			if ( rules.min && rules.max ) {
1094				rules.range = [ rules.min, rules.max ];
1095				delete rules.min;
1096				delete rules.max;
1097			}
1098			if ( rules.minlength && rules.maxlength ) {
1099				rules.rangelength = [ rules.minlength, rules.maxlength ];
1100				delete rules.minlength;
1101				delete rules.maxlength;
1102			}
1103		}
1104
1105		return rules;
1106	},
1107
1108	// Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
1109	normalizeRule: function( data ) {
1110		if ( typeof data === "string" ) {
1111			var transformed = {};
1112			$.each(data.split(/\s/), function() {
1113				transformed[this] = true;
1114			});
1115			data = transformed;
1116		}
1117		return data;
1118	},
1119
1120	// http://jqueryvalidation.org/jQuery.validator.addMethod/
1121	addMethod: function( name, method, message ) {
1122		$.validator.methods[name] = method;
1123		$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
1124		if ( method.length < 3 ) {
1125			$.validator.addClassRules(name, $.validator.normalizeRule(name));
1126		}
1127	},
1128
1129	methods: {
1130
1131		// http://jqueryvalidation.org/required-method/
1132		required: function( value, element, param ) {
1133			// check if dependency is met
1134			if ( !this.depend(param, element) ) {
1135				return "dependency-mismatch";
1136			}
1137			if ( element.nodeName.toLowerCase() === "select" ) {
1138				// could be an array for select-multiple or a string, both are fine this way
1139				var val = $(element).val();
1140				return val && val.length > 0;
1141			}
1142			if ( this.checkable(element) ) {
1143				return this.getLength(value, element) > 0;
1144			}
1145			return $.trim(value).length > 0;
1146		},
1147
1148		// http://jqueryvalidation.org/email-method/
1149		email: function( value, element ) {
1150			// From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29
1151			// Retrieved 2014-01-14
1152			// If you have a problem with this implementation, report a bug against the above spec
1153			// Or use custom methods to implement your own email validation
1154			return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
1155		},
1156
1157		// http://jqueryvalidation.org/url-method/
1158		url: function( value, element ) {
1159			// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
1160			return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
1161		},
1162
1163		// http://jqueryvalidation.org/date-method/
1164		date: function( value, element ) {
1165			return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
1166		},
1167
1168		// http://jqueryvalidation.org/dateISO-method/
1169		dateISO: function( value, element ) {
1170			return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value);
1171		},
1172
1173		// http://jqueryvalidation.org/number-method/
1174		number: function( value, element ) {
1175			return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
1176		},
1177
1178		// http://jqueryvalidation.org/digits-method/
1179		digits: function( value, element ) {
1180			return this.optional(element) || /^\d+$/.test(value);
1181		},
1182
1183		// http://jqueryvalidation.org/creditcard-method/
1184		// based on http://en.wikipedia.org/wiki/Luhn/
1185		creditcard: function( value, element ) {
1186			if ( this.optional(element) ) {
1187				return "dependency-mismatch";
1188			}
1189			// accept only spaces, digits and dashes
1190			if ( /[^0-9 \-]+/.test(value) ) {
1191				return false;
1192			}
1193			var nCheck = 0,
1194				nDigit = 0,
1195				bEven = false,
1196				n, cDigit;
1197
1198			value = value.replace(/\D/g, "");
1199
1200			// Basing min and max length on
1201			// http://developer.ean.com/general_info/Valid_Credit_Card_Types
1202			if ( value.length < 13 || value.length > 19 ) {
1203				return false;
1204			}
1205
1206			for ( n = value.length - 1; n >= 0; n--) {
1207				cDigit = value.charAt(n);
1208				nDigit = parseInt(cDigit, 10);
1209				if ( bEven ) {
1210					if ( (nDigit *= 2) > 9 ) {
1211						nDigit -= 9;
1212					}
1213				}
1214				nCheck += nDigit;
1215				bEven = !bEven;
1216			}
1217
1218			return (nCheck % 10) === 0;
1219		},
1220
1221		// http://jqueryvalidation.org/minlength-method/
1222		minlength: function( value, element, param ) {
1223			var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
1224			return this.optional(element) || length >= param;
1225		},
1226
1227		// http://jqueryvalidation.org/maxlength-method/
1228		maxlength: function( value, element, param ) {
1229			var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
1230			return this.optional(element) || length <= param;
1231		},
1232
1233		// http://jqueryvalidation.org/rangelength-method/
1234		rangelength: function( value, element, param ) {
1235			var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
1236			return this.optional(element) || ( length >= param[0] && length <= param[1] );
1237		},
1238
1239		// http://jqueryvalidation.org/min-method/
1240		min: function( value, element, param ) {
1241			return this.optional(element) || value >= param;
1242		},
1243
1244		// http://jqueryvalidation.org/max-method/
1245		max: function( value, element, param ) {
1246			return this.optional(element) || value <= param;
1247		},
1248
1249		// http://jqueryvalidation.org/range-method/
1250		range: function( value, element, param ) {
1251			return this.optional(element) || ( value >= param[0] && value <= param[1] );
1252		},
1253
1254		// http://jqueryvalidation.org/equalTo-method/
1255		equalTo: function( value, element, param ) {
1256			// bind to the blur event of the target in order to revalidate whenever the target field is updated
1257			// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
1258			var target = $(param);
1259			if ( this.settings.onfocusout ) {
1260				target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
1261					$(element).valid();
1262				});
1263			}
1264			return value === target.val();
1265		},
1266
1267		// http://jqueryvalidation.org/remote-method/
1268		remote: function( value, element, param ) {
1269			if ( this.optional(element) ) {
1270				return "dependency-mismatch";
1271			}
1272
1273			var previous = this.previousValue(element),
1274				validator, data;
1275
1276			if (!this.settings.messages[element.name] ) {
1277				this.settings.messages[element.name] = {};
1278			}
1279			previous.originalMessage = this.settings.messages[element.name].remote;
1280			this.settings.messages[element.name].remote = previous.message;
1281
1282			param = typeof param === "string" && { url: param } || param;
1283
1284			if ( previous.old === value ) {
1285				return previous.valid;
1286			}
1287
1288			previous.old = value;
1289			validator = this;
1290			this.startRequest(element);
1291			data = {};
1292			data[element.name] = value;
1293			$.ajax($.extend(true, {
1294				url: param,
1295				mode: "abort",
1296				port: "validate" + element.name,
1297				dataType: "json",
1298				data: data,
1299				context: validator.currentForm,
1300				success: function( response ) {
1301					var valid = response === true || response === "true",
1302						errors, message, submitted;
1303
1304					validator.settings.messages[element.name].remote = previous.originalMessage;
1305					if ( valid ) {
1306						submitted = validator.formSubmitted;
1307						validator.prepareElement(element);
1308						validator.formSubmitted = submitted;
1309						validator.successList.push(element);
1310						delete validator.invalid[element.name];
1311						validator.showErrors();
1312					} else {
1313						errors = {};
1314						message = response || validator.defaultMessage( element, "remote" );
1315						errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
1316						validator.invalid[element.name] = true;
1317						validator.showErrors(errors);
1318					}
1319					previous.valid = valid;
1320					validator.stopRequest(element, valid);
1321				}
1322			}, param));
1323			return "pending";
1324		}
1325
1326	}
1327
1328});
1329
1330$.format = function deprecated() {
1331	throw "$.format has been deprecated. Please use $.validator.format instead.";
1332};
1333
1334}(jQuery));
1335
1336// ajax mode: abort
1337// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
1338// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
1339(function($) {
1340	var pendingRequests = {},
1341		ajax;
1342	// Use a prefilter if available (1.5+)
1343	if ( $.ajaxPrefilter ) {
1344		$.ajaxPrefilter(function( settings, _, xhr ) {
1345			var port = settings.port;
1346			if ( settings.mode === "abort" ) {
1347				if ( pendingRequests[port] ) {
1348					pendingRequests[port].abort();
1349				}
1350				pendingRequests[port] = xhr;
1351			}
1352		});
1353	} else {
1354		// Proxy ajax
1355		ajax = $.ajax;
1356		$.ajax = function( settings ) {
1357			var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
1358				port = ( "port" in settings ? settings : $.ajaxSettings ).port;
1359			if ( mode === "abort" ) {
1360				if ( pendingRequests[port] ) {
1361					pendingRequests[port].abort();
1362				}
1363				pendingRequests[port] = ajax.apply(this, arguments);
1364				return pendingRequests[port];
1365			}
1366			return ajax.apply(this, arguments);
1367		};
1368	}
1369}(jQuery));
1370
1371// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
1372// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
1373(function($) {
1374	$.extend($.fn, {
1375		validateDelegate: function( delegate, type, handler ) {
1376			return this.bind(type, function( event ) {
1377				var target = $(event.target);
1378				if ( target.is(delegate) ) {
1379					return handler.apply(target, arguments);
1380				}
1381			});
1382		}
1383	});
1384}(jQuery));
1385;
1386var lwp_refreshIntervalId;
1387jQuery(document).ready(function ($) {
1388    var lwp_nonce = idehweb_lwp.nonce, close_button = idehweb_lwp.close_button, lwp_phone_number = '', lwp_email = '';
1389    $(document).on('click', '.lwp_login_overlay, .close', function (e) {
1390        e.preventDefault();
1391        if (close_button == "0")
1392            $('form#lwp_login, form#lwp_login_email, form#lwp_activate').fadeOut(500, function () {
1393                $('.lwp_login_overlay').remove();
1394            });
1395        return false;
1396    });
1397
1398    // Show the login/signup popup on click
1399
1400    $('body').on('input', 'input.lwp_scode[name="lwp_scode"]', function (e) {
1401        console.log('e', e?.target?.value?.length);
1402        if (e?.target?.value?.length == 6) {
1403            $('input.lwp_scode[name="lwp_scode"]').blur();
1404            $('.auth_secCode').click();
1405        }
1406
1407    })
1408    $('body').on('click', '.lwp-log-out', function (e) {
1409
1410    });
1411    $('body').on('click', '#show_login , .show_login, .lwp-open-form', function (e) {
1412        console.log('show_login clicked');
1413        e.preventDefault();
1414        var sticky = idehweb_lwp.sticky;
1415        let temp_sticky = $(this).attr('data-sticky');
1416        if (temp_sticky) {
1417            sticky = temp_sticky;
1418        }
1419        if ($('form#lwp_login').length > 0 || $('form#lwp_login_email').length > 0) {
1420            if (sticky && sticky === '1') {
1421                // Check if the overlay class doesn't exist and append it if needed
1422                if ($('.lwp_login_overlay').length === 0) {
1423                    $('body').append('<div class="lwp_login_overlay"></div>');
1424                }
1425            }
1426        }
1427
1428        // if ($(this).attr('id') == 'show_login')
1429        if ($('form#lwp_login').length > 0 && $('form#lwp_login_email').length > 0) {
1430            console.log('click on here 1');
1431
1432            $('form#lwp_login').fadeIn(0);
1433            $('form#lwp_login_email').fadeOut(0);
1434
1435        }
1436        if ($('form#lwp_login').length > 0 && !($('form#lwp_login_email').length > 0)) {
1437            console.log('click on here 2');
1438
1439            $('form#lwp_login').fadeIn(0);
1440            $('form#lwp_login_email').fadeOut(0);
1441
1442        }
1443        if ($('form#lwp_login_email').length > 0 && !($('form#lwp_login').length > 0)) {
1444            console.log('click on here 3');
1445
1446            $('form#lwp_login_email').fadeIn(0);
1447            $('form#lwp_login').fadeOut(0);
1448
1449        }
1450        // if ($('form#lwp_login_email').length > 0) {
1451        //     console.log('click on here 4');
1452        //
1453        //     $('form#lwp_login_email').fadeIn(0);
1454        //     $('form#lwp_login').fadeOut(0);
1455        //
1456        // }
1457        // else
1458        //     $('form#register').fadeIn(500);
1459        e.preventDefault();
1460    });
1461    $('body').on('click', '.auth_with_phoneNumber', function (e) {
1462        e.preventDefault();
1463
1464        // if ($(this).attr('id') == 'show_login')
1465        $('#lwp_login_email').fadeOut(10);
1466        $('#lwp_login').fadeIn(500);
1467        if ($('#lwp_enter_password')?.length > 0) {
1468            // console.log('dfd',$('.submit_button.forgot_password'))
1469            let method=$('#lwp_login').attr('data-method');
1470            $('.submit_button.forgot_password').removeClass('email').addClass(method);
1471        }
1472        // else
1473        //     $('form#register').fadeIn(500);
1474        e.preventDefault();
1475    });
1476    $('body').on('click', '.forgot_password:not(.firebase) , .lwp_didnt_r_c:not(.firebase)', function (e) {
1477        e.preventDefault();
1478        if (!$(this).valid()) return false;
1479        // if (typeof firebaseConfig !== 'undefined') return false;
1480        let method = $('input[name="otp-method"]:checked').val();
1481        if (method === 'firebase') {
1482            console.log('method is firebase, return false')
1483
1484            return false;
1485        }
1486        if (!method) {
1487            method = $('#lwp_activate').attr('data-method');
1488        }
1489        console.log('method:', method)
1490
1491        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1492        var action = 'lwp_forgot_password';
1493        // var username = $('.lwp_username').val();
1494        // username = username.replace(/^0+/, '');
1495        var username = $('[name="lwp_username"]').val();
1496        username = username.replace(/^[0\+]+/, '');
1497
1498        var lwp_country_codes = $('#lwp_country_codes').val();
1499        username = lwp_country_codes + username;
1500        var email = $('.lwp_email').val();
1501        $('#lwp_login_email').fadeOut(10);
1502        $('#lwp_login').fadeOut(10);
1503        $('#lwp_enter_password').fadeOut(10);
1504
1505        $('#lwp_activate').fadeIn(500);
1506        console.log('nonce', lwp_nonce);
1507        if (username) {
1508            lwp_phone_number = username;
1509        }
1510        if (email) {
1511            lwp_email = email;
1512        }
1513        window.lwp_runTimer();
1514        $.ajax({
1515            dataType: 'json',
1516            url: idehweb_lwp.ajaxurl,
1517            data: {
1518                'action': action,
1519                'nonce': lwp_nonce,
1520
1521                'phone_number': username,
1522                'email': email,
1523                // 'ID': idehweb_lwp.UserId,
1524                'method': method,
1525            },
1526            success: function (data) {
1527
1528
1529            }
1530        });
1531    });
1532    $('body').on('click', '.auth_with_email', function (e) {
1533
1534        // if ($(this).attr('id') == 'show_login')
1535        $('#lwp_login').fadeOut(10);
1536        $('#lwp_login_email').fadeIn(500);
1537        // else
1538        if ($('#lwp_enter_password')?.length > 0) {
1539            // console.log('dfd',$('.submit_button.forgot_password'))
1540            let method=$('#lwp_login').attr('data-method');
1541
1542            $('.submit_button.forgot_password').removeClass(method).addClass('email');
1543        }
1544
1545        //     $('form#register').fadeIn(500);
1546        e.preventDefault();
1547    });
1548    $('#show_login').click();
1549    // Perform AJAX login/register on form submit
1550    $('body').on('click', 'input[name="otp-method"]', function (e) {
1551        if (e.target.value) {
1552            let value = e.target.value;
1553            $('.ajax-auth.lwp-login-form-i').attr('class', 'ajax-auth lwp-login-form-i ' + value).attr('data-method',value);
1554            $('.submit_button.forgot_password').attr('class', 'submit_button forgot_password ' + value).attr('data-method',value);
1555            $('.submit_button.lwp_didnt_r_c').attr('class', 'submit_button lwp_didnt_r_c ' + value).attr('data-method',value);
1556            $('.ajax-auth.lwp-register-form-i').attr('class', 'ajax-auth lwp-register-form-i ' + value).attr('data-method',value);
1557            // $('.ajax-auth.lwp-login-form-i');
1558        }
1559    })
1560    $('body').on('submit', 'form.ajax-auth.lwp-login-form-i:not(.firebase)', function (e) {
1561        e.preventDefault();
1562        console.log('submit form, login with phone...')
1563
1564        let method = $('input[name="otp-method"]:checked').val();
1565        if (method === 'firebase') {
1566            console.log('method is firebase, return false')
1567
1568            return false;
1569        }
1570        if (!method) {
1571            method = $(this).attr('data-method');
1572        }
1573        console.log('method:', method)
1574
1575        if (!$(this).valid()) {
1576            var reason = '';
1577            if ($('[name="lwp_accept_terms"]').length && !$('[name="lwp_accept_terms"]').valid()) {
1578                reason = 'You must agree to the terms of service!'
1579            } else {
1580                reason = 'Phone number is required';
1581            }
1582            $('p.status', this).show().text(reason);
1583            console.log('not valid...')
1584            return false;
1585        }
1586
1587        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1588        var action = 'lwp_ajax_login';
1589        var username = $('[name="lwp_username"]').val();
1590        console.log('username:', username);
1591        username = username.replace(/^[0\+]+/, '');
1592        var lwp_country_codes = $('#lwp_country_codes').val();
1593        console.log('lwp_country_codes:', lwp_country_codes);
1594        username = lwp_country_codes + username;
1595        lwp_phone_number = username;
1596        var ctrl = $(this);
1597
1598        $.ajax({
1599            // type: 'GET',
1600            dataType: 'json',
1601            url: idehweb_lwp.ajaxurl,
1602            data: {
1603                'action': action,
1604                'nonce': lwp_nonce,
1605                'username': username,
1606                'method': method
1607            },
1608            success: function (data) {
1609                console.log('return response...')
1610
1611                $('p.status', ctrl).text(data.message);
1612                if (data.success == true) {
1613                    $('#lwp_login_email').fadeOut(10);
1614                    $('#lwp_login').fadeOut(10);
1615                    idehweb_lwp.UserId = data.ID;
1616                    $('.lwp_line').css('display', 'block');
1617                    $('.lwp_bottom_activation').css('display', 'block');
1618                    $('.lwp_bottom_activation .lwp_change_el').css('display', 'none');
1619                    $('.lwp_bottom_activation .lwp_change_pn').css('display', 'block');
1620
1621                    if (data.authWithPass) {
1622                        if (data.showPass) {
1623                            $('#lwp_enter_password').fadeIn(500);
1624                            console.log('xdwcef');
1625
1626                        } else {
1627                            $('#lwp_activate').fadeIn(500);
1628                            window.lwp_runTimer();
1629                            console.log('xdwcffffef');
1630
1631                        }
1632                    } else {
1633                        $('#lwp_activate').fadeIn(500);
1634                        window.lwp_runTimer();
1635                        console.log('xdwcef543');
1636
1637
1638                    }
1639                    //     document.location.href = idehweb_lwp.redirecturl;
1640                }
1641            }
1642        });
1643    });
1644    $('body').on('submit', 'form#lwp_login_email', function (e) {
1645        // if (!$(this).valid()) return false;
1646        if (!$(this).valid()) {
1647            var reason = '';
1648            if ($('[name="lwp_accept_terms_email"]').length && !$('[name="lwp_accept_terms_email"]').valid()) {
1649                reason = 'You must agree to the terms of service!'
1650            } else {
1651                reason = 'Email is required';
1652            }
1653            $('p.status', this).show().text(reason);
1654            return false;
1655        }
1656        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1657        var action = 'lwp_ajax_login_with_email';
1658        var email = $('.lwp_email').val();
1659
1660        // security = $('form#lwp_login .lwp_scode').val();
1661        lwp_email = email;
1662
1663        var ctrl = $(this);
1664        $.ajax({
1665            // type: 'GET',
1666            dataType: 'json',
1667            url: idehweb_lwp.ajaxurl,
1668            data: {
1669                'action': action,
1670                'email': email,
1671                'nonce': lwp_nonce
1672            },
1673            success: function (data) {
1674
1675                $('p.status', ctrl).text(data.message);
1676                if (data.success == true) {
1677                    $('#lwp_login_email').fadeOut(10);
1678                    $('#lwp_login').fadeOut(10);
1679                    idehweb_lwp.UserId = data.ID;
1680                    $('.lwp_line').css('display', 'none');
1681                    $('.lwp_bottom_activation').css('display', 'block');
1682                    $('.lwp_bottom_activation .lwp_change_pn').css('display', 'none');
1683                    $('.lwp_bottom_activation .lwp_change_el').css('display', 'block');
1684                    if (data.authWithPass) {
1685
1686                        if (data.showPass) {
1687                            $('#lwp_enter_password').fadeIn(500);
1688
1689                        } else {
1690                            $('#lwp_activate').fadeIn(500);
1691
1692                        }
1693                    } else {
1694                        $('#lwp_activate').fadeIn(500);
1695
1696                    }
1697                    //     document.location.href = idehweb_lwp.redirecturl;
1698                }
1699            }
1700        });
1701        e.preventDefault();
1702    });
1703    $('body').on('submit', 'form#lwp_verify_email', function (e) {
1704        // if (!$(this).valid()) return false;
1705        if (!$(this).valid()) {
1706            var reason = '';
1707            if ($('[name="lwp_accept_terms_email"]').length && !$('[name="lwp_accept_terms_email"]').valid()) {
1708                reason = 'You must agree to the terms of service!'
1709            } else {
1710                reason = 'Email is required';
1711            }
1712            $('p.status', this).show().text(reason);
1713            return false;
1714        }
1715        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1716        var action = 'lwp_ajax_verify_with_email';
1717        var email = $('.lwp_email').val();
1718
1719        // security = $('form#lwp_login .lwp_scode').val();
1720
1721        lwp_email = email;
1722        var ctrl = $(this);
1723        $.ajax({
1724            // type: 'GET',
1725            dataType: 'json',
1726            url: idehweb_lwp.ajaxurl,
1727            data: {
1728                'action': action,
1729                'email': email,
1730                'nonce': lwp_nonce
1731            },
1732            success: function (data) {
1733
1734                $('p.status', ctrl).text(data.message);
1735                if (data.success == true) {
1736                    $('#lwp_verify_email').fadeOut(10);
1737                    $('#lwp_login_email').fadeOut(10);
1738                    $('#lwp_login').fadeOut(10);
1739                    idehweb_lwp.UserId = data.ID;
1740                    $('.lwp_line').css('display', 'none');
1741                    $('.lwp_bottom_activation').css('display', 'block');
1742                    $('.lwp_bottom_activation .lwp_change_pn').css('display', 'none');
1743                    $('.lwp_bottom_activation .lwp_change_el').css('display', 'block');
1744                    if (data.authWithPass) {
1745
1746                        if (data.showPass) {
1747                            $('#lwp_enter_password').fadeIn(500);
1748
1749                        } else {
1750                            $('#lwp_activate_email').fadeIn(500);
1751
1752                        }
1753                    } else {
1754                        $('#lwp_activate_email').fadeIn(500);
1755
1756                    }
1757                    //     document.location.href = idehweb_lwp.redirecturl;
1758                }
1759            }
1760        });
1761        e.preventDefault();
1762    });
1763
1764
1765    $('body').on('submit', 'form.ajax-auth.lwp-register-form-i:not(.firebase,.email)', function (e) {
1766        e.preventDefault();
1767        if (!$(this).valid()) return false;
1768        // if (typeof firebaseConfig !== 'undefined') return false;
1769        let method = $('input[name="otp-method"]:checked').val();
1770        // if (method === 'firebase') {
1771        //     console.log('method is firebase, return false')
1772        //
1773        //     return false;
1774        // }
1775
1776        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1777        var action = 'lwp_ajax_register';
1778        var security = $('.lwp_scode').val();
1779        var obj = {
1780            'action': action,
1781            'secod': security,
1782            'method': method,
1783        };
1784        $('#lwp_login').fadeOut(10);
1785        $('#lwp_login_email').fadeOut(10);
1786        // $('#lwp_activate').fadeOut(500);
1787        // var phone_number = $('.lwp_username').val();
1788        var phone_number = $('[name="lwp_username"]').val();
1789        if (phone_number) {
1790            var lwp_country_codes = $('#lwp_country_codes').val();
1791            // phone_number = phone_number.replace(/^0+/, '');
1792            phone_number = phone_number.replace(/^[0\+]+/, '');
1793            phone_number = lwp_country_codes + phone_number;
1794            obj['phone_number'] = phone_number;
1795            lwp_phone_number = phone_number;
1796
1797        }
1798        var email = $('.lwp_email').val();
1799        if (email) {
1800            obj['email'] = email;
1801            lwp_email = email;
1802        }
1803
1804        var ctrl = $(this);
1805        obj['nonce'] = lwp_nonce;
1806
1807        $.ajax({
1808            // type: 'GET',
1809            dataType: 'json',
1810            url: idehweb_lwp.ajaxurl,
1811            data: obj,
1812            success: function (data) {
1813                if (data.nonce) {
1814                    lwp_nonce = data.nonce;
1815                }
1816                // console.log("data");
1817                // return;
1818                if (!data?.authWithPass) {
1819
1820                    if (data?.lwp_update_extra_fields && data?.userRegisteredNow) {
1821                        console.log("data.lwp_update_extra_fields && data.userRegisteredNow")
1822
1823                        $('#lwp_activate').fadeOut(500);
1824                        $('#lwp_update_extra_fields').fadeIn(500);
1825                        return;
1826                    }
1827                }
1828                if (data?.authWithPass) {
1829
1830                    if (data.updatedPass && data.lwp_update_extra_fields) {
1831                        console.log("data.updatedPass && data.lwp_update_extra_fields")
1832                        $('#lwp_activate').fadeOut(500);
1833                        $('#lwp_update_extra_fields').fadeIn(500);
1834
1835                    }else if (!data.updatedPass && data.lwp_update_extra_fields) {
1836                        console.log("!data.updatedPass && data.lwp_update_extra_fields")
1837
1838                        $('#lwp_activate').fadeOut(500);
1839                        $('#lwp_update_password').fadeIn(500);
1840                        $('#lwp_update_password').addClass(data?.userRegisteredNow ? "" : "lwp-hide-extra");
1841
1842                    }else if (data.updatedPass && !data.lwp_update_extra_fields) {
1843                        console.log("data.updatedPass && !data.lwp_update_extra_fields")
1844
1845                        $('#lwp_activate').fadeOut(500);
1846                        $('#lwp_update_password').fadeIn(500);
1847
1848                    }else if (!data.updatedPass && !data.lwp_update_extra_fields) {
1849                        console.log("!data.updatedPass && !data.lwp_update_extra_fields")
1850
1851                        $('#lwp_activate').fadeOut(500);
1852                        $('#lwp_update_password').fadeIn(500);
1853
1854                    } else {
1855                        console.log("else of data.updatedPass && data.lwp_update_extra_fields")
1856
1857                        $('p.status', ctrl).text(data.message);
1858                        if (data.success)
1859                            document.location.href = idehweb_lwp.redirecturl;
1860
1861                    }
1862                } else {
1863                    $('p.status', ctrl).text(data.message);
1864                    if (data.success)
1865                        document.location.href = idehweb_lwp.redirecturl;
1866                }
1867
1868                // console.log('');
1869                // if (data.loggedin == true && idehweb_lwp.redirecturl) {
1870                //     location.replace(idehweb_lwp.redirecturl);
1871                // }
1872            }
1873        });
1874    });
1875    $('body').on('submit', 'form#lwp_activate_email', function (e) {
1876        e.preventDefault();
1877        if (!$(this).valid()) return false;
1878        let method = $('input[name="otp-method"]:checked').val();
1879        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1880        var action = 'lwp_activate_email';
1881        var security = $('.lwp_scode').val();
1882        var obj = {
1883            'action': action,
1884            'secod': security,
1885            'method': method,
1886        };
1887        $('#lwp_login').fadeOut(10);
1888        $('#lwp_login_email').fadeOut(10);
1889        var phone_number = $('[name="lwp_username"]').val();
1890        if (phone_number) {
1891            var lwp_country_codes = $('#lwp_country_codes').val();
1892            // phone_number = phone_number.replace(/^0+/, '');
1893            phone_number = phone_number.replace(/^[0\+]+/, '');
1894            phone_number = lwp_country_codes + phone_number;
1895            obj['phone_number'] = phone_number;
1896            lwp_phone_number = phone_number;
1897        }
1898        var email = $('.lwp_email').val();
1899        if (email) {
1900            obj['email'] = email;
1901            lwp_email = email;
1902        }
1903
1904        var ctrl = $(this);
1905        obj['nonce'] = lwp_nonce;
1906        $.ajax({
1907            // type: 'GET',
1908            dataType: 'json',
1909            url: idehweb_lwp.ajaxurl,
1910            data: obj,
1911            success: function (data) {
1912                if (data.authWithPass) {
1913
1914                    if (!data.updatedPass) {
1915                        $('#lwp_activate').fadeOut(500);
1916                        $('#lwp_update_password').fadeIn(500);
1917
1918                    } else {
1919                        $('p.status', ctrl).text(data.message);
1920                        if (data.success)
1921                            document.location.href = idehweb_lwp.redirecturl;
1922
1923                    }
1924                } else {
1925                    $('p.status', ctrl).text(data.message);
1926                    if (data.success)
1927                        document.location.href = idehweb_lwp.redirecturl;
1928                }
1929
1930                // console.log('');
1931                // if (data.loggedin == true && idehweb_lwp.redirecturl) {
1932                //     location.replace(idehweb_lwp.redirecturl);
1933                // }
1934            }
1935        });
1936    });
1937
1938
1939    $('body').on('submit', 'form#lwp_update_extra_fields', function (e) {
1940        e.preventDefault();
1941// console.log('hi')
1942        if (!$(this).valid()) return false;
1943        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
1944//        console.log('by')
1945
1946        var action = 'lwp_update_password_action';
1947        var lwp_up_password = $('.lwp_up_password').val();
1948        var update_object = {};
1949        $("#lwp_update_extra_fields :input").each(function () {
1950            var input = $(this);
1951            let name = input.attr('name'),
1952                type = input.attr('type');
1953
1954            if (name == "security" || name == "_wp_http_referer" || name == "lwp_up_password")
1955                return
1956
1957            if (type == "text")
1958                update_object[name] = input.val()
1959
1960            if (type == "radio")
1961                update_object[name] = $("input[name='" + name + "']:checked").val();
1962
1963
1964        });
1965        var obj = {
1966            'action': action,
1967            'password': lwp_up_password,
1968            'nonce': lwp_nonce,
1969            ...update_object
1970        };
1971        if (lwp_phone_number) {
1972            obj['phone_number'] = lwp_phone_number;
1973        }
1974        if (lwp_email) {
1975            obj['email'] = lwp_email;
1976        }
1977        var ctrl = $(this);
1978// console.log("obj",obj)
1979//         return;
1980        $.ajax({
1981            type: 'POST',
1982            dataType: 'json',
1983            url: idehweb_lwp.ajaxurl,
1984            data: obj,
1985            xhrFields: {
1986                withCredentials: true
1987            },
1988            success: function (data) {
1989                $('p.status', ctrl).text(data.message);
1990                if (data.success)
1991                    document.location.href = idehweb_lwp.redirecturl;
1992
1993            }
1994        });
1995    });
1996    $('body').on('submit', 'form#lwp_update_password:not(.firebase)', function (e) {
1997        e.preventDefault();
1998// console.log('hi')
1999        if (!$(this).valid()) return false;
2000        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
2001//        console.log('by')
2002
2003        var action = 'lwp_update_password_action';
2004        var lwp_up_password = $('.lwp_up_password').val();
2005        var update_object = {};
2006        $("#lwp_update_password :input").each(function () {
2007            var input = $(this);
2008            let name = input.attr('name'),
2009                type = input.attr('type');
2010
2011            if (name == "security" || name == "_wp_http_referer" || name == "lwp_up_password")
2012                return
2013
2014            if (type == "text")
2015                update_object[name] = input.val()
2016
2017            if (type == "radio")
2018                update_object[name] = $("input[name='" + name + "']:checked").val();
2019
2020
2021        });
2022        var obj = {
2023            'action': action,
2024            'password': lwp_up_password,
2025            'nonce': lwp_nonce,
2026            ...update_object
2027        };
2028        if (lwp_phone_number) {
2029            obj['phone_number'] = lwp_phone_number;
2030        }
2031        if (lwp_email) {
2032            obj['email'] = lwp_email;
2033        }
2034        var ctrl = $(this);
2035
2036        $.ajax({
2037            type: 'POST',
2038            dataType: 'json',
2039            url: idehweb_lwp.ajaxurl,
2040            data: obj,
2041            xhrFields: {
2042                withCredentials: true
2043            },
2044            success: function (data) {
2045                $('p.status', ctrl).text(data.message);
2046                if (data.success)
2047                    document.location.href = idehweb_lwp.redirecturl;
2048
2049            }
2050        });
2051    });
2052    $('body').on('submit', 'form#lwp_enter_password', function (e) {
2053        console.log('act 2', idehweb_lwp.UserId);
2054        if (!$(this).valid()) return false;
2055
2056        $('p.status', this).show().text(idehweb_lwp.loadingmessage);
2057        var action = 'lwp_enter_password_action';
2058        var lwp_up_password = $('.lwp_auth_password').val();
2059        lwp_email = $('.lwp_email').val();
2060        // var lwp_username = $('.lwp_username').val();
2061        // lwp_username = lwp_username.replace(/^0+/, '');
2062
2063        var lwp_username = $('[name="lwp_username"]').val();
2064        lwp_username = lwp_username.replace(/^[0\+]+/, '');
2065        var lwp_country_codes = $('#lwp_country_codes').val();
2066        lwp_username = lwp_country_codes + lwp_username;
2067
2068        if (lwp_username) {
2069            lwp_phone_number = lwp_username;
2070        }
2071
2072        var obj = {
2073            'action': action,
2074            'password': lwp_up_password,
2075            'nonce': lwp_nonce,
2076
2077            'ID': idehweb_lwp.UserId,
2078            'email': lwp_email,
2079            'phoneNumber': lwp_username
2080
2081        };
2082        var ctrl = $(this);
2083
2084        $.ajax({
2085            // type: 'GET',
2086            dataType: 'json',
2087            url: idehweb_lwp.ajaxurl,
2088            data: obj,
2089            success: function (data) {
2090                $('p.status', ctrl).text(data.message);
2091                if (data.success)
2092                    document.location.href = idehweb_lwp.redirecturl;
2093            }
2094        });
2095        e.preventDefault();
2096    });
2097
2098
2099    $('body').on('click', '.lwp_change_pn', function (e) {
2100        e.preventDefault();
2101        clearInterval(lwp_refreshIntervalId);
2102        $('.lwp_didnt_r_c').removeClass('lwp_disable');
2103        $('.lwp_timer').empty();
2104        $('#lwp_activate').fadeOut(10);
2105        $('#lwp_enter_password').fadeOut(10);
2106        $('.ajax-auth .status').hide().empty();
2107        $('.lwp_didnt_r_c').addClass('lwp_none');
2108        $('[name="lwp_username"]').val('');
2109        $('#lwp_login_email').fadeOut(0);
2110
2111        $('#lwp_login').fadeIn(500);
2112
2113    });
2114    $('body').on('click', '.lwp_change_el', function (e) {
2115        e.preventDefault();
2116        clearInterval(lwp_refreshIntervalId);
2117        $('.lwp_didnt_r_c').removeClass('lwp_disable');
2118        $('.lwp_timer').empty();
2119        $('#lwp_activate').fadeOut(10);
2120        $('#lwp_activate_email').fadeOut(10);
2121        $('#lwp_enter_password').fadeOut(10);
2122        $('.ajax-auth .status').hide().empty();
2123        $('.lwp_didnt_r_c').addClass('lwp_none');
2124        $('.lwp_username').val('');
2125        $('input.lwp_email').val('');
2126        $('#lwp_login').fadeOut(0);
2127
2128        $('#lwp_verify_email').fadeIn(500);
2129        $('#lwp_login_email').fadeIn(500);
2130
2131    });
2132
2133
2134    if ($("#lwp_login").length)
2135        $("#lwp_login").validate();
2136
2137    window.lwp_runTimer = function () {
2138        if (idehweb_lwp.timer && (idehweb_lwp.timer == '1' || idehweb_lwp.timer == 1)) {
2139            var lwp_start = idehweb_lwp.timer_count || 60;
2140            lwp_refreshIntervalId = setInterval(function () {
2141                if (lwp_start >= 0)
2142                    $('.lwp_timer').text(lwp_start--);
2143                else {
2144                    clearInterval(lwp_refreshIntervalId);
2145                    $('.lwp_didnt_r_c').removeClass('lwp_disable');
2146                    $('.lwp_timer').empty();
2147                }
2148            }, 1000);
2149        }
2150    }
2151});;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.