1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a8833425-1863-561b-ba5b-32924d93d558")}catch(e){}}(); 3import {A}from'./chunk-DQbKpPtE.js';import {F as F$1}from'./chunk-Dh0gY_Hn.js';import {p,f,m as m$1}from'./chunk-CKLUSTpS.js';import {x as x$1,_ as _$1,K as K$2,j}from'./chunk-BUfIJStM.js';import {v}from'./chunk-CDmUW_ji.js';import {t as tt,x as xe}from'./chunk-C2EMd3uT.js';import {n,t}from'./chunk-rRw6AN79.js';import {c,i as i$1,_}from'./chunk-DNtnKLEI.js';import {x}from'./chunk-Bgp1Xors.js';import {m,G as G$1,c as ce,f as Gw,am as J,an as Z,E as vs,Q as jg,J as yl,av as te,z,i as it,aa as oB,al as A$1,bC as rt,a6 as zg,V as mI,a0 as Lg,af as Qg,ag as LC,aY as M,l as pC,o as hC,x as x$2,bu as Tn,ab as me,C as Ce,r as nB,s as tB,b8 as pe,a as Gt$1,O as Oc,aK as Bn,bv as kn,aL as Xe,bD as on,aM as xn,aN as Rn,bE as Bt$1,aO as gn,aP as hn,aQ as fe,aR as rt$1,aS as le,aT as de,aU as It$1,aV as Nt$1,aW as dn,aX as ln,g as hi,j as fi,y as yt$1,w as wt$1,aC as Yt$1,aD as mt,t as tt$1,K as sT,T as TT,ba as nw,F as yC,ah as YC,Y as am,_ as _T,bb as ow,W as vC,a5 as TC,a7 as Of,a4 as xC,a8 as kf,p as p$1,q as Oy,ay as av,I,ai as Y,aj as V,bF as Lt$1,bG as Pt$1,a9 as Cl,at as em,Z as ST,bg as IT,bB as bE}from'./main-4VLKDOCZ.js';import {c as ct}from'./chunk-B6AJcvsE.js';import {K as K$1}from'./chunk-YoSAHh99.js';import {v as ve,n as ne}from'./chunk-CGRu243p.js';import'./chunk-CnpvWcIg.js';import {S as Si,O as Oi,U}from'./chunk-cXqDMoZI.js';import'./chunk-CFc4R64D.js';import'./chunk-DsnTQB1I.js';import'./chunk-DtMMcy1N.js';var pt=(()=>{class a{api=m(A);async fetchForCompany(e){let{municipalTaxes:i}=await this.api.list(e),t=i.filter(o=>o.id);return t.length>0?t:this.api.peekForCompany(e)}async hasMunicipalTax(e){return (await this.fetchForCompany(e)).length>0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=x$2({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var dt=(()=>{class a{route=m(G$1);router=m(ce);municipalTaxGuard=m(pt);async ngOnInit(){let e=this.route.snapshot.paramMap.get("id"),i=[];try{i=await this.municipalTaxGuard.fetchForCompany(e);}catch(t){console.error("municipal-taxes index: failed to query municipal registrations",t);}if(i.length>=1){let t=i[0];this.router.navigate(["/companies",e,"municipal-taxes",t.id],{replaceUrl:true});}else this.router.navigate(["/companies",e,"municipal-taxes","new"],{replaceUrl:true});}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=Gw({type:a,selectors:[["app-municipal-taxes-index-page"]],decls:2,vars:0,consts:[["id","company",1,"layout-row-form","municipal-taxes-index"],["diameter","40"]],template:function(i,t){i&1&&(vs(0,"section",0),jg(1,"mat-spinner",1),yl());},dependencies:[J,Z],styles:[".municipal-taxes-index[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:48px 16px}"]})}return a})();var G=Pt$1,vt=["prefectures","prefectures.v2"],Ct=600*1e3;function yt(a){return Y(V({},a.attributes),{id:String(a.id),cityCode:String(a.id)})}var ut=(()=>{class a{http=m(Oy);prefectures=it(null);isLoading=it(false);lastError=it(null);inFlight=null;getPrefectures(){if(this.inFlight)return this.inFlight;let e=this.readCache();if(e){let i=e.map(yt);return this.prefectures.set(i),this.lastError.set(null),Promise.resolve(i)}return this.isLoading.set(true),this.lastError.set(null),this.inFlight=(async()=>{try{let t=(await av(this.http.get(`${I.PREFECTURES_API}/v1/prefectures/`,{params:{$filter:"Status eq 'Active'"}}))||[]).map(o=>Y(V({},o),{id:String(o.id),cityCode:String(o.id)}));return this.writeCache(t.map(o=>({id:o.id,attributes:o}))),this.prefectures.set(t),t}catch(i){return this.lastError.set(i),this.prefectures.set(null),null}finally{this.isLoading.set(false),this.inFlight=null;}})(),this.inFlight}findByCode(e){let i=this.prefectures();if(e==null||!i)return null;let t=String(e);return i.find(o=>o.cityCode?.toString()===t)||null}readCache(){try{vt.forEach(o=>localStorage.removeItem(o));let e=localStorage.getItem(G);if(!e||e==="undefined")return null;let i=JSON.parse(e);return !i||!i.timestamp||!Array.isArray(i.payload)?null:i.payload.length===0?(localStorage.removeItem(G),null):Date.now()-i.timestamp>=Ct?null:i.payload.every(o=>o&&o.id!=null&&o.attributes)?i.payload:(localStorage.removeItem(G),null)}catch{return localStorage.removeItem(G),null}}writeCache(e){if(!(!Array.isArray(e)||e.length===0))try{localStorage.setItem(G,JSON.stringify({timestamp:Date.now(),payload:e}));}catch{}}static \u0275fac=function(i){return new(i||a)};static \u0275prov=x$2({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var K=Lt$1,Tt="national-issuer-cities.v1",St=600*1e3,ft=(()=>{class a{http=m(Oy);inflight=null;peekNationalIssuerCities(){let e=this.readCache();return e?e.map(this.hydrate):null}async getNationalIssuerCities(){if(this.inflight)return this.inflight;let e=this.readCache();return e?e.map(this.hydrate):(this.inflight=(async()=>{try{let t=(await av(this.http.get(`${I.PREFECTURES_API}/v1/prefectures/`,{params:{$filter:"Status eq 'Active' and Tag eq 'NationalRTC'"}}))||[]).map(o=>Y(V({},o),{id:String(o.id),cityCode:String(o.id)}));return t.length>0&&this.writeCache(t.map(o=>({id:o.id,attributes:o}))),t}catch(i){return console.warn("Failed to load cities from national issuer:",i),[]}finally{this.inflight=null;}}
3)(),this.inflight)}hydrate(e){return Y(V({},e.attributes),{id:String(e.id),cityCode:String(e.id)})}readCache(){try{localStorage.removeItem(Tt);let e=localStorage.getItem(K);if(!e||e==="undefined")return null;let i=JSON.parse(e);return !i||!i.timestamp||!Array.isArray(i.payload)?null:i.payload.length===0?(localStorage.removeItem(K),null):Date.now()-i.timestamp>=St?null:i.payload.every(o=>o&&o.id!=null&&o.attributes)?i.payload:(localStorage.removeItem(K),null)}catch{return localStorage.removeItem(K),null}}writeCache(e){try{localStorage.setItem(K,JSON.stringify({timestamp:Date.now(),payload:e}));}catch{}}static \u0275fac=function(i){return new(i||a)};static \u0275prov=x$2({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var Mt=a=>({environmentTitle:a}),$=(a,u)=>u.code;function Et(a,u){a&1&&(vs(0,"h3",2),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"companies.edit.municipalTax.form.title")));}function bt(a,u){if(a&1){let e=TC();vs(0,"div",5)(1,"h4"),sT(2),TT(3,"translate"),yl(),vs(4,"p"),sT(5),TT(6,"translate"),vs(7,"button",25),zg("click",function(){Of(e);let t=xC();return kf(t.retryPrefectures())}),sT(8),TT(9,"translate"),yl()()();}a&2&&(mI(2),am(_T(3,3,"forms.address.errors.prefecturesLoad.title")),mI(3),Cl(" ",_T(6,5,"forms.address.errors.prefecturesLoad.message")," "),mI(3),am(_T(9,7,"retryBtn")));}function Nt(a,u){if(a&1&&jg(0,"app-city-not-found-alert",6),a&2){let e=xC();Lg("prefectures",e.prefectures.prefectures())("state",e.model().city.state)("city",e.model().city);}}function wt(a,u){if(a&1){let e=TC();vs(0,"div",7)(1,"mat-checkbox",26),zg("change",function(t){Of(e);let o=xC();return kf(o.isMunicipalTaxExempt.set(t.checked))}),sT(2),TT(3,"translate"),yl()();}if(a&2){let e=xC();mI(),Lg("checked",e.isMunicipalTaxExempt()),mI(),Cl(" ",_T(3,2,"forms.company.tax.isExempt")," ");}}function It(a,u){a&1&&(vs(0,"mat-hint"),jg(1,"span",4),TT(2,"translate"),yl()),a&2&&(mI(),Lg("innerHTML",_T(2,1,"companies.edit.municipalTax.form.taxNumberHint"),bE));}function Dt(a,u){a&1&&(vs(0,"mat-error"),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"validations.municipalTax.taxNumberFormat")));}function Ft(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(e.code);}}function Pt(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(e.name);}}function kt(a,u){a&1&&jg(0,"mat-spinner",16);}function Bt(a,u){a&1&&(vs(0,"mat-icon",17),TT(1,"translate"),sT(2," check_circle "),yl()),a&2&&Lg("matTooltip",_T(1,1,"forms.address.errors.prefectureIntegrated"));}function Rt(a,u){a&1&&(vs(0,"mat-icon",18),TT(1,"translate"),sT(2," warning "),yl()),a&2&&Lg("matTooltip",_T(1,1,"forms.address.errors.cityNotFound.title"));}function Vt(a,u){a&1&&(vs(0,"mat-hint",19),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"forms.address.errors.prefectureIntegrated")));}function At(a,u){a&1&&(vs(0,"mat-hint",20),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"forms.address.errors.cityNotFound.title")));}function Ot(a,u){a&1&&(vs(0,"mat-error"),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"validations.municipalTax.cityCodeRequired")));}function Lt(a,u){if(a&1){let e=TC();vs(0,"div",21)(1,"mat-checkbox",27),zg("change",function(t){Of(e);let o=xC();return kf(o.toggleNationalIssuer(t.checked))}),vs(2,"strong"),sT(3),TT(4,"translate"),yl()(),jg(5,"small",28),TT(6,"translate"),yl();}if(a&2){let e=xC();mI(),Lg("checked",e.isNationalIssuerChecked())("disabled",e.isMunicipalTaxExempt()),mI(2),am(_T(4,4,"companies.edit.municipalTax.form.nationalIssuer.label")),mI(2),Lg("innerHTML",_T(6,6,"companies.edit.municipalTax.form.nationalIssuer.hint"),bE);}}function Ht(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(e.name);}}function Ut(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),TT(2,"translate"),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(_T(2,2,"enums.specialTaxRegimes."+e.code));}}function zt(a,u){a&1&&(vs(0,"mat-hint"),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"companies.edit.municipalTax.form.specialTaxRegimeHint")));}function qt(a,u){a&1&&(vs(0,"mat-error"),sT(1),TT(2,"translate"),yl()),a&2&&(mI(),am(_T(2,1,"validations.required")));}function jt(a,u){a&1&&(vs(0,"mat-form-field",9)(1,"mat-label"),sT(2),TT(3,"translate"),yl(),jg(4,"input",29),nw(),yl(),vs(5,"mat-form-field",9)(6,"mat-label"),sT(7),TT(8,"translate"),yl(),jg(9,"input",30),nw(),yl(),vs(10,"mat-form-field",9)(11,"mat-label"),sT(12),TT(13,"translate"),yl(),jg(14,"input",31),nw(),yl()),a&2&&(mI(2),am(_T(3,3,"companies.edit.municipalTax.form.loginName")),mI(2),ow(),mI(3),am(_T(8,5,"companies.edit.municipalTax.form.loginPassword")),mI(2),ow(),mI(3),am(_T(13,7,"companies.edit.municipalTax.form.authIssueValue")),mI(2),ow());}function $t(a,u){a&1&&(vs(0,"mat-form-field",24)(1,"mat-label"),sT(2),TT(3,"translate"),yl(),jg(4,"input",32),nw(),vs(5,"mat-hint"),jg(6,"span",4),TT(7,"translate"),yl()()),a&2&&(mI(2),am(_T(3,2,"companies.edit.municipalTax.form.regi
3onalCode.label")),mI(2),ow(),mI(2),Lg("innerHTML",_T(7,4,"companies.edit.municipalTax.form.regionalCode.hint"),bE));}function Gt(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),TT(2,"translate"),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(_T(2,2,"enums.taxDeterminations."+e.code));}}function Kt(a,u){if(a&1&&(vs(0,"mat-option",14),sT(1),TT(2,"translate"),yl()),a&2){let e=u.$implicit;Lg("value",e.code),mI(),am(_T(2,2,"enums.taxDeterminations."+e.code));}}function Yt(a,u){if(a&1){let e=TC();vs(0,"section",1)(1,"h3",2),sT(2),TT(3,"translate"),yl(),vs(4,"div",8)(5,"mat-form-field",9)(6,"mat-label"),sT(7),TT(8,"translate"),yl(),vs(9,"mat-select",33),zg("closed",function(){Of(e);let t=xC();return kf(t.federalDeterminationSearch.set(""))}),vs(10,"app-select-search",13),TT(11,"translate"),zg("searchChange",function(t){Of(e);let o=xC();return kf(o.federalDeterminationSearch.set(t))}),yl(),yC(12,Gt,3,4,"mat-option",14,$),yl(),nw(),yl(),vs(14,"mat-form-field",9)(15,"mat-label"),sT(16),TT(17,"translate"),yl(),vs(18,"mat-select",34),zg("closed",function(){Of(e);let t=xC();return kf(t.municipalDeterminationSearch.set(""))}),vs(19,"app-select-search",13),TT(20,"translate"),zg("searchChange",function(t){Of(e);let o=xC();return kf(o.municipalDeterminationSearch.set(t))}),yl(),yC(21,Kt,3,4,"mat-option",14,$),yl(),nw(),yl(),vs(23,"mat-form-field",9)(24,"mat-label"),sT(25),TT(26,"translate"),yl(),jg(27,"input",35),nw(),vs(28,"span",36),sT(29,"%"),yl()(),vs(30,"div",3)(31,"h4"),sT(32),TT(33,"translate"),yl(),jg(34,"p",4),TT(35,"translate"),yl()()(),vs(36,"section",1)(37,"h3",2),sT(38),TT(39,"translate"),yl(),vs(40,"div",8)(41,"div",37)(42,"mat-form-field",9)(43,"mat-label"),sT(44),TT(45,"translate"),yl(),jg(46,"input",38),nw(),yl(),vs(47,"mat-form-field",9)(48,"mat-label"),sT(49),TT(50,"translate"),yl(),jg(51,"input",39),nw(),yl()(),vs(52,"div",3)(53,"h4"),sT(54),TT(55,"translate"),yl(),jg(56,"p",4),TT(57,"translate"),yl()()();}if(a&2){let e=xC();mI(2),am(_T(3,13,"companies.edit.municipalTax.form.taxDataTitle")),mI(5),am(_T(8,15,"companies.edit.municipalTax.form.federalTaxDetermination.label")),mI(2),ow(),mI(),Lg("placeholder",_T(11,17,"companies.edit.municipalTax.form.federalTaxDetermination.searchPlaceholder")),mI(2),vC(e.filteredFederalDeterminations()),mI(4),am(_T(17,19,"companies.edit.municipalTax.form.municipalTaxDetermination.label")),mI(2),ow(),mI(),Lg("placeholder",_T(20,21,"companies.edit.municipalTax.form.municipalTaxDetermination.searchPlaceholder")),mI(2),vC(e.filteredMunicipalDeterminations()),mI(4),am(_T(26,23,"companies.edit.municipalTax.form.issRate")),mI(2),ow(),mI(5),am(_T(33,25,"companies.edit.fiscalInfo.issInfo.title")),mI(2),Lg("innerHTML",_T(35,27,"companies.edit.fiscalInfo.issInfo.text"),bE),mI(4),am(_T(39,29,"companies.edit.municipalTax.form.rpsTitle")),mI(6),am(_T(45,31,"companies.edit.municipalTax.form.rpsSerialNumber")),mI(2),ow(),mI(3),am(_T(50,33,"companies.edit.municipalTax.form.rpsNumber")),mI(2),ow(),mI(3),am(_T(55,35,"companies.edit.fiscalInfo.rpsInfo.title")),mI(2),Lg("innerHTML",_T(57,37,"companies.edit.fiscalInfo.rpsInfo.text"),bE);}}function Qt(a,u){if(a&1){let e=TC();vs(0,"section",1)(1,"div",40)(2,"h3",2),sT(3),TT(4,"translate"),yl(),vs(5,"span",41),sT(6),TT(7,"translate"),yl()(),jg(8,"p",42),TT(9,"translate"),vs(10,"button",43),zg("click",function(){Of(e);let t=xC();return kf(t.tryToSwitchEnvironment())}),vs(11,"mat-icon"),sT(12,"swap_horiz"),yl(),sT(13),TT(14,"translate"),TT(15,"translate"),yl()();}if(a&2){let e=xC();mI(3),am(_T(4,8,"companies.edit.municipalTax.form.environment.title")),mI(2),em("status-badge--success",e.isProductionEnvironment())("status-badge--warning",!e.isProductionEnvironment()),mI(),am(_T(7,10,e.isProductionEnvironment()?"enums.apiEnvironments.Production":"enums.apiEnvironments.Development")),mI(2),Lg("innerHTML",_T(9,12,e.isProductionEnvironment()?"companies.edit.municipalTax.form.environment.productionDescription":"companies.edit.municipalTax.form.environment.developmentDescription"),bE),mI(5),Cl(" ",ST(15,16,"companies.edit.environment.switchEnvironmentButton",IT(19,Mt,_T(14,14,e.isProductionEnvironment()?"enums.apiEnvironments.Development":"enums.apiEnvironments.Production")))," ");}}var F=(()=>{class a{fb=m(Tn);address=m(K$1);environmentSwitch=m(xe);nationalIssuer=m(ft);destroyRef=m(me);translate=m(z);prefectures=m(ut);user=m(Ce);model=nB.required();additionalFields=nB(false);showEnvironmentSwitch=nB(false);showDataTitle=nB(true);calloutClass=nB("");showExempt=nB(false);company=nB(null);updateEnvironment=tB();specialTaxRegimes=_$1;taxDeterminations=K$2;legalNatures=j;states=it(null);filteredCities=it(null);nationalIssuerCities=it(null);needsUserAndPassword=it(false);isMunicipalTaxExempt=it(false);stateSearch=it("");citySearch=it("");legalNatureSearch=it("");specialTaxRegimeSearch=it("");federalDeterminationSearch=it("");municipalDeterminationSearch=it("");modelVersion=it(0);form=this.fb.group({taxNumber:[null,[pe.pattern(/^[0-9a-zA-Z]{1,15}$/)]],state:[null],cityCode:[null,[pe.required]],legalNature:[null],specialTaxRegime:[null,[pe.required]],email:[null],loginName:[null],loginPassword:[null],authIssueValue:[null],federalTaxDetermination:[null],municipalTaxDetermination:[null],issRateDisplay:[null],rpsSerialNumber:[null],rpsNumber:[null],regionalTaxNumber:[null]});isInitializing=Gt$1(()=>!this.states()||!this.nationalIssuerCities()||this.prefectures.isLoading());prefectureStatus=Gt$1(()=>(this.modelVersion(),m$1(this.prefectures.prefectures(),this.model().city.state,this.model().city.code)));isNationalIssuerChecked=it(false);isCityNationalIssuerEnabled=Gt$1(()=>{this.modelVersion();let e=this.model().city?.code,i=this.nationalIssuerCities();return !e||!i?false:i.some(t=>t.id?.toString()===String(e))});isProductionEnvironment=Gt$1(()=>(this.modelVersion(),this.model().environment==="Production"));stateOptions=Gt$1(()=>{this.modelVersion();let e=this.states()??[],i=this.model().city?.state;return i&&!e.some(t=>t.code===i)?[{code:i,name:i},...e]:e});filteredStateOptions=Gt$1(()=>{let e=this.stateOptions(),i=this.stateSearch().toLowerCase();return i?e.filter(t=>t.code.toLowerCase().includes(i)):e});cityOptions=Gt$1(()=>{this.modelVersion();let e=this.filteredCities(),i=this.model().city;return e?(i?.code&&i?.name&&!e.some(t=>t.code===i.code)&&(e=[{code:i.code,name:i.name},...e]),e):i?.code&&i?.name?[{code:i.code,name:i.name}]:[]});filteredCityOptions=Gt$1(()=>{let e=this.cityOptions(),i=this.citySearch().toLowerCase();return i?e.filter(t=>t.name?.toLowerCase().includes(i)):e});filteredLegalNatures=Gt$1(()=>{let e=this.legalNatureSearch().toLowerCase();return e?this.legalNatures.filter(i=>i.name.toLowerCase().includes(e)):this.legalNatures});filteredSpecialTaxRegimes=Gt$1(()=>{let e=this.specialTaxRegimeSearch().toLowerCase();return e?this.specialTaxRegimes.filter(i=>this.specialTaxRegimeLabel(i.code).toLowerCase().includes(e)):this.specialTaxRegimes});filteredFederalDeterminations=Gt$1(()=>this.filterDeterminations(this.federalDeterminationSearch()));filteredMunicipalDeterminations=Gt$1(()=>this.filterDeterminations(this.municipalDeterminationSearch()));specialTaxRegimeLabel(e){return this.translate.instant(`enums.specialTaxRegimes.${e}`)}taxDeterminationLabel(e){return this.translate.instant(`enums.taxDeterminations.${e}`)}filterDeterminations(e){let i=e.toLowerCase();return i?this.taxDeterminations.filter(t=>this.taxDeterminationLabel(t.code).toLowerCase().includes(i)):this.taxDeterminations}constructor(){Oc(()=>{let e=this.isInitializing()||this.isMunicipalTaxExempt();this.toggleControl("state",!e),this.toggleControl("cityCode",!e);let i=this.isMunicipalTaxExempt();["taxNumber","legalNature","specialTaxRegime","email","loginName","loginPassword","authIssueValue"].forEach(t=>this.toggleControl(t,!i));});}
3ngOnInit(){let e=this.model();e.specialTaxRegime||(e.specialTaxRegime="Nenhum");let i=e.federalTaxDetermination,t$1=e.municipalTaxDetermination;this.form.patchValue({taxNumber:e.taxNumber??null,state:e.city?.state??null,cityCode:e.city?.code??null,legalNature:e.legalNature??null,specialTaxRegime:e.specialTaxRegime??null,email:e.email??null,loginName:e.loginName??null,loginPassword:e.loginPassword??null,authIssueValue:e.authIssueValue??null,federalTaxDetermination:i===0?"NotInformed":i??null,municipalTaxDetermination:t$1===0?"NotInformed":t$1??null,issRateDisplay:this.formatIssRate(e.issRate),rpsSerialNumber:e.rpsSerialNumber??null,rpsNumber:e.rpsNumber??null,regionalTaxNumber:e.regionalTaxNumber??null},{emitEvent:false}),this.isNationalIssuerChecked.set(e.regionalTaxNumber===t),this.bindWriteThrough(),this.prefillFromCacheSync(),this.loadFormDataAsync().catch(o=>{console.warn("municipal-tax-form: falha ao hidratar dados em background",o);});}bindWriteThrough(){let e=this.model(),i=(t,o)=>{this.form.get(t).valueChanges.pipe(p$1(this.destroyRef)).subscribe(f=>{o(f),this.modelVersion.update(xt=>xt+1);});};i("taxNumber",t=>e.taxNumber=t),i("legalNature",t=>e.legalNature=t),i("specialTaxRegime",t=>e.specialTaxRegime=t),i("email",t=>e.email=t),i("loginName",t=>e.loginName=t),i("loginPassword",t=>e.loginPassword=t),i("authIssueValue",t=>e.authIssueValue=t),i("federalTaxDetermination",t=>e.federalTaxDetermination=t),i("municipalTaxDetermination",t=>e.municipalTaxDetermination=t),i("rpsSerialNumber",t=>e.rpsSerialNumber=t),i("rpsNumber",t=>e.rpsNumber=t!=null&&t!==""?Number(t):null),i("regionalTaxNumber",t$1=>{e.regionalTaxNumber=t$1!=null&&t$1!==""?Number(t$1):null,this.isNationalIssuerChecked.set(e.regionalTaxNumber===t);}),i("issRateDisplay",t=>{let o=parseFloat(String(t??"").replace(/\s|%/g,"").replace(",","."));e.issRate=isNaN(o)?0:o/100;});}formatIssRate(e){return e==null?null:new Intl.NumberFormat("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e*100)}toggleControl(e,i){let t=this.form.get(e);i&&t.disabled&&t.enable({emitEvent:false}),!i&&t.enabled&&t.disable({emitEvent:false});}get isValid(){return !this.form.invalid}markAllAsTouched(){this.form.markAllAsTouched();}notifyModelChanged(){this.modelVersion.update(e=>e+1);}prefillFromCacheSync(){let e=this.model(),i=this.address.peekStates(),t=this.nationalIssuer.peekNationalIssuerCities();i&&this.states.set(i),t&&this.nationalIssuerCities.set(t),!e.city?.state&&this.company()?.address?.state&&(e.city.state=this.company().address.state,this.form.get("state").setValue(e.city.state,{emitEvent:false}));let o=e.city?.state;if(o){let f=this.address.peekCitiesByState(o);f&&(this.filteredCities.set(f),this.autoFillCityFromCompany(f));}this.checkPrefectureNeedsAuth();}async loadFormDataAsync(){let e=this.model(),[i,,t]=await Promise.allSettled([this.address.getStates(),this.prefectures.getPrefectures(),this.nationalIssuer.getNationalIssuerCities()]);i.status==="fulfilled"&&i.value.length>0?this.states.set(i.value):i.status==="rejected"&&console.warn("municipal-tax-form: falha ao carregar states",i.reason),t.status==="fulfilled"&&t.value?this.nationalIssuerCities.set(t.value):t.status==="rejected"&&console.warn("municipal-tax-form: falha ao carregar national-issuer cities",t.reason),!e.city?.state&&this.company()?.address?.state&&(e.city.state=this.company().address.state,this.form.get("state").setValue(e.city.state,{emitEvent:false}));let o=e.city?.state;if(o&&!this.filteredCities())try{let f=await this.address.getCitiesByState(o);f&&(this.filteredCities.set(f),this.autoFillCityFromCompany(f));}catch(f){console.warn("municipal-tax-form: falha ao carregar cidades por state",f);}this.checkPrefectureNeedsAuth(),this.modelVersion.update(f=>f+1);}autoFillCityFromCompany(e){let i=this.model();if(i.city?.code||!this.company()?.address?.city)return;let t=this.company().address.city,o=e.find(f=>f.code===t.code||f.name===t.name);o&&(i.city.code=o.code,i.city.name=o.name,this.form.get("cityCode").setValue(o.code,{emitEvent:false}),this.modelVersion.update(f=>f+1));}checkPrefectureNeedsAuth(){let e=this.model().city?.code;if(!e)return;this.prefectures.findByCode(e)?.webService?.authenticationMethod==="UserAndPassword"&&this.needsUserAndPassword.set(true);}retryPrefectures(){return this.prefectures.getPrefectures()}async selectState(e){if(!e)return;let i=this.model();i.city.state=e,i.city.code=null,i.city.name=null,this.form.get("cityCode").setValue(null,{emitEvent:false}),this.needsUserAndPassword.set(false),this.citySearch.set(""),this.modelVersion.update(o=>o+1);let t=await this.address.getCitiesByState(e);this.filteredCities.set(t??null);}selectCity(e){if(!e)return;let i=this.model(),t=this.cityOptions().find(f=>f.code===e);if(!t)return;i.city.code=t.code,i.city.name=t.name,this.modelVersion.update(f=>f+1);let o=this.prefectures.findByCode(t.code);this.needsUserAndPassword.set(o?.webService?.authenticationMethod==="UserAndPassword");}toggleNationalIssuer(e){let i=this.model(),t$1=e?t:0;i.regionalTaxNumber=t$1,this.isNationalIssuerChecked.set(e),this.form.get("regionalTaxNumber").setValue(t$1,{emitEvent:false}),this.modelVersion.update(o=>o+1);}async tryToSwitchEnvironment(){await this.environmentSwitch.confirmSwitch("municipal",this.isProductionEnvironment())&&this.updateEnvironment.emit(this.model());}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=Gw({type:a,selectors:[["app-municipal-tax-form"]],inputs:{model:[1,"model"],additionalFields:[1,"additionalFields"],showEnvironmentSwitch:[1,"showEnvironmentSwitch"],showDataTitle:[1,"showDataTitle"],calloutClass:[1,"calloutClass"],showExempt:[1,"showExempt"],company:[1,"company"]},outputs:{updateEnvironment:"updateEnvironment"},decls:74,vars:56,consts:[[1,"municipal-tax-form",3,"formGroup"],[1,"form-section"],[1,"form-section__title"],[1,"bs-callout","bs-callout-primary"],[3,"innerHTML"],[1,"bs-callout","bs-callout-warning","mt0"],[3,"prefectures","state","city"],[1,"form-check-row"],[1,"form-grid"],["appearance","outline"],["matInput","","formControlName","taxNumber"],["matInput","","type","email","formControlName","email"],["formControlName","state",3,"selectionChange","closed"],[3,"searchChange","placeholder"],[3,"value"],["formControlName","cityCode",3,"selectionChange","closed"],["matSuffix","","diameter","16"],["matSuffix","",1,"prefecture-suffix","prefecture-suffix--ok",3,"matTooltip"],["matSuffix","",1,"prefecture-suffix","prefecture-suffix--warn",3,"matTooltip"],[1,"prefecture-hint","prefecture-hint--ok"],[1,"prefecture-hint","prefecture-hint--warn"],[1,"form-grid__full","form-grid__check"],["formControlName","legalNature",3,"closed"],["formControlName","specialTaxRegime",3,"closed"],["appearance","outline","data-test-admin-regional-code",""],["mat-stroked-button","","color","primary","type","button",3,"click"],[3,"change","checked"],[3,"change","checked","disabled"],[1,"md-hint",3,"innerHTML"],["matInput","","formControlName","loginName"],["matInput","","type","password","formControlName","loginPassword"],["matInput","","formControlName","authIssueValue"],["matInput","","type","number","formControlName","regi
3onalTaxNumber"],["formControlName","federalTaxDetermination",3,"closed"],["formControlName","municipalTaxDetermination",3,"closed"],["matInput","","formControlName","issRateDisplay"],["matTextSuffix",""],[1,"form-grid__stack"],["matInput","","formControlName","rpsSerialNumber"],["matInput","","type","number","min","1","formControlName","rpsNumber"],[1,"form-section__header"],[1,"status-badge"],[1,"environment-description",3,"innerHTML"],["mat-stroked-button","","type","button",3,"click"]],template:function(i,t){i&1&&(vs(0,"form",0)(1,"section",1),pC(2,Et,3,3,"h3",2),vs(3,"div",3)(4,"h4"),sT(5),TT(6,"translate"),yl(),jg(7,"p",4),TT(8,"translate"),yl(),pC(9,bt,10,9,"div",5)(10,Nt,1,3,"app-city-not-found-alert",6),pC(11,wt,4,4,"div",7),vs(12,"div",8)(13,"mat-form-field",9)(14,"mat-label"),sT(15),TT(16,"translate"),yl(),jg(17,"input",10),nw(),pC(18,It,3,3,"mat-hint"),pC(19,Dt,3,3,"mat-error"),yl(),vs(20,"mat-form-field",9)(21,"mat-label"),sT(22),TT(23,"translate"),yl(),jg(24,"input",11),nw(),yl(),vs(25,"mat-form-field",9)(26,"mat-label"),sT(27),TT(28,"translate"),yl(),vs(29,"mat-select",12),zg("selectionChange",function(f){return t.selectState(f.value)})("closed",function(){return t.stateSearch.set("")}),vs(30,"app-select-search",13),TT(31,"translate"),zg("searchChange",function(f){return t.stateSearch.set(f)}),yl(),yC(32,Ft,2,2,"mat-option",14,$),yl(),nw(),yl(),vs(34,"mat-form-field",9)(35,"mat-label"),sT(36),TT(37,"translate"),yl(),vs(38,"mat-select",15),zg("selectionChange",function(f){return t.selectCity(f.value)})("closed",function(){return t.citySearch.set("")}),vs(39,"app-select-search",13),TT(40,"translate"),zg("searchChange",function(f){return t.citySearch.set(f)}),yl(),yC(41,Pt,2,2,"mat-option",14,$),yl(),nw(),pC(43,kt,1,0,"mat-spinner",16),pC(44,Bt,3,3,"mat-icon",17),pC(45,Rt,3,3,"mat-icon",18),pC(46,Vt,3,3,"mat-hint",19)(47,At,3,3,"mat-hint",20),pC(48,Ot,3,3,"mat-error"),yl(),pC(49,Lt,7,8,"div",21),vs(50,"mat-form-field",9)(51,"mat-label"),sT(52),TT(53,"translate"),yl(),vs(54,"mat-select",22),zg("closed",function(){return t.legalNatureSearch.set("")}),vs(55,"app-select-search",13),TT(56,"translate"),zg("searchChange",function(f){return t.legalNatureSearch.set(f)}),yl(),yC(57,Ht,2,2,"mat-option",14,$),yl(),nw(),yl(),vs(59,"mat-form-field",9)(60,"mat-label"),sT(61),TT(62,"translate"),yl(),vs(63,"mat-select",23),zg("closed",function(){return t.specialTaxRegimeSearch.set("")}),vs(64,"app-select-search",13),TT(65,"translate"),zg("searchChange",function(f){return t.specialTaxRegimeSearch.set(f)}),yl(),yC(66,Ut,3,4,"mat-option",14,$),yl(),nw(),pC(68,zt,3,3,"mat-hint"),pC(69,qt,3,3,"mat-error"),yl(),pC(70,jt,15,9),pC(71,$t,8,6,"mat-form-field",24),yl()(),pC(72,Yt,58,39),pC(73,Qt,16,21,"section",1),yl()),i&2&&(Lg("formGroup",t.form),mI(2),hC(t.showDataTitle()?2:-1),mI(),YC(t.calloutClass()),mI(2),am(_T(6,32,"companies.edit.municipalTax.requiredForNfse.title")),mI(2),Lg("innerHTML",_T(8,34,"companies.edit.municipalTax.requiredForNfse.text"),bE),mI(2),hC(t.prefectures.lastError()?9:t.prefectures.isLoading()?-1:10),mI(2),hC(t.showExempt()?11:-1),mI(4),am(_T(16,36,"companies.edit.municipalTax.form.taxNumber")),mI(2),ow(),mI(),hC(t.form.controls.taxNumber.value?-1:18),mI(),hC(t.form.controls.taxNumber.hasError("pattern")?19:-1),mI(3),am(_T(23,38,"companies.edit.municipalTax.form.email")),mI(2),ow(),mI(3),am(_T(28,40,"forms.address.state.label")),mI(2),ow(),mI(),Lg("placeholder",_T(31,42,"forms.address.state.searchPlaceholder")),mI(2),vC(t.filteredStateOptions()),mI(4),am(_T(37,44,"companies.edit.municipalTax.form.cityName")),mI(2),ow(),mI(),Lg("placeholder",_T(40,46,"companies.edit.municipalTax.form.searchCity")),mI(2),vC(t.filteredCityOptions()),mI(2),hC(t.prefectures.isLoading()?43:-1),mI(),hC(!t.prefectures.isLoading()&&!t.prefectures.lastError()&&t.prefectureStatus()==="ok"?44:-1),mI(),hC(!t.prefectures.isLoading()&&!t.prefectures.lastError()&&t.prefectureStatus()==="warn"?45:-1),mI(),hC(!t.prefectures.isLoading()&&!t.prefectures.lastError()&&t.prefectureStatus()==="ok"?46:!t.prefectures.isLoading()&&!t.prefectures.lastError()&&t.prefectureStatus()==="warn"?47:-1),mI(2),hC(t.form.controls.cityCode.hasError("required")?48:-1),mI(),hC(t.isCityNationalIssuerEnabled()?49:-1),mI(3),am(_T(53,48,"companies.edit.municipalTax.form.legalNature.label")),mI(2),ow(),mI(),Lg("placeholder",_T(56,50,"companies.edit.municipalTax.form.legalNature.searchPlaceholder")),mI(2),vC(t.filteredLegalNatures()),mI(4),am(_T(62,52,"companies.edit.municipalTax.form.specialTaxRegime")),mI(2),ow(),mI(),Lg("placeholder",_T(65,54,"forms.company.tax.specialTaxRegime.searchPlaceholder")),mI(2),vC(t.filteredSpecialTaxRegimes()),mI(2),hC(t.form.controls.specialTaxRegime.value?-1:68),mI(),hC(t.form.controls.specialTaxRegime.hasError("required")?69:-1),mI(),hC(t.needsUserAndPassword()?70:-1),mI(),hC(t.user.isAdmin()?71:-1),mI(),hC(t.additionalFields()?72:-1),mI(),hC(t.showEnvironmentSwitch()?73:-1));},dependencies:[Bn,kn,Xe,on,xn,Rn,Bt$1,gn,hn,fe,rt$1,le,de,It$1,Nt$1,dn,ln,Si,Oi,U,ve,ne,hi,fi,yt$1,wt$1,J,Z,Yt$1,mt,F$1,v,tt$1],styles:[".form-section[_ngcontent-%COMP%] + .form-section[_ngcontent-%COMP%]{margin-top:24px}.form-section__title[_ngcontent-%COMP%]{margin:0 0 12px}.form-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px 24px;padding-top:12px}@media(max-width:768px){.form-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.form-grid__full[_ngcontent-%COMP%]{grid-column:1/-1}.form-grid__stack[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.form-grid__check[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding-bottom:8px}.form-check-row[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:4px}.bs-callout[_ngcontent-%COMP%]{padding:12px 16px;margin:12px 0 20px;border-left:4px solid var(--mat-sys-outline-variant);background:var(--mat-sys-surface-container-low);border-radius:3px}
3.bs-callout[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 6px;font-size:15px}.bs-callout[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.bs-callout.mt0[_ngcontent-%COMP%]{margin-top:0}.bs-callout-primary[_ngcontent-%COMP%]{border-left-color:var(--app-status-info)}.bs-callout-warning[_ngcontent-%COMP%]{border-left-color:var(--app-status-warning);background:#fff8ef}.form-grid[_ngcontent-%COMP%] .bs-callout[_ngcontent-%COMP%]{margin:0}.prefecture-suffix--ok[_ngcontent-%COMP%]{color:var(--app-status-success)}.prefecture-suffix--warn[_ngcontent-%COMP%]{color:var(--app-status-warning)}.prefecture-hint--ok[_ngcontent-%COMP%]{color:var(--app-status-success-text)}.prefecture-hint--warn[_ngcontent-%COMP%]{color:var(--app-status-warning-text)}.md-hint[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-size:12px}.form-section__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-bottom:12px}.form-section__header[_ngcontent-%COMP%] .form-section__title[_ngcontent-%COMP%]{margin:0}.environment-description[_ngcontent-%COMP%]{margin:0 0 16px;color:var(--mat-sys-on-surface-variant);font-size:13px;line-height:1.5}"]})}return a})();var ht=(()=>{class a{route=m(G$1);router=m(ce);api=m(A);notify=m(te);translate=m(z);companyId=this.route.snapshot.paramMap.get("id");model=n(this.companyId);onboarding=c(this.route.snapshot.queryParamMap);saving=it(false);form=oB.required(F);async createMunicipalTax(){if(!this.saving()&&(this.form().markAllAsTouched(),!!this.form().isValid)){p(this.model),this.saving.set(true);try{await this.api.create(this.model),this.notify.success(this.translate.instant("companies.edit.municipalTax.messages.createSuccess")),this.leaveAfterCreate();}catch(e){A$1(e,{context:"municipal-tax.create",cityCode:this.model.city?.code??null,fields:f(e),backendMessage:rt(x(e))}),this.notify.error(this.translate.instant("companies.edit.municipalTax.messages.createError"));}finally{this.saving.set(false);}}}cancel(){if(this.onboarding){this.router.navigate([i$1],{queryParams:{company:this.companyId}});return}this.goToCompany();}goToCompany(){this.router.navigate(["/companies",this.companyId]);}leaveAfterCreate(){if(this.onboarding){this.router.navigate(_(this.companyId,"service"));return}this.goToCompany();}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=Gw({type:a,selectors:[["app-municipal-tax-new-page"]],viewQuery:function(i,t){i&1&&Qg(t.form,F,5),i&2&&LC();},decls:4,vars:8,consts:[["id","company",1,"layout-row-form"],[3,"companyId","titleKey"],[3,"submitClick","cancelClick","
3showSubmit","showCancel","saving"],[3,"model","additionalFields","showDataTitle"]],template:function(i,t){i&1&&(vs(0,"section",0),jg(1,"app-company-page-toolbar",1),vs(2,"app-card-form",2),zg("submitClick",function(){return t.createMunicipalTax()})("cancelClick",function(){return t.cancel()}),jg(3,"app-municipal-tax-form",3),yl()()),i&2&&(mI(),Lg("companyId",t.companyId)("titleKey","companies.edit.municipalTax.new.title"),mI(),Lg("showSubmit",true)("showCancel",true)("saving",t.saving()),mI(),Lg("model",t.model)("additionalFields",true)("showDataTitle",true));},dependencies:[ct,x$1,F],encapsulation:2})}return a})();function Jt(a,u){if(a&1){let e=TC();vs(0,"app-card-form",5),zg("submitClick",function(){Of(e);let t=xC();return kf(t.updateMunicipalTax())})("cancelClick",function(){Of(e);let t=xC();return kf(t.goToCompany())}),vs(1,"app-municipal-tax-form",6),zg("updateEnvironment",function(t){Of(e);let o=xC();return kf(o.saveEnvironment(t))}),yl()();}if(a&2){let e=xC();Lg("showSubmit",true)("showCancel",true)("saving",e.saving()),mI(),Lg("model",u)("additionalFields",true)("showEnvironmentSwitch",true)("showDataTitle",true);}}function Wt(a,u){a&1&&jg(0,"app-page-spinner",4),a&2&&Lg("diameter",40);}var gt=(()=>{class a{route=m(G$1);router=m(ce);api=m(A);notify=m(te);translate=m(z);companyId=this.route.snapshot.paramMap.get("id");municipalTaxId=this.route.snapshot.paramMap.get("municipalTaxId");model=it(null);saving=it(false);form=oB(F);async ngOnInit(){try{let e=await this.api.get(this.companyId,this.municipalTaxId);this.model.set(e);}catch(e){A$1(e,{context:"municipal-tax.load",backendMessage:rt(x(e))}),this.notify.error(this.translate.instant("toasts.municipalTax.loadError")),this.goToCompany();}}async updateMunicipalTax(){let e=this.model(),i=this.form();if(!(!e||!i||this.saving())&&(i.markAllAsTouched(),!!i.isValid)){p(e),this.saving.set(true);try{await this.api.update(e),this.notify.success(this.translate.instant("companies.edit.municipalTax.messages.updateSuccess")),this.goToCompany();}catch(t){let o=x(t);A$1(t,{context:"municipal-tax.update",cityCode:e.city?.code??null,fields:f(t),backendMessage:rt(o)}),this.notify.error(this.translate.instant(o==="tax number is not valid"?"companies.edit.municipalTax.messages.invalidTaxNumber":"companies.edit.municipalTax.messages.updateError"));}finally{this.saving.set(false);}}}async saveEnvironment(e){let i=e.environment==="Production"?"Development":"Production";try{let t=await this.api.update(e,{environment:i});e.environment=t.environment??i,this.form()?.notifyModelChanged(),this.notify.success(this.translate.instant("companies.edit.municipalTax.messages.environmentChangeSuccess"));}catch(t){A$1(t,{context:"municipal-tax.environment",environment:i,backendMessage:rt(x(t))}),this.notify.error(this.translate.instant("companies.edit.municipalTax.messages.environmentChangeError"));}}async deleteMunicipalTax(){let e=this.model();if(e)try{await this.api.delete(e),this.notify.success(this.translate.instant("companies.edit.municipalTax.messages.deleteSuccess")),this.goToCompany();}catch(i){A$1(i,{context:"municipal-tax.delete",backendMessage:rt(x(i))}),this.notify.error(this.translate.instant("companies.edit.municipalTax.messages.deleteError"));}}goToCompany(){this.router.navigate(["/companies",this.companyId]);}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=Gw({type:a,selectors:[["app-municipal-tax-edit-page"]],viewQuery:function(i,t){i&1&&Qg(t.form,F,5),i&2&&LC();},decls:5,vars:4,consts:[["id","company",1,"layout-row-form"],[3,"companyId","titleKey"],[3,"companyId"],[3,"showSubmit","showCancel","saving"],["minHeight","136px",3,"diameter"],[3,"submitClick","cancelClick","
3showSubmit","showCancel","saving"],[3,"updateEnvironment","model","additionalFields","showEnvironmentSwitch","showDataTitle"]],template:function(i,t){if(i&1&&(vs(0,"section",0)(1,"app-company-page-toolbar",1),jg(2,"app-company-actions-menu",2),yl(),pC(3,Jt,2,7,"app-card-form",3)(4,Wt,1,1,"app-page-spinner",4),yl()),i&2){let o;mI(),Lg("companyId",t.companyId)("titleKey","companies.edit.municipalTax.edit.title"),mI(),Lg("companyId",t.companyId),mI(),hC((o=t.model())?3:4,o);}},dependencies:[M,ct,x$1,F,tt],encapsulation:2})}return a})();var La=[{path:"",component:dt,title:"Inscri\xE7\xE3o municipal da empresa"},{path:"new",component:ht,title:"Cadastrar inscri\xE7\xE3o municipal"},{path:":municipalTaxId",component:gt,title:"Informa\xE7\xF5es da inscri\xE7\xE3o municipal da empresa"}];export{La as default}; 4//# debugId=a8833425-1863-561b-ba5b-32924d93d558
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.