{{-- Primary Owner Information Component --}}
{!! html()->hidden('owner_id', $primary_owner->id ?? 0) !!}
{!! html()->label($userTitle . ' Status')->for('owner_status') !!} {!! html()->select('owner_status', ['1' => 'Primary ' . $userTitle, '2' => 'Secondary ' . $userTitle], 1)->class('form-control')->id('owner_status')->attribute('readonly', 'readonly')->attribute('onmousedown', 'return false;')->attribute('onkeydown', 'return false;') !!}
{!! html()->label('First Name')->for('owner_first_name')->class('required') !!}* {!! html()->text('owner_first_name', $primary_owner->first_name ?? null)->class('form-control')->required() !!}
{!! html()->label('Middle Name')->for('owner_middle_name') !!} {!! html()->text('owner_middle_name', $primary_owner->middle_name ?? null)->class('form-control') !!}
{!! html()->label('Last Name')->for('owner_last_name') !!}* {!! html()->text('owner_last_name', $primary_owner->last_name ?? null)->class('form-control')->required() !!}
{!! html()->label('Phone Number')->for('owner_phone')->class('required') !!}*
{!! html()->text('')->class('form-control right-border-radius0 no-right-border front-phone-code')->placeholder('1 -')->disabled() !!} {!! html()->text('owner_phone', $primary_owner->phone ?? null)->class('form-control input-mask disable-autocomplete no-left-border left-border-radius0 front-phone-number')->required()->attribute('autocomplete', 'off')->attribute('data-inputmask', "'mask': '(999) 999-9999'")->attribute('data-parsley-required-message', 'Please enter your phone number')->attribute('data-parsley-pattern', '^\(\d{3}\) \d{3}-\d{4}$')->attribute('data-parsley-pattern-message', 'Please enter a valid phone number (e.g. (123) 456-7890)') !!}
{!! html()->label('Email')->for('owner_email') !!}* {!! html()->email('owner_email', $primary_owner->email ?? null)->class('form-control')->required() !!}
{!! html()->checkbox('owner_same_business_phone', $primary_owner->is_same_as_business_phone ?? false, 1)->class('custom-control-input')->id('owner_same_business_phone') !!} {!! html()->label('Same as business phone')->class('custom-control-label')->for('owner_same_business_phone') !!}
{!! html()->checkbox('owner_same_business_email', $primary_owner->is_same_as_business_email ?? false, 1)->class('custom-control-input default-business-email')->id('owner_same_business_email') !!} {!! html()->label('Same as business email')->class('custom-control-label')->for('owner_same_business_email') !!}
{!! html()->label('Country')->for('owner_country') !!}* {!! html()->select('owner_country', ['' => 'Choose...'] + $countries, $primary_owner->location_country_id ?? 231)->class('form-control select2')->required() !!}
{!! html()->label('Date Of Birth')->for('owner_dob') !!}* {!! html()->text('owner_dob', $primary_owner->dob ?? null)->class('form-control datepicker datepicker_dob1')->required()->attribute('data-parsley-required', 'true')->attribute('data-parsley-age-check', '18')->attribute('data-parsley-age-check-message', 'Owner must be at least 18 years old')->attribute('data-parsley-pattern', '^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-[0-9]{4}$')->attribute('data-parsley-pattern-message', 'Please enter a valid date in MM-DD-YYYY format') !!}
{!! html()->label('SSN')->for('owner_ssn') !!}* {!! html()->text('owner_ssn', $primary_owner->ssn ?? null)->class('form-control input-mask')->required()->attribute('autocomplete', 'off')->attribute('data-inputmask', "'mask': '999-99-9999'")->attribute('data-parsley-required-message', 'Please enter your SSN')->attribute('data-parsley-pattern', '^\d{3}-\d{2}-\d{4}$')->attribute('data-parsley-pattern-message', 'Please enter a valid SSN (e.g. 222-22-2222)') !!}
{!! html()->label('Business Title')->for('owner_business_title')->class('required') !!}* {!! html()->text( 'owner_business_title', isset($business->business_name) ? $business->business_name : $primary_owner->business_title ?? null, )->class('form-control')->required() !!}
@if (isset($business) && in_array($business->entity_type_id, [2, 4, 6])) {!! html()->hidden('owner_ownership', 100) !!} @else {!! html()->label('Ownership %* (Percentage)', 'owner_ownership')->toHtml() !!}
{!! html()->text('owner_ownership', $primary_owner->ownership_percentage ?? null)->class('form-control no-right-border small-width numeric')->attribute('aria-describedby', 'option-ownership')->required()->attribute('min', 0)->attribute('max', 100)->attribute('step', '0.01')->attribute('data-parsley-type', 'number')->attribute('data-parsley-min', '0')->attribute('data-parsley-max', '100')->attribute('data-parsley-pattern', '^\d{1,3}(\.\d{1,2})?$')->attribute('data-parsley-required-message', 'Please enter an ownership percentage')->attribute('data-parsley-type-message', 'Please enter a valid number between 0 and 100')->attribute('data-parsley-min-message', 'Value must be at least 0')->attribute('data-parsley-max-message', 'Value must be at most 100')->attribute('data-parsley-pattern-message', 'Ownership can have up to 2 decimal places') !!}
%
@endif

{{ $userTitle }} Address

{!! html()->label('Address')->for('owner_address') !!}* {!! html()->text( 'owner_address', isset($business->business_addressline_one) ? $business->business_addressline_one : $primary_owner->addressline_one ?? '', )->class('form-control location-address')->required() !!}
{!! html()->label('Address 2 (Optional)')->for('owner_address2') !!} {!! html()->text( 'owner_address2', isset($business->business_addressline_two) ? $business->business_addressline_two : $primary_owner->addressline_two ?? '', )->class('form-control') !!}
{!! html()->label('City')->for('owner_city_name') !!}* {!! html()->text('owner_city_name', isset($business->city_name) ? $business->city_name : $primary_owner->city_name ?? null)->class('form-control')->required() !!}
{!! html()->label('State')->for('owner_state_id') !!}* {!! html()->select( 'owner_state_id', ['' => 'Choose...'] + $states, $primary_owner->location_state_id ?? ($business->business_state_id ?? null), )->class('form-control select2')->required() !!}
{!! html()->label('Zip')->for('owner_zip') !!}* {!! html()->text('owner_zip', $primary_owner->zip ?? null)->class('form-control numeric')->attribute('minlength', 5)->attribute('maxlength', 6)->attribute('pattern', '^\d{5,6}$')->attribute('title', 'Please enter a 5 or 6 digit zip code')->required() !!}