@bicharts/shape-core 0.6.108 → 0.6.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a as en}from"./chunk-5MRZID36.mjs";import{a as tn,b as G,d as v,e as U}from"./chunk-5HI6TVMM.mjs";import{p as P}from"./chunk-CZJ7M6A5.mjs";var on="AB|CA|Alberta|-113.75|52.18,AK|US|Alaska|-148.32|61.29,AL|US|Alabama|-86.73|33.08,AR|US|Arkansas|-92.85|35.29,AZ|US|Arizona|-111.99|33.32,BC|CA|British Columbia|-122.73|49.27,CA|US|California|-119.21|35.2,CO|US|Colorado|-105|39.63,CT|US|Connecticut|-73.01|41.42,DC|US|District of Columbia|-77.04|38.9,DE|US|Delaware|-75.59|39.57,FL|US|Florida|-81.29|27.53,GA|US|Georgia|-84.02|33.43,HI|US|Hawaii|-157.73|21.26,IA|US|Iowa|-92.79|41.88,ID|US|Idaho|-115.65|44.2,IL|US|Illinois|-88.05|41.67,IN|US|Indiana|-86.27|40.23,KS|US|Kansas|-96|38.59,KY|US|Kentucky|-84.91|38.13,LA|US|Louisiana|-91.28|30.57,MA|US|Massachusetts|-71.28|42.32,MB|CA|Manitoba|-97.3|49.88,MD|US|Maryland|-76.79|39.18,ME|US|Maine|-70.01|43.92,MI|US|Michigan|-83.69|42.56,MN|US|Minnesota|-93.26|44.98,MO|US|Missouri|-92.66|38.73,MS|US|Mississippi|-89.62|32.36,MT|US|Montana|-111.07|46.37,MX01|MX|Aguascalientes|-102.29|21.91,MX02|MX|Baja California|-116.5|32.46,MX03|MX|Baja California Sur|-110.12|23.52,MX04|MX|Campeche|-91.08|19.25,MX05|MX|Chiapas|-92.77|16.28,MX06|MX|Chihuahua|-106.27|30.1,MX07|MX|Coahuila|-101.88|26.32,MX08|MX|Colima|-103.94|19.15,MX09|MX|Mexico City|-99.13|19.41,MX10|MX|Durango|-104.24|24.64,MX11|MX|Guanajuato|-101.37|20.87,MX12|MX|Guerrero|-99.83|17.31,MX13|MX|Hidalgo|-98.81|20.13,MX14|MX|Jalisco|-103.39|20.64,MX15|MX|M\xE9xico|-99.14|19.51,MX16|MX|Michoac\xE1n|-101.68|19.49,MX17|MX|Morelos|-99.15|18.88,MX18|MX|Nayarit|-104.89|21.5,MX19|MX|Nuevo Le\xF3n|-100.26|25.69,MX20|MX|Oaxaca|-96.23|17.05,MX21|MX|Puebla|-98.12|19.07,MX22|MX|Quer\xE9taro|-100.35|20.57,MX23|MX|Quintana Roo|-87.09|20.7,MX24|MX|San Luis Potos\xED|-100.7|22.22,MX25|MX|Sinaloa|-107.49|24.63,MX26|MX|Sonora|-111.05|29.37,MX27|MX|Tabasco|-92.98|17.99,MX28|MX|Tamaulipas|-98.33|24.92,MX29|MX|Tlaxcala|-98.19|19.31,MX30|MX|Veracruz|-96.31|19.2,MX31|MX|Yucat\xE1n|-89.52|20.94,MX32|MX|Zacatecas|-102.7|22.93,NB|CA|New Brunswick|-65.73|45.83,NC|US|North Carolina|-79.61|35.57,ND|US|North Dakota|-98.8|47.31,NE|US|Nebraska|-96.42|41.07,NH|US|New Hampshire|-71.37|43,NJ|US|New Jersey|-74.34|40.51,NL|CA|Newfoundland and Labrador|-52.77|47.55,NM|US|New Mexico|-106.28|34.69,NS|CA|Nova Scotia|-63.11|44.86,NV|US|Nevada|-115.95|36.72,NY|US|New York|-74.13|40.89,OH|US|Ohio|-82.75|40.53,OK|US|Oklahoma|-97.01|35.66,ON|CA|Ontario|-79.27|43.94,OR|US|Oregon|-122.75|44.96,PA|US|Pennsylvania|-76.12|40.23,PE|CA|Prince Edward Island|-63.13|46.23,QC|CA|Quebec|-73.14|45.89,RI|US|Rhode Island|-71.45|41.79,SC|US|South Carolina|-80.69|33.6,SD|US|South Dakota|-98.66|43.89,SK|CA|Saskatchewan|-105.99|51.63,TN|US|Tennessee|-87.53|35.63,TX|US|Texas|-97.51|31.01,UT|US|Utah|-111.96|40.5,VA|US|Virginia|-77.08|37.61,VT|US|Vermont|-73.21|44.48,WA|US|Washington|-121.46|47.29,WI|US|Wisconsin|-88.6|43.36,WV|US|West Virginia|-81.42|38.99,WY|US|Wyoming|-105.54|42.26,YT|CA|Yukon|-135.05|60.72",rn="006|-66.84|18.26,007|-66.15|18.15,008|-64.74|17.74,009|-66.12|18.37,010|-72.6|42.26,011|-72.53|42.07,012|-73.21|42.37,013|-72.51|42.58,014|-71.81|42.59,015|-71.85|42.23,016|-71.84|42.28,017|-71.44|42.33,018|-71.21|42.64,019|-70.89|42.66,020|-71.28|42.12,021|-71.05|42.31,022|-71.04|42.35,023|-70.86|41.98,024|-71.22|42.37,025|-70.6|41.71,026|-70.2|41.73,027|-71.07|41.77,028|-71.62|41.69,029|-71.47|41.82,030|-71.51|42.9,031|-71.48|43,032|-71.65|43.57,033|-71.58|43.26,034|-72.19|42.91,035|-71.31|44.69,036|-72.32|43.17,037|-72.13|43.69,038|-71.1|43.56,039|-70.76|43.24,040|-70.6|43.78,041|-70.27|43.7,042|-70.49|44.38,043|-69.75|44.3,044|-68.83|45.45,045|-69.57|43.99,046|-67.8|44.79,047|-68.34|46.55,048|-69.17|44.2,049|-69.97|44.99,050|-72.43|43.85,051|-72.65|43.28,052|-73.14|43.03,053|-72.77|42.94,054|-72.98|44.58,056|-72.6|44.35,057|-73.04|43.69,058|-72.12|44.68,059|-71.7|44.79,060|-72.81|41.88,061|-72.69|41.74,062|-72.12|41.81,063|-72.03|41.5,064|-72.61|41.46,065|-72.94|41.36,066|-73.22|41.24,067|-73.24|41.68,068|-73.42|41.28,069|-73.57|41.14,070|-74.28|40.76,071|-74.2|40.74,072|-74.2|40.68,073|-74.08|40.71,074|-74.4|41.09,075|-74.17|40.92,076|-74.01|40.94,077|-74.17|40.28,078|-74.81|40.97,079|-74.55|40.74,080|-74.98|39.78,081|-75.07|39.94,082|-74.68|39.32,083|-75.04|39.45,084|-74.48|39.35,085|-74.62|40.25,086|-74.68|40.23,087|-74.22|39.96,088|-74.72|40.54,089|-74.48|40.45,100|-73.96|40.77,101|-73.95|40.78,102|-74.02|40.72,103|-74.15|40.58,104|-73.85|40.9,105|-73.75|41.27,106|-73.74|41.02,107|-73.84|40.96,108|-73.8|40.95,109|-74.27|41.3,110|-73.69|40.74,111|-73.93|40.76,112|-73.94|40.66,113|-73.84|40.73,114|-73.77|40.69,115|-73.62|40.71,116|-73.88|40.57,117|-73.23|40.82,118|-73.5|40.77,119|-72.53|40.95,120|-74.22|42.92,121|-74.4|43.46,122|-73.81|42.7,123|-73.96|42.82,124|-74.27|42.09,125|-73.7|41.89,126|-73.88|41.69,127|-74.75|41.74,128|-73.91|43.61,129|-74.03|44.53,130|-76.16|43.08,131|-76.46|43.27,132|-76.2|43.03,133|-75.07|43.45,134|-75.35|43.03,135|-75.15|43.14,136|-75.39|44.33,137|-75.2|42.21,138|-75.46|42.43,139|-75.88|42.12,140|-78.48|43.01,141|-78.7|42.49,142|-78.8|42.91,143|-78.96|43.12,144|-77.71|42.96,145|-77.17|43.14,146|-77.65|43.17,147|-78.84|42.21,148|-77.18|42.29,149|-76.78|42.09,150|-80.23|40.56,151|-80.18|40.53,152|-79.97|40.46,153|-80.24|40.01,154|-79.65|39.92,155|-78.8|39.95,156|-79.47|40.33,157|-79.02|40.71,158|-78.66|41.32,159|-78.84|40.35,160|-79.88|40.93,161|-80.3|41.19,162|-79.35|41.08,163|-79.58|41.59,164|-80|41.87,165|-80.04|42.1,166|-78.28|40.48,167|-78.47|41.76,168|-78|40.97,169|-77.37|41.8,170|-77.29|40.44,171|-76.78|40.33,172|-77.81|39.98,173|-76.93|39.89,174|-76.72|39.97,175|-76.24|40.05,176|-76.34|40.05,177|-77.22|41.34,178|-76.77|40.93,179|-76.27|40.69,180|-75.45|40.67,181|-75.47|40.6,182|-75.88|40.9,183|-75.19|41.12,184|-75.38|41.53,185|-75.68|41.37,186|-76.17|41.4,187|-75.86|41.22,188|-76.12|41.82,189|-75.14|40.36,190|-75.37|39.97,191|-75.15|40.01,193|-75.78|39.92,194|-75.46|40.19,195|-75.9|40.42,196|-75.95|40.34,197|-75.68|39.53,198|-75.58|39.77,199|-75.46|38.83,200|-77.02|38.9,201|-77.68|38.9,202|-77.03|38.89,203|-77.01|38.86,204|-77.05|38.89,205|-77.01|38.87,206|-76.76|38.45,207|-76.78|38.88,208|-77.23|39.15,209|-76.99|39.05,210|-76.32|39.53,211|-76.73|39.58,212|-76.58|39.31,214|-76.55|39,215|-79.08|39.56,216|-76.02|38.86,217|-77.5|39.52,218|-75.57|38.27,219|-75.94|39.57,220|-77.25|38.78,221|-77.25|38.92,222|-77.11|38.88,223|-77.13|38.79,224|-77.25|38.22,225|-77.51|38.09,226|-78.25|39.03,227|-78.05|38.49,228|-78.79|38.57,229|-78.55|38.02,230|-78.09|37.66,231|-76.96|37.55,232|-77.46|37.51,233|-76.3|36.68,234|-76.66|36.77,235|-76.26|36.87,236|-76.44|37.12,237|-76.38|36.85,238|-77.41|36.94,239|-78.39|37.03,240|-80.1|37.23,241|-79.89|36.9,242|-82.49|36.83,243|-81.13|36.86,244|-79.51|38.05,245|-79.11|37.15,246|-81.8|37.19,247|-81.14|37.39,248|-81.64|37.47,249|-80.32|37.95,250|-81.45|38.27,251|-81.89|38.64,252|-81.45|38.77,253|-81.64|38.42,254|-78.11|39.45,255|-82.19|38.25,256|-82.08|37.76,257|-82.41|38.4,258|-81.21|37.72,259|-80.89|37.83,260|-80.63|40.05,261|-81.27|39.2,262|-80.02|38.75,263|-80.23|39.27,264|-80.65|39.21,265|-80.05|39.59,266|-80.8|38.48,267|-78.98|39.33,268|-79.12|38.88,270|-80.45|36.24,271|-80.24|36.06,272|-79.82|35.86,273|-79.52|35.55,274|-79.81|36.09,275|-78.54|35.93,276|-78.65|35.81,277|-78.9|35.99,278|-77.32|35.88,279|-76.5|36.19,280|-81.2|35.4,281|-80.41|35.21,282|-80.83|35.22,283|-78.94|34.96,284|-78.23|34.39,285|-77.23|35.06,286|-81.36|36.06,287|-82.78|35.51,288|-82.55|35.6,289|-83.97|35.11,290|-80.88|34.19,291|-80.62|33.71,292|-80.96|34.04,293|-81.86|34.78,294|-80.08|33.05,295|-79.49|34.07,296|-82.57|34.61,297|-80.92|34.83,298|-81.74|33.51,299|-80.96|32.55,300|-84.08|33.85,301|-84.91|34.04,302|-84.55|33.25,303|-84.42|33.77,304|-82.11|32.48,305|-83.81|34.58,306|-83.14|33.86,307|-85.1|34.71,308|-82.34|33.35,309|-82.01|33.4,310|-83.42|32.64,312|-83.64|32.83,313|-81.49|31.68,314|-81.15|32.03,315|-82.21|31.4,316|-83.21|31.02,317|-83.87|31.48,318|-84.69|32.45,319|-84.95|32.47,320|-82.58|30.27,321|-81.48|29.39,322|-81.69|30.3,323|-84.25|30.29,324|-85.58|30.55,325|-87.03|30.76,326|-82.6|29.58,327|-81.28|28.79,328|-81.32|28.47,329|-80.67|27.96,330|-80.58|25.31,331|-80.38|25.74,333|-80.25|26.13,334|-81.01|26.64,335|-82.22|28.19,336|-82.47|28.01,337|-82.73|27.85,338|-81.64|27.72,339|-81.71|26.77,341|-81.32|26.11,342|-82.16|27.29,344|-82.35|29.01,346|-82.52|28.41,347|-81.4|28.29,349|-80.72|27.34,350|-86.8|34.05,351|-86.38|33.43,352|-86.77|33.5,354|-87.86|33.07,355|-87.71|33.96,356|-87.4|34.67,357|-86.26|34.75,358|-86.59|34.69,359|-85.94|34.27,360|-86.09|32.09,361|-86.27|32.31,362|-85.65|33.53,363|-85.56|31.34,364|-86.97|31.38,365|-88.14|31.32,366|-88.19|30.68,367|-87.34|32.33,368|-85.41|32.61,369|-88.25|32.12,370|-87.02|36.12,371|-86.23|35.75,372|-86.83|36.15,373|-85.36|35.32,374|-85.33|35.06,376|-82.3|36.36,377|-84.31|36.27,378|-83.35|36.3,379|-83.97|35.97,380|-89.43|35.55,381|-89.96|35.1,382|-88.68|36.29,383|-88.5|35.61,384|-87.36|35.34,385|-85.34|36.18,386|-89.76|34.57,387|-90.81|33.54,388|-88.63|34.36,389|-89.9|33.77,390|-90|32.53,391|-90.67|32.51,392|-90.22|32.32,393|-88.8|32.42,394|-89.26|31.23,395|-89|30.59,396|-90.67|31.32,397|-88.87|33.53,398|-84.67|31.32,400|-85.29|38.07,401|-86.2|37.85,402|-85.66|38.19,403|-84.2|38.06,404|-84.42|37.53,405|-84.45|38.04,406|-84.87|38.22,407|-84.12|36.95,408|-83.26|36.9,409|-83.74|36.95,410|-84.32|38.64,411|-83.06|38.38,412|-82.67|37.89,413|-83.48|37.58,414|-83.15|37.84,415|-82.39|37.46,416|-82.78|37.54,417|-83.25|37.23,418|-82.88|37.21,420|-88.57|36.9,421|-86.09|36.89,422|-87.11|36.95,423|-87.02|37.52,424|-87.7|37.47,425|-84.71|37.15,426|-84.82|36.81,427|-85.73|37.32,430|-82.9|40.21,431|-82.99|39.69,432|-82.97|39.98,433|-83.38|40.55,434|-83.3|41.42,435|-84.22|41.46,436|-83.54|41.67,437|-81.66|39.85,438|-81.88|40.27,439|-80.9|40.25,440|-80.97|41.64,441|-81.66|41.42,442|-81.6|41.13,443|-81.54|41.07,444|-80.77|41.09,445|-80.64|41.05,446|-81.53|40.65,447|-81.39|40.83,448|-82.77|41.02,449|-82.55|40.74,450|-84.48|39.43,451|-83.84|39.16,452|-84.48|39.18,453|-84.3|39.97,454|-84.18|39.74,455|-83.81|39.94,456|-82.86|38.99,457|-81.78|39.35,458|-84.23|40.83,460|-86.13|40.17,461|-86.18|39.62,462|-86.14|39.79,463|-87.05|41.41,464|-87.34|41.55,465|-86.08|41.44,466|-86.28|41.66,467|-85.21|41.17,468|-85.17|41.09,469|-86.14|40.76,470|-85.08|39.16,471|-86.02|38.43,472|-85.74|39.05,473|-85.15|40.09,474|-86.63|38.99,475|-87.03|38.46,476|-87.53|38.13,477|-87.58|38.03,478|-87.29|39.45,479|-87.11|40.5,480|-82.79|42.83,481|-83.62|42.2,482|-83.1|42.38,483|-83.35|42.66,484|-83.22|43.29,485|-83.69|43.03,486|-84.36|43.99,487|-83.67|44.45,488|-84.67|43.02,489|-84.59|42.74,490|-85.54|42.2,491|-86.36|41.87,492|-84.36|42.06,493|-85.57|43.33,494|-86.14|43.39,495|-85.66|42.96,496|-85.52|44.44,497|-84.37|45.17,498|-86.94|46.17,499|-88.93|46.6,500|-94.77|41.63,501|-92.79|41.84,502|-93.67|42.12,503|-93.63|41.59,504|-93.37|43.17,505|-94.45|42.77,506|-92.45|42.65,507|-92.31|42.49,508|-94.56|40.96,510|-95.91|42.6,511|-96.39|42.52,512|-96.06|43.28,513|-95.16|43.27,514|-95.08|42.11,515|-95.55|41.44,516|-95.37|40.74,520|-90.98|42.46,521|-91.73|43.2,522|-92.31|41.9,523|-91.66|41.87,524|-91.69|41.96,525|-92.46|40.95,526|-91.44|40.88,527|-90.88|41.64,528|-90.61|41.56,530|-88.24|43.51,531|-88.33|42.75,532|-87.98|43.06,534|-87.86|42.74,535|-89.66|42.95,537|-89.38|43.08,538|-90.73|42.88,539|-89.55|43.64,540|-92.46|45.08,541|-88.23|45.09,542|-87.6|44.52,543|-88.01|44.53,544|-89.85|44.93,545|-89.86|45.89,546|-90.87|43.93,547|-91.52|44.85,548|-91.63|46.04,549|-88.96|44.19,550|-92.98|45.17,551|-93.08|44.96,553|-94.06|44.99,554|-93.31|45.01,556|-91.03|47.67,557|-92.68|47.39,558|-92.08|46.96,559|-92.28|43.89,560|-94.04|44.02,561|-95.65|43.92,562|-95.75|45.08,563|-94.59|45.83,564|-94.5|46.63,565|-96.08|46.86,566|-94.31|47.88,567|-96.22|48.39,570|-97.07|43.48,571|-96.76|43.54,572|-97.18|45.04,573|-98.53|43.91,574|-98.93|45.36,575|-100.61|43.86,576|-101.59|45.43,577|-103.11|44.26,580|-97.39|46.66,581|-96.83|46.86,582|-97.72|48.25,583|-99.34|48.32,584|-99.12|46.88,585|-100.98|46.76,586|-102.99|46.75,587|-101.7|48.34,588|-103.48|48.2,590|-108.62|45.98,591|-108.45|45.69,592|-105.6|48.2,593|-105.58|46.4,594|-111.24|47.79,595|-109.12|48.38,596|-111.74|46.65,597|-112.31|45.48,598|-114.25|46.97,599|-114.57|48.37,600|-88.15|42.29,601|-88.47|42.01,602|-87.69|42.04,603|-87.79|41.89,604|-88.09|41.39,605|-88.55|41.69,606|-87.69|41.83,607|-87.82|42.03,608|-87.76|41.84,609|-87.92|40.8,610|-89.56|42.18,611|-89.08|42.28,612|-90.29|41.5,613|-89.16|41.34,614|-90.43|40.82,615|-89.68|40.71,616|-89.61|40.72,617|-88.89|40.52,618|-88.15|40.11,619|-88.19|39.66,620|-90.01|39.13,622|-89.72|38.41,623|-91.02|39.99,624|-88.19|39.04,625|-89.21|39.63,626|-90|39.86,627|-89.66|39.8,628|-88.65|38.35,629|-88.89|37.55,630|-90.83|38.35,631|-90.32|38.64,633|-91.11|39.02,634|-91.78|39.93,635|-92.61|40.2,636|-90.64|37.61,637|-89.81|37.37,638|-89.73|36.55,639|-90.62|36.84,640|-94.1|39.07,641|-94.58|39.14,644|-94.69|40.13,645|-94.83|39.75,646|-93.55|39.89,647|-94.15|38.06,648|-94.35|36.93,650|-92.23|38.45,651|-92.19|38.51,652|-92.38|39.21,653|-93.26|38.71,654|-92.03|37.93,655|-91.92|37.67,656|-93.08|36.76,657|-92.43|37.03,658|-93.3|37.22,660|-95.12|38.84,661|-94.73|39.11,662|-94.72|38.95,664|-96.15|39.64,665|-96.34|39.4,666|-95.76|39.06,667|-95.23|37.64,668|-96.39|38.36,669|-97.86|39.77,670|-98.49|37.33,671|-98.4|37.44,672|-97.33|37.7,673|-95.81|37.23,674|-97.79|38.98,675|-98.99|38.25,676|-99.47|39.34,677|-101.15|39.35,678|-100.82|37.91,679|-101.43|37.18,680|-96.46|41.55,681|-96.05|41.24,683|-96.93|40.39,684|-97.26|40.89,685|-96.69|40.82,686|-97.68|41.55,687|-98.16|42.43,688|-99.15|41.34,689|-98.9|40.34,690|-100.99|40.37,691|-101.59|41.42,692|-100.64|42.67,693|-102.84|42.29,700|-89.93|29.63,701|-89.93|30.02,703|-90.65|29.62,704|-90.27|30.66,705|-92.25|30.2,706|-93.21|30.34,707|-91.2|30.57,708|-91.1|30.45,710|-93.4|32.45,711|-93.75|32.47,712|-91.95|32.56,713|-91.86|31.43,714|-92.84|31.57,716|-91.75|33.61,717|-92.79|33.48,718|-93.84|33.66,719|-93.61|34.4,720|-91.9|34.92,721|-92.56|34.93,722|-92.37|34.7,723|-90.59|35.07,724|-90.76|36.04,725|-91.81|36.01,726|-92.93|36.15,727|-94.05|36.11,728|-93.33|35.3,729|-94.08|35.29,730|-97.83|35.31,731|-97.5|35.43,734|-97.14|34.21,735|-98.81|34.53,736|-99.33|35.52,737|-98.2|36.42,738|-99.54|36.5,739|-101.67|36.74,740|-96.19|36.34,741|-95.96|36.15,743|-95.02|36.55,744|-95.44|35.64,745|-95.65|34.66,746|-97.05|36.71,747|-95.41|34.02,748|-96.66|35.17,749|-94.69|35.23,750|-96.76|33.06,751|-96.32|32.48,752|-96.78|32.79,753|-96.84|32.81,754|-95.67|33.37,755|-94.45|33.3,756|-94.58|32.49,757|-95.37|32.24,758|-95.68|31.44,759|-94.29|31.29,760|-97.54|32.59,761|-97.38|32.77,762|-97.44|33.52,763|-98.87|33.73,764|-98.59|32.61,765|-97.62|31.11,766|-97.06|31.7,767|-97.15|31.57,768|-99.37|31.23,769|-100.88|31.03,770|-95.39|29.79,772|-95.37|29.77,773|-95.24|30.48,774|-96.02|29.38,775|-94.98|29.68,776|-94.16|30.27,777|-94.19|29.96,778|-96.32|30.67,779|-96.95|28.92,780|-99.01|28.67,781|-97.93|29.08,782|-98.53|29.47,783|-98.14|27.63,784|-97.44|27.73,785|-98.19|26.39,786|-98.1|30.27,787|-97.78|30.3,788|-100.26|29.44,789|-96.87|29.92,790|-101.63|35.48,791|-101.85|35.21,792|-100.57|34.25,793|-102.15|33.37,794|-101.88|33.58,795|-100.31|32.7,796|-99.72|32.46,797|-102.22|31.57,798|-104.17|30.53,799|-106.16|31.8,800|-105.11|39.91,801|-104.47|39.51,802|-104.93|39.78,803|-105.31|40.04,804|-106.16|39.98,805|-105.35|40.57,806|-104.49|40.38,807|-103.09|40.4,808|-103.16|39.12,809|-104.67|38.79,810|-103.58|37.77,811|-106.39|37.54,812|-106.39|38.46,813|-108.42|37.49,814|-108.02|38.43,815|-108.7|38.92,816|-107.86|39.99,820|-105.27|41.31,821|-110.51|44.57,822|-104.67|42.39,823|-107.03|41.75,824|-108.65|44.32,825|-108.91|43.14,826|-106.43|43.1,827|-105|44.2,828|-106.71|44.55,829|-109.71|42.82,830|-110.51|43.7,831|-110.53|42.6,832|-112.17|42.66,833|-114.23|42.81,834|-111.63|43.86,835|-115.77|46.07,836|-115.99|44,837|-116.04|43.58,838|-116.47|47.77,840|-110.86|40.53,841|-111.81|40.71,843|-112.18|41.67,844|-112.01|41.23,845|-109.72|38.09,846|-111.68|39.63,847|-112.82|37.61,850|-112.09|33.63,851|-111.41|33,852|-111.69|33.6,853|-113.44|33.49,855|-110.3|33.43,856|-110.59|32,857|-111.09|32.18,859|-109.81|34.23,860|-111.15|35.89,863|-112.57|34.85,864|-113.79|35.66,865|-109.55|36.03,870|-106.9|35.22,871|-106.72|35.12,873|-108.56|35.44,874|-108.23|36.59,875|-106.04|36.27,877|-104.68|36.06,878|-107.94|34,879|-107.48|33.2,880|-108.03|32.37,881|-103.81|34.26,882|-104.07|32.87,883|-105.48|33.62,884|-103.79|35.74,890|-114.84|37,891|-115.42|36.33,893|-116.96|39.5,894|-118.06|41.29,895|-119.72|39.9,897|-119.8|39.18,898|-115.71|40.95,900|-118.32|34.04,902|-118.76|34.07,903|-118.34|33.95,904|-118.48|34.02,905|-118.33|33.83,906|-118.03|33.93,907|-118.45|33.39,908|-118.18|33.8,910|-118.25|34.28,911|-118.13|34.15,912|-118.25|34.19,913|-118.55|34.36,914|-118.47|34.18,915|-118.33|34.19,916|-118.38|34.18,917|-117.78|34.14,918|-118.13|34.09,919|-116.62|32.73,920|-116.7|33.16,921|-117.14|32.85,922|-115.5|33.59,923|-117.14|34.66,924|-117.33|34.17,925|-117.06|33.68,926|-117.73|33.63,927|-117.85|33.74,928|-117.71|33.85,930|-119.12|34.39,931|-119.97|34.48,932|-119.07|35.98,933|-119.01|35.35,934|-120.5|35.38,935|-118.36|37.37,936|-119.72|36.95,937|-119.85|36.71,939|-121.42|36.34,940|-122.31|37.41,941|-122.44|37.77,943|-122.13|37.44,944|-122.32|37.53,945|-122.05|38.09,946|-122.19|37.78,947|-122.26|37.89,948|-122.3|37.97,949|-122.74|38.14,950|-121.42|36.85,951|-121.76|37.33,952|-120.79|38.14,953|-120.56|37.62,954|-123.15|39.08,955|-123.75|40.5,956|-121.34|38.62,957|-120.86|39.13,958|-121.44|38.58,959|-121.73|39.47,960|-122.42|41.06,961|-120.33|40.52,967|-155.53|19.6,968|-157.83|21.34,969|144.77|13.45,970|-121.45|45.3,971|-123.79|45.64,972|-122.74|45.57,973|-123.26|44.68,974|-123.46|43.61,975|-123.06|42.34,976|-120.4|42.67,977|-120.77|44.32,978|-118.59|45.21,979|-117.63|43.34,980|-121.78|47.42,981|-122.32|47.6,982|-121.79|48.39,983|-123.87|47.96,984|-122.46|47.18,985|-123.27|46.94,986|-122.15|45.99,988|-119.91|48,989|-120.57|46.71,990|-117.56|47.62,991|-118.13|47.91,992|-117.4|47.67,993|-118.82|46.4,994|-117.21|46.2,995|-156.93|60.89,996|-151.66|60.82,997|-146.69|65.19,998|-136.2|58.94,999|-131.24|55.86",an="ABW|-70.02|12.54,AFG|68|34.63,AGO|14.24|-9.84,AIA|-63.06|18.22,ALA|19.93|60.1,ALB|19.81|41.14,AND|1.53|42.51,ARE|55.24|24.99,ARG|-61.28|-32.95,ARM|44.52|40.23,ASM|-170.7|-14.28,ATA|21.28|-80.52,ATF|70.22|-49.35,ATG|-61.84|17.12,AUS|144.91|-33.49,AUT|15.51|47.93,AZE|49.02|40.37,BDI|29.49|-3.34,BEL|4.37|50.89,BEN|2.33|7.65,BES|-68.27|12.15,BFA|-2.08|12.15,BGD|90.42|23.65,BGR|24.92|42.71,BHR|50.57|26.18,BHS|-77.34|25.06,BIH|17.97|44.18,BLM|-62.85|17.9,BLR|27.81|53.57,BLZ|-88.41|17.54,BMU|-64.78|32.29,BOL|-65.79|-17.39,BRA|-45.89|-17.51,BRB|-59.62|13.11,BRN|114.74|4.82,BTN|89.69|27.32,BWA|25.99|-23.43,CAF|18.32|4.94,CAN|-79.4|43.71,CCK|96.82|-12.16,CHE|7.96|47.07,CHL|-71.21|-33.72,CHN|114.44|32,CIV|-4.89|6.16,CMR|11.19|5.41,COD|20.23|-4.72,COG|14.18|-4.04,COK|-159.78|-21.21,COL|-74.85|5.93,COM|43.58|-11.89,CPV|-23.87|15.66,CRI|-84.14|9.99,CUB|-80.25|22.21,CUW|-68.88|12.12,CXR|105.68|-10.42,CYM|-81.38|19.32,CYP|33.31|35,CZE|15.44|49.89,DEU|9.65|51.24,DJI|43.15|11.59,DMA|-61.39|15.3,DNK|11.42|55.79,DOM|-70.07|18.75,DZA|3.55|35.62,ECU|-79.29|-1.4,EGY|31.22|29.84,ERI|38.84|15.25,ESH|-13.19|27.14,ESP|-2.91|39.69,EST|25.17|59.29,ETH|39.02|9.26,FIN|24.87|61.26,FJI|178.2|-17.85,FLK|-57.86|-51.69,FRA|2.87|47.28,FRO|-6.77|62.01,FSM|158.16|6.92,GAB|10.22|-0.06,GBR|-1.37|52.49,GEO|43.92|41.84,GGY|-2.54|49.46,GHA|-0.98|6.4,GIB|-5.35|36.14,GIN|-12.8|9.75,GLP|-61.53|16.23,GMB|-16.59|13.41,GNB|-15.48|11.9,GNQ|9.77|1.86,GRC|23.73|37.98,GRD|-61.75|12.05,GRL|-51.72|64.18,GTM|-90.71|14.73,GUF|-52.64|5.04,GUM|144.82|13.5,GUY|-58.11|6.63,HKG|114.15|22.33,HMD|73.5|-53.1,HND|-87.41|14.94,HRV|16.21|45.31,HTI|-72.34|18.54,HUN|19.21|47.39,IDN|106.85|-6.21,IMN|-4.48|54.15,IND|78.36|21,IOT|71.35|-6.19,IRL|-6.87|53.12,IRN|51.6|34.4,IRQ|44.78|33.65,ISL|-21.7|64.22,ISR|34.97|32.07,ITA|12|42.73,JAM|-76.91|18.03,JEY|-2.1|49.19,JOR|35.96|32.03,JPN|137.27|35.53,KAZ|70.17|47.24,KEN|36.81|-0.97,KGZ|73.96|41.94,KHM|104.7|11.75,KIR|172.98|1.33,KNA|-62.72|17.3,KOR|127.51|36.58,KWT|48.06|29.2,Kosovo|20.9|42.58,LAO|102.6|17.97,LBN|35.53|33.87,LBR|-10.39|6.36,LBY|13.19|32.89,LCA|-60.97|14.04,LIE|9.52|47.14,LKA|80.25|7.25,LSO|27.67|-29.38,LTU|24.18|55.04,LUX|6.08|49.56,LVA|24.13|56.85,MAC|113.55|22.19,MAF|-63.08|18.07,MAR|-6.65|33.43,MCO|7.42|43.74,MDA|28.82|47.09,MDG|47.46|-18.89,MDV|73.51|4.18,MEX|-100.65|21.59,MHL|171.38|7.09,MKD|21.47|41.8,MLI|-7.15|12.95,MLT|14.46|35.91,MMR|96.18|18.74,MNE|19.17|42.53,MNG|105.33|47.94,MNP|145.75|15.21,MOZ|32.58|-25.97,MRT|-14.58|18.01,MSR|-62.21|16.79,MTQ|-61.01|14.64,MUS|57.51|-20.23,MWI|34.34|-14.24,MYS|103.35|3.45,MYT|45.23|-12.77,N. Cyprus|33.56|35.27,NAM|17.19|-21.34,NCL|166.47|-22.26,NER|5.05|14.04,NFK|167.97|-29.05,NGA|5.91|7.87,NIC|-86.17|12.33,NIU|-169.92|-19.05,NLD|5.21|52.09,NOR|9.62|60.46,NPL|84.7|27.64,NRU|166.93|-0.55,NZL|174.54|-38.9,OMN|57.69|23.27,PAK|71.47|30.24,PAN|-79.83|8.98,PCN|-130.1|-25.07,PER|-76.4|-11.18,PHL|121.05|14.65,PLW|134.58|7.52,PNG|147.4|-7.71,POL|19.26|51.79,PRI|-66.24|18.35,PRK|126.54|39.52,PRT|-9.08|39.42,PRY|-57.15|-25.27,PSE|35.23|31.78,PYF|-149.59|-17.57,QAT|51.49|25.32,REU|55.45|-21.08,ROU|25.47|45.38,RUS|51.84|54.52,RWA|29.78|-1.98,SAU|43.01|23.76,SDN|31.67|14.67,SEN|-16.73|14.66,SGP|103.85|1.33,SGS|-36.51|-54.28,SHN|-5.72|-15.92,SJM|15.65|78.22,SLB|159.97|-9.44,SLE|-12.4|8.36,SLV|-89.08|13.7,SMR|12.45|43.94,SOM|44.96|4.91,SPM|-56.18|46.78,SRB|20.62|44.5,SSD|29.91|6.61,STP|6.73|0.34,SUR|-55.18|5.84,SVK|18.69|48.55,SVN|14.83|46.16,SWE|16.03|58.86,SWZ|31.28|-26.43,SXM|-63.05|18.03,SYC|55.46|-4.62,SYR|37.18|35.12,Somaliland|46.23|9.76,TCA|-72.1|21.74,TCD|16.57|11.53,TGO|1.16|6.8,THA|100.71|13.71,TJK|69.39|39.08,TKM|59.4|38.74,TLS|125.65|-8.67,TON|-175.2|-21.14,TTO|-61.4|10.5,TUN|10.23|35.87,TUR|32.1|39.5,TUV|179.19|-8.52,TWN|121.06|24.37,TZA|36.11|-5.88,UGA|32.23|0.59,UKR|32.8|48.99,URY|-56.28|-34.1,USA|-93.51|37.4,UZB|69.22|41.26,VAT|12.45|41.9,VCT|-61.21|13.14,VEN|-67.82|9.83,VGB|-64.62|18.43,VIR|-64.8|17.9,VNM|106.63|10.82,VUT|168.31|-17.74,WLF|-176.17|-13.28,WSM|-171.77|-13.83,YEM|44.62|14.36,ZAF|26.96|-28.33,ZMB|28.41|-13.86,ZWE|30.49|-18.56";var ut=95,sn=new Set(["n a","none","null","nil","unknown","not applicable","not available","not specified","unspecified","missing","blank","empty","tbd","to be determined"]),Tn=new Set(Array.from(sn).filter(n=>n.includes(" ")&&n!=="n a").map(n=>n.replace(/ /g,"")));function T(n){return n?sn.has(n)||Tn.has(n.replace(/ /g,"")):!0}var ct=80;function g(n){return tn(n.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase()).replace(/[^\p{L}\p{Nd}\s]/gu," ").replace(/\s+/g," ").trim()}function h(n){return G(n)}var hn="AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,AS ASM,AT AUT,AU AUS,AW ABW,AX ALA,AZ AZE,BA BIH,BB BRB,BD BGD,BE BEL,BF BFA,BG BGR,BH BHR,BI BDI,BJ BEN,BL BLM,BM BMU,BN BRN,BO BOL,BQ BES,BR BRA,BS BHS,BT BTN,BV BVT,BW BWA,BY BLR,BZ BLZ,CA CAN,CC CCK,CD COD,CF CAF,CG COG,CH CHE,CI CIV,CK COK,CL CHL,CM CMR,CN CHN,CO COL,CR CRI,CU CUB,CV CPV,CW CUW,CX CXR,CY CYP,CZ CZE,DE DEU,DJ DJI,DK DNK,DM DMA,DO DOM,DZ DZA,EC ECU,EE EST,EG EGY,EH ESH,ER ERI,ES ESP,ET ETH,FI FIN,FJ FJI,FK FLK,FM FSM,FO FRO,FR FRA,GA GAB,GB GBR,GD GRD,GE GEO,GF GUF,GG GGY,GH GHA,GI GIB,GL GRL,GM GMB,GN GIN,GP GLP,GQ GNQ,GR GRC,GS SGS,GT GTM,GU GUM,GW GNB,GY GUY,HK HKG,HM HMD,HN HND,HR HRV,HT HTI,HU HUN,ID IDN,IE IRL,IL ISR,IM IMN,IN IND,IO IOT,IQ IRQ,IR IRN,IS ISL,IT ITA,JE JEY,JM JAM,JO JOR,JP JPN,KE KEN,KG KGZ,KH KHM,KI KIR,KM COM,KN KNA,KP PRK,KR KOR,KW KWT,KY CYM,KZ KAZ,LA LAO,LB LBN,LC LCA,LI LIE,LK LKA,LR LBR,LS LSO,LT LTU,LU LUX,LV LVA,LY LBY,MA MAR,MC MCO,MD MDA,ME MNE,MF MAF,MG MDG,MH MHL,MK MKD,ML MLI,MM MMR,MN MNG,MO MAC,MP MNP,MQ MTQ,MR MRT,MS MSR,MT MLT,MU MUS,MV MDV,MW MWI,MX MEX,MY MYS,MZ MOZ,NA NAM,NC NCL,NE NER,NF NFK,NG NGA,NI NIC,NL NLD,NO NOR,NP NPL,NR NRU,NU NIU,NZ NZL,OM OMN,PA PAN,PE PER,PF PYF,PG PNG,PH PHL,PK PAK,PL POL,PM SPM,PN PCN,PR PRI,PS PSE,PT PRT,PW PLW,PY PRY,QA QAT,RE REU,RO ROU,RS SRB,RU RUS,RW RWA,SA SAU,SB SLB,SC SYC,SD SDN,SE SWE,SG SGP,SH SHN,SI SVN,SJ SJM,SK SVK,SL SLE,SM SMR,SN SEN,SO SOM,SR SUR,SS SSD,ST STP,SV SLV,SX SXM,SY SYR,SZ SWZ,TC TCA,TD TCD,TF ATF,TG TGO,TH THA,TJ TJK,TK TKL,TL TLS,TM TKM,TN TUN,TO TON,TR TUR,TT TTO,TV TUV,TW TWN,TZ TZA,UA UKR,UG UGA,UM UMI,US USA,UY URY,UZ UZB,VA VAT,VC VCT,VE VEN,VG VGB,VI VIR,VN VNM,VU VUT,WF WLF,WS WSM,YE YEM,YT MYT,ZA ZAF,ZM ZMB,ZW ZWE",C=(()=>{let n=new Map;for(let e of hn.split(",")){let[t,i]=e.split(" ");t&&i&&n.set(t,i)}return n})(),Ln=new Set(C.keys()),Pn=new Set(C.values()),Un=["en","fr","es","de","it","pt","ru","ja","zh","ko","ar","hi","tr","pl","he","nl","sv","fi","nb","da","cs","el","uk","ro","id","vi","th","sk","hu","hr"],En={usa:"USA","u.s.":"USA","u.s.a.":"USA",us:"USA",america:"USA","united states of america":"USA","the united states":"USA",uk:"GBR","u.k.":"GBR","great britain":"GBR",britain:"GBR",england:"GBR","south korea":"KOR","north korea":"PRK",korea:"KOR","ivory coast":"CIV","cote d ivoire":"CIV",vietnam:"VNM",laos:"LAO",syria:"SYR",iran:"IRN",russia:"RUS",moldova:"MDA",tanzania:"TZA",bolivia:"BOL",venezuela:"VEN",brunei:"BRN","czech republic":"CZE",czechia:"CZE",slovakia:"SVK",uae:"ARE","united arab emirates":"ARE",drc:"COD","dr congo":"COD","democratic republic of the congo":"COD","republic of the congo":"COG",congo:"COG",swaziland:"SWZ",eswatini:"SWZ","cape verde":"CPV","cabo verde":"CPV",burma:"MMR",myanmar:"MMR",holland:"NLD","the netherlands":"NLD",netherlands:"NLD",vatican:"VAT","vatican city":"VAT",palestine:"PSE",macau:"MAC",macao:"MAC","hong kong":"HKG",taiwan:"TWN",turkey:"TUR",turkiye:"TUR",macedonia:"MKD","north macedonia":"MKD",gambia:"GMB","the gambia":"GMB",bahamas:"BHS","the bahamas":"BHS","east timor":"TLS","timor leste":"TLS"},Bn=Object.freeze({"Antigua and Barbuda":"ATG","Bosnia and Herzegovina":"BIH","Heard Island and McDonald Islands":"HMD","Saint Kitts and Nevis":"KNA","St Kitts and Nevis":"KNA","Saint Pierre and Miquelon":"SPM","St Pierre and Miquelon":"SPM","Saint Vincent and the Grenadines":"VCT","St Vincent and the Grenadines":"VCT","Sao Tome and Principe":"STP","South Georgia and the South Sandwich Islands":"SGS","Svalbard and Jan Mayen":"SJM","Trinidad and Tobago":"TTO","Turks and Caicos Islands":"TCA","Turks and Caicos":"TCA","Wallis and Futuna":"WLF","Saint Helena, Ascension and Tristan da Cunha":"SHN","Bonaire, Sint Eustatius and Saba":"BES","United Kingdom of Great Britain and Northern Ireland":"GBR","Bolivia, Plurinational State of":"BOL","Bolivia (Plurinational State of)":"BOL","Brunei Darussalam":"BRN","Congo, The Democratic Republic of the":"COD","Congo, Democratic Republic of the":"COD","Democratic Republic of Congo":"COD","Falkland Islands (Malvinas)":"FLK","Holy See (Vatican City State)":"VAT","Holy See":"VAT","Iran, Islamic Republic of":"IRN","Iran (Islamic Republic of)":"IRN","Islamic Republic of Iran":"IRN","Korea, Republic of":"KOR","Republic of Korea":"KOR","Korea (the Republic of)":"KOR","Korea, Democratic People's Republic of":"PRK","Democratic People's Republic of Korea":"PRK","Korea (the Democratic People's Republic of)":"PRK","Lao People's Democratic Republic":"LAO","Micronesia, Federated States of":"FSM","Micronesia (Federated States of)":"FSM","Moldova, Republic of":"MDA","Republic of Moldova":"MDA","Palestine, State of":"PSE","State of Palestine":"PSE","Russian Federation":"RUS","Syrian Arab Republic":"SYR","Taiwan, Province of China":"TWN","Tanzania, United Republic of":"TZA","United Republic of Tanzania":"TZA","Venezuela, Bolivarian Republic of":"VEN","Venezuela (Bolivarian Republic of)":"VEN","Viet Nam":"VNM","Virgin Islands, British":"VGB","Virgin Islands, U.S.":"VIR","Saint Martin (French part)":"MAF","Sint Maarten (Dutch part)":"SXM","Netherlands (Kingdom of the)":"NLD","Macedonia, the former Yugoslav Republic of":"MKD"}),Z=null,_=null;function ln(){if(Z)return Z;let n=new Map,e=[],t=["en",...Un.filter(o=>o!=="en")];for(let o of t){let r=null;try{r=new Intl.DisplayNames([o],{type:"region"})}catch{continue}for(let[a,l]of C){let u;try{u=r.of(a)}catch{u=void 0}if(!u||u===a)continue;let c=g(u);c&&!n.has(c)&&n.set(c,l),e.push([u,l])}}for(let[o,r]of Object.entries(Bn)){let a=g(o);a&&!n.has(a)&&n.set(a,r),e.push([o,r])}for(let[o,r]of Object.entries(En)){let a=g(o);a&&n.set(a,r),e.push([o,r])}let i=new U;for(let[o,r]of e){let a=g(o);n.get(a)===r&&(i.add(o,r),i.add(a,r))}return Z=n,_=i,n}function Kn(){return _||ln(),_}function On(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=g(e),i=ln().get(t);return i||(T(t)?null:Kn().get(h(e))??null)}function L(n){return C.get(String(n||"").trim().toUpperCase())??null}function I(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=e.toUpperCase();return t.length===3&&Pn.has(t)?t:t.length===2&&Ln.has(t)?C.get(t)??null:On(e)}var dn={europe:[-25,34,45,71.5],asia:[25,-11,150,56],africa:[-26,-35,58,38],"south-america":[-92,-56,-34,13],"north-america":[-168,7,-52,72],oceania:[110,-48,200,20]};function wn(n,e,t){let i=dn[t];return!i||n<i[1]||n>i[3]?!1:e>=i[0]&&e<=i[2]?!0:i[2]>180&&e+360>=i[0]&&e+360<=i[2]}var Dn=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],xn=[7,72,-172,-52];function un(n,e,t){return n>=t[0]&&n<=t[1]&&e>=t[2]&&e<=t[3]}var y=n=>Math.round(n*10)/10;function St(n,e=3){let t=[],i=[],o=0,r=0,a=Object.keys(dn),l=new Map(a.map(s=>[s,0]));for(let s of n){let p=s?.lat,S=s?.lon;if(typeof p!="number"||typeof S!="number"||!isFinite(p)||!isFinite(S)||p<-90||p>90||S<-180||S>180)continue;t.push(p),i.push(S);for(let m of a)wn(p,S,m)&&l.set(m,l.get(m)+1);let M=s?.country?String(s.country).trim().toUpperCase():"",b=M?B(M):null;b?((M==="US"||M==="USA")&&o++,b==="north-america"&&r++):(Dn.some(m=>un(p,S,m))&&o++,un(p,S,xn)&&r++)}let u=t.length;if(u<e)return null;t.sort((s,p)=>s-p),i.sort((s,p)=>s-p);let c={},f,d=0;for(let s of[...a].sort()){let p=l.get(s);c[s]=y(p/u*100),p>d&&(d=p,f=s)}return{pctUsa:y(o/u*100),pctNa:y(r/u*100),latP5:y(P(t,.05)),latP95:y(P(t,.95)),lonP5:y(P(i,.05)),lonP95:y(P(i,.95)),n:u,regionPct:c,...f?{dominantFrame:f,dominantFramePct:y(d/u*100)}:{}}}var cn={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},E=(()=>{let n=new Map;for(let e of Object.keys(cn))for(let t of cn[e].split(/\s+/))t&&n.set(t,e);return n})();function Hn(n){for(let[e,t]of n){let i=E.get(e);i&&!E.has(t)&&E.set(t,i)}}Hn(C);function B(n){if(!n)return null;let e=String(n).trim().toUpperCase();if(!e)return null;let t=E.get(e);if(t)return t;let i=I(String(n));return i?E.get(i)??null:null}function Rt(n,e=2){return kn(n.map(t=>[t,1]),e)}function kn(n,e=2){let t=new Map,i=0;for(let[l,u]of n){let c=B(l);if(!c)continue;let f=typeof u=="number"&&isFinite(u)&&u>0?u:1;t.set(c,(t.get(c)??0)+f),i+=f}if(i<e||!t.size)return null;let o=0;for(let[l,u]of n)Fn(l)&&(o+=typeof u=="number"&&isFinite(u)&&u>0?u:1);let r="europe",a=-1;for(let l of Array.from(t.keys()).sort()){let u=t.get(l);u>a&&(r=l,a=u)}return{dominantGeoRegion:r,dominantGeoRegionPct:y(a/i*100),regionCount:t.size,middleEastPct:y(Math.min(o,i)/i*100),n:i}}var fn=new Set("AE BH CY EG IL IQ IR JO KW LB OM PS QA SA SY TR YE".split(" ")),pn=new Set([...fn].map(n=>C.get(n)).filter(n=>!!n));function Fn(n){if(!n)return!1;let e=String(n).trim().toUpperCase();if(fn.has(e)||pn.has(e))return!0;let t=I(String(n));return!!t&&pn.has(t)}var Vn=Symbol.for("@bicharts/shape-core/admin1-lookup/v1"),R=(n=>n[Vn]??={lookup:null})(globalThis),Xn=(()=>{let n=new Map;return C.forEach((e,t)=>n.set(e,t)),n})();function bt(n){if(!n||typeof n.cities!="string"||typeof n.admin1!="string")throw new Error("admin1 lookup: not a lookup document");if(R.lookup&&R.lookup.version===n.version)return{cities:R.lookup.cityCount,admin1:R.lookup.admin1Count};let e=new Map,t=(d,s)=>{if(!d)return;let p=e.get(d);p?p.push(s):e.set(d,[s])},i=0;for(let d of n.cities.split(`
3
- `)){let s=d.split("|");if(s.length<6)continue;let p={cc:s[1],a1:s[2],popK:+s[3]||0,lat:+s[4],lon:+s[5],pid:s[7]||""};t(s[0],{...p,primary:!0});for(let S of(s[6]||"").split(";"))t(S,{...p,primary:!1});i++}let o=new Map,r=new Map,a=(d,s)=>{if(!d)return;let p=r.get(d);p?p.includes(s)||p.push(s):r.set(d,[s])},l=0;for(let d of n.admin1.split(`
4
- `)){let s=d.split("|");if(!(s.length<2||!s[0].includes("."))){o.set(s[0],s[1]),a(s[1],s[0]);for(let p of(s[2]||"").split(";"))a(p,s[0]);l++}}let u=new Map,c=new Set;for(let d of(n.crosswalk||"").split(`
5
- `)){let[s,p]=d.split("|");s&&p&&(u.set(s,p),c.add(p))}e.forEach(d=>d.forEach(s=>{s.pid&&c.add(s.pid)}));let f=new Map;for(let d of(n.centers||"").split(`
6
- `)){let[s,p,S]=d.split("|");s&&isFinite(+p)&&isFinite(+S)&&p!==""&&S!==""&&(f.set(s,[+p,+S]),c.add(s))}return R.lookup={version:n.version,cityByKey:e,admin1ByCode:o,admin1ByKey:r,provinceOfCode:u,provinceIds:c,centers:f,cityCount:i,admin1Count:l},{cities:i,admin1:l}}function W(){return R.lookup!==null}function Nt(){R.lookup=null}function mn(n){let e=I(n);return e?Xn.get(e)??null:null}var Yn=10;function Mn(n,e={}){if(!R.lookup||!n)return{status:"unmatched"};let t=g(String(n)),i=R.lookup.cityByKey.get(t);if(!i||i.length===0)return{status:"unmatched"};let o=e.country?mn(e.country):null;if(e.country&&o?i=i.filter(f=>f.cc===o):e.region&&(i=i.filter(f=>B(f.cc)===e.region)),i.length===0)return{status:"unmatched"};let r=i.filter(f=>f.primary),a=r.length>0?r:i,l=new Map;for(let f of a){let d=`${f.cc}|${f.a1}|${f.lat}|${f.lon}`;l.has(d)||l.set(d,f)}let u=[...l.values()].sort((f,d)=>d.popK-f.popK),c=u[0];return u.length===1||c.popK>=Yn*Math.max(u[1].popK,1)?!c.a1&&!c.pid?{status:"unmatched"}:{status:"resolved",cc:c.cc,admin1:c.a1,code:`${c.cc}.${c.a1}`,provinceId:c.pid||null,lat:c.lat,lon:c.lon,popK:c.popK}:{status:"ambiguous",candidates:u.length}}function vn(n,e){if(!R.lookup||!n)return[];let t=R.lookup.admin1ByKey.get(g(String(n)))??[],i=e?mn(e):null;return i?t.filter(o=>o.startsWith(i+".")):[...t]}function Zn(n){return!R.lookup||!n?null:R.lookup.provinceOfCode.get(n)??null}function It(n){return!R.lookup||!n?!1:R.lookup.provinceIds.has(String(n).trim().toUpperCase())}function gn(n){return!R.lookup||!n?null:R.lookup.centers?.get(String(n).trim().toUpperCase())??null}function z(n,e={}){if(!R.lookup||!n)return{status:"unmatched"};let t=String(n).trim();if(!t)return{status:"unmatched"};if(R.lookup.provinceIds.has(t.toUpperCase()))return{status:"resolved",provinceId:t.toUpperCase()};let i=R.lookup.provinceOfCode.get(t.toUpperCase());if(i)return{status:"resolved",provinceId:i};let o=[...new Set(vn(t,e.country??null).map(Zn).filter(r=>!!r))];if(o.length>1&&e.region){let r=o.filter(a=>B(a.split("-")[0])===e.region);r.length&&(o=r)}return o.length===1?{status:"resolved",provinceId:o[0]}:o.length?{status:"ambiguous",candidates:o.length}:{status:"unmatched"}}var _n={"north-america":"N",world:"W"};function nn(n,e){let t=n.filter(i=>i.row.kinds.includes(_n[e||"north-america"]));return t.length?t:(e||"north-america")==="world"?n:t}var V=en;function Kt(n){n!==V&&(V=n||"",D=null,x=null,H=null,k=null,F=null)}function Wn(){return V.length>0}var zn={US:"washington",CA:"ottawa",MX:"mexico city",GB:"london",FR:"paris",DE:"berlin",IT:"rome",ES:"madrid",PT:"lisbon",NL:"amsterdam",BE:"brussels",CH:"bern",AT:"vienna",IE:"dublin",PL:"warsaw",SE:"stockholm",NO:"oslo",DK:"copenhagen",FI:"helsinki",IS:"reykjavik",CZ:"prague",SK:"bratislava",HU:"budapest",RO:"bucharest",BG:"sofia",GR:"athens",TR:"ankara",UA:"kyiv",RU:"moscow",RS:"belgrade",HR:"zagreb",SI:"ljubljana",EE:"tallinn",LV:"riga",LT:"vilnius",JP:"tokyo",CN:"beijing",KR:"seoul",KP:"pyongyang",IN:"new delhi",PK:"islamabad",BD:"dhaka",LK:"colombo",TH:"bangkok",VN:"hanoi",PH:"manila",ID:"jakarta",MY:"kuala lumpur",SG:"singapore",MM:"naypyidaw",KH:"phnom penh",LA:"vientiane",NP:"kathmandu",AF:"kabul",IR:"tehran",IQ:"baghdad",SA:"riyadh",AE:"abu dhabi",QA:"doha",KW:"kuwait city",BH:"manama",OM:"muscat",JO:"amman",LB:"beirut",SY:"damascus",IL:"jerusalem",YE:"sanaa",EG:"cairo",LY:"tripoli",TN:"tunis",DZ:"algiers",MA:"rabat",SD:"khartoum",ET:"addis ababa",KE:"nairobi",TZ:"dodoma",UG:"kampala",NG:"abuja",GH:"accra",CI:"yamoussoukro",SN:"dakar",ML:"bamako",CM:"yaounde",CD:"kinshasa",CG:"brazzaville",AO:"luanda",ZM:"lusaka",ZW:"harare",MZ:"maputo",BW:"gaborone",NA:"windhoek",ZA:"pretoria",AU:"canberra",NZ:"wellington",PG:"port moresby",FJ:"suva",BR:"brasilia",AR:"buenos aires",CL:"santiago",PE:"lima",CO:"bogota",VE:"caracas",EC:"quito",BO:"la paz",PY:"asuncion",UY:"montevideo",GY:"georgetown",SR:"paramaribo",CU:"havana",DO:"santo domingo",HT:"port au prince",JM:"kingston",TT:"port of spain",PA:"panama city",CR:"san jose",NI:"managua",HN:"tegucigalpa",SV:"san salvador",GT:"guatemala city",BZ:"belmopan",AZ:"baku",AM:"yerevan",GE:"tbilisi",KZ:"astana",UZ:"tashkent",TM:"ashgabat",KG:"bishkek",TJ:"dushanbe",MN:"ulaanbaatar",BY:"minsk",MD:"chisinau",AL:"tirana",MK:"skopje",BA:"sarajevo",ME:"podgorica",XK:"pristina",CY:"nicosia",MT:"valletta",LU:"luxembourg"},D=null;function K(){if(D)return D;let n=new Map,e=V,t=(i,o,r)=>{if(!i)return;let a=n.get(i);a?a.some(l=>l.row===o)||a.push({row:o,primary:r}):n.set(i,[{row:o,primary:r}])};for(let i of e.split(",")){let o=i.split("|");if(o.length<7)continue;let r={a1:o[1],cc:o[2],lon:+o[3],lat:+o[4],pop:+o[5],kinds:o[6]||"N"};o.length>8&&o[8]&&(r.tags=o[8].split(";").filter(Boolean));let a=zn[r.cc];if(a&&G(o[0])===G(a)&&(r.tags||(r.tags=[]),r.tags.includes("capital")||r.tags.push("capital")),t(g(o[0]),r,!0),o.length>7&&o[7])for(let l of o[7].split(";"))t(g(l),r,!1)}for(let i of n.values())i.sort((o,r)=>r.row.pop-o.row.pop);return D=n,n}var Jn=200,x=null;function yn(){if(x)return x;let n=new Map;for(let[e,t]of K()){if(!e.endsWith(" city"))continue;let i=e.slice(0,-5);!i||K().get(i)?.some(o=>o.primary)||t[0].row.pop<Jn||n.set(i,t)}return x=n,n}function X(n,e){if(!n)return;let t=Sn(K(),yn(),n);if(t)return t;if(T(n))return;let i=e??G(n);if(v(i))return Sn(Qn(),jn(),i)}function Sn(n,e,t){let i=n.get(t);if(i?.some(a=>a.primary))return i;let o=e.get(t);if(!o)return i;let r=o.map(a=>({row:a.row,primary:!0}));return i?[...r,...i]:r}var H=null;function Qn(){return H||(H=bn(K())),H}var k=null;function jn(){return k||(k=bn(yn())),k}function bn(n){let e=new Map;for(let[t,i]of n){let o=G(t);if(!v(o))continue;let r=e.get(o);if(!r){e.set(o,i.slice());continue}for(let a of i){let l=r.findIndex(u=>u.row===a.row);l<0?r.push(a):a.primary&&!r[l].primary&&(r[l]=a)}}for(let t of e.values())t.sort((i,o)=>o.row.pop-i.row.pop);return e}var F=null;function $n(){if(F)return F;let n=new Map;for(let t of an.split(",")){let i=t.split("|");i.length<3||n.set(i[0],{lon:+i[1],lat:+i[2]})}let e=new Map;for(let t of K().values())for(let i of t){let o=L(i.row.cc);if(!o)continue;let r=e.get(o);(r===void 0||i.row.pop>r)&&(e.set(o,i.row.pop),n.set(o,{lon:i.row.lon,lat:i.row.lat}))}return F=n,n}var J=null;function Y(){if(J)return J;let n=new Map;for(let e of on.split(",")){let t=e.split("|");if(t.length<5)continue;let i={key:t[0],cc:t[1],name:t[2],lon:+t[3],lat:+t[4]};n.set(g(i.key),i);let o=g(i.name);o==="mexico"&&i.cc==="MX"?(n.set("estado de mexico",i),n.set("edomex",i)):n.set(o,i)}return J=n,n}var Q=null;function qn(){if(Q)return Q;let n=new U;for(let[e,t]of Y())n.add(e,t);return Q=n,n}var j=null;function nt(){if(j)return j;let n=new Map;for(let e of rn.split(",")){let t=e.split("|");t.length<3||n.set(t[0],{lon:+t[1],lat:+t[2]})}return j=n,n}var tt=new Set(["USA","PRI","VIR","GUM","ASM","MNP"]),Nn=new Set(["USA","CAN","MEX"]);function Rn(n,e){return e!=="north-america"||!!n&&Nn.has(n)}function An(n){if(n==null)return null;let e=g(String(n));if(!e)return null;let t=Y().get(e);return t?t.key:T(e)?null:qn().get(h(String(n)))?.key??null}var In={us:"US",usa:"US","u s":"US","u s a":"US",america:"US","united states":"US","united states of america":"US",ca:"CA",can:"CA",canada:"CA",mx:"MX",mex:"MX",mexico:"MX","estados unidos mexicanos":"MX"};function Ot(n){if(n==null)return null;let e=g(String(n));if(!e)return null;let t=In[e];return t||(T(e)?null:et().get(h(String(n)))??null)}var $=null;function et(){if($)return $;let n=new U;for(let[e,t]of Object.entries(In))n.add(e,t);return $=n,n}function it(n){return Y().get(g(n))?.cc??null}function ot(n){let e=it(n);return e?L(e):null}function wt(n){return Gn(n)[0]??null}function rt(n){if(n==null)return null;let e=String(n).trim().replace(/\.0+$/,"");if(!e)return null;let t=/^(\d{5})(-\d{4})?$/.exec(e);return t?t[1]:/^\d{3,4}$/.test(e)?e.padStart(5,"0"):null}function Gn(n){if(n==null)return[];let e=String(n).trim().replace(/\.0+$/,"");if(!e)return[];if(/^\d{3}$/.test(e)){let i=e.padStart(5,"0").slice(0,3);return i===e?[e]:[e,i]}let t=rt(e);return t?[t.slice(0,3)]:[]}function at(n){return!!n&&n.ambiguous===!0&&!("precision"in n)}function st(n){let e=null,t=typeof n.lat=="string"?n.lat.trim():n.lat,i=typeof n.lon=="string"?n.lon.trim():n.lon;if(t!=null&&t!==""&&i!==void 0&&i!==null&&i!==""){let a=+t,l=+i;if(isFinite(a)&&isFinite(l)&&a>=-90&&a<=90&&l>=-180&&l<=180)if(a===0&&l===0)e={lat:0,lon:0,precision:"latlon"};else return{lat:a,lon:l,precision:"latlon"}}let o=I(n.country),r=An(n.state);if(r&&o&&ot(r)!==o&&(r=null),r&&n.region&&n.region!=="north-america"&&(r=null),n.city!==void 0&&n.city!==null){let a=g(String(n.city)),l=X(a,h(String(n.city))),u=l?nn(l,n.mapKind):null;if(u&&u.length){let c=n.state===void 0||n.state===null?"":String(n.state).trim(),f=c?g(c):"",d=c?An(c):null,s=[],p=-1;for(let M of u){let b=M.row,m=0;if(c&&b.a1!=="")if(d&&b.a1===d||g(b.a1)===f)m++;else continue;if(o)if(L(b.cc)===o)m++;else continue;m>p?(p=m,s=[M]):m===p&&s.push(M)}s.some(M=>M.primary)&&(s=s.filter(M=>M.primary));let S=new Map;for(let M of s)S.set(M.row.lon.toFixed(2)+","+M.row.lat.toFixed(2),M.row);if(S.size===1){let M=s[0].row;return{lat:M.lat,lon:M.lon,precision:"city"}}if(S.size>1)return{ambiguous:!0,matches:S.size}}if(W()){let c=Mn(String(n.city),{country:n.country??null,region:n.region??null});if(c.status==="ambiguous")return{ambiguous:!0,matches:c.candidates};if(c.status==="resolved"&&Rn(L(c.cc),n.mapKind)){let f=n.state===void 0||n.state===null?"":String(n.state).trim(),d=f?z(f,{country:n.country??null,region:n.region??null}):null;if(!d||d.status==="resolved"&&d.provinceId===c.provinceId)return{lat:c.lat,lon:c.lon,precision:"city"}}}}if(!o||tt.has(o))for(let a of Gn(n.zip)){let l=nt().get(a);if(l)return{lat:l.lat,lon:l.lon,precision:"zip3"}}if(r){let a=Y().get(g(r));if(a)return{lat:a.lat,lon:a.lon,precision:"state"}}if(!r&&n.state!==void 0&&n.state!==null&&String(n.state).trim()&&W()){let a=z(String(n.state),{country:n.country??null,region:n.region??null});if(a.status==="ambiguous")return{ambiguous:!0,matches:a.candidates};if(a.status==="resolved"){let l=L(a.provinceId.split("-")[0]),u=gn(a.provinceId);if(u&&(!o||l===o)&&Rn(l,n.mapKind))return{lat:u[1],lon:u[0],precision:"state"}}}if(o&&(n.mapKind!=="north-america"||Nn.has(o))){let a=$n().get(o);if(a)return{lat:a.lat,lon:a.lon,precision:"country"}}return e}var w={latlon:0,city:1,zip3:2,state:3,country:4},Cn=8;function Dt(n,e,t){let i=new Array(n.length),o=new Array(n.length),r=new Array(n.length),a=new Set,l=[],u=new Set,c=[],f=new Set,d=[],s={latlon:0,city:0,zip3:0,state:0,country:0},p=0,S=0,M=null;for(let m=0;m<n.length;++m){let O=n[m],N=st({...O,mapKind:e,region:t});if(at(N)){i[m]=null,o[m]=null,r[m]=null,S++;let A=q(O);A&&!f.has(A.toLowerCase())&&(f.add(A.toLowerCase()),d.length<Cn&&d.push(A))}else if(N){if(i[m]=N.lat,o[m]=N.lon,r[m]=N.precision,p++,s[N.precision]++,(M===null||w[N.precision]>w[M])&&(M=N.precision),w[N.precision]>w.city){let A=q(O);A&&!u.has(A.toLowerCase())&&(u.add(A.toLowerCase()),c.length<Cn&&c.push(A))}}else{i[m]=null,o[m]=null,r[m]=null;let A=q(O);A&&!a.has(A.toLowerCase())&&(a.add(A.toLowerCase()),l.push(A))}}let b=!Wn()&&n.some(m=>m.city!==null&&m.city!==void 0&&String(m.city).trim()!=="");return{lat:i,lon:o,precisions:r,precision:M,precisionCounts:s,coarseExamples:c,unmatched:l,ambiguousRows:S,ambiguousExamples:d,matchedRows:p,totalRows:n.length,...b?{cityTableMissing:!0}:{}}}function q(n){let e=[n.city,n.state,n.zip,n.country].filter(t=>t!=null&&String(t).trim()!=="").map(t=>String(t).trim()).join(", ");return e||(n.label===null||n.label===void 0?"":String(n.label).trim())}function xt(n,e){let t=g(String(n??""));if(!t)return[];let i=X(t,h(String(n??"")));if(!i)return[];let o=I(e??null),r=new Set;for(let a of i)if(!(o&&L(a.row.cc)!==o))for(let l of a.row.tags??[])r.add(l);return Array.from(r)}function Ht(n,e){if(!n)return!1;let t=X(n);return t?nn(t,e).length>0:!1}function kt(n,e){let t=new Set,i=0;for(let o of n){if(o==null)continue;let r=g(String(o));if(T(r)||t.has(r))continue;t.add(r);let a=X(r,h(String(o)));a&&nn(a,e).length>0&&i++}return t.size===0?0:Math.round(i/t.size*1e3)/10}export{ut as a,T as b,ct as c,g as d,h as e,Ln as f,Pn as g,ln as h,On as i,I as j,dn as k,St as l,Hn as m,B as n,Rt as o,kn as p,Fn as q,bt as r,W as s,Nt as t,mn as u,Yn as v,Mn as w,vn as x,Zn as y,It as z,z as A,Kt as B,Wn as C,Nn as D,An as E,Ot as F,wt as G,rt as H,Gn as I,at as J,st as K,Dt as L,xt as M,Ht as N,kt as O};
2
+ import{a as en}from"./chunk-5MRZID36.mjs";import{a as tn,b as G,d as v,e as U}from"./chunk-5HI6TVMM.mjs";import{p as P}from"./chunk-CZJ7M6A5.mjs";var on="AB|CA|Alberta|-113.75|52.18,AK|US|Alaska|-148.32|61.29,AL|US|Alabama|-86.73|33.08,AR|US|Arkansas|-92.85|35.29,AZ|US|Arizona|-111.99|33.32,BC|CA|British Columbia|-122.73|49.27,CA|US|California|-119.21|35.2,CO|US|Colorado|-105|39.63,CT|US|Connecticut|-73.01|41.42,DC|US|District of Columbia|-77.04|38.9,DE|US|Delaware|-75.59|39.57,FL|US|Florida|-81.29|27.53,GA|US|Georgia|-84.02|33.43,HI|US|Hawaii|-157.73|21.26,IA|US|Iowa|-92.79|41.88,ID|US|Idaho|-115.65|44.2,IL|US|Illinois|-88.05|41.67,IN|US|Indiana|-86.27|40.23,KS|US|Kansas|-96|38.59,KY|US|Kentucky|-84.91|38.13,LA|US|Louisiana|-91.28|30.57,MA|US|Massachusetts|-71.28|42.32,MB|CA|Manitoba|-97.3|49.88,MD|US|Maryland|-76.79|39.18,ME|US|Maine|-70.01|43.92,MI|US|Michigan|-83.69|42.56,MN|US|Minnesota|-93.26|44.98,MO|US|Missouri|-92.66|38.73,MS|US|Mississippi|-89.62|32.36,MT|US|Montana|-111.07|46.37,MX01|MX|Aguascalientes|-102.29|21.91,MX02|MX|Baja California|-116.5|32.46,MX03|MX|Baja California Sur|-110.12|23.52,MX04|MX|Campeche|-91.08|19.25,MX05|MX|Chiapas|-92.77|16.28,MX06|MX|Chihuahua|-106.27|30.1,MX07|MX|Coahuila|-101.88|26.32,MX08|MX|Colima|-103.94|19.15,MX09|MX|Mexico City|-99.13|19.41,MX10|MX|Durango|-104.24|24.64,MX11|MX|Guanajuato|-101.37|20.87,MX12|MX|Guerrero|-99.83|17.31,MX13|MX|Hidalgo|-98.81|20.13,MX14|MX|Jalisco|-103.39|20.64,MX15|MX|M\xE9xico|-99.14|19.51,MX16|MX|Michoac\xE1n|-101.68|19.49,MX17|MX|Morelos|-99.15|18.88,MX18|MX|Nayarit|-104.89|21.5,MX19|MX|Nuevo Le\xF3n|-100.26|25.69,MX20|MX|Oaxaca|-96.23|17.05,MX21|MX|Puebla|-98.12|19.07,MX22|MX|Quer\xE9taro|-100.35|20.57,MX23|MX|Quintana Roo|-87.09|20.7,MX24|MX|San Luis Potos\xED|-100.7|22.22,MX25|MX|Sinaloa|-107.49|24.63,MX26|MX|Sonora|-111.05|29.37,MX27|MX|Tabasco|-92.98|17.99,MX28|MX|Tamaulipas|-98.33|24.92,MX29|MX|Tlaxcala|-98.19|19.31,MX30|MX|Veracruz|-96.31|19.2,MX31|MX|Yucat\xE1n|-89.52|20.94,MX32|MX|Zacatecas|-102.7|22.93,NB|CA|New Brunswick|-65.73|45.83,NC|US|North Carolina|-79.61|35.57,ND|US|North Dakota|-98.8|47.31,NE|US|Nebraska|-96.42|41.07,NH|US|New Hampshire|-71.37|43,NJ|US|New Jersey|-74.34|40.51,NL|CA|Newfoundland and Labrador|-52.77|47.55,NM|US|New Mexico|-106.28|34.69,NS|CA|Nova Scotia|-63.11|44.86,NV|US|Nevada|-115.95|36.72,NY|US|New York|-74.13|40.89,OH|US|Ohio|-82.75|40.53,OK|US|Oklahoma|-97.01|35.66,ON|CA|Ontario|-79.27|43.94,OR|US|Oregon|-122.75|44.96,PA|US|Pennsylvania|-76.12|40.23,PE|CA|Prince Edward Island|-63.13|46.23,QC|CA|Quebec|-73.14|45.89,RI|US|Rhode Island|-71.45|41.79,SC|US|South Carolina|-80.69|33.6,SD|US|South Dakota|-98.66|43.89,SK|CA|Saskatchewan|-105.99|51.63,TN|US|Tennessee|-87.53|35.63,TX|US|Texas|-97.51|31.01,UT|US|Utah|-111.96|40.5,VA|US|Virginia|-77.08|37.61,VT|US|Vermont|-73.21|44.48,WA|US|Washington|-121.46|47.29,WI|US|Wisconsin|-88.6|43.36,WV|US|West Virginia|-81.42|38.99,WY|US|Wyoming|-105.54|42.26,YT|CA|Yukon|-135.05|60.72",rn="006|-66.84|18.26,007|-66.15|18.15,008|-64.74|17.74,009|-66.12|18.37,010|-72.6|42.26,011|-72.53|42.07,012|-73.21|42.37,013|-72.51|42.58,014|-71.81|42.59,015|-71.85|42.23,016|-71.84|42.28,017|-71.44|42.33,018|-71.21|42.64,019|-70.89|42.66,020|-71.28|42.12,021|-71.05|42.31,022|-71.04|42.35,023|-70.86|41.98,024|-71.22|42.37,025|-70.6|41.71,026|-70.2|41.73,027|-71.07|41.77,028|-71.62|41.69,029|-71.47|41.82,030|-71.51|42.9,031|-71.48|43,032|-71.65|43.57,033|-71.58|43.26,034|-72.19|42.91,035|-71.31|44.69,036|-72.32|43.17,037|-72.13|43.69,038|-71.1|43.56,039|-70.76|43.24,040|-70.6|43.78,041|-70.27|43.7,042|-70.49|44.38,043|-69.75|44.3,044|-68.83|45.45,045|-69.57|43.99,046|-67.8|44.79,047|-68.34|46.55,048|-69.17|44.2,049|-69.97|44.99,050|-72.43|43.85,051|-72.65|43.28,052|-73.14|43.03,053|-72.77|42.94,054|-72.98|44.58,056|-72.6|44.35,057|-73.04|43.69,058|-72.12|44.68,059|-71.7|44.79,060|-72.81|41.88,061|-72.69|41.74,062|-72.12|41.81,063|-72.03|41.5,064|-72.61|41.46,065|-72.94|41.36,066|-73.22|41.24,067|-73.24|41.68,068|-73.42|41.28,069|-73.57|41.14,070|-74.28|40.76,071|-74.2|40.74,072|-74.2|40.68,073|-74.08|40.71,074|-74.4|41.09,075|-74.17|40.92,076|-74.01|40.94,077|-74.17|40.28,078|-74.81|40.97,079|-74.55|40.74,080|-74.98|39.78,081|-75.07|39.94,082|-74.68|39.32,083|-75.04|39.45,084|-74.48|39.35,085|-74.62|40.25,086|-74.68|40.23,087|-74.22|39.96,088|-74.72|40.54,089|-74.48|40.45,100|-73.96|40.77,101|-73.95|40.78,102|-74.02|40.72,103|-74.15|40.58,104|-73.85|40.9,105|-73.75|41.27,106|-73.74|41.02,107|-73.84|40.96,108|-73.8|40.95,109|-74.27|41.3,110|-73.69|40.74,111|-73.93|40.76,112|-73.94|40.66,113|-73.84|40.73,114|-73.77|40.69,115|-73.62|40.71,116|-73.88|40.57,117|-73.23|40.82,118|-73.5|40.77,119|-72.53|40.95,120|-74.22|42.92,121|-74.4|43.46,122|-73.81|42.7,123|-73.96|42.82,124|-74.27|42.09,125|-73.7|41.89,126|-73.88|41.69,127|-74.75|41.74,128|-73.91|43.61,129|-74.03|44.53,130|-76.16|43.08,131|-76.46|43.27,132|-76.2|43.03,133|-75.07|43.45,134|-75.35|43.03,135|-75.15|43.14,136|-75.39|44.33,137|-75.2|42.21,138|-75.46|42.43,139|-75.88|42.12,140|-78.48|43.01,141|-78.7|42.49,142|-78.8|42.91,143|-78.96|43.12,144|-77.71|42.96,145|-77.17|43.14,146|-77.65|43.17,147|-78.84|42.21,148|-77.18|42.29,149|-76.78|42.09,150|-80.23|40.56,151|-80.18|40.53,152|-79.97|40.46,153|-80.24|40.01,154|-79.65|39.92,155|-78.8|39.95,156|-79.47|40.33,157|-79.02|40.71,158|-78.66|41.32,159|-78.84|40.35,160|-79.88|40.93,161|-80.3|41.19,162|-79.35|41.08,163|-79.58|41.59,164|-80|41.87,165|-80.04|42.1,166|-78.28|40.48,167|-78.47|41.76,168|-78|40.97,169|-77.37|41.8,170|-77.29|40.44,171|-76.78|40.33,172|-77.81|39.98,173|-76.93|39.89,174|-76.72|39.97,175|-76.24|40.05,176|-76.34|40.05,177|-77.22|41.34,178|-76.77|40.93,179|-76.27|40.69,180|-75.45|40.67,181|-75.47|40.6,182|-75.88|40.9,183|-75.19|41.12,184|-75.38|41.53,185|-75.68|41.37,186|-76.17|41.4,187|-75.86|41.22,188|-76.12|41.82,189|-75.14|40.36,190|-75.37|39.97,191|-75.15|40.01,193|-75.78|39.92,194|-75.46|40.19,195|-75.9|40.42,196|-75.95|40.34,197|-75.68|39.53,198|-75.58|39.77,199|-75.46|38.83,200|-77.02|38.9,201|-77.68|38.9,202|-77.03|38.89,203|-77.01|38.86,204|-77.05|38.89,205|-77.01|38.87,206|-76.76|38.45,207|-76.78|38.88,208|-77.23|39.15,209|-76.99|39.05,210|-76.32|39.53,211|-76.73|39.58,212|-76.58|39.31,214|-76.55|39,215|-79.08|39.56,216|-76.02|38.86,217|-77.5|39.52,218|-75.57|38.27,219|-75.94|39.57,220|-77.25|38.78,221|-77.25|38.92,222|-77.11|38.88,223|-77.13|38.79,224|-77.25|38.22,225|-77.51|38.09,226|-78.25|39.03,227|-78.05|38.49,228|-78.79|38.57,229|-78.55|38.02,230|-78.09|37.66,231|-76.96|37.55,232|-77.46|37.51,233|-76.3|36.68,234|-76.66|36.77,235|-76.26|36.87,236|-76.44|37.12,237|-76.38|36.85,238|-77.41|36.94,239|-78.39|37.03,240|-80.1|37.23,241|-79.89|36.9,242|-82.49|36.83,243|-81.13|36.86,244|-79.51|38.05,245|-79.11|37.15,246|-81.8|37.19,247|-81.14|37.39,248|-81.64|37.47,249|-80.32|37.95,250|-81.45|38.27,251|-81.89|38.64,252|-81.45|38.77,253|-81.64|38.42,254|-78.11|39.45,255|-82.19|38.25,256|-82.08|37.76,257|-82.41|38.4,258|-81.21|37.72,259|-80.89|37.83,260|-80.63|40.05,261|-81.27|39.2,262|-80.02|38.75,263|-80.23|39.27,264|-80.65|39.21,265|-80.05|39.59,266|-80.8|38.48,267|-78.98|39.33,268|-79.12|38.88,270|-80.45|36.24,271|-80.24|36.06,272|-79.82|35.86,273|-79.52|35.55,274|-79.81|36.09,275|-78.54|35.93,276|-78.65|35.81,277|-78.9|35.99,278|-77.32|35.88,279|-76.5|36.19,280|-81.2|35.4,281|-80.41|35.21,282|-80.83|35.22,283|-78.94|34.96,284|-78.23|34.39,285|-77.23|35.06,286|-81.36|36.06,287|-82.78|35.51,288|-82.55|35.6,289|-83.97|35.11,290|-80.88|34.19,291|-80.62|33.71,292|-80.96|34.04,293|-81.86|34.78,294|-80.08|33.05,295|-79.49|34.07,296|-82.57|34.61,297|-80.92|34.83,298|-81.74|33.51,299|-80.96|32.55,300|-84.08|33.85,301|-84.91|34.04,302|-84.55|33.25,303|-84.42|33.77,304|-82.11|32.48,305|-83.81|34.58,306|-83.14|33.86,307|-85.1|34.71,308|-82.34|33.35,309|-82.01|33.4,310|-83.42|32.64,312|-83.64|32.83,313|-81.49|31.68,314|-81.15|32.03,315|-82.21|31.4,316|-83.21|31.02,317|-83.87|31.48,318|-84.69|32.45,319|-84.95|32.47,320|-82.58|30.27,321|-81.48|29.39,322|-81.69|30.3,323|-84.25|30.29,324|-85.58|30.55,325|-87.03|30.76,326|-82.6|29.58,327|-81.28|28.79,328|-81.32|28.47,329|-80.67|27.96,330|-80.58|25.31,331|-80.38|25.74,333|-80.25|26.13,334|-81.01|26.64,335|-82.22|28.19,336|-82.47|28.01,337|-82.73|27.85,338|-81.64|27.72,339|-81.71|26.77,341|-81.32|26.11,342|-82.16|27.29,344|-82.35|29.01,346|-82.52|28.41,347|-81.4|28.29,349|-80.72|27.34,350|-86.8|34.05,351|-86.38|33.43,352|-86.77|33.5,354|-87.86|33.07,355|-87.71|33.96,356|-87.4|34.67,357|-86.26|34.75,358|-86.59|34.69,359|-85.94|34.27,360|-86.09|32.09,361|-86.27|32.31,362|-85.65|33.53,363|-85.56|31.34,364|-86.97|31.38,365|-88.14|31.32,366|-88.19|30.68,367|-87.34|32.33,368|-85.41|32.61,369|-88.25|32.12,370|-87.02|36.12,371|-86.23|35.75,372|-86.83|36.15,373|-85.36|35.32,374|-85.33|35.06,376|-82.3|36.36,377|-84.31|36.27,378|-83.35|36.3,379|-83.97|35.97,380|-89.43|35.55,381|-89.96|35.1,382|-88.68|36.29,383|-88.5|35.61,384|-87.36|35.34,385|-85.34|36.18,386|-89.76|34.57,387|-90.81|33.54,388|-88.63|34.36,389|-89.9|33.77,390|-90|32.53,391|-90.67|32.51,392|-90.22|32.32,393|-88.8|32.42,394|-89.26|31.23,395|-89|30.59,396|-90.67|31.32,397|-88.87|33.53,398|-84.67|31.32,400|-85.29|38.07,401|-86.2|37.85,402|-85.66|38.19,403|-84.2|38.06,404|-84.42|37.53,405|-84.45|38.04,406|-84.87|38.22,407|-84.12|36.95,408|-83.26|36.9,409|-83.74|36.95,410|-84.32|38.64,411|-83.06|38.38,412|-82.67|37.89,413|-83.48|37.58,414|-83.15|37.84,415|-82.39|37.46,416|-82.78|37.54,417|-83.25|37.23,418|-82.88|37.21,420|-88.57|36.9,421|-86.09|36.89,422|-87.11|36.95,423|-87.02|37.52,424|-87.7|37.47,425|-84.71|37.15,426|-84.82|36.81,427|-85.73|37.32,430|-82.9|40.21,431|-82.99|39.69,432|-82.97|39.98,433|-83.38|40.55,434|-83.3|41.42,435|-84.22|41.46,436|-83.54|41.67,437|-81.66|39.85,438|-81.88|40.27,439|-80.9|40.25,440|-80.97|41.64,441|-81.66|41.42,442|-81.6|41.13,443|-81.54|41.07,444|-80.77|41.09,445|-80.64|41.05,446|-81.53|40.65,447|-81.39|40.83,448|-82.77|41.02,449|-82.55|40.74,450|-84.48|39.43,451|-83.84|39.16,452|-84.48|39.18,453|-84.3|39.97,454|-84.18|39.74,455|-83.81|39.94,456|-82.86|38.99,457|-81.78|39.35,458|-84.23|40.83,460|-86.13|40.17,461|-86.18|39.62,462|-86.14|39.79,463|-87.05|41.41,464|-87.34|41.55,465|-86.08|41.44,466|-86.28|41.66,467|-85.21|41.17,468|-85.17|41.09,469|-86.14|40.76,470|-85.08|39.16,471|-86.02|38.43,472|-85.74|39.05,473|-85.15|40.09,474|-86.63|38.99,475|-87.03|38.46,476|-87.53|38.13,477|-87.58|38.03,478|-87.29|39.45,479|-87.11|40.5,480|-82.79|42.83,481|-83.62|42.2,482|-83.1|42.38,483|-83.35|42.66,484|-83.22|43.29,485|-83.69|43.03,486|-84.36|43.99,487|-83.67|44.45,488|-84.67|43.02,489|-84.59|42.74,490|-85.54|42.2,491|-86.36|41.87,492|-84.36|42.06,493|-85.57|43.33,494|-86.14|43.39,495|-85.66|42.96,496|-85.52|44.44,497|-84.37|45.17,498|-86.94|46.17,499|-88.93|46.6,500|-94.77|41.63,501|-92.79|41.84,502|-93.67|42.12,503|-93.63|41.59,504|-93.37|43.17,505|-94.45|42.77,506|-92.45|42.65,507|-92.31|42.49,508|-94.56|40.96,510|-95.91|42.6,511|-96.39|42.52,512|-96.06|43.28,513|-95.16|43.27,514|-95.08|42.11,515|-95.55|41.44,516|-95.37|40.74,520|-90.98|42.46,521|-91.73|43.2,522|-92.31|41.9,523|-91.66|41.87,524|-91.69|41.96,525|-92.46|40.95,526|-91.44|40.88,527|-90.88|41.64,528|-90.61|41.56,530|-88.24|43.51,531|-88.33|42.75,532|-87.98|43.06,534|-87.86|42.74,535|-89.66|42.95,537|-89.38|43.08,538|-90.73|42.88,539|-89.55|43.64,540|-92.46|45.08,541|-88.23|45.09,542|-87.6|44.52,543|-88.01|44.53,544|-89.85|44.93,545|-89.86|45.89,546|-90.87|43.93,547|-91.52|44.85,548|-91.63|46.04,549|-88.96|44.19,550|-92.98|45.17,551|-93.08|44.96,553|-94.06|44.99,554|-93.31|45.01,556|-91.03|47.67,557|-92.68|47.39,558|-92.08|46.96,559|-92.28|43.89,560|-94.04|44.02,561|-95.65|43.92,562|-95.75|45.08,563|-94.59|45.83,564|-94.5|46.63,565|-96.08|46.86,566|-94.31|47.88,567|-96.22|48.39,570|-97.07|43.48,571|-96.76|43.54,572|-97.18|45.04,573|-98.53|43.91,574|-98.93|45.36,575|-100.61|43.86,576|-101.59|45.43,577|-103.11|44.26,580|-97.39|46.66,581|-96.83|46.86,582|-97.72|48.25,583|-99.34|48.32,584|-99.12|46.88,585|-100.98|46.76,586|-102.99|46.75,587|-101.7|48.34,588|-103.48|48.2,590|-108.62|45.98,591|-108.45|45.69,592|-105.6|48.2,593|-105.58|46.4,594|-111.24|47.79,595|-109.12|48.38,596|-111.74|46.65,597|-112.31|45.48,598|-114.25|46.97,599|-114.57|48.37,600|-88.15|42.29,601|-88.47|42.01,602|-87.69|42.04,603|-87.79|41.89,604|-88.09|41.39,605|-88.55|41.69,606|-87.69|41.83,607|-87.82|42.03,608|-87.76|41.84,609|-87.92|40.8,610|-89.56|42.18,611|-89.08|42.28,612|-90.29|41.5,613|-89.16|41.34,614|-90.43|40.82,615|-89.68|40.71,616|-89.61|40.72,617|-88.89|40.52,618|-88.15|40.11,619|-88.19|39.66,620|-90.01|39.13,622|-89.72|38.41,623|-91.02|39.99,624|-88.19|39.04,625|-89.21|39.63,626|-90|39.86,627|-89.66|39.8,628|-88.65|38.35,629|-88.89|37.55,630|-90.83|38.35,631|-90.32|38.64,633|-91.11|39.02,634|-91.78|39.93,635|-92.61|40.2,636|-90.64|37.61,637|-89.81|37.37,638|-89.73|36.55,639|-90.62|36.84,640|-94.1|39.07,641|-94.58|39.14,644|-94.69|40.13,645|-94.83|39.75,646|-93.55|39.89,647|-94.15|38.06,648|-94.35|36.93,650|-92.23|38.45,651|-92.19|38.51,652|-92.38|39.21,653|-93.26|38.71,654|-92.03|37.93,655|-91.92|37.67,656|-93.08|36.76,657|-92.43|37.03,658|-93.3|37.22,660|-95.12|38.84,661|-94.73|39.11,662|-94.72|38.95,664|-96.15|39.64,665|-96.34|39.4,666|-95.76|39.06,667|-95.23|37.64,668|-96.39|38.36,669|-97.86|39.77,670|-98.49|37.33,671|-98.4|37.44,672|-97.33|37.7,673|-95.81|37.23,674|-97.79|38.98,675|-98.99|38.25,676|-99.47|39.34,677|-101.15|39.35,678|-100.82|37.91,679|-101.43|37.18,680|-96.46|41.55,681|-96.05|41.24,683|-96.93|40.39,684|-97.26|40.89,685|-96.69|40.82,686|-97.68|41.55,687|-98.16|42.43,688|-99.15|41.34,689|-98.9|40.34,690|-100.99|40.37,691|-101.59|41.42,692|-100.64|42.67,693|-102.84|42.29,700|-89.93|29.63,701|-89.93|30.02,703|-90.65|29.62,704|-90.27|30.66,705|-92.25|30.2,706|-93.21|30.34,707|-91.2|30.57,708|-91.1|30.45,710|-93.4|32.45,711|-93.75|32.47,712|-91.95|32.56,713|-91.86|31.43,714|-92.84|31.57,716|-91.75|33.61,717|-92.79|33.48,718|-93.84|33.66,719|-93.61|34.4,720|-91.9|34.92,721|-92.56|34.93,722|-92.37|34.7,723|-90.59|35.07,724|-90.76|36.04,725|-91.81|36.01,726|-92.93|36.15,727|-94.05|36.11,728|-93.33|35.3,729|-94.08|35.29,730|-97.83|35.31,731|-97.5|35.43,734|-97.14|34.21,735|-98.81|34.53,736|-99.33|35.52,737|-98.2|36.42,738|-99.54|36.5,739|-101.67|36.74,740|-96.19|36.34,741|-95.96|36.15,743|-95.02|36.55,744|-95.44|35.64,745|-95.65|34.66,746|-97.05|36.71,747|-95.41|34.02,748|-96.66|35.17,749|-94.69|35.23,750|-96.76|33.06,751|-96.32|32.48,752|-96.78|32.79,753|-96.84|32.81,754|-95.67|33.37,755|-94.45|33.3,756|-94.58|32.49,757|-95.37|32.24,758|-95.68|31.44,759|-94.29|31.29,760|-97.54|32.59,761|-97.38|32.77,762|-97.44|33.52,763|-98.87|33.73,764|-98.59|32.61,765|-97.62|31.11,766|-97.06|31.7,767|-97.15|31.57,768|-99.37|31.23,769|-100.88|31.03,770|-95.39|29.79,772|-95.37|29.77,773|-95.24|30.48,774|-96.02|29.38,775|-94.98|29.68,776|-94.16|30.27,777|-94.19|29.96,778|-96.32|30.67,779|-96.95|28.92,780|-99.01|28.67,781|-97.93|29.08,782|-98.53|29.47,783|-98.14|27.63,784|-97.44|27.73,785|-98.19|26.39,786|-98.1|30.27,787|-97.78|30.3,788|-100.26|29.44,789|-96.87|29.92,790|-101.63|35.48,791|-101.85|35.21,792|-100.57|34.25,793|-102.15|33.37,794|-101.88|33.58,795|-100.31|32.7,796|-99.72|32.46,797|-102.22|31.57,798|-104.17|30.53,799|-106.16|31.8,800|-105.11|39.91,801|-104.47|39.51,802|-104.93|39.78,803|-105.31|40.04,804|-106.16|39.98,805|-105.35|40.57,806|-104.49|40.38,807|-103.09|40.4,808|-103.16|39.12,809|-104.67|38.79,810|-103.58|37.77,811|-106.39|37.54,812|-106.39|38.46,813|-108.42|37.49,814|-108.02|38.43,815|-108.7|38.92,816|-107.86|39.99,820|-105.27|41.31,821|-110.51|44.57,822|-104.67|42.39,823|-107.03|41.75,824|-108.65|44.32,825|-108.91|43.14,826|-106.43|43.1,827|-105|44.2,828|-106.71|44.55,829|-109.71|42.82,830|-110.51|43.7,831|-110.53|42.6,832|-112.17|42.66,833|-114.23|42.81,834|-111.63|43.86,835|-115.77|46.07,836|-115.99|44,837|-116.04|43.58,838|-116.47|47.77,840|-110.86|40.53,841|-111.81|40.71,843|-112.18|41.67,844|-112.01|41.23,845|-109.72|38.09,846|-111.68|39.63,847|-112.82|37.61,850|-112.09|33.63,851|-111.41|33,852|-111.69|33.6,853|-113.44|33.49,855|-110.3|33.43,856|-110.59|32,857|-111.09|32.18,859|-109.81|34.23,860|-111.15|35.89,863|-112.57|34.85,864|-113.79|35.66,865|-109.55|36.03,870|-106.9|35.22,871|-106.72|35.12,873|-108.56|35.44,874|-108.23|36.59,875|-106.04|36.27,877|-104.68|36.06,878|-107.94|34,879|-107.48|33.2,880|-108.03|32.37,881|-103.81|34.26,882|-104.07|32.87,883|-105.48|33.62,884|-103.79|35.74,890|-114.84|37,891|-115.42|36.33,893|-116.96|39.5,894|-118.06|41.29,895|-119.72|39.9,897|-119.8|39.18,898|-115.71|40.95,900|-118.32|34.04,902|-118.76|34.07,903|-118.34|33.95,904|-118.48|34.02,905|-118.33|33.83,906|-118.03|33.93,907|-118.45|33.39,908|-118.18|33.8,910|-118.25|34.28,911|-118.13|34.15,912|-118.25|34.19,913|-118.55|34.36,914|-118.47|34.18,915|-118.33|34.19,916|-118.38|34.18,917|-117.78|34.14,918|-118.13|34.09,919|-116.62|32.73,920|-116.7|33.16,921|-117.14|32.85,922|-115.5|33.59,923|-117.14|34.66,924|-117.33|34.17,925|-117.06|33.68,926|-117.73|33.63,927|-117.85|33.74,928|-117.71|33.85,930|-119.12|34.39,931|-119.97|34.48,932|-119.07|35.98,933|-119.01|35.35,934|-120.5|35.38,935|-118.36|37.37,936|-119.72|36.95,937|-119.85|36.71,939|-121.42|36.34,940|-122.31|37.41,941|-122.44|37.77,943|-122.13|37.44,944|-122.32|37.53,945|-122.05|38.09,946|-122.19|37.78,947|-122.26|37.89,948|-122.3|37.97,949|-122.74|38.14,950|-121.42|36.85,951|-121.76|37.33,952|-120.79|38.14,953|-120.56|37.62,954|-123.15|39.08,955|-123.75|40.5,956|-121.34|38.62,957|-120.86|39.13,958|-121.44|38.58,959|-121.73|39.47,960|-122.42|41.06,961|-120.33|40.52,967|-155.53|19.6,968|-157.83|21.34,969|144.77|13.45,970|-121.45|45.3,971|-123.79|45.64,972|-122.74|45.57,973|-123.26|44.68,974|-123.46|43.61,975|-123.06|42.34,976|-120.4|42.67,977|-120.77|44.32,978|-118.59|45.21,979|-117.63|43.34,980|-121.78|47.42,981|-122.32|47.6,982|-121.79|48.39,983|-123.87|47.96,984|-122.46|47.18,985|-123.27|46.94,986|-122.15|45.99,988|-119.91|48,989|-120.57|46.71,990|-117.56|47.62,991|-118.13|47.91,992|-117.4|47.67,993|-118.82|46.4,994|-117.21|46.2,995|-156.93|60.89,996|-151.66|60.82,997|-146.69|65.19,998|-136.2|58.94,999|-131.24|55.86",an="ABW|-70.02|12.54,AFG|68|34.63,AGO|14.24|-9.84,AIA|-63.06|18.22,ALA|19.93|60.1,ALB|19.81|41.14,AND|1.53|42.51,ARE|55.24|24.99,ARG|-61.28|-32.95,ARM|44.52|40.23,ASM|-170.7|-14.28,ATA|21.28|-80.52,ATF|70.22|-49.35,ATG|-61.84|17.12,AUS|144.91|-33.49,AUT|15.51|47.93,AZE|49.02|40.37,BDI|29.49|-3.34,BEL|4.37|50.89,BEN|2.33|7.65,BES|-68.27|12.15,BFA|-2.08|12.15,BGD|90.42|23.65,BGR|24.92|42.71,BHR|50.57|26.18,BHS|-77.34|25.06,BIH|17.97|44.18,BLM|-62.85|17.9,BLR|27.81|53.57,BLZ|-88.41|17.54,BMU|-64.78|32.29,BOL|-65.79|-17.39,BRA|-45.89|-17.51,BRB|-59.62|13.11,BRN|114.74|4.82,BTN|89.69|27.32,BWA|25.99|-23.43,CAF|18.32|4.94,CAN|-79.4|43.71,CCK|96.82|-12.16,CHE|7.96|47.07,CHL|-71.21|-33.72,CHN|114.44|32,CIV|-4.89|6.16,CMR|11.19|5.41,COD|20.23|-4.72,COG|14.18|-4.04,COK|-159.78|-21.21,COL|-74.85|5.93,COM|43.58|-11.89,CPV|-23.87|15.66,CRI|-84.14|9.99,CUB|-80.25|22.21,CUW|-68.88|12.12,CXR|105.68|-10.42,CYM|-81.38|19.32,CYP|33.31|35,CZE|15.44|49.89,DEU|9.65|51.24,DJI|43.15|11.59,DMA|-61.39|15.3,DNK|11.42|55.79,DOM|-70.07|18.75,DZA|3.55|35.62,ECU|-79.29|-1.4,EGY|31.22|29.84,ERI|38.84|15.25,ESH|-13.19|27.14,ESP|-2.91|39.69,EST|25.17|59.29,ETH|39.02|9.26,FIN|24.87|61.26,FJI|178.2|-17.85,FLK|-57.86|-51.69,FRA|2.87|47.28,FRO|-6.77|62.01,FSM|158.16|6.92,GAB|10.22|-0.06,GBR|-1.37|52.49,GEO|43.92|41.84,GGY|-2.54|49.46,GHA|-0.98|6.4,GIB|-5.35|36.14,GIN|-12.8|9.75,GLP|-61.53|16.23,GMB|-16.59|13.41,GNB|-15.48|11.9,GNQ|9.77|1.86,GRC|23.73|37.98,GRD|-61.75|12.05,GRL|-51.72|64.18,GTM|-90.71|14.73,GUF|-52.64|5.04,GUM|144.82|13.5,GUY|-58.11|6.63,HKG|114.15|22.33,HMD|73.5|-53.1,HND|-87.41|14.94,HRV|16.21|45.31,HTI|-72.34|18.54,HUN|19.21|47.39,IDN|106.85|-6.21,IMN|-4.48|54.15,IND|78.36|21,IOT|71.35|-6.19,IRL|-6.87|53.12,IRN|51.6|34.4,IRQ|44.78|33.65,ISL|-21.7|64.22,ISR|34.97|32.07,ITA|12|42.73,JAM|-76.91|18.03,JEY|-2.1|49.19,JOR|35.96|32.03,JPN|137.27|35.53,KAZ|70.17|47.24,KEN|36.81|-0.97,KGZ|73.96|41.94,KHM|104.7|11.75,KIR|172.98|1.33,KNA|-62.72|17.3,KOR|127.51|36.58,KWT|48.06|29.2,Kosovo|20.9|42.58,LAO|102.6|17.97,LBN|35.53|33.87,LBR|-10.39|6.36,LBY|13.19|32.89,LCA|-60.97|14.04,LIE|9.52|47.14,LKA|80.25|7.25,LSO|27.67|-29.38,LTU|24.18|55.04,LUX|6.08|49.56,LVA|24.13|56.85,MAC|113.55|22.19,MAF|-63.08|18.07,MAR|-6.65|33.43,MCO|7.42|43.74,MDA|28.82|47.09,MDG|47.46|-18.89,MDV|73.51|4.18,MEX|-100.65|21.59,MHL|171.38|7.09,MKD|21.47|41.8,MLI|-7.15|12.95,MLT|14.46|35.91,MMR|96.18|18.74,MNE|19.17|42.53,MNG|105.33|47.94,MNP|145.75|15.21,MOZ|32.58|-25.97,MRT|-14.58|18.01,MSR|-62.21|16.79,MTQ|-61.01|14.64,MUS|57.51|-20.23,MWI|34.34|-14.24,MYS|103.35|3.45,MYT|45.23|-12.77,N. Cyprus|33.56|35.27,NAM|17.19|-21.34,NCL|166.47|-22.26,NER|5.05|14.04,NFK|167.97|-29.05,NGA|5.91|7.87,NIC|-86.17|12.33,NIU|-169.92|-19.05,NLD|5.21|52.09,NOR|9.62|60.46,NPL|84.7|27.64,NRU|166.93|-0.55,NZL|174.54|-38.9,OMN|57.69|23.27,PAK|71.47|30.24,PAN|-79.83|8.98,PCN|-130.1|-25.07,PER|-76.4|-11.18,PHL|121.05|14.65,PLW|134.58|7.52,PNG|147.4|-7.71,POL|19.26|51.79,PRI|-66.24|18.35,PRK|126.54|39.52,PRT|-9.08|39.42,PRY|-57.15|-25.27,PSE|35.23|31.78,PYF|-149.59|-17.57,QAT|51.49|25.32,REU|55.45|-21.08,ROU|25.47|45.38,RUS|51.84|54.52,RWA|29.78|-1.98,SAU|43.01|23.76,SDN|31.67|14.67,SEN|-16.73|14.66,SGP|103.85|1.33,SGS|-36.51|-54.28,SHN|-5.72|-15.92,SJM|15.65|78.22,SLB|159.97|-9.44,SLE|-12.4|8.36,SLV|-89.08|13.7,SMR|12.45|43.94,SOM|44.96|4.91,SPM|-56.18|46.78,SRB|20.62|44.5,SSD|29.91|6.61,STP|6.73|0.34,SUR|-55.18|5.84,SVK|18.69|48.55,SVN|14.83|46.16,SWE|16.03|58.86,SWZ|31.28|-26.43,SXM|-63.05|18.03,SYC|55.46|-4.62,SYR|37.18|35.12,Somaliland|46.23|9.76,TCA|-72.1|21.74,TCD|16.57|11.53,TGO|1.16|6.8,THA|100.71|13.71,TJK|69.39|39.08,TKM|59.4|38.74,TLS|125.65|-8.67,TON|-175.2|-21.14,TTO|-61.4|10.5,TUN|10.23|35.87,TUR|32.1|39.5,TUV|179.19|-8.52,TWN|121.06|24.37,TZA|36.11|-5.88,UGA|32.23|0.59,UKR|32.8|48.99,URY|-56.28|-34.1,USA|-93.51|37.4,UZB|69.22|41.26,VAT|12.45|41.9,VCT|-61.21|13.14,VEN|-67.82|9.83,VGB|-64.62|18.43,VIR|-64.8|17.9,VNM|106.63|10.82,VUT|168.31|-17.74,WLF|-176.17|-13.28,WSM|-171.77|-13.83,YEM|44.62|14.36,ZAF|26.96|-28.33,ZMB|28.41|-13.86,ZWE|30.49|-18.56";var ct=95,sn=new Set(["n a","none","null","nil","unknown","not applicable","not available","not specified","unspecified","missing","blank","empty","tbd","to be determined"]),Tn=new Set(Array.from(sn).filter(n=>n.includes(" ")&&n!=="n a").map(n=>n.replace(/ /g,"")));function T(n){return n?sn.has(n)||Tn.has(n.replace(/ /g,"")):!0}var pt=80;function g(n){return tn(n.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase()).replace(/[^\p{L}\p{Nd}\s]/gu," ").replace(/\s+/g," ").trim()}function h(n){return G(n)}var hn="AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,AS ASM,AT AUT,AU AUS,AW ABW,AX ALA,AZ AZE,BA BIH,BB BRB,BD BGD,BE BEL,BF BFA,BG BGR,BH BHR,BI BDI,BJ BEN,BL BLM,BM BMU,BN BRN,BO BOL,BQ BES,BR BRA,BS BHS,BT BTN,BV BVT,BW BWA,BY BLR,BZ BLZ,CA CAN,CC CCK,CD COD,CF CAF,CG COG,CH CHE,CI CIV,CK COK,CL CHL,CM CMR,CN CHN,CO COL,CR CRI,CU CUB,CV CPV,CW CUW,CX CXR,CY CYP,CZ CZE,DE DEU,DJ DJI,DK DNK,DM DMA,DO DOM,DZ DZA,EC ECU,EE EST,EG EGY,EH ESH,ER ERI,ES ESP,ET ETH,FI FIN,FJ FJI,FK FLK,FM FSM,FO FRO,FR FRA,GA GAB,GB GBR,GD GRD,GE GEO,GF GUF,GG GGY,GH GHA,GI GIB,GL GRL,GM GMB,GN GIN,GP GLP,GQ GNQ,GR GRC,GS SGS,GT GTM,GU GUM,GW GNB,GY GUY,HK HKG,HM HMD,HN HND,HR HRV,HT HTI,HU HUN,ID IDN,IE IRL,IL ISR,IM IMN,IN IND,IO IOT,IQ IRQ,IR IRN,IS ISL,IT ITA,JE JEY,JM JAM,JO JOR,JP JPN,KE KEN,KG KGZ,KH KHM,KI KIR,KM COM,KN KNA,KP PRK,KR KOR,KW KWT,KY CYM,KZ KAZ,LA LAO,LB LBN,LC LCA,LI LIE,LK LKA,LR LBR,LS LSO,LT LTU,LU LUX,LV LVA,LY LBY,MA MAR,MC MCO,MD MDA,ME MNE,MF MAF,MG MDG,MH MHL,MK MKD,ML MLI,MM MMR,MN MNG,MO MAC,MP MNP,MQ MTQ,MR MRT,MS MSR,MT MLT,MU MUS,MV MDV,MW MWI,MX MEX,MY MYS,MZ MOZ,NA NAM,NC NCL,NE NER,NF NFK,NG NGA,NI NIC,NL NLD,NO NOR,NP NPL,NR NRU,NU NIU,NZ NZL,OM OMN,PA PAN,PE PER,PF PYF,PG PNG,PH PHL,PK PAK,PL POL,PM SPM,PN PCN,PR PRI,PS PSE,PT PRT,PW PLW,PY PRY,QA QAT,RE REU,RO ROU,RS SRB,RU RUS,RW RWA,SA SAU,SB SLB,SC SYC,SD SDN,SE SWE,SG SGP,SH SHN,SI SVN,SJ SJM,SK SVK,SL SLE,SM SMR,SN SEN,SO SOM,SR SUR,SS SSD,ST STP,SV SLV,SX SXM,SY SYR,SZ SWZ,TC TCA,TD TCD,TF ATF,TG TGO,TH THA,TJ TJK,TK TKL,TL TLS,TM TKM,TN TUN,TO TON,TR TUR,TT TTO,TV TUV,TW TWN,TZ TZA,UA UKR,UG UGA,UM UMI,US USA,UY URY,UZ UZB,VA VAT,VC VCT,VE VEN,VG VGB,VI VIR,VN VNM,VU VUT,WF WLF,WS WSM,XK XKX,YE YEM,YT MYT,ZA ZAF,ZM ZMB,ZW ZWE",C=(()=>{let n=new Map;for(let e of hn.split(",")){let[t,i]=e.split(" ");t&&i&&n.set(t,i)}return n})(),Ln=new Set(C.keys()),Pn=new Set(C.values()),Un=["en","fr","es","de","it","pt","ru","ja","zh","ko","ar","hi","tr","pl","he","nl","sv","fi","nb","da","cs","el","uk","ro","id","vi","th","sk","hu","hr"],En={usa:"USA","u.s.":"USA","u.s.a.":"USA",us:"USA",america:"USA","united states of america":"USA","the united states":"USA",uk:"GBR","u.k.":"GBR","great britain":"GBR",britain:"GBR",england:"GBR","south korea":"KOR","north korea":"PRK",korea:"KOR","ivory coast":"CIV","cote d ivoire":"CIV",vietnam:"VNM",laos:"LAO",syria:"SYR",iran:"IRN",russia:"RUS",moldova:"MDA",tanzania:"TZA",bolivia:"BOL",venezuela:"VEN",brunei:"BRN","czech republic":"CZE",czechia:"CZE",slovakia:"SVK",uae:"ARE","united arab emirates":"ARE",drc:"COD","dr congo":"COD","democratic republic of the congo":"COD","republic of the congo":"COG",congo:"COG",swaziland:"SWZ",eswatini:"SWZ","cape verde":"CPV","cabo verde":"CPV",burma:"MMR",myanmar:"MMR",holland:"NLD","the netherlands":"NLD",netherlands:"NLD",vatican:"VAT","vatican city":"VAT",palestine:"PSE",macau:"MAC",macao:"MAC","hong kong":"HKG",taiwan:"TWN",turkey:"TUR",turkiye:"TUR",macedonia:"MKD","north macedonia":"MKD",gambia:"GMB","the gambia":"GMB",bahamas:"BHS","the bahamas":"BHS","east timor":"TLS","timor leste":"TLS"},Bn=Object.freeze({"Antigua and Barbuda":"ATG","Bosnia and Herzegovina":"BIH","Heard Island and McDonald Islands":"HMD","Saint Kitts and Nevis":"KNA","St Kitts and Nevis":"KNA","Saint Pierre and Miquelon":"SPM","St Pierre and Miquelon":"SPM","Saint Vincent and the Grenadines":"VCT","St Vincent and the Grenadines":"VCT","Sao Tome and Principe":"STP","South Georgia and the South Sandwich Islands":"SGS","Svalbard and Jan Mayen":"SJM","Trinidad and Tobago":"TTO","Turks and Caicos Islands":"TCA","Turks and Caicos":"TCA","Wallis and Futuna":"WLF","Saint Helena, Ascension and Tristan da Cunha":"SHN","Bonaire, Sint Eustatius and Saba":"BES","United Kingdom of Great Britain and Northern Ireland":"GBR","Bolivia, Plurinational State of":"BOL","Bolivia (Plurinational State of)":"BOL","Brunei Darussalam":"BRN","Congo, The Democratic Republic of the":"COD","Congo, Democratic Republic of the":"COD","Democratic Republic of Congo":"COD","Falkland Islands (Malvinas)":"FLK","Holy See (Vatican City State)":"VAT","Holy See":"VAT","Iran, Islamic Republic of":"IRN","Iran (Islamic Republic of)":"IRN","Islamic Republic of Iran":"IRN","Korea, Republic of":"KOR","Republic of Korea":"KOR","Korea (the Republic of)":"KOR","Korea, Democratic People's Republic of":"PRK","Democratic People's Republic of Korea":"PRK","Korea (the Democratic People's Republic of)":"PRK","Lao People's Democratic Republic":"LAO","Micronesia, Federated States of":"FSM","Micronesia (Federated States of)":"FSM","Moldova, Republic of":"MDA","Republic of Moldova":"MDA","Palestine, State of":"PSE","State of Palestine":"PSE","Russian Federation":"RUS","Syrian Arab Republic":"SYR","Taiwan, Province of China":"TWN","Tanzania, United Republic of":"TZA","United Republic of Tanzania":"TZA","Venezuela, Bolivarian Republic of":"VEN","Venezuela (Bolivarian Republic of)":"VEN","Viet Nam":"VNM","Virgin Islands, British":"VGB","Virgin Islands, U.S.":"VIR","Saint Martin (French part)":"MAF","Sint Maarten (Dutch part)":"SXM","Netherlands (Kingdom of the)":"NLD","Macedonia, the former Yugoslav Republic of":"MKD",Kosovo:"XKX","Republic of Kosovo":"XKX"}),Z=null,_=null;function ln(){if(Z)return Z;let n=new Map,e=[],t=["en",...Un.filter(o=>o!=="en")];for(let o of t){let r=null;try{r=new Intl.DisplayNames([o],{type:"region"})}catch{continue}for(let[a,l]of C){let u;try{u=r.of(a)}catch{u=void 0}if(!u||u===a)continue;let c=g(u);c&&!n.has(c)&&n.set(c,l),e.push([u,l])}}for(let[o,r]of Object.entries(Bn)){let a=g(o);a&&!n.has(a)&&n.set(a,r),e.push([o,r])}for(let[o,r]of Object.entries(En)){let a=g(o);a&&n.set(a,r),e.push([o,r])}let i=new U;for(let[o,r]of e){let a=g(o);n.get(a)===r&&(i.add(o,r),i.add(a,r))}return Z=n,_=i,n}function Kn(){return _||ln(),_}function On(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=g(e),i=ln().get(t);return i||(T(t)?null:Kn().get(h(e))??null)}function L(n){return C.get(String(n||"").trim().toUpperCase())??null}function I(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=e.toUpperCase();return t.length===3&&Pn.has(t)?t:t.length===2&&Ln.has(t)?C.get(t)??null:On(e)}var fn={europe:[-25,34,45,71.5],asia:[25,-11,150,56],africa:[-26,-35,58,38],"south-america":[-92,-56,-34,13],"north-america":[-168,7,-52,72],oceania:[110,-48,200,20]};function wn(n,e,t){let i=fn[t];return!i||n<i[1]||n>i[3]?!1:e>=i[0]&&e<=i[2]?!0:i[2]>180&&e+360>=i[0]&&e+360<=i[2]}var Dn=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],xn=[7,72,-172,-52];function un(n,e,t){return n>=t[0]&&n<=t[1]&&e>=t[2]&&e<=t[3]}var y=n=>Math.round(n*10)/10;function Rt(n,e=3){let t=[],i=[],o=0,r=0,a=Object.keys(fn),l=new Map(a.map(s=>[s,0]));for(let s of n){let p=s?.lat,S=s?.lon;if(typeof p!="number"||typeof S!="number"||!isFinite(p)||!isFinite(S)||p<-90||p>90||S<-180||S>180)continue;t.push(p),i.push(S);for(let m of a)wn(p,S,m)&&l.set(m,l.get(m)+1);let M=s?.country?String(s.country).trim().toUpperCase():"",N=M?B(M):null;N?((M==="US"||M==="USA")&&o++,N==="north-america"&&r++):(Dn.some(m=>un(p,S,m))&&o++,un(p,S,xn)&&r++)}let u=t.length;if(u<e)return null;t.sort((s,p)=>s-p),i.sort((s,p)=>s-p);let c={},d,f=0;for(let s of[...a].sort()){let p=l.get(s);c[s]=y(p/u*100),p>f&&(f=p,d=s)}return{pctUsa:y(o/u*100),pctNa:y(r/u*100),latP5:y(P(t,.05)),latP95:y(P(t,.95)),lonP5:y(P(i,.05)),lonP95:y(P(i,.95)),n:u,regionPct:c,...d?{dominantFrame:d,dominantFramePct:y(f/u*100)}:{}}}var cn={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA XK",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},E=(()=>{let n=new Map;for(let e of Object.keys(cn))for(let t of cn[e].split(/\s+/))t&&n.set(t,e);return n})();function Hn(n){for(let[e,t]of n){let i=E.get(e);i&&!E.has(t)&&E.set(t,i)}}Hn(C);function B(n){if(!n)return null;let e=String(n).trim().toUpperCase();if(!e)return null;let t=E.get(e);if(t)return t;let i=I(String(n));return i?E.get(i)??null:null}function At(n,e=2){return kn(n.map(t=>[t,1]),e)}function kn(n,e=2){let t=new Map,i=0;for(let[l,u]of n){let c=B(l);if(!c)continue;let d=typeof u=="number"&&isFinite(u)&&u>0?u:1;t.set(c,(t.get(c)??0)+d),i+=d}if(i<e||!t.size)return null;let o=0;for(let[l,u]of n)Fn(l)&&(o+=typeof u=="number"&&isFinite(u)&&u>0?u:1);let r="europe",a=-1;for(let l of Array.from(t.keys()).sort()){let u=t.get(l);u>a&&(r=l,a=u)}return{dominantGeoRegion:r,dominantGeoRegionPct:y(a/i*100),regionCount:t.size,middleEastPct:y(Math.min(o,i)/i*100),n:i}}var dn=new Set("AE BH CY EG IL IQ IR JO KW LB OM PS QA SA SY TR YE".split(" ")),pn=new Set([...dn].map(n=>C.get(n)).filter(n=>!!n));function Fn(n){if(!n)return!1;let e=String(n).trim().toUpperCase();if(dn.has(e)||pn.has(e))return!0;let t=I(String(n));return!!t&&pn.has(t)}var Xn=Symbol.for("@bicharts/shape-core/admin1-lookup/v1"),R=(n=>n[Xn]??={lookup:null})(globalThis),Vn=(()=>{let n=new Map;return C.forEach((e,t)=>n.set(e,t)),n})();function bt(n){if(!n||typeof n.cities!="string"||typeof n.admin1!="string")throw new Error("admin1 lookup: not a lookup document");if(R.lookup&&R.lookup.version===n.version)return{cities:R.lookup.cityCount,admin1:R.lookup.admin1Count};let e=new Map,t=(f,s)=>{if(!f)return;let p=e.get(f);p?p.push(s):e.set(f,[s])},i=0;for(let f of n.cities.split(`
3
+ `)){let s=f.split("|");if(s.length<6)continue;let p={cc:s[1],a1:s[2],popK:+s[3]||0,lat:+s[4],lon:+s[5],pid:s[7]||""};t(s[0],{...p,primary:!0});for(let S of(s[6]||"").split(";"))t(S,{...p,primary:!1});i++}let o=new Map,r=new Map,a=(f,s)=>{if(!f)return;let p=r.get(f);p?p.includes(s)||p.push(s):r.set(f,[s])},l=0;for(let f of n.admin1.split(`
4
+ `)){let s=f.split("|");if(!(s.length<2||!s[0].includes("."))){o.set(s[0],s[1]),a(s[1],s[0]);for(let p of(s[2]||"").split(";"))a(p,s[0]);l++}}let u=new Map,c=new Set;for(let f of(n.crosswalk||"").split(`
5
+ `)){let[s,p]=f.split("|");s&&p&&(u.set(s,p),c.add(p))}e.forEach(f=>f.forEach(s=>{s.pid&&c.add(s.pid)}));let d=new Map;for(let f of(n.centers||"").split(`
6
+ `)){let[s,p,S]=f.split("|");s&&isFinite(+p)&&isFinite(+S)&&p!==""&&S!==""&&(d.set(s,[+p,+S]),c.add(s))}return R.lookup={version:n.version,cityByKey:e,admin1ByCode:o,admin1ByKey:r,provinceOfCode:u,provinceIds:c,centers:d,cityCount:i,admin1Count:l},{cities:i,admin1:l}}function W(){return R.lookup!==null}function It(){R.lookup=null}function mn(n){let e=I(n);return e?Vn.get(e)??null:null}var Yn=10;function Mn(n,e={}){if(!R.lookup||!n)return{status:"unmatched"};let t=g(String(n)),i=R.lookup.cityByKey.get(t);if(!i||i.length===0)return{status:"unmatched"};let o=e.country?mn(e.country):null;if(e.country&&o?i=i.filter(d=>d.cc===o):e.region&&(i=i.filter(d=>B(d.cc)===e.region)),i.length===0)return{status:"unmatched"};let r=i.filter(d=>d.primary),a=r.length>0?r:i,l=new Map;for(let d of a){let f=`${d.cc}|${d.a1}|${d.lat}|${d.lon}`;l.has(f)||l.set(f,d)}let u=[...l.values()].sort((d,f)=>f.popK-d.popK),c=u[0];return u.length===1||c.popK>=Yn*Math.max(u[1].popK,1)?!c.a1&&!c.pid?{status:"unmatched"}:{status:"resolved",cc:c.cc,admin1:c.a1,code:`${c.cc}.${c.a1}`,provinceId:c.pid||null,lat:c.lat,lon:c.lon,popK:c.popK}:{status:"ambiguous",candidates:u.length}}function vn(n,e){if(!R.lookup||!n)return[];let t=R.lookup.admin1ByKey.get(g(String(n)))??[],i=e?mn(e):null;return i?t.filter(o=>o.startsWith(i+".")):[...t]}function Zn(n){return!R.lookup||!n?null:R.lookup.provinceOfCode.get(n)??null}function Gt(n){return!R.lookup||!n?!1:R.lookup.provinceIds.has(String(n).trim().toUpperCase())}function gn(n){return!R.lookup||!n?null:R.lookup.centers?.get(String(n).trim().toUpperCase())??null}function z(n,e={}){if(!R.lookup||!n)return{status:"unmatched"};let t=String(n).trim();if(!t)return{status:"unmatched"};if(R.lookup.provinceIds.has(t.toUpperCase()))return{status:"resolved",provinceId:t.toUpperCase()};let i=R.lookup.provinceOfCode.get(t.toUpperCase());if(i)return{status:"resolved",provinceId:i};let o=[...new Set(vn(t,e.country??null).map(Zn).filter(r=>!!r))];if(o.length>1&&e.region){let r=o.filter(a=>B(a.split("-")[0])===e.region);r.length&&(o=r)}return o.length===1?{status:"resolved",provinceId:o[0]}:o.length?{status:"ambiguous",candidates:o.length}:{status:"unmatched"}}var _n={"north-america":"N",world:"W"};function nn(n,e){let t=n.filter(i=>i.row.kinds.includes(_n[e||"north-america"]));return t.length?t:(e||"north-america")==="world"?n:t}var X=en;function Ot(n){n!==X&&(X=n||"",D=null,x=null,H=null,k=null,F=null)}function Wn(){return X.length>0}var zn={US:"washington",CA:"ottawa",MX:"mexico city",GB:"london",FR:"paris",DE:"berlin",IT:"rome",ES:"madrid",PT:"lisbon",NL:"amsterdam",BE:"brussels",CH:"bern",AT:"vienna",IE:"dublin",PL:"warsaw",SE:"stockholm",NO:"oslo",DK:"copenhagen",FI:"helsinki",IS:"reykjavik",CZ:"prague",SK:"bratislava",HU:"budapest",RO:"bucharest",BG:"sofia",GR:"athens",TR:"ankara",UA:"kyiv",RU:"moscow",RS:"belgrade",HR:"zagreb",SI:"ljubljana",EE:"tallinn",LV:"riga",LT:"vilnius",JP:"tokyo",CN:"beijing",KR:"seoul",KP:"pyongyang",IN:"new delhi",PK:"islamabad",BD:"dhaka",LK:"colombo",TH:"bangkok",VN:"hanoi",PH:"manila",ID:"jakarta",MY:"kuala lumpur",SG:"singapore",MM:"naypyidaw",KH:"phnom penh",LA:"vientiane",NP:"kathmandu",AF:"kabul",IR:"tehran",IQ:"baghdad",SA:"riyadh",AE:"abu dhabi",QA:"doha",KW:"kuwait city",BH:"manama",OM:"muscat",JO:"amman",LB:"beirut",SY:"damascus",IL:"jerusalem",YE:"sanaa",EG:"cairo",LY:"tripoli",TN:"tunis",DZ:"algiers",MA:"rabat",SD:"khartoum",ET:"addis ababa",KE:"nairobi",TZ:"dodoma",UG:"kampala",NG:"abuja",GH:"accra",CI:"yamoussoukro",SN:"dakar",ML:"bamako",CM:"yaounde",CD:"kinshasa",CG:"brazzaville",AO:"luanda",ZM:"lusaka",ZW:"harare",MZ:"maputo",BW:"gaborone",NA:"windhoek",ZA:"pretoria",AU:"canberra",NZ:"wellington",PG:"port moresby",FJ:"suva",BR:"brasilia",AR:"buenos aires",CL:"santiago",PE:"lima",CO:"bogota",VE:"caracas",EC:"quito",BO:"la paz",PY:"asuncion",UY:"montevideo",GY:"georgetown",SR:"paramaribo",CU:"havana",DO:"santo domingo",HT:"port au prince",JM:"kingston",TT:"port of spain",PA:"panama city",CR:"san jose",NI:"managua",HN:"tegucigalpa",SV:"san salvador",GT:"guatemala city",BZ:"belmopan",AZ:"baku",AM:"yerevan",GE:"tbilisi",KZ:"astana",UZ:"tashkent",TM:"ashgabat",KG:"bishkek",TJ:"dushanbe",MN:"ulaanbaatar",BY:"minsk",MD:"chisinau",AL:"tirana",MK:"skopje",BA:"sarajevo",ME:"podgorica",XK:"pristina",CY:"nicosia",MT:"valletta",LU:"luxembourg"},D=null;function K(){if(D)return D;let n=new Map,e=X,t=(i,o,r)=>{if(!i)return;let a=n.get(i);a?a.some(l=>l.row===o)||a.push({row:o,primary:r}):n.set(i,[{row:o,primary:r}])};for(let i of e.split(",")){let o=i.split("|");if(o.length<7)continue;let r={a1:o[1],cc:o[2],lon:+o[3],lat:+o[4],pop:+o[5],kinds:o[6]||"N"};o.length>8&&o[8]&&(r.tags=o[8].split(";").filter(Boolean));let a=zn[r.cc];if(a&&G(o[0])===G(a)&&(r.tags||(r.tags=[]),r.tags.includes("capital")||r.tags.push("capital")),t(g(o[0]),r,!0),o.length>7&&o[7])for(let l of o[7].split(";"))t(g(l),r,!1)}for(let i of n.values())i.sort((o,r)=>r.row.pop-o.row.pop);return D=n,n}var Jn=200,x=null;function yn(){if(x)return x;let n=new Map;for(let[e,t]of K()){if(!e.endsWith(" city"))continue;let i=e.slice(0,-5);!i||K().get(i)?.some(o=>o.primary)||t[0].row.pop<Jn||n.set(i,t)}return x=n,n}function V(n,e){if(!n)return;let t=Sn(K(),yn(),n);if(t)return t;if(T(n))return;let i=e??G(n);if(v(i))return Sn(Qn(),jn(),i)}function Sn(n,e,t){let i=n.get(t);if(i?.some(a=>a.primary))return i;let o=e.get(t);if(!o)return i;let r=o.map(a=>({row:a.row,primary:!0}));return i?[...r,...i]:r}var H=null;function Qn(){return H||(H=Nn(K())),H}var k=null;function jn(){return k||(k=Nn(yn())),k}function Nn(n){let e=new Map;for(let[t,i]of n){let o=G(t);if(!v(o))continue;let r=e.get(o);if(!r){e.set(o,i.slice());continue}for(let a of i){let l=r.findIndex(u=>u.row===a.row);l<0?r.push(a):a.primary&&!r[l].primary&&(r[l]=a)}}for(let t of e.values())t.sort((i,o)=>o.row.pop-i.row.pop);return e}var $n="XKX|21.17|42.67",F=null;function qn(){if(F)return F;let n=new Map;for(let t of`${$n},${an}`.split(",")){let i=t.split("|");i.length<3||n.set(i[0],{lon:+i[1],lat:+i[2]})}let e=new Map;for(let t of K().values())for(let i of t){let o=L(i.row.cc);if(!o)continue;let r=e.get(o);(r===void 0||i.row.pop>r)&&(e.set(o,i.row.pop),n.set(o,{lon:i.row.lon,lat:i.row.lat}))}return F=n,n}var J=null;function Y(){if(J)return J;let n=new Map;for(let e of on.split(",")){let t=e.split("|");if(t.length<5)continue;let i={key:t[0],cc:t[1],name:t[2],lon:+t[3],lat:+t[4]};n.set(g(i.key),i);let o=g(i.name);o==="mexico"&&i.cc==="MX"?(n.set("estado de mexico",i),n.set("edomex",i)):n.set(o,i)}return J=n,n}var Q=null;function nt(){if(Q)return Q;let n=new U;for(let[e,t]of Y())n.add(e,t);return Q=n,n}var j=null;function tt(){if(j)return j;let n=new Map;for(let e of rn.split(",")){let t=e.split("|");t.length<3||n.set(t[0],{lon:+t[1],lat:+t[2]})}return j=n,n}var et=new Set(["USA","PRI","VIR","GUM","ASM","MNP"]),bn=new Set(["USA","CAN","MEX"]);function Rn(n,e){return e!=="north-america"||!!n&&bn.has(n)}function An(n){if(n==null)return null;let e=g(String(n));if(!e)return null;let t=Y().get(e);return t?t.key:T(e)?null:nt().get(h(String(n)))?.key??null}var In={us:"US",usa:"US","u s":"US","u s a":"US",america:"US","united states":"US","united states of america":"US",ca:"CA",can:"CA",canada:"CA",mx:"MX",mex:"MX",mexico:"MX","estados unidos mexicanos":"MX"};function wt(n){if(n==null)return null;let e=g(String(n));if(!e)return null;let t=In[e];return t||(T(e)?null:it().get(h(String(n)))??null)}var $=null;function it(){if($)return $;let n=new U;for(let[e,t]of Object.entries(In))n.add(e,t);return $=n,n}function ot(n){return Y().get(g(n))?.cc??null}function rt(n){let e=ot(n);return e?L(e):null}function Dt(n){return Gn(n)[0]??null}function at(n){if(n==null)return null;let e=String(n).trim().replace(/\.0+$/,"");if(!e)return null;let t=/^(\d{5})(-\d{4})?$/.exec(e);return t?t[1]:/^\d{3,4}$/.test(e)?e.padStart(5,"0"):null}function Gn(n){if(n==null)return[];let e=String(n).trim().replace(/\.0+$/,"");if(!e)return[];if(/^\d{3}$/.test(e)){let i=e.padStart(5,"0").slice(0,3);return i===e?[e]:[e,i]}let t=at(e);return t?[t.slice(0,3)]:[]}function st(n){return!!n&&n.ambiguous===!0&&!("precision"in n)}function lt(n){let e=null,t=typeof n.lat=="string"?n.lat.trim():n.lat,i=typeof n.lon=="string"?n.lon.trim():n.lon;if(t!=null&&t!==""&&i!==void 0&&i!==null&&i!==""){let a=+t,l=+i;if(isFinite(a)&&isFinite(l)&&a>=-90&&a<=90&&l>=-180&&l<=180)if(a===0&&l===0)e={lat:0,lon:0,precision:"latlon"};else return{lat:a,lon:l,precision:"latlon"}}let o=I(n.country),r=An(n.state);if(r&&o&&rt(r)!==o&&(r=null),r&&n.region&&n.region!=="north-america"&&(r=null),n.city!==void 0&&n.city!==null){let a=g(String(n.city)),l=V(a,h(String(n.city))),u=l?nn(l,n.mapKind):null;if(u&&u.length){let c=n.state===void 0||n.state===null?"":String(n.state).trim(),d=c?g(c):"",f=c?An(c):null,s=[],p=-1;for(let M of u){let N=M.row,m=0;if(c&&N.a1!=="")if(f&&N.a1===f||g(N.a1)===d)m++;else continue;if(o)if(L(N.cc)===o)m++;else continue;m>p?(p=m,s=[M]):m===p&&s.push(M)}s.some(M=>M.primary)&&(s=s.filter(M=>M.primary));let S=new Map;for(let M of s)S.set(M.row.lon.toFixed(2)+","+M.row.lat.toFixed(2),M.row);if(S.size===1){let M=s[0].row;return{lat:M.lat,lon:M.lon,precision:"city"}}if(S.size>1)return{ambiguous:!0,matches:S.size}}if(W()){let c=Mn(String(n.city),{country:n.country??null,region:n.region??null});if(c.status==="ambiguous")return{ambiguous:!0,matches:c.candidates};if(c.status==="resolved"&&Rn(L(c.cc),n.mapKind)){let d=n.state===void 0||n.state===null?"":String(n.state).trim(),f=d?z(d,{country:n.country??null,region:n.region??null}):null;if(!f||f.status==="resolved"&&f.provinceId===c.provinceId)return{lat:c.lat,lon:c.lon,precision:"city"}}}}if(!o||et.has(o))for(let a of Gn(n.zip)){let l=tt().get(a);if(l)return{lat:l.lat,lon:l.lon,precision:"zip3"}}if(r){let a=Y().get(g(r));if(a)return{lat:a.lat,lon:a.lon,precision:"state"}}if(!r&&n.state!==void 0&&n.state!==null&&String(n.state).trim()&&W()){let a=z(String(n.state),{country:n.country??null,region:n.region??null});if(a.status==="ambiguous")return{ambiguous:!0,matches:a.candidates};if(a.status==="resolved"){let l=L(a.provinceId.split("-")[0]),u=gn(a.provinceId);if(u&&(!o||l===o)&&Rn(l,n.mapKind))return{lat:u[1],lon:u[0],precision:"state"}}}if(o&&(n.mapKind!=="north-america"||bn.has(o))){let a=qn().get(o);if(a)return{lat:a.lat,lon:a.lon,precision:"country"}}return e}var w={latlon:0,city:1,zip3:2,state:3,country:4},Cn=8;function xt(n,e,t){let i=new Array(n.length),o=new Array(n.length),r=new Array(n.length),a=new Set,l=[],u=new Set,c=[],d=new Set,f=[],s={latlon:0,city:0,zip3:0,state:0,country:0},p=0,S=0,M=null;for(let m=0;m<n.length;++m){let O=n[m],b=lt({...O,mapKind:e,region:t});if(st(b)){i[m]=null,o[m]=null,r[m]=null,S++;let A=q(O);A&&!d.has(A.toLowerCase())&&(d.add(A.toLowerCase()),f.length<Cn&&f.push(A))}else if(b){if(i[m]=b.lat,o[m]=b.lon,r[m]=b.precision,p++,s[b.precision]++,(M===null||w[b.precision]>w[M])&&(M=b.precision),w[b.precision]>w.city){let A=q(O);A&&!u.has(A.toLowerCase())&&(u.add(A.toLowerCase()),c.length<Cn&&c.push(A))}}else{i[m]=null,o[m]=null,r[m]=null;let A=q(O);A&&!a.has(A.toLowerCase())&&(a.add(A.toLowerCase()),l.push(A))}}let N=!Wn()&&n.some(m=>m.city!==null&&m.city!==void 0&&String(m.city).trim()!=="");return{lat:i,lon:o,precisions:r,precision:M,precisionCounts:s,coarseExamples:c,unmatched:l,ambiguousRows:S,ambiguousExamples:f,matchedRows:p,totalRows:n.length,...N?{cityTableMissing:!0}:{}}}function q(n){let e=[n.city,n.state,n.zip,n.country].filter(t=>t!=null&&String(t).trim()!=="").map(t=>String(t).trim()).join(", ");return e||(n.label===null||n.label===void 0?"":String(n.label).trim())}function Ht(n,e){let t=g(String(n??""));if(!t)return[];let i=V(t,h(String(n??"")));if(!i)return[];let o=I(e??null),r=new Set;for(let a of i)if(!(o&&L(a.row.cc)!==o))for(let l of a.row.tags??[])r.add(l);return Array.from(r)}function kt(n,e){if(!n)return!1;let t=V(n);return t?nn(t,e).length>0:!1}function Ft(n,e){let t=new Set,i=0;for(let o of n){if(o==null)continue;let r=g(String(o));if(T(r)||t.has(r))continue;t.add(r);let a=V(r,h(String(o)));a&&nn(a,e).length>0&&i++}return t.size===0?0:Math.round(i/t.size*1e3)/10}export{ct as a,T as b,pt as c,g as d,h as e,Ln as f,Pn as g,ln as h,On as i,I as j,fn as k,Rt as l,Hn as m,B as n,At as o,kn as p,Fn as q,bt as r,W as s,It as t,mn as u,Yn as v,Mn as w,vn as x,Zn as y,Gt as z,z as A,Ot as B,Wn as C,bn as D,An as E,wt as F,Dt as G,at as H,Gn as I,st as J,lt as K,xt as L,Ht as M,kt as N,Ft as O};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a as be}from"./chunk-U3H6UBOO.mjs";import{a as At,f as ee,g as Se,h as ie,i as _e,j as ne}from"./chunk-TZ74QIKA.mjs";import{b as ht,c as yt,d as bt,e as St,f as _t}from"./chunk-WTJVREEE.mjs";import{c as ft,l as gt,n as he,p as pt,s as re,w as ye,x as ke,y as De,z as Pe}from"./chunk-AAPXJXEP.mjs";import{e as lt,k as ge,m as dt,n as mt,o as pe}from"./chunk-3ZAS32F5.mjs";import{b as ut,d as ct}from"./chunk-5HI6TVMM.mjs";import{A as fe,B as ot,E as at,a as ce,b as J,c as Ze,d as de,g as qe,h as Qe,j as Je,l as et,m as tt,o as nt,p as me,q as rt,r as it,u as Ne,w as st}from"./chunk-CZJ7M6A5.mjs";import{c as Xe,f as Ee}from"./chunk-WC4JINEZ.mjs";var cn=85,dn=60,mn=/(^|[^a-z])(state|province|provincia|provinz|region|regione|regiao|county|department|departement|departamento|prefecture|oblast|canton|kanton|bundesland|land|territory)([^a-z]|$)/i,Oe=t=>Math.round(t*10)/10,Ae=t=>t.split("-")[0];function xt(t){let e=new Map,n=0;if(t.forEach((s,o)=>{let l=he(o);l&&(e.set(l,(e.get(l)||0)+s),n+=s)}),n===0)return{};let[i,r]=[...e].sort((s,o)=>o[1]-s[1])[0];return{dominantRegion:i,dominantRegionPct:Oe(100*r/n)}}function bi(t){let e=t.province===null||t.province===void 0?"":String(t.province).trim();if(e)return Ct(e,t.provinceKind,t.country);if(!re())return null;let n=t.city===null||t.city===void 0?"":String(t.city).trim();if(!n)return null;let i=ye(n,{country:t.country===null||t.country===void 0?null:String(t.country)});return i.status==="resolved"?i.provinceId:null}function Ct(t,e,n){if(e==="us-state-code"||e==="us-state-name"){let s=_t(t,e);return s?"US-"+s:null}if(!re())return null;if(e==="admin1-code")return Pe(t)?t.toUpperCase():null;let i=n==null?null:String(n),r=new Set(ke(t,i).map(De).filter(s=>!!s));return r.size===1?[...r][0]:null}function Si(t,e={}){let n=e.deriveProvinces!==!1,i=new Array(t.length),r=new Array(t.length),s=new Set,o=[],l=new Set,a=[],c=0,d=0,g=0,m=A=>{let S=A.toLowerCase();s.has(S)||(s.add(S),o.push(A))},b=A=>A==null||A===""?null:Number(A),M=new Map;return t.forEach((A,S)=>{i[S]=null,r[S]=null;let p=A.country===null||A.country===void 0||String(A.country).trim()===""?null:String(A.country).trim(),h=A.province===null||A.province===void 0?"":String(A.province).trim();if(h){let _=Ct(h,e.provinceKind,p);_?(i[S]=_,r[S]="province",c++):m(h);return}if(!n)return;let x=b(A.lat),f=b(A.lon),C=!1;if(e.locate&&x!==null&&f!==null&&isFinite(x)&&isFinite(f)){C=!0;let _=e.locate(x,f);if(_){i[S]=_,r[S]="coordinates",c++;return}}let y=A.city===null||A.city===void 0?"":String(A.city).trim();if(y&&re()){let _=y.toLowerCase()+""+(p??""),w=M.get(_);if(w||(w=ye(y,{country:p}),M.set(_,w)),w.status==="resolved"&&w.provinceId){i[S]=w.provinceId,r[S]="city",c++;return}if(w.status==="ambiguous"){d++,l.has(_)||(l.add(_),a.length<8&&a.push(y));return}m(y);return}C&&g++}),{iso:i,source:r,unmatched:o,matchedRows:c,totalRows:t.length,ambiguousRows:d,ambiguousExamples:a,unplacedPoints:g}}function wt(t,e,n={}){let i=new Map;if(!re()||e.length===0)return i;let r=t.findIndex(l=>!l.isMeasure&&(l.geoKind||"").startsWith("country")),s=l=>l==null?"":String(l).trim(),o=l=>{let a=new Map;for(let b of e){let M=s(b[l]);if(!M)continue;let A=r>=0&&s(b[r])||null,S=M+""+(A??""),p=a.get(S);p?p.rows++:a.set(S,{city:M,country:A,rows:1})}if(a.size===0)return null;let c=0,d=0,g=new Set,m=new Map;return a.forEach(b=>{let M=ye(b.city,{country:b.country});M.status!=="unmatched"&&d++,!(M.status!=="resolved"||!M.provinceId)&&(c++,g.add(M.provinceId),m.set(M.cc,(m.get(M.cc)||0)+b.rows))}),{signals:{rollupPct:Oe(100*c/a.size),regionCount:g.size,countryCount:m.size,...xt(m)},cityPct:100*d/a.size,distinct:a.size}};return t.forEach((l,a)=>{if(l.isMeasure||a===r)return;let c=l.geoKind||"";if(c.startsWith("city")){if(n.cities===!1)return;let _=o(a);_&&i.set(a,_.signals);return}if(c)return;let d=new Map,g=new Map;for(let _ of e){let w=s(_[a]);w&&(d.set(w,(d.get(w)||0)+1),g.has(w)||g.set(w,r>=0&&s(_[r])||null))}if(d.size<3)return;let m=0,b=0,M=0,A=new Set,S=new Map;d.forEach((_,w)=>{if(Pe(w)){m++;let z=w.toUpperCase();A.add(z),S.set(Ae(z),(S.get(Ae(z))||0)+_);return}let W=new Set(ke(w,g.get(w)).map(De).filter(z=>!!z));if(W.size===1){b++;let z=[...W][0];A.add(z),S.set(Ae(z),(S.get(Ae(z))||0)+_)}else W.size>1&&M++});let h=mn.test(l.name.replace(/[_-]+/g," "))?dn:cn,x=100*m/d.size,f=100*b/d.size,C=x>=f,y=C?x:f;if(y<h){if(n.cities===!1)return;let _=o(a);if(!_||_.cityPct<ft||_.distinct<bt&&!yt(l.name,ht))return;i.set(a,_.signals);return}i.set(a,{kind:C?"admin1-code":"admin1-name",matchPct:Oe(y),ambiguous:!C&&M/d.size>.15?!0:void 0,regionCount:A.size,countryCount:S.size,...xt(S)})}),i}function ze(t){let e=(t||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}var Le={a:0,b:0,c:0,yearFirst:!1,sep:"",trail:"",word:"",day:0,year:0,namedOrder:"dmy",cjkPattern:""},fn=/\s+(\d{1,2}):(\d{2})(?::(\d{2})(?:[.,]\d{1,9})?)?(?:\s*([ap])\.?\s?m\.?)?$/i,gn=/^(\d{1,4})(\s*[./-]\s*)(\d{1,2})(\s*[./-]\s*)(\d{1,4})(\.?)$/,pn=/^(\d{4})(\s*[年년]\s*)(\d{1,2})(\s*[月월]\s*)(\d{1,2})(\s*[日일号])$/,hn=/(\d)(?:st|nd|rd|th|er|º|ª)(?=[\s.,/-]|$)/gi,yn=new Set(["de","del","of"]),bn=new Set(["\u0433","\u0440","r"]),Sn=/^[\p{L}\p{M}\u0970\u05f3]+$/u,Fe=/^\d+$/;function _n(t){let e=+t[1],n=+t[2],i=t[3]===void 0?0:+t[3],r=t[4]!==void 0;if(n>59||i>59)return null;if(r){if(e<1||e>12)return null;e=e%12+(t[4].toLowerCase()==="p"?12:0)}else if(e>23)return null;return{h:e,mi:n,s:i,seconds:t[3]!==void 0,meridiem:r}}function Mt(t){let e=t.replace(/[\u200e\u200f\u061c]/g,"").replace(/\s+/g," ").trim();if(e==="")return null;e=At(e);let n=null,i=fn.exec(e);if(i){if(n=_n(i),!n)return null;e=e.slice(0,i.index)}let r;if(r=pn.exec(e)){let m=`cjk|${r[2]}|${r[4]}|${r[6]}`;return{...Le,form:"cjk",key:m,clock:n,a:+r[1],b:+r[3],c:+r[5],yearFirst:!0,cjkPattern:`%Y${r[2]}%m${r[4]}%d${r[6]}`}}if(r=gn.exec(e)){let m=r[2],b=r[4];if(m!==b)return null;let M=m.trim(),A=r[6];if(A&&M!==".")return null;let S=[r[1].length,r[3].length,r[5].length],p=S[0]===4,h=S[2]===4;return p===h||(p?S[1]>2||S[2]>2:S[0]>2||S[1]>2)?null:p&&M==="-"&&m==="-"&&S[1]===2&&S[2]===2?"iso":p&&M==="."&&m==="."&&!A&&!(S[1]===2&&S[2]===2)?null:{...Le,form:"numeric",key:`num|${p?"y":"x"}|${m}|${A}`,clock:n,a:+r[1],b:+r[3],c:+r[5],yearFirst:p,sep:m,trail:A}}let s=e.replace(hn,"$1").split(/[\s.,/-]+/).filter(m=>m!==""&&!yn.has(m.toLowerCase()));if(s.length===4&&Fe.test(s[2])&&bn.has(s[3].toLowerCase())&&s.pop(),s.length!==3)return null;let o=s.map(m=>Fe.test(m)?"N":Sn.test(m)?"W":"?").join(""),l=s.map(m=>Fe.test(m)?m:""),a=0,c=0,d="",g;if(o==="NWN"&&l[0].length<=2&&l[2].length===4)a=+l[0],d=s[1],c=+l[2],g="dmy";else if(o==="WNN"&&l[1].length<=2&&l[2].length===4)d=s[0],a=+l[1],c=+l[2],g="mdy";else if(o==="NWN"&&l[0].length===4&&l[2].length<=2)c=+l[0],d=s[1],a=+l[2],g="ymd";else return null;return{...Le,form:"named",key:`named|${g}`,clock:n,day:a,year:c,word:d,namedOrder:g}}var An=[31,28,31,30,31,30,31,31,30,31,30,31],xn=t=>t%4===0&&t%100!==0||t%400===0;function Tt(t,e,n){return t>=1&&t<=9999&&e>=1&&e<=12&&n>=1?n<=(e===2&&xn(t)?29:An[e-1]):!1}function Cn(t,e,n,i){let r=new Date(Date.UTC(2e3,e-1,n,i?.h??0,i?.mi??0,i?.s??0));return r.setUTCFullYear(t),r}function vt(t,e={}){let n=(e.floor??1)>=1,i=new Map,r=new Map,s=0,o=null;for(let p of t){if(p==null)continue;if(typeof p!="string"){if(n)return null;s++;continue}let h=p.trim();if(h==="")continue;s++;let x=i.get(h);if(x===void 0&&(x=Mt(h),i.set(h,x)),x===null||x==="iso"){if(n)return null;continue}if(n){if(o===null)o=x;else if(x.key!==o.key)return null}else r.set(x.key,(r.get(x.key)??0)+1)}if(!n){let p=0,h="";for(let[x,f]of r)f>p&&(p=f,h=x);if(p===0||p/s<e.floor)return null;o=[...i.values()].find(x=>x!==null&&x!=="iso"&&x.key===h)??null}if(o===null)return null;let l=o.key,a=[...i.values()].filter(p=>p!==null&&p!=="iso"&&p.key===l),c,d="shape",g=null;if(o.form==="named"){if(c=o.namedOrder,g=_e(a.map(p=>p.word),e.locale),!g)return null}else if(o.form==="cjk"||o.yearFirst)c="ymd";else{let p=0,h=0;for(let x of a)x.a>12&&p++,x.b>12&&h++;if(p>0&&h>0)return null;p>0?(c="dmy",d="values"):h>0?(c="mdy",d="values"):o.sep.trim()==="."?(c="dmy",d="shape"):(c=ze(e.locale)?"mdy":"dmy",d="locale")}let m=p=>{if(p.form==="named"){let h=g.get(ee(p.word));return h===void 0?null:[p.year,h+1,p.day]}return p.yearFirst?[p.a,p.b,p.c]:c==="dmy"?[p.c,p.b,p.a]:[p.c,p.a,p.b]},b=1/0,M=-1/0,A=0;for(let p of a){let h=m(p);if(!h||!Tt(h[0],h[1],h[2])){if(n)return null;A++;continue}b=Math.min(b,h[0]),M=Math.max(M,h[0])}if(!n&&(r.get(l)-A)/s<e.floor||b>=2400&&M<=2699||b>=1300&&M<=1500)return null;let S={form:o.form,order:c,orderFrom:d,hasTime:a.some(p=>p.clock!==null),read(p){if(typeof p!="string")return null;let h=p.trim();if(h==="")return null;let x=i.get(h);if(x===void 0&&(x=Mt(h),i.set(h,x)),x===null||x==="iso"||x.key!==l)return null;let f=m(x);return!f||!Tt(f[0],f[1],f[2])?null:Cn(f[0],f[1],f[2],x.clock)}};if(o.form!=="named"&&!a.some(p=>p.clock?.meridiem)){let p;o.form==="cjk"?p=o.cjkPattern:o.yearFirst?p=`%Y${o.sep}%m${o.sep}%d${o.trail}`:p=(c==="dmy"?`%d${o.sep}%m${o.sep}%Y`:`%m${o.sep}%d${o.sep}%Y`)+o.trail;let h=a.filter(x=>x.clock!==null).length;h===0?S.pattern=p:h===a.length&&(S.pattern=p+(a.every(x=>x.clock.seconds)?" %H:%M:%S":" %H:%M"))}return S}import rn from"papaparse";var wn=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","capita","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan","ocupacion","ocupacao","occupazione","auslastung","bezetting","belaggning","belaegning","belegg","kayttoaste","oblozenie","obsazenost","obsadenost","kihasznaltsag","doluluk","ocupare","popunjenost","efficacite","eficiencia","efficienza","effizienz","effectiviteit","verimlilik"],Mn=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],Tn=["latitude","longitude"],vn=["latitude","longitude"];function q(t){return ce(t)}var Et=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z","sum pa","\u0441\u0443\u043C\u043C\u0430","\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E","\u0441\u0443\u043C\u0430","\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C","\u03B1\u03B8\u03C1\u03BF\u03B9\u03C3\u03BC\u03B1","\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2"],In=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von","prom.","\u0441\u0440\u0435\u0434\u043D\u0435\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435","\u0441\u0440\u0435\u0434\u043D\u0435\u0435","\u0441\u0435\u0440\u0435\u0434\u043D\u0454","\u03BC\u03B5\u03C3\u03BF\u03C2 \u03BF\u03C1\u03BF\u03C2","\u0645\u06CC\u0627\u0646\u06AF\u06CC\u0646"],Rn=["osszege","sucet","\u7684\u603B\u548C","\u7684\u8BA1\u6570","\u306E\u5408\u8A08","\uC758 \uD569\uACC4"],En=["atlaga","priemer","\u7684\u5E73\u5747\u503C","\u306E\u5E73\u5747","\uC758 \uD3C9\uADE0"],xe=Object.freeze({"nombre de":"count","recuento de":"count","contagem de":"count","anzahl von":"count","aantal van":"count","conteggio di":"count","antal av":"count",lukumaara:"count","pocet z":"count",\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:"count",\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C:"count",\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2:"count",\u7684\u8BA1\u6570:"count","minimum de":"min","minimo de":"min","minimo di":"min","minimum von":"min","maximum de":"max","maximo de":"max","massimo di":"max","maximum von":"max"});function We(t){return[...t].sort((e,n)=>n.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Nt=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+We(Et)+")\\s+)","i");function It(t){for(let e of t){let n=e.codePointAt(0)??0;if(n>=11904&&n<=40959||n>=44032&&n<=55215)return!0}return!1}var Nn="[\u2013\u2014-]";function kt(t){let e=t.filter(r=>!It(r)),n=t.filter(It),i=[];return e.length&&i.push("(?:\\s+|\\s*"+Nn+"\\s*)("+We(e)+")"),n.length&&i.push("\\s*("+We(n)+")"),new RegExp("(?:"+i.join("|")+")\\s*$","i")}var $e=kt(Rn),kn=kt(En);function Ce(t,e){let n=e.exec(t);if(!n)return null;let i=t.slice(0,n.index);return i.trim()===""?null:{base:i,label:(n[1]??n[2]??"").toLowerCase()}}function Dt(t){let e=q(String(t??"").trim().toLowerCase());if(!e)return null;for(let r of In)if(e.startsWith(r+" "))return xe[r]??"avg";for(let r of Et)if(e.startsWith(r+" ")||e===r)return xe[r]??"sum";let n=Ce(e,kn);if(n)return xe[n.label]??"avg";let i=Ce(e,$e);return i?xe[i.label]??"sum":null}var Dn=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,Pn=new RegExp("\\b("+wn.join("|")+")\\b|("+Mn.join("|")+")$","i"),On=new RegExp("\\b("+Tn.join("|")+")\\b|("+vn.join("|")+")$","i");function Me(t){if(!t)return"";let e=String(t),n=q(e),i=Nt.exec(n);if(i)return e.slice(i[0].length).trim();let r=Ce(n,$e);return(r?e.slice(0,r.base.length):e).trim()}function Ln(t){if(!t)return!1;let e=q(String(t));return Nt.test(e)||Ce(e,$e)!==null}var Fn=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],Rt=new RegExp("^\\s*("+[...Fn].sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function Pt(t){if(t==null)return"";let e=String(t),n=Rt.exec(e);if(!n)return e;let i=l=>l.toLowerCase().replace(/\s+/g," ").trim(),r=i(n[1]),s=e.slice(n[0].length),o=0;for(;o<8;){let l=Rt.exec(s);if(!l||i(l[1])!==r)break;let a=s.slice(l[0].length);if(a.trim()==="")break;s=a,o++}return o===0?e:e.slice(0,n[0].length)+s}function Be(t,e){if(!t||!e)return!1;let n=String(t);for(let i of e){let r=i?.hostName;if(r&&r!==i?.name&&n.includes(r))return!0}return!1}var we={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},Ot=new RegExp("^("+Object.keys(we).join("|")+")\\((.+)\\)$");function Lt(t){if(!t)return[];let e=Ot.exec(String(t).trim());if(!e)return[];let n=we[e[1]],i=e[2],r=[];for(let s=i.indexOf(".");s>=0;s=i.indexOf(".",s+1)){if(s===0)continue;let o=i.slice(s+1);if(o.trim()!=="")for(let l of n){let a=l+o;r.includes(a)||r.push(a)}}return r}function Ft(t,e,n){let i=Ot.exec(String(t??"").trim());if(!i)return!1;let r=i[1];if((r==="Count"||r==="CountNonNull")&&n==="Decimal")return!0;let s=new Set(we[r]),o=String(e??""),l=i[2];for(let a=l.indexOf(".");a>=0;a=l.indexOf(".",a+1)){if(a===0)continue;let c=l.slice(a+1);if(c.trim()!==""){for(let d of Object.values(we))for(let g of d)if(!s.has(g)&&o===g+c)return!0}}return!1}function zn(t){let e=Me(t);return e.length===0?"":e.replace(Dn," ")}function zt(t,e){if(!e)return!1;let n=Me(e);return t.test(q(zn(e)))||t.test(q(n))||t.test(q(J(n).join(" ")))}function Wt(t){return zt(On,t)}function Wn(t){return zt(Pn,t)||Wt(t)}var $t=/int|double|decimal|single|float|number|currency|money/i;function $n(t){let e=String(t?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||t?.isMeasure===!0||$t.test(String(t?.dataType??""))?"Continuous":"Categorical"}function Bn(t){return t?.isMeasure===!0||$t.test(String(t?.dataType??""))}function Bt(t){let e=t??{},n=$n(e);if(n!=="Continuous")return{nature:n,additivity:"unknown",basis:"role",suppressed:!1};if(Wt(e.name))return{nature:n,additivity:"positional",basis:"name",suppressed:!0};let i=String(e.additivity??"").trim().toLowerCase();if(!(i==="additive"&&Ln(e.name))){if(i==="additive")return{nature:n,additivity:"additive",basis:"measured",suppressed:!1};if(i==="part_of_whole")return{nature:n,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(i==="intensive_rate")return{nature:n,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:n,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:Wn(e.name)?{nature:n,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:n,additivity:"additive",basis:"default",suppressed:!1}}function Gt(t){let e=Bt(t),n=t??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return Bn(n)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function Ti(t){return Gt(t)[0]}function vi(t,e){return Gt(t).indexOf(e)>=0}function Ii(t,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let n=Bt(t);return n.additivity==="additive"||n.additivity==="part_of_whole"||n.additivity==="unknown"}var Gn={de:["nr","nummer","kennung","kennziffer","plz","postleitzahl"],nl:["nr","nummer"],sv:["nr","nummer"],da:["nr","nummer"],nb:["nr","nummer"],fi:["tunnus","koodi","nro"],hu:["azonos\xEDt\xF3","k\xF3d"],tr:["kod","kodu","numaras\u0131","numarasi"],zh:["\u7F16\u53F7","\u4EE3\u7801","\u7F16\u7801","\u53F7\u7801","\u90AE\u7F16"],ja:["\u756A\u53F7","\u30B3\u30FC\u30C9"],ko:["\uBC88\uD638","\uCF54\uB4DC"],hi:["\u0915\u094B\u0921","\u0915\u094D\u0930\u092E\u093E\u0902\u0915"],fr:["num\xE9ro"],es:["c\xF3digo"],pt:["c\xF3digo","cep"],it:["codice"],pl:["kod","numer"],cs:["k\xF3d","\u010D\xEDslo"],sk:["k\xF3d","\u010D\xEDslo"],hr:["\u0161ifra","oznaka"],ru:["\u043A\u043E\u0434","\u043D\u043E\u043C\u0435\u0440"],uk:["\u043A\u043E\u0434","\u043D\u043E\u043C\u0435\u0440"],el:["\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2"],ar:["\u0631\u0645\u0632","\u0643\u0648\u062F","\u0631\u0642\u0645"],he:["\u05E7\u05D5\u05D3"],id:["kode","nomor"],vi:["m\xE3"],th:["\u0E23\u0E2B\u0E31\u0E2A"]},Kn=["fr","es","pt","it","pl","cs","sk","hr","ru","uk","el","ar","he","id","vi","th"],Vn=["num\xE9ro"],Un=t=>t.normalize("NFC").toLowerCase();function Hn(t,e,n,i){let r=Ee(n);return!r||!t?null:t===e?"word":r.wordBreaks===!1?Array.from(e).length<tt?null:(i?t.startsWith(e):t.endsWith(e))&&t.length>e.length?"suffix":null:i?Je(t,n).includes(e)?"word":null:r.script==="Hang"?et(t,e)?"suffix":null:r.compounds&&Qe(t,e,qe)?"suffix":null}function Kt(t){let e=String(t??"").trim();if(!e)return null;let n=de(e),i=de(Me(e));for(let[r,s]of Object.entries(Gn)){let o=Kn.includes(r),l=o?i:n;for(let a of s){let c=Vn.includes(a)||!!Ee(r)?.foldSensitive,d=c?l.words:l.folded;if(d.length===0)continue;let g=c?Un(a):de(a).folded.join(" "),m=Hn(o?d[0]:d[d.length-1],g,r,o);if(m)return{lang:r,word:a,view:m}}}return null}var Yn=[["Lu",/^\p{Lu}$/u],["Ll",/^\p{Ll}$/u],["Lt",/^\p{Lt}$/u],["Lm",/^\p{Lm}$/u],["Lo",/^\p{Lo}$/u],["Mn",/^\p{Mn}$/u],["Mc",/^\p{Mc}$/u],["Nd",/^\p{Nd}$/u]];function Te(t){for(let[e,n]of Yn)if(n.test(t))return e;return null}var jn=[{id:"ascii",test:/^[A-Za-z]$/,ranges:[[65,90],[97,122]]},{id:"latin",test:/^[\u00C0-\u017F]$/u,ranges:[[192,383]]},{id:"cyrillic",test:/^[\u0400-\u045F\u0490-\u0491]$/u,ranges:[[1024,1119],[1168,1169]]},{id:"greek",test:/^[\u0386-\u03CE]$/u,ranges:[[902,974]]},{id:"han",test:/^[\u4E00-\u9FFF]$/u,ranges:[[19968,40959]]},{id:"hiragana",test:/^\p{Script=Hiragana}$/u,ranges:[[12353,12447]]},{id:"katakana",test:/^\p{Script=Katakana}$/u,ranges:[[12448,12543]]},{id:"hangul",test:/^[\uAC00-\uD7A3]$/u,ranges:[[44032,55203]]},{id:"arabic",test:/^[\u0620-\u0652\u0671-\u06D3]$/u,ranges:[[1568,1618],[1649,1747]]},{id:"hebrew",test:/^[\u05B0-\u05EA]$/u,ranges:[[1456,1514]]},{id:"devanagari",test:/^\p{Script=Devanagari}$/u,ranges:[[2304,2431]]},{id:"thai",test:/^\p{Script=Thai}$/u,ranges:[[3585,3662]]}],ve=new Map;function Vt(t,e,n,i){let r=ve.get(t);if(r)return r;let s=[];for(let[o,l]of e)for(let a=o;a<=l;a++){let c=String.fromCodePoint(a);Te(c)===n&&(i&&!i.test(c)||s.push(c))}return ve.set(t,s),s}function Xn(t){let n=t.codePointAt(0);for(let o=0;o<9&&Te(String.fromCodePoint(n-1))==="Nd";o++)n--;let i="nd:"+n.toString(16),r=ve.get(i);if(r)return r;let s=[];for(let o=n;o<n+10;o++){let l=String.fromCodePoint(o);Te(l)==="Nd"&&s.push(l)}return ve.set(i,s),s}function Zn(t,e){if(e==="Nd")return Xn(t);for(let r of jn)if(r.test.test(t))return Vt(r.id+":"+e,r.ranges,e,r.id==="ascii"?null:r.test);let i=t.codePointAt(0)&-128;return Vt("block:"+i.toString(16)+":"+e,[[i,i+127]],e,null)}function qn(t,e,n,i){let r=t.filter(s=>!e.has(s));return r.length===0&&(r=t.filter(s=>s!==n)),r.length===0?n:r[Math.min(r.length-1,Math.floor(i()*r.length))]}var Qn=/^[\p{L}\p{M}\p{Nd}]$/u,Ut=/^[\p{L}\p{Nd}]$/u;function Ht(t,e){if(!t)return t??"";let n=new Set(Array.from(t)),i=d=>{let g=Te(d);return!g||!Qn.test(d)?d:qn(Zn(d,g),n,d,e)},r=d=>{let g=[];for(let m of d)g.push(i(m)),Ut.test(m)&&e()<.2&&g.push(i(m));if(g.length>6){let m=Math.floor(e()*Math.min(3,g.length-6));for(let b=0;b<m;b++)for(let M=0;M<5;M++){let A=Math.floor(e()*g.length);if(Ut.test(g[A])){g.splice(A,1);break}}}return g.join("")};if(!(t.includes("@")&&t.includes(".")))return r(t);let[o,l=""]=t.split("@"),a=l.endsWith(".com"),c=a?l.slice(0,-4):l;return`${r(o)}@${r(c)}${a?".com":""}`}var Jn=/^[A-Za-z_$][A-Za-z0-9_$]*$/,er=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),tr=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function se(t,e){if(!t||!e)return!1;let n=er(e);return new RegExp("['\"`]"+n+"['\"`]").test(t)?!0:Jn.test(e)&&new RegExp("\\."+n+"(?![A-Za-z0-9_$])").test(t)}function nr(t){return!!t&&tr.test(t)}function Oi(t,e,n){return t?nr(t)?[...e]:[...n,...e].some(i=>se(t,i))?e.filter(i=>se(t,i)):[...e]:[]}var rr=5,ir=6,sr=3,te=864e5,or=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,ar=/^(\d{4})[-/](\d{1,2})$/,lr=/^(\d{4})[-\s]?Q([1-4])$/i,ur=/^Q([1-4])[-\s](\d{4})$/i,cr=/^(\d{4})$/,dr=/^(\d{4})(0[1-9]|1[0-2])$/,mr=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/,fr=/^(\D+?)[\s\-/.,']*((?:19|20)\d{2})$/u,gr=/^((?:19|20)\d{2})[\s\-/.,']+(\D+)$/u;function Ge(t,e,n){let i=ee(t);if(!i)return 0;if(i==="sept")return 9;for(let o of e&&!/^en\b/i.test(e)?["en",e]:["en"]){let l=Se(o)[i];if(l!==void 0)return l+1}let r=n?.get(i);if(r!==void 0)return r+1;let s=ie(t);if(s.length>0){if(s.every(a=>a.month===s[0].month))return s[0].month+1;let o=Xe(String(e??"").split(/[-_]/)[0])?.code,l=s.find(a=>a.lang===o);if(l)return l.month+1}return 0}function pr(t){let e=ge(t).filter(i=>i.yearDigits===4);if(e.length===0||e.some(i=>i.lang==="en"))return null;let n=e[0];return e.some(i=>i.grain!=="quarter"||i.n!==n.n||i.year!==n.year)?null:Y(n.year,(n.n-1)*3+1,1)}function Y(t,e,n,i=0,r=0,s=0){if(!(t>=1&&e>=1&&e<=12&&n>=1&&n<=31))return null;let o=Date.UTC(t,e-1,n,i,r,s);if(!Number.isFinite(o))return null;let l=a=>a<10?"0"+a:String(a);return{ms:o,y:t,m:e,d:n,iso:`${t}-${l(e)}-${l(n)}`}}function hr(t,e){let n=[],i="";for(let a=0;a<e.length;a++){if(e[a]!=="%"){i+=e[a].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++a]){case"Y":n.push("Y"),i+="(\\d{4})";break;case"m":n.push("m"),i+="(\\d{1,2})";break;case"d":n.push("d"),i+="(\\d{1,2})";break;case"H":case"M":case"S":i+="\\d{1,2}";break;case"%":i+="%";break;default:return null}}let r=new RegExp("^"+i+"$").exec(t);if(!r)return null;let s=0,o=1,l=1;return n.forEach((a,c)=>{let d=+r[c+1];a==="Y"?s=d:a==="m"?o=d:l=d}),s?Y(s,o,l):null}function j(t,e,n,i){let r=(t??"").trim();if(r==="")return null;if(e){let a=hr(r,e);return a||null}let s=or.exec(r);if(s)return Y(+s[1],+s[2],+s[3],+(s[4]??0),+(s[5]??0),+(s[6]??0));if(s=lr.exec(r),s)return Y(+s[1],(+s[2]-1)*3+1,1);if(s=ur.exec(r),s)return Y(+s[2],(+s[1]-1)*3+1,1);if(s=ar.exec(r),s&&+s[2]>=1&&+s[2]<=12)return Y(+s[1],+s[2],1);if(s=mr.exec(r),s)return Y(+s[1],+s[2],+s[3]);if(s=dr.exec(r),s)return Y(+s[1],+s[2],1);if(s=cr.exec(r),s){let a=+s[1];return a>=1900&&a<=2100?Y(a,1,1):null}let o=pr(r);if(o)return o;if(s=fr.exec(r),s){let a=Ge(s[1],n,i);if(a)return Y(+s[2],a,1)}if(s=gr.exec(r),s){let a=Ge(s[2],n,i);if(a)return Y(+s[1],a,1)}let l=ne(r);if(l){let a="month"in l?l.month:Ge(l.word,n,i);if(a)return Y(l.year,a,1)}return null}function Yt(t){let e=new Date(t).getUTCDay();return e>=1&&e<=5}function jt(t,e){if(e<=t)return 0;let n=Math.round((e-t)/te),i=Math.floor(n/7),r=i*5,s=t+i*7*te;for(;s<e;)Yt(s)&&r++,s+=te;return r}function yr(t){if(t.length===0)return 0;let e=[...t].sort((i,r)=>i-r),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function br(t){return t>0?t<.95?"hour":t<=1.05?"day":t>=6.5&&t<=7.5?"week":t>=27&&t<=31.5?"month":t>=88&&t<=93?"quarter":t>=362&&t<=368?"year":"irregular":"irregular"}function oe(t,e,n,i){switch(n){case"year":return e.y-t.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(t.y*4+Math.floor((t.m-1)/3));case"month":return e.y*12+e.m-(t.y*12+t.m);case"week":return Math.round((e.ms-t.ms)/(7*te));case"weekday":return jt(t.ms,e.ms);case"day":return Math.round((e.ms-t.ms)/te);default:return i>0?Math.round((e.ms-t.ms)/i):0}}function Xt(t,e){return Ke(t,e)?.cadence??null}function Ke(t,e){let n=e?.gapFactor??rr,i=0,r=0,s=new Map,o=Array.from(t),l;if(!e?.pattern){let f=[];for(let C of o){if(C==null||C==="")continue;let y=ne(String(C));y&&"word"in y&&f.push(y.word)}f.length>0&&(l=_e(f,e?.locale)??void 0)}for(let f of o){if(f==null||f==="")continue;i++;let C=j(String(f),e?.pattern,e?.locale,l);C&&(r++,s.set(C.ms,C))}let a=[...s.values()].sort((f,C)=>f.ms-C.ms);if(a.length<sr||i>0&&r/i<.8)return null;let c=a[a.length-1].ms-a[0].ms;if(c<=0)return null;let d=[];for(let f=1;f<a.length;f++)d.push(a[f].ms-a[f-1].ms);let g=yr(d);if(!(g>0))return null;let m=br(g/te);m==="day"&&c>=7*te&&a.every(f=>Yt(f.ms))&&jt(a[0].ms,a[a.length-1].ms)+1>a.length*.5&&(m="weekday");let b=m==="irregular"?a.length:oe(a[0],a[a.length-1],m,g)+1,M=1,A=1,S=[],p=a[0],h=1;for(let f=1;f<a.length;f++){let C=oe(a[f-1],a[f],m,g);C>M&&(M=C),m!=="irregular"&&C>n?(A++,S.push({from:p.iso,to:a[f-1].iso,points:h}),p=a[f],h=1):h++}S.push({from:p.iso,to:a[a.length-1].iso,points:h});let x={grain:m,points:a.length,expectedPoints:Math.max(b,a.length),coveragePct:Math.round(a.length/Math.max(b,a.length)*1e3)/10,runs:A,largestGapUnits:M,gapFactor:n};return e?.includeBounds&&S.length<=ir&&(x.runBounds=S),{cadence:x,points:a,stepMs:g}}var Sr=8,_r=.5,Ar=200,xr=new Set(["category","categories","subcategory","type","types","kind","class","classes","classification","segment","segments","tier","status","priority","severity","grade","level","band","bucket","group","channel","method","mode","stage","phase","period","shift","gender","sex","result","outcome","reason","flag","genre","sector","source"]),Cr=["category","classification","segment","status","priority","severity","channel"],wr=new Set(["UUID","EMAIL_LIKE","URL_LIKE","PHONE_LIKE","NUMERIC_ID","HEX_ID","OPAQUE_ID_ALPHANUMERIC","DATE_STR","BOOLEAN"]);function Mr(t){let e=J(t);if(e.length===0)return!1;let n=e[e.length-1];return xr.has(n)?!0:Cr.some(i=>n.length>i.length&&n.endsWith(i))}function Tr(t){if(t.isMeasure)return"measure";if(t.isTemporal||t.isDatePart||t.isReassembledDate)return"temporal";let e=Array.from(t.values).filter(n=>n!==""&&n!==null&&n!==void 0);return e.length<2||e.length>Ar?"cardinality":t.rows>0&&e.length>=t.rows?"row-identity":t.isBinaryFlag?"flag":pe(e,t.locale)!==null?"ordinal":t.identifierNamed||t.dataType==="String"&&wr.has(be(e))?"identifier":!t.geoKind&&Mr(t.name)?"attribute":"entity"}function Qt(t){let e=-1,n=1/0,i=!1;return t.forEach((r,s)=>{if(Tr(r)!=="entity")return;let o=new Set(Array.from(r.values).filter(a=>a!=="")).size,l=!!r.geoKind;(o<n||o===n&&l&&!i)&&(e=s,n=o,i=l)}),e}var Zt=t=>t<10?"0"+t:String(t);function qt(t,e){switch(e){case"year":return`${t.y}-01-01`;case"quarter":return`${t.y}-${Zt(Math.floor((t.m-1)/3)*3+1)}-01`;case"month":return`${t.y}-${Zt(t.m)}-01`;case"hour":return new Date(t.ms).toISOString().replace(/\.\d{3}Z$/,"Z");default:return t.iso}}function Jt(t){let{periods:e,series:n}=t,i=Math.min(e.length,n.length),r=new Set;for(let C=0;C<i;C++)e[C]&&r.add(e[C]);let s=Ke(r,{pattern:t.pattern,locale:t.locale});if(!s)return null;let o=s.cadence.grain;if(o==="irregular")return null;let l=s.points[0],a=oe(l,s.points[s.points.length-1],o,s.stepMs)+1;if(a!==s.cadence.expectedPoints)return null;let c=new Map;for(let C of r){let y=j(C,t.pattern,t.locale);if(!y)continue;let _=oe(l,y,o,s.stepMs);_>=0&&_<a&&c.set(C,{idx:_,stamp:y})}let d=new Map;for(let C=0;C<i;C++){let y=n[C];if(!y)continue;let _=c.get(e[C]);if(!_)continue;let w=d.get(y);w||(w={seen:new Set,lo:_.idx,hi:_.idx,loStamp:_.stamp,hiStamp:_.stamp,order:d.size},d.set(y,w)),w.seen.add(_.idx),_.idx<w.lo&&(w.lo=_.idx,w.loStamp=_.stamp),_.idx>w.hi&&(w.hi=_.idx,w.hiStamp=_.stamp)}if(d.size<2)return null;let g=0;for(let C of d.values())g+=C.seen.size;if(g/(d.size*a)<(t.minFill??_r))return null;let m=[],b=new Set,M=0,A=0,S=0,p=0,h=0,x=1;for(let[C,y]of d){for(let z of y.seen)b.add(z);if(y.seen.size>=a)continue;let _=[...y.seen].sort((z,X)=>z-X),w=1;for(let z=1;z<_.length;z++)w=Math.max(w,_[z]-_[z-1]);let W={key:C,acc:y,coverage:y.seen.size/a,before:y.lo,after:a-1-y.hi,interior:y.hi-y.lo+1-y.seen.size,gap:w};m.push(W),W.before>0&&M++,W.after>0&&A++,W.interior>0&&S++,p=Math.max(p,W.before),h=Math.max(h,W.after),x=Math.max(x,w)}if(m.length===0)return null;m.sort((C,y)=>C.coverage-y.coverage||C.acc.order-y.acc.order);let f=m.slice(0,t.maxListed??Sr);return{seriesColumn:t.seriesColumn,grain:o,periods:a,seriesCount:d.size,incompleteSeries:m.length,lateStarts:M,earlyEnds:A,withHoles:S,columnWideMissing:a-b.size,maxMissingBefore:p,maxMissingAfter:h,largestGap:x,series:f.map(C=>{let y={};return t.includeNames&&(y.name=C.key),t.includeDates&&(y.first=qt(C.acc.loStamp,o),y.last=qt(C.acc.hiStamp,o)),y.missingBefore=C.before,y.missingAfter=C.after,y.missingInterior=C.interior,y.largestGap=C.gap,y.coverage=Math.round(C.coverage*1e3)/1e3,y}),more:m.length-f.length}}var Ie=6;function ae(t){let e=t.slice().sort((i,r)=>i-r),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function vr(t){let e=t.length;if(e<Ie)return null;let n=t[0],i=t[0],r=0;for(let f of t)f<n&&(n=f),f>i&&(i=f),r+=f;if(n===i)return null;let s=ae(t.map(Math.abs));if(s===0)return null;let o=[];for(let f=1;f<e;f++)o.push(t[f]-t[f-1]);let l=ae(o.map(Math.abs))/s,a=(e-1)/2,c=r/e,d=0,g=0,m=0;for(let f=0;f<e;f++)d+=(f-a)*(t[f]-c),g+=(f-a)*(f-a),m+=(t[f]-c)*(t[f]-c);m/=e;let b=d/g,M=c-b*a,A=t.map((f,C)=>f-(M+b*C)),S=A.reduce((f,C)=>f+C,0)/e,p=0,h=0;for(let f=0;f<e;f++)p+=(A[f]-S)*(A[f]-S),f>0&&(h+=(A[f]-A[f-1])*(A[f]-A[f-1]));return p/=e,h/=e-1,{vnDetrended:p<=m*1e-12?2:h/p,relStep:l}}function Ve(t){let{stamps:e,series:n,values:i}=t,r=Math.min(e.length,i.length),s=new Map;for(let c=0;c<r;c++){let d=e[c],g=i[c];if(d===null||g===null||!Number.isFinite(g))continue;let m="";if(n&&(m=n[c]??"",m===""))continue;let b=s.get(m);b||s.set(m,b=new Map),b.set(d,(b.get(d)??0)+g)}let o=[],l=[],a=[];for(let c of s.values()){let d=[...c.entries()].sort((m,b)=>m[0]-b[0]).map(m=>m[1]),g=vr(d);g&&(o.push(g.vnDetrended),l.push(g.relStep),a.push(d.length))}return o.length===0?null:{series:o.length,points:Math.round(ae(a)),vnDetrended:Math.round(ae(o)*1e3)/1e3,relStep:Math.round(ae(l)*1e4)/1e4}}function Yi(t){let e=t.times.map(n=>j(n,t.pattern,t.locale)?.ms??null);return Ve({stamps:e,series:t.series,values:t.values})}var Ir=5e5,Rr=8,Er=4,Nr=5,Ue=1,He=2,kr=4,Dr=8;function Pr(t,e,n){let[i,r]=[...t];if(e.isTemporal){let s=j(i,e.temporalTextPattern,n),o=j(r,e.temporalTextPattern,n);if(s&&o&&s.ms!==o.ms)return s.ms<o.ms?{a:i,b:r,setOrder:"temporal"}:{a:r,b:i,setOrder:"temporal"}}return i<r?{a:i,b:r,setOrder:"none"}:{a:r,b:i,setOrder:"none"}}function Or(t,e,n){let{rows:i,text:r,locale:s}=t,o=Pr(n.values,n,s),l=new Uint8Array(i.length),a=0;for(let c=0;c<i.length;c++){let d=r(i[c][e]);d===o.a?l[c]=1:d===o.b?l[c]=2:a++}return{code:l,blankRows:a,setOrder:o.setOrder}}function Lr(t,e){let{rows:n,text:i}=t,r=new Int32Array(n.length),s=new Map;for(let o=0;o<n.length;o++){let l=i(n[o][e]);if(l===""){r[o]=-1;continue}let a=s.get(l);a===void 0&&(a=s.size,s.set(l,a)),r[o]=a}return{ids:r,dict:s}}function Fr(t,e,n){let i=new Uint8Array(n);for(let s=0;s<t.length;s++){let o=e[s];if(o===0)continue;let l=t[s];if(l<0)continue;let a=i[l];i[l]=a&o?a|o<<2:a|o}let r={keysA:0,keysB:0,keysBoth:0,dupA:0,dupB:0};for(let s=0;s<n;s++){let o=i[s];o&Ue&&r.keysA++,o&He&&r.keysB++,(o&(Ue|He))===(Ue|He)&&r.keysBoth++,o&kr&&r.dupA++,o&Dr&&r.dupB++}return r}function zr(t,e){let n=(t.dupA+t.dupB)*(e.keysA+e.keysB),i=(e.dupA+e.dupB)*(t.keysA+t.keysB);return n<i||n===i&&t.keysBoth>e.keysBoth}var en=t=>t==null||typeof t=="string"&&t.trim()==="";function Wr(t,e,n){if(t===e)return!0;let i=en(t),r=en(e);return i||r?i&&r:typeof t=="number"&&typeof e=="number"?!1:t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():n(t).trim()===n(e).trim()}function tn(t){let{rows:e,columns:n}=t,i=e.length;if(i<2||i>Ir)return null;let r=n.map((y,_)=>({c:y,i:_})).filter(({c:y})=>!y.isMeasure&&!y.isTemporal&&!y.isDatePart&&y.distinct>=Nr).sort((y,_)=>(_.c.identifierNamed?1:0)-(y.c.identifierNamed?1:0)||_.c.distinct-y.c.distinct||y.i-_.i).slice(0,Rr),s=n.map((y,_)=>({c:y,i:_})).filter(({c:y})=>!y.isMeasure&&y.values!==null&&y.values.size===2).slice(0,Er);if(r.length===0||s.length===0)return null;let o=s.map(({c:y,i:_})=>Or(t,_,y)),l=null;for(let{i:y}of r){let _=Lr(t,y);for(let w=0;w<s.length;w++){if(s[w].i===y)continue;let W=Fr(_.ids,o[w].code,_.dict.size);W.keysBoth<1||(!l||zr(W,l.tally))&&(l={tally:W,keyIdx:y,setNo:w,ids:_.ids,dict:_.dict})}}if(!l)return null;let{ids:a,dict:c,tally:d}=l,g=o[l.setNo],m=s[l.setNo].i,b=c.size,M=new Int32Array(b).fill(-1),A=new Int32Array(b).fill(-1);for(let y=0;y<i;y++){let _=g.code[y],w=a[y];_===0||w<0||(_===1?M[w]<0&&(M[w]=y):A[w]<0&&(A[w]=y))}let S=[];for(let y=0;y<n.length;y++)y!==l.keyIdx&&y!==m&&S.push(y);let p=0;for(let y=0;y<b;y++){let _=M[y],w=A[y];if(_<0||w<0)continue;let W=e[_],z=e[w],X=!0;for(let Q of S)if(!Wr(W[Q],z[Q],t.text)){X=!1;break}X&&p++}let h=p===d.keysBoth?100:p===0?0:Math.min(99,Math.max(1,Math.round(p/d.keysBoth*100))),x=new Map,f=new Map;for(let[y,_]of c){let w=M[_]>=0,W=A[_]>=0;if(!w&&!W)continue;let z=ut(y);ct(z)&&(w&&x.set(z,(x.get(z)??0)+1),W&&f.set(z,(f.get(z)??0)+1))}let C=y=>{let _=0;for(let w of y.values())w>=2&&(_+=w);return _};return{key:l.keyIdx,discriminator:m,pairing:{form:"long",key:n[l.keyIdx].name,discriminator:n[m].name,keysA:d.keysA,keysB:d.keysB,keysBoth:d.keysBoth,duplicateKeysA:d.dupA,duplicateKeysB:d.dupB,identicalPct:h,discriminatorBlankRows:g.blankRows,looseCollisionsA:C(x),looseCollisionsB:C(f),setOrder:g.setOrder}}}var $r=t=>t==="Integer"||t==="Decimal";function Br(t){let e=[],n=[];return t.forEach((i,r)=>{if(i.twoValues){if(i.isBinaryFlag){e.push(r);return}i.isMeasure||i.isTemporal||i.isDatePart||i.identifierNamed||n.push(r)}}),[...e,...n].slice(0,6)}function Gr(t,e){let n=[];for(let i=0;i<t.length&&n.length<12;i++){let r=t[i];e.has(i)||!$r(r.dataType)||r.isTemporal||r.isDatePart||r.identifierNamed||r.distinct<3||n.push(i)}return n}function nn(t){let e=new Map,{rows:n,columns:i,text:r}=t;if(n.length===0||n.length>(t.maxRows??5e5))return e;let s=Br(i);if(s.length===0)return e;let o=Gr(i,new Set(s));if(o.length===0)return e;let l=s.map(a=>{let[c,d]=i[a].twoValues,g=new Uint8Array(n.length);for(let m=0;m<n.length;m++){let b=r(n[m][a]);g[m]=b===c?1:b===d?2:0}return g});for(let a of o){let c=new Float64Array(n.length),d=0;for(let h=0;h<n.length;h++){let x=n[h][a],f=x==null||x===""?NaN:typeof x=="number"?x:parseFloat(x);c[h]=f,f===f&&f!==1/0&&f!==-1/0&&d++}if(d<2)continue;let g=new Float64Array(d);for(let h=0,x=0;h<n.length;h++){let f=c[h];f===f&&f!==1/0&&f!==-1/0&&(g[x++]=f)}g.sort();let m=new Float64Array(d),b=0;for(let h=0;h<d;h++)(h===0||g[h]!==g[h-1])&&(m[b++]=g[h]);let M=new Int32Array(n.length).fill(-1);for(let h=0;h<n.length;h++){let x=c[h];if(!(x===x&&x!==1/0&&x!==-1/0))continue;let f=0,C=b-1;for(;f<C;){let y=f+C>>>1;m[y]<x?f=y+1:C=y}M[h]=f}let A=[],S=new Int32Array(b),p=new Int32Array(b);for(let h=0;h<s.length;h++){let x=l[h];S.fill(0),p.fill(0);let f=0,C=0;for(let U=0;U<n.length;U++){let u=M[U];u<0||(x[U]===1?(S[u]++,f++):x[U]===2&&(p[u]++,C++))}if(f===0||C===0)continue;let y=f<=C,_=y?f:C,w=y?C:f,W=y?S:p,z=y?p:S,X=0,Q=0,le=0;for(let U=0;U<b;U++){let u=W[U],T=z[U];X+=u*(Q+.5*T),Q+=T,u+T>=2&&(le+=u+T)}A.push({outcome:i[s[h]].name,aucMinorityHigh:Math.round(X/(_*w)*1e4)/1e4,nMinority:_,nMajority:w,ties:le})}A.length>0&&e.set(a,A)}return e}var Kr=12,Vr=100,Ur=.3,Hr=.9,Yr=120,jr=1900,Xr=2100,Zr=0,qr=20,Qr=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function Re(t){if(!t)return!1;let e=J(t);return e.length===0?!1:Qr.has(e[e.length-1])?!0:Kt(t)!==null}var Jr=new Set(["year","yr","fy"]),ei=t=>J(t).some(e=>Jr.has(e))||lt(t)!==null,ti=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function Ye(t){if(!Number.isInteger(t)||t<190001||t>210012)return!1;let e=t%100;return e>=1&&e<=12}function je(t){if(!Number.isInteger(t)||t<19000101||t>21001231)return!1;let e=Math.floor(t/100)%100,n=t%100;return e>=1&&e<=12&&n>=1&&n<=31}var ni=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,ri=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,ii=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function an(t,e){let n=[],i=0,r=si(t,e,n,()=>{i++});if(r)return r;if(i>0||n.length<2)return null;let s=vt(n,{locale:e,floor:.8});return!s||!s.pattern||s.form==="named"?null:{pattern:s.pattern,orderFrom:s.orderFrom==="shape"?s.order==="ymd"?"iso":"shape":s.orderFrom}}function si(t,e,n,i){let r=0,s=0,o=0,l=0,a=0,c="",d=0,g="",m=0,b=0,M=0,A=0,S=!1;for(let y of t){if(y==null)continue;let _=String(y).trim();if(_==="")continue;r++,n.push(_);let w;if(w=ni.exec(_)){i();let W=+w[2],z=+w[3];W>=1&&W<=12&&z>=1&&z<=31&&(s++,w[4]!==void 0&&o++,w[6]!==void 0&&l++)}else if(w=ri.exec(_)){i();let W=+w[3],z=+w[4];W>=1&&W<=12&&z>=1&&z<=31&&(c&&c!==w[2]&&(S=!0),c=w[2],a++)}else if(w=ii.exec(_)){i();let W=+w[1],z=+w[3];W>=1&&W<=31&&z>=1&&z<=31&&(W<=12||z<=12)&&(g&&g!==w[2]&&(S=!0),g=w[2],d++,W>12&&M++,z>12&&A++,w[5]!==void 0&&m++,w[7]!==void 0&&b++)}if(r>=200)break}if(r<2||(s+a+d)/r<.8||(s>0?1:0)+(a>0?1:0)+(d>0?1:0)!==1||S)return null;if(s>0)return o===s?{pattern:l===s?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(a>0)return{pattern:`%Y${c}%m${c}%d`,orderFrom:"iso"};if(M>0&&A>0)return null;let x,f;M>0?(x=!0,f="values"):A>0?(x=!1,f="values"):g==="."?(x=!0,f="shape"):(x=!ze(e),f="locale");let C=x?`%d${g}%m${g}%Y`:`%m${g}%d${g}%Y`;return m===d?{pattern:C+(b===d?" %H:%M:%S":" %H:%M"),orderFrom:f}:{pattern:C,orderFrom:f}}function oi(t,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(t))return!1;let n=t.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!n)return!1;let i=ee(n);return i.length>0&&e[i]!==void 0}function ai(t,e){let n=new Map,i=new Map;for(let l of t){let a=ne(l);if(!a||"month"in a)continue;let c=ie(a.word),d=c.some(m=>m.lang==="en"),g=ee(a.word);for(let m of new Set(c.map(b=>b.lang)))m!=="en"&&(n.has(m)||(n.set(m,new Set),i.set(m,new Set)),n.get(m).add(g),d||i.get(m).add(g))}let r=[...n.keys()].filter(l=>n.get(l).size>=3&&i.get(l).size>=1),s=0,o=new Map(r.map(l=>[l,0]));for(let l of e){let a=ne(l);if(!a)continue;if("month"in a){s++;continue}let c=ie(a.word);if(c.length===0)continue;let d=c.some(g=>g.lang==="en");for(let g of r)(d||c.some(m=>m.lang===g))&&o.set(g,o.get(g)+1)}return s+Math.max(0,...o.values())}var li=/(?:19|20)[0-9]{2}/;function ui(t){let e=new Map,n=0;for(let r of t){if(!li.test(ce(r)))continue;let s=new Set(ge(r).filter(o=>o.yearDigits===4&&(o.grain==="quarter"||o.grain==="week")).map(o=>o.lang));if(s.size!==0){if(s.has("en")){n++;continue}for(let o of s)e.set(o,(e.get(o)??0)+1)}}let i=0;for(let r of e.values())i=Math.max(i,r);return i>0?i+n:0}function ci(t){let{dataType:e,name:n,isMeasure:i,distinctCount:r}=t;if(e==="DateTime")return!0;if(i)return!1;if(e==="Integer"||e==="Decimal"){let s=t.minNum,o=t.maxNum;if(!(s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&Number.isInteger(s)&&Number.isInteger(o)&&o>=s))return!1;let a=s>=1900&&o<=2100;if(a&&r>=2&&ei(n)||a&&r>=3&&r===o-s+1)return!0;let c=Ye(s)&&Ye(o),d=je(s)&&je(o);if(c||d){if(!t.sampleValues)return!0;let g=0,m=0;for(let b of t.sampleValues){if(b==null||b==="")continue;g++;let M=Number(String(b).trim());if(Number.isFinite(M)&&(c?Ye(M):je(M))&&m++,g>=60)break}if(g>=2&&m===g)return!0}return!1}if(t.sampleValues){let s=t.locale?Se(t.locale):null,o=0,l=0,a=[],c=[];for(let d of t.sampleValues){if(d==null||d==="")continue;o++;let g=String(d).trim();if(a.push(g),ti.test(g)||oi(g,s)?l++:c.push(g),o>=60)break}if(o>=2&&l/o>=.8||o>=2&&(l+ui(c)+ai(a,c))/o>=.8||an(a,t.locale)!==null)return!0}return!1}function di(t){let e=q((t||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":Dt(t)}function mi(t){let{rows:e,measureColIdx:n,measureName:i,candidateDims:r,minNum:s,maxNum:o,discourageAgg:l}=t,a=100,c=.01,d="";for(let m of r){if(m.distinct<2||m.distinct>a)continue;let b=r.filter(h=>h.idx!==m.idx).map(h=>h.idx),M=new Map;for(let h of e){let x=h[n];if(typeof x!="number"||!Number.isFinite(x))continue;let f=b.length?b.map(y=>String(h[y])).join(d):"",C=M.get(f);C||(C={sum:0,cset:new Set},M.set(f,C)),C.sum+=x,C.cset.add(String(h[m.idx]))}let A=0,S=0,p=0;for(let h of M.values())h.cset.size<2||(p++,Math.abs(h.sum-100)<=100*c?A++:Math.abs(h.sum-1)<=1*c&&S++);if(p>=2&&(A/p>=.9||S/p>=.9))return{additivity:"part_of_whole",partOfWholeDim:m.name}}if(l)return{additivity:"intensive_rate"};let g=di(i);return g==="avg"||g==="min"||g==="max"?{additivity:"intensive_rate"}:g==="count"?{additivity:"additive"}:g==="sum"?{additivity:"unknown"}:s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&s>=0&&o<=1.0001&&o>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function ln(t){let{dataType:e,isMeasure:n,name:i,distinct:r,nonblank:s,prec:o,maxval:l,minval:a}=t,c=l-a+1,d=c>0?r/c:1,g=s>0?r/s:0,m=e==="Decimal"||o>0;return!n&&Re(i)?"Categorical":d>=Hr&&(dt(i)&&r<=Yr||a>=jr&&l<=Xr||a>=Zr&&l<=qr)?"Ordinal":n||r>Kr&&(m||r>=Vr||g>=Ur)?"Continuous":"Categorical"}function sn(t,e,n){return!t||t.isMeasure||e||t.dataType!=="Integer"&&t.dataType!=="Decimal"?!1:ln({dataType:t.dataType,isMeasure:!1,name:t.name,distinct:n.distinct,nonblank:n.nonblank,prec:n.prec,maxval:typeof n.maxval=="number"?n.maxval:0,minval:typeof n.minval=="number"?n.minval:0})==="Continuous"}function fi(t){let e=null;for(let n=0;n<t.length;n++){let i=t[n];if(typeof i!="string"||i.length===0)continue;let r=i.trim();r.length!==i.length&&(e||(e=t.slice()),e[n]=r)}return e||t}var on=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;_declaredDimensions=new WeakSet;_inferredMeasureFlags=null;dedupRows=!0;emitLegacyAggAliases=!1;deriveProvinces=!0;dateCellsAreLocalWallClock=!1;wallClockColumnIndexes(){let e=new Set;if(!this.dateCellsAreLocalWallClock||!this._cols)return e;for(let n=0;n<this._cols.length;n++){let i=this._cols[n];!i||!/date|time/i.test(String(i.dataType??""))||ot(this._rows.map(r=>r[n]))&&e.add(n)}return e}STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let i=e.toString().split(".")[1];return i?i.length:0}getColumns(){return this._cols}inferredMeasureFlags(){if(this._inferredMeasureFlags)return this._inferredMeasureFlags;let e=this._cols.map(n=>!!(n&&n.isMeasure));return this._cols.forEach((n,i)=>{if(!n||n.isMeasure||this._declaredDimensions.has(n)||n.dataType!=="Integer"&&n.dataType!=="Decimal")return;let r=new Set,s=0,o=0,l=null,a=null;for(let c of this._rows){let d=c[i],g=this.STR(d);if(g!=""&&(r.add(g),s++,(l===null||d<l)&&(l=d),(a===null||d>a)&&(a=d),n.dataType=="Decimal")){let m=this.getPrecision(d);m>o&&(o=m)}}e[i]=sn(n,!1,{distinct:r.size,nonblank:s,prec:o,minval:l,maxval:a})}),Object.freeze(e),this._inferredMeasureFlags=e,e}declareDimensions(e){this._inferredMeasureFlags=null;for(let n of e)n&&this._declaredDimensions.add(n)}wholeDayIso(e){return st(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,n){if(this._computedStatsForLevel==e)return this._cols;let i=0,r=parseInt(e),s=this.wallClockColumnIndexes(),o=[],l=[],a=[];for(let u of this._cols){let T=new Map,P=[],D=0,v=0,k=0,F=null,O=null,N=null,G=!1,K=!0,R=!0,E=null,V=!1,L=s.has(i);for(let I of this._rows){let $=I[i],B=L&&$ instanceof Date?fe($):$,H=this.STR(B);if(H!=""){if(D+=H.length,T.set(H,(T.get(H)||0)+1),v++,u.dataType=="Integer"||u.dataType=="Decimal"||u.dataType=="DateTime")if((F===null||B<F)&&(F=B),(O===null||B>O)&&(O=B),u.dataType=="Integer"||u.dataType=="Decimal"){if(N===null?N=B:N+=B,u.dataType=="Decimal"){let Z=this.getPrecision(B);Z>k&&(k=Z)}P.push(B)}else G=G||this.hasTimeComponent(B);V&&(B<E?K=!1:B>E&&(R=!1)),E=B,V=!0}}if(v>=3&&(K&&!R?u.sortedDirection="asc":R&&!K?u.sortedDirection="desc":u.sortedDirection="none"),v>0&&T.size>0&&!u.isMeasure){let I=0,$=Number.MAX_SAFE_INTEGER;for(let B of T.values())B>I&&(I=B),B<$&&($=B);if(u.modalShare=I/v,u.minGroupCount=$===Number.MAX_SAFE_INTEGER?null:$,T.size===2){let B=[...T.keys()].map(ue=>nt(ue).trim().toLowerCase()).sort(),Z=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(ue=>B[0]===ue[0]&&B[1]===ue[1]),un=/^(is|has)[_\p{L}\p{N}]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/iu.test(u.name);(Z||un)&&(u.isBinaryFlag=!0)}}else u.isMeasure&&(u.dataType==="Integer"||u.dataType==="Decimal")&&T.size===2&&T.has("0")&&T.has("1")&&(u.isBinaryFlag=!0);if(u.dataType=="DateTime"&&(u.dateWithTime=G,G&&at(L?this._rows.map(I=>I[i]instanceof Date?fe(I[i]):I[i]):this._rows.map(I=>I[i]))?u.timeOfDayOnly=!0:delete u.timeOfDayOnly),u.isTemporal=ci({dataType:u.dataType,name:u.name,isMeasure:u.isMeasure,distinctCount:T.size,minNum:typeof F=="number"?F:null,maxNum:typeof O=="number"?O:null,sampleValues:T.keys(),locale:n}),u.isTemporal&&u.dataType==="String"&&!u.isMeasure){let I=an(T.keys(),n);I&&(u.temporalTextPattern=I.pattern)}if(u.timeOfDayOnly)delete u.temporalCadence;else if(u.isTemporal&&!u.isMeasure){let I=Xt(T.keys(),{includeBounds:r>=20,pattern:u.temporalTextPattern,locale:n});I&&(u.temporalCadence=I)}this.updateColumnStats10(r,u,v,T,k,O,F),this.updateColumnStats20(r,P,v,N,u,D,G,F,O,k,T,n),sn(u,this._declaredDimensions.has(u),{distinct:T.size,nonblank:v,prec:k,minval:F,maxval:O})&&(u.isMeasure=!0,u.geoKind=void 0,u.geoMatchPct=void 0,u.geoAmbiguous=void 0,u.dominantGeoRegion=void 0,u.dominantGeoRegionPct=void 0,u.geoRegionCount=void 0),o[i]=u.isMeasure||T.size>2e3?null:new Set(T.keys()),l[i]=T.size,a[i]=T.size===2?[...T.keys()].sort():null,i++}wt(this._cols,this._rows,{cities:this.deriveProvinces}).forEach((u,T)=>{let P=this._cols[T];u.kind&&(P.geoKind=u.kind,P.geoMatchPct=u.matchPct,u.ambiguous&&(P.geoAmbiguous=!0)),u.rollupPct!==void 0&&(P.admin1RollupPct=u.rollupPct),u.regionCount!==void 0&&(P.admin1RegionCount=u.regionCount),u.countryCount!==void 0&&(P.admin1CountryCount=u.countryCount),u.dominantRegion&&(P.dominantGeoRegion=u.dominantRegion,P.dominantGeoRegionPct=u.dominantRegionPct)});let c=this.getGeoExtent();if(c&&c.dominantFrame&&this._geoExtentLatIdx>=0){let u=this._cols[this._geoExtentLatIdx];u.geoKind||(u.dominantGeoRegion=c.dominantFrame,u.dominantGeoRegionPct=c.dominantFramePct,this.deriveProvinces&&(u.admin1RollupPct=c.dominantFramePct))}let d=[];this._cols.forEach((u,T)=>{u.isMeasure||d.push({idx:T,distinct:u.distinctCount??0,name:u.name})}),this._cols.forEach((u,T)=>{if(!u.isMeasure)return;let P=typeof u.lowValue=="number"?u.lowValue:null,D=typeof u.highValue=="number"?u.highValue:null,v=mi({rows:this._rows,measureColIdx:T,measureName:u.name,candidateDims:d,minNum:P,maxNum:D,discourageAgg:!!u.discourageAggregationAcrossGroups});u.additivity=v.additivity,v.partOfWholeDim&&(u.partOfWholeDim=v.partOfWholeDim)});let g=50,m=4,b=d.filter(u=>u.distinct>=2&&u.distinct<=g);this._cols.forEach((u,T)=>{if(!u.isMeasure)return;let P=[];for(let R of this._rows){let E=R[T];if(E==null||E==="")continue;let V=typeof E=="number"?E:parseFloat(E);isNaN(V)||P.push(V)}if(P.length===0)return;let D=[...P].sort((R,E)=>R-E);if(D[0]===D[D.length-1])u.relativeDispersion=0;else if(D.length>=m){let R=me(D,.5),E=me(D,.1),V=me(D,.9);u.relativeDispersion=Math.abs(R)>1e-9?Math.round((V-E)/Math.abs(R)*1e3)/1e3:void 0}else u.relativeDispersion=void 0;let v=[];for(let R of b){let E=new Set;for(let V of this._rows){let L=V[T];L==null||L===""||E.add(this.STR(V[R.idx])+"")}v.push({otherColumn:R.name,nonBlankGroupCount:E.size})}v.length>0&&(u.nonBlankGroups=v);let k=0;for(let R of P)k+=R;k/=P.length;let F=0;for(let R of P)F+=(R-k)*(R-k);if(F<=1e-12)return;let O=[],N=[],G=R=>{if(R.length<4)return NaN;let E=[...R].sort((L,I)=>L-I),V=L=>E[Math.min(E.length-1,Math.max(0,Math.floor(L*(E.length-1))))];return V(.75)-V(.25)},K=G(P);for(let R of b){let E=new Map;for(let I of this._rows){let $=I[T];if($==null||$==="")continue;let B=typeof $=="number"?$:parseFloat($);if(isNaN(B))continue;let H=this.STR(I[R.idx])+"",Z=E.get(H);Z?(Z.s+=B,Z.n++,Z.vals.push(B)):E.set(H,{s:B,n:1,vals:[B]})}let V=0;for(let I of E.values()){let $=I.s/I.n;V+=I.n*($-k)*($-k)}O.push({otherColumn:R.name,eta2:Math.round(V/F*1e4)/1e4});let L=[];for(let I of E.values()){let $=G(I.vals);isNaN($)||L.push($)}if(L.length>=2&&isFinite(K)&&K>1e-9){let I=(Math.max(...L)-Math.min(...L))/K;N.push({otherColumn:R.name,spreadRatio:Math.round(I*1e4)/1e4})}}O.length>0&&(u.groupDiscrimination=O),N.length>0&&(u.spreadDiscrimination=N)});let M=.97,A=.8,S=8,p=5,h=this._cols.map((u,T)=>({c:u,i:T})).filter(u=>u.c.isMeasure);for(let u=0;u<h.length;u++)for(let T=u+1;T<h.length;T++){let P=h[u].i,D=h[T].i,v=0,k=0,F=0,O=0,N=0,G=0;for(let L of this._rows){let I=L[P],$=L[D];if(I==null||I===""||$===null||$===void 0||$==="")continue;let B=typeof I=="number"?I:parseFloat(I),H=typeof $=="number"?$:parseFloat($);isNaN(B)||isNaN(H)||(v++,k+=B,F+=H,O+=B*B,N+=H*H,G+=B*H)}if(v<p)continue;let K=v*O-k*k,R=v*N-F*F;if(K<=1e-12||R<=1e-12)continue;let E=(v*G-k*F)/Math.sqrt(K*R),V=Math.min(1,Math.round(Math.abs(E)*1e3)/1e3);for(let L of[h[u].c,h[T].c])(L.maxAbsMeasureCorrelation===void 0||V>L.maxAbsMeasureCorrelation)&&(L.maxAbsMeasureCorrelation=V);if(Math.abs(E)>=M){let L=h[u].c,I=h[T].c;L.collinearWithMeasures||(L.collinearWithMeasures=[]),I.collinearWithMeasures||(I.collinearWithMeasures=[]),L.collinearWithMeasures.push(I.name),I.collinearWithMeasures.push(L.name)}else if(Math.abs(E)>=A){let L=h[u].c,I=h[T].c,$=Math.round(E*1e3)/1e3;L.correlatedWithMeasures||(L.correlatedWithMeasures=[]),I.correlatedWithMeasures||(I.correlatedWithMeasures=[]),L.correlatedWithMeasures.push({otherColumn:I.name,r:$}),I.correlatedWithMeasures.push({otherColumn:L.name,r:$})}}for(let{c:u}of h)u.correlatedWithMeasures&&(u.correlatedWithMeasures.sort((T,P)=>Math.abs(P.r)-Math.abs(T.r)||(T.otherColumn<P.otherColumn?-1:1)),u.correlatedWithMeasures.length=Math.min(u.correlatedWithMeasures.length,S));for(let u=0;u<this._cols.length;u++){let T=o[u];if(!T||T.size===0)continue;let P=[];for(let D=0;D<this._cols.length;D++){if(D===u)continue;let v=o[D];if(!v||v.size===0)continue;let k=0;for(let O of T)v.has(O)&&k++;let F=Math.round(k/T.size*100);F>0&&P.push({otherColumn:this._cols[D].name,percentShared:F})}P.length>0&&(this._cols[u].sharedValueRatioWithOthers=P)}let x=50,f=[];for(let u=0;u<this._cols.length;u++){let T=o[u];T&&T.size>=2&&T.size<=x&&f.push(u)}if(f.length>=2){let u=new Map,T=(D,v)=>D+":"+v;for(let D=0;D<f.length;D++)for(let v=D+1;v<f.length;v++)u.set(T(f[D],f[v]),new Map);for(let D of this._rows)for(let v=0;v<f.length;v++){let k=this.STR(D[f[v]])+"";for(let F=v+1;F<f.length;F++){let O=""+this.STR(D[f[F]]),N=u.get(T(f[v],f[F])),G=k+""+O;N.set(G,(N.get(G)??0)+1)}}let P=new Map;for(let D=0;D<f.length;D++)for(let v=D+1;v<f.length;v++){let k=f[D],F=f[v],O=o[k].size,N=o[F].size,G=u.get(T(k,F)),K=G.size,R=0;for(let I of G.values())(R===0||I<R)&&(R=I);let E=Math.round(K/(O*N)*100),V=K===O,L=K===N;if((this._cols[k].categoricalPairStats||=[]).push({otherColumn:this._cols[F].name,fillPct:E,determinesOther:V,minCellCount:R,distinctCombinations:K}),(this._cols[F].categoricalPairStats||=[]).push({otherColumn:this._cols[k].name,fillPct:E,determinesOther:L,minCellCount:R,distinctCombinations:K}),V&&O>N){let I=P.get(k);(!I||N<I.card)&&P.set(k,{name:this._cols[F].name,card:N,ratio:N/O})}if(L&&N>O){let I=P.get(F);(!I||O<I.card)&&P.set(F,{name:this._cols[k].name,card:O,ratio:O/N})}}for(let[D,v]of P)this._cols[D].primaryParentColumn=v.name,this._cols[D].nestingRatio=Math.round(v.ratio*100)/100}let C=6,y=this._rows.length;for(let u=0;u<this._cols.length;u++){let T=this._cols[u];if(T.isMeasure||T.primaryParentColumn)continue;let P=T.distinctCount??0;if(P<=x||y>0&&P>=y)continue;let D=[];for(let v=0;v<this._cols.length;v++){if(v===u)continue;let k=this._cols[v];if(k.isMeasure)continue;let F=k.distinctCount??0;F<2||F>=P||D.push(v)}D.sort((v,k)=>(this._cols[v].distinctCount??0)-(this._cols[k].distinctCount??0));for(let v of D.slice(0,C)){let k=new Map,F=!0;for(let N of this._rows){let G=this.STR(N[u])+"",K=this.STR(N[v])+"",R=k.get(G);if(R===void 0)k.set(G,K);else if(R!==K){F=!1;break}}if(!F)continue;let O=this._cols[v].distinctCount??0;T.primaryParentColumn=this._cols[v].name,T.nestingRatio=Math.round(O/P*100)/100;break}}let _=.01,w=.05,W=.95,z=8,X=8,Q=6,le=500,U=[];for(let u=0;u<this._cols.length&&U.length<X;u++){let T=this._cols[u].dataType;(T==="Double"||T==="Integer"||T==="Decimal")&&U.push(u)}if(U.length>=3&&this._rows.length>=z){let u=Math.min(this._rows.length,le),T=U.map(O=>{let N=[];for(let R=0;R<u;R++){let E=this._rows[R][O],V=typeof E=="number"?E:parseFloat(String(E).replace(/,/g,""));if(E==null||E===""||!isFinite(V))return null;N.push(V)}let G=N[0],K=!1;for(let R of N)if(R!==G){K=!0;break}return K?N:null}),P=U.map((O,N)=>N).filter(O=>T[O]!==null),D=O=>{let N=O.slice().sort((K,R)=>K-R),G=N.length>>1;return N.length%2?N[G]:(N[G-1]+N[G])/2},v=null,k=[],F=O=>{if(k.length>=3){let N=k.map(E=>T[E]),G=N[0].length,K=new Array(G);for(let E=0;E<G;E++){let V=0;for(let L of N)V+=L[E];K[E]=V}let R=D(K);if(R>0){let E=0;for(let L of K)Math.abs(L-R)<=R*_&&E++;let V=E/G;if(V>=W){let L=1;for(let I of N){let $=D(I)/R;$<L&&(L=$)}L>=w&&(!v||k.length>v.cols.length)&&(v={cols:k.slice(),total:R,matched:V})}}}if(!(k.length>=Q))for(let N=O;N<P.length;N++)k.push(P[N]),F(N+1),k.pop()};if(F(0),v){let O=v,G={columns:O.cols.map(K=>this._cols[U[K]].name),total:Math.round(O.total*1e3)/1e3,matchedPct:Math.round(O.matched*100)/100};for(let K of O.cols)this._cols[U[K]].constantSumGroup=G}}return this.applyTwoSetPairing(n,o),this.applyScoreSeparation(l,a),this.applySeriesCompleteness(r,n,o),this.applyMeasurePersistence(n,o),this._computedStatsForLevel=e,this._cols}applyTwoSetPairing(e,n){for(let r of this._cols)r.twoSetPairing!==void 0&&delete r.twoSetPairing;let i=tn({rows:this._rows,columns:this._cols.map((r,s)=>{let o=n[s];return{name:r.name,values:o,distinct:o?o.size:r.distinctCount??0,isMeasure:!!r.isMeasure,isTemporal:!!r.isTemporal,isDatePart:!!r.isDatePart,identifierNamed:Re(r.name),temporalTextPattern:r.temporalTextPattern}}),text:r=>this.STR(r),locale:e});i&&(this._cols[i.key].twoSetPairing=i.pairing,this._cols[i.discriminator].twoSetPairing=i.pairing)}applyScoreSeparation(e,n){for(let r of this._cols)r.scoreSeparation!==void 0&&delete r.scoreSeparation;let i=nn({rows:this._rows,columns:this._cols.map((r,s)=>({name:r.name,dataType:r.dataType,isMeasure:!!r.isMeasure,isTemporal:!!r.isTemporal,isDatePart:!!r.isDatePart,identifierNamed:Re(r.name),isBinaryFlag:!!r.isBinaryFlag,distinct:e[s]??0,twoValues:n[s]??null})),text:r=>this.STR(r)});for(let[r,s]of i)this._cols[r].scoreSeparation=s}applySeriesCompleteness(e,n,i){for(let c of this._cols)c.seriesCompleteness!==void 0&&delete c.seriesCompleteness;let r=this._cols.map((c,d)=>({c,i:d})).filter(({c})=>c.isTemporal&&!c.isMeasure&&c.temporalCadence&&c.temporalCadence.grain!=="irregular");if(r.length===0)return;let s=this.seriesKeyIndex(n,i);if(s<0)return;let o=this._cols[s],l=this._rows.map(c=>this.STR(c[s])),a=e>=20&&(o.dataType!=="String"||Array.isArray(o.safeDistinctValues));for(let{c,i:d}of r){let g=Jt({periods:this._rows.map(m=>this.STR(m[d])),series:l,seriesColumn:o.name,pattern:c.temporalTextPattern,locale:n,includeDates:e>=20,includeNames:a});g&&(c.seriesCompleteness=g)}}seriesKeyIndex(e,n){let i=[],r=[];this._cols.forEach((o,l)=>{let a=n[l];a&&(i.push(l),r.push({name:o.name,dataType:o.dataType,isMeasure:!!o.isMeasure,isTemporal:!!o.isTemporal,isDatePart:!!o.isDatePart,isReassembledDate:!!o.isReassembledDate,isBinaryFlag:!!o.isBinaryFlag,geoKind:o.geoKind,identifierNamed:Re(o.name),values:a,rows:this._rows.length,locale:e}))});let s=Qt(r);return s<0?-1:i[s]}applyMeasurePersistence(e,n){for(let a of this._cols)a.persistence!==void 0&&delete a.persistence;let i=[];if(this._cols.forEach((a,c)=>{a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal"||a.dataType==="Double")&&i.push(c)}),i.length===0||this._rows.length<Ie)return;let r=-1,s=[];for(let a=0;a<this._cols.length&&r<0;a++){let c=this._cols[a];if(!c.isTemporal||c.isMeasure||c.isDatePart)continue;let d=this._rows.map(g=>j(this.STR(g[a]),c.temporalTextPattern,e)?.ms??null);new Set(d.filter(g=>g!==null)).size<Ie||(r=a,s=d)}if(r<0)return;let o=this.seriesKeyIndex(e,n),l=o>=0?this._rows.map(a=>this.STR(a[o])):void 0;for(let a of i){let c=this._rows.map(g=>{let m=g[a];if(m==null||m==="")return null;let b=typeof m=="number"?m:parseFloat(String(m).replace(/,/g,""));return Number.isFinite(b)?b:null}),d=Ve({stamps:s,series:l,values:c});d&&(this._cols[a].persistence={timeColumn:this._cols[r].name,...o>=0?{seriesColumn:this._cols[o].name}:{},...d})}}updateColumnStats20(e,n,i,r,s,o,l,a,c,d,g,m){if(e>=20){let b=[...n].sort((S,p)=>S-p),M=Math.floor(b.length/2);if(i>0&&r!=null?s.avgValue=s.dataType=="Integer"?Math.round(r/i):r/i:s.avgValue=null,i>0&&(s.avgLength=o/i),this._rows.length>0){let S=p=>{let h=p instanceof Date?p:typeof p=="string"?Ne(p)??new Date(p):new Date(p),x=this.wholeDayIso(h);return x?x+"T00:00:00.000Z":isNaN(h.getTime())?p:h.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!a?s.lowValue=a:s.lowValue=S(a),s.dataType!="DateTime"||l||!c?s.highValue=c:s.highValue=S(c),s.medianValue=b.length===0?null:b.length%2===0?s.dataType=="Integer"?Math.round((b[M-1]+b[M])/2):(b[M-1]+b[M])/2:b[M],s.numericPrecision=d}if(b.length>0){let S=s.avgValue??0,p=b.length,h=0,x=0;for(let y of b){let _=y-S;h+=_*_,x+=_*_*_}let f=h/p,C=Math.sqrt(f);s.skewness=f===0?0:x/p/(C*C*C),s.stdDev=Math.sqrt(f)}r!==null&&(s.sum=r);let A=Array.from(g.entries()).sort((S,p)=>p[1]-S[1]);if(s.topCategories=A.slice(0,10).map(S=>S[1]),!s.isMeasure&&A.length>0&&(s.dataType!=="String"&&(s.topCategoryValues=A.slice(0,5).map(S=>S[0])),e>=20)){let S=A.map(h=>h[0]),p=pe(S,m);if(p!==null)s.ordinalPattern=p.pattern,s.orderedDomain=p.orderedDomain;else if(s.dataType==="String"){let h=mt(S);h!==null&&(s.safeDistinctValues=h)}}if(b.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let S=p=>b[Math.floor((b.length-1)*p)];s.quantiles={p05:S(.05),p25:S(.25),p75:S(.75),p95:S(.95)}}}if(!s.isMeasure&&s.dataType==="String"&&g.size>0){let b=Array.from(g.entries()).sort((S,p)=>p[1]-S[1]).map(S=>S[0]);s.formatSignature=be(b);let M=i>0?o/i:void 0,A=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!A.test(s.formatSignature)&&(M===void 0||M>=3)&&(s.isFreeText=!0)}if(!s.isMeasure&&g.size>0){let b=Array.from(g.entries()).sort((A,S)=>S[1]-A[1]),M=St(b.map(A=>A[0]),s.name,m);if(M!==null&&(s.geoKind=M.geoKind,s.geoMatchPct=M.geoMatchPct,M.geoAmbiguous&&(s.geoAmbiguous=!0),M.geoKind.indexOf("country")===0)){let A=pt(b);A&&(s.dominantGeoRegion=A.dominantGeoRegion,s.dominantGeoRegionPct=A.dominantGeoRegionPct,s.geoRegionCount=A.regionCount,A.middleEastPct>0&&(s.middleEastPct=A.middleEastPct))}}}updateColumnStats10(e,n,i,r,s,o,l){let a=this._rows.length-i;e>=10&&(n.blankCount=a),n.distinctCount=r.size+(a!=0?1:0),n.valueNature="Categorical",i>0&&(n.dataType==="Integer"||n.dataType==="Decimal"?n.valueNature=ln({dataType:n.dataType,isMeasure:!!n.isMeasure,name:n.name,distinct:r.size,nonblank:i,prec:s,maxval:o,minval:l}):n.dataType==="DateTime"&&(n.valueNature=n.dateWithTime?"Continuous":"Ordinal"))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((i,r)=>{i.isMeasure||e.push(r)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let n=new Set;for(let i of this._rows)n.add(JSON.stringify(e.map(r=>i[r])));return this._leafCardinality=n.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=o=>Ze(o,{camel:!0}),n=-1,i=-1,r=-1;if(this._cols.forEach((o,l)=>{let a=e(o.name),c=o.dataType==="Integer"||o.dataType==="Decimal";c&&n<0&&a.some(d=>d==="lat"||d==="latitude")?n=l:c&&i<0&&a.some(d=>d==="lon"||d==="lng"||d==="long"||d==="longitude")&&(i=l),r<0&&!o.isMeasure&&typeof o.geoKind=="string"&&o.geoKind.indexOf("country")===0&&(r=l)}),n<0||i<0)return null;this._geoExtentLatIdx=n;let s=[];for(let o of this._rows){let l=o[n],a=o[i],c=l==null||l===""?null:Number(l),d=a==null||a===""?null:Number(a);s.push({lat:c,lon:d,country:r>=0&&he(this.STR(o[r]))?this.STR(o[r]):null})}return this._geoExtent=gt(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;_geoExtentLatIdx=-1;obfuscateString(e){return Ht(e,it)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(n=>{let i={};this._cols.forEach((r,s)=>{i[r.name]=n[s],this.emitLegacyAggAliases&&r.hostName&&r.hostName!==r.name&&!Object.prototype.hasOwnProperty.call(i,r.hostName)&&(i[r.hostName]=n[s])});for(let[r,s]of e)Object.prototype.hasOwnProperty.call(i,s.alias)||(i[s.alias]=n[r]);return i})}async getCSVAsync(e){let n=[],i=e?25:1e7,r=e?4e3:1e7,s=new Map,o=this.wallClockColumnIndexes();for(let a of this._rows){let c={};for(let d=0;d<this._cols.length;d++){let g=this._cols[d],m=a[d];if(this.STR(m)!=""){if(e&&g.dataType=="String")if(s.has(m))m=s.get(m);else{let b=this.obfuscateString(m);s.set(m,b),m=b}else if(g.dataType=="DateTime"&&!g.dateWithTime){let b=m instanceof Date?m:typeof m=="string"?Ne(m)??new Date(m):new Date(m);m=(this.wholeDayIso(b)??b.toISOString().slice(0,10))+"T00:00:00.000Z"}else o.has(d)&&m instanceof Date&&(m=fe(m));r-=this.STR(m).length}else m=null;c[d]=m,--r}if(n.push(c),--i,i<=0||r<=0)break}return await rn.unparse(n,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return rn.unparse([this._cols.map((n,i)=>{if(this.emitLegacyAggAliases&&n.hostName)return this.STR(n.hostName);let r=e.get(i);return this.STR(r&&r.headerName?r.alias:n.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(n=>n==null?null:this.STR(n)),this._englishAliases=new Map}aliasesForCode(e){let n=Be(e,this._cols)?this.legacyAliases():[];for(let i of this.englishAliasesFor(e).values())n.push({name:i.name,alias:i.alias,reason:"english-implicit-agg"});return n}armAliasesForCode(e){return this.emitLegacyAggAliases=Be(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let n of this.liveEnglishAliases().values())e.push({name:n.name,alias:n.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let n of this._cols)n&&n.hostName&&n.hostName!==n.name&&e.push({name:this.STR(n.name),alias:this.STR(n.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let n=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return n;let i=String(e),r=new Set;for(let o of this._cols)o&&(r.add(this.STR(o.name)),o.hostName&&r.add(this.STR(o.hostName)));let s=new Map;for(let o=0;o<this._cols.length;o++){if(!this._cols[o]||Ft(this._hostQueryNames[o],this._cols[o].name,this._cols[o].dataType))continue;let l=Lt(this._hostQueryNames[o]).filter(a=>!r.has(a)&&se(i,a));l.length===1&&s.set(l[0],[...s.get(l[0])??[],o])}for(let[o,l]of s){if(l.length!==1)continue;let a=this.STR(this._cols[l[0]].name);n.set(l[0],{name:a,alias:o,headerName:!se(i,a)})}return n}liveEnglishAliases(){let e=new Map;for(let[n,i]of this._englishAliases){let r=this._cols?this._cols[n]:null;r&&this.STR(r.name)===i.name&&e.set(n,i)}return e}addRow(e,n){if(this.dedupRows){let i="";for(let s of e)i+=this.STR(s)+"~";let r=rt(i);if(this._rowHashes.has(r))return!1;this._rowHashes.add(r)}return this._rows.push(fi(e)),this._inferredMeasureFlags=null,this._origIndices.push(n??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}invalidateStats(){this._computedStatsForLevel=null,this._geoExtentComputed=!1,this._geoExtent=null,this._geoExtentLatIdx=-1}reset(){this._inferredMeasureFlags=null,this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._inferredMeasureFlags=null,this._cols=e,!e||e.length===0)return;let n=new Set(e.map(i=>this.STR(i?.name)));for(let i of e){if(!i)continue;let r=this.STR(i.name),s=Pt(r);!s||s===r||n.has(s)||(n.delete(r),n.add(s),i.hostName=r,i.name=s)}}};export{cn as a,dn as b,bi as c,Si as d,wt as e,vt as f,wn as g,Mn as h,Tn as i,vn as j,Me as k,Ln as l,Pt as m,Be as n,Lt as o,Wt as p,Wn as q,Bt as r,Gt as s,Ti as t,vi as u,Ii as v,Gn as w,Kn as x,Vn as y,Kt as z,se as A,nr as B,Oi as C,rr as D,ir as E,j as F,Xt as G,Sr as H,_r as I,Ar as J,Tr as K,Qt as L,Jt as M,Yi as N,Re as O,an as P,ci as Q,di as R,mi as S,ln as T,sn as U,fi as V,on as W};
2
+ import{a as be}from"./chunk-U3H6UBOO.mjs";import{a as At,f as ee,g as Se,h as ie,i as _e,j as ne}from"./chunk-TZ74QIKA.mjs";import{b as ht,c as yt,d as bt,e as St,f as _t}from"./chunk-YDYFP2T4.mjs";import{c as ft,l as gt,n as he,p as pt,s as re,w as ye,x as ke,y as De,z as Pe}from"./chunk-DTBXJVUG.mjs";import{e as lt,k as ge,m as dt,n as mt,o as pe}from"./chunk-3ZAS32F5.mjs";import{b as ut,d as ct}from"./chunk-5HI6TVMM.mjs";import{A as fe,B as ot,E as at,a as ce,b as J,c as Ze,d as de,g as qe,h as Qe,j as Je,l as et,m as tt,o as nt,p as me,q as rt,r as it,u as Ne,w as st}from"./chunk-CZJ7M6A5.mjs";import{c as Xe,f as Ee}from"./chunk-WC4JINEZ.mjs";var cn=85,dn=60,mn=/(^|[^a-z])(state|province|provincia|provinz|region|regione|regiao|county|department|departement|departamento|prefecture|oblast|canton|kanton|bundesland|land|territory)([^a-z]|$)/i,Oe=t=>Math.round(t*10)/10,Ae=t=>t.split("-")[0];function xt(t){let e=new Map,n=0;if(t.forEach((s,o)=>{let l=he(o);l&&(e.set(l,(e.get(l)||0)+s),n+=s)}),n===0)return{};let[i,r]=[...e].sort((s,o)=>o[1]-s[1])[0];return{dominantRegion:i,dominantRegionPct:Oe(100*r/n)}}function bi(t){let e=t.province===null||t.province===void 0?"":String(t.province).trim();if(e)return Ct(e,t.provinceKind,t.country);if(!re())return null;let n=t.city===null||t.city===void 0?"":String(t.city).trim();if(!n)return null;let i=ye(n,{country:t.country===null||t.country===void 0?null:String(t.country)});return i.status==="resolved"?i.provinceId:null}function Ct(t,e,n){if(e==="us-state-code"||e==="us-state-name"){let s=_t(t,e);return s?"US-"+s:null}if(!re())return null;if(e==="admin1-code")return Pe(t)?t.toUpperCase():null;let i=n==null?null:String(n),r=new Set(ke(t,i).map(De).filter(s=>!!s));return r.size===1?[...r][0]:null}function Si(t,e={}){let n=e.deriveProvinces!==!1,i=new Array(t.length),r=new Array(t.length),s=new Set,o=[],l=new Set,a=[],c=0,d=0,g=0,m=A=>{let S=A.toLowerCase();s.has(S)||(s.add(S),o.push(A))},b=A=>A==null||A===""?null:Number(A),M=new Map;return t.forEach((A,S)=>{i[S]=null,r[S]=null;let p=A.country===null||A.country===void 0||String(A.country).trim()===""?null:String(A.country).trim(),h=A.province===null||A.province===void 0?"":String(A.province).trim();if(h){let _=Ct(h,e.provinceKind,p);_?(i[S]=_,r[S]="province",c++):m(h);return}if(!n)return;let x=b(A.lat),f=b(A.lon),C=!1;if(e.locate&&x!==null&&f!==null&&isFinite(x)&&isFinite(f)){C=!0;let _=e.locate(x,f);if(_){i[S]=_,r[S]="coordinates",c++;return}}let y=A.city===null||A.city===void 0?"":String(A.city).trim();if(y&&re()){let _=y.toLowerCase()+""+(p??""),w=M.get(_);if(w||(w=ye(y,{country:p}),M.set(_,w)),w.status==="resolved"&&w.provinceId){i[S]=w.provinceId,r[S]="city",c++;return}if(w.status==="ambiguous"){d++,l.has(_)||(l.add(_),a.length<8&&a.push(y));return}m(y);return}C&&g++}),{iso:i,source:r,unmatched:o,matchedRows:c,totalRows:t.length,ambiguousRows:d,ambiguousExamples:a,unplacedPoints:g}}function wt(t,e,n={}){let i=new Map;if(!re()||e.length===0)return i;let r=t.findIndex(l=>!l.isMeasure&&(l.geoKind||"").startsWith("country")),s=l=>l==null?"":String(l).trim(),o=l=>{let a=new Map;for(let b of e){let M=s(b[l]);if(!M)continue;let A=r>=0&&s(b[r])||null,S=M+""+(A??""),p=a.get(S);p?p.rows++:a.set(S,{city:M,country:A,rows:1})}if(a.size===0)return null;let c=0,d=0,g=new Set,m=new Map;return a.forEach(b=>{let M=ye(b.city,{country:b.country});M.status!=="unmatched"&&d++,!(M.status!=="resolved"||!M.provinceId)&&(c++,g.add(M.provinceId),m.set(M.cc,(m.get(M.cc)||0)+b.rows))}),{signals:{rollupPct:Oe(100*c/a.size),regionCount:g.size,countryCount:m.size,...xt(m)},cityPct:100*d/a.size,distinct:a.size}};return t.forEach((l,a)=>{if(l.isMeasure||a===r)return;let c=l.geoKind||"";if(c.startsWith("city")){if(n.cities===!1)return;let _=o(a);_&&i.set(a,_.signals);return}if(c)return;let d=new Map,g=new Map;for(let _ of e){let w=s(_[a]);w&&(d.set(w,(d.get(w)||0)+1),g.has(w)||g.set(w,r>=0&&s(_[r])||null))}if(d.size<3)return;let m=0,b=0,M=0,A=new Set,S=new Map;d.forEach((_,w)=>{if(Pe(w)){m++;let z=w.toUpperCase();A.add(z),S.set(Ae(z),(S.get(Ae(z))||0)+_);return}let W=new Set(ke(w,g.get(w)).map(De).filter(z=>!!z));if(W.size===1){b++;let z=[...W][0];A.add(z),S.set(Ae(z),(S.get(Ae(z))||0)+_)}else W.size>1&&M++});let h=mn.test(l.name.replace(/[_-]+/g," "))?dn:cn,x=100*m/d.size,f=100*b/d.size,C=x>=f,y=C?x:f;if(y<h){if(n.cities===!1)return;let _=o(a);if(!_||_.cityPct<ft||_.distinct<bt&&!yt(l.name,ht))return;i.set(a,_.signals);return}i.set(a,{kind:C?"admin1-code":"admin1-name",matchPct:Oe(y),ambiguous:!C&&M/d.size>.15?!0:void 0,regionCount:A.size,countryCount:S.size,...xt(S)})}),i}function ze(t){let e=(t||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}var Le={a:0,b:0,c:0,yearFirst:!1,sep:"",trail:"",word:"",day:0,year:0,namedOrder:"dmy",cjkPattern:""},fn=/\s+(\d{1,2}):(\d{2})(?::(\d{2})(?:[.,]\d{1,9})?)?(?:\s*([ap])\.?\s?m\.?)?$/i,gn=/^(\d{1,4})(\s*[./-]\s*)(\d{1,2})(\s*[./-]\s*)(\d{1,4})(\.?)$/,pn=/^(\d{4})(\s*[年년]\s*)(\d{1,2})(\s*[月월]\s*)(\d{1,2})(\s*[日일号])$/,hn=/(\d)(?:st|nd|rd|th|er|º|ª)(?=[\s.,/-]|$)/gi,yn=new Set(["de","del","of"]),bn=new Set(["\u0433","\u0440","r"]),Sn=/^[\p{L}\p{M}\u0970\u05f3]+$/u,Fe=/^\d+$/;function _n(t){let e=+t[1],n=+t[2],i=t[3]===void 0?0:+t[3],r=t[4]!==void 0;if(n>59||i>59)return null;if(r){if(e<1||e>12)return null;e=e%12+(t[4].toLowerCase()==="p"?12:0)}else if(e>23)return null;return{h:e,mi:n,s:i,seconds:t[3]!==void 0,meridiem:r}}function Mt(t){let e=t.replace(/[\u200e\u200f\u061c]/g,"").replace(/\s+/g," ").trim();if(e==="")return null;e=At(e);let n=null,i=fn.exec(e);if(i){if(n=_n(i),!n)return null;e=e.slice(0,i.index)}let r;if(r=pn.exec(e)){let m=`cjk|${r[2]}|${r[4]}|${r[6]}`;return{...Le,form:"cjk",key:m,clock:n,a:+r[1],b:+r[3],c:+r[5],yearFirst:!0,cjkPattern:`%Y${r[2]}%m${r[4]}%d${r[6]}`}}if(r=gn.exec(e)){let m=r[2],b=r[4];if(m!==b)return null;let M=m.trim(),A=r[6];if(A&&M!==".")return null;let S=[r[1].length,r[3].length,r[5].length],p=S[0]===4,h=S[2]===4;return p===h||(p?S[1]>2||S[2]>2:S[0]>2||S[1]>2)?null:p&&M==="-"&&m==="-"&&S[1]===2&&S[2]===2?"iso":p&&M==="."&&m==="."&&!A&&!(S[1]===2&&S[2]===2)?null:{...Le,form:"numeric",key:`num|${p?"y":"x"}|${m}|${A}`,clock:n,a:+r[1],b:+r[3],c:+r[5],yearFirst:p,sep:m,trail:A}}let s=e.replace(hn,"$1").split(/[\s.,/-]+/).filter(m=>m!==""&&!yn.has(m.toLowerCase()));if(s.length===4&&Fe.test(s[2])&&bn.has(s[3].toLowerCase())&&s.pop(),s.length!==3)return null;let o=s.map(m=>Fe.test(m)?"N":Sn.test(m)?"W":"?").join(""),l=s.map(m=>Fe.test(m)?m:""),a=0,c=0,d="",g;if(o==="NWN"&&l[0].length<=2&&l[2].length===4)a=+l[0],d=s[1],c=+l[2],g="dmy";else if(o==="WNN"&&l[1].length<=2&&l[2].length===4)d=s[0],a=+l[1],c=+l[2],g="mdy";else if(o==="NWN"&&l[0].length===4&&l[2].length<=2)c=+l[0],d=s[1],a=+l[2],g="ymd";else return null;return{...Le,form:"named",key:`named|${g}`,clock:n,day:a,year:c,word:d,namedOrder:g}}var An=[31,28,31,30,31,30,31,31,30,31,30,31],xn=t=>t%4===0&&t%100!==0||t%400===0;function Tt(t,e,n){return t>=1&&t<=9999&&e>=1&&e<=12&&n>=1?n<=(e===2&&xn(t)?29:An[e-1]):!1}function Cn(t,e,n,i){let r=new Date(Date.UTC(2e3,e-1,n,i?.h??0,i?.mi??0,i?.s??0));return r.setUTCFullYear(t),r}function vt(t,e={}){let n=(e.floor??1)>=1,i=new Map,r=new Map,s=0,o=null;for(let p of t){if(p==null)continue;if(typeof p!="string"){if(n)return null;s++;continue}let h=p.trim();if(h==="")continue;s++;let x=i.get(h);if(x===void 0&&(x=Mt(h),i.set(h,x)),x===null||x==="iso"){if(n)return null;continue}if(n){if(o===null)o=x;else if(x.key!==o.key)return null}else r.set(x.key,(r.get(x.key)??0)+1)}if(!n){let p=0,h="";for(let[x,f]of r)f>p&&(p=f,h=x);if(p===0||p/s<e.floor)return null;o=[...i.values()].find(x=>x!==null&&x!=="iso"&&x.key===h)??null}if(o===null)return null;let l=o.key,a=[...i.values()].filter(p=>p!==null&&p!=="iso"&&p.key===l),c,d="shape",g=null;if(o.form==="named"){if(c=o.namedOrder,g=_e(a.map(p=>p.word),e.locale),!g)return null}else if(o.form==="cjk"||o.yearFirst)c="ymd";else{let p=0,h=0;for(let x of a)x.a>12&&p++,x.b>12&&h++;if(p>0&&h>0)return null;p>0?(c="dmy",d="values"):h>0?(c="mdy",d="values"):o.sep.trim()==="."?(c="dmy",d="shape"):(c=ze(e.locale)?"mdy":"dmy",d="locale")}let m=p=>{if(p.form==="named"){let h=g.get(ee(p.word));return h===void 0?null:[p.year,h+1,p.day]}return p.yearFirst?[p.a,p.b,p.c]:c==="dmy"?[p.c,p.b,p.a]:[p.c,p.a,p.b]},b=1/0,M=-1/0,A=0;for(let p of a){let h=m(p);if(!h||!Tt(h[0],h[1],h[2])){if(n)return null;A++;continue}b=Math.min(b,h[0]),M=Math.max(M,h[0])}if(!n&&(r.get(l)-A)/s<e.floor||b>=2400&&M<=2699||b>=1300&&M<=1500)return null;let S={form:o.form,order:c,orderFrom:d,hasTime:a.some(p=>p.clock!==null),read(p){if(typeof p!="string")return null;let h=p.trim();if(h==="")return null;let x=i.get(h);if(x===void 0&&(x=Mt(h),i.set(h,x)),x===null||x==="iso"||x.key!==l)return null;let f=m(x);return!f||!Tt(f[0],f[1],f[2])?null:Cn(f[0],f[1],f[2],x.clock)}};if(o.form!=="named"&&!a.some(p=>p.clock?.meridiem)){let p;o.form==="cjk"?p=o.cjkPattern:o.yearFirst?p=`%Y${o.sep}%m${o.sep}%d${o.trail}`:p=(c==="dmy"?`%d${o.sep}%m${o.sep}%Y`:`%m${o.sep}%d${o.sep}%Y`)+o.trail;let h=a.filter(x=>x.clock!==null).length;h===0?S.pattern=p:h===a.length&&(S.pattern=p+(a.every(x=>x.clock.seconds)?" %H:%M:%S":" %H:%M"))}return S}import rn from"papaparse";var wn=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","capita","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan","ocupacion","ocupacao","occupazione","auslastung","bezetting","belaggning","belaegning","belegg","kayttoaste","oblozenie","obsazenost","obsadenost","kihasznaltsag","doluluk","ocupare","popunjenost","efficacite","eficiencia","efficienza","effizienz","effectiviteit","verimlilik"],Mn=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],Tn=["latitude","longitude"],vn=["latitude","longitude"];function q(t){return ce(t)}var Et=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z","sum pa","\u0441\u0443\u043C\u043C\u0430","\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E","\u0441\u0443\u043C\u0430","\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C","\u03B1\u03B8\u03C1\u03BF\u03B9\u03C3\u03BC\u03B1","\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2"],In=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von","prom.","\u0441\u0440\u0435\u0434\u043D\u0435\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435","\u0441\u0440\u0435\u0434\u043D\u0435\u0435","\u0441\u0435\u0440\u0435\u0434\u043D\u0454","\u03BC\u03B5\u03C3\u03BF\u03C2 \u03BF\u03C1\u03BF\u03C2","\u0645\u06CC\u0627\u0646\u06AF\u06CC\u0646"],Rn=["osszege","sucet","\u7684\u603B\u548C","\u7684\u8BA1\u6570","\u306E\u5408\u8A08","\uC758 \uD569\uACC4"],En=["atlaga","priemer","\u7684\u5E73\u5747\u503C","\u306E\u5E73\u5747","\uC758 \uD3C9\uADE0"],xe=Object.freeze({"nombre de":"count","recuento de":"count","contagem de":"count","anzahl von":"count","aantal van":"count","conteggio di":"count","antal av":"count",lukumaara:"count","pocet z":"count",\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:"count",\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C:"count",\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2:"count",\u7684\u8BA1\u6570:"count","minimum de":"min","minimo de":"min","minimo di":"min","minimum von":"min","maximum de":"max","maximo de":"max","massimo di":"max","maximum von":"max"});function We(t){return[...t].sort((e,n)=>n.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Nt=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+We(Et)+")\\s+)","i");function It(t){for(let e of t){let n=e.codePointAt(0)??0;if(n>=11904&&n<=40959||n>=44032&&n<=55215)return!0}return!1}var Nn="[\u2013\u2014-]";function kt(t){let e=t.filter(r=>!It(r)),n=t.filter(It),i=[];return e.length&&i.push("(?:\\s+|\\s*"+Nn+"\\s*)("+We(e)+")"),n.length&&i.push("\\s*("+We(n)+")"),new RegExp("(?:"+i.join("|")+")\\s*$","i")}var $e=kt(Rn),kn=kt(En);function Ce(t,e){let n=e.exec(t);if(!n)return null;let i=t.slice(0,n.index);return i.trim()===""?null:{base:i,label:(n[1]??n[2]??"").toLowerCase()}}function Dt(t){let e=q(String(t??"").trim().toLowerCase());if(!e)return null;for(let r of In)if(e.startsWith(r+" "))return xe[r]??"avg";for(let r of Et)if(e.startsWith(r+" ")||e===r)return xe[r]??"sum";let n=Ce(e,kn);if(n)return xe[n.label]??"avg";let i=Ce(e,$e);return i?xe[i.label]??"sum":null}var Dn=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,Pn=new RegExp("\\b("+wn.join("|")+")\\b|("+Mn.join("|")+")$","i"),On=new RegExp("\\b("+Tn.join("|")+")\\b|("+vn.join("|")+")$","i");function Me(t){if(!t)return"";let e=String(t),n=q(e),i=Nt.exec(n);if(i)return e.slice(i[0].length).trim();let r=Ce(n,$e);return(r?e.slice(0,r.base.length):e).trim()}function Ln(t){if(!t)return!1;let e=q(String(t));return Nt.test(e)||Ce(e,$e)!==null}var Fn=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],Rt=new RegExp("^\\s*("+[...Fn].sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function Pt(t){if(t==null)return"";let e=String(t),n=Rt.exec(e);if(!n)return e;let i=l=>l.toLowerCase().replace(/\s+/g," ").trim(),r=i(n[1]),s=e.slice(n[0].length),o=0;for(;o<8;){let l=Rt.exec(s);if(!l||i(l[1])!==r)break;let a=s.slice(l[0].length);if(a.trim()==="")break;s=a,o++}return o===0?e:e.slice(0,n[0].length)+s}function Be(t,e){if(!t||!e)return!1;let n=String(t);for(let i of e){let r=i?.hostName;if(r&&r!==i?.name&&n.includes(r))return!0}return!1}var we={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},Ot=new RegExp("^("+Object.keys(we).join("|")+")\\((.+)\\)$");function Lt(t){if(!t)return[];let e=Ot.exec(String(t).trim());if(!e)return[];let n=we[e[1]],i=e[2],r=[];for(let s=i.indexOf(".");s>=0;s=i.indexOf(".",s+1)){if(s===0)continue;let o=i.slice(s+1);if(o.trim()!=="")for(let l of n){let a=l+o;r.includes(a)||r.push(a)}}return r}function Ft(t,e,n){let i=Ot.exec(String(t??"").trim());if(!i)return!1;let r=i[1];if((r==="Count"||r==="CountNonNull")&&n==="Decimal")return!0;let s=new Set(we[r]),o=String(e??""),l=i[2];for(let a=l.indexOf(".");a>=0;a=l.indexOf(".",a+1)){if(a===0)continue;let c=l.slice(a+1);if(c.trim()!==""){for(let d of Object.values(we))for(let g of d)if(!s.has(g)&&o===g+c)return!0}}return!1}function zn(t){let e=Me(t);return e.length===0?"":e.replace(Dn," ")}function zt(t,e){if(!e)return!1;let n=Me(e);return t.test(q(zn(e)))||t.test(q(n))||t.test(q(J(n).join(" ")))}function Wt(t){return zt(On,t)}function Wn(t){return zt(Pn,t)||Wt(t)}var $t=/int|double|decimal|single|float|number|currency|money/i;function $n(t){let e=String(t?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||t?.isMeasure===!0||$t.test(String(t?.dataType??""))?"Continuous":"Categorical"}function Bn(t){return t?.isMeasure===!0||$t.test(String(t?.dataType??""))}function Bt(t){let e=t??{},n=$n(e);if(n!=="Continuous")return{nature:n,additivity:"unknown",basis:"role",suppressed:!1};if(Wt(e.name))return{nature:n,additivity:"positional",basis:"name",suppressed:!0};let i=String(e.additivity??"").trim().toLowerCase();if(!(i==="additive"&&Ln(e.name))){if(i==="additive")return{nature:n,additivity:"additive",basis:"measured",suppressed:!1};if(i==="part_of_whole")return{nature:n,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(i==="intensive_rate")return{nature:n,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:n,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:Wn(e.name)?{nature:n,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:n,additivity:"additive",basis:"default",suppressed:!1}}function Gt(t){let e=Bt(t),n=t??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return Bn(n)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function Ti(t){return Gt(t)[0]}function vi(t,e){return Gt(t).indexOf(e)>=0}function Ii(t,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let n=Bt(t);return n.additivity==="additive"||n.additivity==="part_of_whole"||n.additivity==="unknown"}var Gn={de:["nr","nummer","kennung","kennziffer","plz","postleitzahl"],nl:["nr","nummer"],sv:["nr","nummer"],da:["nr","nummer"],nb:["nr","nummer"],fi:["tunnus","koodi","nro"],hu:["azonos\xEDt\xF3","k\xF3d"],tr:["kod","kodu","numaras\u0131","numarasi"],zh:["\u7F16\u53F7","\u4EE3\u7801","\u7F16\u7801","\u53F7\u7801","\u90AE\u7F16"],ja:["\u756A\u53F7","\u30B3\u30FC\u30C9"],ko:["\uBC88\uD638","\uCF54\uB4DC"],hi:["\u0915\u094B\u0921","\u0915\u094D\u0930\u092E\u093E\u0902\u0915"],fr:["num\xE9ro"],es:["c\xF3digo"],pt:["c\xF3digo","cep"],it:["codice"],pl:["kod","numer"],cs:["k\xF3d","\u010D\xEDslo"],sk:["k\xF3d","\u010D\xEDslo"],hr:["\u0161ifra","oznaka"],ru:["\u043A\u043E\u0434","\u043D\u043E\u043C\u0435\u0440"],uk:["\u043A\u043E\u0434","\u043D\u043E\u043C\u0435\u0440"],el:["\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2"],ar:["\u0631\u0645\u0632","\u0643\u0648\u062F","\u0631\u0642\u0645"],he:["\u05E7\u05D5\u05D3"],id:["kode","nomor"],vi:["m\xE3"],th:["\u0E23\u0E2B\u0E31\u0E2A"]},Kn=["fr","es","pt","it","pl","cs","sk","hr","ru","uk","el","ar","he","id","vi","th"],Vn=["num\xE9ro"],Un=t=>t.normalize("NFC").toLowerCase();function Hn(t,e,n,i){let r=Ee(n);return!r||!t?null:t===e?"word":r.wordBreaks===!1?Array.from(e).length<tt?null:(i?t.startsWith(e):t.endsWith(e))&&t.length>e.length?"suffix":null:i?Je(t,n).includes(e)?"word":null:r.script==="Hang"?et(t,e)?"suffix":null:r.compounds&&Qe(t,e,qe)?"suffix":null}function Kt(t){let e=String(t??"").trim();if(!e)return null;let n=de(e),i=de(Me(e));for(let[r,s]of Object.entries(Gn)){let o=Kn.includes(r),l=o?i:n;for(let a of s){let c=Vn.includes(a)||!!Ee(r)?.foldSensitive,d=c?l.words:l.folded;if(d.length===0)continue;let g=c?Un(a):de(a).folded.join(" "),m=Hn(o?d[0]:d[d.length-1],g,r,o);if(m)return{lang:r,word:a,view:m}}}return null}var Yn=[["Lu",/^\p{Lu}$/u],["Ll",/^\p{Ll}$/u],["Lt",/^\p{Lt}$/u],["Lm",/^\p{Lm}$/u],["Lo",/^\p{Lo}$/u],["Mn",/^\p{Mn}$/u],["Mc",/^\p{Mc}$/u],["Nd",/^\p{Nd}$/u]];function Te(t){for(let[e,n]of Yn)if(n.test(t))return e;return null}var jn=[{id:"ascii",test:/^[A-Za-z]$/,ranges:[[65,90],[97,122]]},{id:"latin",test:/^[\u00C0-\u017F]$/u,ranges:[[192,383]]},{id:"cyrillic",test:/^[\u0400-\u045F\u0490-\u0491]$/u,ranges:[[1024,1119],[1168,1169]]},{id:"greek",test:/^[\u0386-\u03CE]$/u,ranges:[[902,974]]},{id:"han",test:/^[\u4E00-\u9FFF]$/u,ranges:[[19968,40959]]},{id:"hiragana",test:/^\p{Script=Hiragana}$/u,ranges:[[12353,12447]]},{id:"katakana",test:/^\p{Script=Katakana}$/u,ranges:[[12448,12543]]},{id:"hangul",test:/^[\uAC00-\uD7A3]$/u,ranges:[[44032,55203]]},{id:"arabic",test:/^[\u0620-\u0652\u0671-\u06D3]$/u,ranges:[[1568,1618],[1649,1747]]},{id:"hebrew",test:/^[\u05B0-\u05EA]$/u,ranges:[[1456,1514]]},{id:"devanagari",test:/^\p{Script=Devanagari}$/u,ranges:[[2304,2431]]},{id:"thai",test:/^\p{Script=Thai}$/u,ranges:[[3585,3662]]}],ve=new Map;function Vt(t,e,n,i){let r=ve.get(t);if(r)return r;let s=[];for(let[o,l]of e)for(let a=o;a<=l;a++){let c=String.fromCodePoint(a);Te(c)===n&&(i&&!i.test(c)||s.push(c))}return ve.set(t,s),s}function Xn(t){let n=t.codePointAt(0);for(let o=0;o<9&&Te(String.fromCodePoint(n-1))==="Nd";o++)n--;let i="nd:"+n.toString(16),r=ve.get(i);if(r)return r;let s=[];for(let o=n;o<n+10;o++){let l=String.fromCodePoint(o);Te(l)==="Nd"&&s.push(l)}return ve.set(i,s),s}function Zn(t,e){if(e==="Nd")return Xn(t);for(let r of jn)if(r.test.test(t))return Vt(r.id+":"+e,r.ranges,e,r.id==="ascii"?null:r.test);let i=t.codePointAt(0)&-128;return Vt("block:"+i.toString(16)+":"+e,[[i,i+127]],e,null)}function qn(t,e,n,i){let r=t.filter(s=>!e.has(s));return r.length===0&&(r=t.filter(s=>s!==n)),r.length===0?n:r[Math.min(r.length-1,Math.floor(i()*r.length))]}var Qn=/^[\p{L}\p{M}\p{Nd}]$/u,Ut=/^[\p{L}\p{Nd}]$/u;function Ht(t,e){if(!t)return t??"";let n=new Set(Array.from(t)),i=d=>{let g=Te(d);return!g||!Qn.test(d)?d:qn(Zn(d,g),n,d,e)},r=d=>{let g=[];for(let m of d)g.push(i(m)),Ut.test(m)&&e()<.2&&g.push(i(m));if(g.length>6){let m=Math.floor(e()*Math.min(3,g.length-6));for(let b=0;b<m;b++)for(let M=0;M<5;M++){let A=Math.floor(e()*g.length);if(Ut.test(g[A])){g.splice(A,1);break}}}return g.join("")};if(!(t.includes("@")&&t.includes(".")))return r(t);let[o,l=""]=t.split("@"),a=l.endsWith(".com"),c=a?l.slice(0,-4):l;return`${r(o)}@${r(c)}${a?".com":""}`}var Jn=/^[A-Za-z_$][A-Za-z0-9_$]*$/,er=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),tr=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function se(t,e){if(!t||!e)return!1;let n=er(e);return new RegExp("['\"`]"+n+"['\"`]").test(t)?!0:Jn.test(e)&&new RegExp("\\."+n+"(?![A-Za-z0-9_$])").test(t)}function nr(t){return!!t&&tr.test(t)}function Oi(t,e,n){return t?nr(t)?[...e]:[...n,...e].some(i=>se(t,i))?e.filter(i=>se(t,i)):[...e]:[]}var rr=5,ir=6,sr=3,te=864e5,or=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,ar=/^(\d{4})[-/](\d{1,2})$/,lr=/^(\d{4})[-\s]?Q([1-4])$/i,ur=/^Q([1-4])[-\s](\d{4})$/i,cr=/^(\d{4})$/,dr=/^(\d{4})(0[1-9]|1[0-2])$/,mr=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/,fr=/^(\D+?)[\s\-/.,']*((?:19|20)\d{2})$/u,gr=/^((?:19|20)\d{2})[\s\-/.,']+(\D+)$/u;function Ge(t,e,n){let i=ee(t);if(!i)return 0;if(i==="sept")return 9;for(let o of e&&!/^en\b/i.test(e)?["en",e]:["en"]){let l=Se(o)[i];if(l!==void 0)return l+1}let r=n?.get(i);if(r!==void 0)return r+1;let s=ie(t);if(s.length>0){if(s.every(a=>a.month===s[0].month))return s[0].month+1;let o=Xe(String(e??"").split(/[-_]/)[0])?.code,l=s.find(a=>a.lang===o);if(l)return l.month+1}return 0}function pr(t){let e=ge(t).filter(i=>i.yearDigits===4);if(e.length===0||e.some(i=>i.lang==="en"))return null;let n=e[0];return e.some(i=>i.grain!=="quarter"||i.n!==n.n||i.year!==n.year)?null:Y(n.year,(n.n-1)*3+1,1)}function Y(t,e,n,i=0,r=0,s=0){if(!(t>=1&&e>=1&&e<=12&&n>=1&&n<=31))return null;let o=Date.UTC(t,e-1,n,i,r,s);if(!Number.isFinite(o))return null;let l=a=>a<10?"0"+a:String(a);return{ms:o,y:t,m:e,d:n,iso:`${t}-${l(e)}-${l(n)}`}}function hr(t,e){let n=[],i="";for(let a=0;a<e.length;a++){if(e[a]!=="%"){i+=e[a].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++a]){case"Y":n.push("Y"),i+="(\\d{4})";break;case"m":n.push("m"),i+="(\\d{1,2})";break;case"d":n.push("d"),i+="(\\d{1,2})";break;case"H":case"M":case"S":i+="\\d{1,2}";break;case"%":i+="%";break;default:return null}}let r=new RegExp("^"+i+"$").exec(t);if(!r)return null;let s=0,o=1,l=1;return n.forEach((a,c)=>{let d=+r[c+1];a==="Y"?s=d:a==="m"?o=d:l=d}),s?Y(s,o,l):null}function j(t,e,n,i){let r=(t??"").trim();if(r==="")return null;if(e){let a=hr(r,e);return a||null}let s=or.exec(r);if(s)return Y(+s[1],+s[2],+s[3],+(s[4]??0),+(s[5]??0),+(s[6]??0));if(s=lr.exec(r),s)return Y(+s[1],(+s[2]-1)*3+1,1);if(s=ur.exec(r),s)return Y(+s[2],(+s[1]-1)*3+1,1);if(s=ar.exec(r),s&&+s[2]>=1&&+s[2]<=12)return Y(+s[1],+s[2],1);if(s=mr.exec(r),s)return Y(+s[1],+s[2],+s[3]);if(s=dr.exec(r),s)return Y(+s[1],+s[2],1);if(s=cr.exec(r),s){let a=+s[1];return a>=1900&&a<=2100?Y(a,1,1):null}let o=pr(r);if(o)return o;if(s=fr.exec(r),s){let a=Ge(s[1],n,i);if(a)return Y(+s[2],a,1)}if(s=gr.exec(r),s){let a=Ge(s[2],n,i);if(a)return Y(+s[1],a,1)}let l=ne(r);if(l){let a="month"in l?l.month:Ge(l.word,n,i);if(a)return Y(l.year,a,1)}return null}function Yt(t){let e=new Date(t).getUTCDay();return e>=1&&e<=5}function jt(t,e){if(e<=t)return 0;let n=Math.round((e-t)/te),i=Math.floor(n/7),r=i*5,s=t+i*7*te;for(;s<e;)Yt(s)&&r++,s+=te;return r}function yr(t){if(t.length===0)return 0;let e=[...t].sort((i,r)=>i-r),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function br(t){return t>0?t<.95?"hour":t<=1.05?"day":t>=6.5&&t<=7.5?"week":t>=27&&t<=31.5?"month":t>=88&&t<=93?"quarter":t>=362&&t<=368?"year":"irregular":"irregular"}function oe(t,e,n,i){switch(n){case"year":return e.y-t.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(t.y*4+Math.floor((t.m-1)/3));case"month":return e.y*12+e.m-(t.y*12+t.m);case"week":return Math.round((e.ms-t.ms)/(7*te));case"weekday":return jt(t.ms,e.ms);case"day":return Math.round((e.ms-t.ms)/te);default:return i>0?Math.round((e.ms-t.ms)/i):0}}function Xt(t,e){return Ke(t,e)?.cadence??null}function Ke(t,e){let n=e?.gapFactor??rr,i=0,r=0,s=new Map,o=Array.from(t),l;if(!e?.pattern){let f=[];for(let C of o){if(C==null||C==="")continue;let y=ne(String(C));y&&"word"in y&&f.push(y.word)}f.length>0&&(l=_e(f,e?.locale)??void 0)}for(let f of o){if(f==null||f==="")continue;i++;let C=j(String(f),e?.pattern,e?.locale,l);C&&(r++,s.set(C.ms,C))}let a=[...s.values()].sort((f,C)=>f.ms-C.ms);if(a.length<sr||i>0&&r/i<.8)return null;let c=a[a.length-1].ms-a[0].ms;if(c<=0)return null;let d=[];for(let f=1;f<a.length;f++)d.push(a[f].ms-a[f-1].ms);let g=yr(d);if(!(g>0))return null;let m=br(g/te);m==="day"&&c>=7*te&&a.every(f=>Yt(f.ms))&&jt(a[0].ms,a[a.length-1].ms)+1>a.length*.5&&(m="weekday");let b=m==="irregular"?a.length:oe(a[0],a[a.length-1],m,g)+1,M=1,A=1,S=[],p=a[0],h=1;for(let f=1;f<a.length;f++){let C=oe(a[f-1],a[f],m,g);C>M&&(M=C),m!=="irregular"&&C>n?(A++,S.push({from:p.iso,to:a[f-1].iso,points:h}),p=a[f],h=1):h++}S.push({from:p.iso,to:a[a.length-1].iso,points:h});let x={grain:m,points:a.length,expectedPoints:Math.max(b,a.length),coveragePct:Math.round(a.length/Math.max(b,a.length)*1e3)/10,runs:A,largestGapUnits:M,gapFactor:n};return e?.includeBounds&&S.length<=ir&&(x.runBounds=S),{cadence:x,points:a,stepMs:g}}var Sr=8,_r=.5,Ar=200,xr=new Set(["category","categories","subcategory","type","types","kind","class","classes","classification","segment","segments","tier","status","priority","severity","grade","level","band","bucket","group","channel","method","mode","stage","phase","period","shift","gender","sex","result","outcome","reason","flag","genre","sector","source"]),Cr=["category","classification","segment","status","priority","severity","channel"],wr=new Set(["UUID","EMAIL_LIKE","URL_LIKE","PHONE_LIKE","NUMERIC_ID","HEX_ID","OPAQUE_ID_ALPHANUMERIC","DATE_STR","BOOLEAN"]);function Mr(t){let e=J(t);if(e.length===0)return!1;let n=e[e.length-1];return xr.has(n)?!0:Cr.some(i=>n.length>i.length&&n.endsWith(i))}function Tr(t){if(t.isMeasure)return"measure";if(t.isTemporal||t.isDatePart||t.isReassembledDate)return"temporal";let e=Array.from(t.values).filter(n=>n!==""&&n!==null&&n!==void 0);return e.length<2||e.length>Ar?"cardinality":t.rows>0&&e.length>=t.rows?"row-identity":t.isBinaryFlag?"flag":pe(e,t.locale)!==null?"ordinal":t.identifierNamed||t.dataType==="String"&&wr.has(be(e))?"identifier":!t.geoKind&&Mr(t.name)?"attribute":"entity"}function Qt(t){let e=-1,n=1/0,i=!1;return t.forEach((r,s)=>{if(Tr(r)!=="entity")return;let o=new Set(Array.from(r.values).filter(a=>a!=="")).size,l=!!r.geoKind;(o<n||o===n&&l&&!i)&&(e=s,n=o,i=l)}),e}var Zt=t=>t<10?"0"+t:String(t);function qt(t,e){switch(e){case"year":return`${t.y}-01-01`;case"quarter":return`${t.y}-${Zt(Math.floor((t.m-1)/3)*3+1)}-01`;case"month":return`${t.y}-${Zt(t.m)}-01`;case"hour":return new Date(t.ms).toISOString().replace(/\.\d{3}Z$/,"Z");default:return t.iso}}function Jt(t){let{periods:e,series:n}=t,i=Math.min(e.length,n.length),r=new Set;for(let C=0;C<i;C++)e[C]&&r.add(e[C]);let s=Ke(r,{pattern:t.pattern,locale:t.locale});if(!s)return null;let o=s.cadence.grain;if(o==="irregular")return null;let l=s.points[0],a=oe(l,s.points[s.points.length-1],o,s.stepMs)+1;if(a!==s.cadence.expectedPoints)return null;let c=new Map;for(let C of r){let y=j(C,t.pattern,t.locale);if(!y)continue;let _=oe(l,y,o,s.stepMs);_>=0&&_<a&&c.set(C,{idx:_,stamp:y})}let d=new Map;for(let C=0;C<i;C++){let y=n[C];if(!y)continue;let _=c.get(e[C]);if(!_)continue;let w=d.get(y);w||(w={seen:new Set,lo:_.idx,hi:_.idx,loStamp:_.stamp,hiStamp:_.stamp,order:d.size},d.set(y,w)),w.seen.add(_.idx),_.idx<w.lo&&(w.lo=_.idx,w.loStamp=_.stamp),_.idx>w.hi&&(w.hi=_.idx,w.hiStamp=_.stamp)}if(d.size<2)return null;let g=0;for(let C of d.values())g+=C.seen.size;if(g/(d.size*a)<(t.minFill??_r))return null;let m=[],b=new Set,M=0,A=0,S=0,p=0,h=0,x=1;for(let[C,y]of d){for(let z of y.seen)b.add(z);if(y.seen.size>=a)continue;let _=[...y.seen].sort((z,X)=>z-X),w=1;for(let z=1;z<_.length;z++)w=Math.max(w,_[z]-_[z-1]);let W={key:C,acc:y,coverage:y.seen.size/a,before:y.lo,after:a-1-y.hi,interior:y.hi-y.lo+1-y.seen.size,gap:w};m.push(W),W.before>0&&M++,W.after>0&&A++,W.interior>0&&S++,p=Math.max(p,W.before),h=Math.max(h,W.after),x=Math.max(x,w)}if(m.length===0)return null;m.sort((C,y)=>C.coverage-y.coverage||C.acc.order-y.acc.order);let f=m.slice(0,t.maxListed??Sr);return{seriesColumn:t.seriesColumn,grain:o,periods:a,seriesCount:d.size,incompleteSeries:m.length,lateStarts:M,earlyEnds:A,withHoles:S,columnWideMissing:a-b.size,maxMissingBefore:p,maxMissingAfter:h,largestGap:x,series:f.map(C=>{let y={};return t.includeNames&&(y.name=C.key),t.includeDates&&(y.first=qt(C.acc.loStamp,o),y.last=qt(C.acc.hiStamp,o)),y.missingBefore=C.before,y.missingAfter=C.after,y.missingInterior=C.interior,y.largestGap=C.gap,y.coverage=Math.round(C.coverage*1e3)/1e3,y}),more:m.length-f.length}}var Ie=6;function ae(t){let e=t.slice().sort((i,r)=>i-r),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function vr(t){let e=t.length;if(e<Ie)return null;let n=t[0],i=t[0],r=0;for(let f of t)f<n&&(n=f),f>i&&(i=f),r+=f;if(n===i)return null;let s=ae(t.map(Math.abs));if(s===0)return null;let o=[];for(let f=1;f<e;f++)o.push(t[f]-t[f-1]);let l=ae(o.map(Math.abs))/s,a=(e-1)/2,c=r/e,d=0,g=0,m=0;for(let f=0;f<e;f++)d+=(f-a)*(t[f]-c),g+=(f-a)*(f-a),m+=(t[f]-c)*(t[f]-c);m/=e;let b=d/g,M=c-b*a,A=t.map((f,C)=>f-(M+b*C)),S=A.reduce((f,C)=>f+C,0)/e,p=0,h=0;for(let f=0;f<e;f++)p+=(A[f]-S)*(A[f]-S),f>0&&(h+=(A[f]-A[f-1])*(A[f]-A[f-1]));return p/=e,h/=e-1,{vnDetrended:p<=m*1e-12?2:h/p,relStep:l}}function Ve(t){let{stamps:e,series:n,values:i}=t,r=Math.min(e.length,i.length),s=new Map;for(let c=0;c<r;c++){let d=e[c],g=i[c];if(d===null||g===null||!Number.isFinite(g))continue;let m="";if(n&&(m=n[c]??"",m===""))continue;let b=s.get(m);b||s.set(m,b=new Map),b.set(d,(b.get(d)??0)+g)}let o=[],l=[],a=[];for(let c of s.values()){let d=[...c.entries()].sort((m,b)=>m[0]-b[0]).map(m=>m[1]),g=vr(d);g&&(o.push(g.vnDetrended),l.push(g.relStep),a.push(d.length))}return o.length===0?null:{series:o.length,points:Math.round(ae(a)),vnDetrended:Math.round(ae(o)*1e3)/1e3,relStep:Math.round(ae(l)*1e4)/1e4}}function Yi(t){let e=t.times.map(n=>j(n,t.pattern,t.locale)?.ms??null);return Ve({stamps:e,series:t.series,values:t.values})}var Ir=5e5,Rr=8,Er=4,Nr=5,Ue=1,He=2,kr=4,Dr=8;function Pr(t,e,n){let[i,r]=[...t];if(e.isTemporal){let s=j(i,e.temporalTextPattern,n),o=j(r,e.temporalTextPattern,n);if(s&&o&&s.ms!==o.ms)return s.ms<o.ms?{a:i,b:r,setOrder:"temporal"}:{a:r,b:i,setOrder:"temporal"}}return i<r?{a:i,b:r,setOrder:"none"}:{a:r,b:i,setOrder:"none"}}function Or(t,e,n){let{rows:i,text:r,locale:s}=t,o=Pr(n.values,n,s),l=new Uint8Array(i.length),a=0;for(let c=0;c<i.length;c++){let d=r(i[c][e]);d===o.a?l[c]=1:d===o.b?l[c]=2:a++}return{code:l,blankRows:a,setOrder:o.setOrder}}function Lr(t,e){let{rows:n,text:i}=t,r=new Int32Array(n.length),s=new Map;for(let o=0;o<n.length;o++){let l=i(n[o][e]);if(l===""){r[o]=-1;continue}let a=s.get(l);a===void 0&&(a=s.size,s.set(l,a)),r[o]=a}return{ids:r,dict:s}}function Fr(t,e,n){let i=new Uint8Array(n);for(let s=0;s<t.length;s++){let o=e[s];if(o===0)continue;let l=t[s];if(l<0)continue;let a=i[l];i[l]=a&o?a|o<<2:a|o}let r={keysA:0,keysB:0,keysBoth:0,dupA:0,dupB:0};for(let s=0;s<n;s++){let o=i[s];o&Ue&&r.keysA++,o&He&&r.keysB++,(o&(Ue|He))===(Ue|He)&&r.keysBoth++,o&kr&&r.dupA++,o&Dr&&r.dupB++}return r}function zr(t,e){let n=(t.dupA+t.dupB)*(e.keysA+e.keysB),i=(e.dupA+e.dupB)*(t.keysA+t.keysB);return n<i||n===i&&t.keysBoth>e.keysBoth}var en=t=>t==null||typeof t=="string"&&t.trim()==="";function Wr(t,e,n){if(t===e)return!0;let i=en(t),r=en(e);return i||r?i&&r:typeof t=="number"&&typeof e=="number"?!1:t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():n(t).trim()===n(e).trim()}function tn(t){let{rows:e,columns:n}=t,i=e.length;if(i<2||i>Ir)return null;let r=n.map((y,_)=>({c:y,i:_})).filter(({c:y})=>!y.isMeasure&&!y.isTemporal&&!y.isDatePart&&y.distinct>=Nr).sort((y,_)=>(_.c.identifierNamed?1:0)-(y.c.identifierNamed?1:0)||_.c.distinct-y.c.distinct||y.i-_.i).slice(0,Rr),s=n.map((y,_)=>({c:y,i:_})).filter(({c:y})=>!y.isMeasure&&y.values!==null&&y.values.size===2).slice(0,Er);if(r.length===0||s.length===0)return null;let o=s.map(({c:y,i:_})=>Or(t,_,y)),l=null;for(let{i:y}of r){let _=Lr(t,y);for(let w=0;w<s.length;w++){if(s[w].i===y)continue;let W=Fr(_.ids,o[w].code,_.dict.size);W.keysBoth<1||(!l||zr(W,l.tally))&&(l={tally:W,keyIdx:y,setNo:w,ids:_.ids,dict:_.dict})}}if(!l)return null;let{ids:a,dict:c,tally:d}=l,g=o[l.setNo],m=s[l.setNo].i,b=c.size,M=new Int32Array(b).fill(-1),A=new Int32Array(b).fill(-1);for(let y=0;y<i;y++){let _=g.code[y],w=a[y];_===0||w<0||(_===1?M[w]<0&&(M[w]=y):A[w]<0&&(A[w]=y))}let S=[];for(let y=0;y<n.length;y++)y!==l.keyIdx&&y!==m&&S.push(y);let p=0;for(let y=0;y<b;y++){let _=M[y],w=A[y];if(_<0||w<0)continue;let W=e[_],z=e[w],X=!0;for(let Q of S)if(!Wr(W[Q],z[Q],t.text)){X=!1;break}X&&p++}let h=p===d.keysBoth?100:p===0?0:Math.min(99,Math.max(1,Math.round(p/d.keysBoth*100))),x=new Map,f=new Map;for(let[y,_]of c){let w=M[_]>=0,W=A[_]>=0;if(!w&&!W)continue;let z=ut(y);ct(z)&&(w&&x.set(z,(x.get(z)??0)+1),W&&f.set(z,(f.get(z)??0)+1))}let C=y=>{let _=0;for(let w of y.values())w>=2&&(_+=w);return _};return{key:l.keyIdx,discriminator:m,pairing:{form:"long",key:n[l.keyIdx].name,discriminator:n[m].name,keysA:d.keysA,keysB:d.keysB,keysBoth:d.keysBoth,duplicateKeysA:d.dupA,duplicateKeysB:d.dupB,identicalPct:h,discriminatorBlankRows:g.blankRows,looseCollisionsA:C(x),looseCollisionsB:C(f),setOrder:g.setOrder}}}var $r=t=>t==="Integer"||t==="Decimal";function Br(t){let e=[],n=[];return t.forEach((i,r)=>{if(i.twoValues){if(i.isBinaryFlag){e.push(r);return}i.isMeasure||i.isTemporal||i.isDatePart||i.identifierNamed||n.push(r)}}),[...e,...n].slice(0,6)}function Gr(t,e){let n=[];for(let i=0;i<t.length&&n.length<12;i++){let r=t[i];e.has(i)||!$r(r.dataType)||r.isTemporal||r.isDatePart||r.identifierNamed||r.distinct<3||n.push(i)}return n}function nn(t){let e=new Map,{rows:n,columns:i,text:r}=t;if(n.length===0||n.length>(t.maxRows??5e5))return e;let s=Br(i);if(s.length===0)return e;let o=Gr(i,new Set(s));if(o.length===0)return e;let l=s.map(a=>{let[c,d]=i[a].twoValues,g=new Uint8Array(n.length);for(let m=0;m<n.length;m++){let b=r(n[m][a]);g[m]=b===c?1:b===d?2:0}return g});for(let a of o){let c=new Float64Array(n.length),d=0;for(let h=0;h<n.length;h++){let x=n[h][a],f=x==null||x===""?NaN:typeof x=="number"?x:parseFloat(x);c[h]=f,f===f&&f!==1/0&&f!==-1/0&&d++}if(d<2)continue;let g=new Float64Array(d);for(let h=0,x=0;h<n.length;h++){let f=c[h];f===f&&f!==1/0&&f!==-1/0&&(g[x++]=f)}g.sort();let m=new Float64Array(d),b=0;for(let h=0;h<d;h++)(h===0||g[h]!==g[h-1])&&(m[b++]=g[h]);let M=new Int32Array(n.length).fill(-1);for(let h=0;h<n.length;h++){let x=c[h];if(!(x===x&&x!==1/0&&x!==-1/0))continue;let f=0,C=b-1;for(;f<C;){let y=f+C>>>1;m[y]<x?f=y+1:C=y}M[h]=f}let A=[],S=new Int32Array(b),p=new Int32Array(b);for(let h=0;h<s.length;h++){let x=l[h];S.fill(0),p.fill(0);let f=0,C=0;for(let U=0;U<n.length;U++){let u=M[U];u<0||(x[U]===1?(S[u]++,f++):x[U]===2&&(p[u]++,C++))}if(f===0||C===0)continue;let y=f<=C,_=y?f:C,w=y?C:f,W=y?S:p,z=y?p:S,X=0,Q=0,le=0;for(let U=0;U<b;U++){let u=W[U],T=z[U];X+=u*(Q+.5*T),Q+=T,u+T>=2&&(le+=u+T)}A.push({outcome:i[s[h]].name,aucMinorityHigh:Math.round(X/(_*w)*1e4)/1e4,nMinority:_,nMajority:w,ties:le})}A.length>0&&e.set(a,A)}return e}var Kr=12,Vr=100,Ur=.3,Hr=.9,Yr=120,jr=1900,Xr=2100,Zr=0,qr=20,Qr=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function Re(t){if(!t)return!1;let e=J(t);return e.length===0?!1:Qr.has(e[e.length-1])?!0:Kt(t)!==null}var Jr=new Set(["year","yr","fy"]),ei=t=>J(t).some(e=>Jr.has(e))||lt(t)!==null,ti=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function Ye(t){if(!Number.isInteger(t)||t<190001||t>210012)return!1;let e=t%100;return e>=1&&e<=12}function je(t){if(!Number.isInteger(t)||t<19000101||t>21001231)return!1;let e=Math.floor(t/100)%100,n=t%100;return e>=1&&e<=12&&n>=1&&n<=31}var ni=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,ri=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,ii=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function an(t,e){let n=[],i=0,r=si(t,e,n,()=>{i++});if(r)return r;if(i>0||n.length<2)return null;let s=vt(n,{locale:e,floor:.8});return!s||!s.pattern||s.form==="named"?null:{pattern:s.pattern,orderFrom:s.orderFrom==="shape"?s.order==="ymd"?"iso":"shape":s.orderFrom}}function si(t,e,n,i){let r=0,s=0,o=0,l=0,a=0,c="",d=0,g="",m=0,b=0,M=0,A=0,S=!1;for(let y of t){if(y==null)continue;let _=String(y).trim();if(_==="")continue;r++,n.push(_);let w;if(w=ni.exec(_)){i();let W=+w[2],z=+w[3];W>=1&&W<=12&&z>=1&&z<=31&&(s++,w[4]!==void 0&&o++,w[6]!==void 0&&l++)}else if(w=ri.exec(_)){i();let W=+w[3],z=+w[4];W>=1&&W<=12&&z>=1&&z<=31&&(c&&c!==w[2]&&(S=!0),c=w[2],a++)}else if(w=ii.exec(_)){i();let W=+w[1],z=+w[3];W>=1&&W<=31&&z>=1&&z<=31&&(W<=12||z<=12)&&(g&&g!==w[2]&&(S=!0),g=w[2],d++,W>12&&M++,z>12&&A++,w[5]!==void 0&&m++,w[7]!==void 0&&b++)}if(r>=200)break}if(r<2||(s+a+d)/r<.8||(s>0?1:0)+(a>0?1:0)+(d>0?1:0)!==1||S)return null;if(s>0)return o===s?{pattern:l===s?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(a>0)return{pattern:`%Y${c}%m${c}%d`,orderFrom:"iso"};if(M>0&&A>0)return null;let x,f;M>0?(x=!0,f="values"):A>0?(x=!1,f="values"):g==="."?(x=!0,f="shape"):(x=!ze(e),f="locale");let C=x?`%d${g}%m${g}%Y`:`%m${g}%d${g}%Y`;return m===d?{pattern:C+(b===d?" %H:%M:%S":" %H:%M"),orderFrom:f}:{pattern:C,orderFrom:f}}function oi(t,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(t))return!1;let n=t.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!n)return!1;let i=ee(n);return i.length>0&&e[i]!==void 0}function ai(t,e){let n=new Map,i=new Map;for(let l of t){let a=ne(l);if(!a||"month"in a)continue;let c=ie(a.word),d=c.some(m=>m.lang==="en"),g=ee(a.word);for(let m of new Set(c.map(b=>b.lang)))m!=="en"&&(n.has(m)||(n.set(m,new Set),i.set(m,new Set)),n.get(m).add(g),d||i.get(m).add(g))}let r=[...n.keys()].filter(l=>n.get(l).size>=3&&i.get(l).size>=1),s=0,o=new Map(r.map(l=>[l,0]));for(let l of e){let a=ne(l);if(!a)continue;if("month"in a){s++;continue}let c=ie(a.word);if(c.length===0)continue;let d=c.some(g=>g.lang==="en");for(let g of r)(d||c.some(m=>m.lang===g))&&o.set(g,o.get(g)+1)}return s+Math.max(0,...o.values())}var li=/(?:19|20)[0-9]{2}/;function ui(t){let e=new Map,n=0;for(let r of t){if(!li.test(ce(r)))continue;let s=new Set(ge(r).filter(o=>o.yearDigits===4&&(o.grain==="quarter"||o.grain==="week")).map(o=>o.lang));if(s.size!==0){if(s.has("en")){n++;continue}for(let o of s)e.set(o,(e.get(o)??0)+1)}}let i=0;for(let r of e.values())i=Math.max(i,r);return i>0?i+n:0}function ci(t){let{dataType:e,name:n,isMeasure:i,distinctCount:r}=t;if(e==="DateTime")return!0;if(i)return!1;if(e==="Integer"||e==="Decimal"){let s=t.minNum,o=t.maxNum;if(!(s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&Number.isInteger(s)&&Number.isInteger(o)&&o>=s))return!1;let a=s>=1900&&o<=2100;if(a&&r>=2&&ei(n)||a&&r>=3&&r===o-s+1)return!0;let c=Ye(s)&&Ye(o),d=je(s)&&je(o);if(c||d){if(!t.sampleValues)return!0;let g=0,m=0;for(let b of t.sampleValues){if(b==null||b==="")continue;g++;let M=Number(String(b).trim());if(Number.isFinite(M)&&(c?Ye(M):je(M))&&m++,g>=60)break}if(g>=2&&m===g)return!0}return!1}if(t.sampleValues){let s=t.locale?Se(t.locale):null,o=0,l=0,a=[],c=[];for(let d of t.sampleValues){if(d==null||d==="")continue;o++;let g=String(d).trim();if(a.push(g),ti.test(g)||oi(g,s)?l++:c.push(g),o>=60)break}if(o>=2&&l/o>=.8||o>=2&&(l+ui(c)+ai(a,c))/o>=.8||an(a,t.locale)!==null)return!0}return!1}function di(t){let e=q((t||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":Dt(t)}function mi(t){let{rows:e,measureColIdx:n,measureName:i,candidateDims:r,minNum:s,maxNum:o,discourageAgg:l}=t,a=100,c=.01,d="";for(let m of r){if(m.distinct<2||m.distinct>a)continue;let b=r.filter(h=>h.idx!==m.idx).map(h=>h.idx),M=new Map;for(let h of e){let x=h[n];if(typeof x!="number"||!Number.isFinite(x))continue;let f=b.length?b.map(y=>String(h[y])).join(d):"",C=M.get(f);C||(C={sum:0,cset:new Set},M.set(f,C)),C.sum+=x,C.cset.add(String(h[m.idx]))}let A=0,S=0,p=0;for(let h of M.values())h.cset.size<2||(p++,Math.abs(h.sum-100)<=100*c?A++:Math.abs(h.sum-1)<=1*c&&S++);if(p>=2&&(A/p>=.9||S/p>=.9))return{additivity:"part_of_whole",partOfWholeDim:m.name}}if(l)return{additivity:"intensive_rate"};let g=di(i);return g==="avg"||g==="min"||g==="max"?{additivity:"intensive_rate"}:g==="count"?{additivity:"additive"}:g==="sum"?{additivity:"unknown"}:s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&s>=0&&o<=1.0001&&o>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function ln(t){let{dataType:e,isMeasure:n,name:i,distinct:r,nonblank:s,prec:o,maxval:l,minval:a}=t,c=l-a+1,d=c>0?r/c:1,g=s>0?r/s:0,m=e==="Decimal"||o>0;return!n&&Re(i)?"Categorical":d>=Hr&&(dt(i)&&r<=Yr||a>=jr&&l<=Xr||a>=Zr&&l<=qr)?"Ordinal":n||r>Kr&&(m||r>=Vr||g>=Ur)?"Continuous":"Categorical"}function sn(t,e,n){return!t||t.isMeasure||e||t.dataType!=="Integer"&&t.dataType!=="Decimal"?!1:ln({dataType:t.dataType,isMeasure:!1,name:t.name,distinct:n.distinct,nonblank:n.nonblank,prec:n.prec,maxval:typeof n.maxval=="number"?n.maxval:0,minval:typeof n.minval=="number"?n.minval:0})==="Continuous"}function fi(t){let e=null;for(let n=0;n<t.length;n++){let i=t[n];if(typeof i!="string"||i.length===0)continue;let r=i.trim();r.length!==i.length&&(e||(e=t.slice()),e[n]=r)}return e||t}var on=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;_declaredDimensions=new WeakSet;_inferredMeasureFlags=null;dedupRows=!0;emitLegacyAggAliases=!1;deriveProvinces=!0;dateCellsAreLocalWallClock=!1;wallClockColumnIndexes(){let e=new Set;if(!this.dateCellsAreLocalWallClock||!this._cols)return e;for(let n=0;n<this._cols.length;n++){let i=this._cols[n];!i||!/date|time/i.test(String(i.dataType??""))||ot(this._rows.map(r=>r[n]))&&e.add(n)}return e}STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let i=e.toString().split(".")[1];return i?i.length:0}getColumns(){return this._cols}inferredMeasureFlags(){if(this._inferredMeasureFlags)return this._inferredMeasureFlags;let e=this._cols.map(n=>!!(n&&n.isMeasure));return this._cols.forEach((n,i)=>{if(!n||n.isMeasure||this._declaredDimensions.has(n)||n.dataType!=="Integer"&&n.dataType!=="Decimal")return;let r=new Set,s=0,o=0,l=null,a=null;for(let c of this._rows){let d=c[i],g=this.STR(d);if(g!=""&&(r.add(g),s++,(l===null||d<l)&&(l=d),(a===null||d>a)&&(a=d),n.dataType=="Decimal")){let m=this.getPrecision(d);m>o&&(o=m)}}e[i]=sn(n,!1,{distinct:r.size,nonblank:s,prec:o,minval:l,maxval:a})}),Object.freeze(e),this._inferredMeasureFlags=e,e}declareDimensions(e){this._inferredMeasureFlags=null;for(let n of e)n&&this._declaredDimensions.add(n)}wholeDayIso(e){return st(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,n){if(this._computedStatsForLevel==e)return this._cols;let i=0,r=parseInt(e),s=this.wallClockColumnIndexes(),o=[],l=[],a=[];for(let u of this._cols){let T=new Map,P=[],D=0,v=0,k=0,F=null,O=null,N=null,G=!1,K=!0,R=!0,E=null,V=!1,L=s.has(i);for(let I of this._rows){let $=I[i],B=L&&$ instanceof Date?fe($):$,H=this.STR(B);if(H!=""){if(D+=H.length,T.set(H,(T.get(H)||0)+1),v++,u.dataType=="Integer"||u.dataType=="Decimal"||u.dataType=="DateTime")if((F===null||B<F)&&(F=B),(O===null||B>O)&&(O=B),u.dataType=="Integer"||u.dataType=="Decimal"){if(N===null?N=B:N+=B,u.dataType=="Decimal"){let Z=this.getPrecision(B);Z>k&&(k=Z)}P.push(B)}else G=G||this.hasTimeComponent(B);V&&(B<E?K=!1:B>E&&(R=!1)),E=B,V=!0}}if(v>=3&&(K&&!R?u.sortedDirection="asc":R&&!K?u.sortedDirection="desc":u.sortedDirection="none"),v>0&&T.size>0&&!u.isMeasure){let I=0,$=Number.MAX_SAFE_INTEGER;for(let B of T.values())B>I&&(I=B),B<$&&($=B);if(u.modalShare=I/v,u.minGroupCount=$===Number.MAX_SAFE_INTEGER?null:$,T.size===2){let B=[...T.keys()].map(ue=>nt(ue).trim().toLowerCase()).sort(),Z=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(ue=>B[0]===ue[0]&&B[1]===ue[1]),un=/^(is|has)[_\p{L}\p{N}]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/iu.test(u.name);(Z||un)&&(u.isBinaryFlag=!0)}}else u.isMeasure&&(u.dataType==="Integer"||u.dataType==="Decimal")&&T.size===2&&T.has("0")&&T.has("1")&&(u.isBinaryFlag=!0);if(u.dataType=="DateTime"&&(u.dateWithTime=G,G&&at(L?this._rows.map(I=>I[i]instanceof Date?fe(I[i]):I[i]):this._rows.map(I=>I[i]))?u.timeOfDayOnly=!0:delete u.timeOfDayOnly),u.isTemporal=ci({dataType:u.dataType,name:u.name,isMeasure:u.isMeasure,distinctCount:T.size,minNum:typeof F=="number"?F:null,maxNum:typeof O=="number"?O:null,sampleValues:T.keys(),locale:n}),u.isTemporal&&u.dataType==="String"&&!u.isMeasure){let I=an(T.keys(),n);I&&(u.temporalTextPattern=I.pattern)}if(u.timeOfDayOnly)delete u.temporalCadence;else if(u.isTemporal&&!u.isMeasure){let I=Xt(T.keys(),{includeBounds:r>=20,pattern:u.temporalTextPattern,locale:n});I&&(u.temporalCadence=I)}this.updateColumnStats10(r,u,v,T,k,O,F),this.updateColumnStats20(r,P,v,N,u,D,G,F,O,k,T,n),sn(u,this._declaredDimensions.has(u),{distinct:T.size,nonblank:v,prec:k,minval:F,maxval:O})&&(u.isMeasure=!0,u.geoKind=void 0,u.geoMatchPct=void 0,u.geoAmbiguous=void 0,u.dominantGeoRegion=void 0,u.dominantGeoRegionPct=void 0,u.geoRegionCount=void 0),o[i]=u.isMeasure||T.size>2e3?null:new Set(T.keys()),l[i]=T.size,a[i]=T.size===2?[...T.keys()].sort():null,i++}wt(this._cols,this._rows,{cities:this.deriveProvinces}).forEach((u,T)=>{let P=this._cols[T];u.kind&&(P.geoKind=u.kind,P.geoMatchPct=u.matchPct,u.ambiguous&&(P.geoAmbiguous=!0)),u.rollupPct!==void 0&&(P.admin1RollupPct=u.rollupPct),u.regionCount!==void 0&&(P.admin1RegionCount=u.regionCount),u.countryCount!==void 0&&(P.admin1CountryCount=u.countryCount),u.dominantRegion&&(P.dominantGeoRegion=u.dominantRegion,P.dominantGeoRegionPct=u.dominantRegionPct)});let c=this.getGeoExtent();if(c&&c.dominantFrame&&this._geoExtentLatIdx>=0){let u=this._cols[this._geoExtentLatIdx];u.geoKind||(u.dominantGeoRegion=c.dominantFrame,u.dominantGeoRegionPct=c.dominantFramePct,this.deriveProvinces&&(u.admin1RollupPct=c.dominantFramePct))}let d=[];this._cols.forEach((u,T)=>{u.isMeasure||d.push({idx:T,distinct:u.distinctCount??0,name:u.name})}),this._cols.forEach((u,T)=>{if(!u.isMeasure)return;let P=typeof u.lowValue=="number"?u.lowValue:null,D=typeof u.highValue=="number"?u.highValue:null,v=mi({rows:this._rows,measureColIdx:T,measureName:u.name,candidateDims:d,minNum:P,maxNum:D,discourageAgg:!!u.discourageAggregationAcrossGroups});u.additivity=v.additivity,v.partOfWholeDim&&(u.partOfWholeDim=v.partOfWholeDim)});let g=50,m=4,b=d.filter(u=>u.distinct>=2&&u.distinct<=g);this._cols.forEach((u,T)=>{if(!u.isMeasure)return;let P=[];for(let R of this._rows){let E=R[T];if(E==null||E==="")continue;let V=typeof E=="number"?E:parseFloat(E);isNaN(V)||P.push(V)}if(P.length===0)return;let D=[...P].sort((R,E)=>R-E);if(D[0]===D[D.length-1])u.relativeDispersion=0;else if(D.length>=m){let R=me(D,.5),E=me(D,.1),V=me(D,.9);u.relativeDispersion=Math.abs(R)>1e-9?Math.round((V-E)/Math.abs(R)*1e3)/1e3:void 0}else u.relativeDispersion=void 0;let v=[];for(let R of b){let E=new Set;for(let V of this._rows){let L=V[T];L==null||L===""||E.add(this.STR(V[R.idx])+"")}v.push({otherColumn:R.name,nonBlankGroupCount:E.size})}v.length>0&&(u.nonBlankGroups=v);let k=0;for(let R of P)k+=R;k/=P.length;let F=0;for(let R of P)F+=(R-k)*(R-k);if(F<=1e-12)return;let O=[],N=[],G=R=>{if(R.length<4)return NaN;let E=[...R].sort((L,I)=>L-I),V=L=>E[Math.min(E.length-1,Math.max(0,Math.floor(L*(E.length-1))))];return V(.75)-V(.25)},K=G(P);for(let R of b){let E=new Map;for(let I of this._rows){let $=I[T];if($==null||$==="")continue;let B=typeof $=="number"?$:parseFloat($);if(isNaN(B))continue;let H=this.STR(I[R.idx])+"",Z=E.get(H);Z?(Z.s+=B,Z.n++,Z.vals.push(B)):E.set(H,{s:B,n:1,vals:[B]})}let V=0;for(let I of E.values()){let $=I.s/I.n;V+=I.n*($-k)*($-k)}O.push({otherColumn:R.name,eta2:Math.round(V/F*1e4)/1e4});let L=[];for(let I of E.values()){let $=G(I.vals);isNaN($)||L.push($)}if(L.length>=2&&isFinite(K)&&K>1e-9){let I=(Math.max(...L)-Math.min(...L))/K;N.push({otherColumn:R.name,spreadRatio:Math.round(I*1e4)/1e4})}}O.length>0&&(u.groupDiscrimination=O),N.length>0&&(u.spreadDiscrimination=N)});let M=.97,A=.8,S=8,p=5,h=this._cols.map((u,T)=>({c:u,i:T})).filter(u=>u.c.isMeasure);for(let u=0;u<h.length;u++)for(let T=u+1;T<h.length;T++){let P=h[u].i,D=h[T].i,v=0,k=0,F=0,O=0,N=0,G=0;for(let L of this._rows){let I=L[P],$=L[D];if(I==null||I===""||$===null||$===void 0||$==="")continue;let B=typeof I=="number"?I:parseFloat(I),H=typeof $=="number"?$:parseFloat($);isNaN(B)||isNaN(H)||(v++,k+=B,F+=H,O+=B*B,N+=H*H,G+=B*H)}if(v<p)continue;let K=v*O-k*k,R=v*N-F*F;if(K<=1e-12||R<=1e-12)continue;let E=(v*G-k*F)/Math.sqrt(K*R),V=Math.min(1,Math.round(Math.abs(E)*1e3)/1e3);for(let L of[h[u].c,h[T].c])(L.maxAbsMeasureCorrelation===void 0||V>L.maxAbsMeasureCorrelation)&&(L.maxAbsMeasureCorrelation=V);if(Math.abs(E)>=M){let L=h[u].c,I=h[T].c;L.collinearWithMeasures||(L.collinearWithMeasures=[]),I.collinearWithMeasures||(I.collinearWithMeasures=[]),L.collinearWithMeasures.push(I.name),I.collinearWithMeasures.push(L.name)}else if(Math.abs(E)>=A){let L=h[u].c,I=h[T].c,$=Math.round(E*1e3)/1e3;L.correlatedWithMeasures||(L.correlatedWithMeasures=[]),I.correlatedWithMeasures||(I.correlatedWithMeasures=[]),L.correlatedWithMeasures.push({otherColumn:I.name,r:$}),I.correlatedWithMeasures.push({otherColumn:L.name,r:$})}}for(let{c:u}of h)u.correlatedWithMeasures&&(u.correlatedWithMeasures.sort((T,P)=>Math.abs(P.r)-Math.abs(T.r)||(T.otherColumn<P.otherColumn?-1:1)),u.correlatedWithMeasures.length=Math.min(u.correlatedWithMeasures.length,S));for(let u=0;u<this._cols.length;u++){let T=o[u];if(!T||T.size===0)continue;let P=[];for(let D=0;D<this._cols.length;D++){if(D===u)continue;let v=o[D];if(!v||v.size===0)continue;let k=0;for(let O of T)v.has(O)&&k++;let F=Math.round(k/T.size*100);F>0&&P.push({otherColumn:this._cols[D].name,percentShared:F})}P.length>0&&(this._cols[u].sharedValueRatioWithOthers=P)}let x=50,f=[];for(let u=0;u<this._cols.length;u++){let T=o[u];T&&T.size>=2&&T.size<=x&&f.push(u)}if(f.length>=2){let u=new Map,T=(D,v)=>D+":"+v;for(let D=0;D<f.length;D++)for(let v=D+1;v<f.length;v++)u.set(T(f[D],f[v]),new Map);for(let D of this._rows)for(let v=0;v<f.length;v++){let k=this.STR(D[f[v]])+"";for(let F=v+1;F<f.length;F++){let O=""+this.STR(D[f[F]]),N=u.get(T(f[v],f[F])),G=k+""+O;N.set(G,(N.get(G)??0)+1)}}let P=new Map;for(let D=0;D<f.length;D++)for(let v=D+1;v<f.length;v++){let k=f[D],F=f[v],O=o[k].size,N=o[F].size,G=u.get(T(k,F)),K=G.size,R=0;for(let I of G.values())(R===0||I<R)&&(R=I);let E=Math.round(K/(O*N)*100),V=K===O,L=K===N;if((this._cols[k].categoricalPairStats||=[]).push({otherColumn:this._cols[F].name,fillPct:E,determinesOther:V,minCellCount:R,distinctCombinations:K}),(this._cols[F].categoricalPairStats||=[]).push({otherColumn:this._cols[k].name,fillPct:E,determinesOther:L,minCellCount:R,distinctCombinations:K}),V&&O>N){let I=P.get(k);(!I||N<I.card)&&P.set(k,{name:this._cols[F].name,card:N,ratio:N/O})}if(L&&N>O){let I=P.get(F);(!I||O<I.card)&&P.set(F,{name:this._cols[k].name,card:O,ratio:O/N})}}for(let[D,v]of P)this._cols[D].primaryParentColumn=v.name,this._cols[D].nestingRatio=Math.round(v.ratio*100)/100}let C=6,y=this._rows.length;for(let u=0;u<this._cols.length;u++){let T=this._cols[u];if(T.isMeasure||T.primaryParentColumn)continue;let P=T.distinctCount??0;if(P<=x||y>0&&P>=y)continue;let D=[];for(let v=0;v<this._cols.length;v++){if(v===u)continue;let k=this._cols[v];if(k.isMeasure)continue;let F=k.distinctCount??0;F<2||F>=P||D.push(v)}D.sort((v,k)=>(this._cols[v].distinctCount??0)-(this._cols[k].distinctCount??0));for(let v of D.slice(0,C)){let k=new Map,F=!0;for(let N of this._rows){let G=this.STR(N[u])+"",K=this.STR(N[v])+"",R=k.get(G);if(R===void 0)k.set(G,K);else if(R!==K){F=!1;break}}if(!F)continue;let O=this._cols[v].distinctCount??0;T.primaryParentColumn=this._cols[v].name,T.nestingRatio=Math.round(O/P*100)/100;break}}let _=.01,w=.05,W=.95,z=8,X=8,Q=6,le=500,U=[];for(let u=0;u<this._cols.length&&U.length<X;u++){let T=this._cols[u].dataType;(T==="Double"||T==="Integer"||T==="Decimal")&&U.push(u)}if(U.length>=3&&this._rows.length>=z){let u=Math.min(this._rows.length,le),T=U.map(O=>{let N=[];for(let R=0;R<u;R++){let E=this._rows[R][O],V=typeof E=="number"?E:parseFloat(String(E).replace(/,/g,""));if(E==null||E===""||!isFinite(V))return null;N.push(V)}let G=N[0],K=!1;for(let R of N)if(R!==G){K=!0;break}return K?N:null}),P=U.map((O,N)=>N).filter(O=>T[O]!==null),D=O=>{let N=O.slice().sort((K,R)=>K-R),G=N.length>>1;return N.length%2?N[G]:(N[G-1]+N[G])/2},v=null,k=[],F=O=>{if(k.length>=3){let N=k.map(E=>T[E]),G=N[0].length,K=new Array(G);for(let E=0;E<G;E++){let V=0;for(let L of N)V+=L[E];K[E]=V}let R=D(K);if(R>0){let E=0;for(let L of K)Math.abs(L-R)<=R*_&&E++;let V=E/G;if(V>=W){let L=1;for(let I of N){let $=D(I)/R;$<L&&(L=$)}L>=w&&(!v||k.length>v.cols.length)&&(v={cols:k.slice(),total:R,matched:V})}}}if(!(k.length>=Q))for(let N=O;N<P.length;N++)k.push(P[N]),F(N+1),k.pop()};if(F(0),v){let O=v,G={columns:O.cols.map(K=>this._cols[U[K]].name),total:Math.round(O.total*1e3)/1e3,matchedPct:Math.round(O.matched*100)/100};for(let K of O.cols)this._cols[U[K]].constantSumGroup=G}}return this.applyTwoSetPairing(n,o),this.applyScoreSeparation(l,a),this.applySeriesCompleteness(r,n,o),this.applyMeasurePersistence(n,o),this._computedStatsForLevel=e,this._cols}applyTwoSetPairing(e,n){for(let r of this._cols)r.twoSetPairing!==void 0&&delete r.twoSetPairing;let i=tn({rows:this._rows,columns:this._cols.map((r,s)=>{let o=n[s];return{name:r.name,values:o,distinct:o?o.size:r.distinctCount??0,isMeasure:!!r.isMeasure,isTemporal:!!r.isTemporal,isDatePart:!!r.isDatePart,identifierNamed:Re(r.name),temporalTextPattern:r.temporalTextPattern}}),text:r=>this.STR(r),locale:e});i&&(this._cols[i.key].twoSetPairing=i.pairing,this._cols[i.discriminator].twoSetPairing=i.pairing)}applyScoreSeparation(e,n){for(let r of this._cols)r.scoreSeparation!==void 0&&delete r.scoreSeparation;let i=nn({rows:this._rows,columns:this._cols.map((r,s)=>({name:r.name,dataType:r.dataType,isMeasure:!!r.isMeasure,isTemporal:!!r.isTemporal,isDatePart:!!r.isDatePart,identifierNamed:Re(r.name),isBinaryFlag:!!r.isBinaryFlag,distinct:e[s]??0,twoValues:n[s]??null})),text:r=>this.STR(r)});for(let[r,s]of i)this._cols[r].scoreSeparation=s}applySeriesCompleteness(e,n,i){for(let c of this._cols)c.seriesCompleteness!==void 0&&delete c.seriesCompleteness;let r=this._cols.map((c,d)=>({c,i:d})).filter(({c})=>c.isTemporal&&!c.isMeasure&&c.temporalCadence&&c.temporalCadence.grain!=="irregular");if(r.length===0)return;let s=this.seriesKeyIndex(n,i);if(s<0)return;let o=this._cols[s],l=this._rows.map(c=>this.STR(c[s])),a=e>=20&&(o.dataType!=="String"||Array.isArray(o.safeDistinctValues));for(let{c,i:d}of r){let g=Jt({periods:this._rows.map(m=>this.STR(m[d])),series:l,seriesColumn:o.name,pattern:c.temporalTextPattern,locale:n,includeDates:e>=20,includeNames:a});g&&(c.seriesCompleteness=g)}}seriesKeyIndex(e,n){let i=[],r=[];this._cols.forEach((o,l)=>{let a=n[l];a&&(i.push(l),r.push({name:o.name,dataType:o.dataType,isMeasure:!!o.isMeasure,isTemporal:!!o.isTemporal,isDatePart:!!o.isDatePart,isReassembledDate:!!o.isReassembledDate,isBinaryFlag:!!o.isBinaryFlag,geoKind:o.geoKind,identifierNamed:Re(o.name),values:a,rows:this._rows.length,locale:e}))});let s=Qt(r);return s<0?-1:i[s]}applyMeasurePersistence(e,n){for(let a of this._cols)a.persistence!==void 0&&delete a.persistence;let i=[];if(this._cols.forEach((a,c)=>{a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal"||a.dataType==="Double")&&i.push(c)}),i.length===0||this._rows.length<Ie)return;let r=-1,s=[];for(let a=0;a<this._cols.length&&r<0;a++){let c=this._cols[a];if(!c.isTemporal||c.isMeasure||c.isDatePart)continue;let d=this._rows.map(g=>j(this.STR(g[a]),c.temporalTextPattern,e)?.ms??null);new Set(d.filter(g=>g!==null)).size<Ie||(r=a,s=d)}if(r<0)return;let o=this.seriesKeyIndex(e,n),l=o>=0?this._rows.map(a=>this.STR(a[o])):void 0;for(let a of i){let c=this._rows.map(g=>{let m=g[a];if(m==null||m==="")return null;let b=typeof m=="number"?m:parseFloat(String(m).replace(/,/g,""));return Number.isFinite(b)?b:null}),d=Ve({stamps:s,series:l,values:c});d&&(this._cols[a].persistence={timeColumn:this._cols[r].name,...o>=0?{seriesColumn:this._cols[o].name}:{},...d})}}updateColumnStats20(e,n,i,r,s,o,l,a,c,d,g,m){if(e>=20){let b=[...n].sort((S,p)=>S-p),M=Math.floor(b.length/2);if(i>0&&r!=null?s.avgValue=s.dataType=="Integer"?Math.round(r/i):r/i:s.avgValue=null,i>0&&(s.avgLength=o/i),this._rows.length>0){let S=p=>{let h=p instanceof Date?p:typeof p=="string"?Ne(p)??new Date(p):new Date(p),x=this.wholeDayIso(h);return x?x+"T00:00:00.000Z":isNaN(h.getTime())?p:h.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!a?s.lowValue=a:s.lowValue=S(a),s.dataType!="DateTime"||l||!c?s.highValue=c:s.highValue=S(c),s.medianValue=b.length===0?null:b.length%2===0?s.dataType=="Integer"?Math.round((b[M-1]+b[M])/2):(b[M-1]+b[M])/2:b[M],s.numericPrecision=d}if(b.length>0){let S=s.avgValue??0,p=b.length,h=0,x=0;for(let y of b){let _=y-S;h+=_*_,x+=_*_*_}let f=h/p,C=Math.sqrt(f);s.skewness=f===0?0:x/p/(C*C*C),s.stdDev=Math.sqrt(f)}r!==null&&(s.sum=r);let A=Array.from(g.entries()).sort((S,p)=>p[1]-S[1]);if(s.topCategories=A.slice(0,10).map(S=>S[1]),!s.isMeasure&&A.length>0&&(s.dataType!=="String"&&(s.topCategoryValues=A.slice(0,5).map(S=>S[0])),e>=20)){let S=A.map(h=>h[0]),p=pe(S,m);if(p!==null)s.ordinalPattern=p.pattern,s.orderedDomain=p.orderedDomain;else if(s.dataType==="String"){let h=mt(S);h!==null&&(s.safeDistinctValues=h)}}if(b.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let S=p=>b[Math.floor((b.length-1)*p)];s.quantiles={p05:S(.05),p25:S(.25),p75:S(.75),p95:S(.95)}}}if(!s.isMeasure&&s.dataType==="String"&&g.size>0){let b=Array.from(g.entries()).sort((S,p)=>p[1]-S[1]).map(S=>S[0]);s.formatSignature=be(b);let M=i>0?o/i:void 0,A=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!A.test(s.formatSignature)&&(M===void 0||M>=3)&&(s.isFreeText=!0)}if(!s.isMeasure&&g.size>0){let b=Array.from(g.entries()).sort((A,S)=>S[1]-A[1]),M=St(b.map(A=>A[0]),s.name,m);if(M!==null&&(s.geoKind=M.geoKind,s.geoMatchPct=M.geoMatchPct,M.geoAmbiguous&&(s.geoAmbiguous=!0),M.geoKind.indexOf("country")===0)){let A=pt(b);A&&(s.dominantGeoRegion=A.dominantGeoRegion,s.dominantGeoRegionPct=A.dominantGeoRegionPct,s.geoRegionCount=A.regionCount,A.middleEastPct>0&&(s.middleEastPct=A.middleEastPct))}}}updateColumnStats10(e,n,i,r,s,o,l){let a=this._rows.length-i;e>=10&&(n.blankCount=a),n.distinctCount=r.size+(a!=0?1:0),n.valueNature="Categorical",i>0&&(n.dataType==="Integer"||n.dataType==="Decimal"?n.valueNature=ln({dataType:n.dataType,isMeasure:!!n.isMeasure,name:n.name,distinct:r.size,nonblank:i,prec:s,maxval:o,minval:l}):n.dataType==="DateTime"&&(n.valueNature=n.dateWithTime?"Continuous":"Ordinal"))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((i,r)=>{i.isMeasure||e.push(r)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let n=new Set;for(let i of this._rows)n.add(JSON.stringify(e.map(r=>i[r])));return this._leafCardinality=n.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=o=>Ze(o,{camel:!0}),n=-1,i=-1,r=-1;if(this._cols.forEach((o,l)=>{let a=e(o.name),c=o.dataType==="Integer"||o.dataType==="Decimal";c&&n<0&&a.some(d=>d==="lat"||d==="latitude")?n=l:c&&i<0&&a.some(d=>d==="lon"||d==="lng"||d==="long"||d==="longitude")&&(i=l),r<0&&!o.isMeasure&&typeof o.geoKind=="string"&&o.geoKind.indexOf("country")===0&&(r=l)}),n<0||i<0)return null;this._geoExtentLatIdx=n;let s=[];for(let o of this._rows){let l=o[n],a=o[i],c=l==null||l===""?null:Number(l),d=a==null||a===""?null:Number(a);s.push({lat:c,lon:d,country:r>=0&&he(this.STR(o[r]))?this.STR(o[r]):null})}return this._geoExtent=gt(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;_geoExtentLatIdx=-1;obfuscateString(e){return Ht(e,it)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(n=>{let i={};this._cols.forEach((r,s)=>{i[r.name]=n[s],this.emitLegacyAggAliases&&r.hostName&&r.hostName!==r.name&&!Object.prototype.hasOwnProperty.call(i,r.hostName)&&(i[r.hostName]=n[s])});for(let[r,s]of e)Object.prototype.hasOwnProperty.call(i,s.alias)||(i[s.alias]=n[r]);return i})}async getCSVAsync(e){let n=[],i=e?25:1e7,r=e?4e3:1e7,s=new Map,o=this.wallClockColumnIndexes();for(let a of this._rows){let c={};for(let d=0;d<this._cols.length;d++){let g=this._cols[d],m=a[d];if(this.STR(m)!=""){if(e&&g.dataType=="String")if(s.has(m))m=s.get(m);else{let b=this.obfuscateString(m);s.set(m,b),m=b}else if(g.dataType=="DateTime"&&!g.dateWithTime){let b=m instanceof Date?m:typeof m=="string"?Ne(m)??new Date(m):new Date(m);m=(this.wholeDayIso(b)??b.toISOString().slice(0,10))+"T00:00:00.000Z"}else o.has(d)&&m instanceof Date&&(m=fe(m));r-=this.STR(m).length}else m=null;c[d]=m,--r}if(n.push(c),--i,i<=0||r<=0)break}return await rn.unparse(n,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return rn.unparse([this._cols.map((n,i)=>{if(this.emitLegacyAggAliases&&n.hostName)return this.STR(n.hostName);let r=e.get(i);return this.STR(r&&r.headerName?r.alias:n.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(n=>n==null?null:this.STR(n)),this._englishAliases=new Map}aliasesForCode(e){let n=Be(e,this._cols)?this.legacyAliases():[];for(let i of this.englishAliasesFor(e).values())n.push({name:i.name,alias:i.alias,reason:"english-implicit-agg"});return n}armAliasesForCode(e){return this.emitLegacyAggAliases=Be(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let n of this.liveEnglishAliases().values())e.push({name:n.name,alias:n.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let n of this._cols)n&&n.hostName&&n.hostName!==n.name&&e.push({name:this.STR(n.name),alias:this.STR(n.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let n=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return n;let i=String(e),r=new Set;for(let o of this._cols)o&&(r.add(this.STR(o.name)),o.hostName&&r.add(this.STR(o.hostName)));let s=new Map;for(let o=0;o<this._cols.length;o++){if(!this._cols[o]||Ft(this._hostQueryNames[o],this._cols[o].name,this._cols[o].dataType))continue;let l=Lt(this._hostQueryNames[o]).filter(a=>!r.has(a)&&se(i,a));l.length===1&&s.set(l[0],[...s.get(l[0])??[],o])}for(let[o,l]of s){if(l.length!==1)continue;let a=this.STR(this._cols[l[0]].name);n.set(l[0],{name:a,alias:o,headerName:!se(i,a)})}return n}liveEnglishAliases(){let e=new Map;for(let[n,i]of this._englishAliases){let r=this._cols?this._cols[n]:null;r&&this.STR(r.name)===i.name&&e.set(n,i)}return e}addRow(e,n){if(this.dedupRows){let i="";for(let s of e)i+=this.STR(s)+"~";let r=rt(i);if(this._rowHashes.has(r))return!1;this._rowHashes.add(r)}return this._rows.push(fi(e)),this._inferredMeasureFlags=null,this._origIndices.push(n??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}invalidateStats(){this._computedStatsForLevel=null,this._geoExtentComputed=!1,this._geoExtent=null,this._geoExtentLatIdx=-1}reset(){this._inferredMeasureFlags=null,this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._inferredMeasureFlags=null,this._cols=e,!e||e.length===0)return;let n=new Set(e.map(i=>this.STR(i?.name)));for(let i of e){if(!i)continue;let r=this.STR(i.name),s=Pt(r);!s||s===r||n.has(s)||(n.delete(r),n.add(s),i.hostName=r,i.name=s)}}};export{cn as a,dn as b,bi as c,Si as d,wt as e,vt as f,wn as g,Mn as h,Tn as i,vn as j,Me as k,Ln as l,Pt as m,Be as n,Lt as o,Wt as p,Wn as q,Bt as r,Gt as s,Ti as t,vi as u,Ii as v,Gn as w,Kn as x,Vn as y,Kt as z,se as A,nr as B,Oi as C,rr as D,ir as E,j as F,Xt as G,Sr as H,_r as I,Ar as J,Tr as K,Qt as L,Jt as M,Yi as N,Re as O,an as P,ci as Q,di as R,mi as S,ln as T,sn as U,fi as V,on as W};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{O as I,W as A,f as R}from"./chunk-PUXXFTDT.mjs";import{a as h,c as x,d as E,e as L}from"./chunk-TZ74QIKA.mjs";import{u as C}from"./chunk-CZJ7M6A5.mjs";import M from"papaparse";var k=500,P=/^[+-]?\d{1,15}$/,v=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,N=/^\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4}$/;function O(e,o=".",n=!1){if(n)return"DateTime";let r=0,s=0,i=0,l=0;for(let c of e){if(c==null)continue;if(typeof c=="number"){l++,s++,Number.isInteger(c)&&r++;continue}if(c instanceof Date){l++,i++;continue}if(typeof c=="boolean"){l++;continue}let m=String(c).trim();if(m!==""){if(l++,P.test(h(m))){r++,s++;continue}if(L(m,o)){s++;continue}if((v.test(m)||N.test(m))&&!isNaN(Date.parse(m))){i++;continue}}}return l===0?"String":i===l?"DateTime":r===l?"Integer":s===l?"Decimal":"String"}function _(e,o,n=".",r=null){if(e==null)return null;if(typeof e=="number")return o==="String"?String(e):e;if(e instanceof Date)return o==="DateTime"?e:e.toISOString();if(typeof e=="boolean")return String(e);let s=String(e).trim();if(s==="")return null;switch(o){case"Integer":{let i=h(s);return P.test(i)?parseInt(i,10):null}case"Decimal":return E(s,n);case"DateTime":return r?r.read(s):C(s);default:return s}}function $(e){let o=(e||"").toLowerCase().replace(/\(.*$/,"").trim();return/^(tinyint|smallint|int|integer|int2|int4|int8|bigint|serial|bigserial)$/.test(o)?"Integer":/^(decimal|numeric|money|smallmoney|float|real|double|double precision|number)$/.test(o)?"Decimal":/^(date|datetime|datetime2|smalldatetime|datetimeoffset|timestamp|timestamptz|time)$/.test(o)?"DateTime":(/^(bit|bool|boolean)$/.test(o),"String")}function*q(e,o){for(let n of e)yield n?.[o]}function g(e,o,n){if(e.length===0)throw new Error("ingest: no columns were resolved from the source. Supply column descriptors, or use a source shape that carries them (grid/table/objects/sql).");let r=e.length,s=e.map((t,a)=>o.slice(0,k).map(u=>u?.[a])),i=s.map(t=>x(t,n.locale)),l=e.map((t,a)=>t.dataType===void 0||t.dataType==="DateTime"?R(q(o,a),{locale:n.locale??"en"}):null),c=e.map((t,a)=>t.dataType??O(s[a],i[a],l[a]!==null)),m=new Set((n.measures??[]).map(t=>t.toLowerCase())),b=new Set((n.dimensions??[]).map(t=>t.toLowerCase())),j=new Set((n.nonAdditive??[]).map(t=>t.toLowerCase())),D=e.map((t,a)=>{let u=t.name.toLowerCase(),f=t.isMeasure??((c[a]==="Integer"||c[a]==="Decimal")&&!I(t.name));m.has(u)&&(f=!0),b.has(u)&&(f=!1);let T={name:t.name,dataType:c[a],isMeasure:f};return f&&j.has(u)&&(T.discourageAggregationAcrossGroups=!0),T}),d=new A;d.dedupRows=n.dedup!==!1,d.deriveProvinces=n.deriveProvinces!==!1,d.setColumns(D),d.declareDimensions(D.filter((t,a)=>b.has(e[a].name.toLowerCase())));for(let t=0;t<o.length;t++){let a=o[t];d.addRow(Array.from({length:r},(u,f)=>_(a?.[f],c[f],i[f],l[f])),t)}let p=d.getColumnsWithStats(n.privacyLevel??"20",n.locale??"en"),S=new Map(p.map(t=>[t.name,t]));e.forEach(t=>{let a=S.get(t.name);a&&(t.format&&(a.modelFormat=t.format),t.description&&(a.modelDesc=t.description))});let y=t=>{let a=S.get(t);if(a)return[a];let u=t.toLowerCase();return p.filter(f=>f.name.toLowerCase()===u)};for(let[t,a]of Object.entries(n.formats??{}))for(let u of y(t))u.modelFormat=a;for(let[t,a]of Object.entries(n.descriptions??{}))for(let u of y(t))u.modelDesc=a;for(let t of n.groupBy??[])for(let a of y(t))a.isGrouping=!0;return{columns:p,rows:d.toObjectArray(),totalRows:d.getRowCount(),index:d}}function w(e,o){return e.map(n=>Array.isArray(n)?n:o.map(r=>n[r]))}function F(e,o){let n=[],r=new Set,s=Math.min(e.length,Math.max(1,o));for(let i=0;i<s;i++){let l=e[i];if(!(!l||typeof l!="object"))for(let c of Object.keys(l))r.has(c)||(r.add(c),n.push(c))}return n}function V(e){let o=String(e??"").replace(/^\uFEFF/,""),n=[],r=[],s=0;return M.parse(o,{skipEmptyLines:!1,step:i=>{let l=i.meta.cursor,c=o.slice(s,l);s=l,i.errors?.length&&r.push(...i.errors);let m=i.data;m.length===1&&m[0]===""&&c.replace(/[\r\n]/g,"")===""||n.push(m)}}),!n.length&&!r.length&&r.push(...M.parse(o,{skipEmptyLines:!0}).errors),{rows:n,errors:r}}function Y(e,o={}){switch(e.kind){case"csv":{let n=V(e.text);if(n.errors.length&&n.rows.length===0)throw new Error(`ingest: CSV parse failed - ${n.errors[0].message}`);let r=n.rows;if(r.length<2)throw new Error("ingest: CSV needs a header line plus at least one data row.");let s=r[0].map(i=>(i??"").trim());return g(s.map(i=>({name:i})),r.slice(1),o)}case"grid":{if(!e.header?.length)throw new Error("ingest: 'grid' needs a non-empty header.");return g(e.header.map(n=>({name:(n??"").trim()})),e.rows??[],o)}case"table":{if(!e.columns?.length)throw new Error("ingest: 'table' needs at least one column descriptor.");let n=e.columns.map(r=>r.name);return g(e.columns,w(e.rows??[],n),o)}case"objects":{let n=e.rows??[],r=e.columns?.length?e.columns:F(n,o.columnScanLimit??k).map(s=>({name:s}));if(!r.length)throw new Error("ingest: 'objects' produced no columns - the rows array is empty or holds no object keys.");return g(r,w(n,r.map(s=>s.name)),o)}case"sql":{if(!e.schema?.length)throw new Error("ingest: 'sql' needs at least one schema column.");let n=e.schema.map(r=>{let s=$(r.dataType);return{name:r.name,dataType:s,isMeasure:r.isMeasure,format:r.format,description:r.description}});return g(n,w(e.rows??[],n.map(r=>r.name)),o)}default:{let n=e;throw new Error(`ingest: unknown source kind '${n?.kind}'. Expected one of: csv, grid, table, objects, sql.`)}}}export{$ as a,V as b,Y as c};
2
+ import{O as I,W as A,f as R}from"./chunk-O6A7HGFH.mjs";import{a as h,c as x,d as E,e as L}from"./chunk-TZ74QIKA.mjs";import{u as C}from"./chunk-CZJ7M6A5.mjs";import M from"papaparse";var k=500,P=/^[+-]?\d{1,15}$/,v=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,N=/^\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4}$/;function O(e,o=".",n=!1){if(n)return"DateTime";let r=0,s=0,i=0,l=0;for(let c of e){if(c==null)continue;if(typeof c=="number"){l++,s++,Number.isInteger(c)&&r++;continue}if(c instanceof Date){l++,i++;continue}if(typeof c=="boolean"){l++;continue}let m=String(c).trim();if(m!==""){if(l++,P.test(h(m))){r++,s++;continue}if(L(m,o)){s++;continue}if((v.test(m)||N.test(m))&&!isNaN(Date.parse(m))){i++;continue}}}return l===0?"String":i===l?"DateTime":r===l?"Integer":s===l?"Decimal":"String"}function _(e,o,n=".",r=null){if(e==null)return null;if(typeof e=="number")return o==="String"?String(e):e;if(e instanceof Date)return o==="DateTime"?e:e.toISOString();if(typeof e=="boolean")return String(e);let s=String(e).trim();if(s==="")return null;switch(o){case"Integer":{let i=h(s);return P.test(i)?parseInt(i,10):null}case"Decimal":return E(s,n);case"DateTime":return r?r.read(s):C(s);default:return s}}function $(e){let o=(e||"").toLowerCase().replace(/\(.*$/,"").trim();return/^(tinyint|smallint|int|integer|int2|int4|int8|bigint|serial|bigserial)$/.test(o)?"Integer":/^(decimal|numeric|money|smallmoney|float|real|double|double precision|number)$/.test(o)?"Decimal":/^(date|datetime|datetime2|smalldatetime|datetimeoffset|timestamp|timestamptz|time)$/.test(o)?"DateTime":(/^(bit|bool|boolean)$/.test(o),"String")}function*q(e,o){for(let n of e)yield n?.[o]}function g(e,o,n){if(e.length===0)throw new Error("ingest: no columns were resolved from the source. Supply column descriptors, or use a source shape that carries them (grid/table/objects/sql).");let r=e.length,s=e.map((t,a)=>o.slice(0,k).map(u=>u?.[a])),i=s.map(t=>x(t,n.locale)),l=e.map((t,a)=>t.dataType===void 0||t.dataType==="DateTime"?R(q(o,a),{locale:n.locale??"en"}):null),c=e.map((t,a)=>t.dataType??O(s[a],i[a],l[a]!==null)),m=new Set((n.measures??[]).map(t=>t.toLowerCase())),b=new Set((n.dimensions??[]).map(t=>t.toLowerCase())),j=new Set((n.nonAdditive??[]).map(t=>t.toLowerCase())),D=e.map((t,a)=>{let u=t.name.toLowerCase(),f=t.isMeasure??((c[a]==="Integer"||c[a]==="Decimal")&&!I(t.name));m.has(u)&&(f=!0),b.has(u)&&(f=!1);let T={name:t.name,dataType:c[a],isMeasure:f};return f&&j.has(u)&&(T.discourageAggregationAcrossGroups=!0),T}),d=new A;d.dedupRows=n.dedup!==!1,d.deriveProvinces=n.deriveProvinces!==!1,d.setColumns(D),d.declareDimensions(D.filter((t,a)=>b.has(e[a].name.toLowerCase())));for(let t=0;t<o.length;t++){let a=o[t];d.addRow(Array.from({length:r},(u,f)=>_(a?.[f],c[f],i[f],l[f])),t)}let p=d.getColumnsWithStats(n.privacyLevel??"20",n.locale??"en"),S=new Map(p.map(t=>[t.name,t]));e.forEach(t=>{let a=S.get(t.name);a&&(t.format&&(a.modelFormat=t.format),t.description&&(a.modelDesc=t.description))});let y=t=>{let a=S.get(t);if(a)return[a];let u=t.toLowerCase();return p.filter(f=>f.name.toLowerCase()===u)};for(let[t,a]of Object.entries(n.formats??{}))for(let u of y(t))u.modelFormat=a;for(let[t,a]of Object.entries(n.descriptions??{}))for(let u of y(t))u.modelDesc=a;for(let t of n.groupBy??[])for(let a of y(t))a.isGrouping=!0;return{columns:p,rows:d.toObjectArray(),totalRows:d.getRowCount(),index:d}}function w(e,o){return e.map(n=>Array.isArray(n)?n:o.map(r=>n[r]))}function F(e,o){let n=[],r=new Set,s=Math.min(e.length,Math.max(1,o));for(let i=0;i<s;i++){let l=e[i];if(!(!l||typeof l!="object"))for(let c of Object.keys(l))r.has(c)||(r.add(c),n.push(c))}return n}function V(e){let o=String(e??"").replace(/^\uFEFF/,""),n=[],r=[],s=0;return M.parse(o,{skipEmptyLines:!1,step:i=>{let l=i.meta.cursor,c=o.slice(s,l);s=l,i.errors?.length&&r.push(...i.errors);let m=i.data;m.length===1&&m[0]===""&&c.replace(/[\r\n]/g,"")===""||n.push(m)}}),!n.length&&!r.length&&r.push(...M.parse(o,{skipEmptyLines:!0}).errors),{rows:n,errors:r}}function Y(e,o={}){switch(e.kind){case"csv":{let n=V(e.text);if(n.errors.length&&n.rows.length===0)throw new Error(`ingest: CSV parse failed - ${n.errors[0].message}`);let r=n.rows;if(r.length<2)throw new Error("ingest: CSV needs a header line plus at least one data row.");let s=r[0].map(i=>(i??"").trim());return g(s.map(i=>({name:i})),r.slice(1),o)}case"grid":{if(!e.header?.length)throw new Error("ingest: 'grid' needs a non-empty header.");return g(e.header.map(n=>({name:(n??"").trim()})),e.rows??[],o)}case"table":{if(!e.columns?.length)throw new Error("ingest: 'table' needs at least one column descriptor.");let n=e.columns.map(r=>r.name);return g(e.columns,w(e.rows??[],n),o)}case"objects":{let n=e.rows??[],r=e.columns?.length?e.columns:F(n,o.columnScanLimit??k).map(s=>({name:s}));if(!r.length)throw new Error("ingest: 'objects' produced no columns - the rows array is empty or holds no object keys.");return g(r,w(n,r.map(s=>s.name)),o)}case"sql":{if(!e.schema?.length)throw new Error("ingest: 'sql' needs at least one schema column.");let n=e.schema.map(r=>{let s=$(r.dataType);return{name:r.name,dataType:s,isMeasure:r.isMeasure,format:r.format,description:r.description}});return g(n,w(e.rows??[],n.map(r=>r.name)),o)}default:{let n=e;throw new Error(`ingest: unknown source kind '${n?.kind}'. Expected one of: csv, grid, table, objects, sql.`)}}}export{$ as a,V as b,Y as c};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{H as x,N as V,a as en,b as L,c as sn,d as on,e as rn,f as an,g as cn,h as un,i as ln,j as W}from"./chunk-AAPXJXEP.mjs";import{e as tn}from"./chunk-5HI6TVMM.mjs";import{b as nn}from"./chunk-CZJ7M6A5.mjs";var An="006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999",w=new Set(An.match(/.{3}/g)??[]);var dn=[["AL","Alabama"],["AK","Alaska"],["AZ","Arizona"],["AR","Arkansas"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DE","Delaware"],["FL","Florida"],["GA","Georgia"],["HI","Hawaii"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["IA","Iowa"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["ME","Maine"],["MD","Maryland"],["MA","Massachusetts"],["MI","Michigan"],["MN","Minnesota"],["MS","Mississippi"],["MO","Missouri"],["MT","Montana"],["NE","Nebraska"],["NV","Nevada"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NY","New York"],["NC","North Carolina"],["ND","North Dakota"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VT","Vermont"],["VA","Virginia"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"],["DC","District of Columbia"],["PR","Puerto Rico"],["GU","Guam"],["VI","U.S. Virgin Islands"],["AS","American Samoa"],["MP","Northern Mariana Islands"]],pn=new Set(dn.map(n=>n[0])),Cn={"Ala.":"AL","Alab.":"AL","Ariz.":"AZ","Ark.":"AR","Calif.":"CA","Cal.":"CA","Colo.":"CO","Col.":"CO","Conn.":"CT","Del.":"DE","Fla.":"FL","Flor.":"FL","Ga.":"GA","Ill.":"IL","Ind.":"IN","Kan.":"KS","Kans.":"KS","Ky.":"KY","La.":"LA","Md.":"MD","Mass.":"MA","Mich.":"MI","Minn.":"MN","Miss.":"MS","Mo.":"MO","Mont.":"MT","Neb.":"NE","Nebr.":"NE","Nev.":"NV","N.H.":"NH","N.J.":"NJ","N.M.":"NM","N.Mex.":"NM","N. Mex.":"NM","N.Y.":"NY","N.C.":"NC","N.D.":"ND","N.Dak.":"ND","N. Dak.":"ND","Okla.":"OK","Ore.":"OR","Oreg.":"OR","Pa.":"PA","Penn.":"PA","Penna.":"PA","R.I.":"RI","S.C.":"SC","S.D.":"SD","S.Dak.":"SD","S. Dak.":"SD","Tenn.":"TN","Tex.":"TX","Vt.":"VT","Va.":"VA","Wash.":"WA","W.Va.":"WV","W. Va.":"WV","Wis.":"WI","Wisc.":"WI","Wyo.":"WY","D.C.":"DC","Wash. D.C.":"DC","Wash., D.C.":"DC","P.R.":"PR","V.I.":"VI"},Y=(()=>{let n=new Map;for(let[s,o]of dn)n.set(g(o),s);n.set(g("Washington DC"),"DC"),n.set(g("Washington D.C."),"DC"),n.set(g("US Virgin Islands"),"VI");for(let[s,o]of Object.entries(Cn)){let r=g(s);r&&!n.has(r)&&n.set(r,o)}return n})(),In=(()=>{let n=new tn;for(let[s,o]of Y)n.add(s,o);return n})();function mn(n){let s=g(n),o=Y.get(s);return o||(L(s)?null:In.get(rn(n))??null)}var Sn=new Set(["01","02","04","05","06","08","09","10","11","12","13","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","44","45","46","47","48","49","50","51","53","54","55","56","60","66","69","72","78"]);function yn(n){return n.trim().toUpperCase()}function g(n){return on(n)}var H=new Set(["country","countries","nation","nationality","iso","geo"]),U=new Set(["state","province","st"]),fn=new Set(["zip","zipcode","postal","postcode","plz"]),Mn=new Set(["county","fips","borough","parish"]),Tn=new Set(["city","cities","town","municipality","metro","location","place"]);function y(n,s){if(!n)return!1;for(let o of nn(n))if(s.has(o))return!0;return!1}var Dn=95,On=5,_n=6e4;function Un(n,s,o){if(!n||n.length===0)return null;let r=[],I=new Set;for(let t of n){if(t==null)continue;let e=String(t).trim();if(e.length===0||L(g(e)))continue;let i=e.toLowerCase();if(!I.has(i)&&(I.add(i),r.push(e),r.length>_n))return null}let N=r.length;if(N<2)return null;let h=r.map(yn),M=r.map(g),O=un(),d=0,p=0,m=0,T=0,D=0,l=0,_=0,F=0,Z=0,K=0,$=0,P=0,J=t=>(x(t)??"").slice(0,3),X=0,B=0,E=0,v=y(s,fn);for(let t=0;t<N;++t){let e=h[t],i=M[t],c=r[t],S=an.has(e),C=pn.has(e);cn.has(e)&&d++,S&&p++,C&&m++,S&&C&&X++;let G=O.has(i)||ln(c)!==null,R=Y.has(i)||mn(c)!==null;G&&T++,R&&D++,G&&R&&B++,W(c)&&K++,C&&R&&E++,/^\d{5}(-\d{4})?$/.test(c)||v&&/^\d{3,4}$/.test(c)?(l++,w.has(J(c))&&P++):/^\d{4}$/.test(c)&&$++,/^\d{5}$/.test(c)&&Sn.has(c.slice(0,2))&&_++,V(i)&&F++,V(i,"world")&&Z++}if(!v&&l>0){l+=$;for(let t of r)/^\d{4}$/.test(t)&&w.has(J(t))&&P++}let j=t=>t/N*100,A=[],u=(t,e,i,c=!1)=>{let S=j(e),C=t==="city-name"||t==="city-name-world";S<(C?sn:Dn)||e<2||c&&e<On&&!y(s,t==="country-name"?H:C?Tn:U)||A.push({kind:t,matched:e,spec:i,pct:S})};u("country-iso3",d,6),u("country-name",T,5,!0),u("us-state-name",D,5,!0),u("us-zip5",l,4),u("us-county-fips",_,4),u("country-iso2",p,3),u("us-state-code",m,3);let gn=A.length;u("city-name",F,2,!0),A.length===gn&&u("city-name-world",Z,2,!0);let Nn=m-E,hn=D-E;Nn>0&&hn>0&&u("us-state-name",m+D-E,5,!0);let b=Math.max(d,p,T);if(K>b){let t=d===b?"country-iso3":T===b?"country-name":"country-iso2";u(t,K,t==="country-iso3"?6:t==="country-name"?5:3,t==="country-name")}if(A.length===0)return null;A.sort((t,e)=>e.pct-t.pct||e.spec-t.spec);let a=A[0],k=!1,q={"country-iso2":"us-state-code","us-state-code":"country-iso2","us-zip5":"us-county-fips","us-county-fips":"us-zip5","country-name":"us-state-name","us-state-name":"country-name"}[a.kind],z=A[1],Q=q&&z&&z.kind===q&&Math.abs(a.pct-z.pct)<=15;if(a.kind==="country-iso2"||a.kind==="us-state-code"){let t=a.matched>0?X/a.matched:0,e=y(s,H),i=y(s,U);if(Q||t>=.5){if(e&&!i)return f("country-iso2",p,!1);if(i&&!e)return f("us-state-code",m,!1);k=!0}}else if(a.kind==="us-zip5"||a.kind==="us-county-fips"){let t=_===l&&l===N,e=y(s,fn),i=y(s,Mn);return i&&!e?f("us-county-fips",_,!1):e&&!i?f("us-zip5",l,!1):t?f("us-zip5",l,!0):f("us-zip5",l,!1)}else if(Q&&(a.kind==="country-name"||a.kind==="us-state-name")){let t=a.matched>0?B/a.matched:0,e=y(s,H),i=y(s,U);if(e&&!i)return f("country-name",T,!1);if(i&&!e)return f("us-state-name",D,!1);t>=.5&&(k=!0)}return f(a.kind,a.matched,k);function f(t,e,i){let S={geoKind:t,geoMatchPct:Math.round(j(t==="us-zip5"?P:e)*10)/10};return i&&(S.geoAmbiguous=!0),S}}function En(n,s){if(n==null)return null;let o=String(n).trim();if(o.length===0)return null;switch(s){case"country-iso3":case"country-iso2":case"country-name":return W(o);case"us-state-code":case"us-state-name":{let r=yn(o);return pn.has(r)?r:mn(o)}case"us-zip5":return x(o);case"us-county-fips":return/^\d{5}$/.test(o)&&Sn.has(o.slice(0,2))?o:null;default:return null}}function Yn(n){switch(n){case"country-iso3":case"country-iso2":case"country-name":case"us-state-code":case"us-state-name":case"us-zip5":case"us-county-fips":return!0;default:return!1}}function Rn(n,s){return s==="us-zip5"?w.has(n.slice(0,3)):!0}function Fn(n,s){let o=new Array(n.length),r=new Set,I=[],N=0;for(let h=0;h<n.length;++h){let M=En(n[h],s),O=M!==null&&Rn(M,s)?M:null;if(o[h]=O,O!==null)N++;else{let d=n[h];if(d!=null){let p=String(d).trim();if(p.length>0){let m=p.toLowerCase();r.has(m)||(r.add(m),I.push(p))}}}}return{iso:o,unmatched:I,matchedRows:N,totalRows:n.length}}export{fn as a,Tn as b,y as c,On as d,Un as e,En as f,Yn as g,Fn as h};
2
+ import{H as x,N as V,a as en,b as L,c as sn,d as on,e as rn,f as an,g as cn,h as un,i as ln,j as W}from"./chunk-DTBXJVUG.mjs";import{e as tn}from"./chunk-5HI6TVMM.mjs";import{b as nn}from"./chunk-CZJ7M6A5.mjs";var An="006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999",w=new Set(An.match(/.{3}/g)??[]);var dn=[["AL","Alabama"],["AK","Alaska"],["AZ","Arizona"],["AR","Arkansas"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DE","Delaware"],["FL","Florida"],["GA","Georgia"],["HI","Hawaii"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["IA","Iowa"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["ME","Maine"],["MD","Maryland"],["MA","Massachusetts"],["MI","Michigan"],["MN","Minnesota"],["MS","Mississippi"],["MO","Missouri"],["MT","Montana"],["NE","Nebraska"],["NV","Nevada"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NY","New York"],["NC","North Carolina"],["ND","North Dakota"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VT","Vermont"],["VA","Virginia"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"],["DC","District of Columbia"],["PR","Puerto Rico"],["GU","Guam"],["VI","U.S. Virgin Islands"],["AS","American Samoa"],["MP","Northern Mariana Islands"]],pn=new Set(dn.map(n=>n[0])),Cn={"Ala.":"AL","Alab.":"AL","Ariz.":"AZ","Ark.":"AR","Calif.":"CA","Cal.":"CA","Colo.":"CO","Col.":"CO","Conn.":"CT","Del.":"DE","Fla.":"FL","Flor.":"FL","Ga.":"GA","Ill.":"IL","Ind.":"IN","Kan.":"KS","Kans.":"KS","Ky.":"KY","La.":"LA","Md.":"MD","Mass.":"MA","Mich.":"MI","Minn.":"MN","Miss.":"MS","Mo.":"MO","Mont.":"MT","Neb.":"NE","Nebr.":"NE","Nev.":"NV","N.H.":"NH","N.J.":"NJ","N.M.":"NM","N.Mex.":"NM","N. Mex.":"NM","N.Y.":"NY","N.C.":"NC","N.D.":"ND","N.Dak.":"ND","N. Dak.":"ND","Okla.":"OK","Ore.":"OR","Oreg.":"OR","Pa.":"PA","Penn.":"PA","Penna.":"PA","R.I.":"RI","S.C.":"SC","S.D.":"SD","S.Dak.":"SD","S. Dak.":"SD","Tenn.":"TN","Tex.":"TX","Vt.":"VT","Va.":"VA","Wash.":"WA","W.Va.":"WV","W. Va.":"WV","Wis.":"WI","Wisc.":"WI","Wyo.":"WY","D.C.":"DC","Wash. D.C.":"DC","Wash., D.C.":"DC","P.R.":"PR","V.I.":"VI"},Y=(()=>{let n=new Map;for(let[s,o]of dn)n.set(g(o),s);n.set(g("Washington DC"),"DC"),n.set(g("Washington D.C."),"DC"),n.set(g("US Virgin Islands"),"VI");for(let[s,o]of Object.entries(Cn)){let r=g(s);r&&!n.has(r)&&n.set(r,o)}return n})(),In=(()=>{let n=new tn;for(let[s,o]of Y)n.add(s,o);return n})();function mn(n){let s=g(n),o=Y.get(s);return o||(L(s)?null:In.get(rn(n))??null)}var Sn=new Set(["01","02","04","05","06","08","09","10","11","12","13","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","44","45","46","47","48","49","50","51","53","54","55","56","60","66","69","72","78"]);function yn(n){return n.trim().toUpperCase()}function g(n){return on(n)}var H=new Set(["country","countries","nation","nationality","iso","geo"]),U=new Set(["state","province","st"]),fn=new Set(["zip","zipcode","postal","postcode","plz"]),Mn=new Set(["county","fips","borough","parish"]),Tn=new Set(["city","cities","town","municipality","metro","location","place"]);function y(n,s){if(!n)return!1;for(let o of nn(n))if(s.has(o))return!0;return!1}var Dn=95,On=5,_n=6e4;function Un(n,s,o){if(!n||n.length===0)return null;let r=[],I=new Set;for(let t of n){if(t==null)continue;let e=String(t).trim();if(e.length===0||L(g(e)))continue;let i=e.toLowerCase();if(!I.has(i)&&(I.add(i),r.push(e),r.length>_n))return null}let N=r.length;if(N<2)return null;let h=r.map(yn),M=r.map(g),O=un(),d=0,p=0,m=0,T=0,D=0,l=0,_=0,F=0,Z=0,K=0,$=0,P=0,J=t=>(x(t)??"").slice(0,3),X=0,B=0,E=0,v=y(s,fn);for(let t=0;t<N;++t){let e=h[t],i=M[t],c=r[t],S=an.has(e),C=pn.has(e);cn.has(e)&&d++,S&&p++,C&&m++,S&&C&&X++;let G=O.has(i)||ln(c)!==null,R=Y.has(i)||mn(c)!==null;G&&T++,R&&D++,G&&R&&B++,W(c)&&K++,C&&R&&E++,/^\d{5}(-\d{4})?$/.test(c)||v&&/^\d{3,4}$/.test(c)?(l++,w.has(J(c))&&P++):/^\d{4}$/.test(c)&&$++,/^\d{5}$/.test(c)&&Sn.has(c.slice(0,2))&&_++,V(i)&&F++,V(i,"world")&&Z++}if(!v&&l>0){l+=$;for(let t of r)/^\d{4}$/.test(t)&&w.has(J(t))&&P++}let j=t=>t/N*100,A=[],u=(t,e,i,c=!1)=>{let S=j(e),C=t==="city-name"||t==="city-name-world";S<(C?sn:Dn)||e<2||c&&e<On&&!y(s,t==="country-name"?H:C?Tn:U)||A.push({kind:t,matched:e,spec:i,pct:S})};u("country-iso3",d,6),u("country-name",T,5,!0),u("us-state-name",D,5,!0),u("us-zip5",l,4),u("us-county-fips",_,4),u("country-iso2",p,3),u("us-state-code",m,3);let gn=A.length;u("city-name",F,2,!0),A.length===gn&&u("city-name-world",Z,2,!0);let Nn=m-E,hn=D-E;Nn>0&&hn>0&&u("us-state-name",m+D-E,5,!0);let b=Math.max(d,p,T);if(K>b){let t=d===b?"country-iso3":T===b?"country-name":"country-iso2";u(t,K,t==="country-iso3"?6:t==="country-name"?5:3,t==="country-name")}if(A.length===0)return null;A.sort((t,e)=>e.pct-t.pct||e.spec-t.spec);let a=A[0],k=!1,q={"country-iso2":"us-state-code","us-state-code":"country-iso2","us-zip5":"us-county-fips","us-county-fips":"us-zip5","country-name":"us-state-name","us-state-name":"country-name"}[a.kind],z=A[1],Q=q&&z&&z.kind===q&&Math.abs(a.pct-z.pct)<=15;if(a.kind==="country-iso2"||a.kind==="us-state-code"){let t=a.matched>0?X/a.matched:0,e=y(s,H),i=y(s,U);if(Q||t>=.5){if(e&&!i)return f("country-iso2",p,!1);if(i&&!e)return f("us-state-code",m,!1);k=!0}}else if(a.kind==="us-zip5"||a.kind==="us-county-fips"){let t=_===l&&l===N,e=y(s,fn),i=y(s,Mn);return i&&!e?f("us-county-fips",_,!1):e&&!i?f("us-zip5",l,!1):t?f("us-zip5",l,!0):f("us-zip5",l,!1)}else if(Q&&(a.kind==="country-name"||a.kind==="us-state-name")){let t=a.matched>0?B/a.matched:0,e=y(s,H),i=y(s,U);if(e&&!i)return f("country-name",T,!1);if(i&&!e)return f("us-state-name",D,!1);t>=.5&&(k=!0)}return f(a.kind,a.matched,k);function f(t,e,i){let S={geoKind:t,geoMatchPct:Math.round(j(t==="us-zip5"?P:e)*10)/10};return i&&(S.geoAmbiguous=!0),S}}function En(n,s){if(n==null)return null;let o=String(n).trim();if(o.length===0)return null;switch(s){case"country-iso3":case"country-iso2":case"country-name":return W(o);case"us-state-code":case"us-state-name":{let r=yn(o);return pn.has(r)?r:mn(o)}case"us-zip5":return x(o);case"us-county-fips":return/^\d{5}$/.test(o)&&Sn.has(o.slice(0,2))?o:null;default:return null}}function Yn(n){switch(n){case"country-iso3":case"country-iso2":case"country-name":case"us-state-code":case"us-state-name":case"us-zip5":case"us-county-fips":return!0;default:return!1}}function Rn(n,s){return s==="us-zip5"?w.has(n.slice(0,3)):!0}function Fn(n,s){let o=new Array(n.length),r=new Set,I=[],N=0;for(let h=0;h<n.length;++h){let M=En(n[h],s),O=M!==null&&Rn(M,s)?M:null;if(o[h]=O,O!==null)N++;else{let d=n[h];if(d!=null){let p=String(d).trim();if(p.length>0){let m=p.toLowerCase();r.has(m)||(r.add(m),I.push(p))}}}}return{iso:o,unmatched:I,matchedRows:N,totalRows:n.length}}export{fn as a,Tn as b,y as c,On as d,Un as e,En as f,Yn as g,Fn as h};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a,b,c,d,e,f,g,h}from"./chunk-WTJVREEE.mjs";import"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{b as CITY_NAME_TOKENS,d as NAME_KIND_MIN_DISTINCT,a as ZIP_NAME_TOKENS,h as buildGeoIsoColumn,e as detectGeo,c as hasAnyToken,g as isJoinGeoKind,f as toGeoIso};
2
+ import{a,b,c,d,e,f,g,h}from"./chunk-YDYFP2T4.mjs";import"./chunk-DTBXJVUG.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{b as CITY_NAME_TOKENS,d as NAME_KIND_MIN_DISTINCT,a as ZIP_NAME_TOKENS,h as buildGeoIsoColumn,e as detectGeo,c as hasAnyToken,g as isJoinGeoKind,f as toGeoIso};
package/dist/geoPoint.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{B as b,C as c,D as d,E as e,F as f,G as g,H as h,I as i,J as j,K as k,L as l,M as m,N as n,O as o,d as a}from"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{d as NORTH_AMERICA_COUNTRIES,l as buildGeoPointColumns,o as cityMatchPct,m as cityTagsFor,c as isCityTableLoaded,j as isGeoPointAmbiguity,n as isKnownCity,f as normalizeCountry,a as normalizePlaceName,h as normalizeZip5,b as registerCityTable,e as resolveAdmin1,k as resolveGeoPoint,i as zipPrefixCandidates,g as zipToPrefix3};
2
+ import{B as b,C as c,D as d,E as e,F as f,G as g,H as h,I as i,J as j,K as k,L as l,M as m,N as n,O as o,d as a}from"./chunk-DTBXJVUG.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{d as NORTH_AMERICA_COUNTRIES,l as buildGeoPointColumns,o as cityMatchPct,m as cityTagsFor,c as isCityTableLoaded,j as isGeoPointAmbiguity,n as isKnownCity,f as normalizeCountry,a as normalizePlaceName,h as normalizeZip5,b as registerCityTable,e as resolveAdmin1,k as resolveGeoPoint,i as zipPrefixCandidates,g as zipToPrefix3};
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a as yr,b as hr}from"./chunk-HIVICMC5.mjs";import{a as Cr,b as I,c as br,d as D,e as E,f as Er,g as J,h as Z}from"./chunk-4J7WPYLM.mjs";import{a as fr,b as pr,c as gr}from"./chunk-GR25KIHB.mjs";import{A as Hn,B as Kn,C as Bn,D as jn,E as Yn,F as Qn,G as Xn,H as Jn,I as Zn,J as er,K as tr,L as nr,M as rr,N as or,O as ir,P as sr,Q as ar,R as lr,S as ur,T as cr,U as dr,W as mr,a as pn,b as gn,c as yn,d as hn,e as Cn,g as wn,h as _n,i as On,j as Pn,k as vn,l as Ln,m as An,n as In,o as Mn,p as Nn,q as Fn,r as Dn,s as kn,t as Gn,u as Vn,v as Un,w as Wn,x as qn,y as $n,z as zn}from"./chunk-PUXXFTDT.mjs";import{a as bn}from"./chunk-U3H6UBOO.mjs";import{b as En,c as Tn,d as Sn,f as Rn,g as xn}from"./chunk-TZ74QIKA.mjs";import{a as de,c as me,e as cn,f as dn,g as mn,h as fn}from"./chunk-WTJVREEE.mjs";import{A as Q,B as Zt,C as en,D as ce,E as M,F as tn,G as nn,H as rn,I as W,J as on,K as sn,L as an,M as ln,N as X,O as un,a as A,b as G,c as j,d as V,j as U,k as Vt,l as Ut,m as Wt,n as qt,o as $t,q as zt,r as Ht,s as Y,t as Kt,u as Bt,v as jt,w as Yt,x as Qt,y as Xt,z as Jt}from"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import{a as Et,b as Tt,c as St,d as Rt,e as xt,f as wt,g as _t,h as Ot,i as Pt,j as vt,k as Lt,l as At,m as Dt,n as kt,o as Gt}from"./chunk-3ZAS32F5.mjs";import{b as It,c as Mt,d as Nt,e as Ft}from"./chunk-5HI6TVMM.mjs";import{A as gt,B as yt,C as ht,D as Ct,E as bt,a as He,b as Ke,c as Be,d as je,e as Ye,f as Qe,g as Xe,h as Je,i as Ze,j as et,k as tt,l as nt,m as rt,n as ot,o as it,q as B,r as st,s as at,t as lt,u as ut,v as ct,w as dt,x as mt,y as ft,z as pt}from"./chunk-CZJ7M6A5.mjs";import{a as Ve,b as Ue,c as We,d as qe,e as $e,f as K,g as ze}from"./chunk-WC4JINEZ.mjs";var ee=2,ge=400;function ne(e){return!!U(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=V(String(n));if(!G(o)&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||re(e)<95)return!1;let n=t.filter(a=>ne(a)&&!M(a)).length,o=t.filter(a=>!ne(a)&&!!M(a)).length;return n>=1&&n>=o}function fe(e,t){if(!M(e))return!1;let n=U(e);return n?t==="world"?!0:ce.has(n):!1}function re(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)ne(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){return M(e)?!0:Y()?Q(e).status!=="unmatched"||Q(e.trim().replace(/\s+/g,"-")).status!=="unmatched":!1}function q(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)oe(o)&&n++;return Math.round(n/t.length*1e3)/10}function se(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!G(V(o))&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function ie(e){let t=se(e);if(t.length===0)return 0;let n=0;for(let o of t)W(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function pe(e,t){return me(t,de)?!0:se(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Tr(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)X(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function te(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function Sr(e,t){let n=0;for(let o of se(e))t(o)&&n++;return n}function Rr(e,t,n,o,a){let u=[],l=[],i={},C={},b=new Set(e),h=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&b.has(d)&&(i[s]=d)}let g=new Set(a??e);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&b.has(f)){let s=h(f),d=ie(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):pe(s,f)?i.zip=f:l.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&b.has(c)){let s=h(c),d=F(s);d.length>0&&d.every(S=>fe(S,o))?l.push(`state=${c} (every value is "CA", which is both Canada and California)`):N(s)?(l.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):q(s)<95?l.push(`state=${c} (only ${q(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),y=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of y){let S=h(d);if(N(S))continue;let O=q(S);if(O<95)continue;let H=te(S,oe),Ge=te(S,ue=>oe(ue)&&!fe(ue,o));H<ee&&Ge<1||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.state=s.name,p.add(s.name),u.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of y){if(p.has(s))continue;let d=h(s),S=ie(d);if(!(S<95)&&pe(d,s)&&!(Sr(d,O=>W(O).length>0)<ee)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!N(h(T))){let s=null;for(let d of y){if(p.has(d)||!N(h(d)))continue;let S=re(h(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${re(h(T))}% of values are country identifiers; using ${s.name} instead)`),C.country=T),i.country=s.name,p.add(s.name),u.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of y){if(p.has(d))continue;let S=h(d),O=Tr(S,o);O<j||te(S,H=>X(H,o))<ee||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let v=i.country?h(i.country):[],R=!!i.country&&N(v),L=R?new Set(v.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&L>=2,w=!!(i.lat&&i.lon)&&t.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=90&&S>=-180&&S<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!w&&l.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&l.push(R?`country=${i.country} (every row resolves to the same country - nothing to place apart)`:`country=${i.country} (values are not country identifiers)`),{bind:!!(i.city||i.state||i.zip||x||w)?i:null,backfilled:u,refused:l,...Object.keys(C).length?{labelFallback:C}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ae=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),xr=Object.freeze(Array.from(new Set(Object.values(ae).flatMap(e=>e.langs)))),ye=Object.freeze(["fa","ar","he","th"]),he=1900,Ce=2100;function wr(e,t){let n=[],o=K(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function _r(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of wr(n,t)){let a=ae[o];if(a&&a.langs.includes(t))return a.part}return null}function Or(e,t){return ye.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=he&&t<=Ce:!0}function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pr=/\b(?:columns|cols|column)\b/i;function $(e,t){let n=Math.max(0,t-240),o=e.slice(n,t),a=o.lastIndexOf(";");return a>=0&&(o=o.slice(a+1)),Pr.test(o)}function Ee(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Te(e,t,n){let o=be(t),a=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),l=0,i;for(;(i=u.exec(e))!==null;)$(e,i.index)&&l++;let C=0;for(;(i=a.exec(e))!==null;){let b=i.index+i[0].lastIndexOf(".name");if(!$(e,b))continue;C++;let h=be(i[1]);if(!n(h))return!1}return C>0&&C===l}function vr(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(e)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(e))}var Se=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function Lr(e,t){if(!e)return[];let n=new Set(t);for(let i of Se)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)$(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||Ee(e,i)||l.push(i)}),l}function Ar(e,t){if(!e)return[];let n=(e.getColumns()||[]).map(o=>o.name);if(!t||typeof e.aliasesForCode!="function")return n;for(let o of e.aliasesForCode(t))n.push(o.alias);return n}function Re(e,t){let n=t?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(e)||e<=n?0:Math.round(e-n)}function Ir(e,t,n){let o=Re(e,t);if(o===null||o<=0)return null;let a=typeof t?.freemiumColumnCapPivot=="number"?t.freemiumColumnCapPivot:4,u=o>a?t?.freemiumColumnCapMessageMany:t?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let l=u.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=xe(n);return i.length===0?l:l+" "+i.join(" ")}function xe(e){if(!e||e.length===0)return[];let t=[],n=new Map,o=new Map;for(let u of e){let l=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(l!==""&&(n.has(l)||(t.push(l),n.set(l,0)),u.isDatePart===!0&&n.set(l,n.get(l)+1),u.isReassembledDate===!0&&!o.has(l))){let i=typeof u.sourceField=="string"?u.sourceField.trim():"",C=typeof u.name=="string"?u.name.trim():"",b=i!==""?i:C;b!==""&&o.set(l,b)}}let a=[];for(let u of t){let l=o.get(u),i=n.get(u)??0;!l||i===0||a.push(`'${l}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return a}var m=e=>e==null?"":String(e),P=e=>e===!0,we=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Mr=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function _e(e,t){let n={};for(let[o,a]of Mr){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function Nr(e){return Array.isArray(e)?e.map(t=>({code:m(E(t,"code")),severity:m(E(t,"severity")),text:m(E(t,"text"))})).filter(t=>t.text!==""):[]}function Fr(e){let t=b=>E(e,b),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=_e(e,"point"),l=_e(e,"destPoint");Object.keys(l).length&&(u.dest=l);let i=t("retryable"),C=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:Nr(t("notices")),freemiumStatusCode:m(t("freemiumStatusCode")),code:m(t("code")),language:m(t("language")),version:Number(t("version")??0),codeSummary:m(t("codeSummary")),chartName:m(t("chartName")??t("chartType")),finalChartName:m(t("finalChartName")),warningMessage:m(t("warningMessage")),outputHash:m(t("outputHash")),validatorToken:m(t("validatorToken")),editCodeKey:m(t("editCodeKey")),signedLLMRequestID:m(t("signedLLMRequestID")),userReply:m(t("userReply")),userReplyOutcome:m(t("userReplyOutcome")),improvementSuggestion:m(t("improvementSuggestion")),geoColumn:m(t("geoColumn")),geoKind:m(t("geoKind")),geoPointCols:Object.keys(u).length?u:null,creditBalanceBefore:we(t("creditBalanceBefore")),creditCost:we(t("creditCost")),isServiceError:P(t("isServiceError")),isRateLimited:P(t("isRateLimited")),suppressSelectionGlyph:P(t("suppressSelectionGlyph")),isRefusal:P(t("isRefusal")),isVersionNotFound:P(t("isVersionNotFound")),isGenerationCancelled:P(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof C=="boolean"?{isPollFinal:C}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof a=="boolean"?{forceThumbnailUpload:a}:{}}}var Oe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function Dr(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let l=C=>E(u,C),i=l("recommended");return{name:m(l("chartTypeName")??l("name")),description:m(l("description")??l("chartDesc")),rank:Oe(l("rank")),score:Oe(l("score")),renderer:k(l("renderer")),language:k(l("language")),isPreview:P(l("isPreview")),alsoWorthALook:P(l("alsoWorthALook")),recommended:typeof i=="boolean"?i:void 0,viaProjection:k(l("viaProjection")),viaProjectionKey:k(l("viaProjectionKey")),detailNote:k(l("detailNote"))}}).filter(u=>u.name):null,a=Array.isArray(n)?n.map(u=>({name:m(E(u,"chartTypeName")??E(u,"name")),reason:m(E(u,"reason")),reasonCode:m(E(u,"reasonCode")),isVeto:P(E(u,"isVeto"))})).filter(u=>u.name):[];return{errorMessage:m(E(e,"errorMessage")),errorCode:m(E(e,"errorCode")),charts:o,refused:a,noFitSummary:m(E(e,"noFitSummary"))}}function kr(e){return!e||typeof e!="object"?null:{status:String(E(e,"status")??""),verdictReason:E(e,"verdictReason")??null,instruction:E(e,"instruction")??null,fix:E(e,"fix")??null,errorMessage:E(e,"errorMessage")??null,errorCode:E(e,"errorCode")??null}}var Pe=["working","analyze","generate","refine","review"];function Gr(e,t){let n=String(e??"").trim().toLowerCase();if(Pe.includes(n))return n;let o=String(t??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var Vr="FREEMIUM_ATTEMPT_SPENT",Ur="CLIENT_SECRET_MISMATCH",Wr="FREEMIUM_COLUMN_CAP",qr="OAUTH_TOKEN_EXPIRED",$r="OAUTH_SIGNED_OUT";function zr(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Hr(e){let t=e.linkNonce?(e.linkNonce()??"").trim():null,n=t?null:e.accessToken?(e.accessToken()??"").trim():null,o=t||n?{licensee:"",licenseKey:"",secretKey:""}:e.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:e.freemiumKey?.()??""},linkNonce:t,accessToken:n}}function Kr(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function Br(e){let t=0;for(let n of e){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>t&&(t=o)}return t}function ve(e){if(e.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(e.recoveryFetchVersion!=null)return{version:e.recoveryFetchVersion,fetchOnly:!0};let t=e.settingVersion??null;if(e.genNew)return{version:t,fetchOnly:void 0};let n=(t??0)>0?t:null,o=(e.codeVersion??0)>0?e.codeVersion:null,a=n??o??t;return{version:a,fetchOnly:a!=null&&a>0?!0:void 0}}function jr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=ve({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion}),u=e.fetchArmedAtMs,l=t&&typeof u=="number"&&Number.isSafeInteger(u)&&u>0?u:void 0;return{genNew:o,version:a.version,fetchOnly:a.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0,...l!==void 0?{fetchArmedAtMs:l}:{}}}function Yr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Qr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Xr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Jr(e,t,n){let o=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;return{...typeof e=="boolean"?{dataComplete:e}:{},...o(t)?{rowsWithheld:t}:{},...o(n)?{rowsFilteredOut:n}:{}}}var Zr={fit:"Best fit",variety:"Something different"};function Le(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function eo(e){let t=Le(e);return t?{qualifyOrder:t}:{}}function Ae(e,t){return e!=null&&t!=null&&e!==t}function to(e,t){return e?Ae(t.capturedFor,t.now)?{shortlist:void 0,stale:!0}:{shortlist:{...e,ageMs:t.atMs>0?Math.max(0,Math.round(t.nowMs-t.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var no=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Ie(e){let t=String(e??"").trim().toLowerCase();return no[t]??t}function Me(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Ie(n.dataType)]);return t}function ro(e){return B(Me(e))}var oo=2,io=3,so=4,ao=64,lo=8e3,uo=6e4,co=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),mo=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function fo(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function po(e){return e.hint?e.hint:e.generated?"generate":e.previous?e.outputHash!==e.previous.outputHash?"version":e.dataSignature!==e.previous.dataSignature?"data":e.viewport!==e.previous.viewport?"resize":"other":"open"}function go(){let e=new Set,t=new Set;return{firstDraw(n,o){if(!n)return!1;let a=`${n}|${o}`;return e.has(a)?!1:(e.add(a),!0)},firstInteract(n){return!n||t.has(n)?!1:(t.add(n),!0)}}}function yo(e){return!!e&&!e.includes("|")&&!e.includes(",")}function le(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function ho(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.clientVersion!="string"||t.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof t.timeoutMs!="number"||!Number.isFinite(t.timeoutMs)||t.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=t.timeoutMs,C=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,b=g=>{try{t.onFailure?.(g)}catch{}},h=async(g,f,c,p)=>{let y;try{let T=await a.post(f,c,p,{timeoutMs:i});y=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){b({channel:g,stage:"post",status:null,error:T});return}(y<200||y>299)&&b({channel:g,stage:"status",status:y,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${C()}${l}/LogClientMsg/?nocache=${u.now()}`,c=I(g),p=D(c,o)}catch(y){b({channel:"client-message",stage:"build",status:null,error:y});return}await h("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,y;try{p=`${C()}${l}/eventlog`,y=le(g,t.clientVersion,f,c)}catch(T){b({channel:"event-count",stage:"build",status:null,error:T});return}await h("event-count",p,y,{"Content-Type":"text/plain"})}}}var Ne=2**31-1;function Fe(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function Co(e){return typeof e=="number"&&e>0&&e<=Ne?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ne} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function bo(e,t={}){if(typeof e!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=e,o=t.credentials??"omit";return{async post(a,u,l,i){let C=i.timeoutMs,b=Co(C);if(b)throw b;let h=new AbortController,g=!1,f=setTimeout(()=>{g=!0,h.abort(Fe(C))},C),c=()=>h.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,y=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Fe(C):_,v;try{v=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:h.signal})}catch(_){throw y(),T(_)}let R=J(v),L=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...L,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{y()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){y(),_.close();return}_.enqueue(s.value)}catch(s){y(),_.error(T(s))}},cancel(_){return y(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var De=300;function ke(e){return String(e??"").toLowerCase().replace(/[^a-z0-9-]/g,"").slice(0,40)}var Eo="/LLMChart/",To="/LLMChart/qualify",So="/VisionReview/",Ro="/LLMChart/sample",xo="/RefundGenerate/",wo=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",z=async e=>JSON.parse(await e.text());function _o(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Oo(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(t.apiPath!==void 0&&typeof t.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(t.nocache!==void 0&&t.nocache!==null&&typeof t.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,C=g=>t.nocache?t.nocache(g):String(u.now());async function b(g,f,c,p,y){let T=`${i()}${l}${f}?nocache=${C(g)}`,v={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,L=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&wo(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,v,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return L(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)_o(x);else try{w=(await x.text()).slice(0,De)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await y(x)}}catch(w){return L(!0,w)}}function h(g,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${g} call needs a positive deadline in milliseconds`);return f}return{async generate(g,f){let c=h("generate",f),p=c.onStage??void 0;return b("generate",Eo,I(g),c,y=>Z(y,p))},async qualify(g,f){let c=h("qualify",f),p=c.route??To;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return b("qualify",p,I(g),c,z)},async review(g,f){let c=h("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return b("review",So,p,c,z)},async sample(g,f){let c=h("sample",f);return b("sample",Ro,I(g),c,z)},async refund(g,f,c){let p=h("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");let y=ke(c),T=y?{CorrelationID:g.trim(),Reason:y}:{CorrelationID:g.trim()};return b("refund",xo,JSON.stringify(T),p,z)}}}export{pn as ADMIN1_MATCH_PCT,gn as ADMIN1_MATCH_PCT_NAMED,j as CITY_ROLE_MATCH_PCT,jt as CITY_TIE_RATIO,co as CLIENT_EVENT_KINDS,Ur as CLIENT_SECRET_MISMATCH,Xe as COMPOUND_MIN_STEM,Et as CYCLE_MEMBERS,St as CYCLE_WORDS,Ce as DATE_LEVEL_GREGORIAN_YEAR_MAX,he as DATE_LEVEL_GREGORIAN_YEAR_MIN,xr as DATE_LEVEL_LANGUAGES,ae as DATE_LEVEL_NAMES,ye as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,jn as DEFAULT_GAP_FACTOR,lt as DEFAULT_TEMPERATURE,mo as DRAW_REASONS,Vr as FREEMIUM_ATTEMPT_SPENT,Wr as FREEMIUM_COLUMN_CAP,st as GET_RANDOM,Ze as GLUED_STEM_MIN,tt as HANGUL_MIN_STEM,Se as HOST_SYNTHETIC_COLUMNS,De as HTTP_BODY_START_CHARS,qn as IDENTIFIER_HEAD_INITIAL,$n as IDENTIFIER_UNFOLDED,Wn as IDENTIFIER_WORDS,_n as INTENSIVE_SUFFIX_TOKENS,wn as INTENSIVE_WORD_TOKENS,mr as IndexedText,Mt as LOOSE_KEY_MIN_LENGTH,Ft as LooseIndex,Yn as MAX_RUN_BOUNDS,$r as OAUTH_SIGNED_OUT,qr as OAUTH_TOKEN_EXPIRED,Ot as PERIOD_CODE_FORMS,_t as PERIOD_CODE_MEMBERS,Pt as PERIOD_ORDINALS,vt as PERIOD_UNFOLDED,Pn as POSITIONAL_SUFFIX_TOKENS,On as POSITIONAL_WORD_TOKENS,yr as PREVIEW_OMITTED_FIELDS,Pe as PROGRESS_STAGE_IDS,Zr as QUALIFY_ORDER_LABELS,Vt as REGION_FRAME_WINDOWS,A as ROLE_MATCH_PCT,Jn as SERIES_COMPLETENESS_MAX_LISTED,Zn as SERIES_COMPLETENESS_MIN_FILL,er as SERIES_KEY_MAX_DISTINCT,so as SEV_ERROR,oo as SEV_INFO,ao as SEV_USER_PRESENTED,io as SEV_WARNING,B as SIMPLE_STRING_HASH,it as STR,rt as SUBSTRING_MIN,Ve as SUPPORTED_LANGUAGES,Ue as SUPPORTED_LANGUAGE_CODES,uo as TELEMETRY_TIMEOUT_DEV_MS,lo as TELEMETRY_TIMEOUT_MS,$e as VOCABULARY_LANGUAGE_CODES,qe as VOCABULARY_ONLY_LANGUAGES,Tt as YEAR_WORDS,Qt as admin1CodesForName,Y as admin1LookupRegistered,q as admin1MatchPct,kn as allowedAggregations,Ct as anchorLocalWallClockDates,zr as answerIsRetryable,fn as buildGeoIsoColumn,an as buildGeoPointColumns,hn as buildProvinceIsoColumn,Rt as calendarWordIn,Yr as capabilityFields,un as cityMatchPct,ln as cityTagsFor,ur as classifyAdditivity,po as classifyDraw,Dn as classifyForAggregation,cr as classifyNumericValueNature,ar as classifyTemporal,Kt as clearAdmin1LookupForTests,In as codeNeedsLegacyAggNames,Hn as codeReadsColumn,Kn as codeReadsColumnsByRoleOrPosition,An as collapseRepeatedAggPrefix,Bn as columnsTheCodeReads,Bt as countryIso2,qt as countryRegion,go as createDrawLedger,Oo as createGenerateClient,ho as createTelemetryClient,Hr as credentialFields,Jr as dataCompletenessFields,_r as dateLevelPart,Or as dateLevelYearAdmits,bt as datesAreTimeOfDayOnly,yt as datesCarryTimeOfDay,En as decimalSeparatorOf,Gn as defaultAggregation,Tn as detectDecimalSeparator,bn as detectFormatSignature,cn as detectGeo,Gt as detectOrdinalDomain,sr as detectTextDatePattern,fo as drawLocation,I as encodePayload,fr as engineTypeForSqlType,Mn as englishImplicitAggNames,le as eventLogLine,jr as fetchFields,bo as fetchTransport,He as foldName,Ir as freemiumColumnCapRefusal,Re as freemiumColumnsOverCap,xe as freemiumDateHierarchyClauses,et as gluedPrefixStems,Ar as guardColumnNames,Cr as gzipWireText,nt as hangulWordEndsWith,Ln as hasDefaultAggPrefix,Ye as hasUnsegmentedScript,lr as hostAggHint,zt as inMiddleEast,gr as ingest,Vn as isAggregationAllowed,G as isBlankLike,en as isCityTableLoaded,$ as isColumnContextRef,at as isDeterministicRefusal,yo as isEventLogCode,on as isGeoPointAmbiguity,ir as isIdentifierName,mn as isJoinGeoKind,Jt as isKnownProvinceId,Er as isNdjsonContentType,Dt as isOrdinalFriendlyName,Nt as isUsableLooseKey,br as keyedSigner,Xr as leafCardinalityField,ft as localMidnightDateColumns,mt as localMidnightToUtcDay,ht as localWallClockDateColumns,wt as localizedCycleIn,zn as localizedIdentifierWordIn,xt as localizedYearWordIn,N as looksLikeCountryColumn,It as looseNameKey,ot as matchNameToken,Br as maxNonMeasureCardinality,Cn as measureAdmin1Columns,Xn as measureCadence,or as measurePersistence,rr as measureSeriesCompleteness,D as messageSignature,Lr as missingHardColumnRefs,xn as monthLookupFor,Be as nameLetterRuns,Fn as nameLooksIntensiveRate,Nn as nameLooksPositional,Ee as nameProbeIsGuarded,vr as nameProbeKeepsDrawing,Ke as nameWords,tn as normalizeCountry,pt as normalizeLocalMidnightDates,Rn as normalizeMonthKey,V as normalizePlaceName,rn as normalizeZip5,to as offeredShortlistFor,pr as parseCsvRows,ut as parseDateStable,Fr as parseGenerateResponse,Sn as parseNumberText,Dr as parseQualifyResponse,kr as parseReviewVerdict,Qn as parseTemporalPoint,hr as payloadPreview,At as periodCodeSeries,nr as pickSeriesColumn,Gr as progressStageOf,dr as promotesToMeasure,Xt as provinceIdForAdmin1Code,yn as provinceIdForRow,eo as qualifyOrderField,Le as qualifyOrderOf,Z as readGenerateStream,je as readName,Lt as readPeriodCode,E as readWireField,ke as refundReasonCode,Ht as registerAdmin1Lookup,Zt as registerCityTable,Wt as registerIso3Regions,M as resolveAdmin1,Yt as resolveCityAdmin1,ve as resolveFetchVersion,sn as resolveGeoPoint,ze as resolveLanguage,Rr as resolvePointRoles,Qr as retryFields,kt as safeDistinctValuesToShip,Me as schemaIdentity,ro as schemaIdentityKey,Ie as schemaTypeFamily,tr as seriesKeyVerdict,Un as shareOfTotalIsHonest,Ae as shortlistIsStale,vn as stripHostAggPrefix,$t as summarizeCountryRegions,Ut as summarizeGeoExtent,We as supportedLanguage,dn as toGeoIso,Qe as unsegmentedRuns,gt as utcWallClock,Kr as viewportFields,K as vocabularyLanguage,ct as wholeDayFrame,dt as wholeDayIso,J as wireResponseFromFetch,Je as wordEndsWith,ie as zipMatchPct,W as zipPrefixCandidates,nn as zipToPrefix3};
2
+ import{a as yr,b as hr}from"./chunk-HIVICMC5.mjs";import{a as Cr,b as M,c as br,d as D,e as E,f as Er,g as J,h as Z}from"./chunk-4J7WPYLM.mjs";import{a as fr,b as pr,c as gr}from"./chunk-QHZYDO3U.mjs";import{A as Hn,B as Kn,C as Bn,D as jn,E as Yn,F as Qn,G as Xn,H as Jn,I as Zn,J as er,K as tr,L as nr,M as rr,N as or,O as ir,P as sr,Q as ar,R as lr,S as ur,T as cr,U as dr,W as mr,a as pn,b as gn,c as yn,d as hn,e as Cn,g as wn,h as _n,i as On,j as Pn,k as An,l as vn,m as Ln,n as Mn,o as In,p as Nn,q as Fn,r as Dn,s as kn,t as Gn,u as Vn,v as Un,w as Wn,x as qn,y as $n,z as zn}from"./chunk-O6A7HGFH.mjs";import{a as bn}from"./chunk-U3H6UBOO.mjs";import{b as En,c as Tn,d as Sn,f as Rn,g as xn}from"./chunk-TZ74QIKA.mjs";import{a as de,c as me,e as cn,f as dn,g as mn,h as fn}from"./chunk-YDYFP2T4.mjs";import{A as Q,B as Zt,C as en,D as ce,E as I,F as tn,G as nn,H as rn,I as W,J as on,K as sn,L as an,M as ln,N as X,O as un,a as L,b as G,c as j,d as V,j as U,k as Vt,l as Ut,m as Wt,n as qt,o as $t,q as zt,r as Ht,s as Y,t as Kt,u as Bt,v as jt,w as Yt,x as Qt,y as Xt,z as Jt}from"./chunk-DTBXJVUG.mjs";import"./chunk-5MRZID36.mjs";import{a as Et,b as Tt,c as St,d as Rt,e as xt,f as wt,g as _t,h as Ot,i as Pt,j as At,k as vt,l as Lt,m as Dt,n as kt,o as Gt}from"./chunk-3ZAS32F5.mjs";import{b as Mt,c as It,d as Nt,e as Ft}from"./chunk-5HI6TVMM.mjs";import{A as gt,B as yt,C as ht,D as Ct,E as bt,a as He,b as Ke,c as Be,d as je,e as Ye,f as Qe,g as Xe,h as Je,i as Ze,j as et,k as tt,l as nt,m as rt,n as ot,o as it,q as B,r as st,s as at,t as lt,u as ut,v as ct,w as dt,x as mt,y as ft,z as pt}from"./chunk-CZJ7M6A5.mjs";import{a as Ve,b as Ue,c as We,d as qe,e as $e,f as K,g as ze}from"./chunk-WC4JINEZ.mjs";var ee=2,ge=400;function ne(e){return!!U(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=V(String(n));if(!G(o)&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||re(e)<95)return!1;let n=t.filter(a=>ne(a)&&!I(a)).length,o=t.filter(a=>!ne(a)&&!!I(a)).length;return n>=1&&n>=o}function fe(e,t){if(!I(e))return!1;let n=U(e);return n?t==="world"?!0:ce.has(n):!1}function re(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)ne(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){return I(e)?!0:Y()?Q(e).status!=="unmatched"||Q(e.trim().replace(/\s+/g,"-")).status!=="unmatched":!1}function q(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)oe(o)&&n++;return Math.round(n/t.length*1e3)/10}function se(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!G(V(o))&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function ie(e){let t=se(e);if(t.length===0)return 0;let n=0;for(let o of t)W(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function pe(e,t){return me(t,de)?!0:se(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Tr(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)X(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function te(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function Sr(e,t){let n=0;for(let o of se(e))t(o)&&n++;return n}function Rr(e,t,n,o,a){let u=[],l=[],i={},y={},h=new Set(e),b=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&h.has(d)&&(i[s]=d)}let g=new Set(a??e);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&h.has(f)){let s=b(f),d=ie(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):pe(s,f)?i.zip=f:l.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&h.has(c)){let s=b(c),d=F(s);d.length>0&&d.every(S=>fe(S,o))?l.push(`state=${c} (every value is "CA", which is both Canada and California)`):N(s)?(l.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):q(s)<95?l.push(`state=${c} (only ${q(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),C=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of C){let S=b(d);if(N(S))continue;let O=q(S);if(O<95)continue;let H=te(S,oe),Ge=te(S,ue=>oe(ue)&&!fe(ue,o));H<ee&&Ge<1||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.state=s.name,p.add(s.name),u.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of C){if(p.has(s))continue;let d=b(s),S=ie(d);if(!(S<95)&&pe(d,s)&&!(Sr(d,O=>W(O).length>0)<ee)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!N(b(T))){let s=null;for(let d of C){if(p.has(d)||!N(b(d)))continue;let S=re(b(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${re(b(T))}% of values are country identifiers; using ${s.name} instead)`),y.country=T),i.country=s.name,p.add(s.name),u.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of C){if(p.has(d))continue;let S=b(d),O=Tr(S,o);O<j||te(S,H=>X(H,o))<ee||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let A=i.country?b(i.country):[],R=!!i.country&&N(A),v=R?new Set(A.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&v>=2,w=!!(i.lat&&i.lon)&&t.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=90&&S>=-180&&S<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!w&&l.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&l.push(R?`country=${i.country} (every row resolves to the same country - nothing to place apart)`:`country=${i.country} (values are not country identifiers)`),{bind:!!(i.city||i.state||i.zip||x||w)?i:null,backfilled:u,refused:l,...Object.keys(y).length?{labelFallback:y}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ae=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),xr=Object.freeze(Array.from(new Set(Object.values(ae).flatMap(e=>e.langs)))),ye=Object.freeze(["fa","ar","he","th"]),he=1900,Ce=2100;function wr(e,t){let n=[],o=K(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function _r(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of wr(n,t)){let a=ae[o];if(a&&a.langs.includes(t))return a.part}return null}function Or(e,t){return ye.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=he&&t<=Ce:!0}function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pr=/\b(?:columns|cols|column)\b/i;function $(e,t){let n=Math.max(0,t-240),o=e.slice(n,t),a=o.lastIndexOf(";");return a>=0&&(o=o.slice(a+1)),Pr.test(o)}function Ee(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Te(e,t,n){let o=be(t),a=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),l=0,i;for(;(i=u.exec(e))!==null;)$(e,i.index)&&l++;let y=0;for(;(i=a.exec(e))!==null;){let h=i.index+i[0].lastIndexOf(".name");if(!$(e,h))continue;y++;let b=be(i[1]);if(!n(b))return!1}return y>0&&y===l}function Ar(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(e)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(e))}var Se=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function vr(e,t){if(!e)return[];let n=new Set(t);for(let i of Se)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)$(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||Ee(e,i)||l.push(i)}),l}function Lr(e,t){if(!e)return[];let n=(e.getColumns()||[]).map(o=>o.name);if(!t||typeof e.aliasesForCode!="function")return n;for(let o of e.aliasesForCode(t))n.push(o.alias);return n}function Re(e,t){let n=t?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(e)||e<=n?0:Math.round(e-n)}function Mr(e,t,n){let o=Re(e,t);if(o===null||o<=0)return null;let a=typeof t?.freemiumColumnCapPivot=="number"?t.freemiumColumnCapPivot:4,u=o>a?t?.freemiumColumnCapMessageMany:t?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let l=u.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=xe(n);return i.length===0?l:l+" "+i.join(" ")}function xe(e){if(!e||e.length===0)return[];let t=[],n=new Map,o=new Map;for(let u of e){let l=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(l!==""&&(n.has(l)||(t.push(l),n.set(l,0)),u.isDatePart===!0&&n.set(l,n.get(l)+1),u.isReassembledDate===!0&&!o.has(l))){let i=typeof u.sourceField=="string"?u.sourceField.trim():"",y=typeof u.name=="string"?u.name.trim():"",h=i!==""?i:y;h!==""&&o.set(l,h)}}let a=[];for(let u of t){let l=o.get(u),i=n.get(u)??0;!l||i===0||a.push(`'${l}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return a}var m=e=>e==null?"":String(e),P=e=>e===!0,we=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function _e(e,t){let n={};for(let[o,a]of Ir){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function Nr(e){return Array.isArray(e)?e.map(t=>({code:m(E(t,"code")),severity:m(E(t,"severity")),text:m(E(t,"text"))})).filter(t=>t.text!==""):[]}function Fr(e){let t=h=>E(e,h),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=_e(e,"point"),l=_e(e,"destPoint");Object.keys(l).length&&(u.dest=l);let i=t("retryable"),y=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:Nr(t("notices")),freemiumStatusCode:m(t("freemiumStatusCode")),code:m(t("code")),language:m(t("language")),version:Number(t("version")??0),codeSummary:m(t("codeSummary")),chartName:m(t("chartName")??t("chartType")),finalChartName:m(t("finalChartName")),warningMessage:m(t("warningMessage")),outputHash:m(t("outputHash")),validatorToken:m(t("validatorToken")),editCodeKey:m(t("editCodeKey")),signedLLMRequestID:m(t("signedLLMRequestID")),userReply:m(t("userReply")),userReplyOutcome:m(t("userReplyOutcome")),improvementSuggestion:m(t("improvementSuggestion")),geoColumn:m(t("geoColumn")),geoKind:m(t("geoKind")),geoPointCols:Object.keys(u).length?u:null,creditBalanceBefore:we(t("creditBalanceBefore")),creditCost:we(t("creditCost")),isServiceError:P(t("isServiceError")),isRateLimited:P(t("isRateLimited")),suppressSelectionGlyph:P(t("suppressSelectionGlyph")),isRefusal:P(t("isRefusal")),isVersionNotFound:P(t("isVersionNotFound")),isGenerationCancelled:P(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof y=="boolean"?{isPollFinal:y}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof a=="boolean"?{forceThumbnailUpload:a}:{}}}var Oe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function Dr(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let l=y=>E(u,y),i=l("recommended");return{name:m(l("chartTypeName")??l("name")),description:m(l("description")??l("chartDesc")),rank:Oe(l("rank")),score:Oe(l("score")),renderer:k(l("renderer")),language:k(l("language")),isPreview:P(l("isPreview")),alsoWorthALook:P(l("alsoWorthALook")),recommended:typeof i=="boolean"?i:void 0,viaProjection:k(l("viaProjection")),viaProjectionKey:k(l("viaProjectionKey")),detailNote:k(l("detailNote"))}}).filter(u=>u.name):null,a=Array.isArray(n)?n.map(u=>({name:m(E(u,"chartTypeName")??E(u,"name")),reason:m(E(u,"reason")),reasonCode:m(E(u,"reasonCode")),isVeto:P(E(u,"isVeto"))})).filter(u=>u.name):[];return{errorMessage:m(E(e,"errorMessage")),errorCode:m(E(e,"errorCode")),charts:o,refused:a,noFitSummary:m(E(e,"noFitSummary"))}}function kr(e){return!e||typeof e!="object"?null:{status:String(E(e,"status")??""),verdictReason:E(e,"verdictReason")??null,instruction:E(e,"instruction")??null,fix:E(e,"fix")??null,errorMessage:E(e,"errorMessage")??null,errorCode:E(e,"errorCode")??null}}var Pe=["working","analyze","generate","refine","review"];function Gr(e,t){let n=String(e??"").trim().toLowerCase();if(Pe.includes(n))return n;let o=String(t??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var Vr="FREEMIUM_ATTEMPT_SPENT",Ur="CLIENT_SECRET_MISMATCH",Wr="FREEMIUM_COLUMN_CAP",qr="OAUTH_TOKEN_EXPIRED",$r="OAUTH_SIGNED_OUT";function zr(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Hr(e){let t=e.linkNonce?(e.linkNonce()??"").trim():null,n=t?null:e.accessToken?(e.accessToken()??"").trim():null,o=t||n?{licensee:"",licenseKey:"",secretKey:""}:e.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:e.freemiumKey?.()??""},linkNonce:t,accessToken:n}}function Kr(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function Br(e){let t=0;for(let n of e){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>t&&(t=o)}return t}function Ae(e){if(e.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(e.recoveryFetchVersion!=null)return{version:e.recoveryFetchVersion,fetchOnly:!0};let t=e.settingVersion??null;if(e.genNew)return{version:t,fetchOnly:void 0};let n=(t??0)>0?t:null,o=(e.codeVersion??0)>0?e.codeVersion:null,a=n??o??t;return{version:a,fetchOnly:a!=null&&a>0?!0:void 0}}function jr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=Ae({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion}),u=e.fetchArmedAtMs,l=t&&typeof u=="number"&&Number.isSafeInteger(u)&&u>0?u:void 0,i=e.fetchCutAtMs,y=t&&typeof i=="number"&&Number.isSafeInteger(i)&&i>0?i:void 0,h=t?Yr(e.fetchCause):"";return{genNew:o,version:a.version,fetchOnly:a.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0,...l!==void 0?{fetchArmedAtMs:l}:{},...y!==void 0?{fetchCutAtMs:y}:{},...h?{fetchCause:h}:{}}}function Yr(e){if(typeof e!="string")return"";let t=e.replace(/[\u0000-\u001f\u007f]+/g," ").trim().slice(0,120);return/[\ud800-\udbff]$/.test(t)&&(t=t.slice(0,-1)),t.trimEnd()}function Qr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Xr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Jr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Zr(e,t,n){let o=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;return{...typeof e=="boolean"?{dataComplete:e}:{},...o(t)?{rowsWithheld:t}:{},...o(n)?{rowsFilteredOut:n}:{}}}var eo={fit:"Best fit",variety:"Something different"};function ve(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function to(e){let t=ve(e);return t?{qualifyOrder:t}:{}}function Le(e,t){return e!=null&&t!=null&&e!==t}function no(e,t){return e?Le(t.capturedFor,t.now)?{shortlist:void 0,stale:!0}:{shortlist:{...e,ageMs:t.atMs>0?Math.max(0,Math.round(t.nowMs-t.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var ro=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Me(e){let t=String(e??"").trim().toLowerCase();return ro[t]??t}function Ie(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Me(n.dataType)]);return t}function oo(e){return B(Ie(e))}var io=2,so=3,ao=4,lo=64,uo=8e3,co=6e4,mo=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),fo=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function po(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function go(e){return e.hint?e.hint:e.generated?"generate":e.previous?e.outputHash!==e.previous.outputHash?"version":e.dataSignature!==e.previous.dataSignature?"data":e.viewport!==e.previous.viewport?"resize":"other":"open"}function yo(){let e=new Set,t=new Set;return{firstDraw(n,o){if(!n)return!1;let a=`${n}|${o}`;return e.has(a)?!1:(e.add(a),!0)},firstInteract(n){return!n||t.has(n)?!1:(t.add(n),!0)}}}function ho(e){return!!e&&!e.includes("|")&&!e.includes(",")}function le(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function Co(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.clientVersion!="string"||t.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof t.timeoutMs!="number"||!Number.isFinite(t.timeoutMs)||t.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=t.timeoutMs,y=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,h=g=>{try{t.onFailure?.(g)}catch{}},b=async(g,f,c,p)=>{let C;try{let T=await a.post(f,c,p,{timeoutMs:i});C=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){h({channel:g,stage:"post",status:null,error:T});return}(C<200||C>299)&&h({channel:g,stage:"status",status:C,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${y()}${l}/LogClientMsg/?nocache=${u.now()}`,c=M(g),p=D(c,o)}catch(C){h({channel:"client-message",stage:"build",status:null,error:C});return}await b("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,C;try{p=`${y()}${l}/eventlog`,C=le(g,t.clientVersion,f,c)}catch(T){h({channel:"event-count",stage:"build",status:null,error:T});return}await b("event-count",p,C,{"Content-Type":"text/plain"})}}}var Ne=2**31-1;function Fe(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function bo(e){return typeof e=="number"&&e>0&&e<=Ne?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ne} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Eo(e,t={}){if(typeof e!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=e,o=t.credentials??"omit";return{async post(a,u,l,i){let y=i.timeoutMs,h=bo(y);if(h)throw h;let b=new AbortController,g=!1,f=setTimeout(()=>{g=!0,b.abort(Fe(y))},y),c=()=>b.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,C=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Fe(y):_,A;try{A=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:b.signal})}catch(_){throw C(),T(_)}let R=J(A),v=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...v,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{C()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){C(),_.close();return}_.enqueue(s.value)}catch(s){C(),_.error(T(s))}},cancel(_){return C(),x.cancel(_)}});return{status:R.status,...v,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var De=300;function ke(e){return String(e??"").toLowerCase().replace(/[^a-z0-9-]/g,"").slice(0,40)}var To="/LLMChart/",So="/LLMChart/qualify",Ro="/VisionReview/",xo="/LLMChart/sample",wo="/RefundGenerate/",_o=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",z=async e=>JSON.parse(await e.text());function Oo(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Po(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(t.apiPath!==void 0&&typeof t.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(t.nocache!==void 0&&t.nocache!==null&&typeof t.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,y=g=>t.nocache?t.nocache(g):String(u.now());async function h(g,f,c,p,C){let T=`${i()}${l}${f}?nocache=${y(g)}`,A={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,v=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&_o(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,A,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return v(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)Oo(x);else try{w=(await x.text()).slice(0,De)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await C(x)}}catch(w){return v(!0,w)}}function b(g,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${g} call needs a positive deadline in milliseconds`);return f}return{async generate(g,f){let c=b("generate",f),p=c.onStage??void 0;return h("generate",To,M(g),c,C=>Z(C,p))},async qualify(g,f){let c=b("qualify",f),p=c.route??So;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return h("qualify",p,M(g),c,z)},async review(g,f){let c=b("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return h("review",Ro,p,c,z)},async sample(g,f){let c=b("sample",f);return h("sample",xo,M(g),c,z)},async refund(g,f,c){let p=b("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");let C=ke(c),T=C?{CorrelationID:g.trim(),Reason:C}:{CorrelationID:g.trim()};return h("refund",wo,JSON.stringify(T),p,z)}}}export{pn as ADMIN1_MATCH_PCT,gn as ADMIN1_MATCH_PCT_NAMED,j as CITY_ROLE_MATCH_PCT,jt as CITY_TIE_RATIO,mo as CLIENT_EVENT_KINDS,Ur as CLIENT_SECRET_MISMATCH,Xe as COMPOUND_MIN_STEM,Et as CYCLE_MEMBERS,St as CYCLE_WORDS,Ce as DATE_LEVEL_GREGORIAN_YEAR_MAX,he as DATE_LEVEL_GREGORIAN_YEAR_MIN,xr as DATE_LEVEL_LANGUAGES,ae as DATE_LEVEL_NAMES,ye as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,jn as DEFAULT_GAP_FACTOR,lt as DEFAULT_TEMPERATURE,fo as DRAW_REASONS,Vr as FREEMIUM_ATTEMPT_SPENT,Wr as FREEMIUM_COLUMN_CAP,st as GET_RANDOM,Ze as GLUED_STEM_MIN,tt as HANGUL_MIN_STEM,Se as HOST_SYNTHETIC_COLUMNS,De as HTTP_BODY_START_CHARS,qn as IDENTIFIER_HEAD_INITIAL,$n as IDENTIFIER_UNFOLDED,Wn as IDENTIFIER_WORDS,_n as INTENSIVE_SUFFIX_TOKENS,wn as INTENSIVE_WORD_TOKENS,mr as IndexedText,It as LOOSE_KEY_MIN_LENGTH,Ft as LooseIndex,Yn as MAX_RUN_BOUNDS,$r as OAUTH_SIGNED_OUT,qr as OAUTH_TOKEN_EXPIRED,Ot as PERIOD_CODE_FORMS,_t as PERIOD_CODE_MEMBERS,Pt as PERIOD_ORDINALS,At as PERIOD_UNFOLDED,Pn as POSITIONAL_SUFFIX_TOKENS,On as POSITIONAL_WORD_TOKENS,yr as PREVIEW_OMITTED_FIELDS,Pe as PROGRESS_STAGE_IDS,eo as QUALIFY_ORDER_LABELS,Vt as REGION_FRAME_WINDOWS,L as ROLE_MATCH_PCT,Jn as SERIES_COMPLETENESS_MAX_LISTED,Zn as SERIES_COMPLETENESS_MIN_FILL,er as SERIES_KEY_MAX_DISTINCT,ao as SEV_ERROR,io as SEV_INFO,lo as SEV_USER_PRESENTED,so as SEV_WARNING,B as SIMPLE_STRING_HASH,it as STR,rt as SUBSTRING_MIN,Ve as SUPPORTED_LANGUAGES,Ue as SUPPORTED_LANGUAGE_CODES,co as TELEMETRY_TIMEOUT_DEV_MS,uo as TELEMETRY_TIMEOUT_MS,$e as VOCABULARY_LANGUAGE_CODES,qe as VOCABULARY_ONLY_LANGUAGES,Tt as YEAR_WORDS,Qt as admin1CodesForName,Y as admin1LookupRegistered,q as admin1MatchPct,kn as allowedAggregations,Ct as anchorLocalWallClockDates,zr as answerIsRetryable,fn as buildGeoIsoColumn,an as buildGeoPointColumns,hn as buildProvinceIsoColumn,Rt as calendarWordIn,Qr as capabilityFields,un as cityMatchPct,ln as cityTagsFor,ur as classifyAdditivity,go as classifyDraw,Dn as classifyForAggregation,cr as classifyNumericValueNature,ar as classifyTemporal,Kt as clearAdmin1LookupForTests,Mn as codeNeedsLegacyAggNames,Hn as codeReadsColumn,Kn as codeReadsColumnsByRoleOrPosition,Ln as collapseRepeatedAggPrefix,Bn as columnsTheCodeReads,Bt as countryIso2,qt as countryRegion,yo as createDrawLedger,Po as createGenerateClient,Co as createTelemetryClient,Hr as credentialFields,Zr as dataCompletenessFields,_r as dateLevelPart,Or as dateLevelYearAdmits,bt as datesAreTimeOfDayOnly,yt as datesCarryTimeOfDay,En as decimalSeparatorOf,Gn as defaultAggregation,Tn as detectDecimalSeparator,bn as detectFormatSignature,cn as detectGeo,Gt as detectOrdinalDomain,sr as detectTextDatePattern,po as drawLocation,M as encodePayload,fr as engineTypeForSqlType,In as englishImplicitAggNames,le as eventLogLine,jr as fetchFields,Eo as fetchTransport,He as foldName,Mr as freemiumColumnCapRefusal,Re as freemiumColumnsOverCap,xe as freemiumDateHierarchyClauses,et as gluedPrefixStems,Lr as guardColumnNames,Cr as gzipWireText,nt as hangulWordEndsWith,vn as hasDefaultAggPrefix,Ye as hasUnsegmentedScript,lr as hostAggHint,zt as inMiddleEast,gr as ingest,Vn as isAggregationAllowed,G as isBlankLike,en as isCityTableLoaded,$ as isColumnContextRef,at as isDeterministicRefusal,ho as isEventLogCode,on as isGeoPointAmbiguity,ir as isIdentifierName,mn as isJoinGeoKind,Jt as isKnownProvinceId,Er as isNdjsonContentType,Dt as isOrdinalFriendlyName,Nt as isUsableLooseKey,br as keyedSigner,Jr as leafCardinalityField,ft as localMidnightDateColumns,mt as localMidnightToUtcDay,ht as localWallClockDateColumns,wt as localizedCycleIn,zn as localizedIdentifierWordIn,xt as localizedYearWordIn,N as looksLikeCountryColumn,Mt as looseNameKey,ot as matchNameToken,Br as maxNonMeasureCardinality,Cn as measureAdmin1Columns,Xn as measureCadence,or as measurePersistence,rr as measureSeriesCompleteness,D as messageSignature,vr as missingHardColumnRefs,xn as monthLookupFor,Be as nameLetterRuns,Fn as nameLooksIntensiveRate,Nn as nameLooksPositional,Ee as nameProbeIsGuarded,Ar as nameProbeKeepsDrawing,Ke as nameWords,tn as normalizeCountry,pt as normalizeLocalMidnightDates,Rn as normalizeMonthKey,V as normalizePlaceName,rn as normalizeZip5,no as offeredShortlistFor,pr as parseCsvRows,ut as parseDateStable,Fr as parseGenerateResponse,Sn as parseNumberText,Dr as parseQualifyResponse,kr as parseReviewVerdict,Qn as parseTemporalPoint,hr as payloadPreview,Lt as periodCodeSeries,nr as pickSeriesColumn,Gr as progressStageOf,dr as promotesToMeasure,Xt as provinceIdForAdmin1Code,yn as provinceIdForRow,to as qualifyOrderField,ve as qualifyOrderOf,Z as readGenerateStream,je as readName,vt as readPeriodCode,E as readWireField,ke as refundReasonCode,Ht as registerAdmin1Lookup,Zt as registerCityTable,Wt as registerIso3Regions,I as resolveAdmin1,Yt as resolveCityAdmin1,Ae as resolveFetchVersion,sn as resolveGeoPoint,ze as resolveLanguage,Rr as resolvePointRoles,Xr as retryFields,kt as safeDistinctValuesToShip,Ie as schemaIdentity,oo as schemaIdentityKey,Me as schemaTypeFamily,tr as seriesKeyVerdict,Un as shareOfTotalIsHonest,Le as shortlistIsStale,An as stripHostAggPrefix,$t as summarizeCountryRegions,Ut as summarizeGeoExtent,We as supportedLanguage,dn as toGeoIso,Qe as unsegmentedRuns,gt as utcWallClock,Kr as viewportFields,K as vocabularyLanguage,ct as wholeDayFrame,dt as wholeDayIso,J as wireResponseFromFetch,Je as wordEndsWith,ie as zipMatchPct,W as zipPrefixCandidates,nn as zipToPrefix3};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{O as a,P as b,Q as c,R as d,S as e,T as f,U as g,V as h,W as i}from"./chunk-PUXXFTDT.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-TZ74QIKA.mjs";import"./chunk-WTJVREEE.mjs";import"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-3ZAS32F5.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{i as IndexedText,e as classifyAdditivity,f as classifyNumericValueNature,c as classifyTemporal,b as detectTextDatePattern,d as hostAggHint,a as isIdentifierName,g as promotesToMeasure,h as trimmedCells};
2
+ import{O as a,P as b,Q as c,R as d,S as e,T as f,U as g,V as h,W as i}from"./chunk-O6A7HGFH.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-TZ74QIKA.mjs";import"./chunk-YDYFP2T4.mjs";import"./chunk-DTBXJVUG.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-3ZAS32F5.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{i as IndexedText,e as classifyAdditivity,f as classifyNumericValueNature,c as classifyTemporal,b as detectTextDatePattern,d as hostAggHint,a as isIdentifierName,g as promotesToMeasure,h as trimmedCells};
package/dist/ingest.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a,b,c}from"./chunk-GR25KIHB.mjs";import"./chunk-PUXXFTDT.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-TZ74QIKA.mjs";import"./chunk-WTJVREEE.mjs";import"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-3ZAS32F5.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{a as engineTypeForSqlType,c as ingest,b as parseCsvRows};
2
+ import{a,b,c}from"./chunk-QHZYDO3U.mjs";import"./chunk-O6A7HGFH.mjs";import"./chunk-U3H6UBOO.mjs";import"./chunk-TZ74QIKA.mjs";import"./chunk-YDYFP2T4.mjs";import"./chunk-DTBXJVUG.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-3ZAS32F5.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{a as engineTypeForSqlType,c as ingest,b as parseCsvRows};
@@ -335,6 +335,8 @@ export type LLMRequestCode = {
335
335
  fetchOnly?: boolean;
336
336
  fetchCorrelationId?: string;
337
337
  fetchArmedAtMs?: number;
338
+ fetchCutAtMs?: number;
339
+ fetchCause?: string;
338
340
  model?: string;
339
341
  renderer?: string;
340
342
  language?: string;
@@ -90,6 +90,16 @@ export interface FetchRequest {
90
90
  * milliseconds on the host's own clock. Used only with `fetchCorrelationId`; see `fetchFields`.
91
91
  */
92
92
  fetchArmedAtMs?: number | null;
93
+ /**
94
+ * When the stream of the generation a correlation poll recovers was cut: epoch milliseconds on the host's own
95
+ * clock (the clock `fetchArmedAtMs` uses). Used only with `fetchCorrelationId`; logged, never a decision input.
96
+ */
97
+ fetchCutAtMs?: number | null;
98
+ /**
99
+ * Why that poll runs - what cut the stream, as the host saw it ("stream-cut: terminated", "transport-lost").
100
+ * Used only with `fetchCorrelationId`; sent as one line of at most 120 characters, logged, never parsed.
101
+ */
102
+ fetchCause?: string | null;
93
103
  /** A recovery poll keyed by version. null/absent = not one. */
94
104
  recoveryFetchVersion?: number | null;
95
105
  /** A version the reader stated - asked for by number. null or 0 mean "no preference", never "version zero". */
@@ -105,6 +115,10 @@ export interface FetchFields {
105
115
  fetchCorrelationId: string | undefined;
106
116
  /** Present only on a poll by correlation that stated a usable arm time; never a key holding `undefined`. */
107
117
  fetchArmedAtMs?: number;
118
+ /** Present only on a poll by correlation that stated a usable cut time. */
119
+ fetchCutAtMs?: number;
120
+ /** Present only on a poll by correlation that stated a cause with any text in it. */
121
+ fetchCause?: string;
108
122
  }
109
123
  /**
110
124
  * WHICH VERSION A REQUEST ASKS FOR, AND WHETHER THE SERVER MAY FALL THROUGH TO MAKING A NEW ONE.
@@ -152,6 +166,13 @@ export declare function resolveFetchVersion(i: {
152
166
  * server binds it as an integer, and a value it cannot bind (a fraction, a string, an exponent form)
153
167
  * fails the whole request rather than just that field, so it is sent only as a positive whole number
154
168
  * and its key is left off otherwise. A server that predates the field drops it unread.
169
+ *
170
+ * THE CUT TIME AND CAUSE ride a poll by correlation too, when the host knows them: when the stream it is
171
+ * recovering was cut, on the same clock as the arm time, and why. The server logs them and stores them on
172
+ * the row the poll writes; it decides nothing on them. The cut time follows the arm time's integer rule.
173
+ * The cause is free text from the host, so it is sent as one line - control characters become a space -
174
+ * of at most 120 characters, and not at all when nothing is left. Both keys come after the arm time, so a
175
+ * caller that states neither serialises exactly as before.
155
176
  */
156
177
  export declare function fetchFields(r: FetchRequest): FetchFields;
157
178
  /** The renderer capability flags a generate request carries. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/shape-core",
3
- "version": "0.6.108",
3
+ "version": "0.6.110",
4
4
  "description": "Host-agnostic data-shape profiler: ingest a dataset's rows through IValueCollection.addRow and read back the measured shape as an LLMColumnWithValue[] payload — types, cardinality, temporal/ordinal detection, geographic region and point resolution, cross-column signals. MEASUREMENT only: the policy that decides what a measured shape means for chart selection lives server-side.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",