@milaboratories/pl-model-common 1.16.5 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ /** Structure to help resolve conflicts if multiple participants writes to
2
+ * the same state */
3
+ export interface AuthorMarker {
4
+ /** Unique identifier of client or even a specific window that sets this
5
+ * particular state */
6
+ authorId: string;
7
+ /** Sequential version of the state local to the author */
8
+ localVersion: number;
9
+ }
10
+ //# sourceMappingURL=author_marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"author_marker.d.ts","sourceRoot":"","sources":["../src/author_marker.ts"],"names":[],"mappings":"AAAA;oBACoB;AACpB,MAAM,WAAW,YAAY;IAC3B;0BACsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IAEjB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -1,5 +1,6 @@
1
1
  import { BlockOutputsBase } from './common_types';
2
2
  import { NavigationState } from './navigation';
3
+ import { AuthorMarker } from './author_marker';
3
4
  /**
4
5
  * @template Args sets type of block arguments passed to the workflow
5
6
  * @template Outputs type of the outputs returned by the workflow and rendered
@@ -18,5 +19,6 @@ export type BlockState<Args = unknown, Outputs extends BlockOutputsBase = BlockO
18
19
  outputs: Outputs;
19
20
  /** Current navigation state */
20
21
  navigationState: NavigationState<Href>;
22
+ readonly author: AuthorMarker | undefined;
21
23
  };
22
24
  //# sourceMappingURL=block_state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CACpB,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC;IACF,6CAA6C;IAC7C,IAAI,EAAE,IAAI,CAAC;IAEX;kBACc;IACd,EAAE,EAAE,OAAO,CAAC;IAEZ,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IAEjB,+BAA+B;IAC/B,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CACxC,CAAC"}
1
+ {"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CACpB,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC;IACF,6CAA6C;IAC7C,IAAI,EAAE,IAAI,CAAC;IAEX;kBACc;IACd,EAAE,EAAE,OAAO,CAAC;IAEZ,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IAEjB,+BAA+B;IAC/B,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAEvC,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;CAC3C,CAAC"}
@@ -82,6 +82,8 @@ export interface LsDriver {
82
82
  * components, that handle file Drag&Drop.
83
83
  * */
84
84
  fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;
85
+ /** Saves currently opened block webview as a PDF. */
86
+ exportToPdf?(): Promise<void>;
85
87
  }
86
88
  /** Gets a file path from an import handle. */
87
89
  export declare function getFilePathFromHandle(handle: Im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tE;AAMD,8CAA8C;AAC9C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEtE"}
package/dist/errors.d.ts CHANGED
@@ -38,7 +38,7 @@ export type ResultOrError<S, F = Error> = {
38
38
  } | {
39
39
  error: F;
40
40
  };
41
- export declare function unwrapResult<T>(result: ResultOrError<T>): T;
41
+ export declare function unwrapResult<T>(result: ResultOrError<T, Error | SerializedError>): T;
42
42
  export declare function serializeResult<T>(result: ResultOrError<T>): ResultOrError<T, SerializedError>;
43
43
  export declare function deserializeResult<T>(result: ResultOrError<T, SerializedError>): ResultOrError<T>;
44
44
  export declare function wrapCallback<T>(callback: () => T): ResultOrError<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,IAAI,SAAgB;CACrB;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,KAAK;IAChC,IAAI,SAAa;CAClB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAEpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMrD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,SAAiB;CACtB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,IAAI,SAAwB;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAmBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAA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,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG;IACF,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAKpF;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC,CAK9F;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAKhG;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAOnE;AAED,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAOhG;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC,CAGxF;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAGrH"}
package/dist/index.d.ts CHANGED
@@ -13,4 +13,5 @@ export * from './json';
13
13
  export * from './errors';
14
14
  export * from './flags';
15
15
  export * from './bmodel';
16
+ export * from './author_marker';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var ae=Object.defineProperty;var ue=(e,n,t)=>n in e?ae(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>ue(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("zod"),g=require("canonicalize");function ce(e){if(e.code!==void 0)return{code:e.code,sdkVersion:e.sdkVersion,featureFlags:e.featureFlags}}function y(e){if(e!==void 0)return typeof e=="string"?{__renderLambda:!0,handle:e,retentive:!1}:e}function fe(e){if(e.v3!==void 0){const{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,enrichmentTargets:f}=e.v3,{code:se}=e;return{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,code:se,enrichmentTargets:f}}else if(e.inputsValid!==void 0){const{sdkVersion:n,renderingMode:t,outputs:r,inputsValid:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(n===void 0||t===void 0||r===void 0||o===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v2. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n,renderingMode:t,initialArgs:a,outputs:Object.fromEntries(Object.entries(r).map(([c,f])=>[c,y(f)])),inputsValid:y(o),sections:y(i),initialUiState:void 0,code:s}}else if(e.renderingMode!==void 0){const{sdkVersion:n,canRun:t,renderingMode:r,outputs:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(r===void 0||o===void 0||t===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v1. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n??"unknown",renderingMode:r,initialArgs:a,outputs:Object.fromEntries(Object.entries(o).map(([c,f])=>[c,y(f)])),inputsValid:y(t),sections:y(i),initialUiState:void 0,code:s}}else{const{sdkVersion:n}=e,t=Object.keys(e);throw new Error(`Config format not supported: SDK = ${n}; Fields = ${t.join(", ")}`)}}const de=m.z.object({from:m.z.number(),to:m.z.number()});function le(e,n){if(!(e==null||n==null))return{from:e,to:n}}function me(e,n){if(e.from<0||e.to<0||e.from>=e.to)throw new Error(`${n}: invalid bytes range: ${e}`)}function pe(e){return e!==void 0&&e.startsWith("log+live://log/")}function k(e){throw new Error("Unexpected object: "+e)}const D="upload://upload/",R="index://index/";function $(e){return e.startsWith(D)}function J(e){return e.startsWith(R)}function j(e){if(J(e)){const n=e.slice(R.length);return JSON.parse(decodeURIComponent(n)).path}else if($(e)){const n=e.slice(D.length);return JSON.parse(decodeURIComponent(n)).localPath}k(e)}function ye(e){return e.replace(/^.*[\\/]/,"")}function he(e){return ye(j(e))}function ge(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&n.data!==void 0&&typeof n.data=="object";case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";default:return!1}}function be(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]=n(o);return{...e,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]={index:n(o.index),values:n(o.values)};return{...e,parts:t}}}}function we(e,n){switch(e.type){case"Json":break;case"JsonPartitioned":{for(const[t,r]of Object.entries(e.parts))n(r);break}case"BinaryPartitioned":{for(const[t,r]of Object.entries(e.parts))n(r.index),n(r.values);break}}}function B(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&Array.isArray(n.data);case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);default:return!1}}function Pe(e){return B(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function Ae(e){switch(e.type){case"Json":{const n=Object.entries(e.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function Ee(e){switch(e.type){case"Json":{const n={};for(const t of e.data)n[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function xe(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t=e.parts.map(r=>({key:r.key,value:n(r.value)}));return{...e,parts:t}}case"BinaryPartitioned":{const t=e.parts.map(r=>({key:r.key,value:{index:n(r.value.index),values:n(r.value.values)}}));return{...e,parts:t}}}}const L=-2147483648,A=-9007199254740991n,ke=NaN,Se=NaN,z=null,U=null;function b(e,n){switch(n){case"Int":return e===L;case"Long":return e===Number(A)||e===A;case"Float":return Number.isNaN(e);case"Double":return Number.isNaN(e);case"String":return e===z;case"Bytes":return e===U;default:throw Error(`unsupported data type: ${n}`)}}function ve(e){if(!T(e))throw new Error(`Expected not-NA PValue, got ${e}`);return e}function T(e,n){if(!n)return typeof e=="string"||typeof e=="number"&&isFinite(e)||typeof e=="bigint";if(b(e,n))return!1;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function M(e,n){if(!n)return e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint";if(b(e,n))return!0;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function Ie(e){if(e===null||typeof e=="string"||typeof e=="number")return e;if(typeof e=="bigint")return{bigint:e.toString()};throw new Error(`Type ${typeof e} (value ${e}) not yet supported.`)}function K(e,n){if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint"){if(n&&!b(e,n)&&!M(e,n))throw new Error(`Unexpected value type, got ${typeof e}, expected ${n}`);return e}if(typeof e=="object"&&e!==null&&"bigint"in e&&typeof e.bigint=="string"){if(n&&n!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);return BigInt(e.bigint)}throw new Error(`Unsupported type ${typeof e} (value ${e}).`)}function Ne(e){if(e=q(e),e===null)throw new Error("Value is null");return e}function q(e){if(e=K(e),e===null)return null;if(typeof e=="string")return e;if(typeof e=="number"){if(!isFinite(e))throw new Error(`Value is not finite (${e})`);return e}if(typeof e=="bigint")return Number(e);throw new Error(`Unexpected value type: ${typeof e}`)}function _(e,n){const t=Math.floor(n/8),r=1<<7-n%8;return(e[t]&r)>0}const H={type:"absent"},W=null;function Ce(e){return typeof e=="object"&&e!==null&&e.type==="absent"}function Fe(e,n,t={}){if(_(e.absent,n))return t.absent===void 0?H:t.absent;const r=e.data[n],o=e.type;if(b(r,o))return t.na===void 0?W:t.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 Ve(e){return{kind:e.kind,valueType:e.valueType,name:e.name,domain:e.domain,parentAxes:e.parentAxes,axesId:S(e.axesSpec)}}function Oe(e){return{columnId:e.id,spec:e.spec}}function p(e){const{type:n,name:t,domain:r}=e,o={type:n,name:t};return r&&Object.entries(r).length>0&&Object.assign(o,{domain:r}),o}function S(e){return e.map(p)}function De(e){return g(p(e))}function Re(e,n){if(e===void 0)return n===void 0;if(n===void 0)return!0;for(const t in n)if(e[t]!==n[t])return!1;return!0}function G(e,n){return e.name===n.name&&Re(e.domain,n.domain)}function $e(e,n){return{...e,src:h(e.src,n)}}function h(e,n){switch(e.type){case"column":return{type:"column",column:n(e.column)};case"slicedColumn":return{type:"slicedColumn",column:n(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(t=>h(t,n))};case"outer":return{type:"outer",primary:h(e.primary,n),secondary:e.secondary.map(t=>h(t,n))};default:k(e)}}function Je(e){switch(e.type){case"axis":return{type:"axis",id:e.id};case"column":return{type:"column",id:e.id}}}function X(e){return g(e)}function je(e){return JSON.parse(e)}function V(e){return g(p(e))}function O(e,n){return JSON.stringify([e,n])}class Be{constructor(n){l(this,"domains",new Map);l(this,"axes",new Map);l(this,"domainPacks",[]);l(this,"domainPackToAnchor",new Map);this.anchors=n;const t=Object.entries(n);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let i=0;i<o.axesSpec.length;i++){const a=o.axesSpec[i],s=V(a);this.axes.set(s,{anchor:r,idx:i})}if(o.domain!==void 0){const i=Object.entries(o.domain);i.sort((a,s)=>a[0].localeCompare(s[0])),this.domainPackToAnchor.set(JSON.stringify(i),r),this.domainPacks.push(i.map(([a])=>a));for(const[a,s]of i){const u=O(a,s);this.domains.set(u,r)}}}}derive(n,t){const r={name:n.name,axes:[]};let o;if(n.domain!==void 0)e:for(const a of this.domainPacks){const s=[];for(const c of a){const f=n.domain[c];if(f!==void 0)s.push([c,f]);else break e}const u=this.domainPackToAnchor.get(JSON.stringify(s));if(u!==void 0){r.domainAnchor=u,o=new Set(a);break}}for(const[a,s]of Object.entries(n.domain??{})){if(o!==void 0&&o.has(a))continue;const u=O(a,s),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[a]=c?{anchor:c}:s}if(r.axes=n.axesSpec.map(a=>{const s=V(a),u=this.axes.get(s);return u===void 0?p(a):u}),!t||t.length===0)return r;const i=[];for(const a of t){const[s,u]=a;if(typeof s=="number"){if(s<0||s>=n.axesSpec.length)throw new Error(`Axis index ${s} is out of bounds (0-${n.axesSpec.length-1})`);i.push([s,u])}else{const c=n.axesSpec.findIndex(f=>f.name===s);if(c===-1)throw new Error(`Axis with name "${s}" not found in the column specification`);i.push([c,u])}}return i.sort((a,s)=>a[0]-s[0]),{source:r,axisFilters:i}}deriveS(n,t){return X(this.derive(n,t))}}function Le(e,n,t){const r={...n},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const i=e[r.domainAnchor];if(!i)throw new Error(`Anchor "${r.domainAnchor}" not found`);const a=i.domain||{};r.domain={...a,...r.domain},delete r.domainAnchor}if(r.domain){const i={};for(const[a,s]of Object.entries(r.domain))if(typeof s=="string")i[a]=s;else{const u=e[s.anchor];if(!u)throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);if(!u.domain||u.domain[a]===void 0){if(!o)throw new Error(`Domain key "${a}" not found in anchor "${s.anchor}"`);continue}i[a]=u.domain[a]}r.domain=i}return r.axes&&(r.axes=r.axes.map(i=>ze(e,i))),r}function ze(e,n){if(!Ue(n))return n;const t=n.anchor,r=e[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in n){if(n.idx<0||n.idx>=r.axesSpec.length)throw new Error(`Axis index ${n.idx} out of bounds for anchor "${t}"`);return r.axesSpec[n.idx]}else if("name"in n){const o=r.axesSpec.filter(i=>i.name===n.name);if(o.length>1)throw new Error(`Multiple axes with name "${n.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${n.name}" not found in anchor "${t}"`);return o[0]}else if("id"in n){const o=r.axesSpec.filter(i=>G(n.id,p(i)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function Ue(e){return typeof e=="object"&&"anchor"in e}function Te(e){return typeof e=="object"&&e!==null&&"source"in e&&"axisFilters"in e}function d(e){return e.kind==="PColumn"}function Q(e){return d(e.spec)}function Me(e){return d(e.obj)}function Ke(e){return d(e.obj.spec)}function qe(e){if(!Q(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function _e(e,n){return e===void 0?void 0:{...e,data:n(e.data)}}function He(e){const n=new Map,t=r=>{switch(r.type){case"column":n.set(r.column.id,r.column);return;case"slicedColumn":n.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:k(r)}};return t(e),[...n.values()]}function We(e){throw new Error("Unexpected object: "+e)}function w(e,n){switch(e.type){case"and":for(const t of e.operands)if(!w(t,n))return!1;return!0;case"or":for(const t of e.operands)if(w(t,n))return!0;return!1;case"not":return!w(e.operand,n);case"name":return d(n)&&n.name===e.name;case"name_pattern":return d(n)&&!!n.name.match(e.pattern);case"annotation":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]===e.value;case"annotation_pattern":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]!==void 0&&!!n.annotations[e.annotation].match(e.pattern);case"has_axes":return d(n)&&e.axes.every(t=>n.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,i])=>r.domain[o]===i))));default:We(e)}}function E(e,n){if(e.name!==void 0&&e.name!==n.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.type))return!1}else if(e.type!==n.type)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}return!0}function x(e,n){if(n.name!==void 0&&e.name!==n.name||n.namePattern!==void 0&&!new RegExp(n.namePattern).test(e.name))return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.valueType))return!1}else if(n.type!==e.valueType)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}if(n.axes!==void 0){const t=e.axesSpec.map(p);if(n.partialAxesMatch){for(const r of n.axes)if(!t.some(o=>E(r,o)))return!1}else{if(t.length!==n.axes.length)return!1;for(let r=0;r<n.axes.length;r++)if(!E(n.axes[r],t[r]))return!1}}if(n.annotations!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotations))if(t[r]!==o)return!1}if(n.annotationPatterns!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotationPatterns)){const i=t[r];if(i===void 0||!new RegExp(o).test(i))return!1}}return!0}function Ge(e){return Array.isArray(e)?n=>e.some(t=>d(n)&&x(n,t)):n=>d(n)&&x(n,e)}function Xe(e){const n={kind:e.kind,name:e.name};return e.domain!==void 0&&(n.domain=e.domain),d(e)&&(n.axesSpec=S(e.axesSpec)),g(n)}const Qe={href:"/"},Ye=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"),requireEnrichments:m.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).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.").readonly();function Ze(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function en(e,n,t=!1){return t?{__isRef:!0,blockId:e,name:n,requireEnrichments:!0}:{__isRef:!0,blockId:e,name:n}}function nn(e,n=!0){if(n)return{...e,requireEnrichments:!0};{const{requireEnrichments:t,...r}=e;return r}}function tn(e,n,t=!1){return e.blockId===n.blockId&&e.name===n.name&&(t||e.requireEnrichments===n.requireEnrichments)}function rn(e,n){return e.ok?{ok:!0,value:n(e.value)}:e}function on(e){if(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new DataView(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new DataView(e);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const sn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",an="0123456789ABCDEFGHIJKLMNOPQRSTUV",un="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Y(e,n,t){t=t||{};let r,o;switch(n){case"RFC3548":case"RFC4648":r=sn,o=!0;break;case"RFC4648-HEX":r=an,o=!0;break;case"Crockford":r=un,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(n))}const i=t.padding!==void 0?t.padding:o,a=on(e);let s=0,u=0,c="";for(let f=0;f<a.byteLength;f++)for(u=u<<8|a.getUint8(f),s+=8;s>=5;)c+=r[u>>>s-5&31],s-=5;if(s>0&&(c+=r[u<<5-s&31]),i)for(;c.length%8!==0;)c+="=";return c}const v=15,Z=24,I=m.z.string().length(Z).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function cn(){const e=new Uint8Array(v);return crypto.getRandomValues(e),I.parse(Y(e,"RFC4648"))}function ee(e){if(e.length!==v)throw new Error(`Wrong number of bytes: ${e.length}`);return I.parse(Y(e,"RFC4648"))}async function fn(e){const n=new TextEncoder,t=await crypto.subtle.digest("SHA-256",n.encode(e));return ee(new Uint8Array(t.slice(0,15)))}function dn(e){return JSON.stringify(e)}function ln(e){return g(e)}function mn(e){return JSON.parse(e)}class pn extends Error{constructor(){super(...arguments);l(this,"name","AbortError")}}class yn extends Error{constructor(){super(...arguments);l(this,"name","UiError")}}function hn(e){return e instanceof Error&&e.name==="AbortError"}function ne(e){return e instanceof Error?e.name==="AbortError"||ne(e.cause):!1}function gn(e){return e instanceof Error&&e.name==="AggregateError"}class te extends Error{constructor(){super(...arguments);l(this,"name","PFrameError")}}function bn(e){return e instanceof Error&&e.name==="PFrameError"}class wn extends te{constructor(){super(...arguments);l(this,"name","PFrameError.Driver")}}function Pn(e){return e instanceof Error&&e.name==="PFrameError.Driver"}function An(e){if(typeof e=="string")return`String value was thrown: ${e}`;if(e&&typeof e=="object")try{return`Plain object was thrown: ${JSON.stringify(e)}`}catch(n){return`Non-serializable object was thrown (JSON.stringify failed: ${n instanceof Error?n.message:String(n)}): ${String(e)}`}return`Non-Error value (${typeof e}) was thrown: ${e}`}function P(e){return e instanceof Error?e:new Error(An(e))}function N(e){const n=e.cause?N(e.cause):void 0,t=new Error(e.message,n!==void 0?{cause:n}:void 0);return t.name=e.name||"Error",t.stack=e.stack,t}function C(e){const n=P(e),t=n.cause?C(n.cause):void 0;return{name:n.name,message:n.message,stack:n.stack,...n.cause!==void 0&&{cause:t}}}function En(e){if(e.error)throw e.error;return e.value}function F(e){return e.error?{error:C(e.error)}:{value:e.value}}function xn(e){return e.error?{error:N(e.error)}:{value:e.value}}function re(e){try{return{value:e()}}catch(n){return{error:P(n)}}}async function oe(e){try{return{value:await e()}}catch(n){return{error:P(n)}}}function kn(e){const n=re(e);return F(n)}async function Sn(e){const n=await oe(e);return F(n)}const vn=["supportsLazyState"],In=["requiresUIAPIVersion","requiresModelAPIVersion"];function Nn(e,n,t=!0){return e===void 0?!1:e[n]===t}function Cn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("requires")&&t===!0).map(([n])=>n))}function Fn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("supports")&&t===!0).map(([n])=>n))}class ie extends Error{constructor(t){super(`Some of the block requirements are not supported by the runtime: ${Array.from(t.entries()).map(([r,o])=>`${r}: ${o}`).join(", ")}`);l(this,"name","IncompatibleFlagsError");this.incompatibleFlags=t}}class Vn{constructor(){l(this,"supportedRequirements",new Map)}addSupportedRequirement(n,t=!0){return this.supportedRequirements.has(n)||this.supportedRequirements.set(n,new Set),this.supportedRequirements.get(n).add(t),this}getIncompatibleFlags(n){if(n===void 0)return;const t=new Map;for(const[r,o]of Object.entries(n))if(r.startsWith("requires")){if(o===void 0)continue;const i=this.supportedRequirements.get(r);(i===void 0||!i.has(o))&&t.set(r,o)}return t.size===0?void 0:t}checkCompatibility(n){return this.getIncompatibleFlags(n)===void 0}throwIfIncompatible(n){const t=this.getIncompatibleFlags(n);if(t!==void 0)throw new ie(t)}}exports.AbortError=pn;exports.AllRequiresFeatureFlags=In;exports.AllSupportsFeatureFlags=vn;exports.AnchoredIdDeriver=Be;exports.DefaultNavigationState=Qe;exports.IncompatibleFlagsError=ie;exports.PFrameDriverError=wn;exports.PFrameError=te;exports.PTableAbsent=H;exports.PTableNA=W;exports.PValueBytesNA=U;exports.PValueDoubleNA=Se;exports.PValueFloatNA=ke;exports.PValueIntNA=L;exports.PValueLongNA=A;exports.PValueStringNA=z;exports.PlId=I;exports.PlIdBytes=v;exports.PlIdLength=Z;exports.PlRef=Ye;exports.RangeBytes=de;exports.RuntimeCapabilities=Vn;exports.UiError=yn;exports.canonicalizeAxisId=De;exports.canonicalizeJson=ln;exports.checkBlockFlag=Nn;exports.createPlRef=en;exports.dataInfoToEntries=Ae;exports.deriveNativeId=Xe;exports.deserializeError=N;exports.deserializeResult=xn;exports.digestPlId=fn;exports.ensureError=P;exports.ensureNotNAPValue=ve;exports.ensurePColumn=qe;exports.entriesToDataInfo=Ee;exports.executePSpecPredicate=w;exports.extractAllColumns=He;exports.extractAllRequirements=Cn;exports.extractAllSupports=Fn;exports.extractCodeWithInfo=ce;exports.extractConfigGeneric=fe;exports.getAxesId=S;exports.getAxisId=p;exports.getColumnIdAndSpec=Oe;exports.getFileNameFromHandle=he;exports.getFilePathFromHandle=j;exports.getPColumnSpecId=Ve;exports.getPTableColumnId=Je;exports.hasAbortError=ne;exports.isAbortError=hn;exports.isAggregateError=gn;exports.isDataInfo=ge;exports.isDataInfoEntries=B;exports.isFilteredPColumn=Te;exports.isImportFileHandleIndex=J;exports.isImportFileHandleUpload=$;exports.isLiveLog=pe;exports.isNotNAPValue=T;exports.isPColumn=Q;exports.isPColumnResult=Ke;exports.isPColumnSpec=d;exports.isPColumnSpecResult=Me;exports.isPFrameDriverError=Pn;exports.isPFrameError=bn;exports.isPTableAbsent=Ce;exports.isPValue=M;exports.isPartitionedDataInfoEntries=Pe;exports.isPlRef=Ze;exports.isValueAbsent=_;exports.isValueNA=b;exports.mapDataInfo=be;exports.mapDataInfoEntries=xe;exports.mapJoinEntry=h;exports.mapPObjectData=_e;exports.mapPTableDef=$e;exports.mapValueInVOE=rn;exports.matchAxis=E;exports.matchAxisId=G;exports.matchPColumn=x;exports.newRangeBytesOpt=le;exports.pTableValue=Fe;exports.pValueToStringOrNumber=Ne;exports.pValueToStringOrNumberOrNull=q;exports.parseColumnId=je;exports.parseJson=mn;exports.plId=ee;exports.plRefsEqual=tn;exports.resolveAnchors=Le;exports.safeConvertToPValue=K;exports.selectorsToPredicate=Ge;exports.serializeError=C;exports.serializeResult=F;exports.stringifyColumnId=X;exports.stringifyJson=dn;exports.toJsonSafePValue=Ie;exports.uniquePlId=cn;exports.unwrapResult=En;exports.validateRangeBytes=me;exports.visitDataInfo=we;exports.withEnrichments=nn;exports.wrapAndSerialize=kn;exports.wrapAndSerializeAsync=Sn;exports.wrapAsyncCallback=oe;exports.wrapCallback=re;
1
+ "use strict";var ae=Object.defineProperty;var ue=(e,n,t)=>n in e?ae(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>ue(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("zod"),g=require("canonicalize");function ce(e){if(e.code!==void 0)return{code:e.code,sdkVersion:e.sdkVersion,featureFlags:e.featureFlags}}function y(e){if(e!==void 0)return typeof e=="string"?{__renderLambda:!0,handle:e,retentive:!1}:e}function fe(e){if(e.v3!==void 0){const{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,enrichmentTargets:f}=e.v3,{code:se}=e;return{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,code:se,enrichmentTargets:f}}else if(e.inputsValid!==void 0){const{sdkVersion:n,renderingMode:t,outputs:r,inputsValid:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(n===void 0||t===void 0||r===void 0||o===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v2. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n,renderingMode:t,initialArgs:a,outputs:Object.fromEntries(Object.entries(r).map(([c,f])=>[c,y(f)])),inputsValid:y(o),sections:y(i),initialUiState:void 0,code:s}}else if(e.renderingMode!==void 0){const{sdkVersion:n,canRun:t,renderingMode:r,outputs:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(r===void 0||o===void 0||t===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v1. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n??"unknown",renderingMode:r,initialArgs:a,outputs:Object.fromEntries(Object.entries(o).map(([c,f])=>[c,y(f)])),inputsValid:y(t),sections:y(i),initialUiState:void 0,code:s}}else{const{sdkVersion:n}=e,t=Object.keys(e);throw new Error(`Config format not supported: SDK = ${n}; Fields = ${t.join(", ")}`)}}const de=m.z.object({from:m.z.number(),to:m.z.number()});function le(e,n){if(!(e==null||n==null))return{from:e,to:n}}function me(e,n){if(e.from<0||e.to<0||e.from>=e.to)throw new Error(`${n}: invalid bytes range: ${e}`)}function pe(e){return e!==void 0&&e.startsWith("log+live://log/")}function S(e){throw new Error("Unexpected object: "+e)}const D="upload://upload/",R="index://index/";function $(e){return e.startsWith(D)}function J(e){return e.startsWith(R)}function j(e){if(J(e)){const n=e.slice(R.length);return JSON.parse(decodeURIComponent(n)).path}else if($(e)){const n=e.slice(D.length);return JSON.parse(decodeURIComponent(n)).localPath}S(e)}function ye(e){return e.replace(/^.*[\\/]/,"")}function he(e){return ye(j(e))}function ge(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&n.data!==void 0&&typeof n.data=="object";case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";default:return!1}}function be(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]=n(o);return{...e,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]={index:n(o.index),values:n(o.values)};return{...e,parts:t}}}}function we(e,n){switch(e.type){case"Json":break;case"JsonPartitioned":{for(const[t,r]of Object.entries(e.parts))n(r);break}case"BinaryPartitioned":{for(const[t,r]of Object.entries(e.parts))n(r.index),n(r.values);break}}}function B(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&Array.isArray(n.data);case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);default:return!1}}function Pe(e){return B(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function Ae(e){switch(e.type){case"Json":{const n=Object.entries(e.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function Ee(e){switch(e.type){case"Json":{const n={};for(const t of e.data)n[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function xe(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t=e.parts.map(r=>({key:r.key,value:n(r.value)}));return{...e,parts:t}}case"BinaryPartitioned":{const t=e.parts.map(r=>({key:r.key,value:{index:n(r.value.index),values:n(r.value.values)}}));return{...e,parts:t}}}}const L=-2147483648,E=-9007199254740991n,ke=NaN,Se=NaN,z=null,U=null;function b(e,n){switch(n){case"Int":return e===L;case"Long":return e===Number(E)||e===E;case"Float":return Number.isNaN(e);case"Double":return Number.isNaN(e);case"String":return e===z;case"Bytes":return e===U;default:throw Error(`unsupported data type: ${n}`)}}function ve(e){if(!T(e))throw new Error(`Expected not-NA PValue, got ${e}`);return e}function T(e,n){if(!n)return typeof e=="string"||typeof e=="number"&&isFinite(e)||typeof e=="bigint";if(b(e,n))return!1;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function M(e,n){if(!n)return e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint";if(b(e,n))return!0;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function Ie(e){if(e===null||typeof e=="string"||typeof e=="number")return e;if(typeof e=="bigint")return{bigint:e.toString()};throw new Error(`Type ${typeof e} (value ${e}) not yet supported.`)}function K(e,n){if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint"){if(n&&!b(e,n)&&!M(e,n))throw new Error(`Unexpected value type, got ${typeof e}, expected ${n}`);return e}if(typeof e=="object"&&e!==null&&"bigint"in e&&typeof e.bigint=="string"){if(n&&n!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);return BigInt(e.bigint)}throw new Error(`Unsupported type ${typeof e} (value ${e}).`)}function Ne(e){if(e=q(e),e===null)throw new Error("Value is null");return e}function q(e){if(e=K(e),e===null)return null;if(typeof e=="string")return e;if(typeof e=="number"){if(!isFinite(e))throw new Error(`Value is not finite (${e})`);return e}if(typeof e=="bigint")return Number(e);throw new Error(`Unexpected value type: ${typeof e}`)}function _(e,n){const t=Math.floor(n/8),r=1<<7-n%8;return(e[t]&r)>0}const H={type:"absent"},W=null;function Ce(e){return typeof e=="object"&&e!==null&&e.type==="absent"}function Fe(e,n,t={}){if(_(e.absent,n))return t.absent===void 0?H:t.absent;const r=e.data[n],o=e.type;if(b(r,o))return t.na===void 0?W:t.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 Ve(e){return{kind:e.kind,valueType:e.valueType,name:e.name,domain:e.domain,parentAxes:e.parentAxes,axesId:v(e.axesSpec)}}function Oe(e){return{columnId:e.id,spec:e.spec}}function p(e){const{type:n,name:t,domain:r}=e,o={type:n,name:t};return r&&Object.entries(r).length>0&&Object.assign(o,{domain:r}),o}function v(e){return e.map(p)}function De(e){return g(p(e))}function Re(e,n){if(e===void 0)return n===void 0;if(n===void 0)return!0;for(const t in n)if(e[t]!==n[t])return!1;return!0}function G(e,n){return e.name===n.name&&Re(e.domain,n.domain)}function $e(e,n){return{...e,src:h(e.src,n)}}function h(e,n){switch(e.type){case"column":return{type:"column",column:n(e.column)};case"slicedColumn":return{type:"slicedColumn",column:n(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(t=>h(t,n))};case"outer":return{type:"outer",primary:h(e.primary,n),secondary:e.secondary.map(t=>h(t,n))};default:S(e)}}function Je(e){switch(e.type){case"axis":return{type:"axis",id:e.id};case"column":return{type:"column",id:e.id}}}function X(e){return g(e)}function je(e){return JSON.parse(e)}function V(e){return g(p(e))}function O(e,n){return JSON.stringify([e,n])}class Be{constructor(n){l(this,"domains",new Map);l(this,"axes",new Map);l(this,"domainPacks",[]);l(this,"domainPackToAnchor",new Map);this.anchors=n;const t=Object.entries(n);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let i=0;i<o.axesSpec.length;i++){const a=o.axesSpec[i],s=V(a);this.axes.set(s,{anchor:r,idx:i})}if(o.domain!==void 0){const i=Object.entries(o.domain);i.sort((a,s)=>a[0].localeCompare(s[0])),this.domainPackToAnchor.set(JSON.stringify(i),r),this.domainPacks.push(i.map(([a])=>a));for(const[a,s]of i){const u=O(a,s);this.domains.set(u,r)}}}}derive(n,t){const r={name:n.name,axes:[]};let o;if(n.domain!==void 0)e:for(const a of this.domainPacks){const s=[];for(const c of a){const f=n.domain[c];if(f!==void 0)s.push([c,f]);else break e}const u=this.domainPackToAnchor.get(JSON.stringify(s));if(u!==void 0){r.domainAnchor=u,o=new Set(a);break}}for(const[a,s]of Object.entries(n.domain??{})){if(o!==void 0&&o.has(a))continue;const u=O(a,s),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[a]=c?{anchor:c}:s}if(r.axes=n.axesSpec.map(a=>{const s=V(a),u=this.axes.get(s);return u===void 0?p(a):u}),!t||t.length===0)return r;const i=[];for(const a of t){const[s,u]=a;if(typeof s=="number"){if(s<0||s>=n.axesSpec.length)throw new Error(`Axis index ${s} is out of bounds (0-${n.axesSpec.length-1})`);i.push([s,u])}else{const c=n.axesSpec.findIndex(f=>f.name===s);if(c===-1)throw new Error(`Axis with name "${s}" not found in the column specification`);i.push([c,u])}}return i.sort((a,s)=>a[0]-s[0]),{source:r,axisFilters:i}}deriveS(n,t){return X(this.derive(n,t))}}function Le(e,n,t){const r={...n},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const i=e[r.domainAnchor];if(!i)throw new Error(`Anchor "${r.domainAnchor}" not found`);const a=i.domain||{};r.domain={...a,...r.domain},delete r.domainAnchor}if(r.domain){const i={};for(const[a,s]of Object.entries(r.domain))if(typeof s=="string")i[a]=s;else{const u=e[s.anchor];if(!u)throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);if(!u.domain||u.domain[a]===void 0){if(!o)throw new Error(`Domain key "${a}" not found in anchor "${s.anchor}"`);continue}i[a]=u.domain[a]}r.domain=i}return r.axes&&(r.axes=r.axes.map(i=>ze(e,i))),r}function ze(e,n){if(!Ue(n))return n;const t=n.anchor,r=e[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in n){if(n.idx<0||n.idx>=r.axesSpec.length)throw new Error(`Axis index ${n.idx} out of bounds for anchor "${t}"`);return r.axesSpec[n.idx]}else if("name"in n){const o=r.axesSpec.filter(i=>i.name===n.name);if(o.length>1)throw new Error(`Multiple axes with name "${n.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${n.name}" not found in anchor "${t}"`);return o[0]}else if("id"in n){const o=r.axesSpec.filter(i=>G(n.id,p(i)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function Ue(e){return typeof e=="object"&&"anchor"in e}function Te(e){return typeof e=="object"&&e!==null&&"source"in e&&"axisFilters"in e}function d(e){return e.kind==="PColumn"}function Q(e){return d(e.spec)}function Me(e){return d(e.obj)}function Ke(e){return d(e.obj.spec)}function qe(e){if(!Q(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function _e(e,n){return e===void 0?void 0:{...e,data:n(e.data)}}function He(e){const n=new Map,t=r=>{switch(r.type){case"column":n.set(r.column.id,r.column);return;case"slicedColumn":n.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:S(r)}};return t(e),[...n.values()]}function We(e){throw new Error("Unexpected object: "+e)}function w(e,n){switch(e.type){case"and":for(const t of e.operands)if(!w(t,n))return!1;return!0;case"or":for(const t of e.operands)if(w(t,n))return!0;return!1;case"not":return!w(e.operand,n);case"name":return d(n)&&n.name===e.name;case"name_pattern":return d(n)&&!!n.name.match(e.pattern);case"annotation":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]===e.value;case"annotation_pattern":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]!==void 0&&!!n.annotations[e.annotation].match(e.pattern);case"has_axes":return d(n)&&e.axes.every(t=>n.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,i])=>r.domain[o]===i))));default:We(e)}}function x(e,n){if(e.name!==void 0&&e.name!==n.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.type))return!1}else if(e.type!==n.type)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}return!0}function k(e,n){if(n.name!==void 0&&e.name!==n.name||n.namePattern!==void 0&&!new RegExp(n.namePattern).test(e.name))return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.valueType))return!1}else if(n.type!==e.valueType)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}if(n.axes!==void 0){const t=e.axesSpec.map(p);if(n.partialAxesMatch){for(const r of n.axes)if(!t.some(o=>x(r,o)))return!1}else{if(t.length!==n.axes.length)return!1;for(let r=0;r<n.axes.length;r++)if(!x(n.axes[r],t[r]))return!1}}if(n.annotations!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotations))if(t[r]!==o)return!1}if(n.annotationPatterns!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotationPatterns)){const i=t[r];if(i===void 0||!new RegExp(o).test(i))return!1}}return!0}function Ge(e){return Array.isArray(e)?n=>e.some(t=>d(n)&&k(n,t)):n=>d(n)&&k(n,e)}function Xe(e){const n={kind:e.kind,name:e.name};return e.domain!==void 0&&(n.domain=e.domain),d(e)&&(n.axesSpec=v(e.axesSpec)),g(n)}const Qe={href:"/"},Ye=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"),requireEnrichments:m.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).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.").readonly();function Ze(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function en(e,n,t=!1){return t?{__isRef:!0,blockId:e,name:n,requireEnrichments:!0}:{__isRef:!0,blockId:e,name:n}}function nn(e,n=!0){if(n)return{...e,requireEnrichments:!0};{const{requireEnrichments:t,...r}=e;return r}}function tn(e,n,t=!1){return e.blockId===n.blockId&&e.name===n.name&&(t||e.requireEnrichments===n.requireEnrichments)}function rn(e,n){return e.ok?{ok:!0,value:n(e.value)}:e}function on(e){if(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new DataView(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new DataView(e);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const sn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",an="0123456789ABCDEFGHIJKLMNOPQRSTUV",un="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Y(e,n,t){t=t||{};let r,o;switch(n){case"RFC3548":case"RFC4648":r=sn,o=!0;break;case"RFC4648-HEX":r=an,o=!0;break;case"Crockford":r=un,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(n))}const i=t.padding!==void 0?t.padding:o,a=on(e);let s=0,u=0,c="";for(let f=0;f<a.byteLength;f++)for(u=u<<8|a.getUint8(f),s+=8;s>=5;)c+=r[u>>>s-5&31],s-=5;if(s>0&&(c+=r[u<<5-s&31]),i)for(;c.length%8!==0;)c+="=";return c}const I=15,Z=24,N=m.z.string().length(Z).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function cn(){const e=new Uint8Array(I);return crypto.getRandomValues(e),N.parse(Y(e,"RFC4648"))}function ee(e){if(e.length!==I)throw new Error(`Wrong number of bytes: ${e.length}`);return N.parse(Y(e,"RFC4648"))}async function fn(e){const n=new TextEncoder,t=await crypto.subtle.digest("SHA-256",n.encode(e));return ee(new Uint8Array(t.slice(0,15)))}function dn(e){return JSON.stringify(e)}function ln(e){return g(e)}function mn(e){return JSON.parse(e)}class pn extends Error{constructor(){super(...arguments);l(this,"name","AbortError")}}class yn extends Error{constructor(){super(...arguments);l(this,"name","UiError")}}function hn(e){return e instanceof Error&&e.name==="AbortError"}function ne(e){return e instanceof Error?e.name==="AbortError"||ne(e.cause):!1}function gn(e){return e instanceof Error&&e.name==="AggregateError"}class te extends Error{constructor(){super(...arguments);l(this,"name","PFrameError")}}function bn(e){return e instanceof Error&&e.name==="PFrameError"}class wn extends te{constructor(){super(...arguments);l(this,"name","PFrameError.Driver")}}function Pn(e){return e instanceof Error&&e.name==="PFrameError.Driver"}function An(e){if(typeof e=="string")return`String value was thrown: ${e}`;if(e&&typeof e=="object")try{return`Plain object was thrown: ${JSON.stringify(e)}`}catch(n){return`Non-serializable object was thrown (JSON.stringify failed: ${n instanceof Error?n.message:String(n)}): ${String(e)}`}return`Non-Error value (${typeof e}) was thrown: ${e}`}function P(e){return e instanceof Error?e:new Error(An(e))}function A(e){const n=e.cause?A(e.cause):void 0,t=new Error(e.message,n!==void 0?{cause:n}:void 0);return t.name=e.name||"Error",t.stack=e.stack,t}function C(e){const n=P(e),t=n.cause?C(n.cause):void 0;return{name:n.name,message:n.message,stack:n.stack,...n.cause!==void 0&&{cause:t}}}function En(e){if(e.error)throw e.error instanceof Error?e.error:A(e.error);return e.value}function F(e){return e.error?{error:C(e.error)}:{value:e.value}}function xn(e){return e.error?{error:A(e.error)}:{value:e.value}}function re(e){try{return{value:e()}}catch(n){return{error:P(n)}}}async function oe(e){try{return{value:await e()}}catch(n){return{error:P(n)}}}function kn(e){const n=re(e);return F(n)}async function Sn(e){const n=await oe(e);return F(n)}const vn=["supportsLazyState"],In=["requiresUIAPIVersion","requiresModelAPIVersion"];function Nn(e,n,t=!0){return e===void 0?!1:e[n]===t}function Cn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("requires")&&t===!0).map(([n])=>n))}function Fn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("supports")&&t===!0).map(([n])=>n))}class ie extends Error{constructor(t){super(`Some of the block requirements are not supported by the runtime: ${Array.from(t.entries()).map(([r,o])=>`${r}: ${o}`).join(", ")}`);l(this,"name","IncompatibleFlagsError");this.incompatibleFlags=t}}class Vn{constructor(){l(this,"supportedRequirements",new Map)}addSupportedRequirement(n,t=!0){return this.supportedRequirements.has(n)||this.supportedRequirements.set(n,new Set),this.supportedRequirements.get(n).add(t),this}getIncompatibleFlags(n){if(n===void 0)return;const t=new Map;for(const[r,o]of Object.entries(n))if(r.startsWith("requires")){if(o===void 0)continue;const i=this.supportedRequirements.get(r);(i===void 0||!i.has(o))&&t.set(r,o)}return t.size===0?void 0:t}checkCompatibility(n){return this.getIncompatibleFlags(n)===void 0}throwIfIncompatible(n){const t=this.getIncompatibleFlags(n);if(t!==void 0)throw new ie(t)}}exports.AbortError=pn;exports.AllRequiresFeatureFlags=In;exports.AllSupportsFeatureFlags=vn;exports.AnchoredIdDeriver=Be;exports.DefaultNavigationState=Qe;exports.IncompatibleFlagsError=ie;exports.PFrameDriverError=wn;exports.PFrameError=te;exports.PTableAbsent=H;exports.PTableNA=W;exports.PValueBytesNA=U;exports.PValueDoubleNA=Se;exports.PValueFloatNA=ke;exports.PValueIntNA=L;exports.PValueLongNA=E;exports.PValueStringNA=z;exports.PlId=N;exports.PlIdBytes=I;exports.PlIdLength=Z;exports.PlRef=Ye;exports.RangeBytes=de;exports.RuntimeCapabilities=Vn;exports.UiError=yn;exports.canonicalizeAxisId=De;exports.canonicalizeJson=ln;exports.checkBlockFlag=Nn;exports.createPlRef=en;exports.dataInfoToEntries=Ae;exports.deriveNativeId=Xe;exports.deserializeError=A;exports.deserializeResult=xn;exports.digestPlId=fn;exports.ensureError=P;exports.ensureNotNAPValue=ve;exports.ensurePColumn=qe;exports.entriesToDataInfo=Ee;exports.executePSpecPredicate=w;exports.extractAllColumns=He;exports.extractAllRequirements=Cn;exports.extractAllSupports=Fn;exports.extractCodeWithInfo=ce;exports.extractConfigGeneric=fe;exports.getAxesId=v;exports.getAxisId=p;exports.getColumnIdAndSpec=Oe;exports.getFileNameFromHandle=he;exports.getFilePathFromHandle=j;exports.getPColumnSpecId=Ve;exports.getPTableColumnId=Je;exports.hasAbortError=ne;exports.isAbortError=hn;exports.isAggregateError=gn;exports.isDataInfo=ge;exports.isDataInfoEntries=B;exports.isFilteredPColumn=Te;exports.isImportFileHandleIndex=J;exports.isImportFileHandleUpload=$;exports.isLiveLog=pe;exports.isNotNAPValue=T;exports.isPColumn=Q;exports.isPColumnResult=Ke;exports.isPColumnSpec=d;exports.isPColumnSpecResult=Me;exports.isPFrameDriverError=Pn;exports.isPFrameError=bn;exports.isPTableAbsent=Ce;exports.isPValue=M;exports.isPartitionedDataInfoEntries=Pe;exports.isPlRef=Ze;exports.isValueAbsent=_;exports.isValueNA=b;exports.mapDataInfo=be;exports.mapDataInfoEntries=xe;exports.mapJoinEntry=h;exports.mapPObjectData=_e;exports.mapPTableDef=$e;exports.mapValueInVOE=rn;exports.matchAxis=x;exports.matchAxisId=G;exports.matchPColumn=k;exports.newRangeBytesOpt=le;exports.pTableValue=Fe;exports.pValueToStringOrNumber=Ne;exports.pValueToStringOrNumberOrNull=q;exports.parseColumnId=je;exports.parseJson=mn;exports.plId=ee;exports.plRefsEqual=tn;exports.resolveAnchors=Le;exports.safeConvertToPValue=K;exports.selectorsToPredicate=Ge;exports.serializeError=C;exports.serializeResult=F;exports.stringifyColumnId=X;exports.stringifyJson=dn;exports.toJsonSafePValue=Ie;exports.uniquePlId=cn;exports.unwrapResult=En;exports.validateRangeBytes=me;exports.visitDataInfo=we;exports.withEnrichments=nn;exports.wrapAndSerialize=kn;exports.wrapAndSerializeAsync=Sn;exports.wrapAsyncCallback=oe;exports.wrapCallback=re;
2
2
  //# sourceMappingURL=index.js.map