@datagrok/hit-triage 1.10.8 → 1.10.9

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,10 +1,6 @@
1
1
 
2
- > @datagrok/hit-triage@1.10.8 build /home/runner/work/public/public/packages/HitTriage
2
+ > @datagrok/hit-triage@1.10.9 build /home/runner/work/public/public/packages/HitTriage
3
3
  > grok build
4
4
 
5
- HitTriage warnings
6
- Latest package version (1.10.8) is not in CHANGELOG
7
- 
8
- Changelog guideline: https://datagrok.ai/help/develop/dev-process/changelog-policy#changelog-guideline
9
5
  Rspack compiled successfully
10
- bundled HitTriage in 0.8s 225 KB
6
+ bundled HitTriage in 0.6s 225 KB
@@ -0,0 +1,16 @@
1
+ {
2
+ "search.followSymlinks": false,
3
+ "cucumber.features": [
4
+ "bdd/features/**/*.feature"
5
+ ],
6
+ "cucumber.glue": [
7
+ "bdd/bindings/**/*.ts",
8
+ "node_modules/@datagrok-libraries/bdd/bindings/**/*.ts"
9
+ ],
10
+ "cucumber.parameterTypes": [
11
+ {
12
+ "name": "state",
13
+ "regexp": "visible|hidden|present|absent|enabled|disabled|partially checked|checked|unchecked|selected|empty|expanded|collapsed|focused|invalid|valid|ready|read-only|editable|busy|required"
14
+ }
15
+ ]
16
+ }
package/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # HitTriage changelog
2
2
 
3
- ## v.next
3
+ ## 1.10.9 (2026-10-15)
4
4
 
5
5
  * Hit Design, PeptiHit: Fixed the "Campaing Name" typo in the new-campaign form
6
+ * Hit Design, PeptiHit: Fixed column tags (such as `.choices`) and calculated columns' formulas being lost when a campaign was saved and reopened; a reopened calculated column follows its source again
6
7
  * AI: Exposed AI view functions on all four Hit apps — the landing views list/open/create/delete campaigns and templates, and the campaign table views get a hit-specific vocabulary (state, molecules, stages, status, save, submit) plus a search/call bridge to the standard table commands.
7
8
 
8
9
  ## 1.10.6 (2026-07-16)
@@ -0,0 +1 @@
1
+ {"tiers": ["viewers"]}
@@ -0,0 +1,99 @@
1
+ /* Hit Design's campaigns, as the features use them. A campaign is two files on the AppData share
2
+ (campaign.json and its table, enriched_table.csv), and every save also writes its row in the
3
+ hitdesign database's update log (a molecule edit would register V-iDs as well, which these features
4
+ never do). The campaign a feature uses is made for it through the JS API, the template embedded the
5
+ way a saved campaign carries it, and removed at feature end: its folder, and its rows in the
6
+ package's database, read back until they are gone. A run killed before its end is swept up when the
7
+ next one starts. */
8
+ import {Page} from '@playwright/test';
9
+ import {Given, When} from '@datagrok-libraries/bdd';
10
+ import {type ElementRef, atFeatureEnd, expect, gestures, locate, pollMs} from '@datagrok-libraries/bdd/runtime';
11
+
12
+ declare const grok: any;
13
+ declare const DG: any;
14
+
15
+ const CAMPAIGNS = 'System:AppData/HitTriage/Hit Design/campaigns';
16
+
17
+ /** Removes every campaign of the feature's key (`<key>-<n>`) — its folder and its rows in the hitdesign
18
+ * database — and returns what is still there: '' once all of it is gone. */
19
+ function removeCampaigns(page: Page, key: string): Promise<string> {
20
+ return page.evaluate(async ([root, k]) => {
21
+ const ids: string[] = (await grok.dapi.files.list(root))
22
+ .filter((f: any) => f.isDirectory && f.name.startsWith(`${k}-`)).map((f: any) => f.name);
23
+ for (const id of ids)
24
+ await grok.dapi.files.delete(`${root}/${id}`);
25
+ const conn = (await grok.dapi.connections.filter('name = "hitdesign"').list())
26
+ .find((c: any) => c.nqName === 'HitTriage:hitdesign');
27
+ const where = `app_name = 'Hit Design' and campaign_id like '${k}-%'`;
28
+ for (const table of ['update_logs', 'campaign_locks', 'campaign_vids'])
29
+ await conn.query('bdd-hit-design-cleanup', `delete from hitdesign.${table} where ${where} returning campaign_id`)
30
+ .apply();
31
+ const left: string[] = [];
32
+ for (const id of ids)
33
+ if (await grok.dapi.files.exists(`${root}/${id}`))
34
+ left.push(`folder ${id}`);
35
+ for (const table of ['update_logs', 'campaign_locks', 'campaign_vids']) {
36
+ const rows = (await conn.query('bdd-hit-design-cleanup', `select campaign_id from hitdesign.${table} where ${where}`)
37
+ .apply()).rowCount;
38
+ if (rows > 0)
39
+ left.push(`${rows} row(s) in hitdesign.${table}`);
40
+ }
41
+ return left.join(', ');
42
+ }, [CAMPAIGNS, key] as [string, string]);
43
+ }
44
+
45
+ async function removedAndReadBack(page: Page, name: string, key: string): Promise<void> {
46
+ let left = '';
47
+ await expect.poll(async () => left = await removeCampaigns(page, key),
48
+ {message: `the Hit Design campaign "${name}" removed from the share and the hitdesign database`, timeout: pollMs(30000)})
49
+ .toBe('').catch((e) => {
50
+ throw new Error(`the Hit Design campaign "${name}" is still on the server: ${left || e?.message}`);
51
+ });
52
+ }
53
+
54
+ export const campaignOnServer = Given('the Hit Design campaign {string} with a table of:',
55
+ async (page: Page, name: string, table: string[][]) => {
56
+ const key = 'BDD' + name.replace(/[^A-Za-z]/g, '').toUpperCase();
57
+ await removedAndReadBack(page, name, key);
58
+ atFeatureEnd(page, () => removedAndReadBack(page, name, key));
59
+ await page.evaluate(async ([root, n, k, rows]) => {
60
+ const id = `${k}-1`;
61
+ const csv = rows.map((r) => r.join(',')).join('\n') + '\n';
62
+ const types: {[_: string]: string} = {};
63
+ const semTypes: {[_: string]: string | null} = {};
64
+ for (const c of DG.DataFrame.fromCsv(csv).columns.toList()) {
65
+ types[c.name] = c.type;
66
+ semTypes[c.name] = c.name === 'Molecule' ? 'Molecule' : null;
67
+ }
68
+ await grok.dapi.files.writeAsText(`${root}/${id}/enriched_table.csv`, csv);
69
+ await grok.dapi.files.writeAsText(`${root}/${id}/campaign.json`, JSON.stringify({
70
+ name: id, friendlyName: n, templateName: n, status: 'In Progress', createDate: '2026/10/15', campaignFields: {},
71
+ columnSemTypes: semTypes, columnTypes: types, rowCount: rows.length - 1, filteredRowCount: rows.length - 1,
72
+ savePath: `System.AppData/HitTriage/Hit Design/campaigns/${id}/enriched_table.csv`, version: 1,
73
+ template: {name: n, key: k, campaignFields: [], stages: ['Design'],
74
+ compute: {descriptors: {enabled: false, args: []}, functions: [], scripts: [], queries: []}}}));
75
+ }, [CAMPAIGNS, name, key, table] as [string, string, string, string[][]]);
76
+ }, {tier: 'api', description: 'a campaign of that friendly name made through the JS API, its id "BDD" and the name\'s letters ("BDDBDDCOLUMNS-1"): its table the rows given (the first one the header), its template embedded (no compute, one "Design" stage); removed at feature end with its rows in the hitdesign database, read back, and swept the same way before it is made'});
77
+
78
+ /** The Tags input of the Column Properties dialog is a key and value per row, with an empty row only
79
+ * when the column has no tags: a new tag goes into that row, else into the one the first row's "+"
80
+ * inserts. */
81
+ export const addTag = When('user adds the {string} tag with value {string} to {element}',
82
+ async (page: Page, tag: string, value: string, target: ElementRef) => {
83
+ const root = (await locate(page, target)).first()
84
+ .locator('xpath=ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " ui-input-root ")][1]');
85
+ const rows = root.locator('tr');
86
+ const emptyRow = () => rows.evaluateAll((trs) => trs.findIndex((tr) => {
87
+ const inputs = Array.from(tr.querySelectorAll('input'));
88
+ return inputs.length === 2 && inputs.every((i) => i.value === '');
89
+ }));
90
+ if (await emptyRow() < 0)
91
+ await rows.first().locator('button').first().click();
92
+ let row = -1;
93
+ await expect.poll(async () => row = await emptyRow(), {message: `an empty row in ${target.phrase}`}).toBeGreaterThanOrEqual(0);
94
+ const [keyInput, valueInput] = [rows.nth(row).locator('input').nth(0), rows.nth(row).locator('input').nth(1)];
95
+ await keyInput.click();
96
+ await gestures.typeVerified(keyInput, tag, `the key of a new row in ${target.phrase}`);
97
+ await valueInput.click();
98
+ await gestures.typeVerified(valueInput, value, `the value of the "${tag}" row in ${target.phrase}`);
99
+ }, {tier: 'ui', description: 'types the tag and its value into an empty row of a Tags input (the Column Properties dialog\'s), a new one made with the first row\'s "+" when every row holds a tag'});
@@ -0,0 +1,61 @@
1
+ @journey
2
+ Feature: A Hit Design campaign keeps its columns' tags and formulas when it is saved and reopened
3
+ A campaign saves its table as CSV and, in campaign.json, each column's semantic type and type. A tag set on
4
+ a column (".choices" makes the grid edit the column with a dropdown) and a calculated column's formula live
5
+ in the column's tags, and the save kept neither: the reopened campaign had no dropdown, and its calculated
6
+ column came back as plain values that no longer followed their source. The campaign is reopened from the
7
+ app's campaign list, which reads both files from the server again.
8
+
9
+ The campaign is made for the feature and removed at its end, with its rows in the hitdesign database
10
+ (bindings/hit-design.ts). Its Notes column is empty, as a column the user has just added is.
11
+
12
+ Background:
13
+ Given user is logged in
14
+ And the Hit Design campaign "BDD Columns" with a table of:
15
+ | Molecule | Stage | V-iD | Score | Notes |
16
+ | CCO | Design | | 10 | |
17
+ | c1ccccc1 | Design | | 4 | |
18
+ And user opens the "Hit Design" app
19
+ When user clicks on "BDD Columns" link
20
+ Then the "BDD Columns" view should be current
21
+ And the table should have 2 rows
22
+
23
+ Scenario: A tag set on an empty column is there when the campaign is reopened
24
+ When user picks "Column Properties..." from the context menu of the "header Notes" area of grid
25
+ And user adds the ".choices" tag with value '["low","high"]' to "Tags" input in "Notes" dialog
26
+ And user clicks on OK button in "Notes" dialog
27
+ And user double-clicks on the "cell 1 of Notes" area of grid
28
+ Then cell editor should offer the choice "low"
29
+ When user presses Escape
30
+ And user clicks on "Submit..." button
31
+ And user clicks on Save button in "Submit" dialog
32
+ Then an info balloon containing "Campaign saved successfully" should have been shown
33
+ When user clicks on "Hit Design" link
34
+ And user clicks on "BDD Columns" link
35
+ Then the "BDD Columns" view should be current
36
+ And the table should have the columns "Molecule, Stage, V-iD, Score, Notes"
37
+ And "Notes" column should have tag ".choices" equal to '["low","high"]'
38
+ When user double-clicks on the "cell 1 of Notes" area of grid
39
+ Then cell editor should offer the choice "low"
40
+ And cell editor should offer the choice "high"
41
+ When user presses Escape
42
+ Then no error or warning balloon should have been shown
43
+
44
+ Scenario: A calculated column keeps its formula and follows its source when the campaign is reopened
45
+ When user adds a calculated column "Score x2" with formula "${Score} * 2"
46
+ Then the value of "Score x2" column in row 1 should be "20"
47
+ When user clicks on "Submit..." button
48
+ And user clicks on Save button in "Submit" dialog
49
+ Then an info balloon containing "Campaign saved successfully" should have been shown
50
+ When user clicks on "Hit Design" link
51
+ And user clicks on "BDD Columns" link
52
+ Then the "BDD Columns" view should be current
53
+ And the table should have the columns "Molecule, Stage, V-iD, Score, Notes, Score x2"
54
+ And "Score x2" column should have tag "formula" equal to "${Score} * 2"
55
+ When user double-clicks on the "cell 1 of Score" area of grid
56
+ And user presses Control+A in cell editor
57
+ And user types "7" into cell editor
58
+ And user presses Enter
59
+ Then the value of "Score" column in row 1 should be "7"
60
+ And the value of "Score x2" column in row 1 should be "14"
61
+ And no error or warning balloon should have been shown
@@ -0,0 +1,75 @@
1
+ /* eslint-disable max-len */
2
+ /* eslint-disable comma-spacing */
3
+ /* eslint-disable quotes */
4
+ /* ---
5
+ generated: features/hit-design/campaign-column-metadata.feature
6
+ generator: @datagrok-libraries/bdd — do not edit; run `grok-bdd compile` to regenerate
7
+ --- */
8
+ import {test} from '@playwright/test';
9
+ import '@datagrok-libraries/bdd/bindings/common/kinds';
10
+ import '@datagrok-libraries/bdd/bindings/common/parameter-types';
11
+ import '@datagrok-libraries/bdd/bindings/platform/datasets';
12
+ import '@datagrok-libraries/bdd/bindings/platform/elements';
13
+ import {addTag, campaignOnServer} from '../../bindings/hit-design.js';
14
+ import {loggedIn} from '@datagrok-libraries/bdd/bindings/common/session';
15
+ import {clickOn, pressKey, pressKeyIn, shouldOfferChoice, typeInto} from '@datagrok-libraries/bdd/bindings/common/steps';
16
+ import {columnTag, columnsExactly, valueInRow} from '@datagrok-libraries/bdd/bindings/platform/columns';
17
+ import {addCalculated, rowCount} from '@datagrok-libraries/bdd/bindings/platform/data';
18
+ import {openApp, viewIsCurrent} from '@datagrok-libraries/bdd/bindings/platform/steps';
19
+ import {doubleClickArea, infoBalloonText, noBalloons, pickFromAreaContextMenu} from '@datagrok-libraries/bdd/bindings/tiers/viewers/steps';
20
+ import {el, feature, journey} from '@datagrok-libraries/bdd/runtime';
21
+
22
+ test.describe("A Hit Design campaign keeps its columns' tags and formulas when it is saved and reopened", () => {
23
+ const session = feature(test, "features/hit-design/campaign-column-metadata.feature", import.meta.url);
24
+ test("A Hit Design campaign keeps its columns' tags and formulas when it is saved and reopened", {tag: ["@journey"]}, async ({browser}) => {
25
+ const page = await session.page(browser);
26
+ const run = journey(test, 2, page);
27
+ await session.step(13, "Given user is logged in", () => loggedIn(page));
28
+ await session.step(14, "And the Hit Design campaign \"BDD Columns\" with a table of:", () => campaignOnServer(page, "BDD Columns", [["Molecule","Stage","V-iD","Score","Notes"],["CCO","Design","","10",""],["c1ccccc1","Design","","4",""]]), [["Molecule","Stage","V-iD","Score","Notes"],["CCO","Design","","10",""],["c1ccccc1","Design","","4",""]]);
29
+ await session.step(18, "And user opens the \"Hit Design\" app", () => openApp(page, "Hit Design"));
30
+ await session.step(19, "When user clicks on \"BDD Columns\" link", () => clickOn(page, el("\"BDD Columns\" link")));
31
+ await session.step(20, "Then the \"BDD Columns\" view should be current", () => viewIsCurrent(page, "BDD Columns"));
32
+ await session.step(21, "And the table should have 2 rows", () => rowCount(page, 2));
33
+ await run.scenario("A tag set on an empty column is there when the campaign is reopened", async () => {
34
+ await session.step(24, "When user picks \"Column Properties...\" from the context menu of the \"header Notes\" area of grid", () => pickFromAreaContextMenu(page, "Column Properties...", "header Notes", el("grid")));
35
+ await session.step(25, "And user adds the \".choices\" tag with value '[\"low\",\"high\"]' to \"Tags\" input in \"Notes\" dialog", () => addTag(page, ".choices", "[\"low\",\"high\"]", el("\"Tags\" input in \"Notes\" dialog")));
36
+ await session.step(26, "And user clicks on OK button in \"Notes\" dialog", () => clickOn(page, el("OK button in \"Notes\" dialog")));
37
+ await session.step(27, "And user double-clicks on the \"cell 1 of Notes\" area of grid", () => doubleClickArea(page, "cell 1 of Notes", el("grid")));
38
+ await session.step(28, "Then cell editor should offer the choice \"low\"", () => shouldOfferChoice(page, el("cell editor"), "low"));
39
+ await session.step(29, "When user presses Escape", () => pressKey(page, "Escape"));
40
+ await session.step(30, "And user clicks on \"Submit...\" button", () => clickOn(page, el("\"Submit...\" button")));
41
+ await session.step(31, "And user clicks on Save button in \"Submit\" dialog", () => clickOn(page, el("Save button in \"Submit\" dialog")));
42
+ await session.step(32, "Then an info balloon containing \"Campaign saved successfully\" should have been shown", () => infoBalloonText(page, "Campaign saved successfully"));
43
+ await session.step(33, "When user clicks on \"Hit Design\" link", () => clickOn(page, el("\"Hit Design\" link")));
44
+ await session.step(34, "And user clicks on \"BDD Columns\" link", () => clickOn(page, el("\"BDD Columns\" link")));
45
+ await session.step(35, "Then the \"BDD Columns\" view should be current", () => viewIsCurrent(page, "BDD Columns"));
46
+ await session.step(36, "And the table should have the columns \"Molecule, Stage, V-iD, Score, Notes\"", () => columnsExactly(page, "Molecule, Stage, V-iD, Score, Notes"));
47
+ await session.step(37, "And \"Notes\" column should have tag \".choices\" equal to '[\"low\",\"high\"]'", () => columnTag(page, "Notes", ".choices", "[\"low\",\"high\"]"));
48
+ await session.step(38, "When user double-clicks on the \"cell 1 of Notes\" area of grid", () => doubleClickArea(page, "cell 1 of Notes", el("grid")));
49
+ await session.step(39, "Then cell editor should offer the choice \"low\"", () => shouldOfferChoice(page, el("cell editor"), "low"));
50
+ await session.step(40, "And cell editor should offer the choice \"high\"", () => shouldOfferChoice(page, el("cell editor"), "high"));
51
+ await session.step(41, "When user presses Escape", () => pressKey(page, "Escape"));
52
+ await session.step(42, "Then no error or warning balloon should have been shown", () => noBalloons(page));
53
+ });
54
+ await run.scenario("A calculated column keeps its formula and follows its source when the campaign is reopened", async () => {
55
+ await session.step(45, "When user adds a calculated column \"Score x2\" with formula \"${Score} * 2\"", () => addCalculated(page, "Score x2", "${Score} * 2"));
56
+ await session.step(46, "Then the value of \"Score x2\" column in row 1 should be \"20\"", () => valueInRow(page, "Score x2", 1, "20"));
57
+ await session.step(47, "When user clicks on \"Submit...\" button", () => clickOn(page, el("\"Submit...\" button")));
58
+ await session.step(48, "And user clicks on Save button in \"Submit\" dialog", () => clickOn(page, el("Save button in \"Submit\" dialog")));
59
+ await session.step(49, "Then an info balloon containing \"Campaign saved successfully\" should have been shown", () => infoBalloonText(page, "Campaign saved successfully"));
60
+ await session.step(50, "When user clicks on \"Hit Design\" link", () => clickOn(page, el("\"Hit Design\" link")));
61
+ await session.step(51, "And user clicks on \"BDD Columns\" link", () => clickOn(page, el("\"BDD Columns\" link")));
62
+ await session.step(52, "Then the \"BDD Columns\" view should be current", () => viewIsCurrent(page, "BDD Columns"));
63
+ await session.step(53, "And the table should have the columns \"Molecule, Stage, V-iD, Score, Notes, Score x2\"", () => columnsExactly(page, "Molecule, Stage, V-iD, Score, Notes, Score x2"));
64
+ await session.step(54, "And \"Score x2\" column should have tag \"formula\" equal to \"${Score} * 2\"", () => columnTag(page, "Score x2", "formula", "${Score} * 2"));
65
+ await session.step(55, "When user double-clicks on the \"cell 1 of Score\" area of grid", () => doubleClickArea(page, "cell 1 of Score", el("grid")));
66
+ await session.step(56, "And user presses Control+A in cell editor", () => pressKeyIn(page, "Control+A", el("cell editor")));
67
+ await session.step(57, "And user types \"7\" into cell editor", () => typeInto(page, "7", el("cell editor")));
68
+ await session.step(58, "And user presses Enter", () => pressKey(page, "Enter"));
69
+ await session.step(59, "Then the value of \"Score\" column in row 1 should be \"7\"", () => valueInRow(page, "Score", 1, "7"));
70
+ await session.step(60, "And the value of \"Score x2\" column in row 1 should be \"14\"", () => valueInRow(page, "Score x2", 1, "14"));
71
+ await session.step(61, "And no error or warning balloon should have been shown", () => noBalloons(page));
72
+ });
73
+ run.finish();
74
+ });
75
+ });
@@ -0,0 +1 @@
1
+ {"type": "module", "private": true}
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["es2022", "dom"],
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "skipLibCheck": true,
10
+ "esModuleInterop": true
11
+ },
12
+ "include": ["bindings", "generated"]
13
+ }
@@ -1,4 +1,4 @@
1
- var hittriage_test;(()=>{var e={397(e){!function(t,n){var o={};n(o);var i=o.default;for(var s in o)i[s]=o[s];"object"==typeof e.exports?e.exports=i:"function"==typeof define&&define.amd?define(function(){return i}):t.sha256=i}(this,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]);function n(e,n,o,i,s){for(var r,a,l,c,u,y,f,x,p,d,h,g,m;s>=64;){for(d=0,r=n[0],a=n[1],l=n[2],c=n[3],u=n[4],y=n[5],f=n[6],x=n[7];d<16;d++)h=i+4*d,e[d]=(255&o[h])<<24|(255&o[h+1])<<16|(255&o[h+2])<<8|255&o[h+3];for(d=16;d<64;d++)g=((p=e[d-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,m=((p=e[d-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,e[d]=(g+e[d-7]|0)+(m+e[d-16]|0);for(d=0;d<64;d++)g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&y^~u&f)|0)+(x+(t[d]+e[d]|0)|0)|0,m=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&a^r&l^a&l)|0,x=f,f=y,y=u,u=c+g|0,c=l,l=a,a=r,r=g+m|0;n[0]+=r,n[1]+=a,n[2]+=l,n[3]+=c,n[4]+=u,n[5]+=y,n[6]+=f,n[7]+=x,i+=64,s-=64}return i}var o=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return t.prototype.reset=function(){return this.state[0]=0x6a09e667,this.state[1]=0xbb67ae85,this.state[2]=0x3c6ef372,this.state[3]=0xa54ff53a,this.state[4]=0x510e527f,this.state[5]=0x9b05688c,this.state[6]=0x1f83d9ab,this.state[7]=0x5be0cd19,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(var e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this.finished)throw Error("SHA256: can't update because hash was finished.");var o=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[o++],t--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(o=n(this.temp,this.state,e,o,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[o++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,o=this.bufferLength,i=t/0x20000000|0,s=t<<3,r=t%64<56?64:128;this.buffer[o]=128;for(var a=o+1;a<r-8;a++)this.buffer[a]=0;this.buffer[r-8]=i>>>24&255,this.buffer[r-7]=i>>>16&255,this.buffer[r-6]=i>>>8&255,this.buffer[r-5]=i>>>0&255,this.buffer[r-4]=s>>>24&255,this.buffer[r-3]=s>>>16&255,this.buffer[r-2]=s>>>8&255,this.buffer[r-1]=s>>>0&255,n(this.temp,this.state,this.buffer,0,r),this.finished=!0}for(var a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=o;var i=function(){function e(e){this.inner=new o,this.outer=new o,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)new o().update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(var n=0;n<t.length;n++)t[n]^=54;this.inner.update(t);for(var n=0;n<t.length;n++)t[n]^=106;this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();function s(e){var t=new o().update(e),n=t.digest();return t.clean(),n}function r(e,t){var n=new i(e).update(t),o=n.digest();return n.clean(),o}e.HMAC=i,e.hash=s,e.default=s,e.hmac=r;var a=new Uint8Array(e.digestLength);e.hkdf=function(e,t,n,o){void 0===t&&(t=a),void 0===o&&(o=32);for(var s=new Uint8Array([1]),l=new i(r(t,e)),c=new Uint8Array(l.digestLength),u=c.length,y=new Uint8Array(o),f=0;f<o;f++)u===c.length&&(!function(e,t,n,o){var i=o[0];if(0===i)throw Error("hkdf: cannot expand more");t.reset(),i>1&&t.update(e),n&&t.update(n),t.update(o),t.finish(e),o[0]++}(c,l,n,s),u=0),y[f]=c[u++];return l.clean(),c.fill(0),s.fill(0),y},e.pbkdf2=function(e,t,n,o){for(var s=new i(e),r=s.digestLength,a=new Uint8Array(4),l=new Uint8Array(r),c=new Uint8Array(r),u=new Uint8Array(o),y=0;y*r<o;y++){var f=y+1;a[0]=f>>>24&255,a[1]=f>>>16&255,a[2]=f>>>8&255,a[3]=f>>>0&255,s.reset(),s.update(t),s.update(a),s.finish(c);for(var x=0;x<r;x++)l[x]=c[x];for(var x=2;x<=n;x++){s.reset(),s.update(c).finish(c);for(var p=0;p<r;p++)l[p]^=c[p]}for(var x=0;x<r&&y*r+x<o;x++)u[y*r+x]=l[x]}for(var y=0;y<r;y++)l[y]=c[y]=0;for(var y=0;y<4;y++)a[y]=0;return s.clean(),u}})}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";var e;n.r(o),n.d(o,{tests:()=>p,test:()=>R,_package:()=>N,initAutoTests:()=>E});let t=DG;n(397);let i=DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string
1
+ var hittriage_test;(()=>{var e={397(e){!function(t,n){var o={};n(o);var i=o.default;for(var s in o)i[s]=o[s];"object"==typeof e.exports?e.exports=i:"function"==typeof define&&define.amd?define(function(){return i}):t.sha256=i}(this,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]);function n(e,n,o,i,s){for(var r,a,l,c,u,y,f,x,p,h,d,g,m;s>=64;){for(h=0,r=n[0],a=n[1],l=n[2],c=n[3],u=n[4],y=n[5],f=n[6],x=n[7];h<16;h++)d=i+4*h,e[h]=(255&o[d])<<24|(255&o[d+1])<<16|(255&o[d+2])<<8|255&o[d+3];for(h=16;h<64;h++)g=((p=e[h-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,m=((p=e[h-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,e[h]=(g+e[h-7]|0)+(m+e[h-16]|0);for(h=0;h<64;h++)g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&y^~u&f)|0)+(x+(t[h]+e[h]|0)|0)|0,m=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&a^r&l^a&l)|0,x=f,f=y,y=u,u=c+g|0,c=l,l=a,a=r,r=g+m|0;n[0]+=r,n[1]+=a,n[2]+=l,n[3]+=c,n[4]+=u,n[5]+=y,n[6]+=f,n[7]+=x,i+=64,s-=64}return i}var o=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return t.prototype.reset=function(){return this.state[0]=0x6a09e667,this.state[1]=0xbb67ae85,this.state[2]=0x3c6ef372,this.state[3]=0xa54ff53a,this.state[4]=0x510e527f,this.state[5]=0x9b05688c,this.state[6]=0x1f83d9ab,this.state[7]=0x5be0cd19,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(var e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this.finished)throw Error("SHA256: can't update because hash was finished.");var o=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[o++],t--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(o=n(this.temp,this.state,e,o,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[o++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,o=this.bufferLength,i=t/0x20000000|0,s=t<<3,r=t%64<56?64:128;this.buffer[o]=128;for(var a=o+1;a<r-8;a++)this.buffer[a]=0;this.buffer[r-8]=i>>>24&255,this.buffer[r-7]=i>>>16&255,this.buffer[r-6]=i>>>8&255,this.buffer[r-5]=i>>>0&255,this.buffer[r-4]=s>>>24&255,this.buffer[r-3]=s>>>16&255,this.buffer[r-2]=s>>>8&255,this.buffer[r-1]=s>>>0&255,n(this.temp,this.state,this.buffer,0,r),this.finished=!0}for(var a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=o;var i=function(){function e(e){this.inner=new o,this.outer=new o,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)new o().update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(var n=0;n<t.length;n++)t[n]^=54;this.inner.update(t);for(var n=0;n<t.length;n++)t[n]^=106;this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();function s(e){var t=new o().update(e),n=t.digest();return t.clean(),n}function r(e,t){var n=new i(e).update(t),o=n.digest();return n.clean(),o}e.HMAC=i,e.hash=s,e.default=s,e.hmac=r;var a=new Uint8Array(e.digestLength);e.hkdf=function(e,t,n,o){void 0===t&&(t=a),void 0===o&&(o=32);for(var s=new Uint8Array([1]),l=new i(r(t,e)),c=new Uint8Array(l.digestLength),u=c.length,y=new Uint8Array(o),f=0;f<o;f++)u===c.length&&(!function(e,t,n,o){var i=o[0];if(0===i)throw Error("hkdf: cannot expand more");t.reset(),i>1&&t.update(e),n&&t.update(n),t.update(o),t.finish(e),o[0]++}(c,l,n,s),u=0),y[f]=c[u++];return l.clean(),c.fill(0),s.fill(0),y},e.pbkdf2=function(e,t,n,o){for(var s=new i(e),r=s.digestLength,a=new Uint8Array(4),l=new Uint8Array(r),c=new Uint8Array(r),u=new Uint8Array(o),y=0;y*r<o;y++){var f=y+1;a[0]=f>>>24&255,a[1]=f>>>16&255,a[2]=f>>>8&255,a[3]=f>>>0&255,s.reset(),s.update(t),s.update(a),s.finish(c);for(var x=0;x<r;x++)l[x]=c[x];for(var x=2;x<=n;x++){s.reset(),s.update(c).finish(c);for(var p=0;p<r;p++)l[p]^=c[p]}for(var x=0;x<r&&y*r+x<o;x++)u[y*r+x]=l[x]}for(var y=0;y<r;y++)l[y]=c[y]=0;for(var y=0;y<4;y++)a[y]=0;return s.clean(),u}})}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";var e;n.r(o),n.d(o,{tests:()=>h,test:()=>N,_package:()=>E,initAutoTests:()=>M});let t=DG;n(397);let i=DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string
2
2
  Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND
3
3
  ATOM
4
4
  END",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc
@@ -29,7 +29,7 @@ END",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-
29
29
  Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND
30
30
  ATOM
31
31
  END",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,
32
- ,,,,,,,,,,,,,,,,,,,,,`);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function r(e,t,n,o,i,s,r){try{var a=e[s](r),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(o,i)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,l,"next",e)}function l(e){r(s,o,i,a,l,"throw",e)}a(void 0)})}}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}i.columns.add(DG.Column.fromList(DG.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));let u=console.log.bind(console),y=console.info.bind(console),f=console.warn.bind(console),x=console.error.bind(console),p={},d="Auto Tests",h="Demo",g="Detectors",m="Core",b={};(e||(e={})).notNull=function(e,t){if(null==e)throw Error(`${null==t?"Value":t} not defined`)};class v{constructor(e,t,n){this.catchUnhandled=!0,this.report=!1,this.returnOnFail=!1,this.closeAll=!0,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t),void 0!==n&&(this.returnOnFail=n)}}class C{constructor(e,t,n,o){this.category=e,this.name=t,null!=o||(o={}),null!=o.timeout||(o.timeout=3e4),this.options=o,this.test=()=>a(function*(){return new Promise((e,t)=>a(function*(){let o="";try{DG.Test.isInDebug;let e=yield n();try{var i;o=null!=(i=null==e?void 0:e.toString())?i:""}catch(e){o="Can't convert test's result to string",console.error(`Can't convert test's result to string in the ${this.category}:${this.name} test`)}}catch(e){t(e)}e(o)}).call(this))}).call(this)}}function w(e,t,n){let o=void 0===t||t;if(n=n?`${n}, `:"",e!==o)throw Error(`${n}Expected "${o}", got "${e}"`)}function k(e,t,n){var o,i,s;let r=null!=(o=null!=(i=null==(s=e.options)?void 0:s.node)?i:t.node)&&o;return n.nodeOnly?r:!n.excludeNodeTests||!r}function O(e,t){return a(function*(){let n=e.id;if(b[n])return;let o=t?t.tests:p;if("DevTools"===e.name||t&&"DevTools"===t._package.name){var s=!0,r=!1,l=void 0;try{for(var c,u,y,f,x,v,k,O,D=window.dartTests[Symbol.iterator]();!(s=(O=D.next()).done);s=!0){let e=O.value,t=e.name.split(/\s*\|\s*!/g),n=null!=(c=t.pop())?c:e.name,i=t.length?m+": "+t.join(": "):m,s=n.split(" | ");n=s[s.length-1],s.unshift(i),s.pop(),i=s.join(": "),void 0===o[i]&&(o[i]={tests:[],clear:!0}),o[i].tests.push(new C(i,n,e.test,{isAggregated:!1,timeout:null!=(u=null==(f=e.options)?void 0:f.timeout)?u:3e4,skipReason:null==(x=e.options)?void 0:x.skipReason,owner:null==(v=e.options)?void 0:v.owner,benchmark:null!=(y=null==(k=e.options)?void 0:k.benchmark)&&y}))}}catch(e){r=!0,l=e}finally{try{s||null==D.return||D.return()}finally{if(r)throw l}}}let T=[],L=[],S=[],P=yield grok.dapi.functions.filter(`package.id = "${n}"`).list(),N=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);var R=!0,E=!1,M=void 0;try{for(var I,F,$,G,U=P[Symbol.iterator]();!(R=(G=U.next()).done);R=!0){let t=G.value,n=t.options.test,s=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){let i=n[e].matchAll(N),s={};Array.from(i).forEach(e=>{e[0].startsWith("skip")?s.skip=e[1]:e[0].startsWith("wait")?s.wait=parseInt(e[2]):e[0].startsWith("cat")?s.cat=e[3]:e[0].startsWith("timeout")&&(s.timeout=parseInt(e[4]))});let r=new C(null!=(I=s.cat)?I:d,1===n.length?t.name:`${t.name} ${e+1}`,()=>a(function*(){var o;let i=yield grok.functions.eval((o=n[e],o.replace(RegExp(t.name,"gi"),t.nqName)));if(s.wait&&(yield A(s.wait)),"boolean"==typeof i&&!i)throw`Failed: ${n[e]}, expected true, got ${i}`})(),{skipReason:s.skip,timeout:DG.Test.isInBenchmark?null!=(F=s.benchmarkTimeout)?F:108e5:null!=($=s.timeout)?$:3e4,node:t instanceof DG.DataQuery});if(s.cat){let e=s.cat;void 0===o[e]&&(o[e]={tests:[],clear:!0}),o[e].tests||(o[e].tests=[]),o[e].tests.push(r)}else T.push(r)}if(s){let e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new C(h,t.friendlyName,()=>a(function*(){yield A(300),grok.shell.clearLastError(),yield t.apply(),yield A(e||2e3);let n=yield grok.shell.lastError;if(n)throw Error(n)})(),{skipReason:t.options.demoSkip});L.push(n)}if(t.hasTag("semTypeDetector")){let n=i;t.options.testData&&(n=yield grok.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));let o=new C(g,t.friendlyName,()=>a(function*(){let o=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);var i=!0,s=!1,r=void 0;try{for(var a,l=n.clone().columns[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){let e=a.value,n=yield t.apply([e]);o.push(n||e.semType)}}catch(e){s=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(s)throw r}}let c=o.filter(e=>e);w(c.length,1),t.options.testDataColumnName&&w(c[0],t.options.testDataColumnName)})(),{skipReason:t.options.skipTest});S.push(o)}}}catch(e){E=!0,M=e}finally{try{R||null==U.return||U.return()}finally{if(E)throw M}}b[n]=!0,T.length>0&&(o[d]={tests:T,clear:!0}),L.length>0&&(o[h]={tests:L,clear:!0}),S.length>0&&(o[g]={tests:S,clear:!1})})()}function D(e){return a(function*(){return`${e.toString()}
33
- ${e.stack?yield DG.Logger.translateStackTrace(e.stack):""}`})()}function T(e,t,n,o,i,s){return a(function*(){var r,a,y,f,p,d,h,g,m,b,v,C,w,k;let O;n.length=0;let T=void 0!=t&&e.name.toLowerCase()!==t.toLowerCase(),A=(null==(a=e.options)?void 0:a.skipReason)||T,S=T?"skipped":null==(y=e.options)?void 0:y.skipReason;if(DG.Test.isInBenchmark&&!(null==(f=e.options)?void 0:f.benchmark))return void u(`Package testing: Skipped {{${e.category}}} {{${e.name}}} doesnt available in benchmark mode`);A&&!DG.Test.isInBenchmark&&u(`Package testing: Skipped {{${e.category}}} {{${e.name}}}`),A||u(`Package testing: Started {{${e.category}}} {{${e.name}}}`);let P=Date.now(),N=new Date(P).toISOString();try{A?O={name:e.name,owner:null!=(h=null==(g=e.options)?void 0:g.owner)?h:"",category:e.category,logs:"",date:N,success:!0,result:S,ms:0,skipped:!0,package:null!=i?i:"",flaking:DG.Test.isReproducing}:(DG.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),O={name:e.name,owner:null!=(m=null==(v=e.options)?void 0:v.owner)?m:"",category:e.category,logs:"",date:N,success:!0,result:null!=(b=(yield L(e.test,null!=o?o:3e4)).toString())?b:"OK",ms:0,skipped:!1,package:null!=i?i:"",flaking:DG.Test.isReproducing},DG.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),grok.shell.info(`Profiling of ${e.category}: ${e.name} finished
34
- Please ensure that you have opened DevTools (F12) / Performance panel before test starts.`)))}catch(t){x(t),O={name:e.name,owner:null!=(C=null==(w=e.options)?void 0:w.owner)?C:"",category:e.category,logs:"",date:N,success:!1,result:yield D(t),ms:0,skipped:!1,package:null!=i?i:"",flaking:!1}}if((null==(p=e.options)?void 0:p.isAggregated)&&O.result.constructor===DG.DataFrame){let e=O.result.col("success");if(e&&(O.success=e.stats.sum===e.length),!s){let e=O.result;e.columns.remove("stack"),e.rows.removeWhere(e=>e.get("success")),O.result=e}O.result=O.result.toCsv()}if(O.logs=n.join("\n"),O.ms=Date.now()-P,A||u(`Package testing: Finished {{${e.category}}} {{${e.name}}} with {{${O.success?"success":"error"}}} for ${O.ms} ms`),O.success||u(`Package testing: Result for {{${e.category}}} {{${e.name}}}: ${O.result}`),O.category=e.category,O.name=e.name,O.owner=null!=(r=null==(d=e.options)?void 0:d.owner)?r:"",!T){let t={success:O.success,result:O.result,ms:O.ms,date:O.date,skipped:O.skipped,category:e.category,name:e.name,logs:O.logs,owner:O.owner,flaking:DG.Test.isReproducing&&O.success,package:O.package};if(O.result.constructor==Object){let e=Object.keys(O.result).reduce((e,t)=>c(l({},e),{["result."+t]:O.result[t]}),{});t=l({},t,e)}t.result instanceof DG.DataFrame&&(t.result=JSON.stringify(null==(k=t.result)?void 0:k.toJson())||""),yield grok.shell.reportTest("package",t)}return O})()}function A(e){return a(function*(){yield new Promise(t=>setTimeout(t,e))})()}function L(e,t,n){let o=void 0===n?"EXECUTION TIMEOUT":n;return a(function*(){let n=null,i=new Promise((e,i)=>{n=setTimeout(()=>{i(o)},t)});try{return yield Promise.race([e(),i])}finally{n&&clearTimeout(n)}})()}function S(e,t,n,o,i,s,r){try{var a=e[s](r),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(o,i)}function P(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function r(e){S(s,o,i,r,a,"next",e)}function a(e){S(s,o,i,r,a,"throw",e)}r(void 0)})}}DG.DataFrame.fromColumns([DG.Column.fromStrings("col",["val1","val2","val3"])]);let N=new t.Package;function R(e,n,o){return P(function*(){var i;let r=yield(i={category:e,test:n,testContext:o},a(function*(){let e,t=(null==i?void 0:i.nodeOptions)?i.nodeOptions.package:grok.functions.getCurrentCall().func.package;if(!t)throw Error("Can't run tests outside of the package");let n=null==(S=t.packageOwner)?void 0:S.match(/<([^>]*)>/),o=n?n[1]:"";void 0!=t&&(yield O(t));let r=[];console.log("Running tests..."),console.log(i),null!=i||(i={}),null!=(P=i).testContext||(P.testContext=new v),grok.shell.clearLastError();let d=(e=[],console.log=(...t)=>{e.push(...t),u(...t)},console.info=(...t)=>{e.push(...t),y(...t)},console.warn=(...t)=>{e.push(...t),f(...t)},console.error=(...t)=>{e.push(...t),x(...t)},e);yield(b=p,C=i,a(function*(){try{let y=(null==C?void 0:C.skipToCategory)!=void 0,f=!1;var e=!0,n=!1,i=void 0;try{for(var p,h,g,m,v,w,O=Object.entries(b)[Symbol.iterator]();!(e=(w=O.next()).done);e=!0){let e,n=(p=w.value,function(e){if(Array.isArray(e))return e}(p)||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],s=!0,r=!1;try{for(o=o.call(e);!(s=(t=o.next()).done)&&(i.push(t.value),2!==i.length);s=!0);}catch(e){r=!0,n=e}finally{try{s||null==o.return||o.return()}finally{if(r)throw n}}return i}}(p)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(p)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=n[0],x=n[1];if((null==(m=C.exclude)?void 0:m.some(e=>i.startsWith(e)))||(null==C?void 0:C.category)!=null&&!i.toLowerCase().startsWith(null==C?void 0:C.category.toLowerCase().trim()))continue;if(y)if(f)y=!1;else{if((null==C?void 0:C.skipToCategory)==null||i.toLowerCase().trim()!==(null==C?void 0:C.skipToCategory.toLowerCase().trim()))continue;f=!0}let b=(null!=(h=x.tests)?h:[]).filter(e=>k(e,x,C));if((C.nodeOnly||C.excludeNodeTests)&&0===b.length)continue;let O=void 0==x.tests?void 0:b.every(e=>{var t;return(null==(t=e.options)?void 0:t.skipReason)||(null==C?void 0:C.test)!=null&&C.test.toLowerCase()!==e.name.toLowerCase()});if(!O){let e=b.filter(e=>{var t;return(null==(t=e.options)?void 0:t.skipReason)||(null==C?void 0:C.test)!=null&&C.test.toLowerCase()!==e.name.toLowerCase()}).length;u(`Package testing: Started {{${i}}}${e>0?` skipped {{${e}}}`:""}`),x.beforeStatus=yield E(x.before,i)}C.stressTest&&(b=b.filter(e=>{var t;return null==(t=e.options)?void 0:t.stressTest}),b=function(e){let t=e.slice();return t.sort(()=>Math.random()-.5),t}(b)),(null!=(g=null==(v=C.tags)?void 0:v.length)?g:0)>0&&(b=b.filter(e=>{var t,n;return null==(n=e.options)||null==(t=n.tags)?void 0:t.some(e=>{var t;return(null!=(t=null==C?void 0:C.tags)?t:[]).includes(e)})})),x.beforeStatus?(e=Array.from(b.map(e=>({date:new Date().toISOString(),category:i,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})))).forEach(e=>a(function*(){return yield grok.shell.reportTest("package",e)})()):e=yield function(e,n,i){return a(function*(){var s,r,a,u,y,f,x,p,h,g,m,b,v,C,w,O,D,A,L,S,P;let N=(null!=(s=e.tests)?s:[]).filter(t=>k(t,e,n)),R=[],E=M();if(e.clear){let s=i&&void 0!=n.skipToTest;for(let i=0;i<N.length;i++){N[i].options&&(null==(p=N[i].options)?void 0:p.benchmark)===void 0&&(N[i].options||(N[i].options={}),N[i].options.benchmark=null!=(h=e.benchmarks)&&h);let C=N[i];if(n.test&&n.test.toLowerCase()!==C.name.toLowerCase())continue;if(s)if((null==n?void 0:n.skipToTest)==void 0||C.name.toLowerCase().trim()!==(null==n?void 0:n.skipToTest.toLowerCase().trim()))continue;else s=!1;(null==C?void 0:C.options)&&(C.options.owner=null!=(g=null!=(m=null!=(b=null==(v=N[i].options)?void 0:v.owner)?b:null==e?void 0:e.owner)?m:o)?g:"");let w=yield T(C,null==n?void 0:n.test,d,DG.Test.isInBenchmark?null!=(r=null==(u=N[i].options)?void 0:u.benchmarkTimeout)?r:108e5:null!=(a=null==(y=N[i].options)?void 0:y.timeout)?a:3e4,t.name,n.verbose);if((null==(f=C.options)?void 0:f.skipReason)||!window.gc||(yield window.gc()),w&&(R.push(c(l({},w),{widgetsDifference:M()-E})),n.returnOnFail&&n.skipToTest!==C.name&&!w.success&&!w.skipped))break;n.nodeOptions||(null==(x=n.testContext)?void 0:x.closeAll)===!1||(grok.shell.closeAll(),DG.Balloon.closeAll())}}else{let s=i&&void 0!=n.skipToTest;for(let i=0;i<N.length;i++){let r=N[i];if(n.test&&n.test.toLowerCase()!==r.name.toLowerCase())continue;if(s){(null==n?void 0:n.skipToTest)!=void 0&&r.name.toLowerCase().trim()===(null==n?void 0:n.skipToTest.toLowerCase().trim())&&(s=!1);continue}(null==r?void 0:r.options)&&(r.options.owner=null!=(A=null!=(L=null!=(S=null==(P=N[i].options)?void 0:P.owner)?S:null==e?void 0:e.owner)?L:o)?A:"");let a=yield T(r,null==n?void 0:n.test,d,DG.Test.isInBenchmark?null!=(C=null==(w=N[i].options)?void 0:w.benchmarkTimeout)?C:108e5:null==(O=N[i].options)?void 0:O.timeout,t.name,n.verbose);if((null==(D=r.options)?void 0:D.skipReason)||!window.gc||(yield window.gc()),a&&(R.push(c(l({},a),{widgetsDifference:M()-E})),n.returnOnFail&&n.skipToTest!==r.name&&!a.success&&!a.skipped))break}}return R})()}(x,C,y);let D=e.filter(e=>"skipped"!=e.result);if(O||(x.afterStatus=yield E(x.after,i)),x.afterStatus&&(u(`Package testing: Category after() {{${i}}} failed`),u(`Package testing: Result for {{${i}}} after: ${x.afterStatus}`),D.push({date:new Date().toISOString(),category:i,name:"after",success:!1,result:x.afterStatus,ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})),x.beforeStatus&&(u(`Package testing: Category before() {{${i}}} failed`),u(`Package testing: Result for {{${i}}} before: ${x.beforeStatus}`),D.push({date:new Date().toISOString(),category:i,name:"before",success:!1,result:x.beforeStatus,ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})),r.push(...D),C.returnOnFail&&D.some(e=>!e.success&&!e.skipped&&e.name!==C.skipToTest))break}}catch(e){n=!0,i=e}finally{try{e||null==O.return||O.return()}finally{if(n)throw i}}}finally{console.log=u,console.info=y,console.warn=f,console.error=x}if(C.testContext.catchUnhandled&&!DG.Test.isInBenchmark){yield A(1e3);let e=yield grok.shell.lastError;if(void 0!=e){let n={logs:"",date:new Date().toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1,owner:null!=o?o:"",package:t.name,widgetsDifference:0};u(`Package testing: Unhandled Exception: ${e}`),r.push(c(l({},n),{flaking:DG.Test.isReproducing&&!e})),n.package=t.name,yield grok.shell.reportTest("package",n)}}})());var h=!0,g=!1,m=void 0;try{for(var b,C,w,S,P,N,R=r[Symbol.iterator]();!(h=(N=R.next()).done);h=!0){let e=N.value;e.result=e.result.toString().replace(/"/g,"'"),void 0!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"))}}catch(e){g=!0,m=e}finally{try{h||null==R.return||R.return()}finally{if(g)throw m}}return r;function E(e,t){return a(function*(){let n;try{void 0!==e&&(yield L(()=>a(function*(){yield e()})(),1e5,`before ${t}: timeout error`))}catch(e){n=yield D(e)}return n})()}function M(){if("u">typeof process)return 0;let e=-1;try{e=DG.Widget.getAll().length}catch(e){var t;console.warn(null!=(t=e.message)?t:e)}return e}})());return t.DataFrame.fromObjects(r)})()}function E(){return P(function*(){yield O(N,N.getModule("package-test.js"))})()}})(),hittriage_test=o})();
32
+ ,,,,,,,,,,,,,,,,,,,,,`),s=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAIAAACDRijCAAAAQElEQVR4nGO8Y2PDQA3ARBVTGKhoEAucpXz4MBn679ra0sxFaDYQBMqoPhh8gc00fA1iQeOTl5oYqOgixuGbaQF0Bgp24E7RmwAAAABJRU5ErkJggg=="),e=>e.charCodeAt(0));function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t,n,o,i,s,r){try{var a=e[s](r),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(o,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function r(e){a(s,o,i,r,l,"next",e)}function l(e){a(s,o,i,r,l,"throw",e)}r(void 0)})}}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}i.columns.add(DG.Column.fromList(DG.TYPE.BYTE_ARRAY,"BinaryImage",Array.from({length:11},()=>s)));let y=console.log.bind(console),f=console.info.bind(console),x=console.warn.bind(console),p=console.error.bind(console),h={},d="Auto Tests",g="Demo",m="Detectors",b="Core",v={};(e||(e={})).notNull=function(e,t){if(null==e)throw Error(`${null==t?"Value":t} not defined`)};class C{constructor(e,t,n){this.catchUnhandled=!0,this.report=!1,this.returnOnFail=!1,this.closeAll=!0,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t),void 0!==n&&(this.returnOnFail=n)}}class w{constructor(e,t,n,o){this.category=e,this.name=t,null!=o||(o={}),null!=o.timeout||(o.timeout=3e4),this.options=o,this.test=()=>l(function*(){return new Promise((e,t)=>l(function*(){let o="";try{DG.Test.isInDebug;let e=yield n();try{var i;o=null!=(i=null==e?void 0:e.toString())?i:""}catch(e){o="Can't convert test's result to string",console.error(`Can't convert test's result to string in the ${this.category}:${this.name} test`)}}catch(e){t(e)}e(o)}).call(this))}).call(this)}}function k(e,t,n){let o=void 0===t||t;if(n=n?`${n}, `:"",e!==o)throw Error(`${n}Expected "${o}", got "${e}"`)}function A(e,t,n){var o,i,s;let r=null!=(o=null!=(i=null==(s=e.options)?void 0:s.node)?i:t.node)&&o;return n.nodeOnly?r:!n.excludeNodeTests||!r}function O(e,t){return l(function*(){let n=e.id;if(v[n])return;let o=t?t.tests:h;if("DevTools"===e.name||t&&"DevTools"===t._package.name){var s=!0,r=!1,a=void 0;try{for(var c,u,y,f,x,p,C,A,O=window.dartTests[Symbol.iterator]();!(s=(A=O.next()).done);s=!0){let e=A.value,t=e.name.split(/\s*\|\s*!/g),n=null!=(c=t.pop())?c:e.name,i=t.length?b+": "+t.join(": "):b,s=n.split(" | ");n=s[s.length-1],s.unshift(i),s.pop(),i=s.join(": "),void 0===o[i]&&(o[i]={tests:[],clear:!0}),o[i].tests.push(new w(i,n,e.test,{isAggregated:!1,timeout:null!=(u=null==(f=e.options)?void 0:f.timeout)?u:3e4,skipReason:null==(x=e.options)?void 0:x.skipReason,owner:null==(p=e.options)?void 0:p.owner,benchmark:null!=(y=null==(C=e.options)?void 0:C.benchmark)&&y}))}}catch(e){r=!0,a=e}finally{try{s||null==O.return||O.return()}finally{if(r)throw a}}}let D=[],T=[],S=[],P=yield grok.dapi.functions.filter(`package.id = "${n}"`).list(),R=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);var E=!0,N=!1,M=void 0;try{for(var I,F,G,$,U=P[Symbol.iterator]();!(E=($=U.next()).done);E=!0){let t=$.value,n=t.options.test,s=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){let i=n[e].matchAll(R),s={};Array.from(i).forEach(e=>{e[0].startsWith("skip")?s.skip=e[1]:e[0].startsWith("wait")?s.wait=parseInt(e[2]):e[0].startsWith("cat")?s.cat=e[3]:e[0].startsWith("timeout")&&(s.timeout=parseInt(e[4]))});let r=new w(null!=(I=s.cat)?I:d,1===n.length?t.name:`${t.name} ${e+1}`,()=>l(function*(){var o;let i=yield grok.functions.eval((o=n[e],o.replace(RegExp(t.name,"gi"),t.nqName)));if(s.wait&&(yield L(s.wait)),"boolean"==typeof i&&!i)throw`Failed: ${n[e]}, expected true, got ${i}`})(),{skipReason:s.skip,timeout:DG.Test.isInBenchmark?null!=(F=s.benchmarkTimeout)?F:108e5:null!=(G=s.timeout)?G:3e4,node:t instanceof DG.DataQuery});if(s.cat){let e=s.cat;void 0===o[e]&&(o[e]={tests:[],clear:!0}),o[e].tests||(o[e].tests=[]),o[e].tests.push(r)}else D.push(r)}if(s){let e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new w(g,t.friendlyName,()=>l(function*(){yield L(300),grok.shell.clearLastError(),yield t.apply(),yield L(e||2e3);let n=yield grok.shell.lastError;if(n)throw Error(n)})(),{skipReason:t.options.demoSkip});T.push(n)}if(t.hasTag("semTypeDetector")){let n=i;t.options.testData&&(n=yield grok.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));let o=new w(m,t.friendlyName,()=>l(function*(){let o=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);var i=!0,s=!1,r=void 0;try{for(var a,l=n.clone().columns[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){let e=a.value,n=yield t.apply([e]);o.push(n||e.semType)}}catch(e){s=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(s)throw r}}let c=o.filter(e=>e);k(c.length,1),t.options.testDataColumnName&&k(c[0],t.options.testDataColumnName)})(),{skipReason:t.options.skipTest});S.push(o)}}}catch(e){N=!0,M=e}finally{try{E||null==U.return||U.return()}finally{if(N)throw M}}v[n]=!0,D.length>0&&(o[d]={tests:D,clear:!0}),T.length>0&&(o[g]={tests:T,clear:!0}),S.length>0&&(o[m]={tests:S,clear:!1})})()}function D(e){return l(function*(){return`${e.toString()}
33
+ ${e.stack?yield DG.Logger.translateStackTrace(e.stack):""}`})()}function T(e,t,n,o,i,s){return l(function*(){var r,a,l,f,x,h,d,g,m,b,v,C,w,k;let A;n.length=0;let O=void 0!=t&&e.name.toLowerCase()!==t.toLowerCase(),T=(null==(a=e.options)?void 0:a.skipReason)||O,L=O?"skipped":null==(l=e.options)?void 0:l.skipReason;if(DG.Test.isInBenchmark&&!(null==(f=e.options)?void 0:f.benchmark))return void y(`Package testing: Skipped {{${e.category}}} {{${e.name}}} doesnt available in benchmark mode`);T&&!DG.Test.isInBenchmark&&y(`Package testing: Skipped {{${e.category}}} {{${e.name}}}`),T||y(`Package testing: Started {{${e.category}}} {{${e.name}}}`);let P=Date.now(),R=new Date(P).toISOString();try{T?A={name:e.name,owner:null!=(d=null==(g=e.options)?void 0:g.owner)?d:"",category:e.category,logs:"",date:R,success:!0,result:L,ms:0,skipped:!0,package:null!=i?i:"",flaking:DG.Test.isReproducing}:(DG.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),A={name:e.name,owner:null!=(m=null==(v=e.options)?void 0:v.owner)?m:"",category:e.category,logs:"",date:R,success:!0,result:null!=(b=(yield S(e.test,null!=o?o:3e4)).toString())?b:"OK",ms:0,skipped:!1,package:null!=i?i:"",flaking:DG.Test.isReproducing},DG.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),grok.shell.info(`Profiling of ${e.category}: ${e.name} finished
34
+ Please ensure that you have opened DevTools (F12) / Performance panel before test starts.`)))}catch(t){p(t),A={name:e.name,owner:null!=(C=null==(w=e.options)?void 0:w.owner)?C:"",category:e.category,logs:"",date:R,success:!1,result:yield D(t),ms:0,skipped:!1,package:null!=i?i:"",flaking:!1}}if((null==(x=e.options)?void 0:x.isAggregated)&&A.result.constructor===DG.DataFrame){let e=A.result.col("success");if(e&&(A.success=e.stats.sum===e.length),!s){let e=A.result;e.columns.remove("stack"),e.rows.removeWhere(e=>e.get("success")),A.result=e}A.result=A.result.toCsv()}if(A.logs=n.join("\n"),A.ms=Date.now()-P,T||y(`Package testing: Finished {{${e.category}}} {{${e.name}}} with {{${A.success?"success":"error"}}} for ${A.ms} ms`),A.success||y(`Package testing: Result for {{${e.category}}} {{${e.name}}}: ${A.result}`),A.category=e.category,A.name=e.name,A.owner=null!=(r=null==(h=e.options)?void 0:h.owner)?r:"",!O){let t={success:A.success,result:A.result,ms:A.ms,date:A.date,skipped:A.skipped,category:e.category,name:e.name,logs:A.logs,owner:A.owner,flaking:DG.Test.isReproducing&&A.success,package:A.package};if(A.result.constructor==Object){let e=Object.keys(A.result).reduce((e,t)=>u(c({},e),{["result."+t]:A.result[t]}),{});t=c({},t,e)}t.result instanceof DG.DataFrame&&(t.result=JSON.stringify(null==(k=t.result)?void 0:k.toJson())||""),yield grok.shell.reportTest("package",t)}return A})()}function L(e){return l(function*(){yield new Promise(t=>setTimeout(t,e))})()}function S(e,t,n){let o=void 0===n?"EXECUTION TIMEOUT":n;return l(function*(){let n=null,i=new Promise((e,i)=>{n=setTimeout(()=>{i(o)},t)});try{return yield Promise.race([e(),i])}finally{n&&clearTimeout(n)}})()}function P(e,t,n,o,i,s,r){try{var a=e[s](r),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(o,i)}function R(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function r(e){P(s,o,i,r,a,"next",e)}function a(e){P(s,o,i,r,a,"throw",e)}r(void 0)})}}DG.DataFrame.fromColumns([DG.Column.fromStrings("col",["val1","val2","val3"])]);let E=new t.Package;function N(e,n,o){return R(function*(){var i;let s=yield(i={category:e,test:n,testContext:o},l(function*(){let e,t=(null==i?void 0:i.nodeOptions)?i.nodeOptions.package:grok.functions.getCurrentCall().func.package;if(!t)throw Error("Can't run tests outside of the package");let n=null==(k=t.packageOwner)?void 0:k.match(/<([^>]*)>/),o=n?n[1]:"";void 0!=t&&(yield O(t));let s=[];console.log("Running tests..."),console.log(i),null!=i||(i={}),null!=(P=i).testContext||(P.testContext=new C),grok.shell.clearLastError();let a=(e=[],console.log=(...t)=>{e.push(...t),y(...t)},console.info=(...t)=>{e.push(...t),f(...t)},console.warn=(...t)=>{e.push(...t),x(...t)},console.error=(...t)=>{e.push(...t),p(...t)},e);yield(b=h,v=i,l(function*(){try{let f=(null==v?void 0:v.skipToCategory)!=void 0,x=!1;var e=!0,n=!1,i=void 0;try{for(var h,d,g,m,C,w,k=Object.entries(b)[Symbol.iterator]();!(e=(w=k.next()).done);e=!0){let e,n=(h=w.value,function(e){if(Array.isArray(e))return e}(h)||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],s=!0,r=!1;try{for(o=o.call(e);!(s=(t=o.next()).done)&&(i.push(t.value),2!==i.length);s=!0);}catch(e){r=!0,n=e}finally{try{s||null==o.return||o.return()}finally{if(r)throw n}}return i}}(h)||function(e){if(e){if("string"==typeof e)return r(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,2)}}(h)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=n[0],p=n[1];if((null==(m=v.exclude)?void 0:m.some(e=>i.startsWith(e)))||(null==v?void 0:v.category)!=null&&!i.toLowerCase().startsWith(null==v?void 0:v.category.toLowerCase().trim()))continue;if(f)if(x)f=!1;else{if((null==v?void 0:v.skipToCategory)==null||i.toLowerCase().trim()!==(null==v?void 0:v.skipToCategory.toLowerCase().trim()))continue;x=!0}let b=(null!=(d=p.tests)?d:[]).filter(e=>A(e,p,v));if((v.nodeOnly||v.excludeNodeTests)&&0===b.length)continue;let k=void 0==p.tests?void 0:b.every(e=>{var t;return(null==(t=e.options)?void 0:t.skipReason)||(null==v?void 0:v.test)!=null&&v.test.toLowerCase()!==e.name.toLowerCase()});if(!k){let e=b.filter(e=>{var t;return(null==(t=e.options)?void 0:t.skipReason)||(null==v?void 0:v.test)!=null&&v.test.toLowerCase()!==e.name.toLowerCase()}).length;y(`Package testing: Started {{${i}}}${e>0?` skipped {{${e}}}`:""}`),p.beforeStatus=yield N(p.before,i)}v.stressTest&&(b=b.filter(e=>{var t;return null==(t=e.options)?void 0:t.stressTest}),b=function(e){let t=e.slice();return t.sort(()=>Math.random()-.5),t}(b)),(null!=(g=null==(C=v.tags)?void 0:C.length)?g:0)>0&&(b=b.filter(e=>{var t,n;return null==(n=e.options)||null==(t=n.tags)?void 0:t.some(e=>{var t;return(null!=(t=null==v?void 0:v.tags)?t:[]).includes(e)})})),p.beforeStatus?(e=Array.from(b.map(e=>({date:new Date().toISOString(),category:i,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})))).forEach(e=>l(function*(){return yield grok.shell.reportTest("package",e)})()):e=yield function(e,n,i){return l(function*(){var s,r,l,y,f,x,p,h,d,g,m,b,v,C,w,k,O,D,L,S,P;let R=(null!=(s=e.tests)?s:[]).filter(t=>A(t,e,n)),E=[],N=M();if(e.clear){let s=i&&void 0!=n.skipToTest;for(let i=0;i<R.length;i++){R[i].options&&(null==(h=R[i].options)?void 0:h.benchmark)===void 0&&(R[i].options||(R[i].options={}),R[i].options.benchmark=null!=(d=e.benchmarks)&&d);let C=R[i];if(n.test&&n.test.toLowerCase()!==C.name.toLowerCase())continue;if(s)if((null==n?void 0:n.skipToTest)==void 0||C.name.toLowerCase().trim()!==(null==n?void 0:n.skipToTest.toLowerCase().trim()))continue;else s=!1;(null==C?void 0:C.options)&&(C.options.owner=null!=(g=null!=(m=null!=(b=null==(v=R[i].options)?void 0:v.owner)?b:null==e?void 0:e.owner)?m:o)?g:"");let w=yield T(C,null==n?void 0:n.test,a,DG.Test.isInBenchmark?null!=(r=null==(y=R[i].options)?void 0:y.benchmarkTimeout)?r:108e5:null!=(l=null==(f=R[i].options)?void 0:f.timeout)?l:3e4,t.name,n.verbose);if((null==(x=C.options)?void 0:x.skipReason)||!window.gc||(yield window.gc()),w&&(E.push(u(c({},w),{widgetsDifference:M()-N})),n.returnOnFail&&n.skipToTest!==C.name&&!w.success&&!w.skipped))break;n.nodeOptions||(null==(p=n.testContext)?void 0:p.closeAll)===!1||(grok.shell.closeAll(),DG.Balloon.closeAll())}}else{let s=i&&void 0!=n.skipToTest;for(let i=0;i<R.length;i++){let r=R[i];if(n.test&&n.test.toLowerCase()!==r.name.toLowerCase())continue;if(s){(null==n?void 0:n.skipToTest)!=void 0&&r.name.toLowerCase().trim()===(null==n?void 0:n.skipToTest.toLowerCase().trim())&&(s=!1);continue}(null==r?void 0:r.options)&&(r.options.owner=null!=(D=null!=(L=null!=(S=null==(P=R[i].options)?void 0:P.owner)?S:null==e?void 0:e.owner)?L:o)?D:"");let l=yield T(r,null==n?void 0:n.test,a,DG.Test.isInBenchmark?null!=(C=null==(w=R[i].options)?void 0:w.benchmarkTimeout)?C:108e5:null==(k=R[i].options)?void 0:k.timeout,t.name,n.verbose);if((null==(O=r.options)?void 0:O.skipReason)||!window.gc||(yield window.gc()),l&&(E.push(u(c({},l),{widgetsDifference:M()-N})),n.returnOnFail&&n.skipToTest!==r.name&&!l.success&&!l.skipped))break}}return E})()}(p,v,f);let O=e.filter(e=>"skipped"!=e.result);if(k||(p.afterStatus=yield N(p.after,i)),p.afterStatus&&(y(`Package testing: Category after() {{${i}}} failed`),y(`Package testing: Result for {{${i}}} after: ${p.afterStatus}`),O.push({date:new Date().toISOString(),category:i,name:"after",success:!1,result:p.afterStatus,ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})),p.beforeStatus&&(y(`Package testing: Category before() {{${i}}} failed`),y(`Package testing: Result for {{${i}}} before: ${p.beforeStatus}`),O.push({date:new Date().toISOString(),category:i,name:"before",success:!1,result:p.beforeStatus,ms:0,skipped:!1,logs:"",owner:o,package:t.name,widgetsDifference:0,flaking:DG.Test.isReproducing})),s.push(...O),v.returnOnFail&&O.some(e=>!e.success&&!e.skipped&&e.name!==v.skipToTest))break}}catch(e){n=!0,i=e}finally{try{e||null==k.return||k.return()}finally{if(n)throw i}}}finally{console.log=y,console.info=f,console.warn=x,console.error=p}if(v.testContext.catchUnhandled&&!DG.Test.isInBenchmark){yield L(1e3);let e=yield grok.shell.lastError;if(void 0!=e){let n={logs:"",date:new Date().toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1,owner:null!=o?o:"",package:t.name,widgetsDifference:0};y(`Package testing: Unhandled Exception: ${e}`),s.push(u(c({},n),{flaking:DG.Test.isReproducing&&!e})),n.package=t.name,yield grok.shell.reportTest("package",n)}}})());var d=!0,g=!1,m=void 0;try{for(var b,v,w,k,P,R,E=s[Symbol.iterator]();!(d=(R=E.next()).done);d=!0){let e=R.value;e.result=e.result.toString().replace(/"/g,"'"),void 0!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"))}}catch(e){g=!0,m=e}finally{try{d||null==E.return||E.return()}finally{if(g)throw m}}return s;function N(e,t){return l(function*(){let n;try{void 0!==e&&(yield S(()=>l(function*(){yield e()})(),1e5,`before ${t}: timeout error`))}catch(e){n=yield D(e)}return n})()}function M(){if("u">typeof process)return 0;let e=-1;try{e=DG.Widget.getAll().length}catch(e){var t;console.warn(null!=(t=e.message)?t:e)}return e}})());return t.DataFrame.fromObjects(s)})()}function M(){return R(function*(){yield O(E,E.getModule("package-test.js"))})()}})(),hittriage_test=o})();
35
35
  //# sourceMappingURL=package-test.js.map