@bicharts/shape-core 0.6.103 → 0.6.106
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.
- package/dist/{chunk-HJA26Z2E.mjs → chunk-3ZAS32F5.mjs} +1 -1
- package/dist/chunk-AAPXJXEP.mjs +6 -0
- package/dist/chunk-GR25KIHB.mjs +2 -0
- package/dist/chunk-PUXXFTDT.mjs +2 -0
- package/dist/{chunk-A4PQBWRA.mjs → chunk-TZ74QIKA.mjs} +1 -1
- package/dist/chunk-WTJVREEE.mjs +2 -0
- package/dist/geoDetector.mjs +1 -1
- package/dist/geoPoint.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/indexedText.mjs +1 -1
- package/dist/ingest.mjs +1 -1
- package/dist/monthNames.mjs +1 -1
- package/dist/ordinalDetector.mjs +1 -1
- package/dist/types/admin1Lookup.d.ts +77 -0
- package/dist/types/admin1Signals.d.ts +72 -0
- package/dist/types/geoDetector.d.ts +3 -1
- package/dist/types/geoExtent.d.ts +22 -0
- package/dist/types/geoPoint.d.ts +7 -1
- package/dist/types/geoPointRoles.d.ts +0 -1
- package/dist/types/index.d.ts +7 -2
- package/dist/types/indexedText.d.ts +16 -9
- package/dist/types/ingest.d.ts +3 -0
- package/dist/types/models.d.ts +16 -0
- package/package.json +1 -1
- package/dist/chunk-AMMJRSAC.mjs +0 -2
- package/dist/chunk-CQS6BGRJ.mjs +0 -2
- package/dist/chunk-INMDBTAR.mjs +0 -2
- package/dist/chunk-IPPPCWAK.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
package/dist/geoDetector.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,d,e,f}from"./chunk-
|
|
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};
|
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{
|
|
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};
|
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 Jn,b as Zn}from"./chunk-HIVICMC5.mjs";import{a as er,b as I,c as tr,d as D,e as E,f as nr,g as X,h as J}from"./chunk-4J7WPYLM.mjs";import{a as Yn,b as Qn,c as Xn}from"./chunk-AMMJRSAC.mjs";import{A as Pn,B as vn,C as Ln,D as An,E as Mn,F as In,G as Nn,H as Fn,I as Dn,J as kn,K as Gn,L as Vn,M as Un,N as Wn,O as qn,P as $n,Q as zn,R as Hn,S as Kn,T as Bn,V as jn,a as Qt,b as Xt,c as Jt,d as Zt,f as an,g as ln,h as un,i as cn,j as dn,k as mn,l as fn,m as pn,n as gn,o as yn,p as hn,q as Cn,r as bn,s as En,t as Tn,u as Sn,v as Rn,w as xn,x as wn,y as _n,z as On}from"./chunk-CQS6BGRJ.mjs";import{a as en}from"./chunk-U3H6UBOO.mjs";import{b as tn,c as nn,d as rn,f as on,g as sn}from"./chunk-A4PQBWRA.mjs";import{a as le,b as ue,c as Kt,d as Bt,e as jt,f as Yt}from"./chunk-IPPPCWAK.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as Dt,m as kt,n as ae,o as v,p as Gt,q as Vt,r as Ut,s as q,t as Wt,u as qt,v as $t,w as zt,x as Q,y as Ht}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ht,b as Ct,c as bt,d as Et,e as Tt,f as St,g as Rt,h as xt,i as wt,j as _t,k as Ot,l as Pt,m as It,n as Nt,o as Ft}from"./chunk-HJA26Z2E.mjs";import{A as mt,B as ft,C as pt,D as gt,E as yt,a as qe,b as $e,c as ze,d as He,e as Ke,f as Be,g as je,h as Ye,i as Qe,j as Xe,k as Je,l as Ze,m as et,n as tt,o as nt,q as j,r as rt,s as ot,t as it,u as st,v as at,w as lt,x as ut,y as ct,z as dt}from"./chunk-CZJ7M6A5.mjs";import{a as De,b as ke,c as Ge,d as Ve,e as Ue,f as B,g as We}from"./chunk-WC4JINEZ.mjs";import{b as vt,c as Lt,d as At,e as Mt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(e){return!!W(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=U(String(n));if(!V(o)&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||ne(e)<95)return!1;let n=t.filter(a=>te(a)&&!v(a)).length,o=t.filter(a=>!te(a)&&!!v(a)).length;return n>=1&&n>=o}function ce(e,t){if(!v(e))return!1;let n=W(e);return n?t==="world"?!0:ae.has(n):!1}function ne(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)te(o)&&n++;return Math.round(n/t.length*1e3)/10}function $(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)v(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function re(e){let t=oe(e);if(t.length===0)return 0;let n=0;for(let o of t)q(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function de(e,t){return ue(t,le)?!0:oe(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function rr(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)Q(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function ee(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function or(e,t){let n=0;for(let o of oe(e))t(o)&&n++;return n}function ir(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=re(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):de(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=>ce(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)):$(s)<95?l.push(`state=${c} (only ${$(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=$(S);if(O<95)continue;let K=ee(S,G=>!!v(G)),Fe=ee(S,G=>!!v(G)&&!ce(G,o));K<Z&&Fe<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=re(d);if(!(S<95)&&de(d,s)&&!(or(d,O=>q(O).length>0)<Z)){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=ne(h(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${ne(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=rr(S,o);O<Y||ee(S,K=>Q(K,o))<Z||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let L=i.country?h(i.country):[],R=!!i.country&&N(L),A=R?new Set(L.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&A>=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)}),ie=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")}),sr=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(e=>e.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function ar(e,t){let n=[],o=B(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function lr(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of ar(n,t)){let a=ie[o];if(a&&a.langs.includes(t))return a.part}return null}function ur(e,t){return fe.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=pe&&t<=ge:!0}function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var cr=/\b(?:columns|cols|column)\b/i;function z(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)),cr.test(o)}function he(e,t){return Ce(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Ce(e,t,n){let o=ye(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;)z(e,i.index)&&l++;let C=0;for(;(i=a.exec(e))!==null;){let b=i.index+i[0].lastIndexOf(".name");if(!z(e,b))continue;C++;let h=ye(i[1]);if(!n(h))return!1}return C>0&&C===l}function dr(e,t){return Ce(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 be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function mr(e,t){if(!e)return[];let n=new Set(t);for(let i of be)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)z(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||he(e,i)||l.push(i)}),l}function fr(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 Ee(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 pr(e,t,n){let o=Ee(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=Te(n);return i.length===0?l:l+" "+i.join(" ")}function Te(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,Se=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},gr=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(e,t){let n={};for(let[o,a]of gr){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function yr(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 hr(e){let t=b=>E(e,b),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=Re(e,"point"),l=Re(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:yr(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:Se(t("creditBalanceBefore")),creditCost:Se(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 xe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function Cr(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:xe(l("rank")),score:xe(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 br(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 we=["working","analyze","generate","refine","review"];function Er(e,t){let n=String(e??"").trim().toLowerCase();if(we.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 Tr="FREEMIUM_ATTEMPT_SPENT",Sr="CLIENT_SECRET_MISMATCH",Rr="FREEMIUM_COLUMN_CAP",xr="OAUTH_TOKEN_EXPIRED",wr="OAUTH_SIGNED_OUT";function _r(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Or(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 Pr(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function vr(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 _e(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 Lr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=_e({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 Ar(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Mr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Ir(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Nr(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 Fr={fit:"Best fit",variety:"Something different"};function Oe(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function Dr(e){let t=Oe(e);return t?{qualifyOrder:t}:{}}function Pe(e,t){return e!=null&&t!=null&&e!==t}function kr(e,t){return e?Pe(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 Gr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function ve(e){let t=String(e??"").trim().toLowerCase();return Gr[t]??t}function Le(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",ve(n.dataType)]);return t}function Vr(e){return j(Le(e))}var Ur=2,Wr=3,qr=4,$r=64,zr=8e3,Hr=6e4,Kr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),Br=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function jr(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function Yr(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 Qr(){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 Xr(e){return!!e&&!e.includes("|")&&!e.includes(",")}function se(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function Jr(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=se(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 Ae=2**31-1;function Me(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function Zr(e){return typeof e=="number"&&e>0&&e<=Ae?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ae} (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 C=i.timeoutMs,b=Zr(C);if(b)throw b;let h=new AbortController,g=!1,f=setTimeout(()=>{g=!0,h.abort(Me(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?Me(C):_,L;try{L=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:h.signal})}catch(_){throw y(),T(_)}let R=X(L),A=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...A,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,...A,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300;function Ne(e){return String(e??"").toLowerCase().replace(/[^a-z0-9-]/g,"").slice(0,40)}var to="/LLMChart/",no="/LLMChart/qualify",ro="/VisionReview/",oo="/LLMChart/sample",io="/RefundGenerate/",so=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",H=async e=>JSON.parse(await e.text());function ao(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function lo(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)}`,L={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,A=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&so(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,L,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return A(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)ao(x);else try{w=(await x.text()).slice(0,Ie)}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 A(!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",to,I(g),c,y=>J(y,p))},async qualify(g,f){let c=h("qualify",f),p=c.route??no;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return b("qualify",p,I(g),c,H)},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",ro,p,c,H)},async sample(g,f){let c=h("sample",f);return b("sample",oo,I(g),c,H)},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=Ne(c),T=y?{CorrelationID:g.trim(),Reason:y}:{CorrelationID:g.trim()};return b("refund",io,JSON.stringify(T),p,H)}}}export{Y as CITY_ROLE_MATCH_PCT,Kr as CLIENT_EVENT_KINDS,Sr as CLIENT_SECRET_MISMATCH,je as COMPOUND_MIN_STEM,ht as CYCLE_MEMBERS,bt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,sr as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,Ln as DEFAULT_GAP_FACTOR,it as DEFAULT_TEMPERATURE,Br as DRAW_REASONS,Tr as FREEMIUM_ATTEMPT_SPENT,Rr as FREEMIUM_COLUMN_CAP,rt as GET_RANDOM,Qe as GLUED_STEM_MIN,Je as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,xn as IDENTIFIER_HEAD_INITIAL,wn as IDENTIFIER_UNFOLDED,Rn as IDENTIFIER_WORDS,ln as INTENSIVE_SUFFIX_TOKENS,an as INTENSIVE_WORD_TOKENS,jn as IndexedText,Lt as LOOSE_KEY_MIN_LENGTH,Mt as LooseIndex,An as MAX_RUN_BOUNDS,wr as OAUTH_SIGNED_OUT,xr as OAUTH_TOKEN_EXPIRED,xt as PERIOD_CODE_FORMS,Rt as PERIOD_CODE_MEMBERS,wt as PERIOD_ORDINALS,_t as PERIOD_UNFOLDED,cn as POSITIONAL_SUFFIX_TOKENS,un as POSITIONAL_WORD_TOKENS,Jn as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,Fr as QUALIFY_ORDER_LABELS,M as ROLE_MATCH_PCT,Nn as SERIES_COMPLETENESS_MAX_LISTED,Fn as SERIES_COMPLETENESS_MIN_FILL,Dn as SERIES_KEY_MAX_DISTINCT,qr as SEV_ERROR,Ur as SEV_INFO,$r as SEV_USER_PRESENTED,Wr as SEV_WARNING,j as SIMPLE_STRING_HASH,nt as STR,et as SUBSTRING_MIN,De as SUPPORTED_LANGUAGES,ke as SUPPORTED_LANGUAGE_CODES,Hr as TELEMETRY_TIMEOUT_DEV_MS,zr as TELEMETRY_TIMEOUT_MS,Ue as VOCABULARY_LANGUAGE_CODES,Ve as VOCABULARY_ONLY_LANGUAGES,Ct as YEAR_WORDS,$ as admin1MatchPct,bn as allowedAggregations,gt as anchorLocalWallClockDates,_r as answerIsRetryable,Yt as buildGeoIsoColumn,$t as buildGeoPointColumns,Et as calendarWordIn,Ar as capabilityFields,Ht as cityMatchPct,zt as cityTagsFor,Hn as classifyAdditivity,Yr as classifyDraw,Cn as classifyForAggregation,Kn as classifyNumericValueNature,$n as classifyTemporal,pn as codeNeedsLegacyAggNames,On as codeReadsColumn,Pn as codeReadsColumnsByRoleOrPosition,fn as collapseRepeatedAggPrefix,vn as columnsTheCodeReads,Jt as countryRegion,Qr as createDrawLedger,lo as createGenerateClient,Jr as createTelemetryClient,Or as credentialFields,Nr as dataCompletenessFields,lr as dateLevelPart,ur as dateLevelYearAdmits,yt as datesAreTimeOfDayOnly,ft as datesCarryTimeOfDay,tn as decimalSeparatorOf,En as defaultAggregation,nn as detectDecimalSeparator,en as detectFormatSignature,Kt as detectGeo,Ft as detectOrdinalDomain,qn as detectTextDatePattern,jr as drawLocation,I as encodePayload,Yn as engineTypeForSqlType,gn as englishImplicitAggNames,se as eventLogLine,Lr as fetchFields,eo as fetchTransport,qe as foldName,pr as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Xe as gluedPrefixStems,fr as guardColumnNames,er as gzipWireText,Ze as hangulWordEndsWith,mn as hasDefaultAggPrefix,Ke as hasUnsegmentedScript,zn as hostAggHint,Xn as ingest,Tn as isAggregationAllowed,V as isBlankLike,kt as isCityTableLoaded,z as isColumnContextRef,ot as isDeterministicRefusal,Xr as isEventLogCode,Wt as isGeoPointAmbiguity,Wn as isIdentifierName,jt as isJoinGeoKind,nr as isNdjsonContentType,It as isOrdinalFriendlyName,At as isUsableLooseKey,tr as keyedSigner,Ir as leafCardinalityField,ct as localMidnightDateColumns,ut as localMidnightToUtcDay,pt as localWallClockDateColumns,St as localizedCycleIn,_n as localizedIdentifierWordIn,Tt as localizedYearWordIn,N as looksLikeCountryColumn,vt as looseNameKey,tt as matchNameToken,vr as maxNonMeasureCardinality,In as measureCadence,Un as measurePersistence,Vn as measureSeriesCompleteness,D as messageSignature,mr as missingHardColumnRefs,sn as monthLookupFor,ze as nameLetterRuns,hn as nameLooksIntensiveRate,yn as nameLooksPositional,he as nameProbeIsGuarded,dr as nameProbeKeepsDrawing,$e as nameWords,Gt as normalizeCountry,dt as normalizeLocalMidnightDates,on as normalizeMonthKey,U as normalizePlaceName,Ut as normalizeZip5,kr as offeredShortlistFor,Qn as parseCsvRows,st as parseDateStable,hr as parseGenerateResponse,rn as parseNumberText,Cr as parseQualifyResponse,br as parseReviewVerdict,Mn as parseTemporalPoint,Zn as payloadPreview,Pt as periodCodeSeries,Gn as pickSeriesColumn,Er as progressStageOf,Bn as promotesToMeasure,Dr as qualifyOrderField,Oe as qualifyOrderOf,J as readGenerateStream,He as readName,Ot as readPeriodCode,E as readWireField,Ne as refundReasonCode,Dt as registerCityTable,Xt as registerIso3Regions,v as resolveAdmin1,_e as resolveFetchVersion,qt as resolveGeoPoint,We as resolveLanguage,ir as resolvePointRoles,Mr as retryFields,Nt as safeDistinctValuesToShip,Le as schemaIdentity,Vr as schemaIdentityKey,ve as schemaTypeFamily,kn as seriesKeyVerdict,Sn as shareOfTotalIsHonest,Pe as shortlistIsStale,dn as stripHostAggPrefix,Zt as summarizeCountryRegions,Qt as summarizeGeoExtent,Ge as supportedLanguage,Bt as toGeoIso,Be as unsegmentedRuns,mt as utcWallClock,Pr as viewportFields,B as vocabularyLanguage,at as wholeDayFrame,lt as wholeDayIso,X as wireResponseFromFetch,Ye as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,Vt as zipToPrefix3};
|
|
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};
|
package/dist/indexedText.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{
|
|
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};
|
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-
|
|
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};
|
package/dist/monthNames.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{f as a,g as b,h as c,i as d,j as e}from"./chunk-
|
|
2
|
+
import{f as a,g as b,h as c,i as d,j as e}from"./chunk-TZ74QIKA.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-WC4JINEZ.mjs";export{b as monthLookupFor,c as monthWordReadings,a as normalizeMonthKey,d as readMonthWords,e as splitMonthPeriod};
|
package/dist/ordinalDetector.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{m as a,n as b,o as c}from"./chunk-
|
|
2
|
+
import{m as a,n as b,o as c}from"./chunk-3ZAS32F5.mjs";import"./chunk-5HI6TVMM.mjs";import"./chunk-CZJ7M6A5.mjs";import"./chunk-WC4JINEZ.mjs";export{c as detectOrdinalDomain,a as isOrdinalFriendlyName,b as safeDistinctValuesToShip};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type GeoRegion } from "./geoExtent";
|
|
2
|
+
/** The hosted document, as served. */
|
|
3
|
+
export interface Admin1LookupDoc {
|
|
4
|
+
version: number;
|
|
5
|
+
cities: string;
|
|
6
|
+
admin1: string;
|
|
7
|
+
crosswalk?: string;
|
|
8
|
+
centers?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Parse and register the hosted lookup. Idempotent for the same version; returns the row counts. A document that
|
|
11
|
+
* is not the expected shape registers nothing and throws, so a host's bounded preload logs it as a failed load. */
|
|
12
|
+
export declare function registerAdmin1Lookup(doc: Admin1LookupDoc): {
|
|
13
|
+
cities: number;
|
|
14
|
+
admin1: number;
|
|
15
|
+
};
|
|
16
|
+
/** True once a host has registered the lookup. Province signals are emitted only then. */
|
|
17
|
+
export declare function admin1LookupRegistered(): boolean;
|
|
18
|
+
/** Forget the registered lookup. Tests only. */
|
|
19
|
+
export declare function clearAdmin1LookupForTests(): void;
|
|
20
|
+
/** A country value (name, ISO-2 or ISO-3, any language the country matcher reads) as ISO-2, or null. */
|
|
21
|
+
export declare function countryIso2(value: string | null | undefined): string | null;
|
|
22
|
+
/** A city resolves only when it is unique inside the narrowed scope, or when the largest candidate holds at least
|
|
23
|
+
* this many times the population of the next. A named constant, to be re-measured. */
|
|
24
|
+
export declare const CITY_TIE_RATIO = 10;
|
|
25
|
+
export type CityAdmin1Result = {
|
|
26
|
+
status: "resolved";
|
|
27
|
+
cc: string;
|
|
28
|
+
admin1: string;
|
|
29
|
+
code: string;
|
|
30
|
+
provinceId: string | null;
|
|
31
|
+
lat: number;
|
|
32
|
+
lon: number;
|
|
33
|
+
popK: number;
|
|
34
|
+
} | {
|
|
35
|
+
status: "ambiguous";
|
|
36
|
+
candidates: number;
|
|
37
|
+
} | {
|
|
38
|
+
status: "unmatched";
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Which first-level division a city name sits in, narrowed by the row's country (any form the country matcher
|
|
42
|
+
* reads) and, when there is none, by the continent the map shows. A primary-name match outranks an alternate-name
|
|
43
|
+
* match. The tie-break: unique inside the scope, or the most populous at CITY_TIE_RATIO x the next; anything else
|
|
44
|
+
* is "ambiguous", counted by the caller and never guessed.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveCityAdmin1(city: string | null | undefined, opts?: {
|
|
47
|
+
country?: string | null;
|
|
48
|
+
region?: GeoRegion | null;
|
|
49
|
+
}): CityAdmin1Result;
|
|
50
|
+
/** The GeoNames first-level codes ("FR.11") a province NAME can mean, narrowed by country when given. */
|
|
51
|
+
export declare function admin1CodesForName(name: string | null | undefined, country?: string | null): string[];
|
|
52
|
+
/** The province id (the drawn polygon's id) a GeoNames first-level code maps to, or null when its cities spread over
|
|
53
|
+
* several provinces (a merged country's nation, such as England) or none were placed. */
|
|
54
|
+
export declare function provinceIdForAdmin1Code(code: string | null | undefined): string | null;
|
|
55
|
+
/** True when a value is a province id the lookup knows (an ISO 3166-2 code such as "FR-IDF", or a fallback id). */
|
|
56
|
+
export declare function isKnownProvinceId(value: string | null | undefined): boolean;
|
|
57
|
+
/** A province's center [lon, lat] - population-weighted over its cities, else its largest part's center - where a
|
|
58
|
+
* bubble map places a row that names the province and no city. Null when the lookup carries none. */
|
|
59
|
+
export declare function provinceCenter(provinceId: string | null | undefined): [number, number] | null;
|
|
60
|
+
export type ProvinceValueResult = {
|
|
61
|
+
status: "resolved";
|
|
62
|
+
provinceId: string;
|
|
63
|
+
} | {
|
|
64
|
+
status: "ambiguous";
|
|
65
|
+
candidates: number;
|
|
66
|
+
} | {
|
|
67
|
+
status: "unmatched";
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* One province VALUE - an ISO 3166-2 code, a GeoNames first-level code ("FR.11") or a name in any language the lookup
|
|
71
|
+
* carries - to the province it names. Narrowed first by the row's country, then by the continent the map shows; a
|
|
72
|
+
* name still naming several provinces is "ambiguous" (Punjab, Limburg, Georgia), counted by the caller, never guessed.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveProvinceValue(value: string | null | undefined, opts?: {
|
|
75
|
+
country?: string | null;
|
|
76
|
+
region?: GeoRegion | null;
|
|
77
|
+
}): ProvinceValueResult;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** A province column needs this share of its distinct values to match, or the lower share when its NAME reads as a
|
|
2
|
+
* province. The server re-checks against its own threshold; this is only whether to emit the kind at all. */
|
|
3
|
+
export declare const ADMIN1_MATCH_PCT = 85;
|
|
4
|
+
export declare const ADMIN1_MATCH_PCT_NAMED = 60;
|
|
5
|
+
export interface Admin1ColumnSignals {
|
|
6
|
+
kind?: "admin1-code" | "admin1-name";
|
|
7
|
+
matchPct?: number;
|
|
8
|
+
ambiguous?: boolean;
|
|
9
|
+
rollupPct?: number;
|
|
10
|
+
regionCount?: number;
|
|
11
|
+
countryCount?: number;
|
|
12
|
+
dominantRegion?: string;
|
|
13
|
+
dominantRegionPct?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The province a row sits in, from its province value, or failing that its city (narrowed by its country). Null when
|
|
17
|
+
* none resolves to exactly one province. A province value takes precedence over the city.
|
|
18
|
+
*/
|
|
19
|
+
export declare function provinceIdForRow(args: {
|
|
20
|
+
province?: unknown;
|
|
21
|
+
provinceKind?: string | null;
|
|
22
|
+
city?: unknown;
|
|
23
|
+
country?: unknown;
|
|
24
|
+
}): string | null;
|
|
25
|
+
/** What placed a row on a province map. */
|
|
26
|
+
export type ProvinceSource = "province" | "coordinates" | "city";
|
|
27
|
+
export interface ProvinceIsoColumn {
|
|
28
|
+
/** Per-row province id, aligned with the rows; null where the row did not place. */
|
|
29
|
+
iso: (string | null)[];
|
|
30
|
+
/** Per-row source of the id, null where the row did not place. */
|
|
31
|
+
source: (ProvinceSource | null)[];
|
|
32
|
+
/** Distinct province or city values that named no single province (feeds the unmatched note). */
|
|
33
|
+
unmatched: string[];
|
|
34
|
+
matchedRows: number;
|
|
35
|
+
totalRows: number;
|
|
36
|
+
/** Rows whose city matched more than one province under the tie-break: counted, never guessed. */
|
|
37
|
+
ambiguousRows: number;
|
|
38
|
+
ambiguousExamples: string[];
|
|
39
|
+
/** Rows with coordinates that landed in no province (and had no city to fall back on). */
|
|
40
|
+
unplacedPoints: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* THE PROVINCE JOIN COLUMN for a province map, per row in a fixed precedence: the province value, then the coordinates,
|
|
44
|
+
* then the city. A province cell that is FILLED is the reader's own value and is never overridden: when it names no
|
|
45
|
+
* province the row stays unmatched and is counted. Only a BLANK province cell falls through, and only while the reader
|
|
46
|
+
* derives provinces; with `deriveProvinces` false a row places by its province value alone.
|
|
47
|
+
*
|
|
48
|
+
* Coordinates need the province geometry, which this package does not carry: the caller passes `locate`, returning the
|
|
49
|
+
* province id a coordinate falls in (or null). Without it, coordinates are skipped.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildProvinceIsoColumn(rows: ReadonlyArray<{
|
|
52
|
+
province?: unknown;
|
|
53
|
+
city?: unknown;
|
|
54
|
+
country?: unknown;
|
|
55
|
+
lat?: unknown;
|
|
56
|
+
lon?: unknown;
|
|
57
|
+
}>, opts?: {
|
|
58
|
+
provinceKind?: string | null;
|
|
59
|
+
deriveProvinces?: boolean;
|
|
60
|
+
locate?: (lat: number, lon: number) => string | null;
|
|
61
|
+
}): ProvinceIsoColumn;
|
|
62
|
+
/**
|
|
63
|
+
* Province signals for every column of a profiled table. `rows` are positional; `cols` carry the kinds the
|
|
64
|
+
* per-column profile already found. Returns one entry per column index that gained a signal.
|
|
65
|
+
*/
|
|
66
|
+
export declare function measureAdmin1Columns(cols: ReadonlyArray<{
|
|
67
|
+
name: string;
|
|
68
|
+
isMeasure?: boolean;
|
|
69
|
+
geoKind?: string;
|
|
70
|
+
}>, rows: ReadonlyArray<ReadonlyArray<unknown>>, opts?: {
|
|
71
|
+
cities?: boolean;
|
|
72
|
+
}): Map<number, Admin1ColumnSignals>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export declare const ZIP_NAME_TOKENS: Set<string>;
|
|
2
|
+
export declare const CITY_NAME_TOKENS: Set<string>;
|
|
2
3
|
export declare function hasAnyToken(columnName: string | undefined, tokens: Set<string>): boolean;
|
|
3
|
-
export type GeoKind = "country-iso3" | "country-iso2" | "country-name" | "us-state-code" | "us-state-name" | "us-zip5" | "us-county-fips" | "city-name" | "city-name-world";
|
|
4
|
+
export type GeoKind = "country-iso3" | "country-iso2" | "country-name" | "us-state-code" | "us-state-name" | "us-zip5" | "us-county-fips" | "city-name" | "city-name-world" | "admin1-code" | "admin1-name";
|
|
4
5
|
export type GeoDetectionResult = {
|
|
5
6
|
geoKind: GeoKind;
|
|
6
7
|
geoMatchPct: number;
|
|
7
8
|
geoAmbiguous?: boolean;
|
|
8
9
|
};
|
|
10
|
+
export declare const NAME_KIND_MIN_DISTINCT = 5;
|
|
9
11
|
/**
|
|
10
12
|
* Detect whether a column's values are a geographic dimension.
|
|
11
13
|
* @param rawValues DISTINCT raw cell values (order irrelevant; duplicates are
|
|
@@ -15,7 +15,23 @@ export interface GeoExtentSummary {
|
|
|
15
15
|
* is not the same claim as one from three thousand, and a consumer weighting the signal
|
|
16
16
|
* needs to know which it has. */
|
|
17
17
|
n: number;
|
|
18
|
+
/** Rows inside each continent map's frame window (REGION_FRAME_WINDOWS), 0..100. The windows
|
|
19
|
+
* overlap at their edges (Turkey sits in Europe's and Asia's), so the shares need not sum to 100. */
|
|
20
|
+
regionPct?: Record<RegionFrame, number>;
|
|
21
|
+
/** The frame holding the most rows, and its share. Ties resolve by name, so it is stable. */
|
|
22
|
+
dominantFrame?: RegionFrame;
|
|
23
|
+
dominantFramePct?: number;
|
|
18
24
|
}
|
|
25
|
+
/** The continents a map frame is drawn for. */
|
|
26
|
+
export type RegionFrame = "europe" | "asia" | "africa" | "south-america" | "north-america" | "oceania";
|
|
27
|
+
/**
|
|
28
|
+
* Each continent map's WINDOW, [lonMin, latMin, lonMax, latMax] - the rectangle the continent maps fit, so "inside the
|
|
29
|
+
* frame" means the same thing when a table is offered a map and when the map is drawn. A lonMax past 180 wraps the
|
|
30
|
+
* antimeridian (Oceania reaches the Pacific islands east of it).
|
|
31
|
+
*/
|
|
32
|
+
export declare const REGION_FRAME_WINDOWS: Readonly<Record<RegionFrame, readonly [number, number, number, number]>>;
|
|
33
|
+
/** Is a coordinate inside a continent's frame window? */
|
|
34
|
+
export declare function inRegionFrame(lat: number, lon: number, frame: RegionFrame): boolean;
|
|
19
35
|
/** What a country column says about its own region mix. */
|
|
20
36
|
export interface CountryRegionSummary {
|
|
21
37
|
dominantGeoRegion: GeoRegion;
|
|
@@ -24,6 +40,10 @@ export interface CountryRegionSummary {
|
|
|
24
40
|
/** Distinct regions with at least one country present. A single-region set is the
|
|
25
41
|
* gray-world case; a spread of four is a genuinely global one. */
|
|
26
42
|
regionCount: number;
|
|
43
|
+
/** Share of resolved rows in the MIDDLE EAST, 0..100. An OVERLAPPING frame: the regions above partition the world, so
|
|
44
|
+
* a Middle East table splits between Asia and Africa (and Cyprus, Europe) and no single region holds it; this share
|
|
45
|
+
* is what offers the Middle East map. */
|
|
46
|
+
middleEastPct: number;
|
|
27
47
|
/** Country values that resolved to a region at all. */
|
|
28
48
|
n: number;
|
|
29
49
|
}
|
|
@@ -76,3 +96,5 @@ export declare function summarizeCountryRegions(values: ReadonlyArray<string | n
|
|
|
76
96
|
* materialise a million strings to answer a question about a dozen.
|
|
77
97
|
*/
|
|
78
98
|
export declare function summarizeCountryRegionsWeighted(entries: ReadonlyArray<readonly [string | null | undefined, number]>, minCountries?: number): CountryRegionSummary | null;
|
|
99
|
+
/** Is a country value (ISO-2, ISO-3 or a name) one of the Middle East frame's members? */
|
|
100
|
+
export declare function inMiddleEast(code: string | null | undefined): boolean;
|
package/dist/types/geoPoint.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GeoRegion } from "./geoExtent";
|
|
1
2
|
export type GeoPointPrecision = "latlon" | "city" | "zip3" | "state" | "country";
|
|
2
3
|
export type GeoPointResult = {
|
|
3
4
|
lat: number;
|
|
@@ -106,6 +107,9 @@ export declare function resolveGeoPoint(args: {
|
|
|
106
107
|
/** Which map's candidate rows the CITY tier may use (default "north-america", which
|
|
107
108
|
* is byte-identical to the pre-v2 candidate set). The WORLD map passes "world". */
|
|
108
109
|
mapKind?: GeoMapKind | null;
|
|
110
|
+
/** The continent a continent bubble map shows: a province or city name that several countries share is narrowed to
|
|
111
|
+
* that continent before it is called ambiguous. Read only by the hosted-lookup tiers. */
|
|
112
|
+
region?: GeoRegion | null;
|
|
109
113
|
}): GeoPointResult | GeoPointAmbiguity | null;
|
|
110
114
|
export type GeoPointColumns = {
|
|
111
115
|
/** Per-row coordinates, aligned 1:1 with the input; null where unresolved. */
|
|
@@ -175,7 +179,9 @@ rows: Array<{
|
|
|
175
179
|
zip?: any;
|
|
176
180
|
country?: any;
|
|
177
181
|
label?: any;
|
|
178
|
-
}>, mapKind?: GeoMapKind | null
|
|
182
|
+
}>, mapKind?: GeoMapKind | null,
|
|
183
|
+
/** The continent a continent bubble map shows (resolveGeoPoint's `region`). Absent: no continent narrowing. */
|
|
184
|
+
region?: GeoRegion | null): GeoPointColumns;
|
|
179
185
|
/**
|
|
180
186
|
* The TAGS on a known city ("capital", ...), empty when it carries none or is unknown.
|
|
181
187
|
*
|
|
@@ -57,7 +57,6 @@ export declare function looksLikeCountryColumn(values: Array<unknown>): boolean;
|
|
|
57
57
|
export { NORTH_AMERICA_COUNTRIES } from "./geoPoint";
|
|
58
58
|
/** Share of DISTINCT values that are country identifiers, 0..100 (one decimal). */
|
|
59
59
|
export declare function countryMatchPct(values: Array<unknown>): number;
|
|
60
|
-
/** Share of DISTINCT values that resolve to a state/province, 0..100 (one decimal). */
|
|
61
60
|
export declare function admin1MatchPct(values: Array<unknown>): number;
|
|
62
61
|
/** Share of DISTINCT values that read as a ZIP / ZIP-prefix, 0..100 (one decimal). This is a
|
|
63
62
|
* VALUE question — "can this be read as a ZIP" — and it stays permissive about short forms,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,8 +19,13 @@ export { parseDateStable, wholeDayFrame, wholeDayIso } from "./util";
|
|
|
19
19
|
export { localMidnightToUtcDay, localMidnightDateColumns, normalizeLocalMidnightDates, utcWallClock, datesCarryTimeOfDay, localWallClockDateColumns, anchorLocalWallClockDates, datesAreTimeOfDayOnly } from "./util";
|
|
20
20
|
export { detectGeo, toGeoIso, buildGeoIsoColumn, isJoinGeoKind } from "./geoDetector";
|
|
21
21
|
export type { GeoKind, GeoDetectionResult, GeoIsoColumn } from "./geoDetector";
|
|
22
|
-
export { summarizeGeoExtent, summarizeCountryRegions, countryRegion, registerIso3Regions } from "./geoExtent";
|
|
23
|
-
export type { GeoRegion, GeoExtentSummary, CountryRegionSummary } from "./geoExtent";
|
|
22
|
+
export { summarizeGeoExtent, summarizeCountryRegions, countryRegion, registerIso3Regions, REGION_FRAME_WINDOWS, inMiddleEast } from "./geoExtent";
|
|
23
|
+
export type { GeoRegion, GeoExtentSummary, CountryRegionSummary, RegionFrame } from "./geoExtent";
|
|
24
|
+
export { registerAdmin1Lookup, admin1LookupRegistered, clearAdmin1LookupForTests, resolveCityAdmin1, admin1CodesForName, countryIso2, CITY_TIE_RATIO } from "./admin1Lookup";
|
|
25
|
+
export type { Admin1LookupDoc, CityAdmin1Result } from "./admin1Lookup";
|
|
26
|
+
export { provinceIdForAdmin1Code, isKnownProvinceId } from "./admin1Lookup";
|
|
27
|
+
export { measureAdmin1Columns, provinceIdForRow, buildProvinceIsoColumn, ADMIN1_MATCH_PCT, ADMIN1_MATCH_PCT_NAMED } from "./admin1Signals";
|
|
28
|
+
export type { Admin1ColumnSignals, ProvinceIsoColumn, ProvinceSource } from "./admin1Signals";
|
|
24
29
|
export { resolveGeoPoint, buildGeoPointColumns, isGeoPointAmbiguity, resolveAdmin1, zipToPrefix3, zipPrefixCandidates, normalizeZip5, normalizePlaceName, cityMatchPct, normalizeCountry, cityTagsFor, registerCityTable, isCityTableLoaded, } from "./geoPoint";
|
|
25
30
|
export type { GeoPointPrecision, GeoPointResult, GeoPointColumns, GeoPointAmbiguity, GeoMapKind } from "./geoPoint";
|
|
26
31
|
export { resolvePointRoles, looksLikeCountryColumn, admin1MatchPct, zipMatchPct, } from "./geoPointRoles";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LLMColumnWithValue } from "./models";
|
|
2
|
+
import { type GeoExtentSummary } from "./geoExtent";
|
|
2
3
|
export declare function isIdentifierName(name: string): boolean;
|
|
3
4
|
export type ValueNature = "Continuous" | "Ordinal" | "Categorical";
|
|
4
5
|
export interface TextDateDetection {
|
|
@@ -151,6 +152,13 @@ export declare class IndexedText implements IValueCollection {
|
|
|
151
152
|
* regenerating any one of them stops the flag ever being set for it again.
|
|
152
153
|
*/
|
|
153
154
|
emitLegacyAggAliases: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* THE READER'S "DERIVE PROVINCES" SETTING (default on). Off, a province map is offered only on a real province
|
|
157
|
+
* column: no city column is measured for how it rolls up to provinces, and coordinates are not offered for placing
|
|
158
|
+
* by province, so the server, which reads those figures, offers nothing that rests on a derivation. Province
|
|
159
|
+
* columns are still recognized either way. Set before the first getColumnsWithStats.
|
|
160
|
+
*/
|
|
161
|
+
deriveProvinces: boolean;
|
|
154
162
|
/**
|
|
155
163
|
* SET BY A HOST WHOSE DATE CELLS ARE THE READER'S LOCAL WALL CLOCK (a Power BI date-time field). When on, every date
|
|
156
164
|
* column that carries a time of day (datesCarryTimeOfDay over the whole column) is profiled - bounds, distinct keys,
|
|
@@ -206,17 +214,10 @@ export declare class IndexedText implements IValueCollection {
|
|
|
206
214
|
getRowCount(): number;
|
|
207
215
|
getLeafCardinality(): number;
|
|
208
216
|
private _leafCardinality;
|
|
209
|
-
getGeoExtent():
|
|
210
|
-
pctUsa: number;
|
|
211
|
-
pctNa: number;
|
|
212
|
-
latP5: number;
|
|
213
|
-
latP95: number;
|
|
214
|
-
lonP5: number;
|
|
215
|
-
lonP95: number;
|
|
216
|
-
n: number;
|
|
217
|
-
} | null;
|
|
217
|
+
getGeoExtent(): GeoExtentSummary | null;
|
|
218
218
|
private _geoExtent;
|
|
219
219
|
private _geoExtentComputed;
|
|
220
|
+
private _geoExtentLatIdx;
|
|
220
221
|
private obfuscateString;
|
|
221
222
|
toObjectArray(): Record<string, any>[];
|
|
222
223
|
getCSVAsync(forSample: boolean): Promise<string>;
|
|
@@ -262,6 +263,12 @@ export declare class IndexedText implements IValueCollection {
|
|
|
262
263
|
private liveEnglishAliases;
|
|
263
264
|
addRow(colvals: any[], originalIdx?: number): boolean;
|
|
264
265
|
getOriginalRowIndex(i: number): number;
|
|
266
|
+
/**
|
|
267
|
+
* Forget the computed column statistics, keeping the rows, so the next getColumnsWithStats measures again. For a host
|
|
268
|
+
* whose profile changed inputs after the first measurement - the admin-1 lookup arrived, or the reader toggled
|
|
269
|
+
* deriveProvinces - without re-adding every row.
|
|
270
|
+
*/
|
|
271
|
+
invalidateStats(): void;
|
|
265
272
|
reset(): void;
|
|
266
273
|
/**
|
|
267
274
|
* THE ONE PLACE A COLUMN NAME ENTERS THE ENGINE, which is why the doubled-aggregation-prefix
|
package/dist/types/ingest.d.ts
CHANGED
|
@@ -48,6 +48,9 @@ export interface IngestOptions {
|
|
|
48
48
|
nonAdditive?: string[];
|
|
49
49
|
/** "0" | "10" | "20" | "30" — how much detail the measured shape carries. Default "20". */
|
|
50
50
|
privacyLevel?: string;
|
|
51
|
+
/** The reader's "Derive provinces" setting: false measures no city or coordinate rollup to provinces, so only a real
|
|
52
|
+
* province column offers a province map. Default true. (IndexedText.deriveProvinces.) */
|
|
53
|
+
deriveProvinces?: boolean;
|
|
51
54
|
/** Locale for temporal classification (month-name matching), and the tiebreak for a text
|
|
52
55
|
* column whose values do not say which character is the decimal point (`12,500` alone could
|
|
53
56
|
* be either). Default "en". */
|