@gram-ai/elements 1.13.5 → 1.13.7

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,16 @@
1
+ "use strict";const $=require("react/jsx-runtime"),A=require("react"),De=require("@assistant-ui/react"),oe=require("vega"),Ce=A.createContext(void 0),ie=()=>{const e=A.useContext(Ce);if(!e)throw new Error("useElements must be used within a ElementsProvider");return e},qe={compact:{"p-xs":"p-1","p-sm":"p-1.5","p-md":"p-2","p-lg":"p-2.5","p-xl":"p-3","px-xs":"px-1","px-sm":"px-1.5","px-md":"px-2","px-lg":"px-2.5","px-xl":"px-3","py-xs":"py-1","py-sm":"py-1.5","py-md":"py-2","py-lg":"py-2.5","py-xl":"py-3","gap-sm":"gap-1","gap-md":"gap-1.5","gap-lg":"gap-2","gap-xl":"gap-2.5","h-header":"h-10","h-input":"min-h-10","text-base":"text-sm","text-title":"text-xl","text-subtitle":"text-sm"},normal:{"p-xs":"p-1","p-sm":"p-2","p-md":"p-3","p-lg":"p-4","p-xl":"p-6","px-xs":"px-1","px-sm":"px-2","px-md":"px-3","px-lg":"px-4","px-xl":"px-6","py-xs":"py-1","py-sm":"py-2","py-md":"py-3","py-lg":"py-4","py-xl":"py-6","gap-sm":"gap-1.5","gap-md":"gap-2","gap-lg":"gap-3","gap-xl":"gap-4","h-header":"h-12","h-input":"min-h-12","text-base":"text-base","text-title":"text-2xl","text-subtitle":"text-base"},spacious:{"p-xs":"p-2","p-sm":"p-3","p-md":"p-4","p-lg":"p-6","p-xl":"p-10","px-xs":"px-2","px-sm":"px-3","px-md":"px-4","px-lg":"px-6","px-xl":"px-10","py-xs":"py-2","py-sm":"py-3","py-md":"py-4","py-lg":"py-6","py-xl":"py-10","gap-sm":"gap-2","gap-md":"gap-3","gap-lg":"gap-4","gap-xl":"gap-6","h-header":"h-14","h-input":"min-h-16","text-base":"text-lg","text-title":"text-3xl","text-subtitle":"text-lg"}},ze=()=>{const{config:e}=ie(),r=e.theme?.density??"normal";return t=>qe[r][t]},Je={sharp:{sm:"rounded-sm",md:"rounded",lg:"rounded-md",xl:"rounded-lg",full:"rounded-lg"},soft:{sm:"rounded",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},round:{sm:"rounded-lg",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-full"}},Ae=()=>{const{config:e}=ie(),r=e.theme?.radius??"soft";return t=>Je[r][t]};function Se(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=Se(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Re(){for(var e,r,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=Se(e))&&(o&&(o+=" "),o+=r);return o}const Ye=(e,r)=>{const t=new Array(e.length+r.length);for(let o=0;o<e.length;o++)t[o]=e[o];for(let o=0;o<r.length;o++)t[e.length+o]=r[o];return t},Xe=(e,r)=>({classGroupId:e,validator:r}),Ee=(e=new Map,r=null,t)=>({nextPart:e,validators:r,classGroupId:t}),Q="-",he=[],Ze="arbitrary..",He=e=>{const r=Qe(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ke(i);const m=i.split(Q),c=m[0]===""&&m.length>1?1:0;return Ie(m,c,r)},getConflictingClassGroupIds:(i,m)=>{if(m){const c=o[i],g=t[i];return c?g?Ye(g,c):c:g||he}return t[i]||he}}},Ie=(e,r,t)=>{if(e.length-r===0)return t.classGroupId;const a=e[r],l=t.nextPart.get(a);if(l){const g=Ie(e,r+1,l);if(g)return g}const i=t.validators;if(i===null)return;const m=r===0?e.join(Q):e.slice(r).join(Q),c=i.length;for(let g=0;g<c;g++){const f=i[g];if(f.validator(m))return f.classGroupId}},Ke=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),t=r.indexOf(":"),o=r.slice(0,t);return o?Ze+o:void 0})(),Qe=e=>{const{theme:r,classGroups:t}=e;return et(t,r)},et=(e,r)=>{const t=Ee();for(const o in e){const a=e[o];le(a,t,o,r)}return t},le=(e,r,t,o)=>{const a=e.length;for(let l=0;l<a;l++){const i=e[l];tt(i,r,t,o)}},tt=(e,r,t,o)=>{if(typeof e=="string"){rt(e,r,t);return}if(typeof e=="function"){ot(e,r,t,o);return}st(e,r,t,o)},rt=(e,r,t)=>{const o=e===""?r:Ne(r,e);o.classGroupId=t},ot=(e,r,t,o)=>{if(nt(e)){le(e(o),r,t,o);return}r.validators===null&&(r.validators=[]),r.validators.push(Xe(t,e))},st=(e,r,t,o)=>{const a=Object.entries(e),l=a.length;for(let i=0;i<l;i++){const[m,c]=a[i];le(c,Ne(r,m),t,o)}},Ne=(e,r)=>{let t=e;const o=r.split(Q),a=o.length;for(let l=0;l<a;l++){const i=o[l];let m=t.nextPart.get(i);m||(m=Ee(),t.nextPart.set(i,m)),t=m}return t},nt=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,at=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=Object.create(null),o=Object.create(null);const a=(l,i)=>{t[l]=i,r++,r>e&&(r=0,o=t,t=Object.create(null))};return{get(l){let i=t[l];if(i!==void 0)return i;if((i=o[l])!==void 0)return a(l,i),i},set(l,i){l in t?t[l]=i:a(l,i)}}},ae="!",xe=":",it=[],ye=(e,r,t,o,a)=>({modifiers:e,hasImportantModifier:r,baseClassName:t,maybePostfixModifierPosition:o,isExternal:a}),lt=e=>{const{prefix:r,experimentalParseClassName:t}=e;let o=a=>{const l=[];let i=0,m=0,c=0,g;const f=a.length;for(let z=0;z<f;z++){const w=a[z];if(i===0&&m===0){if(w===xe){l.push(a.slice(c,z)),c=z+1;continue}if(w==="/"){g=z;continue}}w==="["?i++:w==="]"?i--:w==="("?m++:w===")"&&m--}const v=l.length===0?a:a.slice(c);let x=v,C=!1;v.endsWith(ae)?(x=v.slice(0,-1),C=!0):v.startsWith(ae)&&(x=v.slice(1),C=!0);const S=g&&g>c?g-c:void 0;return ye(l,C,x,S)};if(r){const a=r+xe,l=o;o=i=>i.startsWith(a)?l(i.slice(a.length)):ye(it,!1,i,void 0,!0)}if(t){const a=o;o=l=>t({className:l,parseClassName:a})}return o},ct=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((t,o)=>{r.set(t,1e6+o)}),t=>{const o=[];let a=[];for(let l=0;l<t.length;l++){const i=t[l],m=i[0]==="[",c=r.has(i);m||c?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(i)):a.push(i)}return a.length>0&&(a.sort(),o.push(...a)),o}},dt=e=>({cache:at(e.cacheSize),parseClassName:lt(e),sortModifiers:ct(e),...He(e)}),pt=/\s+/,mt=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:l}=r,i=[],m=e.trim().split(pt);let c="";for(let g=m.length-1;g>=0;g-=1){const f=m[g],{isExternal:v,modifiers:x,hasImportantModifier:C,baseClassName:S,maybePostfixModifierPosition:z}=t(f);if(v){c=f+(c.length>0?" "+c:c);continue}let w=!!z,M=o(w?S.substring(0,z):S);if(!M){if(!w){c=f+(c.length>0?" "+c:c);continue}if(M=o(S),!M){c=f+(c.length>0?" "+c:c);continue}w=!1}const D=x.length===0?"":x.length===1?x[0]:l(x).join(":"),_=C?D+ae:D,j=_+M;if(i.indexOf(j)>-1)continue;i.push(j);const G=a(M,w);for(let O=0;O<G.length;++O){const U=G[O];i.push(_+U)}c=f+(c.length>0?" "+c:c)}return c},ut=(...e)=>{let r=0,t,o,a="";for(;r<e.length;)(t=e[r++])&&(o=Me(t))&&(a&&(a+=" "),a+=o);return a},Me=e=>{if(typeof e=="string")return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=Me(e[o]))&&(t&&(t+=" "),t+=r);return t},gt=(e,...r)=>{let t,o,a,l;const i=c=>{const g=r.reduce((f,v)=>v(f),e());return t=dt(g),o=t.cache.get,a=t.cache.set,l=m,m(c)},m=c=>{const g=o(c);if(g)return g;const f=mt(c,t);return a(c,f),f};return l=i,(...c)=>l(ut(...c))},ft=[],b=e=>{const r=t=>t[e]||ft;return r.isThemeGetter=!0,r},Oe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Te=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bt=/^\d+\/\d+$/,ht=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>bt.test(e),u=e=>!!e&&!Number.isNaN(Number(e)),N=e=>!!e&&Number.isInteger(Number(e)),se=e=>e.endsWith("%")&&u(e.slice(0,-1)),I=e=>ht.test(e),vt=()=>!0,Ct=e=>xt.test(e)&&!yt.test(e),Pe=()=>!1,zt=e=>wt.test(e),At=e=>kt.test(e),St=e=>!s(e)&&!n(e),Rt=e=>F(e,Le,Pe),s=e=>Oe.test(e),P=e=>F(e,Ve,Ct),ne=e=>F(e,Ot,u),we=e=>F(e,je,Pe),Et=e=>F(e,Ge,At),H=e=>F(e,Fe,zt),n=e=>Te.test(e),B=e=>W(e,Ve),It=e=>W(e,Tt),ke=e=>W(e,je),Nt=e=>W(e,Le),Mt=e=>W(e,Ge),K=e=>W(e,Fe,!0),F=(e,r,t)=>{const o=Oe.exec(e);return o?o[1]?r(o[1]):t(o[2]):!1},W=(e,r,t=!1)=>{const o=Te.exec(e);return o?o[1]?r(o[1]):t:!1},je=e=>e==="position"||e==="percentage",Ge=e=>e==="image"||e==="url",Le=e=>e==="length"||e==="size"||e==="bg-size",Ve=e=>e==="length",Ot=e=>e==="number",Tt=e=>e==="family-name",Fe=e=>e==="shadow",Pt=()=>{const e=b("color"),r=b("font"),t=b("text"),o=b("font-weight"),a=b("tracking"),l=b("leading"),i=b("breakpoint"),m=b("container"),c=b("spacing"),g=b("radius"),f=b("shadow"),v=b("inset-shadow"),x=b("text-shadow"),C=b("drop-shadow"),S=b("blur"),z=b("perspective"),w=b("aspect"),M=b("ease"),D=b("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...j(),n,s],O=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],p=()=>[n,s,c],R=()=>[V,"full","auto",...p()],ce=()=>[N,"none","subgrid",n,s],de=()=>["auto",{span:["full",N,n,s]},N,n,s],q=()=>[N,"auto",n,s],pe=()=>["auto","min","max","fr",n,s],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...p()],T=()=>[V,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],d=()=>[e,n,s],me=()=>[...j(),ke,we,{position:[n,s]}],ue=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Nt,Rt,{size:[n,s]}],te=()=>[se,B,P],y=()=>["","none","full",g,n,s],k=()=>["",u,B,P],J=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],h=()=>[u,se,ke,we],be=()=>["","none",S,n,s],Y=()=>["none",u,n,s],X=()=>["none",u,n,s],re=()=>[u,n,s],Z=()=>[V,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[I],breakpoint:[I],color:[vt],container:[I],"drop-shadow":[I],ease:["in","out","in-out"],font:[St],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[I],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[I],shadow:[I],spacing:["px",u],text:[I],"text-shadow":[I],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",V,s,n,w]}],container:["container"],columns:[{columns:[u,s,n,m]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[N,"auto",n,s]}],basis:[{basis:[V,"full","auto",m,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[u,V,"auto","initial","none",s]}],grow:[{grow:["",u,n,s]}],shrink:[{shrink:["",u,n,s]}],order:[{order:[N,"first","last","none",n,s]}],"grid-cols":[{"grid-cols":ce()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":ce()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[m,"screen",...T()]}],"min-w":[{"min-w":[m,"screen","none",...T()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",t,B,P]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,n,ne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",se,s]}],"font-family":[{font:[It,s,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,n,s]}],"line-clamp":[{"line-clamp":[u,"none",n,ne]}],leading:[{leading:[l,...p()]}],"list-image":[{"list-image":["none",n,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",n,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:d()}],"text-color":[{text:d()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[u,"from-font","auto",n,P]}],"text-decoration-color":[{decoration:d()}],"underline-offset":[{"underline-offset":[u,"auto",n,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",n,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",n,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},N,n,s],radial:["",n,s],conic:[N,n,s]},Mt,Et]}],"bg-color":[{bg:d()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:d()}],"gradient-via":[{via:d()}],"gradient-to":[{to:d()}],rounded:[{rounded:y()}],"rounded-s":[{"rounded-s":y()}],"rounded-e":[{"rounded-e":y()}],"rounded-t":[{"rounded-t":y()}],"rounded-r":[{"rounded-r":y()}],"rounded-b":[{"rounded-b":y()}],"rounded-l":[{"rounded-l":y()}],"rounded-ss":[{"rounded-ss":y()}],"rounded-se":[{"rounded-se":y()}],"rounded-ee":[{"rounded-ee":y()}],"rounded-es":[{"rounded-es":y()}],"rounded-tl":[{"rounded-tl":y()}],"rounded-tr":[{"rounded-tr":y()}],"rounded-br":[{"rounded-br":y()}],"rounded-bl":[{"rounded-bl":y()}],"border-w":[{border:k()}],"border-w-x":[{"border-x":k()}],"border-w-y":[{"border-y":k()}],"border-w-s":[{"border-s":k()}],"border-w-e":[{"border-e":k()}],"border-w-t":[{"border-t":k()}],"border-w-r":[{"border-r":k()}],"border-w-b":[{"border-b":k()}],"border-w-l":[{"border-l":k()}],"divide-x":[{"divide-x":k()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":k()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:d()}],"border-color-x":[{"border-x":d()}],"border-color-y":[{"border-y":d()}],"border-color-s":[{"border-s":d()}],"border-color-e":[{"border-e":d()}],"border-color-t":[{"border-t":d()}],"border-color-r":[{"border-r":d()}],"border-color-b":[{"border-b":d()}],"border-color-l":[{"border-l":d()}],"divide-color":[{divide:d()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[u,n,s]}],"outline-w":[{outline:["",u,B,P]}],"outline-color":[{outline:d()}],shadow:[{shadow:["","none",f,K,H]}],"shadow-color":[{shadow:d()}],"inset-shadow":[{"inset-shadow":["none",v,K,H]}],"inset-shadow-color":[{"inset-shadow":d()}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:d()}],"ring-offset-w":[{"ring-offset":[u,P]}],"ring-offset-color":[{"ring-offset":d()}],"inset-ring-w":[{"inset-ring":k()}],"inset-ring-color":[{"inset-ring":d()}],"text-shadow":[{"text-shadow":["none",x,K,H]}],"text-shadow-color":[{"text-shadow":d()}],opacity:[{opacity:[u,n,s]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[u]}],"mask-image-linear-from-pos":[{"mask-linear-from":h()}],"mask-image-linear-to-pos":[{"mask-linear-to":h()}],"mask-image-linear-from-color":[{"mask-linear-from":d()}],"mask-image-linear-to-color":[{"mask-linear-to":d()}],"mask-image-t-from-pos":[{"mask-t-from":h()}],"mask-image-t-to-pos":[{"mask-t-to":h()}],"mask-image-t-from-color":[{"mask-t-from":d()}],"mask-image-t-to-color":[{"mask-t-to":d()}],"mask-image-r-from-pos":[{"mask-r-from":h()}],"mask-image-r-to-pos":[{"mask-r-to":h()}],"mask-image-r-from-color":[{"mask-r-from":d()}],"mask-image-r-to-color":[{"mask-r-to":d()}],"mask-image-b-from-pos":[{"mask-b-from":h()}],"mask-image-b-to-pos":[{"mask-b-to":h()}],"mask-image-b-from-color":[{"mask-b-from":d()}],"mask-image-b-to-color":[{"mask-b-to":d()}],"mask-image-l-from-pos":[{"mask-l-from":h()}],"mask-image-l-to-pos":[{"mask-l-to":h()}],"mask-image-l-from-color":[{"mask-l-from":d()}],"mask-image-l-to-color":[{"mask-l-to":d()}],"mask-image-x-from-pos":[{"mask-x-from":h()}],"mask-image-x-to-pos":[{"mask-x-to":h()}],"mask-image-x-from-color":[{"mask-x-from":d()}],"mask-image-x-to-color":[{"mask-x-to":d()}],"mask-image-y-from-pos":[{"mask-y-from":h()}],"mask-image-y-to-pos":[{"mask-y-to":h()}],"mask-image-y-from-color":[{"mask-y-from":d()}],"mask-image-y-to-color":[{"mask-y-to":d()}],"mask-image-radial":[{"mask-radial":[n,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":h()}],"mask-image-radial-to-pos":[{"mask-radial-to":h()}],"mask-image-radial-from-color":[{"mask-radial-from":d()}],"mask-image-radial-to-color":[{"mask-radial-to":d()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[u]}],"mask-image-conic-from-pos":[{"mask-conic-from":h()}],"mask-image-conic-to-pos":[{"mask-conic-to":h()}],"mask-image-conic-from-color":[{"mask-conic-from":d()}],"mask-image-conic-to-color":[{"mask-conic-to":d()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",n,s]}],filter:[{filter:["","none",n,s]}],blur:[{blur:be()}],brightness:[{brightness:[u,n,s]}],contrast:[{contrast:[u,n,s]}],"drop-shadow":[{"drop-shadow":["","none",C,K,H]}],"drop-shadow-color":[{"drop-shadow":d()}],grayscale:[{grayscale:["",u,n,s]}],"hue-rotate":[{"hue-rotate":[u,n,s]}],invert:[{invert:["",u,n,s]}],saturate:[{saturate:[u,n,s]}],sepia:[{sepia:["",u,n,s]}],"backdrop-filter":[{"backdrop-filter":["","none",n,s]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[u,n,s]}],"backdrop-contrast":[{"backdrop-contrast":[u,n,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",u,n,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u,n,s]}],"backdrop-invert":[{"backdrop-invert":["",u,n,s]}],"backdrop-opacity":[{"backdrop-opacity":[u,n,s]}],"backdrop-saturate":[{"backdrop-saturate":[u,n,s]}],"backdrop-sepia":[{"backdrop-sepia":["",u,n,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",n,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[u,"initial",n,s]}],ease:[{ease:["linear","initial",M,n,s]}],delay:[{delay:[u,n,s]}],animate:[{animate:["none",D,n,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[z,n,s]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[n,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":["translate-none"],accent:[{accent:d()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:d()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",n,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",n,s]}],fill:[{fill:["none",...d()]}],"stroke-w":[{stroke:[u,B,P,ne]}],stroke:[{stroke:["none",...d()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jt=gt(Pt);function We(...e){return jt(Re(e))}function Gt(e){throw new Error(`Unexpected value: ${e}`)}const Lt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,t,o)=>o?o.toUpperCase():t.toLowerCase()),ve=e=>{const r=Vt(e);return r.charAt(0).toUpperCase()+r.slice(1)},_e=(...e)=>e.filter((r,t,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===t).join(" ").trim(),Ft=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var Wt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _t=A.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:i,...m},c)=>A.createElement("svg",{ref:c,...Wt,width:r,height:r,stroke:e,strokeWidth:o?Number(t)*24/Number(r):t,className:_e("lucide",a),...!l&&!Ft(m)&&{"aria-hidden":"true"},...m},[...i.map(([g,f])=>A.createElement(g,f)),...Array.isArray(l)?l:[l]]));const Ue=(e,r)=>{const t=A.forwardRef(({className:o,...a},l)=>A.createElement(_t,{ref:l,iconNode:r,className:_e(`lucide-${Lt(ve(e))}`,`lucide-${e}`,o),...a}));return t.displayName=ve(e),t};const Ut=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$e=Ue("circle-alert",Ut),$t=({code:e})=>{const r=De.useAssistantState(({message:f})=>f),t=A.useRef(null),[o,a]=A.useState(!0),[l,i]=A.useState(null),m=r.status?.type==="complete",c=Ae(),g=ze();return A.useEffect(()=>{if(!m||!t.current)return;let f=null;return(async()=>{try{let x;try{x=JSON.parse(e)}catch(S){throw new Error(`Invalid JSON syntax: ${S instanceof Error?S.message:"Unable to parse"}`)}const C=oe.parse(x);f=new oe.View(C,{container:t.current??void 0,renderer:"svg",hover:!0,logLevel:oe.Warn}),await f.runAsync(),a(!1)}catch(x){console.error("Failed to render chart:",x);const C=x instanceof Error?x.message:"Failed to render chart";i(C),a(!1)}})(),()=>{f&&f.finalize()}},[m,e]),$.jsxs("div",{className:We("relative flex min-h-[400px] w-fit max-w-full min-w-[400px] items-center justify-center border p-6 after:hidden",c("lg"),g("p-lg")),children:[(o||!m)&&$.jsx("div",{className:"shimmer text-muted-foreground bg-background/80 absolute inset-0 z-10 flex items-center justify-center",children:"Rendering chart..."}),l&&$.jsxs("div",{className:"bg-background absolute inset-0 z-10 flex items-center justify-center gap-2 text-rose-500",children:[$.jsx($e,{name:"alert-circle",className:"h-4 w-4"}),"Error rendering chart"]}),$.jsx("div",{ref:t,className:o?"hidden":"block"})]})},Be={language:"vega",prompt:`When a user requests a chart or visualization, respond with a valid Vega specification (https://vega.github.io/vega/) in a code block with language 'vega'.
2
+
3
+ CRITICAL JSON REQUIREMENTS:
4
+ - The code block MUST contain ONLY valid, parseable JSON
5
+ - NO comments (no // or /* */ anywhere)
6
+ - NO trailing commas
7
+ - Use double quotes for all strings and keys
8
+ - NO text before or after the JSON object
9
+ - The JSON must start with { and end with }
10
+
11
+ CONTENT GUIDELINES:
12
+ - Outside the code block, describe trends and insights found in the data
13
+ - Do not describe visual properties or technical implementation details
14
+ - Do not mention "Vega" or other technical terms - this is user-facing
15
+
16
+ The Vega spec will be parsed with JSON.parse() - if it fails, the chart will error. Ensure strict JSON validity.`,Component:$t,Header:void 0},Bt=[Be];exports.CircleAlert=$e;exports.ElementsContext=Ce;exports.assertNever=Gt;exports.chart=Be;exports.clsx=Re;exports.cn=We;exports.createLucideIcon=Ue;exports.recommended=Bt;exports.useDensity=ze;exports.useElements=ie;exports.useRadius=Ae;