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;
Contact Information
What is your current
residence status?
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;
Personal Information
What is your
marital
status?
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
Who are you
sponsoring?
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
Are you currently
employed?
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
Are you able to provide
evidence
of your work?
Please explain the
type of proof
available
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 the country of
citizenship
of the sponsored person?
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 the country of
residence
of the sponsored person?
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 the current
residence status
of the sponsored person?
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
List other applicable citizenships of the sponsored person
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;
Travel Profile
Have the sponsored person lived
outside
your current country of residence for any periods of
12 months or more?
Places and dates
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;
Travel Profile
Have the sponsored person ever
lived
or
visited
Canada?
Dates and details
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
Has the sponsored person, their spouse, or dependent children ever been convicted of a
criminal offence?
What is
nature
of the offence?
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;
Medical Profile
Does the sponsored person or their family they want to immigrate with have any
medical problems?
Please provide more
details
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;
Visa Details
Has the sponsored person or their spouse been previously
denied a Canadian visa
upon application?
What
visa
did they apply for?
What were the
reasons
of denial?
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.