1import{s as t,I as n}from"./core-base-C6U1gwfh.js";import"./vendor-core-PeJPZ6eL.js";import"./vendor-firebase-BoNTAgzP.js";function e(n){var e;const a=+n||0;return"nearest"===(null==(e=t.settings)?void 0:e.rounding)?Math.round(100*a)/100:Math.floor(100*a)/100}function a(){var n;(n=t).metadata||(n.metadata={}),t.metadata.bagManual=!0,delete t.metadata.autoRemainderContactId}function o(){var n;const e=new Set;for(const d in t.splits){const n=t.splits[d];let a=0;for(const t in n)a+=n[t];if(0!==a)for(const t in n)n[t]>0&&e.add(t)}const a=(null==(n=t.metadata)?void 0:n.paidByTotals)||{};Object.keys(a).forEach(t=>{a[t]>0&&e.add(t)});const o=window.bagDraft||t.roundingBag||{};Object.keys(o).forEach(t=>{Math.abs(Number(o[t])||0)>1e-4&&e.add(t)});const i=[...e];return i.sort((n,e)=>{let o=0,i=0;for(let a in t.splits)t.splits[a][n]&&(o+=t.splits[a][n]),t.splits[a][e]&&(i+=t.splits[a][e]);const d=a[n]>0,s=a[e]>0,l=0===o&&d,r=0===i&&s;return l&&!r?-1:!l&&r?1:0}),i}function i(){var n,a,o,i;const d=(null==(n=t.metadata)?void 0:n.paidByTotals)||{},s=Object.values(d).reduce((t,n)=>t+Math.round(100*(Number(n)||0)),0),l=s>0?s:(t.receipt||[]).reduce((t,n)=>t+Math.round(100*(Number(n.price)||0)),0);let r=0;const c=t.receipt||[];for(let e=0;e<c.length;e++){const n=(null==(a=t.splits)?void 0:a[e])||{},d=(null==(o=t.fixedSplits)?void 0:o[e])||{},s=Number(null==(i=c[e])?void 0:i.price)||0;for(const t in n)if(void 0!==d[t])r+=Math.round(100*d[t]);else{const e=n[t]||0;if(e>0){const t="function"==typeof window.splitDisplayAmount?window.splitDisplayAmount(s,e):Math.round(s*e)/100;r+=Math.round(100*t)}}}return(window.round2||e)((l-r)/100)}function d(){const n=i(),e=o();let a=0;const d=window.bagDraft||t.roundingBag||{};return e.forEach(t=>a+=Math.round(100*(d[t]||0))),Math.round(100*n)-a}function s(){document.querySelectorAll(".sc-split-assignment-row[data-bag-id]").forEach(t=>{const n=t.dataset.bagId,e=window.bagSelectedIds.has(n);t.classList.toggle("sc-split-assignment-row--selected",e),t.setAttribute("aria-pressed",e?"true":"false");const a=t.querySelector(".sc-split-assignment-select-indicator");a&&"function"==typeof window.getSplitAssignmentSelectIndicatorHtml&&(a.outerHTML=window.getSplitAssignmentSelectIndicatorHtml(e,!1))})}function l(t){t&&(window.bagSelectedIds.has(t)?window.bagSelectedIds.delete(t):window.bagSelectedIds.add(t),s(),updateBagUI())}window.bagSelectedIds=window.bagSelectedIds||new Set,window.toggleBagSelectAll=function(){const t=Array.from(document.querySelectorAll(".sc-split-assignment-row[data-bag-id]"));if(!t.length)return;t.every(t=>window.bagSelectedIds.has(t.dataset.bagId))?window.bagSelectedIds.clear():t.forEach(t=>window.bagSelectedIds.add(t.dataset.bagId)),s(),updateBagUI()},window.handleBagInput=function(n,e){var o,i;a(),(o=t).metadata||(o.metadata={}),(i=t.metadata).bagManualFlags||(i.bagManualFlags={}),t.metadata.bagManualFlags[e]=!0;const d=window.ASSIGNMENT_AMOUNT_MAX||99999.99,s="function"==typeof window.sanitizeAssignmentAmountInputValue?window.sanitizeAssignmentAmountInputValue(n.value,{allowNegative:!0}):n.value;s!==n.value&&(n.value=s),window.bagDraft[e]="function"==typeof window.parseAssignmentAmountInput?window.parseAssignmentAmountInput(n.value,{min:-d}):+n.value||0,updateBagUI()},window.handleBagBlur=function(n,o){var i,d;a(),(i=t).metadata||(i.metadata={}),(d=t.metadata).bagManualFlags||(d.bagManualFlags={}),t.metadata.bagManualFlags[o]=!0;const s=window.ASSIGNMENT_AMOUNT_MAX||99999.99,l="function"==typeof window.parseAssignmentAmountInput?window.parseAssignmentAmountInput(n.value,{min:-s}):(window.round2||e)(+n.value);window.bagDraft[o]=l,n.value="function"==typeof window.formatAssignmentAmountEditValue?window.formatAssignmentAmountEditValue(l):l.toFixed(2),n.dataset.rawValue=String(l),"function"==typeof window.updateAssignmentAmountDisplay&&window.updateAssignmentAmountDisplay(n),updateBagUI()},window.fillBagGap=function(){a();const n=d();if(0===n)return;let e=[];
1if(window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(t=>e.push(t)):Array.isArray(window.bagSelectedIds)&&(e=[...window.bagSelectedIds])),0===e.length&&(e=o()),0===e.length)return;const i=Math.trunc(n/e.length);0!==i&&(e.forEach(n=>{var e,a;const o=Math.round(100*(window.bagDraft[n]||0));window.bagDraft[n]=(o+i)/100,(e=t).metadata||(e.metadata={}),(a=t.metadata).bagManualFlags||(a.bagManualFlags={}),t.metadata.bagManualFlags[n]=!0;const d=document.getElementById(`bag_input_${n}`);d&&(d.value="function"==typeof window.formatAssignmentAmountEditValue?window.formatAssignmentAmountEditValue(window.bagDraft[n]):window.bagDraft[n].toFixed(2),d.dataset.rawValue=String(window.bagDraft[n]),"function"==typeof window.updateAssignmentAmountDisplay&&window.updateAssignmentAmountDisplay(d))}),window.bagSelectedIds.clear(),s(),updateBagUI())},window.emptyBagUser=function(){a();let n=[];window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(t=>n.push(t)):Array.isArray(window.bagSelectedIds)&&(n=[...window.bagSelectedIds])),0===n.length&&(n=o()),n.forEach(n=>{var e,a;window.bagDraft[n]=0,(e=t).metadata||(e.metadata={}),(a=t.metadata).bagManualFlags||(a.bagManualFlags={}),t.metadata.bagManualFlags[n]=!0;const o=document.getElementById(`bag_input_${n}`);o&&(o.value="",o.dataset.rawValue="0","function"==typeof window.updateAssignmentAmountDisplay&&window.updateAssignmentAmountDisplay(o))}),s(),updateBagUI()},window.splitBagGapEvenly=function(){a();const n=d();if(0===n)return;let e=[];
1if(window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(t=>e.push(t)):Array.isArray(window.bagSelectedIds)&&(e=[...window.bagSelectedIds])),0===e.length&&(e=o()),0===e.length)return;e.forEach(n=>{var e;(null==(e=t.metadata)?void 0:e.bagManualFlags)&&delete t.metadata.bagManualFlags[n]});const i=Math.trunc(n/e.length);0!==i&&(e.forEach(t=>{const n=Math.round(100*(window.bagDraft[t]||0));window.bagDraft[t]=(n+i)/100;const e=document.getElementById(`bag_input_${t}`);e&&(e.value="function"==typeof window.formatAssignmentAmountEditValue?window.formatAssignmentAmountEditValue(window.bagDraft[t]):window.bagDraft[t].toFixed(2),e.dataset.rawValue=String(window.bagDraft[t]),"function"==typeof window.updateAssignmentAmountDisplay&&window.updateAssignmentAmountDisplay(e))}),window.bagSelectedIds.clear(),s(),updateBagUI())},window.updateBagUI=function(){const t=i(),n=o();let e=0;n.forEach(t=>e+=Math.round(100*(window.bagDraft[t]||0)));const a=Math.round(100*t)-e,d=document.getElementById("bagAllocated"),s=document.getElementById("bagDiff"),l=document.getElementById("bagRemainderAmount"),r=document.getElementById("bagConfirmBtn"),c=document.getElementById("bagFillBtn"),g=document.getElementById("bagEmptyBtn"),w=document.getElementById("bagSplitEvenlyBtn");if(d&&(d.innerHTML="function"==typeof window.money?window.money(e/100):`$${(e/100).toFixed(2)}`),l&&(l.textContent="function"==typeof window.money?window.money(Math.abs(t)):`$${Math.abs(t).toFixed(2)}`),s&&(s.innerHTML="function"==typeof window.money?window.money(a/100):`$${(a/100).toFixed(2)}`,s.style.color=0===a?"function"==typeof window.getThemeColor?window.getThemeColor("positive_dark"):"green":"function"==typeof window.getThemeColor?window.getThemeColor("negative_dark"):"red"),r&&(0===a?(r.style.opacity="1",r.style.cursor="pointer",r.disabled=!1,r.innerHTML='Save <svg class="nav-icon dash-icon-svg" style="width: 1em; height: 1em; vertical-align: middle; margin-bottom: 0px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>',r.style.cssText+="function"==typeof window.getGlassyTintedButtonStyle?window.getGlassyTintedButtonStyle(window.getThemeColor("positive")):"",r.style.color="var(--text-primary)"):(r.style.opacity="0.5",r.style.cursor="not-allowed",r.disabled=!0,r.innerHTML="Match Check Total",r.style.cssText+="function"==typeof window.getGlassyTintedButtonStyle?window.getGlassyTintedButtonStyle("var(--text-secondary)"):"")),c){let t=[];window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(n=>t.push(n)):Array.isArray(window.bagSelectedIds)&&(t=[...window.bagSelectedIds])),0===t.length&&(t=n);const e=t.length>0&&0!==a&&0!==Math.trunc(a/t.length);c.style.opacity=e?"1":"0.5",c.style.cursor=e?"pointer":"not-allowed",c.disabled=!e}if(g){let t=[];window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(n=>t.push(n)):Array.isArray(window.bagSelectedIds)&&(t=[...window.bagSelectedIds])),0===t.length&&(t=n);const e=t.some(t=>0!==(window.bagDraft[t]||0));g.style.opacity=e?"1":"0.5",g.style.cursor=e?"pointer":"not-allowed",g.disabled=!e}if(w){let t=[];window.bagSelectedIds&&("function"==typeof window.bagSelectedIds.forEach?window.bagSelectedIds.forEach(n=>t.push(n)):Array.isArray(window.bagSelectedIds)&&(t=[...window.bagSelectedIds])),0===t.length&&(t=n);t.length>0&&0!==a&&0!==Math.trunc(a/t.length)?(w.style.opacity="1",w.style.cursor="pointer",w.disabled=!1):(w.style.opacity="0.5",w.style.cursor="not-allowed",w.disabled=!0)}!function(){const t=document.getElementById("bagHeaderCard");if(!t)return;const n=Array.from(document.querySelectorAll(".sc-split-assignment-row[data-bag-id]")),e=n.length>0&&n.every(t=>window.bagSelectedIds.has(t.dataset.bagId)),a=t.querySelector(".sc-split-assignment-select-indicator");a&&"function"==typeof window.getSplitAssignmentSelectIndicatorHtml&&(a.outerHTML=window.getSplitAssignmentSelectIndicatorHtml(e,!0))}()},window.closeBag=async function(){var t,n;null==(t=window._bagModalViewportUnbind)||t.call(window),window._bagModalViewportUnbind=null,window.bagSelectedIds=new Set,delete window.bagDraft,null==(n=document.getElementById("bagOverlay"))||n.remove()},window.confirmBag=function(){var n;const d=i(),s=o();let l=0;
1s.forEach(t=>l+=Math.round(100*(window.bagDraft[t]||0)));Math.round(100*d)===l?(t.metadata.itemBag=[],s.forEach(n=>{t.roundingBag[n]=(window.round2||e)(window.bagDraft[n]||0)}),a(),null==(n=document.getElementById("bagOverlay"))||n.remove(),"function"==typeof window.render&&window.render(!0)):window.customAlert("Please distribute the exact difference to a contact before confirming.")},window.round2=e,window.roundDown=e,window.getRelevantIds=o,window.getNetPaidMinusOwed=i,window.getBagRemainingCents=d,window.getBagRemainingCentsInCents=function(){return(d()/100).toFixed(2)},window.openBag=function(){var e;const a=i(),d=document.getElementById("bagOverlay");d&&d.remove(),"function"==typeof window.updateRemainderDistribution&&window.updateRemainderDistribution();const s=o();t.roundingBag||(t.roundingBag={}),window.bagDraft=JSON.parse(JSON.stringify(t.roundingBag)),window.bagSelectedIds=new Set;const r=document.createElement("div");r.id="bagOverlay",r.className="modal-overlay",r.style.cssText=window.modalOverlayStyle||"";const c=window.getMemoizedContactsMap?window.getMemoizedContactsMap(t.contacts):(t.contacts||[]).reduce((t,n)=>(t[n.id]=n,t),{}),g="function"==typeof window.getSplitAssignmentSelectIndicatorHtml?window.getSplitAssignmentSelectIndicatorHtml(!1):"";let w=s.map(t=>{const e=c[t]||("function"==typeof window.getSafeContact?window.getSafeContact(t):null),a=window.bagDraft[t]||0,o="function"==typeof window.getSplitAssignmentRowStyle?window.getSplitAssignmentRowStyle(null==e?void 0:e.color):"background: var(--card-bg);";return`\n <div class="sc-split-assignment-row" data-bag-id="${n(t)}" role="button" tabindex="0" aria-pressed="false" style="${o}">\n ${g}\n <div class="sc-split-assignment-row-name">\n <span style="font-weight:700; font-size:15px; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">${n((null==e?void 0:e.first)||"User")}</span>\n </div>\n <div class="sc-split-assignment-row-actions">\n <div class="sc-currency-field sc-currency-field--assignment" style="${"function"==typeof window.assignmentAmountTintStyle?window.assignmentAmountTintStyle(null==e?void 0:e.color):""}">\n ${window.assignmentAmountInputHtml(`bag_input_${n(t)}`,t,a,"bag-amount-input",`Remainder for ${n((null==e?void 0:e.first)||"contact")}`,null==e?void 0:e.color)}\n </div>\n </div>\n </div>\n `}).join("");const u="function"==typeof window.getSplitAssignmentHighlightStyle?window.getSplitAssignmentHighlightStyle("function"==typeof window.getThemeColor?window.getThemeColor("info"):"var(--accent-color)"):"";r.innerHTML=`\n <div class="sc-split-assignment-panel" role="dialog" aria-modal="true" aria-labelledby="bagModalTitle">\n <button aria-label="Close" type="button" style="${window.baseBtn} ${void 0!==window.modalCloseBtnStyle?window.modalCloseBtnStyle:"position:absolute; top:16px; right:16px;"}">${window.closeIconHtml()}</button>\n <h2 id="bagModalTitle" style="margin:0 0 4px 0; text-transform:uppercase; letter-spacing:-0.5px;">Assign Remainder</h2>\n <p style="margin:0 0 20px 0; font-size:15px; color:var(--text-secondary); font-weight:bold;">Assign the rest of the bill.</p>\n\n <div class="sc-split-assignment-highlight sc-split-assignment-highlight--clickable" id="bagHeaderCard" style="${u} cursor:pointer; display:flex; align-items:center; gap:12px;">\n ${"function"==typeof window.getSplitAssignmentSelectIndicatorHtml?window.getSplitAssignmentSelectIndicatorHtml(!1,!0):""}\n <div style="flex:1; display:flex; justify-content:space-between; align-items:center;">\n <span style="font-weight:bold; font-size:16px;">Remainder:</span>\n <strong id="bagRemainderAmount" style="font-size:20px;">${window.money(Math.abs(a))}</strong>\n </div>\n </div>\n\n <div class="sc-split-assignment-scroll">\n ${w}\n </div>\n\n <div style="margin-top:12px; display:flex; justify-content:flex-end; gap:8px;">\n <button type="button" id="bagFillBtn" style="${window.baseBtn} ${window.getGlassyTintedButtonStyle(window.getThemeColor("teal"))} padding:6px 12px; font-size:14px;">\n <svg class="nav-icon dash-icon-svg" style="width: 1em; height: 1em; vertical-align: middle; margin-bottom: 0px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 21h10l2-14H5l2 14z"></path><path d="M15 7V5a3 3 0 0 0-6 0v2"></path></svg> Fill\n </button>\n <button type="button" id="bagEmptyBtn" style="${window.baseBtn} ${window.getGlassyTintedButtonStyle(window.getThemeColor("negative"))} padding:6px 12px; font-size:14px;">\n <svg class="nav-icon dash-icon-svg" style="width: 1em; height: 1em; vertical-align: middle; margin-bottom: 0px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg> Clear\n </button>\n <button type="button" id="bagSplitEvenlyBtn" style="${window.baseBtn} ${window.getGlassyTintedButtonStyle(window.getThemeColor("info"))} padding:6px 12px; font-size:14px;">\n <svg class="nav-icon dash-icon-svg" style="width: 1em; height: 1em; vertical-align: middle; margin-bottom: 0px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="2" x2="12" y2="22"></line><line x1="2" y1="12" x2="22" y2="12"></line><circle cx="6" cy="12" r="4"></circle><circle cx="18" cy="12" r="4"></circle></svg> Split Evenly\n </button>\n </div>\n\n <div style="margin-top:12px; padding-top:16px; border-top:2px dashed var(--border-color);">\n <div style="display:flex; justify-content:space-between; font-size:15px; margin-bottom:4px;">
1\n <span>Allocated:</span>\n <span id="bagAllocated" style="font-weight:bold;">$0.00</span>\n </div>\n <div style="display:flex; justify-content:space-between; font-size:17px; font-weight:900;">\n <span>Difference:</span>\n <span id="bagDiff" style="color:red;">$0.00</span>\n </div>\n </div>\n\n <div style="display:flex; gap:12px; margin-top:24px;">\n <button type="button" id="bagConfirmBtn" style="${window.baseBtn} ${window.getGlassyTintedButtonStyle(window.getThemeColor("accent"))} flex:1; color: var(--text-primary); font-weight: 900; display: flex; align-items: center; justify-content: center;">Save <svg class="nav-icon dash-icon-svg" style="width: 1em; height: 1em; vertical-align: middle; margin-bottom: 0px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></button>\n </div>\n </div>\n `,(window.getModalHost?window.getModalHost():document.body).appendChild(r);const m=r.querySelector(".sc-split-assignment-panel");m&&"function"==typeof window.bindModalViewportFit?(null==(e=window._bagModalViewportUnbind)||e.call(window),window._bagModalViewportUnbind=window.bindModalViewportFit(r,m)):m&&"function"==typeof window.fitModalContainerToViewport&&window.fitModalContainerToViewport(m),function(){const t=document.getElementById("bagOverlay");if(!t||"1"===t.dataset.scBagBound)return;t.dataset.scBagBound="1";const n=t.querySelector("[aria-label='Close']");n&&n.addEventListener("click",()=>window.closeBag()),t.addEventListener("click",t=>{if(t.target.closest(".bag-amount-input, .sc-assignment-amount-wrap, .sc-currency-field--assignment"))return;const n=t.target.closest(".sc-split-assignment-row[data-bag-id]");n&&l(n.dataset.bagId)}),t.addEventListener("keydown",t=>{if("Enter"!==t.key&&" "!==t.key)return;const n=t.target.closest(".sc-split-assignment-row[data-bag-id]");n&&!t.target.closest(".bag-amount-input, .sc-assignment-amount-wrap, .sc-currency-field--assignment, button")&&(t.preventDefault(),l(n.dataset.bagId))}),document.querySelectorAll(".bag-amount-input").forEach(t=>{const n=t.dataset.id;t.addEventListener("input",()=>window.handleBagInput(t,n)),t.addEventListener("blur",()=>window.handleBagBlur(t,n))}),"function"==typeof window.bindAssignmentAmountFields&&window.bindAssignmentAmountFields(t);const e=document.getElementById("bagHeaderCard");e&&e.addEventListener("click",window.toggleBagSelectAll);const a=document.getElementById("bagFillBtn");a&&a.addEventListener("click",()=>window.fillBagGap());const o=document.getElementById("bagEmptyBtn");o&&o.addEventListener("click",()=>window.emptyBagUser());const i=document.getElementById("bagSplitEvenlyBtn");i&&i.addEventListener("click",()=>window.splitBagGapEvenly());const d=document.getElementById("bagConfirmBtn");d&&d.addEventListener("click",()=>window.confirmBag())}(),updateBagUI()},window.updateBagUI=window.updateBagUI,window.ensureBagManualWhenRoundingPresent=function(){var n;(n=t).metadata||(n.metadata={}),Object.values(t.roundingBag||{}).some(t=>Math.abs(Number(t)||0)>1e-4)&&(t.metadata.bagManual=!0)},window.confirmBag=window.confirmBag,window.money=function(t){return(t<0?"-":"")+"$"+Math.abs(t).toFixed(2)},window.closeBag=window.closeBag,window.updateRemainderDistribution=function(){var n,a,d,s,l,r;const c=i(),g=o();if((n=t).roundingBag||(n.roundingBag={}),(a=t).metadata||(a.metadata={}),(d=t.metadata).bagManualFlags||(d.bagManualFlags={}),Object.keys(t.roundingBag).forEach(n=>{g.includes(n)||delete t.roundingBag[n]}),Math.abs(c)<.005)return void g.forEach(n=>{t.metadata.bagManualFlags[n]||delete t.roundingBag[n]});if(0===g.length)return;const w=g.filter(n=>!0===t.metadata.bagManualFlags[n]),u=g.filter(n=>!t.metadata.bagManualFlags[n]),m=Math.round(100*c);let p=0;w.forEach(n=>{p+=Math.round(100*(t.roundingBag[n]||0))});const f=m-p;if(u.length>0){const n=Math.trunc(f/u.length);let a=f-n*u.length;const o=null==(s=t.settings)?void 0:s.meId,i=[...u].sort((t,n)=>{if(o){if(t===o&&n!==o)return-1;if(n===o&&t!==o)return 1}return 0});if(u.forEach(n=>{delete t.roundingBag[n]}
1),i.forEach(e=>{t.roundingBag[e]=n/100}),0!==a){const n=a>0?1:-1;let o=Math.abs(a),d=0;for(;o>0;){const a=i[d%i.length];t.roundingBag[a]=(window.round2||e)((t.roundingBag[a]||0)+n/100),o--,d++}}}null==(l=t.metadata)||delete l.autoRemainderContactId,null==(r=t.metadata)||delete r.itemBag},window.getContactsMap=function(t){const n={};if(!t||!Array.isArray(t))return n;for(let e=0;e<t.length;e++){const a=t[e];a&&a.id&&(n[a.id]=a)}return n};
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.