2024-06-18

This commit is contained in:
Juan Pablo Vial
2024-06-18 22:41:03 -04:00
parent 6169089475
commit 390e79ad6d
60 changed files with 3162 additions and 155 deletions

View File

@ -2,6 +2,11 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.3/semantic.min.js" integrity="sha512-gnoBksrDbaMnlE0rhhkcx3iwzvgBGz6mOEj4/Y5ZY09n55dYddx6+WYc72A55qEesV8VX2iMomteIwobeGK1BQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">
class APIClient {
static fetch(url, options=null) {
return fetchAPI(url, options)
}
}
function fetchAPI(url, options=null) {
if (options === null) {
options = {}

View File

@ -0,0 +1,26 @@
@push('page_scripts')
<script>
class Rut {
static digitoVerificador(rut) {
if (rut.length === 0) {
return ''
}
let M = 0, S = 1
for (; rut; rut = Math.floor(rut / 10)) {
S = (S + rut % 10 * (9 - M++ % 6)) % 11
}
return S ? S - 1 : 'K'
}
static format(rut) {
if (rut.length === 0) {
return ''
}
rut.replace(/\./g, '')
return rut.replace(/^(\d{1,2})(\d{3})(\d{3})$/, '$1.$2.$3')
}
static validar(rut, digito) {
return Rut.digitoVerificador(rut) === digito
}
}
</script>
@endpush