PageSourceSearch

https://servicosonline.bage.rs.gov.br/js/6072.js

js bage.rs.gov.br collected 2026-10-02 07:21:23 UTC 141,141 bytes, 3 lines download raw bytes

1/*! For license information please see 6072.js.LICENSE.txt */
2"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6072,3801,6580],{3239:(e,n,t)=>{t.d(n,{A:()=>o});var r=t(3675);const o={obterConfig:function(){return r.A.get(route("certidoes.config"))},buscar:function(e){return r.A.post(route("certidoes.buscar"),e)},emitir:function(e){return r.A.post(route("certidoes.emitir"),e)},validar:function(e){return r.A.post(route("certidoes.validar",{codigo:e}))},exigeCpfCnpj:function(e){return r.A.post(route("certidoes.exige-cpf-cnpj"),e)}}},6206:(e,n,t)=>{t.d(n,{A:()=>o});var r=t(3675);const o={obterDocumentoRecenteBase64:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.A.get(route("documento.recente-base64",{storage_id:e}),{params:n})}}},9826:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(4991),o=t.n(r),a=t(6314),i=t.n(a)()(o());i.push([e.id,".container-visualizador[data-v-757d06a6]{align-items:start;flex:1;justify-content:start}.container-visualizador[data-v-757d06a6],.documento-preview[data-v-757d06a6]{display:flex;flex-direction:column;height:100%;width:100%}.documento-preview[data-v-757d06a6]{align-items:center;border:1px solid var(--color-border);flex-grow:100;gap:20px;justify-content:center;overflow-x:auto;overflow-y:scroll;padding:15px}.actions-container[data-v-757d06a6]{flex-wrap:wrap;justify-content:space-between;margin-bottom:10px;width:100%}.action-buttons[data-v-757d06a6],.actions-container[data-v-757d06a6]{align-items:center;display:flex;gap:10px}.action-buttons[data-v-757d06a6]{justify-content:center}","",{version:3,sources:["webpack://./resources/js/vue/components/VisualizadorDocumentoUnico.vue"],names:[],mappings:"AAyVA,yCAOI,iBAAkB,CAJlB,MAAO,CAGP,qBAEJ,CAEA,6EANI,YAAa,CACb,qBAAsB,CAHtB,WAAY,CADZ,UAsBJ,CAbA,oCAOI,kBAAmB,CAGnB,oCAAqC,CANrC,aAAc,CAQd,QAAS,CANT,sBAAuB,CAGvB,eAAgB,CADhB,iBAAkB,CALlB,YAUJ,CAEA,oCAMI,cAAe,CAFf,6BAA8B,CAF9B,kBAAmB,CADnB,UAOJ,CAEA,qEALI,kBAAmB,CAFnB,YAAa,CAIb,QAQJ,CALA,iCAEI,sBAGJ",sourcesContent:["<script setup>\nimport { onBeforeUnmount, ref, watch } from 'vue';\nimport { useBreakpoint } from '@/composables/useBreakpoint';\nimport Dialog from \"primevue/dialog\";\nimport Button from \"primevue/button\";\nimport Loading from \"./Loading.vue\";\nimport StorageService from '@/services/StorageService';\n\nconst props = defineProps({\n    appendTo: {\n        type: String,\n        default: 'body',\n        description: 'ID do elemento ao qual o Dialog deve se limitar (elemento deve ter position: relative)'\n    }\n});\n\n// DADOS DOCUMENTO\nconst documento = ref(null);\nconst nomeDocumento = ref('');\n\n// DIALOG\nconst showDialog = ref(false);\nconst iframepreview = ref(null);\nconst documentoUrl = ref(null);\n\n// LOADING\nconst loading = ref(false);\nconst loadingIframe = ref(false);\n\n// ERRO\nconst error = ref(false);\n\n// MOBILE/DESKTOP\nconst { isMobile } = useBreakpoint();\n\n/**\n * Abre Dialog com Iframe para visualizar documento passando ID do Documento no E-storage.\n *\n * @param {number} documentoId - ID do Documento no E-storage\n * @param {string} documentoNome - Nome do Documento\n */\nconst openDialog = (documentoId, documentoNome = '') => {\n    documento.value = null;\n    error.value = false;\n\n    showDialog.value = true;\n    nomeDocumento.value = documentoNome;\n\n    downloadArquivo(documentoId);\n}\n\n/**\n * Abre Dialog com Iframe para visualizar documento passando Base64 do Documento.\n *\n * @param {string} base64 - Base64 do Documento\n * @param {string} documentoNome - Nome do Documento\n */\nconst openDialogWithBase64 = (base64, documentoNome = '') => {\n    documento.value = null;\n    error.value = false;\n\n    // Extrai o tipo MIME do Base64\n    const matches = base64.match(/^data:([a-zA-Z0-9]+\\/[a-zA-Z0-9-.+]+);base64,/);
2\n    let contentType = null;\n    let base64Clean = base64;\n\n    if (matches && matches.length > 1) {\n        contentType = matches[1];\n    } else {\n        // Remove prefixo se existir para análise\n        base64Clean = base64.split(',')[1] || base64;\n\n        // Tenta detectar o tipo MIME pela assinatura do arquivo\n        try {\n            const header = atob(base64Clean.substring(0, 8));\n\n            if (header.startsWith('%PDF')) {\n                contentType = 'application/pdf';\n            } else if (header.startsWith('JVBERi0x')) {\n                contentType = 'application/pdf';\n            } else if (header.startsWith('\\x89PNG')) {\n                contentType = 'image/png';\n            } else if (header.startsWith('\\xFF\\xD8\\xFF')) {\n                contentType = 'image/jpeg';\n            } else if (header.startsWith('GIF8')) {\n                contentType = 'image/gif';\n            } else if (header.startsWith('<svg') || header.startsWith('<?xml')) {\n                contentType = 'image/svg+xml';\n            }\n        } catch (e) {\n            console.warn('Não foi possível detectar o MIME type do base64:', e);\n        }\n    }\n\n    documento.value = {\n        documento: base64,\n        content_type: normalizeMimeType(contentType, documentoNome)\n    }\n\n    nomeDocumento.value = documentoNome;\n\n    showDialog.value = true;\n}\n\nconst closeDialog = (e) => showDialog.value = false;\n\nconst MIME_TYPE_BY_EXTENSION = {\n    pdf: 'application/pdf',\n    png: 'image/png',\n    jpg: 'image/jpeg',\n    jpeg: 'image/jpeg',\n    gif: 'image/gif',\n    webp: 'image/webp',\n    svg: 'image/svg+xml',\n    txt: 'text/plain',\n    csv: 'text/csv',\n    json: 'application/json',\n    xml: 'application/xml',\n    html: 'text/html',\n    htm: 'text/html'\n};\n\nconst getExtensionFromFileName = (fileName = '') => {\n    const normalizedFileName = fileName.split('?')[0].trim();\n    const extension = normalizedFileName.includes('.') ? normalizedFileName.split('.').pop() : '';\n\n    return extension.toLowerCase();\n};\n\nconst normalizeMimeType = (mimeType, fileName = '') => {\n    if (mimeType && mimeType !== 'application/octet-stream') {\n        return mimeType;\n    }\n\n    return MIME_TYPE_BY_EXTENSION[getExtensionFromFileName(fileName)] || mimeType || 'application/octet-stream';\n};\n\nconst revokeDocumentoUrl = () => {\n    if (!documentoUrl.value) {\n        return;\n    }\n\n    URL.revokeObjectURL(documentoUrl.value);\n    documentoUrl.value = null;\n};\n\nconst downloadArquivo = async (documentoId) => {\n    loadingIframe.value = true;\n\n    try {\n        const resp = await StorageService.obterDocumentoRecenteBase64(documentoId, { 'base64-only-content': false });\n\n        loadingIframe.value = false;\n\n        documento.value = {\n            ...resp.data.data,\n            content_type: normalizeMimeType(resp.data.data?.content_type, nomeDocumento.value)\n        };\n    } catch (e) {\n        error.value = true;\n        loadingIframe.value = false;\n\n        console.error(e);\n    }\n}\n\n/**\n * Converte Base64 para URL e carrega em um iframe\n *\n * @param {string} base64Data - Dados em Base64 (com ou sem prefixo)\n * @param {string} mimeType - Tipo MIME (ex: 'application/pdf')\n */\nfunction base64ToIframe(base64Data, mimeType) {\n    // Remove o prefixo se existir (ex: \"data:application/pdf;base64,\")\n    const base64WithoutPrefix = base64Data.split(',')[1] || base64Data;\n\n    // Converte Base64 para Blob\n    const byteCharacters = atob(base64WithoutPrefix);\n    const byteArrays = [];\n\n    for (let offset = 0; offset < byteCharacters.length; offset += 512) {\n        const slice = byteCharacters.slice(offset, offset + 512);\n        const byteNumbers = new Array(slice.length);\n\n        for (let i = 0; i < slice.length; i++) {\n            byteNumbers[i] = slice.charCodeAt(i);\n        }\n\n        const byteArray = new Uint8Array(byteNumbers);\n        byteArrays.push(byteArray);\n    }\n\n    const blob = new Blob(byteArrays, { type: mimeType });\n    const blobUrl = URL.createObjectURL(blob);\n\n    return blobUrl;\n}\n\nconst downloadBase64File = (base64, filename, mimeType) => {\n    // Remove o prefixo do Base64 se existir (ex: data:image/png;base64,)\n    const base64WithoutPrefix = base64.split(';base64,').pop();\n\n    // Converte o Base64 para um array de bytes\n    const byteCharacters = atob(base64WithoutPrefix);\n    const byteNumbers = new Array(byteCharacters.length);\n\n    for (let i = 0; i < byteCharacters.length;
2 i++) {\n        byteNumbers[i] = byteCharacters.charCodeAt(i);\n    }\n\n    const byteArray = new Uint8Array(byteNumbers);\n\n    // Cria um blob com os dados\n    const blob = new Blob([byteArray], { type: mimeType });\n\n    // Cria um URL temporário para o blob\n    const url = URL.createObjectURL(blob);\n\n    // Cria um elemento <a> temporário para disparar o download\n    const link = document.createElement('a');\n    link.href = url;\n    link.download = filename;\n    document.body.appendChild(link);\n    link.click();\n\n    // Limpeza\n    setTimeout(() => {\n        document.body.removeChild(link);\n        URL.revokeObjectURL(url);\n    }, 100);\n}\n\nconst verEmOutraAba = () => {\n    if (!documentoUrl.value) {\n        return;\n    }\n\n    window.open(documentoUrl.value, '_blank');\n}\n\nconst isVisualizavelEmFrame = (text = '') => {\n    const patterns = [\n        /image\\/[^ \\n]+/, // Imagens\n        /application\\/pdf/, // PDFs\n        /video\\/[^ \\n]+/, // Vídeos\n        /image\\/svg\\+xml/, // SVG\n        /audio\\/[^ \\n]+/, // Arquivos de áudio\n        /text\\/[^ \\n]+/, // Textos simples, html, csv, etc.\n        /application\\/json/, // JSON\n        /application\\/xml/, // XML\n        /application\\/[^ \\n]+\\+xml/ // Outros formatos XML\n    ];\n\n    return patterns.some(pattern => pattern.test(text));\n};\n\nwatch(documento, (novoDocumento) => {\n    revokeDocumentoUrl();\n\n    if (!novoDocumento?.documento || !novoDocumento?.content_type || !isVisualizavelEmFrame(novoDocumento.content_type)) {\n        return;\n    }\n\n    documentoUrl.value = base64ToIframe(novoDocumento.documento, novoDocumento.content_type);\n});\n\nonBeforeUnmount(() => {\n    revokeDocumentoUrl();\n});\n\ndefineExpose({ openDialog, openDialogWithBase64, closeDialog });\n<\/script>\n\n<template>\n    <Dialog\n        header=\"Visualizador de Documento\"\n        :modal=\"true\"\n        :visible=\"showDialog\"\n        :closable=\"true\"\n        :append-to=\"isMobile || props.appendTo === 'body' ? 'body' : `#${props.appendTo}`\"\n        :pt:mask:style=\"{ position: isMobile ? 'fixed' : 'absolute' }\"\n        :pt:root:style=\"{\n            width: isMobile ? '100vw' : '85vw',\n            minHeight: isMobile ? '85%' : '90%'\n        }\"\n        :pt:content:style=\"{ flex: '1', display: 'flex', flexDirection: 'column' }\"\n        @update:visible=\"closeDialog\"\n    >\n        <div class=\"container-visualizador\">\n            <div v-if=\"documento\" class=\"actions-container\">\n                <b\n                    v-if=\"nomeDocumento\"\n                    :style=\"{ fontSize: isMobile ? '1.1rem' : '1.3rem', wordBreak: 'break-word' }\"\n                >\n                    {{ nomeDocumento }}\n                </b>\n\n                <div class=\"action-buttons\">\n                    <Button\n                        label=\"Download\"\n                        icon=\"pi pi-download\"\n                        size=\"small\"\n                        @click=\"downloadBase64File(documento.documento, nomeDocumento, documento.content_type)\"\n                    />\n\n                    <Button\n                        v-if=\"documento && isVisualizavelEmFrame(documento ? documento.content_type : '')\"\n                        label=\"Ver em outra aba\"\n                        icon=\"pi pi-eye\"\n                        size=\"small\"\n                        @click=\"verEmOutraAba\"\n                    />\n                </div>\n            </div>\n\n            <div class=\"documento-preview\">\n                <Loading :is-loading=\"loadingIframe\" message=\"Carregando Documento...\" />\n\n                <iframe\n                    v-if=\"documento && isVisualizavelEmFrame(documento ? documento.content_type : '')\"\n                    :src=\"documentoUrl\"\n                    width=\"100%\"\n                    height=\"100%\"\n                    style=\"flex: 1;\"\n                    ref=\"iframepreview\"\n                    frameborder=\"0\"\n                    @load=\"loadingIframe = false\"\n                ></iframe>\n\n                <h1\n                    v-if=\"documento && !isVisualizavelEmFrame(documento ? documento.content_type : '')\"\n                    class=\"text-2xl font-bold text-center\"\n                >\n                    Este tipo de arquivo nao pode ser visualizado aqui. Use o botao de download para abrir no aplicativo apropriado.<br>\n                </h1>\n\n                <h1 v-if=\"!loading && error\" class=\"text-2xl font-bold text-center\">\n                    Não foi possível carregar o documento. Tente novamente mais tarde.\n                </h1>\n            </div>\n        </div>\n    </Dialog>\n</template>\n\n<style scoped>\n.container-visualizador {\n    width: 100%;\n    height: 100%;\n    flex: 1;\n    display: flex;\n    flex-direction: column;\n    justify-content: start;
2\n    align-items: start;\n}\n\n.documento-preview {\n    height: 100%;\n    width: 100%;\n    padding: 15px;\n    flex-grow: 100;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    overflow-y: scroll;\n    overflow-x: auto;\n    border: 1px solid var(--color-border);\n    flex-direction: column;\n    gap: 20px;\n}\n\n.actions-container {\n    width: 100%;\n    margin-bottom: 10px;\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 10px;\n}\n\n.action-buttons {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    gap: 10px;\n}\n</style>\n"],sourceRoot:""}]);const l=i},9152:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(4991),o=t.n(r),a=t(6314),i=t.n(a)()(o());i.push([e.id,".card-header h2[data-v-02eff4ba]{color:var(--color-primary);font-size:1.25rem;font-weight:600;margin:0}.form-grid[data-v-02eff4ba]{display:grid;grid-template-columns:1fr 1fr}.full-width[data-v-02eff4ba]{grid-column:1/-1}.field[data-v-02eff4ba]{display:flex;flex-direction:column;gap:6px}.field label[data-v-02eff4ba]{color:#334155;font-size:.875rem;font-weight:500}.actions[data-v-02eff4ba]{display:flex;gap:12px}@media (max-width:767px){.form-grid[data-v-02eff4ba]{grid-template-columns:1fr}.actions[data-v-02eff4ba]{flex-direction:column}}","",{version:3,sources:["webpack://./resources/js/vue/page/EmissaoCertidoes/Components/FormConsulta.vue"],names:[],mappings:"AA4TA,iCAGI,0BAA2B,CAF3B,iBAAkB,CAClB,eAAgB,CAEhB,QACJ,CAEA,4BACI,YAAa,CACb,6BACJ,CAEA,6BACI,gBACJ,CAEA,wBACI,YAAa,CACb,qBAAsB,CACtB,OACJ,CAEA,8BAGI,aAAc,CADd,iBAAmB,CADnB,eAGJ,CAEA,0BACI,YAAa,CACb,QACJ,CAEA,yBACI,4BACI,yBACJ,CAEA,0BACI,qBACJ,CACJ",sourcesContent:["<script setup>\nimport { ref, computed, onMounted } from 'vue';\nimport { Field, useForm } from 'vee-validate';\nimport { useToast } from 'primevue/usetoast';\nimport * as yup from 'yup';\nimport CertidaoService from '@/services/CertidaoService';\nimport Card from 'primevue/card';\nimport InputText from 'primevue/inputtext';\nimport Button from 'primevue/button';\nimport Select from 'primevue/select';\n\nconst props = defineProps({ menuCertidoesVisivel: Boolean, emitindo: Boolean });\n\nconst emit = defineEmits(['loading', 'certidoes']);\n\nconst consultando = ref(false);\nconst configuracoesEmissao = ref({});\nconst exigeCpfCnpjOpcoes = ref({\n    matricula: false,\n    inscricao: false\n});\nconst exibeCpfCnpj = ref(false);\n\nconst emitirPorOptions = ref([\n    { label: 'Matrícula', value: 'M' },\n    { label: 'Inscrição', value: 'I' },\n    { label: 'Nome/Razão Social', value: 'C' }\n]);\n\nconst schemaConsulta = computed(() =>\n    yup.object({\n        emitir_por: yup.string().required('Selecione o tipo de identificação.'),\n        identificador: yup.string().when('emitir_por', {\n            is: (val) => val && val !== 'C',\n            then: (schema) => schema.required(`Preencha a ${identificadorLabel.value}.`),\n            otherwise: (schema) => schema.notRequired()\n        }),\n        cpf_cnpj: exibeCpfCnpj.value ?\n                  yup.string().nullable().cpfCnpj().required('Preencha o CPF ou CNPJ.') :\n                  yup.string().nullable().cpfCnpj()\n    })\n);\n\nconst {\n    handleSubmit,\n    values: valoresConsulta,\n    resetForm,\n    setFieldValue\n} = useForm({\n    validationSchema: schemaConsulta,\n    initialValues: {\n        emitir_por: '',\n        identificador: '',\n        cpf_cnpj: ''\n    }\n});\n\nconst identificadorLabel = computed(() => {\n    const labels = {\n        M: 'Matrícula',\n        I: 'Inscrição',\n        C: 'CGM'\n    };\n\n    return labels[valoresConsulta.emitir_por] ?? 'Identificador';\n});\n\nconst identificadorPlaceholder = computed(() => {\n    if (!valoresConsulta.emitir_por) return 'Selecione como deseja emitir';\n\n    return valoresConsulta.emitir_por === 'C'\n        ? 'Opcional para emissão por CGM'\n        : 'Digite a matrícula ou inscrição';\n});\n\nconst exibirIdentificador = computed(() => {\n    return valoresConsulta.emitir_por && valoresConsulta.emitir_por !== 'C';\n});\n\nconst identificadorHabilitado = computed(() =>
2 {\n    return Boolean(valoresConsulta.emitir_por && valoresConsulta.emitir_por !== 'C');\n});\n\nconst toast = useToast();\n\nonMounted(async () => {\n    await carregarExigeCpfCnpj();\n    await carregarConfiguracoes();\n});\n\nconst carregarConfiguracoes = async () => {\n    emit('loading', true);\n\n    try {\n        const resp = await CertidaoService.obterConfig();\n\n        configuracoesEmissao.value = {\n            certidoes_inscricao: resp.data.certidoes_inscricao ?? true,\n            certidoes_matricula: resp.data.certidoes_matricula ?? true,\n            certidoes_nome_razao_social: resp.data.certidoes_nome_razao_social ?? true,\n            configurado: resp.data.configurado ?? false\n        };\n    } catch (e) {\n        toast.add({\n            severity: 'warn',\n            summary: 'Atenção',\n            detail: 'Não foi possível buscar as configurações.',\n            life: 3000\n        });\n    } finally {\n        emit('loading', false);\n    }\n}\n\nconst carregarExigeCpfCnpj = async () => {\n    emit('loading', true);\n\n    try {\n        const resp = await CertidaoService.exigeCpfCnpj({});\n\n        exigeCpfCnpjOpcoes.value = resp.data.data ?? resp.data;\n    } catch (e) {\n        console.error(e);\n    } finally {\n        emit('loading', false);\n\n        onChangeCpfCnpj();\n    }\n}\n\nconst submitConsulta = handleSubmit(async (values) => {\n    consultando.value = true;\n\n    emit('certidoes', []);\n\n    const payload = {\n        emitir_por: values.emitir_por\n    };\n\n    if (values.emitir_por !== 'C') payload.identificador = onlyDigits(values.identificador);\n\n    const cpfCnpj = onlyDigits(values.cpf_cnpj);\n\n    if (cpfCnpj) payload.cpf_cnpj = cpfCnpj;\n\n    try {\n        const resp = await CertidaoService.buscar(payload);\n\n        const rawData = resp.data.data ?? resp.data;\n        const items = Array.isArray(rawData) ? rawData : [rawData];\n        const certidoes = items\n            .filter((item) => item?.tipo && item?.titulo)\n            .map((item) => ({\n                tipo: item.tipo,\n                titulo: item.titulo,\n                identificador: item.identificador\n            }));\n\n        emit('certidoes', certidoes);\n\n        if (certidoes.length === 0) {\n            toast.add({\n                severity: 'info',\n                summary: 'Atenção',\n                detail: 'Nenhuma certidão disponível para os dados informados.',\n                life: 3000\n            });\n        }\n    } catch (e) {\n        handleApiError(e, 'Não foi possível consultar as certidões fiscais.');\n    } finally {\n        consultando.value = false;\n    }\n});\n\nconst onChangeCpfCnpj = () => {\n    if (valoresConsulta.emitir_por === 'M') {\n        exibeCpfCnpj.value = exigeCpfCnpjOpcoes.value.matricula;\n    } else if (valoresConsulta.emitir_por === 'I') {\n        exibeCpfCnpj.value = exigeCpfCnpjOpcoes.value.inscricao;\n    } else if (valoresConsulta.emitir_por === 'C') {\n        exibeCpfCnpj.value = true;\n    }\n\n    if (!exibeCpfCnpj.value) setFieldValue('cpf_cnpj', null);\n}\n\nconst onlyDigits = (value) => {\n    return (value || '').replace(/\\D/g, '');\n}\n\nconst handleApiError = (e, fallbackMsg) => {\n    const validationErrors = e.response?.data?.errors;\n    const errorMessage = e.response?.data?.message;\n\n    if (validationErrors) {\n        const messages = Object.values(validationErrors).flat().join('<br/>');\n\n        toast.add({ severity: 'info', summary: 'Atenção', detail: messages, life: 5000 });\n\n        return;\n    }\n\n    if (errorMessage) {\n        toast.add({ severity: 'info', summary: 'Atenção', detail: errorMessage, life: 5000 });\n\n        return;\n    }\n\n    toast.add({ severity: 'warn', summary: 'Atenção', detail: fallbackMsg, life: 5000 });\n}\n\nconst limparForm = () => {\n    resetForm();\n\n    exibeCpfCnpj.value = false;\n\n    emit('certidoes', []);\n}\n\ndefineExpose({ valoresConsulta });\n<\/script>\n\n<template>\n    <Card v-if=\"!props.menuCertidoesVisivel\" class=\"consulta-card\">\n        <template #title>\n            <div class=\"card-header\">\n                <h2>Consultar disponibilidade</h2>\n            </div>\n        </template>\n\n        <template #content>
2\n            <form @submit=\"submitConsulta\" class=\"form-grid gap-2\">\n                <div class=\"field\">\n                    <label for=\"emitir_por\">Emitir por</label>\n\n                    <Field name=\"emitir_por\" v-slot=\"{ value, handleChange, errorMessage }\">\n                        <Select\n                            :model-value=\"value\"\n                            :options=\"emitirPorOptions\"\n                            option-label=\"label\"\n                            option-value=\"value\"\n                            placeholder=\"Selecione\"\n                            @change=\"(e) => {\n                                handleChange(e.value);\n                                onChangeCpfCnpj();\n                            }\"\n                        />\n\n                        <small v-if=\"errorMessage\" class=\"text-danger\">\n                            {{ errorMessage }}\n                        </small>\n                    </Field>\n                </div>\n\n                <div v-if=\"exibirIdentificador\" class=\"field\">\n                    <label for=\"identificador\">{{ identificadorLabel }}</label>\n\n                    <Field name=\"identificador\" v-slot=\"{ field, errorMessage }\">\n                        <InputText\n                            v-bind=\"field\"\n                            id=\"identificador\"\n                            :placeholder=\"identificadorPlaceholder\"\n                            inputmode=\"numeric\"\n                            maxlength=\"30\"\n                            :disabled=\"!identificadorHabilitado\"\n                            class=\"w-full\"\n                        />\n\n                        <small v-if=\"errorMessage\" class=\"text-danger\">{{ errorMessage }}</small>\n                    </Field>\n                </div>\n\n                <div v-if=\"exibeCpfCnpj\" class=\"field full-width\">\n                    <label for=\"cpf_cnpj\">CPF ou CNPJ</label>\n\n                    <Field name=\"cpf_cnpj\" v-slot=\"{ field, errorMessage }\">\n                        <InputText\n                            v-bind=\"field\"\n                            id=\"cpf_cnpj\"\n                            placeholder=\"Informe sem máscara para envio\"\n                            inputmode=\"numeric\"\n                            maxlength=\"18\"\n                            class=\"w-full\"\n                        />\n\n                        <small v-if=\"errorMessage\" class=\"text-danger\">{{ errorMessage }}</small>\n                    </Field>\n                </div>\n\n                <div class=\"actions full-width\">\n                    <Button\n                        label=\"Listar\"\n                        icon=\"pi pi-search\"\n                        severity=\"primary\"\n                        type=\"submit\"\n                        :loading=\"consultando\"\n                        :disabled=\"consultando || props.emitindo\"\n                    />\n\n                    <Button\n                        label=\"Limpar\"\n                        icon=\"pi pi-eraser\"\n                        severity=\"secondary\"\n                        outlined\n                        type=\"button\"\n                        :disabled=\"consultando || props.emitindo\"\n                        @click=\"limparForm()\"\n                    />\n                </div>\n            </form>\n        </template>\n    </Card>\n</template>\n\n<style scoped>\n.card-header h2 {\n    font-size: 1.25rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 0;\n}\n\n.form-grid {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n}\n\n.full-width {\n    grid-column: 1 / -1;\n}\n\n.field {\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n}\n\n.field label {\n    font-weight: 500;\n    font-size: 0.875rem;\n    color: #334155;\n}\n\n.actions {\n    display: flex;\n    gap: 12px;\n}\n\n@media (max-width: 767px) {\n    .form-grid {\n        grid-template-columns: 1fr;\n    }\n\n    .actions {\n        flex-direction: column;\n    }\n}\n</style>\n"],sourceRoot:""}]);const l=i},1508:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(4991),o=t.n(r),a=t(6314),i=t.n(a)()(o());
2i.push([e.id,".card-header h2[data-v-5f5f5909]{color:var(--color-primary);font-size:1.25rem;font-weight:600;margin:0}.field[data-v-5f5f5909]{display:flex;flex-direction:column;gap:6px}.field label[data-v-5f5f5909]{color:#334155;font-size:.875rem;font-weight:500}.actions[data-v-5f5f5909]{display:flex;gap:12px}.resultado-validacao[data-v-5f5f5909]{background:var(--color-primary-light);border-radius:8px;margin-top:24px;padding:20px}.resultado-header[data-v-5f5f5909]{align-items:flex-start;display:flex;justify-content:space-between;margin-bottom:16px}.resultado-header h2[data-v-5f5f5909]{color:var(--color-primary);font-size:1.1rem;font-weight:600;margin:4px 0 0}.resultado-label[data-v-5f5f5909]{color:#64748b;font-size:.75rem;font-weight:500;letter-spacing:.05em;text-transform:uppercase}.dados-grid[data-v-5f5f5909]{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.dados-grid div[data-v-5f5f5909]{display:flex;flex-direction:column;gap:4px}.dados-grid dt[data-v-5f5f5909]{color:#64748b;font-size:.75rem;font-weight:500;letter-spacing:.05em;text-transform:uppercase}.dados-grid dd[data-v-5f5f5909]{color:#0f172a;font-size:.95rem;font-weight:500;margin:0}","",{version:3,sources:["webpack://./resources/js/vue/page/EmissaoCertidoes/Components/FormValidacao.vue"],names:[],mappings:"AAoMA,iCAGI,0BAA2B,CAF3B,iBAAkB,CAClB,eAAgB,CAEhB,QACJ,CAEA,wBACI,YAAa,CACb,qBAAsB,CACtB,OACJ,CAEA,8BAGI,aAAc,CADd,iBAAmB,CADnB,eAGJ,CAEA,0BACI,YAAa,CACb,QACJ,CAEA,sCAGI,qCAAsC,CACtC,iBAAkB,CAHlB,eAAgB,CAChB,YAGJ,CAEA,mCAGI,sBAAuB,CAFvB,YAAa,CACb,6BAA8B,CAE9B,kBACJ,CAEA,sCAGI,0BAA2B,CAF3B,gBAAiB,CACjB,eAAgB,CAEhB,cACJ,CAEA,kCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAGhB,oBAAsB,CADtB,wBAEJ,CAEA,6BACI,YAAa,CAEb,QAAS,CADT,wDAEJ,CAEA,iCACI,YAAa,CACb,qBAAsB,CACtB,OACJ,CAEA,gCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAGhB,oBAAsB,CADtB,wBAEJ,CAEA,gCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAEhB,QACJ",sourcesContent:['<script setup>\nimport { ref } from \'vue\';\nimport { Field, useForm } from \'vee-validate\';\nimport { useToast } from \'primevue/usetoast\';\nimport { formatarData } from "@/helpers/date";\nimport * as yup from \'yup\';\nimport CertidaoService from \'@/services/CertidaoService\';\nimport Button from \'primevue/button\';\nimport Card from \'primevue/card\';\nimport InputText from \'primevue/inputtext\';\nimport Tag from \'primevue/tag\';\n\nconst emit = defineEmits([\'loading\', \'resultado\']);\nconst toast = useToast();\n\nconst validando = ref(false);\nconst resultadoValidacao = ref(null);\n\nconst schemaValidacao = yup.object({\n    codigo: yup.string().required(\'O código da certidão é obrigatório.\')\n});\n\nconst { handleSubmit, resetForm } = useForm({\n    validationSchema: schemaValidacao,\n    initialValues: { codigo: \'\' }\n});\n\nconst exibirValor = (value) => {\n    return value === null || value === undefined || value === \'\' ? \'Não informado\' : String(value);\n}\n\nconst handleApiError = (e, fallbackMsg) => {\n    const validationErrors = e.response?.data?.errors;\n    const errorMessage = e.response?.data?.message;\n\n    if (validationErrors) {\n        const messages = Object.values(validationErrors).flat().join(\'<br/>\');\n\n        toast.add({ severity: \'info\', summary: \'Atenção\', detail: messages, life: 5000 });\n\n        return;\n    }\n\n    if (errorMessage) {\n        toast.add({ severity: \'info\', summary: \'Atenção\', detail: errorMessage, life: 5000 });\n\n        return;\n    }\n\n    toast.add({ severity: \'warn\', summary: \'Atenção\', detail: fallbackMsg, life: 5000 });\n}\n\nconst submitValidacao = handleSubmit(async (values) => {\n    const codigo = String(values.codigo || \'\').trim();\n\n    if (!codigo) {\n        toast.add({\n            severity: \'warn\',\n            summary: \'Atenção\',\n            detail: \'Código da certidão não informado.\',\n            life: 3000\n        });\n\n        return;\n    }\n\n    validando.value = true;\n    resultadoValidacao.value = null;\n\n    try {\n        const resp = await CertidaoService.validar(codigo);\n\n        resultadoValidacao.value = resp.data?.data ?? resp.data ?? null;\n\n        emit(\'resultado\', resultadoValidacao.value);\n    } catch (e) {\n        handleApiError(e, \'Não foi possível validar a certidão fiscal.\');\n    } finally {\n        validando.value = false;\n    }\n});\n\nconst limparValidacao = () => {\n    resetForm();\n\n    resultadoValidacao.value = null;\n\n    emit(\'resultado\', null);\n}\n<\/script>\n\n<template>\n    <Card class="consulta-card">\n        <template #title>\n            <div class="card-header">\n                <h2>Validação de certidão</h2>\n            </div>\n        </template>\n\n        <template #content>\n            <form @submit="submitValidacao" class="d-flex flex-column gap-2">\n                <div class="field">\n                    <label for="codigo">Código da certidão</label>\n\n                    <Field name="codigo" v-slot="{ field, errorMessage }">\n                        <InputText\n                            v-bind="field"\n                            id="codigo"\n                            placeholder="Digite o código de validação"\n                            maxlength="80"\n                            class="w-full"\n                        />\n\n                        <small v-if="errorMessage" class="text-danger">{{ errorMessage }}</small>\n                    </Field>\n                </div>\n\n                <div class="d-flex gap-2">\n                    <Button\n                        label="Validar"\n                        icon="pi pi-check"\n                        severity="primary"\n                        type="submit"\n                        :loading="validando"\n                        :disabled="validando"\n                    />\n\n                    <Button\n                        label="Limpar"\n                        icon="pi pi-eraser"\n                        severity="secondary"\n                        outlined\n                        type="button"\n                        @click="limparValidacao"\n                        :disabled="validando"\n                    />\n                </div>\n            </form>\n\n            \x3c!-- RESULTADO VALIDACAO --\x3e\n            <div v-if="resultadoValidacao" class="resultado-validacao">\n                <div class="resultado-header">\n                    <div>
2\n                        <span class="resultado-label">Resultado da validação</span>\n\n                        <h2>{{ exibirValor(resultadoValidacao.tipocertidao) }}</h2>\n                    </div>\n\n                    <Tag\n                        :value="resultadoValidacao.vencida ? \'Vencida\' : \'Válida\'"\n                        :severity="resultadoValidacao.vencida ? \'danger\' : \'success\'"\n                    />\n                </div>\n\n                <dl class="dados-grid">\n                    <div>\n                        <dt>Instituição</dt>\n                        <dd>{{ exibirValor(resultadoValidacao.instituicao) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>Nome</dt>\n                        <dd>{{ exibirValor(resultadoValidacao.nome) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>CGM</dt>\n                        <dd>{{ exibirValor(resultadoValidacao.cgm) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>Matrícula</dt>\n                        <dd>{{ exibirValor(resultadoValidacao.matric) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>Inscrição</dt>\n                        <dd>{{ exibirValor(resultadoValidacao.inscr) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>Geração</dt>\n                        <dd>{{ formatarData(resultadoValidacao.geracao, false) }}</dd>\n                    </div>\n\n                    <div>\n                        <dt>Vencimento</dt>\n                        <dd>{{ formatarData(resultadoValidacao.venc, false) }}</dd>\n                    </div>\n                </dl>\n            </div>\n        </template>\n    </Card>\n</template>\n\n<style scoped>\n.card-header h2 {\n    font-size: 1.25rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 0;\n}\n\n.field {\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n}\n\n.field label {\n    font-weight: 500;\n    font-size: 0.875rem;\n    color: #334155;\n}\n\n.actions {\n    display: flex;\n    gap: 12px;\n}\n\n.resultado-validacao {\n    margin-top: 24px;\n    padding: 20px;\n    background: var(--color-primary-light);\n    border-radius: 8px;\n}\n\n.resultado-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: flex-start;\n    margin-bottom: 16px;\n}\n\n.resultado-header h2 {\n    font-size: 1.1rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 4px 0 0 0;\n}\n\n.resultado-label {\n    font-size: 0.75rem;\n    font-weight: 500;\n    color: #64748b;\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n}\n\n.dados-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: 16px;\n}\n\n.dados-grid div {\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.dados-grid dt {\n    font-size: 0.75rem;\n    font-weight: 500;\n    color: #64748b;\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n}\n\n.dados-grid dd {\n    font-size: 0.95rem;\n    font-weight: 500;\n    color: #0f172a;\n    margin: 0;\n}\n</style>\n'],sourceRoot:""}]);const l=i},1444:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(4991),o=t.n(r),a=t(6314),i=t.n(a)()(o());i.push([e.id,".main-content[data-v-6cb1148d]{background:var(--color-background);display:flex;flex:1;flex-direction:column}.justify[data-v-6cb1148d]{display:flex;flex:1;justify-content:center;margin-top:200px}.certidoes-page[data-v-6cb1148d]{height:100%;max-width:1200px;overflow:overlay;padding:20px}.workspace[data-v-6cb1148d]{display:flex;flex-direction:column;gap:20px}.consulta-card[data-v-6cb1148d]{background:#fff;border-radius:8px;box-shadow:none}.card-header h2[data-v-6cb1148d]{color:var(--color-primary);font-size:1.25rem;font-weight:600;margin:0}.field label[data-v-6cb1148d]{color:#334155;font-size:.875rem;font-weight:500}.resultado-header[data-v-6cb1148d]{align-items:flex-start;display:flex;justify-content:space-between;margin-bottom:16px}.resultado-header h2[data-v-6cb1148d]{color:var(--color-primary);font-size:1.1rem;font-weight:600;margin:4px 0 0}.resultado-label[data-v-6cb1148d]{color:#64748b;font-size:.75rem;font-weight:500;letter-spacing:.05em;text-transform:uppercase}.dados-grid div[data-v-6cb1148d]{display:flex;flex-direction:column;gap:4px}.dados-grid dt[data-v-6cb1148d]{color:#64748b;font-size:.75rem;font-weight:500;letter-spacing:.05em;text-transform:uppercase}.dados-grid dd[data-v-6cb1148d]{color:#0f172a;font-size:.95rem;font-weight:500;margin:0}.resultado[data-v-6cb1148d]{margin-top:8px}.resultado .resultado-header h2[data-v-6cb1148d]{color:var(--color-primary);font-size:1.1rem;font-weight:600;margin:4px 0 0}.certidoes-grid[data-v-6cb1148d]{display:grid;gap:20px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));margin-top:16px}.certidao-card[data-v-6cb1148d]{background:#fff;border-radius:8px;box-shadow:none}.certidao-header[data-v-6cb1148d]{align-items:flex-start;display:flex;flex-direction:column;gap:8px}.certidao-header h3[data-v-6cb1148d]{color:#0f172a;font-size:1rem;font-weight:600;margin:0}.certidao-descricao[data-v-6cb1148d]{color:#64748b;font-size:.875rem;margin:8px 0 16px}@media (max-width:767px){.certidoes-page[data-v-6cb1148d]{padding:12px}.form-grid[data-v-6cb1148d]{grid-template-columns:1fr}.actions[data-v-6cb1148d]{flex-direction:column}.dados-grid[data-v-6cb1148d]{grid-template-columns:1fr}.resultado-header[data-v-6cb1148d]{flex-direction:column;gap:12px}.certidoes-grid[data-v-6cb1148d]{grid-template-columns:1fr}}","",{version:3,sources:["webpack://./resources/js/vue/page/EmissaoCertidoes/EmissaoCertidoes.vue"],names:[],mappings:"AAwNA,+
2BAII,kCAAmC,CAFnC,YAAa,CADb,MAAO,CAEP,qBAEJ,CAEA,0BAEI,YAAa,CADb,MAAO,CAEP,sBAAuB,CACvB,gBACJ,CAEA,iCACI,WAAY,CACZ,gBAAiB,CAEjB,gBAAiB,CADjB,YAEJ,CAEA,4BACI,YAAa,CACb,qBAAsB,CACtB,QACJ,CAEA,gCACI,eAAmB,CACnB,iBAAkB,CAClB,eACJ,CAEA,iCAGI,0BAA2B,CAF3B,iBAAkB,CAClB,eAAgB,CAEhB,QACJ,CAEA,8BAGI,aAAc,CADd,iBAAmB,CADnB,eAGJ,CAGA,mCAGI,sBAAuB,CAFvB,YAAa,CACb,6BAA8B,CAE9B,kBACJ,CAEA,sCAGI,0BAA2B,CAF3B,gBAAiB,CACjB,eAAgB,CAEhB,cACJ,CAEA,kCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAGhB,oBAAsB,CADtB,wBAEJ,CAEA,iCACI,YAAa,CACb,qBAAsB,CACtB,OACJ,CAEA,gCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAGhB,oBAAsB,CADtB,wBAEJ,CAEA,gCAGI,aAAc,CAFd,gBAAkB,CAClB,eAAgB,CAEhB,QACJ,CAGA,4BACI,cACJ,CAEA,iDAGI,0BAA2B,CAF3B,gBAAiB,CACjB,eAAgB,CAEhB,cACJ,CAEA,iCACI,YAAa,CAEb,QAAS,CADT,yDAA4D,CAE5D,eACJ,CAEA,gCACI,eAAmB,CACnB,iBAAkB,CAClB,eACJ,CAEA,kCAGI,sBAAuB,CAFvB,YAAa,CACb,qBAAsB,CAEtB,OACJ,CAEA,qCAGI,aAAc,CAFd,cAAe,CACf,eAAgB,CAEhB,QACJ,CAEA,qCAEI,aAAc,CADd,iBAAmB,CAEnB,iBACJ,CAEA,yBACI,iCACI,YACJ,CAEA,4BACI,yBACJ,CAEA,0BACI,qBACJ,CAEA,6BACI,yBACJ,CAEA,mCACI,qBAAsB,CACtB,QACJ,CAEA,iCACI,yBACJ,CACJ",sourcesContent:['<script setup>\nimport { ref } from \'vue\';\nimport { useBreakpoint } from \'@/composables/useBreakpoint\';\nimport { useToast } from \'primevue/usetoast\';\nimport CertidaoService from \'@/services/CertidaoService\';\nimport Button from \'primevue/button\';\nimport Card from \'primevue/card\';\nimport Tag from \'primevue/tag\';\nimport VisualizadorDocumentoUnico from \'@/vue/components/VisualizadorDocumentoUnico.vue\';\nimport Header from \'@/vue/components/Header.vue\';\nimport Loading from \'@/vue/components/Loading.vue\';\nimport FormConsulta from \'./Components/FormConsulta.vue\';\nimport FormValidacao from \'./Components/FormValidacao.vue\';\n\nconst { isMobile } = useBreakpoint();\nconst toast = useToast();\n\n// LOADING\nconst loading = ref(false);\nconst emitindo = ref(false);\n\n// DADOS\nconst certidoesDisponiveis = ref([]);\n\n// VISUALIZADOR PDF\nconst pageBodyContainerId = ref(\'page-body-container\');\nconst visualizadorRef = ref(null);\nconst formConsultaRef = ref(null);\n\n// CONFIGURAÇÕES\nconst menuCertidoesVisivel = ref(false);\n\n// HANDLERS FILHOS\nconst handleLoading = (value) => loading.value = value;\n\nconst handleCertidoes = (certidoes) => certidoesDisponiveis.value = certidoes;\n\n// HELPERS\nconst getTipoDescricao = (tipo) => {\n    const tipos = {\n        P: \'Positiva\',\n        N: \'Negativa\',\n        R: \'Regular\'\n    };\n\n    return tipos[tipo] ?? tipo;\n}\n\nconst onlyDigits = (value) => {\n    return (value || \'\').replace(/\\D/g, \'\');\n}\n\nconst handleApiError = (e, fallbackMsg) => {\n    const validationErrors = e.response?.data?.errors;\n    const errorMessage = e.response?.data?.message;\n\n    if (validationErrors) {\n        const messages = Object.values(validationErrors).flat().join(\'<br/>\');\n\n        toast.add({\n            severity: \'info\',\n            summary: \'Atenção\',\n            detail: messages,\n            life: 5000\n        });\n\n        return;\n    }\n\n    toast.add({\n        severity: \'error\',\n        summary: \'Algo inesperado aconteceu...\',\n        detail: errorMessage ?? fallbackMsg,\n        life: 5000\n    });\n}\n\n// EMITIR CERTIDÃO\nconst emitirCertidao = async (certidao) => {\n    if (!certidao?.tipo) return;\n\n    emitindo.value = true;\n\n    const valores = formConsultaRef.value?.valoresConsulta ?? {};\n\n    const payload = {\n        emitir_por: valores.emitir_por,\n        tipo: certidao.tipo,\n        identificador: certidao.identificador,\n        origem: \'processo_eletronico\'\n    }\n\n    if (valores.emitir_por !== \'C\') payload.identificador = onlyDigits(valores.identificador);\n\n    const cpfCnpj = onlyDigits(valores.cpf_cnpj);\n\n    if (cpfCnpj) payload.cpf_cnpj = cpfCnpj;\n\n    try {\n        const resp = await CertidaoService.emitir(payload);\n\n        const arquivo = resp.data?.data?.arquivo ?? resp.data?.arquivo ?? null;\n\n        if (!arquivo) {\n            toast.add({\n                severity: \'error\',\n                summary: \'Algo inesperado aconteceu...\',\n                detail: \'A emissão não retornou o arquivo da certidão.\',\n                life: 3000\n            });\n\n            return;\n        }\n\n        const pdfBase64 = arquivo.replace(/^data:application\\/pdf;base64,/, \'\').trim();\n        const fileName = `certidao-${certidao.tipo.toLowerCase()}-${onlyDigits(valores.identificador)}.pdf`;\n\n        if (visualizadorRef.value) {\n            visualizadorRef.value.openDialogWithBase64(\n                `data:application/pdf;base64,${pdfBase64}`,\n                fileName\n            );\n        }\n    } catch (e) {\n        handleApiError(e, \'Não foi possível emitir a certidão fiscal.\');\n    } finally {\n        emitindo.value = false;\n    }\n}\n<\/script>\n\n<template>\n    <VisualizadorDocumentoUnico ref="visualizadorRef" :append-to="pageBodyContainerId"/>\n\n    <main class="main-content">\n        <Header\n            :titulo="\n                isMobile ? \'Emissão de certidões por matrícula ou inscrição e validação\' : \'Certi
2dões Fiscais\'\n            "\n            titulo-mobile-header="CertidõesFiscais"\n            :subtitulo="\n                isMobile ?\n                \'Informe o tipo de identificação, preencha o número correspondente e, se necessário, \' +\n                \'adicione CPF ou CNPJ para consultar e emitir a certidão fiscal disponível.\' :\n                \'Emissão de certidões por matrícula ou inscrição e validação\'\n            "\n            sub-titulo-mobile-header=""\n        />\n\n        <Loading :is-loading="loading" message="" class="justify"/>\n\n        <div :id="pageBodyContainerId" class="position-relative h-100" style="min-height: 0;">\n            <div v-show="!loading" class="certidoes-page">\n                <div class="workspace">\n                    \x3c!-- VALIDAÇÃO --\x3e\n                    <FormValidacao\n                        @loading="handleLoading"\n                    />\n\n                    \x3c!-- CONSULTA --\x3e\n                    <FormConsulta\n                        ref="formConsultaRef"\n                        :menu-certidoes-visivel="menuCertidoesVisivel"\n                        :emitindo="emitindo"\n                        @loading="handleLoading"\n                        @certidoes="handleCertidoes"\n                    />\n\n                    \x3c!-- RESULTADO CERTIDÕES DISPONÍVEIS --\x3e\n                    <div v-if="certidoesDisponiveis.length > 0" class="resultado">\n                        <div class="resultado-header">\n                            <div>\n                                <span class="resultado-label">Resultado da listagem</span>\n\n                                <h2>Tipos disponíveis para emissão</h2>\n                            </div>\n                        </div>\n\n                        <div class="certidoes-grid">\n                            <Card\n                                v-for="certidao in certidoesDisponiveis"\n                                :key="certidao.tipo"\n                                class="certidao-card"\n                            >\n                                <template #title>\n                                    <div class="certidao-header">\n                                        <Tag :value="certidao.tipo" severity="primary"/>\n\n                                        <h3>{{ certidao.titulo }}</h3>\n                                    </div>\n                                </template>\n\n                                <template #content>\n                                    <p class="certidao-descricao">{{ getTipoDescricao(certidao.tipo) }}</p>\n\n                                    <Button\n                                        :label="emitindo ? \'Emitindo...\' : \'Emitir certidão\'"\n                                        icon="pi pi-download"\n                                        severity="accent"\n                                        type="button"\n                                        @click="emitirCertidao(certidao)"\n                                        :loading="emitindo"\n                                        :disabled="emitindo"\n                                        class="w-full"\n                                    />\n                                </template>\n                            </Card>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </main>\n</template>\n\n<style scoped>\n.main-content {\n    flex: 1;\n    display: flex;\n    flex-direction: column;\n    background: var(--color-background);\n}\n\n.justify {\n    flex: 1;\n    display: flex;\n    justify-content: center;\n    margin-top: 200px;\n}\n\n.certidoes-page {\n    height: 100%;\n    max-width: 1200px;\n    padding: 20px;\n    overflow: overlay;\n}\n\n.workspace {\n    display: flex;\n    flex-direction: column;\n    gap: 20px;\n}\n\n.consulta-card {\n    background: #ffffff;\n    border-radius: 8px;\n    box-shadow: none;\n}\n\n.card-header h2 {\n    font-size: 1.25rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 0;\n}\n\n.field label {\n    font-weight: 500;\n    font-size: 0.875rem;\n    color: #334155;\n}\n\n/* RESULTADO VALIDACAO */\n.resultado-header {\n    display: flex;\n    justify-content: space-between;
2\n    align-items: flex-start;\n    margin-bottom: 16px;\n}\n\n.resultado-header h2 {\n    font-size: 1.1rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 4px 0 0 0;\n}\n\n.resultado-label {\n    font-size: 0.75rem;\n    font-weight: 500;\n    color: #64748b;\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n}\n\n.dados-grid div {\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.dados-grid dt {\n    font-size: 0.75rem;\n    font-weight: 500;\n    color: #64748b;\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n}\n\n.dados-grid dd {\n    font-size: 0.95rem;\n    font-weight: 500;\n    color: #0f172a;\n    margin: 0;\n}\n\n/* RESULTADO CERTIDOES */\n.resultado {\n    margin-top: 8px;\n}\n\n.resultado .resultado-header h2 {\n    font-size: 1.1rem;\n    font-weight: 600;\n    color: var(--color-primary);\n    margin: 4px 0 0 0;\n}\n\n.certidoes-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n    gap: 20px;\n    margin-top: 16px;\n}\n\n.certidao-card {\n    background: #ffffff;\n    border-radius: 8px;\n    box-shadow: none;\n}\n\n.certidao-header {\n    display: flex;\n    flex-direction: column;\n    align-items: flex-start;\n    gap: 8px;\n}\n\n.certidao-header h3 {\n    font-size: 1rem;\n    font-weight: 600;\n    color: #0f172a;\n    margin: 0;\n}\n\n.certidao-descricao {\n    font-size: 0.875rem;\n    color: #64748b;\n    margin: 8px 0 16px 0;\n}\n\n@media (max-width: 767px) {\n    .certidoes-page {\n        padding: 12px;\n    }\n\n    .form-grid {\n        grid-template-columns: 1fr;\n    }\n\n    .actions {\n        flex-direction: column;\n    }\n\n    .dados-grid {\n        grid-template-columns: 1fr;\n    }\n\n    .resultado-header {\n        flex-direction: column;\n        gap: 12px;\n    }\n\n    .certidoes-grid {\n        grid-template-columns: 1fr;\n    }\n}\n</style>\n'],sourceRoot:""}]);const l=i},3784:(e,n,t)=>{t.d(n,{A:()=>_});var r=t(9726),o=t(2093),a=t(3315),i=t(1412),l=t(5875),s=t(6206);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return d(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function f(){f=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,n,t){e[n]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{c({},"")}catch(e){c=function(e,n,t){return e[n]=t}}function d(e,n,t,r){var a=n&&n.prototype instanceof b?n:b,i=Object.create(a.prototype),l=new V(r||[]);return o(i,"_invoke",{value:O(e,t,l)}),i}function p(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var v="suspendedStart",m="suspendedYield",h="executing",g="completed",y={};function b(){}function A(){}function C(){}var x={};c(x,i,(function(){return this}));var w=Object.getPrototypeOf,B=w&&w(w(S([])));B&&B!==t&&r.call(B,i)&&(x=B);var E=C.prototype=b.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(n){c(e,n,(function(e){return this._invoke(n,e)}))}))}function j(e,n){function t(o,a,i,l){var s=p(e[o],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==u(d)&&r.call(d,"__await")?n.resolve(d.__await).then((function(e){t("next",e,i,l)}),(function(e){t("throw",e,i,l)})):n.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return t("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new n((function(n,o){t(e,r,n,o)}))}return a=a?a.then(o,o):o()}})}function O(n,t,r){var o=v;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=_(l,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var u=p(n,t,r);if("normal"===u.type){if(o=r.done?g:m,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function _(n,t){var r=t.method,o=n.iterator[r];if(o===e)return t.delegate=null,"throw"===r&&n.iterator.return&&
vendor: 4,570 bytes, line 2
2(t.method="return",t.arg=e,_(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=p(o,n.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[n.resultName]=i.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function L(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function I(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function S(n){if(n||""===n){var t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(r.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(u(n)+" is not iterable")}return A.prototype=C,o(E,"constructor",{value:C,configurable:!0}),o(C,"constructor",{value:A,configurable:!0}),A.displayName=c(C,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===A||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},k(j.prototype),c(j.prototype,l,(function(){return this})),n.AsyncIterator=j,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new j(d(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=S,V.prototype={constructor:V,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!n)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var t=this;function o(r,o){return l.type="throw",l.arg=n,t.next=r,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),y},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),I(t),y}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;I(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:S(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),y}},n}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
2n%2?p(Object(t),!0).forEach((function(n){m(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function m(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==u(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(e,n,t,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}var g={class:"container-visualizador"},y={key:0,class:"actions-container"},b={class:"action-buttons"},A={class:"documento-preview"},C=["src"],x={key:1,class:"text-2xl font-bold text-center"},w={key:2,class:"text-2xl font-bold text-center"};const B={__name:"VisualizadorDocumentoUnico",props:{appendTo:{type:String,default:"body",description:"ID do elemento ao qual o Dialog deve se limitar (elemento deve ter position: relative)"}},setup:function(e,n){var t=n.expose,u=e,d=(0,r.KR)(null),p=(0,r.KR)(""),m=(0,r.KR)(!1),B=(0,r.KR)(null),E=(0,r.KR)(null),k=(0,r.KR)(!1),j=(0,r.KR)(!1),O=(0,r.KR)(!1),_=(0,o.d)().isMobile,L=function(e){return m.value=!1},I={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",txt:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",html:"text/html",htm:"text/html"},V=function(e){return e&&"application/octet-stream"!==e?e:I[function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("?")[0].trim();return(e.includes(".")?e.split(".").pop():"").toLowerCase()}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")]||e||"application/octet-stream"},S=function(){E.value&&(URL.revokeObjectURL(E.value),E.value=null)},R=function(){var e,n=(e=f().mark((function e(n){var t,r;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j.value=!0,e.prev=1,e.next=4,s.A.obterDocumentoRecenteBase64(n,{"base64-only-content":!1});case 4:r=e.sent,j.value=!1,d.value=v(v({},r.data.data),{},{content_type:V(null===(t=r.data.data)||void 0===t?void 0:t.content_type,p.value)}),e.next=14;break;case 9:e.prev=9,e.t0=e.catch(1),O.value=!0,j.value=!1,console.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,9]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var a=e.apply(n,t);function i(e){h(a,r,o,i,l,"next",e)}function l(e){h(a,r,o,i,l,"throw",e)}i(void 0)}))});return function(e){return n.apply(this,arguments)}}();var D=function(){E.value&&window.open(E.value,"_blank")},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[/image\/[^ \n]+/,/application\/pdf/,/video\/[^ \n]+/,/image\/svg\+xml/,/audio\/[^ \n]+/,/text\/[^ \n]+/,/application\/json/,/application\/xml/,/application\/[^ \n]+\+xml/].some((function(n){return n.test(e)}))};return(0,r.wB)(d,(function(e){S(),null!=e&&e.documento&&null!=e&&e.content_type&&F(e.content_type)&&(E.value=function(e,n){for(var t=e.split(",")[1]||e,r=atob(t),o=[],a=0;a<r.length;a+=512){for(var i=r.slice(a,a+512),l=new Array(i.length),s=0;s<i.length;s++)l[s]=i.charCodeAt(s);var u=new Uint8Array(l);o.push(u)}var c=new Blob(o,{type:n});return URL.createObjectURL(c)}(e.documento,e.content_type))})),(0,r.xo)((function(){S()})),t({openDialog:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";d.value=null,O.value=!1,m.value=!0,p.value=n,R(e)},openDialogWithBase64:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";d.value=null,O.value=!1;var t=e.match(/^data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+);base64,/),r=null,o=e;if(t&&t.length>1)r=t[1];else{o=e.split(",")[1]||e;try{var a=atob(o.substring(0,8));a.startsWith("%PDF")||a.startsWith("JVBERi0x")?r="application/pdf":a.startsWith("‰PNG")?r="image/png":a.startsWith("ÿØÿ")?r="image/jpeg":a.startsWith("GIF8")?r="image/gif":(a.startsWith("<svg")||a.startsWith("<?xml"))&&(r="image/svg+xml")}catch(e){console.warn("Não foi possível detectar o MIME type do base64:",e)}}d.value={documento:e,content_type:V(r,n)},p.value=n,m.value=!0},closeDialog:L}),function(e,n){return(0,r.uX)(),(0,r.Wv)((0,r.R1)(a.A),{header:"Visualizador de Documento",modal:!0,visible:m.value,closable:!0,"append-to":(0,r.R1)(_)||"body"===u.appendTo?"body":"#".concat(u.appendTo),"pt:mask:style":{position:(0,r.R1)(_)?"fixed":"absolute"},"pt:root:style":{width:(0,r.R1)(_)?"100vw":"85vw",minHeight:(0,r.R1)(_)?"85%":"90%"},"pt:content:style":{flex:"1",display:"flex",flexDirection:"column"},"onUpdate:visible":L},{default:(0,r.k6)((function(){return[(0,r.Lk)("div",g,[d.value?((0,r.uX)(),(0,r.CE)("div",y,[p.value?((0,r.uX)(),(0,r.CE)("b",{key:0,style:(0,r.Tr)({fontSize:(0,r.R1)(_)?"1.1rem":"1.3rem",wordBreak:"break-word"})},(0,r.v_)(p.value),5)):(0,r.Q3)("",!0),(0,r.Lk)("div",b,[(0,r.bF)((0,r.R1)(i.A),{label:"Download",icon:"pi pi-download",size:"small",onClick:n[0]||(n[0]=function(e){return function(e,n,t){for(var r=e.split(";base64,").pop(),o=atob(r),a=new Array(o.length),i=0;i<o.length;
2i++)a[i]=o.charCodeAt(i);var l=new Uint8Array(a),s=new Blob([l],{type:t}),u=URL.createObjectURL(s),c=document.createElement("a");c.href=u,c.download=n,document.body.appendChild(c),c.click(),setTimeout((function(){document.body.removeChild(c),URL.revokeObjectURL(u)}),100)}(d.value.documento,p.value,d.value.content_type)})}),d.value&&F(d.value?d.value.content_type:"")?((0,r.uX)(),(0,r.Wv)((0,r.R1)(i.A),{key:0,label:"Ver em outra aba",icon:"pi pi-eye",size:"small",onClick:D})):(0,r.Q3)("",!0)])])):(0,r.Q3)("",!0),(0,r.Lk)("div",A,[(0,r.bF)(l.A,{"is-loading":j.value,message:"Carregando Documento..."},null,8,["is-loading"]),d.value&&F(d.value?d.value.content_type:"")?((0,r.uX)(),(0,r.CE)("iframe",{key:0,src:E.value,width:"100%",height:"100%",style:{flex:"1"},ref_key:"iframepreview",ref:B,frameborder:"0",onLoad:n[1]||(n[1]=function(e){return j.value=!1})},null,40,C)):(0,r.Q3)("",!0),d.value&&!F(d.value?d.value.content_type:"")?((0,r.uX)(),(0,r.CE)("h1",x,c(n[2]||(n[2]=[(0,r.eW)(" Este tipo de arquivo nao pode ser visualizado aqui. Use o botao de download para abrir no aplicativo apropriado.",-1),(0,r.Lk)("br",null,null,-1)])))):(0,r.Q3)("",!0),!k.value&&O.value?((0,r.uX)(),(0,r.CE)("h1",w," Não foi possível carregar o documento. Tente novamente mais tarde. ")):(0,r.Q3)("",!0)])])]})),_:1},8,["visible","append-to","pt:mask:style","pt:root:style"])}}};var E=t(5072),k=t.n(E),j=t(9826),O={insert:"head",singleton:!1};k()(j.A,O);j.A.locals;const _=(0,t(6262).A)(B,[["__scopeId","data-v-757d06a6"]])},3801:(e,n,t)=>{t.r(n),t.d(n,{default:()=>I});var r=t(9726),o=t(1268),a=t(2119),i=t(2664),l=t(3239),s=t(4874),u=t(8554),c=t(1412),d=t(2468);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function p(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return v(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function m(){m=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,n,t){e[n]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{u({},"")}catch(e){u=function(e,n,t){return e[n]=t}}function c(e,n,t,r){var a=n&&n.prototype instanceof b?n:b,i=Object.create(a.prototype),l=new V(r||[]);return o(i,"_invoke",{value:O(e,t,l)}),i}function d(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=c;var p="suspendedStart",v="suspendedYield",h="executing",g="completed",y={};function b(){}function A(){}function C(){}var x={};u(x,i,(function(){return this}));var w=Object.getPrototypeOf,B=w&&w(w(S([])));B&&B!==t&&r.call(B,i)&&(x=B);var E=C.prototype=b.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(n){u(e,n,(function(e){return this._invoke(n,e)}))}))}function j(e,n){function t(o,a,i,l){var s=d(e[o],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==f(c)&&r.call(c,"__await")?n.resolve(c.__await).then((function(e){t("next",e,i,l)}),(function(e){t("throw",e,i,l)})):n.resolve(c).then((function(e){u.value=e,i(u)}),(function(e){return t("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new n((function(n,o){t(e,r,n,o)}))}return a=a?a.then(o,o):o()}})}function O(n,t,r){var o=p;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=_(l,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var u=d(n,t,r);if("normal"===u.type){if(o=r.done?g:v,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function _(n,t){var r=t.method,o=n.iterator[r];if(o===e)return t.delegate=null,"throw"===r&&n.iterator.return&&
vendor: 4,994 bytes, line 2
2(t.method="return",t.arg=e,_(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=d(o,n.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[n.resultName]=i.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function L(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function I(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function S(n){if(n||""===n){var t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(r.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(f(n)+" is not iterable")}return A.prototype=C,o(E,"constructor",{value:C,configurable:!0}),o(C,"constructor",{value:A,configurable:!0}),A.displayName=u(C,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===A||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},k(j.prototype),u(j.prototype,l,(function(){return this})),n.AsyncIterator=j,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new j(c(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(E),u(E,s,"Generator"),u(E,i,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=S,V.prototype={constructor:V,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!n)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var t=this;function o(r,o){return l.type="throw",l.arg=n,t.next=r,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),y},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),I(t),y}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;I(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:S(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),y}},n}function h(e,n,t,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function g(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var a=e.apply(n,t);function i(e){h(a,r,o,i,l,"next",e)}function l(e){h(a,r,o,i,l,"throw",e)}i(void 0)}))}}var y={class:"field"},b={key:0,class:"text-danger"},A={key:0,class:"field"},C={for:"identificador"},x={key:0,class:"text-danger"},w={key:1,class:"field full-width"},B={key:0,class:"text-danger"},E={class:"actions full-width"};const k={__name:"FormConsulta",props:{menuCertidoesVisivel:Boolean,emitindo:Boolean},emits:["loading","certidoes"],setup:function(e,n){var t=n.expose,f=n.emit,v=e,h=f,k=(0,r.KR)(!1),j=(0,r.KR)({}
2),O=(0,r.KR)({matricula:!1,inscricao:!1}),_=(0,r.KR)(!1),L=(0,r.KR)([{label:"Matrícula",value:"M"},{label:"Inscrição",value:"I"},{label:"Nome/Razão Social",value:"C"}]),I=(0,r.EW)((function(){return i.Ik({emitir_por:i.Yj().required("Selecione o tipo de identificação."),identificador:i.Yj().when("emitir_por",{is:function(e){return e&&"C"!==e},then:function(e){return e.required("Preencha a ".concat(M.value,"."))},otherwise:function(e){return e.notRequired()}}),cpf_cnpj:_.value?i.Yj().nullable().cpfCnpj().required("Preencha o CPF ou CNPJ."):i.Yj().nullable().cpfCnpj()})})),V=(0,o.mN)({validationSchema:I,initialValues:{emitir_por:"",identificador:"",cpf_cnpj:""}}),S=V.handleSubmit,R=V.values,D=V.resetForm,F=V.setFieldValue,M=(0,r.EW)((function(){var e;return null!==(e={M:"Matrícula",I:"Inscrição",C:"CGM"}[R.emitir_por])&&void 0!==e?e:"Identificador"})),N=(0,r.EW)((function(){return R.emitir_por?"C"===R.emitir_por?"Opcional para emissão por CGM":"Digite a matrícula ou inscrição":"Selecione como deseja emitir"})),P=(0,r.EW)((function(){return R.emitir_por&&"C"!==R.emitir_por})),T=(0,r.EW)((function(){return Boolean(R.emitir_por&&"C"!==R.emitir_por)})),z=(0,a.d)();(0,r.sV)(g(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G();case 2:return e.next=4,U();case 4:case"end":return e.stop()}}),e)}))));var U=function(){var e=g(m().mark((function e(){var n,t,r,o,a;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h("loading",!0),e.prev=1,e.next=4,l.A.obterConfig();case 4:a=e.sent,j.value={certidoes_inscricao:null===(n=a.data.certidoes_inscricao)||void 0===n||n,certidoes_matricula:null===(t=a.data.certidoes_matricula)||void 0===t||t,certidoes_nome_razao_social:null===(r=a.data.certidoes_nome_razao_social)||void 0===r||r,configurado:null!==(o=a.data.configurado)&&void 0!==o&&o},e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),z.add({severity:"warn",summary:"Atenção",detail:"Não foi possível buscar as configurações.",life:3e3});case 11:return e.prev=11,h("loading",!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])}
2)));return function(){return e.apply(this,arguments)}}(),G=function(){var e=g(m().mark((function e(){var n,t;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h("loading",!0),e.prev=1,e.next=4,l.A.exigeCpfCnpj({});case 4:t=e.sent,O.value=null!==(n=t.data.data)&&void 0!==n?n:t.data,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.error(e.t0);case 11:return e.prev=11,h("loading",!1),J(),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),W=S(function(){var e=g(m().mark((function e(n){var t,r,o,a,i,s,u;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.value=!0,h("certidoes",[]),t={emitir_por:n.emitir_por},"C"!==n.emitir_por&&(t.identificador=q(n.identificador)),(r=q(n.cpf_cnpj))&&(t.cpf_cnpj=r),e.prev=6,e.next=9,l.A.buscar(t);case 9:a=e.sent,i=null!==(o=a.data.data)&&void 0!==o?o:a.data,s=Array.isArray(i)?i:[i],u=s.filter((function(e){return(null==e?void 0:e.tipo)&&(null==e?void 0:e.titulo)})).map((function(e){return{tipo:e.tipo,titulo:e.titulo,identificador:e.identificador}})),h("certidoes",u),0===u.length&&z.add({severity:"info",summary:"Atenção",detail:"Nenhuma certidão disponível para os dados informados.",life:3e3}),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(6),Y(e.t0,"Não foi possível consultar as certidões fiscais.");case 20:return e.prev=20,k.value=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[6,17,20,23]])})));return function(n){return e.apply(this,arguments)}}()),J=function(){"M"===R.emitir_por?_.value=O.value.matricula:"I"===R.emitir_por?_.value=O.value.inscricao:"C"===R.emitir_por&&(_.value=!0),_.value||F("cpf_cnpj",null)},q=function(e){return(e||"").replace(/\D/g,"")},Y=function(e,n){var t,r,o=null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.errors,a=null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message;if(o){var i=Object.values(o).flat().join("<br/>");z.add({severity:"info",summary:"Atenção",detail:i,life:5e3})}else a?z.add({severity:"info",summary:"Atenção",detail:a,life:5e3}):z.add({severity:"warn",summary:"Atenção",detail:n,life:5e3})};return t({valoresConsulta:R}),function(e,n){return v.menuCertidoesVisivel?(0,r.Q3)("",!0):((0,r.uX)(),(0,r.Wv)((0,r.R1)(s.A),{key:0,class:"consulta-card"},{title:(0,r.k6)((function(){return p(n[2]||(n[2]=[(0,r.Lk)("div",{class:"card-header"},[(0,r.Lk)("h2",null,"Consultar disponibilidade")],-1)]))})),content:(0,r.k6)((function(){return[(0,r.Lk)("form",{onSubmit:n[1]||(n[1]=function(){return(0,r.R1)(W)&&(0,r.R1)(W).apply(void 0,arguments)}),class:"form-grid gap-2"},[(0,r.Lk)("div",y,[n[3]||(n[3]=(0,r.Lk)("label",{for:"emitir_por"},"Emitir por",-1)),(0,r.bF)((0,r.R1)(o.D0),{name:"emitir_por"},{default:(0,r.k6)((function(e){var n=e.value,t=e.handleChange,o=e.errorMessage;return[(0,r.bF)((0,r.R1)(d.A),{"model-value":n,options:L.value,"option-label":"label","option-value":"value",placeholder:"Selecione",onChange:function(e){t(e.value),J()}},null,8,["model-value","options","onChange"]),o?((0,r.uX)(),(0,r.CE)("small",b,(0,r.v_)(o),1)):(0,r.Q3)("",!0)]})),_:1})]),P.value?((0,r.uX)(),(0,r.CE)("div",A,[(0,r.Lk)("label",C,(0,r.v_)(M.value),1),(0,r.bF)((0,r.R1)(o.D0),{name:"identificador"},{default:(0,r.k6)((function(e){var n=e.field,t=e.errorMessage;return[(0,r.bF)((0,r.R1)(u.A),(0,r.v6)(n,{id:"identificador",placeholder:N.value,inputmode:"numeric",maxlength:"30",disabled:!T.value,class:"w-full"}),null,16,["placeholder","disabled"]),t?((0,r.uX)(),(0,r.CE)("small",x,(0,r.v_)(t),1)):(0,r.Q3)("",!0)]})),_:1})])):(0,r.Q3)("",!0),_.value?((0,r.uX)(),(0,r.CE)("div",w,[n[4]||(n[4]=(0,r.Lk)("label",{for:"cpf_cnpj"},"CPF ou CNPJ",-1)),(0,r.bF)((0,r.R1)(o.D0),{name:"cpf_cnpj"},{default:(0,r.k6)((function(e){var n=e.field,t=e.errorMessage;return[(0,r.bF)((0,r.R1)(u.A),(0,r.v6)(n,{id:"cpf_cnpj",placeholder:"Informe sem máscara para envio",inputmode:"numeric",maxlength:"18",class:"w-full"}),null,16),t?((0,r.uX)(),(0,r.CE)("small",B,(0,r.v_)(t),1)):(0,r.Q3)("",!0)]})),_:1})])):(0,r.Q3)("",!0),(0,r.Lk)("div",E,[(0,r.bF)((0,r.R1)(c.A),{label:"Listar",icon:"pi pi-search",severity:"primary",type:"submit",loading:k.value,disabled:k.value||v.emitindo},null,8,["loading","disabled"]),(0,r.bF)((0,r.R1)(c.A),{label:"Limpar",icon:"pi pi-eraser",severity:"secondary",outlined:"",type:"button",disabled:k.value||v.emitindo,onClick:n[0]||(n[0]=function(e){return D(),_.value=!1,void h("certidoes",[])})},null,8,["disabled"])])],32)]})),_:1}))}}};var j=t(5072),O=t.n(j),_=t(9152),L={insert:"head",singleton:!1};O()(_.A,L);_.A.locals;const I=(0,t(6262).A)(k,[["__scopeId","data-v-02eff4ba"]])},6580:(e,n,t)=>{t.r(n),t.d(n,{default:()=>_});var r=t(9726),o=t(1268),a=t(2119),i=t(3312),l=t(2664),s=t(3239),u=t(1412),c=t(4874),d=t(8554),f=t(9155);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return m(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function h(){h=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,n,t){e[n]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{u({},"")}catch(e){u=function(e,n,t){return e[n]=t}}function c(e,n,t,r){var a=n&&n.prototype instanceof b?n:b,i=Object.create(a.prototype),l=new V(r||[]);return o(i,"_invoke",{value:O(e,t,l)}),i}function d(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",g="completed",y={};function b(){}function A(){}function C(){}var x={};u(x,i,(function(){return this}));var w=Object.getPrototypeOf,B=w&&w(w(S([])));B&&B!==t&&r.call(B,i)&&(x=B);var E=C.prototype=b.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(n){u(e,n,(function(e){return this._invoke(n,e)}))}))}function j(e,n){function t(o,a,i,l){var s=d(e[o],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==p(c)&&r.call(c,"__await")?n.resolve(c.__await).then((function(e){t("next",e,i,l)}),(function(e){t("throw",e,i,l)})):n.resolve(c).then((function(e){u.value=e,i(u)}),(function(e){return t("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new n((function(n,o){t(e,r,n,o)}))}return a=a?a.then(o,o):o()}})}function O(n,t,r){var o=f;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=_(l,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var u=d(n,t,r);if("normal"===u.type){if(o=r.done?g:v,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function _(n,t){var r=t.method,o=n.iterator[r];if(o===e)return t.delegate=null,"throw"===r&&n.iterator.return&&
vendor: 4,545 bytes, line 2
2(t.method="return",t.arg=e,_(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=d(o,n.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[n.resultName]=i.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function L(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function I(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function S(n){if(n||""===n){var t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(r.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(p(n)+" is not iterable")}return A.prototype=C,o(E,"constructor",{value:C,configurable:!0}),o(C,"constructor",{value:A,configurable:!0}),A.displayName=u(C,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===A||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},k(j.prototype),u(j.prototype,l,(function(){return this})),n.AsyncIterator=j,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new j(c(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(E),u(E,s,"Generator"),u(E,i,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=S,V.prototype={constructor:V,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!n)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var t=this;function o(r,o){return l.type="throw",l.arg=n,t.next=r,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),y},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),I(t),y}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;I(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:S(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),y}},n}function g(e,n,t,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}var y={class:"field"},b={key:0,class:"text-danger"},A={class:"d-flex gap-2"},C={key:0,class:"resultado-validacao"},x={class:"resultado-header"},w={class:"dados-grid"};
2const B={__name:"FormValidacao",emits:["loading","resultado"],setup:function(e,n){var t=n.emit,p=(0,a.d)(),m=(0,r.KR)(!1),B=(0,r.KR)(null),E=l.Ik({codigo:l.Yj().required("O código da certidão é obrigatório.")}),k=(0,o.mN)({validationSchema:E,initialValues:{codigo:""}}),j=k.handleSubmit,O=k.resetForm,_=function(e){return null==e||""===e?"Não informado":String(e)},L=function(e,n){var t,r,o=null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.errors,a=null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message;if(o){var i=Object.values(o).flat().join("<br/>");p.add({severity:"info",summary:"Atenção",detail:i,life:5e3})}else a?p.add({severity:"info",summary:"Atenção",detail:a,life:5e3}):p.add({severity:"warn",summary:"Atenção",detail:n,life:5e3})},I=j(function(){var e,n=(e=h().mark((function e(n){var r,o,a,i,l;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=String(n.codigo||"").trim()){e.next=4;break}return p.add({severity:"warn",summary:"Atenção",detail:"Código da certidão não informado.",life:3e3}),e.abrupt("return");case 4:return m.value=!0,B.value=null,e.prev=6,e.next=9,s.A.validar(r);case 9:l=e.sent,B.value=null!==(o=null!==(a=null===(i=l.data)||void 0===i?void 0:i.data)&&void 0!==a?a:l.data)&&void 0!==o?o:null,t("resultado",B.value),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(6),L(e.t0,"Não foi possível validar a certidão fiscal.");case 17:return e.prev=17,m.value=!1,e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[6,14,17,20]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var a=e.apply(n,t);function i(e){g(a,r,o,i,l,"next",e)}function l(e){g(a,r,o,i,l,"throw",e)}i(void 0)}))});return function(e){return n.apply(this,arguments)}}()),V=function(){O(),B.value=null,t("resultado",null)};return function(e,n){return(0,r.uX)(),(0,r.Wv)((0,r.R1)(c.A),{class:"consulta-card"},{title:(0,r.k6)((function(){return v(n[1]||(n[1]=[(0,r.Lk)("div",{class:"card-header"},[(0,r.Lk)("h2",null,"Validação de certidão")],-1)]))})),content:(0,r.k6)((function(){return[(0,r.Lk)("form",{onSubmit:n[0]||(n[0]=function(){return(0,r.R1)(I)&&(0,r.R1)(I).apply(void 0,arguments)}),class:"d-flex flex-column gap-2"},[(0,r.Lk)("div",y,[n[2]||(n[2]=(0,r.Lk)("label",{for:"codigo"},"Código da certidão",-1)),(0,r.bF)((0,r.R1)(o.D0),{name:"codigo"},{default:(0,r.k6)((function(e){var n=e.field,t=e.errorMessage;return[(0,r.bF)((0,r.R1)(d.A),(0,r.v6)(n,{id:"codigo",placeholder:"Digite o código de validação",maxlength:"80",class:"w-full"}),null,16),t?((0,r.uX)(),(0,r.CE)("small",b,(0,r.v_)(t),1)):(0,r.Q3)("",!0)]})),_:1})]),(0,r.Lk)("div",A,[(0,r.bF)((0,r.R1)(u.A),{label:"Validar",icon:"pi pi-check",severity:"primary",type:"submit",loading:m.value,disabled:m.value},null,8,["loading","disabled"]),(0,r.bF)((0,r.R1)(u.A),{label:"Limpar",icon:"pi pi-eraser",severity:"secondary",outlined:"",type:"button",onClick:V,disabled:m.value},null,8,["disabled"])])],32),B.value?((0,r.uX)(),(0,r.CE)("div",C,[(0,r.Lk)("div",x,[(0,r.Lk)("div",null,[n[3]||(n[3]=(0,r.Lk)("span",{class:"resultado-label"},"Resultado da validação",-1)),(0,r.Lk)("h2",null,(0,r.v_)(_(B.value.tipocertidao)),1)]),(0,r.bF)((0,r.R1)(f.A),{value:B.value.vencida?"Vencida":"Válida",severity:B.value.vencida?"danger":"success"},null,8,["value","severity"])]),(0,r.Lk)("dl",w,[(0,r.Lk)("div",null,[n[4]||(n[4]=(0,r.Lk)("dt",null,"Instituição",-1)),(0,r.Lk)("dd",null,(0,r.v_)(_(B.value.instituicao)),1)]),(0,r.Lk)("div",null,[n[5]||(n[5]=(0,r.Lk)("dt",null,"Nome",-1)),(0,r.Lk)("dd",null,(0,r.v_)(_(B.value.nome)),1)]),(0,r.Lk)("div",null,[n[6]||(n[6]=(0,r.Lk)("dt",null,"CGM",-1)),(0,r.Lk)("dd",null,(0,r.v_)(_(B.value.cgm)),1)]),(0,r.Lk)("div",null,[n[7]||(n[7]=(0,r.Lk)("dt",null,"Matrícula",-1)),(0,r.Lk)("dd",null,(0,r.v_)(_(B.value.matric)),1)]),(0,r.Lk)("div",null,[n[8]||(n[8]=(0,r.Lk)("dt",null,"Inscrição",-1)),(0,r.Lk)("dd",null,(0,r.v_)(_(B.value.inscr)),1)]),(0,r.Lk)("div",null,[n[9]||(n[9]=(0,r.Lk)("dt",null,"Geração",-1)),(0,r.Lk)("dd",null,(0,r.v_)((0,r.R1)(i.X)(B.value.geracao,!1)),1)]),(0,r.Lk)("div",null,[n[10]||(n[10]=(0,r.Lk)("dt",null,"Vencimento",-1)),(0,r.Lk)("dd",null,(0,r.v_)((0,r.R1)(i.X)(B.value.venc,!1)),1)])])])):(0,r.Q3)("",!0)]})),_:1})}}};var E=t(5072),k=t.n(E),j=t(1508),O={insert:"head",singleton:!1};k()(j.A,O);j.A.locals;const _=(0,t(6262).A)(B,[["__scopeId","data-v-5f5f5909"]])},6072:(e,n,t)=>{t.r(n),t.d(n,{default:()=>I});
vendor: 4,901 bytes, line 2
2var r=t(9726),o=t(2093),a=t(2119),i=t(3239),l=t(1412),s=t(4874),u=t(9155),c=t(3784),d=t(7243),f=t(5875),p=t(3801),v=t(6580);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function h(){h=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,n,t){e[n]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{u({},"")}catch(e){u=function(e,n,t){return e[n]=t}}function c(e,n,t,r){var a=n&&n.prototype instanceof b?n:b,i=Object.create(a.prototype),l=new V(r||[]);return o(i,"_invoke",{value:O(e,t,l)}),i}function d(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=c;var f="suspendedStart",p="suspendedYield",v="executing",g="completed",y={};function b(){}function A(){}function C(){}var x={};u(x,i,(function(){return this}));var w=Object.getPrototypeOf,B=w&&w(w(S([])));B&&B!==t&&r.call(B,i)&&(x=B);var E=C.prototype=b.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(n){u(e,n,(function(e){return this._invoke(n,e)}))}))}function j(e,n){function t(o,a,i,l){var s=d(e[o],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==m(c)&&r.call(c,"__await")?n.resolve(c.__await).then((function(e){t("next",e,i,l)}),(function(e){t("throw",e,i,l)})):n.resolve(c).then((function(e){u.value=e,i(u)}),(function(e){return t("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new n((function(n,o){t(e,r,n,o)}))}return a=a?a.then(o,o):o()}})}function O(n,t,r){var o=f;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=_(l,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var u=d(n,t,r);if("normal"===u.type){if(o=r.done?g:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function _(n,t){var r=t.method,o=n.iterator[r];if(o===e)return t.delegate=null,"throw"===r&&n.iterator.return&&(t.method="return",t.arg=e,_(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=d(o,n.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[n.resultName]=i.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function L(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function I(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function S(n){if(n||""===n){var t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(r.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(m(n)+" is not iterable")}return A.prototype=C,o(E,"constructor",{value:C,configurable:!0}),o(C,"constructor",{value:A,configurable:!0}),A.displayName=u(C,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===A||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},k(j.prototype),u(j.prototype,l,(function(){return this})),n.AsyncIterator=j,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new j(c(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(E),u(E,s,"Generator"),u(E,i,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=S,V.prototype={constructor:V,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
2h(I),!n)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var t=this;function o(r,o){return l.type="throw",l.arg=n,t.next=r,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),y},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),I(t),y}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;I(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:S(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),y}},n}function g(e,n,t,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}var y={class:"main-content"},b=["id"],A={class:"certidoes-page"},C={class:"workspace"},x={key:0,class:"resultado"},w={class:"certidoes-grid"},B={class:"certidao-header"},E={class:"certidao-descricao"};const k={__name:"EmissaoCertidoes",setup:function(e){var n=(0,o.d)().isMobile,t=(0,a.d)(),m=(0,r.KR)(!1),k=(0,r.KR)(!1),j=(0,r.KR)([]),O=(0,r.KR)("page-body-container"),_=(0,r.KR)(null),L=(0,r.KR)(null),I=(0,r.KR)(!1),V=function(e){return m.value=e},S=function(e){return j.value=e},R=function(e){return(e||"").replace(/\D/g,"")},D=function(e,n){var r,o,a=null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.errors,i=null===(o=e.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.message;if(a){var l=Object.values(a).flat().join("<br/>");t.add({severity:"info",summary:"Atenção",detail:l,life:5e3})}else t.add({severity:"error",summary:"Algo inesperado aconteceu...",detail:null!=i?i:n,life:5e3})},F=function(){var e,n=(e=h().mark((function e(n){var r,o,a,l,s,u,c,d,f,p,v,m,g;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=n&&n.tipo){e.next=2;break}return e.abrupt("return");case 2:return k.value=!0,a=null!==(r=null===(o=L.value)||void 0===o?void 0:o.valoresConsulta)&&void 0!==r?r:{},l={emitir_por:a.emitir_por,tipo:n.tipo,identificador:n.identificador,origem:"processo_eletronico"},"C"!==a.emitir_por&&(l.identificador=R(a.identificador)),(s=R(a.cpf_cnpj))&&(l.cpf_cnpj=s),e.prev=8,e.next=11,i.A.emitir(l);case 11:if(p=e.sent,v=null!==(u=null!==(c=null===(d=p.data)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.arquivo)&&void 0!==c?c:null===(f=p.data)||void 0===f?void 0:f.arquivo)&&void 0!==u?u:null){e.next=16;break}return t.add({severity:"error",summary:"Algo inesperado aconteceu...",detail:"A emissão não retornou o arquivo da certidão.",life:3e3}),e.abrupt("return");case 16:m=v.replace(/^data:application\/pdf;base64,/,"").trim(),g="certidao-".concat(n.tipo.toLowerCase(),"-").concat(R(a.identificador),".pdf"),_.value&&_.value.openDialogWithBase64("data:application/pdf;base64,".concat(m),g),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(8),D(e.t0,"Não foi possível emitir a certidão fiscal.");case 24:return e.prev=24,k.value=!1,e.finish(24);case 27:case"end":return e.stop()}}),e,null,[[8,21,24,27]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var a=e.apply(n,t);function i(e){g(a,r,o,i,l,"next",e)}function l(e){g(a,r,o,i,l,"throw",e)}i(void 0)}))});return function(e){return n.apply(this,arguments)}}();return function(e,t){return(0,r.uX)(),(0,r.CE)(r.FK,null,[(0,r.bF)(c.A,{ref_key:"visualizadorRef",ref:_,"append-to":O.value},null,8,["append-to"]),(0,r.Lk)("main",y,[(0,r.bF)(d.A,{titulo:(0,r.R1)(n)?"Emissão de certidões por matrícula ou inscrição e validação":"Certidões Fiscais","titulo-mobile-header":"CertidõesFiscais",subtitulo:(0,r.R1)(n)?"Informe o tipo de identificação, preencha o número correspondente e, se necessário, adicione CPF ou CNPJ para consultar e emitir a certidão fiscal disponível.":"Emissão de certidões por matrícula ou inscrição e validação","sub-titulo-mobile-header":""},null,8,["titulo","subtitulo"]),(0,r.bF)(f.A,{"is-loading":m.value,message:"",class:"justify"},null,8,["is-loading"]),(0,r.Lk)("div",{id:O.value,class:"position-relative h-100",style:{"min-height":"0"}},[(0,r.bo)((0,r.Lk)("div",A,[(0,r.Lk)("div",C,[(0,r.bF)(v.default,{onLoading:V}),(0,r.bF)(p.default,{ref_key:"formConsultaRef",ref:L,"menu-certidoes-visivel":I.value,emitindo:k.value,onLoading:V,onCertidoes:S},null,8,["menu-certidoes-visivel","emitindo"]),j.value.length>0?((0,r.uX)(),(0,r.CE)("div",x,[t[0]||(t[0]=(0,r.Lk)("div",{class:"resultado-header"},[(0,r.Lk)("div",null,[(0,r.Lk)("span",{class:"resultado-label"},"Resultado da listagem"),(0,r.Lk)("h2",null,"Tipos disponíveis para emissão")])],-1)),(0,r.Lk)("div",w,[((0,r.uX)(!0),(0,r.CE)(r.FK,null,(0,r.pI)(j.value,(function(e){return(0,r.uX)(),(0,r.Wv)((0,r.R1)(s.A),{key:e.tipo,class:"certidao-card"},{title:(0,r.k6)((function(){return[(0,r.Lk)("div",B,[(0,r.bF)((0,r.R1)(u.A),{value:e.tipo,severity:"primary"},null,8,["value"]),(0,r.Lk)("h3",null,(0,r.v_)(e.titulo),1)])]})),content:(0,r.k6)((function(){return[(0,r.Lk)("p",E,(0,r.v_)((n=e.tipo,null!==(t={P:"Positiva",N:"Negativa",R:"Regular"}[n])&&void 0!==t?t:n)),1),(0,r.bF)((0,r.R1)(l.A),{label:k.value?"Emitindo...":"Emitir certidão",icon:"pi pi-download",severity:"accent",type:"button",onClick:function(n){return F(e)},loading:k.value,disabled:k.value,class:"w-full"},null,8,["label","onClick","loading","disabled"])];var n,t})),_:2},1024)})),128))])])):(0,r.Q3)("",!0)])],512),[[r.aG,!m.value]])],8,b)])],64)}}};var j=t(5072),O=t.n(j),_=t(1444),L={insert:"head",singleton:!1};O()(_.A,L);_.A.locals;const I=(0,t(6262).A)(k,[["__scopeId","data-v-6cb1148d"]])},9155:(e,n,t)=>{t.d(n,{A:()=>u});var r=t(3171),o=t(8849),a=t(5547).A.extend({name:"tag",style:"\n    .p-tag {\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        background: dt('tag.primary.background');\n        color: dt('tag.primary.color');\n        font-size: dt('tag.font.size');\n        font-weight: dt('tag.font.weight');\n        padding: dt('tag.padding');
2\n        border-radius: dt('tag.border.radius');\n        gap: dt('tag.gap');\n    }\n\n    .p-tag-icon {\n        font-size: dt('tag.icon.size');\n        width: dt('tag.icon.size');\n        height: dt('tag.icon.size');\n    }\n\n    .p-tag-rounded {\n        border-radius: dt('tag.rounded.border.radius');\n    }\n\n    .p-tag-success {\n        background: dt('tag.success.background');\n        color: dt('tag.success.color');\n    }\n\n    .p-tag-info {\n        background: dt('tag.info.background');\n        color: dt('tag.info.color');\n    }\n\n    .p-tag-warn {\n        background: dt('tag.warn.background');\n        color: dt('tag.warn.color');\n    }\n\n    .p-tag-danger {\n        background: dt('tag.danger.background');\n        color: dt('tag.danger.color');\n    }\n\n    .p-tag-secondary {\n        background: dt('tag.secondary.background');\n        color: dt('tag.secondary.color');\n    }\n\n    .p-tag-contrast {\n        background: dt('tag.contrast.background');\n        color: dt('tag.contrast.color');\n    }\n",classes:{root:function(e){var n=e.props;return["p-tag p-component",{"p-tag-info":"info"===n.severity,"p-tag-success":"success"===n.severity,"p-tag-warn":"warn"===n.severity,"p-tag-danger":"danger"===n.severity,"p-tag-secondary":"secondary"===n.severity,"p-tag-contrast":"contrast"===n.severity,"p-tag-rounded":n.rounded}]},icon:"p-tag-icon",label:"p-tag-label"}}),i=t(9726);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function s(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n);if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==l(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var u={name:"Tag",extends:{name:"BaseTag",extends:o.A,props:{value:null,severity:null,rounded:Boolean,icon:String},style:a,provide:function(){return{$pcTag:this,$parentInstance:this}}},inheritAttrs:!1,computed:{dataP:function(){return(0,r.cn)(s({rounded:this.rounded},this.severity,this.severity))}}},c=["data-p"];u.render=function(e,n,t,r,o,a){return(0,i.uX)(),(0,i.CE)("span",(0,i.v6)({class:e.cx("root"),"data-p":a.dataP},e.ptmi("root")),[e.$slots.icon?((0,i.uX)(),(0,i.Wv)((0,i.$y)(e.$slots.icon),(0,i.v6)({key:0,class:e.cx("icon")},e.ptm("icon")),null,16,["class"])):e.icon?((0,i.uX)(),(0,i.CE)("span",(0,i.v6)({key:1,class:[e.cx("icon"),e.icon]},e.ptm("icon")),null,16)):(0,i.Q3)("",!0),null!=e.value||e.$slots.default?(0,i.RG)(e.$slots,"default",{key:2},(function(){return[(0,i.Lk)("span",(0,i.v6)({class:e.cx("label")},e.ptm("label")),(0,i.v_)(e.value),17)]})):(0,i.Q3)("",!0)],16,c)}},1268:(e,n,t)=>{t.d(n,{D0:()=>fe,mN:()=>he});var r=t(9726);function o(e){return"function"==typeof e}function a(e){return null==e}const i=e=>null!==e&&!!e&&"object"==typeof e&&!Array.isArray(e);function l(e){return Number(e)>=0}function s(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}function u(e,n){return Object.keys(n).forEach((t=>{if(s(n[t])&&s(e[t]))return e[t]||(e[t]={}),void u(e[t],n[t]);e[t]=n[t]})),e}function c(e){const n=e.split(".");if(!n.length)return"";let t=String(n[0]);for(let e=1;e<n.length;e++)l(n[e])?t+=`[${n[e]}]`:t+=`.${n[e]}`;return t}const d={};function f(e,n,t){"object"==typeof t.value&&(t.value=p(t.value)),t.enumerable&&!t.get&&!t.set&&t.configurable&&t.writable&&"__proto__"!==n?e[n]=t.value:Object.defineProperty(e,n,t)}function p(e){if("object"!=typeof e)return e;var n,t,r,o=0,a=Object.prototype.toString.call(e);
vendor: 5,554 bytes, line 2
2if("[object Object]"===a?r=Object.create(e.__proto__||null):"[object Array]"===a?r=Array(e.length):"[object Set]"===a?(r=new Set,e.forEach((function(e){r.add(p(e))}))):"[object Map]"===a?(r=new Map,e.forEach((function(e,n){r.set(p(n),p(e))}))):"[object Date]"===a?r=new Date(+e):"[object RegExp]"===a?r=new RegExp(e.source,e.flags):"[object DataView]"===a?r=new e.constructor(p(e.buffer)):"[object ArrayBuffer]"===a?r=e.slice(0):"Array]"===a.slice(-6)&&(r=new e.constructor(e)),r){for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)f(r,t[o],Object.getOwnPropertyDescriptor(e,t[o]));for(o=0,t=Object.getOwnPropertyNames(e);o<t.length;o++)Object.hasOwnProperty.call(r,n=t[o])&&r[n]===e[n]||f(r,n,Object.getOwnPropertyDescriptor(e,n))}return r||e}const v=Symbol("vee-validate-form"),m=Symbol("vee-validate-form-context"),h=Symbol("vee-validate-field-instance"),g=Symbol("Default empty value"),y="undefined"!=typeof window;function b(e){return o(e)&&!!e.__locatorRef}function A(e){return!!e&&o(e.parse)&&"VVTypedSchema"===e.__type}function C(e){return!!e&&o(e.validate)}function x(e){return"checkbox"===e||"radio"===e}function w(e){return/^\[.+\]$/i.test(e)}function B(e){return"SELECT"===e.tagName}function E(e,n){return!function(e,n){const t=![!1,null,void 0,0].includes(n.multiple)&&!Number.isNaN(n.multiple);return"select"===e&&"multiple"in n&&t}(e,n)&&"file"!==n.type&&!x(n.type)}function k(e){return j(e)&&e.target&&"submit"in e.target}function j(e){return!!e&&(!!("undefined"!=typeof Event&&o(Event)&&e instanceof Event)||!(!e||!e.srcElement))}function O(e,n){return n in e&&e[n]!==g}function _(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var t,r,o;if(Array.isArray(e)){if((t=e.length)!=n.length)return!1;for(r=t;0!=r--;)if(!_(e[r],n[r]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(r of e.entries())if(!n.has(r[0]))return!1;for(r of e.entries())if(!_(r[1],n.get(r[0])))return!1;return!0}if(I(e)&&I(n))return e.size===n.size&&(e.name===n.name&&(e.lastModified===n.lastModified&&e.type===n.type));if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(r of e.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if((t=e.length)!=n.length)return!1;for(r=t;0!=r--;)if(e[r]!==n[r])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(e=L(e),n=L(n),(t=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=t;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=t;0!=r--;){var a=o[r];if(!_(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}function L(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function I(e){return!!y&&e instanceof File}function V(e){return w(e)?e.replace(/\[|\]/gi,""):e}function S(e,n,t){if(!e)return t;if(w(n))return e[V(n)];return(n||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce(((e,n)=>{return(i(r=e)||Array.isArray(r))&&n in e?e[n]:t;var r}),e)}function R(e,n,t){if(w(n))return void(e[V(n)]=t);const r=n.split(/\.|\[(\d+)\]/).filter(Boolean);let o=e;for(let e=0;e<r.length;e++){if(e===r.length-1)return void(o[r[e]]=t);r[e]in o&&!a(o[r[e]])||(o[r[e]]=l(r[e+1])?[]:{}),o=o[r[e]]}}function D(e,n){Array.isArray(e)&&l(n)?e.splice(Number(n),1):i(e)&&delete e[n]}function F(e,n){if(w(n))return void delete e[V(n)];const t=n.split(/\.|\[(\d+)\]/).filter(Boolean);let r=e;for(let e=0;e<t.length;e++){if(e===t.length-1){D(r,t[e]);break}if(!(t[e]in r)||a(r[t[e]]))break;r=r[t[e]]}const o=t.map(((n,r)=>S(e,t.slice(0,r).join("."))));for(let n=o.length-1;n>=0;n--)l=o[n],(Array.isArray(l)?0===l.length:i(l)&&0===Object.keys(l).length)&&(0!==n?D(o[n-1],t[n-1]):D(e,t[0]));var l}function M(e){return Object.keys(e)}function N(e,n=void 0){const t=(0,r.nI)();return(null==t?void 0:t.provides[e])||(0,r.WQ)(e,n)}function P(e,n,t){if(Array.isArray(e)){const t=[...e],r=t.findIndex((e=>_(e,n)));return r>=0?t.splice(r,1):t.push(n),t}return _(e,n)?t:n}function T(e,n=0){let t=null,r=[];return function(...o){return t&&clearTimeout(t),t=setTimeout((()=>{const n=e(...o);r.forEach((e=>e(n))),r=[]}),n),new Promise((e=>r.push(e)))}}function z(e,n){return i(n)&&n.number?function(e){const n=parseFloat(e);return isNaN(n)?e:n}(e):e}function U(e,n){let t;return async function(...r){const o=e(...r);t=o;const a=await o;return o!==t?a:(t=void 0,n(a,r))}}function G(e){return Array.isArray(e)?e:e?[e]:[]}function W(e,n){const t={};for(const r in e)n.includes(r)||(t[r]=e[r]);return t}function J(e,n,t){return n.slots.default?"string"!=typeof e&&e?{default:()=>{var e,r;return null===(r=(e=n.slots).default)||void 0===r?void 0:r.call(e,t())}}:n.slots.default(t()):n.slots.default}function q(e){if(Y(e))return e._value}function Y(e){return"_value"in e}function K(e){if(!j(e))return e;const n=e.target;if(x(n.type)&&Y(n))return q(n);if("file"===n.type&&n.files){const e=Array.from(n.files);return n.multiple?e:e[0]}if(B(t=n)&&t.multiple)return Array.from(n.options).filter((e=>e.selected&&!e.disabled)).map(q);var t;if(B(n)){const e=Array.from(n.options).find((e=>e.selected));return e?q(e):n.value}return function(e){return"number"===e.type||"range"===e.type?Number.isNaN(e.valueAsNumber)?e.value:e.valueAsNumber:e.value}(n)}function Q(e){const n={};return Object.defineProperty(n,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,
2configurable:!1}),e?i(e)&&e._$$isNormalized?e:i(e)?Object.keys(e).reduce(((n,t)=>{const r=function(e){if(!0===e)return[];if(Array.isArray(e))return e;if(i(e))return e;return[e]}(e[t]);return!1!==e[t]&&(n[t]=X(r)),n}),n):"string"!=typeof e?n:e.split("|").reduce(((e,n)=>{const t=$(n);return t.name?(e[t.name]=X(t.params),e):e}),n):n}function X(e){const n=e=>"string"==typeof e&&"@"===e[0]?function(e){const n=n=>{var t;return null!==(t=S(n,e))&&void 0!==t?t:n[e]};return n.__locatorRef=e,n}(e.slice(1)):e;return Array.isArray(e)?e.map(n):e instanceof RegExp?[e]:Object.keys(e).reduce(((t,r)=>(t[r]=n(e[r]),t)),{})}const $=e=>{let n=[];const t=e.split(":")[0];return e.includes(":")&&(n=e.split(":").slice(1).join(":").split(",")),{name:t,params:n}};let H=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const Z=()=>H;async function ee(e,n,t={}){const r=null==t?void 0:t.bails,a={name:(null==t?void 0:t.name)||"{field}",rules:n,label:null==t?void 0:t.label,bails:null==r||r,formData:(null==t?void 0:t.values)||{}},i=await async function(e,n){const t=e.rules;if(A(t)||C(t))return async function(e,n){const t=A(n.rules)?n.rules:ne(n.rules),r=await t.parse(e,{formData:n.formData}),o=[];for(const e of r.errors)e.errors.length&&o.push(...e.errors);return{value:r.value,errors:o}}(n,Object.assign(Object.assign({},e),{rules:t}));if(o(t)||Array.isArray(t)){const r={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:n},o=Array.isArray(t)?t:[t],a=o.length,i=[];for(let t=0;t<a;t++){const a=o[t],l=await a(n,r);if(!("string"!=typeof l&&!Array.isArray(l)&&l)){if(Array.isArray(l))i.push(...l);else{const e="string"==typeof l?l:re(r);i.push(e)}if(e.bails)return{errors:i}}}return{errors:i}}const r=Object.assign(Object.assign({},e),{rules:Q(t)}),a=[],i=Object.keys(r.rules),l=i.length;for(let t=0;t<l;t++){const o=i[t],l=await te(r,n,{name:o,params:r.rules[o]});if(l.error&&(a.push(l.error),e.bails))return{errors:a}}return{errors:a}}(a,e);return Object.assign(Object.assign({},i),{valid:!i.errors.length})}function ne(e){return{__type:"VVTypedSchema",async parse(n,t){var r;try{return{output:await e.validate(n,{abortEarly:!1,context:(null==t?void 0:t.formData)||{}}),errors:[]}}catch(e){if(!function(e){return!!e&&"ValidationError"===e.name}(e))throw e;if(!(null===(r=e.inner)||void 0===r?void 0:r.length)&&e.errors.length)return{errors:[{path:e.path,errors:e.errors}]};const n=e.inner.reduce(((e,n)=>{const t=n.path||"";return e[t]||(e[t]={errors:[],path:t}),e[t].errors.push(...n.errors),e}),{});return{errors:Object.values(n)}}}}}async function te(e,n,t){const r=(o=t.name,d[o]);var o;if(!r)throw new Error(`No such validator '${t.name}' exists.`);const a=function(e,n){const t=e=>b(e)?e(n):e;if(Array.isArray(e))return e.map(t);return Object.keys(e).reduce(((n,r)=>(n[r]=t(e[r]),n)),{})}(t.params,e.formData),i={field:e.label||e.name,name:e.name,label:e.label,value:n,form:e.formData,rule:Object.assign(Object.assign({},t),{params:a})},l=await r(n,a,i);return"string"==typeof l?{error:l}:{error:l?void 0:re(i)}}function re(e){const n=Z().generateMessage;return n?n(e):"Field is invalid"}async function oe(e,n,t){const r=M(e).map((async r=>{var o,a,i;const l=null===(o=null==t?void 0:t.names)||void 0===o?void 0:o[r],s=await ee(S(n,r),e[r],{name:(null==l?void 0:l.name)||r,label:null==l?void 0:l.label,values:n,bails:null===(i=null===(a=null==t?void 0:t.bailsMap)||void 0===a?void 0:a[r])||void 0===i||i});return Object.assign(Object.assign({},s),{path:r})}));let o=!0;const a=await Promise.all(r),i={},l={};for(const e of a)i[e.path]={valid:e.valid,errors:e.errors},e.valid||(o=!1,l[e.path]=e.errors[0]);return{valid:o,results:i,errors:l,source:"schema"}}let ae=0;function ie(e,n){const{value:t,initialValue:o,setInitialValue:a}=function(e,n,t){const o=(0,r.KR)((0,r.R1)(n));function a(){return t?S(t.initialValues.value,(0,r.R1)(e),(0,r.R1)(o)):(0,r.R1)(o)}function i(n){t?t.setFieldInitialValue((0,r.R1)(e),n,!0):o.value=n}const l=(0,r.EW)(a);if(!t){return{value:(0,r.KR)(a()),initialValue:l,setInitialValue:i}}const s=function(e,n,t,o){if((0,r.i9)(e))return(0,r.R1)(e);if(void 0!==e)return e;return S(n.values,(0,r.R1)(o),(0,r.R1)(t))}(n,t,l,e);t.stageInitialValue((0,r.R1)(e),s,!0);const u=(0,r.EW)({get:()=>S(t.values,(0,r.R1)(e)),set(n){t.setFieldValue((0,r.R1)(e),n,!1)}});return{value:u,initialValue:l,setInitialValue:i}}(e,n.modelValue,n.form);if(!n.form){const{errors:s,setErrors:u}=function(){const e=(0,r.KR)([]);return{errors:e,setErrors:n=>{e.value=G(n)}}}(),c=ae>=Number.MAX_SAFE_INTEGER?0:++ae,d=function(e,n,t,o){const a=(0,r.EW)((()=>{var e,n,t;return null!==(t=null===(n=null===(e=(0,r.BA)(o))||void 0===e?void 0:e.describe)||void 0===n?void 0:n.call(e).required)&&void 0!==t&&t})),i=(0,r.Kh)({touched:!1,pending:!1,valid:!0,required:a,validated:!!(0,r.R1)(t).length,initialValue:(0,r.EW)((()=>(0,r.R1)(n))),dirty:(0,r.EW)((()=>!_((0,r.R1)(e),(0,r.R1)(n))))});return(0,r.wB)(t,(e=>{i.valid=!e.length}),{immediate:!0,flush:"sync"}),i}(t,o,s,n.schema);function f(e){var n;"value"in e&&(t.value=e.value),"errors"in e&&u(e.errors),"touched"in e&&(d.touched=null!==(n=e.touched)&&void 0!==n?n:d.touched),"initialValue"in e&&a(e.initialValue)}return{id:c,path:e,value:t,initialValue:o,meta:d,flags:{pendingUnmount:{[c]:!1},pendingReset:!1},errors:s,setState:f}}const i=n.form.createPathState(e,{bails:n.bails,label:n.label,type:n.type,validate:n.validate,schema:n.schema}),l=(0,r.EW)((()=>i.errors));return{id:Array.isArray(i.id)?i.id[i.id.length-1]:i.id,path:e,value:t,errors:l,meta:i,initialValue:o,flags:i.__flags,setState:function(o){var i,l,s;"value"in o&&(t.value=o.value),"errors"in o&&(null===(i=n.form)||void 0===i||i.setFieldError((0,r.R1)(e),o.errors)),"touched"in o&&(null===(l=n.form)||void 0===l||l.setFieldTouched((0,r.R1)(e),null!==(s=o.touched)&&void 0!==s&&s)),"initialValue"in o&&a(o.initialValue)}}}!function(e,n){let t,r}((()=>{setTimeout((async()=>{await(0,r.dY)()}),100)}),100);function le(e,n,t){return x(null==t?void 0:t.type)?function(e,n,t){const o=(null==t?void 0:t.standalone)?void 0:N(v),a=null==t?void 0:t.checkedValue,i=null==t?void 0:t.uncheckedValue;function l(n){const l=n.handleChange,s=(0,r.EW)((()=>{const e=(0,r.BA)(n.value),t=(0,r.BA)(a);return Array.isArray(e)?e.findIndex((e=>_(e,t)))>=0:_(t,e)}));function u(u,c=!0){var d,f;if(s.value===(null===(d=null==u?void 0:u.target)||void 0===d?void 0:d.checked))return void(c&&n.validate());const p=(0,r.BA)(e),v=null==o?void 0:o.getPathState(p),m=K(u);let h=null!==(f=(0,r.BA)(a))&&void 0!==f?f:m;o&&(null==v?void 0:v.multiple)&&"checkbox"===v.type?h=P(S(o.values,p)||[],h,void 0):"checkbox"===(null==t?void 0:t.type)&&(h=P((0,r.BA)(n.value),h,(0,r.BA)(i))),l(h,c)}return Object.assign(Object.assign({}
2,n),{checked:s,checkedValue:a,uncheckedValue:i,handleChange:u})}return l(se(e,n,t))}(e,n,t):se(e,n,t)}function se(e,n,t){const{initialValue:a,validateOnMount:i,bails:l,type:s,checkedValue:u,label:d,validateOnValueUpdate:f,uncheckedValue:m,controlled:y,keepValueOnUnmount:x,syncVModel:w,form:B}=function(e){const n=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),t=!!(null==e?void 0:e.syncVModel),o="string"==typeof(null==e?void 0:e.syncVModel)?e.syncVModel:(null==e?void 0:e.modelPropName)||"modelValue",a=t&&!("initialValue"in(e||{}))?ue((0,r.nI)(),o):null==e?void 0:e.initialValue;if(!e)return Object.assign(Object.assign({},n()),{initialValue:a});const i="valueProp"in e?e.valueProp:e.checkedValue,l="standalone"in e?!e.standalone:e.controlled,s=(null==e?void 0:e.modelPropName)||(null==e?void 0:e.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},n()),e||{}),{initialValue:a,controlled:null==l||l,checkedValue:i,syncVModel:s})}(t),E=y?N(v):void 0,k=B||E,j=(0,r.EW)((()=>c((0,r.BA)(e)))),O=(0,r.EW)((()=>{if((0,r.BA)(null==k?void 0:k.schema))return;const e=(0,r.R1)(n);return C(e)||A(e)||o(e)||Array.isArray(e)?e:Q(e)})),L=!o(O.value)&&A((0,r.BA)(n)),{id:I,value:V,initialValue:R,meta:D,setState:F,errors:P,flags:T}=ie(j,{modelValue:a,form:k,bails:l,label:d,type:s,validate:O.value?Y:void 0,schema:L?n:void 0}),G=(0,r.EW)((()=>P.value[0]));w&&function({prop:e,value:n,handleChange:t,shouldValidate:o}){const a=(0,r.nI)();if(!a||!e)return void 0;const i="string"==typeof e?e:"modelValue",l=`update:${i}`;if(!(i in a.props))return;(0,r.wB)(n,(e=>{_(e,ue(a,i))||a.emit(l,e)})),(0,r.wB)((()=>ue(a,i)),(e=>{if(e===g&&void 0===n.value)return;const r=e===g?void 0:e;_(r,n.value)||t(r,o())}))}({value:V,prop:w,handleChange:X,shouldValidate:()=>f&&!T.pendingReset});async function W(e){var n,t;if(null==k?void 0:k.validateSchema){const{results:t}=await k.validateSchema(e);return null!==(n=t[(0,r.BA)(j)])&&void 0!==n?n:{valid:!0,errors:[]}}return O.value?ee(V.value,O.value,{name:(0,r.BA)(j),label:(0,r.BA)(d),values:null!==(t=null==k?void 0:k.values)&&void 0!==t?t:{},bails:l}):{valid:!0,errors:[]}}const J=U((async()=>(D.pending=!0,D.validated=!0,W("validated-only"))),(e=>(T.pendingUnmount[te.id]||(F({errors:e.errors}),D.pending=!1,D.valid=e.valid),e))),q=U((async()=>W("silent")),(e=>(D.valid=e.valid,e)));function Y(e){return"silent"===(null==e?void 0:e.mode)?q():J()}function X(e,n=!0){Z(K(e),n)}function $(e){var n;const t=e&&"value"in e?e.value:R.value;F({value:p(t),initialValue:p(t),touched:null!==(n=null==e?void 0:e.touched)&&void 0!==n&&n,errors:(null==e?void 0:e.errors)||[]}),D.pending=!1,D.validated=!1,q()}(0,r.sV)((()=>{if(i)return J();k&&k.validateSchema||q()}));const H=(0,r.nI)();function Z(e,n=!0){V.value=H&&w?z(e,H.props.modelModifiers):e;(n?J:q)()}const ne=(0,r.EW)({get:()=>V.value,set(e){Z(e,f)}}),te={id:I,name:j,label:d,value:ne,meta:D,errors:P,errorMessage:G,type:s,checkedValue:u,uncheckedValue:m,bails:l,keepValueOnUnmount:x,resetField:$,handleReset:()=>$(),validate:Y,handleChange:X,handleBlur:(e,n=!1)=>{D.touched=!0,n&&J()},setState:F,setTouched:function(e){D.touched=e},setErrors:function(e){F({errors:Array.isArray(e)?e:[e]})},setValue:Z};if((0,r.Gt)(h,te),(0,r.i9)(n)&&"function"!=typeof(0,r.R1)(n)&&(0,r.wB)(n,((e,n)=>{_(e,n)||(D.validated?J():q())}),{deep:!0}),!k)return te;const re=(0,r.EW)((()=>{const e=O.value;return!e||o(e)||C(e)||A(e)||Array.isArray(e)?{}:Object.keys(e).reduce(((n,t)=>{const r=(o=e[t],Array.isArray(o)?o.filter(b):M(o).filter((e=>b(o[e]))).map((e=>o[e]))).map((e=>e.__locatorRef)).reduce(((e,n)=>{const t=S(k.values,n)||k.values[n];return void 0!==t&&(e[n]=t),e}),{});var o;return Object.assign(n,r),n}),{})}));return(0,r.wB)(re,((e,n)=>{if(!Object.keys(e).length)return;!_(e,n)&&(D.validated?J():q())})),(0,r.xo)((()=>{var e;const n=null!==(e=(0,r.BA)(te.keepValueOnUnmount))&&void 0!==e?e:(0,r.BA)(k.keepValuesOnUnmount),t=(0,r.BA)(j);if(n||!k||T.pendingUnmount[te.id])return void(null==k||k.removePathState(t,I));
2T.pendingUnmount[te.id]=!0;const o=k.getPathState(t);if(Array.isArray(null==o?void 0:o.id)&&(null==o?void 0:o.multiple)?null==o?void 0:o.id.includes(te.id):(null==o?void 0:o.id)===te.id){if((null==o?void 0:o.multiple)&&Array.isArray(o.value)){const e=o.value.findIndex((e=>_(e,(0,r.BA)(te.checkedValue))));if(e>-1){const n=[...o.value];n.splice(e,1),k.setFieldValue(t,n)}Array.isArray(o.id)&&o.id.splice(o.id.indexOf(te.id),1)}else k.unsetPathValue((0,r.BA)(j));k.removePathState(t,I)}})),te}function ue(e,n){if(e)return e.props[n]}function ce(e,n){let t=e.as||"";return e.as||n.slots.default||(t="input"),t}function de(e,n){return x(n.attrs.type)?O(e,"modelValue")?e.modelValue:void 0:O(e,"modelValue")?e.modelValue:n.attrs.value}const fe=(0,r.pM)({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>Z().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:g},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(e,n){const t=(0,r.lW)(e,"rules"),a=(0,r.lW)(e,"name"),i=(0,r.lW)(e,"label"),l=(0,r.lW)(e,"uncheckedValue"),s=(0,r.lW)(e,"keepValue"),{errors:u,value:c,errorMessage:d,validate:f,handleChange:p,handleBlur:v,setTouched:m,resetField:h,handleReset:g,meta:y,checked:b,setErrors:A,setValue:C}=le(a,t,{validateOnMount:e.validateOnMount,bails:e.bails,standalone:e.standalone,type:n.attrs.type,initialValue:de(e,n),checkedValue:n.attrs.value,uncheckedValue:l,label:i,validateOnValueUpdate:e.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(e,n=!0){p(e,n)},B=(0,r.EW)((()=>{const{validateOnInput:t,validateOnChange:r,validateOnBlur:a,validateOnModelUpdate:i}=function(e){var n,t,r,o;const{validateOnInput:a,validateOnChange:i,validateOnBlur:l,validateOnModelUpdate:s}=Z();return{validateOnInput:null!==(n=e.validateOnInput)&&void 0!==n?n:a,validateOnChange:null!==(t=e.validateOnChange)&&void 0!==t?t:i,validateOnBlur:null!==(r=e.validateOnBlur)&&void 0!==r?r:l,validateOnModelUpdate:null!==(o=e.validateOnModelUpdate)&&void 0!==o?o:s}}(e);const l={name:e.name,onBlur:function(e){v(e,a),o(n.attrs.onBlur)&&n.attrs.onBlur(e)},onInput:function(e){w(e,t),o(n.attrs.onInput)&&n.attrs.onInput(e)},onChange:function(e){w(e,r),o(n.attrs.onChange)&&n.attrs.onChange(e)},"onUpdate:modelValue":e=>w(e,i)};return l})),k=(0,r.EW)((()=>{const t=Object.assign({},B.value);x(n.attrs.type)&&b&&(t.checked=b.value);return E(ce(e,n),n.attrs)&&(t.value=c.value),t})),j=(0,r.EW)((()=>Object.assign(Object.assign({},B.value),{modelValue:c.value})));function O(){return{field:k.value,componentField:j.value,value:c.value,meta:y,errors:u.value,errorMessage:d.value,validate:f,resetField:h,handleChange:w,handleInput:e=>w(e,!1),handleReset:g,handleBlur:B.value.onBlur,setTouched:m,setErrors:A,setValue:C}}return n.expose({value:c,meta:y,errors:u,errorMessage:d,setErrors:A,setTouched:m,setValue:C,reset:h,validate:f,handleChange:p}),()=>{const t=(0,r.$y)(ce(e,n)),o=J(t,n,O);return t?(0,r.h)(t,Object.assign(Object.assign({},n.attrs),k.value),o):o}}});let pe=0;const ve=["bails","fieldsCount","id","multiple","type","validate"];function me(e){const n=(null==e?void 0:e.initialValues)||{},t=Object.assign({},(0,r.BA)(n)),a=(0,r.R1)(null==e?void 0:e.validationSchema);return a&&A(a)&&o(a.cast)?p(a.cast(t)||{}):p(t)}function he(e){var n;const t=pe++,a=(null==e?void 0:e.name)||"Form";let i=0;const l=(0,r.KR)(!1),s=(0,r.KR)(!1),d=(0,r.KR)(0),f=[],h=(0,r.Kh)(me(e)),g=(0,r.KR)([]),y=(0,r.KR)({}),b=(0,r.KR)({}),x=function(e){let n=null,t=[];return function(...o){const a=(0,r.dY)((()=>{if(n!==a)return;const r=e(...o);t.forEach((e=>e(r))),t=[],n=null}));return n=a,new Promise((e=>t.push(e)))}}((()=>{b.value=g.value.reduce(((e,n)=>(e[c((0,r.BA)(n.path))]=n,e)),{})}));function w(e,n){const t=ee(e);
2if(t){if("string"==typeof e){const n=c(e);y.value[n]&&delete y.value[n]}t.errors=G(n),t.valid=!t.errors.length}else"string"==typeof e&&(y.value[c(e)]=G(n))}function B(e){M(e).forEach((n=>{w(n,e[n])}))}(null==e?void 0:e.initialErrors)&&B(e.initialErrors);const E=(0,r.EW)((()=>{const e=g.value.reduce(((e,n)=>(n.errors.length&&(e[(0,r.BA)(n.path)]=n.errors),e)),{});return Object.assign(Object.assign({},y.value),e)})),j=(0,r.EW)((()=>M(E.value).reduce(((e,n)=>{const t=E.value[n];return(null==t?void 0:t.length)&&(e[n]=t[0]),e}),{}))),O=(0,r.EW)((()=>g.value.reduce(((e,n)=>(e[(0,r.BA)(n.path)]={name:(0,r.BA)(n.path)||"",label:n.label||""},e)),{}))),L=(0,r.EW)((()=>g.value.reduce(((e,n)=>{var t;return e[(0,r.BA)(n.path)]=null===(t=n.bails)||void 0===t||t,e}),{}))),I=Object.assign({},(null==e?void 0:e.initialErrors)||{}),V=null!==(n=null==e?void 0:e.keepValuesOnUnmount)&&void 0!==n&&n,{initialValues:D,originalInitialValues:N,setInitialValues:P}=function(e,n,t){const o=me(t),a=(0,r.KR)(o),i=(0,r.KR)(p(o));function l(t,o){(null==o?void 0:o.force)?(a.value=p(t),i.value=p(t)):(a.value=u(p(a.value)||{},p(t)),i.value=u(p(i.value)||{},p(t))),(null==o?void 0:o.updateFields)&&e.value.forEach((e=>{if(e.touched)return;const t=S(a.value,(0,r.BA)(e.path));R(n,(0,r.BA)(e.path),p(t))}))}return{initialValues:a,originalInitialValues:i,setInitialValues:l}}(g,h,e),z=function(e,n,t,o){const a={touched:"some",pending:"some",valid:"every"},i=(0,r.EW)((()=>!_(n,(0,r.R1)(t))));function l(){const n=e.value;return M(a).reduce(((e,t)=>{const r=a[t];return e[t]=n[r]((e=>e[t])),e}),{})}const s=(0,r.Kh)(l());return(0,r.nT)((()=>{const e=l();s.touched=e.touched,s.valid=e.valid,s.pending=e.pending})),(0,r.EW)((()=>Object.assign(Object.assign({initialValues:(0,r.R1)(t)},s),{valid:s.valid&&!M(o.value).length,dirty:i.value})))}(g,h,N,j),J=(0,r.EW)((()=>g.value.reduce(((e,n)=>{const t=S(h,(0,r.BA)(n.path));return R(e,(0,r.BA)(n.path),t),e}),{}))),q=null==e?void 0:e.validationSchema;function Y(e,n){var t,o;const a=(0,r.EW)((()=>S(D.value,(0,r.BA)(e)))),l=b.value[(0,r.BA)(e)],s="checkbox"===(null==n?void 0:n.type)||"radio"===(null==n?void 0:n.type);if(l&&s){l.multiple=!0;const e=i++;return Array.isArray(l.id)?l.id.push(e):l.id=[l.id,e],l.fieldsCount++,l.__flags.pendingUnmount[e]=!1,l}const u=(0,r.EW)((()=>S(h,(0,r.BA)(e)))),c=(0,r.BA)(e),d=re.findIndex((e=>e===c));-1!==d&&re.splice(d,1);const f=(0,r.EW)((()=>{var t,o,a,i;const l=(0,r.BA)(q);if(A(l))return null!==(o=null===(t=l.describe)||void 0===t?void 0:t.call(l,(0,r.BA)(e)).required)&&void 0!==o&&o;const s=(0,r.BA)(null==n?void 0:n.schema);return!!A(s)&&(null!==(i=null===(a=s.describe)||void 0===a?void 0:a.call(s).required)&&void 0!==i&&i)})),v=i++,m=(0,r.Kh)({id:v,path:e,touched:!1,pending:!1,valid:!0,validated:!!(null===(t=I[c])||void 0===t?void 0:t.length),required:f,initialValue:a,errors:(0,r.IJ)([]),bails:null!==(o=null==n?void 0:n.bails)&&void 0!==o&&o,label:null==n?void 0:n.label,type:(null==n?void 0:n.type)||"default",value:u,multiple:!1,__flags:{pendingUnmount:{[v]:!1},pendingReset:!1},fieldsCount:1,validate:null==n?void 0:n.validate,dirty:(0,r.EW)((()=>!_((0,r.R1)(u),(0,r.R1)(a))))});return g.value.push(m),b.value[c]=m,x(),j.value[c]&&!I[c]&&(0,r.dY)((()=>{be(c,{mode:"silent"})})),(0,r.i9)(e)&&(0,r.wB)(e,(e=>{x();const n=p(u.value);b.value[e]=m,(0,r.dY)((()=>{R(h,e,n)}))})),m}const Q=T(xe,5),X=T(xe,5),$=U((async e=>await("silent"===e?Q():X())),((e,[n])=>{const t=M(le.errorBag.value),o=[...new Set([...M(e.results),...g.value.map((e=>e.path)),...t])].sort().reduce(((t,o)=>{var a;const i=o,l=ee(i)||function(e){const n=g.value.filter((n=>e.startsWith((0,r.BA)(n.path))));return n.reduce(((e,n)=>e?n.path.length>e.path.length?n:e:n),void 0)}(i),s=(null===(a=e.results[i])||void 0===a?void 0:a.errors)||[],u=(0,r.BA)(null==l?void 0:l.path)||i,c=function(e,n){if(!n)return e;return{valid:e.valid&&n.valid,errors:[...e.errors,...n.errors]}}({errors:s,valid:!s.length},t.results[u]);return t.results[u]=c,c.valid||(t.errors[u]=c.errors[0]),l&&y.value[u]&&delete y.value[u],l?(l.valid=c.valid,"silent"===n?t:"validated-only"!==n||l.validated?(w(l,c.errors),t):t):(w(u,s
2),t)}),{valid:e.valid,results:{},errors:{},source:e.source});return e.values&&(o.values=e.values,o.source=e.source),M(o.results).forEach((e=>{var t;const r=ee(e);r&&"silent"!==n&&("validated-only"!==n||r.validated)&&w(r,null===(t=o.results[e])||void 0===t?void 0:t.errors)})),o}));function H(e){g.value.forEach(e)}function ee(e){const n="string"==typeof e?c(e):e;return"string"==typeof n?b.value[n]:n}let te,re=[];function ae(e){return function(n,t){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),H((e=>e.touched=!0)),l.value=!0,d.value++,ye().then((o=>{const a=p(h);if(o.valid&&"function"==typeof n){const t=p(J.value);let i=e?t:a;return o.values&&(i="schema"===o.source?o.values:Object.assign({},i,o.values)),n(i,{evt:r,controlledValues:t,setErrors:B,setFieldError:w,setTouched:fe,setFieldTouched:de,setValues:ue,setFieldValue:se,resetForm:ge,resetField:he})}o.valid||"function"!=typeof t||t({values:a,evt:r,errors:o.errors,results:o.results})})).then((e=>(l.value=!1,e)),(e=>{throw l.value=!1,e}))}}}const ie=ae(!1);ie.withControlled=ae(!0);const le={name:a,formId:t,values:h,controlledValues:J,errorBag:E,errors:j,schema:q,submitCount:d,meta:z,isSubmitting:l,isValidating:s,fieldArrays:f,keepValuesOnUnmount:V,validateSchema:(0,r.R1)(q)?$:void 0,validate:ye,setFieldError:w,validateField:be,setFieldValue:se,setValues:ue,setErrors:B,setFieldTouched:de,setTouched:fe,resetForm:ge,resetField:he,handleSubmit:ie,useFieldModel:function(e){if(!Array.isArray(e))return ce(e);return e.map((e=>ce(e,!0)))},defineInputBinds:function(e,n){const[t,o]=Be(e,n);function a(){o.value.onBlur()}function i(n){const t=K(n);se((0,r.BA)(e),t,!1),o.value.onInput()}function l(n){const t=K(n);se((0,r.BA)(e),t,!1),o.value.onChange()}return(0,r.EW)((()=>Object.assign(Object.assign({},o.value),{onBlur:a,onInput:i,onChange:l,value:t.value})))},defineComponentBinds:function(e,n){const[t,a]=Be(e,n),i=ee((0,r.BA)(e));function l(e){t.value=e}return(0,r.EW)((()=>{const e=o(n)?n(W(i,ve)):n||{};return Object.assign({[e.model||"modelValue"]:t.value,[`onUpdate:${e.model||"modelValue"}`]:l},a.value)}))},defineField:Be,stageInitialValue:function(n,t,r=!1){Ce(n,t),R(h,n,t),r&&!(null==e?void 0:e.initialValues)&&R(N.value,n,p(t))},unsetInitialValue:Ae,setFieldInitialValue:Ce,createPathState:Y,getPathState:ee,unsetPathValue:function(e){return re.push(e),te||(te=(0,r.dY)((()=>{[...re].sort().reverse().forEach((e=>{F(h,e)})),re=[],te=null}))),te},removePathState:function(e,n){const t=g.value.findIndex((t=>t.path===e&&(Array.isArray(t.id)?t.id.includes(n):t.id===n))),o=g.value[t];if(-1!==t&&o){if((0,r.dY)((()=>{be(e,{mode:"silent",warn:!1})})),o.multiple&&o.fieldsCount&&o.fieldsCount--,Array.isArray(o.id)){const e=o.id.indexOf(n);e>=0&&o.id.splice(e,1),delete o.__flags.pendingUnmount[n]}(!o.multiple||o.fieldsCount<=0)&&(g.value.splice(t,1),Ae(e),x(),delete b.value[e])}},initialValues:D,getAllPathStates:()=>g.value,destroyPath:function(e){M(b.value).forEach((n=>{n.startsWith(e)&&delete b.value[n]})),g.value=g.value.filter((n=>!n.path.startsWith(e))),(0,r.dY)((()=>{x()}))},isFieldTouched:function(e){const n=ee(e);if(n)return n.touched;return g.value.filter((n=>n.path.startsWith(e))).some((e=>e.touched))},isFieldDirty:function(e){const n=ee(e);if(n)return n.dirty;return g.value.filter((n=>n.path.startsWith(e))).some((e=>e.dirty))},isFieldValid:function(e){const n=ee(e);if(n)return n.valid;return g.value.filter((n=>n.path.startsWith(e))).every((e=>e.valid))}};function se(e,n,t=!0){const r=p(n),o="string"==typeof e?e:e.path;ee(o)||Y(o),R(h,o,r),t&&be(o)}function ue(e,n=!0){u(h,e),f.forEach((e=>e&&e.reset())),n&&ye()}function ce(e,n){const t=ee((0,r.BA)(e))||Y(e);return(0,r.EW)({get:()=>t.value,set(t){var o;se((0,r.BA)(e),t,null!==(o=(0,r.BA)(n))&&void 0!==o&&o)}})}function de(e,n){const t=ee(e);t&&(t.touched=n)}function fe(e){"boolean"!=typeof e?M(e).forEach((n=>{de(n,!!e[n])})):H((n=>{n.touched=e}))}function he(e,n){var t;const o=n&&"value"in n?n.value:S(D.value,e),a=ee(e);a&&(a.__flags.pendingReset=!0),Ce(e,p(o),!0),se(e,o,!1),de(e,null!==(t=null==n?void 0:n.touched)&&void 0!==t&&t),w(e,(null==n?void 0:n.errors)||[]),(0,r.dY)((()=>{a&&(a.__flags.pendingReset=!1)}))}function ge(e,n){let t=p((null==e?void 0:e.values)?e.values:N.value);t=(null==n?void 0:n.force)?t:u(N.value,t),t=A(q)&&o(q.cast)?q.cast(t):t,P(t,{force:null==n?void 0:n.force}),H((n=>{var o;n.__flags.pendingReset=!0,n.validated=!1,n.touched=(null===(o=null==e?void 0:e.touched)||void 0===o?void 0:o[(0,r.BA)(n.path)])||!1,se((0,r.BA)(n.path),S(t,(0,r.BA)(n.path)),!1),w((0,r.BA)(n.path),void 0)}
2)),(null==n?void 0:n.force)?function(e,n=!0){M(h).forEach((e=>{delete h[e]})),M(e).forEach((n=>{se(n,e[n],!1)})),n&&ye()}(t,!1):ue(t,!1),B((null==e?void 0:e.errors)||{}),d.value=(null==e?void 0:e.submitCount)||0,(0,r.dY)((()=>{ye({mode:"silent"}),H((e=>{e.__flags.pendingReset=!1}))}))}async function ye(e){const n=(null==e?void 0:e.mode)||"force";if("force"===n&&H((e=>e.validated=!0)),le.validateSchema)return le.validateSchema(n);s.value=!0;const t=await Promise.all(g.value.map((n=>n.validate?n.validate(e).then((e=>({key:(0,r.BA)(n.path),valid:e.valid,errors:e.errors,value:e.value}))):Promise.resolve({key:(0,r.BA)(n.path),valid:!0,errors:[],value:void 0}))));s.value=!1;const o={},a={},i={};for(const e of t)o[e.key]={valid:e.valid,errors:e.errors},e.value&&R(i,e.key,e.value),e.errors.length&&(a[e.key]=e.errors[0]);return{valid:t.every((e=>e.valid)),results:o,errors:a,values:i,source:"fields"}}async function be(e,n){var t;const r=ee(e);if(r&&"silent"!==(null==n?void 0:n.mode)&&(r.validated=!0),q){const{results:t}=await $((null==n?void 0:n.mode)||"validated-only");return t[e]||{errors:[],valid:!0}}if(null==r?void 0:r.validate)return r.validate(n);!r&&(t=null==n?void 0:n.warn);return Promise.resolve({errors:[],valid:!0})}function Ae(e){F(D.value,e)}function Ce(e,n,t=!1){R(D.value,e,p(n)),t&&R(N.value,e,p(n))}async function xe(){const e=(0,r.R1)(q);if(!e)return{valid:!0,results:{},errors:{},source:"none"};s.value=!0;const n=C(e)||A(e)?await async function(e,n){const t=A(e)?e:ne(e),r=await t.parse(p(n),{formData:p(n)}),o={},a={};for(const e of r.errors){const n=e.errors,t=(e.path||"").replace(/\["(\d+)"\]/g,((e,n
2)=>`[${n}]`));o[t]={valid:!n.length,errors:n},n.length&&(a[t]=n[0])}return{valid:!r.errors.length,results:o,errors:a,values:r.value,source:"schema"}}(e,h):await oe(e,h,{names:O.value,bailsMap:L.value});return s.value=!1,n}const we=ie(((e,{evt:n})=>{k(n)&&n.target.submit()}));function Be(e,n){const t=o(n)||null==n?void 0:n.label,a=ee((0,r.BA)(e))||Y(e,{label:t}),i=()=>o(n)?n(W(a,ve)):n||{};function l(){var e;a.touched=!0;(null!==(e=i().validateOnBlur)&&void 0!==e?e:Z().validateOnBlur)&&be((0,r.BA)(a.path))}function s(){var e;(null!==(e=i().validateOnInput)&&void 0!==e?e:Z().validateOnInput)&&(0,r.dY)((()=>{be((0,r.BA)(a.path))}))}function u(){var e;(null!==(e=i().validateOnChange)&&void 0!==e?e:Z().validateOnChange)&&(0,r.dY)((()=>{be((0,r.BA)(a.path))}))}const c=(0,r.EW)((()=>{const e={onChange:u,onInput:s,onBlur:l};return o(n)?Object.assign(Object.assign({},e),n(W(a,ve)).props||{}):(null==n?void 0:n.props)?Object.assign(Object.assign({},e),n.props(W(a,ve))):e})),d=ce(e,(()=>{var e,n,t;return null===(t=null!==(e=i().validateOnModelUpdate)&&void 0!==e?e:null===(n=Z())||void 0===n?void 0:n.validateOnModelUpdate)||void 0===t||t}));return[d,c]}(0,r.sV)((()=>{(null==e?void 0:e.initialErrors)&&B(e.initialErrors),(null==e?void 0:e.initialTouched)&&fe(e.initialTouched),(null==e?void 0:e.validateOnMount)?ye():le.validateSchema&&le.validateSchema("silent")})),(0,r.i9)(q)&&(0,r.wB)(q,(()=>{var e;null===(e=le.validateSchema)||void 0===e||e.call(le,"validated-only")})),(0,r.Gt)(v,le);const Ee=Object.assign(Object.assign({},le),{values:(0,r.tB)(h),handleReset:()=>ge(),submitForm:we});return(0,r.Gt)(m,Ee),Ee}Boolean,Boolean}}]);
3//# sourceMappingURL=6072.js.map

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.