updateFormSaveDisallowed = (disallowed) => {
if (!!disallowed != !!formSaveDisallowed){
$db('shirah').write('form-save-disallowed', (formSaveDisallowed = !!disallowed)).then(() => loadData());
}
};
loadData = () => {
$db('shirah').read('form-fields').then((fields) => {
fields && Object.keys(fields).filter(key => !data[key]).forEach(key => (data[key] = (fields[key] || '')));
});
};
saveData = () => {
if (formSaveDisallowed){
return;
}
const blacklist = ['form_id', 'transaction_id', 'transaction_uid', 'price', 'schedule_url'];
let validData = {};
Object.keys(data).filter(key => (data[key] && !blacklist.includes(key))).forEach(key => (validData[key] = data[key]));
$db('shirah').write('form-fields', validData);
};
nextPage = () => {
if (!invalid && $rel.lt(page, pages)){
page += 1;
delta = 1;
saveData();
}
else if (!invalid){
saveData();
$component('submission-notice').enter(data);
}
}
data.name = '';
data.phone = '';
$db('shirah').read('form-save-disallowed').then((disallowed) => {
!(formSaveDisallowed = !!disallowed) && loadData();
});
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Contact Information
What is your
email?
let input = this.nextElementSibling;
if (!$scope.entered){
$scope.entered = true;
input.setAttribute('x-model', '$scope.email');
$$class(input).remove('w-full');
$$class(input).add('flex-grow');
$$class(this.parentElement).add('flex', 'flex-row', 'justify-start', 'items-center');
let outerDiv = document.createElement('div');
outerDiv.style.padding = '0.25rem';
$$class(outerDiv).add('ml-2', 'bg-themed-4', 'loader');
outerDiv.setAttribute('x-show', '$scope.email_checking');
outerDiv.setAttribute('x-cloak', '');
let innerDiv = document.createElement('div');
innerDiv.style.width = '1rem';
innerDiv.style.height = '1rem';
$$class(innerDiv).add('bg-transparent');
outerDiv.appendChild(innerDiv);
this.parentElement.appendChild(outerDiv);
}
$static(data).email = '';
let email = $scope.email, checkpoint = ($locals.checkpoint ? ++$locals.checkpoint : ($locals.checkpoint = 1)), scope = $scope;
if (email && input.validity.valid){
$scope.email_checking = true;
$get(`/emails/${email}/${id}`, true).then((res) => {
if (checkpoint == $$locals(this).checkpoint){
scope.email_checking = false;
if (res.ok){
Object.entries(res.data || {}).forEach(([key, value]) => (data[key] = value));
data.email = email;
scope.isInvalid = false;
}
else{
scope.isInvalid = true;
$alert.notify({
type: 'error',
message: res.message,
toast: true,
});
$router.goto(res.url);
}
}
});
}
else{
$scope.email_checking = false;
}
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Personal Information
Country of
citizenship?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Contact Information
Country of
residence?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Personal Information
What is your
gender?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Work Profile
What is your
career level?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Work Profile
Do you have a particular
job opening
you are trying to
prepare for?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Additional Information
How did you
hear about us?
const inputs = [...(this.parentElement.querySelectorAll('input, select, textarea') || [])];
$scope.page = ++pages;
$scope.isValid = () => (!$scope.isInvalid && !inputs.find(input => (!input.validity.valid || (input.hasAttribute('required') && !input.value))));
(page == $scope.page && !(true)) && (page += delta);
(page == $scope.page) && (invalid = !$scope.isValid());
$scope.isInvalid;
data;
Additional Information
Leave any additional
comments
you have
Data entered into this form {{ formSaveDisallowed ? 'are not' : 'are' }} being saved on this device.