@malloydata/render 0.0.222-dev241212021944 → 0.0.222-dev241212154316

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.
@@ -458,7 +458,10 @@ function GE(t, e, n, r = void 0) {
458
458
  return {
459
459
  error: { code: "composite_source_not_defined", data: { path: A } }
460
460
  };
461
- if (!(0, Kb.isJoined)(E) || !(0, Kb.isSourceDef)(E))
461
+ if ((0, Kb.isJoined)(E)) {
462
+ if (!(0, Kb.isSourceDef)(E))
463
+ continue;
464
+ } else
462
465
  return {
463
466
  error: { code: "composite_source_not_a_join", data: { path: A } }
464
467
  };
@@ -1,4 +1,4 @@
1
- (function(yi,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(yi=typeof globalThis<"u"?globalThis:yi||self,T(yi.index={}))})(this,function(yi){"use strict";var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function K$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Bt={},Ex={},it={},rt={},ta={};Object.defineProperty(ta,"__esModule",{value:!0}),ta.isNotUndefined=ta.locationContainsPosition=void 0;function dle(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}ta.locationContainsPosition=dle;function hle(t){return t!==void 0}ta.isNotUndefined=hle;var We={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(U){return"kids"in U}t.exprHasKids=e;function n(U){return"e"in U}t.exprHasE=n;function r(U){return!(e(U)||n(U))}t.exprIsLeaf=r;function i(U){return U.node==="aggregate"&&["sum","avg","count","distinct"].includes(U.function)}t.isAsymmetricExpr=i;function s(U){return U.node!=="arrayLiteral"&&U.node!=="recordLiteral"}function o(U,xe){const fe=typeof xe=="string"?{type:xe}:xe;return s(U)?{...U,typeDef:{...fe}}:U}t.mkTemporal=o;function u(U){return"dstSQLType"in U}t.isRawCast=u;function a(U){return U.value!==null}t.paramHasValue=a;function l(U){return U===void 0||U==="scalar"}t.expressionIsScalar=l;function c(U){return U==="aggregate"||U==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(U){return U==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(U){return U==="aggregate"||U==="ungrouped_aggregate"||U==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(U){return U==="aggregate"||U==="scalar_analytic"||U==="aggregate_analytic"||U==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(U){return U==="aggregate_analytic"||U==="scalar_analytic"}t.expressionIsAnalytic=p;function m(U){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[U]}function g(U,xe){return U===xe||m(U)<m(xe)}t.isExpressionTypeLEQ=g;function y(U,xe){let fe="scalar";return(U==="aggregate"||xe==="aggregate")&&(fe="aggregate"),(U==="ungrouped_aggregate"||xe==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(U==="scalar_analytic"||xe==="scalar_analytic")&&(fe="scalar_analytic"),(U==="aggregate_analytic"||xe==="aggregate_analytic")&&(fe="aggregate_analytic"),(U==="scalar_analytic"&&xe==="aggregate"||U==="aggregate"&&xe==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(U){return U.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function A(U){return"e"in U}t.hasExpression=A;function _(U){return U==="date"||U==="timestamp"}t.isTemporalType=_;function v(U){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(U)}t.isAtomicFieldType=v;function C(U){return["string","number","date","boolean","date","timestamp"].includes(U)}t.canOrderBy=C;function S(U){return["string","number","date","timestamp","boolean","json"].includes(U)}t.isCastType=S;function b(U){return v(U.type)&&!A(U)}t.fieldIsIntrinsic=b;function R(U,xe,fe){if(j(U))return L(U.elementTypeDef,xe,fe);if(B(U)){const{type:K,fields:te,elementTypeDef:Be}=U;return{type:K,fields:te,elementTypeDef:Be,join:"many",name:xe,dialect:fe}}if(U.type==="record"){const{type:K,fields:te}=U;return{type:K,fields:te,join:"one",dialect:fe,name:xe}}return{...U,name:xe}}t.mkFieldDef=R;function L(U,xe,fe){if(U.type==="record")return{type:"array",join:"many",name:xe,dialect:fe,elementTypeDef:{type:"record_element"},fields:U.fields};const K=R(U,"value",fe);return{type:"array",join:"many",name:xe,dialect:fe,elementTypeDef:U,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=L;function B(U){return U.type==="array"&&U.elementTypeDef.type==="record_element"}t.isRepeatedRecord=B;function j(U){return U.type==="array"&&U.elementTypeDef.type!=="record_element"}t.isScalarArray=j;function z(U){return["left","right","full","inner"].includes(U)}t.isMatrixOperation=z;function Z(U){return["composite","table","sql_select","query_source","array","record"].includes(U.type)}t.isJoinable=Z;function W(U){return"join"in U}t.isJoined=W;function oe(U){return M(U)&&W(U)}t.isJoinedSource=oe;function ye(U){return["day","week","month","quarter","year"].includes(U)}t.isDateUnit=ye;function de(U){return ye(U)||["hour","minute","second"].includes(U)}t.isTimestampUnit=de;function se(U){return de(U)||U==="day_of_week"||U==="day_of_year"}t.isExtractUnit=se;var ae;(function(U){U.Date="date",U.Timestamp="timestamp",U.Number="number",U.String="string"})(ae||(t.ValueType=ae={}));function he(U){return typeof U!="string"}t.refIsStructDef=he;function be(U){return!!((U.type==="reduce"||U.type==="project"||U.type==="partial")&&(U.extendSource&&U.extendSource.some(xe=>xe.type==="error")||U.queryFields.some(xe=>xe.type==="error")))}t.segmentHasErrors=be;function F(U){return U.fields.some(xe=>xe.type==="error")}t.structHasErrors=F;function D(U){return U.type==="reduce"}t.isReduceSegment=D;function N(U){return U.type==="partial"}t.isPartialSegment=N;function P(U){return U.type==="project"}t.isProjectSegment=P;function G(U){return P(U)||D(U)}t.isQuerySegment=G;function H(U){return U.rows!==void 0}t.isSamplingRows=H;function O(U){return U.percent!==void 0}t.isSamplingPercent=O;function $(U){return U.enable!==void 0}t.isSamplingEnable=$;function k(U){return U.type==="raw"}t.isRawSegment=k;function Q(U){return U.type==="index"}t.isIndexSegment=Q;function I(U){return"sql"in U}t.isSegmentSQL=I;function q(U){return{...U}}t.sourceBase=q;function M(U){return U.type==="table"||U.type==="sql_select"||U.type==="query_source"||U.type==="query_result"||U.type==="finalize"||U.type==="nest_source"||U.type==="composite"}t.isSourceDef=M;function Y(U){return oe(U)?!1:!!M(U)}t.isBaseTable=Y;function le(U){return U==="literal"}t.isLiteral=le;function ne(...U){return U.length<=1&&U.every(xe=>xe==="literal")?"literal":U.every(xe=>xe==="constant"||xe==="literal")?"constant":U.every(xe=>xe==="output"||xe==="constant"||xe==="literal")?"output":"input"}t.mergeEvalSpaces=ne;function J(U){return U.type==="string"||_(U.type)||U.type==="number"||U.type==="boolean"||U.type==="json"||U.type==="sql native"||U.type==="error"}t.isLeafAtomic=J;function ue(U){return U.as!==void 0?U.as:U.name}t.getIdentifier=ue;function ke(U){return U.type==="turtle"}t.isTurtle=ke;function st(U){return v(U.type)}t.isAtomic=st;function mt(U,xe){return xe.type==="string"}t.isValueString=mt;function X(U,xe){return xe.type==="number"}t.isValueNumber=X;function ie(U,xe){return xe.type==="boolean"}t.isValueBoolean=ie;function Oe(U,xe){return xe.type==="timestamp"}t.isValueTimestamp=Oe;function je(U,xe){return xe.type==="date"}t.isValueDate=je,t.TD={isAtomic(U){return U!==void 0&&v(U.type)},isLeafAtomic(U){return U!==void 0&&J({type:U.type})},isString:U=>(U==null?void 0:U.type)==="string",isNumber:U=>(U==null?void 0:U.type)==="number",isBoolean:U=>(U==null?void 0:U.type)==="boolean",isJSON:U=>(U==null?void 0:U.type)==="json",isSQL:U=>(U==null?void 0:U.type)==="sql native",isDate:U=>(U==null?void 0:U.type)==="date",isTimestamp:U=>(U==null?void 0:U.type)==="timestamp",isTemporal(U){var xe;const fe=(xe=U==null?void 0:U.type)!==null&&xe!==void 0?xe:"";return _(fe)},isError:U=>(U==null?void 0:U.type)==="error",eq(U,xe){if(U===void 0||xe===void 0)return!1;function fe(K,te){const Be={};for(const V of K.fields||[])if(V.name)Be[V.name]=V;else return!1;for(const V of te.fields||[])if(!t.TD.eq(Be[V.name],V))return!1;return!0}return U.type==="array"&&xe.type==="array"?U.elementTypeDef.type!==xe.elementTypeDef.type?!1:U.elementTypeDef.type!=="record_element"&&xe.elementTypeDef.type!=="record_element"?t.TD.eq(U.elementTypeDef,xe.elementTypeDef):fe(U,xe):U.type==="record"&&xe.type==="record"?fe(U,xe):U.type==="sql native"&&xe.type==="sql native"?U.rawType!==void 0&&U.rawType===xe.rawType:U.type===xe.type}}})(We),Object.defineProperty(rt,"__esModule",{value:!0}),rt.compositeFieldUsageJoinPaths=rt.joinedCompositeFieldUsage=rt.compositeFieldUsageDifference=rt.emptyCompositeFieldUsage=rt.mergeCompositeFieldUsage=rt.unique=rt.formatCompositeFieldUsage=rt.compositeFieldUsageIsPlural=rt.isEmptyCompositeFieldUsage=rt.formatCompositeFieldUsages=rt.compositeFieldUsagePaths=rt.resolveCompositeSources=rt.narrowCompositeFieldResolution=rt.emptyNarrowedCompositeFieldResolution=void 0;const X$=ta,Xb=We;function ey(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=Sle(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:A}of x){const _=new Set;for(const v of E.fields)_.add((s=v.as)!==null&&s!==void 0?s:v.name);for(const v of n.fields)if(!_.has(v)){y.shift();continue e}if(E.type==="composite"){const v=ey(t,E,Cle(n,E),{source:A??E.sources.map(C=>({source:C,nested:[]})),joined:{}});if("error"in v){y.shift();continue e}f={...v.success},y[0]={source:E,nested:v.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],A=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:A}}};if(!(0,Xb.isJoined)(E)||!(0,Xb.isSourceDef)(E))return{error:{code:"composite_source_not_a_join",data:{path:A}}};const _=ey(A,E,y,m[g]);if("error"in _)return _;if(!(0,Xb.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:A}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ple(){return{source:void 0,joined:{}}}rt.emptyNarrowedCompositeFieldResolution=ple;function gle(t,e,n){const r=ey([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}rt.narrowCompositeFieldResolution=gle;function mle(t,e){const n=ey([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}rt.resolveCompositeSources=mle;function Zb(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>Zb(n).map(r=>[e,...r])).flat()]}rt.compositeFieldUsagePaths=Zb;function yle(t){return Zb(t).map(e=>Z$(e)).join(", ")}rt.formatCompositeFieldUsages=yle;function eT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+eT(n),t.fields.length)}function Ele(t){return eT(t)===0}rt.isEmptyCompositeFieldUsage=Ele;function Ale(t){return eT(t)>1}rt.compositeFieldUsageIsPlural=Ale;function Z$(t){return`\`${t.join(".")}\``}rt.formatCompositeFieldUsage=Z$;function eB(t){return Array.from(new Set(t))}rt.unique=eB;function tB(...t){const e=t.filter(X$.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=tB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(X$.isNotUndefined));return{fields:eB(e.map(i=>i.fields).flat()),joinedUsage:r}}rt.mergeCompositeFieldUsage=tB;function _le(){return{fields:[],joinedUsage:{}}}rt.emptyCompositeFieldUsage=_le;function vle(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function nB(t,e){return{fields:vle(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?nB(r,e.joinedUsage[n]):r]))}}rt.compositeFieldUsageDifference=nB;function rB(t,e){return t.length===0?e:rB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}rt.joinedCompositeFieldUsage=rB;function iB(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>iB(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}rt.compositeFieldUsageJoinPaths=iB;function sB(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function Sle(t){return t.fields.filter(e=>!sB(e))}function Cle(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>sB(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(it,"__esModule",{value:!0}),it.expandOverrideMapFromBase=it.expandBlueprintMap=it.overload=it.minAnalytic=it.minAggregate=it.minScalar=it.maxAnalytic=it.maxUngroupedAggregate=it.anyExprType=it.maxAggregate=it.maxScalar=it.makeParam=it.param=it.variadicParam=it.literal=it.output=it.constant=it.sql=it.spread=it.arg=void 0;const ble=rt;function oB(t){return{node:"function_parameter",name:t}}it.arg=oB;function Tle(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}it.spread=Tle;function Rle(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}it.sql=Rle;function tT(t){return{...t,evalSpace:"constant"}}it.constant=tT;function Ole(t){return{...t,evalSpace:"output"}}it.output=Ole;function nT(t){return{...t,evalSpace:"literal"}}it.literal=nT;function Dle(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}it.variadicParam=Dle;function uB(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}it.param=uB;function Nle(t,...e){return{param:uB(t,...e),arg:oB(t)}}it.makeParam=Nle;function ty(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}it.maxScalar=ty;function aB(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}it.maxAggregate=aB;function rT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}it.anyExprType=rT;function wle(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}it.maxUngroupedAggregate=wle;function lB(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}it.maxAnalytic=lB;function Ax(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}it.minScalar=Ax;function cB(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}it.minAggregate=cB;function fB(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}it.minAnalytic=fB;function Fle(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}it.overload=Fle;function _s(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Lle(t,e){var n;let r;return typeof t=="string"?r=Ax(t):"generic"in t?r=Ax(_s(t,e)):"literal"in t?r=nT(Ax(_s(t.literal,e))):"constant"in t?r=tT(Ax(_s(t.constant,e))):"dimension"in t?r=Ax(_s(t.dimension,e)):"measure"in t?r=cB(_s(t.measure,e)):r=fB(_s(t.calculation,e)),{...r,compositeFieldUsage:(0,ble.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function xB(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Ile(t){return xB(t)?[t]:Array.isArray(t)?t:xB(t.variadic)?[t.variadic]:t.variadic}function $le(t,e){return typeof t=="string"?rT(t):"generic"in t?rT(_s(t,e)):"literal"in t?nT(ty(_s(t.literal,e))):"constant"in t?tT(ty(_s(t.constant,e))):"dimension"in t?ty(_s(t.dimension,e)):"measure"in t?aB(_s(t.measure,e)):lB(_s(t.calculation,e))}function Ble(t,e){return t.map(n=>$le(n,e))}function dB(t){return typeof t!="string"&&"variadic"in t}function kle(t,e,n){return{name:t,allowedTypes:Ble(Ile(e),n),isVariadic:dB(e)}}function Ple(t,e){return Object.entries(t).map(r=>kle(r[0],r[1],e))}function Mle(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function jle(t,e){return dB(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ule(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>jle(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function qle(t){return"sql"in t.impl?Mle(t.impl.sql):"expr"in t.impl?t.impl.expr:Ule(t.impl.function,t)}function Hle(t){return{e:qle(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function hB(t,e){return{returnType:Lle(t.returns,e),params:Ple(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Hle(t)}}function iT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>hB(t,{name:e,type:n}))}return[hB(t)]}function sT(t){return"takes"in t&&"returns"in t&&"impl"in t}function zle(t){return"function"in t||"sql"in t||"expr"in t}function Qle(t){return sT(t)?iT(t):Object.values(t).flatMap(e=>iT(e))}function Gle(t){const e={};for(const n in t)e[n]=Qle(t[n]);return e}it.expandBlueprintMap=Gle;function pB(t,e){return iT({...t,impl:e})}function Wle(t,e,n){if(zle(n)){if(!sT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return pB(e,n)}else{if(sT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return pB(s,i)})}}function Vle(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=Wle(r,t[r],e[r])}return n}it.expandOverrideMapFromBase=Vle;var hl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=We;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
1
+ (function(yi,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(yi=typeof globalThis<"u"?globalThis:yi||self,T(yi.index={}))})(this,function(yi){"use strict";var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function K$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Bt={},Ex={},it={},rt={},ta={};Object.defineProperty(ta,"__esModule",{value:!0}),ta.isNotUndefined=ta.locationContainsPosition=void 0;function dle(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}ta.locationContainsPosition=dle;function hle(t){return t!==void 0}ta.isNotUndefined=hle;var We={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(U){return"kids"in U}t.exprHasKids=e;function n(U){return"e"in U}t.exprHasE=n;function r(U){return!(e(U)||n(U))}t.exprIsLeaf=r;function i(U){return U.node==="aggregate"&&["sum","avg","count","distinct"].includes(U.function)}t.isAsymmetricExpr=i;function s(U){return U.node!=="arrayLiteral"&&U.node!=="recordLiteral"}function o(U,xe){const fe=typeof xe=="string"?{type:xe}:xe;return s(U)?{...U,typeDef:{...fe}}:U}t.mkTemporal=o;function u(U){return"dstSQLType"in U}t.isRawCast=u;function a(U){return U.value!==null}t.paramHasValue=a;function l(U){return U===void 0||U==="scalar"}t.expressionIsScalar=l;function c(U){return U==="aggregate"||U==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(U){return U==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(U){return U==="aggregate"||U==="ungrouped_aggregate"||U==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(U){return U==="aggregate"||U==="scalar_analytic"||U==="aggregate_analytic"||U==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(U){return U==="aggregate_analytic"||U==="scalar_analytic"}t.expressionIsAnalytic=p;function m(U){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[U]}function g(U,xe){return U===xe||m(U)<m(xe)}t.isExpressionTypeLEQ=g;function y(U,xe){let fe="scalar";return(U==="aggregate"||xe==="aggregate")&&(fe="aggregate"),(U==="ungrouped_aggregate"||xe==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(U==="scalar_analytic"||xe==="scalar_analytic")&&(fe="scalar_analytic"),(U==="aggregate_analytic"||xe==="aggregate_analytic")&&(fe="aggregate_analytic"),(U==="scalar_analytic"&&xe==="aggregate"||U==="aggregate"&&xe==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(U){return U.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function A(U){return"e"in U}t.hasExpression=A;function _(U){return U==="date"||U==="timestamp"}t.isTemporalType=_;function v(U){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(U)}t.isAtomicFieldType=v;function C(U){return["string","number","date","boolean","date","timestamp"].includes(U)}t.canOrderBy=C;function S(U){return["string","number","date","timestamp","boolean","json"].includes(U)}t.isCastType=S;function b(U){return v(U.type)&&!A(U)}t.fieldIsIntrinsic=b;function R(U,xe,fe){if(j(U))return L(U.elementTypeDef,xe,fe);if(B(U)){const{type:K,fields:te,elementTypeDef:Be}=U;return{type:K,fields:te,elementTypeDef:Be,join:"many",name:xe,dialect:fe}}if(U.type==="record"){const{type:K,fields:te}=U;return{type:K,fields:te,join:"one",dialect:fe,name:xe}}return{...U,name:xe}}t.mkFieldDef=R;function L(U,xe,fe){if(U.type==="record")return{type:"array",join:"many",name:xe,dialect:fe,elementTypeDef:{type:"record_element"},fields:U.fields};const K=R(U,"value",fe);return{type:"array",join:"many",name:xe,dialect:fe,elementTypeDef:U,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=L;function B(U){return U.type==="array"&&U.elementTypeDef.type==="record_element"}t.isRepeatedRecord=B;function j(U){return U.type==="array"&&U.elementTypeDef.type!=="record_element"}t.isScalarArray=j;function z(U){return["left","right","full","inner"].includes(U)}t.isMatrixOperation=z;function Z(U){return["composite","table","sql_select","query_source","array","record"].includes(U.type)}t.isJoinable=Z;function W(U){return"join"in U}t.isJoined=W;function oe(U){return M(U)&&W(U)}t.isJoinedSource=oe;function ye(U){return["day","week","month","quarter","year"].includes(U)}t.isDateUnit=ye;function de(U){return ye(U)||["hour","minute","second"].includes(U)}t.isTimestampUnit=de;function se(U){return de(U)||U==="day_of_week"||U==="day_of_year"}t.isExtractUnit=se;var ae;(function(U){U.Date="date",U.Timestamp="timestamp",U.Number="number",U.String="string"})(ae||(t.ValueType=ae={}));function he(U){return typeof U!="string"}t.refIsStructDef=he;function be(U){return!!((U.type==="reduce"||U.type==="project"||U.type==="partial")&&(U.extendSource&&U.extendSource.some(xe=>xe.type==="error")||U.queryFields.some(xe=>xe.type==="error")))}t.segmentHasErrors=be;function F(U){return U.fields.some(xe=>xe.type==="error")}t.structHasErrors=F;function D(U){return U.type==="reduce"}t.isReduceSegment=D;function N(U){return U.type==="partial"}t.isPartialSegment=N;function P(U){return U.type==="project"}t.isProjectSegment=P;function G(U){return P(U)||D(U)}t.isQuerySegment=G;function H(U){return U.rows!==void 0}t.isSamplingRows=H;function O(U){return U.percent!==void 0}t.isSamplingPercent=O;function $(U){return U.enable!==void 0}t.isSamplingEnable=$;function k(U){return U.type==="raw"}t.isRawSegment=k;function Q(U){return U.type==="index"}t.isIndexSegment=Q;function I(U){return"sql"in U}t.isSegmentSQL=I;function q(U){return{...U}}t.sourceBase=q;function M(U){return U.type==="table"||U.type==="sql_select"||U.type==="query_source"||U.type==="query_result"||U.type==="finalize"||U.type==="nest_source"||U.type==="composite"}t.isSourceDef=M;function Y(U){return oe(U)?!1:!!M(U)}t.isBaseTable=Y;function le(U){return U==="literal"}t.isLiteral=le;function ne(...U){return U.length<=1&&U.every(xe=>xe==="literal")?"literal":U.every(xe=>xe==="constant"||xe==="literal")?"constant":U.every(xe=>xe==="output"||xe==="constant"||xe==="literal")?"output":"input"}t.mergeEvalSpaces=ne;function J(U){return U.type==="string"||_(U.type)||U.type==="number"||U.type==="boolean"||U.type==="json"||U.type==="sql native"||U.type==="error"}t.isLeafAtomic=J;function ue(U){return U.as!==void 0?U.as:U.name}t.getIdentifier=ue;function ke(U){return U.type==="turtle"}t.isTurtle=ke;function st(U){return v(U.type)}t.isAtomic=st;function mt(U,xe){return xe.type==="string"}t.isValueString=mt;function X(U,xe){return xe.type==="number"}t.isValueNumber=X;function ie(U,xe){return xe.type==="boolean"}t.isValueBoolean=ie;function Oe(U,xe){return xe.type==="timestamp"}t.isValueTimestamp=Oe;function je(U,xe){return xe.type==="date"}t.isValueDate=je,t.TD={isAtomic(U){return U!==void 0&&v(U.type)},isLeafAtomic(U){return U!==void 0&&J({type:U.type})},isString:U=>(U==null?void 0:U.type)==="string",isNumber:U=>(U==null?void 0:U.type)==="number",isBoolean:U=>(U==null?void 0:U.type)==="boolean",isJSON:U=>(U==null?void 0:U.type)==="json",isSQL:U=>(U==null?void 0:U.type)==="sql native",isDate:U=>(U==null?void 0:U.type)==="date",isTimestamp:U=>(U==null?void 0:U.type)==="timestamp",isTemporal(U){var xe;const fe=(xe=U==null?void 0:U.type)!==null&&xe!==void 0?xe:"";return _(fe)},isError:U=>(U==null?void 0:U.type)==="error",eq(U,xe){if(U===void 0||xe===void 0)return!1;function fe(K,te){const Be={};for(const V of K.fields||[])if(V.name)Be[V.name]=V;else return!1;for(const V of te.fields||[])if(!t.TD.eq(Be[V.name],V))return!1;return!0}return U.type==="array"&&xe.type==="array"?U.elementTypeDef.type!==xe.elementTypeDef.type?!1:U.elementTypeDef.type!=="record_element"&&xe.elementTypeDef.type!=="record_element"?t.TD.eq(U.elementTypeDef,xe.elementTypeDef):fe(U,xe):U.type==="record"&&xe.type==="record"?fe(U,xe):U.type==="sql native"&&xe.type==="sql native"?U.rawType!==void 0&&U.rawType===xe.rawType:U.type===xe.type}}})(We),Object.defineProperty(rt,"__esModule",{value:!0}),rt.compositeFieldUsageJoinPaths=rt.joinedCompositeFieldUsage=rt.compositeFieldUsageDifference=rt.emptyCompositeFieldUsage=rt.mergeCompositeFieldUsage=rt.unique=rt.formatCompositeFieldUsage=rt.compositeFieldUsageIsPlural=rt.isEmptyCompositeFieldUsage=rt.formatCompositeFieldUsages=rt.compositeFieldUsagePaths=rt.resolveCompositeSources=rt.narrowCompositeFieldResolution=rt.emptyNarrowedCompositeFieldResolution=void 0;const X$=ta,Xb=We;function ey(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=Sle(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:A}of x){const _=new Set;for(const v of E.fields)_.add((s=v.as)!==null&&s!==void 0?s:v.name);for(const v of n.fields)if(!_.has(v)){y.shift();continue e}if(E.type==="composite"){const v=ey(t,E,Cle(n,E),{source:A??E.sources.map(C=>({source:C,nested:[]})),joined:{}});if("error"in v){y.shift();continue e}f={...v.success},y[0]={source:E,nested:v.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],A=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:A}}};if((0,Xb.isJoined)(E)){if(!(0,Xb.isSourceDef)(E))continue}else return{error:{code:"composite_source_not_a_join",data:{path:A}}};const _=ey(A,E,y,m[g]);if("error"in _)return _;if(!(0,Xb.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:A}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ple(){return{source:void 0,joined:{}}}rt.emptyNarrowedCompositeFieldResolution=ple;function gle(t,e,n){const r=ey([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}rt.narrowCompositeFieldResolution=gle;function mle(t,e){const n=ey([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}rt.resolveCompositeSources=mle;function Zb(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>Zb(n).map(r=>[e,...r])).flat()]}rt.compositeFieldUsagePaths=Zb;function yle(t){return Zb(t).map(e=>Z$(e)).join(", ")}rt.formatCompositeFieldUsages=yle;function eT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+eT(n),t.fields.length)}function Ele(t){return eT(t)===0}rt.isEmptyCompositeFieldUsage=Ele;function Ale(t){return eT(t)>1}rt.compositeFieldUsageIsPlural=Ale;function Z$(t){return`\`${t.join(".")}\``}rt.formatCompositeFieldUsage=Z$;function eB(t){return Array.from(new Set(t))}rt.unique=eB;function tB(...t){const e=t.filter(X$.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=tB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(X$.isNotUndefined));return{fields:eB(e.map(i=>i.fields).flat()),joinedUsage:r}}rt.mergeCompositeFieldUsage=tB;function _le(){return{fields:[],joinedUsage:{}}}rt.emptyCompositeFieldUsage=_le;function vle(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function nB(t,e){return{fields:vle(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?nB(r,e.joinedUsage[n]):r]))}}rt.compositeFieldUsageDifference=nB;function rB(t,e){return t.length===0?e:rB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}rt.joinedCompositeFieldUsage=rB;function iB(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>iB(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}rt.compositeFieldUsageJoinPaths=iB;function sB(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function Sle(t){return t.fields.filter(e=>!sB(e))}function Cle(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>sB(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(it,"__esModule",{value:!0}),it.expandOverrideMapFromBase=it.expandBlueprintMap=it.overload=it.minAnalytic=it.minAggregate=it.minScalar=it.maxAnalytic=it.maxUngroupedAggregate=it.anyExprType=it.maxAggregate=it.maxScalar=it.makeParam=it.param=it.variadicParam=it.literal=it.output=it.constant=it.sql=it.spread=it.arg=void 0;const ble=rt;function oB(t){return{node:"function_parameter",name:t}}it.arg=oB;function Tle(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}it.spread=Tle;function Rle(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}it.sql=Rle;function tT(t){return{...t,evalSpace:"constant"}}it.constant=tT;function Ole(t){return{...t,evalSpace:"output"}}it.output=Ole;function nT(t){return{...t,evalSpace:"literal"}}it.literal=nT;function Dle(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}it.variadicParam=Dle;function uB(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}it.param=uB;function Nle(t,...e){return{param:uB(t,...e),arg:oB(t)}}it.makeParam=Nle;function ty(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}it.maxScalar=ty;function aB(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}it.maxAggregate=aB;function rT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}it.anyExprType=rT;function wle(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}it.maxUngroupedAggregate=wle;function lB(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}it.maxAnalytic=lB;function Ax(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}it.minScalar=Ax;function cB(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}it.minAggregate=cB;function fB(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}it.minAnalytic=fB;function Fle(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}it.overload=Fle;function _s(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Lle(t,e){var n;let r;return typeof t=="string"?r=Ax(t):"generic"in t?r=Ax(_s(t,e)):"literal"in t?r=nT(Ax(_s(t.literal,e))):"constant"in t?r=tT(Ax(_s(t.constant,e))):"dimension"in t?r=Ax(_s(t.dimension,e)):"measure"in t?r=cB(_s(t.measure,e)):r=fB(_s(t.calculation,e)),{...r,compositeFieldUsage:(0,ble.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function xB(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Ile(t){return xB(t)?[t]:Array.isArray(t)?t:xB(t.variadic)?[t.variadic]:t.variadic}function $le(t,e){return typeof t=="string"?rT(t):"generic"in t?rT(_s(t,e)):"literal"in t?nT(ty(_s(t.literal,e))):"constant"in t?tT(ty(_s(t.constant,e))):"dimension"in t?ty(_s(t.dimension,e)):"measure"in t?aB(_s(t.measure,e)):lB(_s(t.calculation,e))}function Ble(t,e){return t.map(n=>$le(n,e))}function dB(t){return typeof t!="string"&&"variadic"in t}function kle(t,e,n){return{name:t,allowedTypes:Ble(Ile(e),n),isVariadic:dB(e)}}function Ple(t,e){return Object.entries(t).map(r=>kle(r[0],r[1],e))}function Mle(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function jle(t,e){return dB(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ule(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>jle(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function qle(t){return"sql"in t.impl?Mle(t.impl.sql):"expr"in t.impl?t.impl.expr:Ule(t.impl.function,t)}function Hle(t){return{e:qle(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function hB(t,e){return{returnType:Lle(t.returns,e),params:Ple(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Hle(t)}}function iT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>hB(t,{name:e,type:n}))}return[hB(t)]}function sT(t){return"takes"in t&&"returns"in t&&"impl"in t}function zle(t){return"function"in t||"sql"in t||"expr"in t}function Qle(t){return sT(t)?iT(t):Object.values(t).flatMap(e=>iT(e))}function Gle(t){const e={};for(const n in t)e[n]=Qle(t[n]);return e}it.expandBlueprintMap=Gle;function pB(t,e){return iT({...t,impl:e})}function Wle(t,e,n){if(zle(n)){if(!sT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return pB(e,n)}else{if(sT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return pB(s,i)})}}function Vle(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=Wle(r,t[r],e[r])}return n}it.expandOverrideMapFromBase=Vle;var hl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=We;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
2
2
  STRING_AGG(DISTINCT ${`concat('${f}', ${a}, '${x}', ${l})`}${c.length>0?","+c:""}),
3
3
  '${f}.*?${x}',
4
4
  ''
@@ -1375,7 +1375,10 @@ function Uv(t, e, n, r = void 0) {
1375
1375
  return {
1376
1376
  error: { code: "composite_source_not_defined", data: { path: v } }
1377
1377
  };
1378
- if (!(0, BT.isJoined)(E) || !(0, BT.isSourceDef)(E))
1378
+ if ((0, BT.isJoined)(E)) {
1379
+ if (!(0, BT.isSourceDef)(E))
1380
+ continue;
1381
+ } else
1379
1382
  return {
1380
1383
  error: { code: "composite_source_not_a_join", data: { path: v } }
1381
1384
  };
@@ -1,4 +1,4 @@
1
- (function(ep,tp){typeof exports=="object"&&typeof module<"u"?module.exports=tp():typeof define=="function"&&define.amd?define(tp):(ep=typeof globalThis<"u"?globalThis:ep||self,ep.register=tp())})(this,function(){"use strict";function ep(t){return Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=Object.assign({},i),DB(i.value)&&!I0e(i.value)&&!Array.isArray(i.value)&&(n[r].value=Object.assign({},i.value)),Array.isArray(i.value)&&(n[r].value=i.value.slice(0)),n},{})}function tp(t){return t?Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=DB(i)&&"value"in i?i:{value:i},n[r].attribute||(n[r].attribute=L0e(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function N0e(t){return Object.keys(t).reduce((n,r)=>(n[r]=t[r].value,n),{})}function F0e(t,e){const n=ep(e);return Object.keys(e).forEach(i=>{const s=n[i],o=t.getAttribute(s.attribute),u=t[i];o&&(s.value=s.parse?OB(o):o),u!=null&&(s.value=Array.isArray(u)?u.slice(0):u),s.reflect&&RB(t,s.attribute,s.value,!!s.parse),Object.defineProperty(t,i,{get(){return s.value},set(a){const l=s.value;s.value=a,s.reflect&&RB(this,s.attribute,s.value,!!s.parse);for(let c=0,f=this.__propertyChangedCallbacks.length;c<f;c++)this.__propertyChangedCallbacks[c](i,a,l)},enumerable:!0,configurable:!0})}),n}function OB(t){if(t)try{return JSON.parse(t)}catch{return t}}function RB(t,e,n,r){if(n==null||n===!1)return t.removeAttribute(e);let i=r?JSON.stringify(n):n;t.__updating[e]=!0,i==="true"&&(i=""),t.setAttribute(e,i),Promise.resolve().then(()=>delete t.__updating[e])}function L0e(t){return t.replace(/\.?([A-Z]+)/g,(e,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function DB(t){return t!=null&&(typeof t=="object"||typeof t=="function")}function I0e(t){return Object.prototype.toString.call(t)==="[object Function]"}function $0e(t){return typeof t=="function"&&t.toString().indexOf("class")===0}let $T;function B0e(t,e){const n=Object.keys(e);return class extends t{static get observedAttributes(){return n.map(i=>e[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=F0e(this,e);const i=N0e(this.props),s=this.Component,o=$T;try{$T=this,this.__initialized=!0,$0e(s)?new s(i,{element:this}):s(i,{element:this})}finally{$T=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,s,o){if(this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in e)){if(o==null&&!this[i])return;this[i]=e[i].parse?OB(o):o}}lookupProp(i){if(e)return n.find(s=>i===s||i===e[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function wB(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function NB(t,e={},n={}){const{BaseElement:r=HTMLElement,extension:i,customElements:s=window.customElements}=n;return o=>{if(!t)throw new Error("tag is required to register a Component");let u=s.get(t);return u?(u.prototype.Component=o,u):(u=B0e(r,tp(e)),u.prototype.Component=o,u.prototype.registeredTag=t,s.define(t,u,i),u)}}const k0e={context:void 0,registry:void 0},P0e=(t,e)=>t===e,Ko=Symbol("solid-proxy"),BT=Symbol("solid-track"),jy={equals:P0e};let FB=PB;const ya=1,Uy=2,LB={owned:null,cleanups:null,context:null,owner:null};var zt=null;let kT=null,M0e=null,ln=null,Tr=null,Ea=null,qy=0;function np(t,e){const n=ln,r=zt,i=t.length===0,s=e===void 0?r:e,o=i?LB:{owned:null,cleanups:null,context:s?s.context:null,owner:s},u=i?t:()=>t(()=>Xi(()=>Gy(o)));zt=o,ln=null;try{return Dc(u,!0)}finally{ln=n,zt=r}}function dr(t,e){e=e?Object.assign({},jy,e):jy;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),kB(n,i));return[BB.bind(n),r]}function j0e(t,e,n){const r=zy(t,e,!0,ya);Wx(r)}function Pn(t,e,n){const r=zy(t,e,!1,ya);Wx(r)}function ws(t,e,n){FB=Q0e;const r=zy(t,e,!1,ya);(!n||!n.render)&&(r.user=!0),Ea?Ea.push(r):Wx(r)}function Fn(t,e,n){n=n?Object.assign({},jy,n):jy;const r=zy(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Wx(r),BB.bind(r)}function U0e(t){return Dc(t,!1)}function Xi(t){if(ln===null)return t();const e=ln;ln=null;try{return t()}finally{ln=e}}function rp(t){ws(()=>Xi(t))}function ip(t){return zt===null||(zt.cleanups===null?zt.cleanups=[t]:zt.cleanups.push(t)),t}function PT(){return ln}function IB(){return zt}function q0e(t,e){const n=zt,r=ln;zt=t,ln=null;try{return Dc(e,!0)}catch(i){UT(i)}finally{zt=n,ln=r}}function MT(t,e){const n=Symbol("context");return{id:n,Provider:W0e(n),defaultValue:t}}function jT(t){return zt&&zt.context&&zt.context[t.id]!==void 0?zt.context[t.id]:t.defaultValue}function $B(t){const e=Fn(t),n=Fn(()=>qT(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function BB(){if(this.sources&&this.state)if(this.state===ya)Wx(this);else{const t=Tr;Tr=null,Dc(()=>Qy(this),!1),Tr=t}if(ln){const t=this.observers?this.observers.length:0;ln.sources?(ln.sources.push(this),ln.sourceSlots.push(t)):(ln.sources=[this],ln.sourceSlots=[t]),this.observers?(this.observers.push(ln),this.observerSlots.push(ln.sources.length-1)):(this.observers=[ln],this.observerSlots=[ln.sources.length-1])}return this.value}function kB(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&Dc(()=>{for(let i=0;i<t.observers.length;i+=1){const s=t.observers[i],o=kT&&kT.running;o&&kT.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Tr.push(s):Ea.push(s),s.observers&&MB(s)),o||(s.state=ya)}if(Tr.length>1e6)throw Tr=[],new Error},!1)),e}function Wx(t){if(!t.fn)return;Gy(t);const e=qy;z0e(t,t.value,e)}function z0e(t,e,n){let r;const i=zt,s=ln;ln=zt=t;try{r=t.fn(e)}catch(o){return t.pure&&(t.state=ya,t.owned&&t.owned.forEach(Gy),t.owned=null),t.updatedAt=n+1,UT(o)}finally{ln=s,zt=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?kB(t,r):t.value=r,t.updatedAt=n)}function zy(t,e,n,r=ya,i){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:zt,context:zt?zt.context:null,pure:n};return zt===null||zt!==LB&&(zt.owned?zt.owned.push(s):zt.owned=[s]),s}function Hy(t){if(t.state===0)return;if(t.state===Uy)return Qy(t);if(t.suspense&&Xi(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<qy);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===ya)Wx(t);else if(t.state===Uy){const r=Tr;Tr=null,Dc(()=>Qy(t,e[0]),!1),Tr=r}}function Dc(t,e){if(Tr)return t();let n=!1;e||(Tr=[]),Ea?n=!0:Ea=[],qy++;try{const r=t();return H0e(n),r}catch(r){n||(Ea=null),Tr=null,UT(r)}}function H0e(t){if(Tr&&(PB(Tr),Tr=null),t)return;const e=Ea;Ea=null,e.length&&Dc(()=>FB(e),!1)}function PB(t){for(let e=0;e<t.length;e++)Hy(t[e])}function Q0e(t){let e,n=0;for(e=0;e<t.length;e++){const r=t[e];r.user?t[n++]=r:Hy(r)}for(e=0;e<n;e++)Hy(t[e])}function Qy(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const r=t.sources[n];if(r.sources){const i=r.state;i===ya?r!==e&&(!r.updatedAt||r.updatedAt<qy)&&Hy(r):i===Uy&&Qy(r,e)}}}function MB(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Uy,n.pure?Tr.push(n):Ea.push(n),n.observers&&MB(n))}}function Gy(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),r=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Gy(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function G0e(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function UT(t,e=zt){throw G0e(t)}function qT(t){if(typeof t=="function"&&!t.length)return qT(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const r=qT(t[n]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return e}return t}function W0e(t,e){return function(r){let i;return Pn(()=>i=Xi(()=>(zt.context={...zt.context,[t]:r.value},$B(()=>r.children))),void 0),i}}const V0e=Symbol("fallback");function jB(t){for(let e=0;e<t.length;e++)t[e]()}function Y0e(t,e,n={}){let r=[],i=[],s=[],o=0,u=e.length>1?[]:null;return ip(()=>jB(s)),()=>{let a=t()||[],l,c;return a[BT],Xi(()=>{let x=a.length,d,p,m,g,y,E,v,_,A;if(x===0)o!==0&&(jB(s),s=[],r=[],i=[],o=0,u&&(u=[])),n.fallback&&(r=[V0e],i[0]=np(S=>(s[0]=S,n.fallback())),o=1);else if(o===0){for(i=new Array(x),c=0;c<x;c++)r[c]=a[c],i[c]=np(f);o=x}else{for(m=new Array(x),g=new Array(x),u&&(y=new Array(x)),E=0,v=Math.min(o,x);E<v&&r[E]===a[E];E++);for(v=o-1,_=x-1;v>=E&&_>=E&&r[v]===a[_];v--,_--)m[_]=i[v],g[_]=s[v],u&&(y[_]=u[v]);for(d=new Map,p=new Array(_+1),c=_;c>=E;c--)A=a[c],l=d.get(A),p[c]=l===void 0?-1:l,d.set(A,c);for(l=E;l<=v;l++)A=r[l],c=d.get(A),c!==void 0&&c!==-1?(m[c]=i[l],g[c]=s[l],u&&(y[c]=u[l]),c=p[c],d.set(A,c)):s[l]();for(c=E;c<x;c++)c in m?(i[c]=m[c],s[c]=g[c],u&&(u[c]=y[c],u[c](c))):i[c]=np(f);i=i.slice(0,o=x),r=a.slice(0)}return i});function f(x){if(s[c]=x,u){const[d,p]=dr(c);return u[c]=p,e(a[c],d)}return e(a[c])}}}function Ge(t,e){return Xi(()=>t(e||{}))}function Wy(){return!0}const X0e={get(t,e,n){return e===Ko?n:t.get(e)},has(t,e){return e===Ko?!0:t.has(e)},set:Wy,deleteProperty:Wy,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:Wy,deleteProperty:Wy}},ownKeys(t){return t.keys()}};function zT(t){return(t=typeof t=="function"?t():t)?t:{}}function J0e(){for(let t=0,e=this.length;t<e;++t){const n=this[t]();if(n!==void 0)return n}}function Zo(...t){let e=!1;for(let o=0;o<t.length;o++){const u=t[o];e=e||!!u&&Ko in u,t[o]=typeof u=="function"?(e=!0,Fn(u)):u}if(e)return new Proxy({get(o){for(let u=t.length-1;u>=0;u--){const a=zT(t[u])[o];if(a!==void 0)return a}},has(o){for(let u=t.length-1;u>=0;u--)if(o in zT(t[u]))return!0;return!1},keys(){const o=[];for(let u=0;u<t.length;u++)o.push(...Object.keys(zT(t[u])));return[...new Set(o)]}},X0e);const n={},r=Object.create(null);for(let o=t.length-1;o>=0;o--){const u=t[o];if(!u)continue;const a=Object.getOwnPropertyNames(u);for(let l=a.length-1;l>=0;l--){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const f=Object.getOwnPropertyDescriptor(u,c);if(!r[c])r[c]=f.get?{enumerable:!0,configurable:!0,get:J0e.bind(n[c]=[f.get.bind(u)])}:f.value!==void 0?f:void 0;else{const x=n[c];x&&(f.get?x.push(f.get.bind(u)):f.value!==void 0&&x.push(()=>f.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const u=s[o],a=r[u];a&&a.get?Object.defineProperty(i,u,a):i[u]=a?a.value:void 0}return i}const UB=t=>`Stale read from <${t}>.`;function Yn(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Fn(Y0e(()=>t.each,t.children,e||void 0))}function Or(t){const e=t.keyed,n=Fn(()=>t.when,void 0,{equals:(r,i)=>e?r===i:!r==!i});return Fn(()=>{const r=n();if(r){const i=t.children;return typeof i=="function"&&i.length>0?Xi(()=>i(e?r:()=>{if(!Xi(n))throw UB("Show");return t.when})):i}return t.fallback},void 0,void 0)}function qB(t){let e=!1;const n=(s,o)=>(e?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],r=$B(()=>t.children),i=Fn(()=>{let s=r();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const u=s[o].when;if(u)return e=!!s[o].keyed,[o,u,s[o]]}return[-1]},void 0,{equals:n});return Fn(()=>{const[s,o,u]=i();if(s<0)return t.fallback;const a=u.children;return typeof a=="function"&&a.length>0?Xi(()=>a(e?o:()=>{if(Xi(i)[0]!==s)throw UB("Match");return u.when})):a},void 0,void 0)}function Vy(t){return t}function K0e(t,e,n){let r=n.length,i=e.length,s=r,o=0,u=0,a=e[i-1].nextSibling,l=null;for(;o<i||u<s;){if(e[o]===n[u]){o++,u++;continue}for(;e[i-1]===n[s-1];)i--,s--;if(i===o){const c=s<r?u?n[u-1].nextSibling:n[s-u]:a;for(;u<s;)t.insertBefore(n[u++],c)}else if(s===u)for(;o<i;)(!l||!l.has(e[o]))&&e[o].remove(),o++;else if(e[o]===n[s-1]&&n[u]===e[i-1]){const c=e[--i].nextSibling;t.insertBefore(n[u++],e[o++].nextSibling),t.insertBefore(n[--s],c),e[i]=n[s]}else{if(!l){l=new Map;let f=u;for(;f<s;)l.set(n[f],f++)}const c=l.get(e[o]);if(c!=null)if(u<c&&c<s){let f=o,x=1,d;for(;++f<i&&f<s&&!((d=l.get(e[f]))==null||d!==c+x);)x++;if(x>c-u){const p=e[o];for(;u<c;)t.insertBefore(n[u++],p)}else t.replaceChild(n[u++],e[o++])}else o++;else e[o++].remove()}}}const zB="_$DX_DELEGATE";function mt(t,e,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=t,n?o.content.firstChild.firstChild:o.content.firstChild},s=e?()=>Xi(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return s.cloneNode=s,s}function HT(t,e=window.document){const n=e[zB]||(e[zB]=new Set);for(let r=0,i=t.length;r<i;r++){const s=t[r];n.has(s)||(n.add(s),e.addEventListener(s,Z0e))}}function Ji(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function HB(t,e,n,r){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function wc(t,e,n){if(!e)return n?Ji(t,"style"):e;const r=t.style;if(typeof e=="string")return r.cssText=e;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),e||(e={});let i,s;for(s in n)e[s]==null&&r.removeProperty(s),delete n[s];for(s in e)i=e[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function lo(t,e,n){return Xi(()=>t(e,n))}function Xe(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return Yy(t,e,r,n);Pn(i=>Yy(t,e(),i,n),r)}function Z0e(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const i=n[`${e}Data`];if(i!==void 0?r.call(n,i,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Yy(t,e,n,r,i){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,o=r!==void 0;if(t=o&&n[0]&&n[0].parentNode||t,s==="string"||s==="number")if(s==="number"&&(e=e.toString()),o){let u=n[0];u&&u.nodeType===3?u.data!==e&&(u.data=e):u=document.createTextNode(e),n=Vx(t,n,r,u)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||s==="boolean")n=Vx(t,n,r);else{if(s==="function")return Pn(()=>{let u=e();for(;typeof u=="function";)u=u();n=Yy(t,u,n,r)}),()=>n;if(Array.isArray(e)){const u=[],a=n&&Array.isArray(n);if(QT(u,e,n,i))return Pn(()=>n=Yy(t,u,n,r,!0)),()=>n;if(u.length===0){if(n=Vx(t,n,r),o)return n}else a?n.length===0?QB(t,u,r):K0e(t,n,u):(n&&Vx(t),QB(t,u));n=u}else if(e.nodeType){if(Array.isArray(n)){if(o)return n=Vx(t,n,r,e);Vx(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function QT(t,e,n,r){let i=!1;for(let s=0,o=e.length;s<o;s++){let u=e[s],a=n&&n[t.length],l;if(!(u==null||u===!0||u===!1))if((l=typeof u)=="object"&&u.nodeType)t.push(u);else if(Array.isArray(u))i=QT(t,u,a)||i;else if(l==="function")if(r){for(;typeof u=="function";)u=u();i=QT(t,Array.isArray(u)?u:[u],Array.isArray(a)?a:[a])||i}else t.push(u),i=!0;else{const c=String(u);a&&a.nodeType===3&&a.data===c?t.push(a):t.push(document.createTextNode(c))}}return i}function QB(t,e,n=null){for(let r=0,i=e.length;r<i;r++)t.insertBefore(e[r],n)}function Vx(t,e,n,r){if(n===void 0)return t.textContent="";const i=r||document.createTextNode("");if(e.length){let s=!1;for(let o=e.length-1;o>=0;o--){const u=e[o];if(i!==u){const a=u.parentNode===t;!s&&!o?a?t.replaceChild(i,u):t.insertBefore(i,n):a&&u.remove()}else s=!0}}else t.insertBefore(i,n);return[i]}const ece="http://www.w3.org/2000/svg";function tce(t,e=!1){return e?document.createElementNS(ece,t):document.createElement(t)}function nce(t){const{useShadow:e}=t,n=document.createTextNode(""),r=()=>t.mount||document.body,i=IB();let s,o=!!k0e.context;return ws(()=>{s||(s=q0e(i,()=>Fn(()=>t.children)));const u=r();if(u instanceof HTMLHeadElement){const[a,l]=dr(!1),c=()=>l(!0);np(f=>Xe(u,()=>a()?f():s(),null)),ip(c)}else{const a=tce(t.isSVG?"g":"div",t.isSVG),l=e&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),Xe(l,s),u.appendChild(a),t.ref&&t.ref(a),ip(()=>u.removeChild(a))}},void 0,{render:!o}),n}function rce(t){const e=Object.keys(t),n={};for(let r=0;r<e.length;r++){const[i,s]=dr(t[e[r]]);Object.defineProperty(n,e[r],{get:i,set(o){s(()=>o)}})}return n}function ice(t){if(t.assignedSlot&&t.assignedSlot._$owner)return t.assignedSlot._$owner;let e=t.parentNode;for(;e&&!e._$owner&&!(e.assignedSlot&&e.assignedSlot._$owner);)e=e.parentNode;return e&&e.assignedSlot?e.assignedSlot._$owner:t._$owner}function GB(t){return(e,n)=>{const{element:r}=n;return np(i=>{const s=rce(e);r.addPropertyChangedCallback((u,a)=>s[u]=a),r.addReleaseCallback(()=>{r.renderRoot.textContent="",i()});const o=t(s,n);return Xe(r.renderRoot,o)},ice(r))}}var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function sce(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var WB={},Yx={},at={},ut={},va={};Object.defineProperty(va,"__esModule",{value:!0}),va.isNotUndefined=va.locationContainsPosition=void 0;function oce(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}va.locationContainsPosition=oce;function uce(t){return t!==void 0}va.isNotUndefined=uce;var Je={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(z){return"kids"in z}t.exprHasKids=e;function n(z){return"e"in z}t.exprHasE=n;function r(z){return!(e(z)||n(z))}t.exprIsLeaf=r;function i(z){return z.node==="aggregate"&&["sum","avg","count","distinct"].includes(z.function)}t.isAsymmetricExpr=i;function s(z){return z.node!=="arrayLiteral"&&z.node!=="recordLiteral"}function o(z,de){const fe=typeof de=="string"?{type:de}:de;return s(z)?{...z,typeDef:{...fe}}:z}t.mkTemporal=o;function u(z){return"dstSQLType"in z}t.isRawCast=u;function a(z){return z.value!==null}t.paramHasValue=a;function l(z){return z===void 0||z==="scalar"}t.expressionIsScalar=l;function c(z){return z==="aggregate"||z==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(z){return z==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(z){return z==="aggregate"||z==="ungrouped_aggregate"||z==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(z){return z==="aggregate"||z==="scalar_analytic"||z==="aggregate_analytic"||z==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(z){return z==="aggregate_analytic"||z==="scalar_analytic"}t.expressionIsAnalytic=p;function m(z){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[z]}function g(z,de){return z===de||m(z)<m(de)}t.isExpressionTypeLEQ=g;function y(z,de){let fe="scalar";return(z==="aggregate"||de==="aggregate")&&(fe="aggregate"),(z==="ungrouped_aggregate"||de==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(z==="scalar_analytic"||de==="scalar_analytic")&&(fe="scalar_analytic"),(z==="aggregate_analytic"||de==="aggregate_analytic")&&(fe="aggregate_analytic"),(z==="scalar_analytic"&&de==="aggregate"||z==="aggregate"&&de==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(z){return z.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function v(z){return"e"in z}t.hasExpression=v;function _(z){return z==="date"||z==="timestamp"}t.isTemporalType=_;function A(z){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(z)}t.isAtomicFieldType=A;function S(z){return["string","number","date","boolean","date","timestamp"].includes(z)}t.canOrderBy=S;function b(z){return["string","number","date","timestamp","boolean","json"].includes(z)}t.isCastType=b;function C(z){return A(z.type)&&!v(z)}t.fieldIsIntrinsic=C;function w(z,de,fe){if(M(z))return I(z.elementTypeDef,de,fe);if(F(z)){const{type:K,fields:ee,elementTypeDef:Oe}=z;return{type:K,fields:ee,elementTypeDef:Oe,join:"many",name:de,dialect:fe}}if(z.type==="record"){const{type:K,fields:ee}=z;return{type:K,fields:ee,join:"one",dialect:fe,name:de}}return{...z,name:de}}t.mkFieldDef=w;function I(z,de,fe){if(z.type==="record")return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:{type:"record_element"},fields:z.fields};const K=w(z,"value",fe);return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:z,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=I;function F(z){return z.type==="array"&&z.elementTypeDef.type==="record_element"}t.isRepeatedRecord=F;function M(z){return z.type==="array"&&z.elementTypeDef.type!=="record_element"}t.isScalarArray=M;function U(z){return["left","right","full","inner"].includes(z)}t.isMatrixOperation=U;function X(z){return["composite","table","sql_select","query_source","array","record"].includes(z.type)}t.isJoinable=X;function W(z){return"join"in z}t.isJoined=W;function ae(z){return j(z)&&W(z)}t.isJoinedSource=ae;function ge(z){return["day","week","month","quarter","year"].includes(z)}t.isDateUnit=ge;function he(z){return ge(z)||["hour","minute","second"].includes(z)}t.isTimestampUnit=he;function ue(z){return he(z)||z==="day_of_week"||z==="day_of_year"}t.isExtractUnit=ue;var ce;(function(z){z.Date="date",z.Timestamp="timestamp",z.Number="number",z.String="string"})(ce||(t.ValueType=ce={}));function ie(z){return typeof z!="string"}t.refIsStructDef=ie;function re(z){return!!((z.type==="reduce"||z.type==="project"||z.type==="partial")&&(z.extendSource&&z.extendSource.some(de=>de.type==="error")||z.queryFields.some(de=>de.type==="error")))}t.segmentHasErrors=re;function R(z){return z.fields.some(de=>de.type==="error")}t.structHasErrors=R;function O(z){return z.type==="reduce"}t.isReduceSegment=O;function D(z){return z.type==="partial"}t.isPartialSegment=D;function k(z){return z.type==="project"}t.isProjectSegment=k;function G(z){return k(z)||O(z)}t.isQuerySegment=G;function q(z){return z.rows!==void 0}t.isSamplingRows=q;function N(z){return z.percent!==void 0}t.isSamplingPercent=N;function B(z){return z.enable!==void 0}t.isSamplingEnable=B;function P(z){return z.type==="raw"}t.isRawSegment=P;function Q(z){return z.type==="index"}t.isIndexSegment=Q;function $(z){return"sql"in z}t.isSegmentSQL=$;function H(z){return{...z}}t.sourceBase=H;function j(z){return z.type==="table"||z.type==="sql_select"||z.type==="query_source"||z.type==="query_result"||z.type==="finalize"||z.type==="nest_source"||z.type==="composite"}t.isSourceDef=j;function J(z){return ae(z)?!1:!!j(z)}t.isBaseTable=J;function xe(z){return z==="literal"}t.isLiteral=xe;function se(...z){return z.length<=1&&z.every(de=>de==="literal")?"literal":z.every(de=>de==="constant"||de==="literal")?"constant":z.every(de=>de==="output"||de==="constant"||de==="literal")?"output":"input"}t.mergeEvalSpaces=se;function Z(z){return z.type==="string"||_(z.type)||z.type==="number"||z.type==="boolean"||z.type==="json"||z.type==="sql native"||z.type==="error"}t.isLeafAtomic=Z;function oe(z){return z.as!==void 0?z.as:z.name}t.getIdentifier=oe;function we(z){return z.type==="turtle"}t.isTurtle=we;function ke(z){return A(z.type)}t.isAtomic=ke;function ze(z,de){return de.type==="string"}t.isValueString=ze;function V(z,de){return de.type==="number"}t.isValueNumber=V;function ne(z,de){return de.type==="boolean"}t.isValueBoolean=ne;function Te(z,de){return de.type==="timestamp"}t.isValueTimestamp=Te;function Me(z,de){return de.type==="date"}t.isValueDate=Me,t.TD={isAtomic(z){return z!==void 0&&A(z.type)},isLeafAtomic(z){return z!==void 0&&Z({type:z.type})},isString:z=>(z==null?void 0:z.type)==="string",isNumber:z=>(z==null?void 0:z.type)==="number",isBoolean:z=>(z==null?void 0:z.type)==="boolean",isJSON:z=>(z==null?void 0:z.type)==="json",isSQL:z=>(z==null?void 0:z.type)==="sql native",isDate:z=>(z==null?void 0:z.type)==="date",isTimestamp:z=>(z==null?void 0:z.type)==="timestamp",isTemporal(z){var de;const fe=(de=z==null?void 0:z.type)!==null&&de!==void 0?de:"";return _(fe)},isError:z=>(z==null?void 0:z.type)==="error",eq(z,de){if(z===void 0||de===void 0)return!1;function fe(K,ee){const Oe={};for(const Y of K.fields||[])if(Y.name)Oe[Y.name]=Y;else return!1;for(const Y of ee.fields||[])if(!t.TD.eq(Oe[Y.name],Y))return!1;return!0}return z.type==="array"&&de.type==="array"?z.elementTypeDef.type!==de.elementTypeDef.type?!1:z.elementTypeDef.type!=="record_element"&&de.elementTypeDef.type!=="record_element"?t.TD.eq(z.elementTypeDef,de.elementTypeDef):fe(z,de):z.type==="record"&&de.type==="record"?fe(z,de):z.type==="sql native"&&de.type==="sql native"?z.rawType!==void 0&&z.rawType===de.rawType:z.type===de.type}}})(Je),Object.defineProperty(ut,"__esModule",{value:!0}),ut.compositeFieldUsageJoinPaths=ut.joinedCompositeFieldUsage=ut.compositeFieldUsageDifference=ut.emptyCompositeFieldUsage=ut.mergeCompositeFieldUsage=ut.unique=ut.formatCompositeFieldUsage=ut.compositeFieldUsageIsPlural=ut.isEmptyCompositeFieldUsage=ut.formatCompositeFieldUsages=ut.compositeFieldUsagePaths=ut.resolveCompositeSources=ut.narrowCompositeFieldResolution=ut.emptyNarrowedCompositeFieldResolution=void 0;const VB=va,GT=Je;function Jy(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=gce(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:v}of x){const _=new Set;for(const A of E.fields)_.add((s=A.as)!==null&&s!==void 0?s:A.name);for(const A of n.fields)if(!_.has(A)){y.shift();continue e}if(E.type==="composite"){const A=Jy(t,E,mce(n,E),{source:v??E.sources.map(S=>({source:S,nested:[]})),joined:{}});if("error"in A){y.shift();continue e}f={...A.success},y[0]={source:E,nested:A.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],v=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:v}}};if(!(0,GT.isJoined)(E)||!(0,GT.isSourceDef)(E))return{error:{code:"composite_source_not_a_join",data:{path:v}}};const _=Jy(v,E,y,m[g]);if("error"in _)return _;if(!(0,GT.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:v}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ace(){return{source:void 0,joined:{}}}ut.emptyNarrowedCompositeFieldResolution=ace;function lce(t,e,n){const r=Jy([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}ut.narrowCompositeFieldResolution=lce;function cce(t,e){const n=Jy([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}ut.resolveCompositeSources=cce;function WT(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>WT(n).map(r=>[e,...r])).flat()]}ut.compositeFieldUsagePaths=WT;function fce(t){return WT(t).map(e=>YB(e)).join(", ")}ut.formatCompositeFieldUsages=fce;function VT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+VT(n),t.fields.length)}function xce(t){return VT(t)===0}ut.isEmptyCompositeFieldUsage=xce;function dce(t){return VT(t)>1}ut.compositeFieldUsageIsPlural=dce;function YB(t){return`\`${t.join(".")}\``}ut.formatCompositeFieldUsage=YB;function XB(t){return Array.from(new Set(t))}ut.unique=XB;function JB(...t){const e=t.filter(VB.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=JB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(VB.isNotUndefined));return{fields:XB(e.map(i=>i.fields).flat()),joinedUsage:r}}ut.mergeCompositeFieldUsage=JB;function hce(){return{fields:[],joinedUsage:{}}}ut.emptyCompositeFieldUsage=hce;function pce(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function KB(t,e){return{fields:pce(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?KB(r,e.joinedUsage[n]):r]))}}ut.compositeFieldUsageDifference=KB;function ZB(t,e){return t.length===0?e:ZB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}ut.joinedCompositeFieldUsage=ZB;function ek(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>ek(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}ut.compositeFieldUsageJoinPaths=ek;function tk(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function gce(t){return t.fields.filter(e=>!tk(e))}function mce(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>tk(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(at,"__esModule",{value:!0}),at.expandOverrideMapFromBase=at.expandBlueprintMap=at.overload=at.minAnalytic=at.minAggregate=at.minScalar=at.maxAnalytic=at.maxUngroupedAggregate=at.anyExprType=at.maxAggregate=at.maxScalar=at.makeParam=at.param=at.variadicParam=at.literal=at.output=at.constant=at.sql=at.spread=at.arg=void 0;const yce=ut;function nk(t){return{node:"function_parameter",name:t}}at.arg=nk;function Ece(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}at.spread=Ece;function vce(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}at.sql=vce;function YT(t){return{...t,evalSpace:"constant"}}at.constant=YT;function _ce(t){return{...t,evalSpace:"output"}}at.output=_ce;function XT(t){return{...t,evalSpace:"literal"}}at.literal=XT;function Ace(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}at.variadicParam=Ace;function rk(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}at.param=rk;function Sce(t,...e){return{param:rk(t,...e),arg:nk(t)}}at.makeParam=Sce;function Ky(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.maxScalar=Ky;function ik(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.maxAggregate=ik;function JT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}at.anyExprType=JT;function bce(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}at.maxUngroupedAggregate=bce;function sk(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}at.maxAnalytic=sk;function Xx(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.minScalar=Xx;function ok(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.minAggregate=ok;function uk(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}at.minAnalytic=uk;function Cce(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}at.overload=Cce;function Ns(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Tce(t,e){var n;let r;return typeof t=="string"?r=Xx(t):"generic"in t?r=Xx(Ns(t,e)):"literal"in t?r=XT(Xx(Ns(t.literal,e))):"constant"in t?r=YT(Xx(Ns(t.constant,e))):"dimension"in t?r=Xx(Ns(t.dimension,e)):"measure"in t?r=ok(Ns(t.measure,e)):r=uk(Ns(t.calculation,e)),{...r,compositeFieldUsage:(0,yce.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function ak(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Oce(t){return ak(t)?[t]:Array.isArray(t)?t:ak(t.variadic)?[t.variadic]:t.variadic}function Rce(t,e){return typeof t=="string"?JT(t):"generic"in t?JT(Ns(t,e)):"literal"in t?XT(Ky(Ns(t.literal,e))):"constant"in t?YT(Ky(Ns(t.constant,e))):"dimension"in t?Ky(Ns(t.dimension,e)):"measure"in t?ik(Ns(t.measure,e)):sk(Ns(t.calculation,e))}function Dce(t,e){return t.map(n=>Rce(n,e))}function lk(t){return typeof t!="string"&&"variadic"in t}function wce(t,e,n){return{name:t,allowedTypes:Dce(Oce(e),n),isVariadic:lk(e)}}function Nce(t,e){return Object.entries(t).map(r=>wce(r[0],r[1],e))}function Fce(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function Lce(t,e){return lk(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ice(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>Lce(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function $ce(t){return"sql"in t.impl?Fce(t.impl.sql):"expr"in t.impl?t.impl.expr:Ice(t.impl.function,t)}function Bce(t){return{e:$ce(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function ck(t,e){return{returnType:Tce(t.returns,e),params:Nce(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Bce(t)}}function KT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>ck(t,{name:e,type:n}))}return[ck(t)]}function ZT(t){return"takes"in t&&"returns"in t&&"impl"in t}function kce(t){return"function"in t||"sql"in t||"expr"in t}function Pce(t){return ZT(t)?KT(t):Object.values(t).flatMap(e=>KT(e))}function Mce(t){const e={};for(const n in t)e[n]=Pce(t[n]);return e}at.expandBlueprintMap=Mce;function fk(t,e){return KT({...t,impl:e})}function jce(t,e,n){if(kce(n)){if(!ZT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return fk(e,n)}else{if(ZT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return fk(s,i)})}}function Uce(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=jce(r,t[r],e[r])}return n}at.expandOverrideMapFromBase=Uce;var Bl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=Je;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
1
+ (function(ep,tp){typeof exports=="object"&&typeof module<"u"?module.exports=tp():typeof define=="function"&&define.amd?define(tp):(ep=typeof globalThis<"u"?globalThis:ep||self,ep.register=tp())})(this,function(){"use strict";function ep(t){return Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=Object.assign({},i),DB(i.value)&&!I0e(i.value)&&!Array.isArray(i.value)&&(n[r].value=Object.assign({},i.value)),Array.isArray(i.value)&&(n[r].value=i.value.slice(0)),n},{})}function tp(t){return t?Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=DB(i)&&"value"in i?i:{value:i},n[r].attribute||(n[r].attribute=L0e(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function N0e(t){return Object.keys(t).reduce((n,r)=>(n[r]=t[r].value,n),{})}function F0e(t,e){const n=ep(e);return Object.keys(e).forEach(i=>{const s=n[i],o=t.getAttribute(s.attribute),u=t[i];o&&(s.value=s.parse?OB(o):o),u!=null&&(s.value=Array.isArray(u)?u.slice(0):u),s.reflect&&RB(t,s.attribute,s.value,!!s.parse),Object.defineProperty(t,i,{get(){return s.value},set(a){const l=s.value;s.value=a,s.reflect&&RB(this,s.attribute,s.value,!!s.parse);for(let c=0,f=this.__propertyChangedCallbacks.length;c<f;c++)this.__propertyChangedCallbacks[c](i,a,l)},enumerable:!0,configurable:!0})}),n}function OB(t){if(t)try{return JSON.parse(t)}catch{return t}}function RB(t,e,n,r){if(n==null||n===!1)return t.removeAttribute(e);let i=r?JSON.stringify(n):n;t.__updating[e]=!0,i==="true"&&(i=""),t.setAttribute(e,i),Promise.resolve().then(()=>delete t.__updating[e])}function L0e(t){return t.replace(/\.?([A-Z]+)/g,(e,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function DB(t){return t!=null&&(typeof t=="object"||typeof t=="function")}function I0e(t){return Object.prototype.toString.call(t)==="[object Function]"}function $0e(t){return typeof t=="function"&&t.toString().indexOf("class")===0}let $T;function B0e(t,e){const n=Object.keys(e);return class extends t{static get observedAttributes(){return n.map(i=>e[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=F0e(this,e);const i=N0e(this.props),s=this.Component,o=$T;try{$T=this,this.__initialized=!0,$0e(s)?new s(i,{element:this}):s(i,{element:this})}finally{$T=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,s,o){if(this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in e)){if(o==null&&!this[i])return;this[i]=e[i].parse?OB(o):o}}lookupProp(i){if(e)return n.find(s=>i===s||i===e[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function wB(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function NB(t,e={},n={}){const{BaseElement:r=HTMLElement,extension:i,customElements:s=window.customElements}=n;return o=>{if(!t)throw new Error("tag is required to register a Component");let u=s.get(t);return u?(u.prototype.Component=o,u):(u=B0e(r,tp(e)),u.prototype.Component=o,u.prototype.registeredTag=t,s.define(t,u,i),u)}}const k0e={context:void 0,registry:void 0},P0e=(t,e)=>t===e,Ko=Symbol("solid-proxy"),BT=Symbol("solid-track"),jy={equals:P0e};let FB=PB;const ya=1,Uy=2,LB={owned:null,cleanups:null,context:null,owner:null};var zt=null;let kT=null,M0e=null,ln=null,Tr=null,Ea=null,qy=0;function np(t,e){const n=ln,r=zt,i=t.length===0,s=e===void 0?r:e,o=i?LB:{owned:null,cleanups:null,context:s?s.context:null,owner:s},u=i?t:()=>t(()=>Xi(()=>Gy(o)));zt=o,ln=null;try{return Dc(u,!0)}finally{ln=n,zt=r}}function dr(t,e){e=e?Object.assign({},jy,e):jy;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),kB(n,i));return[BB.bind(n),r]}function j0e(t,e,n){const r=zy(t,e,!0,ya);Wx(r)}function Pn(t,e,n){const r=zy(t,e,!1,ya);Wx(r)}function ws(t,e,n){FB=Q0e;const r=zy(t,e,!1,ya);(!n||!n.render)&&(r.user=!0),Ea?Ea.push(r):Wx(r)}function Fn(t,e,n){n=n?Object.assign({},jy,n):jy;const r=zy(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Wx(r),BB.bind(r)}function U0e(t){return Dc(t,!1)}function Xi(t){if(ln===null)return t();const e=ln;ln=null;try{return t()}finally{ln=e}}function rp(t){ws(()=>Xi(t))}function ip(t){return zt===null||(zt.cleanups===null?zt.cleanups=[t]:zt.cleanups.push(t)),t}function PT(){return ln}function IB(){return zt}function q0e(t,e){const n=zt,r=ln;zt=t,ln=null;try{return Dc(e,!0)}catch(i){UT(i)}finally{zt=n,ln=r}}function MT(t,e){const n=Symbol("context");return{id:n,Provider:W0e(n),defaultValue:t}}function jT(t){return zt&&zt.context&&zt.context[t.id]!==void 0?zt.context[t.id]:t.defaultValue}function $B(t){const e=Fn(t),n=Fn(()=>qT(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function BB(){if(this.sources&&this.state)if(this.state===ya)Wx(this);else{const t=Tr;Tr=null,Dc(()=>Qy(this),!1),Tr=t}if(ln){const t=this.observers?this.observers.length:0;ln.sources?(ln.sources.push(this),ln.sourceSlots.push(t)):(ln.sources=[this],ln.sourceSlots=[t]),this.observers?(this.observers.push(ln),this.observerSlots.push(ln.sources.length-1)):(this.observers=[ln],this.observerSlots=[ln.sources.length-1])}return this.value}function kB(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&Dc(()=>{for(let i=0;i<t.observers.length;i+=1){const s=t.observers[i],o=kT&&kT.running;o&&kT.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Tr.push(s):Ea.push(s),s.observers&&MB(s)),o||(s.state=ya)}if(Tr.length>1e6)throw Tr=[],new Error},!1)),e}function Wx(t){if(!t.fn)return;Gy(t);const e=qy;z0e(t,t.value,e)}function z0e(t,e,n){let r;const i=zt,s=ln;ln=zt=t;try{r=t.fn(e)}catch(o){return t.pure&&(t.state=ya,t.owned&&t.owned.forEach(Gy),t.owned=null),t.updatedAt=n+1,UT(o)}finally{ln=s,zt=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?kB(t,r):t.value=r,t.updatedAt=n)}function zy(t,e,n,r=ya,i){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:zt,context:zt?zt.context:null,pure:n};return zt===null||zt!==LB&&(zt.owned?zt.owned.push(s):zt.owned=[s]),s}function Hy(t){if(t.state===0)return;if(t.state===Uy)return Qy(t);if(t.suspense&&Xi(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<qy);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===ya)Wx(t);else if(t.state===Uy){const r=Tr;Tr=null,Dc(()=>Qy(t,e[0]),!1),Tr=r}}function Dc(t,e){if(Tr)return t();let n=!1;e||(Tr=[]),Ea?n=!0:Ea=[],qy++;try{const r=t();return H0e(n),r}catch(r){n||(Ea=null),Tr=null,UT(r)}}function H0e(t){if(Tr&&(PB(Tr),Tr=null),t)return;const e=Ea;Ea=null,e.length&&Dc(()=>FB(e),!1)}function PB(t){for(let e=0;e<t.length;e++)Hy(t[e])}function Q0e(t){let e,n=0;for(e=0;e<t.length;e++){const r=t[e];r.user?t[n++]=r:Hy(r)}for(e=0;e<n;e++)Hy(t[e])}function Qy(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const r=t.sources[n];if(r.sources){const i=r.state;i===ya?r!==e&&(!r.updatedAt||r.updatedAt<qy)&&Hy(r):i===Uy&&Qy(r,e)}}}function MB(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Uy,n.pure?Tr.push(n):Ea.push(n),n.observers&&MB(n))}}function Gy(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),r=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Gy(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function G0e(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function UT(t,e=zt){throw G0e(t)}function qT(t){if(typeof t=="function"&&!t.length)return qT(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const r=qT(t[n]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return e}return t}function W0e(t,e){return function(r){let i;return Pn(()=>i=Xi(()=>(zt.context={...zt.context,[t]:r.value},$B(()=>r.children))),void 0),i}}const V0e=Symbol("fallback");function jB(t){for(let e=0;e<t.length;e++)t[e]()}function Y0e(t,e,n={}){let r=[],i=[],s=[],o=0,u=e.length>1?[]:null;return ip(()=>jB(s)),()=>{let a=t()||[],l,c;return a[BT],Xi(()=>{let x=a.length,d,p,m,g,y,E,v,_,A;if(x===0)o!==0&&(jB(s),s=[],r=[],i=[],o=0,u&&(u=[])),n.fallback&&(r=[V0e],i[0]=np(S=>(s[0]=S,n.fallback())),o=1);else if(o===0){for(i=new Array(x),c=0;c<x;c++)r[c]=a[c],i[c]=np(f);o=x}else{for(m=new Array(x),g=new Array(x),u&&(y=new Array(x)),E=0,v=Math.min(o,x);E<v&&r[E]===a[E];E++);for(v=o-1,_=x-1;v>=E&&_>=E&&r[v]===a[_];v--,_--)m[_]=i[v],g[_]=s[v],u&&(y[_]=u[v]);for(d=new Map,p=new Array(_+1),c=_;c>=E;c--)A=a[c],l=d.get(A),p[c]=l===void 0?-1:l,d.set(A,c);for(l=E;l<=v;l++)A=r[l],c=d.get(A),c!==void 0&&c!==-1?(m[c]=i[l],g[c]=s[l],u&&(y[c]=u[l]),c=p[c],d.set(A,c)):s[l]();for(c=E;c<x;c++)c in m?(i[c]=m[c],s[c]=g[c],u&&(u[c]=y[c],u[c](c))):i[c]=np(f);i=i.slice(0,o=x),r=a.slice(0)}return i});function f(x){if(s[c]=x,u){const[d,p]=dr(c);return u[c]=p,e(a[c],d)}return e(a[c])}}}function Ge(t,e){return Xi(()=>t(e||{}))}function Wy(){return!0}const X0e={get(t,e,n){return e===Ko?n:t.get(e)},has(t,e){return e===Ko?!0:t.has(e)},set:Wy,deleteProperty:Wy,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:Wy,deleteProperty:Wy}},ownKeys(t){return t.keys()}};function zT(t){return(t=typeof t=="function"?t():t)?t:{}}function J0e(){for(let t=0,e=this.length;t<e;++t){const n=this[t]();if(n!==void 0)return n}}function Zo(...t){let e=!1;for(let o=0;o<t.length;o++){const u=t[o];e=e||!!u&&Ko in u,t[o]=typeof u=="function"?(e=!0,Fn(u)):u}if(e)return new Proxy({get(o){for(let u=t.length-1;u>=0;u--){const a=zT(t[u])[o];if(a!==void 0)return a}},has(o){for(let u=t.length-1;u>=0;u--)if(o in zT(t[u]))return!0;return!1},keys(){const o=[];for(let u=0;u<t.length;u++)o.push(...Object.keys(zT(t[u])));return[...new Set(o)]}},X0e);const n={},r=Object.create(null);for(let o=t.length-1;o>=0;o--){const u=t[o];if(!u)continue;const a=Object.getOwnPropertyNames(u);for(let l=a.length-1;l>=0;l--){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const f=Object.getOwnPropertyDescriptor(u,c);if(!r[c])r[c]=f.get?{enumerable:!0,configurable:!0,get:J0e.bind(n[c]=[f.get.bind(u)])}:f.value!==void 0?f:void 0;else{const x=n[c];x&&(f.get?x.push(f.get.bind(u)):f.value!==void 0&&x.push(()=>f.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const u=s[o],a=r[u];a&&a.get?Object.defineProperty(i,u,a):i[u]=a?a.value:void 0}return i}const UB=t=>`Stale read from <${t}>.`;function Yn(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Fn(Y0e(()=>t.each,t.children,e||void 0))}function Or(t){const e=t.keyed,n=Fn(()=>t.when,void 0,{equals:(r,i)=>e?r===i:!r==!i});return Fn(()=>{const r=n();if(r){const i=t.children;return typeof i=="function"&&i.length>0?Xi(()=>i(e?r:()=>{if(!Xi(n))throw UB("Show");return t.when})):i}return t.fallback},void 0,void 0)}function qB(t){let e=!1;const n=(s,o)=>(e?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],r=$B(()=>t.children),i=Fn(()=>{let s=r();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const u=s[o].when;if(u)return e=!!s[o].keyed,[o,u,s[o]]}return[-1]},void 0,{equals:n});return Fn(()=>{const[s,o,u]=i();if(s<0)return t.fallback;const a=u.children;return typeof a=="function"&&a.length>0?Xi(()=>a(e?o:()=>{if(Xi(i)[0]!==s)throw UB("Match");return u.when})):a},void 0,void 0)}function Vy(t){return t}function K0e(t,e,n){let r=n.length,i=e.length,s=r,o=0,u=0,a=e[i-1].nextSibling,l=null;for(;o<i||u<s;){if(e[o]===n[u]){o++,u++;continue}for(;e[i-1]===n[s-1];)i--,s--;if(i===o){const c=s<r?u?n[u-1].nextSibling:n[s-u]:a;for(;u<s;)t.insertBefore(n[u++],c)}else if(s===u)for(;o<i;)(!l||!l.has(e[o]))&&e[o].remove(),o++;else if(e[o]===n[s-1]&&n[u]===e[i-1]){const c=e[--i].nextSibling;t.insertBefore(n[u++],e[o++].nextSibling),t.insertBefore(n[--s],c),e[i]=n[s]}else{if(!l){l=new Map;let f=u;for(;f<s;)l.set(n[f],f++)}const c=l.get(e[o]);if(c!=null)if(u<c&&c<s){let f=o,x=1,d;for(;++f<i&&f<s&&!((d=l.get(e[f]))==null||d!==c+x);)x++;if(x>c-u){const p=e[o];for(;u<c;)t.insertBefore(n[u++],p)}else t.replaceChild(n[u++],e[o++])}else o++;else e[o++].remove()}}}const zB="_$DX_DELEGATE";function mt(t,e,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=t,n?o.content.firstChild.firstChild:o.content.firstChild},s=e?()=>Xi(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return s.cloneNode=s,s}function HT(t,e=window.document){const n=e[zB]||(e[zB]=new Set);for(let r=0,i=t.length;r<i;r++){const s=t[r];n.has(s)||(n.add(s),e.addEventListener(s,Z0e))}}function Ji(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function HB(t,e,n,r){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function wc(t,e,n){if(!e)return n?Ji(t,"style"):e;const r=t.style;if(typeof e=="string")return r.cssText=e;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),e||(e={});let i,s;for(s in n)e[s]==null&&r.removeProperty(s),delete n[s];for(s in e)i=e[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function lo(t,e,n){return Xi(()=>t(e,n))}function Xe(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return Yy(t,e,r,n);Pn(i=>Yy(t,e(),i,n),r)}function Z0e(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const i=n[`${e}Data`];if(i!==void 0?r.call(n,i,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Yy(t,e,n,r,i){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,o=r!==void 0;if(t=o&&n[0]&&n[0].parentNode||t,s==="string"||s==="number")if(s==="number"&&(e=e.toString()),o){let u=n[0];u&&u.nodeType===3?u.data!==e&&(u.data=e):u=document.createTextNode(e),n=Vx(t,n,r,u)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||s==="boolean")n=Vx(t,n,r);else{if(s==="function")return Pn(()=>{let u=e();for(;typeof u=="function";)u=u();n=Yy(t,u,n,r)}),()=>n;if(Array.isArray(e)){const u=[],a=n&&Array.isArray(n);if(QT(u,e,n,i))return Pn(()=>n=Yy(t,u,n,r,!0)),()=>n;if(u.length===0){if(n=Vx(t,n,r),o)return n}else a?n.length===0?QB(t,u,r):K0e(t,n,u):(n&&Vx(t),QB(t,u));n=u}else if(e.nodeType){if(Array.isArray(n)){if(o)return n=Vx(t,n,r,e);Vx(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function QT(t,e,n,r){let i=!1;for(let s=0,o=e.length;s<o;s++){let u=e[s],a=n&&n[t.length],l;if(!(u==null||u===!0||u===!1))if((l=typeof u)=="object"&&u.nodeType)t.push(u);else if(Array.isArray(u))i=QT(t,u,a)||i;else if(l==="function")if(r){for(;typeof u=="function";)u=u();i=QT(t,Array.isArray(u)?u:[u],Array.isArray(a)?a:[a])||i}else t.push(u),i=!0;else{const c=String(u);a&&a.nodeType===3&&a.data===c?t.push(a):t.push(document.createTextNode(c))}}return i}function QB(t,e,n=null){for(let r=0,i=e.length;r<i;r++)t.insertBefore(e[r],n)}function Vx(t,e,n,r){if(n===void 0)return t.textContent="";const i=r||document.createTextNode("");if(e.length){let s=!1;for(let o=e.length-1;o>=0;o--){const u=e[o];if(i!==u){const a=u.parentNode===t;!s&&!o?a?t.replaceChild(i,u):t.insertBefore(i,n):a&&u.remove()}else s=!0}}else t.insertBefore(i,n);return[i]}const ece="http://www.w3.org/2000/svg";function tce(t,e=!1){return e?document.createElementNS(ece,t):document.createElement(t)}function nce(t){const{useShadow:e}=t,n=document.createTextNode(""),r=()=>t.mount||document.body,i=IB();let s,o=!!k0e.context;return ws(()=>{s||(s=q0e(i,()=>Fn(()=>t.children)));const u=r();if(u instanceof HTMLHeadElement){const[a,l]=dr(!1),c=()=>l(!0);np(f=>Xe(u,()=>a()?f():s(),null)),ip(c)}else{const a=tce(t.isSVG?"g":"div",t.isSVG),l=e&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),Xe(l,s),u.appendChild(a),t.ref&&t.ref(a),ip(()=>u.removeChild(a))}},void 0,{render:!o}),n}function rce(t){const e=Object.keys(t),n={};for(let r=0;r<e.length;r++){const[i,s]=dr(t[e[r]]);Object.defineProperty(n,e[r],{get:i,set(o){s(()=>o)}})}return n}function ice(t){if(t.assignedSlot&&t.assignedSlot._$owner)return t.assignedSlot._$owner;let e=t.parentNode;for(;e&&!e._$owner&&!(e.assignedSlot&&e.assignedSlot._$owner);)e=e.parentNode;return e&&e.assignedSlot?e.assignedSlot._$owner:t._$owner}function GB(t){return(e,n)=>{const{element:r}=n;return np(i=>{const s=rce(e);r.addPropertyChangedCallback((u,a)=>s[u]=a),r.addReleaseCallback(()=>{r.renderRoot.textContent="",i()});const o=t(s,n);return Xe(r.renderRoot,o)},ice(r))}}var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function sce(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var WB={},Yx={},at={},ut={},va={};Object.defineProperty(va,"__esModule",{value:!0}),va.isNotUndefined=va.locationContainsPosition=void 0;function oce(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}va.locationContainsPosition=oce;function uce(t){return t!==void 0}va.isNotUndefined=uce;var Je={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(z){return"kids"in z}t.exprHasKids=e;function n(z){return"e"in z}t.exprHasE=n;function r(z){return!(e(z)||n(z))}t.exprIsLeaf=r;function i(z){return z.node==="aggregate"&&["sum","avg","count","distinct"].includes(z.function)}t.isAsymmetricExpr=i;function s(z){return z.node!=="arrayLiteral"&&z.node!=="recordLiteral"}function o(z,de){const fe=typeof de=="string"?{type:de}:de;return s(z)?{...z,typeDef:{...fe}}:z}t.mkTemporal=o;function u(z){return"dstSQLType"in z}t.isRawCast=u;function a(z){return z.value!==null}t.paramHasValue=a;function l(z){return z===void 0||z==="scalar"}t.expressionIsScalar=l;function c(z){return z==="aggregate"||z==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(z){return z==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(z){return z==="aggregate"||z==="ungrouped_aggregate"||z==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(z){return z==="aggregate"||z==="scalar_analytic"||z==="aggregate_analytic"||z==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(z){return z==="aggregate_analytic"||z==="scalar_analytic"}t.expressionIsAnalytic=p;function m(z){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[z]}function g(z,de){return z===de||m(z)<m(de)}t.isExpressionTypeLEQ=g;function y(z,de){let fe="scalar";return(z==="aggregate"||de==="aggregate")&&(fe="aggregate"),(z==="ungrouped_aggregate"||de==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(z==="scalar_analytic"||de==="scalar_analytic")&&(fe="scalar_analytic"),(z==="aggregate_analytic"||de==="aggregate_analytic")&&(fe="aggregate_analytic"),(z==="scalar_analytic"&&de==="aggregate"||z==="aggregate"&&de==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(z){return z.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function v(z){return"e"in z}t.hasExpression=v;function _(z){return z==="date"||z==="timestamp"}t.isTemporalType=_;function A(z){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(z)}t.isAtomicFieldType=A;function S(z){return["string","number","date","boolean","date","timestamp"].includes(z)}t.canOrderBy=S;function b(z){return["string","number","date","timestamp","boolean","json"].includes(z)}t.isCastType=b;function C(z){return A(z.type)&&!v(z)}t.fieldIsIntrinsic=C;function w(z,de,fe){if(M(z))return I(z.elementTypeDef,de,fe);if(F(z)){const{type:K,fields:ee,elementTypeDef:Oe}=z;return{type:K,fields:ee,elementTypeDef:Oe,join:"many",name:de,dialect:fe}}if(z.type==="record"){const{type:K,fields:ee}=z;return{type:K,fields:ee,join:"one",dialect:fe,name:de}}return{...z,name:de}}t.mkFieldDef=w;function I(z,de,fe){if(z.type==="record")return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:{type:"record_element"},fields:z.fields};const K=w(z,"value",fe);return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:z,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=I;function F(z){return z.type==="array"&&z.elementTypeDef.type==="record_element"}t.isRepeatedRecord=F;function M(z){return z.type==="array"&&z.elementTypeDef.type!=="record_element"}t.isScalarArray=M;function U(z){return["left","right","full","inner"].includes(z)}t.isMatrixOperation=U;function X(z){return["composite","table","sql_select","query_source","array","record"].includes(z.type)}t.isJoinable=X;function W(z){return"join"in z}t.isJoined=W;function ae(z){return j(z)&&W(z)}t.isJoinedSource=ae;function ge(z){return["day","week","month","quarter","year"].includes(z)}t.isDateUnit=ge;function he(z){return ge(z)||["hour","minute","second"].includes(z)}t.isTimestampUnit=he;function ue(z){return he(z)||z==="day_of_week"||z==="day_of_year"}t.isExtractUnit=ue;var ce;(function(z){z.Date="date",z.Timestamp="timestamp",z.Number="number",z.String="string"})(ce||(t.ValueType=ce={}));function ie(z){return typeof z!="string"}t.refIsStructDef=ie;function re(z){return!!((z.type==="reduce"||z.type==="project"||z.type==="partial")&&(z.extendSource&&z.extendSource.some(de=>de.type==="error")||z.queryFields.some(de=>de.type==="error")))}t.segmentHasErrors=re;function R(z){return z.fields.some(de=>de.type==="error")}t.structHasErrors=R;function O(z){return z.type==="reduce"}t.isReduceSegment=O;function D(z){return z.type==="partial"}t.isPartialSegment=D;function k(z){return z.type==="project"}t.isProjectSegment=k;function G(z){return k(z)||O(z)}t.isQuerySegment=G;function q(z){return z.rows!==void 0}t.isSamplingRows=q;function N(z){return z.percent!==void 0}t.isSamplingPercent=N;function B(z){return z.enable!==void 0}t.isSamplingEnable=B;function P(z){return z.type==="raw"}t.isRawSegment=P;function Q(z){return z.type==="index"}t.isIndexSegment=Q;function $(z){return"sql"in z}t.isSegmentSQL=$;function H(z){return{...z}}t.sourceBase=H;function j(z){return z.type==="table"||z.type==="sql_select"||z.type==="query_source"||z.type==="query_result"||z.type==="finalize"||z.type==="nest_source"||z.type==="composite"}t.isSourceDef=j;function J(z){return ae(z)?!1:!!j(z)}t.isBaseTable=J;function xe(z){return z==="literal"}t.isLiteral=xe;function se(...z){return z.length<=1&&z.every(de=>de==="literal")?"literal":z.every(de=>de==="constant"||de==="literal")?"constant":z.every(de=>de==="output"||de==="constant"||de==="literal")?"output":"input"}t.mergeEvalSpaces=se;function Z(z){return z.type==="string"||_(z.type)||z.type==="number"||z.type==="boolean"||z.type==="json"||z.type==="sql native"||z.type==="error"}t.isLeafAtomic=Z;function oe(z){return z.as!==void 0?z.as:z.name}t.getIdentifier=oe;function we(z){return z.type==="turtle"}t.isTurtle=we;function ke(z){return A(z.type)}t.isAtomic=ke;function ze(z,de){return de.type==="string"}t.isValueString=ze;function V(z,de){return de.type==="number"}t.isValueNumber=V;function ne(z,de){return de.type==="boolean"}t.isValueBoolean=ne;function Te(z,de){return de.type==="timestamp"}t.isValueTimestamp=Te;function Me(z,de){return de.type==="date"}t.isValueDate=Me,t.TD={isAtomic(z){return z!==void 0&&A(z.type)},isLeafAtomic(z){return z!==void 0&&Z({type:z.type})},isString:z=>(z==null?void 0:z.type)==="string",isNumber:z=>(z==null?void 0:z.type)==="number",isBoolean:z=>(z==null?void 0:z.type)==="boolean",isJSON:z=>(z==null?void 0:z.type)==="json",isSQL:z=>(z==null?void 0:z.type)==="sql native",isDate:z=>(z==null?void 0:z.type)==="date",isTimestamp:z=>(z==null?void 0:z.type)==="timestamp",isTemporal(z){var de;const fe=(de=z==null?void 0:z.type)!==null&&de!==void 0?de:"";return _(fe)},isError:z=>(z==null?void 0:z.type)==="error",eq(z,de){if(z===void 0||de===void 0)return!1;function fe(K,ee){const Oe={};for(const Y of K.fields||[])if(Y.name)Oe[Y.name]=Y;else return!1;for(const Y of ee.fields||[])if(!t.TD.eq(Oe[Y.name],Y))return!1;return!0}return z.type==="array"&&de.type==="array"?z.elementTypeDef.type!==de.elementTypeDef.type?!1:z.elementTypeDef.type!=="record_element"&&de.elementTypeDef.type!=="record_element"?t.TD.eq(z.elementTypeDef,de.elementTypeDef):fe(z,de):z.type==="record"&&de.type==="record"?fe(z,de):z.type==="sql native"&&de.type==="sql native"?z.rawType!==void 0&&z.rawType===de.rawType:z.type===de.type}}})(Je),Object.defineProperty(ut,"__esModule",{value:!0}),ut.compositeFieldUsageJoinPaths=ut.joinedCompositeFieldUsage=ut.compositeFieldUsageDifference=ut.emptyCompositeFieldUsage=ut.mergeCompositeFieldUsage=ut.unique=ut.formatCompositeFieldUsage=ut.compositeFieldUsageIsPlural=ut.isEmptyCompositeFieldUsage=ut.formatCompositeFieldUsages=ut.compositeFieldUsagePaths=ut.resolveCompositeSources=ut.narrowCompositeFieldResolution=ut.emptyNarrowedCompositeFieldResolution=void 0;const VB=va,GT=Je;function Jy(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=gce(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:v}of x){const _=new Set;for(const A of E.fields)_.add((s=A.as)!==null&&s!==void 0?s:A.name);for(const A of n.fields)if(!_.has(A)){y.shift();continue e}if(E.type==="composite"){const A=Jy(t,E,mce(n,E),{source:v??E.sources.map(S=>({source:S,nested:[]})),joined:{}});if("error"in A){y.shift();continue e}f={...A.success},y[0]={source:E,nested:A.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],v=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:v}}};if((0,GT.isJoined)(E)){if(!(0,GT.isSourceDef)(E))continue}else return{error:{code:"composite_source_not_a_join",data:{path:v}}};const _=Jy(v,E,y,m[g]);if("error"in _)return _;if(!(0,GT.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:v}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ace(){return{source:void 0,joined:{}}}ut.emptyNarrowedCompositeFieldResolution=ace;function lce(t,e,n){const r=Jy([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}ut.narrowCompositeFieldResolution=lce;function cce(t,e){const n=Jy([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}ut.resolveCompositeSources=cce;function WT(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>WT(n).map(r=>[e,...r])).flat()]}ut.compositeFieldUsagePaths=WT;function fce(t){return WT(t).map(e=>YB(e)).join(", ")}ut.formatCompositeFieldUsages=fce;function VT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+VT(n),t.fields.length)}function xce(t){return VT(t)===0}ut.isEmptyCompositeFieldUsage=xce;function dce(t){return VT(t)>1}ut.compositeFieldUsageIsPlural=dce;function YB(t){return`\`${t.join(".")}\``}ut.formatCompositeFieldUsage=YB;function XB(t){return Array.from(new Set(t))}ut.unique=XB;function JB(...t){const e=t.filter(VB.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=JB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(VB.isNotUndefined));return{fields:XB(e.map(i=>i.fields).flat()),joinedUsage:r}}ut.mergeCompositeFieldUsage=JB;function hce(){return{fields:[],joinedUsage:{}}}ut.emptyCompositeFieldUsage=hce;function pce(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function KB(t,e){return{fields:pce(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?KB(r,e.joinedUsage[n]):r]))}}ut.compositeFieldUsageDifference=KB;function ZB(t,e){return t.length===0?e:ZB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}ut.joinedCompositeFieldUsage=ZB;function ek(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>ek(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}ut.compositeFieldUsageJoinPaths=ek;function tk(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function gce(t){return t.fields.filter(e=>!tk(e))}function mce(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>tk(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(at,"__esModule",{value:!0}),at.expandOverrideMapFromBase=at.expandBlueprintMap=at.overload=at.minAnalytic=at.minAggregate=at.minScalar=at.maxAnalytic=at.maxUngroupedAggregate=at.anyExprType=at.maxAggregate=at.maxScalar=at.makeParam=at.param=at.variadicParam=at.literal=at.output=at.constant=at.sql=at.spread=at.arg=void 0;const yce=ut;function nk(t){return{node:"function_parameter",name:t}}at.arg=nk;function Ece(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}at.spread=Ece;function vce(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}at.sql=vce;function YT(t){return{...t,evalSpace:"constant"}}at.constant=YT;function _ce(t){return{...t,evalSpace:"output"}}at.output=_ce;function XT(t){return{...t,evalSpace:"literal"}}at.literal=XT;function Ace(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}at.variadicParam=Ace;function rk(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}at.param=rk;function Sce(t,...e){return{param:rk(t,...e),arg:nk(t)}}at.makeParam=Sce;function Ky(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.maxScalar=Ky;function ik(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.maxAggregate=ik;function JT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}at.anyExprType=JT;function bce(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}at.maxUngroupedAggregate=bce;function sk(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}at.maxAnalytic=sk;function Xx(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.minScalar=Xx;function ok(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.minAggregate=ok;function uk(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}at.minAnalytic=uk;function Cce(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}at.overload=Cce;function Ns(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Tce(t,e){var n;let r;return typeof t=="string"?r=Xx(t):"generic"in t?r=Xx(Ns(t,e)):"literal"in t?r=XT(Xx(Ns(t.literal,e))):"constant"in t?r=YT(Xx(Ns(t.constant,e))):"dimension"in t?r=Xx(Ns(t.dimension,e)):"measure"in t?r=ok(Ns(t.measure,e)):r=uk(Ns(t.calculation,e)),{...r,compositeFieldUsage:(0,yce.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function ak(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Oce(t){return ak(t)?[t]:Array.isArray(t)?t:ak(t.variadic)?[t.variadic]:t.variadic}function Rce(t,e){return typeof t=="string"?JT(t):"generic"in t?JT(Ns(t,e)):"literal"in t?XT(Ky(Ns(t.literal,e))):"constant"in t?YT(Ky(Ns(t.constant,e))):"dimension"in t?Ky(Ns(t.dimension,e)):"measure"in t?ik(Ns(t.measure,e)):sk(Ns(t.calculation,e))}function Dce(t,e){return t.map(n=>Rce(n,e))}function lk(t){return typeof t!="string"&&"variadic"in t}function wce(t,e,n){return{name:t,allowedTypes:Dce(Oce(e),n),isVariadic:lk(e)}}function Nce(t,e){return Object.entries(t).map(r=>wce(r[0],r[1],e))}function Fce(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function Lce(t,e){return lk(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ice(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>Lce(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function $ce(t){return"sql"in t.impl?Fce(t.impl.sql):"expr"in t.impl?t.impl.expr:Ice(t.impl.function,t)}function Bce(t){return{e:$ce(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function ck(t,e){return{returnType:Tce(t.returns,e),params:Nce(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Bce(t)}}function KT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>ck(t,{name:e,type:n}))}return[ck(t)]}function ZT(t){return"takes"in t&&"returns"in t&&"impl"in t}function kce(t){return"function"in t||"sql"in t||"expr"in t}function Pce(t){return ZT(t)?KT(t):Object.values(t).flatMap(e=>KT(e))}function Mce(t){const e={};for(const n in t)e[n]=Pce(t[n]);return e}at.expandBlueprintMap=Mce;function fk(t,e){return KT({...t,impl:e})}function jce(t,e,n){if(kce(n)){if(!ZT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return fk(e,n)}else{if(ZT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return fk(s,i)})}}function Uce(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=jce(r,t[r],e[r])}return n}at.expandOverrideMapFromBase=Uce;var Bl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=Je;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
2
2
  STRING_AGG(DISTINCT ${`concat('${f}', ${a}, '${x}', ${l})`}${c.length>0?","+c:""}),
3
3
  '${f}.*?${x}',
4
4
  ''
@@ -1375,7 +1375,10 @@ function Uv(t, e, n, r = void 0) {
1375
1375
  return {
1376
1376
  error: { code: "composite_source_not_defined", data: { path: v } }
1377
1377
  };
1378
- if (!(0, BT.isJoined)(E) || !(0, BT.isSourceDef)(E))
1378
+ if ((0, BT.isJoined)(E)) {
1379
+ if (!(0, BT.isSourceDef)(E))
1380
+ continue;
1381
+ } else
1379
1382
  return {
1380
1383
  error: { code: "composite_source_not_a_join", data: { path: v } }
1381
1384
  };
@@ -1,4 +1,4 @@
1
- (function(Py){typeof define=="function"&&define.amd?define(Py):Py()})(function(){"use strict";function Py(t){return Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=Object.assign({},i),RB(i.value)&&!I0e(i.value)&&!Array.isArray(i.value)&&(n[r].value=Object.assign({},i.value)),Array.isArray(i.value)&&(n[r].value=i.value.slice(0)),n},{})}function w0e(t){return t?Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=RB(i)&&"value"in i?i:{value:i},n[r].attribute||(n[r].attribute=L0e(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function N0e(t){return Object.keys(t).reduce((n,r)=>(n[r]=t[r].value,n),{})}function F0e(t,e){const n=Py(e);return Object.keys(e).forEach(i=>{const s=n[i],o=t.getAttribute(s.attribute),u=t[i];o&&(s.value=s.parse?TB(o):o),u!=null&&(s.value=Array.isArray(u)?u.slice(0):u),s.reflect&&OB(t,s.attribute,s.value,!!s.parse),Object.defineProperty(t,i,{get(){return s.value},set(a){const l=s.value;s.value=a,s.reflect&&OB(this,s.attribute,s.value,!!s.parse);for(let c=0,f=this.__propertyChangedCallbacks.length;c<f;c++)this.__propertyChangedCallbacks[c](i,a,l)},enumerable:!0,configurable:!0})}),n}function TB(t){if(t)try{return JSON.parse(t)}catch{return t}}function OB(t,e,n,r){if(n==null||n===!1)return t.removeAttribute(e);let i=r?JSON.stringify(n):n;t.__updating[e]=!0,i==="true"&&(i=""),t.setAttribute(e,i),Promise.resolve().then(()=>delete t.__updating[e])}function L0e(t){return t.replace(/\.?([A-Z]+)/g,(e,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function RB(t){return t!=null&&(typeof t=="object"||typeof t=="function")}function I0e(t){return Object.prototype.toString.call(t)==="[object Function]"}function $0e(t){return typeof t=="function"&&t.toString().indexOf("class")===0}let IT;function B0e(t,e){const n=Object.keys(e);return class extends t{static get observedAttributes(){return n.map(i=>e[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=F0e(this,e);const i=N0e(this.props),s=this.Component,o=IT;try{IT=this,this.__initialized=!0,$0e(s)?new s(i,{element:this}):s(i,{element:this})}finally{IT=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,s,o){if(this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in e)){if(o==null&&!this[i])return;this[i]=e[i].parse?TB(o):o}}lookupProp(i){if(e)return n.find(s=>i===s||i===e[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function DB(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function wB(t,e={},n={}){const{BaseElement:r=HTMLElement,extension:i,customElements:s=window.customElements}=n;return o=>{if(!t)throw new Error("tag is required to register a Component");let u=s.get(t);return u?(u.prototype.Component=o,u):(u=B0e(r,w0e(e)),u.prototype.Component=o,u.prototype.registeredTag=t,s.define(t,u,i),u)}}const k0e={context:void 0,registry:void 0},P0e=(t,e)=>t===e,Ko=Symbol("solid-proxy"),$T=Symbol("solid-track"),My={equals:P0e};let NB=kB;const ya=1,jy=2,FB={owned:null,cleanups:null,context:null,owner:null};var zt=null;let BT=null,M0e=null,ln=null,Tr=null,Ea=null,Uy=0;function ep(t,e){const n=ln,r=zt,i=t.length===0,s=e===void 0?r:e,o=i?FB:{owned:null,cleanups:null,context:s?s.context:null,owner:s},u=i?t:()=>t(()=>Xi(()=>Qy(o)));zt=o,ln=null;try{return Dc(u,!0)}finally{ln=n,zt=r}}function dr(t,e){e=e?Object.assign({},My,e):My;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),BB(n,i));return[$B.bind(n),r]}function j0e(t,e,n){const r=qy(t,e,!0,ya);Wx(r)}function Pn(t,e,n){const r=qy(t,e,!1,ya);Wx(r)}function ws(t,e,n){NB=Q0e;const r=qy(t,e,!1,ya);(!n||!n.render)&&(r.user=!0),Ea?Ea.push(r):Wx(r)}function Fn(t,e,n){n=n?Object.assign({},My,n):My;const r=qy(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Wx(r),$B.bind(r)}function U0e(t){return Dc(t,!1)}function Xi(t){if(ln===null)return t();const e=ln;ln=null;try{return t()}finally{ln=e}}function tp(t){ws(()=>Xi(t))}function np(t){return zt===null||(zt.cleanups===null?zt.cleanups=[t]:zt.cleanups.push(t)),t}function kT(){return ln}function LB(){return zt}function q0e(t,e){const n=zt,r=ln;zt=t,ln=null;try{return Dc(e,!0)}catch(i){jT(i)}finally{zt=n,ln=r}}function PT(t,e){const n=Symbol("context");return{id:n,Provider:W0e(n),defaultValue:t}}function MT(t){return zt&&zt.context&&zt.context[t.id]!==void 0?zt.context[t.id]:t.defaultValue}function IB(t){const e=Fn(t),n=Fn(()=>UT(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function $B(){if(this.sources&&this.state)if(this.state===ya)Wx(this);else{const t=Tr;Tr=null,Dc(()=>Hy(this),!1),Tr=t}if(ln){const t=this.observers?this.observers.length:0;ln.sources?(ln.sources.push(this),ln.sourceSlots.push(t)):(ln.sources=[this],ln.sourceSlots=[t]),this.observers?(this.observers.push(ln),this.observerSlots.push(ln.sources.length-1)):(this.observers=[ln],this.observerSlots=[ln.sources.length-1])}return this.value}function BB(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&Dc(()=>{for(let i=0;i<t.observers.length;i+=1){const s=t.observers[i],o=BT&&BT.running;o&&BT.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Tr.push(s):Ea.push(s),s.observers&&PB(s)),o||(s.state=ya)}if(Tr.length>1e6)throw Tr=[],new Error},!1)),e}function Wx(t){if(!t.fn)return;Qy(t);const e=Uy;z0e(t,t.value,e)}function z0e(t,e,n){let r;const i=zt,s=ln;ln=zt=t;try{r=t.fn(e)}catch(o){return t.pure&&(t.state=ya,t.owned&&t.owned.forEach(Qy),t.owned=null),t.updatedAt=n+1,jT(o)}finally{ln=s,zt=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?BB(t,r):t.value=r,t.updatedAt=n)}function qy(t,e,n,r=ya,i){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:zt,context:zt?zt.context:null,pure:n};return zt===null||zt!==FB&&(zt.owned?zt.owned.push(s):zt.owned=[s]),s}function zy(t){if(t.state===0)return;if(t.state===jy)return Hy(t);if(t.suspense&&Xi(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<Uy);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===ya)Wx(t);else if(t.state===jy){const r=Tr;Tr=null,Dc(()=>Hy(t,e[0]),!1),Tr=r}}function Dc(t,e){if(Tr)return t();let n=!1;e||(Tr=[]),Ea?n=!0:Ea=[],Uy++;try{const r=t();return H0e(n),r}catch(r){n||(Ea=null),Tr=null,jT(r)}}function H0e(t){if(Tr&&(kB(Tr),Tr=null),t)return;const e=Ea;Ea=null,e.length&&Dc(()=>NB(e),!1)}function kB(t){for(let e=0;e<t.length;e++)zy(t[e])}function Q0e(t){let e,n=0;for(e=0;e<t.length;e++){const r=t[e];r.user?t[n++]=r:zy(r)}for(e=0;e<n;e++)zy(t[e])}function Hy(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const r=t.sources[n];if(r.sources){const i=r.state;i===ya?r!==e&&(!r.updatedAt||r.updatedAt<Uy)&&zy(r):i===jy&&Hy(r,e)}}}function PB(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=jy,n.pure?Tr.push(n):Ea.push(n),n.observers&&PB(n))}}function Qy(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),r=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Qy(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function G0e(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function jT(t,e=zt){throw G0e(t)}function UT(t){if(typeof t=="function"&&!t.length)return UT(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const r=UT(t[n]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return e}return t}function W0e(t,e){return function(r){let i;return Pn(()=>i=Xi(()=>(zt.context={...zt.context,[t]:r.value},IB(()=>r.children))),void 0),i}}const V0e=Symbol("fallback");function MB(t){for(let e=0;e<t.length;e++)t[e]()}function Y0e(t,e,n={}){let r=[],i=[],s=[],o=0,u=e.length>1?[]:null;return np(()=>MB(s)),()=>{let a=t()||[],l,c;return a[$T],Xi(()=>{let x=a.length,d,p,m,g,y,E,v,_,A;if(x===0)o!==0&&(MB(s),s=[],r=[],i=[],o=0,u&&(u=[])),n.fallback&&(r=[V0e],i[0]=ep(S=>(s[0]=S,n.fallback())),o=1);else if(o===0){for(i=new Array(x),c=0;c<x;c++)r[c]=a[c],i[c]=ep(f);o=x}else{for(m=new Array(x),g=new Array(x),u&&(y=new Array(x)),E=0,v=Math.min(o,x);E<v&&r[E]===a[E];E++);for(v=o-1,_=x-1;v>=E&&_>=E&&r[v]===a[_];v--,_--)m[_]=i[v],g[_]=s[v],u&&(y[_]=u[v]);for(d=new Map,p=new Array(_+1),c=_;c>=E;c--)A=a[c],l=d.get(A),p[c]=l===void 0?-1:l,d.set(A,c);for(l=E;l<=v;l++)A=r[l],c=d.get(A),c!==void 0&&c!==-1?(m[c]=i[l],g[c]=s[l],u&&(y[c]=u[l]),c=p[c],d.set(A,c)):s[l]();for(c=E;c<x;c++)c in m?(i[c]=m[c],s[c]=g[c],u&&(u[c]=y[c],u[c](c))):i[c]=ep(f);i=i.slice(0,o=x),r=a.slice(0)}return i});function f(x){if(s[c]=x,u){const[d,p]=dr(c);return u[c]=p,e(a[c],d)}return e(a[c])}}}function Ge(t,e){return Xi(()=>t(e||{}))}function Gy(){return!0}const X0e={get(t,e,n){return e===Ko?n:t.get(e)},has(t,e){return e===Ko?!0:t.has(e)},set:Gy,deleteProperty:Gy,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:Gy,deleteProperty:Gy}},ownKeys(t){return t.keys()}};function qT(t){return(t=typeof t=="function"?t():t)?t:{}}function J0e(){for(let t=0,e=this.length;t<e;++t){const n=this[t]();if(n!==void 0)return n}}function Zo(...t){let e=!1;for(let o=0;o<t.length;o++){const u=t[o];e=e||!!u&&Ko in u,t[o]=typeof u=="function"?(e=!0,Fn(u)):u}if(e)return new Proxy({get(o){for(let u=t.length-1;u>=0;u--){const a=qT(t[u])[o];if(a!==void 0)return a}},has(o){for(let u=t.length-1;u>=0;u--)if(o in qT(t[u]))return!0;return!1},keys(){const o=[];for(let u=0;u<t.length;u++)o.push(...Object.keys(qT(t[u])));return[...new Set(o)]}},X0e);const n={},r=Object.create(null);for(let o=t.length-1;o>=0;o--){const u=t[o];if(!u)continue;const a=Object.getOwnPropertyNames(u);for(let l=a.length-1;l>=0;l--){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const f=Object.getOwnPropertyDescriptor(u,c);if(!r[c])r[c]=f.get?{enumerable:!0,configurable:!0,get:J0e.bind(n[c]=[f.get.bind(u)])}:f.value!==void 0?f:void 0;else{const x=n[c];x&&(f.get?x.push(f.get.bind(u)):f.value!==void 0&&x.push(()=>f.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const u=s[o],a=r[u];a&&a.get?Object.defineProperty(i,u,a):i[u]=a?a.value:void 0}return i}const jB=t=>`Stale read from <${t}>.`;function Yn(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Fn(Y0e(()=>t.each,t.children,e||void 0))}function Or(t){const e=t.keyed,n=Fn(()=>t.when,void 0,{equals:(r,i)=>e?r===i:!r==!i});return Fn(()=>{const r=n();if(r){const i=t.children;return typeof i=="function"&&i.length>0?Xi(()=>i(e?r:()=>{if(!Xi(n))throw jB("Show");return t.when})):i}return t.fallback},void 0,void 0)}function UB(t){let e=!1;const n=(s,o)=>(e?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],r=IB(()=>t.children),i=Fn(()=>{let s=r();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const u=s[o].when;if(u)return e=!!s[o].keyed,[o,u,s[o]]}return[-1]},void 0,{equals:n});return Fn(()=>{const[s,o,u]=i();if(s<0)return t.fallback;const a=u.children;return typeof a=="function"&&a.length>0?Xi(()=>a(e?o:()=>{if(Xi(i)[0]!==s)throw jB("Match");return u.when})):a},void 0,void 0)}function Wy(t){return t}function K0e(t,e,n){let r=n.length,i=e.length,s=r,o=0,u=0,a=e[i-1].nextSibling,l=null;for(;o<i||u<s;){if(e[o]===n[u]){o++,u++;continue}for(;e[i-1]===n[s-1];)i--,s--;if(i===o){const c=s<r?u?n[u-1].nextSibling:n[s-u]:a;for(;u<s;)t.insertBefore(n[u++],c)}else if(s===u)for(;o<i;)(!l||!l.has(e[o]))&&e[o].remove(),o++;else if(e[o]===n[s-1]&&n[u]===e[i-1]){const c=e[--i].nextSibling;t.insertBefore(n[u++],e[o++].nextSibling),t.insertBefore(n[--s],c),e[i]=n[s]}else{if(!l){l=new Map;let f=u;for(;f<s;)l.set(n[f],f++)}const c=l.get(e[o]);if(c!=null)if(u<c&&c<s){let f=o,x=1,d;for(;++f<i&&f<s&&!((d=l.get(e[f]))==null||d!==c+x);)x++;if(x>c-u){const p=e[o];for(;u<c;)t.insertBefore(n[u++],p)}else t.replaceChild(n[u++],e[o++])}else o++;else e[o++].remove()}}}const qB="_$DX_DELEGATE";function mt(t,e,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=t,n?o.content.firstChild.firstChild:o.content.firstChild},s=e?()=>Xi(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return s.cloneNode=s,s}function zT(t,e=window.document){const n=e[qB]||(e[qB]=new Set);for(let r=0,i=t.length;r<i;r++){const s=t[r];n.has(s)||(n.add(s),e.addEventListener(s,Z0e))}}function Ji(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function zB(t,e,n,r){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function wc(t,e,n){if(!e)return n?Ji(t,"style"):e;const r=t.style;if(typeof e=="string")return r.cssText=e;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),e||(e={});let i,s;for(s in n)e[s]==null&&r.removeProperty(s),delete n[s];for(s in e)i=e[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function lo(t,e,n){return Xi(()=>t(e,n))}function Xe(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return Vy(t,e,r,n);Pn(i=>Vy(t,e(),i,n),r)}function Z0e(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const i=n[`${e}Data`];if(i!==void 0?r.call(n,i,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Vy(t,e,n,r,i){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,o=r!==void 0;if(t=o&&n[0]&&n[0].parentNode||t,s==="string"||s==="number")if(s==="number"&&(e=e.toString()),o){let u=n[0];u&&u.nodeType===3?u.data!==e&&(u.data=e):u=document.createTextNode(e),n=Vx(t,n,r,u)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||s==="boolean")n=Vx(t,n,r);else{if(s==="function")return Pn(()=>{let u=e();for(;typeof u=="function";)u=u();n=Vy(t,u,n,r)}),()=>n;if(Array.isArray(e)){const u=[],a=n&&Array.isArray(n);if(HT(u,e,n,i))return Pn(()=>n=Vy(t,u,n,r,!0)),()=>n;if(u.length===0){if(n=Vx(t,n,r),o)return n}else a?n.length===0?HB(t,u,r):K0e(t,n,u):(n&&Vx(t),HB(t,u));n=u}else if(e.nodeType){if(Array.isArray(n)){if(o)return n=Vx(t,n,r,e);Vx(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function HT(t,e,n,r){let i=!1;for(let s=0,o=e.length;s<o;s++){let u=e[s],a=n&&n[t.length],l;if(!(u==null||u===!0||u===!1))if((l=typeof u)=="object"&&u.nodeType)t.push(u);else if(Array.isArray(u))i=HT(t,u,a)||i;else if(l==="function")if(r){for(;typeof u=="function";)u=u();i=HT(t,Array.isArray(u)?u:[u],Array.isArray(a)?a:[a])||i}else t.push(u),i=!0;else{const c=String(u);a&&a.nodeType===3&&a.data===c?t.push(a):t.push(document.createTextNode(c))}}return i}function HB(t,e,n=null){for(let r=0,i=e.length;r<i;r++)t.insertBefore(e[r],n)}function Vx(t,e,n,r){if(n===void 0)return t.textContent="";const i=r||document.createTextNode("");if(e.length){let s=!1;for(let o=e.length-1;o>=0;o--){const u=e[o];if(i!==u){const a=u.parentNode===t;!s&&!o?a?t.replaceChild(i,u):t.insertBefore(i,n):a&&u.remove()}else s=!0}}else t.insertBefore(i,n);return[i]}const ece="http://www.w3.org/2000/svg";function tce(t,e=!1){return e?document.createElementNS(ece,t):document.createElement(t)}function nce(t){const{useShadow:e}=t,n=document.createTextNode(""),r=()=>t.mount||document.body,i=LB();let s,o=!!k0e.context;return ws(()=>{s||(s=q0e(i,()=>Fn(()=>t.children)));const u=r();if(u instanceof HTMLHeadElement){const[a,l]=dr(!1),c=()=>l(!0);ep(f=>Xe(u,()=>a()?f():s(),null)),np(c)}else{const a=tce(t.isSVG?"g":"div",t.isSVG),l=e&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),Xe(l,s),u.appendChild(a),t.ref&&t.ref(a),np(()=>u.removeChild(a))}},void 0,{render:!o}),n}function rce(t){const e=Object.keys(t),n={};for(let r=0;r<e.length;r++){const[i,s]=dr(t[e[r]]);Object.defineProperty(n,e[r],{get:i,set(o){s(()=>o)}})}return n}function ice(t){if(t.assignedSlot&&t.assignedSlot._$owner)return t.assignedSlot._$owner;let e=t.parentNode;for(;e&&!e._$owner&&!(e.assignedSlot&&e.assignedSlot._$owner);)e=e.parentNode;return e&&e.assignedSlot?e.assignedSlot._$owner:t._$owner}function QB(t){return(e,n)=>{const{element:r}=n;return ep(i=>{const s=rce(e);r.addPropertyChangedCallback((u,a)=>s[u]=a),r.addReleaseCallback(()=>{r.renderRoot.textContent="",i()});const o=t(s,n);return Xe(r.renderRoot,o)},ice(r))}}var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function sce(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var GB={},Yx={},at={},ut={},va={};Object.defineProperty(va,"__esModule",{value:!0}),va.isNotUndefined=va.locationContainsPosition=void 0;function oce(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}va.locationContainsPosition=oce;function uce(t){return t!==void 0}va.isNotUndefined=uce;var Je={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(z){return"kids"in z}t.exprHasKids=e;function n(z){return"e"in z}t.exprHasE=n;function r(z){return!(e(z)||n(z))}t.exprIsLeaf=r;function i(z){return z.node==="aggregate"&&["sum","avg","count","distinct"].includes(z.function)}t.isAsymmetricExpr=i;function s(z){return z.node!=="arrayLiteral"&&z.node!=="recordLiteral"}function o(z,de){const fe=typeof de=="string"?{type:de}:de;return s(z)?{...z,typeDef:{...fe}}:z}t.mkTemporal=o;function u(z){return"dstSQLType"in z}t.isRawCast=u;function a(z){return z.value!==null}t.paramHasValue=a;function l(z){return z===void 0||z==="scalar"}t.expressionIsScalar=l;function c(z){return z==="aggregate"||z==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(z){return z==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(z){return z==="aggregate"||z==="ungrouped_aggregate"||z==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(z){return z==="aggregate"||z==="scalar_analytic"||z==="aggregate_analytic"||z==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(z){return z==="aggregate_analytic"||z==="scalar_analytic"}t.expressionIsAnalytic=p;function m(z){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[z]}function g(z,de){return z===de||m(z)<m(de)}t.isExpressionTypeLEQ=g;function y(z,de){let fe="scalar";return(z==="aggregate"||de==="aggregate")&&(fe="aggregate"),(z==="ungrouped_aggregate"||de==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(z==="scalar_analytic"||de==="scalar_analytic")&&(fe="scalar_analytic"),(z==="aggregate_analytic"||de==="aggregate_analytic")&&(fe="aggregate_analytic"),(z==="scalar_analytic"&&de==="aggregate"||z==="aggregate"&&de==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(z){return z.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function v(z){return"e"in z}t.hasExpression=v;function _(z){return z==="date"||z==="timestamp"}t.isTemporalType=_;function A(z){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(z)}t.isAtomicFieldType=A;function S(z){return["string","number","date","boolean","date","timestamp"].includes(z)}t.canOrderBy=S;function b(z){return["string","number","date","timestamp","boolean","json"].includes(z)}t.isCastType=b;function C(z){return A(z.type)&&!v(z)}t.fieldIsIntrinsic=C;function w(z,de,fe){if(M(z))return I(z.elementTypeDef,de,fe);if(F(z)){const{type:K,fields:ee,elementTypeDef:Oe}=z;return{type:K,fields:ee,elementTypeDef:Oe,join:"many",name:de,dialect:fe}}if(z.type==="record"){const{type:K,fields:ee}=z;return{type:K,fields:ee,join:"one",dialect:fe,name:de}}return{...z,name:de}}t.mkFieldDef=w;function I(z,de,fe){if(z.type==="record")return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:{type:"record_element"},fields:z.fields};const K=w(z,"value",fe);return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:z,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=I;function F(z){return z.type==="array"&&z.elementTypeDef.type==="record_element"}t.isRepeatedRecord=F;function M(z){return z.type==="array"&&z.elementTypeDef.type!=="record_element"}t.isScalarArray=M;function U(z){return["left","right","full","inner"].includes(z)}t.isMatrixOperation=U;function X(z){return["composite","table","sql_select","query_source","array","record"].includes(z.type)}t.isJoinable=X;function W(z){return"join"in z}t.isJoined=W;function ae(z){return j(z)&&W(z)}t.isJoinedSource=ae;function ge(z){return["day","week","month","quarter","year"].includes(z)}t.isDateUnit=ge;function he(z){return ge(z)||["hour","minute","second"].includes(z)}t.isTimestampUnit=he;function ue(z){return he(z)||z==="day_of_week"||z==="day_of_year"}t.isExtractUnit=ue;var ce;(function(z){z.Date="date",z.Timestamp="timestamp",z.Number="number",z.String="string"})(ce||(t.ValueType=ce={}));function ie(z){return typeof z!="string"}t.refIsStructDef=ie;function re(z){return!!((z.type==="reduce"||z.type==="project"||z.type==="partial")&&(z.extendSource&&z.extendSource.some(de=>de.type==="error")||z.queryFields.some(de=>de.type==="error")))}t.segmentHasErrors=re;function R(z){return z.fields.some(de=>de.type==="error")}t.structHasErrors=R;function O(z){return z.type==="reduce"}t.isReduceSegment=O;function D(z){return z.type==="partial"}t.isPartialSegment=D;function k(z){return z.type==="project"}t.isProjectSegment=k;function G(z){return k(z)||O(z)}t.isQuerySegment=G;function q(z){return z.rows!==void 0}t.isSamplingRows=q;function N(z){return z.percent!==void 0}t.isSamplingPercent=N;function B(z){return z.enable!==void 0}t.isSamplingEnable=B;function P(z){return z.type==="raw"}t.isRawSegment=P;function Q(z){return z.type==="index"}t.isIndexSegment=Q;function $(z){return"sql"in z}t.isSegmentSQL=$;function H(z){return{...z}}t.sourceBase=H;function j(z){return z.type==="table"||z.type==="sql_select"||z.type==="query_source"||z.type==="query_result"||z.type==="finalize"||z.type==="nest_source"||z.type==="composite"}t.isSourceDef=j;function J(z){return ae(z)?!1:!!j(z)}t.isBaseTable=J;function xe(z){return z==="literal"}t.isLiteral=xe;function se(...z){return z.length<=1&&z.every(de=>de==="literal")?"literal":z.every(de=>de==="constant"||de==="literal")?"constant":z.every(de=>de==="output"||de==="constant"||de==="literal")?"output":"input"}t.mergeEvalSpaces=se;function Z(z){return z.type==="string"||_(z.type)||z.type==="number"||z.type==="boolean"||z.type==="json"||z.type==="sql native"||z.type==="error"}t.isLeafAtomic=Z;function oe(z){return z.as!==void 0?z.as:z.name}t.getIdentifier=oe;function we(z){return z.type==="turtle"}t.isTurtle=we;function ke(z){return A(z.type)}t.isAtomic=ke;function ze(z,de){return de.type==="string"}t.isValueString=ze;function V(z,de){return de.type==="number"}t.isValueNumber=V;function ne(z,de){return de.type==="boolean"}t.isValueBoolean=ne;function Te(z,de){return de.type==="timestamp"}t.isValueTimestamp=Te;function Me(z,de){return de.type==="date"}t.isValueDate=Me,t.TD={isAtomic(z){return z!==void 0&&A(z.type)},isLeafAtomic(z){return z!==void 0&&Z({type:z.type})},isString:z=>(z==null?void 0:z.type)==="string",isNumber:z=>(z==null?void 0:z.type)==="number",isBoolean:z=>(z==null?void 0:z.type)==="boolean",isJSON:z=>(z==null?void 0:z.type)==="json",isSQL:z=>(z==null?void 0:z.type)==="sql native",isDate:z=>(z==null?void 0:z.type)==="date",isTimestamp:z=>(z==null?void 0:z.type)==="timestamp",isTemporal(z){var de;const fe=(de=z==null?void 0:z.type)!==null&&de!==void 0?de:"";return _(fe)},isError:z=>(z==null?void 0:z.type)==="error",eq(z,de){if(z===void 0||de===void 0)return!1;function fe(K,ee){const Oe={};for(const Y of K.fields||[])if(Y.name)Oe[Y.name]=Y;else return!1;for(const Y of ee.fields||[])if(!t.TD.eq(Oe[Y.name],Y))return!1;return!0}return z.type==="array"&&de.type==="array"?z.elementTypeDef.type!==de.elementTypeDef.type?!1:z.elementTypeDef.type!=="record_element"&&de.elementTypeDef.type!=="record_element"?t.TD.eq(z.elementTypeDef,de.elementTypeDef):fe(z,de):z.type==="record"&&de.type==="record"?fe(z,de):z.type==="sql native"&&de.type==="sql native"?z.rawType!==void 0&&z.rawType===de.rawType:z.type===de.type}}})(Je),Object.defineProperty(ut,"__esModule",{value:!0}),ut.compositeFieldUsageJoinPaths=ut.joinedCompositeFieldUsage=ut.compositeFieldUsageDifference=ut.emptyCompositeFieldUsage=ut.mergeCompositeFieldUsage=ut.unique=ut.formatCompositeFieldUsage=ut.compositeFieldUsageIsPlural=ut.isEmptyCompositeFieldUsage=ut.formatCompositeFieldUsages=ut.compositeFieldUsagePaths=ut.resolveCompositeSources=ut.narrowCompositeFieldResolution=ut.emptyNarrowedCompositeFieldResolution=void 0;const WB=va,QT=Je;function Xy(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=gce(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:v}of x){const _=new Set;for(const A of E.fields)_.add((s=A.as)!==null&&s!==void 0?s:A.name);for(const A of n.fields)if(!_.has(A)){y.shift();continue e}if(E.type==="composite"){const A=Xy(t,E,mce(n,E),{source:v??E.sources.map(S=>({source:S,nested:[]})),joined:{}});if("error"in A){y.shift();continue e}f={...A.success},y[0]={source:E,nested:A.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],v=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:v}}};if(!(0,QT.isJoined)(E)||!(0,QT.isSourceDef)(E))return{error:{code:"composite_source_not_a_join",data:{path:v}}};const _=Xy(v,E,y,m[g]);if("error"in _)return _;if(!(0,QT.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:v}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ace(){return{source:void 0,joined:{}}}ut.emptyNarrowedCompositeFieldResolution=ace;function lce(t,e,n){const r=Xy([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}ut.narrowCompositeFieldResolution=lce;function cce(t,e){const n=Xy([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}ut.resolveCompositeSources=cce;function GT(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>GT(n).map(r=>[e,...r])).flat()]}ut.compositeFieldUsagePaths=GT;function fce(t){return GT(t).map(e=>VB(e)).join(", ")}ut.formatCompositeFieldUsages=fce;function WT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+WT(n),t.fields.length)}function xce(t){return WT(t)===0}ut.isEmptyCompositeFieldUsage=xce;function dce(t){return WT(t)>1}ut.compositeFieldUsageIsPlural=dce;function VB(t){return`\`${t.join(".")}\``}ut.formatCompositeFieldUsage=VB;function YB(t){return Array.from(new Set(t))}ut.unique=YB;function XB(...t){const e=t.filter(WB.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=XB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(WB.isNotUndefined));return{fields:YB(e.map(i=>i.fields).flat()),joinedUsage:r}}ut.mergeCompositeFieldUsage=XB;function hce(){return{fields:[],joinedUsage:{}}}ut.emptyCompositeFieldUsage=hce;function pce(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function JB(t,e){return{fields:pce(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?JB(r,e.joinedUsage[n]):r]))}}ut.compositeFieldUsageDifference=JB;function KB(t,e){return t.length===0?e:KB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}ut.joinedCompositeFieldUsage=KB;function ZB(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>ZB(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}ut.compositeFieldUsageJoinPaths=ZB;function ek(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function gce(t){return t.fields.filter(e=>!ek(e))}function mce(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>ek(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(at,"__esModule",{value:!0}),at.expandOverrideMapFromBase=at.expandBlueprintMap=at.overload=at.minAnalytic=at.minAggregate=at.minScalar=at.maxAnalytic=at.maxUngroupedAggregate=at.anyExprType=at.maxAggregate=at.maxScalar=at.makeParam=at.param=at.variadicParam=at.literal=at.output=at.constant=at.sql=at.spread=at.arg=void 0;const yce=ut;function tk(t){return{node:"function_parameter",name:t}}at.arg=tk;function Ece(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}at.spread=Ece;function vce(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}at.sql=vce;function VT(t){return{...t,evalSpace:"constant"}}at.constant=VT;function _ce(t){return{...t,evalSpace:"output"}}at.output=_ce;function YT(t){return{...t,evalSpace:"literal"}}at.literal=YT;function Ace(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}at.variadicParam=Ace;function nk(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}at.param=nk;function Sce(t,...e){return{param:nk(t,...e),arg:tk(t)}}at.makeParam=Sce;function Jy(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.maxScalar=Jy;function rk(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.maxAggregate=rk;function XT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}at.anyExprType=XT;function bce(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}at.maxUngroupedAggregate=bce;function ik(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}at.maxAnalytic=ik;function Xx(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.minScalar=Xx;function sk(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.minAggregate=sk;function ok(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}at.minAnalytic=ok;function Cce(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}at.overload=Cce;function Ns(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Tce(t,e){var n;let r;return typeof t=="string"?r=Xx(t):"generic"in t?r=Xx(Ns(t,e)):"literal"in t?r=YT(Xx(Ns(t.literal,e))):"constant"in t?r=VT(Xx(Ns(t.constant,e))):"dimension"in t?r=Xx(Ns(t.dimension,e)):"measure"in t?r=sk(Ns(t.measure,e)):r=ok(Ns(t.calculation,e)),{...r,compositeFieldUsage:(0,yce.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function uk(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Oce(t){return uk(t)?[t]:Array.isArray(t)?t:uk(t.variadic)?[t.variadic]:t.variadic}function Rce(t,e){return typeof t=="string"?XT(t):"generic"in t?XT(Ns(t,e)):"literal"in t?YT(Jy(Ns(t.literal,e))):"constant"in t?VT(Jy(Ns(t.constant,e))):"dimension"in t?Jy(Ns(t.dimension,e)):"measure"in t?rk(Ns(t.measure,e)):ik(Ns(t.calculation,e))}function Dce(t,e){return t.map(n=>Rce(n,e))}function ak(t){return typeof t!="string"&&"variadic"in t}function wce(t,e,n){return{name:t,allowedTypes:Dce(Oce(e),n),isVariadic:ak(e)}}function Nce(t,e){return Object.entries(t).map(r=>wce(r[0],r[1],e))}function Fce(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function Lce(t,e){return ak(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ice(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>Lce(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function $ce(t){return"sql"in t.impl?Fce(t.impl.sql):"expr"in t.impl?t.impl.expr:Ice(t.impl.function,t)}function Bce(t){return{e:$ce(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function lk(t,e){return{returnType:Tce(t.returns,e),params:Nce(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Bce(t)}}function JT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>lk(t,{name:e,type:n}))}return[lk(t)]}function KT(t){return"takes"in t&&"returns"in t&&"impl"in t}function kce(t){return"function"in t||"sql"in t||"expr"in t}function Pce(t){return KT(t)?JT(t):Object.values(t).flatMap(e=>JT(e))}function Mce(t){const e={};for(const n in t)e[n]=Pce(t[n]);return e}at.expandBlueprintMap=Mce;function ck(t,e){return JT({...t,impl:e})}function jce(t,e,n){if(kce(n)){if(!KT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return ck(e,n)}else{if(KT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return ck(s,i)})}}function Uce(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=jce(r,t[r],e[r])}return n}at.expandOverrideMapFromBase=Uce;var Bl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=Je;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
1
+ (function(Py){typeof define=="function"&&define.amd?define(Py):Py()})(function(){"use strict";function Py(t){return Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=Object.assign({},i),RB(i.value)&&!I0e(i.value)&&!Array.isArray(i.value)&&(n[r].value=Object.assign({},i.value)),Array.isArray(i.value)&&(n[r].value=i.value.slice(0)),n},{})}function w0e(t){return t?Object.keys(t).reduce((n,r)=>{const i=t[r];return n[r]=RB(i)&&"value"in i?i:{value:i},n[r].attribute||(n[r].attribute=L0e(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function N0e(t){return Object.keys(t).reduce((n,r)=>(n[r]=t[r].value,n),{})}function F0e(t,e){const n=Py(e);return Object.keys(e).forEach(i=>{const s=n[i],o=t.getAttribute(s.attribute),u=t[i];o&&(s.value=s.parse?TB(o):o),u!=null&&(s.value=Array.isArray(u)?u.slice(0):u),s.reflect&&OB(t,s.attribute,s.value,!!s.parse),Object.defineProperty(t,i,{get(){return s.value},set(a){const l=s.value;s.value=a,s.reflect&&OB(this,s.attribute,s.value,!!s.parse);for(let c=0,f=this.__propertyChangedCallbacks.length;c<f;c++)this.__propertyChangedCallbacks[c](i,a,l)},enumerable:!0,configurable:!0})}),n}function TB(t){if(t)try{return JSON.parse(t)}catch{return t}}function OB(t,e,n,r){if(n==null||n===!1)return t.removeAttribute(e);let i=r?JSON.stringify(n):n;t.__updating[e]=!0,i==="true"&&(i=""),t.setAttribute(e,i),Promise.resolve().then(()=>delete t.__updating[e])}function L0e(t){return t.replace(/\.?([A-Z]+)/g,(e,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function RB(t){return t!=null&&(typeof t=="object"||typeof t=="function")}function I0e(t){return Object.prototype.toString.call(t)==="[object Function]"}function $0e(t){return typeof t=="function"&&t.toString().indexOf("class")===0}let IT;function B0e(t,e){const n=Object.keys(e);return class extends t{static get observedAttributes(){return n.map(i=>e[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=F0e(this,e);const i=N0e(this.props),s=this.Component,o=IT;try{IT=this,this.__initialized=!0,$0e(s)?new s(i,{element:this}):s(i,{element:this})}finally{IT=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,s,o){if(this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in e)){if(o==null&&!this[i])return;this[i]=e[i].parse?TB(o):o}}lookupProp(i){if(e)return n.find(s=>i===s||i===e[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function DB(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function wB(t,e={},n={}){const{BaseElement:r=HTMLElement,extension:i,customElements:s=window.customElements}=n;return o=>{if(!t)throw new Error("tag is required to register a Component");let u=s.get(t);return u?(u.prototype.Component=o,u):(u=B0e(r,w0e(e)),u.prototype.Component=o,u.prototype.registeredTag=t,s.define(t,u,i),u)}}const k0e={context:void 0,registry:void 0},P0e=(t,e)=>t===e,Ko=Symbol("solid-proxy"),$T=Symbol("solid-track"),My={equals:P0e};let NB=kB;const ya=1,jy=2,FB={owned:null,cleanups:null,context:null,owner:null};var zt=null;let BT=null,M0e=null,ln=null,Tr=null,Ea=null,Uy=0;function ep(t,e){const n=ln,r=zt,i=t.length===0,s=e===void 0?r:e,o=i?FB:{owned:null,cleanups:null,context:s?s.context:null,owner:s},u=i?t:()=>t(()=>Xi(()=>Qy(o)));zt=o,ln=null;try{return Dc(u,!0)}finally{ln=n,zt=r}}function dr(t,e){e=e?Object.assign({},My,e):My;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),BB(n,i));return[$B.bind(n),r]}function j0e(t,e,n){const r=qy(t,e,!0,ya);Wx(r)}function Pn(t,e,n){const r=qy(t,e,!1,ya);Wx(r)}function ws(t,e,n){NB=Q0e;const r=qy(t,e,!1,ya);(!n||!n.render)&&(r.user=!0),Ea?Ea.push(r):Wx(r)}function Fn(t,e,n){n=n?Object.assign({},My,n):My;const r=qy(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Wx(r),$B.bind(r)}function U0e(t){return Dc(t,!1)}function Xi(t){if(ln===null)return t();const e=ln;ln=null;try{return t()}finally{ln=e}}function tp(t){ws(()=>Xi(t))}function np(t){return zt===null||(zt.cleanups===null?zt.cleanups=[t]:zt.cleanups.push(t)),t}function kT(){return ln}function LB(){return zt}function q0e(t,e){const n=zt,r=ln;zt=t,ln=null;try{return Dc(e,!0)}catch(i){jT(i)}finally{zt=n,ln=r}}function PT(t,e){const n=Symbol("context");return{id:n,Provider:W0e(n),defaultValue:t}}function MT(t){return zt&&zt.context&&zt.context[t.id]!==void 0?zt.context[t.id]:t.defaultValue}function IB(t){const e=Fn(t),n=Fn(()=>UT(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function $B(){if(this.sources&&this.state)if(this.state===ya)Wx(this);else{const t=Tr;Tr=null,Dc(()=>Hy(this),!1),Tr=t}if(ln){const t=this.observers?this.observers.length:0;ln.sources?(ln.sources.push(this),ln.sourceSlots.push(t)):(ln.sources=[this],ln.sourceSlots=[t]),this.observers?(this.observers.push(ln),this.observerSlots.push(ln.sources.length-1)):(this.observers=[ln],this.observerSlots=[ln.sources.length-1])}return this.value}function BB(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&Dc(()=>{for(let i=0;i<t.observers.length;i+=1){const s=t.observers[i],o=BT&&BT.running;o&&BT.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Tr.push(s):Ea.push(s),s.observers&&PB(s)),o||(s.state=ya)}if(Tr.length>1e6)throw Tr=[],new Error},!1)),e}function Wx(t){if(!t.fn)return;Qy(t);const e=Uy;z0e(t,t.value,e)}function z0e(t,e,n){let r;const i=zt,s=ln;ln=zt=t;try{r=t.fn(e)}catch(o){return t.pure&&(t.state=ya,t.owned&&t.owned.forEach(Qy),t.owned=null),t.updatedAt=n+1,jT(o)}finally{ln=s,zt=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?BB(t,r):t.value=r,t.updatedAt=n)}function qy(t,e,n,r=ya,i){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:zt,context:zt?zt.context:null,pure:n};return zt===null||zt!==FB&&(zt.owned?zt.owned.push(s):zt.owned=[s]),s}function zy(t){if(t.state===0)return;if(t.state===jy)return Hy(t);if(t.suspense&&Xi(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<Uy);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===ya)Wx(t);else if(t.state===jy){const r=Tr;Tr=null,Dc(()=>Hy(t,e[0]),!1),Tr=r}}function Dc(t,e){if(Tr)return t();let n=!1;e||(Tr=[]),Ea?n=!0:Ea=[],Uy++;try{const r=t();return H0e(n),r}catch(r){n||(Ea=null),Tr=null,jT(r)}}function H0e(t){if(Tr&&(kB(Tr),Tr=null),t)return;const e=Ea;Ea=null,e.length&&Dc(()=>NB(e),!1)}function kB(t){for(let e=0;e<t.length;e++)zy(t[e])}function Q0e(t){let e,n=0;for(e=0;e<t.length;e++){const r=t[e];r.user?t[n++]=r:zy(r)}for(e=0;e<n;e++)zy(t[e])}function Hy(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const r=t.sources[n];if(r.sources){const i=r.state;i===ya?r!==e&&(!r.updatedAt||r.updatedAt<Uy)&&zy(r):i===jy&&Hy(r,e)}}}function PB(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=jy,n.pure?Tr.push(n):Ea.push(n),n.observers&&PB(n))}}function Qy(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),r=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Qy(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function G0e(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function jT(t,e=zt){throw G0e(t)}function UT(t){if(typeof t=="function"&&!t.length)return UT(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const r=UT(t[n]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return e}return t}function W0e(t,e){return function(r){let i;return Pn(()=>i=Xi(()=>(zt.context={...zt.context,[t]:r.value},IB(()=>r.children))),void 0),i}}const V0e=Symbol("fallback");function MB(t){for(let e=0;e<t.length;e++)t[e]()}function Y0e(t,e,n={}){let r=[],i=[],s=[],o=0,u=e.length>1?[]:null;return np(()=>MB(s)),()=>{let a=t()||[],l,c;return a[$T],Xi(()=>{let x=a.length,d,p,m,g,y,E,v,_,A;if(x===0)o!==0&&(MB(s),s=[],r=[],i=[],o=0,u&&(u=[])),n.fallback&&(r=[V0e],i[0]=ep(S=>(s[0]=S,n.fallback())),o=1);else if(o===0){for(i=new Array(x),c=0;c<x;c++)r[c]=a[c],i[c]=ep(f);o=x}else{for(m=new Array(x),g=new Array(x),u&&(y=new Array(x)),E=0,v=Math.min(o,x);E<v&&r[E]===a[E];E++);for(v=o-1,_=x-1;v>=E&&_>=E&&r[v]===a[_];v--,_--)m[_]=i[v],g[_]=s[v],u&&(y[_]=u[v]);for(d=new Map,p=new Array(_+1),c=_;c>=E;c--)A=a[c],l=d.get(A),p[c]=l===void 0?-1:l,d.set(A,c);for(l=E;l<=v;l++)A=r[l],c=d.get(A),c!==void 0&&c!==-1?(m[c]=i[l],g[c]=s[l],u&&(y[c]=u[l]),c=p[c],d.set(A,c)):s[l]();for(c=E;c<x;c++)c in m?(i[c]=m[c],s[c]=g[c],u&&(u[c]=y[c],u[c](c))):i[c]=ep(f);i=i.slice(0,o=x),r=a.slice(0)}return i});function f(x){if(s[c]=x,u){const[d,p]=dr(c);return u[c]=p,e(a[c],d)}return e(a[c])}}}function Ge(t,e){return Xi(()=>t(e||{}))}function Gy(){return!0}const X0e={get(t,e,n){return e===Ko?n:t.get(e)},has(t,e){return e===Ko?!0:t.has(e)},set:Gy,deleteProperty:Gy,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:Gy,deleteProperty:Gy}},ownKeys(t){return t.keys()}};function qT(t){return(t=typeof t=="function"?t():t)?t:{}}function J0e(){for(let t=0,e=this.length;t<e;++t){const n=this[t]();if(n!==void 0)return n}}function Zo(...t){let e=!1;for(let o=0;o<t.length;o++){const u=t[o];e=e||!!u&&Ko in u,t[o]=typeof u=="function"?(e=!0,Fn(u)):u}if(e)return new Proxy({get(o){for(let u=t.length-1;u>=0;u--){const a=qT(t[u])[o];if(a!==void 0)return a}},has(o){for(let u=t.length-1;u>=0;u--)if(o in qT(t[u]))return!0;return!1},keys(){const o=[];for(let u=0;u<t.length;u++)o.push(...Object.keys(qT(t[u])));return[...new Set(o)]}},X0e);const n={},r=Object.create(null);for(let o=t.length-1;o>=0;o--){const u=t[o];if(!u)continue;const a=Object.getOwnPropertyNames(u);for(let l=a.length-1;l>=0;l--){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const f=Object.getOwnPropertyDescriptor(u,c);if(!r[c])r[c]=f.get?{enumerable:!0,configurable:!0,get:J0e.bind(n[c]=[f.get.bind(u)])}:f.value!==void 0?f:void 0;else{const x=n[c];x&&(f.get?x.push(f.get.bind(u)):f.value!==void 0&&x.push(()=>f.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const u=s[o],a=r[u];a&&a.get?Object.defineProperty(i,u,a):i[u]=a?a.value:void 0}return i}const jB=t=>`Stale read from <${t}>.`;function Yn(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Fn(Y0e(()=>t.each,t.children,e||void 0))}function Or(t){const e=t.keyed,n=Fn(()=>t.when,void 0,{equals:(r,i)=>e?r===i:!r==!i});return Fn(()=>{const r=n();if(r){const i=t.children;return typeof i=="function"&&i.length>0?Xi(()=>i(e?r:()=>{if(!Xi(n))throw jB("Show");return t.when})):i}return t.fallback},void 0,void 0)}function UB(t){let e=!1;const n=(s,o)=>(e?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],r=IB(()=>t.children),i=Fn(()=>{let s=r();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const u=s[o].when;if(u)return e=!!s[o].keyed,[o,u,s[o]]}return[-1]},void 0,{equals:n});return Fn(()=>{const[s,o,u]=i();if(s<0)return t.fallback;const a=u.children;return typeof a=="function"&&a.length>0?Xi(()=>a(e?o:()=>{if(Xi(i)[0]!==s)throw jB("Match");return u.when})):a},void 0,void 0)}function Wy(t){return t}function K0e(t,e,n){let r=n.length,i=e.length,s=r,o=0,u=0,a=e[i-1].nextSibling,l=null;for(;o<i||u<s;){if(e[o]===n[u]){o++,u++;continue}for(;e[i-1]===n[s-1];)i--,s--;if(i===o){const c=s<r?u?n[u-1].nextSibling:n[s-u]:a;for(;u<s;)t.insertBefore(n[u++],c)}else if(s===u)for(;o<i;)(!l||!l.has(e[o]))&&e[o].remove(),o++;else if(e[o]===n[s-1]&&n[u]===e[i-1]){const c=e[--i].nextSibling;t.insertBefore(n[u++],e[o++].nextSibling),t.insertBefore(n[--s],c),e[i]=n[s]}else{if(!l){l=new Map;let f=u;for(;f<s;)l.set(n[f],f++)}const c=l.get(e[o]);if(c!=null)if(u<c&&c<s){let f=o,x=1,d;for(;++f<i&&f<s&&!((d=l.get(e[f]))==null||d!==c+x);)x++;if(x>c-u){const p=e[o];for(;u<c;)t.insertBefore(n[u++],p)}else t.replaceChild(n[u++],e[o++])}else o++;else e[o++].remove()}}}const qB="_$DX_DELEGATE";function mt(t,e,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=t,n?o.content.firstChild.firstChild:o.content.firstChild},s=e?()=>Xi(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return s.cloneNode=s,s}function zT(t,e=window.document){const n=e[qB]||(e[qB]=new Set);for(let r=0,i=t.length;r<i;r++){const s=t[r];n.has(s)||(n.add(s),e.addEventListener(s,Z0e))}}function Ji(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function zB(t,e,n,r){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function wc(t,e,n){if(!e)return n?Ji(t,"style"):e;const r=t.style;if(typeof e=="string")return r.cssText=e;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),e||(e={});let i,s;for(s in n)e[s]==null&&r.removeProperty(s),delete n[s];for(s in e)i=e[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function lo(t,e,n){return Xi(()=>t(e,n))}function Xe(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return Vy(t,e,r,n);Pn(i=>Vy(t,e(),i,n),r)}function Z0e(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const i=n[`${e}Data`];if(i!==void 0?r.call(n,i,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Vy(t,e,n,r,i){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,o=r!==void 0;if(t=o&&n[0]&&n[0].parentNode||t,s==="string"||s==="number")if(s==="number"&&(e=e.toString()),o){let u=n[0];u&&u.nodeType===3?u.data!==e&&(u.data=e):u=document.createTextNode(e),n=Vx(t,n,r,u)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||s==="boolean")n=Vx(t,n,r);else{if(s==="function")return Pn(()=>{let u=e();for(;typeof u=="function";)u=u();n=Vy(t,u,n,r)}),()=>n;if(Array.isArray(e)){const u=[],a=n&&Array.isArray(n);if(HT(u,e,n,i))return Pn(()=>n=Vy(t,u,n,r,!0)),()=>n;if(u.length===0){if(n=Vx(t,n,r),o)return n}else a?n.length===0?HB(t,u,r):K0e(t,n,u):(n&&Vx(t),HB(t,u));n=u}else if(e.nodeType){if(Array.isArray(n)){if(o)return n=Vx(t,n,r,e);Vx(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function HT(t,e,n,r){let i=!1;for(let s=0,o=e.length;s<o;s++){let u=e[s],a=n&&n[t.length],l;if(!(u==null||u===!0||u===!1))if((l=typeof u)=="object"&&u.nodeType)t.push(u);else if(Array.isArray(u))i=HT(t,u,a)||i;else if(l==="function")if(r){for(;typeof u=="function";)u=u();i=HT(t,Array.isArray(u)?u:[u],Array.isArray(a)?a:[a])||i}else t.push(u),i=!0;else{const c=String(u);a&&a.nodeType===3&&a.data===c?t.push(a):t.push(document.createTextNode(c))}}return i}function HB(t,e,n=null){for(let r=0,i=e.length;r<i;r++)t.insertBefore(e[r],n)}function Vx(t,e,n,r){if(n===void 0)return t.textContent="";const i=r||document.createTextNode("");if(e.length){let s=!1;for(let o=e.length-1;o>=0;o--){const u=e[o];if(i!==u){const a=u.parentNode===t;!s&&!o?a?t.replaceChild(i,u):t.insertBefore(i,n):a&&u.remove()}else s=!0}}else t.insertBefore(i,n);return[i]}const ece="http://www.w3.org/2000/svg";function tce(t,e=!1){return e?document.createElementNS(ece,t):document.createElement(t)}function nce(t){const{useShadow:e}=t,n=document.createTextNode(""),r=()=>t.mount||document.body,i=LB();let s,o=!!k0e.context;return ws(()=>{s||(s=q0e(i,()=>Fn(()=>t.children)));const u=r();if(u instanceof HTMLHeadElement){const[a,l]=dr(!1),c=()=>l(!0);ep(f=>Xe(u,()=>a()?f():s(),null)),np(c)}else{const a=tce(t.isSVG?"g":"div",t.isSVG),l=e&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),Xe(l,s),u.appendChild(a),t.ref&&t.ref(a),np(()=>u.removeChild(a))}},void 0,{render:!o}),n}function rce(t){const e=Object.keys(t),n={};for(let r=0;r<e.length;r++){const[i,s]=dr(t[e[r]]);Object.defineProperty(n,e[r],{get:i,set(o){s(()=>o)}})}return n}function ice(t){if(t.assignedSlot&&t.assignedSlot._$owner)return t.assignedSlot._$owner;let e=t.parentNode;for(;e&&!e._$owner&&!(e.assignedSlot&&e.assignedSlot._$owner);)e=e.parentNode;return e&&e.assignedSlot?e.assignedSlot._$owner:t._$owner}function QB(t){return(e,n)=>{const{element:r}=n;return ep(i=>{const s=rce(e);r.addPropertyChangedCallback((u,a)=>s[u]=a),r.addReleaseCallback(()=>{r.renderRoot.textContent="",i()});const o=t(s,n);return Xe(r.renderRoot,o)},ice(r))}}var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function sce(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var GB={},Yx={},at={},ut={},va={};Object.defineProperty(va,"__esModule",{value:!0}),va.isNotUndefined=va.locationContainsPosition=void 0;function oce(t,e){return t.range.start.line<=e.line&&t.range.end.line>=e.line&&(e.line!==t.range.start.line||e.character>=t.range.start.character)&&(e.line!==t.range.end.line||e.character<=t.range.end.character)}va.locationContainsPosition=oce;function uce(t){return t!==void 0}va.isNotUndefined=uce;var Je={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isBaseTable=t.isSourceDef=t.sourceBase=t.isSegmentSQL=t.isIndexSegment=t.isRawSegment=t.isSamplingEnable=t.isSamplingPercent=t.isSamplingRows=t.isQuerySegment=t.isProjectSegment=t.isPartialSegment=t.isReduceSegment=t.structHasErrors=t.segmentHasErrors=t.refIsStructDef=t.ValueType=t.isExtractUnit=t.isTimestampUnit=t.isDateUnit=t.isJoinedSource=t.isJoined=t.isJoinable=t.isMatrixOperation=t.isScalarArray=t.isRepeatedRecord=t.mkArrayDef=t.mkFieldDef=t.fieldIsIntrinsic=t.isCastType=t.canOrderBy=t.isAtomicFieldType=t.isTemporalType=t.hasExpression=t.maxOfExpressionTypes=t.maxExpressionType=t.isExpressionTypeLEQ=t.expressionIsAnalytic=t.expressionIsCalculation=t.expressionInvolvesAggregate=t.expressionIsUngroupedAggregate=t.expressionIsAggregate=t.expressionIsScalar=t.paramHasValue=t.isRawCast=t.mkTemporal=t.isAsymmetricExpr=t.exprIsLeaf=t.exprHasE=t.exprHasKids=void 0,t.TD=t.isValueDate=t.isValueTimestamp=t.isValueBoolean=t.isValueNumber=t.isValueString=t.isAtomic=t.isTurtle=t.getIdentifier=t.isLeafAtomic=t.mergeEvalSpaces=t.isLiteral=void 0;function e(z){return"kids"in z}t.exprHasKids=e;function n(z){return"e"in z}t.exprHasE=n;function r(z){return!(e(z)||n(z))}t.exprIsLeaf=r;function i(z){return z.node==="aggregate"&&["sum","avg","count","distinct"].includes(z.function)}t.isAsymmetricExpr=i;function s(z){return z.node!=="arrayLiteral"&&z.node!=="recordLiteral"}function o(z,de){const fe=typeof de=="string"?{type:de}:de;return s(z)?{...z,typeDef:{...fe}}:z}t.mkTemporal=o;function u(z){return"dstSQLType"in z}t.isRawCast=u;function a(z){return z.value!==null}t.paramHasValue=a;function l(z){return z===void 0||z==="scalar"}t.expressionIsScalar=l;function c(z){return z==="aggregate"||z==="ungrouped_aggregate"}t.expressionIsAggregate=c;function f(z){return z==="ungrouped_aggregate"}t.expressionIsUngroupedAggregate=f;function x(z){return z==="aggregate"||z==="ungrouped_aggregate"||z==="aggregate_analytic"}t.expressionInvolvesAggregate=x;function d(z){return z==="aggregate"||z==="scalar_analytic"||z==="aggregate_analytic"||z==="ungrouped_aggregate"}t.expressionIsCalculation=d;function p(z){return z==="aggregate_analytic"||z==="scalar_analytic"}t.expressionIsAnalytic=p;function m(z){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[z]}function g(z,de){return z===de||m(z)<m(de)}t.isExpressionTypeLEQ=g;function y(z,de){let fe="scalar";return(z==="aggregate"||de==="aggregate")&&(fe="aggregate"),(z==="ungrouped_aggregate"||de==="ungrouped_aggregate")&&(fe="ungrouped_aggregate"),(z==="scalar_analytic"||de==="scalar_analytic")&&(fe="scalar_analytic"),(z==="aggregate_analytic"||de==="aggregate_analytic")&&(fe="aggregate_analytic"),(z==="scalar_analytic"&&de==="aggregate"||z==="aggregate"&&de==="scalar_analytic")&&(fe="aggregate_analytic"),fe}t.maxExpressionType=y;function E(z){return z.reduce(y,"scalar")}t.maxOfExpressionTypes=E;function v(z){return"e"in z}t.hasExpression=v;function _(z){return z==="date"||z==="timestamp"}t.isTemporalType=_;function A(z){return["string","number","date","timestamp","boolean","json","sql native","record","array","error"].includes(z)}t.isAtomicFieldType=A;function S(z){return["string","number","date","boolean","date","timestamp"].includes(z)}t.canOrderBy=S;function b(z){return["string","number","date","timestamp","boolean","json"].includes(z)}t.isCastType=b;function C(z){return A(z.type)&&!v(z)}t.fieldIsIntrinsic=C;function w(z,de,fe){if(M(z))return I(z.elementTypeDef,de,fe);if(F(z)){const{type:K,fields:ee,elementTypeDef:Oe}=z;return{type:K,fields:ee,elementTypeDef:Oe,join:"many",name:de,dialect:fe}}if(z.type==="record"){const{type:K,fields:ee}=z;return{type:K,fields:ee,join:"one",dialect:fe,name:de}}return{...z,name:de}}t.mkFieldDef=w;function I(z,de,fe){if(z.type==="record")return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:{type:"record_element"},fields:z.fields};const K=w(z,"value",fe);return{type:"array",join:"many",name:de,dialect:fe,elementTypeDef:z,fields:[K,{...K,name:"each",e:{node:"field",path:["value"]}}]}}t.mkArrayDef=I;function F(z){return z.type==="array"&&z.elementTypeDef.type==="record_element"}t.isRepeatedRecord=F;function M(z){return z.type==="array"&&z.elementTypeDef.type!=="record_element"}t.isScalarArray=M;function U(z){return["left","right","full","inner"].includes(z)}t.isMatrixOperation=U;function X(z){return["composite","table","sql_select","query_source","array","record"].includes(z.type)}t.isJoinable=X;function W(z){return"join"in z}t.isJoined=W;function ae(z){return j(z)&&W(z)}t.isJoinedSource=ae;function ge(z){return["day","week","month","quarter","year"].includes(z)}t.isDateUnit=ge;function he(z){return ge(z)||["hour","minute","second"].includes(z)}t.isTimestampUnit=he;function ue(z){return he(z)||z==="day_of_week"||z==="day_of_year"}t.isExtractUnit=ue;var ce;(function(z){z.Date="date",z.Timestamp="timestamp",z.Number="number",z.String="string"})(ce||(t.ValueType=ce={}));function ie(z){return typeof z!="string"}t.refIsStructDef=ie;function re(z){return!!((z.type==="reduce"||z.type==="project"||z.type==="partial")&&(z.extendSource&&z.extendSource.some(de=>de.type==="error")||z.queryFields.some(de=>de.type==="error")))}t.segmentHasErrors=re;function R(z){return z.fields.some(de=>de.type==="error")}t.structHasErrors=R;function O(z){return z.type==="reduce"}t.isReduceSegment=O;function D(z){return z.type==="partial"}t.isPartialSegment=D;function k(z){return z.type==="project"}t.isProjectSegment=k;function G(z){return k(z)||O(z)}t.isQuerySegment=G;function q(z){return z.rows!==void 0}t.isSamplingRows=q;function N(z){return z.percent!==void 0}t.isSamplingPercent=N;function B(z){return z.enable!==void 0}t.isSamplingEnable=B;function P(z){return z.type==="raw"}t.isRawSegment=P;function Q(z){return z.type==="index"}t.isIndexSegment=Q;function $(z){return"sql"in z}t.isSegmentSQL=$;function H(z){return{...z}}t.sourceBase=H;function j(z){return z.type==="table"||z.type==="sql_select"||z.type==="query_source"||z.type==="query_result"||z.type==="finalize"||z.type==="nest_source"||z.type==="composite"}t.isSourceDef=j;function J(z){return ae(z)?!1:!!j(z)}t.isBaseTable=J;function xe(z){return z==="literal"}t.isLiteral=xe;function se(...z){return z.length<=1&&z.every(de=>de==="literal")?"literal":z.every(de=>de==="constant"||de==="literal")?"constant":z.every(de=>de==="output"||de==="constant"||de==="literal")?"output":"input"}t.mergeEvalSpaces=se;function Z(z){return z.type==="string"||_(z.type)||z.type==="number"||z.type==="boolean"||z.type==="json"||z.type==="sql native"||z.type==="error"}t.isLeafAtomic=Z;function oe(z){return z.as!==void 0?z.as:z.name}t.getIdentifier=oe;function we(z){return z.type==="turtle"}t.isTurtle=we;function ke(z){return A(z.type)}t.isAtomic=ke;function ze(z,de){return de.type==="string"}t.isValueString=ze;function V(z,de){return de.type==="number"}t.isValueNumber=V;function ne(z,de){return de.type==="boolean"}t.isValueBoolean=ne;function Te(z,de){return de.type==="timestamp"}t.isValueTimestamp=Te;function Me(z,de){return de.type==="date"}t.isValueDate=Me,t.TD={isAtomic(z){return z!==void 0&&A(z.type)},isLeafAtomic(z){return z!==void 0&&Z({type:z.type})},isString:z=>(z==null?void 0:z.type)==="string",isNumber:z=>(z==null?void 0:z.type)==="number",isBoolean:z=>(z==null?void 0:z.type)==="boolean",isJSON:z=>(z==null?void 0:z.type)==="json",isSQL:z=>(z==null?void 0:z.type)==="sql native",isDate:z=>(z==null?void 0:z.type)==="date",isTimestamp:z=>(z==null?void 0:z.type)==="timestamp",isTemporal(z){var de;const fe=(de=z==null?void 0:z.type)!==null&&de!==void 0?de:"";return _(fe)},isError:z=>(z==null?void 0:z.type)==="error",eq(z,de){if(z===void 0||de===void 0)return!1;function fe(K,ee){const Oe={};for(const Y of K.fields||[])if(Y.name)Oe[Y.name]=Y;else return!1;for(const Y of ee.fields||[])if(!t.TD.eq(Oe[Y.name],Y))return!1;return!0}return z.type==="array"&&de.type==="array"?z.elementTypeDef.type!==de.elementTypeDef.type?!1:z.elementTypeDef.type!=="record_element"&&de.elementTypeDef.type!=="record_element"?t.TD.eq(z.elementTypeDef,de.elementTypeDef):fe(z,de):z.type==="record"&&de.type==="record"?fe(z,de):z.type==="sql native"&&de.type==="sql native"?z.rawType!==void 0&&z.rawType===de.rawType:z.type===de.type}}})(Je),Object.defineProperty(ut,"__esModule",{value:!0}),ut.compositeFieldUsageJoinPaths=ut.joinedCompositeFieldUsage=ut.compositeFieldUsageDifference=ut.emptyCompositeFieldUsage=ut.mergeCompositeFieldUsage=ut.unique=ut.formatCompositeFieldUsage=ut.compositeFieldUsageIsPlural=ut.isEmptyCompositeFieldUsage=ut.formatCompositeFieldUsages=ut.compositeFieldUsagePaths=ut.resolveCompositeSources=ut.narrowCompositeFieldResolution=ut.emptyNarrowedCompositeFieldResolution=void 0;const WB=va,QT=Je;function Xy(t,e,n,r=void 0){var i,s,o,u,a,l,c;let f={...e},x;const d=gce(e);if(n.fields.length>0||e.type==="composite")if(e.type==="composite"){let g=!1;x=(i=r==null?void 0:r.source)!==null&&i!==void 0?i:e.sources.map(E=>({source:E,nested:void 0}));const y=[...x];e:for(const{source:E,nested:v}of x){const _=new Set;for(const A of E.fields)_.add((s=A.as)!==null&&s!==void 0?s:A.name);for(const A of n.fields)if(!_.has(A)){y.shift();continue e}if(E.type==="composite"){const A=Xy(t,E,mce(n,E),{source:v??E.sources.map(S=>({source:S,nested:[]})),joined:{}});if("error"in A){y.shift();continue e}f={...A.success},y[0]={source:E,nested:A.narrowedCompositeFieldResolution.source}}else f={...E};g=!0,f={...f,fields:[...d,...f.fields],filterList:[...(o=e.filterList)!==null&&o!==void 0?o:[],...(u=f.filterList)!==null&&u!==void 0?u:[]]};break}if(!g)return{error:{code:"no_suitable_composite_source_input",data:{fields:n.fields,path:t}}};x=y}else return{error:{code:"not_a_composite_source",data:{path:t}}};const p={},m=(a=r==null?void 0:r.joined)!==null&&a!==void 0?a:{};for(const g of f.fields)p[(l=g.as)!==null&&l!==void 0?l:g.name]=g;for(const[g,y]of Object.entries(n.joinedUsage)){const E=p[g],v=[...t,g];if(E===void 0)return{error:{code:"composite_source_not_defined",data:{path:v}}};if((0,QT.isJoined)(E)){if(!(0,QT.isSourceDef)(E))continue}else return{error:{code:"composite_source_not_a_join",data:{path:v}}};const _=Xy(v,E,y,m[g]);if("error"in _)return _;if(!(0,QT.isJoinable)(_.success))return{error:{code:"composite_source_is_not_joinable",data:{path:v}}};p[g]={..._.success,join:E.join,as:(c=E.as)!==null&&c!==void 0?c:E.name,onExpression:E.onExpression},m[g]=_.narrowedCompositeFieldResolution}return{success:{...f,fields:Object.values(p)},narrowedCompositeFieldResolution:{source:x,joined:m}}}function ace(){return{source:void 0,joined:{}}}ut.emptyNarrowedCompositeFieldResolution=ace;function lce(t,e,n){const r=Xy([],t,e,n);return"success"in r?{narrowedCompositeFieldResolution:r.narrowedCompositeFieldResolution,error:void 0}:{narrowedCompositeFieldResolution:void 0,error:r.error}}ut.narrowCompositeFieldResolution=lce;function cce(t,e){const n=Xy([],t,e);return"success"in n?{sourceDef:n.success,error:void 0}:{sourceDef:void 0,error:n.error}}ut.resolveCompositeSources=cce;function GT(t){return[...t.fields.map(e=>[e]),...Object.entries(t.joinedUsage).map(([e,n])=>GT(n).map(r=>[e,...r])).flat()]}ut.compositeFieldUsagePaths=GT;function fce(t){return GT(t).map(e=>VB(e)).join(", ")}ut.formatCompositeFieldUsages=fce;function WT(t){return Object.values(t.joinedUsage).reduce((e,n)=>e+WT(n),t.fields.length)}function xce(t){return WT(t)===0}ut.isEmptyCompositeFieldUsage=xce;function dce(t){return WT(t)>1}ut.compositeFieldUsageIsPlural=dce;function VB(t){return`\`${t.join(".")}\``}ut.formatCompositeFieldUsage=VB;function YB(t){return Array.from(new Set(t))}ut.unique=YB;function XB(...t){const e=t.filter(WB.isNotUndefined),n=new Set(e.map(i=>Object.keys(i.joinedUsage)).flat()),r={};for(const i of n)r[i]=XB(...e.map(s=>s==null?void 0:s.joinedUsage[i]).filter(WB.isNotUndefined));return{fields:YB(e.map(i=>i.fields).flat()),joinedUsage:r}}ut.mergeCompositeFieldUsage=XB;function hce(){return{fields:[],joinedUsage:{}}}ut.emptyCompositeFieldUsage=hce;function pce(t,e){const n=new Set(e),r=[];for(const i of t)n.has(i)||r.push(i);return r}function JB(t,e){return{fields:pce(t.fields,e.fields),joinedUsage:Object.fromEntries(Object.entries(t.joinedUsage).map(([n,r])=>[n,n in e.joinedUsage?JB(r,e.joinedUsage[n]):r]))}}ut.compositeFieldUsageDifference=JB;function KB(t,e){return t.length===0?e:KB(t.slice(0,-1),{fields:[],joinedUsage:{[t[t.length-1]]:e}})}ut.joinedCompositeFieldUsage=KB;function ZB(t){const e=Object.keys(t.joinedUsage);return[...e.map(n=>[n]),...e.map(n=>ZB(t.joinedUsage[n]).map(r=>[n,...r])).flat()]}ut.compositeFieldUsageJoinPaths=ZB;function ek(t){var e;return"e"in t&&((e=t.e)===null||e===void 0?void 0:e.node)==="compositeField"}function gce(t){return t.fields.filter(e=>!ek(e))}function mce(t,e){var n;const r={};for(const i of e.fields)r[(n=i.as)!==null&&n!==void 0?n:i.name]=i;return{fields:t.fields.filter(i=>ek(r[i])),joinedUsage:t.joinedUsage}}Object.defineProperty(at,"__esModule",{value:!0}),at.expandOverrideMapFromBase=at.expandBlueprintMap=at.overload=at.minAnalytic=at.minAggregate=at.minScalar=at.maxAnalytic=at.maxUngroupedAggregate=at.anyExprType=at.maxAggregate=at.maxScalar=at.makeParam=at.param=at.variadicParam=at.literal=at.output=at.constant=at.sql=at.spread=at.arg=void 0;const yce=ut;function tk(t){return{node:"function_parameter",name:t}}at.arg=tk;function Ece(t,e=void 0,n=void 0){return{node:"spread",e:t,prefix:e,suffix:n}}at.spread=Ece;function vce(t,...e){const n={node:"genericSQLExpr",kids:{args:[]},src:[]},r=[...e];let i="";for(const s of t){i+=s;const o=r.shift();o!==void 0&&(typeof o=="string"?i+=o:(n.src.push(i),n.kids.args.push(o),i=""))}return i.length>0&&n.src.push(i),n}at.sql=vce;function VT(t){return{...t,evalSpace:"constant"}}at.constant=VT;function _ce(t){return{...t,evalSpace:"output"}}at.output=_ce;function YT(t){return{...t,evalSpace:"literal"}}at.literal=YT;function Ace(t,...e){return{name:t,isVariadic:!0,allowedTypes:e}}at.variadicParam=Ace;function nk(t,...e){return{name:t,isVariadic:!1,allowedTypes:e}}at.param=nk;function Sce(t,...e){return{param:nk(t,...e),arg:tk(t)}}at.makeParam=Sce;function Jy(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.maxScalar=Jy;function rk(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.maxAggregate=rk;function XT(t){return{type:t,expressionType:void 0,evalSpace:"input"}}at.anyExprType=XT;function bce(t){return{type:t,expressionType:"ungrouped_aggregate",evalSpace:"input"}}at.maxUngroupedAggregate=bce;function ik(t){return{type:t,expressionType:"aggregate_analytic",evalSpace:"input"}}at.maxAnalytic=ik;function Xx(t){return{type:t,expressionType:"scalar",evalSpace:"input"}}at.minScalar=Xx;function sk(t){return{type:t,expressionType:"aggregate",evalSpace:"input"}}at.minAggregate=sk;function ok(t){return{type:t,expressionType:"scalar_analytic",evalSpace:"input"}}at.minAnalytic=ok;function Cce(t,e,n,r){return{returnType:t,params:e,e:n,needsWindowOrderBy:r==null?void 0:r.needsWindowOrderBy,between:r==null?void 0:r.between,isSymmetric:r==null?void 0:r.isSymmetric,supportsOrderBy:r==null?void 0:r.supportsOrderBy,defaultOrderByArgIndex:r==null?void 0:r.defaultOrderByArgIndex,supportsLimit:r==null?void 0:r.supportsLimit}}at.overload=Cce;function Ns(t,e){if(typeof t=="string")return t;if(t.generic!==(e==null?void 0:e.name))throw new Error(`Cannot expand generic name ${t.generic}`);return e.type}function Tce(t,e){var n;let r;return typeof t=="string"?r=Xx(t):"generic"in t?r=Xx(Ns(t,e)):"literal"in t?r=YT(Xx(Ns(t.literal,e))):"constant"in t?r=VT(Xx(Ns(t.constant,e))):"dimension"in t?r=Xx(Ns(t.dimension,e)):"measure"in t?r=sk(Ns(t.measure,e)):r=ok(Ns(t.calculation,e)),{...r,compositeFieldUsage:(0,yce.emptyCompositeFieldUsage)(),expressionType:(n=r.expressionType)!==null&&n!==void 0?n:"scalar"}}function uk(t){return typeof t=="string"||"generic"in t||"literal"in t||"constant"in t||"dimension"in t||"measure"in t||"calculation"in t}function Oce(t){return uk(t)?[t]:Array.isArray(t)?t:uk(t.variadic)?[t.variadic]:t.variadic}function Rce(t,e){return typeof t=="string"?XT(t):"generic"in t?XT(Ns(t,e)):"literal"in t?YT(Jy(Ns(t.literal,e))):"constant"in t?VT(Jy(Ns(t.constant,e))):"dimension"in t?Jy(Ns(t.dimension,e)):"measure"in t?rk(Ns(t.measure,e)):ik(Ns(t.calculation,e))}function Dce(t,e){return t.map(n=>Rce(n,e))}function ak(t){return typeof t!="string"&&"variadic"in t}function wce(t,e,n){return{name:t,allowedTypes:Dce(Oce(e),n),isVariadic:ak(e)}}function Nce(t,e){return Object.entries(t).map(r=>wce(r[0],r[1],e))}function Fce(t){const e=[],n=[];let r=t;for(;r.length>0;){const s=r.indexOf("${");if(s===-1){e.push(r);break}const o=r.slice(0,s);r=r.slice(s);const u=r.indexOf("}");if(u===-1){e.push(o+r);break}const a=r.slice(2,u);r=r.slice(u+1);const l=a.startsWith("..."),c=a.endsWith(":"),f=l?a.slice(3):c?a.slice(0,-1):a,x={node:"function_parameter",name:f};e.push(o),l?n.push({node:"spread",e:x,prefix:"",suffix:""}):c&&f==="order_by"?n.push({node:"aggregate_order_by"}):c&&f==="limit"?n.push({node:"aggregate_limit"}):n.push(x)}return{node:"genericSQLExpr",kids:{args:n},src:e}}function Lce(t,e){return ak(e)?{node:"spread",e:{node:"function_parameter",name:t},prefix:"",suffix:""}:{node:"function_parameter",name:t}}function Ice(t,e){const n=Object.entries(e.takes),r=n.length>0?n.length-1:0;return{node:"genericSQLExpr",kids:{args:n.map(i=>Lce(i[0],i[1]))},src:[`${t}(`,...Array(r).fill(","),")"]}}function $ce(t){return"sql"in t.impl?Fce(t.impl.sql):"expr"in t.impl?t.impl.expr:Ice(t.impl.function,t)}function Bce(t){return{e:$ce(t),between:t.impl.between,needsWindowOrderBy:t.impl.needsWindowOrderBy,defaultOrderByArgIndex:t.impl.defaultOrderByArgIndex}}function lk(t,e){return{returnType:Tce(t.returns,e),params:Nce(t.takes,e),isSymmetric:t.isSymmetric,supportsOrderBy:t.supportsOrderBy,supportsLimit:t.supportsLimit,...Bce(t)}}function JT(t){if(t.generic!==void 0){const e=t.generic[0];return t.generic[1].map(n=>lk(t,{name:e,type:n}))}return[lk(t)]}function KT(t){return"takes"in t&&"returns"in t&&"impl"in t}function kce(t){return"function"in t||"sql"in t||"expr"in t}function Pce(t){return KT(t)?JT(t):Object.values(t).flatMap(e=>JT(e))}function Mce(t){const e={};for(const n in t)e[n]=Pce(t[n]);return e}at.expandBlueprintMap=Mce;function ck(t,e){return JT({...t,impl:e})}function jce(t,e,n){if(kce(n)){if(!KT(e))throw new Error(`Malformed function override: ${t}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(e)})`);return ck(e,n)}else{if(KT(e))throw new Error(`Malformed function override: ${t}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(n)})`);return Object.entries(n).flatMap(([r,i])=>{const s=e[r];if(s===void 0)throw new Error(`Malformed function override: ${t}. No overload named ${r}`);return ck(s,i)})}}function Uce(t,e){const n={};for(const r in e){if(!(r in t))throw new Error(`Malformed function override: ${r}. No such function in Malloy standard`);n[r]=jce(r,t[r],e[r])}return n}at.expandOverrideMapFromBase=Uce;var Bl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Dialect=t.qtz=t.inDays=t.dayIndex=t.isDialectFieldStruct=void 0;const e=Je;function n(u){return u.type==="struct"}t.isDialectFieldStruct=n;const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];t.dayIndex=r.indexOf("day");function i(u){return r.indexOf(u)>=t.dayIndex}t.inDays=i;function s(u){const a=u.queryTimezone;if(!(a===void 0||a===u.systemTimezone))return a}t.qtz=s;class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.supportsCountApprox=!1,this.supportsFullJoin=!0,this.nativeBoolean=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0}sqlFinalStage(a,l){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(a){return this.castToString(`DATE(${a})`)}sqlLiteralNumber(a){return a}ignoreInProject(a){return!1}exprToSQL(a,l){switch(l.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(l);case"delta":return this.sqlAlterTimeExpr(l);case"trunc":return this.sqlTruncExpr(a,l);case"extract":return this.sqlTimeExtractExpr(a,l);case"cast":return this.sqlCast(a,l);case"regexpMatch":return this.sqlRegexpMatch(l);case"/":return this.divisionIsInteger?`${l.kids.left.sql}*1.0/${l.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${l.kids.left.sql},${l.kids.right.sql})`;case"timeLiteral":return this.sqlLiteralTime(a,l);case"stringLiteral":return this.sqlLiteralString(l.literal);case"numberLiteral":return this.sqlLiteralNumber(l.literal);case"regexpLiteral":return this.sqlLiteralRegexp(l.literal);case"recordLiteral":return this.sqlLiteralRecord(l);case"arrayLiteral":return this.sqlLiteralArray(l)}}sqlSumDistinct(a,l,c){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(a,l,c){return"sqlAggDistinct called but not implemented"}sqlSampleTable(a,l){if(l!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return a}sqlOrderBy(a){return`ORDER BY ${a.join(",")}`}sqlTzStr(a){return`"${a.queryTimezone}"`}sqlMakeUnnestKey(a,l){return this.concat(a,"'x'",l)}sqlStringAggDistinct(a,l,c){const f="__STRING_AGG_KS__",x="__STRING_AGG_KE__";return`REGEXP_REPLACE(
2
2
  STRING_AGG(DISTINCT ${`concat('${f}', ${a}, '${x}', ${l})`}${c.length>0?","+c:""}),
3
3
  '${f}.*?${x}',
4
4
  ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.222-dev241212021944",
3
+ "version": "0.0.222-dev241212154316",
4
4
  "license": "MIT",
5
5
  "main": "dist/module/index.umd.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "build-types": "tsc --build --declaration --emitDeclarationOnly"
31
31
  },
32
32
  "dependencies": {
33
- "@malloydata/malloy": "^0.0.222-dev241212021944",
33
+ "@malloydata/malloy": "^0.0.222-dev241212154316",
34
34
  "@tanstack/solid-virtual": "^3.10.4",
35
35
  "component-register": "^0.8.6",
36
36
  "lodash": "^4.17.20",