diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legend.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legend.js new file mode 100644 index 000000000000..11d36c8ad3d2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legend.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isArray = require( '@stdlib/assert/is-array' ); +var defaults = require( './../defaults.js' ); +var resolveValue = require( './resolve_value.js' ); +var resolveTextValue = require( './resolve_text_value.js' ); +var resolveSchemaValue = require( './resolve_schema_value.js' ); + + +// VARIABLES // + +var PROPS = [ + 'direction', + 'orient', + 'type' +]; +var ARRAY_PROPS = [ +]; +var SCHEMA_PROPS = [ +]; +var TEXT_PROPS = [ +]; + + +// MAIN // + +/** +* Synchronizes an legend editor configuration with a provided schema. +* +* @private +* @param {Object} conf - legend configuration object +* @param {Object} schema - legend schema +* @returns {Object} mutated configuration object +*/ +function config( conf, schema ) { + var def; + var i; + + def = defaults.legend; + + for ( i = 0; i < TEXT_PROPS.length; i++ ) { + resolveTextValue( schema, def, conf, TEXT_PROPS[ i ] ); + } + for ( i = 0; i < ARRAY_PROPS.length; i++ ) { + resolveValue( schema, def, conf, ARRAY_PROPS[ i ] ); + if ( isArray( conf[ ARRAY_PROPS[ i ] ] ) ) { + conf[ ARRAY_PROPS[ i ] ] = conf[ ARRAY_PROPS[ i ] ].join( ', ' ); + } + } + for ( i = 0; i < PROPS.length; i++ ) { + resolveValue( schema, def, conf, PROPS[ i ] ); + } + for ( i = 0; i < SCHEMA_PROPS.length; i++ ) { + resolveSchemaValue( schema, def, conf, SCHEMA_PROPS[ i ] ); + } + return conf; +} + + +// EXPORTS // + +module.exports = config; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legends.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legends.js new file mode 100644 index 000000000000..710f171084b6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/legends.js @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var legend = require( './legend.js' ); + + +// MAIN // + +/** +* Synchronizes a list of legend editor configurations with a provided schema. +* +* @private +* @param {Array} conf - list of legend configuration objects +* @param {Object} schema - visualization schema +* @returns {Array} mutated configuration objects +*/ +function config( conf, schema ) { + var list; + var M; + var N; + var i; + + list = schema.legends; + if ( !list ) { + return []; + } + M = list.length; + N = conf.length; + if ( N > M ) { + // WARNING: discarding extra configurations means that legend configuration objects become orphaned; thus, any editor controllers which still reference those objects will no longer sync with the greater editor configuration... + conf.length = M; + } else if ( N < M ) { + for ( i = N; i <= M; i++ ) { + conf.push( {} ); + } + } + for ( i = 0; i < M; i++ ) { + conf[ i ] = legend( conf[ i ], list[ i ] ); + } + return conf; +} + + +// EXPORTS // + +module.exports = config; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/sync.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/sync.js index 6c2f80fe9690..e85ffac2435c 100644 --- a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/sync.js +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/sync.js @@ -24,6 +24,7 @@ var general = require( './general.js' ); var padding = require( './padding.js' ); var title = require( './title.js' ); var axes = require( './axes.js' ); +var legends = require( './legends.js' ); // MAIN // @@ -41,8 +42,9 @@ function sync( conf, schema ) { padding( conf.padding, schema ); title( conf.title, schema ); axes( conf.axes, schema ); + legends( conf.legends, schema ); - // TODO: sync marks, legends, projections, scales, etc + // TODO: sync marks, projections, scales, etc return conf; } diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/index.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/index.js index 9b6a2358105c..f3da034eec20 100644 --- a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/index.js +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/index.js @@ -32,6 +32,7 @@ var createGeneral = require( './menus/general.js' ); var createPadding = require( './menus/padding.js' ); var createTitle = require( './menus/title.js' ); var createAxes = require( './menus/axes.js' ); +var createLegends = require( './menus/legends.js' ); var sync = require( './config/sync.js' ); var onChange = require( './on_change.js' ); var defaults = require( './defaults.js' ); @@ -155,6 +156,7 @@ setReadOnly( Editor.prototype, 'create', function create() { this._tree.padding = createPadding( editor, conf.padding ); this._tree.title = createTitle( editor, conf.title ); this._tree.axes = createAxes( editor, conf.axes, this._state.schema.raw ); + this._tree.legends = createLegends( editor, conf.legends, this._state.schema.raw ); editor.onFinishChange( onChange ); diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legend.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legend.js new file mode 100644 index 000000000000..9c8a4f8bcf10 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legend.js @@ -0,0 +1,88 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var objectKeys = require( '@stdlib/utils/keys' ); +var defaults = require( './../defaults.js' ); + + +// VARIABLES // + +var EMPTY_STRING = [ '' ]; + + +// MAIN // + +/** +* Adds an legend menu to a parent folder. +* +* @private +* @param {Editor} parent - parent folder instance +* @param {Object} conf - editor legend configuration +* @param {Object} schema - visualization schema +* @param {string} name - folder name +* @returns {(Object|null)} menu tree +*/ +function addMenu( parent, conf, schema, name ) { + var controllers; + var controller; + var folder; + var keys; + var def; + var d; + var i; + var k; + + keys = objectKeys( conf ); + if ( keys.length === 0 ) { + return null; + } + folder = parent.addFolder( name ); + folder.close(); + + def = defaults.legend; + + controllers = {}; + for ( i = 0; i < keys.length; i++ ) { + k = keys[ i ]; + d = def[ k ]; + if ( k === 'direction' ) { + controller = folder.add( conf, k, EMPTY_STRING.concat( d.values ) ); + } else if ( k === 'orient' ) { + controller = folder.add( conf, k, EMPTY_STRING.concat( d.values ) ); + } else if ( k === 'type' ) { + controller = folder.add( conf, k, EMPTY_STRING.concat( d.values ) ); + } else { + console.log( 'Unrecognized property in editor configuration. Key: %s.', k ); + continue; + } + controllers[ k ] = controller; + } + return { + 'folder': folder, + 'controllers': controllers + }; +} + + +// EXPORTS // + +module.exports = addMenu; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legends.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legends.js new file mode 100644 index 000000000000..999169887afd --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/legends.js @@ -0,0 +1,66 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var legend = require( './legend.js' ); + + +// MAIN // + +/** +* Adds an legends menu to an editor. +* +* @private +* @param {Editor} editor - editor instance +* @param {Array} conf - list of editor legend configurations +* @param {Object} schema - visualization schema +* @returns {(Object|null)} menu tree +*/ +function addMenu( editor, conf, schema ) { + var children; + var folder; + var o; + var i; + + if ( conf.length === 0 ) { + return null; + } + folder = editor.addFolder( 'Legends' ); + folder.close(); + + children = []; + for ( i = 0; i < conf.length; i++ ) { + o = legend( folder, conf[ i ], schema, format( 'Legend %d', i+1 ) ); + if ( o ) { + children.push( o ); + } + } + return { + 'folder': folder, + 'children': children + }; +} + + +// EXPORTS // + +module.exports = addMenu; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js index 6bc5bd664b3d..f04c5e850a94 100644 --- a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js @@ -98,6 +98,11 @@ function onChange( event ) { ns = [ 'axes', i.toString() ]; } } + for ( i = 0; i < conf.legends.length; i++ ) { + if ( obj === conf.legends[ i ] ) { + ns = [ 'legends', i.toString() ]; + } + } if ( ns === void 0 ) { ns = [ '' ]; } diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transform.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transform.js index d9c6bba1ff12..9a83c9701af0 100644 --- a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transform.js +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transform.js @@ -24,6 +24,7 @@ var isUndefined = require( '@stdlib/assert/is-undefined' ); var general = require( './transforms/general.js' ); var title = require( './transforms/title.js' ); var axes = require( './transforms/axes.js' ); +var legends = require( './transforms/legends.js' ); // MAIN // @@ -68,11 +69,13 @@ function transform( schema, defaults ) { if ( schema.axes && schema.axes.length ) { out.axes = axes( schema.axes, out.signals, defaults.axis ); } + if ( schema.legends && schema.legends.length ) { + out.legends = legends( schema.legends, out.signals, defaults.legend ); + } // FIXME: the following properties in order of priority out.scales = schema.scales; out.marks = schema.marks; - out.legends = schema.legends; out.projections = schema.projections; return out; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legend.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legend.js new file mode 100644 index 000000000000..3f019b398a00 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legend.js @@ -0,0 +1,101 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isSignalReference = require( '@stdlib/plot/vega/base/assert/is-signal-reference' ); +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var copyJSON = require( './../../utils/copy_json.js' ); +var signalName = require( './../../utils/signal_name.js' ); + + +// VARIABLES // + +var PROPS = [ + 'orient', + 'type' +]; + +// Define a list of properties which need to be made explicitly "undefined" when set to falsy values: +var SPECIAL_PROPS = [ + 'direction' +]; +var isSpecialProp = contains( SPECIAL_PROPS ); + + +// MAIN // + +/** +* Returns a transformed legend schema containing signals for use in conjunction with UI components. +* +* ## Notes +* +* - The function mutates the provided list of signals. +* +* @private +* @param {Object} schema - legend schema +* @param {Array} signals - list of signals +* @param {Object} defaults - legend schema defaults +* @param {string} prefix - signal prefix +* @returns {Object} transformed schema +*/ +function transform( schema, signals, defaults, prefix ) { + var value; + var name; + var out; + var k; + var v; + var i; + + out = copyJSON( schema ); + for ( i = 0; i < PROPS.length; i++ ) { + k = PROPS[ i ]; + v = schema[ k ]; + if ( !isSignalReference( v ) ) { + name = signalName( prefix+k ); + value = ( isUndefined( v ) ) ? defaults[ k ].default : v; + + if ( isSpecialProp( k ) ) { + if ( isUndefined( v ) || v === '' || v === false ) { + out[ k ] = void 0; + signals.push({ + 'name': name, + 'value': void 0 + }); + + // Skip further processing... + continue; + } + } + signals.push({ + 'name': name, + 'value': value + }); + out[ k ] = value; + } + } + return out; +} + + +// EXPORTS // + +module.exports = transform; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legends.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legends.js new file mode 100644 index 000000000000..dfcb51e69520 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/legends.js @@ -0,0 +1,62 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var copy = require( '@stdlib/array/base/copy' ); +var format = require( '@stdlib/string/format' ); +var legend = require( './legend.js' ); + + +// VARIABLES // + +var PREFIX = 'legends/'; + + +// MAIN // + +/** +* Returns a list of transformed legend schemas containing signals for use in conjunction with UI components. +* +* ## Notes +* +* - The function mutates the provided list of signals. +* +* @private +* @param {Array} schema - list of legend schemas +* @param {Array} signals - list of signals +* @param {Object} defaults - legend schema defaults +* @returns {Array} transformed schemas +*/ +function transform( schema, signals, defaults ) { + var out; + var i; + + out = copy( schema ); + for ( i = 0; i < out.length; i++ ) { + out[ i ] = legend( schema[ i ], signals, defaults, format( '%s%d/', PREFIX, i ) ); + } + return out; +} + + +// EXPORTS // + +module.exports = transform; diff --git a/lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/app/bundle.js b/lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/app/bundle.js index 9235e97ebc3b..4786792b0f11 100644 --- a/lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/app/bundle.js +++ b/lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/app/bundle.js @@ -19,4 +19,4 @@ /* eslint-disable */ /* editorconfig-checker-disable-file */ -!function(){var R="function"==typeof Object.defineProperty?Object.defineProperty:null;var C=function(){try{return R({},"x",{}),!0}catch(t){return!1}},M=Object.defineProperty;var U=function(t){return"number"==typeof t};function z(t){for(var e="",r=0;rn.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=N(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=ot(n.arg,n.width,n.padRight)),o+=n.arg||"",a+=1}return o},ft=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;var ct=function(t){for(var e,r,n,i=[],o=0,a=ft.exec(t);a;)(e=t.slice(o,ft.lastIndex-a[0].length)).length&&i.push(e),"%"===a[6]?i.push("%"):i.push((n=void 0,n={mapping:(r=a)[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]},"."===r[4]&&void 0===r[5]&&(n.precision="1"),n)),o=ft.lastIndex,a=ft.exec(t);return(e=t.slice(o)).length&&i.push(e),i};var pt=function(t){return"string"==typeof t};var h=function t(e){var r,n;if(!pt(e))throw new TypeError(t("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[ct(e)],n=1;n=r.length?(s=!!(c=d(o,l)))&&"get"in c&&!("originalValue"in c.get)?c.get:o[l]:(s=He(o,l),o[l]),s&&!a&&(Je[f]=o)}}return o},lr=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new p("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new p("`property` must be a string or a symbol`");if(3"function"==typeof(e=sr(t,!!e))&&-1{var r;return v(e)?t.stylize("undefined","undefined"):m(e)?(r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",t.stylize(r,"string")):g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0})(e,r);if(t)return t;var i,t=Object.keys(r),o=(i={},t.forEach(function(t,e){i[t]=!0}),i);if(e.showHidden&&(t=Object.getOwnPropertyNames(r)),E(r)&&(0<=t.indexOf("message")||0<=t.indexOf("description")))return c(r);if(0===t.length){if(_(r))return a=r.name?": "+r.name:"",e.stylize("[Function"+a+"]","special");if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return c(r)}var a="",u=!1,s=["{","}"];if(h(r)&&(u=!0,s=["[","]"]),_(r)&&(a=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(a=" "+RegExp.prototype.toString.call(r)),w(r)&&(a=" "+Date.prototype.toUTCString.call(r)),E(r)&&(a=" "+c(r)),0===t.length&&(!u||0==r.length))return s[0]+a+s[1];if(n<0)return b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r),l=u?((e,r,n,i,t)=>{for(var o=[],a=0,u=r.length;a{try{if(Object.assign){var t=new String("abc");if(t[5]="de","5"!==Object.getOwnPropertyNames(t)[0]){for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n,i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"===i.join(""))return n={},"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")?1:void 0}}}catch(t){}})()?Object.assign:function(t,e){for(var r,n=(t=>{if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)})(t),i=1;i{var r;return v(e)?t.stylize("undefined","undefined"):m(e)?(r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",t.stylize(r,"string")):g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0})(e,r);if(t)return t;var i,t=Object.keys(r),o=(i={},t.forEach(function(t,e){i[t]=!0}),i);if(e.showHidden&&(t=Object.getOwnPropertyNames(r)),E(r)&&(0<=t.indexOf("message")||0<=t.indexOf("description")))return c(r);if(0===t.length){if(_(r))return a=r.name?": "+r.name:"",e.stylize("[Function"+a+"]","special");if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return c(r)}var a="",u=!1,s=["{","}"];if(h(r)&&(u=!0,s=["[","]"]),_(r)&&(a=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(a=" "+RegExp.prototype.toString.call(r)),w(r)&&(a=" "+Date.prototype.toUTCString.call(r)),E(r)&&(a=" "+c(r)),0===t.length&&(!u||0==r.length))return s[0]+a+s[1];if(n<0)return b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r),l=u?((e,r,n,i,t)=>{for(var o=[],a=0,u=r.length;a{var e;try{t()}catch(t){e=t}return e})(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!e&&s(e,r,"Missing expected exception"+n);var i="string"==typeof n,o=!t&&e&&!r;if((!t&&S.isError(e)&&i&&l(e,r)||o)&&s(e,r,"Got unwanted exception"+n),t&&e&&r&&!l(e,r)||!t&&e)throw e}o.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=a(u((r=this).actual),128)+" "+r.operator+" "+a(u(r.expected),128),this.generatedMessage=!0);var e,r=t.stackStartFunction||s;Error.captureStackTrace?Error.captureStackTrace(this,r):(t=new Error).stack&&(t=t.stack,e=i(r),0<=(e=t.indexOf("\n"+e))&&(e=t.indexOf("\n",e+1),t=t.substring(e+1)),this.stack=t)},S.inherits(o.AssertionError,Error),o.fail=s,o.ok=t,o.equal=function(t,e,r){t!=e&&s(t,e,r,"==",o.equal)},o.notEqual=function(t,e,r){t==e&&s(t,e,r,"!=",o.notEqual)},o.deepEqual=function(t,e,r){v(t,e,!1)||s(t,e,r,"deepEqual",o.deepEqual)},o.deepStrictEqual=function(t,e,r){v(t,e,!0)||s(t,e,r,"deepStrictEqual",o.deepStrictEqual)},o.notDeepEqual=function(t,e,r){v(t,e,!1)&&s(t,e,r,"notDeepEqual",o.notDeepEqual)},o.notDeepStrictEqual=function t(e,r,n){v(e,r,!0)&&s(e,r,n,"notDeepStrictEqual",t)},o.strictEqual=function(t,e,r){t!==e&&s(t,e,r,"===",o.strictEqual)},o.notStrictEqual=function(t,e,r){t===e&&s(t,e,r,"!==",o.notStrictEqual)},o.throws=function(t,e,r){f(!0,t,e,r)},o.doesNotThrow=function(t,e,r){f(!1,t,e,r)},o.ifError=function(t){if(t)throw t},o.strict=$n(function t(e,r){e||s(e,!0,r,"==",t)},o,{equal:o.strictEqual,deepEqual:o.deepStrictEqual,notEqual:o.notStrictEqual,notDeepEqual:o.notDeepStrictEqual}),o.strict.strict=o.strict;var w=Object.keys||function(t){var e,r=[];for(e in t)n.call(t,e)&&r.push(e);return r}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),{}),Zn=(!function(s){!function(){function r(){return(new Date).getTime()}for(var e=Array.prototype.slice,n={},i=void 0!==s&&s.console?s.console:"undefined"!=typeof window&&window.console?window.console:{},t=[[function(){},"log"],[function(){i.log.apply(i,arguments)},"info"],[function(){i.log.apply(i,arguments)},"warn"],[function(){i.warn.apply(i,arguments)},"error"],[function(t){n[t]=r()},"time"],[function(t){var e=n[t];if(!e)throw new Error("No such label: "+t);delete n[t];e=r()-e;i.log(t+": "+e+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=k.format.apply(null,arguments),i.error(t.stack)},"trace"],[function(t){i.log(k.inspect(t)+"\n")},"dir"],[function(t){t||(t=e.call(arguments,1),Jn.ok(!1,k.format.apply(null,t)))},"assert"]],o=0;o