1function cell(e,r){return void 0===e[r]||null===e[r]?"":String(e[r]).trim()}function normalizeHeaderCell(e){return String(null==e?"":e).replace(/^\ufeff/,"").replace(/^"|"$/g,"").trim().toLowerCase()}export const A_CSV_COLUMNS={name:0,assessment_basis:1,report_with_edv:2,report_without_edv:3,damage_report_forecast:4};export const A_CSV_COLUMN_COUNT=7;export function headerCells(e){return(null==e?"":String(e)).replace(/\r$/,"").split(";").map(normalizeHeaderCell)}export function detectCsvFormat(e,r){if(!Array.isArray(r)||0===r.length)return null;const t=headerCells(e);for(const e of r){const r=headerCells(e.header).slice(0,5);if(5!==r.length)continue;if(r.every((e,r)=>""!==e&&t[r]===e))return{locale:e.locale,separator:e.separator,delimiter:e.delimiter}}return null}export function parseLocaleNumber(e,r,t){const n=null==e?"":String(e).trim();if(""===n)return 0;const o=n.split(t).join("").split(r).join(".");if(!/^-?\d+(\.\d+)?$/.test(o))return null;const l=Number.parseFloat(o);return Number.isNaN(l)?null:l}export function toCents(e,r,t){const n=parseLocaleNumber(e,r,t);return null===n?null:Math.round(100*n)}export function rowToCsFeeTablePayload(e,r){const{separator:t,delimiter:n}=r;if(!Array.isArray(e)||e.length!==A_CSV_COLUMN_COUNT){const r=Array.isArray(e)?e.length:0;return{payload:null,error:`expected ${A_CSV_COLUMN_COUNT} columns in the export format, found ${r}`}}const o=cell(e,A_CSV_COLUMNS.name);if(""===o)return{payload:null,error:"name is missing"};const l=cell(e,A_CSV_COLUMNS.assessment_basis);if(""===l)return{payload:null,error:"assessment_basis is missing"};const s=toCents(l,t,n);if(null===s)return{payload:null,error:`assessment_basis '${l}' is not a number`};if(s<=0)return{payload:null,error:`assessment_basis '${l}' must be greater than 0`};const a={name:o,assessment_basis:s},i=["report_with_edv","report_without_edv","damage_report_forecast"];for(const r of i){const o=cell(e,A_CSV_COLUMNS[r]);if(""===o)continue;const l=toCents(o,t,n);if(null===l)return{payload:null,error:`${r} '${o}' is not a number`};if(l<0)return{payload:null,error:`${r} '${o}' must not be negative`};a[r]=l}return{payload:a,error:null}}
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.