class CustomSolarIntegratorForm extends HTMLElement { constructor() { super(); this.currentStep = 1; this.totalSteps = 3; this.formData = { company_id: '', integrator_type: 'RESIDENTIAL_INSTALLER', certification_level: 'LEVEL_1', license_number: '', license_expiry_date: '', years_of_experience: 0, completed_projects: 0, warranty_offered: '', insurance_coverage: '', specialization: [], coverage_area: [], certifications: [], equipment_brands: [], minimum_project_size: '', maximum_project_size: '', installation_time_frame: '', warranty_period: 10, maintenance_services: false, emergency_support: false, design_services: false, project_management: false, }; } connectedCallback() { this.attachShadow({ mode: 'open' }); this.render(); } handleInputChange(e) { const { name, value, type, checked } = e.target; if (type === 'checkbox') { this.formData[name] = checked; } else { this.formData[name] = value; } this.render(); } handleArrayChange(name, value) { const currentArray = this.formData[name]; const newArray = currentArray.includes(value) ? currentArray.filter(item => item !== value) : [...currentArray, value]; this.formData[name] = newArray; this.render(); } nextStep() { if (this.currentStep < this.totalSteps) { this.currentStep++; this.render(); } } prevStep() { if (this.currentStep > 1) { this.currentStep--; this.render(); } } renderStep1() { return `

Informações Básicas

`; } renderStep2() { return `

Serviços e Capabilities

${['roof_mount', 'ground_mount', 'tracking_systems', 'commercial', 'residential'].map(spec => `
`).join('')}
`; } renderStep3() { return `

Cobertura e Certificações

`; } render() { this.shadowRoot.innerHTML = `

Registro de Integrador Solar

Passo ${this.currentStep} de ${this.totalSteps}
${this.currentStep === 1 ? this.renderStep1() : ''} ${this.currentStep === 2 ? this.renderStep2() : ''} ${this.currentStep === 3 ? this.renderStep3() : ''}
${this.currentStep > 1 ? ` ` : ''}
${this.currentStep < this.totalSteps ? ` ` : ` `}
`; } } customElements.define('custom-solar-integrator-form', CustomSolarIntegratorForm);