@milaboratories/pl-model-common 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"data_types.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/data_types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,QAAM,CAAC;AACjC,eAAO,MAAM,cAAc,QAAM,CAAC;AAClC,eAAO,MAAM,cAAc,MAAO,CAAC;AACnC,eAAO,MAAM,aAAa,MAAO,CAAC;AAElC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,MAAM,GACd,SAAS,GACT,UAAU,GAIV,YAAY,GACZ,WAAW,CAAC;AAEhB,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,OAA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2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpE,mCAAmC;AACnC,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,IAAI,YAAY,CAExE;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,eAAoB,GACzB,WAAW,CAwBb;AAED,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG;IACxB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var G=Object.defineProperty;var Q=(n,t,e)=>t in n?G(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var p=(n,t,e)=>Q(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("canonicalize"),m=require("zod");function Y(n){return n!==void 0&&n.startsWith("log+live://log/")}function x(n){throw new Error("Unexpected object: "+n)}const V="upload://upload/",E="index://index/";function C(n){return n.startsWith(V)}function O(n){return n.startsWith(E)}function D(n){if(O(n)){const t=n.slice(E.length);return JSON.parse(decodeURIComponent(t)).path}else if(C(n)){const t=n.slice(V.length);return JSON.parse(decodeURIComponent(t)).localPath}x(n)}function Z(n){return n.replace(/^.*[\\/]/,"")}function nn(n){return Z(D(n))}function tn(n){if(!n||typeof n!="object")return!1;const t=n;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&t.data!==void 0&&typeof t.data=="object";case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";default:return!1}}function en(n,t){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const e={};for(const[r,o]of Object.entries(n.parts))e[r]=t(o);return{...n,parts:e}}case"BinaryPartitioned":{const e={};for(const[r,o]of Object.entries(n.parts))e[r]={index:t(o.index),values:t(o.values)};return{...n,parts:e}}}}function rn(n){if(!n||typeof n!="object")return!1;const t=n;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&Array.isArray(t.data);case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);default:return!1}}function on(n){switch(n.type){case"Json":{const t=Object.entries(n.data).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"Json",keyLength:n.keyLength,data:t}}case"JsonPartitioned":{const t=Object.entries(n.parts).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t=Object.entries(n.parts).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}}}function an(n){switch(n.type){case"Json":{const t={};for(const e of n.data)t[JSON.stringify(e.key)]=e.value;return{type:"Json",keyLength:n.keyLength,data:t}}case"JsonPartitioned":{const t={};for(const e of n.parts)t[JSON.stringify(e.key)]=e.value;return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t={};for(const e of n.parts)t[JSON.stringify(e.key)]=e.value;return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}}}function sn(n,t){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const e=n.parts.map(r=>({key:r.key,value:t(r.value)}));return{...n,parts:e}}case"BinaryPartitioned":{const e=n.parts.map(r=>({key:r.key,value:{index:t(r.value.index),values:t(r.value.values)}}));return{...n,parts:e}}}}const J=-2147483648,g=-9007199254740991n,L=NaN,$=NaN,F=null,j=null;function h(n,t){switch(t){case"Int":return n===J;case"Long":return n===Number(g)||n===g;case"Float":return n===L;case"Double":return n===$;case"String":return n===F;case"Bytes":return n===j;default:throw Error(`unsupported data type: ${t}`)}}function un(n){if(!B(n))throw new Error(`Expected not-NA PValue, got ${n}`);return n}function B(n,t){if(!t)return typeof n=="string"||typeof n=="number"&&isFinite(n)||typeof n=="bigint";if(h(n,t))return!1;switch(t){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${t}`)}}function U(n,t){if(!t)return n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint";if(h(n,t))return!0;switch(t){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${t}`)}}function cn(n){if(n===null||typeof n=="string"||typeof n=="number")return n;if(typeof n=="bigint")return{bigint:n.toString()};throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`)}function R(n,t){if(n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint"){if(t&&!h(n,t)&&!U(n,t))throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);return n}if(typeof n=="object"&&n!==null&&"bigint"in n&&typeof n.bigint=="string"){if(t&&t!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${t}`);return BigInt(n.bigint)}throw new Error(`Unsupported type ${typeof n} (value ${n}).`)}function fn(n){if(n=T(n),n===null)throw new Error("Value is null");return n}function T(n){if(n=R(n),n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"){if(!isFinite(n))throw new Error(`Value is not finite (${n})`);return n}if(typeof n=="bigint")return Number(n);throw new Error(`Unexpected value type: ${typeof n}`)}function K(n,t){const e=Math.floor(t/8),r=1<<7-t%8;return(n[e]&r)>0}const v={type:"absent"},H=null;function dn(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function ln(n,t,e={}){if(K(n.absent,t))return e.absent===void 0?v:e.absent;const r=n.data[t],o=n.type;if(h(r,o))return e.na===void 0?H:e.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function l(n){const{type:t,name:e,domain:r}=n;return{type:t,name:e,...r&&{domain:r}}}function pn(n){return n.map(l)}function mn(n){return A(l(n))}function yn(n,t){if(n===void 0)return t===void 0;if(t===void 0)return!0;for(const e in t)if(n[e]!==t[e])return!1;return!0}function M(n,t){return n.name===t.name&&yn(n.domain,t.domain)}function hn(n,t){return{...n,src:y(n.src,t)}}function y(n,t){switch(n.type){case"column":return{type:"column",column:t(n.column)};case"inner":case"full":return{type:n.type,entries:n.entries.map(e=>y(e,t))};case"outer":return{type:"outer",primary:y(n.primary,t),secondary:n.secondary.map(e=>y(e,t))};default:x(n)}}function _(n){return A(n)}function bn(n){return JSON.parse(n)}function S(n){return A(l(n))}function I(n,t){return JSON.stringify([n,t])}class gn{constructor(t){p(this,"domains",new Map);p(this,"axes",new Map);p(this,"domainPacks",[]);p(this,"domainPackToAnchor",new Map);this.anchors=t;const e=Object.entries(t);e.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of e){for(let i=0;i<o.axesSpec.length;i++){const s=o.axesSpec[i],a=S(s);this.axes.set(a,{anchor:r,idx:i})}if(o.domain!==void 0){const i=Object.entries(o.domain);i.sort((s,a)=>s[0].localeCompare(a[0])),this.domainPackToAnchor.set(JSON.stringify(i),r),this.domainPacks.push(i.map(([s])=>s));for(const[s,a]of i){const u=I(s,a);this.domains.set(u,r)}}}}derive(t,e){const r={name:t.name,axes:[]};let o;if(t.domain!==void 0)n:for(const s of this.domainPacks){const a=[];for(const c of s){const d=t.domain[c];if(d!==void 0)a.push([c,d]);else break n}const u=this.domainPackToAnchor.get(JSON.stringify(a));if(u!==void 0){r.domainAnchor=u,o=new Set(s);break}}for(const[s,a]of Object.entries(t.domain??{})){if(o!==void 0&&o.has(s))continue;const u=I(s,a),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[s]=c?{anchor:c}:a}if(r.axes=t.axesSpec.map(s=>{const a=S(s);return this.axes.get(a)??s}),!e||e.length===0)return r;const i=[];for(const s of e){const[a,u]=s;if(typeof a=="number"){if(a<0||a>=t.axesSpec.length)throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length-1})`);i.push([a,u])}else{const c=t.axesSpec.findIndex(d=>d.name===a);if(c===-1)throw new Error(`Axis with name "${a}" not found in the column specification`);i.push([c,u])}}return i.sort((s,a)=>s[0]-a[0]),{source:r,axisFilters:i}}deriveS(t,e){return _(this.derive(t,e))}}function Pn(n,t){const e={...t};if(e.domainAnchor!==void 0){const r=n[e.domainAnchor];if(!r)throw new Error(`Anchor "${e.domainAnchor}" not found`);const o=r.domain||{};e.domain={...o,...e.domain},delete e.domainAnchor}if(e.domain){const r={};for(const[o,i]of Object.entries(e.domain))if(typeof i=="string")r[o]=i;else{const s=n[i.anchor];if(!s)throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);if(!s.domain||s.domain[o]===void 0)throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);r[o]=s.domain[o]}e.domain=r}return e.axes&&(e.axes=e.axes.map(r=>wn(n,r))),e}function wn(n,t){if(!An(t))return t;const e=t.anchor,r=n[e];if(!r)throw new Error(`Anchor "${e}" not found for axis reference`);if("idx"in t){if(t.idx<0||t.idx>=r.axesSpec.length)throw new Error(`Axis index ${t.idx} out of bounds for anchor "${e}"`);return r.axesSpec[t.idx]}else if("name"in t){const o=r.axesSpec.filter(i=>i.name===t.name);if(o.length>1)throw new Error(`Multiple axes with name "${t.name}" found in anchor "${e}"`);if(o.length===0)throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);return o[0]}else if("id"in t){const o=r.axesSpec.filter(i=>M(t.id,l(i)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${e}"`);return o[0]}throw new Error("Unsupported axis reference type")}function An(n){return typeof n=="object"&&"anchor"in n}function xn(n){return typeof n=="object"&&n!==null&&"source"in n&&"axisFilters"in n}function f(n){return n.kind==="PColumn"}function z(n){return f(n.spec)}function kn(n){return f(n.obj)}function Nn(n){return f(n.obj.spec)}function Sn(n){if(!z(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n}function In(n,t){return n===void 0?void 0:{...n,data:t(n.data)}}function Vn(n){const t=new Map,e=r=>{switch(r.type){case"column":t.set(r.column.id,r.column);return;case"full":case"inner":for(const o of r.entries)e(o);return;case"outer":e(r.primary);for(const o of r.secondary)e(o);return;default:x(r)}};return e(n),[...t.values()]}function En(n){throw new Error("Unexpected object: "+n)}function b(n,t){switch(n.type){case"and":for(const e of n.operands)if(!b(e,t))return!1;return!0;case"or":for(const e of n.operands)if(b(e,t))return!0;return!1;case"not":return!b(n.operand,t);case"name":return f(t)&&t.name===n.name;case"name_pattern":return f(t)&&!!t.name.match(n.pattern);case"annotation":return f(t)&&t.annotations!==void 0&&t.annotations[n.annotation]===n.value;case"annotation_pattern":return f(t)&&t.annotations!==void 0&&t.annotations[n.annotation]!==void 0&&!!t.annotations[n.annotation].match(n.pattern);case"has_axes":return f(t)&&n.axes.every(e=>t.axesSpec.some(r=>(e.type===void 0||e.type===r.type)&&(e.name===void 0||e.name===r.name)&&(e.domain===void 0||Object.keys(e.domain).length===0||r.domain!==void 0&&Object.entries(e.domain).every(([o,i])=>r.domain[o]===i))));default:En(n)}}function P(n,t){if(n.name!==void 0&&n.name!==t.name)return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(t.type))return!1}else if(n.type!==t.type)return!1}if(n.domain!==void 0){const e=t.domain||{};for(const[r,o]of Object.entries(n.domain))if(e[r]!==o)return!1}return!0}function w(n,t){if(t.name!==void 0&&n.name!==t.name||t.namePattern!==void 0&&!new RegExp(t.namePattern).test(n.name))return!1;if(t.type!==void 0){if(Array.isArray(t.type)){if(!t.type.includes(n.valueType))return!1}else if(t.type!==n.valueType)return!1}if(t.domain!==void 0){const e=n.domain||{};for(const[r,o]of Object.entries(t.domain))if(e[r]!==o)return!1}if(t.axes!==void 0){const e=n.axesSpec.map(l);if(t.partialAxesMatch){for(const r of t.axes)if(!e.some(o=>P(r,o)))return!1}else{if(e.length!==t.axes.length)return!1;for(let r=0;r<t.axes.length;r++)if(!P(t.axes[r],e[r]))return!1}}if(t.annotations!==void 0){const e=n.annotations||{};for(const[r,o]of Object.entries(t.annotations))if(e[r]!==o)return!1}if(t.annotationPatterns!==void 0){const e=n.annotations||{};for(const[r,o]of Object.entries(t.annotationPatterns)){const i=e[r];if(i===void 0||!new RegExp(o).test(i))return!1}}return!0}function Cn(n){return Array.isArray(n)?t=>n.some(e=>f(t)&&w(t,e)):t=>f(t)&&w(t,n)}const On={href:"/"},Dn=m.z.object({__isRef:m.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:m.z.string().describe("Upstream block id"),name:m.z.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Jn(n){return typeof n=="object"&&n!==null&&"__isRef"in n&&n.__isRef===!0&&"blockId"in n&&"name"in n}function Ln(n,t){return n.blockId===t.blockId&&n.name===t.name}function $n(n,t){return n.ok?{ok:!0,value:t(n.value)}:n}function Fn(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const jn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Bn="0123456789ABCDEFGHIJKLMNOPQRSTUV",Un="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function W(n,t,e){e=e||{};let r,o;switch(t){case"RFC3548":case"RFC4648":r=jn,o=!0;break;case"RFC4648-HEX":r=Bn,o=!0;break;case"Crockford":r=Un,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(t))}const i=e.padding!==void 0?e.padding:o,s=Fn(n);let a=0,u=0,c="";for(let d=0;d<s.byteLength;d++)for(u=u<<8|s.getUint8(d),a+=8;a>=5;)c+=r[u>>>a-5&31],a-=5;if(a>0&&(c+=r[u<<5-a&31]),i)for(;c.length%8!==0;)c+="=";return c}const k=15,q=24,N=m.z.string().length(q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function Rn(){const n=new Uint8Array(k);return crypto.getRandomValues(n),N.parse(W(n,"RFC4648"))}function X(n){if(n.length!==k)throw new Error(`Wrong number of bytes: ${n.length}`);return N.parse(W(n,"RFC4648"))}async function Tn(n){const t=new TextEncoder,e=await crypto.subtle.digest("SHA-256",t.encode(n));return X(new Uint8Array(e.slice(0,15)))}exports.AnchoredIdDeriver=gn;exports.DefaultNavigationState=On;exports.PTableAbsent=v;exports.PTableNA=H;exports.PValueBytesNA=j;exports.PValueDoubleNA=$;exports.PValueFloatNA=L;exports.PValueIntNA=J;exports.PValueLongNA=g;exports.PValueStringNA=F;exports.PlId=N;exports.PlIdBytes=k;exports.PlIdLength=q;exports.PlRef=Dn;exports.canonicalizeAxisId=mn;exports.dataInfoToEntries=on;exports.digestPlId=Tn;exports.ensureNotNAPValue=un;exports.ensurePColumn=Sn;exports.entriesToDataInfo=an;exports.executePSpecPredicate=b;exports.extractAllColumns=Vn;exports.getAxesId=pn;exports.getAxisId=l;exports.getFileNameFromHandle=nn;exports.getFilePathFromHandle=D;exports.isDataInfo=tn;exports.isDataInfoEntries=rn;exports.isFilteredPColumn=xn;exports.isImportFileHandleIndex=O;exports.isImportFileHandleUpload=C;exports.isLiveLog=Y;exports.isNotNAPValue=B;exports.isPColumn=z;exports.isPColumnResult=Nn;exports.isPColumnSpec=f;exports.isPColumnSpecResult=kn;exports.isPTableAbsent=dn;exports.isPValue=U;exports.isPlRef=Jn;exports.isValueAbsent=K;exports.isValueNA=h;exports.mapDataInfo=en;exports.mapDataInfoEntries=sn;exports.mapJoinEntry=y;exports.mapPObjectData=In;exports.mapPTableDef=hn;exports.mapValueInVOE=$n;exports.matchAxis=P;exports.matchAxisId=M;exports.matchPColumn=w;exports.pTableValue=ln;exports.pValueToStringOrNumber=fn;exports.pValueToStringOrNumberOrNull=T;exports.parseColumnId=bn;exports.plId=X;exports.plRefsEqual=Ln;exports.resolveAnchors=Pn;exports.safeConvertToPValue=R;exports.selectorsToPredicate=Cn;exports.stringifyColumnId=_;exports.toJsonSafePValue=cn;exports.uniquePlId=Rn;
1
+ "use strict";var q=Object.defineProperty;var X=(n,t,e)=>t in n?q(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var p=(n,t,e)=>X(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("canonicalize"),m=require("zod");function G(n){return n!==void 0&&n.startsWith("log+live://log/")}function x(n){throw new Error("Unexpected object: "+n)}const V="upload://upload/",E="index://index/";function C(n){return n.startsWith(V)}function O(n){return n.startsWith(E)}function D(n){if(O(n)){const t=n.slice(E.length);return JSON.parse(decodeURIComponent(t)).path}else if(C(n)){const t=n.slice(V.length);return JSON.parse(decodeURIComponent(t)).localPath}x(n)}function Q(n){return n.replace(/^.*[\\/]/,"")}function Y(n){return Q(D(n))}function Z(n){if(!n||typeof n!="object")return!1;const t=n;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&t.data!==void 0&&typeof t.data=="object";case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";default:return!1}}function nn(n,t){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const e={};for(const[r,o]of Object.entries(n.parts))e[r]=t(o);return{...n,parts:e}}case"BinaryPartitioned":{const e={};for(const[r,o]of Object.entries(n.parts))e[r]={index:t(o.index),values:t(o.values)};return{...n,parts:e}}}}function tn(n){if(!n||typeof n!="object")return!1;const t=n;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&Array.isArray(t.data);case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);default:return!1}}function en(n){switch(n.type){case"Json":{const t=Object.entries(n.data).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"Json",keyLength:n.keyLength,data:t}}case"JsonPartitioned":{const t=Object.entries(n.parts).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t=Object.entries(n.parts).map(([e,r])=>({key:JSON.parse(e),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}}}function rn(n){switch(n.type){case"Json":{const t={};for(const e of n.data)t[JSON.stringify(e.key)]=e.value;return{type:"Json",keyLength:n.keyLength,data:t}}case"JsonPartitioned":{const t={};for(const e of n.parts)t[JSON.stringify(e.key)]=e.value;return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t={};for(const e of n.parts)t[JSON.stringify(e.key)]=e.value;return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:t}}}}function on(n,t){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const e=n.parts.map(r=>({key:r.key,value:t(r.value)}));return{...n,parts:e}}case"BinaryPartitioned":{const e=n.parts.map(r=>({key:r.key,value:{index:t(r.value.index),values:t(r.value.values)}}));return{...n,parts:e}}}}const J=-2147483648,g=-9007199254740991n,an=NaN,sn=NaN,L=null,$=null;function h(n,t){switch(t){case"Int":return n===J;case"Long":return n===Number(g)||n===g;case"Float":return Number.isNaN(n);case"Double":return Number.isNaN(n);case"String":return n===L;case"Bytes":return n===$;default:throw Error(`unsupported data type: ${t}`)}}function un(n){if(!F(n))throw new Error(`Expected not-NA PValue, got ${n}`);return n}function F(n,t){if(!t)return typeof n=="string"||typeof n=="number"&&isFinite(n)||typeof n=="bigint";if(h(n,t))return!1;switch(t){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${t}`)}}function j(n,t){if(!t)return n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint";if(h(n,t))return!0;switch(t){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${t}`)}}function cn(n){if(n===null||typeof n=="string"||typeof n=="number")return n;if(typeof n=="bigint")return{bigint:n.toString()};throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`)}function B(n,t){if(n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint"){if(t&&!h(n,t)&&!j(n,t))throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);return n}if(typeof n=="object"&&n!==null&&"bigint"in n&&typeof n.bigint=="string"){if(t&&t!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${t}`);return BigInt(n.bigint)}throw new Error(`Unsupported type ${typeof n} (value ${n}).`)}function fn(n){if(n=U(n),n===null)throw new Error("Value is null");return n}function U(n){if(n=B(n),n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"){if(!isFinite(n))throw new Error(`Value is not finite (${n})`);return n}if(typeof n=="bigint")return Number(n);throw new Error(`Unexpected value type: ${typeof n}`)}function R(n,t){const e=Math.floor(t/8),r=1<<7-t%8;return(n[e]&r)>0}const T={type:"absent"},K=null;function dn(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function ln(n,t,e={}){if(R(n.absent,t))return e.absent===void 0?T:e.absent;const r=n.data[t],o=n.type;if(h(r,o))return e.na===void 0?K:e.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function l(n){const{type:t,name:e,domain:r}=n;return{type:t,name:e,...r&&{domain:r}}}function pn(n){return n.map(l)}function mn(n){return A(l(n))}function yn(n,t){if(n===void 0)return t===void 0;if(t===void 0)return!0;for(const e in t)if(n[e]!==t[e])return!1;return!0}function v(n,t){return n.name===t.name&&yn(n.domain,t.domain)}function hn(n,t){return{...n,src:y(n.src,t)}}function y(n,t){switch(n.type){case"column":return{type:"column",column:t(n.column)};case"inner":case"full":return{type:n.type,entries:n.entries.map(e=>y(e,t))};case"outer":return{type:"outer",primary:y(n.primary,t),secondary:n.secondary.map(e=>y(e,t))};default:x(n)}}function H(n){return A(n)}function bn(n){return JSON.parse(n)}function S(n){return A(l(n))}function I(n,t){return JSON.stringify([n,t])}class gn{constructor(t){p(this,"domains",new Map);p(this,"axes",new Map);p(this,"domainPacks",[]);p(this,"domainPackToAnchor",new Map);this.anchors=t;const e=Object.entries(t);e.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of e){for(let i=0;i<o.axesSpec.length;i++){const s=o.axesSpec[i],a=S(s);this.axes.set(a,{anchor:r,idx:i})}if(o.domain!==void 0){const i=Object.entries(o.domain);i.sort((s,a)=>s[0].localeCompare(a[0])),this.domainPackToAnchor.set(JSON.stringify(i),r),this.domainPacks.push(i.map(([s])=>s));for(const[s,a]of i){const u=I(s,a);this.domains.set(u,r)}}}}derive(t,e){const r={name:t.name,axes:[]};let o;if(t.domain!==void 0)n:for(const s of this.domainPacks){const a=[];for(const c of s){const d=t.domain[c];if(d!==void 0)a.push([c,d]);else break n}const u=this.domainPackToAnchor.get(JSON.stringify(a));if(u!==void 0){r.domainAnchor=u,o=new Set(s);break}}for(const[s,a]of Object.entries(t.domain??{})){if(o!==void 0&&o.has(s))continue;const u=I(s,a),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[s]=c?{anchor:c}:a}if(r.axes=t.axesSpec.map(s=>{const a=S(s);return this.axes.get(a)??s}),!e||e.length===0)return r;const i=[];for(const s of e){const[a,u]=s;if(typeof a=="number"){if(a<0||a>=t.axesSpec.length)throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length-1})`);i.push([a,u])}else{const c=t.axesSpec.findIndex(d=>d.name===a);if(c===-1)throw new Error(`Axis with name "${a}" not found in the column specification`);i.push([c,u])}}return i.sort((s,a)=>s[0]-a[0]),{source:r,axisFilters:i}}deriveS(t,e){return H(this.derive(t,e))}}function Pn(n,t){const e={...t};if(e.domainAnchor!==void 0){const r=n[e.domainAnchor];if(!r)throw new Error(`Anchor "${e.domainAnchor}" not found`);const o=r.domain||{};e.domain={...o,...e.domain},delete e.domainAnchor}if(e.domain){const r={};for(const[o,i]of Object.entries(e.domain))if(typeof i=="string")r[o]=i;else{const s=n[i.anchor];if(!s)throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);if(!s.domain||s.domain[o]===void 0)throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);r[o]=s.domain[o]}e.domain=r}return e.axes&&(e.axes=e.axes.map(r=>wn(n,r))),e}function wn(n,t){if(!An(t))return t;const e=t.anchor,r=n[e];if(!r)throw new Error(`Anchor "${e}" not found for axis reference`);if("idx"in t){if(t.idx<0||t.idx>=r.axesSpec.length)throw new Error(`Axis index ${t.idx} out of bounds for anchor "${e}"`);return r.axesSpec[t.idx]}else if("name"in t){const o=r.axesSpec.filter(i=>i.name===t.name);if(o.length>1)throw new Error(`Multiple axes with name "${t.name}" found in anchor "${e}"`);if(o.length===0)throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);return o[0]}else if("id"in t){const o=r.axesSpec.filter(i=>v(t.id,l(i)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${e}"`);return o[0]}throw new Error("Unsupported axis reference type")}function An(n){return typeof n=="object"&&"anchor"in n}function xn(n){return typeof n=="object"&&n!==null&&"source"in n&&"axisFilters"in n}function f(n){return n.kind==="PColumn"}function M(n){return f(n.spec)}function Nn(n){return f(n.obj)}function kn(n){return f(n.obj.spec)}function Sn(n){if(!M(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n}function In(n,t){return n===void 0?void 0:{...n,data:t(n.data)}}function Vn(n){const t=new Map,e=r=>{switch(r.type){case"column":t.set(r.column.id,r.column);return;case"full":case"inner":for(const o of r.entries)e(o);return;case"outer":e(r.primary);for(const o of r.secondary)e(o);return;default:x(r)}};return e(n),[...t.values()]}function En(n){throw new Error("Unexpected object: "+n)}function b(n,t){switch(n.type){case"and":for(const e of n.operands)if(!b(e,t))return!1;return!0;case"or":for(const e of n.operands)if(b(e,t))return!0;return!1;case"not":return!b(n.operand,t);case"name":return f(t)&&t.name===n.name;case"name_pattern":return f(t)&&!!t.name.match(n.pattern);case"annotation":return f(t)&&t.annotations!==void 0&&t.annotations[n.annotation]===n.value;case"annotation_pattern":return f(t)&&t.annotations!==void 0&&t.annotations[n.annotation]!==void 0&&!!t.annotations[n.annotation].match(n.pattern);case"has_axes":return f(t)&&n.axes.every(e=>t.axesSpec.some(r=>(e.type===void 0||e.type===r.type)&&(e.name===void 0||e.name===r.name)&&(e.domain===void 0||Object.keys(e.domain).length===0||r.domain!==void 0&&Object.entries(e.domain).every(([o,i])=>r.domain[o]===i))));default:En(n)}}function P(n,t){if(n.name!==void 0&&n.name!==t.name)return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(t.type))return!1}else if(n.type!==t.type)return!1}if(n.domain!==void 0){const e=t.domain||{};for(const[r,o]of Object.entries(n.domain))if(e[r]!==o)return!1}return!0}function w(n,t){if(t.name!==void 0&&n.name!==t.name||t.namePattern!==void 0&&!new RegExp(t.namePattern).test(n.name))return!1;if(t.type!==void 0){if(Array.isArray(t.type)){if(!t.type.includes(n.valueType))return!1}else if(t.type!==n.valueType)return!1}if(t.domain!==void 0){const e=n.domain||{};for(const[r,o]of Object.entries(t.domain))if(e[r]!==o)return!1}if(t.axes!==void 0){const e=n.axesSpec.map(l);if(t.partialAxesMatch){for(const r of t.axes)if(!e.some(o=>P(r,o)))return!1}else{if(e.length!==t.axes.length)return!1;for(let r=0;r<t.axes.length;r++)if(!P(t.axes[r],e[r]))return!1}}if(t.annotations!==void 0){const e=n.annotations||{};for(const[r,o]of Object.entries(t.annotations))if(e[r]!==o)return!1}if(t.annotationPatterns!==void 0){const e=n.annotations||{};for(const[r,o]of Object.entries(t.annotationPatterns)){const i=e[r];if(i===void 0||!new RegExp(o).test(i))return!1}}return!0}function Cn(n){return Array.isArray(n)?t=>n.some(e=>f(t)&&w(t,e)):t=>f(t)&&w(t,n)}const On={href:"/"},Dn=m.z.object({__isRef:m.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:m.z.string().describe("Upstream block id"),name:m.z.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Jn(n){return typeof n=="object"&&n!==null&&"__isRef"in n&&n.__isRef===!0&&"blockId"in n&&"name"in n}function Ln(n,t){return n.blockId===t.blockId&&n.name===t.name}function $n(n,t){return n.ok?{ok:!0,value:t(n.value)}:n}function Fn(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const jn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Bn="0123456789ABCDEFGHIJKLMNOPQRSTUV",Un="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function _(n,t,e){e=e||{};let r,o;switch(t){case"RFC3548":case"RFC4648":r=jn,o=!0;break;case"RFC4648-HEX":r=Bn,o=!0;break;case"Crockford":r=Un,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(t))}const i=e.padding!==void 0?e.padding:o,s=Fn(n);let a=0,u=0,c="";for(let d=0;d<s.byteLength;d++)for(u=u<<8|s.getUint8(d),a+=8;a>=5;)c+=r[u>>>a-5&31],a-=5;if(a>0&&(c+=r[u<<5-a&31]),i)for(;c.length%8!==0;)c+="=";return c}const N=15,z=24,k=m.z.string().length(z).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function Rn(){const n=new Uint8Array(N);return crypto.getRandomValues(n),k.parse(_(n,"RFC4648"))}function W(n){if(n.length!==N)throw new Error(`Wrong number of bytes: ${n.length}`);return k.parse(_(n,"RFC4648"))}async function Tn(n){const t=new TextEncoder,e=await crypto.subtle.digest("SHA-256",t.encode(n));return W(new Uint8Array(e.slice(0,15)))}exports.AnchoredIdDeriver=gn;exports.DefaultNavigationState=On;exports.PTableAbsent=T;exports.PTableNA=K;exports.PValueBytesNA=$;exports.PValueDoubleNA=sn;exports.PValueFloatNA=an;exports.PValueIntNA=J;exports.PValueLongNA=g;exports.PValueStringNA=L;exports.PlId=k;exports.PlIdBytes=N;exports.PlIdLength=z;exports.PlRef=Dn;exports.canonicalizeAxisId=mn;exports.dataInfoToEntries=en;exports.digestPlId=Tn;exports.ensureNotNAPValue=un;exports.ensurePColumn=Sn;exports.entriesToDataInfo=rn;exports.executePSpecPredicate=b;exports.extractAllColumns=Vn;exports.getAxesId=pn;exports.getAxisId=l;exports.getFileNameFromHandle=Y;exports.getFilePathFromHandle=D;exports.isDataInfo=Z;exports.isDataInfoEntries=tn;exports.isFilteredPColumn=xn;exports.isImportFileHandleIndex=O;exports.isImportFileHandleUpload=C;exports.isLiveLog=G;exports.isNotNAPValue=F;exports.isPColumn=M;exports.isPColumnResult=kn;exports.isPColumnSpec=f;exports.isPColumnSpecResult=Nn;exports.isPTableAbsent=dn;exports.isPValue=j;exports.isPlRef=Jn;exports.isValueAbsent=R;exports.isValueNA=h;exports.mapDataInfo=nn;exports.mapDataInfoEntries=on;exports.mapJoinEntry=y;exports.mapPObjectData=In;exports.mapPTableDef=hn;exports.mapValueInVOE=$n;exports.matchAxis=P;exports.matchAxisId=v;exports.matchPColumn=w;exports.pTableValue=ln;exports.pValueToStringOrNumber=fn;exports.pValueToStringOrNumberOrNull=U;exports.parseColumnId=bn;exports.plId=W;exports.plRefsEqual=Ln;exports.resolveAnchors=Pn;exports.safeConvertToPValue=B;exports.selectorsToPredicate=Cn;exports.stringifyColumnId=H;exports.toJsonSafePValue=cn;exports.uniquePlId=Rn;
2
2
  //# sourceMappingURL=index.js.map