@bicharts/shape-core 0.6.66 → 0.6.69

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.
@@ -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
+ var c=Object.freeze(["licenseKey","licensee","secretKey","freemiumKey","linkNonce","accessToken","clientId","instanceKey","correlationId"]);function a(t){let e=t.shape;return!Array.isArray(e)||e.length===0}function l(t,e={}){let s=new Set(c),o={};for(let[r,n]of Object.entries(t??{}))if(!s.has(r)){if(r==="sampleCsv"){let i=typeof n=="string"?n.length>0:n!=null;o[r]=i?e.sampleNote??null:n;continue}o[r]=n}return e.emptyShapeNote&&a(t??{})&&(o._note=e.emptyShapeNote),o}export{c as a,l as b};
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 qn,b as zn}from"./chunk-UQU75XXR.mjs";import{a as $n,b as I,c as Kn,d as k,e as E,f as Hn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as Gn,b as Dn,c as Vn,d as Un,e as Wn}from"./chunk-N52JPYZI.mjs";import{A as bn,B as En,C as Tn,D as Sn,E as Rn,F as xn,G as wn,H as Pn,I as _n,J as vn,K as Ln,L as Mn,M as On,N as In,O as Nn,P as An,Q as Fn,S as kn,a as zt,b as $t,c as Kt,d as Ht,e as Qt,f as Xt,g as Jt,h as Zt,i as en,j as tn,k as nn,l as rn,m as on,n as sn,o as an,p as ln,q as un,r as cn,s as dn,t as mn,u as fn,v as pn,w as gn,x as yn,y as hn,z as Cn}from"./chunk-OPDY2YEA.mjs";import{a as Bt}from"./chunk-U3H6UBOO.mjs";import{a as jt,b as Yt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Vt,d as Ut,e as Wt,f as qt}from"./chunk-KQOVPOVU.mjs";import{a as O,b as V,c as Y,d as U,k as W,l as Lt,m as Mt,n as ae,o as v,p as Ot,q as It,r as Nt,s as q,t as At,u as Ft,v as kt,w as Gt,x as Q,y as Dt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ct,b as dt,c as mt,d as ft,e as pt,f as gt,g as yt,h as ht,i as Ct,j as bt,k as Et,l as Tt,m as Pt,n as _t,o as vt}from"./chunk-GKXYRUK5.mjs";import{A as rt,B as ot,C as it,D as st,E as at,F as lt,G as ut,a as Ae,b as Fe,c as ke,d as Ge,e as De,f as B,g as Ve,h as Ue,i as We,j as qe,k as ze,l as $e,m as Ke,n as He,o as Be,p as je,q as Ye,r as Qe,s as Xe,t as Je,u as Ze,v as et,x as j,y as tt,z as nt}from"./chunk-4VN252CK.mjs";import{b as St,c as Rt,d as xt,e as wt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(t){return!!W(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=U(String(n));if(!V(o)&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function A(t){let e=F(t);if(e.length===0||ne(t)<95)return!1;let n=e.filter(u=>te(u)&&!v(u)).length,o=e.filter(u=>!te(u)&&!!v(u)).length;return n>=1&&n>=o}function ce(t,e){if(!v(t))return!1;let n=W(t);return n?e==="world"?!0:ae.has(n):!1}function ne(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)te(o)&&n++;return Math.round(n/e.length*1e3)/10}function z(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)v(o)&&n++;return Math.round(n/e.length*1e3)/10}function oe(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function re(t){let e=oe(t);if(e.length===0)return 0;let n=0;for(let o of e)q(o).length>0&&n++;return Math.round(n/e.length*1e3)/10}function de(t,e){return ue(e,le)?!0:oe(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Bn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)Q(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function ee(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function jn(t,e){let n=0;for(let o of oe(t))e(o)&&n++;return n}function Yn(t,e,n,o,u){let l=[],a=[],i={},h={},C=new Set(t),y=s=>e.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.has(d)&&(i[s]=d)}let g=new Set(u??t);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&C.has(f)){let s=y(f),d=re(s);d<95?a.push(`zip=${f} (only ${d}% of values read as ZIPs)`):de(s,f)?i.zip=f:a.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?a.push(`state=${c} (every value is "CA", which is both Canada and California)`):A(s)?(a.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):z(s)<95?a.push(`state=${c} (only ${z(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=t.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(A(S))continue;let _=z(S);if(_<95)continue;let H=ee(S,D=>!!v(D)),Ne=ee(S,D=>!!v(D)&&!ce(D,o));H<Z&&Ne<1||(!s||_>s.pct)&&(s={name:d,pct:_})}s&&(i.state=s.name,p.add(s.name),l.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(jn(d,_=>q(_).length>0)<Z)){i.zip=s,p.add(s),l.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!A(y(T))){let s=null;for(let d of b){if(p.has(d)||!A(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(a.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.country=T),i.country=s.name,p.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of b){if(p.has(d))continue;let S=y(d),_=Bn(S,o);_<Y||ee(S,H=>Q(H,o))<Z||(!s||_>s.pct)&&(s={name:d,pct:_})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let L=i.country?y(i.country):[],R=!!i.country&&A(L),M=R?new Set(L.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&M>=2,w=!!(i.lat&&i.lon)&&e.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&&a.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&a.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:l,refused:a,...Object.keys(h).length?{labelFallback:h}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),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")}),Qn=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(t=>t.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Xn(t,e){let n=[],o=B(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function Jn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of Xn(n,e)){let u=ie[o];if(u&&u.langs.includes(e))return u.part}return null}function Zn(t,e){return fe.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=pe&&e<=ge:!0}function ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var er=/\b(?:columns|cols|column)\b/i;function $(t,e){let n=Math.max(0,e-240),o=t.slice(n,e),u=o.lastIndexOf(";");return u>=0&&(o=o.slice(u+1)),er.test(o)}function he(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(t))}function Ce(t,e,n){let o=ye(e),u=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),l=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),a=0,i;for(;(i=l.exec(t))!==null;)$(t,i.index)&&a++;let h=0;for(;(i=u.exec(t))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!$(t,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===a}function tr(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(t)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(t))}var be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function nr(t,e){if(!t)return[];let n=new Set(e);for(let i of be)n.add(i);let o=new Set,u=/\.name\s*===?\s*(['"])([^'"]+)\1/g,l;for(;(l=u.exec(t))!==null;)$(t,l.index)&&o.add(l[2]);if(o.size===0)return[];let a=[];return o.forEach(i=>{n.has(i)||he(t,i)||a.push(i)}),a}function rr(t,e){if(!t)return[];let n=(t.getColumns()||[]).map(o=>o.name);if(!e||typeof t.aliasesForCode!="function")return n;for(let o of t.aliasesForCode(e))n.push(o.alias);return n}function Ee(t,e){let n=e?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(t)||t<=n?0:Math.round(t-n)}function or(t,e,n){let o=Ee(t,e);if(o===null||o<=0)return null;let u=typeof e?.freemiumColumnCapPivot=="number"?e.freemiumColumnCapPivot:4,l=o>u?e?.freemiumColumnCapMessageMany:e?.freemiumColumnCapMessageFew;if(typeof l!="string"||l.trim().length===0)return null;let a=l.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=Te(n);return i.length===0?a:a+" "+i.join(" ")}function Te(t){if(!t||t.length===0)return[];let e=[],n=new Map,o=new Map;for(let l of t){let a=typeof l?.dateGroupId=="string"?l.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(e.push(a),n.set(a,0)),l.isDatePart===!0&&n.set(a,n.get(a)+1),l.isReassembledDate===!0&&!o.has(a))){let i=typeof l.sourceField=="string"?l.sourceField.trim():"",h=typeof l.name=="string"?l.name.trim():"",C=i!==""?i:h;C!==""&&o.set(a,C)}}let u=[];for(let l of e){let a=o.get(l),i=n.get(l)??0;!a||i===0||u.push(`'${a}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return u}var m=t=>t==null?"":String(t),N=t=>t===!0,Se=t=>{if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null},ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(t,e){let n={};for(let[o,u]of ir){let l=m(E(t,e+u));l&&(n[o]=l)}return n}function sr(t){return Array.isArray(t)?t.map(e=>({code:m(E(e,"code")),severity:m(E(e,"severity")),text:m(E(e,"text"))})).filter(e=>e.text!==""):[]}function ar(t){let e=C=>E(t,C),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Re(t,"point"),a=Re(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable"),h=e("isPollFinal");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:sr(e("notices")),freemiumStatusCode:m(e("freemiumStatusCode")),code:m(e("code")),language:m(e("language")),version:Number(e("version")??0),codeSummary:m(e("codeSummary")),chartName:m(e("chartName")??e("chartType")),finalChartName:m(e("finalChartName")),warningMessage:m(e("warningMessage")),outputHash:m(e("outputHash")),validatorToken:m(e("validatorToken")),editCodeKey:m(e("editCodeKey")),signedLLMRequestID:m(e("signedLLMRequestID")),userReply:m(e("userReply")),userReplyOutcome:m(e("userReplyOutcome")),improvementSuggestion:m(e("improvementSuggestion")),geoColumn:m(e("geoColumn")),geoKind:m(e("geoKind")),geoPointCols:Object.keys(l).length?l:null,creditBalanceBefore:Se(e("creditBalanceBefore")),creditCost:Se(e("creditCost")),isServiceError:N(e("isServiceError")),isRateLimited:N(e("isRateLimited")),isRefusal:N(e("isRefusal")),isVersionNotFound:N(e("isVersionNotFound")),isGenerationCancelled:N(e("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(e("servedCorrelationId")),...typeof h=="boolean"?{isPollFinal:h}:{},...m(e("pollOutcome"))!==""?{pollOutcome:m(e("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var xe=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function lr(t){let e=E(t,"charts"),n=E(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=h=>E(l,h),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:xe(a("rank")),score:xe(a("score")),renderer:G(a("renderer")),language:G(a("language")),isPreview:N(a("isPreview")),recommended:typeof i=="boolean"?i:void 0,viaProjection:G(a("viaProjection")),viaProjectionKey:G(a("viaProjectionKey")),detailNote:G(a("detailNote"))}}).filter(l=>l.name):null,u=Array.isArray(n)?n.map(l=>({name:m(E(l,"chartTypeName")??E(l,"name")),reason:m(E(l,"reason")),reasonCode:m(E(l,"reasonCode")),isVeto:N(E(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:m(E(t,"errorMessage")),errorCode:m(E(t,"errorCode")),charts:o,refused:u,noFitSummary:m(E(t,"noFitSummary"))}}function ur(t){return!t||typeof t!="object"?null:{status:String(E(t,"status")??""),verdictReason:E(t,"verdictReason")??null,instruction:E(t,"instruction")??null,fix:E(t,"fix")??null,errorMessage:E(t,"errorMessage")??null,errorCode:E(t,"errorCode")??null}}var we=["working","analyze","generate","refine","review"];function cr(t,e){let n=String(t??"").trim().toLowerCase();if(we.includes(n))return n;let o=String(e??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var dr="FREEMIUM_ATTEMPT_SPENT",mr="CLIENT_SECRET_MISMATCH",fr="FREEMIUM_COLUMN_CAP";function pr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function gr(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:n.licenseKey,licensee:n.licensee,secretKey:n.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e}}function yr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function hr(t){let e=0;for(let n of t){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>e&&(e=o)}return e}function Pe(t){if(t.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(t.recoveryFetchVersion!=null)return{version:t.recoveryFetchVersion,fetchOnly:!0};let e=t.settingVersion??null;if(t.genNew)return{version:e,fetchOnly:void 0};let n=(e??0)>0?e:null,o=(t.codeVersion??0)>0?t.codeVersion:null,u=n??o??e;return{version:u,fetchOnly:u!=null&&u>0?!0:void 0}}function Cr(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=Pe({genNew:o,recoveryFetchVersion:t.recoveryFetchVersion,recoveryFetchByCorrelation:e,settingVersion:t.settingVersion,codeVersion:t.codeVersion});return{genNew:o,version:u.version,fetchOnly:u.fetchOnly,fetchCorrelationId:t.fetchCorrelationId??void 0}}function br(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Er(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function Tr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function _e(t,e){return t!=null&&e!=null&&t!==e}function Sr(t,e){return t?_e(e.capturedFor,e.now)?{shortlist:void 0,stale:!0}:{shortlist:{...t,ageMs:e.atMs>0?Math.max(0,Math.round(e.nowMs-e.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var Rr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function ve(t){let e=String(t??"").trim().toLowerCase();return Rr[e]??e}function Le(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",ve(n.dataType)]);return e}function xr(t){return j(Le(t))}var wr=2,Pr=3,_r=4,vr=64,Lr=8e3,Mr=6e4,Or=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function Ir(t){return!!t&&!t.includes("|")&&!t.includes(",")}function se(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function Nr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.clientVersion!="string"||e.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof e.timeoutMs!="number"||!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=e.timeoutMs,h=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,C=g=>{try{e.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await u.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${a}/LogClientMsg/?nocache=${l.now()}`,c=I(g),p=k(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${a}/eventlog`,b=se(g,e.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"Content-Type":"text/plain"})}}}var Me=2**31-1;function Oe(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function Ar(t){return typeof t=="number"&&t>0&&t<=Me?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(t)} ms: it must be a number of milliseconds above 0 and at most ${Me} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Fr(t,e={}){if(typeof t!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=t,o=e.credentials??"omit";return{async post(u,l,a,i){let h=i.timeoutMs,C=Ar(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Oe(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=P=>g?Oe(h):P,L;try{L=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:y.signal})}catch(P){throw b(),T(P)}let R=X(L),M=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...M,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(P){throw T(P)}finally{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(P){try{let s=await x.read();if(s.done){b(),P.close();return}P.enqueue(s.value)}catch(s){b(),P.error(T(s))}},cancel(P){return b(),x.cancel(P)}});return{status:R.status,...M,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,kr="/LLMChart/",Gr="/LLMChart/qualify",Dr="/VisionReview/",Vr="/LLMChart/sample",Ur="/RefundGenerate/",Wr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",K=async t=>JSON.parse(await t.text());function qr(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function zr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(e.apiPath!==void 0&&typeof e.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(e.nocache!==void 0&&e.nocache!==null&&typeof e.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,h=g=>e.nocache?e.nocache(g):String(l.now());async function C(g,f,c,p,b){let T=`${i()}${a}${f}?nocache=${h(g)}`,L={"Content-Type":"text/plain","X-Signature":k(c,o)},R=p.signal??void 0,M=(w,P)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&Wr(P),cancelled:s,error:P}},x;try{x=await u.post(T,c,L,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return M(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)qr(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 b(x)}}catch(w){return M(!0,w)}}function y(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=y("generate",f),p=c.onStage??void 0;return C("generate",kr,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??Gr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,K)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Dr,p,c,K)},async sample(g,f){let c=y("sample",f);return C("sample",Vr,I(g),c,K)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",Ur,JSON.stringify({CorrelationID:g.trim()}),c,K)}}}export{Y as CITY_ROLE_MATCH_PCT,Or as CLIENT_EVENT_KINDS,mr as CLIENT_SECRET_MISMATCH,He as COMPOUND_MIN_STEM,ct as CYCLE_MEMBERS,mt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Qn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,En as DEFAULT_GAP_FACTOR,rt as DEFAULT_TEMPERATURE,dr as FREEMIUM_ATTEMPT_SPENT,fr as FREEMIUM_COLUMN_CAP,tt as GET_RANDOM,je as GLUED_STEM_MIN,Qe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,pn as IDENTIFIER_HEAD_INITIAL,gn as IDENTIFIER_UNFOLDED,fn as IDENTIFIER_WORDS,Xt as INTENSIVE_SUFFIX_TOKENS,Qt as INTENSIVE_WORD_TOKENS,kn as IndexedText,Rt as LOOSE_KEY_MIN_LENGTH,wt as LooseIndex,Tn as MAX_RUN_BOUNDS,ht as PERIOD_CODE_FORMS,yt as PERIOD_CODE_MEMBERS,Ct as PERIOD_ORDINALS,bt as PERIOD_UNFOLDED,Zt as POSITIONAL_SUFFIX_TOKENS,Jt as POSITIONAL_WORD_TOKENS,qn as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,O as ROLE_MATCH_PCT,xn as SERIES_COMPLETENESS_MAX_LISTED,wn as SERIES_COMPLETENESS_MIN_FILL,Pn as SERIES_KEY_MAX_DISTINCT,_r as SEV_ERROR,wr as SEV_INFO,vr as SEV_USER_PRESENTED,Pr as SEV_WARNING,j as SIMPLE_STRING_HASH,et as STR,Je as SUBSTRING_MIN,Ae as SUPPORTED_LANGUAGES,Fe as SUPPORTED_LANGUAGE_CODES,Mr as TELEMETRY_TIMEOUT_DEV_MS,Lr as TELEMETRY_TIMEOUT_MS,De as VOCABULARY_LANGUAGE_CODES,Ge as VOCABULARY_ONLY_LANGUAGES,dt as YEAR_WORDS,z as admin1MatchPct,un as allowedAggregations,pr as answerIsRetryable,qt as buildGeoIsoColumn,kt as buildGeoPointColumns,ft as calendarWordIn,br as capabilityFields,Dt as cityMatchPct,Gt as cityTagsFor,An as classifyAdditivity,ln as classifyForAggregation,Fn as classifyNumericValueNature,In as classifyTemporal,rn as codeNeedsLegacyAggNames,hn as codeReadsColumn,Cn as codeReadsColumnsByRoleOrPosition,nn as collapseRepeatedAggPrefix,bn as columnsTheCodeReads,Kt as countryRegion,zr as createGenerateClient,Nr as createTelemetryClient,gr as credentialFields,Jn as dateLevelPart,Zn as dateLevelYearAdmits,Gn as decimalSeparatorOf,cn as defaultAggregation,Dn as detectDecimalSeparator,Bt as detectFormatSignature,Vt as detectGeo,vt as detectOrdinalDomain,On as detectTextDatePattern,I as encodePayload,Un as engineTypeForSqlType,on as englishImplicitAggNames,se as eventLogLine,Cr as fetchFields,Fr as fetchTransport,Ue as foldName,or as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Ye as gluedPrefixStems,rr as guardColumnNames,$n as gzipWireText,Xe as hangulWordEndsWith,tn as hasDefaultAggPrefix,$e as hasUnsegmentedScript,Nn as hostAggHint,Wn as ingest,dn as isAggregationAllowed,V as isBlankLike,Mt as isCityTableLoaded,$ as isColumnContextRef,nt as isDeterministicRefusal,Ir as isEventLogCode,At as isGeoPointAmbiguity,Mn as isIdentifierName,Wt as isJoinGeoKind,Hn as isNdjsonContentType,Pt as isOrdinalFriendlyName,xt as isUsableLooseKey,Kn as keyedSigner,Tr as leafCardinalityField,lt as localMidnightDateColumns,at as localMidnightToUtcDay,gt as localizedCycleIn,yn as localizedIdentifierWordIn,pt as localizedYearWordIn,A as looksLikeCountryColumn,St as looseNameKey,Ze as matchNameToken,hr as maxNonMeasureCardinality,Rn as measureCadence,Ln as measureSeriesCompleteness,k as messageSignature,nr as missingHardColumnRefs,Yt as monthLookupFor,qe as nameLetterRuns,an as nameLooksIntensiveRate,sn as nameLooksPositional,he as nameProbeIsGuarded,tr as nameProbeKeepsDrawing,We as nameWords,Ot as normalizeCountry,ut as normalizeLocalMidnightDates,jt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,Sr as offeredShortlistFor,ot as parseDateStable,ar as parseGenerateResponse,Vn as parseNumberText,lr as parseQualifyResponse,ur as parseReviewVerdict,Sn as parseTemporalPoint,zn as payloadPreview,Tt as periodCodeSeries,vn as pickSeriesColumn,cr as progressStageOf,J as readGenerateStream,ze as readName,Et as readPeriodCode,E as readWireField,Lt as registerCityTable,$t as registerIso3Regions,v as resolveAdmin1,Pe as resolveFetchVersion,Ft as resolveGeoPoint,Ve as resolveLanguage,Yn as resolvePointRoles,Er as retryFields,_t as safeDistinctValuesToShip,Le as schemaIdentity,xr as schemaIdentityKey,ve as schemaTypeFamily,_n as seriesKeyVerdict,mn as shareOfTotalIsHonest,_e as shortlistIsStale,en as stripHostAggPrefix,Ht as summarizeCountryRegions,zt as summarizeGeoExtent,ke as supportedLanguage,Ut as toGeoIso,Ke as unsegmentedRuns,yr as viewportFields,B as vocabularyLanguage,it as wholeDayFrame,st as wholeDayIso,X as wireResponseFromFetch,Be as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,It as zipToPrefix3};
2
+ import{a as qn,b as zn}from"./chunk-HIVICMC5.mjs";import{a as $n,b as I,c as Kn,d as k,e as E,f as Hn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as Gn,b as Dn,c as Vn,d as Un,e as Wn}from"./chunk-N52JPYZI.mjs";import{A as bn,B as En,C as Tn,D as Sn,E as Rn,F as xn,G as wn,H as _n,I as Pn,J as On,K as vn,L as Ln,M as Mn,N as In,O as Nn,P as An,Q as Fn,S as kn,a as zt,b as $t,c as Kt,d as Ht,e as Qt,f as Xt,g as Jt,h as Zt,i as en,j as tn,k as nn,l as rn,m as on,n as sn,o as an,p as ln,q as un,r as cn,s as dn,t as mn,u as fn,v as pn,w as gn,x as yn,y as hn,z as Cn}from"./chunk-OPDY2YEA.mjs";import{a as Bt}from"./chunk-U3H6UBOO.mjs";import{a as jt,b as Yt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Vt,d as Ut,e as Wt,f as qt}from"./chunk-KQOVPOVU.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as vt,m as Lt,n as ae,o as O,p as Mt,q as It,r as Nt,s as q,t as At,u as Ft,v as kt,w as Gt,x as Q,y as Dt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ct,b as dt,c as mt,d as ft,e as pt,f as gt,g as yt,h as ht,i as Ct,j as bt,k as Et,l as Tt,m as _t,n as Pt,o as Ot}from"./chunk-GKXYRUK5.mjs";import{A as rt,B as ot,C as it,D as st,E as at,F as lt,G as ut,a as Ae,b as Fe,c as ke,d as Ge,e as De,f as B,g as Ve,h as Ue,i as We,j as qe,k as ze,l as $e,m as Ke,n as He,o as Be,p as je,q as Ye,r as Qe,s as Xe,t as Je,u as Ze,v as et,x as j,y as tt,z as nt}from"./chunk-4VN252CK.mjs";import{b as St,c as Rt,d as xt,e as wt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(t){return!!W(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=U(String(n));if(!V(o)&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function A(t){let e=F(t);if(e.length===0||ne(t)<95)return!1;let n=e.filter(u=>te(u)&&!O(u)).length,o=e.filter(u=>!te(u)&&!!O(u)).length;return n>=1&&n>=o}function ce(t,e){if(!O(t))return!1;let n=W(t);return n?e==="world"?!0:ae.has(n):!1}function ne(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)te(o)&&n++;return Math.round(n/e.length*1e3)/10}function z(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)O(o)&&n++;return Math.round(n/e.length*1e3)/10}function oe(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function re(t){let e=oe(t);if(e.length===0)return 0;let n=0;for(let o of e)q(o).length>0&&n++;return Math.round(n/e.length*1e3)/10}function de(t,e){return ue(e,le)?!0:oe(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Bn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)Q(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function ee(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function jn(t,e){let n=0;for(let o of oe(t))e(o)&&n++;return n}function Yn(t,e,n,o,u){let l=[],a=[],i={},h={},C=new Set(t),y=s=>e.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.has(d)&&(i[s]=d)}let g=new Set(u??t);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&C.has(f)){let s=y(f),d=re(s);d<95?a.push(`zip=${f} (only ${d}% of values read as ZIPs)`):de(s,f)?i.zip=f:a.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?a.push(`state=${c} (every value is "CA", which is both Canada and California)`):A(s)?(a.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):z(s)<95?a.push(`state=${c} (only ${z(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=t.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(A(S))continue;let P=z(S);if(P<95)continue;let H=ee(S,D=>!!O(D)),Ne=ee(S,D=>!!O(D)&&!ce(D,o));H<Z&&Ne<1||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.state=s.name,p.add(s.name),l.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(jn(d,P=>q(P).length>0)<Z)){i.zip=s,p.add(s),l.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!A(y(T))){let s=null;for(let d of b){if(p.has(d)||!A(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(a.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.country=T),i.country=s.name,p.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of b){if(p.has(d))continue;let S=y(d),P=Bn(S,o);P<Y||ee(S,H=>Q(H,o))<Z||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let v=i.country?y(i.country):[],R=!!i.country&&A(v),L=R?new Set(v.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&L>=2,w=!!(i.lat&&i.lon)&&e.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&&a.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&a.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:l,refused:a,...Object.keys(h).length?{labelFallback:h}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),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")}),Qn=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(t=>t.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Xn(t,e){let n=[],o=B(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function Jn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of Xn(n,e)){let u=ie[o];if(u&&u.langs.includes(e))return u.part}return null}function Zn(t,e){return fe.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=pe&&e<=ge:!0}function ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var er=/\b(?:columns|cols|column)\b/i;function $(t,e){let n=Math.max(0,e-240),o=t.slice(n,e),u=o.lastIndexOf(";");return u>=0&&(o=o.slice(u+1)),er.test(o)}function he(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(t))}function Ce(t,e,n){let o=ye(e),u=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),l=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),a=0,i;for(;(i=l.exec(t))!==null;)$(t,i.index)&&a++;let h=0;for(;(i=u.exec(t))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!$(t,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===a}function tr(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(t)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(t))}var be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function nr(t,e){if(!t)return[];let n=new Set(e);for(let i of be)n.add(i);let o=new Set,u=/\.name\s*===?\s*(['"])([^'"]+)\1/g,l;for(;(l=u.exec(t))!==null;)$(t,l.index)&&o.add(l[2]);if(o.size===0)return[];let a=[];return o.forEach(i=>{n.has(i)||he(t,i)||a.push(i)}),a}function rr(t,e){if(!t)return[];let n=(t.getColumns()||[]).map(o=>o.name);if(!e||typeof t.aliasesForCode!="function")return n;for(let o of t.aliasesForCode(e))n.push(o.alias);return n}function Ee(t,e){let n=e?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(t)||t<=n?0:Math.round(t-n)}function or(t,e,n){let o=Ee(t,e);if(o===null||o<=0)return null;let u=typeof e?.freemiumColumnCapPivot=="number"?e.freemiumColumnCapPivot:4,l=o>u?e?.freemiumColumnCapMessageMany:e?.freemiumColumnCapMessageFew;if(typeof l!="string"||l.trim().length===0)return null;let a=l.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=Te(n);return i.length===0?a:a+" "+i.join(" ")}function Te(t){if(!t||t.length===0)return[];let e=[],n=new Map,o=new Map;for(let l of t){let a=typeof l?.dateGroupId=="string"?l.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(e.push(a),n.set(a,0)),l.isDatePart===!0&&n.set(a,n.get(a)+1),l.isReassembledDate===!0&&!o.has(a))){let i=typeof l.sourceField=="string"?l.sourceField.trim():"",h=typeof l.name=="string"?l.name.trim():"",C=i!==""?i:h;C!==""&&o.set(a,C)}}let u=[];for(let l of e){let a=o.get(l),i=n.get(l)??0;!a||i===0||u.push(`'${a}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return u}var m=t=>t==null?"":String(t),N=t=>t===!0,Se=t=>{if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null},ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(t,e){let n={};for(let[o,u]of ir){let l=m(E(t,e+u));l&&(n[o]=l)}return n}function sr(t){return Array.isArray(t)?t.map(e=>({code:m(E(e,"code")),severity:m(E(e,"severity")),text:m(E(e,"text"))})).filter(e=>e.text!==""):[]}function ar(t){let e=C=>E(t,C),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Re(t,"point"),a=Re(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable"),h=e("isPollFinal");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:sr(e("notices")),freemiumStatusCode:m(e("freemiumStatusCode")),code:m(e("code")),language:m(e("language")),version:Number(e("version")??0),codeSummary:m(e("codeSummary")),chartName:m(e("chartName")??e("chartType")),finalChartName:m(e("finalChartName")),warningMessage:m(e("warningMessage")),outputHash:m(e("outputHash")),validatorToken:m(e("validatorToken")),editCodeKey:m(e("editCodeKey")),signedLLMRequestID:m(e("signedLLMRequestID")),userReply:m(e("userReply")),userReplyOutcome:m(e("userReplyOutcome")),improvementSuggestion:m(e("improvementSuggestion")),geoColumn:m(e("geoColumn")),geoKind:m(e("geoKind")),geoPointCols:Object.keys(l).length?l:null,creditBalanceBefore:Se(e("creditBalanceBefore")),creditCost:Se(e("creditCost")),isServiceError:N(e("isServiceError")),isRateLimited:N(e("isRateLimited")),isRefusal:N(e("isRefusal")),isVersionNotFound:N(e("isVersionNotFound")),isGenerationCancelled:N(e("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(e("servedCorrelationId")),...typeof h=="boolean"?{isPollFinal:h}:{},...m(e("pollOutcome"))!==""?{pollOutcome:m(e("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var xe=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function lr(t){let e=E(t,"charts"),n=E(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=h=>E(l,h),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:xe(a("rank")),score:xe(a("score")),renderer:G(a("renderer")),language:G(a("language")),isPreview:N(a("isPreview")),recommended:typeof i=="boolean"?i:void 0,viaProjection:G(a("viaProjection")),viaProjectionKey:G(a("viaProjectionKey")),detailNote:G(a("detailNote"))}}).filter(l=>l.name):null,u=Array.isArray(n)?n.map(l=>({name:m(E(l,"chartTypeName")??E(l,"name")),reason:m(E(l,"reason")),reasonCode:m(E(l,"reasonCode")),isVeto:N(E(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:m(E(t,"errorMessage")),errorCode:m(E(t,"errorCode")),charts:o,refused:u,noFitSummary:m(E(t,"noFitSummary"))}}function ur(t){return!t||typeof t!="object"?null:{status:String(E(t,"status")??""),verdictReason:E(t,"verdictReason")??null,instruction:E(t,"instruction")??null,fix:E(t,"fix")??null,errorMessage:E(t,"errorMessage")??null,errorCode:E(t,"errorCode")??null}}var we=["working","analyze","generate","refine","review"];function cr(t,e){let n=String(t??"").trim().toLowerCase();if(we.includes(n))return n;let o=String(e??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var dr="FREEMIUM_ATTEMPT_SPENT",mr="CLIENT_SECRET_MISMATCH",fr="FREEMIUM_COLUMN_CAP",pr="OAUTH_TOKEN_EXPIRED",gr="OAUTH_SIGNED_OUT";function yr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function hr(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?null:t.accessToken?(t.accessToken()??"").trim():null,o=e||n?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e,accessToken:n}}function Cr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function br(t){let e=0;for(let n of t){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>e&&(e=o)}return e}function _e(t){if(t.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(t.recoveryFetchVersion!=null)return{version:t.recoveryFetchVersion,fetchOnly:!0};let e=t.settingVersion??null;if(t.genNew)return{version:e,fetchOnly:void 0};let n=(e??0)>0?e:null,o=(t.codeVersion??0)>0?t.codeVersion:null,u=n??o??e;return{version:u,fetchOnly:u!=null&&u>0?!0:void 0}}function Er(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=_e({genNew:o,recoveryFetchVersion:t.recoveryFetchVersion,recoveryFetchByCorrelation:e,settingVersion:t.settingVersion,codeVersion:t.codeVersion});return{genNew:o,version:u.version,fetchOnly:u.fetchOnly,fetchCorrelationId:t.fetchCorrelationId??void 0}}function Tr(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Sr(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function Rr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Pe(t,e){return t!=null&&e!=null&&t!==e}function xr(t,e){return t?Pe(e.capturedFor,e.now)?{shortlist:void 0,stale:!0}:{shortlist:{...t,ageMs:e.atMs>0?Math.max(0,Math.round(e.nowMs-e.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var wr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Oe(t){let e=String(t??"").trim().toLowerCase();return wr[e]??e}function ve(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Oe(n.dataType)]);return e}function _r(t){return j(ve(t))}var Pr=2,Or=3,vr=4,Lr=64,Mr=8e3,Ir=6e4,Nr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function Ar(t){return!!t&&!t.includes("|")&&!t.includes(",")}function se(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function Fr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.clientVersion!="string"||e.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof e.timeoutMs!="number"||!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=e.timeoutMs,h=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,C=g=>{try{e.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await u.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${a}/LogClientMsg/?nocache=${l.now()}`,c=I(g),p=k(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${a}/eventlog`,b=se(g,e.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"Content-Type":"text/plain"})}}}var Le=2**31-1;function Me(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function kr(t){return typeof t=="number"&&t>0&&t<=Le?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(t)} ms: it must be a number of milliseconds above 0 and at most ${Le} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Gr(t,e={}){if(typeof t!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=t,o=e.credentials??"omit";return{async post(u,l,a,i){let h=i.timeoutMs,C=kr(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Me(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Me(h):_,v;try{v=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:y.signal})}catch(_){throw b(),T(_)}let R=X(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{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){b(),_.close();return}_.enqueue(s.value)}catch(s){b(),_.error(T(s))}},cancel(_){return b(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,Dr="/LLMChart/",Vr="/LLMChart/qualify",Ur="/VisionReview/",Wr="/LLMChart/sample",qr="/RefundGenerate/",zr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",K=async t=>JSON.parse(await t.text());function $r(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function Kr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(e.apiPath!==void 0&&typeof e.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(e.nocache!==void 0&&e.nocache!==null&&typeof e.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,h=g=>e.nocache?e.nocache(g):String(l.now());async function C(g,f,c,p,b){let T=`${i()}${a}${f}?nocache=${h(g)}`,v={"Content-Type":"text/plain","X-Signature":k(c,o)},R=p.signal??void 0,L=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&zr(_),cancelled:s,error:_}},x;try{x=await u.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)$r(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 b(x)}}catch(w){return L(!0,w)}}function y(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=y("generate",f),p=c.onStage??void 0;return C("generate",Dr,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??Vr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,K)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Ur,p,c,K)},async sample(g,f){let c=y("sample",f);return C("sample",Wr,I(g),c,K)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",qr,JSON.stringify({CorrelationID:g.trim()}),c,K)}}}export{Y as CITY_ROLE_MATCH_PCT,Nr as CLIENT_EVENT_KINDS,mr as CLIENT_SECRET_MISMATCH,He as COMPOUND_MIN_STEM,ct as CYCLE_MEMBERS,mt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Qn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,En as DEFAULT_GAP_FACTOR,rt as DEFAULT_TEMPERATURE,dr as FREEMIUM_ATTEMPT_SPENT,fr as FREEMIUM_COLUMN_CAP,tt as GET_RANDOM,je as GLUED_STEM_MIN,Qe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,pn as IDENTIFIER_HEAD_INITIAL,gn as IDENTIFIER_UNFOLDED,fn as IDENTIFIER_WORDS,Xt as INTENSIVE_SUFFIX_TOKENS,Qt as INTENSIVE_WORD_TOKENS,kn as IndexedText,Rt as LOOSE_KEY_MIN_LENGTH,wt as LooseIndex,Tn as MAX_RUN_BOUNDS,gr as OAUTH_SIGNED_OUT,pr as OAUTH_TOKEN_EXPIRED,ht as PERIOD_CODE_FORMS,yt as PERIOD_CODE_MEMBERS,Ct as PERIOD_ORDINALS,bt as PERIOD_UNFOLDED,Zt as POSITIONAL_SUFFIX_TOKENS,Jt as POSITIONAL_WORD_TOKENS,qn as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,M as ROLE_MATCH_PCT,xn as SERIES_COMPLETENESS_MAX_LISTED,wn as SERIES_COMPLETENESS_MIN_FILL,_n as SERIES_KEY_MAX_DISTINCT,vr as SEV_ERROR,Pr as SEV_INFO,Lr as SEV_USER_PRESENTED,Or as SEV_WARNING,j as SIMPLE_STRING_HASH,et as STR,Je as SUBSTRING_MIN,Ae as SUPPORTED_LANGUAGES,Fe as SUPPORTED_LANGUAGE_CODES,Ir as TELEMETRY_TIMEOUT_DEV_MS,Mr as TELEMETRY_TIMEOUT_MS,De as VOCABULARY_LANGUAGE_CODES,Ge as VOCABULARY_ONLY_LANGUAGES,dt as YEAR_WORDS,z as admin1MatchPct,un as allowedAggregations,yr as answerIsRetryable,qt as buildGeoIsoColumn,kt as buildGeoPointColumns,ft as calendarWordIn,Tr as capabilityFields,Dt as cityMatchPct,Gt as cityTagsFor,An as classifyAdditivity,ln as classifyForAggregation,Fn as classifyNumericValueNature,In as classifyTemporal,rn as codeNeedsLegacyAggNames,hn as codeReadsColumn,Cn as codeReadsColumnsByRoleOrPosition,nn as collapseRepeatedAggPrefix,bn as columnsTheCodeReads,Kt as countryRegion,Kr as createGenerateClient,Fr as createTelemetryClient,hr as credentialFields,Jn as dateLevelPart,Zn as dateLevelYearAdmits,Gn as decimalSeparatorOf,cn as defaultAggregation,Dn as detectDecimalSeparator,Bt as detectFormatSignature,Vt as detectGeo,Ot as detectOrdinalDomain,Mn as detectTextDatePattern,I as encodePayload,Un as engineTypeForSqlType,on as englishImplicitAggNames,se as eventLogLine,Er as fetchFields,Gr as fetchTransport,Ue as foldName,or as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Ye as gluedPrefixStems,rr as guardColumnNames,$n as gzipWireText,Xe as hangulWordEndsWith,tn as hasDefaultAggPrefix,$e as hasUnsegmentedScript,Nn as hostAggHint,Wn as ingest,dn as isAggregationAllowed,V as isBlankLike,Lt as isCityTableLoaded,$ as isColumnContextRef,nt as isDeterministicRefusal,Ar as isEventLogCode,At as isGeoPointAmbiguity,Ln as isIdentifierName,Wt as isJoinGeoKind,Hn as isNdjsonContentType,_t as isOrdinalFriendlyName,xt as isUsableLooseKey,Kn as keyedSigner,Rr as leafCardinalityField,lt as localMidnightDateColumns,at as localMidnightToUtcDay,gt as localizedCycleIn,yn as localizedIdentifierWordIn,pt as localizedYearWordIn,A as looksLikeCountryColumn,St as looseNameKey,Ze as matchNameToken,br as maxNonMeasureCardinality,Rn as measureCadence,vn as measureSeriesCompleteness,k as messageSignature,nr as missingHardColumnRefs,Yt as monthLookupFor,qe as nameLetterRuns,an as nameLooksIntensiveRate,sn as nameLooksPositional,he as nameProbeIsGuarded,tr as nameProbeKeepsDrawing,We as nameWords,Mt as normalizeCountry,ut as normalizeLocalMidnightDates,jt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,xr as offeredShortlistFor,ot as parseDateStable,ar as parseGenerateResponse,Vn as parseNumberText,lr as parseQualifyResponse,ur as parseReviewVerdict,Sn as parseTemporalPoint,zn as payloadPreview,Tt as periodCodeSeries,On as pickSeriesColumn,cr as progressStageOf,J as readGenerateStream,ze as readName,Et as readPeriodCode,E as readWireField,vt as registerCityTable,$t as registerIso3Regions,O as resolveAdmin1,_e as resolveFetchVersion,Ft as resolveGeoPoint,Ve as resolveLanguage,Yn as resolvePointRoles,Sr as retryFields,Pt as safeDistinctValuesToShip,ve as schemaIdentity,_r as schemaIdentityKey,Oe as schemaTypeFamily,Pn as seriesKeyVerdict,mn as shareOfTotalIsHonest,Pe as shortlistIsStale,en as stripHostAggPrefix,Ht as summarizeCountryRegions,zt as summarizeGeoExtent,ke as supportedLanguage,Ut as toGeoIso,Ke as unsegmentedRuns,Cr as viewportFields,B as vocabularyLanguage,it as wholeDayFrame,st as wholeDayIso,X as wireResponseFromFetch,Be as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,It as zipToPrefix3};
@@ -1,2 +1,2 @@
1
1
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
- import{a,b}from"./chunk-UQU75XXR.mjs";export{a as PREVIEW_OMITTED_FIELDS,b as payloadPreview};
2
+ import{a,b}from"./chunk-HIVICMC5.mjs";export{a as PREVIEW_OMITTED_FIELDS,b as payloadPreview};
@@ -57,6 +57,9 @@ export interface CredentialTriple {
57
57
  * Optional members, each from the host matrix:
58
58
  * - `linkNonce`: a host that signs in by a linked session rather than a typed key. Today the
59
59
  * Excel add-in only; absent elsewhere.
60
+ * - `accessToken`: a host that signs its user in through the browser and holds an access token
61
+ * for the person's account. Today the MCP server only, and only when no key is configured: which
62
+ * credential a host prefers is the host's decision, so a host that holds a key offers no token.
60
63
  * - `freemiumKey`: a host with a free tier minted per install. Today the Power BI visual only;
61
64
  * the add-in and the MCP server have no free tier by decision, and a page with no
62
65
  * credentials has none either.
@@ -68,6 +71,7 @@ export interface CredentialTriple {
68
71
  export interface CredentialSource {
69
72
  triple(): CredentialTriple;
70
73
  linkNonce?: (() => string | null) | null;
74
+ accessToken?: (() => string | null) | null;
71
75
  freemiumKey?: (() => string | null) | null;
72
76
  instanceKey?: (() => string | null) | null;
73
77
  }
@@ -55,7 +55,7 @@ export { readGenerateStream, isNdjsonContentType, wireResponseFromFetch } from "
55
55
  export type { OnStage } from "./wireStream";
56
56
  export { parseGenerateResponse, parseQualifyResponse, parseReviewVerdict } from "./wireParse";
57
57
  export type { ParsedGenerateResponse, ParsedQualifyResponse, ParsedQualifyChart, ParsedQualifyRefusal, ParsedReviewVerdict, ParsedNotice, WirePointBinding, WirePointColumns, } from "./wireParse";
58
- export { PROGRESS_STAGE_IDS, progressStageOf, FREEMIUM_ATTEMPT_SPENT, CLIENT_SECRET_MISMATCH, FREEMIUM_COLUMN_CAP, answerIsRetryable, } from "./messageCodes";
58
+ export { PROGRESS_STAGE_IDS, progressStageOf, FREEMIUM_ATTEMPT_SPENT, CLIENT_SECRET_MISMATCH, FREEMIUM_COLUMN_CAP, OAUTH_TOKEN_EXPIRED, OAUTH_SIGNED_OUT, answerIsRetryable, } from "./messageCodes";
59
59
  export type { ProgressStageId } from "./messageCodes";
60
60
  export { viewportFields, maxNonMeasureCardinality, credentialFields, resolveFetchVersion, fetchFields, capabilityFields, retryFields, leafCardinalityField, shortlistIsStale, offeredShortlistFor, } from "./wireBuild";
61
61
  export type { ViewportFields, CredentialFields, FetchRequest, FetchFields, CapabilityFields, RetryFields, } from "./wireBuild";
@@ -18,6 +18,13 @@ export declare const FREEMIUM_ATTEMPT_SPENT = "FREEMIUM_ATTEMPT_SPENT";
18
18
  export declare const CLIENT_SECRET_MISMATCH = "CLIENT_SECRET_MISMATCH";
19
19
  /** The free tier's field cap: a wall that spent nothing (the historical `refusalCode`, kept). */
20
20
  export declare const FREEMIUM_COLUMN_CAP = "FREEMIUM_COLUMN_CAP";
21
+ /** A signed-in account's access token is past its expiry while its sign-in is still alive. A host
22
+ * that signs in through the browser refreshes the token silently and sends the request once more;
23
+ * nothing ran and nothing was charged. */
24
+ export declare const OAUTH_TOKEN_EXPIRED = "OAUTH_TOKEN_EXPIRED";
25
+ /** The sign-in behind an access token is gone - revoked from the account page, expired, or unknown.
26
+ * A host forgets the tokens it holds and asks the person to sign in again, once. */
27
+ export declare const OAUTH_SIGNED_OUT = "OAUTH_SIGNED_OUT";
21
28
  /**
22
29
  * May the same request, sent again, answer differently? The server's `retryable` flag when it sent
23
30
  * one; null when it did not (a success, or a server older than the flag) - the host then decides as
@@ -14,6 +14,12 @@ export interface CredentialFields {
14
14
  * linked session sends no such field. The host places it; it sits at a different key in each.
15
15
  */
16
16
  linkNonce: string | null;
17
+ /**
18
+ * The signed-in account's access token as the wire carries it (the request's `accessToken`):
19
+ * trimmed, "" when the host signs in this way but has no token right now. Null when the source
20
+ * has no `accessToken` member, and null whenever a live link nonce travels instead.
21
+ */
22
+ accessToken: string | null;
17
23
  }
18
24
  /**
19
25
  * THE CREDENTIALS A REQUEST CARRIES: ONE CREDENTIAL, AND A LINKED SESSION'S NONCE WINS.
@@ -27,6 +33,12 @@ export interface CredentialFields {
27
33
  * What each value holds is the source's own: a host that resolves a mode (licensed or free tier) or
28
34
  * trims what a reader typed does that in its source. The free-tier key rides beside either, "" when
29
35
  * the source has none.
36
+ *
37
+ * A SIGNED-IN ACCOUNT'S ACCESS TOKEN follows the same rule for the same reason: the server reads the
38
+ * token only when the triple is empty, so a live token travels with an EMPTY triple, never beside a
39
+ * key. A live nonce outranks it (a source offering both has two sessions, and the nonce is the one
40
+ * this rule already sends). Which of a key and a token a host prefers is decided in its source: a
41
+ * host that holds a key returns no token.
30
42
  */
31
43
  export declare function credentialFields(source: CredentialSource): CredentialFields;
32
44
  /** The two places a generate request states its drawing area, in the order they travel. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/shape-core",
3
- "version": "0.6.66",
3
+ "version": "0.6.69",
4
4
  "description": "Host-agnostic data-shape profiler: ingest a dataset's rows through IValueCollection.addRow and read back the measured shape as an LLMColumnWithValue[] payload — types, cardinality, temporal/ordinal detection, geographic region and point resolution, cross-column signals. MEASUREMENT only: the policy that decides what a measured shape means for chart selection lives server-side.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
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
- var c=Object.freeze(["licenseKey","licensee","secretKey","freemiumKey","linkNonce","clientId","instanceKey","correlationId"]);function a(t){let e=t.shape;return!Array.isArray(e)||e.length===0}function l(t,e={}){let i=new Set(c),o={};for(let[r,n]of Object.entries(t??{}))if(!i.has(r)){if(r==="sampleCsv"){let s=typeof n=="string"?n.length>0:n!=null;o[r]=s?e.sampleNote??null:n;continue}o[r]=n}return e.emptyShapeNote&&a(t??{})&&(o._note=e.emptyShapeNote),o}export{c as a,l as b};